diff -Nru boinc-7.0.7+dfsg/api/boinc_api.cpp boinc-7.0.14+dfsg/api/boinc_api.cpp --- boinc-7.0.7+dfsg/api/boinc_api.cpp 2011-12-27 00:37:07.000000000 +0000 +++ boinc-7.0.14+dfsg/api/boinc_api.cpp 2012-01-13 19:00:16.000000000 +0000 @@ -150,6 +150,10 @@ bool g_sleep = false; // simulate unresponsive app by setting to true (debugging) static FUNC_PTR timer_callback = 0; +char web_graphics_url[256]; +bool send_web_graphics_url = false; +char remote_desktop_addr[256]; +bool send_remote_desktop_addr = false; #define TIMER_PERIOD 0.1 // period of worker-thread timer interrupts. @@ -819,7 +823,7 @@ } } #else - if (options.multi_process) { + if (options.multi_process && options.direct_process_action) { suspend_or_resume_descendants(0, false); } #endif @@ -1126,7 +1130,7 @@ fprintf(stderr, "%s 1 sec elapsed\n", boinc_msg_prefix(buf, sizeof(buf))); #endif - // here it we're at a one-second boundary; do slow stuff + // here if we're at a one-second boundary; do slow stuff // if (!ready_to_checkpoint) { @@ -1178,6 +1182,25 @@ if (timer_callback) { timer_callback(); } + + // send graphics-related messages + // + if (send_web_graphics_url && !app_client_shm->shm->graphics_reply.has_msg()) { + sprintf(buf, + "%s", + web_graphics_url + ); + app_client_shm->shm->graphics_reply.send_msg(buf); + send_web_graphics_url = false; + } + if (send_remote_desktop_addr && !app_client_shm->shm->graphics_reply.has_msg()) { + sprintf(buf, + "%s", + remote_desktop_addr + ); + app_client_shm->shm->graphics_reply.send_msg(buf); + send_remote_desktop_addr = false; + } } #ifdef _WIN32 @@ -1451,8 +1474,13 @@ } void boinc_web_graphics_url(char* url) { - char buf[256]; if (standalone) return; - sprintf(buf, "%s", url); - app_client_shm->shm->graphics_reply.send_msg(buf); + strcpy(web_graphics_url, url); + send_web_graphics_url = true; +} + +void boinc_remote_desktop_addr(char* addr) { + if (standalone) return; + strcpy(remote_desktop_addr, addr); + send_remote_desktop_addr = true; } diff -Nru boinc-7.0.7+dfsg/api/boinc_api.h boinc-7.0.14+dfsg/api/boinc_api.h --- boinc-7.0.7+dfsg/api/boinc_api.h 2011-12-27 00:37:07.000000000 +0000 +++ boinc-7.0.14+dfsg/api/boinc_api.h 2012-01-13 19:00:16.000000000 +0000 @@ -118,6 +118,7 @@ extern double boinc_worker_thread_cpu_time(); extern int boinc_init_parallel(); extern void boinc_web_graphics_url(char*); +extern void boinc_remote_desktop_addr(char*); #ifdef __APPLE__ extern int setMacPList(void); diff -Nru boinc-7.0.7+dfsg/api/boinc_opencl.cpp boinc-7.0.14+dfsg/api/boinc_opencl.cpp --- boinc-7.0.7+dfsg/api/boinc_opencl.cpp 2011-11-09 21:24:47.000000000 +0000 +++ boinc-7.0.14+dfsg/api/boinc_opencl.cpp 2012-01-20 13:30:47.000000000 +0000 @@ -94,6 +94,7 @@ int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform) { int retval; APP_INIT_DATA aid; + int opencl_device_index; retval = boinc_parse_init_data_file(); if (retval) return retval; @@ -104,13 +105,19 @@ return ERR_NOT_FOUND; } - if (aid.gpu_device_num < 0) { + opencl_device_index = aid.gpu_opencl_dev_index; + if (opencl_device_index < 0) { + // Older versions of init_data.xml don't have gpu_opencl_dev_index field + opencl_device_index = aid.gpu_device_num; + } + + if (opencl_device_index < 0) { fprintf(stderr, "GPU device # not found in %s\n", INIT_DATA_FILE); return ERR_NOT_FOUND; } retval = boinc_get_opencl_ids_aux( - aid.gpu_type, aid.gpu_device_num, device, platform + aid.gpu_type, opencl_device_index, device, platform ); return retval; diff -Nru boinc-7.0.7+dfsg/checkin_notes boinc-7.0.14+dfsg/checkin_notes --- boinc-7.0.7+dfsg/checkin_notes 2011-12-31 00:39:50.000000000 +0000 +++ boinc-7.0.14+dfsg/checkin_notes 2012-02-02 19:57:12.000000000 +0000 @@ -1,9044 +1,1292 @@ -David 1 Jan 2011 - - fix some bad file permissions - - delist defunct stats site +David 1 Jan 2012 + - remote job stuff - clientgui/ - DlgItemProperties.cpp,h - AsynRPC.cpp - html/inc/ - stats_sites.inc - samples/ - wrapper/ - wrapper.cpp - example_app/ - uc2.cpp - client/ - sim_control.cpp - -David 2 Jan 2011 - - unix build: remove hardwired -ldl - - lib/ - Makefile.am - -David 3 Jan 2011 - - client: show a given system notice at most once a week - - client/ - client_msgs.cpp - sim_control.cpp - cs_notice.cpp - -Charlie 4 Jan 2010 - - Mac: Fix symbol table generation. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 6 Jan 2011 - - user web: fix bugs in server status page - - fix some indentation - - html/user/ - server_status.php - client/ - *.cpp - -David 6 Jan 2011 - - simulator work - - fix some indentation - - various files - -David 11 Jan 2011 - - client: use std::deque instead of std::vector - for RR sim's pending-job lists. - Erasing head of vector is slow. - - lib: allow GPU peak FLOPS to be specified in XML (for simulator) - - simulator work - - client: old work fetch policy: projects may need enough jobs - for all device instances, not just resource_share*ninst. - E.g. a project that has only CPU jobs in a CPU/GPU client - - client: with REC scheduling, don't ask for work for - secondary resources if project has negative priority. - - client: in RR sim, make sure we saturate devices if possible. - Otherwise we may report a shortfall incorrectly - - client/ - coproc_detect.cpp - cpu_sched.cpp - rr_sim.cpp,h - sim.cpp - sim_control.php - sim_scenario.php (new) - work_fetch.cpp,h - lib/ - coproc.cpp,h - sched/ - sched_customize.cpp - sched_types.cpp - -David 11 Jan 2011 - - client: set PROJECT::last_upload_start when a job completes, - NOT when its first upload starts. - This prevents a scheduler RPC from happening between the two. - This was a bug in [22841] - - client/ - cs_apps.cpp - pers_file_xfer.cpp - -David 12 Jan 2011 - - client: tweak [22842] so that system clock changes - of < 60 seconds are ignored - - client/ - client_state.h - -Rom 12 Jan 2011 - - MGR: Embed the BOINC skin in the executable using XPM files. - - clientgui/res/skins/default/graphic/ - - clientgui/ - SkinManager.cpp - win_build/ - boincmgr.vcproj - -David 12 Jan 2011 - - single-job submission system: don't hardwire i686 architecture; - make it work on any Linux system. - From Steffen Moller. - - html/ops/ - single_job_setup.php - -Rom 13 Jan 2011 - - MGR: Disable the background repaint events for the SGUI Messages and - SGUI Preferences dialog. Changing the font color wasn't as easy as - I had hoped and the black background for the skin doesn't do any - good when the text itself is black as well. - - clientgui/ - sg_DlgMessages.cpp - sg_DlgPreferences.cpp - -David 13 Jan 2011 - - scheduler/client/API: pass user ID and team ID from scheduler to client, - and from client to app (host ID is already passed). - E@h asked for this, not sure why. - - client/ - client_types.cpp,h - app_start.cpp - lib/ - app_ipc.cpp,h - sched/ - sched_types.cpp - -Rom 13 Jan 2010 - - MGR: re-enable background painting and just change the default background - color for the new default skin to light gray. - - clientgui/ - sg_DlgMessages.cpp - sg_DlgPreferences.cpp - -Bernd 14 Jan 2011 - - unix build system: generate_svn_version - - generate version string from plain git repositories, too - - define SVN_REPOSITORY (URL) and SVN_REVISION (numerical) separately - so these could be used in proprocessor directives - - generate_svn_version.sh - -David 14 Jan 2011 - - make the Manager build on FC11 - - simulator work - - clientgui/ - Makefile.am - sched/ - edf_sim.cpp - client/ - sim.cpp - sim_control.php - -David 15 Jan 2011 - - client: fix job scheduling bug. - Scenario: we have 2 CPUs and 1GB RAM - Project A has jobs that use 1GB. - Project B has small-mem jobs. - Currently, we ignore RAM usage in building the runnable job list, - so we might pick 2 jobs from project A. - enforce_schedule() (which checks RAM usage) will run just one of them, - and the other CPU will be idle. - Solution: keep track of RAM usage while building the runnable job list. - client/ - cpu_sched.cpp - -David 15 Jan 2011 - - client: code cleanup in CPU scheduling; - eliminate global variable - - client/ - client_state.cpp,h - cpu_sched.cpp - sim.cpp - -Charlie 18 Jan 2011 - Mac: update release script to remove install of separate BOINC skin. - - mac_installer/ - release_boinc.sh - -David 18 Jan 2011 - - simulator work - - client/ - cpu_sched.cpp - work_fetch.h - sim.cpp - sim_control.cpp - client_types.cpp - -David 19 Jan 2011 - - client: eliminate unnecessary CPU reschedules. - Currently we do a reschedule any time a job checkpoints, - in case there's a job that has finished a time slice - but hasn't checkpointed yet. - Instead: flag such jobs, and trigger a reschedule - on checkpoint only for flagged jobs. - - client: fix instability in job scheduling that happens - if a job's estimated completion time in RR sim is close to its deadline. - It can alternate between making and missing deadline, - causing the scheduler to alternate rapidly between jobs. - Solution: if RR sim has marked a job as deadline miss - any time in the last (CPU scheduling period), - treat it as a deadline miss. - - client/ - app.cpp,h - rr_sim.cpp - app_control.cpp - cpu_sched.cpp - -David 19 Jan 2011 - - client: if we're using an acct mgr, - and we're attached to a project manually (not via acct mgr) - and the acct mgr tells us to detach from it, don't. - - client/ - acct_mgr.cpp - -David 19 Jan 2011 - - server: fix for EmBOINC - - sched/ - sched_util.cpp - -David 24 Jan 2011 - - server: disable upload certificates by default. - These increase server load and it's not clear they're needed. - - py/Boinc/ - setup_project.py - -Rom 25 Jan 2011 - - MGR: Fix advanced view button is Simple GUI. - (Button Text is Verdana 8pt. in MS Paint) - - clientgui/res/skins/default/graphic/ - advanced_link_image.xpm - clientgui/res/templates/skins/ - advanced_link_image.gif (Added) - btnAdvancedView.png (Removed) - -David 25 Jan 2011 - - client: accept and in cc_config.xml - - client: reset log flags (as well as options) when rereading cc_config.xml - - client/ - log_flags.cpp,h - -David 25 Jan 2011 - - web: tweaks so that BOINC-Wide Teams site can warn people if - their email address is not validated - - html/ - inc/ - user.inc - user/ - edit_email_action.php - -Charlie 27 Jan 2011 - Mac: update Mac_SA_Insecure.sh script to not require BOINC Client in - BOINC Data folder. - - mac_build/ - Mac_SA_Insecure.sh - -Charlie 27 Jan 2011 - - MGR: Add new Simple GUI. - - clientgui/ - AdvancedFrame.cpp, .h - BOINCGUIApp.cpp, .h - Events.h - sg_BoincSimpleFrame.cpp, .h (new) - sg_CustomControls.cpp, .h - sg_PanelBase.cpp, .h (new) - sg_ProjectCommandPopup.cpp, .h (new) - sg_ProjectPanel.cpp, .h (new) - sg_ProjectWebSitesPopup.cpp, .h (new) - sg_TaskCommandPopup.cpp, .h (new) - sg_TaskPanel.cpp, .h (new) - SkinManager.cpp - mac/ - MacBitmapComboBox.cpp, .h (new) - res/ - RedDot16.xpm (new) - YellowDot16.xpm (new) - GreenDot16.xpm (new) - mac_build/ - boinc.xcodeproj/ - project.pbxproj - win_build/ - boincmgr.vcproj - -David 27 Jan 2011 - - client: fix bug in setting GPU peak flops - - client/ - coproc_detect.cpp - lib/ - coproc.cpp,h - -Charlie 28 Jan 2011 - - MGR: Fix default skin selection display in Simple Preferences - dialog. - - MGR: Use standard native buttons in Simple Preferences and - Simple Notices dialogs. - - MGR: Use our control IDs instead of wxID_HELP for Help buttons - for Mac accessibility (wxID_HELP makes a bitmap button on - Macs which VoiceOver screen reader can't read.) - - MGR: Disable tooltips on Mac while new simple GUI menus are - popped up because they cover menus. - - clientgui/ - DlgAdvPreferences.cpp - DlgAdvPreferencesBase.cpp - sg_BoincSimpleFrame.cpp - sg_DlgMessages.cpp - sg_DlgPreferences.cpp - sg_ProjectCommandPopup.cpp - sg_ProjectWebSitesPopup.cpp - sg_TaskCommandPopup.cpp - wizardex.cpp - SkinManager.cpp - mac/ - MacBitmapComboBox.cpp, .h - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 28 Jan 2011 - - back end: allow the specification of a read-only DB replica - (in config.xml) to include DB name, user, and password. - - back end: add read-only replica info to SCHED_CONFIG, - so that C++ programs can use the replica - (currently only PHP code can use it) - - db_dump: use the read-only DB replica if it exists. - - html/inc/ - boinc_db.inc - db.inc - sched/ - sched_config.cpp,h - db_dump.cpp - -David 28 Jan 2011 - - new script sched/transitioner_catchup.php: transitions all WUs - that need it, then exits. - For big projects coming up after an outage, run this before bin/start - to minimize startup overload - - tweaks to PHP libraries to allow them to be used - by scripts anywhere in the dir hierarchy - - sched/ - transitioner_catchup.php - html/inc/ - boinc_db.inc - util_basics.inc - py/Boinc/ - setup_project.py - -Charlie 29 Jan 2011 - - MGR: Code cleanup. - - clientgui/ - sg_PanelBase.cpp, .h - sg_ProjectPanel.cpp, .h - sg_TaskPanel.cpp, .h - -Charlie 30 Jan 2011 - - MGR: New Simple GUI optimization. - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_PanelBase.cpp - sg_TaskPanel.cpp, .h - -Charlie 30 Jan 2011 - - MGR: Fix compile break on Linux. - - clientgui/ - sg_DlgPreferences.cpp - -Charlie 31 Jan 2011 - - MGR: Update Makefile. - - MGR: New Simple GUI optimization. - - clientgui/ - Makefile.am - sg_TaskPanel.cpp, .h - -Charlie 31 Jan 2011 - - Mac: Add info about dual-GPU Powerbooks to ReadMe files. - - mac_installer/ - GR-ReadMe.rtf - PTP-ReadMe.rtf - ReadMe.rtf - -David 1 Feb 2011 - - client: make "wrong URL" message not be a notice - - web: fix caching problem when PHP not installed as Apache module - - html/inc/ - cache.inc - client/ - cs_scheduler.cpp - -Charlie 1 Feb 2011 - - Mac: Localize items in Mac's BOINC menu. - - clientgui/ - AdvancedFrame.cpp - sg_BoincSimpleFrame.cpp - mac/ - MacGUI.pch - Mac_GUI.cpp - -Charlie 1 Feb 2011 - - MGR: Use branded short application name in Help tooltips instead - of always using "BOINC". - - Mac: Eliminate unused source files Localization.cpp, .h from Mac - project. - - clientgui/ - DlgEventLog.cpp - sg_BoincSimpleFrame.cpp - sg_DlgMessages.cpp - sg_DlgPreferences.cpp - sg_ProjectsComponent.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Rom 1 Feb 2011 - - WINSETUP: Avoid a 0xc0000135 error by giving the boinc_master and - boinc_project membership in the 'Users' group. Dynamic linking - to nvcuda.dll was failing because the project applications were - being denied access to DLLs in the system directory. - - win_build/installerv2/redist/Windows/src/boinccas/ - boinccas.rc - CACreateBOINCGroups.cpp - win_build/installerv2/redist/Windows/Win32/ - boinccas.dll - boinccas95.dll - win_build/installerv2/redist/Windows/x64/ - boinccas.dll - boinccas95.dll - -David 1 Feb 2011 - - create_work: add -d option - - tools/ - create_work.cpp - -Rom 3 Feb 2011 - - MGR: Enable the volunteer configurable 'shutdown core client' feature - on exit for Linux. It was orginally supposed to be enabled when - the balloon features were enabled, but got lost in ifdef hell. - (From "Lee") - - clientgui/ - DlgExitMessage.cpp - MainDocument.cpp - -David 3 Feb 2011 - - create_work: add some debugging printfs for Kamran - - tools/ - backend_lib.cpp - html/ - inc/ - forum.inc - profile.inc - user/ - weak_auth.php - -Charlie 3 Feb 2011 - - MGR: Eliminate unnecessary #ifdef. - - clientgui/ - BOINCGUIApp.cpp - -David 4 Feb 2011 - - client/manager: show venue in project properties - - clientgui/ - DlgItemProperties.cpp - client/ - client_types.cpp - lib/ - gui_rpc_client.h - gui_rpc_client_ops.cpp - -David 7 Feb 2011 - - manager: msg tweak - client/ - CompletionErrorPage.cpp - -David 7 Feb 2011 - - client: don't crash if omit cmdline port#. Fixes #1040 - - client/ - cs_cmdline.cpp - -Rom 8 Feb 2011 - - MGR: Fix a bug that is several years old, appears to have been - introduced during the Unicode conversion phase for Windows. Passing - a wide character string into an narrow character function causes - a NULL reference exception. - - TODO: There is still an issue if the manager attempts to write to - stderr when the BOINC Manager log files are redirected to a - directory the user doesn't have access to. - - clientgui/ - SkinManager.cpp - -David 8 Feb 2011 - - user web: add "delete account" feature. - This allows a user to delete all traces of themselves from a project. - Namely: - - clear fields of user record: email_addr, authenticator, - name, country, postal_code - Note: record is not deleted - - clear the domain_name and last_ip_addr fields of hosts - Note: records are not deleted - - quit team - - delete private messages sent and received - - delete forum posts, subscriptions, and forum prefs - - delete profile and associated images - - server: compile fix - - html/ - inc/ - pm.inc - host.inc - forum.inc - user.inc - util.inc - user/ - delete_account.php - stats.php - tools/ - backend_lib.cpp - -David 8 Feb 2011 - - create_work and possibly other back-end programs: - fix bug that corrupted WU command lines. - The problem: we were using strcpy(p, p+n) to delete the - first n characters of p. - This is incorrect - the behavior of strcpy() is undefined - if its args overlap. - On some systems (e.q. AQUA's server) it does wacky things. - - tools/ - backend_lib.cpp - lib/ - str_util.cpp,h - parse.cpp - -David 9 Feb 2011 - - user web: apparently if you put links of the form - http://setiathome.berkeley.edu/help.php?key=Viagra.uk - all over the web, Google will list "Viagra.uk" in your site outline (why??). - Preliminary checkin for dealing with this. - - html/ - inc/ - prefs.inc - util.inc - user/ - view_profile.php - account_finish.php - am_get_info.php - add_venue.php - -David 9 Feb 2011 - - user web: make all forum tables full-width - html/inc/ - forum.inc - -David 9 Feb 2011 - - user web: finish dealing with get args spam - - html/ - user/ - *.php - inc/ - pm.inc - prefs.inc - forum.inc - util.inc - -David 9 Feb 2011 - - user web: appearance tweaks - - html/ - inc/ - forum.inc - user/ - forum_help_desk.php - forum_index.php - white.css - -David 10 Feb 2011 - - user web: fix "nowrap" post display - - html/inc/ - forum.inc - -David 10 Feb 2011 - - user web: CSS cleanup. - Use classes instead of IDs. - white.css and black.css are cleaned up; style2.css needs work - - html/ - inc/ - pm.inc - forum.inc - user.inc - util.inc - user/ - pm.php - sample_index.php - forum_thread.php - main.css - forum_help_desk.php - friend.php - forum_forum.php - forum_index.php - style2.css - white.css - -David 10 Feb 2011 - - client: if a logical filename contains /'s, - create the needed dirs under the slot dir - - user web: pages with translatable text should not be cached. - Fix this for home page; there are some others - - client/ - app_start.cpp - html/user/ - sample_index.php - -David 11 Feb 2011 - - manager: project properties: if no venue, show "default" - - clientgui/ - DlgItemProperties.cpp - -David 11 Feb 2011 - - user web: style tweaks - html/user/ - forum_post.php - main.css - white.css - -David 11 Feb 2011 - - user web: disable "delete account" feature - - html/ - user/ - delete_account.php - inc/ - user.inc - -David 11 Feb 2011 - - user web: bug fixes - html/user/ - team_quit_action.php - team_manage.php - forum_moderate_post.php - -David 13 Feb 2011 - - user web: fix venue change - html/ - inc/ - prefs.inc - util.inc - user/ - host_venue_action.php - -David 13 Feb 2011 - - user web: bug fixes - - html/user/ - forum_moderate_thread.php - add_venue.phhp - -David 13 Feb 2011 - - user web: bug fix - - html/user/ - forum_reply.php - -David 13 Feb 2011 - - user web: bug fix - html/user/ - forum_banishment_vote_action.php - -David 14 Feb 2011 - - user web: bug fix - html/user/ - pm.php - -David 14 Feb 2011 - - user web: fix [img] BBcode problem - html/inc/ - text_transform.inc - -David 14 Feb 2011 - - user web: various fixes - html/ - inc/ - prefs.inc - user/ - main.css - prefs_remove.php - forum_reply.php - white.css - add_venue.php - forum_edit.php - -David 14 Feb 2011 - - user web: fixes - html/user/ - sample_index.php - main.css - -David 14 Feb 2011 - - client, linux: use X server for idle detection if available - - configure.ac - client/ - hostinfo_unix.cpp - -Charlie 15 Feb 2011 - Mac: Make backtrace compile properly with OS 10.5 and OS 10.6 SDKs. - - lib/ - mac/ - QBacktrace.c - QCrashReport.c - -Charlie 15 Feb 2011 - Mac Installer: Fix the code which deletes installer receipts to use - the current package name (which changed when I eliminated the - Mac installer wrapper application around the installer package.) - This is needed to allow installing an older version to replace a - newer one under OS 10.4.x. - - mac_installer/ - PostInstall.cpp - uninstall.cpp - -David 15 Feb 2011 - - transitioner: fix bug that could cause file deletion to not be done - for some WUs - - back end: fix the way "report grace period" is implemented - old: result.report_deadline (i.e. what's in the DB) and - the deadline sent to the client are the same. - Some confusing and incorrect logic in the transitioner - tries to provide the desired semantics. - new: result.report_deadline is the deadline sent to the client, - plus the grace period. - No logic in the transitioner is needed. - - db/ - boinc_db.cpp,h - sched - sched_config.cpp,h - sched_send.cpp - transitioner.cpp - sched_resend.cpp - -David 15 Feb 2011 - - file upload handler: if client-reported offset is less than file size, - don't just print an error message; - lseek() back to the offset point. - Otherwise we can end up with duplication in the file. - - sched/ - file_upload_handler.cpp - -David 15 Feb 2011 - - update_versions: if FILE.file_ref_info contains , - use that instead of physical name. - This lets you have logical names with slashes - - py/Boinc/ - tools.py - -Charlie 16 Feb 2011 - Mac: More thorough error checking and recovery in code which localizes - items in Mac's BOINC menu. - - mac/ - Mac_GUI.cpp - -David 16 Feb 2011 - - user web: fixes to private message functions - - html/user/ - pm.php - -David 16 Feb 2011 - - client: fix work-fetch bug. - The change in [21877] caused tasks in "download stalled" state - to be skipped in RR simulation, - and therefore to not be counted in the work buffer. - However, "download stalled" was not being evaluated correctly; - it was considering only per-file backoff, not project-wide backoff. - - client: another work-fetch bug: - don't fetch work from a project in project-wide download backoff. - - client/ - client_types.cpp - -David 16 Feb 2011 - - client: fix bug in mechanism that defers work request until - pending uploads are finished. - Due to a typo, this was not being done. - - client/ - cs_scheduler.cpp - -David 16 Feb 2011 - - client: when exclusive app mechanism is used (CPU or GPU) - wait for 30 secs after excl app exits - before restarting computation - - client/ - app.cpp,h - client_state.h - cs_prefs.cpp - -Charlie 17 Feb 2011 - Mac: Additional error checking and release created objects in code - which localizes items in Mac's BOINC menu. - - mac/ - Mac_GUI.cpp - -Charlie 17 Feb 2011 - - Mac installer: update branded build scripts to eliminate wrapper - application around install package (as was done for BOINC 6.12.7). - - clientgui/ - res/ - MacPTPPkgIcon.zip (new) - MacGRPkgIcon.zip (new) - mac_installer/ - make_GridRepublic.sh - make_ProgThruProc.sh - -David 17 Feb 2011 - - file upload handler: fix faulty bug fix of 2/15 - - client: make REC-based scheduling and hysteresis the defaults - - client/ - work_fetch.cpp - sched/ - file_upload_handler.cpp - -David 17 Feb 2011 - - client: when detach project, remove its RSS feeds from list - - client: remove once-per-week limit for client-generated notices; - need to show "network connection required" more often - - client: when remove "network conn required" notice - (because now have conn) - set the flag that says complete notice list is being sent - - client: if RSS feed fetch returns , - show the corresponding message rather than "XML parse error" - - client/ - client_state.cpp - cs_notice.cpp - gui_rpc_server_ops.cpp - http_curl.cpp - net_stats.cpp,h - -Rom 18 Feb 2011 - - client: Fast User Switching does not change the session protocol - to RDP when the active session is put into the background and - a new one is brought into the foreground. It appears it is safe - to use the connected state in addition to the protocol - to detect when the session is no longer capable of processing - GPU work - - lib/ - win_util.cpp - -Charlie 18 Feb 2011 - - Mac: Update link to NVIDIA CUDA Mac driver download page - - mac_installer/ - GR-ReadMe.rtf - PTP-ReadMe.rtf - ReadMe.rtf - -David 18 Feb 2011 - - client: more notice-related fixes. - I'm working on this case: - - start up - - disconnect (produces notice) - - reconnect (removes notice) - The client is now doing the right thing. - The manager is not. - - client/ - acct_setup.h - cs_notice.cpp,h - gui_rpc_server.h - gui_rpc_server_ops.cpp - -David 19 Feb 2011 - - wrapper: add optional element in elements; - specifies a directory to run app in. - macro-substitute project dir for $PROJECT_DIR. - From Carl Christensen, more or less - - samples/wrapper/ - wrapper.cpp - -David 19 Feb 2011 - - wrapper: add optional element in elements; - specifies an environment variable assignment; - macro-substitute project dir for $PROJECT_DIR. - From Carl Christensen - - samples/wrapper/ - wrapper.cpp - -David 19 Feb 2011 - - client: make "wait 30 sec after exclusive app exits" apply to network too - - client: fix bug in "wait 30 sec after exclusive app exits" logic - - client: fix compile warning and possible bug in is_remote_desktop() - - win: remove wrappture_example from solution - (until Hubzereo guys get their win lib working) - - client/ - app.cpp - cs_prefs.cpp - lib/ - win_util.cpp - samples/wrapper/ - wrapper.cpp - win_build/ - boinc.sln - -David 20 Feb 2011 - - wrapper: Windows fixes - - samples/wrapper/ - wrapper.cpp - -David 20 Feb 2011 - - client: fix disk-space accounting bug when user quotas in use - (Windows) - - lib/ - filesys.cpp - -Charlie 21 Feb 2011 - - client: fix compiler warning. - - client/ - cs_notice.cpp - -David 22 Feb 2011 - - client: add cpu_sched debug messages for anti-domino-effect - and anti-thrasing mechanisms - - wrapper: to kill an app, use SIGTERM instead of SIGKILL - client/ - acct_mgr.cpp - cpu_sched.cpp - samples/wrapper/ - wrapper.cpp - -David 22 Feb 2011 - - wrapper: improve and bullet-proof the way we kill apps. - Win: enumerate all descendants, and kill them all TerminateProcess(). - Unix: - send the main process a SIGTERM. - Check once a sec for existence of descendants. - if none, done - If any still exist after 10 sec, kill all descendants - - wrapper fix bug in Win env var stuff - - scheduler: check for VBox version 3.2+ in app_plan() - - sched/ - sched_customize.cpp - lib/ - procinfo.h - procinfo.cpp (new) - procinfo_win.cpp - procinfo_unix.cpp - Makefile.am - samples/wrapper/ - wrapper.cpp - -David 22 Feb 2011 - - client: send - at start of scheduler and account manager requests. - - client/ - cs_scheduler.cpp - acct_mgr.cpp - cpu_sched.cpp - -David 22 Feb 2011 - - client: don't send . - Daemons are started before regular tasks, - run concurrently with them, and are killed on exit. - - samples/wrapper/ - wrapper.cpp - -David 24 Feb 2011 - - client: remove auto update stuff from makefiles. - This feature is mothballed. - - client/ - client_state.cpp,h - scheduler_op.cpp,h - file_names.cpp - cs_scheduler.cpp - cs_statefile - Makefile.am - -David 24 Feb 2011 - - wrapper: fixes from Carl - - lib/ - procinfo_win.cpp - samples/wrapper/ - wrapper.cpp - -Charlie 24 Feb 2011 - - Mac: Remove auto_update.cpp, auto_update.h from XCode Project. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 25 Feb 2011 - - user web: - - in friend request notification, link to user page - - in user page, show ID - - remove "Account data for " in page title - - html/ - inc/ - user.inc - friend.in - user/ - show_user.php - -Rytis 26 Feb 2011 - - user web: add a config option to always show workunit details when using - adaptive replication. - - html/user/ - workunit.php - -David 26 Feb 2011 - - user web: fix wrong user ID - - html/inc/ - user.inc - -David 26 Feb 2011 - - back end: add two example trickle handlers: - trickle_credit: grants credit based on CPU time reported in msg - trickle_echo: echoes trickle-up as a trickle-down - - sched/ - trickle_handler.cpp, h (new) - sched_result.cpp - trickle_credit.cpp - credit.cpp,h - trickle_echo.cpp - validator.cpp - Makefile.am - -David 28 Feb 2011 - - user web: add a feature allowing project admins to control - whether news items are exported as notices. - The creator of a news item is shown a "Don't export" or "Export" - button on the thread page. - By default, news items are exported. - - db/ - schema.sql - html/ - inc/ - news.inc - user/ - forum_thread.php - notices.php - forum_thread_status.php - -David 28 Feb 2011 - - user web: bug fix to the last checkin - - boinccmd: fix --get_project_config operation - - html/user; - forum_thread_status.php - client/ - boinc_cmd.cpp - -David 2 Mar 2011 - - user web: show date/time on friend request page - - html/user/ - friend.php - -Rom 2 Mar 2011 - - MGR: Properly handle the case where the only notice in the manager - is the 'no notice' notice and then we transition to a single notice - from another source. - - clientgui/ - NoticeListCtrl.cpp, .h - -David 2 Mar 2011 - - manager: show notice create time rather than arrival time - - client: don't show "need network" notice if we don't need it - - clientgui/ - NoticeListCtrl.cpp - client/ - cs_notice.cpp - -David 2 Mar 2011 - - client: when get a bunch of notices from RSS feed, - sort them by create time before appending to notice list. - This ensures that, in the Notices tab, - notices are ordered decreasing create time within an RSS feed - (though not necessarily across feeds) - - client/ - cs_notice.cpp,h - -Rom 2 Mar 2011 - - MGR: Turn -boincargs into a string instead of an option. - - clientgui/ - BOINCGUIApp.cpp - -Rom 2 Mar 2011 - - MGR: Turn off the task pane for the notices tab. - - clientgui/ - ViewNotices.cpp - -Rom 2 Mar 2011 - - MGR: Disable our color scheme is a non-white background is selected - for the current theme. My commit on 3 Mar 2010 wasn't good enough - for High-Contrast themes. - - clientgui/ - BOINCBaseView.cpp - DlgEventLog.cpp - -David 2 Mar 2011 - - client: in deciding whether to remove the "need network" notice, - we were using the wrong (too high-level) interface - - client/ - cs_notice.cpp - -Charlie 3 Mar 2011 - - MGR: Remove the old SimpleGUI from the projects. The following - source files are no longer used; they have been removed from the - builds, but have not yet been deleted from the SVN repository: - sg_BoincSimpleGUI.cpp,.h, sg_ClientStateIndicator.cpp,.h, - sg_ImageButton.cpp,.h, sg_ImageLoader.cpp,.h, sg_ProgressBar.cpp,.h, - sg_ProjectsComponent.cpp,.h, sg_StatImageLoader.cpp,.h, - sg_ViewTabPage.cpp,.h - - clientgui/ - AdvancedFrame.cpp, .h - BOINCGUIApp.cpp, .h - Events.h - Makefile.am - sg_BoincSimpleFrame.cpp, .h - mac_build/ - boinc.xcodeproj/ - project.pbxproj - win_build/ - boincmgr.vcproj - -Rom 3 Mar 2011 - - MGR: Change the reminder frequency interval to hours and adjust the min/max - values to 0/24. Default value is now 6 hours between notification reminders. - - clientgui/ - BOINCBaseFrame.cpp - BOINCDialupManager.cpp - BOINCTaskBar.cpp - DlgOptions.cpp - -David 3 Mar 2011 - - client: fix inaccuracy in RR simulation reported by Bill Barber. - The problem arises when there are jobs of projects - with widely differing resource shares, - and results in an overestimation of saturated time. - - Old: at the start of simulation, call WORK_FETCH::compute_shares() - to get resources of runnable projects. - Use these throughout the simulation. - - Problem: suppose you have 2 runnable projects; - P1 has large RS, P2 has small RS. - P1's jobs finish quickly. - P2's jobs then are running alone, - but their FLOPS is scaled (incorrectly) by P2's small RS. - - Solution: recompute relative CPU resource share within the - simulation loop, - and compute it over the projects that have actives jobs - in the simulation. - client/ - rr_sim.cpp - client_types.h - -Charlie 3 Mar 2011 - - MGR: reduce duration of notifications on Mac from 15 to 5 seconds. - - clientgui/ - BOINCTaskBar.cpp - -David 3 Mar 2011 - - manager: fix copyright date in about box - - clientgui/ - DlgAbout.cpp - -David 4 Mar 2011 - - scheduler: if we're not sending jobs because of user prefs - (no CPU, no GPU, selected apps) - send a message, not a notice. - Assume the user knew what they were doing, - and doesn't want to be nagged. - - scheduler: check for the existence of an app version - before checking for user selected-app prefs. - This prevents sending "no jobs available for selected apps" - message when no app versions exist for non-selected apps - - scheduler: use "tasks" instead of "work" in user messages - - sched/ - sched_array.cpp - sched_send.cpp - -David 4 Mar 2011 - - client: fix spurious error when removing a notice RSS feed - - client/ - cs_notice.cpp - -David 6 Mar 2011 - - client: print smoothed as well as instantaneous WSS - - manager: make RPC reason strings translatable - - client/ - app.cpp - clientgui/ - ViewProjects.cpp - -Rom 7 Mar 2011 - - MGR: Refactor part of the Options dialog out of the Advanced Frame - code. - - MGR: Change the Reminder Frequency option in the Options dialog to - a combo box. - - TODO: Change the taskbar logic to handle the 'always' case. - - clientgui/ - AdvancedFrame.cpp - BOINCBaseFrame.cpp, .h - BOINCTaskBar.cpp - DlgOptions.cpp, .h - -Rom 7 Mar 2011 - - MGR: ComboBox's are zero index based. - - clientgui/ - DlgOptions.cpp, .h - -Rom 7 Mar 2011 - - MGR: Handle the 'always' option by only popping a new balloon if the - unread notice count differs from the last time we popped a - balloon. - - clientgui/ - BOINCTaskBar.cpp, .h - -Rom 7 Mar 2011 - - MGR: Don't attempt to set the project or account manager if the project - list control does not contain any items. This can cause a crash - if the all_projects_list.xml is empty. - - clientgui/ - AccountManagerInfoPage.cpp - ProjectInfoPage.cpp - -Charlie 7 Mar 2011 - - MGR: Fix compiler warning. - - clientgui/ - DlgOptions.cpp - -David 7 Mar 2011 - - client: fix to [23162] that broke work fetch - - client/ - work_fetch.cpp - -David 8 Mar 2011 - - client: don't put CDATA around account manager opaque data - in request msg - - client/ - acct_mgr.cpp - -Charlie 10 Mar 2011 - - MGR: Remove from Skin Manager items no longer used by SimpleGUI. - The following source files are no longer used; they have been - removed from the builds, but have not yet been deleted from the - SVN repository: - - clientgui/ - common/ - wxFlatNotebook.cpp,.h - wxFlatNotebookImages.h - wxFNBDropTarget.h - res/ - skins/ - default/ - graphic/ - spacer_image.xpm - state_indicator_background_image.xpm - connecting_indicator_image.xpm - error_indicator_image.xpm - workunit_active_image.xpm - workunit_suspended_image.xpm - workunit_tab_area_background_image.xpm - workunit_area_background_image.xpm - workunit_animation_background_image.xpm - workunit_gauge_background_image.xpm - workunit_gauge_progress_indicator_image.xpm - project_area_background_image.xpm - attach_project_button.xpm - attach_project_clicked_button.xpm - help_button.xpm - help_clicked_button.xpm - right_arrow_button.xpm - right_arrow_clicked_button.xpm - left_arrow_button.xpm - left_arrow_clicked_button.xpm - save_button.xpm - save_clicked_button.xpm - synchronize_button.xpm - synchronize_clicked_button.xpm - cancel_button.xpm - cancel_clicked_button.xpm - close_button.xpm - close_clicked_button.xpm - copy_all_button.xpm - copy_all_clicked_button.xpm - copy_button.xpm - copy_clicked_button.xpm - messages_link_image.xpm - messages_alert_link_image.xpm - suspend_link_image.xpm - resume_link_image.xpm - preferences_link_image.xpm - advanced_link_image.xpm - wizard_bitmap.xpm - - The following files have been modified: - - clientgui/ - BOINCGUIApp.cpp - SkinManager.cpp, .h - sg_DlgPreferences.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - win_build/ - boincmgr.vcproj - -Bernd 10 Mar 2011 - - unix build system: generate_svn_version - - extended support for git repos: - generate numeric version from last commit date, - record host, remote and branch names - - generate_svn_version.sh - -David 10 Mar 2011 - - client (Win): if available, use GetActiveProcessorCount() - rather than GetSystemInfo() to get the # of CPUs. - GetSystemInfo() returns the # of CPUs in the caller's - processor group, which is always <= 64 even on hosts - with > 64 CPUs - - client/ - hostinfo_win.cpp - -David 10 Mar 2011 - - manager: Add Project wizard: - if a project has old server software and - doesn't export platform list (e.g. Superlink) - don't show a confusing "this project may not support - your type of computer" message; - - clientgui/ - ProjectInfoPage.cpp - -Charlie 11 Mar 2011 - - MGR: Fill in initial URL on Account Manager Wizard Selection page. - - MGR: Add a new page to Attach Wizard to be displayed if the user - rejects the Terms of Use. - - lib: Make sorts of projects and account mangers case-insensitive. - - clientgui/ - AccountManagerInfoPage.cpp - Makefile.am - TermsOfUsePage.cpp - UserDisagreesPage.cpp, .h (new) - WizardAttach.cpp, .h - lib/ - gui_rpc_client_ops.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - win_build/ - boincmgr.vcproj - -Charlie 11 Mar 2011 - - MGR: Fix compiler warning. - - clientgui/ - sg_BoincSimpleFrame.cpp - -Rytis 12 Mar 2011 - - user web: implement Memcache as an option for caching (defaults to - in-file cache). Can be enabled by installing php5-memcached package - and defining MEMCACHE_SERVERS in project.inc - - html/ - inc/ - cache.inc - project.sample/ - project.inc - user/ - show_user.php - team_display.php - top_hosts.php - top_teams.php - top_users.php - view_profile.php - -David 12 Mar 2011 - - move client simulator PHP code to doc/sim - - doc/sim/ - various - -Rytis 13 Mar 2011 - - user web: change remaining occurrences of fullpage caching to object - cache. start_cache() and end_cache() are now deprecated. - - html/ - inc/ - cache.inc - team.inc - user/ - download_network.php - server_status.php - team_members.php - userw.php - -David 13 Mar 2011 - - validator: if --credit_from_wu is set, and no credit specified in WU, - assign zero credit and keep going - - client simulator work - - client/ - sim.cpp - makefile_sim - cs_notice.cpp - cpu_sched.cpp - sched/ - validator.cpp - -David 14 Mar 2011 - - API: get rid of BOINC_OPTIONS::backwards_compatible_graphics. - Not necessary. - - wrapper: add optional element to - task descriptor. - If set, pass the wrapper's cmdline args to that task. - NOTE: previously they were always passed. - If you want this behavior, you now must set this. - - samples/wrapper/ - wrapper.cpp - api/ - boinc_api.cpp,h - -Rom 14 Mar 2011 - - SCR: Follow the Mac's lead and gracefully exit the Data Management - thread. Preserve the handle to take more drastic actions should - that not work. - - clientscr/ - mac_saver_module.cpp, .h - screensaver.cpp - screensaver_win.cpp, .h - -David 14 Mar 2011 - - client simulator stuff - - html/user/ - forum_thread.php - client/ - cpu_sched.cpp - -David 14 Mar 2011 - - ops: update script that counts GPUs - - html/ops/ - nvidia.php - -Charlie 14 Mar 2011 - - SCR: Fix compile breaks. - - clientscr/ - mac_saver_module.cpp - -David 15 Mar 2011 - - client simulator stuff - client/ - sim_cpp,h - -David 16 Mar 2011 - - wrapper: improved subprocess cleanup, Unix - - samples/wrapper/ - wrapper.cpp - client/ - sim.cpp - -Bernd 18 Mar 2011 - Einstein@home extensions: - - protect malloc.h - - validator: allow to update 'random' result field - - assimilator: add global variables results_prefix and transcripts_prefix, - set on command-line - - sched/ - assimilator.cpp - assimilate_handler.h - hr_info.cpp - db/ - boinc_db.cpp - -Bernd 18 Mar 2011 - - (locality) scheduler: - omit confusing message & backoff in mixed scheduling - - sched/ - sched_locality.cpp - -David 20 Mar 2011 - - client and API: pass "network suspended" flag from client to app; - make it available as part of BOINC_STATUS - - api/ - boinc_api.cpp,h - html/inc/ - uotd.inc - client/ - app_control.cpp - -David 21 Mar 2011 - - wrapper: macro-substitute $NTHREADS with the --nthreads option value - in job.xml - - samples/wrapper/ - wrapper.cpp - -Rom 22 Mar 2011 - - VBox: Checkpoint for Windows - * Creates/registers virtual machine - * Starts/Stops virtual machine - * Suspends/Resumes virtual machine - * Deletes/deregisters virtual machine - - TODO: - * Fraction done properly - * Standard error streams from virtualized applications - * Find a way to hide the VBoxHeadless application window (It can be minimized manually) - - samples/vboxwrapper/ - vbox.cpp, .h - vbox_win.cpp - vboxwrapper.cpp - vm.cpp, .h - -Charlie 23 Mar 2011 - - client: Define MAXPATHLEN if not defined for compatibility with HURD. - - client/ - hostinfo_unix.cpp - -David 24 Mar 2011 - - define MAXPATHLEN, if needed, in filesys.h - - fix typo in a GUI RPC handler - - lib/ - filesys.h - api/ - mac_icon.cpp - graphics2_unix.cpp - client/ - switcher.cpp - gui_rpc_server_ops.cpp - check_security.cpp - hostinfo_unix.cpp - -Charlie 24 Mar 2011 - - client: Begin adding OpenCL support. - - client/ - coproc_detect.cpp - lib/ - cl.h (added) - cl_platform.h (added) - coproc.h - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 24 Mar 2011 - - client: generalize the GPU framework so that - - new GPU types can be added easily - - users can specify GPUs in cc_config.xml, - referred to by app_info.xml, - and they will be scheduled by BOINC - and passed --device N options - Note: the parsing of cc_config.xml is not done yet. - - RPC protocols (account manager and scheduler) - can now specify GPU types in separate elements - rather than embedding them in tag names - e.g. NVIDIA rather than - - client: in account manager replies, parse elements of the form - NAME - indicating the GPUs of type NAME should not be used. - This allows account managers to control GPU types - not hardwired into the client. - Note: and will continue to be supported. - - scheduler RPC reply: add - NAME - (NAME = GPU name) - to indicate that the project has no jobs for the indicated GPU type. - etc. are still supported - - client/lib: remove set_debts() GUI RPC - - client/scheduler RPC - remove etc. (superceded by no_app) - Exception: elements in sched request - still have and . - Fix this later. - - Implementation notes: - - client/lib: change "CUDA" to "NVIDIA" in type/variable names, and in XML - Continue to recognize "CUDA" for compatibility - - host_info.coprocs no longer used within the client; - use a global var (COPROCS coprocs) instead. - COPROCS now has an array of COPROCs; - GPUs types are identified by the array index. - Index zero means CPU. - - a bunch of other resource-specific structs (like RSC_WORK_FETCH) - are now stored in arrays, with same indices as COPROCS - (i.e. index 0 is CPU) - - COPROCS still has COPROC_NVIDIA and COPROC_ATI structs to hold vendor-specific info - - APP_VERSION now has a struct GPU_USAGE to describe its GPU usage - - client/ - acct_mgr.cpp,h - app_start.cpp - client_state.cpp,h - client_types.cpp,h - coproc_detect.cpp - cpu_sched.cpp - cs_account.cpp - cs_prefs.cpp - cs_scheduler.cpp - cs_statefile.cpp - gui_rpc_server_ops.cpp - rr_sim.cpp - scheduler_op.cpp.h - work_fetch.cpp,h - lib/ - coproc.h - hostinfo.cpp,h - win_build/ - boinc_cli.vcproj - -Charlie 25 Mar 2011 - - client: Temporarily work around compile breaks introduced by the changes - to generalize the GPU framework. - NOTE to David: please look for "//TODO: David, please fix" in these - files and fix as appropriate. - - client/ - app_start.cpp - boinc_cmd.cpp - -David 25 Mar 2011 - - manager: fix crashing bug when notices (or other text parsed by XML_PARSER) - contain non-ASCII characters. - Rom: please port to 6.12 - - lib/ - parse.cpp - -David 25 Mar 2011 - - client: Unix compile fixes - - client/ - app_start.cpp - boinc_cmd.cpp - -Charlie 25 Mar 2011 - - client: Continue adding OpenCL support. - - lib: Fix inconsistent line endings in coproc.cpp. - - client/ - coproc_detect.cpp - lib/ - coproc.cpp, .h - -David 25 Mar 2011 - - manager: fix the above to detect premature EOF correctly - - lib/ - parse.cpp - -David 25 Mar 2011 - - scheduler: compile fixes - - sched/ - sched_customize.cpp - sched_version.cpp - sched_send.cpp - handle_request.cpp - sched_types.cpp - -David 25 Mar 2011 - - API: compile fixes for MinGW. Fixes #955. from Matt Arsenault - - lib/ - stackwalker_imports.h - boinc_win.h - Makefile.mingw - api/ - Makefile.mingw - -David 27 Mar 2011 - - client: Win OpenCL fix from [P3D] Crashtest - - client/ - coproc_detect.cpp - -Rom 28 Mar 2011 - - MGR: Handle the link click events from the notices control for the - Simgle GUI notices dialog box. - - clientgui/ - sg_DlgMessages.cpp, .h - -Rom 28 Mar 2011 - - API: Flush buffers before terminating. - - SCR: Flush buffers before terminating. - - api/ - boinc_api.cpp - clientscr/ - screensaver_win.cpp - -Charlie 29 Mar 2011 - - MGR: Fix compile break. - - clientgui/ - sg_DlgMessages.h - -Charlie 29 Mar 2011 - - client: Continue adding OpenCL support. - - client/ - coproc_detect.cpp - lib/ - coproc.cpp, .h - -Rom 29 Mar 2011 - - client: prevent client from crashing in OpenCL code - - client: fix function prototypes for dynamically calling - OpenCL functions. - - client/ - coproc_detect.cpp - -Rom 29 Mar 2011 - - MGR: Remove UserDisagreesPage from the wizard, replace functionality - by enabling/disabling the next button as needed. - - MGR: Fix a couple of warnings. - - clientgui/ - sg_CustomControls.cpp - sg_DlgMessages.cpp - TermsOfUsePage.cpp - UserDisagreesPage.cpp, .h (Deleted) - WizardAttach.cpp, .h - -Rom 29 Mar 2011 - - WINSCR: So after looking over all the logs from WCG and now from Jacob - Klein a pattern started to emerge. At the end of the log files the last - message logged was 0x12 which translates into WM_QUIT. The latest - documentation on WM_QUIT states it should never show up in the message - loop to begin with. - - The docs now say that WM_QUIT should not be sent to the message loop by - way of PostMessage. We have been doing things this way for over 5 years. - - Change the shutdown logic so that only the primary curtain window can call - PostQuitMessage() and all other curtain windows just exit when they receive - a WM_DESTROY message. - - I'm not sure what causes this to be a problem on some machines and not - others. But preliminary results from Jacob are encouraging. - - clientscr/ - screensaver_win.cpp, .h - -Charlie 30 Mar 2011 - - Mac: Eliminate unused source files UserDisagreesPage.cpp, .h from Mac - project. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Rom 30 Mar 2011 - - client: OpenCL Profile Version wasn't being used anywhere and trying to get it - was causing a crash on Windows. Remove for now. - - client: Fix ATI OpenCL detection so that the coproc test messages will appear. - - client/ - coproc_detect.cpp - lib/ - coproc.h - -Rom 30 Mar 2011 - - client: Beef up the trace logging when attempting to match OpenCL devices to their - native counterparts. - - client/ - coproc_detect.cpp - -Charlie 30 Mar 2011 - - client: Continue adding OpenCL support. - We must check all OpenCL platforms; apparently ATI's platform reports only - ATI / AMD GPUs, and NVIDIA's platform reports only NVIDIA GPUs. - The NVIDIA vendor may be reported as "NVIDIA" or"NVIDIA Corporation" - Note: The client currently always says "No usable GPUs found" because - David has not yet completed implementing the changes begun on 24 Mar. - - client/ - coproc_detect.cpp - lib/ - coproc.h - -Rom 31 Mar 2011 - - lib: Bring header and implementation files into sync over the coproc parsing - function. - - lib/ - coproc.cpp, .h - -Rom 31 Mar 2011 - - lib: Fix build break for Linux. - - lib/ - procinfo.cpp - -Charlie 31 Mar 2011 - - Fix Win build breaks caused by renaming of directory coprocs/cuda/ - to coprocs/NVIDIA/. - - Eliminate redundant cl.h and clpatform.h in lib/ directory because - Rom has added them to new coprocs/OpenCL/include/ directory. - NOTE: It is risky to have multiple copies of the same file in the same - source tree, as they can easily get out of sync. - - Makefile.incl - lib/ - coproc.h - cl.h (deleted) - cl_platform.h (deleted) - mac_build/ - boinc.xcodeproj/ - project.pbxproj - win_build/ - boinc_cli.vcproj - boinc_os_ss.vcproj - boinc_ss.vcproj - boinccmd.vcproj - boinclog.vcproj - boincmgr.vcproj - example_app_multi_thread.vcproj - libboinc.vcproj - libboinc_staticcrt.vcproj - libboincapi_staticcrt.vcproj - libgraphics2.vcproj - sleeper.vcproj - uc2.vcproj - uc2_graphics.vcproj - vboxwrapper.vcproj - wrapper.vcproj - wrappture_example.vcproj - -Charlie 31 Mar 2011 - - client: Add debug logging to show GPU detection when OpenCL is installed - but CAL and / or CUDA is not. (I have verified this works for NVIDIA - GPUs on Mac OS 10.6 without CUDA support installed.) - - client/ - coproc_detect.cpp - -David 1 Apr 2011 - - server/client: make a stripped-down OpenCL header file, lib/cl_boinc.h, - for the things that BOINC actually needs - (fixes server compile problems) - - client: fix various compile errors in coproc_detect.cpp - - lib/ - coproc.h - cl_boinc.h - Makefile.am - client/ - coproc_detect.cpp - -David 1 Apr 2011 - - scheduler: removed unused destructors in COPROC that - caused scheduler to crash (not sure why) - - sched/ - sched_types.cpp,h - lib/ - coproc.h - procinfo.h - -Charlie 1 Apr 2011 - - Mac: Revise Mac project for deleted coprocs/OpenCL/include/ directory and - new cl_boinc.h. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 1 Apr 2011 - - lib: fix compile warnings by removing virtual functions in COPROC - - lib/ - coproc.h - -David 4 Apr 2011 - - scheduler: don't send unboundedly many assigned jobs - - Makefile: don't include unnecessary files - - sched/ - sched_assign.cpp - Makefile.incl - -David 4 Apr 2011 - - client: discard messages whose create time OR arrival time - is more than 30 days ago - - client/ - cs_notices.cpp - -David 4 Apr 2011 - - client: use larger buffer for app command line, - enough to accommodate 64KB from wu.cmdline - - client/ - app_start.cpp - -David 4 Apr 2011 - - scheduler: and - are per-processor, not per-host. - - sched/ - sched_config.cpp - sched_limit.h - -David 6 Apr 2011 - - manager: change simple view notices window title from Messages to Notices - - clientgui/ - sg_DlgMessages.cpp - -David 6 Apr 2011 - - user web: fix numeric field sanitization in prefs. Fixes #1087. - - client: if PREFS::max_ncpus_pct is 0, don't set it to 100; - doing so prevents PREFS::max_ncpus from having any effect. - - html/inc/ - prefs_util.inc - lib/ - prefs.cpp - -David 8 Apr 2011 - - client: defer reporting completed tasks if an upload started recently; - we might be able to report more tasks once the upload completes. - - client/ - cs_scheduler.cpp - -David 8 Apr 2011 - - "upgrade" script: copy sched/fcgi if it exists - - py/Boinc/ - setup_project.py - -David 8 Apr 2011 - - "upgrade" script: remove --project_root option, - and allow full path of project root dir - instead of the short name - - tools/ - upgrade - -David 10 Apr 2011 - - user web: fix "delete profile" function - - html/ - user/ - delete_profile.php - inc/ - profile.inc - -David 10 Apr 2011 - - scheduler: failure to set up COPROCS structure correctly - led to per-GPU job limits not being enforced. - - lib/ - coproc.cpp - -David 10 Apr 2011 - - user web: use special icon for hidden threads (from Jord) - - html/ - inc/ - forum.inc - user/ - forum_forum.php - img/ - hidden.png - -Rom 11 Apr 2011 - - MGR: Remove unneeded asserts. - - clientgui/ - BOINCTaskBar.cpp - -Rom 13 Apr 2011 - - MGR: Add missing keyboard accelerators for the event log. - - MGR: Re-enable the next button when the terms of use wizard - page when the back button is pressed. - - clientgui/ - DlgEventLog.cpp - TermsOfUsePage.cpp - -David 13 Apr 2011 - - admin web: remove options to delete apps and app versions. - This is almost always a bad idea. - - html/ops/ - manage_apps.php - manage_app_versions.php - -David 13 Apr 2011 - - client: - - add log flag - - show trickle-up and int file upload msgs if set - - if scheduler RPC reason is trickle-up, say so - - manager: - - restore "non CPU intensive" to task description - - project properties: show if RPC in progress or trickle-up pending. - (show these low-probability things only if present) - - manager: fix Unix build - - (from Ian Hay) - - clientgui/ - MainDocument.cpp - Makefile.am - DlgITemProperties.cpp - lib/ - gui_rpc_client_print.cpp - client/ - log_flags.cpp,h - scheduler_op.cpp - app.cpp - app_control.cpp - -Rom 14 Apr 2011 - - MGR: Check to see if keyboard accelerators can be redefined on the fly. - - clientgui/ - DlgEventLog.cpp - -Rom 14 Apr 2011 - - MGR: Add missing event handler map item. - - clientgui/ - sg_DlgMessages.cpp - -David 14 Apr 2011 - - API: add support for multi-process apps, - i.e. those that create subprocesses. - Previously, the client's job control options (suspend/resume/quit) - would not work for subprocesses. - Multiprocess apps must initialize with something like: - BOINC_OPTIONS options; - boinc_options_defaults(options); - options.multi_process = true; - boinc_init_options(&options); - Note: an application can be both multi-thread and multi-process. - In this case set options.multi_thread as well. - - wrapper: add support for multi-process apps. - Previously, suspend/resume operations did not work for subprocesses. - If a task is multi-process, you must include - 1 - in its descriptor. - - lib/ - procinfo.cpp,h - samples/wrapper/ - wrapper.cpp - api/ - boinc_api.cpp,h - -David 15 Apr 2011 - - client: fix bug that cause notice RSS feeds to disappear and reappear, - and notices to erroneously be shown as new. - - client/ - cs_notice.cpp - -David 18 Apr 2011 - - client: when estimating job runtime based on fraction done, - use the elapsed time when fraction done was last reported, - not current elapsed time. - Fix problem where est time remaining increases linearly, - then abruptly decreases when new frac done is reported. - From Bruce Allen. - - client/ - app.h - app_control.cpp - work_fetch.cpp - -David 18 Apr 2011 - - client: fix a couple of the messages that are appended to - a job's stderr when the job is aborted - - client/ - client_state.cpp - app_start.cpp - -David 18 Apr 2011 - - user web and notices: fix message describing friend request - - html/inc/ - friend.inc - -David 18 Apr 2011 - - client: replace % with %% in messages from scheduler - (else they're interpreted as format strings) - - client/ - client_state.h - cs_scheduler.cpp - -David 18 Apr 2011 - - client: fix message describing work request - - client/ - scheduler_op.cpp - -Rom 19 Apr 2011 - - MGR: Adjust the width of the various tabs in advanced view if the notice text - width changes. - - MGR: Remove dead code. - - clientgui/ - BOINCBaseFrame.cpp, .h - AdvancedFrame.cpp - -David 19 Apr 2011 - - scheduler: don't send translatable messages to pre-6.12 clients - - sched/ - sched_types.cpp - -David 19 Apr 2011 - - admin web: allow specifying an SVN config dir in the web config file, - in case your svn requires a proxy or something. - From Boris Dayma. - - html/ - ops/ - index.php - project.sample/ - project.inc - -David 20 Apr 2011 - - web: show "logged in as" info on every page; - remove funky "log out" link from user page - - web: go to home page on logout, - not dorky "you are logged out" page - - html/ - inc/ - user.inc - util.inc - user/ - sample_index.php - logout.php - project.sample/ - project.inc - -David 20 Apr 2011 - - web: don't show "log in" link on login or create account pages - - html/ - inc/ - util.inc - user/ - login_form.php - -David 20 Apr 2011 - - client: if an app version has a missing GPU, - we still need to keep track of the usage - and write it to the state file. - - get client simulator working again - - client/ - client_types.cpp,h - sim.cpp - tools/ - backend_lib.cpp - -Charlie 21 Apr 2011 - - Mac: Update XCode Project to link procinfo.cpp and procinfo_mac.cpp into - boinscr (ss_app) because boinc_api.cpp now calls kill_descendants() and - suspend_or_resume_descendants(). - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 21 Apr 2011 - - create_work and other tools: verify that the current dir, - parent dir, or BOINC_PROJECT_DIR actually is a project dir. - - client simulator: improvements - - sched/ - sched_config.cpp - tools/ - create_work.cpp - lib/ - coproc.cpp - client/ - client_state.cpp,h - sim.cpp - work_fetch.cpp - cs_statefile.cpp - -Charlie 22 Apr 2011 - - Mac: We no longer request PowerPC applications on Intel Macs - because all projects supporting Macs should have Intel - applications by now, and PowerPC emulation ("Rosetta") is - not always supported in newer versions of OS X. - - client/ - cs_platforms.cpp - -David 23 Apr 2011 - - client: don't use the Snooze mechanism to handle - OS-requested suspension - (especially with a 1-hour snooze period). - Instead, handle them directly. - - client/ - client_state.cpp,h - cs_prefs.cpp - main.cpp - sysmon_win.cpp - clientgui/ - MainDocument.cpp - lib/ - common_defs.cpp - str_util.cpp - sched/ - get_file.cpp - send_file.cpp - -David 23 Apr 2011 - - server: rename send_file to put_file. - Factor out put_file() and get_file() functions - so they have a C++ API as well as command-line - - sched/ - put_file.cpp - get_file.cpp - Makefile.am - tools/ - backend_lib.cpp,h - lib/ - common_defs.h - -Charlie 24 Apr 2011 - - client: fix bug: statement had no effect. - - lib/ - str_util.cpp - -David 24 Apr 2011 - - account manager RPC: include TIME_STATS and NET_STATS in request message - - client/ - acct_mgr.cpp - -David 24 Apr 2011 - - client: show error messages from account managers correctly - - client/manager: if a job is missing a GPU, show details - - client: win compile fix - - client/ - acct_mgr.cpp - client_msgs.cpp,h - client_types.cpp - sysmon_win.cpp - -David 24 Apr 2011 - - client: simplify the semantics of sticky files: - - All sticky files are reported on each scheduler RPC - - If a scheduler reply says to delete a file, clear its sticky flag - In particular: - - remove the "send file list" tag in scheduler RPC replies - - remove FILE_INFO::marked_for_delete - - remove FILE_INFO::report_on_rpc - - remove the request_file_list program - - client/ - client_types.cpp,h - client_state.cpp - cs_scheduler.cpp - scheduler_op.cpp - sched/ - request_file_list.cpp - Makefile.am - -David 24 Apr 2011 - - client: shuffle code to move CONFIG and LOG_FLAGS - into lib/cc_config.h, - in preparation for adding GUI RPCS - - client/ - main.cpp - log_flags.cpp,h - lib/ - Makefile.am - cc_config.cpp,h (new) - -Charlie 24 Apr 2011 - - Mac: Add new cc_config.cpp,h to XCode Project. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Rom 25 Apr 2011 - - SCR: In certain cases WM_QUIT is sent to the message proc, which is - is causing some type of deadlock and we don't break out of the message - pump like we are suppose too. For debug purposes, let us call DebugBreak() - and see what the other threads are up too. - - clientscr/ - screensaver_win.cpp - -David 25 Apr 2011 - - validator: fix bug when check_pair() returns retry=true, - reported by Travis Desell. - - sched/ - validator.cpp - -David 26 Apr 2011 - - client: fix bugs in runtime estimation of jobs that - have run before but are not currently running. - Old: - - We maintain the most recent fraction_done in state file. - But for apps that checkpoint seldom or never, - this is not the relevant value, - and frac done may go down when the app runs. - - fraction_done_elapsed_time is not initialized, - and can have garbage values for jobs that haven't run yet. - New: - - Record, in the state file, the values of - fraction_done and fraction_done_elapsed_time - at the most recent checkpoint. - When the client starts up, use these values. - - client/ - app.cpp,h - app_control.cpp - -David 26 Apr 2011 - - web: fix infinite recursion when project is down - - html/inc/ - util.inc - -Rom 26 Apr 2011 - - VBOX: Begin merging the two different vbox wrappers (COM vs. Daniel's from - CERN). Where possible stick with the POSIX API set and remove Windows - specific code. (Example vbm_popen). - - NOTE: Not usable at the moment. - - samples/vboxwrapper/cernvm - cernvmwrapper.cpp - samples/vboxwrapper/ - vbox.cpp, .h - vboxwrapper.cpp - samples/vboxwrapper/ - vm.cpp, .h - win_build/ - vboxwrapper.vcproj - -David 26 Apr 2011 - - web: eliminate double calls to page_head() - - html/inc/ - util.inc - -David 26 Apr 2011 - - web: fix bug that cause "use signature" preference to be ignored - - html/user/ - forum_reply.php - -David 26 Apr 2011 - - client: fix bug in [23431] - - client/ - client_types.cpp - -Charlie 27 Apr 2011 - - lib, MGR: Implement get_cc_config, set_cc_config RPCs. - - client/ - log_flags.cpp - clientgui/ - AsyncRPC.cpp,.h - lib/ - cc_config.cpp,.h - gui_rpc_client.h - gui_rpc_client_ops.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - win_build/ - boinc_os_ss.vcproj - boinc_ss.vcproj - boincmgr.vcproj - -Charlie 28 Apr 2011 - - MGR: Begin adding Exclusive Apps pane to Computing Prefs dialog. - - MGR: Implement Manage Settings menu item in Simple GUI. - - clientgui/ - DlgAdvPreferences.cpp - DlgAdvPreferencesBase.cpp,.h - sg_BoincSimpleFrame - -David 28 Apr 2011 - - client: fix bug that prevented work fetch in some cases - - client/ - client_state.cpp - main.cpp - work_fetch.cpp - lib/ - coproc.h - hostinfo.cpp - -David 28 Apr 2011 - - client: change the handling of account manager replies: - Old: - If the AM sends us a project we're already attached to, - and the authenticator is different, - print an error message and don't change anything. - Problem: - If the AM is using weak authenticators, - and the user has changed their password, - the weak authenticator changes. - In this case the AM will send the new weak auth, - the client will ignore it, - and all subsequent scheduler RPCs will fail - until the user removes/adds the project. - Solution: - If the AM sends us a new auth for a project, use it. - Note: - From the time the password is changed on the project - to the next AM RPC, - the client will have a bad weak auth and scheduler RPCs will fail. - That's OK. - - client/ - acct_mgr.cpp - -David 28 Apr 2011 - - scheduler: compile fix - - client: don't print "Insufficient GPU" messages - unless is set - - client/ - cpu_sched.cpp - html/inc/ - util.inc - sched/ - sched_types.cpp - -David 28 Apr 2011 - - client: update to previous commit: - only change the authenticator if both old and new - authenticators are weak - (strong authenticators don't change). - - client/ - acct_mgr.cpp - -Charlie 29 Apr 2011 - - MGR: Continue adding Exclusive Apps pane to Computing Prefs dialog. - - lib: add missing items in CONFIG, PROXY_INFO struct initializers. - - client/ - log_flags.cpp,.h - clientgui/ - DlgAdvPreferences.cpp,.h - DlgAdvPreferencesBase.cpp - lib/ - cc_config.cpp,.h - gui_rpc_client_ops.cpp - proxy_info.cpp - -Rom 29 Apr 2011 - - VBOX: Checkpoint, Re-implement the start/stop/suspend/resume/is_running - and is_registered functions using the vboxmanage app. - - VBOX: Simplify the virtualbox_vbm_popen function and remove a buffer - copy operation. - - samples/vboxwrapper/ - vbox.cpp, .h - -David 29 Apr 2011 - - GUI RPC client library: increase request buffer size - from 4KB to 100B - - lib/ - gui_rpc_client.cpp - -Rom 29 Apr 2011 - - VBOX: Checkpoint, Re-implement the registering and un-registering of the - vm using the vboxmanage app. - - samples/vboxwrapper/ - vbox.cpp, .h - vm.cpp, .h - -David 29 Apr 2011 - - client: increase request msg buffer size for GUI RPCs - client/ - gui_rpc_client_ops.cpp - gui_rpc_client.cpp - -Charlie 29 Apr 2011 - - MGR: Fix a few bugs in Exclusive Apps pane of Computing Prefs dialog. - - clientgui/ - DlgAdvPreferences.cpp - lib/ - cc_config.cpp - -Charlie 1 May 2011 - - lib: initialize data_dir in CONFIG::defaults(); don't write to - cc_config.xml if empty string, because older versions of BOINC choke. - - lib/ - cc_config.cpp - -Rom 3 May 2011 - - VBOX: Handle both abort scenarios - - samples/vboxwrapper/ - vbox.cpp, .h - vm.cpp, .h - -Charlie 4 May 2011 - - MGR: Continue adding Exclusive Apps pane to Computing Prefs dialog. - - clientgui/ - DlgAdvPreferences.cpp - DlgAdvPreferencesBase.cpp - -David 4 May 2011 - - vbox wrapper: add Makefile - - notices: fix bug where the URL in "friend request" notices - doesn't work if you're not already logged in. - - html/ - inc/ - friend.inc - util.inc - user/ - friend.php - login_form.php - samples/vboxwrapper/ - vbox.cpp - Makefile - -Rom 4 May 2011 - - VBOX: Add function for a host being able to execute tasks within - guest VMs. - - samples/vboxwrapper/ - vbox.cpp, .h - vm.cpp, .h - -Rom 4 May 2011 - - VBOX: Switch to using CreateProcess and CreatePipe on Windows, otherwise we - get a bunch of flicking windows when we preform an operation against - VirtualBox. - - samples/vboxwrapper/ - vbox.cpp - -Charlie 5 May 2011 - - MGR: Fix compiler warning. - - clientgui/ - DlgAdvPreferences.cpp - -David 5 May 2011 - - web: don't show login stuff on server status page - - html/inc/ - util.inc - -David 5 May 2011 - - web: don't error out on old-style notice URL - - sched/ - validator.cpp - html/user/ - friend.php - -David 5 May 2011 - - web RPC: add RPC for getting teams by country - - html/user/ - team_search.php - -David 6 May 2011 - - wrapper: tell the client when we checkpoint - (else checkpoint_elapsed_time etc. don't get set) - - make_project: enable update_stats by default - - update_stats: add --min_age option - - sched/ - update_stats.cpp - tools/ - make_project - samples/wrapper/ - wrapper.cpp - -Charlie 7 May 2011 - - Win: add missing procinfo_win.cpp to Windows libboinc project. - - win_build/ - libboinc.vcproj - -David 7 May 2011 - - client: fix bug that broke work fetch. - We can't set coprocs.n_rsc to zero in CONFIG::defaults(). - - multi_thread app: update initialization - - lib/ - cc_config.cpp - samples/multi_thread/ - multi_thread.cpp - -David 7 May 2011 - - client: add config option. - Defines the transfer rate below which the connection - is considered idle, and timeout starts - - lib/ - cc_config.cpp,h - client/ - http_curl.cpp - cs_files.cpp - -David 7 May 2011 - - client: implement "report immediately" at the level of - individual jobs rather than globally. - To use this, projects must add - to the elements in job templates - - client/ - client_types.cpp,h - cs_scheduler.cpp - -Rom 9 May 2011 - - VBOX: Implement basic cpu time accounting and checkpointing - for VMs. - - samples/vboxwrapper/ - vbox.cpp, .h - vboxwrapper.cpp - vm.cpp, .h - -David 10 May 2011 - - client: don't check memory usage immediately after hibernation - - client/ - client_state.h - app.cpp - -David 10 May 2011 - - vbox wrapper: updates - - samples/vboxwrapper/ - vbox.cpp - vm.cpp,h - -Charlie 10 May 2011 - - MGR: Fixes to new Simple GUI for Linux. - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_ProjectPanel.cpp - -Charlie 11 May 2011 - - MGR: Fixes to new Simple GUI for Linux. - - clientgui/ - sg_PanelBase.cpp, .h - sg_TaskPanel.cpp - -David 11 May 2011 - - Change the way update_versions works, and reimplement it in PHP. - Problems with the old version: - - Lots of info encoded in file and directory names: messy kludge - - The convention that directory name == main program name - created a bad situation when using the wrapper: - if you made a new version of your application, - you were forced make a new version of the wrapper - just so it could have a different name. - The new version is described here: - http://boinc.berkeley.edu/trac/wiki/AppVersionNew - - Remove some Python code that suppored the old version - - client: some fixes to dir_size() that might fox - a buffer overflow when using symbolic links - - tools/ - update_versions - html/inc/ - boinc_db.inc - lib/ - filesys.cpp - py/Boinc/ - tools.py - -David 11 May 2011 - - client: show HTTP errors in text form as well as number - - client/ - pers_file_xfer.cpp - file_xfer.cpp - -David 11 May 2011 - - client: fix problem with recursion in dir_size(), this time for real. - - lib/ - filesys.cpp - -Charlie 12 May 2011 - - MGR: Fixes to new Simple GUI for Linux. - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_PanelBase.cpp, .h - -Charlie 13 May 2011 - - MGR: Fixes to new Simple GUI for Linux and Windows. - - MGR: Fix logic to enable / disable Show Graphics in new Simple GUI. - - MGR: make sure new Simple GUI Pause / Resume button is large enough - for the larger of the localized words for Pause and Resume; do - the same for the Add Project / Synchronize button. - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_PanelBase.cpp, .h - sg_ProjectPanel.cpp, .h - sg_TaskCommandPopup.cpp, .h - sg_TaskPanel.cpp, .h - -Charlie 13 May 2011 - - lib: Fix compile break on Windows. - - lib/ - filesys.cpp - -David 13 May 2011 - - create_work: allow multiple URLs for non-local input files - (from Zoltan Farkas) - - scheduler: fix message describing per-app limits - - sched/ - sched_main.cpp - tools/ - backend_lib.cpp - html/project.sample/ - project.inc - -David 13 May 2011 - - scheduler: per-processor limits should be based on - "effective" # of processors (taking prefs into account) - rather than the physical number - - sched/ - sched_send.cpp - sched_limit.h - -David 13 May 2011 - - client/manager: don't show resource usage for non-CPU-intensive jobs - - client/ - client_types.cpp - clientgui/ - MainDocument.cpp - -Charlie 16 May 2011 - - MGR: New Simple GUI: better displays if no tasks or no projects. - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_ProjectPanel.cpp - -David 16 May 2011 - - client: XML-escape the contents of stderr files; - otherwise non-ASCII characters in client_state.xml - make it invalid XML - - client: fix (I think) to scheduling logic. - a job is preemptable if it's finished its time slice and - Old: has checkpointed in last 10 sec - New: has checkpointed since the end of the time slice - - client/ - app_control.cpp - cpu_sched.cpp - api/ - boinc_api.cpp - lib/ - Makefile.am - -David 17 May 2011 - - update_versions: fix bug in version number parsing (from Kevin) - - tools/ - update_versions - -David 17 May 2011 - - scheduler: if an in-progress limit is given in config_aux.xml, - and is not specified, default it to false. - - scheduler: add some log messages - - sched/ - sched_limit.cpp - sched_version.cpp - sched_send.cpp - sched_main.cpp - -David 17 May 2011 - - scheduler: add config option. - If set, and a WU has nonzero batch, - it is interpreted as a user ID, - and the job will be sent only to hosts with that user ID. - - Note: the use of workunit.batch is arbitrary; - we could also use workunit.opaque or other deprecated field. - - client/ - cpu_sched.cpp - sched/ - sched_send.cpp,h - sched_config.cpp,h - -Rom 17 May 2011 - - MGR: Prepopulate both the username field and the email address - field with the cookie information since we do not know ahead - of time which format the account manager uses. Once the - get_project_config RPC has completed, we'll know which one - is the correct one. - - clientgui/ - WizardAttach.cpp - -Charlie 18 May 2011 - - MGR: Fix welcome message in Account Manager Wizard completion page. - - clientgui/ - CompletionPage.cpp - -David 18 May 2011 - - update_versions: make work - - tools/ - update_versions - -David 18 May 2011 - - client: show GPU device number correctly - - client/ - client_types.cpp - -Rom 19 May 2011 - - client: Account for new registry location that the new VirtualBox installer - stashes the version number. Check the new location first, if not found go - back to the original location. - - client/ - hostinfo_win.cpp - -Rom 19 May 2011 - - MGR: Initial stab at supporting Google Chrome cookies. SQLite engine needs - to be upgraded. Write it while the code is still in my head. - - clientgui/ - browser.cpp, .h - -David 19 May 2011 - - client: add log messages showing steps in exiting all tasks, - enabled by - - client: remove redundant task-start messages - - client/ - app_start.cpp - app_control.cpp - cpu_sched.cpp - -David 20 May 2011 - - update_versions: trim XML strings - - tools/ - update_versions - db/ - boinc_db.h - -David 20 May 2011 - - client: on hibernate, don't wait for apps to exit - (NCI apps never will) - - client/ - sysmon_win.cpp - -David 21 May 2011 - - client: if project is set to "don't request more work", - report completed tasks immediately - - client/ - cs_scheduler.cpp - -Charlie 22 May 2011 - - SCR: Fix Mac crash bug when user clicks SS Test button in system preferences. - - clientscr/ - mac_saver_module.cpp - -David 24 May 2011 - - update_versions: flag main program as executable, - otherwise client will reject it - - tools/ - update_versions - -Charlie 25 May 2011 - - MGR: Fix shutting down of Client on Linux. - - clientgui/ - BOINCGUIApp.cpp - -Rom 25 May 2011 - - scheduler: unescape the stderr_out field after parsing so we do not break - other applications parsing the data. - - sched/ - sched_types.cpp - -David 25 May 2011 - - client: escape only non-ASCII chars in stderr out, not control chars - - sched/ - sched_types.cpp - lib/ - parse.cpp,h - client/ - app_control.cpp - -David 25 May 2011 - - client: if is specified in config file, - set host_info.p_ncpus to that value, - so that scheduler requests report that number of CPUs - - client/ - cpu_sched.cpp - -David 25 May 2011 - - client: fix boinc_make_dirs() (from Josh Highley) - - client: allow "non_cpu_intensive" to be specified independently - for different apps in a project. - This is intended to support projects that use the - Attic file distribution system, - which needs to have a daemon running. - - lib/ - filesys.cpp,h - client/ - client_types.cpp,h - app_control.cpp - cpu_sched.cpp - -David 25 May 2011 - - client: equate notices if their text is the same after removing digits, - so that "need 25 GB disk" and "need 24 GB disk" - don't result in 2 notices. - - client/ - cs_notices.cpp - -David 25 May 2011 - - Manager: tweak messages in exit dialog - - clientgui/ - DlgExitMessage.cpp - -David 27 May 2011 - - web: make front page work for Bossa projects - - html/user/ - sample_index.php - -David 31 May 2011 - - client: when killing a nonresponsive task, - kill its descendant processes too - - manager: tweak strings related to task FLOP size - - client/ - client_state.cpp - app_control.cpp - -David 31 May 2011 - - client: Rom pointed out that on Win in secure mode, - the client won't be able to convert descendant PIDs to handles, - and therefore won't be able to terminate them. Sigh. - So terminate the main process using its handle - (we'll still kill descendants in the non-secure case) - - client/ - app_control.cpp - -David 31 May 2011 - - web: add counts in task list pages - - html/ - inc/ - boinc_db.inc - util.inc - result.inc - user/ - results.php - -Charlie 2 Jun 2011 - - MGR: Add SQLite3 v3.7.6.3 source code to Mac XCode project, adding - initializers for two local variables to suppress compiler warnings; - don't link Mac Manager with older pre-installed sqlite3 library. - - clientgui/ - sqlite3.c (added) - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Charlie 2 Jun 2011 - - MGR: If Firefox 3 SQL query fails because cookie database is locked, - make a temporary copy of the cookie file and query that. This works - around a bug in some builds of Firefox 3.5.x. - - clientgui/ - browser.cpp - -Charlie 3 Jun 2011 - - MGR: Fixes for cookie detection on Google Chrome browser. - - clientgui/ - browser.cpp - -David 3 Jun 2011 - - client: my checkin of 8 Apr 2011 didn't work in some cases, e.g.: - - client finishes a job - - before upload starts, work fetch runs and decides to fetch work - from that project. - Solution: - - set PROJECT::last_upload_start when job finishes, - and clear it when a job is uploaded. - - defer scheduler RPC for a limited time if last_upload_start - is set, even if a transfer is not active - - client/ - client_state.cpp - cs_scheduler.cpp - -David 3 Jun 2011 - - scheduler: app version FLOPS estimates were wrong - in the case where we don't have enough elapsed-time stats - for the host/app_version. - The right formula is (peak FLOPS)/app_version.avg_pfc - - sched/ - sched_version.cpp - -Charlie 3 Jun 2011 - - MGR: Convert Google Chrome browser time (microseconds since - January 1, 1601) to UNIX time (seconds since January 1, 1970) - clientgui/ - browser.cpp - -David 5 Jun 2011 - - scheduler, back end: add "homogeneous app version" feature. - Lets you specify, on a per-app basis, - that all instances should be done using the same app version. - This is for validation in the presence of GPUs. - - scheduler: code cleanup - - Instead of adding a bunch of non-DB fields to RESULT, - used a derived class SCHED_DB_RESULT. - - Instead of storing a pointer to BEST_APP_VERSION in RESULT, - store the structure itself. - This simplifies the memory allocation situation. - - client: condition "Got server request to delete file" messages - on - - db/ - boinc_db.cpp,h - schema.sql - sched/ - sched_types.cpp,h - sched_version.cpp - sched_send.cpp,h - sched_array.cpp - sched_locality.cpp - transitioner.cpp - sched_resend.cpp - sched_assign.cpp - sched_score.cpp - html/ops/ - db_update.php - client/ - cs_scheduler.cpp - -David 5 Jun 2011 - - scheduler: when creating HOST_APP_VERSION records, - initialize the n_jobs_today field correctly - - sched/ - sched_send.cpp - -David 5 Jun 2011 - - lib: fix compile warning - - lib/ - filesys.cpp - -Eric K 6 Jun 2011 - - Added safe exit capabilities for Windows CUDA applications. - - checking in the app can be added as below. - -#ifdef _WIN32 -//Jason: Safe exit check macro to play nicer with Cuda & MS-CRT - #ifdef USE_CUDA - #define SAFE_EXIT_CHECK do { \ - if (worker_thread_exit_request) { \ - fprintf(stderr,"-> Worker received exit request, syncing Cuda..."); -cudaThreadSynchronize(); fprintf(stderr,"Done.\n"); \ - fprintf(stderr," Worker Freeing Cuda data..."); cudaAcc_free(); -fprintf(stderr,"Done.\n"); \ - fprintf(stderr," Worker Acknowledging exit request, spinning->\n"); -worker_thread_exit_ack = true; \ - while (1) Sleep(10); \ - } \ - } while (0); - #else - #define SAFE_EXIT_CHECK do { \ - if (worker_thread_exit_request) { \ - fprintf(stderr," Worker Acknowledging exit request, spinning-> "); -worker_thread_exit_ack = true; \ - while (1) Sleep(10); \ - } \ - } while (0); - #endif -#else // Linux or other probably have their own safe exit handling, defined as -blank, do nothing - #define SAFE_EXIT_CHECK -#endif - -and install at the top of the cffft loop, and more locations if desired: - SAFE_EXIT_CHECK; - -I'd like to implement these as BOINC API functions, but have not yet done so. - -David 6 Jun 2011 - - backend: use new XML parser for input template files - (so that they don't have to be 1 element/line) - and also allow optional root element - - fix bug in WORKUNIT DB interface - - db/ - boinc_db.cpp - tools/ - backend_lib.cpp - -David 6 Jun 2011 - - API: undo the above API checkin, and provide a cleaner and - documented way of doing the same thing; see - http://boinc.berkeley.edu/trac/wiki/AppCoprocessor - - api/ - boinc_api.cpp,h - -Charlie 7 Jun 2011 - - MGR: Fix bug I introduced on 6 Aug 2010: if currently connected host name is - empty string, we must treat it as localhost. Implement different logic to - skip exit confirmation dialog and avoid shutting down client if second - instance of Manager is launched but Select Computer dialog is cancelled. - - clientgui/ - MainDocument.cpp, .h - -Rom 7 Jun 2011 - - MGR: Cleanup compiler warnings. Fixes# 1051 - (From: Steffen Möller) - - clientgui/ - AdvancedFrame.cpp - clientgui/common/ - wxFlatNotebookImages.h - clientgui/res/skins/default - advanced_link_image.xpm - -David 7 Jun 2011 - - client: fix bug in app termination logic - - client/ - app_control.cpp - -Charlie 8 Jun 2011 - - MGR: Fix About dialog to show (PowerPC) instead of (x86) when appropriate. - - clientgui/ - DlgAbout.cpp - -Charlie 8 Jun 2011 - - MGR: Rework logic to skip exit confirmation dialog and avoid shutting down - client if second instance of Manager is launched, so it works if connect - to remote host fails. - - MGR: If original instance of Manager is connected to remote host (or none) - when exiting Manager. skip exit confirmation dialog but do shut down local - client if requested in most recently run exit dialog, whether or not - "Remember this decision" was set. - - MGR: Use same exit confirmation dialog wording for Linux as for Windows. - - clientgui/ - BOINCGUIApp.cpp, .h - MainDocument.cpp, .h - DlgExitMessage.cpp - -Rom 8 Jun 2011 - - MGR: Disable list view rules for now. - - clientgui/ - BOINCBaseView.h - -Charlie 8 Jun 2011 - - MGR: Restore list view rules again. - - clientgui/ - BOINCBaseView.h - -David 8 Jun 2011 - - API: forgot to fix boinc_api.h - - api/ - boinc_api.h - -Charlie 9 Jun 2011 - - MGR: Event Log menu item restores Event Log when Minimized; fixed on Mac - and Windows XP, hopefully on other versions of Windows OS. - - clientgui/ - BOINCBaseFrame.cpp - BOINCGUIApp.cpp - -David 10 Jun 2011 - - client: fix bug in logic that defers work fetch if upload active - - client/ - cs_scheduler.cpp - -David 10 Jun 2011 - - update_versions: read from stdin a different way - - tools/ - update_versions - -David 10 Jun 2011 - - client: initialize some PROJECT fields (from Ian Hay). - May fix bug in defer work fetch while uploading logic - - client/ - client_types.cpp - -David 12 Jun 2011 - - client: change --detach_phase_two (??) to --detach_console - - eliminate compiler warnings (e.g. shadowed vars) - in various places, mostly in client - - sched/ - sched_main.cpp - lib/ - cc_config.cpp - samples/ - many.cpp - client/ - many.cpp - api/ - boinc_api.cpp - -David 12 Jun 2011 - - client:restore --detach_phase_two as synonym for --detach_console - - client/ - cs_cmdline.cpp - -David 13 Jun 2011 - - web: when creating an item in News forum, - show "Export as Notice?" checkbox, and default to off. - - db/ - schema.sql - html/ - inc/ - forum.inc - user/ - forum_post.php - -Bernd 14 Jun 2011 - - API: fix install headers in Makefile.mingw - - lib/ - Makefile.mingw - -Rom 15 Jun 2011 - - MGR: Update the project list in the wizard to make use - of more of the information contained in the all projects - list and also make it more accessible than the previous - implementation. - - clientgui/ - ProjectInfoPage.cpp, .h - WizardAttach.cpp, .h - clientgui/res/ - linuxicon.xpm - macosicon.xpm - windowsicon.xpm - clientgui/res/skins/default/graphic/ - advanced_link_image.xpm - win_build/ - libboinc.vcproj - libboincapi_staticcrt.vcproj - -Rom 15 Jun 2011 - - MGR: Add more polish to the new project list. - - clientgui/ - ProjectInfoPage.cpp, .h - clientgui/res/ - blankicon.xpm - -David 15 Jun 2011 - - manager: tweaks to project list - - clientgui/ - ProjectInfoPage.cpp - -Charlie 16 Jun 2011 - - MGR: Fix project list layout for Mac; ellipse long items by size - instead of by number of characters. Set tooltips of possibly - ellipsed items to full text for that item so user can read it. - - clientgui/ - ProjectInfoPage.cpp, .h - -Charlie 16 Jun 2011 - - Fix typo in all projects list: Urbana-Chamapign -> Urbana-Champaign. - - docs/ - projects.inc - win_build/ - installerv2/ - redist/ - all_projects_list.xml - -David 16 Jun 2011 - - client: we were assuming that if we ask a task to exit - and its main process exits, everything is OK. - That's not necessarily the case - buggy apps may have - subprocesses that the main process fails to kill. - - Solution: when we request a task to exit or abort, - make a list of the descendants. - When the main process exits, kill any remaining descendants. - - Also: we weren't checking for the ABORT_PENDING case - in the process exit logic. - This may explain the 5/15 second delay in detaching or - resetting a project with running tasks - - client/ - app.cpp,h - app_control.cpp - -Charlie 17 Jun 2011 - - MGR: Fix project list identification of CUDA, ATI, and MT support (check - for "['cuda" not "[cuda". "['ati" not "[ati" and "['mt" not "[mt".) - - clientgui/ - ProjectInfoPage.cpp - -Rom 17 Jun 2011 - - MGR: Revert previous change to the project list identification code. - - MGR: Fix a bug introduced in a previous commit where the plan class - was being surrounded by single quotes when generating an updated - project list. - - clientgui/ - ProjectInfoPage.cpp - doc/ - get_platforms.inc - -Rom 17 Jun 2011 - - MGR: Change the project list description control into an HTML based - window. - - clientgui/ - ProjectInfoPage.cpp, .h - -David 17 Jun 2011 - - client: add a flag to APP_VERSION. - If set, the app does its own CPU throttling - so the client doesn't have to. - - client/ - client_types.cpp,h - app_control.cpp - -Charlie 18 Jun 2011 - - MGR: Don't mark a project as supported if it requires a coprocessor we lack. - NOTE: if the platform entry contains a modifier such as [cuda] or [ati], - that capability is required. If a project offers both a cuda application - and a CPU-only application for an operating system, it must have two - separate platform entries for that OS, one with [cuda] and one without. - Likewise for ati and mt. - - clientgui/ - ProjectInfoPage.cpp - -David 20 Jun 2011 - - web: use ReCaptcha for account creation as well as profile creation - (from Daniel) - - GUI RPC: remove have_cuda from CC_STATE. - Use the info in host_info.coprocs instead. - - html/ - ops/ - pass_percentage_by_platform.php - user/ - create_account_form.php - create_account_action.php - lib/ - gui_rpc_client_ops.cpp - gui_rpc_client.h - -Rom 20 Jun 2011 - - MGR: Fix build breaks related to GUI RPC changes. - - clientgui/ - AdvancedFrame.cpp - AsyncRPC.cpp - BOINCTaskBar.cpp - DlgItemProperties.cpp - ProjectInfoPage.cpp - -Charlie 20 Jun 2011 - - client: logic fix: test coprocs.none() after coprocs.add() calls, not before. - - client/ - client_state.cpp - -David 21 Jun 2011 - - GUI RPC: restore , elements in CC_STATE - for compatibility - - client: copy coprocs to host_info._coprocs at startup - (else GUI RPCs don't have right info) - - client/ - client_state.cpp - cs_statefile.cpp - lib/ - gui_rpc_client.h - gui_rpc_client_ops.cpp - -David 21 Jun 2011 - - web: add a web-service interface for remotely submitting, querying - and controlling batches of jobs - - web: add an administrative interface for controlling - user permissions for submitting jobs - - web: add an interface where users can view and control - their submitted jobs - See: http://boinc.berkeley.edu/trac/wiki/RemoteJobs - This is at a functional but rough stage. - - db/ - schema.sql - tools/ - create_work.cpp - html/ - ops/ - submit_permissions.php - db_update.php - submit_example.php - inc/ - submit_db.inc - boinc_db.inc - db_conn.inc - user/ - submit.php - submit_status.php - -Charlie 21 Jun 2011 - - MGR: Revert Rom's manager changes of 20 June related to GUI RPC changes, - for compatibility with older Clients. - - clientgui/ - AdvancedFrame.cpp - AsyncRPC.cpp - BOINCTaskBar.cpp - DlgItemProperties.cpp - ProjectInfoPage.cpp - -Charlie 22 Jun 2011 - - MGR: Rename CC_STATE::have_cuda to CC_STATE::have_nvidia to clarify its meaning, - add comment that it is referenced in GUI RPCs as for compatibility. - Wizard ProjectInfo page tests values appropriate for connected client version. - - lib: fill in missing entries in COPROCS GUI RPCs, ensure that old data is reset - when connecting to a different host (not yet complete.) - - clientgui/ - AdvancedFrame.cpp - AsyncRPC.cpp - BOINCTaskBar.cpp - DlgItemProperties.cpp - ProjectInfoPage.cpp - lib/ - coproc.cpp, .h - gui_rpc_client.h - gui_rpc_client_ops.cpp - -Charlie 23 Jun 2011 - - MGR: It turns out we want the Wizard ProjectInfo Page to check for ATI and NVIDIA - GPUs regardless of whether they were reported by CAL, CUDA or OpenCL, so we can - just check CC_STATE::have_ati and CC_STATE::have_nvidia even for newer clients. - This means the Manager doesn't need to do get_host_info RPCs, because all the - host info it needs is available from the host_info section of the get_state RPC, - so eliminate the unnecessary Manager calls of get_host_info RPC. - - clientgui/ - DlgAdvPreferences.cpp - MainDocument.cpp, .h - ProjectInfoPage.cpp - -David 23 Jun 2011 - - lib: fix compile warning - - lib/ - coproc.h - -David 23 Jun 2011 - - client: add per-project GPU exclusion. - If you put an element of the form - - http://project_url.com/ - 1 - - in your cc_config.xml, that GPU won't be used for that project - - lib/ - cc_config.cpp,h - client/ - client_types.cpp,h - client_state.cpp - cpu_sched.cpp - -David 23 Jun 2011 - - client: replace with - in cc_config.xml (but keep old one for compat) - - lib/ - coproc.h - cc_config.cpp,h - client/ - client_state.cpp - coproc_detect.cpp - log_flags.cpp - -Charlie 24 Jun 2011 - - SCR: Add url.cpp to Mac screensaver in XCode project to fix link error. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 24 Jun 2011 - - client: add element to config option, - in case of multiple GPU types - - lib/ - cc_config.cpp,h - client/ - client_types.cpp,h - client_state.cpp - cpu_sched.cpp - -David 25 Jun 2011 - - client: add optional elements to config option, - to allow app-level exclusions - - lib/ - cc_config.cpp,h - client/ - cpu_sched.cpp - -David 25 Jun 2011 - - client simulator: compile fix - - client/ - makefile_sim - sim_util.cpp - -David 25 Jun 2011 - - fix compile warnings - - api/ - boinc_api.cpp - client/ - app_start.cpp - -David 29 Jun 2011 - - back end: strip tags from output templates - - web: main RSS feed should include all news items, even non-notices - - tools/ - process_result_template.cpp - html/inc/ - forum_rss.inc - lib/ - str_util.cpp - samples/wrappture/ - wrappture.cpp - -David 29 Jun 2011 - - server: restore fpops/intops_cumulative to RESULT - (structure, not table) for AQUA - - client, Windows: when wake up from hibernation, - get the time before printing log msg - - db/ - boinc_db.h - client/ - client_state.h - sysmon_win.cpp - -David 30 Jun 2011 - - client (Win) add some bulletproofing in case Windows sends us a - "suspending" event but not a resume event. - - client/ - client_state.cpp,h - sysmon_win.cpp - -David 30 Jun 2011 - - db_purge: make zip compression work (from Teemu Mannermaa) - - get rid of a few compile warnings - - sched/ - sched_send.cpp - db_purge.cpp - sched_types.cpp - sched_score.cpp - sample_work_generator.cpp - -David 4 July 2011 - - back end: fix bugs in [23648] which caused create_work - to mess up input templates containing - or other attribute tags. - XML_PARSER now contains a member element() for when - you want to copy an element without knowing its structure. - - tools/ - backend_lib.cpp - lib/ - parse.cpp,h - html/user/ - openid_login.php - -David 5 July 2011 - - update_versions: fix typo that produced bad XML - - tools/ - update_versions - -Charlie 6 July 2011 - - Mac: Update to libcurl 7.21.7 and c-ares 1.7.4. - - client/ - http_curl.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - buildc-ares.sh - buildcurl.sh - setupForBOINC.sh - HowToBuildBOINC_XCode.rtf - -Rom 6 July 2011 - - Tag for 6.13.0 release, all platforms - boinc_core_release_6_13_0 - - / - configure.ac - version.h - -Charlie 6 July 2011 - - Mac: Fix bad paths to MacBitMapComboBox.cpp, .h in XCode project. - (Checked into 6.13.0 tag). - - clientgui/ - mac/ - MacBitmapComboBox.cpp, .h - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Charlie 7 July 2011 - - Mac: Fix bug where menubar icon menu did not work after changing skin. - - clientgui/ - mac/ - MacSysMenu.cpp - -Rom 7 July 2011 - - WINSCR: Remove diagnostics screensaver dialog when the screensaver fails to - be able open up the log files. - - clientscr/ - screensaver_win.cpp - -David 7 July 2011 - - client: write log msgs saying whether GPUs are OpenCL-capable - - client/ - client_state.cpp - -David 7 July 2011 - - client: fix bug introduced in [23765] that produced garbage - in elements in sched req msgs and elsewhere. - peak_flops is a double. - If you print it using %d, everything from that point forward - is messed up. - - lib/ - coproc.cpp - -David 7 July 2011 - - client: fix typo that caused a lot of spurious - "project has XXXXXX deadline misses" messages - - fix compile warnings - - client/ - sandbox.cpp - rr_sim.cpp - -David 7 July 2011 - - client: possibly fix bug that caused no-GPU prefs to be ignored - - client/ - client_types.cpp - -Charlie 8 July 2011 - - Mac: Refine bug fix for menubar icon menu not working after changing skin. - - clientgui/ - BOINCTaskBar.cpp - mac/ - MacSysMenu.cpp, .h - -David 8 July 2011 - - client: fix bug related to deselecting resource types in project prefs. - Some logic was missing. - - client/ - client_types.cpp,h - cs_account.cpp - work_fetch.cpp - -David 10 July 2011 - - client emulator web interface: make cc_config.xml an attribute - of the simulation, not the scenario. - If you want to run a simulation w/ different log flags, - you shouldn't have to create a new scenario. - - client emulator: add --config_prefix cmdline arg - - validator: prevent infinite loop when app_version.pfc_avg - is wonky (like 1e-300). - Next step: figure out how it got that way. - - client/ - sim.cpp - sched/ - credit.cpp - -David 10 July 2011 - - client: clear have_nvidia/ati flags in CC_STATE - so you don't show garbage in project properties - - lib/ - gui_rpc_client_ops.cpp - -David 10 July 2011 - - Manager and GUI RPC: - Remove debt fields from PROJECT: not used anymore - Add sched_priority field - - lib/ - gui_rpc_client_ops.cpp - gui_rpc_client.h - client/ - client_state.cpp - client_types.cpp - clientgui/ - DlgItemProperties.cpp - -David 10 July 2011 - - client: fix scheduler bug that treated all CPU jobs - as non-high-priority - - client: don't print spurious "domino prevention" - and "thrashing prevention" msgs - - manager: show project descriptions in same size font - as the rest of the dialog - - client/ - cpu_sched.cpp - work_fetch.h - clientgui/ - ProjectInfoPage.cpp - -David 11 July 2011 - - manager: do the above font change only on Win - - clientgui/ - ProjectInfoPage.cpp - -David 11 July 2011 - - manager: fix messed up logic that caused projects to show - "platform not support" incorrectly. - Note: the code in this entire area seems way too complex - - manager: tweak project desc font size - - clientgui/ - ProjectInfoPage.cpp - -David 11 July 2011 - - admin web: add page for showing app and app version details - - html/ - ops/ - submit_permissions.php - app_reset.php (new) - manage_apps.php - login_form.php - logout.php - app_details.php (new) - inc/ - util_ops.inc - -David 12 July 2011 - - admin web: finish page for resetting app statistics - - html/ - ops/ - app_reset.php - app_details.php - inc/ - boinc_db.inc - -David 12 July 2011 - - validator: if job FLOPs estimates are accurate, - PFC values should be around 1. - If they differ from 1 by a factor of > 1e4, ignore them, - and put an error message into the validator log - - validator: if get_pfc() fails because an app version is - missing from the DB (i.e. the project deleted it) - keep going so we don't reprocess the WU forever - - sched/ - credit.cpp - -David 13 July 2011 - - client, work fetch policy: - adjust project REC by the amount of work queued, to increase variety - NOTE: at some point I think I had a reason to not do this, - but I can't remember what it is. - - client, job scheduling policy: fix how project REC is adjusted - - client/ - work_fetch.cpp,h - cpu_sched.cpp - lib/ - common_defs.h - sched/ - credit.cpp,h - trickle_credit.cpp - -David 13 July 2011 - - manager: don't show "Estimated computation speed" in task properties - The quantity involved is not actually computation speed. - Also don't show Max RAM usage. - - clientgui/ - DltItemProperties.cpp - -David 13 July 2011 - - admin web: improve the FLOPs estimation tool so that - it works for GPU versions too - - html/ - ops/ - job_times.php - app_details.php - inc/ - util_ops.php - -David 13 July 2011 - - client: precede OpenCL messages with [coprog_debug], not [coproc-test]. - The convention is to use the name of the enabling log flag. - - client/ - coproc_detect.cpp - - -Rom 14 July 2011 - - lib: Fix the various '????' fields in the diagnostics framework during a - crash on Windows. Somewhere along the lines I messed up with the - conversions of single-byte characters vs. double-byte characters. - - lib/ - stackwalker_win.cpp - -David 14 July 2011 - - client: add config option - - lib/ - cc_config.cpp,h - cpu_sched.cpp - -David 14 July 2011 - - client: if a project has zero resource share, - don't piggyback a work request onto a non-work-request RPC - - client/ - work_fetch.cpp - -David 14 July 2011 - - client: show the right prefix for messages - - client/ - cpu_sched.cpp - -Charlie 18 July 11 - - MGR: Fix "Can't load Image" messages in Simple View; allow gaps in slide - show file numbering; reload images if new project files downloaded. - - clientgui/ - sg_ProjectPanel.cpp, .h - sg_TaskPanel.cpp, .h - -Rom 18 July 2011 - - Tag for 6.13.1 release, all platforms - boinc_core_release_6_13_1 - - / - configure.ac - version.h - -David 18 July 2011 - - web: when listing a user's message-board posts, - don't show team message-board posts unless - a) the requesting user is a member of the team, and - b) if the post is hidden, the requesting user is a team admin - This enforces the goal that a team's message board - is visible only to the team. - - html/user/ - forum_user_posts.php - -David 19 July 2011 - - validator: remove spurious messages - - sched/ - credit.cpp - -David 19 July 2011 - - server: some stuff to prepare for distributed storage - - don't create result records for uploads and downloads. - Just create a msg_to_client record. - - the scheduler handles file-transfer results specially; - it makes a vector of them, then calls a project-supplied function - handle_file_xfer_results() - - change the interface and implementation of put_file and get_file - - client write project sched priority in GUI RPC replies, - but not to the state file - - sched/ - delete_file.cpp - put_file.cpp - get_file.cpp - sched_types.cpp,h - sched_customize.cpp,h - handle_request.cpp - credit_test.cpp - tools/ - backend_lib.cpp,h - py/Boinc/ - setup_project.py - client/ - client_state.cpp - boinc_cmd.cpp - client_types.cpp - -David 20 July 2011 - - client: changes to the client file model to support distributed storage, - as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel - Compatibility: - clients that upgrade to this version should see nothing unusual. - Clients that downgrade from this version to a previous version - should see all projects reset - (i.e. tasks disappear and then get re-downloaded). - - manager: always show whether a file transfer is upload or download - - client: don't scale work requests by resource share - - client/ - client_types.cpp,h - cs_apps.cpp - cs_files.cpp - cs_prefs.cpp - cs_statefile.cpp - file_xfer.cpp - pers_file_xfer.cpp - work_fetch.cpp - clientgui/ - ViewTransfers.cpp - lib/ - gui_rpc_client.h - gui_rpc_client_ops.cpp - -David 20 July 2011 - - client/server: change the implementation of upload certificates - as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel - Compatibility: if your project is using upload certificates: - - set ignore_upload_certificates - - disable job creation - - let your job queue drain - - upgrade to new server software - - clear ignore_upload_certificates - - enable job creation - - sched/ - file_upload_handler.cpp - tools/ - process_result_template.cpp - lib/ - gui_rpc_client_print.cpp - client/ - client_types.cpp,h - file_xfer.cpp - -David 20 July 2011 - - server: debug the above - - sched/ - file_upload_handler.cpp - -David 20 July 2011 - - client: debug the above - - client/ - file_xfer.cpp - -David 20 July 2011 - - server: debug distributed storage functions - - generate upload signatures if needed - - assign deadlines to file xfer jobs (default 1 week) - - scheduler: ack completed file xfer results - - sched/ - put_file.cpp - get_file.cpp - sched_customize.cpp - tools/ - backend_lib.cpp,h - -David 20 July 2011 - - client: debug distributed storage functions - - client/ - client_types.cpp,h - cs_statefile.cpp - scheduler_op.cpp - -David 22 July 2011 - - server: some remote job submission code. Not finished. - - tools/ - create_work.cpp - html/ - inc/ - submit.inc - user/ - submit.php - submit_example.php - -Charlie 25 July 11 - - Mac: Begin changes for XCode 4.1 and GCC 4.2. - - client/ - hostinfo_unix.cpp - clientgui/ - browser.h - sqlite3.c - mac/ - MacBitmapComboBox.h - lib/ - hostinfo.h - -David 25 July 2011 - - web: more remote job submission code. Not finished. - - db/ - boinc_db.h - html/ - inc/ - submit.inc - boinc_db.inc - result.inc - user/ - submit_example.php - get_output.php - submit.php - -David 25 July 2011 - - user web: internationalization, from Christian Beer - - html/user/ - show_host_detail.php - sample_index.php - show_coproc.php - show_user.php - profile_search_action.php - team.php - -David 25 July 2011 - - user web: remote job submission: - add the ability to download zipped output files - - html/user/ - submit_example.php - get_output.php - -Charlie 26 July 11 -- Mac: Finish changes for XCode 4.1 and GCC 4.2. - - clientgui/ - sqlite3.c - mac_build/ - boinc.xcodeproj/ - project.pbxproj - mac_installer/ - PostInstall.cpp - release_boinc.sh - -David 26 July 2011 - - web: remote job submission: implement abort and cleanup functions - - html/ - inc/ - forum.inc - submit.inc - util.inc - result.inc - user/ - forum_thread.php - submit_example.php - submit.php - -David 26 July 2011 - - web: remote job submission: - - add fields to batch table, extend APIs accordingly - - require that example web interface run on BOINC server - (this makes many things easier; - an actual remote interface would require a bit more work) - - db/ - boinc_db.h - schema.sql - html/ - ops/ - db_update.php - inc/ - submit_db.inc - submit.inc - util.inc - result.inc - user/ - submit_example.php - submit.php - -Charlie 27 July 11 - - lib: Initialize config_coprocs struct in CONFIG::defaults(). - - lib/ - cc_config.cpp - -Charlie 27 July 11 - - SCR: Fix delay dismissing screensaver under Mac OS10.7. - - clientscr/ - mac_saver_module.cpp - Mac_Saver_Module.h - Mac_Saver_ModuleView.m, .h - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Charlie 28 July 11 - - Mac SCR: Fix vertical range of moving logo. - - clientscr/ - Mac_Saver_ModuleView.m - -David 28 July 2011 - - remote job submission: bug fix and tweaks - - client: cc_config.xml: if is omitted from a , - it means exclude all instances of that GPU type - - client: if all instances of a GPU type are excluded for a project, - don't ask the project for jobs of that type - - html/ - ops/ - submit_permissions.php - inc/ - util.h - user/ - submit_example.php - lib/ - cc_config.cpp,h - client/ - work_fetch.cpp,h - client_types.cpp,h - client_state.cpp - gui_rpc_server_ops.cpp - cpu_sched.cpp - -David 29 July 2011 - - client: fix bug in config option - - client: extend option so that if is omitted, - all GPUs of the given type are excluded. - - client/ - cpu_sched.cpp - work_fetch.cpp - lib/ - cc_config.cpp,h - -David 30 July 2011 - - server: fix typo - - db/ - boinc_db.h - -David 30 July 2011 - - user web: in instructions for logging in with authenticator, - show the actual account file name. - - html/user/ - get_passwd.php - -David 30 July 2011 - - web: fix typo that prevented users from seeing their own hidden posts - - html/ - inc/ - prefs.inc - user/ - forum_user_posts.php - -David 31 July 2011 - - web: fix +/- forum rating, and tweak messages. Fixes #1123 - - html/user/ - forum_report_post.php - forum_rate.php - -David 31 July 2011 - - scheduler: check for negative elapsed time in results - reported by client, set to zero - - sched/ - sched_result.cpp - sched_types.cpp - html/user/ - create_account_form.cpp - -David 1 Aug 2011 - - web: fix bug in next_url mechanism - - html/inc/ - util.inc - -David 1 Aug 2011 - - client: change the way upload signatures are generated - in an attempt to make them work with existing servers - - client/ - file_xfer.cpp - -David 1 Aug 2011 - - client: undo the above. doesn't work - - client/ - file_xfer.cpp - -David 1 Aug 2011 - - update_versions: add optional element to - element in version.xml. - If present, update_versions will gzip the file in the download dir. - Use this only if you have gzip-encoding enabled in Apache. - - tools/ - update_versions - -Charlie 2 Aug 11 - - Mac installer: Work around bug in Mac OS 10.7 dscl merge command. - - mac_installer/ - PostInstall.cpp - -David 2 Aug 2011 - - update_versions: bug fixes - - tools/ - update_versions - -David 3 Aug 2011 - - client: fix bug in get_descendants(), - which prevented the client from cleaning up - subprocesses of misbehaving multiprocess apps. - - remote job submission system: - assign physical names to input files (based on their MD5) - rather than having the user provide physical names - - VM apps: eliminate vbox64 plan class. Only vbox. - - sched/ - sched_customize.cpp - html/ - ops/ - manage_app_versions.php - inc/ - submit.inc - user/ - submit_example.php - submit.php - lib/ - procinfo.cpp - client/ - app_start.cpp - app_control.cpp - -David 3 Aug 2011 - - client: add optional to APP_VERSION>. - If present, "file_prefix/" is prepended to the logical names - of input and output files of jobs using that app version. - I.e. for Vbox wrapper based app versions, file_prefix is "share", - so that I/O files are put in a "share" subdirectory of the slot dir. - - update_versions: add support for - - x - in version.xml - - tools/ - update_versions - client/ - client_types.cpp,h - app.h - app_start.cpp - -David 3 Aug 2011 - - client: if an app version has nonempty file_prefix, - copy all its input and output files - - client/ - app.h - app_start.cpp - -Charlie 3 Aug 11 - - Mac: Fix warning about potential memory leak. - - clientgui/ - mac/ - SystemMenu.m - -David 3 Aug 2011 - - vbox wrapper: fix parsing of job file - - vbox wrapper: fix code structure - - merge vm and vbox - - no global vars - - samples/vboxwrapper/ - vbox.cpp,h - vm.cpp.h (removed) - vboxwrapper.cpp - Makefile - -David 3 Aug 2011 - - vbox wrapper: hardwire logical name of image file to "vm_image.vdi". - - vbox wrapper: on startup, rename image file to "vm_image_SLOT.vdi", - where SLOT is the slot number. - Vbox requires unique names for VM image files. - - samples/vboxwrapper/ - vbox.cpp,h - vboxwrapper.cpp - -David 4 Aug 2011 - - scheduler: apparently some hosts send GPU parameters that cause - the peak_flops to be negative (probably #processors = -1). - This leads to negative credit. - Fix: if peak flops is negative, set it to 50 GFLOPS - - web: fix email validate page - - lib/ - coproc.h - html/user/ - validate_email_addr.php - -Rom 4 Aug 2011 - - vbox wrapper: initialize xml parser with the correct starting tag. - - samples/vboxwrapper/ - vboxwrapper.cpp - -David 4 Aug 2011 - - scheduler: turns out we need separate vbox32 and vbox64 - plan classes after all. - Otherwise (since app_plan() is not passed an app version) - there's no way to enforce that 64 bit hosts are sent - only the 64 bit version (which is necessary because - of the split-registry scheme). - - sched/ - sched_customize.cpp - -David 6 Aug 2011 - - web: send user a private message when - - one of their posts is moderated - - a banishment vote starts or completes. - This is needed in cases where the user can't or doesn't - read email to their account's address. - The "from" address of the PM is that of the user, not the moderator. - - html/ - inc/ - pm.inc - forum_email.inc - user/ - pm.php - team_founder_transfer_action.php - -David 6 Aug 2011 - - update_versions: fix bug where files not listed in version.xml - are not processed correctly - - remote job submission: debug - - create_work: --rsc_fpops_est etc. should override the template file - - tools/ - backend_lib.cpp - update_versions.cpp - html/user/ - submit_example.php - submit.php - -David 7 Aug 2011 - - remote job submission: bug fixes - - html/ - inc/ - submit.inc - util.inc - result.inc - user/ - submit_example.php - submit.php - -David 7 Aug 2011 - - client: projects with zero resource share are always lower priority, - for both job sched and work fetch, - than projects with positive resource share. - - client/ - cpu_sched.cpp - work_fetch.cpp - -David 7 Aug 2011 - - scheduler: fix nasty bug where SCHED_DB_RESULT::parse() - was doing memset(this, 0, sizeof(RESULT)), - i.e. it wasn't zeroing out the whole structure. - The elapsed_time field (which isn't reported by old clients), - is near the end of the struct, - and it was getting garbage, e.g. 1e-304, in some cases, - which led to zero credit (and maybe other problems) - - validator: treat 1e-304 like zero in case of other problems - like the above. - - remote job submission: tweaks - - sched/ - credit.cpp - sched_types.cpp - html/user/ - submit_example.php - submit.php - -David 7 Aug 2011 - - web: when sending emails to other users, don't translate anything - (since they don't necessarily speak our language) - - html/ - ops/ - index.php - inc/ - pm.inc - submit.inc - -David 7 Aug 2011 - - client: make round-robin simulator match what the job scheduler now does: - give lowest priority to projects with zero resource share. - - client/ - rr_sim.cpp - client_types.h - -Charlie 8 Aug 2011 - - Changes for Charity Engine Desktop. - - clientgui/ - mac/ - CE_ss_logo.tiff (new) - res/ - CE_Install.icns (new) - CharityEngine.icns (new) - CE_Uninstall.icns (new) - MacCEPkgIcon.zip (new) - skins/ - Charity Engine/ (new) - graphics/ (new) - (many new files) - skin.xml (new) - clientscr/ - mac_saver_module.cpp - res/ - CE_ss_logo.png (new) - CE_ss_logo.jpg (new) - ss_app.cpp - mac_installer/ - CE-Branding (new) - CE-ReadMe.rtf (new) - CharityEngine/ (new) - acct_mgr_url.xml (new) - GR-ReadMe.rtf - make_CharityEngine.sh (new) - PostInstall.cpp - PTP-ReadMe.rtf - ReadMe.rtf - -Charlie 8 Aug 2011 - - Mac Client: Call NSVersionOfRunTimeLibrary("cuda") to set - cc.display_driver_version (from Oliver Bock.) - - client/ - coproc_detect.cpp - -David 9 Aug 2011 - - client: rename MODE to RUN_MODE, and rename vars accordingly - - client/various - -David 9 Aug 2011 - - client: pass XML_PARSER& rather than MIOFILE& to parse functions. - Preparatory to using new-style XML parsing everywhere. - - client/various - lib/various - -Rom 10 Aug 2011 - - Changes for Charity Engine Desktop. - - client/win/res/ - ce.ico - clientctrl/ - boincsvcctrl.rc - clientgui/ - BOINCGUIApp.rc - clientgui/res/ - ce.ico - clientlib/win/ - boinc_dll.rc - clientscr/ - boinc_ss.rc - clientscr/ - boinc_ss_opengl.rc - clientscr/res/ - ce.bmp - ce.ico - clienttray/ - boinc_tray.rc - win_build/ - ce_boinc_cli.vcproj - ce_boinc_dll.vcproj - ce_boinc_ss.vcproj - ce_boinccmd.vcproj - ce_boincmgr.vcproj - ce_boincsvcctrl.vcproj - ce_boinctray.vcproj - ce_ss_app.vcproj - CharityEngine.sln - win_build/installerv2/ - CharityEngine.ism - win_build/installerv2/redist/0409/ - ce-eula.rtf - win_build/installerv2/redist/CharityEngine/ - acct_mgr_url.xml - ce.ico - CE_IsDialogBanner.bmp - CE_IsDialogBitmap.bmp - CE_Splash.bmp - -David 10 Aug 2011 - - Improve interface of XML_PARSER. - Add parsed_tag and is_tag to the class, - so that parsing functions don't need to declare them - and pass them around. - - Complete the task of using XML_PARSER as the argument - to all parsing functions. - (Internally, many of these functions still use the old XML parser; - that's the next step.) - - db/ - boinc_db.cpp,h - sched/ - various - tools/ - backend_lib.cpp - lib/ - various - client/ - various - -David 10 Aug 2011 - - fix compile warnings; msg tweak - - client/ - cpu_sched.cpp - lib/ - parse.cpp - -David 10 Aug 2011 - - client: use new XML parser pretty much everywhere - - lib/ - cert_sig.cpp,h - parse.h - client/ - pers_file_xfer.cpp - cs_account.cpp - client_types.cpp - cs_statefile.cpp - scheduler_op.cpp - time_stats.cpp - app.cpp - current_version.cpp - -Charlie 11 Aug 2011 - - Mac installer: Bug fixes for OS 10.7 Lion: LoginItemAPI.c did not - set hidden property for login items, so use AppleScript instead, - to prevent Lion from opening BOINC windows at system startup. - - Fix a bug I introduced on 8 August which prevented launching - WaitPermissions.app. - - Mac uninstaller: Remove Charity Engine BOINC app if present. - - mac_installer/ - AddRemoveUser.cpp - PostInstall.cpp - Uninstall.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 11 Aug 2011 - - client: more XML parsing stuff - - client/ - app.cpp - net_stats.cpp - -David 11 Aug 2011 - - scheduler: update XML parsing - - sched/ - sched_main.cpp - sched_types.cpp - -David 11 Aug 2011 - - client: XML tweak - - client/ - client_types.cpp - -Charlie 12 Aug 2011 - - Mac installer: Bug fixes for OS 10.7 Lion. - - mac_build/ - Mac_SA_Secure.sh - mac_installer/ - AddRemoveUser.cpp - PostInstall.cpp - -Rom 18 Aug 2011 - - WINSCR: Based on feedback from WCG about the screensaver lock-up - problem attempt to provoke Windows into redrawing the primary - display. It turns out that the screensaver image is a ghost - image, so create a blank top-most window and close it after - the graphics application has been terminated. - - clientscr/ - screensaver_win.cpp, .h - -David 21 Aug 2011 - - Vbox wrapper: add --trickle x option; sends a trickle-up message - reporting incremental runtime exery x seconds of runtime. - - client: more XML parsing cleanup - - credit trickle handler: do sanity checks on CPU speed - - sched/ - trickle_credit.cpp - credit.cpp,h - samples/vboxwrapper/ - vboxwrapper.cpp - client/ - acct_setup.cpp,h - gui_rpc_server_ops.cpp - -David 21 Aug 2011 - - credit trickle handler: write log messages if sanity checks fail - - sched/ - trickle_credit.cpp - -David 21 Aug 2011 - - add script to purge trickle message records from DB - - fix spelling errors in db_purge - - html/ops/ - purge_trickles.php (new) - sched/ - db_purge.cpp - -Charlie 22 Aug 2011 - - client: Fix compiler warnings. - - client/ - app.cpp - coproc_detect.cpp - -Charlie 22 Aug 2011 - - client: Correlate OpenCL results with CAL or CUDA results based - on index of devices reported by each. This assumes that CUDA - and OpenCL and report NVIDIA devices in the same order, and - that CAL and OpenCL report ATI/AMD devices in the same order. - - client/ - coproc_detect.cpp - lib/ - coproc.h - -David 22 Aug 2011 - - client emulator fixes - - sched/ - edf_sim.h - client/ - sim.cpp - sim_util.cpp - cs_statefile.cpp - -Charlie 23 Aug 2011 - - client: If OpenCL is supported, add OpenCL information to - COPROC_ATI::write_xml() and COPROC_NVIDIA::write_xml(), and - parse OpenCL information in COPROC_ATI::parse() and - COPROC_NVIDIA::parse(). - - client: Add OpenCL platform version number to COPROC struct. - - client/ - coproc_detect.cpp - lib/ - cl_boinc.h - coproc.cpp, .h - parse.h - -David 23 Aug 2011 - - example app: change the app version structure to match the new format - - samples/example_app/ - various - -David 23 Aug 2011 - - fix linux build errors in coproc stuff. - I don't think unsigned long long is relevant here. - - lib/ - parse.h - coproc.cpp - client/ - coproc_detect.cpp - -David 23 Aug 2011 - - example app: get it right this time - - samples/example_app/ - various - -Charlie 24 Aug 2011 - - lib: fix compile errors on Mac, Ubuntu and Windows. - - lib/ - parse.h - -Charlie 24 Aug 2011 - - client: fix compile warnings on Mac and Ubuntu. - - client/ - coproc_detect.cpp - -Charlie 24 Aug 2011 - - lib, client: revert recent changes to restore unsigned long long so - we can determine cause of and try to fix Linux build errors. - - lib: On Windows, call _strtoui64() instead of strtoull. - - lib/ - coproc.cpp - parse.h - client/ - coproc_detect.cpp - -David 24 Aug 2011 - - job submission: fix bug where parameters specified in the - input template (e.g., delay bound) were ignored - - web: fix PHP warning - - tools/ - backend_lib.cpp - html/ - inc/ - forum.inc - user/ - forum_forum.php - -David 24 Aug 2011 - - client: pass --gpu_type X (X=nvidia or ati) as well as --device. - This lets device-neutral OpenCL apps figure out which GPU to use. - - client/ - app_start.cpp - -Charlie 25 Aug 2011 - - client: fix Linux compile errors and warnings. - - client/ - coproc_detect.cpp - lib/ - coproc.cpp - parse.h - -David 25 Aug 2011 - - client: fix bug where NVIDIA display driver version wasn't being - set correctly for some laptop GPUs - - client/server: improve estimation of NVIDIA GPU peak FLOPS - - lib/ - coproc.h - client/ - coproc_detect.cpp - -David 25 Aug 2011 - - validator: update credit statistics even if credit_from_wu - is being used. - - web: make almost everything translatable. From Christian Beer. - - sched/ - validator.cpp - html/user/ - various - -Charlie 26 Aug 2011 - - lib: use standard implementation of strtoull when available. - - configure.ac - clientgui/ - mac/ - config.h - lib/ - parse.h - -David 26 Aug 2011 - - web: more fixes from Christian Beer. Fixes #1129 - - html/ - ops/ - inc/ - -Rom 26 Aug 2011 - - VboxWrapper: Add functions for enable/disable network and throttling - the CPU and network activity. - - samples/vboxwrapper/ - vbox.cpp, .h - -David 26 Aug 2011 - - scheduler: don't send user a message when there is no - app version for their platform for a particular app. - The may be versions for other apps which don't have jobs right now. - TODO: send a message if there are no versions of ANY app - for any platform. - - fix makefile indentation, caused manager to not be built - fixes #1132 - - sched/ - sched_version.cpp - sched_send.cpp - Makefile.am - -David 26 Aug 2011 - - VirtualBox wrapper: - - change names of CPU and network-limiting functions - to express their units (always do this). - - wrapper monitors status.suspend_network - and suspends/resumes network accordingly - - wrapper sets CPU and network bandwidth limits on startup - (Rom: should this be done before run() rather than after?) - Note: App versions using this wrapper should always have - in their version.xml, - to tell the client that the app throttles itself. - - samples/vboxwrapper/ - vbox.cpp,h - vboxwrapper.cpp - -David 26 Aug 2011 - - fix build error in Linux screensaver (at least on FC14) - - clientscr/ - screensaver_x11.cpp - -David 26 Aug 2011 - - web: comment out OpenID login - not working yet - - html/user/ - login_form.php - -David 26 Aug 2011 - - job creation: handling of extra XML in input templates didn't work. - - job creation: fix stripping of tags - - client: fix off-by-1 error in buffer overflow logic for scanning keys. - - tools/ - backend_lib.cpp - process_result_template.cpp - lib/ - crypt.cpp - parse.cpp,h - -David 26 Aug 2011 - - manager: Communitcations -> Communications. - please, no spelling errors in function/variable names - - client: parse deprecated tags in - - clientgui/ - ProjectProcessingPage.cpp,h - AccountManagerProcessingPage.cpp,h - client/ - client_types.cpp - -David 26 Aug 2011 - - client: fix bug that caused project attach to fail - - clientgui: Rom, we should do error-checking of most GUI RPCs; - look for REPORT ERROR in ProjectProcessingPage.cpp - - client/ - acct_setup.cpp - coproc_detect.cpp - clientgui/ - ProjectProcessingPage.cpp - -David 26 Aug 2011 - - web: fix glitch in forum next/prev links - - html/inc/ - host.inc - forum.inc - -David 26 Aug 2011 - - web: more tra() stuff - - html/user/ - forum_thread.php - -David 27 Aug 2011 - - web: add a magic header string that supposedly will make - Recaptcha work on some IE variants. WTF?? - - html/ - inc/ - util.inc - user/ - create_account_form.php - create_profile.php - -David 28 Aug 2011 - - web: fix to the above - - web: fix forum search - - html/ - inc/ - util.inc - user/ - forum_search.php - forum_search_action.php - -David 28 Aug 2011 - - web: fix some stuff broken by my checkin [24039]. - - web: use & instead of & in URLs (not complete) - - html/ - inc/ - forum.inc - util.inc - user/ - forum_thread.php - forum_forum.php - edit_forum_preferences_action.php - -David 29 Aug 2011 - - web: fix typo in profile credit/edit - - html/user/ - create_profile.php - -David 29 Aug 2011 - - web: fix bug in "report post" function - - html/user/ - delete_profile.php - forum_report_post.php - -David 29 Aug 2011 - - Vbox wrapper: deal with checkpointing. - Current: wrapper reports frequent checkpointing to client, - but actually checkpoints only when the VM is stopped - Problem: large amounts of work would be wasted if - BOINC stops in an ungraceful way (e.g., power failure) - Solution: - Don't report frequent checkpointing. - Every CPU scheduling period (typically once/hour) - stop the VM (creating a checkpoint) - and call boinc_temporary_exit(0). - If the client wants to keep running this job, - it will start us immediately. - - samples/vboxwrapper/ - vboxwrapper.cpp - -David 29 Aug 2011 - - web: add page showing top GPU models - - html/user/ - gpu_list.php - -Charlie 30 Aug 2011 - - Mac: Copy BOINC libraries built with XCode 4.1 to locations - where built by earlier versions of XCode so dependent - builds can always find them. - - Vbox wrapper: create XCode project. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - samples/vboxwrapper/ - vboxwrapper.xcodeproj - project.pbxproj - -David 30 Aug 2011 - - client: fix a couple of valgrind warnings - - client/ - cs_notice.cpp - hostinfo_unix.cpp - -David 30 Aug 2011 - - client: send all running jobs a "reread app info" message - when global prefs change (in the case of vboxwrapper, - it might have to change network or CPU throttling) - - sched/ - sched_version.cpp - sched_send.cpp - client/ - cs_prefs.cpp - -David 30 Aug 2011 - - web: sort GPUs by average elapsed time - - html/user/ - gpu_list.php - -David 30 Aug 2011 - - vbox wrapper: check for boinc_status.reread_init_data_file, - and if set reread the file, set throttles, and clear flag - - samples/vboxwrapper/ - vboxwrapper.cpp - -David 30 Aug 2011 - - validator: in "credit_from_wu" case, record what the new credit - system would have assigned in result.claimed_credit. - - sched/ - validator.cpp - -Charlie 31 Aug 2011 - - define GPU_TYPE_NVIDIA, GPU_TYPE_ATI, use everywhere instead of - literal strings "NVIDIA" and "ATI" to ensure uniformity. - - client/ - acct_mgr.cpp - client_state.cpp - client_types.cpp - coproc_detect.cpp - cpu_sched.cpp - cs_account.cpp - cs_scheduler.cpp - log_flags.cpp - scheduler_op.cpp - lib/ - coproc.cpp, .h - gui_rpc_client_ops.cpp - -Charlie 31 Aug 2011 - - lib: Add OPENCL_REFERENCE boinc_get_opencl_ids(int argc, char** argv) - to be called by OpenCL project applications to get the platform ID - and device ID of the GPU assigned to the task by the scheduler. - - lib/ - coproc.cpp, .h - -David 31 Aug 2011 - - API: move boinc_get_opencl_ids() from lib/ to api/. - lib/ is for code that's used by >1 part of BOINC - - lib/ - coproc.cpp,h - api/ - boinc_opencl.cpp,h (new) - Makefile.am - -David 31 Aug 2011 - - boinc_get_opencl_ids(): - - change signature to return int error code - - no function overloading - - api/ - boinc_opencl.cpp,h - -David 31 Aug 2011 - - client: fix bugs related to white space around code signing keys - - win compile fixes - - api/ - boinc_opencl.cpp - client/ - client_types.cpp - cs_scheduler.cpp - scheduler_op.cpp - win_build/ - libboincapi_staticrt.vcproj - -David 31 Aug 2011 - - web: show actual project info on "forget password?" page - - html/user/ - get_passwd.php - -David 31 Aug 2011 - - API: boinc_get_opencl_ids() doesn't need to link - the OpenCL library at runtime. - It's used only in OpenCL applications, - which already include the library. - - api/ - boinc_opencl.cpp,h - Makefile.am - -David 31 Aug 2011 - - scheduler: make sure there's a \n after and . - Otherwise older clients won't be able to parse. - - sched/ - sched_types.cpp - -Rom 31 Aug 2011 - - VboxWrapper: Specify a configuration directory under the slot directory to - try and avoid permission errors on multiple platforms when BOINC - is installed as a daemon. - - samples/vboxwrapper/ - vbox.cpp - -Charlie 31 Aug 2011 - - api: Fix compile errors and warnings, add documentation in comments - - lib: remove unnecessary #include, add needed function declarations - - api/ - boinc_opencl.cpp, .h - lib/ - cl_boinc.h - coproc.cpp - -David 31 Aug 2011 - - web: show relative performance on GPU list - - html/user/ - gpu_list.php - -Charlie 1 Sep 2011 - - api: More fixes to boinc_get_opencl_ids() - - api/ - boinc_opencl.cpp - lib/ - cl_boinc.h - -Charlie 1 Sep 2011 - - lib: if OS_Darwin use procinfo_mac.cpp isntead of procinfo_unix.cpp. - - lib, api: update XCode project to build same source files in each - library as corresponding make files. - - lib/ - makefile.am - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 1 Sept 2011 - - server: rename process_wu_template() to process_input_template(), - and move it to its own file - - sched/ - Makefile.am - tools/ - backend_lib.cpp,h - process_input_template.cpp,h (new) - Makefile.am - api/ - reduce_main.cpp - -David 1 Sept 2011 - - server: factor process_input_template() into smaller pieces - - tools/ - process_input_template.cpp - -David 1 Sept 2011 - - web: fix bug in "allow beta apps" preferences editing - - html/user/ - prefs_edit.php - -David 1 Sept 2011 - - wrapper compile fixes - - samples/wrapper/ - wrapper.cpp - -Rom 1 Sept 2011 - - VboxWrapper: Add a way to extract the VM process id from the VM's - log file. - - samples/vboxwrapper/ - vbox.cpp, .h - -David 2 Sept 2011 - - client (and API and manager): change the data structure - used for system process info - Old: vector of PROCINFO. - Descendants of a process were found by recursively - iterating through the vector. - Operations are O(n) - New: map of (id, PROCINFO), - and each PROCINFO has a vector of its children. - Operations are O(log(n)) - Also combined Mac/Win/Linux variants of code that - was essentially the same. - - lib/ - procinfo.cpp,h - procinfo_win.cpp - procinfo_unix.cpp - procinfo_mac.cpp - clientgui/ - BOINCClientManager.cpp - BOINCGUIApp.cpp - -David 2 Sept 2011 - - more code shuffling: - proc_control: controlling processes - procinfo: enumerating and querying processes - run_app_windows: launching apps as other users on Win - - lib/ - proc_control.cpp,h - run_app_windows.cpp - procinfo.cpp,h - Makefile.am - api/ - boinc_api.cpp - client/ - app_control.cpp - -David 2 Sept 2011 - - client/API/vboxwrapper: - add a mechanism so that apps can report sub-processes - that are not descendants (e.g., virtual machines) - These processes are then counted as part of the app, - not as "non-BOINC CPU time". - This fixes a bug where processing was incorrectly suspended - because CPU usage by VM apps exceeded the "CPU usage limit" pref. - - Implementation: - - the PIDs of the processes in question - are passed from app to client via shared-memory, - in the app_status channel. - A new variant of boinc_report_app_status() supports this. - - the VBox wrapper queries the PID of the VM, - and reports it in this way. - - procinfo_app() includes a new argument: a list of PIDs - that are part of the app, although not ancestrally - related to the main process. - - in the client, ACTIVE_TASK now includes a vector "other_pids". - If this is nonempty, it's passed to procinfo_app(). - - lib/ - procinfo.cpp,h - samples/ - vboxwrapper/ - vbox.cpp,h - vboxwrapper.cpp - api/ - boinc_api.cpp,h - client/ - app.cpp,h - app_control.cpp - -David 2 Sept 2011 - - web: fix bug in add project prefs for a venue - - html/user/ - add_venue.php - -Charlie 2 Sep 2011 - - lib: Fix compile errors; add app_control.cpp to XCode project. - - client/ - app_control.cpp - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 2 Sept 2011 - - lib: minor code shuffle - - lib/ - proc_control.cpp - procinfo_win.cpp - -David 2 Sept 2011 - - web: when displaying a user's posts, limit the query to 1000 - so the page doesn't exceed CPU limit - - html/user/ - forum_user_posts.php - -David 5 Sept 2011 - - web: fix warnings in forum pages - - scheduler: when using elapsed time stats to predict runtime, - cap the estimated FLOPS at twice the peak FLOPS; - otherwise, if a host has received a lot of very short jobs - recently, it will get a too-high FLOPS estimate and - will exceed the rsc_fpops_bound limit. - - db/ - boinc_db.h - sched/ - sched_types.cpp,h - sched_version.cpp - html/ - ops/ - submit_permissions.php - inc/ - forum.inc - -David 5 Sept 2011 - - scheduler RPC: add element to - the element in - scheduler RPC request - (tells the server that there's an override file). - - account manager RPC: add element, - including the override flag. - - web: add "no time limit" option for forum search - - web: increase show-user-post query limit to 10000 - - lib/ - prefs.cpp,h - client/ - cs_prefs.cpp - acct_mgr.cpp - html/user/ - forum_search.php - forum_search_action.php - forum_user_posts.php - -David 6 Sept 2011 - - scheduler: add a debug message - - sched/ - sched_send.cpp - -David 6 Sept 2011 - - client: fix bugs with white space around code sign keys - and file signatures - - client: when describing app versions in scheduler requests, - we still must use CUDA instead of NVIDIA; - that's what's in the server code. - - client/ - client_types.cpp - -David 6 Sept 2011 - - scheduler: use new XML parser for most request elements - - scheduler: parse NVIDIA as well as CUDA in app version descriptions - (workaround for recent clients) - - sched/ - sched_send.cpp - sched_types.cpp - -David 6 Sept 2011 - - preliminary stuff for mechanism where privileged users - can create apps and app versions - - crontab commands should be preceded by cd to project root - - db/ - schema.sql - tools/ - make_project - html/ - ops/ - submit_permissions.php - db_update.php - user/ - submit_app.php - -David 7 Sept 2011 - - scheduler: fix crashing bug - - sched/ - sched_version.cpp - sched_assign.cpp - -Rom 7 Sept 2011 - - Tag for 6.13.2 release, all platforms - boinc_core_release_6_13_2 - - / - configure.ac - version.h - -David 7 Sept 2011 - - feeder: change the DB query to skip jobs for deprecated apps. - Otherwise, if you have a deprecated app with >= 200 jobs - (200 is the query's limit) - it could always get jobs for that app, - and never put anything into the cache. - - db/ - boinc_db.cpp - -David 7 Sept 2011 - - client: make exit_before_start a cc_config.xml option - (as well as a cmdline option) - - wrapper: print error messages if stdin/out/err files don't exist - - lib/ - cc_config.cpp,h - samples/wrapper/ - wrapper.cpp - client/ - client_state.cpp,h - app_start.cpp - cs_cmdline.cpp - app_control.cpp - -David 8 Sept 2011 - - scheduler: in work_needed(), ignore requests for resource - types for which we have no app versions - - client: if too many elements in cc_config.xml, - detect it and inform user - - sched/ - sched_send.cpp - lib/ - coproc.h - cc_config.cpp - samples/ - client_state_save.xml - client/ - log_flags.cpp - -David 8 Sept 2011 - - web: fix PHP warning - - html/inc/ - result.inc - -David 8 Sept 2011 - - validator: old scheduler bugs may cause result.flops_estimate - to be negative in some cases. - Detect this, and use 1e10 instead - - sched/ - credit.cpp - -David 8 Sept 2011 - - client: new XML parser had a limit of 8KB for strings. - This broke things. Increase it to 256KB. - - lib/ - parse.cpp - -Charlie 9 Sep 2011 - - Mac: More fixes for building under XCode 4.1. - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - mac_installer/ - release_boinc.sh - -Rom 9 Sept 2011 - - Tag for 6.13.3 release, all platforms - boinc_core_release_6_13_3 - - / - configure.ac - version.h - -David 9 Sept 2011 - - web: suppress warning on cache unlink - - html/inc/ - cache.inc - -David 9 Sept 2011 - - client: XML-escape the URLs in RSS feed lists - - lib: make xml_unescape work for arbitrarily large strings - - lib/ - parse.cpp - client/ - cs_notice.cpp - -David 10 Sept 2011 - - client: don't pass --gpu_type to GPU apps; - this breaks many existing apps. - Instead, pass the GPU type (and the device number) - in app_init_data.xml - - client/ - app_start.cpp - lib/ - app_ipc.cpp,h - -David 10 Sept 2011 - - client: fix error in parsing of XML comments - - lib/ - parse.cpp - -David 11 Sept 2011 - - client: finish next-to-last checkin - - client/ - app_control.cpp - app_start.cpp - app.h - -David 11 Sept 2011 - - manager, simple view: - - edit label text - - increase opacity of main area; - otherwise some text is hard to read - - change borders from blue to light gray. - In general shouldn't use primary colors - - display credit as integer - - reduce size of project name; - otherwise long names don't fit (on Win) - - don't use "(in slot x)". - "Slot" is not part of the vocabulary here. - - clientgui/ - sg_PanelBase.cpp - sg_ProjectPanel.cpp - sg_TaskPanel.cpp - -David 11 Sept 2011 - - API: change boinc_get_opencl_ids() to use APP_INIT_DATA - instead of cmdline - - api/ - boinc_api.cpp,h - boinc_opencl.cpp,h - -David 11 Sept 2011 - - API; fix the above fix - - api/ - boinc_api.cpp,h - boinc_opencl.cpp - Makefile.am - -David 12 Sept 2011 - - client: make RR simulation more accurate - by simulating time-slicing explicitly. - Also simulate changes in project REC - and hence in scheduling priority. - - client: add a log flag "rrsim_detail" that prints - time-slice-level info. - - lib/ - cc_config.cpp,h - client/ - work_fetch.cpp,h - client_types.cpp,h - rr_sim.cpp,h - cpu_sched.cpp - -David 12 Sept 2011 - - client: remove code related to debt-based scheduling - - client/ - work_fetch.cpp,h - client_types.cpp,h - sim.cpp - cpu_sched.cpp - -David 12 Sept 2011 - - client: make file upload work w/ old handlers - - client/ - file_xfer.cpp - -David 12 Sept 2011 - - web: add config option - - html/user/ - create_account_form.php - create_account_action.php - sample_index.php - -David 12 Sept 2011 - - validator: add --no_credit option; - maintains stats but doesn't grant credit - - sched/ - validator.cpp - -David 12 Sept 2011 - - client, GUI RPC, Manager: - in GUI RPC, change RESULT.gpu_mem_wait to scheduler_wait. - It means that the app did a boinc_temporary_exit(), - and is waiting to be rescheduled. - GPU mem wait is one source of this, not the only one - - clientgui/ - MainDocument.cpp - lib/ - gui_rpc_client.h - gui_rpc_client_ops.cpp - client/ - client_types.cpp - -Rom 13 Sept 2011 - - VBOX: Add more trace messages to the wrapper to help resolve - issues. - - samples/vboxwrapper/ - vbox.cpp - -David 13 Sept 2011 - - validator: add a --credit_from_runtime option. - This assigns credit proportional to runtime*p_fpops. - To prevent cheating, p_fpops is capped at the 95th percentile value - among active hosts, - and runtime is capped at a specified limit. - This option supports apps, like LHC's CERNvm app, - that run for a certain amount of time and then exit. - The CreditNew system doesn't work for such apps. - - trickle_credit: - To prevent cheating, - cap p_fpops at the 95th percentile value among active hosts, - and require a limit on runtime. - - require that trickle handlers supply an initialization function - - db/ - boinc_db.cpp,h - sched/ - trickle_handler.cpp,h - trickle_credit.cpp - trickle_echo.cpp - validate_util2.cpp - validator.cpp - -David 13 Sept 2011 - - wrapper: don't delete task-level checkpoint file when starting task; - that defeats the purpose. From Uwe Becker. - - samples/wrapper/ - wrapper.cpp - -Rom 13 Sept 2011 - - VBOX: Properly trap stderr output from vboxmanage by redirecting it to - stdout. Error messages should now be properly detected on Linux and - Mac. - - samples/vboxwrapper/ - vbox.cpp - -Rom 13 Sept 2011 - - VBOX: Don't attempt to stop a VM that is already shut down. - - samples/vboxwrapper/ - vbox.cpp - -Rom 13 Sept 2011 - - VBOX: Make is_running() a bit smarter about detecting the running state - of a virtual machine. - - samples/vboxwrapper/ - vbox.cpp - -David 13 Sept 2011 - - client: get GPU available RAM at startup (only) - - client: fix compile warning - - lib/ - coproc.cpp - client/ - work_fetch.cpp,h - client_state.cpp - coproc_detect.cpp - cpu_sched.cpp - -David 13 Sept 2011 - - client: fixes to the above - - client: prevent infinite recursion (and stack overflow) - in procinfo.cpp:add_child_totals(). - Not sure how this could happen. - - client/ - coproc_detect.cpp - lib/ - procinfo.cpp - -Rom 13 Sept 2011 - - VBOX: Increase the pipe buffer on Windows from the default to 128k. Despite what - the docs say, if the buffer isn't large enough VboxManage hangs attempting to - write the VM log file to it. Luckly the VM log file is only 64k. - - VBOX: Fix a couple of parsing errors. - - samples/vboxwrapper/ - vbox.cpp - -Rom 14 Sept 2011 - - VBOX: Add a register_only command line argument to help debug VM related issues. - - VBOX: Add some suggestions to the source on how to debug VM related issues. - - VBOX: Add a quick sanity check when the enable_shared_directory option is - enabled. - - samples/vboxwrapper/ - vbox.cpp, .h - vboxwrapper.cpp - -David 13 Sept 2011 - - client: escape URLs for curl, otherwise filenames with spaces don't work - - lib/ - procinfo.cpp - client/ - http_curl.cpp - -David 13 Sept 2011 - - client: curl_easy_escape() escapes way too much. Just escape spaces. - - client/ - http_curl.cpp - -David 14 Sept 2011 - - XML parsing: do XML unescaping in place rather than allocating - a buffer on the stack. - Fixes a Manager crash on the Mac, - where the default thread stack size seems to be 512KB. - - lib/ - parse.cpp,h - app_ipc.cpp - client/ - cs_notice.cpp - -Rom 14 Sept 2011 - - client: Update Windows detection code to support Windows 8. - (From: [P3D] Crashtest) - - client/ - hostinfo_win.cpp - -David 14 Sept 2011 - - client: change in the use of GPU available RAM: - - measure the available RAM of each GPU when BOINC starts up. - If this fails, set available = physical. - Show available RAM in startup messages. - - use available RAM rather than physical RAM in selecting - the "best" GPU instance - - report available RAM to the scheduler - TODO: change the scheduler to use available rather than physical - if it's reported - - sched/ - sample_trivial_validator.cpp - lib/ - coproc.cpp,h - client/ - client_state.cpp - coproc_detect.cpp - cpu_sched.cpp - -David 14 Sept 2011 - - vboxwrapper: we don't seem to be getting the VM PID. - Add some printfs. - - samples/vboxwrapper/ - vbox.cpp - -David 14 Sept 2011 - - client: report available GPU RAM to scheduler - - lib/ - coproc.cpp - -David 14 Sept 2011 - - lib: parse in coproc XML - - lib: do coproc XML parsing using new XML parser - - lib/ - parse.cpp,h - coproc.cpp,h - -David 14 Sept 2011 - - scheduler: in app_plan functions for GPUs, - use available RAM if reported by client; - otherwise use physical RAM. - - sched/ - sched_customize.cpp - -David 14 Sept 2011 - - scheduler: revise [21428] to include non-anonymous-platform, - and change the ratio limit from 2 to 10. - - sched/ - sched_send.cpp - sched_version.cpp - -Charlie 15 Sep 2011 - - lib: fix compiler warning. - - vboxwrapper: fix compiler warning. - - Mac: Change XCode project to build both 32-bit and 64-bit - BOINC libraries for debug as well as for deployment. - - vboxwrapper: update XCode project for easier access to built - executables and symbol tables under XCode 4.1. - - lib/ - coproc.cpp - samples/ - vboxwrapper/ - vbox.cpp - vboxwrapper.xcodeproj/ - project.pbxproj - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 15 Sept 2011 - - minor code shuffle - - client/ - rr_sim.cpp - -Rom 15 Sept 2011 - - VBOX: Add a way to track overall network utilization of a VM. - - samples/vboxwrapper/ - vbox.cpp, .h - -David 16 Sept 2011 - - Validator: allow project-specific code to mark a result - is a "runtime outlier", i.e. its runtime does - not correspond to the job's rsc_fpops_est. - Runtime outliers are not counted in the statistics for - elapsed time, turnaround time, and peak FLOPs count. - - The is intended for applications like SETI@home, - some of whose jobs finish more or less instantly - (this happens if the data contains a lot of interference). - If a host happens to get a bunch of these short jobs, - its statistics will get skewed: in essence, the server - will think that the host is extremely fast, - and will send it too many jobs. - - db/ - boinc_db.cpp,h - sched/ - credit.cpp - validator.cpp - html/ops/ - db_update.php - -David 16 Sept 2011 - - vboxwrapper: code cleanup - - use double for potentially large quantities - - factor out repetitive code, rather than copy and paste - - samples/vboxwrapper/ - vbox.cpp,h - -David 16 Sept 2011 - - vboxwrapper: report network usage to the client - - client: include the above in enforcing network quota preferences - - api/ - boinc_api.cpp,h - samples/vboxwrapper/ - vbox.cpp,h - vboxwrapper.cpp - client/ - app.cpp,h - app_control.cpp - sched/ - trickle_handler.cpp - -David 16 Sept 2011 - - transitioner: fix bug related to new runtime_outlier field - - db/ - boinc_db.cpp - -David 16 Sept 2011 - - validator: add runtime_outlier message - - sched/ - credit.cpp - -David 16 Sept 2011 - - client: with VBox on Win, the process graph sometimes has cycles. - Not sure where this comes from. - But avoid infinite recursion when traversing descendants. - - lib/ - procinfo.cpp,h - -Charlie 16 Sep 2011 - - wrapper: Update Mac build script for XCode 4.1 and OS 10.7. - NOTE: We no longer support PowerPC Macs. - - samples/wrapper/ - wrapper.cpp - -David 18 Sept 2011 - - client: make the attributes of GUI RPCs (network, authentication) - explicit rather than determined by position in a list. - - client: add a new "read-only" attribute for GUI RPCs. - This is in preparation for handling GUI RPCs in separate threads. - - client: remove code to support pre-V6 graphics. - - lib/ - parse.h - client/ - cs_notice.cpp,h - gui_rpc_server.cpp,h - gui_rpc_server_ops.cpp - app.cpp - app_control.cpp - Makefile.am - -David 18 Sept 2011 - - Win fixes - - lib/ - mfile.cpp - parse.cpp - win_build/ - boinc_cli.vcproj - -David 18 Sept 2011 - - lib: add generic interfaces for threads and thread synchronization - - lib/ - thread.cpp,h - -David 18 Sept 2011 - - win fixes - - lib/ - thread.cpp,h - win_build/ - libboinc.vcproj - -Rom 19 Sept 2011 - - Tag for 6.13.4 release, all platforms - boinc_core_release_6_13_4 - - / - configure.ac - version.h - -David 19 Sept 2011 - - client: in handling the acct_mgr GUI RPC, - don't start the RPC directly; - that might fail if CLIENT_STATE::gui_http is busy. - Instead, set a timer field. - - client: structure ACCT_MGR_OP the same as other GUI_HTTP_OP variants - - client: clarify the comments on GUI_HTTP and GUI_HTTP_OP - - Note: GUI_HTTP and GUI_HTTP_OP are misnomers; they refer to - any HTTP op other than scheduler requests and file transfers. - Should change the name, maybe to CLIENT_HTTP* - - client/ - client_state.cpp - gui_rpc_server.cpp - gui_rpc_server_ops.cpp - gui_http.cpp,h - acct_mgr.cpp,h - cs_trickle.h - -Charlie 20 Sep 2011 - - Mac: Remove app_graphics.cpp from Client in XCode project, add new - files thread.cpp,.h to libboinc.a in XCode project. - (Checked in to 6.13.4 tag.) - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -David 20 Sept 2011 - - client: intermediate checkin for replicated trickle-ups. - Not finished yet. - - example app: add --trickle_up and --trickle_down options, - for testing trickle messages - - client/ - acct_mgr.cpp - client_types.h - cs_notice.cpp,h - cs_scheduler.cpp - cs_trickle.cpp,h - gui_http.cpp,h - gui_rpc_server.cpp,h - http_curl.cpp,h - scheduler_op.cpp,h - samples/example_app/ - uc2.php - -David 21 Sept 2011 - - back end: extend the access control system for remote job submission - and other operations. - You can now designate a user as "manager" for a particular app. - They can then: - - control job-submit permissions for that app - - deprecate/undeprecate versions of the app. - - abort jobs for that app - - You can also designate a user as manager for the project. - They can then edit permissions and quotas, - as well as performing the app-specific functions for all apps. - - This is described here: - http://boinc.berkeley.edu/trac/wiki/MultiUser#Accesscontrol - - This required some changes to the DB schema. - - db/ - schema.sql - tools/ - manage_privileges - html/ - inc/ - submit.inc - submit_util.inc (new) - result.inc - ops/ - submit_permissions.php (removed) - db_update.php - user/ - manage_project.php (new) - submit_example.php - manage.php (new) - manage_app.php (new) - submit.php - py/Boinc/ - setup_project.py - -David 21 Sept 2011 - - client: fix bug in ATI GPU detection, caused zero RAM measurements - - client/ - coproc_detect.cpp - -Rom 21 Sept 2011 - - client: fix ATI GPU max mem display issue. - - lib/ - coproc.cpp - -David 21 Sept 2011 - - fix typo in DB schema - - msg tweaks in make_project - - db/ - schema.sql - py/Boinc/ - setup_project.py - -David 21 Sept 2011 - - client: more stuff for replicated trickle ups - - client/ - cs_trickle.cpp - client_types.cpp - http_curl.cpp - -David 21 Sept 2011 - - lib: don't include thread.cpp; - not needed for server, and causes errors on some 64-bit Linux - - lib/ - Makefile.am - -Charlie 22 Sep 2011 - - vboxwrapper: fix code which sets environment variables. - - "PATH" must be upper case. - - putenv() does not copy its input string, so must use setenv(). - - samples/ - vboxwrapper/ - vbox.cpp - -Rom 22 Sept 2011 - - VBOX: More environment variable tweaks. - - samples/vboxwrapper/ - vbox.cpp, .h - -David 22 Sept 2011 - - client: more work on replicated trickles. Not working yet. - - client/ - client_state.cpp - cs_trickle.cpp,h - -David 22 Sept 2011 - - client: replicated trickles. Seems to be working now. - - client: added config option - - client/ - cs_trickle.cpp - gui_http.cpp,h - httl_curl.cpp - lib/ - cc_config.cpp,h - -Rom 22 Sept 2011 - - Tag for 6.13.5 release, all platforms - boinc_core_release_6_13_5 - - / - configure.ac - version.h - -Rom 22 Sept 2011 - - client: Disable GPU detection of Windows when running as a - service to avoid a deadlock condition with the latest ATI - drivers. - - client/ - client_state.cpp - coproc_detect.cpp - -Charlie 23 Sep 2011 - - Mac: fixes for problems with OS 10.4 compatibility. - (checked into 6.13.5 and 6.13.6 tags) - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - -Rom 22 Sept 2011 - - Tag for 6.13.6 release, all platforms - boinc_core_release_6_13_6 - - / - configure.ac - version.h - -David 23 Sept 2011 - - fix typo in manage_privileges - - tools/ - manage_privileges - -David 23 Sept 2011 - - web: don't addslashes() for button titles; this was left over - from when buttons were implemented in Javascript - - html/inc/ - util.inc - -David 23 Sept 2011 - - web: message tweak - - html/inc/ - forum.inc - -David 23 Sept 2011 - - client: fix spurious error message about trickle-up URLs - - client/ - client_types.cpp - -David 23 Sept 2011 - - client: don't call CLIENT_STATE::free_mem() on shutdown. - This is for debugging only, and it can cause crashes. - - client/ - main.cpp - -Charlie 24 Sep 2011 - - Mac: more fixes for problems with OS 10.4 compatibility. - (checked into 6.13.5 and 6.13.6 tags) - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - mac_installer/ - PostInstall.cpp - uninstall.cpp - -David 26 Sept 2011 - - client simulator: add --existing_jobs_only option. - This simulates just the jobs in the state file, - rather than simulating an infinite stream of jobs - modeled after the ones in the state file. - - client/ - sim.cpp,h - cs_prefs.cpp - -Charlie 26 Sep 2011 - - Mac: update wxMac build script for building with XCode 4.1 - under OS 10.7 while maintaining OS 10.4 compatibility. - (checked into 6.13.6 tag) - - mac_build/ - buildWxMac.sh - -David 26 Sept 2011 - - client simulator: fixes - - client: message tweaks - - client/ - client_state.cpp,h - sim.cpp - cs_prefs.cpp - cs_apps.cpp - log_flags.cpp - cpu_sched.cpp - lib/ - cc_config.h - -David 26 Sept 2011 - - web: when showing a user's posts, don't show the ones - in hidden threads - - web: in showing the context of a post, link the thread also. - - html/ - user/ - forum_user_posts.php - inc/ - forum.inc - -Charlie 27 Sep 2011 - - client: Fix compile break on Mac. - - client/ - cpu_sched.cpp - -Rom 27 Sept 2011 - - web: The create_account RPC supports taking an invite_code parameter - but we currently do not expose a way in get_project_config to determine - that a UI should prompt for one. Add a tag - if the project is only accepting new accounts by invitation. - - html/user/ - get_project_config.php - -Rom 27 Sept 2011 - lib: only build the static version of libboinc. - - lib/ - Makefile.am - -David 27 Sept 2011 - - fix comment - client/ - app_control.cpp - -David 27 Sept 2011 - - Updates Linux notifications to use current libnotify. - - Fix build problems on Mac OS X using autotools - - Consistently use #if HAVE_X for platform checks, - rather than #ifdef HAVE_X or #if defined(HAVE_X) - - In Unix build, make lots of compiler checks standard - - Fix some compile warnings - - From Matt Arsenault. - - Note: there are now lots of compile warnings in clientgui/ on Unix, - mostly in WxWidgets code - - configure.ac - Makefile.incl - clientgui/gtk - taskbarex.cpp - db/ - boinc_db.cpp - clientscr/ - gfxswitcher.cpp - sched/ - file_deleter.cpp - hr.h - lib/ - various - win_build/ - win-config.h - api/ - various - client/ - various - -Charlie 27 Sep 2011 - - client: Fix compiler warnings on Mac. - - client: Fix compile break on Mac. - - client/ - client_state.cpp - cs_cmdline.cpp - mac/ - config.h - -David 28 Sept 2011 - - manager: fix build break on Linux - Undoes part of yesterday's checkin. - - more changes from #ifdef HAVE_X to #if HAVE_X - - clientgui/gtk/ - taskbarex.cpp - lib/ - proc_control.cpp - mac_address.cpp - diagnostics.cpp - parse.h - -Rom 30 Sept 2011 - - WINSETUP: Add more logging to the create group and add user to group - functions in an attempt to figure out what is going on with Windows 8. - - win_build/installerv2/redist/Windows/src/boinccas/ - CACreateBOINCGroups.cpp - win_build/installerv2/redist/Windows/Win32/ - boinccas.dll - boinccas95.dll - win_build/installerv2/redist/Windows/x64/ - boinccas.dll - boinccas95.dll - -David 1 Oct 2011 - - client: fix a bug reported by Jacob Klein, - where work fetch didn't work right in the presence of - multiple GPUs and config options. - For example: suppose: - - you have 2 GPUs and 2 projects - - Project A is excluded from GPU 1 - - you have lots of jobs for project A - Then the client won't try to fetch jobs from project B. - - The problem had 2 parts: - a) round-robin simulation wasn't taking GPU exclusions into account. - In the above example, it would think that both GPUs had jobs. - I fixed this by computing the # of GPUs from each project - is excluded, and using this in the RR simulation. - b) Once this was done, I needed to make the client - request GPU jobs from project B rather than project A. - I did this with following policy: - If a project has excluded GPUs of a given type, - and has a runnable job of that type, - don't ask it for more work of that type. - - Notes: - - the policy in b) is crude, and it means that work-buffer - preferences are ignored in some cases. - - neither a) nor b) takes into account app-level exclusions. - - I could fix both of these with a lot of work, - but I'd rather move to a model in which dissimilar GPUs - are modeled as different resources, - which would remove the need for the mechanism - in the first place. - - Other note: I figured out this problem using the client simulator, - based on the client state file that Jacob sent me. - - - web: remove extraneous ) at end of button tooltips - - html/inc/ - util.inc - client/ - client_types.h - client_state.cpp - sim.cpp - work_fetch.cpp - rr_sim.cpp - gui_rpc_serever_ops.cpp - log_flags.cpp,h - -David 1 Oct 2011 - - client: specify the project in "Some tasks need more memory - than allowed by your preferences" messages - - client - cs_trickle.cpp - client_state.cpp - -David 1 Oct 2011 - - team import script: don't exit if fail to create user. - The failure may be because the email is banned - (as happened w/ SETI@home) - - html/ops/ - team_import.php - -David 2 Oct 2011 - - client: fix bug that could cause GPU idleness - in the presence of GPU exclusions. - The problem was in the job-selection phase, - which picks enough jobs to use all devices. - It was ignoring GPU exclusions, so for example on - a 2 GPU system it could pick 2 jobs from a project - for which 1 GPU is excluded, - and as a result 1 GPU would be idle. - - Solution: during job selection, - keep track of GPU usage on a per-instance basis. - Select a job only if it can run on a non-excluded GPU. - - - client: in computing ncprocs_excluded (which is used in - work fetch policy) don't count exclusions of non-existent devices - - html/ops/ - team_export.php - lib/ - coproc.h - client/ - log_flags.cpp - cpu_sched.cpp - -David 2 Oct 2011 - - client: compute project scheduling priority more efficiently - - client: if an app version can't be used because the GPUs it needs - are all excluded, mark it and all its results as "coproc missing" - so that they won't be looked at in scheduling logic. - - client/ - client_state.cpp - client_types.cpp,h - cpu_sched.cpp - gui_rpc_server_ops.cpp - log_flags.cpp,h - rr_sim.cpp - sim.cpp - work_fetch.cpp - -Charlie 3 Oct 2011 - - client: Fix compiler warnings. - - client/ - cpu_sched.cpp - -David 3 Oct 2011 - - web: fix error in profile listings. - From Uwe Becker. - - html/user/ - profile_menu.php - -David 3 Oct 2011 - - lib: move XML parse test program to its own file. - - Note: XML_PARSER::parse_str() doesn't currently work right - for something like xx. - It should return "xx". - TODO. - - lib/ - parse.cpp,h - parse_test.cpp (new) - Makefile.am - -David 3 Oct 2011 - - scheduler: fix bugs that broke work fetch for anonymous platform; - don't send irrelevant messages to anon platform clients - - sched/ - sched_types.h - sched_send.cpp - -David 3 Oct 2011 - - scheduler: record VirtualBox version # in the host table - - sched/ - handle_request.cpp - lib/ - coproc.cpp,h - -David 4 Oct 2011 - - client: don't generate notice if lookup of host - in remote_hosts.cfg fails. - - client/ - gui_rpc_server.cpp - -David 4 Oct 2011 - - client: don't show "(device N)" if there's only 1 device - - client/ - client_types.cpp - -David 4 Oct 2011 - - client: win compile fixes - - client/ - cpu_sched.cpp - -Rom 4 Oct 2011 - - WINSCR: Before shutting down the screensaver, quickly reinitialize the OpenGL device - on the primary display. Some of the issues being reported with the screensaver - is a left over ghost image of the OpenGL display before the graphics application - was terminated because keyboard/mouse activity was detected. - - clientscr/ - screensaver_win.cpp - win_build/ - boinc_os_ss.vcproj - -David 4 Oct 2011 - - client: in the function that sorts jobs by arrival time, - don't use name as a tiebreaker. - The will typically group jobs of the same application, - and (it is believed that) things run faster when - applications are mixed. - - scheduler: bug: if a client gets host-specific prefs - (e.g. from an account manager) - it will send only the working prefs to the scheduler. - The scheduler then always sends back the DB prefs, - overwriting the host-specific prefs. - Fix: note the mod time in the working prefs, - and only send the DB prefs if they're more recent. - - client/ - cs_statefile.cpp - sched/ - handle_request.cpp - -David 5 Oct 2011 - - client: fix a memory leak; would lose ~120 bytes each time a job is started - - lib/ - filesys.cpp - -Rom 5 Oct 2011 - - Lib: Re-enable boinc lib mem snapshots for BOINC based applications (boinc, - boincmgr, boinc.scr) on Windows. - - lib/ - diagnostics.cpp - -David 5 Oct - - client: fix memory leak when reading stderr of completed job. - This caused 128KB + size of stderr loss for each job. - - client: print error message if reading stderr fails - (e.g. because of malloc failure) - - client/ - app.h - app_control.cpp - -David 5 Oct - - client: free vectors in NOTICES, RSS_FEEDS, and DAILY_XFER_HISTORY - in free_mem() (for mem leak checking) - - client - cs_notice.h - check_state.cpp - net_stats.h - -David 5 Oct - - scheduler: fix bug that caused scheduler to not send GPU jobs - - sched/ - sched_customize.cpp - lib/ - coproc.cpp - -David 5 Oct - - client: problem: suppose a project has 2 data servers, - and one of them is down. - If several downloads from the broken one fail, - we go into "project-level backoff" - and don't start downloads from either server. - (Same applies to uploads). - - Solution: make project-level backoff apply only to - transfers that have already failed at least once - - client/ - pers_file_xfer.cpp - -David 6 Oct - - GUI RPC: add get_daily_xfer_history() RPC for getting - the daily records of #bytes uploaded and downloaded - - lib/ - gui_rpc_client_print.cpp - gui_rpc_client_ops.cpp - gui_rpc_client.h - client/ - boinc_cmd.cpp - gui_rpc_server_ops.cpp - net_stats.cpp,h - main.cpp - -David 6 Oct - - client: fix bug in writing daily xfer history file - - client/ - main.cpp - net_stats.cpp - -Charlie 7 Oct 2011 - - client: write descriptions of OpenCL devices to stdout - (and display in manager's Event log). - - client: work around a bug where OpenCL reports global RAM of ATI - GPUs incorrectly (1/2 of actual value.) - - client/ - coproc_detect.cpp - lib/ - coproc.cpp, .h - -David 7 Oct 2011 - - client/server: change field names in OPENCL_DEVICE_PROP - to match those in the clGetDeviceInfo() calls. - Principles: - - if there's already a name for something, use it. - - follow case conventions - - lib/ - coproc.cpp,h - client/ - coproc_detect.cpp - sched/ - sched_customize.cpp,h - -David 7 Oct 2011 - - scheduler add app_plan() support for plan classes - opencl_nvidia_101 and opencl_ati_101 - - sched/ - sched_customize.cpp - -David 7 Oct 2011 - - client and scheduler: estimate peak FLOPS for GPUs that - are detected by OpenCL but not by native APIs (CUDA/CAL). - This is limited by the fact that OpenCL doesn't give - us the necessary hardware info - (ATI; wavefrontSize; NVIDIA: compute capability). - We use the minimum values for these, - so in most cases we'll be underestimating the peak FLOPS. - - lib/ - coproc.cpp,h - -David 7 Oct 2011 - - client (Mac): there was no error check of the creation - of a memory-mapped file used for communication with an app. - Add a check, and don't start the job if it fails. - - client/ - app_start.cpp - -David 7 Oct 2011 - - client: don't do scheduler-requested RPCs if - - project is set to No New Work, and - - project has no jobs on the client - - client/ - client_types.h - work_fetch.cpp - cs_scheduler.cpp - -David 7 Oct 2011 - - client/scheduler: the code for estimating peak FLOPS of ATI GPUs - (from Crunch3r) has a multiplier of 2.5 for cores/processor. - This is possibly because give a double-precision estimate. - But actually we want single-precision. Change it to 5. See - http://golubev.com/about_cpu_and_gpu_2_en.htm - - lib/ - coproc.cpp - -Charlie 7 Oct 2011 - - client: improve code which writes OpenCL descriptions. - - client/ - coproc_detect.cpp - -Charlie 7 Oct 2011 - - client: Compare openCL-only devices by estimated peak flops. - - client/ - coproc_detect.cpp - lib/ - coproc.cpp,h - -David 7 Oct 2011 - - scheduler: problem: in the daily quota mechanism, - the boundary between days is 00:00 in server local time. - This creates a spike of jobs being dispatched - (and files being downloaded) after that time. - - Solution: distribute the boundary uniformly, - using a random number determined by the host ID. - (Make sure to save/restore the seed around this, - so we don't destroy the randomness of other things) - - sched/ - handle_request.cpp - -David 7 Oct 2011 - - client: compare OpenCL-only devices the same as other devices - - code cleanup - - lib/ - coproc.cpp,h - client/ - coproc_detect.cpp - sched/ - sched_customize.cpp - -David 8 Oct 2011 - - scheduler: fix crashing bug when using HR. From Kevin Reed. - - sched/ - sched_version.cpp - -Charlie 8 Oct 2011 - - client: Fill in peak flops for each OpenCL GPU before compare; - else there is nothing to ompare with. - - client/ - coproc_detect.cpp - -David 8 Oct 2011 - - API: don't crash if send trickle msg running standalone. - From Christian Ries. - - api/ - boinc_api.cpp - -David 8 Oct 2011 - - client: fix bugs in acct manager attach/detach - - client/ - gui_rpc_server_ops.cpp - -Charlie 10 Oct 2011 - - code cleanup - - lib/ - coproc.cpp,h - client/ - coproc_detect.cpp - -Rom 10 Oct 2011 - - client: Fix crashing bug in OpenCL detection on Windows. - - lib: Fix crashing bug for debug builds of the BOINC client software - - client/ - coproc_detect.cpp - lib/ - diagnostics.cpp - -Charlie 10 Oct 2011 - - code optimization - - client/ - coproc_detect.cpp - -Charlie 11 Oct 2011 - - Mac installer: follow recommendations of Apple Developer Technical - Support: create users and groups boinc_master and boinc_project - at first available UserIDs and GroupIDs starting at 501 instead - of 25 to avoid conflicts with UserIDs and groupIDs which may be - added in the future; use Directory Services to find the user - names of all human users instead of stepping through the entries - in the /Users directory. - - Mac installer: revert to using LoginItemAPI.c under OS 10.7.1, - because it once again sets hidden property for login items, but - the AppleScript seems not to work under OS 10.7.1. - - clientgui/ - mac/ - SetupSecurity.cpp - mac_installer/ - PostInstall.cpp - -Rom 11 Oct 2011 - - Tag for 6.13.7 release, all platforms - boinc_core_release_6_13_7 - - / - configure.ac - version.h - -David 11 Oct 2011 - - client/server: add a new result state RESULT_UPLOAD_FAILED - for when the job completed successfully but - one or more output files had permanent upload failures. - Show this state in web interfaces. - - sample_work_generator: check return value of count_unsent_results(), - so that we don't generate infinite work if there's a DB problem - - web: RSS feed shows news items from last 90 days, rather than 14 - - sched/ - sample_work_generator.cpp - html/ - inc/ - result.inc - user/ - rss_main.php - lib/ - coproc.cpp,h - error_numbers.h - common_defs.h - client/ - client_types.cpp,h - client_state.cpp - coproc_detect.cpp - -David 11 Oct 2011 - - client and user web: show NVIDIA driver version and CUDA version - as, e.g., 275.33 instead of 27533 - - html/inc/ - host.inc - lib/ - coproc.cpp - -Rom 11 Oct 2011 - - vbox: Move the destination of the VBOX_USER_HOME environment variable to - /projects/virtualbox so that the virtualbox configuration - can remain consistent across one or more projects. - - samples/vboxwrapper/ - vbox.cpp - -Charlie 11 Oct 2011 - - client: fix NVIDIA driver version and CUDA version display for Mac. - - lib/ - coproc.cpp - -Rom 11 Oct 2011 - - Tag for 6.13.8 release, all platforms - boinc_core_release_6_13_8 - - / - configure.ac - version.h - -David 11 Oct 2011 - - scheduler: fix a bug that would choose app versions erroneously. - The problem: the choice of app version was based on - the "projected FLOPS" return by estimate_flops(av). - If usage stats exist for the host / app version, - this returns a number X such that - WU.rsc_fpops_est/X approximates the runtime of a job - using the given app version.. - (If WU.rsc_fpops_est is way off, this will be correspondingly way off - from the actual FLOPS the app version will get.) - However, if there are no usage stats, - it return an estimate based on host hardware speed, - which might be 100X less. - Hence, in some cases a new app version would never get used. - - Solution: choose app versions based on the values - returned by the app plan functions. - Use estimate_flops() AFTER choosing the version. - - scheduler: improve the accuracy of FLOPS estimation for GPU apps. - The "flops_scale" argument to coproc_perf - (which expresses the difference between peak GPU FLOPS - and actual FLOPS) should be used to scale GPU FLOPS - prior to calling coproc_perf(), - rather than scaling the estimate returned by coproc_perf(). - - show_shmem: show have_X_apps flags - - sched/ - sched_customize.cpp - sched_version.cpp - sched_shmem.cpp - -Charlie 12 Oct 2011 - - client: fix honoring of cc_config ignore GPU options. - - client/ - coproc_detect.cpp - -Charlie 13 Oct 2011 - - atiopencl sample: call boinc_get_opencl_ids() if not stand-alone; - improve error messages. - - samples/ - atiopencl/ - atiopencl.cpp - -Rom 13 Oct 2011 - - WINSCR: Move the reset display call to the end of the full screensaver - section. We do not need to perform a display reset in the various - test modes. - - clientscr/ - screensaver_win.cpp - -David 13 Oct 2011 - - client: fix bug where network suspend got ignored when - OS suspends (e.g. sleep or hibernate) - - client/ - cs_prefs.cpp - -David 13 Oct 2011 - - client: create and destroy PERS_FILE_XFERs even if network suspended. - This will show pending uploads in the Transfers tab. - - file_upload_handler: fix message to client when can't acquire lock - - client: parse in state file correctly - - client/ - client_stte.cpp - sim.cpp - cs_statefile.cpp - cs_files.cpp - sched/ - file_upload_handler.cpp - -David 13 Oct 2011 - - web: fix bug in user search when enter empty name prefix - - html/user/ - user_search.php - -Rom 13 Oct 2011 - - MGR: Support both the old and new libnotify at runtime on Linux - - clientgui/gtk/ - taskbarex.cpp - -David 13 Oct 2011 - - manager: don't show slot number in simple view task list - - clientgui/ - sg_TaskPanel.cpp,h - -Rom 13 Oct 2011 - - MGR: Remove code that blocks the switch to simple view when an - accessibility aid is running. - - clientgui/ - BOINCGUIApp.cpp - AdvancedFrame.cpp - -Rom 14 Oct 2011 - - Remove dead code related to v5 graphics applications from the - client software. - - client/ - boinc_cmd.cpp - clientgui/ - AsyncRPC.cpp, .h - BOINCGUIApp.cpp, .h - MainDocument.cpp - clientgui/gtk/ - taskbarex.cpp - clientscr/ - screensaver.cpp - lib/ - gui_rpc_client.h - gui_rpc_client_ops.cpp - win_build/ - win-config.h - -Rom 14 Oct 2011 - - MGR: Remove the triangle in the lower right-hand corner of the - default project image for the simple GUI - - clientgui/res/skins/default/graphic/ - project_image.xpm - -Rom 14 Oct 2011 - - MGR: Persist Simple GUI notification dialog size and position - information. - - MGR: Remove context menu help buttons from dialog. - - clientgui/ - sg_DlgMessages.cpp - -David 14 Oct 2011 - - client: show OpenCL version correctly on Win - lib/ - coproc.cpp - -David 14 Oct 2011 - - client: improvements to job scheduling and work fetch policies. - - Job scheduling: the baseline policy is to schedule based on "project priority", - which is how much processing P should receive based on resource share - minus how much it actually has received recently. - This policy tends to run jobs from the same project together, - so we modified it by adding a priority adjustment as jobs are scheduled. - The idea is that if 2 projects have about the same priority - they should split the processors. - - The problem: the adjustment was too large on hosts that are on - only a small fraction of the time, - thus tending to run 1 job from each project, regardless of priority. - - Solution: make an adjustment that reflects the host's actual throughput. - See adjust_rec_sched() for details. - - - Work fetch: similar situation. - We were making an adjustment based on how much work the project currently has queued, - but the adjustment drowned out the project priority, - so we'd tend to always get work from the project that has least work queued. - Solution: make a smaller adjustment (-.3 ... .3) - - - client: in message announcing app start, show the plan class - - - client: don't show "unrecognized XML" messages for account files. - It's typically project-specific prefs that the client doesn't know about. - - client/ - app_start.cpp - client_state.cpp - cpu_sched.cpp - cs_account.cpp - work_fetch.cpp + html/ + inc/ + sandbox.inc + user/ + lammps.php + submit.php -David 14 Oct 2011 - - client: bug fix for the above - client/ - work_fetch.cpp +Rom 1 Jan 2012 + - OPS: Update failure_result_summary_by_platform.php to include + plan class information. + - OPS: Update error code translation table + + html/inc + result.inc + html/ops + failure_result_summary_by_platform.php -David 14 Oct 2011 - - scheduler: in cuda_check(), ati_check() and opencl_check() - (in sched_customize.cpp) - the flops_scale argument is intended to express the - GPU efficiency (actual/peak). - Pass appropriate values. +David 2 Jan 2012 + - ops: fix link in index page - sched/ - sched_customize.cpp - sched_version.cpp html/ ops/ index.php - inc/ - db_ops.inc + user/ + sandbox.php + +Rom 2 Jan 2012 + - VBOX: If VirtualBox reports an error snag both the hypervisor system + log as well as the VM execution log. Maybe the hypervisor log + will tell us what is up with the virtual floppy device. + - VBOX: Don't retry commands that are expected to fail in normal use + cases. It slows down getting the VM up and running. + - VBOX: After starting the VM, use a timed loop waiting for the initial + VM state change instead of just waiting for 5 seconds. Older + machines can take longer than 5 seconds to switch from poweroff + to starting. If we hit the main poll loop in that state the wrapper + thinks we have crashed. + - VBOX: Strip carriage returns from all the vboxmanage output on + Windows. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp -David 16 Oct 2011 - - client simulator: make the output more graphical +David 2 Jan 2012 + - client: compute projects' disk share (based on resource share). + Report it (along with disk usage) in scheduler request messages. + This will allow the scheduler to send file-delete commands + if the project is using more than its share. + - client: add log flag + - create_work: add --help, show --command_line option + tools/ + create_work.cpp html/ inc/ util.inc - client/ - sim.cpp - -David 17 Oct 2011 - - add boinc_opencl.h to set of installed headers - - emulator tweaks - lib/ - Makefile.am - client/ - sim.cpp - sim_util.cpp - -David 17 Oct 2011 - - client: call xp.skip_unexpected() if get unexpected tag, - to avoid showing multiple error messages - - client simulator: bug fixes and tweaks - - client/ - client_types.cpp,h - app.h - sim.cpp,h - work_fetch.cpp - sim_util.cpp - -David 17 Oct 2011 - - client: associate a PROJECT with HTTP_OP where applicable, - so that if you use and filter by project - you don't see other projects' HTTP stuff - - client simulator: cc_config.xml is part of the scenario; - log flags are part of the simulation - - client/ - http_curl.cpp,h - sim.cpp - work_fetch.cpp - file_xfer.cpp - gui_http.cpp - scheduler_op.cpp - -Rom 17 Oct 2011 - - MGR: Make the Default skin loadable from the file system. - - MGR: Change the in-memory defaults for the skin to be a light-gray - background. - - MGR: Change the dots used in the simple gui. - - MGR: Make the dots used in the simple gui skinable. - - MGR: Change the 'Project Web Sites' button text to 'Project Web Pages'. - - MGR: Add a basic 'Default' skin to be included by the various - installers - - MGR: Remove a bunch of files that are not used by the default skin - anymore. - - clientgui/res/skins/default/graphic/ - - clientgui/res/templates/ - dotgreen.gif - dotred.gif - dotyellow.gif - clientgui/ - sg_DlgPreferences.cpp - sg_ProjectPanel.cpp - sg_TaskPanel.cpp, .h - SkinManager.cpp, .h - clientgui/skins/Default/ - background_image.png - clientgui/skins/Default/ - skin.xml - -David 18 Oct 2011 - - backend API: added function cancel_jobs(minid, maxid) - for canceling jobs - - added program cancel_jobs for canceling jobs - - DB interface: it's not an error if update_fields_noid() - affects != 1 rows - - db/ - db_base.cpp - tools/ - backend_lib.cpp,h - cancel_jobs.cpp (new) - poll_wu.cpp - Makefile.am - lib/ - parse.cpp - py/Boinc/ - setup_project.py - -Charlie 18 Oct 2011 - - Mac: Update Mac build scripts, XCode project and source files - to allow automated builds under OS 10.7 Lion and XCode 4.2. - - Mac: Build and link jpeglib from boinc/samples/jpeglib instead - of requiring a separate jpeglib-6b directory. - - api/ - gutil.cpp - gutil_text.cpp + user/ + sandbox.php lib/ - mac/ - QBackTrace.c - QCrashReport.c - mac_build/ - boinc.xcodeproj/ - project.pbxproj - buildc-ares.sh - buildcurl.sh - BuildMacBOINC.sh - buildWxMac.sh - setupForBOINC.sh - mac_installer/ - Installer.cpp - PostInstall.cpp - samples/ - jpeglib/ - jconfig.h - -Rom 18 Oct 2011 - - MGR: More simple GUI text changes - - MHR: Reduce clutter in log file - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_ProjectPanel.cpp, .h - -David 18 Oct 2011 - - client: change the way project priorities are computed, - so that they do what they're supposed to - (i.e. enforce resource shares) - - client: change log flag to - - client simulator: update REC even with large delta-t. - - client simulator: handle "no new work" apps correctly - - api/ - Makefile.am + cc_config.cpp,h client/ - work_fetch.cpp,h client_types.h - client_state.cpp - sim.cpp - rr_sim.cpp - sim_util.cpp + client_state.h + cs_prefs.cpp + cs_scheduler.cpp cpu_sched.cpp -David 18 Oct 2011 - - client: fix bug that caused extra "<" to get written at - end of global_prefs_override.xml and cc_config.xml - when they are modified via GUI RPCs +David 2 Jan 2012 + - upgrade script: + - prompt user for DB user/passwd if DB updates needed + - error out immediately if any DB update fails + Fixes #1169, #1170 + - create_work: check for duplicate s in input template + NOTE: the input template syntax is pretty clunky - client/ - gui_rpc_server_ops.cpp - -David 19 Oct 2011 - - client: fix crashing bug when there's a cycle in the process graph. - I had fixed this in one place but not another. - - client: don't memset(0,) a PROCINFO; use clear() instead + tools/ + process_input_template.cpp + html/ + ops/ + upgrade_db.php + inc/ + util_ops.inc - lib/ - proc_control.cpp - procinfo_mac.cpp - procinfo_unix.cpp - procinfo_win.cpp - -Charlie 19 Oct 2011 - - Mac: Update XCode project and Mac build scripts to build - libboinc_opencl.a library and to work both with XCode 3.2 on - OS 10.6.8 and with XCode 4.2 on OS 10.7.2. +Rom 2 Jan 2012 + - VBOX: Fix crashing issue I introduced last night attempting to + extract the hypervisor system log. + - VBOX: Report the hypervisor system log with any failed vboxmanage + command that happens during the phase where we setup the VM. - mac_build/ - boinc.xcodeproj/ - project.pbxproj - BuildMacBOINC.sh - -Charlie 19 Oct 2011 - - MGR: Replace backup images RedDot16.xpm, YellowDot16.xpm and - GreenDot16.xpm with XPM files created from Rom's new files - dotred.gif, dotyellow.gif and dotgreen.gif. These need to - be cmpiled into the source code as backups in case the GIFs - are missing, because these images are essential resources. - - clientgui/ - res/ - RedDot16.xpm - YellowDot16.xpm - GreenDot16.xpm - -Charlie 19 Oct 2011 - - MGR: Simple View bug fix. - - clientgui/ - sg_TaskPanel.cpp + samples/vboxwrapper/ + vbox.cpp, .h -Rom 19 Oct 2011 - - MGR: Fix dot images - - clientgui/res/skins/default/graphic/ - workunit_running_image.xpm - workunit_suspended_image.xpm - workunit_waiting_image.xpm - clientgui/res/templates/ - dotgreen.gif - dotred.gif - dotyellow.gif +David 3 Jan 2012 + - remote job submission: show input file links + - ops: fix message: app.min_version applies to HR app versions, + not client version -David 19 Oct 2011 - - client simulator: bug fix + html/ + ops/ + manage_apps.php + user/ + submit.php + sandbox.php - client/ - sim.cpp - lib/ - parse.cpp +David 3 Jan 2012 + - LAMMPS -Charlie 20 Oct 2011 - - MGR: Replace colored dot GIF files with new PNG files which do - the anti-aliasing in the alpha channel, so they look correct - when highlighted on the Mac. Generate new XPM files from - these PNG files. - - clientgui/res/skins/default/ - graphic/ - workunit_running_image.xpm - workunit_suspended_image.xpm - workunit_waiting_image.xpm - skin.xml (added) - clientgui/res/templates/ - dotgreen.gif (deleted) - dotred.gif (deleted) - dotyellow.gif (deleted) - Green_dot.png (added) - Red_dot.png (added) - Yellow_dot.png (added) + html/user/ + lammps.php -Charlie 20 Oct 2011 - - MGR: Force update of Task Selection List on reskin interface. - - clientgui/ - sg_TaskPanel.cpp,h +David 3 Jan 2012 + - client: calculate disk share for zero-priority projects correctly -Charlie 20 Oct 2011 - - MGR: Move skin file to correct place, set background image's - background color to black for this background_image.png. - - clientgui/ - res/skins/default/ - skin.xml (deleted) - skins/Default/ - skin.xml - -David 21 Oct 2011 - - client/API: pass bool using_sandbox in APP_INIT_DATA; - says whether the client is using account-based sandboxing. - Needed by vboxwrapper. - - web: don't show authenticator in Your Account page. - The problem with authenticators is that if a bad guys gets yours, - they can log in to your account even if you change your password. - Eventually we should not use them at all - (i.e. in cookies and sent to client). - - make_project: copy python stuff (e.g. bin/start) for web-only projects; - generate appropriate project.readme file for web-only projects. + client/ + cs_prefs.cpp - html/inc/ - user.inc - lib/ - app_ipc.cpp,h +Rom 3 Jan 2012 + - client: Remove scaling factor for AMD OpenCL devices. Latest + generation of drivers now report the correct memory size. + They didn't wait for the next OpenCL spec change. + client/ - app_start.cpp - cs_scheduler.cpp - tools/ - make_project - py/Boinc/ - setup_project.py - -Charlie 21 Oct 2011 - - MGR: Adjust preference dialog titles, improve Simple View menus - and other text, make Simple Preferences dialog more like - Advanced Preferences dialog. + coproc_detect.cpp - clientgui/ - AdvancedFrame.cpp - DlgAdvPreferencesBase.cpp - DlgOptions.cpp - Events.h - sg_BoincSimpleFrame.cpp,.h - sg_DlgMessages.cpp,.h - sg_DlgPreferences.cpp,.h - -Rom 21 Oct 2011 - - VBOX: Don't redirect VirtualBox to a different directory structure for - the root configuration file when the client is NOT in sandbox mode. - Doing so could cause confusion if the volunteer uses VirtualBox for - any of their own work. If BOINC started up first it would have appeared - that their own VM's no longer existed. +Rom 3 Jan 2012 + - VBOX: Per tester feedback, at an hourly status report to track + network usage. + - VBOX: For errors where an error code is specified in the output, + use that value when returning from vbm_open(). Make it easier + to track failure rates by problem type in the ops pages. + (Windows Only) + - VBOX: Try making the process of extracting the hypervisor system + log more robust, make a temp copy of it in the slot directory. + Avoid exclusive file lock issues since VboxSvc will still be + logging to it. + - VBOX: Change the session lock text to make it clearer that the + use of other VirtualBox management tools can cause a problem. + samples/vboxwrapper/ - vbox.cpp + vbox.cpp, .h + vboxwrapper.cpp -Rom 21 Oct 2011 - - MGR: Make the simple gui rounded edges seem smoother by increasing the - radius. - - MGR: Fix project name font in the tasks area, normal size. Increase - its weight to BOLD. - - MGR: Make sure the dot is red if the project has been suspended for - the given task. +Rom 3 Jan 2012 + - VBOX: Restore the elapsed time from the checkpoint file instead of + aid.starting_elapsed_time. It appears some older client versions + are giving erratic results. - clientgui/ - sg_PanelBase.cpp - sg_TaskPanel.cpp + samples/vboxwrapper/ + vboxwrapper.cpp -David 21 Oct 2011 - - scheduler: fix calculation of ATI peak FLOPS; - older clients don't report have_cal. +Rom 4 Jan 2012 + - VBOX: Use strtol instead of atol to parse Vbox error codes from + stderr/stdout output. + - VBOX: Undo my reorg yesterday with regards to report_vm_pid and + report_net_usage. + - VBOX: Only report network usage in the status report if + aid.global_prefs.daily_xfer_limit_mb is non-zero + - VBOX: Add the VM log to the list of things reported on a start + failure. Hypervisor log suggests that it launched the VM but + it failed unexpectedly. So there might be cases where it + actually exists. - lib/ - coproc.cpp + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp -Rom 21 Oct 2011 - - MGR: Scale background skin so that it now fits in the new simple gui - NOTE: We are in the process of trying to get new artwork so that we - can handle the localization issues better. +Rom 4 Jan 2012 + - VBOX: Move start state change detection code from run() function to + start() function and use similar code to handle stop as well. + + Weird stuff happens when people start/stop BOINC quickly, + it looks as though the previous VM instance isn't shutdown before we + attempt to start it again. Hopefully enough of a wait is in there + for the VM to fully halt before the wrapper is terminated. - clientgui/skins/Default/ - background_image.png - -David 21 Oct 2011 - - fix NVIDIA peak FLOPS - - lib/ - coproc.cpp - -David 21 Oct 2011 - - update_versions: touch trigger file so that feeder rereads DB - - tools/ - update_versions - -Charlie 21 Oct 2011 - - MGR: Fix crash bug. - - clientgui/ - sg_BoincSimpleFrame.cpp,.h + samples/vboxwrapper/ + vbox.cpp -Charlie 21 Oct 2011 - - MGR: Fix project name font on Mac, which uses Lucinda Grande font - not Arial. SetFont for the parent window does not propogate to - the text controls because CTransparentStaticText uses OnPaint() - to draw. - - clientgui/ - sg_TaskPanel.cpp +Rom 4 Jan 2012 + - VBOX: Fix a crash bug if multiple virtual NICs are defined for a VM. + I'm not sure what the heck happened. It probably has something to + do with my \r removal code on Windows. Bugs hidden by other bugs + I suppose. -Charlie 22 Oct 2011 - - MGR: Bug fix: when the task currently selected in Simple View - is deleted, change selection to a different task. - - clientgui/ - sg_TaskPanel.cpp + samples/vboxwrapper/ + vbox.cpp -Charlie 23 Oct 2011 - - MGR: Sort Simple View task selection control alphabetically. +Rom 5 Jan 2012 + - VBOX: Extract the various logs before attempting to cleanup if the + registration process fails. - clientgui/ - mac/ - MacBitmapComboBox.cpp,.h - sg_TaskPanel.cpp - -Charlie 23 Oct 2011 - - MGR: Reverted the above change because wxBitmapComboBox on Windows - loses existing items' clientData when we Insert() a new item. - - clientgui/ - sg_TaskPanel.cpp - -David 23 Oct 2011 - - web: forum RSS shouldn't filter sticky threads. - Not sure why that was in there. - html/inc/ - forum_rss.inc - -Charlie 24 Oct 2011 - - Mac installer: Fix a very old bug. - - mac_build/ - Mac_SA_Secure.sh - -David 24 Oct 2011 - - client: reimplement the round-robin simulator to - reduce its runtime from O(N^2) to O(N), - where N is the number of runnable jobs - (which can be in the thousands). - This will make the client emulator run a lot faster, - and will reduce the client CPU overhead a bit. - - API: change boinc_get_opencl_ids() so that it returns - a BOINC error code (< -100) if the app_init.xml is - missing or bad (i.e. we're running standalone), - and an OpenCL error code (> -100) if an OpenCL call failed. - - client/ - work_fetch.cpp,h - client_types.h - sim.cpp - rr_sim.cpp - -Rom 24 Oct 2011 - - MGR Skins: Fix numerious issues related to bad entries in the Skin XML - file. - - clientgui/ - SkinManager.cpp - clientgui/skins/GridRepublic/ - skin.xml - clientgui/skins/Progress Thru Processors/ - skin.xml + samples/vboxwrapper/ + vboxwrapper.cpp -David 24 Oct 2011 - - API: compile fixes for MinGW. From Oliver Bock. +David 5 Jan 2012 + - GUI RPC: use new XML parser lib/ - win_util.h - boinc_win.h - proc_control.h - Makefile.mingw - parse.h - -Charlie 25 Oct 2011 - - MGR: Sort Simple View task selection control alphabetically. - Subclassed CBOINCBitmapComboBox from wxBitmapComboBox to work - around clientData bug in wxBitmapComboBox::Insert(). - - clientgui/ - BOINCBitmapComboBox.cpp,.h (added) - mac/ - MacBitmapComboBox.cpp,.h - sg_PanelBase.h - sg_ProjectPanel.cpp - sg_TaskPanel.cpp,.h - win_build/ - boincmgr.vcproj - -Charlie 25 Oct 2011 - - MGR: Allow skin to specify the (simulated) opacity of Simple View - task and project panels on a scale of 0 (clear) to 255 (opaque). - - clientgui/ - sg_PanelBase.cpp - SkinManager.cpp,.h - -Rom 25 Oct 2011 - - Tag for 6.13.9 release, all platforms - boinc_core_release_6_13_9 - - / - configure.ac - version.h - -David 25 Oct 2011 - - web: typo in forum RSS from Daniel L G; fixes #1147 - - client: message tweak - - html/inc/ - forum_rss.inc - client/ - cpu_sched.cpp - -David 25 Oct 2011 - - scheduler: fix bug in the "homogeneous app version" (HAV) feature - (reported by Kevin Reed). - The problem: cache inconsistency. - If there are 2 results for the same WU in shared mem, - and 2 scheduler instances get them around the same time, - they can send them with different app versions. - We already fixed this problem for HR by - 1) rereading the relevant WU fields while deciding - whether to send the result - 2) doing a "careful update" of the WU field using a where clause - to make sure it wasn't modified in the (short) interval - since rereading it. - I fixed the HAV problem in the same way, - and merged the two mechanisms to combine the DB queries. - - Also: - - The rereads are done in slow_check() (see below). - - The careful updates are done in update_wu_on_send(), - and this is called *before* doing careful updates on result fields. - That way, if the WU updates fail, we don't have orphaned results. - - already_sent_to_different_platform_careful() (sic) - no longer does DB stuff, so it's merged with - already_send_to_different_hr_class() (better name) - - NOTE: slow_check() is used in array scheduling only. - Score-based scheduling uses other code, - in which this bug is not yet fixed. - Locality scheduling doesn't support HR or HAV at all. - This should be unified. - - db/ - db_base.cpp,h - sched/ - sched_hr.cpp,h - sched_array.cpp - sched_send.cpp - sched_score.cpp - -Charlie 26 Oct 2011 - - Mac: Modify XCode project to link with libcrypto.0.9.7.dylib and - libssl.0.9.7.dylib if OS 10.5 SDK is present, to allow running - BOINC on OS 10.4 and later. If OS 10.5 SDK is not present then - it will link with libcrypto.0.9.8.dylib and libssl.0.9.87.dylib - and product will require OS 10.6 or later. - (Checked into 6.13.9 tag.) - - mac_build/ - boinc.xcodeproj/ - project.pbxproj + gui_rpc_client_ops.cpp -Charlie 26 Oct 2011 - - Mac: Update build instructions for client and libraries. - - Mac installer: fix bugs when installing under OS 10.5. - - Mac installer: Update release script to include Default skin. - (All checked into 6.13.9 tag.) +Charlie 5 Jan 2012 + - client: Restore scaling factor for AMD OpenCL devices on Macs with + OpenCL version < 1.2. - mac_build/ - HowToBuildBOINC_XCode.rtf - mac_installer/ - postInstall - PostInstall.cpp - release_boinc.sh - -David 26 Oct 2011 - - scheduler: tweaks to last night's checkin. - In the inner loop of scan_work_array() there are two WORKUNITs: - - the one that's part of wu_result (in the shared-mem array) - - a temp copy. - quick_check() may modify this in host-specific ways - (e.g., adjusting rsc_fpops_est or delay_bound). - This is the one we pass to add_result_to_reply(). - When we reread hr_class and app_version_id from the DB, - update both structs. - - sched/ - sched_array.cpp - sched_send.cpp - -David 26 Oct 2011 - - client: fix typo in project parse code - - client/ - client_types.cpp - -David 26 Oct 2011 - - scheduler: typo in a SQL query - - sched/ - sched_send.cpp - -David 26 Oct 2011 - - web: fix typo that failed to show ATI GPUs in top-GPU page - - html/user/ - gpu_list.php - -David 26 Oct 2011 - - client: smoothed working-set size wasn't being computed correctly. - It was always just the most recent size. - - sched/ - sched_util.cpp - sample_work_generator.cpp - lib/ - procinfo.h client/ - app.cpp - -David 26 Oct 2011 - - scheduler: bug fix from Kevin - - sched/ - sched_send.cpp + coproc_detect.cpp -Charlie 27 Oct 2011 - - Mac installer: Update release script to create projects/virtualbox/ - directory, to ensure it has the correct owner and permissions - because vboxwrapper does not have sufficient privileges to do so. +Charlie 6 Jan 2012 + - Mac Installer: Changes for integrated BOINC+VirtualBox Mac installer. + clientgui/ + mac/ + SetVersion.cpp mac_installer/ + Description.plist + Installer.cpp release_boinc.sh -Rom 27 Oct 2011 - - Tag for 6.13.10 release, all platforms - boinc_core_release_6_13_10 - - / - configure.ac - version.h - -Charlie 28 Oct 2011 - - Mgr: Exit manager as soon as quit rpc to client succeeds, instead - of waiting for client to exit. - (Checked in to 6.13.10 for Mac build only.) - - The problem: if suspended tasks are kept in memory, some project - applications don't respond to exit request from client, but client - needs to allow 20 seconds before killing them in case they are - writing a large checkpoint file. But if the manager waits that - long to exit, it seems unresponsive to users, so it was killing - the client after only 10 seconds. This left orphan project apps - in RAM. - - The solution: assume that if the quit rpc to the client succeeds, - the client will exit properly, so kill client only if RPC fails - or is not completed in 10 seconds. +Rom 6 Jan 2012 + - MGR: Remove sash window divider between the task panel and list panel + in the advanced view. Retain the ability to dynamically adjust the + width of the task panel based on widest button. + - LIB: Use parse string instead of copy contents for messages RPC. clientgui/ - BOINCClientManager.cpp - BOINCGUIApp.cpp,.h - -David 28 Oct 2011 - - GUI RPC client: parse the reply of quit(), - so that it returns an error if no response - + BOINCBaseView.cpp, .h + ViewNotices.cpp + ViewResources.cpp + ViewStatistics.cpp lib/ gui_rpc_client_ops.cpp -David 28 Oct 2011 - - web: Display AMD GPU info correctly. From Teemu Mannermaa. - - html/inc/ - host.inc +Rom 6 Jan 2012 + - VBOX: Use sscanf instead of strtol to convert a hex string. + - VBOX: Use new FloppyIO implementation that reports image + creation errors. -Charlie 29 Oct 2011 - - Mgr: Code cleanup. - - clientgui/ - BOINCClientManager.cpp,.h - BOINCGUIApp.cpp,.h - MainDocument.cpp + samples/vboxwrapper/ + floppyio.cpp, .h + vbox.cpp -David 29 Oct 2011 - - lib: fix a "strcpy(p, p+1)" instance +David 6 Jan 2012 + - manager: parse message contents with XML_PARSER::element_content(). lib/ - url.cpp + gui_rpc_client_ops.cpp -Charlie 31 Oct 2011 - - api: Update comments, remove unused includes for boinc_opencl.a. - - api/ - boinc_opencl.cpp +David 6 Jan 2012 + - validator: for credit_from_runtime, + use result.flops_estimate rather than host.p_fpops; + otherwise it doesn't work for multicore apps. + TODO: cheat-proofing + + sched/ + validator.cpp + html/user/ + forum_thread.php -David 2 Nov 2011 - - API: fix bug in boinc_get_opencl_ids() - - add simulator for distributed storage (not finished) +Rom 6 Jan 2012 + - MGR: Derive from the correct base class to make the sizers work + properly. + + clientgui/ + BOINCBaseView.cpp, .h + ViewNotices.cpp + ViewResources.cpp - api/ - boinc_opencl.cpp - client/ - app_start.cpp - ssim/ - des.h - ssimp.cpp - makefile +Rom 7 Jan 2012 + - VBOX: Sleep for the remainder of the polling period and not the + whole poll period. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp, .h -David 2 Nov 2011 - - server: plan class names containing 'nvidia' or 'cuda' - are assumed to be for NVIDIA GPU apps; - plan class names containing 'ati' are assumed to be for AMD GPU apps. - Clauses for 'nvidia' were missing in a couple of places. +David 7 Jan 2012 + - scheduler: change vbox_mt app plan function to use 1, 2 or 3 CPUs + depending on how many the host has, + and whether CPU VM extensions are present + (this reflects the requirements of CernVM). + db/ + boinc_db.h sched/ + sched_types.h sched_customize.cpp - sched_version.cpp - html/inc/ - util.inc - lib/ - gui_rpc_client_ops.cpp - -David 2 Nov 2011 - - scheduler: in update_wu_on_send(), always try to update - the hr_class and app_version_id fields, - with the where clause that they be either zero or the target value. - This handles the cases where - 1) because of the failure of a results, the transitioner set - the field back to zero; - 2) another scheduler set the field to the target value - (from Kevin Reed) + validator.cpp - sched/ - sched_send.cpp - client/ - makefile_sim +Rom 8 Jan 2012 + - VBOX: Fix regression where the ERR_CPU_VM_EXTENSIONS_DISABLED error + message wasn't being written to stderr when the VM extensions + were disabled via the BIOS. + + samples/vboxwrapper/ + vboxwrapper.cpp -David 2 Nov 2011 - - feeder: fix logic error in the way app_version.pfc_scale is updated - (from Kevin Reed) +David 8 Jan 2012 + - scheduler: change vbox_mt plan function to use at most 2 cores, not 3 + (CERN doesn't actually need 3) sched/ - credit.cpp + sched_customize.cpp -Charlie 3 Nov 2011 - - api: Restore lost checkin of 31 October 2011. - - Mac installer: update ReadMe files for BOINC 6.13.x. - - api/ - boinc_opencl.cpp - mac_installer/ - CE-ReadMe.rtf - GR-ReadMe.rtf - PTP-ReadMe.rtf - ReadMe.rtf - -David 3 Nov 2011 - - client: fix bugs when writing/parsing cc_config.xml via GUI RPCs - (e.g. when editing it via the Manager). - Include only the GPUs that were specified in the original cc_config.xml, - not those detected by the client. - - client: fix bug that failed to require authorization for - GUI RPCs that are supposed to be authorized - - client: report parse errors in acct_mgr_url.xml and acct_mgr_login.xml - - fix compile warnings - - user web: in sample project_specific_prefs.inc, - get app names from the DB instead of listing them in the PHP code. +David 8 Jan 2012 + - client: reset ACTIVE_TASK::bytes_sent and bytes_received + when the task is started or restarted - html/project.sample/ - project_specific_prefs.inc - lib/ - coproc.h - cc_config.cpp client/ - switcher.cpp - coproc_detect.cpp - gui_rpc_server_ops.cpp - acct_mgr.cpp - app.cpp - cpu_sched.cpp - -David 3 Nov 2011 - - wrapper: handle Windows .bat files as main programs - - samples/wrapper/ - wrapper.cpp - -David 3 Nov 2011 - - client: show GPU exclusions at startup - (need to do this after reading the state file, - since GPU exclusions refer to projects). - - client: fix bug that added garbage element - to in state file when using GPU exclusions + app_start.cpp +Charlie 9 Jan 2012 + - client: OpenCL 1.1 has no API for determining available GPU RAM, so if + CAL is not present for ATI / AMD GPU or if CUDA is not present for + NVIDIA GPU, set available GPU RAM equal to total GPU RAM. + client/ - client_types.cpp - client_state.cpp - log_flags.cpp + coproc_detect.cpp -David 4 Nov 2011 - - client: fix work fetch bug. - If we're contacting a project to report results, - only piggyback work requests for resources for which - that project is the highest priority that may have work. - - client: compute result.not_started more efficiently +Rom 9 Jan 2012 + - VBOX: Fix one last regression related to failed start detection. If + only one CPU is allocated, manually disable VM hardware acceleration. + + samples/vboxwrapper/ + vbox.cpp - TODO: continue efficiency work. There's still some quadratic stuff +David 9 Jan 2012 + - scheduler: the p_fpops value reported by clients can't be trusted. + Some credit cheats (e.g. with credit_by_runtime) can be done + by reporting a huge value. + Fix this by capping the value at 1.1 times the 95th percentile + of host.p_fpops, taken over active hosts. - client/ - client_types.cpp,h - client_state.cpp - sim.cpp - work_fetch.cpp - cpu_sched.cpp + db/ + boinc_db.cpp,h + sched/ + census.cpp + sched_types.cpp,h + sched_shmem.cpp,h + sched_util.cpp,h + sched_customize.cpp + feeder.cpp + sched_version.cpp + hr_info.cpp,h -Charlie 5 Nov 2011 - - client: Fix compile error. +Charlie 10 Jan 2012 + - client: Fix idle detection for Apple Remote Desktop and screen sharing + (VNC) under Mac OS 10.7. See comments in HOST_INFO::users_idle() for + details. client/ - cs_scheduler.cpp + hostinfo_unix.cpp -Charlie 5 Nov 2011 - - Mac: add -Wno-format-security compiler flag to suppress warning - that format string is not a string literal in code to show - messages from server in CLIENT_STATE::handle_scheduler_reply(). - - mac_build/ - boinc.xcodeproj/ - project.pbxproj +David 10 Jan 2012 + - first stab at improving Disk View colors -Charlie 5 Nov 2011 - - client: fix errors in (currently unused) get_max_cpu_temperature() - code for Macintosh. + clientgui/ + ViewResources.cpp - client/ - hostinfo_unix.cpp +Charlie 11 Jan 2012 + - Mgr: When launching Mac client as a daemon, allow time for it to start. -David 4 Nov 2011 - - client: fix compile warning - client/ - cs_scheduler.cpp + clientgui/ + BOINCClientManager.cpp -David 4 Nov 2011 - - client: attempt to fix bug reported by John McLeod, - where the client crashes after giving up (90 day timeout) on an upload. - I'm guessing this was caused by [24391], - which changed the order in the poll loop from - garbage_collect - file_xfers->poll - pers_file_xfers->poll - handle_pers_file_xfers - to - garbage_collect - handle_pers_file_xfers - file_xfers->poll - pers_file_xfers->poll - I don't understand why this would have caused a crash, - but so be it. - I restored the original order, but with handle_pers_file_xfers - not inside the if (!network_suspended). - - client renamed handle_pers_file_xfers() to - create_and_delete_pers_file_xfers() - - client simulator: show simulator CPU time +David 11 Jan 2012 + - vboxwrapper: add element to config file. + Specifies host port # for port forwarding. + If absent or zero, assign a port. - client/ - client_state.cpp - sim.cpp - client_state.h - pers_file_xfer.cpp - cs_files.cpp + samples/vboxwrapper + vbox.cpp,h + floppyio.cpp,h + vboxwrapper.cpp -Charlie 5 Nov 2011 - - Mac: remove -Wno-format-security compiler flag (no longer needed). - - mac_build/ - boinc.xcodeproj/ - project.pbxproj +David 11 Jan 2012 + - API: respect direct_process_action even if multi_process is set -David 5 Nov 2011 - - scheduler: fix bug in HR code (from Kevin) + api/ + boinc_api.cpp - sched/ - sched_send.cpp +David 12 Jan 2012 + - LAMMPS job submission: improve completion estimate -David 5 Nov 2011 - - client: don't crash if trickle up exceeds 64KB - (this bug was introduced Sept 20) - - scheduler: truncate long trickle-ups to 256KB; don't crash + html/ + inc/ + boinc_db.inc + user/ + lammps.php - db/ - db_base.cpp,h - client/ - cs_trickle.cpp +Rom 12 Jan 2012 + - VBOX: Enable remote desktop functionality for a VM that has + specified in its vbox_job.xml file. + + NOTE: It does require the VirtualBox extension pack, but that + is freely available on the VirtualBox download page. + + samples/vboxwrapper + vbox.cpp, .h + vboxwrapper.cpp, .h -David 6 Nov 2011 - - client: actually do the checking described above +Rom 12 Jan 2012 + - VBOX: Report the remote desktop connection information to the + core client. Next commit will create an extra "VM Console" + button in the manager when detected. Volunteers will just have + to click the button to see what is going on with the VM. - client/ - cs_trickle.cpp + api/ + boinc_api.cpp, .h + samples/vboxwrapper + vbox.cpp, .h + vboxwrapper.cpp, .h -David 6 Nov 2011 - - client: don't crash if a project sends app_version.flops = 0. +Rom 12 Jan 2012 + - client: Add plumbing to support passing the remote desktop + connection information to the manager + - MGR: Add a "Show VM Console" button for those tasks which + report a remote desktop port number. client/ - client_types.cpp - rr_sim.cpp - -Charlie 7 Nov 2011 - - Mgr: Bug fix. - + app.cpp, .h + app_control.cpp clientgui/ - BOINCGUIApp.cpp + Events.h + MainDocument.cpp, .h + ViewWork.cpp, .h + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp -David 7 Nov 2011 - - manager: apparently WxWidget's combo box has problems (bugs) - if multiple items have the same string. - So, in simple view task combo box: - - show % done (unique in most cases) - - remove version number - - instead of showing plan class, show "NVIDIA GPU" or "ATI GPU" - TODO: update the fraction done +Rom 12 Jan 2012 + - VBOX: Make sure the configured port numbers persist across + restarts of the client software. Remote desktop stopped + working if the client software was restarted. - clientgui/ - sg_TaskPanel.cpp + samples/vboxwrapper + vboxwrapper.cpp -David 7 Nov 2011 - - client: condition RR sim negative FLOPs message on rr_simulation. +Charlie 13 Jan 2012 + - client: Due to my changes of 10 Jan 2012, idle detection did not work + when BOINC was run as a pre-login daemon. So use the old method + when running as a daemon. This means that idle detection for Apple + Remote Desktop and screen sharing (VNC) under Mac OS 10.7 works only + when not running BOINC as a daemon. client/ - rr_sim.cpp + hostinfo_unix.cpp -Rom 7 Nov 2011 - - client: reduce complexity, possibly get rid of a crash condition - on 64-bit Windows. - - client/ - cs_prefs.cpp +Rom 13 Jan 2012 + - VBOX: Cleanup a few messages stating port numbers in the stderr spew. + - VBOX: Send configuration settings in one message instead of piece meal. + + api/ + boinc_api.cpp, .h + samples/vboxwrapper + vboxwrapper.cpp -Rom 7 Nov 2011 - - MGR: Change default skin to the one Jacob Klein purposed. +Rom 13 Jan 2012 + - VBOX: It helps to remove the older send msg routines. Oooops. - clientgui/res/templates/ - - clientgui/skins/Default/ - background_image.png - skin.xml - workunit_running_image.png - workunit_suspended_image.png - workunit_waiting_image.png - -David 7 Nov 2011 - - client: on transient upload failure, don't do start_xfer() - within PERS_FILE_XFER::transient_failure(); - we're about to delete and free the FILE_XFER. - The transfer will be restarted in the next poll. + samples/vboxwrapper + vboxwrapper.cpp - client/ - pers_file_xfer.cpp +David 13 Jan 2012 + - API: fix queueing problem for graphics-related messages + (web graphics URL and remote desktop addr) + - GUI RPC and API: + change "remote_desktop_connection" to "remote_desktop_addr" everywhere. + It's an address, not a connection. + - vboxwrapper: log message cleanup -Charlie 8 Nov 2011 - - Mgr: Fix Simple View layout to fit 3 decimal places for % done. + api/ + boinc_api.cpp,h + client/ + app.cpp,h + app_control.cpp + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h + app_ipc.cpp,h + samples/ + vboxwrapper.cpp +Rom 13 Jan 2012 + - MGR: Add RDP client support for Linux. + clientgui/ - sg_TaskPanel.cpp + MainDocument.cpp -Charlie 8 Nov 2011 - - Mac installer: fixes for OS 10.4 compatibility. +David 13 Jan 2012 + - file deleter: improved logging; from Oliver - mac_installer/ - PostInstall.cpp + sched/ + file_deleter.cpp -Rom 8 Nov 2011 - - API: Remove exception trapping stuff from the - boinc_get_opencl_ids. +Rom 13 Jan 2012 + - MGR: Launch the RDP client on Windows in full-screen mode to avoid + a bug where the screen doesn't refresh and keyboard/mouse events + don't manifest until you close down the client and restart it. - api/ - boinc_opencl.cpp - -David 8 Nov 2011 - - DB: use %u when writing result IDs in SQL queries; - this is to support SETI@home, which ran out of result IDs - and changed the DB field type to int unsigned. - Note: eventually I'll make this change official - and change the .h types as well. - - web: put tags around elements - in project-specific prefs. + clientgui/ + MainDocument.cpp - db/ - boinc_db.cpp - db_base.cpp - sched/ - sched_send.cpp - html/project.sample/ - project_specific_prefs.inc +Charlie 13 Jan 2012 + - MGR: Add RDP client support for the Mac. I have found no reliable way + to pass the IP address and port to Microsoft's Remote Desktop + Connection application for the Mac, so I'm using CoRD. Unfortunately, + CoRD does not seem to be as reliable as I would like either. + + clientgui/ + MainDocument.cpp -Charlie 9 Nov 2011 - - Mgr: to fix Windows combo box problem when multiple items have - the same string, add spaces to identical application names in - Task Selection control as needed to make each entry unique. - Don't append % done to Task Selection control entries, as that - varies over time, causing significant complications. +Rom 13 Jan 2012 + NOTE: Some previously experimental features in the client software are + now important to have for the 7.0 release. The existing 7.0 branch + will no longer be maintained, we'll create a new branch for the 7.0 + client line at a later date. + + - Tag for 7.0.8 release, all platforms + boinc_core_release_7_0_8 - clientgui/ - sg_TaskPanel.cpp + / + configure.ac + version.h -Rom 9 Nov 2011 - - WINSCR: Add a reference to SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING - in the message lookup table. - - clientscr/ - screensaver_win.cpp +David 13 Jan 2012 + - The zip library was moved to a directory (project_depends) + outside of BOINC, but the build files weren't made to work. + Move the library back where it was before. -Rom 9 Nov 2011 - - WINSCR: In the ResetProc message pump, change the call for CloseWindow() - to DestroyWindow(). - - clientscr/ - screensaver_win.cpp + configure.ac + Makefile.am + zip/* -Rom 9 Nov 2011 - - WINSCR: Sync up the timer IDs. - - clientscr/ - screensaver_win.cpp +David 13 Jan 2012 + - GUI RPC: add tag to the start of HTTP replies. + + client/ + gui_rpc_server_ops.cpp -David 9 Nov 2011 - - server: more fixes to DB to handle unsigned result IDs +David 14 Jan 2012 + - client: identify ATI 97x0 GPUs (from Jord) - db/ - boinc_db.cpp + client/ + coproc_detect.cpp -Jeff 9 Nov 2011 - - server: more fixes to DB to handle unsigned result IDs +David 14 Jan 2012 + - GUI RPC client: don't write spurious messages to stderr - sched/ - feeder.cpp - sched_shmem.cpp - db_purge.cpp - sched_assign.cpp lib/ - parse.cpp + gui_rpc_client_ops.cpp -David 9 Nov 2011 - - OpenCL API: fix logic error +Rom 14 Jan 2012 + - VBOX: Fix regression where the vm_name wasn't reset back to the + current wu name after deregistering a stale VM. - api/ - boinc_opencl.cpp + samples/vboxwrapper + vbox.cpp, .h + vboxwrapper.cpp -David 9 Nov 2011 - - OpenCL API: check return value from clGetDeviceIDs() +Rom 15 Jan 2012 + - VBOX: Add User ID and Host ID to the CERN data format. - api/ - boinc_opencl.cpp + samples/vboxwrapper + vboxwrapper.cpp -David 9 Nov 2011 - - scheduler: compute result.report_deadline BEFORE passing it - as an arg to update_wu_on_send() +Rom 15 Jan 2012 + - MGR: Use rdesktop-vrdp on Linux, it is included with VirtualBox + and meant for what we are trying to do. + - MGR: Remove the fullscreen flag on Windows. It might only be + my machine which has refresh problems when launching in + windowed mode. + + clientgui/ + MainDocument.cpp - sched/ - sched_send.cpp +David 15 Jan 2012 + - optimize strip_whitespace(); from Steffen Moller + - storage simulator: generalize so you can use different + coding parameters at different levels -Charlie 9 Nov 2011 - - WINSCR: Fix compile error. - - clientscr/ - screensaver_win.cpp + lib/ + str_util.cpp + ssim/ + ssim.cpp -Rom 10 Nov 2011 - - WINSCR: Attempt to gracefully shutdown a graphics application first - - clientscr/ - screensaver.cpp +David 15 Jan 2012 + - storage simulator: compute fault tolerance correctly -Rom 10 Nov 2011 - - client & lib: Update the OpenCL header to include calling conventions - and weak link information for Mac machines. + ssim/ + ssim.cpp +Charlie 16 Jan 2012 + - client, lib: Improve available GPU RAM detection, include it in + display of GPU description. + + client/ + coproc_detect.cpp lib/ - cl_boinc.h + coproc.cpp,.h + +Charlie 16 Jan 2012 + - client: Add logging message for insufficient GPU RAM details to + coproc_debug flag. + + client/ + cpu_sched.cpp -Rom 10 Nov 2011 - - Tag for 6.13.11 release, all platforms - boinc_core_release_6_13_11 +Rom 16 Jan 2012 + - Tag for 7.0.9 release, all platforms + boinc_core_release_7_0_9 / configure.ac version.h -Charlie 9 Nov 2011 - - MGR: On Mac, work around bug in XCode 4.2 by accepting and ignoring - command line argument "-NSDocumentRevisionsDebugMode=YES" - - client: On Mac, work around bug in XCode 4.2 by accepting and ignoring - command line argument "-NSDocumentRevisionsDebugMode=YES" - (checked into 6.13.11 tag) +Charlie 17 Jan 2012 + - Mac: In permissions error alert: show branded name; if permissions + error is in a subdirectory, show path to bad file or subdirectory. client/ - cs_cmdline.cpp + check_security.cpp + sandbox.h clientgui/ BOINCGUIApp.cpp + mac_installer/ + PosInstall.cpp -Charlie 11 Nov 2011 - - Mgr: fix a bug deleting entries from Task Selection control which I - introduced on 9 November. Deleting an entry cvan create a gap in - the alphabetically sorted sequence, so we can't use my earlier - shortcut in checking for existing entries. - - Mgr: If a slide show has only one slide, load it only once. - - clientgui/ - sg_TaskPanel.cpp - -David 11 Nov 2011 - - client: check return value of FILE_REF when parse project file. - Fixes crashing bug. - +Charlie 17 Jan 2012 + - client: Save all CUDA and CAL GPU info until done with OpenCL detection + so we have available GPU RAM for all OpenCL GPU descriptions. + client/ - client_types.cpp - ssim/ - ssim.cpp + coproc_detect.cpp -Rom 11 Nov 2011 - - MGR: Update default skin to v4. - - clientgui/res/templates/ - - clientgui/skins/Default/ - background_image.png - skin.xml - workunit_running_image.png - workunit_suspended_image.png - workunit_waiting_image.png - -Rom 11 Nov 2011 - - Tag for 6.13.12 release, all platforms - boinc_core_release_6_13_12 +Charlie 17 Jan 2012 + - Tag for 7.0.10 release, all platforms + boinc_core_release_7_0_10 / configure.ac version.h -Charlie 11 Nov 2011 - - Mac installer: There can now be multiple instances of the Manager - running, so shut them all down. - - mac_installer/ - PostInstall.cpp - -David 13 Nov 2011 - - client/scheduler: - If the file "client_opaque.txt" exists on the client, - include its contents in scheduler request messages. - On the scheduler, parse this into SCHEDULER_REQUEST::client_opaque, - where it can be used by the customizable scheduler functions. - - sched/ - sched_types.cpp,h - client/ - file_names.h - cs_scheduler.cpp - -Charlie 14 Nov 2011 - - Mgr: Don't call Simple View specific periodic RPCs when BOINC is - hidden or minimized. - - clientgui/ - MainDocument.cpp +Rom 17 Jan 2012 + - VBOX: Fix a regression I introduced on Saturday, is_vm_registered shouldn't + be called when vm_name is empty. Change it so that is references + vm_master_name instead to get the correct name of the VM. + - VBOX: Fix the logic that scan for the CR character and removes it. Also fix + the partial line inclusion when the various log files are greater than 16k. + string.erase returns what the iterator value should be. + + samples/vboxwrapper + vbox.cpp -David 14 Nov 2011 - - client: show error messages (as notices) when get an error - parsing cc_config.xml - - client: if an element in cc_config.xml - specifies a nonexistent app, show an error msg with - a list of existing app names - - web: increase the default mem limit from 64MB to 256MB - TODO: change user_hosts.php to show N at a time +David 17 Jan 2012 + - storage simulator work + - lib: recent checkin broke strip_whitespace(string&). - html/inc/ - util.inc + ssim/ + ssim.cpp + plot + ssim.php lib/ - cc_config.cpp,h - client/ - log_flags.cpp - -David 14 Nov 2011 - - client: improve messages for the above - - client/ - log_flags.cpp - -David 14 Nov 2011 - - scheduler: increase buffer for global prefs from 8K to 64K - - lay the groundwork for changing it to std::string + str_util.cpp - sched/ - sched_types.cpp - lib/ - parse.cpp,h +David 18 Jan 2012 + - web: link between LAMMPS job submission page and file sandbox page -Charlie 14 Nov 2011 - - Mgr: In CSimpleTaskPanel, change name of Update() to UpdatePanel() - to fix compiler warning about overloading wxWindow::Update(). - - clientgui/ - sg_BoincSimpleFrame.cpp - sg_TaskPanel.cpp,.h + html/user/ + lammps.php + sandbox.php -Charlie 14 Nov 2011 - - MGR: Limit change of 9 November to only Debug builds: accept and - ignore command line argument "-NSDocumentRevisionsDebugMode=YES" +Charlie 18 Jan 2012 + - client: add debugging aids to coproc_detect logic. + + client/ + coproc_detect.cpp - clientgui/ - BOINCGUIApp.cpp +Charlie 18 Jan 2012 + - Tag for 7.0.11 release, all platforms + boinc_core_release_7_0_11 -David 14 Nov 2011 - - client: add some missing items to CONFIG::parse_options_client(). + / + configure.ac + version.h +Charlie 18 Jan 2012 + - client: ATI available RAM is in bytes, not MB; if no CAL, don't divide + OpenCL global_mem_size by MEGA to fill in ATI available RAM. + (Checked in to 7.0.11 tag.) + client/ - log_flags.cpp - pers_file_xfer.cpp + coproc_detect.cpp -Charlie 16 Nov 2011 - - MGR: use wxBitmapComboBox insert() and append() calls without - client data argument instead of passing NULL. - - clientgui/ - BOINCBitmapComboBox.cpp +Rom 18 Jan 2012 + - VBOX: Fix another issue that was a result of Saturdays commit. Make + sure that the vm_name variable is populated with something useful if + resuming from a previous execution of the wrapper. + + samples/vboxwrapper + vbox.cpp -Charlie 17 Nov 2011 - Remove include of boinc_cl.h from parse.h; it is no longer needed. - Remove Mac Availability Macro and weak-link support from cl_boin.ch - as it prevented building BOINC libraries under OS 10.5. - - lib/ - cl_boinc.h - parse.h +David 18 Jan 2012 + - WAP interface to credit info: return correct timestamp, + and don't bother with caching. -Charlie 19 Nov 2011 - - MGR: Fix button font sizes in Simple View Projects panel. - - clientgui/ - sg_ProjectPanel.cpp + html/ + inc/ + wap.inc + user/ + userw.php -David 20 Nov 2011 - - client: on network_available() GUI RPC, - clear project-level upload and download backoffs, - as well as RPC and individual xfer backoffs. - This was an oversight. +Rom 18 Jan 2012 + - VBOX: Use the documented way to reset the UUID of a virtual hard + disk. Thanks Daniel. + + samples/vboxwrapper + vbox.cpp - client/ - client_types.h - net_stats.cpp +David 18 Jan 2012 + - Manager: in project web links, use "Home Page" instead of the + project name (which could be very long) -Charlie 20 Nov 2011 - - MGR: Hide slideshow subpanel if no slides for current task. - clientgui/ - sg_TaskPanel.cpp - -Charlie 21 Nov 2011 - - MGR: In Simple View, draw Mac progress bar on white background for - better visibility; adjust red New Notices ring for new button - shapes if on Mac OS 10.7. + BOINCBaseView.cpp - clientgui/ - sg_BoincSimpleFrame.cpp,.h - sg_PanelBase.cpp - sg_TaskPanel.cpp - -Rom 21 Nov 2011 - - MGR: const fixes for platform bitmaps. - (From: Steffen Möller) - - MGR: Add trace statements to help track down RemoveAt bug - - MGR: Remove static var guard, may not be needed with the SetDlgOpen() - routines blocking timer based updates. If there is a buffer overrun - hopefully it'll manifest itself in a detectable way. - - clientgui/res/ - linuxicon.xpm - macosicon.xpm - windowsicon.xpm - clientgui/ - sg_BoincSimpleFrame.cpp - sg_TaskPanel.cpp +David 19 Jan 2012 + - client: parse HOST_INFO::p_vm_extensions_disabled correctly -Rom 21 Nov 2011 - - MGR: Prevent crash, check returned pointer of menu entry. + lib/ + hostinfo.cpp + proxy_info.cpp + gui_rpc_client_ops.cpp + coproc.cpp + version.h + ssim/ + ssim.php - clientgui/ - sg_BoincSimpleFrame.cpp +Charlie 19 Jan 2012 + - Mac installer: If installing under OS 10.4, create users and groups + boinc_master and boinc_project at first available UserIDs and + GroupIDs starting at 25 instead of 501 to prevent problems with + Accounts pane of System Preferences. -Rom 21 Nov 2011 - - MGR: Fix bad asserts. - clientgui/ - BOINCBitmapComboBox.cpp + mac/ + SetupSecurity.cpp -Charlie 21 Nov 2011 - - MGR: Fix bad transparency in default project icon. - - clientgui/res/skins/default/graphic/ - project_image.xpm +David 19 Jan 2012 + - storage simulator work -Charlie 21 Nov 2011 - - MGR: The asserts were correct; fix minor errors in calling code. - - clientgui/ - BOINCBitmapComboBox.cpp - sg_ProjectPanel.cpp - sg_TaskPanel.cpp - -Charlie 23 Nov 2011 - - MGR: In Simple View, if deleting a task above the current selection, - decrement the index of the current selection. - - MGR: In Simple View, reload slide show when task selection changed. - - clientgui/ - sg_TaskPanel.cpp,.h + ssim/ + ssim.cpp + ssim.php -Charlie 23 Nov 2011 - - MGR: In Simple View, sort Project Selection Control; make sorting of - Project and Task Selection controls case-insensitive, fix bugs in - MacBitmapComboBox.cpp. +Charlie 20 Jan 2012 + - client: Show GPU number in "GPU is OpenCL-capable" message. - clientgui/ - mac/ - MacBitmapComboBox.cpp - MacBitmapComboBox.cpp - sg_ProjectPanel.cpp - sg_TaskPanel.cpp - -David 24 Nov 2011 - - GUI RPC client lib: change setsockopt() for receive timeout - to work on Windows. From Fred. + client/ + client_state.cpp +Charlie 20 Jan 2012 + - OpenCL: + Problem: Mac OpenCL does not recognize all NVIDIA GPUs returned + by CUDA. Since there is no CAL for Mac, this is not an issue + for ATI / AMD GPUs. On other platforms, the CUDA and CAL drivers + also provide OpenCL support, so we don't expect the problem there. + + Solution: I believe that CUDA and OpenCL return identical GPU + model names for the same GPU, and that both return the GPUs in the + same order (but with some possibly omitted from the OpenCL sequence.) + We use that information to correlate the OpenCL data with CUDA data. + We use our internal CUDA device_num for the corresponding OpenCL + device, but add a new field opencl_device_index; the two fields are + equal unless we have CUDA devices not recognized by OpenCL. We + add a new array opencl_device_indexes[] to the COPROC struct, + corresponding to the entries in device_nums[]. + + The init_data.xml file now has a new field gpu_opencl_device_index. + If this field exists, the boinc_get_opencl_ids() API uses this to + find the cl_device_id and cl_platform_id, otherwise it continues + to use the value in gpu_device_num. + + api/ + boinc_opencl.cpp + client/ + app_start.cpp + coproc_detect.cpp lib/ - gui_rpc_client.cpp + app_ipc.cpp,.h + coproc.h -David 24 Nov 2011 - - default screensaver: fix divide-by-zero; code cleanup +David 20 Jan 2012 + - volunteer data archival stuff - clientsrc/ - ss_app.cpp + ssim/ + vda.cpp,h (new) + ssim.cpp + makefile -David 25 Nov 2011 - - client: fix errors in transferring RAM info between CAL and OpenCL. - (bytes vs MB units, local/global terminology issue). - From Oliver Bock> +David 20 Jan 2012 + - client: add a mechanism for restartable download of compressed files. + (It turns out that the compression schemes supported by + Apache and libcurl, suprisingly, aren't restartable.) + + if a from the server contains tags, + use those instead of the tags, + and flag the file as "download_gzipped". + If this is the case, download NAME.gz and save it as NAME.gzt. + When the download is complete, rename NAME.gzt to NAME.gz, + and uncompress it to NAME. + (this ensures that if NAME.gz is present, it's complete). + Also do the uncompression, if needed, in verify_file(). + This ensures that the uncompression will eventually get done + even if the client quits are crashes in the middle. + + - update_versions: if is present in a , + add a gzipped copy in the download directory + and add a elements to the app version's xml_doc. client/ - coproc_detect.cpp + client_types.cpp,h + file_xfer.cpp + cs_files.cpp + tools/ + update_versions -Charlie 26 Nov 2011 - - default screensaver: fix build breaks caused by code cleanup above. +David 20 Jan 2012 + - feeder: if we're rereading the DB because of trigger file, + do PERF_INFO::get_from_db() also. + From Teemu Mannermaa. - clientsrc/ - ss_app.cpp + sched/ + feeder.cpp -Charlie 28 Nov 2011 - - MGR: In Simple View, if task has no slide show, then display the - institution, science area and description. - This is in progress: not yet finished. +David 20 Jan 2012 + - admin web: if change app or app version params, + advise user to stop/restart the project - clientgui/ - Events.h - sg_PanelBase.cpp,.h - sg_TaskPanel.cpp,.h + html/ops/ + manage_apps.php + manage_app_versions.php -Charlie 29 Nov 2011 - - MGR: Continue work on Simple View to display the description if - task has no slide show. - Change all occurrences of "n" to "^n" +Rom 21 Jan 2012 + - VBOX: Enable the wrapper to handle fractional CPU usage. If + the server specifies 1.1 CPUs used, allocate 2 CPUs to be used + in VirtualBox. - clientgui/ - sg_TaskPanel.cpp,.h + samples/vboxwrapper + vboxwrapper.cpp -Charlie 30 Nov 2011 - - MGR: Complete work on Simple View to display the description if - task has no slide show. +Rom 21 Jan 2012 + - sched: adjust the vbox??_mt plan classes to use 1.5 CPUs instead + of the full 2 CPUs. Vboxwrapper uses ceil() to allocate enough + whole CPUs for Virtualbox. Ideally this will cause the BOINC + client-side scheduler to use the remaining fraction of the CPU + for GPU data transfer which will then free up one whole CPU for + another job. All without over-commiting anything. - clientgui/ - sg_TaskPanel.cpp,.h - -Rom 30 Nov 2011 - - Tag for 7.0.1 release, all platforms - boinc_core_release_7_0_1 - - / - configure.ac - version.h + sched/ + sched_customize.cpp -Charlie 30 Nov 2011 - - MGR: Better sizing of Simple View description text box. - - clientgui/ - sg_TaskPanel.cpp,.h +David 22 Jan 2012 + - GUI RPC: switching to the new XML parser + (which won't parse a double as an int) + revealed a type mismatch in FILE_TRANSFER::next_request_time + between client and server. -Rom 1 Dec 2011 - - Tag for 7.0.2 release, all platforms - boinc_core_release_7_0_2 + db/ + boinc_db.cpp,h + schema_vda.sql (new) + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h + ssim/ + vda.cpp + vda_lib.cpp,h + vda_transitioner.cpp + makefile + client/ + net_stats.cpp - / - configure.ac - version.h +David 22 Jan 2012 + - client: fix divide-by-zero bug in calculation of priority + of projects with zero resource share -Charlie 2 Dec 2011 - - Mac installer: revert to using a wrapper application around installer - package to require a system restart if creating users and groups. - (checked into 7.0.2 tag) - - mac_build/ - boinc.xcodeproj/ - project.pbxproj - mac_installer/ - Installer.cpp - PostInstall.cpp - release_boinc.sh + client/ + cpu_sched.cpp -Charlie 2 Dec 2011 - - Mac installer: for files in projects and slots directories, if the - executable-by-owner permission is set, ensure that the - executable-by-group bit is also set. - (checked into 7.0.2 tag) +Rom 23 Jan 2012 + - MGR: Tweak the z-order of BOINC Manager owned windows a little bit. + Image a case where BOINC Manager and the BOINC Manager event log + live side-by-side or only slightly overlapped, and the user wants + to use a full screen/maximized window. If the bring the BOINC + manager window back into focus while that app is still running + make sure the event log comes forward as well. The event log + should appear behind the main window in the case they are + overlapped. clientgui/ - mac/ - SetupSecurity.cpp - -Rom 5 Dec 2011 - - MGR: Increase the opacity of the panels to make the black text more - readable. - - clientgui/skins/Default/ - skin.xml + BOINCGUIApp.cpp, .h -Charlie 6 Dec 2011 - - MGR: eliminate "ghost" Notices window when running on Windows OS. +Rom 23 Jan 2012 + - client - Remove Mac OSX 10.3.9 hack, it is no longer needed. - clientgui/ - sg_DlgMessages.cpp + client/ + http_curl.cpp -Charlie 6 Dec 2011 - - MGR: don't show "indeterminate" progress bar in Simple View. +David 23 Jan 2012 + - scheduler: initialize COPROC_ATI::version to zero; + avoid sending spurious "update driver" messages - clientgui/ - Events.h - sg_PanelBase.cpp,.h - sg_TaskPanel.cpp,.h + lib/ + coproc.cpp + db/ + boinc_db.cpp,h + schema_vda.sql + vda/ + vdad.cpp + makefile -Charlie 7 Dec 2011 - - Mac installer: eliminate use of WaitPermissions.app. - - Mac installer: revert branded build scripts for wrapper application - around installer package. - - mac_installer/ - make_CharityEngine.sh - make_GridRepublic.sh - make_ProgThruProc.sh - PostInstall.cpp - release_boinc.sh +Charlie 23 Jan 2012 + - Mac: If permissions error because unable to opendir() a subdirectory, + show path to that subdirectory. -Charlie 12 Dec 2011 - - MGR: If CSkinIcon PNG file has an alpha channel, use it as mask and - ignore any tag. - - clientgui/ - SkinManager.cpp + client/ + check_security.cpp -Charlie 14 Dec 2011 - - Mac installer: update build scripts for naming consistency with other platforms. +Rom 23 Jan 2012 + - VBOX: Demote the priority level of the VM process to try and prevent + latency issues for volunteers. + - VBOX: If the port forwarding preferred port isn't usable, try asking + the OS for one. + - VBOX: On a failure, get the VM process exit code and report it with + the rest of the stderr spew. - mac_installer/ - make_CharityEngine.sh - make_ProgThruProc.sh + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp -David 1 Dec 2011 - - API and client: add "ncpus" field to APP_INIT_DATA. - Tells multicore apps how many cores to use. - The --nthreads command line arg to the app is now deprecated - though we'll keep it around for the time being. +David 23 Jan 2012 + - web: use et_n instead of pfc_n for #jobs completed + in host app details page + (pfc_n is not populated for hosts running old clients) - lib/ - app_ipc.cpp,h + html/user/ + host_app_versions.php + +Rom 24 Jan 2012 + - client: treat the gzt file extension like we do for the gz file extension. + Disable libcurls ability to decompress on-the-fly and let the CC decompress + it after it has been fully downloaded. + client/ - app_start.cpp + http_curl.cpp -David 4 Dec 2011 - - client: isdigit() asserts if its arg is negative (which it can be). - Call isascii() first. - - GUI RPC lib: add some consts +David 24 Jan 2012 + - client: when deleting a file, check for .gzt and .gz variants as well client/ - cs_notice.cpp + client_types.cpp -David 5 Dec 2011 - - client: when contacting a project for reasons other than - work fetch (e.g. to report completed jobs) - only request work if it's the project we would have chosen - if we were fetching work. - - client: the way in which project priorities were adjusted - in work fetch to reflected currently queued work was wrong. - - client: fix bug in the way project priorities are adjusted - in RR simulator - - client emulator: if there are results in the state file - with states DOWNLOADING or UPLOADING, - change them to DOWNLOADED or UPLOADED. - Otherwise they're stuck. +David 24 Jan 2012 + - client: bug fixes in gzipped download code client/ - work_fetch.cpp,h - sim.cpp - rr_sim.cpp - cs_scheduler.cpp - cpu_sched.cpp - -David 6 Dec 2011 - - client: compile fix; remove redundant total_peak_flops() + client_types.cpp + cs_files.cpp +Rom 24 Jan 2012 + - client: undo my previous commit. We request .gz from the server and write + the contents to a .gzt file. + client/ - work_fetch.cpp,h - cpu_sched.cpp + http_curl.cpp + +Rom 24 Jan 2012 + - VBOX: Fix build breaks for Linux and Mac. + + samples/vboxwrapper/ + vbox.cpp + +Rom 24 Jan 2012 + - client: Fix long standing issue with the .gz extension automatically being + decompressed on-the-fly when it wasn't supposed to be. -David 6 Dec 2011 - - client: if a file download was in progress at the time of - an upgrade from 6.12 to 6.13+, - it could get erroneously marked as an upload and get stuck forever. - Problem: uninitialized member. + client/ + http_curl.cpp +David 24 Jan 2012 + - volunteer storage client/ - pers_file_xfer.cpp + client_types.h + vda/ + vdad.cpp -Rom 6 Dec 2011 - - MGR: Scale the task pane in the advanced view to encompass the largest button. +Charlie 25 Jan 2012 + - VBOX: Fix compiler warnings on Mac. + samples/vboxwrapper/ + vboxwrapper.cpp + +Charlie 25 Jan 2012 + - MGR: Make the task pane in the advanced view and its buttons fixed sizes; + ellipse the button contents if needed; show full button text plus + description in button tooltips; don't set button labels if unchanged. + clientgui/ BOINCBaseView.cpp, .h - BOINCTaskCtrl.cpp + BOINCTaskCtrl.cpp, .h stdwx.h - ViewNotices.cpp - ViewResources.cpp - ViewStatistics.cpp -David 6 Dec 2011 - - lib: encode CAL version numbers in a way that handles - release #s > 1000 +David 26 Jan 2012 + - update_versions: for gzipped files, + send the size of the compressed file as well. + - client: parse and write the compressed size (FILE_INFO::gzipped_nbytes). + For get_transfer GUI RPCs, if it's a compressed download send + the compressed size. + That way the manager will show the fraction done correctly. + tools/ + update_versions lib/ - coproc.cpp,h + gui_rpc_client.h + vda/ + vdad.cpp + client/ + client_types.cpp,h + acct_setup.cpp + +Charlie 26 Jan 2012 + - client: disable temporary debugging aids in coproc_detect logic. + + client/ + coproc_detect.cpp -David 12 Dec 2011 - - client: tweak parameters of file xfer backoff to - reduce backoff intervals somewhat +David 26 Jan 2012 + - client: fix write of gzipped_nbytes client/ - pers_file_xfer.h + client_types.cpp -Rom 12 Dec 2011 - - MGR: Add IE8-10 support for browser cookies when UAC is enabled. Use the - supported API. It appears MS changed the cookie file format in their - latest browsers which broke our hack. I have to leave the hack in - for now because IE7 on Vista didn't expose the IEGetProtectedModeCookie - API. - - WINSETUP: Start BOINCMgr as a restricted process on Windows Vista+. - - clientgui/ - browser.cpp - win_build/installerv2/redist/Windows/src/boinccas/ - boinccas.vcproj - CALaunchBOINCManager.cpp, .h - win_build/installerv2/redist/Windows/Win32/ - boinccas.dll - boinccas95.dll - win_build/installerv2/redist/Windows/x64/ - boinccas.dll - boinccas95.dll - -Rom 1 Dec 2011 - - Tag for 7.0.3 release, all platforms - boinc_core_release_7_0_3 +Rom 26 Jan 2012 + - Tag for 7.0.12 release, all platforms + boinc_core_release_7_0_12 / configure.ac version.h -Charlie 16 Dec 2011 - - MGR: in Simple View, localize institution, science area and description. - +Rom 26 Jan 2012 + - client: after a gzipped file is downloaded, + we uncompress it and then verify it. + The latter involves computing its MD5, which reads the entire file. + Combine these 2 steps so that the MD5 is computed + as the file is uncompressed, + eliminating the need to read the file again. + + lib/ + crypt.cpp,h + crypt_prog.cpp + client/ + client_types.cpp,h + cs_files.cpp + +Charlie 26 Jan 2012 + - Mac: Update the build instructions with the current URL for c-ares-1.7.4. + + mac_build/ + HowToBuildBOINC_XCode.rtf + +Charlie 27 Jan 2012 + - MGR: If CPU or GPU is suspended from Activity Menu, change "Snooze" items + to "Resume" in system tray menu. + - client: Always remember previous CPU and GPU activity settings. + + client/ + client_types.cpp,h + cs_statefile.cpp clientgui/ - BOINCGUIApp.cpp - sg_TaskPanel.cpp + BOINCTaskBar.cpp,.h + mac/ + macSysMenu.cpp -Charlie 21 Dec 2011 - - MGR: Display project descriptions in Attach Wizard using wxTextCtrl - instead of wxHtmlWindow to support screen readers for accessibility, - after converting all occurrences of "n" to "^n". - Show localized project descriptions in Attach Wizard. +David 27 Jan 2012 + - manager: in Disk View, try to make colors more distinct. + In addition to varying the hue, + cycle through 3 different luminance values (.5, .7, .9) + - web: update the wording of buffer-size preferences clientgui/ - ProjectInfoPage.cpp,.h + ViewResources.cpp + html/inc/ + prefs.inc + +David 27 Jan 2012 + - manager: in tooltips for Project/Task buttons, + don't prepend "button name: "; + add a tooltip for Home Page button. -Charlie 21 Dec 2011 - - MGR: Fix horizontal sizing of text in Simple View project description. - clientgui/ - sg_TaskPanel.cpp,.h + BOINCBaseView.cpp + BOINCTaskCtrl.cpp -David 26 Dec 2011 - - API: - allow applications to supply a "web graphics URL", - in which case the manager's "Show Graphics" button - opens a browser at that URL. - This typically would used for applications that - implement a web server that serves pages showing - job information in HTML. +Charlie 27 Jan 2012 + - MGR: Disable new "Resume" items in system tray menu if modal dialog is open. - api/ - boinc_api.cpp,h + clientgui/ + BOINCTaskBar.cpp -David 26 Dec 2011 - - add support for APP::needs_network flag. - If set, don't run jobs for that app while network is suspended. - - client: parse this flag and maintain in state file; - do a job reschedule when network suspend state changes - - GUI RPC: add RESULT::network_wait flag; - if set, this job is waiting for network access to be allowed - - Manager: display the above in task info - - add support for "web graphics URL" (see above) - - client: parse message containing URL on graphics_reply channel - and store in ACTIVE_TASK::web_graphics_url - - GUI RPC: add RESULT::web_graphics_url - - Manager: if web graphics URL is present, Show Graphics opens a browser - - remove some vestigial code for pre-V6 graphics - - client/ - app.cpp,h - app_control.cpp - client_state.cpp - client_types.cpp,h - work_fetch.cpp - clientgui; - MainDocument.cpp - sg_TaskCommandPopup.cpp - ViewWork.cpp - lib/ - gui_rpc_client.h - gui_rpc_client_ops.cpp +David 28 Jan 2012 + - web: msg tweak + - screensaver coordinator: use new XML parser -David 26 Dec 2011 - - make "needs network" a property of APP_VERSION rather than APP + clientscr/ + screensaver.cpp + html/user/ + forum_report_post.php +Charlie 30 Jan 2012 + - client: because available GPU RAM value is unreliable, don't defer + scheduling a task based on insufficient GPU RAM. For now, the + relevant code is guarded by a "#define DEFER_ON_GPU_AVAIL_RAM 0" + so we can easily restore it if we find a reliable way to get the + value of available GPU RAM periodically. + + NOTE: we are still sending this unreliable value to project + servers in the sched_request file. Does it make sense to do so? + client/ - client_types.cpp,h - work_fetch.cpp - app_control.cpp + cpu_sched.cpp + lib/ + coproc.h -Rom 26 Dec 2011 - - Tag for 7.0.4 release, all platforms - boinc_core_release_7_0_4 +David 30 Jan 2012 + - manager: change text for buffer-size fields in advanced prefs dialog - / - configure.ac - version.h + clientgui/ + DlgAdvPreferencesBase.cpp -Rom 27 Dec 2011 - - SCR: Remove last linger pieces of v5 backward graphics compatibility - from the screensaver. - - clientscr/ - screensaver.cpp - screensaver_win.h +David 30 Jan 2012 + - server: revamp the "assigned job" mechanism. + This now supports two main use cases: + 1) there's a job that you want to run once on all hosts, + present and future + (or all hosts belonging to a user, or to a team). + The job is never transitioned, validated, or assimilated. + 2) There's a normal job for which you want to use only + hosts belonging to a specific user (e.g. cluster or cloud hosts). + This restriction can be made either when the job is created, + or on the fly, + e.g. as part of a scheme for accelerating batch completion. + For the latter purposes we now provide a function + restrict_wu_to_user(DB_WORKUNIT&, int userid); + + The job goes through the standard + transitioner/validator/assimilator path. + + These cases are enabled by config flags + + + respectively. -Rom 27 Dec 2011 - - Tag for 7.0.5 release, all platforms - boinc_core_release_7_0_5 + Assignment of type 2) are no longer stored in shared mem, + so there is no limit on their number. - / - configure.ac - version.h + There is no longer a rule that assigned job names must contain "asgn". + + NOTE: this requires a database update. + + db/ + boinc_db.cpp,h + constraints.sql + schema.sql + sched/ + sched_util.cpp,h + sched_shmem.cpp + transitioner.cpp + sched_assign.cpp + tools/ + backend_lib.cpp + create_work.cpp + html/ops/ + db_update.php + lib/ + common_defs.h -David 28 Dec 2011 - - client: detect Windows HyperV Server 2008 R2 (from Crashtest) +David 30 Jan 2012 + - admin web: improvements to the pages for investigating result failures + (though considerable funkiness remains) - client/ - hostinfo_win.cpp + html/ + ops/ + failure_result_summary_by_platform.php + failure_result_summary_by_host.php + index.php + pass_percentage_by_platform.php + inc/ + db_ops.inc -Rom 28 Dec 2011 - - client: increase the buffer sizes for retrieving cpu features on *nix - type systems. the latest generation of processors blow past 256 bytes - and vmx and svm are truncated. - - client/ - hostinfo_unix.cpp +David 31 Jan 2012 + - admin web: fixes and clarifications to failure summaries -Rom 28 Dec 2011 - - WINSETUP: Introduce new BOINC setup packages which include VirtualBox. - - win_build/installerv2/ - BOINC_vbox.ism - BOINCx64_vbox.ism - -Rom 28 Dec 2011 - - Tag for 7.0.6 release, all platforms - boinc_core_release_7_0_6 + html/ + ops/ + failure_result_summary_by_platform.php + failure_result_summary_by_host.php + index.php + pass_percentage_by_platform.php + inc/ + boinc_db.inc + db_ops.inc + user/ + apps.php + +David 31 Jan 2012 + - create_work tool: change option names for assigned jobs + - admin web: show actual platform name in result summary page + + tools/ + create_work.cpp + html/ops/ + pass_percentage_by_platform.php + +David 31 Jan 2012 + - web: fix the user search feature + - scheduler: parse d_project_share + - scheduler: if vbox and vbox_mt are both available, + use vbox for a 1-CPU machine + + db/ + boinc_db.h + sched/ + sched_customize.cpp + sched_types.cpp + html/user/ + user_search.php + +David 1 Feb 2012 + - scheduler: add log messages to show VM-related request items + - fix typos in db_update script + + sched/ + sched_send.cpp + html/ops/ + db_update.php + +Charlie 2 Feb 2012 + - Tag for 7.0.13 release, all platforms + boinc_core_release_7_0_13 / configure.ac version.h -David 30 Dec 2011 - - client: parse APP:non_cpu_intensive correctly. - This got broken somehow. - - client: don't crash if missing RSS feed file for some reason - - client/ - client_types.cpp - cs_notice.cpp - -David 30 Dec 2011 - - client: for VBox apps, check stderr for "ERR_CPU_VM_EXTENSIONS_DISABLED". - If found, set HOST_INFO::p_vm_extensions_disabled, - and pass this to the scheduler. - - Note: if you have a host with VM extensions, and they're disabled - in the BIOS, and you enable them, you can remove the - line from client_state.xml - and you'll be eligible to get multicore VM jobs again. +David 2 Feb 2012 + - client: fix job scheduler problem: + old: RR simulation marks some jobs as missing their deadline, + and the job scheduler runs those jobs as "high priority". + problem: those generally aren't the ones we should run. + E.g. if the client has a lot of jobs from a project, + typically the ones with later deadlines are the ones + whose deadlines are missed in the simulation. + But in this case the EDF policy says we should run + the ones with earliest deadlines. + new: if a project has N deadline misses, + run its N earliest-deadline jobs, + regardless of whether they missed their deadline in the sim. + Note: this is how it used to be (as designed by John McLeod). + I attempted to improve it, and got it wrong. client/ - app_control.cpp - lib/ - hostinfo.cpp,h + cpu_sched.cpp -Rom 30 Dec 2011 - - client: processor features buffer is supposed to be 1024 bytes. avoid - truncation. +Rom 2 Feb 2012 + - MGR: Fix cookie detection problem when using the + IEGetProtectedModeCookie API. Function prototype changed from the + InternetGetCookieEx function. HRESULT != BOOL. - lib/ - hostinfo.cpp + clientgui/ + browser.cpp -Rom 30 Dec 2011 - - WINSETUP: Give 'boinc_admins' and 'boinc_projects' the ability to access and - launch the VirtualBox server-side application. This should complete the - needed work to run VirtualBox within the Windows sandboxed environment. - - WINSETUP: Remove the virtualized file system tag from the Windows Explorer - copied security token when launching BOINC Manager and BOINC Tray after - setup has completed. I believe this will resolve the new cookie issue - experienced by PTP/GR/CE. - - WINSETUP: Hookup new custom actions to the BOINC Installers - - win_build/installerv2/ - BOINC.ism - BOINCx64.ism - win_build/installerv2/redist/Windows/Win32/ - boinccas.dll - boinccas95.dll - win_build/installerv2/redist/Windows/x64/ - boinccas.dll - boinccas95.dll - -Rom 30 Dec 2011 - - Tag for 7.0.7 release, all platforms - boinc_core_release_7_0_7 +Rom 2 Feb 2012 + - Tag for 7.0.14 release, all platforms + boinc_core_release_7_0_14 / configure.ac diff -Nru boinc-7.0.7+dfsg/checkin_notes_2011 boinc-7.0.14+dfsg/checkin_notes_2011 --- boinc-7.0.7+dfsg/checkin_notes_2011 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/checkin_notes_2011 2012-01-01 03:35:29.000000000 +0000 @@ -0,0 +1,9776 @@ +David 1 Jan 2011 + - fix some bad file permissions + - delist defunct stats site + + clientgui/ + DlgItemProperties.cpp,h + AsynRPC.cpp + html/inc/ + stats_sites.inc + samples/ + wrapper/ + wrapper.cpp + example_app/ + uc2.cpp + client/ + sim_control.cpp + +David 2 Jan 2011 + - unix build: remove hardwired -ldl + + lib/ + Makefile.am + +David 3 Jan 2011 + - client: show a given system notice at most once a week + + client/ + client_msgs.cpp + sim_control.cpp + cs_notice.cpp + +Charlie 4 Jan 2010 + - Mac: Fix symbol table generation. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 6 Jan 2011 + - user web: fix bugs in server status page + - fix some indentation + + html/user/ + server_status.php + client/ + *.cpp + +David 6 Jan 2011 + - simulator work + - fix some indentation + + various files + +David 11 Jan 2011 + - client: use std::deque instead of std::vector + for RR sim's pending-job lists. + Erasing head of vector is slow. + - lib: allow GPU peak FLOPS to be specified in XML (for simulator) + - simulator work + - client: old work fetch policy: projects may need enough jobs + for all device instances, not just resource_share*ninst. + E.g. a project that has only CPU jobs in a CPU/GPU client + - client: with REC scheduling, don't ask for work for + secondary resources if project has negative priority. + - client: in RR sim, make sure we saturate devices if possible. + Otherwise we may report a shortfall incorrectly + + client/ + coproc_detect.cpp + cpu_sched.cpp + rr_sim.cpp,h + sim.cpp + sim_control.php + sim_scenario.php (new) + work_fetch.cpp,h + lib/ + coproc.cpp,h + sched/ + sched_customize.cpp + sched_types.cpp + +David 11 Jan 2011 + - client: set PROJECT::last_upload_start when a job completes, + NOT when its first upload starts. + This prevents a scheduler RPC from happening between the two. + This was a bug in [22841] + + client/ + cs_apps.cpp + pers_file_xfer.cpp + +David 12 Jan 2011 + - client: tweak [22842] so that system clock changes + of < 60 seconds are ignored + + client/ + client_state.h + +Rom 12 Jan 2011 + - MGR: Embed the BOINC skin in the executable using XPM files. + + clientgui/res/skins/default/graphic/ + + clientgui/ + SkinManager.cpp + win_build/ + boincmgr.vcproj + +David 12 Jan 2011 + - single-job submission system: don't hardwire i686 architecture; + make it work on any Linux system. + From Steffen Moller. + + html/ops/ + single_job_setup.php + +Rom 13 Jan 2011 + - MGR: Disable the background repaint events for the SGUI Messages and + SGUI Preferences dialog. Changing the font color wasn't as easy as + I had hoped and the black background for the skin doesn't do any + good when the text itself is black as well. + + clientgui/ + sg_DlgMessages.cpp + sg_DlgPreferences.cpp + +David 13 Jan 2011 + - scheduler/client/API: pass user ID and team ID from scheduler to client, + and from client to app (host ID is already passed). + E@h asked for this, not sure why. + + client/ + client_types.cpp,h + app_start.cpp + lib/ + app_ipc.cpp,h + sched/ + sched_types.cpp + +Rom 13 Jan 2010 + - MGR: re-enable background painting and just change the default background + color for the new default skin to light gray. + + clientgui/ + sg_DlgMessages.cpp + sg_DlgPreferences.cpp + +Bernd 14 Jan 2011 + - unix build system: generate_svn_version + - generate version string from plain git repositories, too + - define SVN_REPOSITORY (URL) and SVN_REVISION (numerical) separately + so these could be used in proprocessor directives + + generate_svn_version.sh + +David 14 Jan 2011 + - make the Manager build on FC11 + - simulator work + + clientgui/ + Makefile.am + sched/ + edf_sim.cpp + client/ + sim.cpp + sim_control.php + +David 15 Jan 2011 + - client: fix job scheduling bug. + Scenario: we have 2 CPUs and 1GB RAM + Project A has jobs that use 1GB. + Project B has small-mem jobs. + Currently, we ignore RAM usage in building the runnable job list, + so we might pick 2 jobs from project A. + enforce_schedule() (which checks RAM usage) will run just one of them, + and the other CPU will be idle. + Solution: keep track of RAM usage while building the runnable job list. + client/ + cpu_sched.cpp + +David 15 Jan 2011 + - client: code cleanup in CPU scheduling; + eliminate global variable + + client/ + client_state.cpp,h + cpu_sched.cpp + sim.cpp + +Charlie 18 Jan 2011 + Mac: update release script to remove install of separate BOINC skin. + + mac_installer/ + release_boinc.sh + +David 18 Jan 2011 + - simulator work + + client/ + cpu_sched.cpp + work_fetch.h + sim.cpp + sim_control.cpp + client_types.cpp + +David 19 Jan 2011 + - client: eliminate unnecessary CPU reschedules. + Currently we do a reschedule any time a job checkpoints, + in case there's a job that has finished a time slice + but hasn't checkpointed yet. + Instead: flag such jobs, and trigger a reschedule + on checkpoint only for flagged jobs. + - client: fix instability in job scheduling that happens + if a job's estimated completion time in RR sim is close to its deadline. + It can alternate between making and missing deadline, + causing the scheduler to alternate rapidly between jobs. + Solution: if RR sim has marked a job as deadline miss + any time in the last (CPU scheduling period), + treat it as a deadline miss. + + client/ + app.cpp,h + rr_sim.cpp + app_control.cpp + cpu_sched.cpp + +David 19 Jan 2011 + - client: if we're using an acct mgr, + and we're attached to a project manually (not via acct mgr) + and the acct mgr tells us to detach from it, don't. + + client/ + acct_mgr.cpp + +David 19 Jan 2011 + - server: fix for EmBOINC + + sched/ + sched_util.cpp + +David 24 Jan 2011 + - server: disable upload certificates by default. + These increase server load and it's not clear they're needed. + + py/Boinc/ + setup_project.py + +Rom 25 Jan 2011 + - MGR: Fix advanced view button is Simple GUI. + (Button Text is Verdana 8pt. in MS Paint) + + clientgui/res/skins/default/graphic/ + advanced_link_image.xpm + clientgui/res/templates/skins/ + advanced_link_image.gif (Added) + btnAdvancedView.png (Removed) + +David 25 Jan 2011 + - client: accept and in cc_config.xml + - client: reset log flags (as well as options) when rereading cc_config.xml + + client/ + log_flags.cpp,h + +David 25 Jan 2011 + - web: tweaks so that BOINC-Wide Teams site can warn people if + their email address is not validated + + html/ + inc/ + user.inc + user/ + edit_email_action.php + +Charlie 27 Jan 2011 + Mac: update Mac_SA_Insecure.sh script to not require BOINC Client in + BOINC Data folder. + + mac_build/ + Mac_SA_Insecure.sh + +Charlie 27 Jan 2011 + - MGR: Add new Simple GUI. + + clientgui/ + AdvancedFrame.cpp, .h + BOINCGUIApp.cpp, .h + Events.h + sg_BoincSimpleFrame.cpp, .h (new) + sg_CustomControls.cpp, .h + sg_PanelBase.cpp, .h (new) + sg_ProjectCommandPopup.cpp, .h (new) + sg_ProjectPanel.cpp, .h (new) + sg_ProjectWebSitesPopup.cpp, .h (new) + sg_TaskCommandPopup.cpp, .h (new) + sg_TaskPanel.cpp, .h (new) + SkinManager.cpp + mac/ + MacBitmapComboBox.cpp, .h (new) + res/ + RedDot16.xpm (new) + YellowDot16.xpm (new) + GreenDot16.xpm (new) + mac_build/ + boinc.xcodeproj/ + project.pbxproj + win_build/ + boincmgr.vcproj + +David 27 Jan 2011 + - client: fix bug in setting GPU peak flops + + client/ + coproc_detect.cpp + lib/ + coproc.cpp,h + +Charlie 28 Jan 2011 + - MGR: Fix default skin selection display in Simple Preferences + dialog. + - MGR: Use standard native buttons in Simple Preferences and + Simple Notices dialogs. + - MGR: Use our control IDs instead of wxID_HELP for Help buttons + for Mac accessibility (wxID_HELP makes a bitmap button on + Macs which VoiceOver screen reader can't read.) + - MGR: Disable tooltips on Mac while new simple GUI menus are + popped up because they cover menus. + + clientgui/ + DlgAdvPreferences.cpp + DlgAdvPreferencesBase.cpp + sg_BoincSimpleFrame.cpp + sg_DlgMessages.cpp + sg_DlgPreferences.cpp + sg_ProjectCommandPopup.cpp + sg_ProjectWebSitesPopup.cpp + sg_TaskCommandPopup.cpp + wizardex.cpp + SkinManager.cpp + mac/ + MacBitmapComboBox.cpp, .h + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 28 Jan 2011 + - back end: allow the specification of a read-only DB replica + (in config.xml) to include DB name, user, and password. + - back end: add read-only replica info to SCHED_CONFIG, + so that C++ programs can use the replica + (currently only PHP code can use it) + - db_dump: use the read-only DB replica if it exists. + + html/inc/ + boinc_db.inc + db.inc + sched/ + sched_config.cpp,h + db_dump.cpp + +David 28 Jan 2011 + - new script sched/transitioner_catchup.php: transitions all WUs + that need it, then exits. + For big projects coming up after an outage, run this before bin/start + to minimize startup overload + - tweaks to PHP libraries to allow them to be used + by scripts anywhere in the dir hierarchy + + sched/ + transitioner_catchup.php + html/inc/ + boinc_db.inc + util_basics.inc + py/Boinc/ + setup_project.py + +Charlie 29 Jan 2011 + - MGR: Code cleanup. + + clientgui/ + sg_PanelBase.cpp, .h + sg_ProjectPanel.cpp, .h + sg_TaskPanel.cpp, .h + +Charlie 30 Jan 2011 + - MGR: New Simple GUI optimization. + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_PanelBase.cpp + sg_TaskPanel.cpp, .h + +Charlie 30 Jan 2011 + - MGR: Fix compile break on Linux. + + clientgui/ + sg_DlgPreferences.cpp + +Charlie 31 Jan 2011 + - MGR: Update Makefile. + - MGR: New Simple GUI optimization. + + clientgui/ + Makefile.am + sg_TaskPanel.cpp, .h + +Charlie 31 Jan 2011 + - Mac: Add info about dual-GPU Powerbooks to ReadMe files. + + mac_installer/ + GR-ReadMe.rtf + PTP-ReadMe.rtf + ReadMe.rtf + +David 1 Feb 2011 + - client: make "wrong URL" message not be a notice + - web: fix caching problem when PHP not installed as Apache module + + html/inc/ + cache.inc + client/ + cs_scheduler.cpp + +Charlie 1 Feb 2011 + - Mac: Localize items in Mac's BOINC menu. + + clientgui/ + AdvancedFrame.cpp + sg_BoincSimpleFrame.cpp + mac/ + MacGUI.pch + Mac_GUI.cpp + +Charlie 1 Feb 2011 + - MGR: Use branded short application name in Help tooltips instead + of always using "BOINC". + - Mac: Eliminate unused source files Localization.cpp, .h from Mac + project. + + clientgui/ + DlgEventLog.cpp + sg_BoincSimpleFrame.cpp + sg_DlgMessages.cpp + sg_DlgPreferences.cpp + sg_ProjectsComponent.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Rom 1 Feb 2011 + - WINSETUP: Avoid a 0xc0000135 error by giving the boinc_master and + boinc_project membership in the 'Users' group. Dynamic linking + to nvcuda.dll was failing because the project applications were + being denied access to DLLs in the system directory. + + win_build/installerv2/redist/Windows/src/boinccas/ + boinccas.rc + CACreateBOINCGroups.cpp + win_build/installerv2/redist/Windows/Win32/ + boinccas.dll + boinccas95.dll + win_build/installerv2/redist/Windows/x64/ + boinccas.dll + boinccas95.dll + +David 1 Feb 2011 + - create_work: add -d option + + tools/ + create_work.cpp + +Rom 3 Feb 2011 + - MGR: Enable the volunteer configurable 'shutdown core client' feature + on exit for Linux. It was orginally supposed to be enabled when + the balloon features were enabled, but got lost in ifdef hell. + (From "Lee") + + clientgui/ + DlgExitMessage.cpp + MainDocument.cpp + +David 3 Feb 2011 + - create_work: add some debugging printfs for Kamran + + tools/ + backend_lib.cpp + html/ + inc/ + forum.inc + profile.inc + user/ + weak_auth.php + +Charlie 3 Feb 2011 + - MGR: Eliminate unnecessary #ifdef. + + clientgui/ + BOINCGUIApp.cpp + +David 4 Feb 2011 + - client/manager: show venue in project properties + + clientgui/ + DlgItemProperties.cpp + client/ + client_types.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp + +David 7 Feb 2011 + - manager: msg tweak + client/ + CompletionErrorPage.cpp + +David 7 Feb 2011 + - client: don't crash if omit cmdline port#. Fixes #1040 + + client/ + cs_cmdline.cpp + +Rom 8 Feb 2011 + - MGR: Fix a bug that is several years old, appears to have been + introduced during the Unicode conversion phase for Windows. Passing + a wide character string into an narrow character function causes + a NULL reference exception. + + TODO: There is still an issue if the manager attempts to write to + stderr when the BOINC Manager log files are redirected to a + directory the user doesn't have access to. + + clientgui/ + SkinManager.cpp + +David 8 Feb 2011 + - user web: add "delete account" feature. + This allows a user to delete all traces of themselves from a project. + Namely: + - clear fields of user record: email_addr, authenticator, + name, country, postal_code + Note: record is not deleted + - clear the domain_name and last_ip_addr fields of hosts + Note: records are not deleted + - quit team + - delete private messages sent and received + - delete forum posts, subscriptions, and forum prefs + - delete profile and associated images + - server: compile fix + + html/ + inc/ + pm.inc + host.inc + forum.inc + user.inc + util.inc + user/ + delete_account.php + stats.php + tools/ + backend_lib.cpp + +David 8 Feb 2011 + - create_work and possibly other back-end programs: + fix bug that corrupted WU command lines. + The problem: we were using strcpy(p, p+n) to delete the + first n characters of p. + This is incorrect - the behavior of strcpy() is undefined + if its args overlap. + On some systems (e.q. AQUA's server) it does wacky things. + + tools/ + backend_lib.cpp + lib/ + str_util.cpp,h + parse.cpp + +David 9 Feb 2011 + - user web: apparently if you put links of the form + http://setiathome.berkeley.edu/help.php?key=Viagra.uk + all over the web, Google will list "Viagra.uk" in your site outline (why??). + Preliminary checkin for dealing with this. + + html/ + inc/ + prefs.inc + util.inc + user/ + view_profile.php + account_finish.php + am_get_info.php + add_venue.php + +David 9 Feb 2011 + - user web: make all forum tables full-width + html/inc/ + forum.inc + +David 9 Feb 2011 + - user web: finish dealing with get args spam + + html/ + user/ + *.php + inc/ + pm.inc + prefs.inc + forum.inc + util.inc + +David 9 Feb 2011 + - user web: appearance tweaks + + html/ + inc/ + forum.inc + user/ + forum_help_desk.php + forum_index.php + white.css + +David 10 Feb 2011 + - user web: fix "nowrap" post display + + html/inc/ + forum.inc + +David 10 Feb 2011 + - user web: CSS cleanup. + Use classes instead of IDs. + white.css and black.css are cleaned up; style2.css needs work + + html/ + inc/ + pm.inc + forum.inc + user.inc + util.inc + user/ + pm.php + sample_index.php + forum_thread.php + main.css + forum_help_desk.php + friend.php + forum_forum.php + forum_index.php + style2.css + white.css + +David 10 Feb 2011 + - client: if a logical filename contains /'s, + create the needed dirs under the slot dir + - user web: pages with translatable text should not be cached. + Fix this for home page; there are some others + + client/ + app_start.cpp + html/user/ + sample_index.php + +David 11 Feb 2011 + - manager: project properties: if no venue, show "default" + + clientgui/ + DlgItemProperties.cpp + +David 11 Feb 2011 + - user web: style tweaks + html/user/ + forum_post.php + main.css + white.css + +David 11 Feb 2011 + - user web: disable "delete account" feature + + html/ + user/ + delete_account.php + inc/ + user.inc + +David 11 Feb 2011 + - user web: bug fixes + html/user/ + team_quit_action.php + team_manage.php + forum_moderate_post.php + +David 13 Feb 2011 + - user web: fix venue change + html/ + inc/ + prefs.inc + util.inc + user/ + host_venue_action.php + +David 13 Feb 2011 + - user web: bug fixes + + html/user/ + forum_moderate_thread.php + add_venue.phhp + +David 13 Feb 2011 + - user web: bug fix + + html/user/ + forum_reply.php + +David 13 Feb 2011 + - user web: bug fix + html/user/ + forum_banishment_vote_action.php + +David 14 Feb 2011 + - user web: bug fix + html/user/ + pm.php + +David 14 Feb 2011 + - user web: fix [img] BBcode problem + html/inc/ + text_transform.inc + +David 14 Feb 2011 + - user web: various fixes + html/ + inc/ + prefs.inc + user/ + main.css + prefs_remove.php + forum_reply.php + white.css + add_venue.php + forum_edit.php + +David 14 Feb 2011 + - user web: fixes + html/user/ + sample_index.php + main.css + +David 14 Feb 2011 + - client, linux: use X server for idle detection if available + + configure.ac + client/ + hostinfo_unix.cpp + +Charlie 15 Feb 2011 + Mac: Make backtrace compile properly with OS 10.5 and OS 10.6 SDKs. + + lib/ + mac/ + QBacktrace.c + QCrashReport.c + +Charlie 15 Feb 2011 + Mac Installer: Fix the code which deletes installer receipts to use + the current package name (which changed when I eliminated the + Mac installer wrapper application around the installer package.) + This is needed to allow installing an older version to replace a + newer one under OS 10.4.x. + + mac_installer/ + PostInstall.cpp + uninstall.cpp + +David 15 Feb 2011 + - transitioner: fix bug that could cause file deletion to not be done + for some WUs + - back end: fix the way "report grace period" is implemented + old: result.report_deadline (i.e. what's in the DB) and + the deadline sent to the client are the same. + Some confusing and incorrect logic in the transitioner + tries to provide the desired semantics. + new: result.report_deadline is the deadline sent to the client, + plus the grace period. + No logic in the transitioner is needed. + + db/ + boinc_db.cpp,h + sched + sched_config.cpp,h + sched_send.cpp + transitioner.cpp + sched_resend.cpp + +David 15 Feb 2011 + - file upload handler: if client-reported offset is less than file size, + don't just print an error message; + lseek() back to the offset point. + Otherwise we can end up with duplication in the file. + + sched/ + file_upload_handler.cpp + +David 15 Feb 2011 + - update_versions: if FILE.file_ref_info contains , + use that instead of physical name. + This lets you have logical names with slashes + + py/Boinc/ + tools.py + +Charlie 16 Feb 2011 + Mac: More thorough error checking and recovery in code which localizes + items in Mac's BOINC menu. + + mac/ + Mac_GUI.cpp + +David 16 Feb 2011 + - user web: fixes to private message functions + + html/user/ + pm.php + +David 16 Feb 2011 + - client: fix work-fetch bug. + The change in [21877] caused tasks in "download stalled" state + to be skipped in RR simulation, + and therefore to not be counted in the work buffer. + However, "download stalled" was not being evaluated correctly; + it was considering only per-file backoff, not project-wide backoff. + - client: another work-fetch bug: + don't fetch work from a project in project-wide download backoff. + + client/ + client_types.cpp + +David 16 Feb 2011 + - client: fix bug in mechanism that defers work request until + pending uploads are finished. + Due to a typo, this was not being done. + + client/ + cs_scheduler.cpp + +David 16 Feb 2011 + - client: when exclusive app mechanism is used (CPU or GPU) + wait for 30 secs after excl app exits + before restarting computation + + client/ + app.cpp,h + client_state.h + cs_prefs.cpp + +Charlie 17 Feb 2011 + Mac: Additional error checking and release created objects in code + which localizes items in Mac's BOINC menu. + + mac/ + Mac_GUI.cpp + +Charlie 17 Feb 2011 + - Mac installer: update branded build scripts to eliminate wrapper + application around install package (as was done for BOINC 6.12.7). + + clientgui/ + res/ + MacPTPPkgIcon.zip (new) + MacGRPkgIcon.zip (new) + mac_installer/ + make_GridRepublic.sh + make_ProgThruProc.sh + +David 17 Feb 2011 + - file upload handler: fix faulty bug fix of 2/15 + - client: make REC-based scheduling and hysteresis the defaults + + client/ + work_fetch.cpp + sched/ + file_upload_handler.cpp + +David 17 Feb 2011 + - client: when detach project, remove its RSS feeds from list + - client: remove once-per-week limit for client-generated notices; + need to show "network connection required" more often + - client: when remove "network conn required" notice + (because now have conn) + set the flag that says complete notice list is being sent + - client: if RSS feed fetch returns , + show the corresponding message rather than "XML parse error" + + client/ + client_state.cpp + cs_notice.cpp + gui_rpc_server_ops.cpp + http_curl.cpp + net_stats.cpp,h + +Rom 18 Feb 2011 + - client: Fast User Switching does not change the session protocol + to RDP when the active session is put into the background and + a new one is brought into the foreground. It appears it is safe + to use the connected state in addition to the protocol + to detect when the session is no longer capable of processing + GPU work + + lib/ + win_util.cpp + +Charlie 18 Feb 2011 + - Mac: Update link to NVIDIA CUDA Mac driver download page + + mac_installer/ + GR-ReadMe.rtf + PTP-ReadMe.rtf + ReadMe.rtf + +David 18 Feb 2011 + - client: more notice-related fixes. + I'm working on this case: + - start up + - disconnect (produces notice) + - reconnect (removes notice) + The client is now doing the right thing. + The manager is not. + + client/ + acct_setup.h + cs_notice.cpp,h + gui_rpc_server.h + gui_rpc_server_ops.cpp + +David 19 Feb 2011 + - wrapper: add optional element in elements; + specifies a directory to run app in. + macro-substitute project dir for $PROJECT_DIR. + From Carl Christensen, more or less + + samples/wrapper/ + wrapper.cpp + +David 19 Feb 2011 + - wrapper: add optional element in elements; + specifies an environment variable assignment; + macro-substitute project dir for $PROJECT_DIR. + From Carl Christensen + + samples/wrapper/ + wrapper.cpp + +David 19 Feb 2011 + - client: make "wait 30 sec after exclusive app exits" apply to network too + - client: fix bug in "wait 30 sec after exclusive app exits" logic + - client: fix compile warning and possible bug in is_remote_desktop() + - win: remove wrappture_example from solution + (until Hubzereo guys get their win lib working) + + client/ + app.cpp + cs_prefs.cpp + lib/ + win_util.cpp + samples/wrapper/ + wrapper.cpp + win_build/ + boinc.sln + +David 20 Feb 2011 + - wrapper: Windows fixes + + samples/wrapper/ + wrapper.cpp + +David 20 Feb 2011 + - client: fix disk-space accounting bug when user quotas in use + (Windows) + + lib/ + filesys.cpp + +Charlie 21 Feb 2011 + - client: fix compiler warning. + + client/ + cs_notice.cpp + +David 22 Feb 2011 + - client: add cpu_sched debug messages for anti-domino-effect + and anti-thrasing mechanisms + - wrapper: to kill an app, use SIGTERM instead of SIGKILL + client/ + acct_mgr.cpp + cpu_sched.cpp + samples/wrapper/ + wrapper.cpp + +David 22 Feb 2011 + - wrapper: improve and bullet-proof the way we kill apps. + Win: enumerate all descendants, and kill them all TerminateProcess(). + Unix: + send the main process a SIGTERM. + Check once a sec for existence of descendants. + if none, done + If any still exist after 10 sec, kill all descendants + - wrapper fix bug in Win env var stuff + - scheduler: check for VBox version 3.2+ in app_plan() + + sched/ + sched_customize.cpp + lib/ + procinfo.h + procinfo.cpp (new) + procinfo_win.cpp + procinfo_unix.cpp + Makefile.am + samples/wrapper/ + wrapper.cpp + +David 22 Feb 2011 + - client: send + at start of scheduler and account manager requests. + + client/ + cs_scheduler.cpp + acct_mgr.cpp + cpu_sched.cpp + +David 22 Feb 2011 + - client: don't send . + Daemons are started before regular tasks, + run concurrently with them, and are killed on exit. + + samples/wrapper/ + wrapper.cpp + +David 24 Feb 2011 + - client: remove auto update stuff from makefiles. + This feature is mothballed. + + client/ + client_state.cpp,h + scheduler_op.cpp,h + file_names.cpp + cs_scheduler.cpp + cs_statefile + Makefile.am + +David 24 Feb 2011 + - wrapper: fixes from Carl + + lib/ + procinfo_win.cpp + samples/wrapper/ + wrapper.cpp + +Charlie 24 Feb 2011 + - Mac: Remove auto_update.cpp, auto_update.h from XCode Project. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 25 Feb 2011 + - user web: + - in friend request notification, link to user page + - in user page, show ID + - remove "Account data for " in page title + + html/ + inc/ + user.inc + friend.in + user/ + show_user.php + +Rytis 26 Feb 2011 + - user web: add a config option to always show workunit details when using + adaptive replication. + + html/user/ + workunit.php + +David 26 Feb 2011 + - user web: fix wrong user ID + + html/inc/ + user.inc + +David 26 Feb 2011 + - back end: add two example trickle handlers: + trickle_credit: grants credit based on CPU time reported in msg + trickle_echo: echoes trickle-up as a trickle-down + + sched/ + trickle_handler.cpp, h (new) + sched_result.cpp + trickle_credit.cpp + credit.cpp,h + trickle_echo.cpp + validator.cpp + Makefile.am + +David 28 Feb 2011 + - user web: add a feature allowing project admins to control + whether news items are exported as notices. + The creator of a news item is shown a "Don't export" or "Export" + button on the thread page. + By default, news items are exported. + + db/ + schema.sql + html/ + inc/ + news.inc + user/ + forum_thread.php + notices.php + forum_thread_status.php + +David 28 Feb 2011 + - user web: bug fix to the last checkin + - boinccmd: fix --get_project_config operation + + html/user; + forum_thread_status.php + client/ + boinc_cmd.cpp + +David 2 Mar 2011 + - user web: show date/time on friend request page + + html/user/ + friend.php + +Rom 2 Mar 2011 + - MGR: Properly handle the case where the only notice in the manager + is the 'no notice' notice and then we transition to a single notice + from another source. + + clientgui/ + NoticeListCtrl.cpp, .h + +David 2 Mar 2011 + - manager: show notice create time rather than arrival time + - client: don't show "need network" notice if we don't need it + + clientgui/ + NoticeListCtrl.cpp + client/ + cs_notice.cpp + +David 2 Mar 2011 + - client: when get a bunch of notices from RSS feed, + sort them by create time before appending to notice list. + This ensures that, in the Notices tab, + notices are ordered decreasing create time within an RSS feed + (though not necessarily across feeds) + + client/ + cs_notice.cpp,h + +Rom 2 Mar 2011 + - MGR: Turn -boincargs into a string instead of an option. + + clientgui/ + BOINCGUIApp.cpp + +Rom 2 Mar 2011 + - MGR: Turn off the task pane for the notices tab. + + clientgui/ + ViewNotices.cpp + +Rom 2 Mar 2011 + - MGR: Disable our color scheme is a non-white background is selected + for the current theme. My commit on 3 Mar 2010 wasn't good enough + for High-Contrast themes. + + clientgui/ + BOINCBaseView.cpp + DlgEventLog.cpp + +David 2 Mar 2011 + - client: in deciding whether to remove the "need network" notice, + we were using the wrong (too high-level) interface + + client/ + cs_notice.cpp + +Charlie 3 Mar 2011 + - MGR: Remove the old SimpleGUI from the projects. The following + source files are no longer used; they have been removed from the + builds, but have not yet been deleted from the SVN repository: + sg_BoincSimpleGUI.cpp,.h, sg_ClientStateIndicator.cpp,.h, + sg_ImageButton.cpp,.h, sg_ImageLoader.cpp,.h, sg_ProgressBar.cpp,.h, + sg_ProjectsComponent.cpp,.h, sg_StatImageLoader.cpp,.h, + sg_ViewTabPage.cpp,.h + + clientgui/ + AdvancedFrame.cpp, .h + BOINCGUIApp.cpp, .h + Events.h + Makefile.am + sg_BoincSimpleFrame.cpp, .h + mac_build/ + boinc.xcodeproj/ + project.pbxproj + win_build/ + boincmgr.vcproj + +Rom 3 Mar 2011 + - MGR: Change the reminder frequency interval to hours and adjust the min/max + values to 0/24. Default value is now 6 hours between notification reminders. + + clientgui/ + BOINCBaseFrame.cpp + BOINCDialupManager.cpp + BOINCTaskBar.cpp + DlgOptions.cpp + +David 3 Mar 2011 + - client: fix inaccuracy in RR simulation reported by Bill Barber. + The problem arises when there are jobs of projects + with widely differing resource shares, + and results in an overestimation of saturated time. + + Old: at the start of simulation, call WORK_FETCH::compute_shares() + to get resources of runnable projects. + Use these throughout the simulation. + + Problem: suppose you have 2 runnable projects; + P1 has large RS, P2 has small RS. + P1's jobs finish quickly. + P2's jobs then are running alone, + but their FLOPS is scaled (incorrectly) by P2's small RS. + + Solution: recompute relative CPU resource share within the + simulation loop, + and compute it over the projects that have actives jobs + in the simulation. + client/ + rr_sim.cpp + client_types.h + +Charlie 3 Mar 2011 + - MGR: reduce duration of notifications on Mac from 15 to 5 seconds. + + clientgui/ + BOINCTaskBar.cpp + +David 3 Mar 2011 + - manager: fix copyright date in about box + + clientgui/ + DlgAbout.cpp + +David 4 Mar 2011 + - scheduler: if we're not sending jobs because of user prefs + (no CPU, no GPU, selected apps) + send a message, not a notice. + Assume the user knew what they were doing, + and doesn't want to be nagged. + - scheduler: check for the existence of an app version + before checking for user selected-app prefs. + This prevents sending "no jobs available for selected apps" + message when no app versions exist for non-selected apps + - scheduler: use "tasks" instead of "work" in user messages + + sched/ + sched_array.cpp + sched_send.cpp + +David 4 Mar 2011 + - client: fix spurious error when removing a notice RSS feed + + client/ + cs_notice.cpp + +David 6 Mar 2011 + - client: print smoothed as well as instantaneous WSS + - manager: make RPC reason strings translatable + + client/ + app.cpp + clientgui/ + ViewProjects.cpp + +Rom 7 Mar 2011 + - MGR: Refactor part of the Options dialog out of the Advanced Frame + code. + - MGR: Change the Reminder Frequency option in the Options dialog to + a combo box. + + TODO: Change the taskbar logic to handle the 'always' case. + + clientgui/ + AdvancedFrame.cpp + BOINCBaseFrame.cpp, .h + BOINCTaskBar.cpp + DlgOptions.cpp, .h + +Rom 7 Mar 2011 + - MGR: ComboBox's are zero index based. + + clientgui/ + DlgOptions.cpp, .h + +Rom 7 Mar 2011 + - MGR: Handle the 'always' option by only popping a new balloon if the + unread notice count differs from the last time we popped a + balloon. + + clientgui/ + BOINCTaskBar.cpp, .h + +Rom 7 Mar 2011 + - MGR: Don't attempt to set the project or account manager if the project + list control does not contain any items. This can cause a crash + if the all_projects_list.xml is empty. + + clientgui/ + AccountManagerInfoPage.cpp + ProjectInfoPage.cpp + +Charlie 7 Mar 2011 + - MGR: Fix compiler warning. + + clientgui/ + DlgOptions.cpp + +David 7 Mar 2011 + - client: fix to [23162] that broke work fetch + + client/ + work_fetch.cpp + +David 8 Mar 2011 + - client: don't put CDATA around account manager opaque data + in request msg + + client/ + acct_mgr.cpp + +Charlie 10 Mar 2011 + - MGR: Remove from Skin Manager items no longer used by SimpleGUI. + The following source files are no longer used; they have been + removed from the builds, but have not yet been deleted from the + SVN repository: + + clientgui/ + common/ + wxFlatNotebook.cpp,.h + wxFlatNotebookImages.h + wxFNBDropTarget.h + res/ + skins/ + default/ + graphic/ + spacer_image.xpm + state_indicator_background_image.xpm + connecting_indicator_image.xpm + error_indicator_image.xpm + workunit_active_image.xpm + workunit_suspended_image.xpm + workunit_tab_area_background_image.xpm + workunit_area_background_image.xpm + workunit_animation_background_image.xpm + workunit_gauge_background_image.xpm + workunit_gauge_progress_indicator_image.xpm + project_area_background_image.xpm + attach_project_button.xpm + attach_project_clicked_button.xpm + help_button.xpm + help_clicked_button.xpm + right_arrow_button.xpm + right_arrow_clicked_button.xpm + left_arrow_button.xpm + left_arrow_clicked_button.xpm + save_button.xpm + save_clicked_button.xpm + synchronize_button.xpm + synchronize_clicked_button.xpm + cancel_button.xpm + cancel_clicked_button.xpm + close_button.xpm + close_clicked_button.xpm + copy_all_button.xpm + copy_all_clicked_button.xpm + copy_button.xpm + copy_clicked_button.xpm + messages_link_image.xpm + messages_alert_link_image.xpm + suspend_link_image.xpm + resume_link_image.xpm + preferences_link_image.xpm + advanced_link_image.xpm + wizard_bitmap.xpm + + The following files have been modified: + + clientgui/ + BOINCGUIApp.cpp + SkinManager.cpp, .h + sg_DlgPreferences.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + win_build/ + boincmgr.vcproj + +Bernd 10 Mar 2011 + - unix build system: generate_svn_version + - extended support for git repos: + generate numeric version from last commit date, + record host, remote and branch names + + generate_svn_version.sh + +David 10 Mar 2011 + - client (Win): if available, use GetActiveProcessorCount() + rather than GetSystemInfo() to get the # of CPUs. + GetSystemInfo() returns the # of CPUs in the caller's + processor group, which is always <= 64 even on hosts + with > 64 CPUs + + client/ + hostinfo_win.cpp + +David 10 Mar 2011 + - manager: Add Project wizard: + if a project has old server software and + doesn't export platform list (e.g. Superlink) + don't show a confusing "this project may not support + your type of computer" message; + + clientgui/ + ProjectInfoPage.cpp + +Charlie 11 Mar 2011 + - MGR: Fill in initial URL on Account Manager Wizard Selection page. + - MGR: Add a new page to Attach Wizard to be displayed if the user + rejects the Terms of Use. + - lib: Make sorts of projects and account mangers case-insensitive. + + clientgui/ + AccountManagerInfoPage.cpp + Makefile.am + TermsOfUsePage.cpp + UserDisagreesPage.cpp, .h (new) + WizardAttach.cpp, .h + lib/ + gui_rpc_client_ops.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + win_build/ + boincmgr.vcproj + +Charlie 11 Mar 2011 + - MGR: Fix compiler warning. + + clientgui/ + sg_BoincSimpleFrame.cpp + +Rytis 12 Mar 2011 + - user web: implement Memcache as an option for caching (defaults to + in-file cache). Can be enabled by installing php5-memcached package + and defining MEMCACHE_SERVERS in project.inc + + html/ + inc/ + cache.inc + project.sample/ + project.inc + user/ + show_user.php + team_display.php + top_hosts.php + top_teams.php + top_users.php + view_profile.php + +David 12 Mar 2011 + - move client simulator PHP code to doc/sim + + doc/sim/ + various + +Rytis 13 Mar 2011 + - user web: change remaining occurrences of fullpage caching to object + cache. start_cache() and end_cache() are now deprecated. + + html/ + inc/ + cache.inc + team.inc + user/ + download_network.php + server_status.php + team_members.php + userw.php + +David 13 Mar 2011 + - validator: if --credit_from_wu is set, and no credit specified in WU, + assign zero credit and keep going + - client simulator work + + client/ + sim.cpp + makefile_sim + cs_notice.cpp + cpu_sched.cpp + sched/ + validator.cpp + +David 14 Mar 2011 + - API: get rid of BOINC_OPTIONS::backwards_compatible_graphics. + Not necessary. + - wrapper: add optional element to + task descriptor. + If set, pass the wrapper's cmdline args to that task. + NOTE: previously they were always passed. + If you want this behavior, you now must set this. + + samples/wrapper/ + wrapper.cpp + api/ + boinc_api.cpp,h + +Rom 14 Mar 2011 + - SCR: Follow the Mac's lead and gracefully exit the Data Management + thread. Preserve the handle to take more drastic actions should + that not work. + + clientscr/ + mac_saver_module.cpp, .h + screensaver.cpp + screensaver_win.cpp, .h + +David 14 Mar 2011 + - client simulator stuff + + html/user/ + forum_thread.php + client/ + cpu_sched.cpp + +David 14 Mar 2011 + - ops: update script that counts GPUs + + html/ops/ + nvidia.php + +Charlie 14 Mar 2011 + - SCR: Fix compile breaks. + + clientscr/ + mac_saver_module.cpp + +David 15 Mar 2011 + - client simulator stuff + client/ + sim_cpp,h + +David 16 Mar 2011 + - wrapper: improved subprocess cleanup, Unix + + samples/wrapper/ + wrapper.cpp + client/ + sim.cpp + +Bernd 18 Mar 2011 + Einstein@home extensions: + - protect malloc.h + - validator: allow to update 'random' result field + - assimilator: add global variables results_prefix and transcripts_prefix, + set on command-line + + sched/ + assimilator.cpp + assimilate_handler.h + hr_info.cpp + db/ + boinc_db.cpp + +Bernd 18 Mar 2011 + - (locality) scheduler: + omit confusing message & backoff in mixed scheduling + + sched/ + sched_locality.cpp + +David 20 Mar 2011 + - client and API: pass "network suspended" flag from client to app; + make it available as part of BOINC_STATUS + + api/ + boinc_api.cpp,h + html/inc/ + uotd.inc + client/ + app_control.cpp + +David 21 Mar 2011 + - wrapper: macro-substitute $NTHREADS with the --nthreads option value + in job.xml + + samples/wrapper/ + wrapper.cpp + +Rom 22 Mar 2011 + - VBox: Checkpoint for Windows + * Creates/registers virtual machine + * Starts/Stops virtual machine + * Suspends/Resumes virtual machine + * Deletes/deregisters virtual machine + + TODO: + * Fraction done properly + * Standard error streams from virtualized applications + * Find a way to hide the VBoxHeadless application window (It can be minimized manually) + + samples/vboxwrapper/ + vbox.cpp, .h + vbox_win.cpp + vboxwrapper.cpp + vm.cpp, .h + +Charlie 23 Mar 2011 + - client: Define MAXPATHLEN if not defined for compatibility with HURD. + + client/ + hostinfo_unix.cpp + +David 24 Mar 2011 + - define MAXPATHLEN, if needed, in filesys.h + - fix typo in a GUI RPC handler + + lib/ + filesys.h + api/ + mac_icon.cpp + graphics2_unix.cpp + client/ + switcher.cpp + gui_rpc_server_ops.cpp + check_security.cpp + hostinfo_unix.cpp + +Charlie 24 Mar 2011 + - client: Begin adding OpenCL support. + + client/ + coproc_detect.cpp + lib/ + cl.h (added) + cl_platform.h (added) + coproc.h + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 24 Mar 2011 + - client: generalize the GPU framework so that + - new GPU types can be added easily + - users can specify GPUs in cc_config.xml, + referred to by app_info.xml, + and they will be scheduled by BOINC + and passed --device N options + Note: the parsing of cc_config.xml is not done yet. + - RPC protocols (account manager and scheduler) + can now specify GPU types in separate elements + rather than embedding them in tag names + e.g. NVIDIA rather than + - client: in account manager replies, parse elements of the form + NAME + indicating the GPUs of type NAME should not be used. + This allows account managers to control GPU types + not hardwired into the client. + Note: and will continue to be supported. + - scheduler RPC reply: add + NAME + (NAME = GPU name) + to indicate that the project has no jobs for the indicated GPU type. + etc. are still supported + - client/lib: remove set_debts() GUI RPC + - client/scheduler RPC + remove etc. (superceded by no_app) + Exception: elements in sched request + still have and . + Fix this later. + + Implementation notes: + - client/lib: change "CUDA" to "NVIDIA" in type/variable names, and in XML + Continue to recognize "CUDA" for compatibility + - host_info.coprocs no longer used within the client; + use a global var (COPROCS coprocs) instead. + COPROCS now has an array of COPROCs; + GPUs types are identified by the array index. + Index zero means CPU. + - a bunch of other resource-specific structs (like RSC_WORK_FETCH) + are now stored in arrays, with same indices as COPROCS + (i.e. index 0 is CPU) + - COPROCS still has COPROC_NVIDIA and COPROC_ATI structs to hold vendor-specific info + - APP_VERSION now has a struct GPU_USAGE to describe its GPU usage + + client/ + acct_mgr.cpp,h + app_start.cpp + client_state.cpp,h + client_types.cpp,h + coproc_detect.cpp + cpu_sched.cpp + cs_account.cpp + cs_prefs.cpp + cs_scheduler.cpp + cs_statefile.cpp + gui_rpc_server_ops.cpp + rr_sim.cpp + scheduler_op.cpp.h + work_fetch.cpp,h + lib/ + coproc.h + hostinfo.cpp,h + win_build/ + boinc_cli.vcproj + +Charlie 25 Mar 2011 + - client: Temporarily work around compile breaks introduced by the changes + to generalize the GPU framework. + NOTE to David: please look for "//TODO: David, please fix" in these + files and fix as appropriate. + + client/ + app_start.cpp + boinc_cmd.cpp + +David 25 Mar 2011 + - manager: fix crashing bug when notices (or other text parsed by XML_PARSER) + contain non-ASCII characters. + Rom: please port to 6.12 + + lib/ + parse.cpp + +David 25 Mar 2011 + - client: Unix compile fixes + + client/ + app_start.cpp + boinc_cmd.cpp + +Charlie 25 Mar 2011 + - client: Continue adding OpenCL support. + - lib: Fix inconsistent line endings in coproc.cpp. + + client/ + coproc_detect.cpp + lib/ + coproc.cpp, .h + +David 25 Mar 2011 + - manager: fix the above to detect premature EOF correctly + + lib/ + parse.cpp + +David 25 Mar 2011 + - scheduler: compile fixes + + sched/ + sched_customize.cpp + sched_version.cpp + sched_send.cpp + handle_request.cpp + sched_types.cpp + +David 25 Mar 2011 + - API: compile fixes for MinGW. Fixes #955. from Matt Arsenault + + lib/ + stackwalker_imports.h + boinc_win.h + Makefile.mingw + api/ + Makefile.mingw + +David 27 Mar 2011 + - client: Win OpenCL fix from [P3D] Crashtest + + client/ + coproc_detect.cpp + +Rom 28 Mar 2011 + - MGR: Handle the link click events from the notices control for the + Simgle GUI notices dialog box. + + clientgui/ + sg_DlgMessages.cpp, .h + +Rom 28 Mar 2011 + - API: Flush buffers before terminating. + - SCR: Flush buffers before terminating. + + api/ + boinc_api.cpp + clientscr/ + screensaver_win.cpp + +Charlie 29 Mar 2011 + - MGR: Fix compile break. + + clientgui/ + sg_DlgMessages.h + +Charlie 29 Mar 2011 + - client: Continue adding OpenCL support. + + client/ + coproc_detect.cpp + lib/ + coproc.cpp, .h + +Rom 29 Mar 2011 + - client: prevent client from crashing in OpenCL code + - client: fix function prototypes for dynamically calling + OpenCL functions. + + client/ + coproc_detect.cpp + +Rom 29 Mar 2011 + - MGR: Remove UserDisagreesPage from the wizard, replace functionality + by enabling/disabling the next button as needed. + - MGR: Fix a couple of warnings. + + clientgui/ + sg_CustomControls.cpp + sg_DlgMessages.cpp + TermsOfUsePage.cpp + UserDisagreesPage.cpp, .h (Deleted) + WizardAttach.cpp, .h + +Rom 29 Mar 2011 + - WINSCR: So after looking over all the logs from WCG and now from Jacob + Klein a pattern started to emerge. At the end of the log files the last + message logged was 0x12 which translates into WM_QUIT. The latest + documentation on WM_QUIT states it should never show up in the message + loop to begin with. + + The docs now say that WM_QUIT should not be sent to the message loop by + way of PostMessage. We have been doing things this way for over 5 years. + + Change the shutdown logic so that only the primary curtain window can call + PostQuitMessage() and all other curtain windows just exit when they receive + a WM_DESTROY message. + + I'm not sure what causes this to be a problem on some machines and not + others. But preliminary results from Jacob are encouraging. + + clientscr/ + screensaver_win.cpp, .h + +Charlie 30 Mar 2011 + - Mac: Eliminate unused source files UserDisagreesPage.cpp, .h from Mac + project. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Rom 30 Mar 2011 + - client: OpenCL Profile Version wasn't being used anywhere and trying to get it + was causing a crash on Windows. Remove for now. + - client: Fix ATI OpenCL detection so that the coproc test messages will appear. + + client/ + coproc_detect.cpp + lib/ + coproc.h + +Rom 30 Mar 2011 + - client: Beef up the trace logging when attempting to match OpenCL devices to their + native counterparts. + + client/ + coproc_detect.cpp + +Charlie 30 Mar 2011 + - client: Continue adding OpenCL support. + We must check all OpenCL platforms; apparently ATI's platform reports only + ATI / AMD GPUs, and NVIDIA's platform reports only NVIDIA GPUs. + The NVIDIA vendor may be reported as "NVIDIA" or"NVIDIA Corporation" + Note: The client currently always says "No usable GPUs found" because + David has not yet completed implementing the changes begun on 24 Mar. + + client/ + coproc_detect.cpp + lib/ + coproc.h + +Rom 31 Mar 2011 + - lib: Bring header and implementation files into sync over the coproc parsing + function. + + lib/ + coproc.cpp, .h + +Rom 31 Mar 2011 + - lib: Fix build break for Linux. + + lib/ + procinfo.cpp + +Charlie 31 Mar 2011 + - Fix Win build breaks caused by renaming of directory coprocs/cuda/ + to coprocs/NVIDIA/. + - Eliminate redundant cl.h and clpatform.h in lib/ directory because + Rom has added them to new coprocs/OpenCL/include/ directory. + NOTE: It is risky to have multiple copies of the same file in the same + source tree, as they can easily get out of sync. + + Makefile.incl + lib/ + coproc.h + cl.h (deleted) + cl_platform.h (deleted) + mac_build/ + boinc.xcodeproj/ + project.pbxproj + win_build/ + boinc_cli.vcproj + boinc_os_ss.vcproj + boinc_ss.vcproj + boinccmd.vcproj + boinclog.vcproj + boincmgr.vcproj + example_app_multi_thread.vcproj + libboinc.vcproj + libboinc_staticcrt.vcproj + libboincapi_staticcrt.vcproj + libgraphics2.vcproj + sleeper.vcproj + uc2.vcproj + uc2_graphics.vcproj + vboxwrapper.vcproj + wrapper.vcproj + wrappture_example.vcproj + +Charlie 31 Mar 2011 + - client: Add debug logging to show GPU detection when OpenCL is installed + but CAL and / or CUDA is not. (I have verified this works for NVIDIA + GPUs on Mac OS 10.6 without CUDA support installed.) + + client/ + coproc_detect.cpp + +David 1 Apr 2011 + - server/client: make a stripped-down OpenCL header file, lib/cl_boinc.h, + for the things that BOINC actually needs + (fixes server compile problems) + - client: fix various compile errors in coproc_detect.cpp + + lib/ + coproc.h + cl_boinc.h + Makefile.am + client/ + coproc_detect.cpp + +David 1 Apr 2011 + - scheduler: removed unused destructors in COPROC that + caused scheduler to crash (not sure why) + + sched/ + sched_types.cpp,h + lib/ + coproc.h + procinfo.h + +Charlie 1 Apr 2011 + - Mac: Revise Mac project for deleted coprocs/OpenCL/include/ directory and + new cl_boinc.h. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 1 Apr 2011 + - lib: fix compile warnings by removing virtual functions in COPROC + + lib/ + coproc.h + +David 4 Apr 2011 + - scheduler: don't send unboundedly many assigned jobs + - Makefile: don't include unnecessary files + + sched/ + sched_assign.cpp + Makefile.incl + +David 4 Apr 2011 + - client: discard messages whose create time OR arrival time + is more than 30 days ago + + client/ + cs_notices.cpp + +David 4 Apr 2011 + - client: use larger buffer for app command line, + enough to accommodate 64KB from wu.cmdline + + client/ + app_start.cpp + +David 4 Apr 2011 + - scheduler: and + are per-processor, not per-host. + + sched/ + sched_config.cpp + sched_limit.h + +David 6 Apr 2011 + - manager: change simple view notices window title from Messages to Notices + + clientgui/ + sg_DlgMessages.cpp + +David 6 Apr 2011 + - user web: fix numeric field sanitization in prefs. Fixes #1087. + - client: if PREFS::max_ncpus_pct is 0, don't set it to 100; + doing so prevents PREFS::max_ncpus from having any effect. + + html/inc/ + prefs_util.inc + lib/ + prefs.cpp + +David 8 Apr 2011 + - client: defer reporting completed tasks if an upload started recently; + we might be able to report more tasks once the upload completes. + + client/ + cs_scheduler.cpp + +David 8 Apr 2011 + - "upgrade" script: copy sched/fcgi if it exists + + py/Boinc/ + setup_project.py + +David 8 Apr 2011 + - "upgrade" script: remove --project_root option, + and allow full path of project root dir + instead of the short name + + tools/ + upgrade + +David 10 Apr 2011 + - user web: fix "delete profile" function + + html/ + user/ + delete_profile.php + inc/ + profile.inc + +David 10 Apr 2011 + - scheduler: failure to set up COPROCS structure correctly + led to per-GPU job limits not being enforced. + + lib/ + coproc.cpp + +David 10 Apr 2011 + - user web: use special icon for hidden threads (from Jord) + + html/ + inc/ + forum.inc + user/ + forum_forum.php + img/ + hidden.png + +Rom 11 Apr 2011 + - MGR: Remove unneeded asserts. + + clientgui/ + BOINCTaskBar.cpp + +Rom 13 Apr 2011 + - MGR: Add missing keyboard accelerators for the event log. + - MGR: Re-enable the next button when the terms of use wizard + page when the back button is pressed. + + clientgui/ + DlgEventLog.cpp + TermsOfUsePage.cpp + +David 13 Apr 2011 + - admin web: remove options to delete apps and app versions. + This is almost always a bad idea. + + html/ops/ + manage_apps.php + manage_app_versions.php + +David 13 Apr 2011 + - client: + - add log flag + - show trickle-up and int file upload msgs if set + - if scheduler RPC reason is trickle-up, say so + - manager: + - restore "non CPU intensive" to task description + - project properties: show if RPC in progress or trickle-up pending. + (show these low-probability things only if present) + - manager: fix Unix build + + (from Ian Hay) + + clientgui/ + MainDocument.cpp + Makefile.am + DlgITemProperties.cpp + lib/ + gui_rpc_client_print.cpp + client/ + log_flags.cpp,h + scheduler_op.cpp + app.cpp + app_control.cpp + +Rom 14 Apr 2011 + - MGR: Check to see if keyboard accelerators can be redefined on the fly. + + clientgui/ + DlgEventLog.cpp + +Rom 14 Apr 2011 + - MGR: Add missing event handler map item. + + clientgui/ + sg_DlgMessages.cpp + +David 14 Apr 2011 + - API: add support for multi-process apps, + i.e. those that create subprocesses. + Previously, the client's job control options (suspend/resume/quit) + would not work for subprocesses. + Multiprocess apps must initialize with something like: + BOINC_OPTIONS options; + boinc_options_defaults(options); + options.multi_process = true; + boinc_init_options(&options); + Note: an application can be both multi-thread and multi-process. + In this case set options.multi_thread as well. + - wrapper: add support for multi-process apps. + Previously, suspend/resume operations did not work for subprocesses. + If a task is multi-process, you must include + 1 + in its descriptor. + + lib/ + procinfo.cpp,h + samples/wrapper/ + wrapper.cpp + api/ + boinc_api.cpp,h + +David 15 Apr 2011 + - client: fix bug that cause notice RSS feeds to disappear and reappear, + and notices to erroneously be shown as new. + + client/ + cs_notice.cpp + +David 18 Apr 2011 + - client: when estimating job runtime based on fraction done, + use the elapsed time when fraction done was last reported, + not current elapsed time. + Fix problem where est time remaining increases linearly, + then abruptly decreases when new frac done is reported. + From Bruce Allen. + + client/ + app.h + app_control.cpp + work_fetch.cpp + +David 18 Apr 2011 + - client: fix a couple of the messages that are appended to + a job's stderr when the job is aborted + + client/ + client_state.cpp + app_start.cpp + +David 18 Apr 2011 + - user web and notices: fix message describing friend request + + html/inc/ + friend.inc + +David 18 Apr 2011 + - client: replace % with %% in messages from scheduler + (else they're interpreted as format strings) + + client/ + client_state.h + cs_scheduler.cpp + +David 18 Apr 2011 + - client: fix message describing work request + + client/ + scheduler_op.cpp + +Rom 19 Apr 2011 + - MGR: Adjust the width of the various tabs in advanced view if the notice text + width changes. + - MGR: Remove dead code. + + clientgui/ + BOINCBaseFrame.cpp, .h + AdvancedFrame.cpp + +David 19 Apr 2011 + - scheduler: don't send translatable messages to pre-6.12 clients + + sched/ + sched_types.cpp + +David 19 Apr 2011 + - admin web: allow specifying an SVN config dir in the web config file, + in case your svn requires a proxy or something. + From Boris Dayma. + + html/ + ops/ + index.php + project.sample/ + project.inc + +David 20 Apr 2011 + - web: show "logged in as" info on every page; + remove funky "log out" link from user page + - web: go to home page on logout, + not dorky "you are logged out" page + + html/ + inc/ + user.inc + util.inc + user/ + sample_index.php + logout.php + project.sample/ + project.inc + +David 20 Apr 2011 + - web: don't show "log in" link on login or create account pages + + html/ + inc/ + util.inc + user/ + login_form.php + +David 20 Apr 2011 + - client: if an app version has a missing GPU, + we still need to keep track of the usage + and write it to the state file. + - get client simulator working again + + client/ + client_types.cpp,h + sim.cpp + tools/ + backend_lib.cpp + +Charlie 21 Apr 2011 + - Mac: Update XCode Project to link procinfo.cpp and procinfo_mac.cpp into + boinscr (ss_app) because boinc_api.cpp now calls kill_descendants() and + suspend_or_resume_descendants(). + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 21 Apr 2011 + - create_work and other tools: verify that the current dir, + parent dir, or BOINC_PROJECT_DIR actually is a project dir. + - client simulator: improvements + + sched/ + sched_config.cpp + tools/ + create_work.cpp + lib/ + coproc.cpp + client/ + client_state.cpp,h + sim.cpp + work_fetch.cpp + cs_statefile.cpp + +Charlie 22 Apr 2011 + - Mac: We no longer request PowerPC applications on Intel Macs + because all projects supporting Macs should have Intel + applications by now, and PowerPC emulation ("Rosetta") is + not always supported in newer versions of OS X. + + client/ + cs_platforms.cpp + +David 23 Apr 2011 + - client: don't use the Snooze mechanism to handle + OS-requested suspension + (especially with a 1-hour snooze period). + Instead, handle them directly. + + client/ + client_state.cpp,h + cs_prefs.cpp + main.cpp + sysmon_win.cpp + clientgui/ + MainDocument.cpp + lib/ + common_defs.cpp + str_util.cpp + sched/ + get_file.cpp + send_file.cpp + +David 23 Apr 2011 + - server: rename send_file to put_file. + Factor out put_file() and get_file() functions + so they have a C++ API as well as command-line + + sched/ + put_file.cpp + get_file.cpp + Makefile.am + tools/ + backend_lib.cpp,h + lib/ + common_defs.h + +Charlie 24 Apr 2011 + - client: fix bug: statement had no effect. + + lib/ + str_util.cpp + +David 24 Apr 2011 + - account manager RPC: include TIME_STATS and NET_STATS in request message + + client/ + acct_mgr.cpp + +David 24 Apr 2011 + - client: show error messages from account managers correctly + - client/manager: if a job is missing a GPU, show details + - client: win compile fix + + client/ + acct_mgr.cpp + client_msgs.cpp,h + client_types.cpp + sysmon_win.cpp + +David 24 Apr 2011 + - client: simplify the semantics of sticky files: + - All sticky files are reported on each scheduler RPC + - If a scheduler reply says to delete a file, clear its sticky flag + In particular: + - remove the "send file list" tag in scheduler RPC replies + - remove FILE_INFO::marked_for_delete + - remove FILE_INFO::report_on_rpc + - remove the request_file_list program + + client/ + client_types.cpp,h + client_state.cpp + cs_scheduler.cpp + scheduler_op.cpp + sched/ + request_file_list.cpp + Makefile.am + +David 24 Apr 2011 + - client: shuffle code to move CONFIG and LOG_FLAGS + into lib/cc_config.h, + in preparation for adding GUI RPCS + + client/ + main.cpp + log_flags.cpp,h + lib/ + Makefile.am + cc_config.cpp,h (new) + +Charlie 24 Apr 2011 + - Mac: Add new cc_config.cpp,h to XCode Project. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Rom 25 Apr 2011 + - SCR: In certain cases WM_QUIT is sent to the message proc, which is + is causing some type of deadlock and we don't break out of the message + pump like we are suppose too. For debug purposes, let us call DebugBreak() + and see what the other threads are up too. + + clientscr/ + screensaver_win.cpp + +David 25 Apr 2011 + - validator: fix bug when check_pair() returns retry=true, + reported by Travis Desell. + + sched/ + validator.cpp + +David 26 Apr 2011 + - client: fix bugs in runtime estimation of jobs that + have run before but are not currently running. + Old: + - We maintain the most recent fraction_done in state file. + But for apps that checkpoint seldom or never, + this is not the relevant value, + and frac done may go down when the app runs. + - fraction_done_elapsed_time is not initialized, + and can have garbage values for jobs that haven't run yet. + New: + - Record, in the state file, the values of + fraction_done and fraction_done_elapsed_time + at the most recent checkpoint. + When the client starts up, use these values. + + client/ + app.cpp,h + app_control.cpp + +David 26 Apr 2011 + - web: fix infinite recursion when project is down + + html/inc/ + util.inc + +Rom 26 Apr 2011 + - VBOX: Begin merging the two different vbox wrappers (COM vs. Daniel's from + CERN). Where possible stick with the POSIX API set and remove Windows + specific code. (Example vbm_popen). + + NOTE: Not usable at the moment. + + samples/vboxwrapper/cernvm + cernvmwrapper.cpp + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + samples/vboxwrapper/ + vm.cpp, .h + win_build/ + vboxwrapper.vcproj + +David 26 Apr 2011 + - web: eliminate double calls to page_head() + + html/inc/ + util.inc + +David 26 Apr 2011 + - web: fix bug that cause "use signature" preference to be ignored + + html/user/ + forum_reply.php + +David 26 Apr 2011 + - client: fix bug in [23431] + + client/ + client_types.cpp + +Charlie 27 Apr 2011 + - lib, MGR: Implement get_cc_config, set_cc_config RPCs. + + client/ + log_flags.cpp + clientgui/ + AsyncRPC.cpp,.h + lib/ + cc_config.cpp,.h + gui_rpc_client.h + gui_rpc_client_ops.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + win_build/ + boinc_os_ss.vcproj + boinc_ss.vcproj + boincmgr.vcproj + +Charlie 28 Apr 2011 + - MGR: Begin adding Exclusive Apps pane to Computing Prefs dialog. + - MGR: Implement Manage Settings menu item in Simple GUI. + + clientgui/ + DlgAdvPreferences.cpp + DlgAdvPreferencesBase.cpp,.h + sg_BoincSimpleFrame + +David 28 Apr 2011 + - client: fix bug that prevented work fetch in some cases + + client/ + client_state.cpp + main.cpp + work_fetch.cpp + lib/ + coproc.h + hostinfo.cpp + +David 28 Apr 2011 + - client: change the handling of account manager replies: + Old: + If the AM sends us a project we're already attached to, + and the authenticator is different, + print an error message and don't change anything. + Problem: + If the AM is using weak authenticators, + and the user has changed their password, + the weak authenticator changes. + In this case the AM will send the new weak auth, + the client will ignore it, + and all subsequent scheduler RPCs will fail + until the user removes/adds the project. + Solution: + If the AM sends us a new auth for a project, use it. + Note: + From the time the password is changed on the project + to the next AM RPC, + the client will have a bad weak auth and scheduler RPCs will fail. + That's OK. + + client/ + acct_mgr.cpp + +David 28 Apr 2011 + - scheduler: compile fix + - client: don't print "Insufficient GPU" messages + unless is set + + client/ + cpu_sched.cpp + html/inc/ + util.inc + sched/ + sched_types.cpp + +David 28 Apr 2011 + - client: update to previous commit: + only change the authenticator if both old and new + authenticators are weak + (strong authenticators don't change). + + client/ + acct_mgr.cpp + +Charlie 29 Apr 2011 + - MGR: Continue adding Exclusive Apps pane to Computing Prefs dialog. + - lib: add missing items in CONFIG, PROXY_INFO struct initializers. + + client/ + log_flags.cpp,.h + clientgui/ + DlgAdvPreferences.cpp,.h + DlgAdvPreferencesBase.cpp + lib/ + cc_config.cpp,.h + gui_rpc_client_ops.cpp + proxy_info.cpp + +Rom 29 Apr 2011 + - VBOX: Checkpoint, Re-implement the start/stop/suspend/resume/is_running + and is_registered functions using the vboxmanage app. + - VBOX: Simplify the virtualbox_vbm_popen function and remove a buffer + copy operation. + + samples/vboxwrapper/ + vbox.cpp, .h + +David 29 Apr 2011 + - GUI RPC client library: increase request buffer size + from 4KB to 100B + + lib/ + gui_rpc_client.cpp + +Rom 29 Apr 2011 + - VBOX: Checkpoint, Re-implement the registering and un-registering of the + vm using the vboxmanage app. + + samples/vboxwrapper/ + vbox.cpp, .h + vm.cpp, .h + +David 29 Apr 2011 + - client: increase request msg buffer size for GUI RPCs + client/ + gui_rpc_client_ops.cpp + gui_rpc_client.cpp + +Charlie 29 Apr 2011 + - MGR: Fix a few bugs in Exclusive Apps pane of Computing Prefs dialog. + + clientgui/ + DlgAdvPreferences.cpp + lib/ + cc_config.cpp + +Charlie 1 May 2011 + - lib: initialize data_dir in CONFIG::defaults(); don't write to + cc_config.xml if empty string, because older versions of BOINC choke. + + lib/ + cc_config.cpp + +Rom 3 May 2011 + - VBOX: Handle both abort scenarios + + samples/vboxwrapper/ + vbox.cpp, .h + vm.cpp, .h + +Charlie 4 May 2011 + - MGR: Continue adding Exclusive Apps pane to Computing Prefs dialog. + + clientgui/ + DlgAdvPreferences.cpp + DlgAdvPreferencesBase.cpp + +David 4 May 2011 + - vbox wrapper: add Makefile + - notices: fix bug where the URL in "friend request" notices + doesn't work if you're not already logged in. + + html/ + inc/ + friend.inc + util.inc + user/ + friend.php + login_form.php + samples/vboxwrapper/ + vbox.cpp + Makefile + +Rom 4 May 2011 + - VBOX: Add function for a host being able to execute tasks within + guest VMs. + + samples/vboxwrapper/ + vbox.cpp, .h + vm.cpp, .h + +Rom 4 May 2011 + - VBOX: Switch to using CreateProcess and CreatePipe on Windows, otherwise we + get a bunch of flicking windows when we preform an operation against + VirtualBox. + + samples/vboxwrapper/ + vbox.cpp + +Charlie 5 May 2011 + - MGR: Fix compiler warning. + + clientgui/ + DlgAdvPreferences.cpp + +David 5 May 2011 + - web: don't show login stuff on server status page + + html/inc/ + util.inc + +David 5 May 2011 + - web: don't error out on old-style notice URL + + sched/ + validator.cpp + html/user/ + friend.php + +David 5 May 2011 + - web RPC: add RPC for getting teams by country + + html/user/ + team_search.php + +David 6 May 2011 + - wrapper: tell the client when we checkpoint + (else checkpoint_elapsed_time etc. don't get set) + - make_project: enable update_stats by default + - update_stats: add --min_age option + + sched/ + update_stats.cpp + tools/ + make_project + samples/wrapper/ + wrapper.cpp + +Charlie 7 May 2011 + - Win: add missing procinfo_win.cpp to Windows libboinc project. + + win_build/ + libboinc.vcproj + +David 7 May 2011 + - client: fix bug that broke work fetch. + We can't set coprocs.n_rsc to zero in CONFIG::defaults(). + - multi_thread app: update initialization + + lib/ + cc_config.cpp + samples/multi_thread/ + multi_thread.cpp + +David 7 May 2011 + - client: add config option. + Defines the transfer rate below which the connection + is considered idle, and timeout starts + + lib/ + cc_config.cpp,h + client/ + http_curl.cpp + cs_files.cpp + +David 7 May 2011 + - client: implement "report immediately" at the level of + individual jobs rather than globally. + To use this, projects must add + to the elements in job templates + + client/ + client_types.cpp,h + cs_scheduler.cpp + +Rom 9 May 2011 + - VBOX: Implement basic cpu time accounting and checkpointing + for VMs. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + vm.cpp, .h + +David 10 May 2011 + - client: don't check memory usage immediately after hibernation + + client/ + client_state.h + app.cpp + +David 10 May 2011 + - vbox wrapper: updates + + samples/vboxwrapper/ + vbox.cpp + vm.cpp,h + +Charlie 10 May 2011 + - MGR: Fixes to new Simple GUI for Linux. + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_ProjectPanel.cpp + +Charlie 11 May 2011 + - MGR: Fixes to new Simple GUI for Linux. + + clientgui/ + sg_PanelBase.cpp, .h + sg_TaskPanel.cpp + +David 11 May 2011 + - Change the way update_versions works, and reimplement it in PHP. + Problems with the old version: + - Lots of info encoded in file and directory names: messy kludge + - The convention that directory name == main program name + created a bad situation when using the wrapper: + if you made a new version of your application, + you were forced make a new version of the wrapper + just so it could have a different name. + The new version is described here: + http://boinc.berkeley.edu/trac/wiki/AppVersionNew + - Remove some Python code that suppored the old version + - client: some fixes to dir_size() that might fox + a buffer overflow when using symbolic links + + tools/ + update_versions + html/inc/ + boinc_db.inc + lib/ + filesys.cpp + py/Boinc/ + tools.py + +David 11 May 2011 + - client: show HTTP errors in text form as well as number + + client/ + pers_file_xfer.cpp + file_xfer.cpp + +David 11 May 2011 + - client: fix problem with recursion in dir_size(), this time for real. + + lib/ + filesys.cpp + +Charlie 12 May 2011 + - MGR: Fixes to new Simple GUI for Linux. + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_PanelBase.cpp, .h + +Charlie 13 May 2011 + - MGR: Fixes to new Simple GUI for Linux and Windows. + - MGR: Fix logic to enable / disable Show Graphics in new Simple GUI. + - MGR: make sure new Simple GUI Pause / Resume button is large enough + for the larger of the localized words for Pause and Resume; do + the same for the Add Project / Synchronize button. + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_PanelBase.cpp, .h + sg_ProjectPanel.cpp, .h + sg_TaskCommandPopup.cpp, .h + sg_TaskPanel.cpp, .h + +Charlie 13 May 2011 + - lib: Fix compile break on Windows. + + lib/ + filesys.cpp + +David 13 May 2011 + - create_work: allow multiple URLs for non-local input files + (from Zoltan Farkas) + - scheduler: fix message describing per-app limits + + sched/ + sched_main.cpp + tools/ + backend_lib.cpp + html/project.sample/ + project.inc + +David 13 May 2011 + - scheduler: per-processor limits should be based on + "effective" # of processors (taking prefs into account) + rather than the physical number + + sched/ + sched_send.cpp + sched_limit.h + +David 13 May 2011 + - client/manager: don't show resource usage for non-CPU-intensive jobs + + client/ + client_types.cpp + clientgui/ + MainDocument.cpp + +Charlie 16 May 2011 + - MGR: New Simple GUI: better displays if no tasks or no projects. + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_ProjectPanel.cpp + +David 16 May 2011 + - client: XML-escape the contents of stderr files; + otherwise non-ASCII characters in client_state.xml + make it invalid XML + - client: fix (I think) to scheduling logic. + a job is preemptable if it's finished its time slice and + Old: has checkpointed in last 10 sec + New: has checkpointed since the end of the time slice + + client/ + app_control.cpp + cpu_sched.cpp + api/ + boinc_api.cpp + lib/ + Makefile.am + +David 17 May 2011 + - update_versions: fix bug in version number parsing (from Kevin) + + tools/ + update_versions + +David 17 May 2011 + - scheduler: if an in-progress limit is given in config_aux.xml, + and is not specified, default it to false. + - scheduler: add some log messages + + sched/ + sched_limit.cpp + sched_version.cpp + sched_send.cpp + sched_main.cpp + +David 17 May 2011 + - scheduler: add config option. + If set, and a WU has nonzero batch, + it is interpreted as a user ID, + and the job will be sent only to hosts with that user ID. + + Note: the use of workunit.batch is arbitrary; + we could also use workunit.opaque or other deprecated field. + + client/ + cpu_sched.cpp + sched/ + sched_send.cpp,h + sched_config.cpp,h + +Rom 17 May 2011 + - MGR: Prepopulate both the username field and the email address + field with the cookie information since we do not know ahead + of time which format the account manager uses. Once the + get_project_config RPC has completed, we'll know which one + is the correct one. + + clientgui/ + WizardAttach.cpp + +Charlie 18 May 2011 + - MGR: Fix welcome message in Account Manager Wizard completion page. + + clientgui/ + CompletionPage.cpp + +David 18 May 2011 + - update_versions: make work + + tools/ + update_versions + +David 18 May 2011 + - client: show GPU device number correctly + + client/ + client_types.cpp + +Rom 19 May 2011 + - client: Account for new registry location that the new VirtualBox installer + stashes the version number. Check the new location first, if not found go + back to the original location. + + client/ + hostinfo_win.cpp + +Rom 19 May 2011 + - MGR: Initial stab at supporting Google Chrome cookies. SQLite engine needs + to be upgraded. Write it while the code is still in my head. + + clientgui/ + browser.cpp, .h + +David 19 May 2011 + - client: add log messages showing steps in exiting all tasks, + enabled by + - client: remove redundant task-start messages + + client/ + app_start.cpp + app_control.cpp + cpu_sched.cpp + +David 20 May 2011 + - update_versions: trim XML strings + + tools/ + update_versions + db/ + boinc_db.h + +David 20 May 2011 + - client: on hibernate, don't wait for apps to exit + (NCI apps never will) + + client/ + sysmon_win.cpp + +David 21 May 2011 + - client: if project is set to "don't request more work", + report completed tasks immediately + + client/ + cs_scheduler.cpp + +Charlie 22 May 2011 + - SCR: Fix Mac crash bug when user clicks SS Test button in system preferences. + + clientscr/ + mac_saver_module.cpp + +David 24 May 2011 + - update_versions: flag main program as executable, + otherwise client will reject it + + tools/ + update_versions + +Charlie 25 May 2011 + - MGR: Fix shutting down of Client on Linux. + + clientgui/ + BOINCGUIApp.cpp + +Rom 25 May 2011 + - scheduler: unescape the stderr_out field after parsing so we do not break + other applications parsing the data. + + sched/ + sched_types.cpp + +David 25 May 2011 + - client: escape only non-ASCII chars in stderr out, not control chars + + sched/ + sched_types.cpp + lib/ + parse.cpp,h + client/ + app_control.cpp + +David 25 May 2011 + - client: if is specified in config file, + set host_info.p_ncpus to that value, + so that scheduler requests report that number of CPUs + + client/ + cpu_sched.cpp + +David 25 May 2011 + - client: fix boinc_make_dirs() (from Josh Highley) + - client: allow "non_cpu_intensive" to be specified independently + for different apps in a project. + This is intended to support projects that use the + Attic file distribution system, + which needs to have a daemon running. + + lib/ + filesys.cpp,h + client/ + client_types.cpp,h + app_control.cpp + cpu_sched.cpp + +David 25 May 2011 + - client: equate notices if their text is the same after removing digits, + so that "need 25 GB disk" and "need 24 GB disk" + don't result in 2 notices. + + client/ + cs_notices.cpp + +David 25 May 2011 + - Manager: tweak messages in exit dialog + + clientgui/ + DlgExitMessage.cpp + +David 27 May 2011 + - web: make front page work for Bossa projects + + html/user/ + sample_index.php + +David 31 May 2011 + - client: when killing a nonresponsive task, + kill its descendant processes too + - manager: tweak strings related to task FLOP size + + client/ + client_state.cpp + app_control.cpp + +David 31 May 2011 + - client: Rom pointed out that on Win in secure mode, + the client won't be able to convert descendant PIDs to handles, + and therefore won't be able to terminate them. Sigh. + So terminate the main process using its handle + (we'll still kill descendants in the non-secure case) + + client/ + app_control.cpp + +David 31 May 2011 + - web: add counts in task list pages + + html/ + inc/ + boinc_db.inc + util.inc + result.inc + user/ + results.php + +Charlie 2 Jun 2011 + - MGR: Add SQLite3 v3.7.6.3 source code to Mac XCode project, adding + initializers for two local variables to suppress compiler warnings; + don't link Mac Manager with older pre-installed sqlite3 library. + + clientgui/ + sqlite3.c (added) + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Charlie 2 Jun 2011 + - MGR: If Firefox 3 SQL query fails because cookie database is locked, + make a temporary copy of the cookie file and query that. This works + around a bug in some builds of Firefox 3.5.x. + + clientgui/ + browser.cpp + +Charlie 3 Jun 2011 + - MGR: Fixes for cookie detection on Google Chrome browser. + + clientgui/ + browser.cpp + +David 3 Jun 2011 + - client: my checkin of 8 Apr 2011 didn't work in some cases, e.g.: + - client finishes a job + - before upload starts, work fetch runs and decides to fetch work + from that project. + Solution: + - set PROJECT::last_upload_start when job finishes, + and clear it when a job is uploaded. + - defer scheduler RPC for a limited time if last_upload_start + is set, even if a transfer is not active + + client/ + client_state.cpp + cs_scheduler.cpp + +David 3 Jun 2011 + - scheduler: app version FLOPS estimates were wrong + in the case where we don't have enough elapsed-time stats + for the host/app_version. + The right formula is (peak FLOPS)/app_version.avg_pfc + + sched/ + sched_version.cpp + +Charlie 3 Jun 2011 + - MGR: Convert Google Chrome browser time (microseconds since + January 1, 1601) to UNIX time (seconds since January 1, 1970) + clientgui/ + browser.cpp + +David 5 Jun 2011 + - scheduler, back end: add "homogeneous app version" feature. + Lets you specify, on a per-app basis, + that all instances should be done using the same app version. + This is for validation in the presence of GPUs. + - scheduler: code cleanup + - Instead of adding a bunch of non-DB fields to RESULT, + used a derived class SCHED_DB_RESULT. + - Instead of storing a pointer to BEST_APP_VERSION in RESULT, + store the structure itself. + This simplifies the memory allocation situation. + - client: condition "Got server request to delete file" messages + on + + db/ + boinc_db.cpp,h + schema.sql + sched/ + sched_types.cpp,h + sched_version.cpp + sched_send.cpp,h + sched_array.cpp + sched_locality.cpp + transitioner.cpp + sched_resend.cpp + sched_assign.cpp + sched_score.cpp + html/ops/ + db_update.php + client/ + cs_scheduler.cpp + +David 5 Jun 2011 + - scheduler: when creating HOST_APP_VERSION records, + initialize the n_jobs_today field correctly + + sched/ + sched_send.cpp + +David 5 Jun 2011 + - lib: fix compile warning + + lib/ + filesys.cpp + +Eric K 6 Jun 2011 + - Added safe exit capabilities for Windows CUDA applications. + - checking in the app can be added as below. + +#ifdef _WIN32 +//Jason: Safe exit check macro to play nicer with Cuda & MS-CRT + #ifdef USE_CUDA + #define SAFE_EXIT_CHECK do { \ + if (worker_thread_exit_request) { \ + fprintf(stderr,"-> Worker received exit request, syncing Cuda..."); +cudaThreadSynchronize(); fprintf(stderr,"Done.\n"); \ + fprintf(stderr," Worker Freeing Cuda data..."); cudaAcc_free(); +fprintf(stderr,"Done.\n"); \ + fprintf(stderr," Worker Acknowledging exit request, spinning->\n"); +worker_thread_exit_ack = true; \ + while (1) Sleep(10); \ + } \ + } while (0); + #else + #define SAFE_EXIT_CHECK do { \ + if (worker_thread_exit_request) { \ + fprintf(stderr," Worker Acknowledging exit request, spinning-> "); +worker_thread_exit_ack = true; \ + while (1) Sleep(10); \ + } \ + } while (0); + #endif +#else // Linux or other probably have their own safe exit handling, defined as +blank, do nothing + #define SAFE_EXIT_CHECK +#endif + +and install at the top of the cffft loop, and more locations if desired: + SAFE_EXIT_CHECK; + +I'd like to implement these as BOINC API functions, but have not yet done so. + +David 6 Jun 2011 + - backend: use new XML parser for input template files + (so that they don't have to be 1 element/line) + and also allow optional root element + - fix bug in WORKUNIT DB interface + + db/ + boinc_db.cpp + tools/ + backend_lib.cpp + +David 6 Jun 2011 + - API: undo the above API checkin, and provide a cleaner and + documented way of doing the same thing; see + http://boinc.berkeley.edu/trac/wiki/AppCoprocessor + + api/ + boinc_api.cpp,h + +Charlie 7 Jun 2011 + - MGR: Fix bug I introduced on 6 Aug 2010: if currently connected host name is + empty string, we must treat it as localhost. Implement different logic to + skip exit confirmation dialog and avoid shutting down client if second + instance of Manager is launched but Select Computer dialog is cancelled. + + clientgui/ + MainDocument.cpp, .h + +Rom 7 Jun 2011 + - MGR: Cleanup compiler warnings. Fixes# 1051 + (From: Steffen Möller) + + clientgui/ + AdvancedFrame.cpp + clientgui/common/ + wxFlatNotebookImages.h + clientgui/res/skins/default + advanced_link_image.xpm + +David 7 Jun 2011 + - client: fix bug in app termination logic + + client/ + app_control.cpp + +Charlie 8 Jun 2011 + - MGR: Fix About dialog to show (PowerPC) instead of (x86) when appropriate. + + clientgui/ + DlgAbout.cpp + +Charlie 8 Jun 2011 + - MGR: Rework logic to skip exit confirmation dialog and avoid shutting down + client if second instance of Manager is launched, so it works if connect + to remote host fails. + - MGR: If original instance of Manager is connected to remote host (or none) + when exiting Manager. skip exit confirmation dialog but do shut down local + client if requested in most recently run exit dialog, whether or not + "Remember this decision" was set. + - MGR: Use same exit confirmation dialog wording for Linux as for Windows. + + clientgui/ + BOINCGUIApp.cpp, .h + MainDocument.cpp, .h + DlgExitMessage.cpp + +Rom 8 Jun 2011 + - MGR: Disable list view rules for now. + + clientgui/ + BOINCBaseView.h + +Charlie 8 Jun 2011 + - MGR: Restore list view rules again. + + clientgui/ + BOINCBaseView.h + +David 8 Jun 2011 + - API: forgot to fix boinc_api.h + + api/ + boinc_api.h + +Charlie 9 Jun 2011 + - MGR: Event Log menu item restores Event Log when Minimized; fixed on Mac + and Windows XP, hopefully on other versions of Windows OS. + + clientgui/ + BOINCBaseFrame.cpp + BOINCGUIApp.cpp + +David 10 Jun 2011 + - client: fix bug in logic that defers work fetch if upload active + + client/ + cs_scheduler.cpp + +David 10 Jun 2011 + - update_versions: read from stdin a different way + + tools/ + update_versions + +David 10 Jun 2011 + - client: initialize some PROJECT fields (from Ian Hay). + May fix bug in defer work fetch while uploading logic + + client/ + client_types.cpp + +David 12 Jun 2011 + - client: change --detach_phase_two (??) to --detach_console + - eliminate compiler warnings (e.g. shadowed vars) + in various places, mostly in client + + sched/ + sched_main.cpp + lib/ + cc_config.cpp + samples/ + many.cpp + client/ + many.cpp + api/ + boinc_api.cpp + +David 12 Jun 2011 + - client:restore --detach_phase_two as synonym for --detach_console + + client/ + cs_cmdline.cpp + +David 13 Jun 2011 + - web: when creating an item in News forum, + show "Export as Notice?" checkbox, and default to off. + + db/ + schema.sql + html/ + inc/ + forum.inc + user/ + forum_post.php + +Bernd 14 Jun 2011 + - API: fix install headers in Makefile.mingw + + lib/ + Makefile.mingw + +Rom 15 Jun 2011 + - MGR: Update the project list in the wizard to make use + of more of the information contained in the all projects + list and also make it more accessible than the previous + implementation. + + clientgui/ + ProjectInfoPage.cpp, .h + WizardAttach.cpp, .h + clientgui/res/ + linuxicon.xpm + macosicon.xpm + windowsicon.xpm + clientgui/res/skins/default/graphic/ + advanced_link_image.xpm + win_build/ + libboinc.vcproj + libboincapi_staticcrt.vcproj + +Rom 15 Jun 2011 + - MGR: Add more polish to the new project list. + + clientgui/ + ProjectInfoPage.cpp, .h + clientgui/res/ + blankicon.xpm + +David 15 Jun 2011 + - manager: tweaks to project list + + clientgui/ + ProjectInfoPage.cpp + +Charlie 16 Jun 2011 + - MGR: Fix project list layout for Mac; ellipse long items by size + instead of by number of characters. Set tooltips of possibly + ellipsed items to full text for that item so user can read it. + + clientgui/ + ProjectInfoPage.cpp, .h + +Charlie 16 Jun 2011 + - Fix typo in all projects list: Urbana-Chamapign -> Urbana-Champaign. + + docs/ + projects.inc + win_build/ + installerv2/ + redist/ + all_projects_list.xml + +David 16 Jun 2011 + - client: we were assuming that if we ask a task to exit + and its main process exits, everything is OK. + That's not necessarily the case - buggy apps may have + subprocesses that the main process fails to kill. + + Solution: when we request a task to exit or abort, + make a list of the descendants. + When the main process exits, kill any remaining descendants. + + Also: we weren't checking for the ABORT_PENDING case + in the process exit logic. + This may explain the 5/15 second delay in detaching or + resetting a project with running tasks + + client/ + app.cpp,h + app_control.cpp + +Charlie 17 Jun 2011 + - MGR: Fix project list identification of CUDA, ATI, and MT support (check + for "['cuda" not "[cuda". "['ati" not "[ati" and "['mt" not "[mt".) + + clientgui/ + ProjectInfoPage.cpp + +Rom 17 Jun 2011 + - MGR: Revert previous change to the project list identification code. + - MGR: Fix a bug introduced in a previous commit where the plan class + was being surrounded by single quotes when generating an updated + project list. + + clientgui/ + ProjectInfoPage.cpp + doc/ + get_platforms.inc + +Rom 17 Jun 2011 + - MGR: Change the project list description control into an HTML based + window. + + clientgui/ + ProjectInfoPage.cpp, .h + +David 17 Jun 2011 + - client: add a flag to APP_VERSION. + If set, the app does its own CPU throttling + so the client doesn't have to. + + client/ + client_types.cpp,h + app_control.cpp + +Charlie 18 Jun 2011 + - MGR: Don't mark a project as supported if it requires a coprocessor we lack. + NOTE: if the platform entry contains a modifier such as [cuda] or [ati], + that capability is required. If a project offers both a cuda application + and a CPU-only application for an operating system, it must have two + separate platform entries for that OS, one with [cuda] and one without. + Likewise for ati and mt. + + clientgui/ + ProjectInfoPage.cpp + +David 20 Jun 2011 + - web: use ReCaptcha for account creation as well as profile creation + (from Daniel) + - GUI RPC: remove have_cuda from CC_STATE. + Use the info in host_info.coprocs instead. + + html/ + ops/ + pass_percentage_by_platform.php + user/ + create_account_form.php + create_account_action.php + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h + +Rom 20 Jun 2011 + - MGR: Fix build breaks related to GUI RPC changes. + + clientgui/ + AdvancedFrame.cpp + AsyncRPC.cpp + BOINCTaskBar.cpp + DlgItemProperties.cpp + ProjectInfoPage.cpp + +Charlie 20 Jun 2011 + - client: logic fix: test coprocs.none() after coprocs.add() calls, not before. + + client/ + client_state.cpp + +David 21 Jun 2011 + - GUI RPC: restore , elements in CC_STATE + for compatibility + - client: copy coprocs to host_info._coprocs at startup + (else GUI RPCs don't have right info) + + client/ + client_state.cpp + cs_statefile.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp + +David 21 Jun 2011 + - web: add a web-service interface for remotely submitting, querying + and controlling batches of jobs + - web: add an administrative interface for controlling + user permissions for submitting jobs + - web: add an interface where users can view and control + their submitted jobs + See: http://boinc.berkeley.edu/trac/wiki/RemoteJobs + This is at a functional but rough stage. + + db/ + schema.sql + tools/ + create_work.cpp + html/ + ops/ + submit_permissions.php + db_update.php + submit_example.php + inc/ + submit_db.inc + boinc_db.inc + db_conn.inc + user/ + submit.php + submit_status.php + +Charlie 21 Jun 2011 + - MGR: Revert Rom's manager changes of 20 June related to GUI RPC changes, + for compatibility with older Clients. + + clientgui/ + AdvancedFrame.cpp + AsyncRPC.cpp + BOINCTaskBar.cpp + DlgItemProperties.cpp + ProjectInfoPage.cpp + +Charlie 22 Jun 2011 + - MGR: Rename CC_STATE::have_cuda to CC_STATE::have_nvidia to clarify its meaning, + add comment that it is referenced in GUI RPCs as for compatibility. + Wizard ProjectInfo page tests values appropriate for connected client version. + - lib: fill in missing entries in COPROCS GUI RPCs, ensure that old data is reset + when connecting to a different host (not yet complete.) + + clientgui/ + AdvancedFrame.cpp + AsyncRPC.cpp + BOINCTaskBar.cpp + DlgItemProperties.cpp + ProjectInfoPage.cpp + lib/ + coproc.cpp, .h + gui_rpc_client.h + gui_rpc_client_ops.cpp + +Charlie 23 Jun 2011 + - MGR: It turns out we want the Wizard ProjectInfo Page to check for ATI and NVIDIA + GPUs regardless of whether they were reported by CAL, CUDA or OpenCL, so we can + just check CC_STATE::have_ati and CC_STATE::have_nvidia even for newer clients. + This means the Manager doesn't need to do get_host_info RPCs, because all the + host info it needs is available from the host_info section of the get_state RPC, + so eliminate the unnecessary Manager calls of get_host_info RPC. + + clientgui/ + DlgAdvPreferences.cpp + MainDocument.cpp, .h + ProjectInfoPage.cpp + +David 23 Jun 2011 + - lib: fix compile warning + + lib/ + coproc.h + +David 23 Jun 2011 + - client: add per-project GPU exclusion. + If you put an element of the form + + http://project_url.com/ + 1 + + in your cc_config.xml, that GPU won't be used for that project + + lib/ + cc_config.cpp,h + client/ + client_types.cpp,h + client_state.cpp + cpu_sched.cpp + +David 23 Jun 2011 + - client: replace with + in cc_config.xml (but keep old one for compat) + + lib/ + coproc.h + cc_config.cpp,h + client/ + client_state.cpp + coproc_detect.cpp + log_flags.cpp + +Charlie 24 Jun 2011 + - SCR: Add url.cpp to Mac screensaver in XCode project to fix link error. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 24 Jun 2011 + - client: add element to config option, + in case of multiple GPU types + + lib/ + cc_config.cpp,h + client/ + client_types.cpp,h + client_state.cpp + cpu_sched.cpp + +David 25 Jun 2011 + - client: add optional elements to config option, + to allow app-level exclusions + + lib/ + cc_config.cpp,h + client/ + cpu_sched.cpp + +David 25 Jun 2011 + - client simulator: compile fix + + client/ + makefile_sim + sim_util.cpp + +David 25 Jun 2011 + - fix compile warnings + + api/ + boinc_api.cpp + client/ + app_start.cpp + +David 29 Jun 2011 + - back end: strip tags from output templates + - web: main RSS feed should include all news items, even non-notices + + tools/ + process_result_template.cpp + html/inc/ + forum_rss.inc + lib/ + str_util.cpp + samples/wrappture/ + wrappture.cpp + +David 29 Jun 2011 + - server: restore fpops/intops_cumulative to RESULT + (structure, not table) for AQUA + - client, Windows: when wake up from hibernation, + get the time before printing log msg + + db/ + boinc_db.h + client/ + client_state.h + sysmon_win.cpp + +David 30 Jun 2011 + - client (Win) add some bulletproofing in case Windows sends us a + "suspending" event but not a resume event. + + client/ + client_state.cpp,h + sysmon_win.cpp + +David 30 Jun 2011 + - db_purge: make zip compression work (from Teemu Mannermaa) + - get rid of a few compile warnings + + sched/ + sched_send.cpp + db_purge.cpp + sched_types.cpp + sched_score.cpp + sample_work_generator.cpp + +David 4 July 2011 + - back end: fix bugs in [23648] which caused create_work + to mess up input templates containing + or other attribute tags. + XML_PARSER now contains a member element() for when + you want to copy an element without knowing its structure. + + tools/ + backend_lib.cpp + lib/ + parse.cpp,h + html/user/ + openid_login.php + +David 5 July 2011 + - update_versions: fix typo that produced bad XML + + tools/ + update_versions + +Charlie 6 July 2011 + - Mac: Update to libcurl 7.21.7 and c-ares 1.7.4. + + client/ + http_curl.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + buildc-ares.sh + buildcurl.sh + setupForBOINC.sh + HowToBuildBOINC_XCode.rtf + +Rom 6 July 2011 + - Tag for 6.13.0 release, all platforms + boinc_core_release_6_13_0 + + / + configure.ac + version.h + +Charlie 6 July 2011 + - Mac: Fix bad paths to MacBitMapComboBox.cpp, .h in XCode project. + (Checked into 6.13.0 tag). + + clientgui/ + mac/ + MacBitmapComboBox.cpp, .h + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Charlie 7 July 2011 + - Mac: Fix bug where menubar icon menu did not work after changing skin. + + clientgui/ + mac/ + MacSysMenu.cpp + +Rom 7 July 2011 + - WINSCR: Remove diagnostics screensaver dialog when the screensaver fails to + be able open up the log files. + + clientscr/ + screensaver_win.cpp + +David 7 July 2011 + - client: write log msgs saying whether GPUs are OpenCL-capable + + client/ + client_state.cpp + +David 7 July 2011 + - client: fix bug introduced in [23765] that produced garbage + in elements in sched req msgs and elsewhere. + peak_flops is a double. + If you print it using %d, everything from that point forward + is messed up. + + lib/ + coproc.cpp + +David 7 July 2011 + - client: fix typo that caused a lot of spurious + "project has XXXXXX deadline misses" messages + - fix compile warnings + + client/ + sandbox.cpp + rr_sim.cpp + +David 7 July 2011 + - client: possibly fix bug that caused no-GPU prefs to be ignored + + client/ + client_types.cpp + +Charlie 8 July 2011 + - Mac: Refine bug fix for menubar icon menu not working after changing skin. + + clientgui/ + BOINCTaskBar.cpp + mac/ + MacSysMenu.cpp, .h + +David 8 July 2011 + - client: fix bug related to deselecting resource types in project prefs. + Some logic was missing. + + client/ + client_types.cpp,h + cs_account.cpp + work_fetch.cpp + +David 10 July 2011 + - client emulator web interface: make cc_config.xml an attribute + of the simulation, not the scenario. + If you want to run a simulation w/ different log flags, + you shouldn't have to create a new scenario. + - client emulator: add --config_prefix cmdline arg + - validator: prevent infinite loop when app_version.pfc_avg + is wonky (like 1e-300). + Next step: figure out how it got that way. + + client/ + sim.cpp + sched/ + credit.cpp + +David 10 July 2011 + - client: clear have_nvidia/ati flags in CC_STATE + so you don't show garbage in project properties + + lib/ + gui_rpc_client_ops.cpp + +David 10 July 2011 + - Manager and GUI RPC: + Remove debt fields from PROJECT: not used anymore + Add sched_priority field + + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h + client/ + client_state.cpp + client_types.cpp + clientgui/ + DlgItemProperties.cpp + +David 10 July 2011 + - client: fix scheduler bug that treated all CPU jobs + as non-high-priority + - client: don't print spurious "domino prevention" + and "thrashing prevention" msgs + - manager: show project descriptions in same size font + as the rest of the dialog + + client/ + cpu_sched.cpp + work_fetch.h + clientgui/ + ProjectInfoPage.cpp + +David 11 July 2011 + - manager: do the above font change only on Win + + clientgui/ + ProjectInfoPage.cpp + +David 11 July 2011 + - manager: fix messed up logic that caused projects to show + "platform not support" incorrectly. + Note: the code in this entire area seems way too complex + - manager: tweak project desc font size + + clientgui/ + ProjectInfoPage.cpp + +David 11 July 2011 + - admin web: add page for showing app and app version details + + html/ + ops/ + submit_permissions.php + app_reset.php (new) + manage_apps.php + login_form.php + logout.php + app_details.php (new) + inc/ + util_ops.inc + +David 12 July 2011 + - admin web: finish page for resetting app statistics + + html/ + ops/ + app_reset.php + app_details.php + inc/ + boinc_db.inc + +David 12 July 2011 + - validator: if job FLOPs estimates are accurate, + PFC values should be around 1. + If they differ from 1 by a factor of > 1e4, ignore them, + and put an error message into the validator log + - validator: if get_pfc() fails because an app version is + missing from the DB (i.e. the project deleted it) + keep going so we don't reprocess the WU forever + + sched/ + credit.cpp + +David 13 July 2011 + - client, work fetch policy: + adjust project REC by the amount of work queued, to increase variety + NOTE: at some point I think I had a reason to not do this, + but I can't remember what it is. + - client, job scheduling policy: fix how project REC is adjusted + + client/ + work_fetch.cpp,h + cpu_sched.cpp + lib/ + common_defs.h + sched/ + credit.cpp,h + trickle_credit.cpp + +David 13 July 2011 + - manager: don't show "Estimated computation speed" in task properties + The quantity involved is not actually computation speed. + Also don't show Max RAM usage. + + clientgui/ + DltItemProperties.cpp + +David 13 July 2011 + - admin web: improve the FLOPs estimation tool so that + it works for GPU versions too + + html/ + ops/ + job_times.php + app_details.php + inc/ + util_ops.php + +David 13 July 2011 + - client: precede OpenCL messages with [coprog_debug], not [coproc-test]. + The convention is to use the name of the enabling log flag. + + client/ + coproc_detect.cpp + + +Rom 14 July 2011 + - lib: Fix the various '????' fields in the diagnostics framework during a + crash on Windows. Somewhere along the lines I messed up with the + conversions of single-byte characters vs. double-byte characters. + + lib/ + stackwalker_win.cpp + +David 14 July 2011 + - client: add config option + + lib/ + cc_config.cpp,h + cpu_sched.cpp + +David 14 July 2011 + - client: if a project has zero resource share, + don't piggyback a work request onto a non-work-request RPC + + client/ + work_fetch.cpp + +David 14 July 2011 + - client: show the right prefix for messages + + client/ + cpu_sched.cpp + +Charlie 18 July 11 + - MGR: Fix "Can't load Image" messages in Simple View; allow gaps in slide + show file numbering; reload images if new project files downloaded. + + clientgui/ + sg_ProjectPanel.cpp, .h + sg_TaskPanel.cpp, .h + +Rom 18 July 2011 + - Tag for 6.13.1 release, all platforms + boinc_core_release_6_13_1 + + / + configure.ac + version.h + +David 18 July 2011 + - web: when listing a user's message-board posts, + don't show team message-board posts unless + a) the requesting user is a member of the team, and + b) if the post is hidden, the requesting user is a team admin + This enforces the goal that a team's message board + is visible only to the team. + + html/user/ + forum_user_posts.php + +David 19 July 2011 + - validator: remove spurious messages + + sched/ + credit.cpp + +David 19 July 2011 + - server: some stuff to prepare for distributed storage + - don't create result records for uploads and downloads. + Just create a msg_to_client record. + - the scheduler handles file-transfer results specially; + it makes a vector of them, then calls a project-supplied function + handle_file_xfer_results() + - change the interface and implementation of put_file and get_file + - client write project sched priority in GUI RPC replies, + but not to the state file + + sched/ + delete_file.cpp + put_file.cpp + get_file.cpp + sched_types.cpp,h + sched_customize.cpp,h + handle_request.cpp + credit_test.cpp + tools/ + backend_lib.cpp,h + py/Boinc/ + setup_project.py + client/ + client_state.cpp + boinc_cmd.cpp + client_types.cpp + +David 20 July 2011 + - client: changes to the client file model to support distributed storage, + as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel + Compatibility: + clients that upgrade to this version should see nothing unusual. + Clients that downgrade from this version to a previous version + should see all projects reset + (i.e. tasks disappear and then get re-downloaded). + - manager: always show whether a file transfer is upload or download + - client: don't scale work requests by resource share + + client/ + client_types.cpp,h + cs_apps.cpp + cs_files.cpp + cs_prefs.cpp + cs_statefile.cpp + file_xfer.cpp + pers_file_xfer.cpp + work_fetch.cpp + clientgui/ + ViewTransfers.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp + +David 20 July 2011 + - client/server: change the implementation of upload certificates + as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel + Compatibility: if your project is using upload certificates: + - set ignore_upload_certificates + - disable job creation + - let your job queue drain + - upgrade to new server software + - clear ignore_upload_certificates + - enable job creation + + sched/ + file_upload_handler.cpp + tools/ + process_result_template.cpp + lib/ + gui_rpc_client_print.cpp + client/ + client_types.cpp,h + file_xfer.cpp + +David 20 July 2011 + - server: debug the above + + sched/ + file_upload_handler.cpp + +David 20 July 2011 + - client: debug the above + + client/ + file_xfer.cpp + +David 20 July 2011 + - server: debug distributed storage functions + - generate upload signatures if needed + - assign deadlines to file xfer jobs (default 1 week) + - scheduler: ack completed file xfer results + + sched/ + put_file.cpp + get_file.cpp + sched_customize.cpp + tools/ + backend_lib.cpp,h + +David 20 July 2011 + - client: debug distributed storage functions + + client/ + client_types.cpp,h + cs_statefile.cpp + scheduler_op.cpp + +David 22 July 2011 + - server: some remote job submission code. Not finished. + + tools/ + create_work.cpp + html/ + inc/ + submit.inc + user/ + submit.php + submit_example.php + +Charlie 25 July 11 + - Mac: Begin changes for XCode 4.1 and GCC 4.2. + + client/ + hostinfo_unix.cpp + clientgui/ + browser.h + sqlite3.c + mac/ + MacBitmapComboBox.h + lib/ + hostinfo.h + +David 25 July 2011 + - web: more remote job submission code. Not finished. + + db/ + boinc_db.h + html/ + inc/ + submit.inc + boinc_db.inc + result.inc + user/ + submit_example.php + get_output.php + submit.php + +David 25 July 2011 + - user web: internationalization, from Christian Beer + + html/user/ + show_host_detail.php + sample_index.php + show_coproc.php + show_user.php + profile_search_action.php + team.php + +David 25 July 2011 + - user web: remote job submission: + add the ability to download zipped output files + + html/user/ + submit_example.php + get_output.php + +Charlie 26 July 11 +- Mac: Finish changes for XCode 4.1 and GCC 4.2. + + clientgui/ + sqlite3.c + mac_build/ + boinc.xcodeproj/ + project.pbxproj + mac_installer/ + PostInstall.cpp + release_boinc.sh + +David 26 July 2011 + - web: remote job submission: implement abort and cleanup functions + + html/ + inc/ + forum.inc + submit.inc + util.inc + result.inc + user/ + forum_thread.php + submit_example.php + submit.php + +David 26 July 2011 + - web: remote job submission: + - add fields to batch table, extend APIs accordingly + - require that example web interface run on BOINC server + (this makes many things easier; + an actual remote interface would require a bit more work) + + db/ + boinc_db.h + schema.sql + html/ + ops/ + db_update.php + inc/ + submit_db.inc + submit.inc + util.inc + result.inc + user/ + submit_example.php + submit.php + +Charlie 27 July 11 + - lib: Initialize config_coprocs struct in CONFIG::defaults(). + + lib/ + cc_config.cpp + +Charlie 27 July 11 + - SCR: Fix delay dismissing screensaver under Mac OS10.7. + + clientscr/ + mac_saver_module.cpp + Mac_Saver_Module.h + Mac_Saver_ModuleView.m, .h + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Charlie 28 July 11 + - Mac SCR: Fix vertical range of moving logo. + + clientscr/ + Mac_Saver_ModuleView.m + +David 28 July 2011 + - remote job submission: bug fix and tweaks + - client: cc_config.xml: if is omitted from a , + it means exclude all instances of that GPU type + - client: if all instances of a GPU type are excluded for a project, + don't ask the project for jobs of that type + + html/ + ops/ + submit_permissions.php + inc/ + util.h + user/ + submit_example.php + lib/ + cc_config.cpp,h + client/ + work_fetch.cpp,h + client_types.cpp,h + client_state.cpp + gui_rpc_server_ops.cpp + cpu_sched.cpp + +David 29 July 2011 + - client: fix bug in config option + - client: extend option so that if is omitted, + all GPUs of the given type are excluded. + + client/ + cpu_sched.cpp + work_fetch.cpp + lib/ + cc_config.cpp,h + +David 30 July 2011 + - server: fix typo + + db/ + boinc_db.h + +David 30 July 2011 + - user web: in instructions for logging in with authenticator, + show the actual account file name. + + html/user/ + get_passwd.php + +David 30 July 2011 + - web: fix typo that prevented users from seeing their own hidden posts + + html/ + inc/ + prefs.inc + user/ + forum_user_posts.php + +David 31 July 2011 + - web: fix +/- forum rating, and tweak messages. Fixes #1123 + + html/user/ + forum_report_post.php + forum_rate.php + +David 31 July 2011 + - scheduler: check for negative elapsed time in results + reported by client, set to zero + + sched/ + sched_result.cpp + sched_types.cpp + html/user/ + create_account_form.cpp + +David 1 Aug 2011 + - web: fix bug in next_url mechanism + + html/inc/ + util.inc + +David 1 Aug 2011 + - client: change the way upload signatures are generated + in an attempt to make them work with existing servers + + client/ + file_xfer.cpp + +David 1 Aug 2011 + - client: undo the above. doesn't work + + client/ + file_xfer.cpp + +David 1 Aug 2011 + - update_versions: add optional element to + element in version.xml. + If present, update_versions will gzip the file in the download dir. + Use this only if you have gzip-encoding enabled in Apache. + + tools/ + update_versions + +Charlie 2 Aug 11 + - Mac installer: Work around bug in Mac OS 10.7 dscl merge command. + + mac_installer/ + PostInstall.cpp + +David 2 Aug 2011 + - update_versions: bug fixes + + tools/ + update_versions + +David 3 Aug 2011 + - client: fix bug in get_descendants(), + which prevented the client from cleaning up + subprocesses of misbehaving multiprocess apps. + - remote job submission system: + assign physical names to input files (based on their MD5) + rather than having the user provide physical names + - VM apps: eliminate vbox64 plan class. Only vbox. + + sched/ + sched_customize.cpp + html/ + ops/ + manage_app_versions.php + inc/ + submit.inc + user/ + submit_example.php + submit.php + lib/ + procinfo.cpp + client/ + app_start.cpp + app_control.cpp + +David 3 Aug 2011 + - client: add optional to APP_VERSION>. + If present, "file_prefix/" is prepended to the logical names + of input and output files of jobs using that app version. + I.e. for Vbox wrapper based app versions, file_prefix is "share", + so that I/O files are put in a "share" subdirectory of the slot dir. + - update_versions: add support for + + x + in version.xml + + tools/ + update_versions + client/ + client_types.cpp,h + app.h + app_start.cpp + +David 3 Aug 2011 + - client: if an app version has nonempty file_prefix, + copy all its input and output files + + client/ + app.h + app_start.cpp + +Charlie 3 Aug 11 + - Mac: Fix warning about potential memory leak. + + clientgui/ + mac/ + SystemMenu.m + +David 3 Aug 2011 + - vbox wrapper: fix parsing of job file + - vbox wrapper: fix code structure + - merge vm and vbox + - no global vars + + samples/vboxwrapper/ + vbox.cpp,h + vm.cpp.h (removed) + vboxwrapper.cpp + Makefile + +David 3 Aug 2011 + - vbox wrapper: hardwire logical name of image file to "vm_image.vdi". + - vbox wrapper: on startup, rename image file to "vm_image_SLOT.vdi", + where SLOT is the slot number. + Vbox requires unique names for VM image files. + + samples/vboxwrapper/ + vbox.cpp,h + vboxwrapper.cpp + +David 4 Aug 2011 + - scheduler: apparently some hosts send GPU parameters that cause + the peak_flops to be negative (probably #processors = -1). + This leads to negative credit. + Fix: if peak flops is negative, set it to 50 GFLOPS + - web: fix email validate page + + lib/ + coproc.h + html/user/ + validate_email_addr.php + +Rom 4 Aug 2011 + - vbox wrapper: initialize xml parser with the correct starting tag. + + samples/vboxwrapper/ + vboxwrapper.cpp + +David 4 Aug 2011 + - scheduler: turns out we need separate vbox32 and vbox64 + plan classes after all. + Otherwise (since app_plan() is not passed an app version) + there's no way to enforce that 64 bit hosts are sent + only the 64 bit version (which is necessary because + of the split-registry scheme). + + sched/ + sched_customize.cpp + +David 6 Aug 2011 + - web: send user a private message when + - one of their posts is moderated + - a banishment vote starts or completes. + This is needed in cases where the user can't or doesn't + read email to their account's address. + The "from" address of the PM is that of the user, not the moderator. + + html/ + inc/ + pm.inc + forum_email.inc + user/ + pm.php + team_founder_transfer_action.php + +David 6 Aug 2011 + - update_versions: fix bug where files not listed in version.xml + are not processed correctly + - remote job submission: debug + - create_work: --rsc_fpops_est etc. should override the template file + + tools/ + backend_lib.cpp + update_versions.cpp + html/user/ + submit_example.php + submit.php + +David 7 Aug 2011 + - remote job submission: bug fixes + + html/ + inc/ + submit.inc + util.inc + result.inc + user/ + submit_example.php + submit.php + +David 7 Aug 2011 + - client: projects with zero resource share are always lower priority, + for both job sched and work fetch, + than projects with positive resource share. + + client/ + cpu_sched.cpp + work_fetch.cpp + +David 7 Aug 2011 + - scheduler: fix nasty bug where SCHED_DB_RESULT::parse() + was doing memset(this, 0, sizeof(RESULT)), + i.e. it wasn't zeroing out the whole structure. + The elapsed_time field (which isn't reported by old clients), + is near the end of the struct, + and it was getting garbage, e.g. 1e-304, in some cases, + which led to zero credit (and maybe other problems) + - validator: treat 1e-304 like zero in case of other problems + like the above. + - remote job submission: tweaks + + sched/ + credit.cpp + sched_types.cpp + html/user/ + submit_example.php + submit.php + +David 7 Aug 2011 + - web: when sending emails to other users, don't translate anything + (since they don't necessarily speak our language) + + html/ + ops/ + index.php + inc/ + pm.inc + submit.inc + +David 7 Aug 2011 + - client: make round-robin simulator match what the job scheduler now does: + give lowest priority to projects with zero resource share. + + client/ + rr_sim.cpp + client_types.h + +Charlie 8 Aug 2011 + - Changes for Charity Engine Desktop. + + clientgui/ + mac/ + CE_ss_logo.tiff (new) + res/ + CE_Install.icns (new) + CharityEngine.icns (new) + CE_Uninstall.icns (new) + MacCEPkgIcon.zip (new) + skins/ + Charity Engine/ (new) + graphics/ (new) + (many new files) + skin.xml (new) + clientscr/ + mac_saver_module.cpp + res/ + CE_ss_logo.png (new) + CE_ss_logo.jpg (new) + ss_app.cpp + mac_installer/ + CE-Branding (new) + CE-ReadMe.rtf (new) + CharityEngine/ (new) + acct_mgr_url.xml (new) + GR-ReadMe.rtf + make_CharityEngine.sh (new) + PostInstall.cpp + PTP-ReadMe.rtf + ReadMe.rtf + +Charlie 8 Aug 2011 + - Mac Client: Call NSVersionOfRunTimeLibrary("cuda") to set + cc.display_driver_version (from Oliver Bock.) + + client/ + coproc_detect.cpp + +David 9 Aug 2011 + - client: rename MODE to RUN_MODE, and rename vars accordingly + + client/various + +David 9 Aug 2011 + - client: pass XML_PARSER& rather than MIOFILE& to parse functions. + Preparatory to using new-style XML parsing everywhere. + + client/various + lib/various + +Rom 10 Aug 2011 + - Changes for Charity Engine Desktop. + + client/win/res/ + ce.ico + clientctrl/ + boincsvcctrl.rc + clientgui/ + BOINCGUIApp.rc + clientgui/res/ + ce.ico + clientlib/win/ + boinc_dll.rc + clientscr/ + boinc_ss.rc + clientscr/ + boinc_ss_opengl.rc + clientscr/res/ + ce.bmp + ce.ico + clienttray/ + boinc_tray.rc + win_build/ + ce_boinc_cli.vcproj + ce_boinc_dll.vcproj + ce_boinc_ss.vcproj + ce_boinccmd.vcproj + ce_boincmgr.vcproj + ce_boincsvcctrl.vcproj + ce_boinctray.vcproj + ce_ss_app.vcproj + CharityEngine.sln + win_build/installerv2/ + CharityEngine.ism + win_build/installerv2/redist/0409/ + ce-eula.rtf + win_build/installerv2/redist/CharityEngine/ + acct_mgr_url.xml + ce.ico + CE_IsDialogBanner.bmp + CE_IsDialogBitmap.bmp + CE_Splash.bmp + +David 10 Aug 2011 + - Improve interface of XML_PARSER. + Add parsed_tag and is_tag to the class, + so that parsing functions don't need to declare them + and pass them around. + - Complete the task of using XML_PARSER as the argument + to all parsing functions. + (Internally, many of these functions still use the old XML parser; + that's the next step.) + + db/ + boinc_db.cpp,h + sched/ + various + tools/ + backend_lib.cpp + lib/ + various + client/ + various + +David 10 Aug 2011 + - fix compile warnings; msg tweak + + client/ + cpu_sched.cpp + lib/ + parse.cpp + +David 10 Aug 2011 + - client: use new XML parser pretty much everywhere + + lib/ + cert_sig.cpp,h + parse.h + client/ + pers_file_xfer.cpp + cs_account.cpp + client_types.cpp + cs_statefile.cpp + scheduler_op.cpp + time_stats.cpp + app.cpp + current_version.cpp + +Charlie 11 Aug 2011 + - Mac installer: Bug fixes for OS 10.7 Lion: LoginItemAPI.c did not + set hidden property for login items, so use AppleScript instead, + to prevent Lion from opening BOINC windows at system startup. + - Fix a bug I introduced on 8 August which prevented launching + WaitPermissions.app. + - Mac uninstaller: Remove Charity Engine BOINC app if present. + + mac_installer/ + AddRemoveUser.cpp + PostInstall.cpp + Uninstall.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 11 Aug 2011 + - client: more XML parsing stuff + + client/ + app.cpp + net_stats.cpp + +David 11 Aug 2011 + - scheduler: update XML parsing + + sched/ + sched_main.cpp + sched_types.cpp + +David 11 Aug 2011 + - client: XML tweak + + client/ + client_types.cpp + +Charlie 12 Aug 2011 + - Mac installer: Bug fixes for OS 10.7 Lion. + + mac_build/ + Mac_SA_Secure.sh + mac_installer/ + AddRemoveUser.cpp + PostInstall.cpp + +Rom 18 Aug 2011 + - WINSCR: Based on feedback from WCG about the screensaver lock-up + problem attempt to provoke Windows into redrawing the primary + display. It turns out that the screensaver image is a ghost + image, so create a blank top-most window and close it after + the graphics application has been terminated. + + clientscr/ + screensaver_win.cpp, .h + +David 21 Aug 2011 + - Vbox wrapper: add --trickle x option; sends a trickle-up message + reporting incremental runtime exery x seconds of runtime. + - client: more XML parsing cleanup + - credit trickle handler: do sanity checks on CPU speed + + sched/ + trickle_credit.cpp + credit.cpp,h + samples/vboxwrapper/ + vboxwrapper.cpp + client/ + acct_setup.cpp,h + gui_rpc_server_ops.cpp + +David 21 Aug 2011 + - credit trickle handler: write log messages if sanity checks fail + + sched/ + trickle_credit.cpp + +David 21 Aug 2011 + - add script to purge trickle message records from DB + - fix spelling errors in db_purge + + html/ops/ + purge_trickles.php (new) + sched/ + db_purge.cpp + +Charlie 22 Aug 2011 + - client: Fix compiler warnings. + + client/ + app.cpp + coproc_detect.cpp + +Charlie 22 Aug 2011 + - client: Correlate OpenCL results with CAL or CUDA results based + on index of devices reported by each. This assumes that CUDA + and OpenCL and report NVIDIA devices in the same order, and + that CAL and OpenCL report ATI/AMD devices in the same order. + + client/ + coproc_detect.cpp + lib/ + coproc.h + +David 22 Aug 2011 + - client emulator fixes + + sched/ + edf_sim.h + client/ + sim.cpp + sim_util.cpp + cs_statefile.cpp + +Charlie 23 Aug 2011 + - client: If OpenCL is supported, add OpenCL information to + COPROC_ATI::write_xml() and COPROC_NVIDIA::write_xml(), and + parse OpenCL information in COPROC_ATI::parse() and + COPROC_NVIDIA::parse(). + - client: Add OpenCL platform version number to COPROC struct. + + client/ + coproc_detect.cpp + lib/ + cl_boinc.h + coproc.cpp, .h + parse.h + +David 23 Aug 2011 + - example app: change the app version structure to match the new format + + samples/example_app/ + various + +David 23 Aug 2011 + - fix linux build errors in coproc stuff. + I don't think unsigned long long is relevant here. + + lib/ + parse.h + coproc.cpp + client/ + coproc_detect.cpp + +David 23 Aug 2011 + - example app: get it right this time + + samples/example_app/ + various + +Charlie 24 Aug 2011 + - lib: fix compile errors on Mac, Ubuntu and Windows. + + lib/ + parse.h + +Charlie 24 Aug 2011 + - client: fix compile warnings on Mac and Ubuntu. + + client/ + coproc_detect.cpp + +Charlie 24 Aug 2011 + - lib, client: revert recent changes to restore unsigned long long so + we can determine cause of and try to fix Linux build errors. + - lib: On Windows, call _strtoui64() instead of strtoull. + + lib/ + coproc.cpp + parse.h + client/ + coproc_detect.cpp + +David 24 Aug 2011 + - job submission: fix bug where parameters specified in the + input template (e.g., delay bound) were ignored + - web: fix PHP warning + + tools/ + backend_lib.cpp + html/ + inc/ + forum.inc + user/ + forum_forum.php + +David 24 Aug 2011 + - client: pass --gpu_type X (X=nvidia or ati) as well as --device. + This lets device-neutral OpenCL apps figure out which GPU to use. + + client/ + app_start.cpp + +Charlie 25 Aug 2011 + - client: fix Linux compile errors and warnings. + + client/ + coproc_detect.cpp + lib/ + coproc.cpp + parse.h + +David 25 Aug 2011 + - client: fix bug where NVIDIA display driver version wasn't being + set correctly for some laptop GPUs + - client/server: improve estimation of NVIDIA GPU peak FLOPS + + lib/ + coproc.h + client/ + coproc_detect.cpp + +David 25 Aug 2011 + - validator: update credit statistics even if credit_from_wu + is being used. + - web: make almost everything translatable. From Christian Beer. + + sched/ + validator.cpp + html/user/ + various + +Charlie 26 Aug 2011 + - lib: use standard implementation of strtoull when available. + + configure.ac + clientgui/ + mac/ + config.h + lib/ + parse.h + +David 26 Aug 2011 + - web: more fixes from Christian Beer. Fixes #1129 + + html/ + ops/ + inc/ + +Rom 26 Aug 2011 + - VboxWrapper: Add functions for enable/disable network and throttling + the CPU and network activity. + + samples/vboxwrapper/ + vbox.cpp, .h + +David 26 Aug 2011 + - scheduler: don't send user a message when there is no + app version for their platform for a particular app. + The may be versions for other apps which don't have jobs right now. + TODO: send a message if there are no versions of ANY app + for any platform. + - fix makefile indentation, caused manager to not be built + fixes #1132 + + sched/ + sched_version.cpp + sched_send.cpp + Makefile.am + +David 26 Aug 2011 + - VirtualBox wrapper: + - change names of CPU and network-limiting functions + to express their units (always do this). + - wrapper monitors status.suspend_network + and suspends/resumes network accordingly + - wrapper sets CPU and network bandwidth limits on startup + (Rom: should this be done before run() rather than after?) + Note: App versions using this wrapper should always have + in their version.xml, + to tell the client that the app throttles itself. + + samples/vboxwrapper/ + vbox.cpp,h + vboxwrapper.cpp + +David 26 Aug 2011 + - fix build error in Linux screensaver (at least on FC14) + + clientscr/ + screensaver_x11.cpp + +David 26 Aug 2011 + - web: comment out OpenID login - not working yet + + html/user/ + login_form.php + +David 26 Aug 2011 + - job creation: handling of extra XML in input templates didn't work. + - job creation: fix stripping of tags + - client: fix off-by-1 error in buffer overflow logic for scanning keys. + + tools/ + backend_lib.cpp + process_result_template.cpp + lib/ + crypt.cpp + parse.cpp,h + +David 26 Aug 2011 + - manager: Communitcations -> Communications. + please, no spelling errors in function/variable names + - client: parse deprecated tags in + + clientgui/ + ProjectProcessingPage.cpp,h + AccountManagerProcessingPage.cpp,h + client/ + client_types.cpp + +David 26 Aug 2011 + - client: fix bug that caused project attach to fail + - clientgui: Rom, we should do error-checking of most GUI RPCs; + look for REPORT ERROR in ProjectProcessingPage.cpp + + client/ + acct_setup.cpp + coproc_detect.cpp + clientgui/ + ProjectProcessingPage.cpp + +David 26 Aug 2011 + - web: fix glitch in forum next/prev links + + html/inc/ + host.inc + forum.inc + +David 26 Aug 2011 + - web: more tra() stuff + + html/user/ + forum_thread.php + +David 27 Aug 2011 + - web: add a magic header string that supposedly will make + Recaptcha work on some IE variants. WTF?? + + html/ + inc/ + util.inc + user/ + create_account_form.php + create_profile.php + +David 28 Aug 2011 + - web: fix to the above + - web: fix forum search + + html/ + inc/ + util.inc + user/ + forum_search.php + forum_search_action.php + +David 28 Aug 2011 + - web: fix some stuff broken by my checkin [24039]. + - web: use & instead of & in URLs (not complete) + + html/ + inc/ + forum.inc + util.inc + user/ + forum_thread.php + forum_forum.php + edit_forum_preferences_action.php + +David 29 Aug 2011 + - web: fix typo in profile credit/edit + + html/user/ + create_profile.php + +David 29 Aug 2011 + - web: fix bug in "report post" function + + html/user/ + delete_profile.php + forum_report_post.php + +David 29 Aug 2011 + - Vbox wrapper: deal with checkpointing. + Current: wrapper reports frequent checkpointing to client, + but actually checkpoints only when the VM is stopped + Problem: large amounts of work would be wasted if + BOINC stops in an ungraceful way (e.g., power failure) + Solution: + Don't report frequent checkpointing. + Every CPU scheduling period (typically once/hour) + stop the VM (creating a checkpoint) + and call boinc_temporary_exit(0). + If the client wants to keep running this job, + it will start us immediately. + + samples/vboxwrapper/ + vboxwrapper.cpp + +David 29 Aug 2011 + - web: add page showing top GPU models + + html/user/ + gpu_list.php + +Charlie 30 Aug 2011 + - Mac: Copy BOINC libraries built with XCode 4.1 to locations + where built by earlier versions of XCode so dependent + builds can always find them. + - Vbox wrapper: create XCode project. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + samples/vboxwrapper/ + vboxwrapper.xcodeproj + project.pbxproj + +David 30 Aug 2011 + - client: fix a couple of valgrind warnings + + client/ + cs_notice.cpp + hostinfo_unix.cpp + +David 30 Aug 2011 + - client: send all running jobs a "reread app info" message + when global prefs change (in the case of vboxwrapper, + it might have to change network or CPU throttling) + + sched/ + sched_version.cpp + sched_send.cpp + client/ + cs_prefs.cpp + +David 30 Aug 2011 + - web: sort GPUs by average elapsed time + + html/user/ + gpu_list.php + +David 30 Aug 2011 + - vbox wrapper: check for boinc_status.reread_init_data_file, + and if set reread the file, set throttles, and clear flag + + samples/vboxwrapper/ + vboxwrapper.cpp + +David 30 Aug 2011 + - validator: in "credit_from_wu" case, record what the new credit + system would have assigned in result.claimed_credit. + + sched/ + validator.cpp + +Charlie 31 Aug 2011 + - define GPU_TYPE_NVIDIA, GPU_TYPE_ATI, use everywhere instead of + literal strings "NVIDIA" and "ATI" to ensure uniformity. + + client/ + acct_mgr.cpp + client_state.cpp + client_types.cpp + coproc_detect.cpp + cpu_sched.cpp + cs_account.cpp + cs_scheduler.cpp + log_flags.cpp + scheduler_op.cpp + lib/ + coproc.cpp, .h + gui_rpc_client_ops.cpp + +Charlie 31 Aug 2011 + - lib: Add OPENCL_REFERENCE boinc_get_opencl_ids(int argc, char** argv) + to be called by OpenCL project applications to get the platform ID + and device ID of the GPU assigned to the task by the scheduler. + + lib/ + coproc.cpp, .h + +David 31 Aug 2011 + - API: move boinc_get_opencl_ids() from lib/ to api/. + lib/ is for code that's used by >1 part of BOINC + + lib/ + coproc.cpp,h + api/ + boinc_opencl.cpp,h (new) + Makefile.am + +David 31 Aug 2011 + - boinc_get_opencl_ids(): + - change signature to return int error code + - no function overloading + + api/ + boinc_opencl.cpp,h + +David 31 Aug 2011 + - client: fix bugs related to white space around code signing keys + - win compile fixes + + api/ + boinc_opencl.cpp + client/ + client_types.cpp + cs_scheduler.cpp + scheduler_op.cpp + win_build/ + libboincapi_staticrt.vcproj + +David 31 Aug 2011 + - web: show actual project info on "forget password?" page + + html/user/ + get_passwd.php + +David 31 Aug 2011 + - API: boinc_get_opencl_ids() doesn't need to link + the OpenCL library at runtime. + It's used only in OpenCL applications, + which already include the library. + + api/ + boinc_opencl.cpp,h + Makefile.am + +David 31 Aug 2011 + - scheduler: make sure there's a \n after and . + Otherwise older clients won't be able to parse. + + sched/ + sched_types.cpp + +Rom 31 Aug 2011 + - VboxWrapper: Specify a configuration directory under the slot directory to + try and avoid permission errors on multiple platforms when BOINC + is installed as a daemon. + + samples/vboxwrapper/ + vbox.cpp + +Charlie 31 Aug 2011 + - api: Fix compile errors and warnings, add documentation in comments + - lib: remove unnecessary #include, add needed function declarations + + api/ + boinc_opencl.cpp, .h + lib/ + cl_boinc.h + coproc.cpp + +David 31 Aug 2011 + - web: show relative performance on GPU list + + html/user/ + gpu_list.php + +Charlie 1 Sep 2011 + - api: More fixes to boinc_get_opencl_ids() + + api/ + boinc_opencl.cpp + lib/ + cl_boinc.h + +Charlie 1 Sep 2011 + - lib: if OS_Darwin use procinfo_mac.cpp isntead of procinfo_unix.cpp. + - lib, api: update XCode project to build same source files in each + library as corresponding make files. + + lib/ + makefile.am + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 1 Sept 2011 + - server: rename process_wu_template() to process_input_template(), + and move it to its own file + + sched/ + Makefile.am + tools/ + backend_lib.cpp,h + process_input_template.cpp,h (new) + Makefile.am + api/ + reduce_main.cpp + +David 1 Sept 2011 + - server: factor process_input_template() into smaller pieces + + tools/ + process_input_template.cpp + +David 1 Sept 2011 + - web: fix bug in "allow beta apps" preferences editing + + html/user/ + prefs_edit.php + +David 1 Sept 2011 + - wrapper compile fixes + + samples/wrapper/ + wrapper.cpp + +Rom 1 Sept 2011 + - VboxWrapper: Add a way to extract the VM process id from the VM's + log file. + + samples/vboxwrapper/ + vbox.cpp, .h + +David 2 Sept 2011 + - client (and API and manager): change the data structure + used for system process info + Old: vector of PROCINFO. + Descendants of a process were found by recursively + iterating through the vector. + Operations are O(n) + New: map of (id, PROCINFO), + and each PROCINFO has a vector of its children. + Operations are O(log(n)) + Also combined Mac/Win/Linux variants of code that + was essentially the same. + + lib/ + procinfo.cpp,h + procinfo_win.cpp + procinfo_unix.cpp + procinfo_mac.cpp + clientgui/ + BOINCClientManager.cpp + BOINCGUIApp.cpp + +David 2 Sept 2011 + - more code shuffling: + proc_control: controlling processes + procinfo: enumerating and querying processes + run_app_windows: launching apps as other users on Win + + lib/ + proc_control.cpp,h + run_app_windows.cpp + procinfo.cpp,h + Makefile.am + api/ + boinc_api.cpp + client/ + app_control.cpp + +David 2 Sept 2011 + - client/API/vboxwrapper: + add a mechanism so that apps can report sub-processes + that are not descendants (e.g., virtual machines) + These processes are then counted as part of the app, + not as "non-BOINC CPU time". + This fixes a bug where processing was incorrectly suspended + because CPU usage by VM apps exceeded the "CPU usage limit" pref. + + Implementation: + - the PIDs of the processes in question + are passed from app to client via shared-memory, + in the app_status channel. + A new variant of boinc_report_app_status() supports this. + - the VBox wrapper queries the PID of the VM, + and reports it in this way. + - procinfo_app() includes a new argument: a list of PIDs + that are part of the app, although not ancestrally + related to the main process. + - in the client, ACTIVE_TASK now includes a vector "other_pids". + If this is nonempty, it's passed to procinfo_app(). + + lib/ + procinfo.cpp,h + samples/ + vboxwrapper/ + vbox.cpp,h + vboxwrapper.cpp + api/ + boinc_api.cpp,h + client/ + app.cpp,h + app_control.cpp + +David 2 Sept 2011 + - web: fix bug in add project prefs for a venue + + html/user/ + add_venue.php + +Charlie 2 Sep 2011 + - lib: Fix compile errors; add app_control.cpp to XCode project. + + client/ + app_control.cpp + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 2 Sept 2011 + - lib: minor code shuffle + + lib/ + proc_control.cpp + procinfo_win.cpp + +David 2 Sept 2011 + - web: when displaying a user's posts, limit the query to 1000 + so the page doesn't exceed CPU limit + + html/user/ + forum_user_posts.php + +David 5 Sept 2011 + - web: fix warnings in forum pages + - scheduler: when using elapsed time stats to predict runtime, + cap the estimated FLOPS at twice the peak FLOPS; + otherwise, if a host has received a lot of very short jobs + recently, it will get a too-high FLOPS estimate and + will exceed the rsc_fpops_bound limit. + + db/ + boinc_db.h + sched/ + sched_types.cpp,h + sched_version.cpp + html/ + ops/ + submit_permissions.php + inc/ + forum.inc + +David 5 Sept 2011 + - scheduler RPC: add element to + the element in + scheduler RPC request + (tells the server that there's an override file). + - account manager RPC: add element, + including the override flag. + - web: add "no time limit" option for forum search + - web: increase show-user-post query limit to 10000 + + lib/ + prefs.cpp,h + client/ + cs_prefs.cpp + acct_mgr.cpp + html/user/ + forum_search.php + forum_search_action.php + forum_user_posts.php + +David 6 Sept 2011 + - scheduler: add a debug message + + sched/ + sched_send.cpp + +David 6 Sept 2011 + - client: fix bugs with white space around code sign keys + and file signatures + - client: when describing app versions in scheduler requests, + we still must use CUDA instead of NVIDIA; + that's what's in the server code. + + client/ + client_types.cpp + +David 6 Sept 2011 + - scheduler: use new XML parser for most request elements + - scheduler: parse NVIDIA as well as CUDA in app version descriptions + (workaround for recent clients) + + sched/ + sched_send.cpp + sched_types.cpp + +David 6 Sept 2011 + - preliminary stuff for mechanism where privileged users + can create apps and app versions + - crontab commands should be preceded by cd to project root + + db/ + schema.sql + tools/ + make_project + html/ + ops/ + submit_permissions.php + db_update.php + user/ + submit_app.php + +David 7 Sept 2011 + - scheduler: fix crashing bug + + sched/ + sched_version.cpp + sched_assign.cpp + +Rom 7 Sept 2011 + - Tag for 6.13.2 release, all platforms + boinc_core_release_6_13_2 + + / + configure.ac + version.h + +David 7 Sept 2011 + - feeder: change the DB query to skip jobs for deprecated apps. + Otherwise, if you have a deprecated app with >= 200 jobs + (200 is the query's limit) + it could always get jobs for that app, + and never put anything into the cache. + + db/ + boinc_db.cpp + +David 7 Sept 2011 + - client: make exit_before_start a cc_config.xml option + (as well as a cmdline option) + - wrapper: print error messages if stdin/out/err files don't exist + + lib/ + cc_config.cpp,h + samples/wrapper/ + wrapper.cpp + client/ + client_state.cpp,h + app_start.cpp + cs_cmdline.cpp + app_control.cpp + +David 8 Sept 2011 + - scheduler: in work_needed(), ignore requests for resource + types for which we have no app versions + - client: if too many elements in cc_config.xml, + detect it and inform user + + sched/ + sched_send.cpp + lib/ + coproc.h + cc_config.cpp + samples/ + client_state_save.xml + client/ + log_flags.cpp + +David 8 Sept 2011 + - web: fix PHP warning + + html/inc/ + result.inc + +David 8 Sept 2011 + - validator: old scheduler bugs may cause result.flops_estimate + to be negative in some cases. + Detect this, and use 1e10 instead + + sched/ + credit.cpp + +David 8 Sept 2011 + - client: new XML parser had a limit of 8KB for strings. + This broke things. Increase it to 256KB. + + lib/ + parse.cpp + +Charlie 9 Sep 2011 + - Mac: More fixes for building under XCode 4.1. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + mac_installer/ + release_boinc.sh + +Rom 9 Sept 2011 + - Tag for 6.13.3 release, all platforms + boinc_core_release_6_13_3 + + / + configure.ac + version.h + +David 9 Sept 2011 + - web: suppress warning on cache unlink + + html/inc/ + cache.inc + +David 9 Sept 2011 + - client: XML-escape the URLs in RSS feed lists + - lib: make xml_unescape work for arbitrarily large strings + + lib/ + parse.cpp + client/ + cs_notice.cpp + +David 10 Sept 2011 + - client: don't pass --gpu_type to GPU apps; + this breaks many existing apps. + Instead, pass the GPU type (and the device number) + in app_init_data.xml + + client/ + app_start.cpp + lib/ + app_ipc.cpp,h + +David 10 Sept 2011 + - client: fix error in parsing of XML comments + + lib/ + parse.cpp + +David 11 Sept 2011 + - client: finish next-to-last checkin + + client/ + app_control.cpp + app_start.cpp + app.h + +David 11 Sept 2011 + - manager, simple view: + - edit label text + - increase opacity of main area; + otherwise some text is hard to read + - change borders from blue to light gray. + In general shouldn't use primary colors + - display credit as integer + - reduce size of project name; + otherwise long names don't fit (on Win) + - don't use "(in slot x)". + "Slot" is not part of the vocabulary here. + + clientgui/ + sg_PanelBase.cpp + sg_ProjectPanel.cpp + sg_TaskPanel.cpp + +David 11 Sept 2011 + - API: change boinc_get_opencl_ids() to use APP_INIT_DATA + instead of cmdline + + api/ + boinc_api.cpp,h + boinc_opencl.cpp,h + +David 11 Sept 2011 + - API; fix the above fix + + api/ + boinc_api.cpp,h + boinc_opencl.cpp + Makefile.am + +David 12 Sept 2011 + - client: make RR simulation more accurate + by simulating time-slicing explicitly. + Also simulate changes in project REC + and hence in scheduling priority. + - client: add a log flag "rrsim_detail" that prints + time-slice-level info. + + lib/ + cc_config.cpp,h + client/ + work_fetch.cpp,h + client_types.cpp,h + rr_sim.cpp,h + cpu_sched.cpp + +David 12 Sept 2011 + - client: remove code related to debt-based scheduling + + client/ + work_fetch.cpp,h + client_types.cpp,h + sim.cpp + cpu_sched.cpp + +David 12 Sept 2011 + - client: make file upload work w/ old handlers + + client/ + file_xfer.cpp + +David 12 Sept 2011 + - web: add config option + + html/user/ + create_account_form.php + create_account_action.php + sample_index.php + +David 12 Sept 2011 + - validator: add --no_credit option; + maintains stats but doesn't grant credit + + sched/ + validator.cpp + +David 12 Sept 2011 + - client, GUI RPC, Manager: + in GUI RPC, change RESULT.gpu_mem_wait to scheduler_wait. + It means that the app did a boinc_temporary_exit(), + and is waiting to be rescheduled. + GPU mem wait is one source of this, not the only one + + clientgui/ + MainDocument.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp + client/ + client_types.cpp + +Rom 13 Sept 2011 + - VBOX: Add more trace messages to the wrapper to help resolve + issues. + + samples/vboxwrapper/ + vbox.cpp + +David 13 Sept 2011 + - validator: add a --credit_from_runtime option. + This assigns credit proportional to runtime*p_fpops. + To prevent cheating, p_fpops is capped at the 95th percentile value + among active hosts, + and runtime is capped at a specified limit. + This option supports apps, like LHC's CERNvm app, + that run for a certain amount of time and then exit. + The CreditNew system doesn't work for such apps. + - trickle_credit: + To prevent cheating, + cap p_fpops at the 95th percentile value among active hosts, + and require a limit on runtime. + - require that trickle handlers supply an initialization function + + db/ + boinc_db.cpp,h + sched/ + trickle_handler.cpp,h + trickle_credit.cpp + trickle_echo.cpp + validate_util2.cpp + validator.cpp + +David 13 Sept 2011 + - wrapper: don't delete task-level checkpoint file when starting task; + that defeats the purpose. From Uwe Becker. + + samples/wrapper/ + wrapper.cpp + +Rom 13 Sept 2011 + - VBOX: Properly trap stderr output from vboxmanage by redirecting it to + stdout. Error messages should now be properly detected on Linux and + Mac. + + samples/vboxwrapper/ + vbox.cpp + +Rom 13 Sept 2011 + - VBOX: Don't attempt to stop a VM that is already shut down. + + samples/vboxwrapper/ + vbox.cpp + +Rom 13 Sept 2011 + - VBOX: Make is_running() a bit smarter about detecting the running state + of a virtual machine. + + samples/vboxwrapper/ + vbox.cpp + +David 13 Sept 2011 + - client: get GPU available RAM at startup (only) + - client: fix compile warning + + lib/ + coproc.cpp + client/ + work_fetch.cpp,h + client_state.cpp + coproc_detect.cpp + cpu_sched.cpp + +David 13 Sept 2011 + - client: fixes to the above + - client: prevent infinite recursion (and stack overflow) + in procinfo.cpp:add_child_totals(). + Not sure how this could happen. + + client/ + coproc_detect.cpp + lib/ + procinfo.cpp + +Rom 13 Sept 2011 + - VBOX: Increase the pipe buffer on Windows from the default to 128k. Despite what + the docs say, if the buffer isn't large enough VboxManage hangs attempting to + write the VM log file to it. Luckly the VM log file is only 64k. + - VBOX: Fix a couple of parsing errors. + + samples/vboxwrapper/ + vbox.cpp + +Rom 14 Sept 2011 + - VBOX: Add a register_only command line argument to help debug VM related issues. + - VBOX: Add some suggestions to the source on how to debug VM related issues. + - VBOX: Add a quick sanity check when the enable_shared_directory option is + enabled. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + +David 13 Sept 2011 + - client: escape URLs for curl, otherwise filenames with spaces don't work + + lib/ + procinfo.cpp + client/ + http_curl.cpp + +David 13 Sept 2011 + - client: curl_easy_escape() escapes way too much. Just escape spaces. + + client/ + http_curl.cpp + +David 14 Sept 2011 + - XML parsing: do XML unescaping in place rather than allocating + a buffer on the stack. + Fixes a Manager crash on the Mac, + where the default thread stack size seems to be 512KB. + + lib/ + parse.cpp,h + app_ipc.cpp + client/ + cs_notice.cpp + +Rom 14 Sept 2011 + - client: Update Windows detection code to support Windows 8. + (From: [P3D] Crashtest) + + client/ + hostinfo_win.cpp + +David 14 Sept 2011 + - client: change in the use of GPU available RAM: + - measure the available RAM of each GPU when BOINC starts up. + If this fails, set available = physical. + Show available RAM in startup messages. + - use available RAM rather than physical RAM in selecting + the "best" GPU instance + - report available RAM to the scheduler + TODO: change the scheduler to use available rather than physical + if it's reported + + sched/ + sample_trivial_validator.cpp + lib/ + coproc.cpp,h + client/ + client_state.cpp + coproc_detect.cpp + cpu_sched.cpp + +David 14 Sept 2011 + - vboxwrapper: we don't seem to be getting the VM PID. + Add some printfs. + + samples/vboxwrapper/ + vbox.cpp + +David 14 Sept 2011 + - client: report available GPU RAM to scheduler + + lib/ + coproc.cpp + +David 14 Sept 2011 + - lib: parse in coproc XML + - lib: do coproc XML parsing using new XML parser + + lib/ + parse.cpp,h + coproc.cpp,h + +David 14 Sept 2011 + - scheduler: in app_plan functions for GPUs, + use available RAM if reported by client; + otherwise use physical RAM. + + sched/ + sched_customize.cpp + +David 14 Sept 2011 + - scheduler: revise [21428] to include non-anonymous-platform, + and change the ratio limit from 2 to 10. + + sched/ + sched_send.cpp + sched_version.cpp + +Charlie 15 Sep 2011 + - lib: fix compiler warning. + - vboxwrapper: fix compiler warning. + - Mac: Change XCode project to build both 32-bit and 64-bit + BOINC libraries for debug as well as for deployment. + - vboxwrapper: update XCode project for easier access to built + executables and symbol tables under XCode 4.1. + + lib/ + coproc.cpp + samples/ + vboxwrapper/ + vbox.cpp + vboxwrapper.xcodeproj/ + project.pbxproj + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 15 Sept 2011 + - minor code shuffle + + client/ + rr_sim.cpp + +Rom 15 Sept 2011 + - VBOX: Add a way to track overall network utilization of a VM. + + samples/vboxwrapper/ + vbox.cpp, .h + +David 16 Sept 2011 + - Validator: allow project-specific code to mark a result + is a "runtime outlier", i.e. its runtime does + not correspond to the job's rsc_fpops_est. + Runtime outliers are not counted in the statistics for + elapsed time, turnaround time, and peak FLOPs count. + + The is intended for applications like SETI@home, + some of whose jobs finish more or less instantly + (this happens if the data contains a lot of interference). + If a host happens to get a bunch of these short jobs, + its statistics will get skewed: in essence, the server + will think that the host is extremely fast, + and will send it too many jobs. + + db/ + boinc_db.cpp,h + sched/ + credit.cpp + validator.cpp + html/ops/ + db_update.php + +David 16 Sept 2011 + - vboxwrapper: code cleanup + - use double for potentially large quantities + - factor out repetitive code, rather than copy and paste + + samples/vboxwrapper/ + vbox.cpp,h + +David 16 Sept 2011 + - vboxwrapper: report network usage to the client + - client: include the above in enforcing network quota preferences + + api/ + boinc_api.cpp,h + samples/vboxwrapper/ + vbox.cpp,h + vboxwrapper.cpp + client/ + app.cpp,h + app_control.cpp + sched/ + trickle_handler.cpp + +David 16 Sept 2011 + - transitioner: fix bug related to new runtime_outlier field + + db/ + boinc_db.cpp + +David 16 Sept 2011 + - validator: add runtime_outlier message + + sched/ + credit.cpp + +David 16 Sept 2011 + - client: with VBox on Win, the process graph sometimes has cycles. + Not sure where this comes from. + But avoid infinite recursion when traversing descendants. + + lib/ + procinfo.cpp,h + +Charlie 16 Sep 2011 + - wrapper: Update Mac build script for XCode 4.1 and OS 10.7. + NOTE: We no longer support PowerPC Macs. + + samples/wrapper/ + wrapper.cpp + +David 18 Sept 2011 + - client: make the attributes of GUI RPCs (network, authentication) + explicit rather than determined by position in a list. + - client: add a new "read-only" attribute for GUI RPCs. + This is in preparation for handling GUI RPCs in separate threads. + - client: remove code to support pre-V6 graphics. + + lib/ + parse.h + client/ + cs_notice.cpp,h + gui_rpc_server.cpp,h + gui_rpc_server_ops.cpp + app.cpp + app_control.cpp + Makefile.am + +David 18 Sept 2011 + - Win fixes + + lib/ + mfile.cpp + parse.cpp + win_build/ + boinc_cli.vcproj + +David 18 Sept 2011 + - lib: add generic interfaces for threads and thread synchronization + + lib/ + thread.cpp,h + +David 18 Sept 2011 + - win fixes + + lib/ + thread.cpp,h + win_build/ + libboinc.vcproj + +Rom 19 Sept 2011 + - Tag for 6.13.4 release, all platforms + boinc_core_release_6_13_4 + + / + configure.ac + version.h + +David 19 Sept 2011 + - client: in handling the acct_mgr GUI RPC, + don't start the RPC directly; + that might fail if CLIENT_STATE::gui_http is busy. + Instead, set a timer field. + - client: structure ACCT_MGR_OP the same as other GUI_HTTP_OP variants + - client: clarify the comments on GUI_HTTP and GUI_HTTP_OP + + Note: GUI_HTTP and GUI_HTTP_OP are misnomers; they refer to + any HTTP op other than scheduler requests and file transfers. + Should change the name, maybe to CLIENT_HTTP* + + client/ + client_state.cpp + gui_rpc_server.cpp + gui_rpc_server_ops.cpp + gui_http.cpp,h + acct_mgr.cpp,h + cs_trickle.h + +Charlie 20 Sep 2011 + - Mac: Remove app_graphics.cpp from Client in XCode project, add new + files thread.cpp,.h to libboinc.a in XCode project. + (Checked in to 6.13.4 tag.) + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 20 Sept 2011 + - client: intermediate checkin for replicated trickle-ups. + Not finished yet. + - example app: add --trickle_up and --trickle_down options, + for testing trickle messages + + client/ + acct_mgr.cpp + client_types.h + cs_notice.cpp,h + cs_scheduler.cpp + cs_trickle.cpp,h + gui_http.cpp,h + gui_rpc_server.cpp,h + http_curl.cpp,h + scheduler_op.cpp,h + samples/example_app/ + uc2.php + +David 21 Sept 2011 + - back end: extend the access control system for remote job submission + and other operations. + You can now designate a user as "manager" for a particular app. + They can then: + - control job-submit permissions for that app + - deprecate/undeprecate versions of the app. + - abort jobs for that app + + You can also designate a user as manager for the project. + They can then edit permissions and quotas, + as well as performing the app-specific functions for all apps. + + This is described here: + http://boinc.berkeley.edu/trac/wiki/MultiUser#Accesscontrol + + This required some changes to the DB schema. + + db/ + schema.sql + tools/ + manage_privileges + html/ + inc/ + submit.inc + submit_util.inc (new) + result.inc + ops/ + submit_permissions.php (removed) + db_update.php + user/ + manage_project.php (new) + submit_example.php + manage.php (new) + manage_app.php (new) + submit.php + py/Boinc/ + setup_project.py + +David 21 Sept 2011 + - client: fix bug in ATI GPU detection, caused zero RAM measurements + + client/ + coproc_detect.cpp + +Rom 21 Sept 2011 + - client: fix ATI GPU max mem display issue. + + lib/ + coproc.cpp + +David 21 Sept 2011 + - fix typo in DB schema + - msg tweaks in make_project + + db/ + schema.sql + py/Boinc/ + setup_project.py + +David 21 Sept 2011 + - client: more stuff for replicated trickle ups + + client/ + cs_trickle.cpp + client_types.cpp + http_curl.cpp + +David 21 Sept 2011 + - lib: don't include thread.cpp; + not needed for server, and causes errors on some 64-bit Linux + + lib/ + Makefile.am + +Charlie 22 Sep 2011 + - vboxwrapper: fix code which sets environment variables. + - "PATH" must be upper case. + - putenv() does not copy its input string, so must use setenv(). + + samples/ + vboxwrapper/ + vbox.cpp + +Rom 22 Sept 2011 + - VBOX: More environment variable tweaks. + + samples/vboxwrapper/ + vbox.cpp, .h + +David 22 Sept 2011 + - client: more work on replicated trickles. Not working yet. + + client/ + client_state.cpp + cs_trickle.cpp,h + +David 22 Sept 2011 + - client: replicated trickles. Seems to be working now. + - client: added config option + + client/ + cs_trickle.cpp + gui_http.cpp,h + httl_curl.cpp + lib/ + cc_config.cpp,h + +Rom 22 Sept 2011 + - Tag for 6.13.5 release, all platforms + boinc_core_release_6_13_5 + + / + configure.ac + version.h + +Rom 22 Sept 2011 + - client: Disable GPU detection of Windows when running as a + service to avoid a deadlock condition with the latest ATI + drivers. + + client/ + client_state.cpp + coproc_detect.cpp + +Charlie 23 Sep 2011 + - Mac: fixes for problems with OS 10.4 compatibility. + (checked into 6.13.5 and 6.13.6 tags) + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Rom 22 Sept 2011 + - Tag for 6.13.6 release, all platforms + boinc_core_release_6_13_6 + + / + configure.ac + version.h + +David 23 Sept 2011 + - fix typo in manage_privileges + + tools/ + manage_privileges + +David 23 Sept 2011 + - web: don't addslashes() for button titles; this was left over + from when buttons were implemented in Javascript + + html/inc/ + util.inc + +David 23 Sept 2011 + - web: message tweak + + html/inc/ + forum.inc + +David 23 Sept 2011 + - client: fix spurious error message about trickle-up URLs + + client/ + client_types.cpp + +David 23 Sept 2011 + - client: don't call CLIENT_STATE::free_mem() on shutdown. + This is for debugging only, and it can cause crashes. + + client/ + main.cpp + +Charlie 24 Sep 2011 + - Mac: more fixes for problems with OS 10.4 compatibility. + (checked into 6.13.5 and 6.13.6 tags) + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + mac_installer/ + PostInstall.cpp + uninstall.cpp + +David 26 Sept 2011 + - client simulator: add --existing_jobs_only option. + This simulates just the jobs in the state file, + rather than simulating an infinite stream of jobs + modeled after the ones in the state file. + + client/ + sim.cpp,h + cs_prefs.cpp + +Charlie 26 Sep 2011 + - Mac: update wxMac build script for building with XCode 4.1 + under OS 10.7 while maintaining OS 10.4 compatibility. + (checked into 6.13.6 tag) + + mac_build/ + buildWxMac.sh + +David 26 Sept 2011 + - client simulator: fixes + - client: message tweaks + + client/ + client_state.cpp,h + sim.cpp + cs_prefs.cpp + cs_apps.cpp + log_flags.cpp + cpu_sched.cpp + lib/ + cc_config.h + +David 26 Sept 2011 + - web: when showing a user's posts, don't show the ones + in hidden threads + - web: in showing the context of a post, link the thread also. + + html/ + user/ + forum_user_posts.php + inc/ + forum.inc + +Charlie 27 Sep 2011 + - client: Fix compile break on Mac. + + client/ + cpu_sched.cpp + +Rom 27 Sept 2011 + - web: The create_account RPC supports taking an invite_code parameter + but we currently do not expose a way in get_project_config to determine + that a UI should prompt for one. Add a tag + if the project is only accepting new accounts by invitation. + + html/user/ + get_project_config.php + +Rom 27 Sept 2011 + lib: only build the static version of libboinc. + + lib/ + Makefile.am + +David 27 Sept 2011 + - fix comment + client/ + app_control.cpp + +David 27 Sept 2011 + - Updates Linux notifications to use current libnotify. + - Fix build problems on Mac OS X using autotools + - Consistently use #if HAVE_X for platform checks, + rather than #ifdef HAVE_X or #if defined(HAVE_X) + - In Unix build, make lots of compiler checks standard + - Fix some compile warnings + + From Matt Arsenault. + + Note: there are now lots of compile warnings in clientgui/ on Unix, + mostly in WxWidgets code + + configure.ac + Makefile.incl + clientgui/gtk + taskbarex.cpp + db/ + boinc_db.cpp + clientscr/ + gfxswitcher.cpp + sched/ + file_deleter.cpp + hr.h + lib/ + various + win_build/ + win-config.h + api/ + various + client/ + various + +Charlie 27 Sep 2011 + - client: Fix compiler warnings on Mac. + - client: Fix compile break on Mac. + + client/ + client_state.cpp + cs_cmdline.cpp + mac/ + config.h + +David 28 Sept 2011 + - manager: fix build break on Linux + Undoes part of yesterday's checkin. + - more changes from #ifdef HAVE_X to #if HAVE_X + + clientgui/gtk/ + taskbarex.cpp + lib/ + proc_control.cpp + mac_address.cpp + diagnostics.cpp + parse.h + +Rom 30 Sept 2011 + - WINSETUP: Add more logging to the create group and add user to group + functions in an attempt to figure out what is going on with Windows 8. + + win_build/installerv2/redist/Windows/src/boinccas/ + CACreateBOINCGroups.cpp + win_build/installerv2/redist/Windows/Win32/ + boinccas.dll + boinccas95.dll + win_build/installerv2/redist/Windows/x64/ + boinccas.dll + boinccas95.dll + +David 1 Oct 2011 + - client: fix a bug reported by Jacob Klein, + where work fetch didn't work right in the presence of + multiple GPUs and config options. + For example: suppose: + - you have 2 GPUs and 2 projects + - Project A is excluded from GPU 1 + - you have lots of jobs for project A + Then the client won't try to fetch jobs from project B. + + The problem had 2 parts: + a) round-robin simulation wasn't taking GPU exclusions into account. + In the above example, it would think that both GPUs had jobs. + I fixed this by computing the # of GPUs from each project + is excluded, and using this in the RR simulation. + b) Once this was done, I needed to make the client + request GPU jobs from project B rather than project A. + I did this with following policy: + If a project has excluded GPUs of a given type, + and has a runnable job of that type, + don't ask it for more work of that type. + + Notes: + - the policy in b) is crude, and it means that work-buffer + preferences are ignored in some cases. + - neither a) nor b) takes into account app-level exclusions. + + I could fix both of these with a lot of work, + but I'd rather move to a model in which dissimilar GPUs + are modeled as different resources, + which would remove the need for the mechanism + in the first place. + + Other note: I figured out this problem using the client simulator, + based on the client state file that Jacob sent me. + + - web: remove extraneous ) at end of button tooltips + + html/inc/ + util.inc + client/ + client_types.h + client_state.cpp + sim.cpp + work_fetch.cpp + rr_sim.cpp + gui_rpc_serever_ops.cpp + log_flags.cpp,h + +David 1 Oct 2011 + - client: specify the project in "Some tasks need more memory + than allowed by your preferences" messages + + client + cs_trickle.cpp + client_state.cpp + +David 1 Oct 2011 + - team import script: don't exit if fail to create user. + The failure may be because the email is banned + (as happened w/ SETI@home) + + html/ops/ + team_import.php + +David 2 Oct 2011 + - client: fix bug that could cause GPU idleness + in the presence of GPU exclusions. + The problem was in the job-selection phase, + which picks enough jobs to use all devices. + It was ignoring GPU exclusions, so for example on + a 2 GPU system it could pick 2 jobs from a project + for which 1 GPU is excluded, + and as a result 1 GPU would be idle. + + Solution: during job selection, + keep track of GPU usage on a per-instance basis. + Select a job only if it can run on a non-excluded GPU. + + - client: in computing ncprocs_excluded (which is used in + work fetch policy) don't count exclusions of non-existent devices + + html/ops/ + team_export.php + lib/ + coproc.h + client/ + log_flags.cpp + cpu_sched.cpp + +David 2 Oct 2011 + - client: compute project scheduling priority more efficiently + - client: if an app version can't be used because the GPUs it needs + are all excluded, mark it and all its results as "coproc missing" + so that they won't be looked at in scheduling logic. + + client/ + client_state.cpp + client_types.cpp,h + cpu_sched.cpp + gui_rpc_server_ops.cpp + log_flags.cpp,h + rr_sim.cpp + sim.cpp + work_fetch.cpp + +Charlie 3 Oct 2011 + - client: Fix compiler warnings. + + client/ + cpu_sched.cpp + +David 3 Oct 2011 + - web: fix error in profile listings. + From Uwe Becker. + + html/user/ + profile_menu.php + +David 3 Oct 2011 + - lib: move XML parse test program to its own file. + + Note: XML_PARSER::parse_str() doesn't currently work right + for something like xx. + It should return "xx". + TODO. + + lib/ + parse.cpp,h + parse_test.cpp (new) + Makefile.am + +David 3 Oct 2011 + - scheduler: fix bugs that broke work fetch for anonymous platform; + don't send irrelevant messages to anon platform clients + + sched/ + sched_types.h + sched_send.cpp + +David 3 Oct 2011 + - scheduler: record VirtualBox version # in the host table + + sched/ + handle_request.cpp + lib/ + coproc.cpp,h + +David 4 Oct 2011 + - client: don't generate notice if lookup of host + in remote_hosts.cfg fails. + + client/ + gui_rpc_server.cpp + +David 4 Oct 2011 + - client: don't show "(device N)" if there's only 1 device + + client/ + client_types.cpp + +David 4 Oct 2011 + - client: win compile fixes + + client/ + cpu_sched.cpp + +Rom 4 Oct 2011 + - WINSCR: Before shutting down the screensaver, quickly reinitialize the OpenGL device + on the primary display. Some of the issues being reported with the screensaver + is a left over ghost image of the OpenGL display before the graphics application + was terminated because keyboard/mouse activity was detected. + + clientscr/ + screensaver_win.cpp + win_build/ + boinc_os_ss.vcproj + +David 4 Oct 2011 + - client: in the function that sorts jobs by arrival time, + don't use name as a tiebreaker. + The will typically group jobs of the same application, + and (it is believed that) things run faster when + applications are mixed. + - scheduler: bug: if a client gets host-specific prefs + (e.g. from an account manager) + it will send only the working prefs to the scheduler. + The scheduler then always sends back the DB prefs, + overwriting the host-specific prefs. + Fix: note the mod time in the working prefs, + and only send the DB prefs if they're more recent. + + client/ + cs_statefile.cpp + sched/ + handle_request.cpp + +David 5 Oct 2011 + - client: fix a memory leak; would lose ~120 bytes each time a job is started + + lib/ + filesys.cpp + +Rom 5 Oct 2011 + - Lib: Re-enable boinc lib mem snapshots for BOINC based applications (boinc, + boincmgr, boinc.scr) on Windows. + + lib/ + diagnostics.cpp + +David 5 Oct + - client: fix memory leak when reading stderr of completed job. + This caused 128KB + size of stderr loss for each job. + - client: print error message if reading stderr fails + (e.g. because of malloc failure) + + client/ + app.h + app_control.cpp + +David 5 Oct + - client: free vectors in NOTICES, RSS_FEEDS, and DAILY_XFER_HISTORY + in free_mem() (for mem leak checking) + + client + cs_notice.h + check_state.cpp + net_stats.h + +David 5 Oct + - scheduler: fix bug that caused scheduler to not send GPU jobs + + sched/ + sched_customize.cpp + lib/ + coproc.cpp + +David 5 Oct + - client: problem: suppose a project has 2 data servers, + and one of them is down. + If several downloads from the broken one fail, + we go into "project-level backoff" + and don't start downloads from either server. + (Same applies to uploads). + + Solution: make project-level backoff apply only to + transfers that have already failed at least once + + client/ + pers_file_xfer.cpp + +David 6 Oct + - GUI RPC: add get_daily_xfer_history() RPC for getting + the daily records of #bytes uploaded and downloaded + + lib/ + gui_rpc_client_print.cpp + gui_rpc_client_ops.cpp + gui_rpc_client.h + client/ + boinc_cmd.cpp + gui_rpc_server_ops.cpp + net_stats.cpp,h + main.cpp + +David 6 Oct + - client: fix bug in writing daily xfer history file + + client/ + main.cpp + net_stats.cpp + +Charlie 7 Oct 2011 + - client: write descriptions of OpenCL devices to stdout + (and display in manager's Event log). + - client: work around a bug where OpenCL reports global RAM of ATI + GPUs incorrectly (1/2 of actual value.) + + client/ + coproc_detect.cpp + lib/ + coproc.cpp, .h + +David 7 Oct 2011 + - client/server: change field names in OPENCL_DEVICE_PROP + to match those in the clGetDeviceInfo() calls. + Principles: + - if there's already a name for something, use it. + - follow case conventions + + lib/ + coproc.cpp,h + client/ + coproc_detect.cpp + sched/ + sched_customize.cpp,h + +David 7 Oct 2011 + - scheduler add app_plan() support for plan classes + opencl_nvidia_101 and opencl_ati_101 + + sched/ + sched_customize.cpp + +David 7 Oct 2011 + - client and scheduler: estimate peak FLOPS for GPUs that + are detected by OpenCL but not by native APIs (CUDA/CAL). + This is limited by the fact that OpenCL doesn't give + us the necessary hardware info + (ATI; wavefrontSize; NVIDIA: compute capability). + We use the minimum values for these, + so in most cases we'll be underestimating the peak FLOPS. + + lib/ + coproc.cpp,h + +David 7 Oct 2011 + - client (Mac): there was no error check of the creation + of a memory-mapped file used for communication with an app. + Add a check, and don't start the job if it fails. + + client/ + app_start.cpp + +David 7 Oct 2011 + - client: don't do scheduler-requested RPCs if + - project is set to No New Work, and + - project has no jobs on the client + + client/ + client_types.h + work_fetch.cpp + cs_scheduler.cpp + +David 7 Oct 2011 + - client/scheduler: the code for estimating peak FLOPS of ATI GPUs + (from Crunch3r) has a multiplier of 2.5 for cores/processor. + This is possibly because give a double-precision estimate. + But actually we want single-precision. Change it to 5. See + http://golubev.com/about_cpu_and_gpu_2_en.htm + + lib/ + coproc.cpp + +Charlie 7 Oct 2011 + - client: improve code which writes OpenCL descriptions. + + client/ + coproc_detect.cpp + +Charlie 7 Oct 2011 + - client: Compare openCL-only devices by estimated peak flops. + + client/ + coproc_detect.cpp + lib/ + coproc.cpp,h + +David 7 Oct 2011 + - scheduler: problem: in the daily quota mechanism, + the boundary between days is 00:00 in server local time. + This creates a spike of jobs being dispatched + (and files being downloaded) after that time. + + Solution: distribute the boundary uniformly, + using a random number determined by the host ID. + (Make sure to save/restore the seed around this, + so we don't destroy the randomness of other things) + + sched/ + handle_request.cpp + +David 7 Oct 2011 + - client: compare OpenCL-only devices the same as other devices + - code cleanup + + lib/ + coproc.cpp,h + client/ + coproc_detect.cpp + sched/ + sched_customize.cpp + +David 8 Oct 2011 + - scheduler: fix crashing bug when using HR. From Kevin Reed. + + sched/ + sched_version.cpp + +Charlie 8 Oct 2011 + - client: Fill in peak flops for each OpenCL GPU before compare; + else there is nothing to ompare with. + + client/ + coproc_detect.cpp + +David 8 Oct 2011 + - API: don't crash if send trickle msg running standalone. + From Christian Ries. + + api/ + boinc_api.cpp + +David 8 Oct 2011 + - client: fix bugs in acct manager attach/detach + + client/ + gui_rpc_server_ops.cpp + +Charlie 10 Oct 2011 + - code cleanup + + lib/ + coproc.cpp,h + client/ + coproc_detect.cpp + +Rom 10 Oct 2011 + - client: Fix crashing bug in OpenCL detection on Windows. + - lib: Fix crashing bug for debug builds of the BOINC client software + + client/ + coproc_detect.cpp + lib/ + diagnostics.cpp + +Charlie 10 Oct 2011 + - code optimization + + client/ + coproc_detect.cpp + +Charlie 11 Oct 2011 + - Mac installer: follow recommendations of Apple Developer Technical + Support: create users and groups boinc_master and boinc_project + at first available UserIDs and GroupIDs starting at 501 instead + of 25 to avoid conflicts with UserIDs and groupIDs which may be + added in the future; use Directory Services to find the user + names of all human users instead of stepping through the entries + in the /Users directory. + - Mac installer: revert to using LoginItemAPI.c under OS 10.7.1, + because it once again sets hidden property for login items, but + the AppleScript seems not to work under OS 10.7.1. + + clientgui/ + mac/ + SetupSecurity.cpp + mac_installer/ + PostInstall.cpp + +Rom 11 Oct 2011 + - Tag for 6.13.7 release, all platforms + boinc_core_release_6_13_7 + + / + configure.ac + version.h + +David 11 Oct 2011 + - client/server: add a new result state RESULT_UPLOAD_FAILED + for when the job completed successfully but + one or more output files had permanent upload failures. + Show this state in web interfaces. + - sample_work_generator: check return value of count_unsent_results(), + so that we don't generate infinite work if there's a DB problem + - web: RSS feed shows news items from last 90 days, rather than 14 + + sched/ + sample_work_generator.cpp + html/ + inc/ + result.inc + user/ + rss_main.php + lib/ + coproc.cpp,h + error_numbers.h + common_defs.h + client/ + client_types.cpp,h + client_state.cpp + coproc_detect.cpp + +David 11 Oct 2011 + - client and user web: show NVIDIA driver version and CUDA version + as, e.g., 275.33 instead of 27533 + + html/inc/ + host.inc + lib/ + coproc.cpp + +Rom 11 Oct 2011 + - vbox: Move the destination of the VBOX_USER_HOME environment variable to + /projects/virtualbox so that the virtualbox configuration + can remain consistent across one or more projects. + + samples/vboxwrapper/ + vbox.cpp + +Charlie 11 Oct 2011 + - client: fix NVIDIA driver version and CUDA version display for Mac. + + lib/ + coproc.cpp + +Rom 11 Oct 2011 + - Tag for 6.13.8 release, all platforms + boinc_core_release_6_13_8 + + / + configure.ac + version.h + +David 11 Oct 2011 + - scheduler: fix a bug that would choose app versions erroneously. + The problem: the choice of app version was based on + the "projected FLOPS" return by estimate_flops(av). + If usage stats exist for the host / app version, + this returns a number X such that + WU.rsc_fpops_est/X approximates the runtime of a job + using the given app version.. + (If WU.rsc_fpops_est is way off, this will be correspondingly way off + from the actual FLOPS the app version will get.) + However, if there are no usage stats, + it return an estimate based on host hardware speed, + which might be 100X less. + Hence, in some cases a new app version would never get used. + + Solution: choose app versions based on the values + returned by the app plan functions. + Use estimate_flops() AFTER choosing the version. + - scheduler: improve the accuracy of FLOPS estimation for GPU apps. + The "flops_scale" argument to coproc_perf + (which expresses the difference between peak GPU FLOPS + and actual FLOPS) should be used to scale GPU FLOPS + prior to calling coproc_perf(), + rather than scaling the estimate returned by coproc_perf(). + - show_shmem: show have_X_apps flags + + sched/ + sched_customize.cpp + sched_version.cpp + sched_shmem.cpp + +Charlie 12 Oct 2011 + - client: fix honoring of cc_config ignore GPU options. + + client/ + coproc_detect.cpp + +Charlie 13 Oct 2011 + - atiopencl sample: call boinc_get_opencl_ids() if not stand-alone; + improve error messages. + + samples/ + atiopencl/ + atiopencl.cpp + +Rom 13 Oct 2011 + - WINSCR: Move the reset display call to the end of the full screensaver + section. We do not need to perform a display reset in the various + test modes. + + clientscr/ + screensaver_win.cpp + +David 13 Oct 2011 + - client: fix bug where network suspend got ignored when + OS suspends (e.g. sleep or hibernate) + + client/ + cs_prefs.cpp + +David 13 Oct 2011 + - client: create and destroy PERS_FILE_XFERs even if network suspended. + This will show pending uploads in the Transfers tab. + - file_upload_handler: fix message to client when can't acquire lock + - client: parse in state file correctly + + client/ + client_stte.cpp + sim.cpp + cs_statefile.cpp + cs_files.cpp + sched/ + file_upload_handler.cpp + +David 13 Oct 2011 + - web: fix bug in user search when enter empty name prefix + + html/user/ + user_search.php + +Rom 13 Oct 2011 + - MGR: Support both the old and new libnotify at runtime on Linux + + clientgui/gtk/ + taskbarex.cpp + +David 13 Oct 2011 + - manager: don't show slot number in simple view task list + + clientgui/ + sg_TaskPanel.cpp,h + +Rom 13 Oct 2011 + - MGR: Remove code that blocks the switch to simple view when an + accessibility aid is running. + + clientgui/ + BOINCGUIApp.cpp + AdvancedFrame.cpp + +Rom 14 Oct 2011 + - Remove dead code related to v5 graphics applications from the + client software. + + client/ + boinc_cmd.cpp + clientgui/ + AsyncRPC.cpp, .h + BOINCGUIApp.cpp, .h + MainDocument.cpp + clientgui/gtk/ + taskbarex.cpp + clientscr/ + screensaver.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp + win_build/ + win-config.h + +Rom 14 Oct 2011 + - MGR: Remove the triangle in the lower right-hand corner of the + default project image for the simple GUI + + clientgui/res/skins/default/graphic/ + project_image.xpm + +Rom 14 Oct 2011 + - MGR: Persist Simple GUI notification dialog size and position + information. + - MGR: Remove context menu help buttons from dialog. + + clientgui/ + sg_DlgMessages.cpp + +David 14 Oct 2011 + - client: show OpenCL version correctly on Win + lib/ + coproc.cpp + +David 14 Oct 2011 + - client: improvements to job scheduling and work fetch policies. + - Job scheduling: the baseline policy is to schedule based on "project priority", + which is how much processing P should receive based on resource share + minus how much it actually has received recently. + This policy tends to run jobs from the same project together, + so we modified it by adding a priority adjustment as jobs are scheduled. + The idea is that if 2 projects have about the same priority + they should split the processors. + + The problem: the adjustment was too large on hosts that are on + only a small fraction of the time, + thus tending to run 1 job from each project, regardless of priority. + + Solution: make an adjustment that reflects the host's actual throughput. + See adjust_rec_sched() for details. + + - Work fetch: similar situation. + We were making an adjustment based on how much work the project currently has queued, + but the adjustment drowned out the project priority, + so we'd tend to always get work from the project that has least work queued. + Solution: make a smaller adjustment (-.3 ... .3) + + - client: in message announcing app start, show the plan class + + - client: don't show "unrecognized XML" messages for account files. + It's typically project-specific prefs that the client doesn't know about. + + client/ + app_start.cpp + client_state.cpp + cpu_sched.cpp + cs_account.cpp + work_fetch.cpp + +David 14 Oct 2011 + - client: bug fix for the above + client/ + work_fetch.cpp + +David 14 Oct 2011 + - scheduler: in cuda_check(), ati_check() and opencl_check() + (in sched_customize.cpp) + the flops_scale argument is intended to express the + GPU efficiency (actual/peak). + Pass appropriate values. + + sched/ + sched_customize.cpp + sched_version.cpp + html/ + ops/ + index.php + inc/ + db_ops.inc + +David 16 Oct 2011 + - client simulator: make the output more graphical + + html/ + inc/ + util.inc + client/ + sim.cpp + +David 17 Oct 2011 + - add boinc_opencl.h to set of installed headers + - emulator tweaks + lib/ + Makefile.am + client/ + sim.cpp + sim_util.cpp + +David 17 Oct 2011 + - client: call xp.skip_unexpected() if get unexpected tag, + to avoid showing multiple error messages + - client simulator: bug fixes and tweaks + + client/ + client_types.cpp,h + app.h + sim.cpp,h + work_fetch.cpp + sim_util.cpp + +David 17 Oct 2011 + - client: associate a PROJECT with HTTP_OP where applicable, + so that if you use and filter by project + you don't see other projects' HTTP stuff + - client simulator: cc_config.xml is part of the scenario; + log flags are part of the simulation + + client/ + http_curl.cpp,h + sim.cpp + work_fetch.cpp + file_xfer.cpp + gui_http.cpp + scheduler_op.cpp + +Rom 17 Oct 2011 + - MGR: Make the Default skin loadable from the file system. + - MGR: Change the in-memory defaults for the skin to be a light-gray + background. + - MGR: Change the dots used in the simple gui. + - MGR: Make the dots used in the simple gui skinable. + - MGR: Change the 'Project Web Sites' button text to 'Project Web Pages'. + - MGR: Add a basic 'Default' skin to be included by the various + installers + - MGR: Remove a bunch of files that are not used by the default skin + anymore. + + clientgui/res/skins/default/graphic/ + + clientgui/res/templates/ + dotgreen.gif + dotred.gif + dotyellow.gif + clientgui/ + sg_DlgPreferences.cpp + sg_ProjectPanel.cpp + sg_TaskPanel.cpp, .h + SkinManager.cpp, .h + clientgui/skins/Default/ + background_image.png + clientgui/skins/Default/ + skin.xml + +David 18 Oct 2011 + - backend API: added function cancel_jobs(minid, maxid) + for canceling jobs + - added program cancel_jobs for canceling jobs + - DB interface: it's not an error if update_fields_noid() + affects != 1 rows + + db/ + db_base.cpp + tools/ + backend_lib.cpp,h + cancel_jobs.cpp (new) + poll_wu.cpp + Makefile.am + lib/ + parse.cpp + py/Boinc/ + setup_project.py + +Charlie 18 Oct 2011 + - Mac: Update Mac build scripts, XCode project and source files + to allow automated builds under OS 10.7 Lion and XCode 4.2. + - Mac: Build and link jpeglib from boinc/samples/jpeglib instead + of requiring a separate jpeglib-6b directory. + + api/ + gutil.cpp + gutil_text.cpp + lib/ + mac/ + QBackTrace.c + QCrashReport.c + mac_build/ + boinc.xcodeproj/ + project.pbxproj + buildc-ares.sh + buildcurl.sh + BuildMacBOINC.sh + buildWxMac.sh + setupForBOINC.sh + mac_installer/ + Installer.cpp + PostInstall.cpp + samples/ + jpeglib/ + jconfig.h + +Rom 18 Oct 2011 + - MGR: More simple GUI text changes + - MHR: Reduce clutter in log file + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_ProjectPanel.cpp, .h + +David 18 Oct 2011 + - client: change the way project priorities are computed, + so that they do what they're supposed to + (i.e. enforce resource shares) + - client: change log flag to + - client simulator: update REC even with large delta-t. + - client simulator: handle "no new work" apps correctly + + api/ + Makefile.am + client/ + work_fetch.cpp,h + client_types.h + client_state.cpp + sim.cpp + rr_sim.cpp + sim_util.cpp + cpu_sched.cpp + +David 18 Oct 2011 + - client: fix bug that caused extra "<" to get written at + end of global_prefs_override.xml and cc_config.xml + when they are modified via GUI RPCs + + client/ + gui_rpc_server_ops.cpp + +David 19 Oct 2011 + - client: fix crashing bug when there's a cycle in the process graph. + I had fixed this in one place but not another. + - client: don't memset(0,) a PROCINFO; use clear() instead + + lib/ + proc_control.cpp + procinfo_mac.cpp + procinfo_unix.cpp + procinfo_win.cpp + +Charlie 19 Oct 2011 + - Mac: Update XCode project and Mac build scripts to build + libboinc_opencl.a library and to work both with XCode 3.2 on + OS 10.6.8 and with XCode 4.2 on OS 10.7.2. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + BuildMacBOINC.sh + +Charlie 19 Oct 2011 + - MGR: Replace backup images RedDot16.xpm, YellowDot16.xpm and + GreenDot16.xpm with XPM files created from Rom's new files + dotred.gif, dotyellow.gif and dotgreen.gif. These need to + be cmpiled into the source code as backups in case the GIFs + are missing, because these images are essential resources. + + clientgui/ + res/ + RedDot16.xpm + YellowDot16.xpm + GreenDot16.xpm + +Charlie 19 Oct 2011 + - MGR: Simple View bug fix. + + clientgui/ + sg_TaskPanel.cpp + +Rom 19 Oct 2011 + - MGR: Fix dot images + + clientgui/res/skins/default/graphic/ + workunit_running_image.xpm + workunit_suspended_image.xpm + workunit_waiting_image.xpm + clientgui/res/templates/ + dotgreen.gif + dotred.gif + dotyellow.gif + +David 19 Oct 2011 + - client simulator: bug fix + + client/ + sim.cpp + lib/ + parse.cpp + +Charlie 20 Oct 2011 + - MGR: Replace colored dot GIF files with new PNG files which do + the anti-aliasing in the alpha channel, so they look correct + when highlighted on the Mac. Generate new XPM files from + these PNG files. + + clientgui/res/skins/default/ + graphic/ + workunit_running_image.xpm + workunit_suspended_image.xpm + workunit_waiting_image.xpm + skin.xml (added) + clientgui/res/templates/ + dotgreen.gif (deleted) + dotred.gif (deleted) + dotyellow.gif (deleted) + Green_dot.png (added) + Red_dot.png (added) + Yellow_dot.png (added) + +Charlie 20 Oct 2011 + - MGR: Force update of Task Selection List on reskin interface. + + clientgui/ + sg_TaskPanel.cpp,h + +Charlie 20 Oct 2011 + - MGR: Move skin file to correct place, set background image's + background color to black for this background_image.png. + + clientgui/ + res/skins/default/ + skin.xml (deleted) + skins/Default/ + skin.xml + +David 21 Oct 2011 + - client/API: pass bool using_sandbox in APP_INIT_DATA; + says whether the client is using account-based sandboxing. + Needed by vboxwrapper. + - web: don't show authenticator in Your Account page. + The problem with authenticators is that if a bad guys gets yours, + they can log in to your account even if you change your password. + Eventually we should not use them at all + (i.e. in cookies and sent to client). + - make_project: copy python stuff (e.g. bin/start) for web-only projects; + generate appropriate project.readme file for web-only projects. + + html/inc/ + user.inc + lib/ + app_ipc.cpp,h + client/ + app_start.cpp + cs_scheduler.cpp + tools/ + make_project + py/Boinc/ + setup_project.py + +Charlie 21 Oct 2011 + - MGR: Adjust preference dialog titles, improve Simple View menus + and other text, make Simple Preferences dialog more like + Advanced Preferences dialog. + + clientgui/ + AdvancedFrame.cpp + DlgAdvPreferencesBase.cpp + DlgOptions.cpp + Events.h + sg_BoincSimpleFrame.cpp,.h + sg_DlgMessages.cpp,.h + sg_DlgPreferences.cpp,.h + +Rom 21 Oct 2011 + - VBOX: Don't redirect VirtualBox to a different directory structure for + the root configuration file when the client is NOT in sandbox mode. + Doing so could cause confusion if the volunteer uses VirtualBox for + any of their own work. If BOINC started up first it would have appeared + that their own VM's no longer existed. + + samples/vboxwrapper/ + vbox.cpp + +Rom 21 Oct 2011 + - MGR: Make the simple gui rounded edges seem smoother by increasing the + radius. + - MGR: Fix project name font in the tasks area, normal size. Increase + its weight to BOLD. + - MGR: Make sure the dot is red if the project has been suspended for + the given task. + + clientgui/ + sg_PanelBase.cpp + sg_TaskPanel.cpp + +David 21 Oct 2011 + - scheduler: fix calculation of ATI peak FLOPS; + older clients don't report have_cal. + + lib/ + coproc.cpp + +Rom 21 Oct 2011 + - MGR: Scale background skin so that it now fits in the new simple gui + NOTE: We are in the process of trying to get new artwork so that we + can handle the localization issues better. + + clientgui/skins/Default/ + background_image.png + +David 21 Oct 2011 + - fix NVIDIA peak FLOPS + + lib/ + coproc.cpp + +David 21 Oct 2011 + - update_versions: touch trigger file so that feeder rereads DB + + tools/ + update_versions + +Charlie 21 Oct 2011 + - MGR: Fix crash bug. + + clientgui/ + sg_BoincSimpleFrame.cpp,.h + +Charlie 21 Oct 2011 + - MGR: Fix project name font on Mac, which uses Lucinda Grande font + not Arial. SetFont for the parent window does not propogate to + the text controls because CTransparentStaticText uses OnPaint() + to draw. + + clientgui/ + sg_TaskPanel.cpp + +Charlie 22 Oct 2011 + - MGR: Bug fix: when the task currently selected in Simple View + is deleted, change selection to a different task. + + clientgui/ + sg_TaskPanel.cpp + +Charlie 23 Oct 2011 + - MGR: Sort Simple View task selection control alphabetically. + + clientgui/ + mac/ + MacBitmapComboBox.cpp,.h + sg_TaskPanel.cpp + +Charlie 23 Oct 2011 + - MGR: Reverted the above change because wxBitmapComboBox on Windows + loses existing items' clientData when we Insert() a new item. + + clientgui/ + sg_TaskPanel.cpp + +David 23 Oct 2011 + - web: forum RSS shouldn't filter sticky threads. + Not sure why that was in there. + html/inc/ + forum_rss.inc + +Charlie 24 Oct 2011 + - Mac installer: Fix a very old bug. + + mac_build/ + Mac_SA_Secure.sh + +David 24 Oct 2011 + - client: reimplement the round-robin simulator to + reduce its runtime from O(N^2) to O(N), + where N is the number of runnable jobs + (which can be in the thousands). + This will make the client emulator run a lot faster, + and will reduce the client CPU overhead a bit. + - API: change boinc_get_opencl_ids() so that it returns + a BOINC error code (< -100) if the app_init.xml is + missing or bad (i.e. we're running standalone), + and an OpenCL error code (> -100) if an OpenCL call failed. + + client/ + work_fetch.cpp,h + client_types.h + sim.cpp + rr_sim.cpp + +Rom 24 Oct 2011 + - MGR Skins: Fix numerious issues related to bad entries in the Skin XML + file. + + clientgui/ + SkinManager.cpp + clientgui/skins/GridRepublic/ + skin.xml + clientgui/skins/Progress Thru Processors/ + skin.xml + +David 24 Oct 2011 + - API: compile fixes for MinGW. From Oliver Bock. + + lib/ + win_util.h + boinc_win.h + proc_control.h + Makefile.mingw + parse.h + +Charlie 25 Oct 2011 + - MGR: Sort Simple View task selection control alphabetically. + Subclassed CBOINCBitmapComboBox from wxBitmapComboBox to work + around clientData bug in wxBitmapComboBox::Insert(). + + clientgui/ + BOINCBitmapComboBox.cpp,.h (added) + mac/ + MacBitmapComboBox.cpp,.h + sg_PanelBase.h + sg_ProjectPanel.cpp + sg_TaskPanel.cpp,.h + win_build/ + boincmgr.vcproj + +Charlie 25 Oct 2011 + - MGR: Allow skin to specify the (simulated) opacity of Simple View + task and project panels on a scale of 0 (clear) to 255 (opaque). + + clientgui/ + sg_PanelBase.cpp + SkinManager.cpp,.h + +Rom 25 Oct 2011 + - Tag for 6.13.9 release, all platforms + boinc_core_release_6_13_9 + + / + configure.ac + version.h + +David 25 Oct 2011 + - web: typo in forum RSS from Daniel L G; fixes #1147 + - client: message tweak + + html/inc/ + forum_rss.inc + client/ + cpu_sched.cpp + +David 25 Oct 2011 + - scheduler: fix bug in the "homogeneous app version" (HAV) feature + (reported by Kevin Reed). + The problem: cache inconsistency. + If there are 2 results for the same WU in shared mem, + and 2 scheduler instances get them around the same time, + they can send them with different app versions. + We already fixed this problem for HR by + 1) rereading the relevant WU fields while deciding + whether to send the result + 2) doing a "careful update" of the WU field using a where clause + to make sure it wasn't modified in the (short) interval + since rereading it. + I fixed the HAV problem in the same way, + and merged the two mechanisms to combine the DB queries. + + Also: + - The rereads are done in slow_check() (see below). + - The careful updates are done in update_wu_on_send(), + and this is called *before* doing careful updates on result fields. + That way, if the WU updates fail, we don't have orphaned results. + - already_sent_to_different_platform_careful() (sic) + no longer does DB stuff, so it's merged with + already_send_to_different_hr_class() (better name) + + NOTE: slow_check() is used in array scheduling only. + Score-based scheduling uses other code, + in which this bug is not yet fixed. + Locality scheduling doesn't support HR or HAV at all. + This should be unified. + + db/ + db_base.cpp,h + sched/ + sched_hr.cpp,h + sched_array.cpp + sched_send.cpp + sched_score.cpp + +Charlie 26 Oct 2011 + - Mac: Modify XCode project to link with libcrypto.0.9.7.dylib and + libssl.0.9.7.dylib if OS 10.5 SDK is present, to allow running + BOINC on OS 10.4 and later. If OS 10.5 SDK is not present then + it will link with libcrypto.0.9.8.dylib and libssl.0.9.87.dylib + and product will require OS 10.6 or later. + (Checked into 6.13.9 tag.) + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Charlie 26 Oct 2011 + - Mac: Update build instructions for client and libraries. + - Mac installer: fix bugs when installing under OS 10.5. + - Mac installer: Update release script to include Default skin. + (All checked into 6.13.9 tag.) + + mac_build/ + HowToBuildBOINC_XCode.rtf + mac_installer/ + postInstall + PostInstall.cpp + release_boinc.sh + +David 26 Oct 2011 + - scheduler: tweaks to last night's checkin. + In the inner loop of scan_work_array() there are two WORKUNITs: + - the one that's part of wu_result (in the shared-mem array) + - a temp copy. + quick_check() may modify this in host-specific ways + (e.g., adjusting rsc_fpops_est or delay_bound). + This is the one we pass to add_result_to_reply(). + When we reread hr_class and app_version_id from the DB, + update both structs. + + sched/ + sched_array.cpp + sched_send.cpp + +David 26 Oct 2011 + - client: fix typo in project parse code + + client/ + client_types.cpp + +David 26 Oct 2011 + - scheduler: typo in a SQL query + + sched/ + sched_send.cpp + +David 26 Oct 2011 + - web: fix typo that failed to show ATI GPUs in top-GPU page + + html/user/ + gpu_list.php + +David 26 Oct 2011 + - client: smoothed working-set size wasn't being computed correctly. + It was always just the most recent size. + + sched/ + sched_util.cpp + sample_work_generator.cpp + lib/ + procinfo.h + client/ + app.cpp + +David 26 Oct 2011 + - scheduler: bug fix from Kevin + + sched/ + sched_send.cpp + +Charlie 27 Oct 2011 + - Mac installer: Update release script to create projects/virtualbox/ + directory, to ensure it has the correct owner and permissions + because vboxwrapper does not have sufficient privileges to do so. + + mac_installer/ + release_boinc.sh + +Rom 27 Oct 2011 + - Tag for 6.13.10 release, all platforms + boinc_core_release_6_13_10 + + / + configure.ac + version.h + +Charlie 28 Oct 2011 + - Mgr: Exit manager as soon as quit rpc to client succeeds, instead + of waiting for client to exit. + (Checked in to 6.13.10 for Mac build only.) + + The problem: if suspended tasks are kept in memory, some project + applications don't respond to exit request from client, but client + needs to allow 20 seconds before killing them in case they are + writing a large checkpoint file. But if the manager waits that + long to exit, it seems unresponsive to users, so it was killing + the client after only 10 seconds. This left orphan project apps + in RAM. + + The solution: assume that if the quit rpc to the client succeeds, + the client will exit properly, so kill client only if RPC fails + or is not completed in 10 seconds. + + clientgui/ + BOINCClientManager.cpp + BOINCGUIApp.cpp,.h + +David 28 Oct 2011 + - GUI RPC client: parse the reply of quit(), + so that it returns an error if no response + + lib/ + gui_rpc_client_ops.cpp + +David 28 Oct 2011 + - web: Display AMD GPU info correctly. From Teemu Mannermaa. + + html/inc/ + host.inc + +Charlie 29 Oct 2011 + - Mgr: Code cleanup. + + clientgui/ + BOINCClientManager.cpp,.h + BOINCGUIApp.cpp,.h + MainDocument.cpp + +David 29 Oct 2011 + - lib: fix a "strcpy(p, p+1)" instance + + lib/ + url.cpp + +Charlie 31 Oct 2011 + - api: Update comments, remove unused includes for boinc_opencl.a. + + api/ + boinc_opencl.cpp + +David 2 Nov 2011 + - API: fix bug in boinc_get_opencl_ids() + - add simulator for distributed storage (not finished) + + api/ + boinc_opencl.cpp + client/ + app_start.cpp + ssim/ + des.h + ssimp.cpp + makefile + +David 2 Nov 2011 + - server: plan class names containing 'nvidia' or 'cuda' + are assumed to be for NVIDIA GPU apps; + plan class names containing 'ati' are assumed to be for AMD GPU apps. + Clauses for 'nvidia' were missing in a couple of places. + + sched/ + sched_customize.cpp + sched_version.cpp + html/inc/ + util.inc + lib/ + gui_rpc_client_ops.cpp + +David 2 Nov 2011 + - scheduler: in update_wu_on_send(), always try to update + the hr_class and app_version_id fields, + with the where clause that they be either zero or the target value. + This handles the cases where + 1) because of the failure of a results, the transitioner set + the field back to zero; + 2) another scheduler set the field to the target value + (from Kevin Reed) + + sched/ + sched_send.cpp + client/ + makefile_sim + +David 2 Nov 2011 + - feeder: fix logic error in the way app_version.pfc_scale is updated + (from Kevin Reed) + + sched/ + credit.cpp + +Charlie 3 Nov 2011 + - api: Restore lost checkin of 31 October 2011. + - Mac installer: update ReadMe files for BOINC 6.13.x. + + api/ + boinc_opencl.cpp + mac_installer/ + CE-ReadMe.rtf + GR-ReadMe.rtf + PTP-ReadMe.rtf + ReadMe.rtf + +David 3 Nov 2011 + - client: fix bugs when writing/parsing cc_config.xml via GUI RPCs + (e.g. when editing it via the Manager). + Include only the GPUs that were specified in the original cc_config.xml, + not those detected by the client. + - client: fix bug that failed to require authorization for + GUI RPCs that are supposed to be authorized + - client: report parse errors in acct_mgr_url.xml and acct_mgr_login.xml + - fix compile warnings + - user web: in sample project_specific_prefs.inc, + get app names from the DB instead of listing them in the PHP code. + + html/project.sample/ + project_specific_prefs.inc + lib/ + coproc.h + cc_config.cpp + client/ + switcher.cpp + coproc_detect.cpp + gui_rpc_server_ops.cpp + acct_mgr.cpp + app.cpp + cpu_sched.cpp + +David 3 Nov 2011 + - wrapper: handle Windows .bat files as main programs + + samples/wrapper/ + wrapper.cpp + +David 3 Nov 2011 + - client: show GPU exclusions at startup + (need to do this after reading the state file, + since GPU exclusions refer to projects). + - client: fix bug that added garbage element + to in state file when using GPU exclusions + + client/ + client_types.cpp + client_state.cpp + log_flags.cpp + +David 4 Nov 2011 + - client: fix work fetch bug. + If we're contacting a project to report results, + only piggyback work requests for resources for which + that project is the highest priority that may have work. + - client: compute result.not_started more efficiently + + TODO: continue efficiency work. There's still some quadratic stuff + + client/ + client_types.cpp,h + client_state.cpp + sim.cpp + work_fetch.cpp + cpu_sched.cpp + +Charlie 5 Nov 2011 + - client: Fix compile error. + + client/ + cs_scheduler.cpp + +Charlie 5 Nov 2011 + - Mac: add -Wno-format-security compiler flag to suppress warning + that format string is not a string literal in code to show + messages from server in CLIENT_STATE::handle_scheduler_reply(). + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +Charlie 5 Nov 2011 + - client: fix errors in (currently unused) get_max_cpu_temperature() + code for Macintosh. + + client/ + hostinfo_unix.cpp + +David 4 Nov 2011 + - client: fix compile warning + client/ + cs_scheduler.cpp + +David 4 Nov 2011 + - client: attempt to fix bug reported by John McLeod, + where the client crashes after giving up (90 day timeout) on an upload. + I'm guessing this was caused by [24391], + which changed the order in the poll loop from + garbage_collect + file_xfers->poll + pers_file_xfers->poll + handle_pers_file_xfers + to + garbage_collect + handle_pers_file_xfers + file_xfers->poll + pers_file_xfers->poll + I don't understand why this would have caused a crash, + but so be it. + I restored the original order, but with handle_pers_file_xfers + not inside the if (!network_suspended). + - client renamed handle_pers_file_xfers() to + create_and_delete_pers_file_xfers() + - client simulator: show simulator CPU time + + client/ + client_state.cpp + sim.cpp + client_state.h + pers_file_xfer.cpp + cs_files.cpp + +Charlie 5 Nov 2011 + - Mac: remove -Wno-format-security compiler flag (no longer needed). + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + +David 5 Nov 2011 + - scheduler: fix bug in HR code (from Kevin) + + sched/ + sched_send.cpp + +David 5 Nov 2011 + - client: don't crash if trickle up exceeds 64KB + (this bug was introduced Sept 20) + - scheduler: truncate long trickle-ups to 256KB; don't crash + + db/ + db_base.cpp,h + client/ + cs_trickle.cpp + +David 6 Nov 2011 + - client: actually do the checking described above + + client/ + cs_trickle.cpp + +David 6 Nov 2011 + - client: don't crash if a project sends app_version.flops = 0. + + client/ + client_types.cpp + rr_sim.cpp + +Charlie 7 Nov 2011 + - Mgr: Bug fix. + + clientgui/ + BOINCGUIApp.cpp + +David 7 Nov 2011 + - manager: apparently WxWidget's combo box has problems (bugs) + if multiple items have the same string. + So, in simple view task combo box: + - show % done (unique in most cases) + - remove version number + - instead of showing plan class, show "NVIDIA GPU" or "ATI GPU" + TODO: update the fraction done + + clientgui/ + sg_TaskPanel.cpp + +David 7 Nov 2011 + - client: condition RR sim negative FLOPs message on rr_simulation. + + client/ + rr_sim.cpp + +Rom 7 Nov 2011 + - client: reduce complexity, possibly get rid of a crash condition + on 64-bit Windows. + + client/ + cs_prefs.cpp + +Rom 7 Nov 2011 + - MGR: Change default skin to the one Jacob Klein purposed. + + clientgui/res/templates/ + + clientgui/skins/Default/ + background_image.png + skin.xml + workunit_running_image.png + workunit_suspended_image.png + workunit_waiting_image.png + +David 7 Nov 2011 + - client: on transient upload failure, don't do start_xfer() + within PERS_FILE_XFER::transient_failure(); + we're about to delete and free the FILE_XFER. + The transfer will be restarted in the next poll. + + client/ + pers_file_xfer.cpp + +Charlie 8 Nov 2011 + - Mgr: Fix Simple View layout to fit 3 decimal places for % done. + + clientgui/ + sg_TaskPanel.cpp + +Charlie 8 Nov 2011 + - Mac installer: fixes for OS 10.4 compatibility. + + mac_installer/ + PostInstall.cpp + +Rom 8 Nov 2011 + - API: Remove exception trapping stuff from the + boinc_get_opencl_ids. + + api/ + boinc_opencl.cpp + +David 8 Nov 2011 + - DB: use %u when writing result IDs in SQL queries; + this is to support SETI@home, which ran out of result IDs + and changed the DB field type to int unsigned. + Note: eventually I'll make this change official + and change the .h types as well. + - web: put tags around elements + in project-specific prefs. + + db/ + boinc_db.cpp + db_base.cpp + sched/ + sched_send.cpp + html/project.sample/ + project_specific_prefs.inc + +Charlie 9 Nov 2011 + - Mgr: to fix Windows combo box problem when multiple items have + the same string, add spaces to identical application names in + Task Selection control as needed to make each entry unique. + Don't append % done to Task Selection control entries, as that + varies over time, causing significant complications. + + clientgui/ + sg_TaskPanel.cpp + +Rom 9 Nov 2011 + - WINSCR: Add a reference to SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING + in the message lookup table. + + clientscr/ + screensaver_win.cpp + +Rom 9 Nov 2011 + - WINSCR: In the ResetProc message pump, change the call for CloseWindow() + to DestroyWindow(). + + clientscr/ + screensaver_win.cpp + +Rom 9 Nov 2011 + - WINSCR: Sync up the timer IDs. + + clientscr/ + screensaver_win.cpp + +David 9 Nov 2011 + - server: more fixes to DB to handle unsigned result IDs + + db/ + boinc_db.cpp + +Jeff 9 Nov 2011 + - server: more fixes to DB to handle unsigned result IDs + + sched/ + feeder.cpp + sched_shmem.cpp + db_purge.cpp + sched_assign.cpp + lib/ + parse.cpp + +David 9 Nov 2011 + - OpenCL API: fix logic error + + api/ + boinc_opencl.cpp + +David 9 Nov 2011 + - OpenCL API: check return value from clGetDeviceIDs() + + api/ + boinc_opencl.cpp + +David 9 Nov 2011 + - scheduler: compute result.report_deadline BEFORE passing it + as an arg to update_wu_on_send() + + sched/ + sched_send.cpp + +Charlie 9 Nov 2011 + - WINSCR: Fix compile error. + + clientscr/ + screensaver_win.cpp + +Rom 10 Nov 2011 + - WINSCR: Attempt to gracefully shutdown a graphics application first + + clientscr/ + screensaver.cpp + +Rom 10 Nov 2011 + - client & lib: Update the OpenCL header to include calling conventions + and weak link information for Mac machines. + + lib/ + cl_boinc.h + +Rom 10 Nov 2011 + - Tag for 6.13.11 release, all platforms + boinc_core_release_6_13_11 + + / + configure.ac + version.h + +Charlie 9 Nov 2011 + - MGR: On Mac, work around bug in XCode 4.2 by accepting and ignoring + command line argument "-NSDocumentRevisionsDebugMode=YES" + - client: On Mac, work around bug in XCode 4.2 by accepting and ignoring + command line argument "-NSDocumentRevisionsDebugMode=YES" + (checked into 6.13.11 tag) + + client/ + cs_cmdline.cpp + clientgui/ + BOINCGUIApp.cpp + +Charlie 11 Nov 2011 + - Mgr: fix a bug deleting entries from Task Selection control which I + introduced on 9 November. Deleting an entry cvan create a gap in + the alphabetically sorted sequence, so we can't use my earlier + shortcut in checking for existing entries. + - Mgr: If a slide show has only one slide, load it only once. + + clientgui/ + sg_TaskPanel.cpp + +David 11 Nov 2011 + - client: check return value of FILE_REF when parse project file. + Fixes crashing bug. + + client/ + client_types.cpp + ssim/ + ssim.cpp + +Rom 11 Nov 2011 + - MGR: Update default skin to v4. + + clientgui/res/templates/ + + clientgui/skins/Default/ + background_image.png + skin.xml + workunit_running_image.png + workunit_suspended_image.png + workunit_waiting_image.png + +Rom 11 Nov 2011 + - Tag for 6.13.12 release, all platforms + boinc_core_release_6_13_12 + + / + configure.ac + version.h + +Charlie 11 Nov 2011 + - Mac installer: There can now be multiple instances of the Manager + running, so shut them all down. + + mac_installer/ + PostInstall.cpp + +David 13 Nov 2011 + - client/scheduler: + If the file "client_opaque.txt" exists on the client, + include its contents in scheduler request messages. + On the scheduler, parse this into SCHEDULER_REQUEST::client_opaque, + where it can be used by the customizable scheduler functions. + + sched/ + sched_types.cpp,h + client/ + file_names.h + cs_scheduler.cpp + +Charlie 14 Nov 2011 + - Mgr: Don't call Simple View specific periodic RPCs when BOINC is + hidden or minimized. + + clientgui/ + MainDocument.cpp + +David 14 Nov 2011 + - client: show error messages (as notices) when get an error + parsing cc_config.xml + - client: if an element in cc_config.xml + specifies a nonexistent app, show an error msg with + a list of existing app names + - web: increase the default mem limit from 64MB to 256MB + TODO: change user_hosts.php to show N at a time + + html/inc/ + util.inc + lib/ + cc_config.cpp,h + client/ + log_flags.cpp + +David 14 Nov 2011 + - client: improve messages for the above + + client/ + log_flags.cpp + +David 14 Nov 2011 + - scheduler: increase buffer for global prefs from 8K to 64K + - lay the groundwork for changing it to std::string + + sched/ + sched_types.cpp + lib/ + parse.cpp,h + +Charlie 14 Nov 2011 + - Mgr: In CSimpleTaskPanel, change name of Update() to UpdatePanel() + to fix compiler warning about overloading wxWindow::Update(). + + clientgui/ + sg_BoincSimpleFrame.cpp + sg_TaskPanel.cpp,.h + +Charlie 14 Nov 2011 + - MGR: Limit change of 9 November to only Debug builds: accept and + ignore command line argument "-NSDocumentRevisionsDebugMode=YES" + + clientgui/ + BOINCGUIApp.cpp + +David 14 Nov 2011 + - client: add some missing items to CONFIG::parse_options_client(). + + client/ + log_flags.cpp + pers_file_xfer.cpp + +Charlie 16 Nov 2011 + - MGR: use wxBitmapComboBox insert() and append() calls without + client data argument instead of passing NULL. + + clientgui/ + BOINCBitmapComboBox.cpp + +David 16 Nov 2011 + - web: in GPU model list page, + look for plan classes containing "nvidia" as well as "cuda". + + db/ + boinc_db.h + sched/ + transitioner.cpp + sched_assign.cpp + html/user/ + gpu_ratios.php (new) + gpu_list.php + client/ + net_stats.h + +David 16 Nov 2011 + - fix gpu_ratios.php + + html/user/ + gpu_ratios.php + +Charlie 17 Nov 2011 + Remove include of boinc_cl.h from parse.h; it is no longer needed. + Remove Mac Availability Macro and weak-link support from cl_boin.ch + as it prevented building BOINC libraries under OS 10.5. + + lib/ + cl_boinc.h + parse.h + +David 18 Nov 2011 + - storage simulator work + + lib/ + unix_util.cpp + ssim/ + des.h + ssim.cpp + +Charlie 19 Nov 2011 + - MGR: Fix button font sizes in Simple View Projects panel. + + clientgui/ + sg_ProjectPanel.cpp + +David 20 Nov 2011 + - client: on network_available() GUI RPC, + clear project-level upload and download backoffs, + as well as RPC and individual xfer backoffs. + This was an oversight. + + client/ + client_types.h + net_stats.cpp + ssim/ + ssim.cpp + makefile + +David 20 Nov 2011 + - web: add [sup] BBCode tag for superscripts. + - web: show BBCode info in the same page, rather than target=new. + On Firefox, this opens a new tab but doesn't switch to it, + which makes it look like nothing happened. + + html/ + inc/ + text_transform.inc + util.inc + user/ + bbcode.php + +Charlie 20 Nov 2011 + - MGR: Hide slideshow subpanel if no slides for current task. + + clientgui/ + sg_TaskPanel.cpp + +Charlie 21 Nov 2011 + - MGR: In Simple View, draw Mac progress bar on white background for + better visibility; adjust red New Notices ring for new button + shapes if on Mac OS 10.7. + + clientgui/ + sg_BoincSimpleFrame.cpp,.h + sg_PanelBase.cpp + sg_TaskPanel.cpp + +Rom 21 Nov 2011 + - MGR: const fixes for platform bitmaps. + (From: Steffen Möller) + - MGR: Add trace statements to help track down RemoveAt bug + - MGR: Remove static var guard, may not be needed with the SetDlgOpen() + routines blocking timer based updates. If there is a buffer overrun + hopefully it'll manifest itself in a detectable way. + + clientgui/res/ + linuxicon.xpm + macosicon.xpm + windowsicon.xpm + clientgui/ + sg_BoincSimpleFrame.cpp + sg_TaskPanel.cpp + +Rom 21 Nov 2011 + - MGR: Prevent crash, check returned pointer of menu entry. + + clientgui/ + sg_BoincSimpleFrame.cpp + +Rom 21 Nov 2011 + - MGR: Fix bad asserts. + + clientgui/ + BOINCBitmapComboBox.cpp + +Charlie 21 Nov 2011 + - MGR: Fix bad transparency in default project icon. + + clientgui/res/skins/default/graphic/ + project_image.xpm + +Charlie 21 Nov 2011 + - MGR: The asserts were correct; fix minor errors in calling code. + + clientgui/ + BOINCBitmapComboBox.cpp + sg_ProjectPanel.cpp + sg_TaskPanel.cpp + +David 21 Nov 2011 + - client emulator fixes + + client/ + work_fetch.h + sim.cpp + +Charlie 23 Nov 2011 + - MGR: In Simple View, if deleting a task above the current selection, + decrement the index of the current selection. + - MGR: In Simple View, reload slide show when task selection changed. + + clientgui/ + sg_TaskPanel.cpp,.h + +Charlie 23 Nov 2011 + - MGR: In Simple View, sort Project Selection Control; make sorting of + Project and Task Selection controls case-insensitive, fix bugs in + MacBitmapComboBox.cpp. + + clientgui/ + mac/ + MacBitmapComboBox.cpp + MacBitmapComboBox.cpp + sg_ProjectPanel.cpp + sg_TaskPanel.cpp + +David 24 Nov 2011 + - GUI RPC client lib: change setsockopt() for receive timeout + to work on Windows. From Fred. + + lib/ + gui_rpc_client.cpp + ssim/ + ssim.cpp + des.h + +David 24 Nov 2011 + - default screensaver: fix divide-by-zero; code cleanup + + clientsrc/ + ss_app.cpp + +David 25 Nov 2011 + - client: fix errors in transferring RAM info between CAL and OpenCL. + (bytes vs MB units, local/global terminology issue). + From Oliver Bock> + + client/ + coproc_detect.cpp + +Charlie 26 Nov 2011 + - default screensaver: fix build breaks caused by code cleanup above. + + clientsrc/ + ss_app.cpp + +David 26 Nov 2011 + - storage simulator work + + ssim/ + ssim.cpp + +Charlie 28 Nov 2011 + - MGR: In Simple View, if task has no slide show, then display the + institution, science area and description. + This is in progress: not yet finished. + + clientgui/ + Events.h + sg_PanelBase.cpp,.h + sg_TaskPanel.cpp,.h + +David 28 Nov 2011 + - scheduler: fix crashing bug (don't memset SCHED_REQUEST). + + sched/ + sched_result.cpp + handle_request.cpp + sched_types.cpp + ssim/ + ssim.cpp + +Charlie 29 Nov 2011 + - MGR: Continue work on Simple View to display the description if + task has no slide show. + Change all occurrences of "n" to "^n" + + clientgui/ + sg_TaskPanel.cpp,.h + +David 29 Nov 2011 + - wrapper: measure CPU time of app's process tree, + not just the top-level process + - wrapper: handle fraction-done files correctly + + lib/ + procinfo.cpp,h + samples/wrapper/ + wrapper.cpp + +Charlie 30 Nov 2011 + - MGR: Complete work on Simple View to display the description if + task has no slide show. + + clientgui/ + sg_TaskPanel.cpp,.h + +Charlie 30 Nov 2011 + - MGR: Better sizing of Simple View description text box. + + clientgui/ + sg_TaskPanel.cpp,.h + +David 1 Dec 2011 + - API and client: add "ncpus" field to APP_INIT_DATA. + Tells multicore apps how many cores to use. + The --nthreads command line arg to the app is now deprecated + though we'll keep it around for the time being. + + sched/ + sched_util.cpp,h + sched_customize.cpp,h + credit.cpp + html/user/ + show_user.php + lib/ + app_ipc.cpp,h + client/ + app_start.cpp + +Charlie 2 Dec 2011 + - Mac installer: revert to using a wrapper application around installer + package to require a system restart if creating users and groups. + + mac_build/ + boinc.xcodeproj/ + project.pbxproj + mac_installer/ + Installer.cpp + PostInstall.cpp + release_boinc.sh + +Charlie 2 Dec 2011 + - Mac installer: for files in projects and slots directories, if the + executable-by-owner permission is set, ensure that the + executable-by-group bit is also set. + + clientgui/ + mac/ + SetupSecurity.cpp + +David 2 Dec 2011 + - scheduler: in app_plan(), check for "opencl" before "ati". + Otherwise "opencl_ati" won't get handled right. + Fixes #1158 + + sched/ + sched_customize.cpp + +David 4 Dec 2011 + - client: isdigit() asserts if its arg is negative (which it can be). + Call isascii() first. + - GUI RPC lib: add some consts + + client/ + cs_notice.cpp + +Rom 5 Dec 2011 + - Bump the version number to the next developmental release cycle + 7.1.x + + / + configure.ac + version.h + +Rom 5 Dec 2011 + - MGR: Increase the opacity of the panels to make the black text more + readable. + + clientgui/skins/Default/ + skin.xml + +David 5 Dec 2011 + - client: when contacting a project for reasons other than + work fetch (e.g. to report completed jobs) + only request work if it's the project we would have chosen + if we were fetching work. + - client: the way in which project priorities were adjusted + in work fetch to reflected currently queued work was wrong. + - client: fix bug in the way project priorities are adjusted + in RR simulator + - client emulator: if there are results in the state file + with states DOWNLOADING or UPLOADING, + change them to DOWNLOADED or UPLOADED. + Otherwise they're stuck. + + client/ + work_fetch.cpp,h + sim.cpp + rr_sim.cpp + cs_scheduler.cpp + cpu_sched.cpp + ssim/ + des.h + ssim.cpp + +David 6 Dec 2011 + - client: compile fix; remove redundant total_peak_flops() + + client/ + work_fetch.cpp,h + cpu_sched.cpp + +Charlie 6 Dec 2011 + - MGR: eliminate "ghost" Notices window in Simple View when running + on Windows OS. + - MGR: don't show "indeterminate" progress bar in Simple View. + + clientgui/ + sg_DlgMessages.cpp + +Charlie 6 Dec 2011 + - MGR: don't show "indeterminate" progress bar in Simple View. + + clientgui/ + Events.h + sg_PanelBase.cpp,.h + sg_TaskPanel.cpp,.h + +David 6 Dec 2011 + - client: if a file download was in progress at the time of + an upgrade from 6.12 to 6.13+, + it could get erroneously marked as an upload and get stuck forever. + Problem: uninitialized member. + + client/ + pers_file_xfer.cpp + +Rom 6 Dec 2011 + - MGR: Scale the task pane in the advanced view to encompass the largest button. + + clientgui/ + BOINCBaseView.cpp, .h + BOINCTaskCtrl.cpp + stdwx.h + ViewNotices.cpp + ViewResources.cpp + ViewStatistics.cpp + +David 6 Dec 2011 + - scheduler: encode CAL version numbers in a way that handles + release #s > 1000 + + sched/ + sched_customize.cpp + lib/ + coproc.cpp,h + +Charlie 7 Dec 2011 + - Mac installer: eliminate use of WaitPermissions.app. + - Mac installer: revert branded build scripts for wrapper application + around installer package. + + mac_installer/ + make_CharityEngine.sh + make_GridRepublic.sh + make_ProgThruProc.sh + PostInstall.cpp + release_boinc.sh + +Rom 9 Dec 2011 + - VBOX: Remove unused function, + I don't remember what I was going to use that hook for. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + +Rom 9 Dec 2011 + - VBOX: Remove the guru meditation state, + apparently that is when the vbox host process for the vm crashes. + + samples/vboxwrapper/ + vbox.cpp + +Rom 9 Dec 2011 + - VBOX: Add the ability for the wrapper to know if vboxmanage has hung + or is stuck in a loop. + If so, terminate the process and return an error. + + samples/vboxwrapper/ + vbox.cpp + +Rom 9 Dec 2011 + - MGR: Update Progress Through Processor's skin files. + + clientgui/res/ + progress.ico + clientgui/skins/Progress Thru Processors/graphic + + clientgui/skins/Progress Thru Processors/ + skin.xml + win_build/installerv2/redist/Progress/ + ptp_IsDialogBanner.bmp + ptp_IsDialogBitmap.bmp + ptp_splash.bmp + ptp_Wizard.bmp + +David 10 Dec 2011 + - bug fixes in remote job submission tools + (manage_privileges and get_output.php). + From Nico Schlitter. + - change things so that + make_project --test_app + will produce input/output templates that are compatible + with the remote job submission tools + + tools/ + example_app_in,out (removed .xml from name) + manage_privileges + make_project + html/user/ + get_output.php + ssim/ + ssim.cpp + +David 12 Dec 2011 + - client: tweak parameters of file xfer backoff to + reduce backoff intervals somewhat + - vboxwrapper: fix buffer size typo (from Attila) + - scheduler: fix crash if using homogeneous app version, + and a WU is committed to an old or deprecated app version. + From Kevin Reed. + + sched/ + sched_version.cpp + samples/vboxwrapper/ + vboxwrapper.cpp + ssim/ + ssim.cpp + client/ + pers_file_xfer.h + +David 12 Dec 2011 + - scheduler: if using homogeneous app version, + and a WU is committed to an app version that's been superceded, + treat it as committed to the later version. + + sched/ + sched_shmem.cpp,h + sched_version.cpp + +Rom 12 Dec 2011 + - MGR: Add IE8-10 support for browser cookies when UAC is enabled. Use the + supported API. It appears MS changed the cookie file format in their + latest browsers which broke our hack. I have to leave the hack in + for now because IE7 on Vista didn't expose the IEGetProtectedModeCookie + API. + - WINSETUP: Start BOINCMgr as a restricted process on Windows Vista+. + + clientgui/ + browser.cpp + win_build/installerv2/redist/Windows/src/boinccas/ + boinccas.vcproj + CALaunchBOINCManager.cpp, .h + win_build/installerv2/redist/Windows/Win32/ + boinccas.dll + boinccas95.dll + win_build/installerv2/redist/Windows/x64/ + boinccas.dll + boinccas95.dll + +Charlie 12 Dec 2011 + - MGR: If CSkinIcon PNG file has an alpha channel, use it as mask and + ignore any tag. + + clientgui/ + SkinManager.cpp + +David 13 Dec 2011 + - storage simulator: use a top-down approach to recovery policy. + As of right now, it seems to work. + Need to add statistics for network load and fault-tolerance level. + + ssim/ + ssim.cpp + +Charlie 14 Dec 2011 + - MGR: Check in remaining Progress Through Processors artwork for Macintosh. + - MGR: Fix Progress Through Processors skin file problems for Macintosh: + - If a PNG icon file has an alpha channel, the skin must not have a + entry for it, or the alpha channel will be + ignored. + - The (play), and + must all be the same size. + + clientgui/mac/ + ProgThruProc.tiff + clientgui/res/ + ProgThruProc.icns + PTP_install.icns + PTP_uninstall.icns + clientgui/skins/Progress Thru Processors/ + skin.xml + clientgui/skins/Progress Thru Processors/graphic + ptp_play.png + ptp_icon_play.png + clientscr/res/ + ProgThruProc_ss_logo.png + +Charlie 14 Dec 2011 + - Mac installer: update build scripts for naming consistency with other platforms. + + mac_installer/ + make_CharityEngine.sh + make_ProgThruProc.sh + +Charlie 16 Dec 2011 + - MGR: in Simple View, localize institution, science area and description. + + clientgui/ + BOINCGUIApp.cpp + sg_TaskPanel.cpp + +David 16 Dec 2011 + - web: clean up the logic for when to allow 2 hosts to be merged + + html/inc/ + host.inc + +David 16 Dec 2011 + - storage simulator: add stats for network load and fault tolerance. + - client: msg tweak + - client: minimum work buffer lower bound is 180 sec + - scheduler: in computing HOST_USAGE::project_flops for a job, + if we don't have sufficient elapsed_time statistics + for either the (host, app_version) or the app_version, + use a conservative estimate (p_fpops*(#cpus+#ngpus)) + rather than the number returned by app_plan(). + This avoids "time limit exceeded" errors when the latter is way off. + + ssim/ + ssim.cpp + des.h + client/ + scheduler_op.cpp + client_state.h + sched/ + sched_version.cpp + lib/ + prefs.cpp + +David 16 Dec 2011 + - client: if we're trying to upload a file and it's missing, + that's a permanent error + + client/ + pers_file_xfer.cpp + file_xfer.cpp + +Rom 17 Dec 2011 + - VBOX: Attempt to detect the condition where a Virtual HD image has already been + registered with VirtualBox during the RegisterVM phase. If we detect the + already exists error message run the unsupported internal command to reset + the HD UUID which then allows us to attach the HD to the VM. This should allow + us to run multiple jobs with the same base VM HD image. + + samples/vboxwrapper/ + vbox.cpp + +David 17 Dec 2011 + - scheduler: if using homogeneous app version and a WU is committed + to a superceded or deprecated app version, use it anyway. + The current app version may not validate against the old one. + + sched/ + sched_types.h + sched_version.cpp + +David 19 Dec 2011 + - vboxwrapper: if shared dir is specified and it doesn't exist on startup, + that's not necessarily an error. + Try to create it. + If it exists and is a file, show appropriate error message. + + samples/vboxwrapper/ + vboxwrapper.cpp + +Rom 19 Dec 2011 + - VBOX: Use the same mechanism as the multi-threaded apps to determine desired CPU + count for the VM. VM(s) can now be multi-core. + + samples/vboxwrapper/ + vboxwrapper.cpp + vbox.cpp, .h + +Rom 19 Dec 2011 + - WINSETUP: Copy the explorer primary token to get processes launched by the setup + process to launch with reduced permissions. + + win_build/installerv2/redist/Windows/src/boinccas/ + boinccas.vcproj + CALaunchBOINCManager.cpp + launcher.cpp, .h + win_build/installerv2/redist/Windows/Win32/ + boinccas.dll + boinccas95.dll + win_build/installerv2/redist/Windows/x64/ + boinccas.dll + boinccas95.dll + +Rom 19 Dec 2011 + - MGR: Partial fix for wizard problem when a client automatically attempts to attach + to an account manager via cookies. This fix is good enough for the 6.8 client. + We'll need to do a little more for 7.x and beyond. + + clientgui/ + WizardAttach.cpp + +Charlie 20 Dec 2011 + - MGR: Continue partial fix for wizard problem when a client automatically attempts + to attach to an account manager via cookies. We'll still need to do a little + more for 7.x and beyond. + + clientgui/ + AccountmanagerPropertiesPage.cpp + WizardAttachProject.cpp + +Rom 20 Dec 2011 + - VBOX: Implement CERN's FloppyIO IPC technology for the VirtualBox wrapper. + + samples/vboxwrapper/ + floppyio.cpp, .h + vbox.cpp, .h + vboxwrapper.cpp + win_build/ + vboxwrapper.vcproj + +Rom 20 Dec 2011 + - VBOX: Create a configuration item that specifies the maximum amount of + wall clock time a VM is allowed, if exceeded shutdown gracefully and tell + BOINC that the job is finished. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + +David 20 Dec 2011 + - scheduler: if an app has only GPU versions, + scale their PFC by 0.1 in credit calculations. + This reflects the fact that GPU apps are typically less efficient + (relative to device peak FLOPS) than are CPU apps. + The actual values from SETI@home and Milkyway are 0.05 and 0.08. + + sched/ + credit.cpp + +Rom 20 Dec 2011 + - VBOX: Implement a basic mechanism for port forwarding through to the VM. + Some more work will be required if there is ever a need for more than + one port. But this should work for now. This should successfully + handle running multiple instances of the same job, port information is + stored in a file called "vbox_firewall.txt" which is updated for each + execution of the wrapper. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + win_build/ + vboxwrapper.vcproj + +Charlie 21 Dec 2011 + - MGR: Display project descriptions in Attach Wizard using wxTextCtrl + instead of wxHtmlWindow to support screen readers for accessibility, + after converting all occurrences of "n" to "^n". + Show localized project descriptions in Attach Wizard. + + clientgui/ + ProjectInfoPage.cpp,.h + +Charlie 21 Dec 2011 + - MGR: Fix horizontal sizing of text in Simple View project description. + + clientgui/ + sg_TaskPanel.cpp,.h + +Rom 21 Dec 2011 + - VBOX: Create the FloppyIO image via the FloppyIO constructor before attempting + to link the VM to it. + + samples/vboxwrapper/ + floppyio.cpp + vbox.cpp + +David 21 Dec 2011 + - web: combine ops and regular functions for displaying + various result attributes as strings + + html/ + ops/ + db_action.php + inc/ + result.inc + db_ops.inc + +Rom 21 Dec 2011 + - VBOX: Don't log all vbm_popen errors, we expect certain commands to fail when we + are looking at the existing state of the host. + - VBOX: Reset the output buffer for every command execution. + - VBOX: Remove the teleporting and snapshotting states from the list of running + states. + - VBOX: Remove the '--type floppy' typo when mounting the floppy disk image. + + samples/vboxwrapper/ + vbox.cpp, .h + +Rom 21 Dec 2011 + - VBOX: If vm.run() fails, call vm.cleanup() to unregister the VM before exiting + vboxwrapper. Not doing so leaves the drive reference around and the VM in a + saved state. The next attempt to delete it from another instance of + vboxwrapper fails with a complaint about the old unnamed vm(all files have + been cleaned up by BOINC) being in an non-mutable state. + + samples/vboxwrapper/ + vbox.cpp + vboxwrapper.cpp + +Rom 21 Dec 2011 + - VBOX: If vm.cleanup() can be called when a VM hasn't been fully initialized, + then all the deregister commands have to be optional. Go ahead and log errors + to stderr but continue to run through the various commands anyway. + + samples/vboxwrapper/ + vbox.cpp + +Rom 21 Dec 2011 + - VBOX: If vm.run() fails, it turns out the VM is parked in some kind of saved + state, deregistering the VM would fail all commands because the VM was not + mutable. The first thing we should do when deregistering is discard + any saved state. + + samples/vboxwrapper/ + vbox.cpp + +Rom 21 Dec 2011 + - VBOX: It turns out that once you set the firewall rules, you cannot reset the + rules for a VM until the VM is in a powered off state. I guess the VM will + just have to fail starting up if it cannot allocate the assigned port. + + samples/vboxwrapper/ + vbox.cpp + +Charlie 21 Dec 2011 + - VBOX: Update XCode project for OS 10.7 and XCode 4.2.1. + + samples/vboxwrapper/ + vboxwrapper.xcodeproj + project.pbxproj + +Rom 21 Dec 2011 + - VBOX: Add missing code for progress complete and check-pointing. + + samples/vboxwrapper/ + vboxwrapper.cpp + +Rom 22 Dec 2011 + - VBOX: Try a new approach to dealing with the Windows sandbox issue. Under Windows + VboxSVC.exe is normally launched by svchost.exe which only contains environment + variables defined by the system. In the BOINC sandbox environment we want to + add VBOX_USER_HOME to redirect reading/writing configuration files to a + different directory. What happens if we launch it ahead of making any calls to + VBoxManage which would cause the OS to launch it? If we launch it, it should + inherit our environment block and work just like it works on Linux and the Mac. + + This is such a simple solution, why didn't I think of it sooner? + + samples/vboxwrapper/ + vbox.cpp + +Rom 22 Dec 2011 + - VBOX: Remove code that was meant to force the CC to reschedule jobs. There was + a bug that was fixed last night which prevented the wrapper from properly + reporting its checkpoint time to the CC. The lack of checkpoint information + for the job would have prevented the CC from rescheduling the job and removing + it from memory. Now it can so the extra shutdown each scheduling period + should not be needed. + + samples/vboxwrapper/ + vboxwrapper.cpp + +Rom 23 Dec 2011 + - VBOX: Write the firewall rules once, after creation. If the job was suspended + and restarted it would null out the host port information. + - VBOX: Try to make the CERN compatible datatype for FloppyIO more JSON friendly + by following the advice of issue: + https://github.com/stig/json-framework/issues/48 + - VBOX: Support both the old style and new style of determining assigned threads + of execution (aka core counts). 6.12 and the early versions of 7.x support + the old style. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp, .h + +Rom 23 Dec 2011 + - VBOX: Append the slot number to the end of the floppy disk image name like we do + for virtual hard disks. + - VBOX: Execute closemedium against the virtual floppy disks when the VM is being + deleted. + + samples/vboxwrapper/ + vbox.cpp + vboxwrapper.cpp + +Rom 23 Dec 2011 + - VBOX: handle the case where the volunteer has not installed BOINC in the sandboxed + environment and they suspend/resume the VM by the VirtualBox application. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp + +Rom 23 Dec 2011 + - VBOX: Rework the unique naming scheme for floppys and disk images so that the slot + id is appended after the name instead of after the extension. Avoid problems + with the VirtualBox interface. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp, .h + +Charlie 23 Dec 2011 + - VBOX: Fix "unused variable" warning. + + samples/vboxwrapper/ + vboxwrapper.cpp + +Rom 23 Dec 2011 + - Web: Don't display VirtualBox version number information in the coproc field while + displaying host information. + + html/inc/ + host.inc + +David 23 Dec 2011 + - make_project: don't try to copy nonexistent file; fixes #1166 + - scheduler: change Vbox app plan function to accommodate + single and multithreaded variants + + py/Boinc/ + setup_project.py + sched/ + sched_customize.cpp + +David 23 Dec 2011 + - web: show actual URL and weak auth on weak auth page + - web: make merge and pending pages translatable + From Uwe Becker + + html/user/ + weak_auth.php + merge_by_name.php + pending.php + +David 23 Dec 2011 + - web: more translatability. From Uwe Becker. + + html/ + inc/ + pm.inc + forum.inc + bbcode_html.inc + user/ + pm.php + moderation.php + +Rom 24 Dec 2011 + - VBOX: Remove attempts to remove the floppy image from the media registry. + Apparently when the VM is removed from the VirtualBox server process + it automatically deletes the floppy image from the media registry. + - VBOX: If a VM crashes for one reason or another, append the VM execution + log file to the stderr.txt file. I believe this is what is going on with + Richard Mitnick's computer. At the very least we should be able to give + this to the VirtualBox guys. + - VBOX: Introduce a way to re-execute commands when a session lock + event is detected. A session lock event happens when a volunteer is + tweaking something about the VM while vboxwrapper is attempting to query + state information. + + samples/vboxwrapper/ + vbox.cpp, .h + vboxwrapper.cpp, .h + +Rom 25 Dec 2011 + - VBOX: If an error occurs only log the error once if log_error is true. + + samples/vboxwrapper/ + vbox.cpp, .h + +David 25 Dec 2011 + - vboxwrapper: for port-forwarding feature, + allow specification of guest port only. + Change tag to . + Separate getting port from registering firewall rule + + samples/vboxwrapper/ + vbox.cpp,h + vboxwrapper.cpp + +Rom 25 Dec 2011 + - VBOX: Extract and dump the VM log before attempting to delete the VM. + What was I thinking last night? + + samples/vboxwrapper/ + vboxwrapper.cpp + +Rom 25 Dec 2011 + - VBOX: Richard Mitnick's VM didn't crash according to the latest build. + So what state did it enter? + + samples/vboxwrapper/ + vbox.cpp,.h + +Rom 25 Dec 2011 + - VBOX: For projects that use vboxwrapper to control how long a VM should run, + treat premature shutdown events as failures. Avoids false positive results. + - VBOX: Log the VM Execution log if a premature shutdown event has happened. + - VBOX: Rename config option max_elapsed_time to job_duration. Choosing + max_elapsed_time turned out to be a bad choice in that its purpose + became intermixed with the credit issue(s). + + samples/vboxwrapper/ + vbox.cpp,.h + vboxwrapper.cpp + +Rom 25 Dec 2011 + - VBOX: Disable hardware virtualization acceleration support by default. There + is a ceratin class of machines where the processor supports hardware + acceleration but it is disabled in the computers BIOS. Asking the volunteer + to tweak settings in the computers BIOS isn't a good idea. We might be able + to turn it on as an advanced preference thing in the future. + + samples/vboxwrapper/ + vbox.cpp + vboxwrapper.cpp + +David 26 Dec 2011 + - API/client/manager: + allow applications to supply a "web graphics URL", + in which case the manager's "Show Graphics" button + opens a browser at that URL. + This typically would used for applications that + implement a web server that serves pages showing + job information in HTML. + - vboxwrapper: if is specified in the config file, + set up port forwarding to that port + and use the above API call with URL "http://localhost:port" + + samples/ + vboxwrapper/ + vbox.cpp + vboxwrapper.cpp + api/ + boinc_api.cpp,h + +David 26 Dec 2011 + - add support for APP::needs_network flag. + If set, don't run jobs for that app while network is suspended. + - client: parse this flag and maintain in state file; + do a job reschedule when network suspend state changes + - GUI RPC: add RESULT::network_wait flag; + if set, this job is waiting for network access to be allowed + - Manager: display the above in task info + - add support for "web graphics URL" (see above) + - client: parse message containing URL on graphics_reply channel + and store in ACTIVE_TASK::web_graphics_url + - GUI RPC: add RESULT::web_graphics_url + - Manager: if web graphics URL is present, Show Graphics opens a browser + - remove some vestigial code for pre-V6 graphics + + client/ + app.cpp,h + app_control.cpp + client_state.cpp + client_types.cpp,h + work_fetch.cpp + clientgui; + MainDocument.cpp + sg_TaskCommandPopup.cpp + ViewWork.cpp + lib/ + gui_rpc_client.h + gui_rpc_client_ops.cpp + +David 26 Dec 2011 + - make "needs network" a property of APP_VERSION rather than APP + + client/ + client_types.cpp,h + work_fetch.cpp + app_control.cpp + +David 26 Dec 2011 + - update_versions: support flag in version.xml + + tools/ + update_versions + samples/vboxwrapper/ + vboxwrapper.h + +David 26 Dec 2011 + - scheduler: in vbox plan class, require that host have + VM acceleration hardware feature + - remote job submission: typo fix + + sched/ + sched_customize.cpp + html/user/ + submit.php + +Rom 26 Dec 2011 + - scheduler: in vbox plan class, require that host have + VM acceleration hardware feature if the job is multi-core. + + sched/ + sched_customize.cpp + +Rom 26 Dec 2011 + - VBOX: If a host has been assigned a single-core job and the + processor doesn't support hardware acceleration for VMs, + manually turn off the hardware acceleration support in the VMs + configuration. + + NOTE: The latest server scheduler should not be assigning + multi-core jobs to hosts that do not have hardware acceleration. + + samples/vboxwrapper/ + vbox.cpp + +David 26 Dec 2011 + - scheduler: we were using CPU time for elapsed time + when the latter wasn't reported. + Do this BEFORE sanity checks on elapsed time + to prevent cheating. + + sched/ + sched_result.cpp + +Rom 26 Dec 2011 + - VBOX: For hosts who do not have processors with VM extensions try + and disable the use of them at VM creation time. Certain actions + within VirtualBox will force enabling them at runtime and cause + an error (like SMP support) but it should reduce confusion between + volunteers and projects when a VM configuration change now causes + a class of machine that used to work suddenly stop working. + - VBOX: Add some more helpful text notes for error conditions that + the volunteer might be able to address. For instance other + hypervisors locking the VM CPU features for exclusive use. + - VBOX: If we have to dump out the VM execution log on Windows, remove + excess carriage returns from the spew. + + samples/vboxwrapper/ + vbox.cpp + vboxwrapper.cpp + +David 26 Dec 2011 + - scheduler, vbox plan class function: + send only 32/64 bit version to 32/64 bit host + + sched/ + sched_customize.cpp + +Rom 27 Dec 2011 + - SCR: Remove last linger pieces of v5 backward graphics compatibility + from the screensaver. + + clientscr/ + screensaver.cpp + screensaver_win.h + +David 28 Dec 2011 + - client: detect Windows HyperV Server 2008 R2 (from Crashtest) + + client/ + hostinfo_win.cpp + +Rom 28 Dec 2011 + - client: increase the buffer sizes for retrieving cpu features on *nix + type systems. the latest generation of processors blow past 256 bytes + and vmx and svm are truncated. + + client/ + hostinfo_unix.cpp + +David 28 Dec 2011 + - client: shuffle disk usage code in preparation for disk accounting + - use new XML parser in some GUI RPC code + + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h + client/ + client_types.h + client_state.h + gui_rpc_server_ops.cpp + cs_prefs.cpp + cs_scheduler.cpp + +Rom 28 Dec 2011 + - WINSETUP: Introduce new BOINC setup packages which include VirtualBox. + + win_build/installerv2/ + BOINC_vbox.ism + BOINCx64_vbox.ism + +David 29 Dec 2011 + - scheduler: record Vbox version correctly in host records + - remote job submission: partial checkin for new file sandbox stuff + + sched/ + handle_request.cpp + html/ + inc/ + submit.inc + submit_util.inc + user/ + submit_example.php + submit.php + +Rom 29 Dec 2011 + - VBOX: Add ERR_CPU_VM_EXTENSIONS_DISABLED string to the error case where + the VM extensions for the CPU have been disabled via the BIOS. This + allows the core-client to parse the response and disable future + request for multi-core VM jobs. + + samples/vboxwrapper/ + vboxwrapper.cpp + +David 30 Dec 2011 + - client: parse APP:non_cpu_intensive correctly. + This got broken somehow. + - client: don't crash if missing RSS feed file for some reason + + client/ + client_types.cpp + cs_notice.cpp + +David 30 Dec 2011 + - client: for VBox apps, check stderr for "ERR_CPU_VM_EXTENSIONS_DISABLED". + If found, set HOST_INFO::p_vm_extensions_disabled, + and pass this to the scheduler. + - scheduler (VBox app plan function) if a host has p_vm_extensions_disabled + set, don't sent it multicore VBox jobs. + + Note: if you have a host with VM extensions, and they're disabled + in the BIOS, and you enable them, you can remove the + line from client_state.xml + and you'll be eligible to get multicore VM jobs again. + + client/ + app_control.cpp + lib/ + hostinfo.cpp,h + sched/ + sched_types.cpp + sched_customize.cpp + db/ + boinc_db.h + +Rom 30 Dec 2011 + - client: the processor features buffer is supposed to be 1024 bytes. avoid + truncation. + + lib/ + hostinfo.cpp + +Rom 30 Dec 2011 + - WINSETUP: Give 'boinc_admins' and 'boinc_projects' the ability to access and + launch the VirtualBox server-side application. This should complete the + needed work to run VirtualBox within the Windows sandboxed environment. + - WINSETUP: Remove the virtualized file system tag from the Windows Explorer + copied security token when launching BOINC Manager and BOINC Tray after + setup has completed. I believe this will resolve the new cookie issue + experienced by PTP/GR/CE. + + win_build/installerv2/redist/Windows/src/boinccas/ + aclmgmt.cpp + boinccas.def + boinccas.vcproj + CAGrantBOINCAdminsVirtualBoxRights.cpp, .h + CAGrantBOINCProjectsVirtualBoxRights.cpp, .h + CALaunchBOINCTray.cpp, .h + dcomperm.h + launcher.cpp + listacl.cpp + sdmgmt.cpp + srvcmgmt.cpp + utils.cpp + wrappers.cpp + win_build/installerv2/redist/Windows/Win32/ + boinccas.dll + boinccas95.dll + win_build/installerv2/redist/Windows/x64/ + boinccas.dll + boinccas95.dll + +Rom 30 Dec 2011 + - WINSETUP: Hookup new custom actions to the BOINC Installers + + win_build/installerv2/ + BOINC.ism + BOINCx64.ism + +David 31 Dec 2011 + - web: implement file sandbox for remote job submission + + html/ + inc/ + sandbox.inc (new) + user/ + submit.php + sandbox.php (new) + +David 31 Dec 2011 + - web: add script for submission of batches of LAMMPS jobs + + html/user/ + lammps.php + +David 31 Dec 2011 + - web: new page to manage job submission + + html/ + inc/ + submit.inc + submit_util.inc + user/ + submit_rpc_handler.php + submit_example.php diff -Nru boinc-7.0.7+dfsg/client/acct_setup.cpp boinc-7.0.14+dfsg/client/acct_setup.cpp --- boinc-7.0.7+dfsg/client/acct_setup.cpp 2011-08-27 18:32:47.000000000 +0000 +++ boinc-7.0.14+dfsg/client/acct_setup.cpp 2012-01-26 08:39:51.000000000 +0000 @@ -48,28 +48,26 @@ } int PROJECT_INIT::init() { - char buf[256]; - MIOFILE mf; - FILE* p; - clear(); - p = fopen(PROJECT_INIT_FILENAME, "r"); - if (p) { - mf.init_file(p); - while(mf.fgets(buf, sizeof(buf))) { - if (match_tag(buf, "")) break; - else if (parse_str(buf, "", name, 256)) continue; - else if (parse_str(buf, "", team_name, 256)) continue; - else if (parse_str(buf, "", url, 256)) { - canonicalize_master_url(url); - continue; - } else if (parse_str(buf, "", account_key, 256)) { - continue; - } + FILE* f = fopen(PROJECT_INIT_FILENAME, "r"); + if (!f) return 0; + + MIOFILE mf; + mf.init_file(f); + XML_PARSER xp(&mf); + while (!xp.get_tag()) { + if (xp.match_tag("/project_init")) break; + else if (xp.parse_str("name", name, 256)) continue; + else if (xp.parse_str("team_name", team_name, 256)) continue; + else if (xp.parse_str("url", url, 256)) { + canonicalize_master_url(url); + continue; + } else if (xp.parse_str("account_key", account_key, 256)) { + continue; } - fclose(p); - msg_printf(0, MSG_INFO, "Found project_init.xml for %s", url); } + fclose(f); + msg_printf(0, MSG_INFO, "Found project_init.xml for %s", url); return 0; } diff -Nru boinc-7.0.7+dfsg/client/app_control.cpp boinc-7.0.14+dfsg/client/app_control.cpp --- boinc-7.0.7+dfsg/client/app_control.cpp 2011-12-30 17:36:11.000000000 +0000 +++ boinc-7.0.14+dfsg/client/app_control.cpp 2012-01-13 19:00:16.000000000 +0000 @@ -1205,7 +1205,14 @@ if (!app_client_shm.shm) return; if (app_client_shm.shm->graphics_reply.get_msg(msg_buf)) { + if (log_flags.app_msg_receive) { + msg_printf(this->wup->project, MSG_INFO, + "[app_msg_receive] got msg from slot %d: %s", slot, msg_buf + ); + } + parse_str(msg_buf, "", web_graphics_url, sizeof(web_graphics_url)); + parse_str(msg_buf, "", remote_desktop_addr, sizeof(remote_desktop_addr)); } } diff -Nru boinc-7.0.7+dfsg/client/app.cpp boinc-7.0.14+dfsg/client/app.cpp --- boinc-7.0.7+dfsg/client/app.cpp 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/client/app.cpp 2012-01-13 19:00:16.000000000 +0000 @@ -121,6 +121,7 @@ overdue_checkpoint = false; last_deadline_miss_time = 0; strcpy(web_graphics_url, ""); + strcpy(remote_desktop_addr, ""); } // preempt this task; @@ -593,6 +594,12 @@ web_graphics_url ); } + if (strlen(remote_desktop_addr)) { + fout.printf( + " %s\n", + remote_desktop_addr + ); + } fout.printf("\n"); return 0; } diff -Nru boinc-7.0.7+dfsg/client/app.h boinc-7.0.14+dfsg/client/app.h --- boinc-7.0.7+dfsg/client/app.h 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/client/app.h 2012-01-13 19:00:16.000000000 +0000 @@ -151,6 +151,7 @@ // (e.g. VMs created by vboxwrapper) // These are communicated via the app_status message channel char web_graphics_url[256]; + char remote_desktop_addr[256]; void set_task_state(int, const char*); inline int task_state() { diff -Nru boinc-7.0.7+dfsg/client/app_start.cpp boinc-7.0.14+dfsg/client/app_start.cpp --- boinc-7.0.7+dfsg/client/app_start.cpp 2011-12-14 16:41:22.000000000 +0000 +++ boinc-7.0.14+dfsg/client/app_start.cpp 2012-01-20 13:30:47.000000000 +0000 @@ -251,9 +251,12 @@ k = 0; } aid.gpu_device_num = cp.device_nums[k]; + aid.gpu_opencl_dev_index = cp.opencl_device_indexes[k]; } else { strcpy(aid.gpu_type, ""); aid.gpu_device_num = -1; + aid.gpu_opencl_dev_index = -1; + } aid.ncpus = app_version->avg_ncpus; aid.checkpoint_period = gstate.global_prefs.disk_interval; @@ -501,6 +504,9 @@ graphics_request_queue.init(result->name); // reset message queues process_control_queue.init(result->name); + bytes_sent = 0; + bytes_received = 0; + if (!app_client_shm.shm) { retval = get_shmem_seg_name(); if (retval) { diff -Nru boinc-7.0.7+dfsg/client/check_security.cpp boinc-7.0.14+dfsg/client/check_security.cpp --- boinc-7.0.7+dfsg/client/check_security.cpp 2011-03-24 09:32:02.000000000 +0000 +++ boinc-7.0.14+dfsg/client/check_security.cpp 2012-01-24 02:54:21.000000000 +0000 @@ -39,7 +39,10 @@ bool IsUserInGroupBM(); #endif -static int CheckNestedDirectories(char * basepath, int depth, int use_sandbox, int isManager); +static int CheckNestedDirectories(char * basepath, int depth, + int use_sandbox, int isManager, + char * path_to_error + ); #if (! defined(__WXMAC__) && ! defined(_MAC_INSTALLER)) static char * PersistentFGets(char *buf, size_t buflen, FILE *f); @@ -66,7 +69,7 @@ #ifdef _MAC_INSTALLER char *bundlePath, char *dataPath, #endif -int use_sandbox, int isManager +int use_sandbox, int isManager, char* path_to_error ) { passwd *pw; group *grp; @@ -358,7 +361,7 @@ return -1026; // Step through project directories - retval = CheckNestedDirectories(full_path, 1, use_sandbox, isManager); + retval = CheckNestedDirectories(full_path, 1, use_sandbox, isManager, path_to_error); if (retval) return retval; } @@ -380,7 +383,7 @@ return -1029; // Step through slot directories - retval = CheckNestedDirectories(full_path, 1, use_sandbox, isManager); + retval = CheckNestedDirectories(full_path, 1, use_sandbox, isManager, path_to_error); if (retval) return retval; } @@ -497,7 +500,10 @@ } -static int CheckNestedDirectories(char * basepath, int depth, int use_sandbox, int isManager) { +static int CheckNestedDirectories(char * basepath, int depth, + int use_sandbox, int isManager, + char * path_to_error + ) { int isDirectory; char full_path[MAXPATHLEN]; struct stat sbuf; @@ -508,9 +514,9 @@ dirp = opendir(basepath); if (dirp == NULL) // Should never happen - return -1200; + retval = -1200; - while (true) { + while (dirp) { // Skip this if dirp == NULL, else loop until break dp = readdir(dirp); if (dp == NULL) break; // End of list @@ -583,7 +589,7 @@ if ((! isManager) && (sbuf.st_uid != boinc_master_uid)) continue; // Client can't check subdirectories owned by boinc_project } - retval = CheckNestedDirectories(full_path, depth + 1, use_sandbox, isManager); + retval = CheckNestedDirectories(full_path, depth + 1, use_sandbox, isManager, path_to_error); if (retval) break; } @@ -594,6 +600,7 @@ if (retval && !errShown) { fprintf(stderr, "Permissions error %d at %s\n", retval, full_path); + if (path_to_error) strcpy(path_to_error, full_path); errShown = 1; } return retval; diff -Nru boinc-7.0.7+dfsg/client/client_state.cpp boinc-7.0.14+dfsg/client/client_state.cpp --- boinc-7.0.7+dfsg/client/client_state.cpp 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/client/client_state.cpp 2012-01-20 13:28:00.000000000 +0000 @@ -408,7 +408,7 @@ for (int j=1; jgzipped_urls; while (!xp.get_tag()) { if (xp.match_tag("/file_info") || xp.match_tag("/file")) { if (!strlen(name)) return ERR_BAD_FILENAME; if (strstr(name, "..")) return ERR_BAD_FILENAME; if (strstr(name, "%")) return ERR_BAD_FILENAME; + if (gzipped_urls.size() > 0) { + download_urls.clear(); + download_urls.urls = gzipped_urls; + download_gzipped = true; + } return 0; } if (xp.match_tag("xml_signature")) { @@ -979,14 +988,20 @@ upload_urls.urls.push_back(url); continue; } + if (xp.parse_string("gzipped_url", url)) { + gzipped_urls.push_back(url); + continue; + } if (xp.parse_str("md5_cksum", md5_cksum, sizeof(md5_cksum))) continue; if (xp.parse_double("nbytes", nbytes)) continue; + if (xp.parse_double("gzipped_nbytes", gzipped_nbytes)) continue; if (xp.parse_double("max_nbytes", max_nbytes)) continue; if (xp.parse_int("status", status)) continue; if (xp.parse_bool("executable", executable)) continue; if (xp.parse_bool("uploaded", uploaded)) continue; if (xp.parse_bool("sticky", sticky)) continue; if (xp.parse_bool("gzip_when_done", gzip_when_done)) continue; + if (xp.parse_bool("download_gzipped", download_gzipped)) continue; if (xp.parse_bool("signature_required", signature_required)) continue; if (xp.parse_bool("is_project_file", is_project_file)) continue; if (xp.parse_bool("no_delete", btemp)) continue; @@ -1061,6 +1076,10 @@ if (uploaded) out.printf(" \n"); if (sticky) out.printf(" \n"); if (gzip_when_done) out.printf(" \n"); + if (download_gzipped) { + out.printf(" \n"); + out.printf(" %.0f\n", gzipped_nbytes); + } if (signature_required) out.printf(" \n"); if (is_user_file) out.printf(" \n"); if (strlen(file_signature)) out.printf(" \n%s\n\n", file_signature); @@ -1111,7 +1130,7 @@ project->master_url, project->project_name, name, - nbytes, + download_gzipped?gzipped_nbytes:nbytes, max_nbytes, status ); @@ -1135,6 +1154,15 @@ get_pathname(this, path, sizeof(path)); int retval = delete_project_owned_file(path, true); + + // files with download_gzipped set may exist + // in temporary or compressed form + // + strcat(path, ".gz"); + delete_project_owned_file(path, true); + strcat(path, "t"); + delete_project_owned_file(path, true); + if (retval && status != FILE_NOT_PRESENT) { msg_printf(project, MSG_INTERNAL_ERROR, "Couldn't delete file %s", path); } @@ -1198,6 +1226,7 @@ download_urls.replace(new_info.download_urls); upload_urls.replace(new_info.upload_urls); + download_gzipped = new_info.download_gzipped; // replace signatures // @@ -1270,6 +1299,51 @@ return 0; } +// unzip a file. +// If md5_buf is not NULL, compute the uncompressed MD5 at the same time +// +int FILE_INFO::gunzip(char* md5_buf) { + unsigned char buf[BUFSIZE]; + char inpath[256], outpath[256]; + md5_state_t md5_state; + + if (md5_buf) { + md5_init(&md5_state); + } + get_pathname(this, outpath, sizeof(outpath)); + strcpy(inpath, outpath); + strcat(inpath, ".gz"); + FILE* out = boinc_fopen(outpath, "wb"); + if (!out) return ERR_FOPEN; + gzFile in = gzopen(inpath, "rb"); + while (1) { + int n = gzread(in, buf, BUFSIZE); + if (n <= 0) break; + int m = (int)fwrite(buf, 1, n, out); + if (m != n) { + gzclose(in); + fclose(out); + return ERR_WRITE; + } + if (md5_buf) { + md5_append(&md5_state, buf, n); + } + } + if (md5_buf) { + unsigned char binout[16]; + md5_finish(&md5_state, binout); + for (int i=0; i<16; i++) { + sprintf(md5_buf+2*i, "%02x", binout[i]); + } + md5_buf[32] = 0; + } + + gzclose(in); + fclose(out); + delete_project_owned_file(inpath, true); + return 0; +} + int APP_VERSION::parse(XML_PARSER& xp) { FILE_REF file_ref; double dtemp; @@ -2118,15 +2192,21 @@ RUN_MODE::RUN_MODE() { perm_mode = 0; temp_mode = 0; + prev_mode = 0; temp_timeout = 0; } void RUN_MODE::set(int mode, double duration) { + if (mode == 0) mode = RUN_MODE_AUTO; if (mode == RUN_MODE_RESTORE) { temp_timeout = 0; + if (temp_mode == perm_mode) { + perm_mode = prev_mode; + } temp_mode = perm_mode; return; } + prev_mode = temp_mode; if (duration) { temp_mode = mode; temp_timeout = gstate.now + duration; @@ -2136,12 +2216,23 @@ perm_mode = mode; gstate.set_client_state_dirty("Set mode"); } + + // In case we read older state file with no prev_mode + if (prev_mode == 0) prev_mode = temp_mode; +} + +void RUN_MODE::set_prev(int mode) { + prev_mode = mode; } int RUN_MODE::get_perm() { return perm_mode; } +int RUN_MODE::get_prev() { + return prev_mode; +} + int RUN_MODE::get_current() { if (temp_timeout > gstate.now) { return temp_mode; diff -Nru boinc-7.0.7+dfsg/client/client_types.h boinc-7.0.14+dfsg/client/client_types.h --- boinc-7.0.7+dfsg/client/client_types.h 2011-12-27 01:38:12.000000000 +0000 +++ boinc-7.0.14+dfsg/client/client_types.h 2012-01-27 13:02:35.000000000 +0000 @@ -104,6 +104,7 @@ char md5_cksum[33]; double max_nbytes; double nbytes; + double gzipped_nbytes; // defined if download_gzipped is true double upload_offset; int status; // see above bool executable; // change file protections to make executable @@ -124,6 +125,8 @@ int ref_cnt; URL_LIST download_urls; URL_LIST upload_urls; + bool download_gzipped; + // if set, download NAME.gz and gunzip it to NAME char xml_signature[MAX_SIGNATURE_LEN]; // the upload signature char file_signature[MAX_SIGNATURE_LEN]; @@ -149,6 +152,9 @@ bool verify_file_certs(); int gzip(); // gzip file and add .gz to name + int gunzip(char*); + // unzip file and remove .gz from filename. + // optionally compute MD5 also inline bool uploadable() { return !upload_urls.empty(); } @@ -335,7 +341,7 @@ int sched_rpc_pending; // we need to do a scheduler RPC, for various possible reasons: // user request, propagate host CPID, time-based, etc. - // Reasons are enumerated in scheduler_op.h + // Reasons are enumerated in lib/common_defs.h bool possibly_backed_off; // we need to call request_work_fetch() when a project // transitions from being backed off to not. @@ -359,6 +365,10 @@ // to make sure they haven't been tampered with. // This provides only the illusion of security. bool use_symlinks; + double disk_usage; + // computed by get_disk_usages() + double disk_share; + // computed by get_disk_shares(); // items send in scheduler replies, requesting that // various things be sent in the next request @@ -806,10 +816,13 @@ struct RUN_MODE { int perm_mode; int temp_mode; + int prev_mode; double temp_timeout; RUN_MODE(); void set(int mode, double duration); + void set_prev(int mode); int get_perm(); + int get_prev(); int get_current(); double delay(); }; diff -Nru boinc-7.0.7+dfsg/client/coproc_detect.cpp boinc-7.0.14+dfsg/client/coproc_detect.cpp --- boinc-7.0.7+dfsg/client/coproc_detect.cpp 2011-11-29 19:14:54.000000000 +0000 +++ boinc-7.0.14+dfsg/client/coproc_detect.cpp 2012-01-26 11:11:40.000000000 +0000 @@ -18,6 +18,10 @@ // client-specific GPU code. Mostly GPU detection +#define FAKENVIDIACUDA0 0 +#define FAKE2NVIDIAOPENCLS 0 +#define DEBUGFOROLIVER 0 + #include "cpp.h" #ifdef _WIN32 @@ -62,6 +66,9 @@ } #endif +vector ati_gpus; +vector nvidia_gpus; + void COPROCS::get( bool use_all, vector&descs, vector&warnings, @@ -109,6 +116,9 @@ } signal(SIGSEGV, old_sig); #endif + + ati_gpus.clear(); + nvidia_gpus.clear(); } @@ -193,6 +203,7 @@ COPROC_NVIDIA nvidia_temp; COPROC_ATI ati_temp; unsigned int i; + int current_CUDA_index; char buf[256]; #ifdef _WIN32 @@ -265,6 +276,21 @@ return; } +#if FAKE2NVIDIAOPENCLS +num_devices = 3; +devices[2] = devices[1]; +#endif + +#if DEBUGFOROLIVER + if (log_flags.coproc_debug) { + msg_printf(0, MSG_INFO, + "[coproc] %d OpenCL devices detected", num_devices + ); + } +#endif + // Mac OpenCL does not recognize all NVIDIA GPUs returned by CUDA + current_CUDA_index = 0; + for (device_index=0; device_index= (int)(nvidia_gpus.size())) { + if (log_flags.coproc_debug) { + msg_printf(0, MSG_INFO, + "[coproc] OpenCL NVIDIA index #%d does not match any CUDA device", + device_index + ); + } + return; // Should never happen + } + } + prop.device_num = current_CUDA_index; + prop.opencl_device_index = device_index; + if (!nvidia.have_cuda) { COPROC_NVIDIA c; c.opencl_prop = prop; c.set_peak_flops(); prop.peak_flops = c.peak_flops; } + if (nvidia_gpus.size()) { + // Assumes OpenCL and CUDA return the devices in the same order + prop.opencl_available_ram = nvidia_gpus[prop.device_num].available_ram; + } else { + prop.opencl_available_ram = prop.global_mem_size; + } +#if DEBUGFOROLIVER + if (log_flags.coproc_debug) { + msg_printf(0, MSG_INFO, + "[coproc] OpenCL device %d: clGetDeviceInfo got available memory size %.0fMB", + device_index, prop.opencl_available_ram/MEGA + ); + } +#endif nvidia_opencls.push_back(prop); } if ((strstr(prop.vendor, GPU_TYPE_ATI)) || @@ -293,21 +374,36 @@ (strstr(prop.vendor, "Advanced Micro Devices, Inc.")) ) { prop.device_num = (int)(ati_opencls.size()); + prop.opencl_device_index = prop.device_num; + +#ifdef __APPLE__ // Work around a bug in OpenCL which returns only // 1/2 of total global RAM size. // This bug applies only to ATI GPUs, not to NVIDIA + // This has already been fixed on latest Catalyst + // drivers, but Mac does not use Catalyst drivers. // Assume this will be fixed in openCL 1.2. + // See also further workaround code for systems with + // CAL support. if ((!strstr("1.0", prop.opencl_platform_version)) || (!strstr("1.1", prop.opencl_platform_version)) ){ prop.global_mem_size *= 2; } +#endif + if (!ati.have_cal) { COPROC_ATI c; c.opencl_prop = prop; c.set_peak_flops(); prop.peak_flops = c.peak_flops; } + if (ati_gpus.size()) { + // Assumes OpenCL and CAL return the same device with the same index + prop.opencl_available_ram = ati_gpus[prop.device_num].available_ram; + } else { + prop.opencl_available_ram = prop.global_mem_size; + } ati_opencls.push_back(prop); } } @@ -323,13 +419,30 @@ } else { nvidia.find_best_opencls(use_all, nvidia_opencls, ignore_nvidia_dev); nvidia.prop.totalGlobalMem = nvidia.opencl_prop.global_mem_size; + nvidia.available_ram = nvidia.opencl_prop.global_mem_size; nvidia.prop.clockRate = nvidia.opencl_prop.max_clock_frequency * 1000; } +#if DEBUGFOROLIVER + if (log_flags.coproc_debug) { + msg_printf(0, MSG_INFO, + "[coproc] Creating descriptions for %d NVIDIA OpenCL devices", + (int)nvidia_opencls.size() + ); + } +#endif // Create descriptions for OpenCL NVIDIA GPUs // for (i=0; i &opencls, vector& ignore_dev ) { - unsigned int i; + unsigned int i, j; for (i=0; i &opencls, @@ -587,6 +737,7 @@ } if (use_all || !opencl_compare(opencls[i], opencl_prop, true)) { device_nums[count++] = opencls[i].device_num; + opencl_device_indexes[opencl_device_count] = opencls[i].opencl_device_index; opencl_device_ids[opencl_device_count++] = opencls[i].device_id; opencls[i].is_used = COPROC_USED; } @@ -824,7 +975,6 @@ return; } - vector gpus; retval = (*__cuDeviceGetCount)(&cuda_ndevs); if (retval) { sprintf(buf, "cuDeviceGetCount() returned %d", retval); @@ -841,6 +991,13 @@ for (j=0; j 0) { - *this = gpus[i]; + } else if (nvidia_compare(nvidia_gpus[i], *this, false) > 0) { + *this = nvidia_gpus[i]; } } @@ -912,17 +1071,17 @@ // and set the "count" and "device_nums" fields // count = 0; - for (i=0; i gpus; for (CALuint i=0; i 0) { - *this = gpus[i]; + } else if (ati_compare(ati_gpus[i], *this, false) > 0) { + *this = ati_gpus[i]; } } @@ -1354,17 +1518,17 @@ // and set the "count" and "device_nums" fields // count = 0; - for (i=0; inon_cpu_intensive()) continue; PROJECT* p = rp->project; - bool only_deadline_misses = true; - // treat projects with DCF>90 as if they had deadline misses // if (p->duration_correction_factor < 90.0) { - int d = p->rsc_pwf[rsc_type].deadlines_missed_copy; - if (!d) { + if (p->rsc_pwf[rsc_type].deadlines_missed_copy <= 0) { continue; } - } else { - only_deadline_misses = false; } - if (only_deadline_misses && !rp->rr_sim_misses_deadline) { - continue; - } bool new_best = false; if (best_result) { if (rp->report_deadline < best_result->report_deadline) { @@ -653,9 +645,10 @@ // than those with positive resource share // if (resource_share == 0) { - sched_priority = -1e6 - rec_frac; + sched_priority = -1e3 - rec_frac; + } else { + sched_priority = - rec_frac/resource_share_frac; } - sched_priority = - rec_frac/resource_share_frac; } // called from the scheduler's job-selection loop; @@ -1139,7 +1132,9 @@ cp->type, j, rp->name ); } +#if DEFER_ON_GPU_AVAIL_RAM cp->available_ram_temp[j] -= rp->avp->gpu_ram; +#endif } } @@ -1158,13 +1153,15 @@ if ((cp->usage[i] || cp->pending_usage[i]) && (cp->usage[i] + cp->pending_usage[i] + usage <= 1) ) { +#if DEFER_ON_GPU_AVAIL_RAM if (rp->avp->gpu_ram > cp->available_ram_temp[i]) { defer_sched = true; continue; } + cp->available_ram_temp[i] -= rp->avp->gpu_ram; +#endif rp->coproc_indices[0] = i; cp->usage[i] += usage; - cp->available_ram_temp[i] -= rp->avp->gpu_ram; if (log_flags.coproc_debug) { msg_printf(rp->project, MSG_INFO, "[coproc] Assigning %f of %s instance %d to %s", @@ -1182,13 +1179,15 @@ continue; } if (!cp->usage[i]) { +#if DEFER_ON_GPU_AVAIL_RAM if (rp->avp->gpu_ram > cp->available_ram_temp[i]) { defer_sched = true; continue; } + cp->available_ram_temp[i] -= rp->avp->gpu_ram; +#endif rp->coproc_indices[0] = i; cp->usage[i] += usage; - cp->available_ram_temp[i] -= rp->avp->gpu_ram; if (log_flags.coproc_debug) { msg_printf(rp->project, MSG_INFO, "[coproc] Assigning %f of %s free instance %d to %s", @@ -1222,10 +1221,18 @@ continue; } if (!cp->usage[i]) { +#if DEFER_ON_GPU_AVAIL_RAM if (rp->avp->gpu_ram > cp->available_ram_temp[i]) { defer_sched = true; + if (log_flags.coproc_debug) { + msg_printf(rp->project, MSG_INFO, + "[coproc] task %s needs %.0fMB RAM, %s GPU %d has %.0fMB available", + rp->name, rp->avp->gpu_ram/MEGA, cp->type, i, cp->available_ram_temp[i]/MEGA + ); + } continue; }; +#endif nfree++; } } @@ -1254,10 +1261,14 @@ } if (!cp->usage[i] && !cp->pending_usage[i] +#if DEFER_ON_GPU_AVAIL_RAM && (rp->avp->gpu_ram <= cp->available_ram_temp[i]) +#endif ) { cp->usage[i] = 1; +#if DEFER_ON_GPU_AVAIL_RAM cp->available_ram_temp[i] -= rp->avp->gpu_ram; +#endif rp->coproc_indices[n++] = i; if (log_flags.coproc_debug) { msg_printf(rp->project, MSG_INFO, @@ -1276,10 +1287,14 @@ continue; } if (!cp->usage[i] +#if DEFER_ON_GPU_AVAIL_RAM && (rp->avp->gpu_ram <= cp->available_ram_temp[i]) +#endif ) { cp->usage[i] = 1; +#if DEFER_ON_GPU_AVAIL_RAM cp->available_ram_temp[i] -= rp->avp->gpu_ram; +#endif rp->coproc_indices[n++] = i; if (log_flags.coproc_debug) { msg_printf(rp->project, MSG_INFO, @@ -1308,6 +1323,7 @@ gstate.request_schedule_cpus("insufficient GPU RAM"); } +#if DEFER_ON_GPU_AVAIL_RAM static void copy_available_ram(COPROC& cp, const char* name) { int rt = rsc_index(name); if (rt > 0) { @@ -1316,6 +1332,7 @@ } } } +#endif static inline void assign_coprocs(vector& jobs) { unsigned int i; @@ -1323,12 +1340,14 @@ double usage; coprocs.clear_usage(); +#if DEFER_ON_GPU_AVAIL_RAM if (coprocs.have_nvidia()) { copy_available_ram(coprocs.nvidia, GPU_TYPE_NVIDIA); } if (coprocs.have_ati()) { copy_available_ram(coprocs.ati, GPU_TYPE_ATI); } +#endif // fill in pending usage // @@ -1837,7 +1856,7 @@ return NULL; } -// find total resource shares of all projects +// find total resource shares of all CPU-intensive projects // double CLIENT_STATE::total_resource_share() { double x = 0; diff -Nru boinc-7.0.7+dfsg/client/cs_files.cpp boinc-7.0.14+dfsg/client/cs_files.cpp --- boinc-7.0.7+dfsg/client/cs_files.cpp 2011-11-04 20:25:30.000000000 +0000 +++ boinc-7.0.14+dfsg/client/cs_files.cpp 2012-01-26 23:13:00.000000000 +0000 @@ -131,6 +131,26 @@ get_pathname(this, pathname, sizeof(pathname)); + strcpy(cksum, ""); + + // see if we need to unzip it + // + if (download_gzipped && !boinc_file_exists(pathname)) { + char gzpath[256]; + sprintf(gzpath, "%s.gz", pathname); + if (boinc_file_exists(gzpath) ) { + retval = gunzip(cksum); + if (retval) return retval; + } else { + strcat(gzpath, "t"); + if (!boinc_file_exists(gzpath)) { + status = FILE_NOT_PRESENT; + } + return ERR_FILE_MISSING; + } + } + + // If the file isn't there at all, set status to FILE_NOT_PRESENT; // this will trigger a new download rather than erroring out // @@ -184,7 +204,8 @@ return ERR_NO_SIGNATURE; } retval = verify_file2( - pathname, file_signature, project->code_sign_key, verified + pathname, strlen(cksum)?cksum:NULL, + file_signature, project->code_sign_key, verified ); if (retval) { msg_printf(project, MSG_INTERNAL_ERROR, @@ -205,15 +226,17 @@ return ERR_RSA_FAILED; } } else if (strlen(md5_cksum)) { - retval = md5_file(pathname, cksum, local_nbytes); - if (retval) { - msg_printf(project, MSG_INTERNAL_ERROR, - "MD5 computation error for %s: %s\n", - name, boincerror(retval) - ); - error_msg = "MD5 computation error"; - status = retval; - return retval; + if (!strlen(cksum)) { + retval = md5_file(pathname, cksum, local_nbytes); + if (retval) { + msg_printf(project, MSG_INTERNAL_ERROR, + "MD5 computation error for %s: %s\n", + name, boincerror(retval) + ); + error_msg = "MD5 computation error"; + status = retval; + return retval; + } } if (strcmp(cksum, md5_cksum)) { if (show_errors) { @@ -295,6 +318,16 @@ } else if (fip->status >= 0) { // file transfer did not fail (non-negative status) + // If this was a compressed download, rename .gzt to .gz + // + if (fip->download_gzipped) { + char path[256], from_path[256], to_path[256]; + get_pathname(fip, path, sizeof(path)); + sprintf(from_path, "%s.gzt", path); + sprintf(to_path, "%s.gz", path); + boinc_rename(from_path, to_path); + } + // verify the file with RSA or MD5, and change permissions // retval = fip->verify_file(true, true); diff -Nru boinc-7.0.7+dfsg/client/cs_prefs.cpp boinc-7.0.14+dfsg/client/cs_prefs.cpp --- boinc-7.0.7+dfsg/client/cs_prefs.cpp 2011-11-07 19:47:40.000000000 +0000 +++ boinc-7.0.14+dfsg/client/cs_prefs.cpp 2012-01-03 10:11:58.000000000 +0000 @@ -67,27 +67,97 @@ #ifndef SIM -int CLIENT_STATE::project_disk_usage(PROJECT* p, double& size) { +// populate: +// PROJECT::disk_usage for all projects +// GLOBAL_STATE::client_disk_usage +// GLOBAL_STATE::total_disk_usage +// +int CLIENT_STATE::get_disk_usages() { char buf[256]; unsigned int i; - double s; + double size; + PROJECT* p; + int retval; - get_project_dir(p, buf, sizeof(buf)); - dir_size(buf, size); + client_disk_usage = 0; + total_disk_usage = 0; + for (i=0; idisk_usage = 0; + get_project_dir(p, buf, sizeof(buf)); + retval = dir_size(buf, size); + if (!retval) p->disk_usage = size; + } for (i=0; iwup->project != p) continue; get_slot_dir(atp->slot, buf, sizeof(buf)); - dir_size(buf, s); - size += s; + retval = dir_size(buf, size); + if (retval) continue; + atp->wup->project->disk_usage += size; + } + for (i=0; idisk_usage; + } + retval = dir_size(".", size, false); + if (!retval) { + client_disk_usage = size; + total_disk_usage += size; } - return 0; } -int CLIENT_STATE::total_disk_usage(double& size) { - return dir_size(".", size); +// populate PROJECT::disk_share for all projects +// +void CLIENT_STATE::get_disk_shares() { + PROJECT* p; + unsigned int i; + + double rss = 0; + for (i=0; iresource_share; + p->disk_share = p->disk_usage; + } + if (!rss) return; + + // a project is "greedy" if it's using more than its share of disk + // + double greedy_rs = 0; + double non_greedy_usage = 0; + double allowed = allowed_disk_usage(total_disk_usage); + for (i=0; iresource_share/rss; + if (p->disk_usage > allowed*rs) { + greedy_rs += p->resource_share; + } else { + non_greedy_usage += p->disk_usage; + } + } + if (!greedy_rs) greedy_rs = 1; // handle projects w/ zero resource share + + double greedy_allowed = allowed - non_greedy_usage; + if (log_flags.disk_usage_debug) { + msg_printf(0, MSG_INFO, + "[disk_usage] allowed %.2fMB used %.2fMB", + allowed, total_disk_usage + ); + } + for (i=0; iresource_share/rss; + if (p->disk_usage > allowed*rs) { + p->disk_share = greedy_allowed*p->resource_share/greedy_rs; + } + if (log_flags.disk_usage_debug) { + msg_printf(p, MSG_INFO, + "[disk_usage] usage %.2fMB share %.2fMB", + p->disk_usage/MEGA, p->disk_share/MEGA + ); + } + } } // See if we should suspend processing @@ -453,12 +523,11 @@ " max memory usage when idle: %.2fMB", (host_info.m_nbytes*global_prefs.ram_max_used_idle_frac)/MEGA ); - double x; #ifndef SIM - total_disk_usage(x); + get_disk_usages(); msg_printf(NULL, MSG_INFO, " max disk usage: %.2fGB", - allowed_disk_usage(x)/GIGA + allowed_disk_usage(total_disk_usage)/GIGA ); #endif // max_cpus, bandwidth limits may have changed diff -Nru boinc-7.0.7+dfsg/client/cs_scheduler.cpp boinc-7.0.14+dfsg/client/cs_scheduler.cpp --- boinc-7.0.7+dfsg/client/cs_scheduler.cpp 2011-12-14 16:46:56.000000000 +0000 +++ boinc-7.0.14+dfsg/client/cs_scheduler.cpp 2012-01-02 05:53:42.000000000 +0000 @@ -74,7 +74,6 @@ MIOFILE mf; unsigned int i; RESULT* rp; - double disk_total, disk_project; get_sched_request_filename(*p, buf, sizeof(buf)); FILE* f = boinc_fopen(buf, "wb"); @@ -209,14 +208,15 @@ // get and write disk usage // - total_disk_usage(disk_total); - project_disk_usage(p, disk_project); + get_disk_usages(); + get_disk_shares(); fprintf(f, " \n" " %f\n" " %f\n" + " %f\n" " \n", - disk_total, disk_project + total_disk_usage, p->disk_usage, p->disk_share ); // copy request values from RSC_WORK_FETCH to COPROC @@ -797,6 +797,8 @@ strcpy(avp->cmdline, avpp.cmdline); avp->gpu_usage = avpp.gpu_usage; strlcpy(avp->api_version, avpp.api_version, sizeof(avp->api_version)); + avp->dont_throttle = avpp.dont_throttle; + avp->needs_network = avpp.needs_network; // if we had download failures, clear them // diff -Nru boinc-7.0.7+dfsg/client/cs_statefile.cpp boinc-7.0.14+dfsg/client/cs_statefile.cpp --- boinc-7.0.7+dfsg/client/cs_statefile.cpp 2011-10-13 19:05:18.000000000 +0000 +++ boinc-7.0.14+dfsg/client/cs_statefile.cpp 2012-01-27 13:02:35.000000000 +0000 @@ -446,10 +446,18 @@ cpu_run_mode.set(retval, 0); continue; } + if (xp.parse_int("user_run_prev_request", retval)) { + cpu_run_mode.set_prev(retval); + continue; + } if (xp.parse_int("user_gpu_request", retval)) { gpu_run_mode.set(retval, 0); continue; } + if (xp.parse_int("user_gpu_prev_request", retval)) { + gpu_run_mode.set_prev(retval); + continue; + } if (xp.parse_int("user_network_request", retval)) { network_run_mode.set(retval, 0); continue; @@ -721,7 +729,9 @@ "%d\n" "%d\n" "%d\n" + "%d\n" "%d\n" + "%d\n" "%d\n" "%s" "%f\n" @@ -731,7 +741,9 @@ core_client_version.minor, core_client_version.release, cpu_run_mode.get_perm(), + cpu_run_mode.get_prev(), gpu_run_mode.get_perm(), + gpu_run_mode.get_prev(), network_run_mode.get_perm(), cpu_benchmarks_pending?"\n":"", new_version_check_time, diff -Nru boinc-7.0.7+dfsg/client/file_xfer.cpp boinc-7.0.14+dfsg/client/file_xfer.cpp --- boinc-7.0.7+dfsg/client/file_xfer.cpp 2011-10-18 04:23:03.000000000 +0000 +++ boinc-7.0.14+dfsg/client/file_xfer.cpp 2012-01-20 23:34:15.000000000 +0000 @@ -53,6 +53,9 @@ is_upload = false; fip = &file_info; get_pathname(fip, pathname, sizeof(pathname)); + if (fip->download_gzipped) { + strcat(pathname, ".gzt"); + } // if file is already as large or larger than it's supposed to be, // something's screwy; start reading it from the beginning. @@ -79,6 +82,9 @@ // fip = &file_info; get_pathname(fip, pathname, sizeof(pathname)); + if (!boinc_file_exists(pathname)) { + return ERR_FILE_NOT_FOUND; + } is_upload = true; diff -Nru boinc-7.0.7+dfsg/client/gui_rpc_server_ops.cpp boinc-7.0.14+dfsg/client/gui_rpc_server_ops.cpp --- boinc-7.0.7+dfsg/client/gui_rpc_server_ops.cpp 2011-11-03 19:19:36.000000000 +0000 +++ boinc-7.0.14+dfsg/client/gui_rpc_server_ops.cpp 2012-01-14 05:56:32.000000000 +0000 @@ -155,19 +155,19 @@ } #endif boinc_total = boinc_non_project; + gstate.get_disk_usages(); for (i=0; i\n" " %s\n" " %f\n" "\n", - p->master_url, size + p->master_url, p->disk_usage ); - boinc_total += size; + boinc_total += p->disk_usage; } - d_allowed = gstate.allowed_disk_usage(boinc_total); + d_allowed = gstate.allowed_disk_usage(gstate.total_disk_usage); grc.mfout.printf( "%f\n" "%f\n" @@ -1369,7 +1369,8 @@ "Server: BOINC client\n" "Connection: close\n" "Content-Type: text/xml; charset=utf-8\n" - "Content-Length: %d\n\n", + "Content-Length: %d\n\n" + "\n", n ); send(sock, buf, strlen(buf), 0); diff -Nru boinc-7.0.7+dfsg/client/hostinfo_unix.cpp boinc-7.0.14+dfsg/client/hostinfo_unix.cpp --- boinc-7.0.7+dfsg/client/hostinfo_unix.cpp 2011-12-28 17:02:34.000000000 +0000 +++ boinc-7.0.14+dfsg/client/hostinfo_unix.cpp 2012-01-13 10:35:11.000000000 +0000 @@ -1584,14 +1584,27 @@ // daemon running as user boinc_master, this API works properly under OS 10.6 // but fails under OS 10.5 and earlier. // +// In OS 10.7, IOHIDGetParameter() fails to recognize activity from remote +// logins via Apple Remote Desktop or Screen Sharing (VNC), but the +// CGEventSourceSecondsSinceLastEventType() API does work with ARD and VNC, +// except when BOINC is a pre-login launchd daemon running as user boinc_master. +// +// So as a workaround in OS 10.7, we use CGEventSourceSecondsSinceLastEventType +// unless running as a daemon. Therefore BOINC still won't detect activity from +// remote via Apple Remote Desktop or Screen Sharing (VNC) when run as a daemon +// under OS 10.7. +// // So we use weak-linking of NxIdleTime() to prevent a run-time crash from the -// dynamic linker, and use the IOHIDGetParameter() API if NXIdleTime does not -// exist. +// dynamic linker and use it if it exists. +// If NXIdleTime does not exist, use CGEventSourceSecondsSinceLastEventType() +// under OS 10.7, or IOHIDGetParameter() under OS 10.6. // bool HOST_INFO::users_idle( bool check_all_logins, double idle_time_to_run, double *actual_idle_time ) { static bool error_posted = false; + static long OSVersionInfo = 0; + OSStatus err = noErr; double idleTime = 0; io_service_t service; kern_return_t kernResult = kIOReturnError; @@ -1605,6 +1618,9 @@ if (!triedToLoadNXIdleTime) { triedToLoadNXIdleTime = true; + err = Gestalt(gestaltSystemVersion, &OSVersionInfo); + if (err) OSVersionInfo = 0; + IOKitlib = dlopen ("/System/Library/Frameworks/IOKit.framework/IOKit", RTLD_NOW ); if (IOKitlib) { myNxIdleTimeProc = (nxIdleTimeProc)dlsym(IOKitlib, "NXIdleTime"); @@ -1621,7 +1637,7 @@ gEventHandle = NXOpenEventStatus(); if (!gEventHandle) { - if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes + if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes msg_printf(NULL, MSG_INFO, "User idle detection is disabled: initialization failed." ); @@ -1631,33 +1647,39 @@ } } } else { // NXIdleTime API does not exist in OS 10.6 and later + if ((OSVersionInfo >= 0x1070) && (! gstate.executing_as_daemon)) { + + idleTime = CGEventSourceSecondsSinceLastEventType + (kCGEventSourceStateCombinedSessionState, kCGAnyInputEventType); + } else { // OS Version < 10.7 if (gEventHandle) { - kernResult = IOHIDGetParameter( gEventHandle, CFSTR(EVSIOIDLE), sizeof(UInt64), ¶ms, &rcnt ); - if ( kernResult != kIOReturnSuccess ) { - msg_printf(NULL, MSG_INFO, - "User idle time measurement failed because IOHIDGetParameter failed." - ); - error_posted = true; - goto bail; - } - idleTime = ((double)params) / 1000.0 / 1000.0 / 1000.0; - } else { - service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching(kIOHIDSystemClass)); - if (service) { - kernResult = IOServiceOpen(service, mach_task_self(), kIOHIDParamConnectType, &gEventHandle); - } - if ( (!service) || (kernResult != KERN_SUCCESS) ) { - // When the system first starts up, allow time for HIDSystem to be available if needed - if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes - msg_printf(NULL, MSG_INFO, - "Could not connect to HIDSystem: user idle detection is disabled." + kernResult = IOHIDGetParameter( gEventHandle, CFSTR(EVSIOIDLE), sizeof(UInt64), ¶ms, &rcnt ); + if ( kernResult != kIOReturnSuccess ) { + msg_printf(NULL, MSG_INFO, + "User idle time measurement failed because IOHIDGetParameter failed." ); error_posted = true; goto bail; } - } - } // End gEventHandle == NULL - } // End NXIdleTime API does not exist + idleTime = ((double)params) / 1000.0 / 1000.0 / 1000.0; + } else { + service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching(kIOHIDSystemClass)); + if (service) { + kernResult = IOServiceOpen(service, mach_task_self(), kIOHIDParamConnectType, &gEventHandle); + } + if ( (!service) || (kernResult != KERN_SUCCESS) ) { + // When the system first starts up, allow time for HIDSystem to be available if needed + if (TickCount() > (120*60)) { // If system has been up for more than 2 minutes + msg_printf(NULL, MSG_INFO, + "Could not connect to HIDSystem: user idle detection is disabled." + ); + error_posted = true; + goto bail; + } + } + } // End (gEventHandle == NULL) + } // End (OSVersionInfo < 0x1070) + } // End NXIdleTime API does not exist bail: if (actual_idle_time) { diff -Nru boinc-7.0.7+dfsg/client/hostinfo_win.cpp boinc-7.0.14+dfsg/client/hostinfo_win.cpp --- boinc-7.0.7+dfsg/client/hostinfo_win.cpp 2011-12-28 16:59:07.000000000 +0000 +++ boinc-7.0.14+dfsg/client/hostinfo_win.cpp 2011-12-28 00:22:20.000000000 +0000 @@ -1018,7 +1018,7 @@ FEATURE_TEST(ext_supported, (ext_ecx & (1 << 2)), "svm "); FEATURE_TEST(ext_supported, (ext_ecx & (1 << 6)), "sse4a "); FEATURE_TEST(ext_supported, (ext_ecx & (1 << 9)), "osvw "); - FEATURE_TEST(ext_supported, (ext_ecx & (1 << 10)), "ibs "); + FEATURE_TEST(ext_supported, (ext_ecx & (1 << 10)), "ibs "); FEATURE_TEST(ext_supported, (ext_ecx & (1 << 11)), "xop "); FEATURE_TEST(ext_supported, (ext_ecx & (1 << 12)), "skinit "); FEATURE_TEST(ext_supported, (ext_ecx & (1 << 13)), "wdt "); diff -Nru boinc-7.0.7+dfsg/client/http_curl.cpp boinc-7.0.14+dfsg/client/http_curl.cpp --- boinc-7.0.7+dfsg/client/http_curl.cpp 2011-10-18 04:41:13.000000000 +0000 +++ boinc-7.0.14+dfsg/client/http_curl.cpp 2012-01-25 00:00:30.000000000 +0000 @@ -548,7 +548,9 @@ // So, detect this and don't accept any encoding in that case // if (!out || !ends_with(std::string(out), std::string(".gz"))) { - curl_easy_setopt(curlEasy, CURLOPT_ENCODING, ""); + // Per: http://curl.haxx.se/dev/readme-encoding.html + // NULL disables, empty string accepts all. + curl_easy_setopt(curlEasy, CURLOPT_ENCODING, NULL); } // setup any proxy they may need @@ -912,11 +914,8 @@ CURLINFO_RESPONSE_CODE, &response ); - // CURLINFO_LONG+25 is a workaround for a bug in the gcc version - // included with Mac OS X 10.3.9 - // curl_easy_getinfo(curlEasy, - (CURLINFO)(CURLINFO_LONG+25) /*CURLINFO_OS_ERRNO*/, &connect_error + CURLINFO_OS_ERRNO, &connect_error ); // update byte counts and transfer speed diff -Nru boinc-7.0.7+dfsg/client/net_stats.cpp boinc-7.0.14+dfsg/client/net_stats.cpp --- boinc-7.0.7+dfsg/client/net_stats.cpp 2011-11-29 18:27:57.000000000 +0000 +++ boinc-7.0.14+dfsg/client/net_stats.cpp 2012-01-23 05:03:52.000000000 +0000 @@ -420,6 +420,9 @@ } } +// tell the scheduler how much we've used in the quota period +// (currently not used by scheduler) +// void DAILY_XFER_HISTORY::write_scheduler_request(MIOFILE& mf, int ndays) { double up, down; totals(ndays, up, down); diff -Nru boinc-7.0.7+dfsg/client/net_stats.h boinc-7.0.14+dfsg/client/net_stats.h --- boinc-7.0.7+dfsg/client/net_stats.h 2011-10-06 17:23:16.000000000 +0000 +++ boinc-7.0.14+dfsg/client/net_stats.h 2011-11-16 19:47:40.000000000 +0000 @@ -45,6 +45,7 @@ // This ignores concurrency of transfers. double avg_rate; // recent average transfer rate + // i.e. over all time, not just when transfers are active double avg_time; // when avg_rate was last updated void update(double nbytes, double dt); diff -Nru boinc-7.0.7+dfsg/client/pers_file_xfer.cpp boinc-7.0.14+dfsg/client/pers_file_xfer.cpp --- boinc-7.0.7+dfsg/client/pers_file_xfer.cpp 2011-12-14 16:52:42.000000000 +0000 +++ boinc-7.0.14+dfsg/client/pers_file_xfer.cpp 2011-12-17 05:36:45.000000000 +0000 @@ -141,7 +141,11 @@ } fxp->file_xfer_retval = retval; - transient_failure(retval); + if (retval == ERR_FILE_NOT_FOUND) { + permanent_failure(retval); + } else { + transient_failure(retval); + } delete fxp; fxp = NULL; return retval; diff -Nru boinc-7.0.7+dfsg/client/sandbox.h boinc-7.0.14+dfsg/client/sandbox.h --- boinc-7.0.7+dfsg/client/sandbox.h 2009-12-14 19:24:06.000000000 +0000 +++ boinc-7.0.14+dfsg/client/sandbox.h 2012-01-17 09:38:32.000000000 +0000 @@ -23,7 +23,7 @@ extern int delete_project_owned_file(const char* path, bool retry); extern int remove_project_owned_dir(const char* name); extern int remove_project_owned_file_or_dir(const char* path); -extern int check_security(int use_sandbox, int isManager); +extern int check_security(int use_sandbox, int isManager, char* path_to_error = NULL); #define BOINC_PROJECT_GROUP_NAME "boinc_project" diff -Nru boinc-7.0.7+dfsg/client/scheduler_op.cpp boinc-7.0.14+dfsg/client/scheduler_op.cpp --- boinc-7.0.7+dfsg/client/scheduler_op.cpp 2011-10-18 04:23:03.000000000 +0000 +++ boinc-7.0.14+dfsg/client/scheduler_op.cpp 2011-12-16 19:45:31.000000000 +0000 @@ -263,7 +263,7 @@ if (log_flags.sched_op_debug) { for (int i=0; iAddGrowableRow(0); + itemFlexGridSizer->AddGrowableCol(1); m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags); wxASSERT(m_pTaskPane); m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags); wxASSERT(m_pListPane); + + itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1); + itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1); - SplitVertically(m_pTaskPane, m_pListPane, 250); + SetSizer(itemFlexGridSizer); UpdateSelection(); @@ -723,13 +734,6 @@ wxASSERT(m_pTaskPane); m_pTaskPane->UpdateControls(); Layout(); - - // Adjust the width of the task pane so that it can be fully displayed. - // - if (IsSplit()) { - wxSize sz = m_pTaskPane->GetVirtualSize(); - SetSashPosition(sz.GetWidth(), true); - } } @@ -767,13 +771,13 @@ if (m_pListPane->GetSelectedItemCount()) { if (project) { // Create the web sites task group - pGroup = new CTaskItemGroup( _("Web sites") ); + pGroup = new CTaskItemGroup( _("Project web pages") ); m_TaskGroups.push_back( pGroup ); // Default project url pItem = new CTaskItem( - wxString(project->project_name.c_str(), wxConvUTF8), - wxT(""), + wxString("Home page", wxConvUTF8), + wxString(project->project_name.c_str(), wxConvUTF8) + wxT(" web site"), wxString(project->master_url, wxConvUTF8), ID_TASK_PROJECT_WEB_PROJDEF_MIN ); diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCBaseView.h boinc-7.0.14+dfsg/clientgui/BOINCBaseView.h --- boinc-7.0.7+dfsg/clientgui/BOINCBaseView.h 2011-12-14 16:54:50.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCBaseView.h 2012-01-25 11:51:31.000000000 +0000 @@ -53,6 +53,7 @@ ~CTaskItem() {}; wxString m_strName; + wxString m_strNameEllipsed; wxString m_strDescription; wxInt32 m_iEventID; @@ -97,7 +98,7 @@ typedef bool (*ListSortCompareFunc)(int, int); -class CBOINCBaseView : public wxSplitterWindow { +class CBOINCBaseView : public wxPanel { DECLARE_DYNAMIC_CLASS( CBOINCBaseView ) public: diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCClientManager.cpp boinc-7.0.14+dfsg/clientgui/BOINCClientManager.cpp --- boinc-7.0.7+dfsg/clientgui/BOINCClientManager.cpp 2011-11-03 02:35:04.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCClientManager.cpp 2012-01-11 11:33:03.000000000 +0000 @@ -296,7 +296,13 @@ if (IsBOINCConfiguredAsDaemon() == NewStyleDaemon) { system ("launchctl load /Library/LaunchDaemons/edu.berkeley.boinc.plist"); system ("launchctl start edu.berkeley.boinc"); - bReturnValue = IsBOINCCoreRunning(); + for (int i=0; i<100; i++) { // Wait up to 1 seccond in 10 ms increments + boinc_sleep(0.01); + if (IsBOINCCoreRunning()) { + bReturnValue = true; + break; + } + } } else { // Get the full path to core client inside this application's bundle diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCGUIApp.cpp boinc-7.0.14+dfsg/clientgui/BOINCGUIApp.cpp --- boinc-7.0.7+dfsg/clientgui/BOINCGUIApp.cpp 2011-12-16 10:32:28.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCGUIApp.cpp 2012-01-23 19:30:51.000000000 +0000 @@ -60,6 +60,7 @@ IMPLEMENT_DYNAMIC_CLASS(CBOINCGUIApp, wxApp) BEGIN_EVENT_TABLE (CBOINCGUIApp, wxApp) + EVT_ACTIVATE_APP(CBOINCGUIApp::OnActivateApp) EVT_RPC_FINISHED(CBOINCGUIApp::OnRPCFinished) END_EVENT_TABLE () @@ -294,8 +295,28 @@ wxHelpProvider::Set(new wxHelpControllerHelpProvider()); + // Enable known image types + wxInitAllImageHandlers(); + + // Enable additional file system type handlers + wxFileSystem::AddHandler(new wxMemoryFSHandler); + wxFileSystem::AddHandler(new CBOINCInternetFSHandler); + + // Initialize the skin manager + m_pSkinManager = new CSkinManager(m_bDebugSkins); + wxASSERT(m_pSkinManager); + + + // Load desired manager skin + m_pConfig->Read(wxT("Skin"), &strDesiredSkinName, m_pSkinManager->GetDefaultSkinName()); + m_pSkinManager->ReloadSkin(strDesiredSkinName); + + #ifdef SANDBOX // Make sure owners, groups and permissions are correct for the current setting of g_use_sandbox + char path_to_error[MAXPATHLEN]; + path_to_error[0] = '\0'; + if (!iErrorCode) { #if (defined(__WXMAC__) && defined(_DEBUG)) // TODO: implement this for other platforms // GDB can't attach to applications which are running as a different user @@ -306,7 +327,7 @@ SetBOINCAppOwnersGroupsAndPermissions(NULL); } #endif - iErrorCode = check_security(g_use_sandbox, true); + iErrorCode = check_security(g_use_sandbox, true, path_to_error); } if (iErrorCode) { @@ -314,16 +335,36 @@ ShowApplication(true); if (iErrorCode == -1099) { - strDialogMessage = - _("You currently are not authorized to manage the client.\n\nTo run BOINC as this user, please:\n - reinstall BOINC answering \"Yes\" to the question about\n non-administrative users\n or\n - contact your administrator to add you to the 'boinc_master'\n user group."); + strDialogMessage.Printf( + _("You currently are not authorized to manage the client.\n\nTo run %s as this user, please:\n - reinstall %s answering \"Yes\" to the question about\n non-administrative users\n or\n - contact your administrator to add you to the 'boinc_master'\n user group."), + m_pSkinManager->GetAdvanced()->GetApplicationShortName().c_str(), + m_pSkinManager->GetAdvanced()->GetApplicationShortName().c_str() + ); } else { - strDialogMessage.Printf( - _("BOINC ownership or permissions are not set properly; please reinstall BOINC.\n(Error code %d)"), - iErrorCode - ); - + strDialogMessage.Printf( + _("%s ownership or permissions are not set properly; please reinstall %s.\n(Error code %d"), + m_pSkinManager->GetAdvanced()->GetApplicationShortName().c_str(), + m_pSkinManager->GetAdvanced()->GetApplicationShortName().c_str(), + iErrorCode + ); + if (path_to_error[0]) { + strDialogMessage += _(" at "); + strDialogMessage += wxString::FromUTF8(path_to_error); + } + strDialogMessage += _(")"); + + fprintf(stderr, "%ls ownership or permissions are not set properly; please reinstall %ls.\n(Error code %d at %s)", + m_pSkinManager->GetAdvanced()->GetApplicationShortName().c_str(), + m_pSkinManager->GetAdvanced()->GetApplicationShortName().c_str(), + iErrorCode, path_to_error + ); } - wxMessageDialog* pDlg = new wxMessageDialog(NULL, strDialogMessage, wxT("BOINC Manager"), wxOK); + wxMessageDialog* pDlg = new wxMessageDialog( + NULL, + strDialogMessage, + m_pSkinManager->GetAdvanced()->GetApplicationName(), + wxOK + ); pDlg->ShowModal(); if (pDlg) @@ -334,23 +375,6 @@ #endif // SANDBOX - // Enable known image types - wxInitAllImageHandlers(); - - // Enable additional file system type handlers - wxFileSystem::AddHandler(new wxMemoryFSHandler); - wxFileSystem::AddHandler(new CBOINCInternetFSHandler); - - // Initialize the skin manager - m_pSkinManager = new CSkinManager(m_bDebugSkins); - wxASSERT(m_pSkinManager); - - - // Load desired manager skin - m_pConfig->Read(wxT("Skin"), &strDesiredSkinName, m_pSkinManager->GetDefaultSkinName()); - m_pSkinManager->ReloadSkin(strDesiredSkinName); - - #ifdef __WXMSW__ // Perform any last minute checks that should keep the manager // from starting up. @@ -764,6 +788,17 @@ } +void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) { + if (event.GetActive()) { + if (m_pEventLog && !m_pEventLog->IsIconized()) { + m_pEventLog->Raise(); + } + m_pFrame->Raise(); + } + event.Skip(); +} + + void CBOINCGUIApp::OnRPCFinished( CRPCFinishedEvent& event ) { CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -816,7 +851,7 @@ // Display the Event Log, it is a modeless dialog not owned by any // other UI element. void CBOINCGUIApp::DisplayEventLog(bool bShowWindow) { - if (m_pEventLog ) { + if (m_pEventLog) { if (bShowWindow) { if (m_pEventLog->IsIconized()) { m_pEventLog->Iconize(false); @@ -968,17 +1003,20 @@ } // Show the new frame if needed - if (m_pFrame && !m_pFrame->IsShown() && bShowWindow) { - m_pFrame->Show(); - m_pFrame->Raise(); + if (m_pFrame && bShowWindow) { + if (m_pEventLog) { + m_pEventLog->Show(); + m_pEventLog->Raise(); #ifdef __WXMSW__ - ::SetForegroundWindow((HWND)m_pFrame->GetHWND()); + ::SetForegroundWindow((HWND)m_pEventLog->GetHWND()); #endif - } + } - // Raise the frame to the top of the Z order if needed - if (m_pFrame && m_pFrame->IsShown() && bShowWindow) { + if (!m_pFrame->IsShown()) { + m_pFrame->Show(); + } m_pFrame->Raise(); + #ifdef __WXMSW__ ::SetForegroundWindow((HWND)m_pFrame->GetHWND()); #endif diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCGUIApp.h boinc-7.0.14+dfsg/clientgui/BOINCGUIApp.h --- boinc-7.0.7+dfsg/clientgui/BOINCGUIApp.h 2011-11-03 02:35:04.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCGUIApp.h 2012-01-23 19:30:51.000000000 +0000 @@ -168,6 +168,7 @@ bool SetActiveGUI(int iGUISelection, bool bShowWindow = true); + void OnActivateApp( wxActivateEvent& event ); void OnRPCFinished( CRPCFinishedEvent& event ); int ConfirmExit(); diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCTaskBar.cpp boinc-7.0.14+dfsg/clientgui/BOINCTaskBar.cpp --- boinc-7.0.7+dfsg/clientgui/BOINCTaskBar.cpp 2011-07-08 08:26:11.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCTaskBar.cpp 2012-01-27 22:39:20.000000000 +0000 @@ -92,6 +92,7 @@ m_iconTaskBarNormal = *icon; m_iconTaskBarDisconnected = *iconDisconnected; m_iconTaskBarSnooze = *iconSnooze; + m_SnoozeGPUMenuItem = NULL; m_bTaskbarInitiatedShutdown = false; @@ -217,7 +218,9 @@ ResetTaskBar(); pDoc->GetCoreClientStatus(status); - if (status.task_mode_perm != status.task_mode) { + if (status.task_mode_perm == RUN_MODE_NEVER) { + pDoc->SetActivityRunMode(RUN_MODE_RESTORE, 0); + } else if (status.task_mode_perm != status.task_mode) { pDoc->SetActivityRunMode(RUN_MODE_RESTORE, 0); } else { pDoc->SetActivityRunMode(RUN_MODE_NEVER, 3600); @@ -234,7 +237,9 @@ ResetTaskBar(); pDoc->GetCoreClientStatus(status); - if (status.gpu_mode_perm != status.gpu_mode) { + if (status.gpu_mode_perm == RUN_MODE_NEVER) { + pDoc->SetGPURunMode(RUN_MODE_RESTORE, 0); + } else if (status.gpu_mode_perm != status.gpu_mode) { pDoc->SetGPURunMode(RUN_MODE_RESTORE, 0); } else { pDoc->SetGPURunMode(RUN_MODE_NEVER, 3600); @@ -496,9 +501,9 @@ pMenu->AppendSeparator(); - pMenu->AppendCheckItem(ID_TB_SUSPEND, _("Snooze"), wxEmptyString); + m_SnoozeMenuItem = pMenu->AppendCheckItem(ID_TB_SUSPEND, _("Snooze"), wxEmptyString); if (pDoc->state.have_nvidia || pDoc->state.have_ati) { - pMenu->AppendCheckItem(ID_TB_SUSPEND_GPU, _("Snooze GPU"), wxEmptyString); + m_SnoozeGPUMenuItem = pMenu->AppendCheckItem(ID_TB_SUSPEND_GPU, _("Snooze GPU"), wxEmptyString); } pMenu->AppendSeparator(); @@ -585,46 +590,59 @@ case RUN_MODE_NEVER: switch (status.task_mode_perm) { case RUN_MODE_NEVER: - pMenu->Check(ID_TB_SUSPEND, false); - pMenu->Enable(ID_TB_SUSPEND, false); + m_SnoozeMenuItem->SetItemLabel(_("Resume")); + m_SnoozeMenuItem->Check(false); + if (!is_dialog_detected) { + m_SnoozeMenuItem->Enable(true); + } break; default: - pMenu->Check(ID_TB_SUSPEND, true); + m_SnoozeMenuItem->SetItemLabel(_("Snooze")); + m_SnoozeMenuItem->Check(true); if (!is_dialog_detected) { - pMenu->Enable(ID_TB_SUSPEND, true); + m_SnoozeMenuItem->Enable(true); } } - if (pDoc->state.have_nvidia || pDoc->state.have_ati) { - pMenu->Check(ID_TB_SUSPEND_GPU, false); - pMenu->Enable(ID_TB_SUSPEND_GPU, false); - } break; default: - pMenu->Check(ID_TB_SUSPEND, false); + m_SnoozeMenuItem->SetItemLabel(_("Snooze")); + m_SnoozeMenuItem->Check(false); if (!is_dialog_detected) { - pMenu->Enable(ID_TB_SUSPEND, true); + m_SnoozeMenuItem->Enable(true); } - if (pDoc->state.have_nvidia || pDoc->state.have_ati) { - switch (status.gpu_mode) { + } + + if (pDoc->state.have_nvidia || pDoc->state.have_ati) { + switch (status.gpu_mode) { + case RUN_MODE_NEVER: + switch (status.gpu_mode_perm) { case RUN_MODE_NEVER: - switch (status.gpu_mode_perm) { - case RUN_MODE_NEVER: - pMenu->Check(ID_TB_SUSPEND_GPU, false); - pMenu->Enable(ID_TB_SUSPEND_GPU, false); - break; - default: - pMenu->Check(ID_TB_SUSPEND_GPU, true); - if (!is_dialog_detected) { - pMenu->Enable(ID_TB_SUSPEND_GPU, true); - } + m_SnoozeGPUMenuItem->SetItemLabel(_("Resume GPU")); + m_SnoozeGPUMenuItem->Check(false); + if (!is_dialog_detected) { + m_SnoozeGPUMenuItem->Enable(true); } break; default: - pMenu->Check(ID_TB_SUSPEND_GPU, false); + m_SnoozeGPUMenuItem->SetItemLabel(_("Snooze GPU")); + m_SnoozeGPUMenuItem->Check(true); if (!is_dialog_detected) { - pMenu->Enable(ID_TB_SUSPEND_GPU, true); + m_SnoozeGPUMenuItem->Enable(true); } - break; + } + break; + default: + m_SnoozeGPUMenuItem->SetItemLabel(_("Snooze GPU")); + m_SnoozeGPUMenuItem->Check(false); + if (!is_dialog_detected) { + m_SnoozeGPUMenuItem->Enable(true); + } + break; + } + if (pDoc->state.have_nvidia || pDoc->state.have_ati) { + if (status.task_mode == RUN_MODE_NEVER) { + m_SnoozeGPUMenuItem->Check(false); + m_SnoozeGPUMenuItem->Enable(false); } } } diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCTaskBar.h boinc-7.0.14+dfsg/clientgui/BOINCTaskBar.h --- boinc-7.0.7+dfsg/clientgui/BOINCTaskBar.h 2011-03-07 16:06:26.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCTaskBar.h 2012-01-27 13:02:35.000000000 +0000 @@ -100,25 +100,27 @@ } #endif - wxIcon m_iconTaskBarNormal; - wxIcon m_iconTaskBarDisconnected; - wxIcon m_iconTaskBarSnooze; + wxIcon m_iconTaskBarNormal; + wxIcon m_iconTaskBarDisconnected; + wxIcon m_iconTaskBarSnooze; - wxIcon m_iconCurrentIcon; + wxIcon m_iconCurrentIcon; - bool m_bTaskbarInitiatedShutdown; + bool m_bTaskbarInitiatedShutdown; private: - bool m_bMouseButtonPressed; + bool m_bMouseButtonPressed; + wxMenuItem* m_SnoozeMenuItem; + wxMenuItem* m_SnoozeGPUMenuItem; - wxDateTime m_dtLastNotificationAlertExecuted; - int m_iLastNotificationUnreadMessageCount; + wxDateTime m_dtLastNotificationAlertExecuted; + int m_iLastNotificationUnreadMessageCount; - void ResetTaskBar(); - void DisplayContextMenu(); + void ResetTaskBar(); + void DisplayContextMenu(); - void UpdateTaskbarStatus(); - void UpdateNoticeStatus(); + void UpdateTaskbarStatus(); + void UpdateNoticeStatus(); DECLARE_EVENT_TABLE() }; diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCTaskCtrl.cpp boinc-7.0.14+dfsg/clientgui/BOINCTaskCtrl.cpp --- boinc-7.0.7+dfsg/clientgui/BOINCTaskCtrl.cpp 2011-12-14 16:54:50.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCTaskCtrl.cpp 2012-01-27 21:29:35.000000000 +0000 @@ -23,6 +23,8 @@ #include "BOINCBaseView.h" #include "BOINCTaskCtrl.h" +#define TASKPANEWIDTH 200 +#define TASKBUTTONWIDTH (TASKPANEWIDTH - 55) IMPLEMENT_DYNAMIC_CLASS(CBOINCTaskCtrl, wxScrolledWindow) @@ -31,12 +33,12 @@ CBOINCTaskCtrl::CBOINCTaskCtrl(CBOINCBaseView* pView, wxWindowID iTaskWindowID, wxInt32 iTaskWindowFlags) : - wxScrolledWindow(pView, iTaskWindowID, wxDefaultPosition, wxSize(200, -1), iTaskWindowFlags) + wxScrolledWindow(pView, iTaskWindowID, wxDefaultPosition, wxSize(TASKPANEWIDTH, -1), iTaskWindowFlags) { m_pParent = pView; m_pSizer = NULL; - SetVirtualSize( 200, 1000 ); + SetVirtualSize( TASKPANEWIDTH, 1000 ); EnableScrolling(false, true); SetScrollRate( 0, 10 ); @@ -131,13 +133,18 @@ wxInt32 CBOINCTaskCtrl::UpdateTask( CTaskItem* pItem, wxString strName, wxString strDescription ) { if (pItem->m_pButton) { + if (!pItem->m_strName.Cmp(strName) && + !pItem->m_strDescription.Cmp(strDescription)) { + return 0; + } pItem->m_strName = strName; + pItem->m_strNameEllipsed = pItem->m_strName; + EllipseStringIfNeeded(pItem->m_strNameEllipsed); pItem->m_strDescription = strDescription; - - pItem->m_pButton->SetLabel( strName ); + pItem->m_pButton->SetLabel( pItem->m_strNameEllipsed ); pItem->m_pButton->SetHelpText( strDescription ); #if wxUSE_TOOLTIPS - pItem->m_pButton->SetToolTip( strDescription ); + pItem->m_pButton->SetToolTip(pItem->m_strDescription); #endif } return 0; @@ -180,7 +187,9 @@ pItem = pGroup->m_Tasks[j]; if (!pItem->m_pButton) { pItem->m_pButton = new wxButton; - pItem->m_pButton->Create(this, pItem->m_iEventID, pItem->m_strName, wxDefaultPosition, wxDefaultSize, 0); + pItem->m_strNameEllipsed = pItem->m_strName; + EllipseStringIfNeeded(pItem->m_strNameEllipsed); + pItem->m_pButton->Create(this, pItem->m_iEventID, pItem->m_strNameEllipsed, wxDefaultPosition, wxSize(TASKBUTTONWIDTH, -1), 0); pItem->m_pButton->SetHelpText(pItem->m_strDescription); #if wxUSE_TOOLTIPS pItem->m_pButton->SetToolTip(pItem->m_strDescription); @@ -241,3 +250,26 @@ return true; } + +void CBOINCTaskCtrl::EllipseStringIfNeeded(wxString& s) { + int w, h; + int maxWidth = TASKBUTTONWIDTH - 10; + + GetTextExtent(s, &w, &h); + + // Adapted from ellipis code in wxRendererGeneric::DrawHeaderButtonContents() + if (w > maxWidth) { + int ellipsisWidth; + GetTextExtent( wxT("..."), &ellipsisWidth, NULL); + if (ellipsisWidth > maxWidth) { + s.Clear(); + w = 0; + } else { + do { + s.Truncate( s.length() - 1 ); + GetTextExtent( s, &w, &h); + } while (((w + ellipsisWidth) > maxWidth) && s.length() ); + s.append( wxT("...") ); + } + } +} diff -Nru boinc-7.0.7+dfsg/clientgui/BOINCTaskCtrl.h boinc-7.0.14+dfsg/clientgui/BOINCTaskCtrl.h --- boinc-7.0.7+dfsg/clientgui/BOINCTaskCtrl.h 2008-08-06 18:36:30.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/BOINCTaskCtrl.h 2012-01-25 12:30:44.000000000 +0000 @@ -50,6 +50,8 @@ virtual bool OnSaveState( wxConfigBase* pConfig ); virtual bool OnRestoreState( wxConfigBase* pConfig ); + void EllipseStringIfNeeded( wxString& s ); + private: CBOINCBaseView* m_pParent; diff -Nru boinc-7.0.7+dfsg/clientgui/browser.cpp boinc-7.0.14+dfsg/clientgui/browser.cpp --- boinc-7.0.7+dfsg/clientgui/browser.cpp 2011-12-14 17:03:06.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/browser.cpp 2012-02-02 17:35:24.000000000 +0000 @@ -937,6 +937,7 @@ static tIEGPMC pIEGPMC = NULL; bool bReturnValue = false; bool bCheckDomainName = false; + HRESULT rc; WCHAR szCookieBuffer[2048]; WCHAR* pszCookieFragment = NULL; DWORD dwSize = sizeof(szCookieBuffer)/sizeof(WCHAR); @@ -974,15 +975,15 @@ domainname_w = std::wstring(_T("http://")) + A2W(domainname) + std::wstring(_T("/")); // First check to see if the desired cookie is assigned to the hostname. - bReturnValue = pIEGPMC(hostname_w.c_str(), NULL, szCookieBuffer, &dwSize, NULL) == TRUE; - if (!bReturnValue || (!wcsstr(szCookieBuffer, name_w.c_str()))) { + rc = pIEGPMC(hostname_w.c_str(), NULL, szCookieBuffer, &dwSize, NULL) == TRUE; + if (!SUCCEEDED(rc) || (!wcsstr(szCookieBuffer, name_w.c_str()))) { bCheckDomainName = true; } // Next check if it was assigned to the domainname. if (bCheckDomainName) { - bReturnValue = pIEGPMC(domainname_w.c_str(), NULL, szCookieBuffer, &dwSize, NULL) == TRUE; - if (!bReturnValue || (!wcsstr(szCookieBuffer, name_w.c_str()))) { + rc = pIEGPMC(domainname_w.c_str(), NULL, szCookieBuffer, &dwSize, NULL) == TRUE; + if (!SUCCEEDED(rc) || (!wcsstr(szCookieBuffer, name_w.c_str()))) { return false; } } diff -Nru boinc-7.0.7+dfsg/clientgui/DlgAdvPreferencesBase.cpp boinc-7.0.14+dfsg/clientgui/DlgAdvPreferencesBase.cpp --- boinc-7.0.7+dfsg/clientgui/DlgAdvPreferencesBase.cpp 2011-10-21 12:17:10.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/DlgAdvPreferencesBase.cpp 2012-01-30 18:19:54.000000000 +0000 @@ -423,24 +423,43 @@ // buffer sizes - m_staticText30 = new wxStaticText( networkTab, ID_DEFAULT, _("Connect about every"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText30 = new wxStaticText( + networkTab, ID_DEFAULT, + _("Minimum work buffer"), wxDefaultPosition, wxDefaultSize, 0 + ); networkGeneralGridSizer->Add( m_staticText30, 0, wxALL, 5 ); - m_txtNetConnectInterval = new wxTextCtrl( networkTab, ID_TXTNETCONNECTINTERVAL, wxT(""), wxDefaultPosition, wxSize( 50,-1 ), wxTE_RIGHT ); - m_txtNetConnectInterval->SetToolTip( _("this computer is connected to the Internet about every X days\n(0 if it's always connected)") ); + m_txtNetConnectInterval = new wxTextCtrl( + networkTab, ID_TXTNETCONNECTINTERVAL, wxT(""), + wxDefaultPosition, wxSize( 50,-1 ), wxTE_RIGHT + ); + m_txtNetConnectInterval->SetToolTip( + _("Try to maintain enough tasks to keep busy for this many days") + ); networkGeneralGridSizer->Add( m_txtNetConnectInterval, 0, wxALL, 1 ); - m_staticText31 = new wxStaticText( networkTab, ID_DEFAULT, _("days"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText31 = new wxStaticText( + networkTab, ID_DEFAULT, _("days"), wxDefaultPosition, wxDefaultSize, 0 + ); networkGeneralGridSizer->Add( m_staticText31, 0, wxALL, 5 ); - m_staticText331 = new wxStaticText( networkTab, ID_DEFAULT, _("Additional work buffer"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText331 = new wxStaticText( + networkTab, ID_DEFAULT, + _("Max additional work buffer"), wxDefaultPosition, wxDefaultSize, 0 + ); networkGeneralGridSizer->Add( m_staticText331, 0, wxALIGN_RIGHT|wxALL, 5 ); - m_txtNetAdditionalDays = new wxTextCtrl( networkTab, ID_TXTNETADDITIONALDAYS, wxT(""), wxDefaultPosition, wxSize( 50,-1 ), wxTE_RIGHT ); + m_txtNetAdditionalDays = new wxTextCtrl( + networkTab, ID_TXTNETADDITIONALDAYS, wxT(""), + wxDefaultPosition, wxSize( 50,-1 ), wxTE_RIGHT + ); + m_txtNetAdditionalDays->SetToolTip( + _("In addition, maintain enough tasks for up to this many days") + ); networkGeneralGridSizer->Add( m_txtNetAdditionalDays, 0, wxALL, 1 ); - m_staticText341 = new wxStaticText( networkTab, ID_DEFAULT, _("days (max. 10)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText341 = new wxStaticText( networkTab, ID_DEFAULT, _("days"), wxDefaultPosition, wxDefaultSize, 0 ); networkGeneralGridSizer->Add( m_staticText341, 0, wxALL, 5 ); m_chkNetSkipImageVerification = new wxCheckBox( networkTab, ID_CHKNETSKIPIMAGEVERIFICATION, _("Skip image file verification"), wxDefaultPosition, wxDefaultSize, 0 ); diff -Nru boinc-7.0.7+dfsg/clientgui/Events.h boinc-7.0.14+dfsg/clientgui/Events.h --- boinc-7.0.7+dfsg/clientgui/Events.h 2011-12-06 11:49:07.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/Events.h 2012-01-12 22:05:25.000000000 +0000 @@ -125,6 +125,7 @@ #define ID_TASK_WORK_SHOWGRAPHICS 9202 #define ID_TASK_WORK_ABORT 9203 #define ID_TASK_SHOW_PROPERTIES 9204 +#define ID_TASK_WORK_VMCONSOLE 9205 #define ID_TASK_TRANSFERS_RETRYNOW 9300 #define ID_TASK_TRANSFERS_ABORT 9301 #define ID_TASK_MESSAGES_COPYALL 9400 diff -Nru boinc-7.0.7+dfsg/clientgui/MainDocument.cpp boinc-7.0.14+dfsg/clientgui/MainDocument.cpp --- boinc-7.0.7+dfsg/clientgui/MainDocument.cpp 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/MainDocument.cpp 2012-01-15 17:55:58.000000000 +0000 @@ -1738,7 +1738,7 @@ // If graphics app is already running, don't launch a second instance // if (previous_gfx_app) return 0; - argv[0] =0; + argv[0] = 0; iRetVal = run_program( result->slot_path, @@ -1761,6 +1761,53 @@ } +int CMainDocument::WorkShowVMConsole(RESULT* result) { + int iRetVal = 0; + + if (strlen(result->remote_desktop_addr)) { + wxString strConnection(result->remote_desktop_addr, wxConvUTF8); + wxString strCommand; + +#if defined(__WXMSW__) + strCommand = wxT("mstsc.exe /v:") + strConnection; + wxExecute(strCommand); +#elif defined(__WXGTK__) + strCommand = wxT("rdesktop-vrdp ") + strConnection; + wxExecute(strCommand); +#elif defined(__WXMAC__) + FSRef theFSRef; + OSStatus status = noErr; + + // I have found no reliable way to pass the IP address and port to Microsoft's + // Remote Desktop Connection application for the Mac, so I'm using CoRD. + // Unfortunately, CoRD does not seem as reliable as I would like either. + // + // First try to find the CoRD application by Bundle ID and Creator Code + status = LSFindApplicationForInfo('RDC#', CFSTR("net.sf.cord"), + NULL, &theFSRef, NULL); + if (status != noErr) { + CBOINCBaseFrame* pFrame = wxGetApp().GetFrame(); + if (pFrame) { + pFrame->ShowAlert( + _("Missing application"), + _("Please download and install the CoRD application from http://cord.sourceforge.net"), + wxOK | wxICON_INFORMATION, + false + ); + } + return ERR_FILE_MISSING; + } + + strCommand = wxT("osascript -e 'tell application \"CoRD\"' -e 'activate' -e 'open location \"rdp://") + strConnection + wxT("\"' -e 'end tell'"); + strCommand.Replace(wxT("localhost"), wxT("127.0.0.1")); + system(strCommand.char_str()); +#endif + } + + return iRetVal; +} + + int CMainDocument::WorkAbort(char* url, char* name) { int iRetVal = 0; diff -Nru boinc-7.0.7+dfsg/clientgui/MainDocument.h boinc-7.0.14+dfsg/clientgui/MainDocument.h --- boinc-7.0.7+dfsg/clientgui/MainDocument.h 2011-06-23 09:15:40.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/MainDocument.h 2012-01-12 22:05:25.000000000 +0000 @@ -270,6 +270,7 @@ int WorkSuspend(char* url, char* name); int WorkResume(char* url, char* name); int WorkShowGraphics(RESULT* result); + int WorkShowVMConsole(RESULT* result); int WorkAbort(char* url, char* name); CC_STATE* GetState() { return &state; }; Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/res/progress.ico and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/res/progress.ico differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/res/ProgThruProc.icns and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/res/ProgThruProc.icns differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/res/PTP_install.icns and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/res/PTP_install.icns differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/res/PTP_uninstall.icns and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/res/PTP_uninstall.icns differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/app_icon_16x16.gif and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/app_icon_16x16.gif differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/app_icon_48x48.gif and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/app_icon_48x48.gif differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwLeftClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwLeftClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwLeft.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwLeft.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwRightClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwRightClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwRight.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/arwRight.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAddProjectClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAddProjectClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAddProject.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAddProject.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAdvancedView.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAdvancedView.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAdvancedView.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnAdvancedView.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCancelClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCancelClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCancel.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCancel.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnChangeClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnChangeClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnChange.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnChange.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnClearClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnClearClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnClear.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnClear.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCloseClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCloseClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnClose.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnClose.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopyAllClicked.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopyAllClicked.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopyAll.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopyAll.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopyClicked.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopyClicked.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopy.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnCopy.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnHelpClicked.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnHelpClicked.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnHelp.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnHelp.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessagesAlert.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessagesAlert.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessages.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessages.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessagesOrange.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessagesOrange.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessages.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnMessages.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnPreferences.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnPreferences.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnPreferences.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnPreferences.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnResume.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnResume.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSaveClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSaveClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSave.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSave.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSnooze.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSnooze.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSynchronizeClick.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSynchronizeClick.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSynchronize.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSynchronize.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSynchronize.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/btnSynchronize.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/conn_ind.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/conn_ind.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/default_stat_icon.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/default_stat_icon.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/disable_tab.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/disable_tab.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/dlgBackground.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/dlgBackground.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/error_image.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/error_image.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gauge_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gauge_bg.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gauge_progress_indicator.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gauge_progress_indicator.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_background.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_background.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_icon_play.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_icon_play.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid1_bg.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid1_bg.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid1_bg.PNG and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid1_bg.PNG differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid_bg.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid_bg.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/grid_bg.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_pause.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_pause.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_play.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_play.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_stop.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_stop.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_wizard_bar.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/gr_wizard_bar.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ico_workWU.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ico_workWU.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ico_workWU_sus.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ico_workWU_sus.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/proj_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/proj_bg.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/project_image.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/project_image.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_background.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_background.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_icon_play.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_icon_play.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_pause.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_pause.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_play.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_play.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_stop.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_stop.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_wizard_bar.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/ptp_wizard_bar.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/PTP_wizard.bmp and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/PTP_wizard.bmp differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/simplegui_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/simplegui_bg.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/spacer.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/spacer.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/state_ind_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/state_ind_bg.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/suspend_button.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/suspend_button.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/tabArea_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/tabArea_bg.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/tab_back_next.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/tab_back_next.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/tab_disable.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/tab_disable.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/tab_rollover.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/tab_rollover.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_animation_background.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_animation_background.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_animation_background.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_animation_background.png differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_gauge_background_image.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_gauge_background_image.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_tab_area_background.jpg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/workunit_tab_area_background.jpg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/graphic/wu_bg.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/graphic/wu_bg.png differ diff -Nru boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/skin.xml boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/skin.xml --- boinc-7.0.7+dfsg/clientgui/skins/Progress Thru Processors/skin.xml 2011-10-24 18:06:14.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/skins/Progress Thru Processors/skin.xml 2011-12-14 10:18:01.000000000 +0000 @@ -1,256 +1,261 @@ - - - - - - - - - graphic/grid_bg.png - 0:180:241 - - - - - graphic/spacer.png - - - 0:125:198 - - - graphic/state_ind_bg.png - - - - - graphic/conn_ind.png - - - - - graphic/error_image.png - - - - - graphic/ico_workWU.png - 206:207:207 - 208:208:208 - 200:200:200 - - - - - graphic/ico_workWU_sus.png - 134:149:158 - 167:167:167 - 125:141:151 - - - - - graphic/tabArea_bg.png - - - - - graphic/wu_bg.png - - - - - graphic/project_image.png - - - - - graphic/workunit_animation_background.png - - - - - graphic/gauge_bg.png - - - - - graphic/gauge_progress_indicator.png - - - - - graphic/proj_bg.png - - - - - graphic/default_stat_icon.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - graphic/btnMessages.png - - - - - graphic/btnMessagesOrange.gif - - - - - graphic/btnSnooze.png - - - - - graphic/btnResume.gif - - - - - graphic/btnPreferences.png - - - - - graphic/btnAdvancedView.png - - - - - graphic/grid1_bg.png - - - - - - - Progress Thru Processors Desktop - Progress Thru Processors - - - - graphic/app_icon_16x16.gif - 0:0:0 - - - - - - graphic/app_icon_16x16.gif - 0:0:0 - - - - - - graphic/app_icon_16x16.gif - 0:0:0 - - - - Progress Thru Processors - - http://www.gridrepublic.org - http://www.gridrepublic.org/index.php?param=contact - - - 0 - This will shut down Progress Thru Processors and its tasks entirely - until Progress Thru Processors Desktop is run again. - - In most cases, it is better to avoid exiting the program. Instead - simply close the Progress Thru Processors Desktop Window. - - - - - - Progress Thru Processors Desktop - Attach to Project - - graphic/gr_wizard_bar.png - - - - Progress Thru Processors Desktop - Attach to Account Manager/Update Account Manager - - graphic/gr_wizard_bar.png - - - - - + + + + + + + + + graphic/simplegui_bg.png + 16:46:80 + + + + + graphic/spacer.png + + + 38:172:226 + + + graphic/state_ind_bg.png + + + + + graphic/conn_ind.png + + + + + graphic/error_image.png + + + + + graphic/ico_workWU.png + 20:113:185 + 20:113:185 + 20:113:185 + + + + + graphic/ico_workWU_sus.png + 17:71:126 + 17:71:126 + 17:71:126 + + + + + graphic/tabArea_bg.png + + + + + graphic/wu_bg.png + + + + + graphic/project_image.png + + + + + graphic/ptp_background.png + + + + + graphic/gauge_bg.png + + + + + graphic/gauge_progress_indicator.png + + + + + graphic/proj_bg.png + + + + + graphic/default_stat_icon.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + graphic/btnMessages.png + + + + + graphic/btnMessagesAlert.png + + + + + graphic/btnSnooze.png + + + + + graphic/btnResume.png + + + + + graphic/btnPreferences.png + + + + + graphic/btnAdvancedView.png + + + + + graphic/dlgBackground.png + + + + + + + Progress Thru Processors Desktop + Progress Thru Processors + + + + graphic/ptp_icon_play.png + + + + + + graphic/ptp_stop.png + + + + + + graphic/ptp_pause.png + + + + graphic/ptp_about.ico + + Progress Thru Processors + + http://www.facebook.com/progressthruprocessors + mailto:mlb@gridrepublic.org + + + 0 + This will shut down Progress Thru Processors and its tasks entirely + until Progress Thru Processors Desktop is run again. + + In most cases, it is better to avoid exiting the program. Instead + simply close the Progress Thru Processors Desktop Window. + + + + + + Progress Thru Processors Desktop - Attach to Project + + graphic/ptp_wizard_bar.png + + + + + + graphic/ptp_wizard_bar.png + + + + + \ No newline at end of file diff -Nru boinc-7.0.7+dfsg/clientgui/stdwx.h boinc-7.0.14+dfsg/clientgui/stdwx.h --- boinc-7.0.7+dfsg/clientgui/stdwx.h 2011-12-14 16:54:50.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/stdwx.h 2012-01-25 11:51:31.000000000 +0000 @@ -115,7 +115,6 @@ #include #include #include -#include // splitter control support #ifdef _WIN32 // Visual Studio 2005 has extended the C Run-Time Library by including "secure" diff -Nru boinc-7.0.7+dfsg/clientgui/ViewNotices.cpp boinc-7.0.14+dfsg/clientgui/ViewNotices.cpp --- boinc-7.0.7+dfsg/clientgui/ViewNotices.cpp 2011-12-14 16:54:50.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/ViewNotices.cpp 2012-01-06 23:37:40.000000000 +0000 @@ -51,10 +51,18 @@ // // Setup View // + wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(1, 1, 0); + wxASSERT(itemFlexGridSizer); + + itemFlexGridSizer->AddGrowableRow(0); + itemFlexGridSizer->AddGrowableCol(0); + m_pHtmlListPane = new CNoticeListCtrl(this); wxASSERT(m_pHtmlListPane); - Initialize(m_pHtmlListPane); + itemFlexGridSizer->Add(m_pHtmlListPane, 1, wxGROW|wxALL, 1); + + SetSizer(itemFlexGridSizer); } diff -Nru boinc-7.0.7+dfsg/clientgui/ViewResources.cpp boinc-7.0.14+dfsg/clientgui/ViewResources.cpp --- boinc-7.0.7+dfsg/clientgui/ViewResources.cpp 2011-12-14 16:54:50.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/ViewResources.cpp 2012-01-27 19:24:20.000000000 +0000 @@ -47,14 +47,11 @@ { m_BOINCwasEmpty=false; - wxPanel* pPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); - wxASSERT(pPanel); - wxGridSizer* itemGridSizer = new wxGridSizer(2, 0, 3); wxASSERT(itemGridSizer); // create pie chart ctrl for total disk usage - m_pieCtrlTotal = new wxPieCtrl(pPanel, ID_PIECTRL_RESOURCEUTILIZATIONVIEWTOTAL, wxDefaultPosition, wxDefaultSize); + m_pieCtrlTotal = new wxPieCtrl(this, ID_PIECTRL_RESOURCEUTILIZATIONVIEWTOTAL, wxDefaultPosition, wxDefaultSize); wxASSERT(m_pieCtrlTotal); // setup the legend @@ -75,7 +72,7 @@ // create pie chart ctrl for BOINC disk usage - m_pieCtrlBOINC = new wxPieCtrl(pPanel, ID_PIECTRL_RESOURCEUTILIZATIONVIEW, wxDefaultPosition, wxDefaultSize); + m_pieCtrlBOINC = new wxPieCtrl(this, ID_PIECTRL_RESOURCEUTILIZATIONVIEW, wxDefaultPosition, wxDefaultSize); wxASSERT(m_pieCtrlBOINC); //setup the legend @@ -98,10 +95,7 @@ itemGridSizer->Add(m_pieCtrlTotal, 1, wxGROW|wxALL,1); itemGridSizer->Add(m_pieCtrlBOINC, 1, wxGROW|wxALL,1); - pPanel->SetSizer(itemGridSizer); - pPanel->Layout(); - - Initialize(pPanel); + SetSizer(itemGridSizer); UpdateSelection(); } @@ -171,6 +165,24 @@ return true; } +void hsv2rgb(double h, double s, double v, double& r, double& g, double& b) { + double m, n, f; + int i = floor(h); + f = h - i; + if (!(i&1)) f = 1 - f; + m = v * (1 - s); + n = v * (1 - s*f); + switch (i) { + case 6: + case 0: r = v; g = n; b = m; return; + case 1: r = n; g = v; b = m; return; + case 2: r = m; g = v; b = n; return; + case 3: r = m; g = n; b = v; return; + case 4: r = n; g = m; b = v; return; + case 5: r = v; g = m; b = n; return; + } +} + void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) { CMainDocument* pDoc = wxGetApp().GetDocument(); wxString diskspace; @@ -216,10 +228,15 @@ wxPiePart part; part.SetLabel(projectname + wxT(": ") + diskspace); part.SetValue(usage); - unsigned char r=128+(rand()&127); - unsigned char g=128+(rand()&127); - unsigned char b=128+(rand()&127); - part.SetColour(wxColour(r, g, b)); + double h = (double)i/(double)pDoc->disk_usage.projects.size(); + double r, g, b; + double v = .5 + (i % 3)*.2; + // cycle through 3 different brightnesses + hsv2rgb(h*6, .5, v, r, g, b); + unsigned char cr = (unsigned char) (r*256); + unsigned char cg = (unsigned char) (g*256); + unsigned char cb = (unsigned char) (b*256); + part.SetColour(wxColour(cr, cg, cb)); m_pieCtrlBOINC->m_Series.Add(part); } m_pieCtrlBOINC->Refresh(); diff -Nru boinc-7.0.7+dfsg/clientgui/ViewStatistics.cpp boinc-7.0.14+dfsg/clientgui/ViewStatistics.cpp --- boinc-7.0.7+dfsg/clientgui/ViewStatistics.cpp 2011-12-14 16:54:50.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/ViewStatistics.cpp 2012-01-06 17:12:19.000000000 +0000 @@ -1940,13 +1940,24 @@ // // Setup View // + wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(2, 0, 0); + wxASSERT(itemFlexGridSizer); + + itemFlexGridSizer->AddGrowableRow(0); + itemFlexGridSizer->AddGrowableCol(1); + m_pTaskPane = new CBOINCTaskCtrl(this, ID_TASK_STATISTICSVIEW, DEFAULT_TASK_FLAGS); wxASSERT(m_pTaskPane); m_PaintStatistics = new CPaintStatistics(this, ID_LIST_STATISTICSVIEW, wxDefaultPosition, wxSize(-1, -1), 0); wxASSERT(m_PaintStatistics); - SplitVertically(m_pTaskPane, m_PaintStatistics, 250); + itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1); + itemFlexGridSizer->Add(m_PaintStatistics, 1, wxGROW|wxALL, 1); + + SetSizer(itemFlexGridSizer); + + Layout(); pGroup = new CTaskItemGroup( _("Commands") ); m_TaskGroups.push_back( pGroup ); diff -Nru boinc-7.0.7+dfsg/clientgui/ViewWork.cpp boinc-7.0.14+dfsg/clientgui/ViewWork.cpp --- boinc-7.0.7+dfsg/clientgui/ViewWork.cpp 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/ViewWork.cpp 2012-01-13 19:26:24.000000000 +0000 @@ -52,9 +52,10 @@ // buttons in the "tasks" area #define BTN_ACTIVE_ONLY 0 #define BTN_GRAPHICS 1 -#define BTN_SUSPEND 2 -#define BTN_ABORT 3 -#define BTN_PROPERTIES 4 +#define BTN_VMCONSOLE 2 +#define BTN_SUSPEND 3 +#define BTN_ABORT 4 +#define BTN_PROPERTIES 5 CWork::CWork() { @@ -83,6 +84,7 @@ BEGIN_EVENT_TABLE (CViewWork, CBOINCBaseView) EVT_BUTTON(ID_TASK_WORK_SUSPEND, CViewWork::OnWorkSuspend) EVT_BUTTON(ID_TASK_WORK_SHOWGRAPHICS, CViewWork::OnWorkShowGraphics) + EVT_BUTTON(ID_TASK_WORK_VMCONSOLE, CViewWork::OnWorkShowVMConsole) EVT_BUTTON(ID_TASK_WORK_ABORT, CViewWork::OnWorkAbort) EVT_BUTTON(ID_TASK_SHOW_PROPERTIES, CViewWork::OnShowItemProperties) EVT_BUTTON(ID_TASK_ACTIVE_ONLY, CViewWork::OnActiveTasksOnly) @@ -195,6 +197,13 @@ pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( + _("Show VM Console"), + _("Show VM Console in a window."), + ID_TASK_WORK_VMCONSOLE + ); + pGroup->m_Tasks.push_back( pItem ); + + pItem = new CTaskItem( _("Suspend"), _("Suspend work for this result."), ID_TASK_WORK_SUSPEND @@ -361,6 +370,7 @@ wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkSuspend - Function End")); } + void CViewWork::OnWorkShowGraphics( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkShowGraphics - Function Begin")); @@ -398,6 +408,43 @@ } +void CViewWork::OnWorkShowVMConsole( wxCommandEvent& WXUNUSED(event) ) { + wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkShowVMConsole - Function Begin")); + + CMainDocument* pDoc = wxGetApp().GetDocument(); + CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); + RESULT* result; + int row; + + wxASSERT(pDoc); + wxASSERT(wxDynamicCast(pDoc, CMainDocument)); + wxASSERT(pFrame); + wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); + wxASSERT(m_pListPane); + + pFrame->UpdateStatusText(_("Showing VM console for task...")); + + row = -1; + while (1) { + // Step through all selected items + row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + if (row < 0) break; + + result = pDoc->result(m_iSortedIndexes[row]); + if (result) { + pDoc->WorkShowVMConsole(result); + } + } + + pFrame->UpdateStatusText(wxT("")); + + UpdateSelection(); + pFrame->FireRefreshView(); + + wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkShowVMConsole - Function End")); +} + + void CViewWork::OnWorkAbort( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewWork::OnWorkAbort - Function Begin")); @@ -671,8 +718,10 @@ CMainDocument* pDoc = wxGetApp().GetDocument(); std::string first_project_url; wxString strMachineName; - bool wasSuspended=false, all_same_project=false; + bool wasSuspended=false; + bool all_same_project=false; bool enableShowGraphics = false; + bool enableShowVMConsole = false; bool enableSuspendResume = false; bool enableAbort = false; bool enableProperties = false; @@ -688,17 +737,20 @@ n = m_pListPane->GetSelectedItemCount(); if (n > 0) { enableShowGraphics = true; + enableShowVMConsole = true; enableSuspendResume = true; enableAbort = true; pDoc->GetCoreClientStatus(status); if (status.task_suspend_reason & ~(SUSPEND_REASON_CPU_THROTTLE)) { enableShowGraphics = false; + enableShowVMConsole = false; } pDoc->GetConnectedComputerName(strMachineName); if (!pDoc->IsComputerNameLocal(strMachineName)) { enableShowGraphics = false; + enableShowVMConsole = false; } } @@ -747,17 +799,24 @@ } } + // Disable Show VM console if the selected task hasn't registered a remote + // desktop connection + // + if (!strlen(result->remote_desktop_addr)) { + enableShowVMConsole = false; + } + // Disable Show Graphics button if the selected task can't display graphics // if (!strlen(result->web_graphics_url) && !strlen(result->graphics_exec_path)) { - enableShowGraphics = false; + enableShowGraphics = false; } if (result->suspended_via_gui || result->project_suspended_via_gui || (result->scheduler_state != CPU_SCHED_SCHEDULED) ) { - enableShowGraphics = false; + enableShowGraphics = false; } // Disable Abort button if any selected task already aborted @@ -785,6 +844,13 @@ // To minimize flicker, set each button only once to the final desired state pGroup->m_Tasks[BTN_GRAPHICS]->m_pButton->Enable(enableShowGraphics); + if (enableShowVMConsole) { + pGroup->m_Tasks[BTN_VMCONSOLE]->m_pButton->Enable(); + pGroup->m_Tasks[BTN_VMCONSOLE]->m_pButton->Show(); + } else { + pGroup->m_Tasks[BTN_VMCONSOLE]->m_pButton->Disable(); + pGroup->m_Tasks[BTN_VMCONSOLE]->m_pButton->Hide(); + } pGroup->m_Tasks[BTN_SUSPEND]->m_pButton->Enable(enableSuspendResume); pGroup->m_Tasks[BTN_ABORT]->m_pButton->Enable(enableAbort); pGroup->m_Tasks[BTN_PROPERTIES]->m_pButton->Enable(enableProperties); diff -Nru boinc-7.0.7+dfsg/clientgui/ViewWork.h boinc-7.0.14+dfsg/clientgui/ViewWork.h --- boinc-7.0.7+dfsg/clientgui/ViewWork.h 2010-05-07 16:14:54.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/ViewWork.h 2012-01-12 22:05:25.000000000 +0000 @@ -69,6 +69,7 @@ void OnWorkSuspend( wxCommandEvent& event ); void OnWorkShowGraphics( wxCommandEvent& event ); + void OnWorkShowVMConsole( wxCommandEvent& event ); void OnWorkAbort( wxCommandEvent& event ); void OnShowItemProperties( wxCommandEvent& event ); void OnActiveTasksOnly( wxCommandEvent& event ); diff -Nru boinc-7.0.7+dfsg/clientgui/WizardAttach.cpp boinc-7.0.14+dfsg/clientgui/WizardAttach.cpp --- boinc-7.0.7+dfsg/clientgui/WizardAttach.cpp 2011-06-15 21:00:02.000000000 +0000 +++ boinc-7.0.14+dfsg/clientgui/WizardAttach.cpp 2011-12-20 11:49:12.000000000 +0000 @@ -516,8 +516,8 @@ if (m_PageTransition.size() > 0) { pPage = m_PageTransition.top(); m_PageTransition.pop(); - if ((pPage == m_ProjectPropertiesPage) || (pPage == m_ProjectProcessingPage) || - (pPage == m_AccountManagerPropertiesPage) || (pPage == m_AccountManagerProcessingPage)) + if ((pPage == m_ProjectProcessingPage) || + (pPage == m_AccountManagerProcessingPage)) { // We want to go back to the page before we attempted to communicate // with any server. Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/clientscr/res/ProgThruProc_ss_logo.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/clientscr/res/ProgThruProc_ss_logo.png differ diff -Nru boinc-7.0.7+dfsg/clientscr/screensaver.cpp boinc-7.0.14+dfsg/clientscr/screensaver.cpp --- boinc-7.0.7+dfsg/clientscr/screensaver.cpp 2011-12-27 21:02:38.000000000 +0000 +++ boinc-7.0.14+dfsg/clientscr/screensaver.cpp 2012-01-29 07:25:55.000000000 +0000 @@ -84,6 +84,7 @@ // Count the number of active graphics-capable apps excluding the specified result. // If exclude is NULL, don't exclude any results. + // for (i = 0; i < results.results.size(); i++) { BOINCTRACE(_T("get_random_graphics_app -- active task detected\n")); BOINCTRACE( @@ -105,7 +106,9 @@ // Exclude the specified result unless it is the only candidate. // If exclude is NULL or an empty string, don't exclude any results. // -RESULT* CScreensaver::get_random_graphics_app(RESULTS& results, RESULT* exclude) { +RESULT* CScreensaver::get_random_graphics_app( + RESULTS& results, RESULT* exclude +) { RESULT* rp = NULL; unsigned int i = 0; unsigned int graphics_app_count = 0; @@ -130,10 +133,12 @@ } // Choose which application to display. + // random_selection = (rand() % graphics_app_count) + 1; BOINCTRACE(_T("get_random_graphics_app -- random_selection = '%d'\n"), random_selection); - // Lets find the chosen graphics application. + // find the chosen graphics application. + // for (i = 0; i < results.results.size(); i++) { if (!strlen(results.results[i]->graphics_exec_path)) continue; if (is_same_task(results.results[i], avoid)) continue; @@ -155,11 +160,10 @@ // Launch a project (science) graphics application // #ifdef _WIN32 -int CScreensaver::launch_screensaver(RESULT* rp, HANDLE& graphics_application) +int CScreensaver::launch_screensaver(RESULT* rp, HANDLE& graphics_application) { #else -int CScreensaver::launch_screensaver(RESULT* rp, int& graphics_application) +int CScreensaver::launch_screensaver(RESULT* rp, int& graphics_application) { #endif -{ int retval = 0; if (strlen(rp->graphics_exec_path)) { // V6 Graphics @@ -209,11 +213,10 @@ // Terminate any screensaver graphics application // #ifdef _WIN32 -int CScreensaver::terminate_v6_screensaver(HANDLE& graphics_application) +int CScreensaver::terminate_v6_screensaver(HANDLE& graphics_application) { #else -int CScreensaver::terminate_v6_screensaver(int& graphics_application) +int CScreensaver::terminate_v6_screensaver(int& graphics_application) { #endif -{ int retval = 0; #ifdef __APPLE__ @@ -237,7 +240,7 @@ argv[2] = gfx_pid; argv[3] = 0; - retval = run_program( + retval = run_program( current_dir, m_gfx_Switcher_Path, 3, @@ -276,11 +279,10 @@ // Terminate the project (science) graphics application // #ifdef _WIN32 -int CScreensaver::terminate_screensaver(HANDLE& graphics_application, RESULT *worker_app) +int CScreensaver::terminate_screensaver(HANDLE& graphics_application, RESULT *worker_app) { #else -int CScreensaver::terminate_screensaver(int& graphics_application, RESULT *worker_app) +int CScreensaver::terminate_screensaver(int& graphics_application, RESULT *worker_app) { #endif -{ int retval = 0; if (graphics_application) { @@ -296,11 +298,10 @@ // Launch the default graphics application // #ifdef _WIN32 -int CScreensaver::launch_default_screensaver(char *dir_path, HANDLE& graphics_application) +int CScreensaver::launch_default_screensaver(char *dir_path, HANDLE& graphics_application) { #else -int CScreensaver::launch_default_screensaver(char *dir_path, int& graphics_application) +int CScreensaver::launch_default_screensaver(char *dir_path, int& graphics_application) { #endif -{ int retval = 0; int num_args; @@ -323,7 +324,7 @@ num_args = 4; } - retval = run_program( + retval = run_program( dir_path, m_gfx_Switcher_Path, num_args, @@ -377,11 +378,10 @@ // Terminate the default graphics application // #ifdef _WIN32 -int CScreensaver::terminate_default_screensaver(HANDLE& graphics_application) +int CScreensaver::terminate_default_screensaver(HANDLE& graphics_application) { #else -int CScreensaver::terminate_default_screensaver(int& graphics_application) +int CScreensaver::terminate_default_screensaver(int& graphics_application) { #endif -{ int retval = 0; if (! graphics_application) return 0; @@ -401,11 +401,10 @@ // and so we run only project (science) graphics. #ifdef _WIN32 -DWORD WINAPI CScreensaver::DataManagementProc() +DWORD WINAPI CScreensaver::DataManagementProc() { #else -void *CScreensaver::DataManagementProc() +void *CScreensaver::DataManagementProc() { #endif -{ int retval = 0; int suspend_reason = 0; RESULT* theResult = NULL; @@ -474,7 +473,6 @@ } while (true) { - for (int i = 0; i < 4; i++) { // *** // *** Things that should be run frequently. @@ -698,7 +696,9 @@ } } // End if (m_bScience_gfx_running) - // If no current graphics app, pick an active task at random and launch its graphics app + // If no current graphics app, pick an active task at random + // and launch its graphics app + // if ((m_bDefault_gfx_running || (m_hGraphicsApplication == 0)) && (graphics_app_result_ptr == NULL)) { graphics_app_result_ptr = get_random_graphics_app(results, previous_result_ptr); previous_result_ptr = NULL; @@ -714,7 +714,8 @@ // dtime(), default_saver_start_time_in_science_phase, default_saver_duration_in_science_phase); } default_saver_start_time_in_science_phase = 0; - // HasProcessExited() test will clear m_hGraphicsApplication and graphics_app_result_ptr + // HasProcessExited() test will clear + // m_hGraphicsApplication and graphics_app_result_ptr } else { retval = launch_screensaver(graphics_app_result_ptr, m_hGraphicsApplication); if (retval) { @@ -723,7 +724,9 @@ graphics_app_result_ptr = NULL; m_bScience_gfx_running = false; } else { - SetError(FALSE, SCRAPPERR_BOINCSCREENSAVERLOADING); // A GFX App is running: hide moving BOINC logo + // A GFX App is running: hide moving BOINC logo + // + SetError(FALSE, SCRAPPERR_BOINCSCREENSAVERLOADING); last_change_time = dtime(); m_bScience_gfx_running = true; // Make a local copy of current result, since original pointer @@ -760,11 +763,13 @@ previous_result_ptr = NULL; graphics_app_result_ptr = NULL; m_bDefault_gfx_running = false; - SetError(TRUE, SCRAPPERR_CANTLAUNCHDEFAULTGFXAPP); // No GFX App is running: show BOINC logo + SetError(TRUE, SCRAPPERR_CANTLAUNCHDEFAULTGFXAPP); + // No GFX App is running: show BOINC logo } else { m_bDefault_gfx_running = true; default_saver_start_time_in_science_phase = dtime(); - SetError(FALSE, SCRAPPERR_BOINCSCREENSAVERLOADING); // Default GFX App is running: hide moving BOINC logo + SetError(FALSE, SCRAPPERR_BOINCSCREENSAVERLOADING); + // Default GFX App is running: hide moving BOINC logo } } } @@ -779,20 +784,25 @@ // application. Start a different one. BOINCTRACE(_T("CScreensaver::DataManagementProc - Graphics application isn't running, start a new one.\n")); if (m_bDefault_gfx_running) { - // If we were able to connect to core client but gfx app can't, don't use it. + // If we were able to connect to core client + // but gfx app can't, don't use it. + // BOINCTRACE(_T("CScreensaver::DataManagementProc - Default graphics application exited with code %d.\n"), exit_status); if (!killing_default_gfx) { // If this is an unexpected exit if (exit_status == DEFAULT_GFX_CANT_CONNECT) { - SetError(TRUE, SCRAPPERR_DEFAULTGFXAPPCANTCONNECT); // No GFX App is running: show moving BOINC logo + SetError(TRUE, SCRAPPERR_DEFAULTGFXAPPCANTCONNECT); + // No GFX App is running: show moving BOINC logo } else { - SetError(TRUE, SCRAPPERR_DEFAULTGFXAPPCRASHED); // No GFX App is running: show moving BOINC logo + SetError(TRUE, SCRAPPERR_DEFAULTGFXAPPCRASHED); + // No GFX App is running: show moving BOINC logo } m_bDefault_ss_exists = false; ss_phase = SCIENCE_SS_PHASE; } killing_default_gfx = false; } - SetError(TRUE, SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING); // No GFX App is running: show moving BOINC logo + SetError(TRUE, SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING); + // No GFX App is running: show moving BOINC logo m_hGraphicsApplication = 0; graphics_app_result_ptr = NULL; m_bDefault_gfx_running = false; @@ -831,8 +841,7 @@ #endif -void CScreensaver::GetDefaultDisplayPeriods(struct ss_periods &periods) -{ +void CScreensaver::GetDefaultDisplayPeriods(struct ss_periods &periods) { char* default_data_dir_path = NULL; char buf[1024]; FILE* f; @@ -859,15 +868,19 @@ mf.init_file(f); XML_PARSER xp(&mf); - while (mf.fgets(buf, sizeof(buf))) { - if (parse_bool(buf, "default_ss_first", periods.Show_default_ss_first)) continue; - if (parse_double(buf, "", periods.GFXDefaultPeriod)) continue; - if (parse_double(buf, "", periods.GFXSciencePeriod)) continue; - if (parse_double(buf, "", periods.GFXChangePeriod)) continue; - + while (!xp.get_tag()) { + if (xp.parse_bool("default_ss_first", periods.Show_default_ss_first)) continue; + if (xp.parse_double("default_gfx_duration", periods.GFXDefaultPeriod)) continue; + if (xp.parse_double("science_gfx_duration", periods.GFXSciencePeriod)) continue; + if (xp.parse_double("science_gfx_change_interval", periods.GFXChangePeriod)) continue; } fclose(f); - BOINCTRACE(_T("CScreensaver::GetDefaultDisplayPeriods: m_bShow_default_ss_first=%d, m_fGFXDefaultPeriod=%f, m_fGFXSciencePeriod=%f, m_fGFXChangePeriod=%f\n"), - (int)periods.Show_default_ss_first, periods.GFXDefaultPeriod, periods.GFXSciencePeriod, periods.GFXChangePeriod); + BOINCTRACE( + _T("CScreensaver::GetDefaultDisplayPeriods: m_bShow_default_ss_first=%d, m_fGFXDefaultPeriod=%f, m_fGFXSciencePeriod=%f, m_fGFXChangePeriod=%f\n"), + (int)periods.Show_default_ss_first, + periods.GFXDefaultPeriod, + periods.GFXSciencePeriod, + periods.GFXChangePeriod + ); } diff -Nru boinc-7.0.7+dfsg/configure.ac boinc-7.0.14+dfsg/configure.ac --- boinc-7.0.7+dfsg/configure.ac 2011-12-30 17:44:49.000000000 +0000 +++ boinc-7.0.14+dfsg/configure.ac 2012-02-02 19:57:12.000000000 +0000 @@ -1,12 +1,12 @@ dnl -*- autoconf -*- -dnl $Id: configure.ac 24950 2011-12-30 17:44:49Z romw $ +dnl $Id: configure.ac 25190 2012-02-02 19:57:12Z romw $ dnl not sure exactly what the minimum version is (but 2.13 wont work) AC_PREREQ(2.58) dnl Set the BOINC version here. You can also use the set-version script. -AC_INIT(BOINC, 7.0.7) +AC_INIT(BOINC, 7.0.14) AC_CONFIG_MACRO_DIR([m4]) LIBBOINC_VERSION=`echo ${PACKAGE_VERSION} | sed 's/\./:/g'` AC_SUBST([LIBBOINC_VERSION]) @@ -19,8 +19,8 @@ AC_CONFIG_SRCDIR(lib/shmem.cpp) -AC_REVISION([$Revision: 24950 $]) -REV=`echo '$Revision: 24950 $' | awk "{print $2}"` +AC_REVISION([$Revision: 25190 $]) +REV=`echo '$Revision: 25190 $' | awk "{print $2}"` RDATE=`date '+%Y.%m.%d'` if test -d .svn ; then REV=`svn info | grep Revision | awk '{print $2}'` @@ -937,6 +937,9 @@ test/version.inc tools/boinc_path_config.py:py/boinc_path_config.py.in tools/Makefile + zip/Makefile + zip/zip/Makefile + zip/unzip/Makefile m4/Makefile ]) diff -Nru boinc-7.0.7+dfsg/db/boinc_db.cpp boinc-7.0.14+dfsg/db/boinc_db.cpp --- boinc-7.0.7+dfsg/db/boinc_db.cpp 2011-11-09 17:27:50.000000000 +0000 +++ boinc-7.0.14+dfsg/db/boinc_db.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -86,6 +86,8 @@ working_set_removal = false; } void FILESET_SCHED_TRIGGER_ITEM::clear() {memset(this, 0, sizeof(*this));} +void VDA_FILE::clear() {memset(this, 0, sizeof(*this));} +void VDA_CHUNK_HOST::clear() {memset(this, 0, sizeof(*this));} DB_PLATFORM::DB_PLATFORM(DB_CONN* dc) : DB_BASE("platform", dc?dc:&boinc_db){} @@ -147,6 +149,10 @@ DB_BASE_SPECIAL(dc?dc:&boinc_db){} DB_FILESET_SCHED_TRIGGER_ITEM_SET::DB_FILESET_SCHED_TRIGGER_ITEM_SET(DB_CONN* dc) : DB_BASE_SPECIAL(dc?dc:&boinc_db){} +DB_VDA_FILE::DB_VDA_FILE(DB_CONN* dc) : + DB_BASE("vda_file", dc?dc:&boinc_db){} +DB_VDA_CHUNK_HOST::DB_VDA_CHUNK_HOST(DB_CONN* dc) : + DB_BASE("vda_chunk_host", dc?dc:&boinc_db){} int DB_PLATFORM::get_id() {return id;} int DB_APP::get_id() {return id;} @@ -163,6 +169,7 @@ int DB_FILE::get_id() {return id;} int DB_FILESET::get_id() {return id;} int DB_SCHED_TRIGGER::get_id() {return id;} +int DB_VDA_FILE::get_id() {return id;} void DB_PLATFORM::db_print(char* buf){ sprintf(buf, @@ -782,6 +789,22 @@ return get_double(query, fpops); } +int DB_HOST::fpops_mean(double& mean) { + char query[256]; + sprintf(query, + "select avg(p_fpops) from host where expavg_credit>10" + ); + return get_double(query, mean); +} + +int DB_HOST::fpops_stddev(double& stddev) { + char query[256]; + sprintf(query, + "select stddev(p_fpops) from host where expavg_credit>10" + ); + return get_double(query, stddev); +} + void DB_WORKUNIT::db_print(char* buf){ sprintf(buf, "create_time=%d, appid=%d, " @@ -799,7 +822,8 @@ "priority=%d, " "rsc_bandwidth_bound=%.15e, " "fileset_id=%d, " - "app_version_id=%d ", + "app_version_id=%d, " + "transitioner_flags=%d ", create_time, appid, name, xml_doc, batch, rsc_fpops_est, rsc_fpops_bound, rsc_memory_bound, rsc_disk_bound, @@ -817,7 +841,8 @@ priority, rsc_bandwidth_bound, fileset_id, - app_version_id + app_version_id, + transitioner_flags ); } @@ -855,6 +880,7 @@ rsc_bandwidth_bound = atof(r[i++]); fileset_id = atoi(r[i++]); app_version_id = atoi(r[i++]); + transitioner_flags = atoi(r[i++]); } void DB_CREDITED_JOB::db_print(char* buf){ @@ -1061,7 +1087,7 @@ target_type, multi, workunitid, - resultid + _resultid ); } @@ -1074,7 +1100,7 @@ target_type = atoi(r[i++]); multi = atoi(r[i++]); workunitid = atoi(r[i++]); - resultid = atoi(r[i++]); + _resultid = atoi(r[i++]); } int DB_HOST_APP_VERSION::update_scheduler(DB_HOST_APP_VERSION& orig) { @@ -1267,6 +1293,7 @@ hr_class = atoi(r[i++]); batch = atoi(r[i++]); app_version_id = atoi(r[i++]); + transitioner_flags = atoi(r[i++]); // use safe_atoi() from here on cuz they might not be there // @@ -1326,6 +1353,7 @@ " wu.hr_class, " " wu.batch, " " wu.app_version_id, " + " wu.transitioner_flags, " " res.id, " " res.name, " " res.report_deadline, " @@ -1341,10 +1369,10 @@ " workunit AS wu " " LEFT JOIN result AS res ON wu.id = res.workunitid " "WHERE " - " wu.transition_time < %d %s " + " wu.transition_time < %d %s and transitioner_flags<>%d" "LIMIT " " %d ", - transition_time, mod_clause, nresult_limit + transition_time, mod_clause, TRANSITION_NONE, nresult_limit ); retval = db->do_query(query); @@ -2006,8 +2034,6 @@ for (i=0; i items; }; +struct VDA_FILE { + int id; + char dir[256]; + char name[256]; + double size; + double chunk_size; + double created; + bool need_update; + bool inited; + void clear(); +}; + +struct VDA_CHUNK_HOST { + int vda_file_id; + int host_id; // zero if we're waiting for a host + char name[256]; + bool present_on_host; + bool transfer_in_progress; + bool transfer_wait; + double transition_time; + void clear(); +}; + +struct DB_VDA_FILE : public DB_BASE, public VDA_FILE { + DB_VDA_FILE(DB_CONN* p=0); + int get_id(); + void db_print(char*); + void db_parse(MYSQL_ROW &row); +}; + +struct DB_VDA_CHUNK_HOST : public DB_BASE, public VDA_CHUNK_HOST { + DB_VDA_CHUNK_HOST(DB_CONN* p=0); + void db_print(char*); + void db_parse(MYSQL_ROW &row); +}; + #endif diff -Nru boinc-7.0.7+dfsg/db/constraints.sql boinc-7.0.14+dfsg/db/constraints.sql --- boinc-7.0.7+dfsg/db/constraints.sql 2010-03-29 22:28:20.000000000 +0000 +++ boinc-7.0.14+dfsg/db/constraints.sql 2012-01-30 22:39:13.000000000 +0000 @@ -126,3 +126,6 @@ alter table host_app_version add unique hap(host_id, app_version_id); + +alter table assignment + add index asgn_target(target_type, target_id); diff -Nru boinc-7.0.7+dfsg/db/schema.sql boinc-7.0.14+dfsg/db/schema.sql --- boinc-7.0.7+dfsg/db/schema.sql 2011-09-22 03:15:21.000000000 +0000 +++ boinc-7.0.14+dfsg/db/schema.sql 2012-01-30 22:39:13.000000000 +0000 @@ -237,12 +237,13 @@ max_error_results integer not null, max_total_results integer not null, max_success_results integer not null, - result_template_file varchar(63) not null, + result_template_file varchar(63) not null, priority integer not null, mod_time timestamp, rsc_bandwidth_bound double not null, fileset_id integer not null, app_version_id integer not null, + transitioner_flags tinyint not null, primary key (id) ) engine=InnoDB; @@ -366,6 +367,7 @@ workunitid integer not null, resultid integer not null, -- if not multi, the result + -- deprecated primary key (id) ) engine = InnoDB; diff -Nru boinc-7.0.7+dfsg/db/schema_vda.sql boinc-7.0.14+dfsg/db/schema_vda.sql --- boinc-7.0.7+dfsg/db/schema_vda.sql 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/db/schema_vda.sql 2012-01-23 21:59:12.000000000 +0000 @@ -0,0 +1,28 @@ +create table vda_file ( + id integer not null auto_increment, + dir varchar(254) not null, + name varchar(254) not null, + size double not null default 0, + chunk_size double not null default 0, + created double not null default 0, + need_update tinyint not null default 0, + inited tinyint not null default 0, + primary key(id) +) engine = InnoDB; + +alter table vda_file add unique(name); + +create table vda_chunk_host ( + vda_file_id integer not null default 0, + name varchar[256] not null, + host_id integer not null default 0, + present_on_host tinyint not null default 0, + transfer_in_progress tinyint not null default 0, + transfer_wait tinyint not null default 0, + transition_time double not null default 0 +) engine = InnoDB; + +alter table vda_chunk_host + add index vch_file (vda_file_id), + add index vch_host (host_id), + add index vch_tt (transition_time); diff -Nru boinc-7.0.7+dfsg/debian/boinc-client.init boinc-7.0.14+dfsg/debian/boinc-client.init --- boinc-7.0.7+dfsg/debian/boinc-client.init 2011-12-03 11:20:21.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/boinc-client.init 2012-01-21 22:12:20.000000000 +0000 @@ -3,7 +3,7 @@ # Provides: boinc # Required-Start: $all # Required-Stop: $local_fs $remote_fs -# Should-Start: x11-common, network-manager, gdm, kdm, dbus +# Should-Start: x11-common network-manager gdm kdm dbus # Should-Stop: x11-common # Default-Start: 4 5 # Default-Stop: 0 1 2 3 6 diff -Nru boinc-7.0.7+dfsg/debian/boinc-server-maker.dirs boinc-7.0.14+dfsg/debian/boinc-server-maker.dirs --- boinc-7.0.7+dfsg/debian/boinc-server-maker.dirs 2011-10-08 12:06:12.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/boinc-server-maker.dirs 2012-01-21 22:12:20.000000000 +0000 @@ -1,5 +1,6 @@ usr/lib/boinc-server/bin usr/lib/boinc-server/tools +usr/lib/boinc-server/sched usr/share/boinc-server/bin usr/share/boinc-server/lib usr/share/boinc-server/tools diff -Nru boinc-7.0.7+dfsg/debian/boinc-server-maker.install boinc-7.0.14+dfsg/debian/boinc-server-maker.install --- boinc-7.0.7+dfsg/debian/boinc-server-maker.install 2011-10-31 21:34:00.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/boinc-server-maker.install 2012-01-21 22:12:20.000000000 +0000 @@ -9,6 +9,10 @@ py/Boinc/*.py usr/share/boinc-server/py/Boinc/ sched/db_dump_spec.xml usr/share/boinc-server/sched +sched/transitioner_catchup.php usr/share/boinc-server/sched +#where is this? +#sched/request_file_list usr/share/boinc-server/sched +sched/put_file usr/lib/boinc-server/sched #test/uc_result usr/share/boinc-server/test #test/uc_wu_nodelete usr/share/boinc-server/test @@ -24,6 +28,12 @@ tools/appmgr usr/lib/boinc-server/tools tools/run_in_ops usr/lib/boinc-server/tools +tools/manage_privileges usr/share/boinc-server/tools +tools/cancel_jobs usr/lib/boinc-server/tools +tools/boinc_submit usr/share/boinc-server/tools +tools/demo_submit usr/share/boinc-server/tools +tools/demo_query usr/share/boinc-server/tools + #unclear #html/user/server_status.php usr/share/boinc-server/html/user @@ -104,3 +114,5 @@ #usr/libexec/sched usr/lib/boinc-server + + diff -Nru boinc-7.0.7+dfsg/debian/boinc-server-maker.links boinc-7.0.14+dfsg/debian/boinc-server-maker.links --- boinc-7.0.7+dfsg/debian/boinc-server-maker.links 2011-10-08 12:06:12.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/boinc-server-maker.links 2012-01-21 22:12:20.000000000 +0000 @@ -21,14 +21,15 @@ usr/lib/boinc-server/bin/wu_check usr/share/boinc-server/sched/wu_check usr/lib/boinc-server/bin/file_upload_handler usr/share/boinc-server/sched/file_upload_handler usr/lib/boinc-server/bin/transitioner usr/share/boinc-server/sched/transitioner -usr/lib/boinc-server/bin/sample_bitwise_validator usr/share/boinc-server/sched/sample_bitwise_validator -usr/lib/boinc-server/bin/sample_trivial_validator usr/share/boinc-server/sched/sample_trivial_validator -usr/lib/boinc-server/bin/sample_dummy_assimilator usr/share/boinc-server/sched/sample_dummy_assimilator +usr/lib/boinc-server/bin/sample_bitwise_validator usr/share/boinc-server/sched/sample_bitwise_validator +usr/lib/boinc-server/bin/sample_trivial_validator usr/share/boinc-server/sched/sample_trivial_validator +usr/lib/boinc-server/bin/sample_dummy_assimilator usr/share/boinc-server/sched/sample_dummy_assimilator usr/lib/boinc-server/bin/sample_assimilator usr/share/boinc-server/sched/sample_assimilator usr/lib/boinc-server/bin/sample_work_generator usr/share/boinc-server/sched/sample_work_generator usr/lib/boinc-server/bin/single_job_assimilator usr/share/boinc-server/sched/single_job_assimilator usr/lib/boinc-server/bin/assimilator.py usr/share/boinc-server/sched/assimilator.py usr/lib/boinc-server/bin/pymw_assimilator.py usr/share/boinc-server/sched/pymw_assimilator.py +usr/lib/boinc-server/sched/put_file usr/share/boinc-server/sched/put_file @@ -56,5 +57,5 @@ usr/share/boinc-server/html/user/server_status.php usr/share/boinc-server/html/ops/sample_server_status.php # annoying weakness of make_project -# since we are shipping the apps diffrent, no need to use this. +# we are shipping the apps separately, no need to use this. #usr/share/boinc-server/apps/uc2 usr/share/boinc-server/samples/example_app/uc2 diff -Nru boinc-7.0.7+dfsg/debian/changelog boinc-7.0.14+dfsg/debian/changelog --- boinc-7.0.7+dfsg/debian/changelog 2012-01-01 15:54:32.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/changelog 2012-02-03 20:28:46.000000000 +0000 @@ -1,3 +1,37 @@ +boinc (7.0.14+dfsg-1) unstable; urgency=low + + * New upstream version (Closes: #658485). + + -- Steffen Moeller Fri, 03 Feb 2012 21:28:27 +0100 + +boinc (7.0.11+dfsg-1) unstable; urgency=low + + * Removing ","s from "should start" line in init script (Closes: #654693) + with tons of thanks to Bruno Muller. + * New upstream version. + * [debian/control] corrected for strong binding of [amd64] tag + + -- Steffen Moeller Fri, 20 Jan 2012 13:21:56 +0100 + +boinc (7.0.8+dfsg-2) unstable; urgency=low + + * Fixed patch for whitespace removal. + + -- Steffen Moeller Mon, 16 Jan 2012 23:00:02 +0100 + +boinc (7.0.8+dfsg-1) unstable; urgency=low + + * New upstream version. + * Added disk space check to get-orig-source. + + -- Steffen Moeller Sat, 14 Jan 2012 13:04:18 +0100 + +boinc (7.0.7+dfsg-2) UNRELEASED; urgency=low + + * boinc-server-maker: Fixing missing files for make_project. + + -- Steffen Moeller Mon, 02 Jan 2012 01:56:18 +0100 + boinc (7.0.7+dfsg-1) unstable; urgency=low * New upstream version. diff -Nru boinc-7.0.7+dfsg/debian/control boinc-7.0.14+dfsg/debian/control --- boinc-7.0.7+dfsg/debian/control 2011-12-17 14:25:42.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/control 2012-01-21 22:12:20.000000000 +0000 @@ -42,7 +42,7 @@ Package: boinc-nvidia-cuda Architecture: amd64 i386 Section: contrib/net -Depends: ${misc:Depends}, boinc, libcuda1|nvidia-current, libcuda1-ia32|nvidia-current [amd64], ia32-libs|nvidia-current [amd64] +Depends: ${misc:Depends}, boinc, libcuda1|nvidia-current, libcuda1-ia32 [amd64]|nvidia-current [amd64], ia32-libs [amd64]|nvidia-current [amd64] Description: metapackage for CUDA-savvy BOINC client and manager The Berkeley Open Infrastructure for Network Computing (BOINC) is a software platform for distributed computing: several initiatives of diff -Nru boinc-7.0.7+dfsg/debian/patches/erase_while_1.patch boinc-7.0.14+dfsg/debian/patches/erase_while_1.patch --- boinc-7.0.7+dfsg/debian/patches/erase_while_1.patch 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/patches/erase_while_1.patch 2012-01-21 22:12:20.000000000 +0000 @@ -0,0 +1,117 @@ +Index: boinc/lib/filesys.cpp +=================================================================== +--- boinc.orig/lib/filesys.cpp 2011-12-02 02:55:55.000000000 +0100 ++++ boinc/lib/filesys.cpp 2012-01-15 23:46:23.000000000 +0100 +@@ -168,17 +168,13 @@ + } + } + #else +- while (1) { +- dirent* dp = readdir(dirp); +- if (dp) { +- if (!strcmp(dp->d_name, ".")) continue; +- if (!strcmp(dp->d_name, "..")) continue; +- if (p) strlcpy(p, dp->d_name, p_len); +- return 0; +- } else { +- return ERR_READDIR; +- } ++ for (dirent* dp = readdir(dirp); dp; dp = readdir(dirp)) { ++ if (!strcmp(dp->d_name, ".")) continue; ++ if (!strcmp(dp->d_name, "..")) continue; ++ strlcpy(p, dp->d_name, p_len); ++ return 0; + } ++ return ERR_READDIR; + #endif + } + +@@ -253,16 +249,12 @@ + #else + if (!dirp) return false; + +- while (1) { +- dirent* dp = readdir(dirp); +- if (dp) { +- if (dp->d_name[0] == '.') continue; +- s = dp->d_name; +- return true; +- } else { +- return false; +- } ++ for(dirent* dp = readdir(dirp); dp; dp = readdir(dirp)) { ++ if (dp->d_name[0] == '.') continue; ++ s = dp->d_name; ++ return true; + } ++ return false; + #endif + } + +@@ -354,20 +346,18 @@ + + dirp = dir_open(dirpath); + if (!dirp) return 0; // if dir doesn't exist, it's empty +- while (1) { +- strcpy(filename, ""); +- retval = dir_scan(filename, dirp, sizeof(filename)); +- if (retval) break; +- sprintf(path, "%s/%s", dirpath, filename); +- clean_out_dir(path); +- boinc_rmdir(path); +- retval = boinc_delete_file(path); +- if (retval) { +- dir_close(dirp); +- return retval; +- } +- } ++ ++ strcpy(filename, ""); ++ retval = dir_scan(filename, dirp, sizeof(filename)); + dir_close(dirp); ++ if (retval) return retval; ++ ++ sprintf(path, "%s/%s", dirpath, filename); ++ clean_out_dir(path); // recursion ++ boinc_rmdir(path); ++ retval = boinc_delete_file(path); ++ if (retval) return retval; ++ + return 0; + } + +@@ -540,7 +530,7 @@ + // ownership or permissions when called from the BOINC Client + // under sandbox security, so we copy the file directly. + FILE *src, *dst; +- int m, n; ++ size_t m, n; + int retval = 0; + struct stat sbuf; + unsigned char buf[65536]; +@@ -551,17 +541,18 @@ + fclose(src); + return ERR_FOPEN; + } +- while (1) { ++ ++ do { + n = fread(buf, 1, sizeof(buf), src); +- if (n <= 0) break; + m = fwrite(buf, 1, n, dst); +- if (m != n) { +- retval = ERR_FWRITE; +- break; +- } +- } ++ } while(n>0 && m==n); ++ ++ if (!feof(src)) retval = ERR_FREAD; ++ else if (m != n) retval = ERR_FWRITE; ++ + fclose(src); + fclose(dst); ++ + // Copy file's ownership, permissions to the extent we are allowed + lstat(orig, &sbuf); // Get source file's info + chown(newf, sbuf.st_uid, sbuf.st_gid); diff -Nru boinc-7.0.7+dfsg/debian/patches/mac_addresses_cores_in_kfreebsd.patch boinc-7.0.14+dfsg/debian/patches/mac_addresses_cores_in_kfreebsd.patch --- boinc-7.0.7+dfsg/debian/patches/mac_addresses_cores_in_kfreebsd.patch 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/patches/mac_addresses_cores_in_kfreebsd.patch 2012-02-01 14:49:44.000000000 +0000 @@ -0,0 +1,26 @@ +Index: boinc/lib/mac_address.cpp +=================================================================== +--- boinc.orig/lib/mac_address.cpp 2011-10-30 00:27:06.000000000 +0200 ++++ boinc/lib/mac_address.cpp 2012-02-01 15:49:40.000000000 +0100 +@@ -134,6 +134,10 @@ + + bool + get_mac_addresses(char* addresses) { ++ if (!addresses) { ++ perror("get_mac_addresses: 'addresses' parameter was NULL"); ++ return false; ++ } + #if defined(_WIN32) + IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information for up to 16 NICs + DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer +@@ -261,6 +265,10 @@ + } + hw_addr=(struct ether_addr *)&(item->lifr_lifru.lifru_enaddr); + #endif ++ if (!hw_addr) { ++ perror("get_mac_addresses: Could not determine hw_addr"); ++ return false; ++ } + strcat(addresses, delimiter); + delimiter[0] = ':'; + delimiter[1] = '\0'; diff -Nru boinc-7.0.7+dfsg/debian/patches/redundant_i.patch boinc-7.0.14+dfsg/debian/patches/redundant_i.patch --- boinc-7.0.7+dfsg/debian/patches/redundant_i.patch 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/patches/redundant_i.patch 2012-01-22 11:26:58.000000000 +0000 @@ -0,0 +1,22 @@ +Index: boinc/clientgui/BOINCListCtrl.cpp +=================================================================== +--- boinc.orig/clientgui/BOINCListCtrl.cpp 2011-03-17 18:51:03.000000000 +0100 ++++ boinc/clientgui/BOINCListCtrl.cpp 2012-01-22 12:26:50.000000000 +0100 +@@ -267,7 +267,7 @@ + + void CBOINCListCtrl::DrawProgressBars() + { +- long topItem, numItems, numVisibleItems, i, row; ++ long topItem, numItems, numVisibleItems, row; + wxRect r, rr; + int w = 0, x = 0, xx, yy, ww; + int progressColumn = m_pParentView->GetProgressColumn(); +@@ -300,7 +300,7 @@ + if (numItems <= (topItem + numVisibleItems)) numVisibleItems = numItems - topItem; + + x = 0; +- for (i=0; i< progressColumn; i++) { ++ for (int i=0; i< progressColumn; i++) { + x += GetColumnWidth(i); + } + w = GetColumnWidth(progressColumn); diff -Nru boinc-7.0.7+dfsg/debian/patches/series boinc-7.0.14+dfsg/debian/patches/series --- boinc-7.0.7+dfsg/debian/patches/series 2011-12-06 21:38:03.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/patches/series 2012-02-01 14:46:23.000000000 +0000 @@ -1,3 +1,4 @@ +mac_addresses_cores_in_kfreebsd.patch stripchart_debian.patch upstream_sztaki_configureEval.patch generate_less.patch @@ -14,3 +15,5 @@ #AddingMoreConst.patch #evenMoreConst03.patch #andYetMorePatches04.patch +#erase_while_1.patch +redundant_i.patch diff -Nru boinc-7.0.7+dfsg/debian/patches/stripchart_security.patch boinc-7.0.14+dfsg/debian/patches/stripchart_security.patch --- boinc-7.0.7+dfsg/debian/patches/stripchart_security.patch 2011-10-08 12:06:12.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/patches/stripchart_security.patch 2012-01-21 22:12:20.000000000 +0000 @@ -1,7 +1,7 @@ Index: boinc/stripchart/samples/get_load =================================================================== ---- boinc.orig/stripchart/samples/get_load 2011-09-10 17:52:40.000000000 +0200 -+++ boinc/stripchart/samples/get_load 2011-09-11 11:20:51.000000000 +0200 +--- boinc.orig/stripchart/samples/get_load 2012-01-15 01:31:59.000000000 +0100 ++++ boinc/stripchart/samples/get_load 2012-01-15 02:02:05.000000000 +0100 @@ -1,11 +1,11 @@ -#! /bin/csh +#!/bin/sh @@ -23,8 +23,8 @@ echo $CIVDATE $UNIXDATE $UPTIME Index: boinc/stripchart/samples/parse_config =================================================================== ---- boinc.orig/stripchart/samples/parse_config 2011-09-10 17:52:41.000000000 +0200 -+++ boinc/stripchart/samples/parse_config 2011-09-11 11:20:51.000000000 +0200 +--- boinc.orig/stripchart/samples/parse_config 2012-01-15 01:31:59.000000000 +0100 ++++ boinc/stripchart/samples/parse_config 2012-01-15 02:02:05.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python @@ -33,8 +33,8 @@ Index: boinc/stripchart/samples/dir_size =================================================================== ---- boinc.orig/stripchart/samples/dir_size 2011-09-10 17:52:41.000000000 +0200 -+++ boinc/stripchart/samples/dir_size 2011-09-11 11:20:51.000000000 +0200 +--- boinc.orig/stripchart/samples/dir_size 2012-01-15 01:31:59.000000000 +0100 ++++ boinc/stripchart/samples/dir_size 2012-01-15 02:02:05.000000000 +0100 @@ -1,8 +1,8 @@ -#! /bin/csh +#!/bin/sh @@ -50,8 +50,8 @@ echo $CIVDATE $UNIXDATE $SIZE Index: boinc/stripchart/stripchart.cnf =================================================================== ---- boinc.orig/stripchart/stripchart.cnf 2011-09-11 11:59:01.000000000 +0200 -+++ boinc/stripchart/stripchart.cnf 2011-09-11 11:59:57.000000000 +0200 +--- boinc.orig/stripchart/stripchart.cnf 2012-01-15 02:02:04.000000000 +0100 ++++ boinc/stripchart/stripchart.cnf 2012-01-15 02:02:05.000000000 +0100 @@ -1,4 +1,5 @@ -#! /usr/bin/env perl + diff -Nru boinc-7.0.7+dfsg/debian/rules boinc-7.0.14+dfsg/debian/rules --- boinc-7.0.7+dfsg/debian/rules 2012-01-01 15:55:00.000000000 +0000 +++ boinc-7.0.14+dfsg/debian/rules 2012-01-21 22:12:20.000000000 +0000 @@ -342,6 +342,11 @@ origDir ?= . get-orig-source: + diskfree=`df -k . | awk '{print $$4}' | tail -n +2` ; \ + if [ -z "$$diskfree" -o "$$diskfree" -lt $$((250*1024)) ]; then \ + echo "Not enough disk space for download. Have 250MB available if not more."; \ + exit 1; \ + fi LATEST_VERSION=`svn list http://boinc.berkeley.edu/svn/tags/ | \ sed 's/boinc_core_release_\(.*\)\//\1/' | \ sort -g -t_ -k1 -k2 -k3 | sed 's/_/./g' | tail -n 1 | tr -d '\n'`; \ diff -Nru boinc-7.0.7+dfsg/doc/download_all.php boinc-7.0.14+dfsg/doc/download_all.php --- boinc-7.0.7+dfsg/doc/download_all.php 2011-07-22 22:47:41.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/download_all.php 2011-11-16 19:47:40.000000000 +0000 @@ -192,10 +192,6 @@ } list_end(); echo " -

GPU computing

- If your computer is equipped with a Graphics Processing Unit (GPU), - you may be able to - use it to compute faster.

Other platforms

If your computer is not of one of these types, you can - -

Linux info

"; - show_linux_info(); } echo " - -

Ubuntu image for USB/diskless/CD-ROM install

-
Dotsch/UX - is an ISO-format Linux distribution, based on Ubuntu Linux. - It lets you easily install and boot from a USB stick, hard disk and - from diskless clients, - and it also has some interfaces to set up the diskless server - and the clients automatically. - The current version (1.2) has the 6.10.17 BOINC client pre-installed. - - - -

Customizing this page

+
The information on this page can be restricted by platform and/or version number, diff -Nru boinc-7.0.7+dfsg/doc/index.php boinc-7.0.14+dfsg/doc/index.php --- boinc-7.0.7+dfsg/doc/index.php 2011-09-14 22:45:26.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/index.php 2011-11-19 00:29:55.000000000 +0000 @@ -75,6 +75,8 @@ function show_participate() { echo " + +
".tra("Volunteer")."
@@ -247,6 +249,7 @@ + BOINC diff -Nru boinc-7.0.7+dfsg/doc/links.php boinc-7.0.14+dfsg/doc/links.php --- boinc-7.0.7+dfsg/doc/links.php 2011-01-03 03:55:33.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/links.php 2011-12-30 06:18:57.000000000 +0000 @@ -305,7 +305,7 @@ site("http://www.boinc.org.pl/", "Team boinc.pl"), site("http://www.boinc.prv.pl", "BOINC@Kolobrzeg"), site("http://www.boincatpoland.org", "BOINC@Poland"), - //site("http://www.boinc.pl", "www.boinc.pl"), + site("http://boinc.pl", "BOINC Polish National Team"), site("http://www.tomaszpawel.republika.pl/", "TomaszPawelTeam"), site("http://www.gpuforce.oxyone.pl/", "GPU Force"), )); @@ -325,6 +325,7 @@ site("http://www.boinc.sk/", "www.boinc.sk") )); language("Spanish", array( + site("http://www.titanesdc.com/", "Foros TitanesDC"), site("http://www.seti.cl/", "BOINC SETI Chile"), site("http://www.easyboinc.org/", "Computación Distribuida"), site("http://foro.noticias3d.com/vbulletin/showthread.php?t=192297", "Noticias3D"), diff -Nru boinc-7.0.7+dfsg/doc/projects.inc boinc-7.0.14+dfsg/doc/projects.inc --- boinc-7.0.7+dfsg/doc/projects.inc 2011-09-27 19:45:27.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/projects.inc 2011-11-20 17:26:32.000000000 +0000 @@ -285,6 +285,15 @@ tra("Mathematics, computing, and games"), array( array( + "Mersenne@home", + "http://mersenneathome.net/", + tra("Private"), + tra("Mathematics"), + tra("Mersenne@home searches for 'Mersenne primes' - prime numbers of the form 2p-1."), + + "mersenne_logo80.png" + ), + array( "DistrRTgen", "http://boinc.freerainbowtables.com/distrrtgen/", "Private", diff -Nru boinc-7.0.7+dfsg/doc/projects.php boinc-7.0.14+dfsg/doc/projects.php --- boinc-7.0.7+dfsg/doc/projects.php 2010-03-04 21:23:30.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/projects.php 2012-01-30 22:39:13.000000000 +0000 @@ -33,7 +33,10 @@ a complete list of projects.

-Note: if your computer is equipped with a Graphics Processing Unit +Projects have different requirements such as memory size; +a partial summary is here. +

+If your computer is equipped with a Graphics Processing Unit (GPU), you may be able to use it to compute faster. "; Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/doc/rr_sim.odg and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/doc/rr_sim.odg differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/doc/rr_sim.png and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/doc/rr_sim.png differ diff -Nru boinc-7.0.7+dfsg/doc/sandbox.php boinc-7.0.14+dfsg/doc/sandbox.php --- boinc-7.0.7+dfsg/doc/sandbox.php 2010-01-28 10:33:21.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/sandbox.php 2011-12-01 07:37:04.000000000 +0000 @@ -107,13 +107,15 @@ show_dir(1, 'projects', $mp0770, array( show_dir(2, 'setiathome.berkeley.edu', $mp0775, array( show_file('files created by BOINC Client', $mp06610771), - show_file('files created by project apps', $pp06610771) + show_file('files created by project apps', $pp06610771), + show_file('running BOINC installer changes all files to', $mp06610771) )) )), show_dir(1, 'slots', $mp0770, array( show_dir(2, '0', $mp0775, array( show_file('files created by BOINC Client', $mp06610771), - show_file('files created by project apps', $pp06610771) + show_file('files created by project apps', $pp06610771), + show_file('running BOINC installer changes all files to', $mp06610771) )) )), show_dir(1, 'switcher (directory)', $mm0550, array( @@ -264,6 +266,17 @@ can perform BOINC Manager functions (Activity Menu, etc.). This can be done by moving BOINC Manager out of the /Applications directory into a directory with restricted access. +

  • Important information for project developers: The BOINC +installer traverses the BOINC Data directory and sets the users, groups and +permissions of all files as shown in the above table. This allows it to +repair corrupted permissions. Note that the BOINC installer will +change all files in the projects directory, the slots directory, and +all their subdirectories to user boinc_master and +group boinc_project. This means that if a project file needs to be +executable by another project file, its executable-by-group permission bit +must be set. The BOINC installer will not alter the +executable-by-user and executable-by-group permission bits of files in these +directories (though it will set these bits for the directories themselves.)

    "; diff -Nru boinc-7.0.7+dfsg/doc/versions.inc boinc-7.0.14+dfsg/doc/versions.inc --- boinc-7.0.7+dfsg/doc/versions.inc 2011-11-14 20:10:16.000000000 +0000 +++ boinc-7.0.14+dfsg/doc/versions.inc 2012-01-14 18:21:54.000000000 +0000 @@ -1,31 +1,5 @@ - ".tra("The current release is known to work with these Linux versions:")." -
      -
    • Ubuntu 10.04+ -
    -

    - ".tra("For other Linux versions, check if a BOINC package is offered by your Linux distribution.")." -

      -
    • Fedora 7+: type -
      yum install boinc-client boinc-manager
      as root. -
    • Debian and Ubuntu: package names boinc-client, - boinc-manager - (more info here). - Also boinc-dev (for project developers). -
    • Gentoo: package name sci-misc/boinc -
    -

    - ".tra("Alternatively, download the %1BOINC client for older Linux versions%2. This doesn't have a graphical interface, but it should work on all Linux systems, both x86 and x64.", - "", - "" - ) - ; -} - function type_text($type) { global $xml; if ($xml) { @@ -57,11 +31,11 @@ } } -$w613 = array( - "num"=>"6.13.12", +$w70 = array( + "num"=>"7.0.8", "status"=>"Development version", - "file"=>"boinc_6.13.12_windows_intelx86.exe", - "date"=>"14 Nov 2011", + "file"=>"boinc_7.0.8_windows_intelx86.exe", + "date"=>"13 Jan 2012", "type"=>"win_new", ); @@ -97,11 +71,11 @@ "type"=>"win_new", ); -$w613x64 = array( - "num"=>"6.13.12", +$w70x64 = array( + "num"=>"7.0.8", "status"=>"Development version", - "file"=>"boinc_6.13.12_windows_x86_64.exe", - "date"=>"14 Nov 2011", + "file"=>"boinc_7.0.8_windows_x86_64.exe", + "date"=>"13 Jan 2012", "type"=>"win_new", ); @@ -121,11 +95,11 @@ "type"=>"win_new", ); -$m613 = array( - "num"=>"6.13.12", +$m70 = array( + "num"=>"7.0.8", "status"=>"Development version (standard GUI)", - "file"=>"boinc_6.13.12_macOSX_i686.zip", - "date"=>"14 Nov 2011", + "file"=>"boinc_7.0.8_macOSX_i686.zip", + "date"=>"13 Jan 2012", "type"=>"mac_advanced", ); @@ -153,11 +127,11 @@ "type"=>"mac_advanced", ); -$m613c = array( - "num"=>"6.13.12", +$m70c = array( + "num"=>"7.0.8", "status"=>"Development version (Unix command-line version)", - "file"=>"boinc_6.13.12_i686-apple-darwin.zip", - "date"=>"14 Nov 2011", + "file"=>"boinc_7.0.8_i686-apple-darwin.zip", + "date"=>"13 Jan 2012", "type"=>"bare_core", ); @@ -201,11 +175,11 @@ "type"=>"sea", ); -$l613ubuntu = array( - "num"=>"6.13.12", +$l70ubuntu = array( + "num"=>"7.0.8", "status"=>"Development version", - "file"=>"boinc_6.13.12_i686-pc-linux-gnu.sh", - "date"=>"14 Nov 2011", + "file"=>"boinc_7.0.8_i686-pc-linux-gnu.sh", + "date"=>"13 Jan 2012", "type"=>"sea", ); @@ -225,11 +199,11 @@ "type"=>"sea", ); -$l613ubuntux64 = array( - "num"=>"6.13.12", +$l70ubuntux64 = array( + "num"=>"7.0.8", "status"=>"Development version", - "file"=>"boinc_6.13.12_x86_64-pc-linux-gnu.sh", - "date"=>"14 Nov 2011", + "file"=>"boinc_7.0.8_x86_64-pc-linux-gnu.sh", + "date"=>"13 Jan 2012", "type"=>"sea", ); @@ -258,7 +232,7 @@ "description"=>"2000/XP/Vista/7", "dbname" => "windows_intelx86", "versions"=>array( - $w613, + $w70, $w612, $w610, $w66, @@ -271,7 +245,7 @@ "description"=>"XP/Vista/7", "dbname" => "windows_x86_64", "versions"=>array( - $w613x64, + $w70x64, $w612x64, $w610x64, ) @@ -282,8 +256,8 @@ "description"=>"Version 10.4.0+", "dbname" => "powerpc-apple-darwin", "versions"=>array( - $m613, - $m613c, + $m70, + $m70c, $m612, $m612c, $m610, @@ -305,10 +279,15 @@ $linux = array( "name"=>"Linux x86", - "description"=>"For most current Linux/x86 versions; graphical and command-line interfaces", + "description"=>"Tested on the current Ubuntu release; may work on others. +
    If available, we recommend that you install a + + distribution-specific package + instead. + ", "dbname" => "i686-pc-linux-gnu", "versions"=>array( - $l613ubuntu, + $l70ubuntu, $l612ubuntu, $l610ubuntu, ) @@ -316,10 +295,14 @@ $linuxx64 = array( "name"=>"Linux x64", - "description"=>"For most current Linux/x64 versions; graphical and command-line interfaces", - "dbname" => "x86_64-pc-linux-gnu", + "description"=>"Tested on the current Ubuntu release; may work on others. +
    If available, we recommend that you install a + + distribution-specific package + instead. + ", "versions"=>array( - $l613ubuntux64, + $l70ubuntux64, $l612ubuntux64, $l610ubuntux64, ) diff -Nru boinc-7.0.7+dfsg/html/inc/bbcode_html.inc boinc-7.0.14+dfsg/html/inc/bbcode_html.inc --- boinc-7.0.7+dfsg/html/inc/bbcode_html.inc 2010-12-21 17:15:57.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/bbcode_html.inc 2011-12-24 15:37:20.000000000 +0000 @@ -1,68 +1,71 @@ "; -$bbcode_html = << - + - + - + - + - + - + - + - + - - +
     Font color: -  Font size: '.tra("Font color").': +  '.tra("Font size").': + Close Tags'.tra("Close Tags").'
    -EOT; +'; \ No newline at end of file diff -Nru boinc-7.0.7+dfsg/html/inc/boinc_db.inc boinc-7.0.14+dfsg/html/inc/boinc_db.inc --- boinc-7.0.7+dfsg/html/inc/boinc_db.inc 2011-07-25 21:45:53.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/boinc_db.inc 2012-01-31 07:21:42.000000000 +0000 @@ -215,6 +215,10 @@ $db = BoincDb::get(); return $db->enum('host', 'BoincHost', $clause, $clause2); } + static function count($clause) { + $db = BoincDb::get(); + return $db->count('host', $clause); + } } class BoincResult { @@ -431,4 +435,41 @@ } } +// DB utility functions + +// return the "latest" app versions for a given app and platform +// +function latest_avs_app_platform($appid, $platformid) { + $avs = BoincAppVersion::enum( + "appid=$appid and platformid = $platformid and deprecated=0" + ); + foreach ($avs as $av) { + foreach ($avs as $av2) { + if ($av->id == $av2->id) continue; + if ($av->plan_class == $av2->plan_class && $av->version_num > $av2->version_num) { + $av2->deprecated = 1; + } + } + } + $r = array(); + foreach ($avs as $av) { + if (!$av->deprecated) { + $r[] = $av; + } + } + return $r; +} + +// return the "latest" app versions for a given app +// +function latest_avs_app($appid) { + $platforms = BoincPlatform::enum(""); + $r = array(); + foreach ($platforms as $p) { + $avs = latest_avs_app_platform($appid, $p->id); + $r = array_merge($r, $avs); + } + return $r; +} + ?> diff -Nru boinc-7.0.7+dfsg/html/inc/db_ops.inc boinc-7.0.14+dfsg/html/inc/db_ops.inc --- boinc-7.0.7+dfsg/html/inc/db_ops.inc 2011-10-16 06:04:13.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/db_ops.inc 2012-01-31 07:21:42.000000000 +0000 @@ -20,6 +20,8 @@ ini_set('display_errors', true); ini_set('display_startup_errors', true); +require_once("../inc/result.inc"); + class BoincAssignment { static function enum($where_clause) { $db = BoincDb::get(); @@ -275,6 +277,7 @@ function count() { $count_query = "select count(*) as cnt from $this->table $this->query"; + $result = mysql_query($count_query); if (!$result) return 0; $res = mysql_fetch_object($result); @@ -307,6 +310,7 @@ $this->addeq('hostid'); $this->addeq('userid'); $this->addeq('teamid'); + $this->addeq('app_version_id'); $this->addeq('exit_status'); if (isset($_GET['nsecs'])) { $_GET['mod_time'] = date("YmdHis",time() - $_GET['nsecs']); @@ -339,149 +343,7 @@ } } -// Decode ErrorNumber into human readable, taken from lib/error_numbers.h keep this up to date -// @return String A human readable error message -// @param Integer $x An error number -function result_error_mask_str($x){ - switch($x){ - case 0: return ""; - case -100: return "ERR_SELECT"; - case -102: return "ERR_READ"; - case -103: return "ERR_WRITE"; - case -104: return "ERR_FREAD"; - case -105: return "ERR_FWRITE"; - case -106: return "ERR_IO"; - case -107: return "ERR_CONNECT"; - case -108: return "ERR_FOPEN"; - case -109: return "ERR_RENAME"; - case -110: return "ERR_UNLINK"; - case -111: return "ERR_OPENDIR"; - case -112: return "ERR_XML_PARSE"; - case -113: return "ERR_GETHOSTBYNAME"; - case -114: return "ERR_GIVEUP_DOWNLOAD"; - case -115: return "ERR_GIVEUP_UPLOAD"; - case -116: return "ERR_NULL"; - case -117: return "ERR_NEG"; - case -118: return "ERR_BUFFER_OVERFLOW"; - case -119: return "ERR_MD5_FAILED"; - case -120: return "ERR_RSA_FAILED"; - case -121: return "ERR_OPEN"; - case -122: return "ERR_DUP2"; - case -123: return "ERR_NO_SIGNATURE"; - case -124: return "ERR_THREAD"; - case -125: return "ERR_SIGNAL_CATCH"; - case -126: return "ERR_QUIT_REQUEST"; - case -127: return "ERR_UPLOAD_TRANSIENT"; - case -128: return "ERR_UPLOAD_PERMANENT"; - case -129: return "ERR_IDLE_PERIOD"; - case -130: return "ERR_ALREADY_ATTACHED"; - case -131: return "ERR_FILE_TOO_BIG"; - case -132: return "ERR_GETRUSAGE"; - case -133: return "ERR_BENCHMARK_FAILED"; - case -134: return "ERR_BAD_HEX_FORMAT"; - case -135: return "ERR_USER_REJECTED"; - case -136: return "ERR_DB_NOT_FOUND"; - case -137: return "ERR_DB_NOT_UNIQUE"; - case -138: return "ERR_DB_CANT_CONNECT"; - case -139: return "ERR_GETS"; - case -140: return "ERR_SCANF"; - case -141: return "ERR_STRCHR"; - case -142: return "ERR_STRSTR"; - case -143: return "ERR_READDIR"; - case -144: return "ERR_SHMGET"; - case -145: return "ERR_SHMCTL"; - case -146: return "ERR_SHMAT"; - case -147: return "ERR_FORK"; - case -148: return "ERR_EXEC"; - case -149: return "ERR_NOT_EXITED"; - case -150: return "ERR_NOT_IMPLEMENTED"; - case -151: return "ERR_GETHOSTNAME"; - case -152: return "ERR_NETOPEN"; - case -153: return "ERR_SOCKET"; - case -154: return "ERR_FCNTL"; - case -155: return "ERR_AUTHENTICATOR"; - case -156: return "ERR_SCHED_SHMEM"; - case -157: return "ERR_ASYNCSELECT"; - case -158: return "ERR_BAD_RESULT_STATE"; - case -159: return "ERR_DB_CANT_INIT"; - case -160: return "ERR_NOT_UNIQUE"; - case -161: return "ERR_NOT_FOUND"; - case -162: return "ERR_NO_EXIT_STATUS"; - case -163: return "ERR_FILE_MISSING"; - case -164: return "ERR_NESTED_UNHANDLED_EXCEPTION_DETECTED"; - case -165: return "ERR_SEMGET"; - case -166: return "ERR_SEMCTL"; - case -167: return "ERR_SEMOP"; - case -168: return "ERR_FTOK"; - case -169: return "ERR_SOCKS_UNKNOWN_FAILURE"; - case -170: return "ERR_SOCKS_REQUEST_FAILED"; - case -171: return "ERR_SOCKS_BAD_USER_PASS"; - case -172: return "ERR_SOCKS_UNKNOWN_SERVER_VERSION"; - case -173: return "ERR_SOCKS_UNSUPPORTED"; - case -174: return "ERR_SOCKS_CANT_REACH_HOST"; - case -175: return "ERR_SOCKS_CONN_REFUSED"; - case -176: return "ERR_TIMER_INIT"; - case -177: return "ERR_RSC_LIMIT_EXCEEDED"; - case -178: return "ERR_INVALID_PARAM"; - case -179: return "ERR_SIGNAL_OP"; - case -180: return "ERR_BIND"; - case -181: return "ERR_LISTEN"; - case -182: return "ERR_TIMEOUT"; - case -183: return "ERR_PROJECT_DOWN"; - case -184: return "ERR_HTTP_ERROR"; - case -185: return "ERR_RESULT_START"; - case -186: return "ERR_RESULT_DOWNLOAD"; - case -187: return "ERR_RESULT_UPLOAD"; - case -189: return "ERR_INVALID_URL"; - case -190: return "ERR_MAJOR_VERSION"; - case -191: return "ERR_NO_OPTION"; - case -192: return "ERR_MKDIR"; - case -193: return "ERR_INVALID_EVENT"; - case -194: return "ERR_ALREADY_RUNNING"; - case -195: return "ERR_NO_APP_VERSION"; - case -196: return "ERR_WU_USER_RULE"; - case -197: return "ERR_ABORTED_VIA_GUI"; - case -198: return "ERR_INSUFFICIENT_RESOURCE"; - case -199: return "ERR_RETRY"; - case -200: return "ERR_WRONG_SIZE"; - case -201: return "ERR_USER_PERMISSION"; - case -202: return "ERR_SHMEM_NAME"; - case -203: return "ERR_NO_NETWORK_CONNECTION"; - case -204: return "ERR_IN_PROGRESS"; - case -205: return "ERR_BAD_EMAIL_ADDR"; - case -206: return "ERR_BAD_PASSWD"; - case -207: return "ERR_NONUNIQUE_EMAIL"; - case -208: return "ERR_ACCT_CREATION_DISABLED"; - case -209: return "ERR_ATTACH_FAIL_INIT"; - case -210: return "ERR_ATTACH_FAIL_DOWNLOAD"; - case -211: return "ERR_ATTACH_FAIL_PARSE"; - case -212: return "ERR_ATTACH_FAIL_BAD_KEY"; - case -213: return "ERR_ATTACH_FAIL_FILE_WRITE"; - case -214: return "ERR_ATTACH_FAIL_SERVER_ERROR"; - case -215: return "ERR_SIGNING_KEY"; - case -216: return "ERR_FFLUSH"; - case -217: return "ERR_FSYNC"; - case -218: return "ERR_TRUNCATE"; - case -219: return "ERR_WRONG_URL"; - case -220: return "ERR_DUP_NAME"; - case -221: return "ERR_ABORTED_BY_PROJECT"; - case -222: return "ERR_GETGRNAM"; - case -223: return "ERR_CHOWN"; - case -224: return "ERR_FILE_NOT_FOUND"; - case -225: return "ERR_BAD_FILENAME"; - case -226: return "ERR_TOO_MANY_EXITS"; - case -227: return "ERR_RMDIR"; - case -228: return "ERR_CHILD_FAILED"; - case -229: return "ERR_SYMLINK"; - case -230: return "ERR_DB_CONN_LOST"; - case -231: return "ERR_CRYPTO"; - case -232: return "ERR_ABORTED_ON_EXIT"; - case -233: return "ERR_UNSTARTED_LATE"; - case -234: return "ERR_MISSING_COPROC"; - case -235: return "ERR_PROC_PARSE"; - default: return "Unknown error number"; - } -} + // Determines if in stderr_out is an error reported and prints as human readable String // @return String A human readable string if error otherwise FALSE // @param String $stderr_out the stderr_out value to parse @@ -497,21 +359,6 @@ return "$x ".result_error_mask_str($x); } } -// -function exit_status_string($result) { - $x = $result->exit_status; - if ($x == 0) { - $y = parse_element($result->stderr_out, ""); - if ($y) { - $x = (int)$y; - } - } - if (0<=$x && $x<=9) { - return "$x ".result_error_mask_str($x); - } else { - return sprintf("%d (0x%x)", $x, $x). " ".result_error_mask_str($x); - } -} function show_result_summary() { @@ -669,7 +516,9 @@ echo "\n"; echo "\n"; for ($ss=1; $ss<6; $ss++) { - row2(server_state_string($ss), + $res = null; + $res->server_state = $ss; + row2(result_server_state_string($res), link_results("$server_state[$ss]", $urlquery,"server_state=$ss", '') ); } @@ -679,7 +528,10 @@ echo "\n"; for ($ro=0; $ro<8; $ro++) { - c_row2($outcome[$ro]?outcome_color($ro):'', outcome_string($ro), + $res = null; + $res->outcome = $ro; + $res->exit_status = 0; + c_row2($outcome[$ro]?outcome_color($ro):'', result_outcome_string($res), link_results("$outcome[$ro]", $urlquery, "outcome=$ro", '') ); } @@ -688,7 +540,10 @@ echo ""; echo ""; echo "
    Server state# results
    Outcome# results
    \n"; echo "\n"; for ($vs=0; $vsvalidate_state = $vs; + $res->exit_status = 0; + c_row2($validate_state[$vs]?validate_color($vs):'', validate_state_str($res), link_results("$validate_state[$vs]", $urlquery, "validate_state=$vs", "outcome=1")); } echo "
    Validate state# results
    "; @@ -706,7 +561,10 @@ echo "
    \n"; echo "\n"; for ($cs=1; $cs<7; $cs++) { - row2(client_state_string($cs), + $res = null; + $res->client_state = $cs; + $res->exit_status = 0; + row2(result_client_state_string($res), link_results("$client_state[$cs]", $urlquery, "client_state=$cs", "outcome=3") ); } @@ -721,7 +579,9 @@ "; for($i=1; $i<6; $i++) { - echo "\n"; + $res = null; + $res->server_state=$i; + echo "\n"; } echo "\n"; } @@ -732,7 +592,10 @@ "; for($i=0; $i<8; $i++) { - echo "\n"; + $res = null; + $res->outcome = $i; + $res->exit_status = 0; + echo "\n"; } echo "\n"; } @@ -743,7 +606,10 @@ "; for($i=0; $i "."[$i]  ".' '.validate_state_str($i)."\n"; + $res = null; + $res->validate_state = $vs; + $res->exit_status = 0; + echo "\n"; } echo "\n"; } @@ -754,7 +620,10 @@ "; for($i=0; $i<7; $i++) { - echo "\n"; + $res = null; + $res->client_state = $i; + $res->exit_status = 0; + echo "\n"; } echo "\n"; } @@ -902,7 +771,7 @@ } return "Unknown resource: $x"; } -function app_version_string($avid) { +function hav_app_version_string($avid) { if ($avid > 1000000) { $appid = (int)($avid/1000000); $platform_name = "Anonymous platform"; @@ -933,7 +802,7 @@ $havs = BoincHostAppVersion::enum("host_id=$hostid"); foreach ($havs as $hav) { table_row( - app_version_string($hav->app_version_id), + hav_app_version_string($hav->app_version_id), "$hav->pfc_avg ($hav->pfc_n)", "$hav->et_avg ($hav->et_n)", days_string($hav->turnaround_avg)." ($hav->turnaround_n)" @@ -997,60 +866,6 @@ show_host_app_versions($host->id); } -function wu_error_mask_str($s) { - $x = ""; - if ($s & 1) { - $x = $x."Couldn't send result;
    "; - $s -= 1; - } - if ($s & 2) { - $x = $x."Too many errors (may have bug);
    "; - $s -= 2; - } - if ($s & 4) { - $x = $x."Too many results (may be nondeterministic)
    "; - $s -= 4; - } - if ($s & 8) { - $x = $x."Too many total results
    "; - $s -= 8; - } - if ($s & 16) { - $x = $x."WU cancelled
    "; - $s -= 16; - } - if ($s) { - $x = $x."Unrecognized Error: $s
    "; - } - if (strlen($x)) { - $x="".$x.""; - } else { - $x="
    "; - } - return $x; -} - -function assimilate_state_str($s) { - switch($s) { - case 0: return "Initial"; - case 1: return "Ready to assimilate"; - case 2: return "Assimilated"; - } - echo "THIS IS AN INTERNAL BUG #1 [$s] IN BOINC: PLEASE CONTACT BOINC DEVELOPERS
    "; - return "Unknown"; -} - -function file_delete_state_str($s) { - switch($s) { - case 0: return "Initial"; - case 1: return "Ready to delete"; - case 2: return "Deleted"; - case 3: return "Delete Error"; - } - echo "THIS IS AN INTERNAL BUG #2 [$s] IN BOINC: PLEASE CONTACT BOINC DEVELOPERS
    "; - return "Unknown"; -} - function show_workunit($wu) { $_GET = array('workunitid' => $wu->id); show_result_summary(); @@ -1127,63 +942,7 @@ "; } - -function server_state_string($s) { - switch($s) { - case 1: return "Inactive"; - case 2: return "Unsent"; - case 3: return "Unsent (in work seq)"; - case 4: return "In Progress"; - case 5: return "Over"; - } - echo "THIS IS AN INTERNAL BUG #3 [$s] IN BOINC: PLEASE CONTACT BOINC DEVELOPERS
    "; - return "Unknown"; -} - -function outcome_string($s) { - switch($s) { - case 0: return "Init"; - case 1: return "Success"; - case 2: return "Couldn't send"; - case 3: return "Client error"; - case 4: return "No reply"; - case 5: return "Didn't need"; - case 6: return "Validate error"; - case 7: return "Client detached"; - } - echo "THIS IS AN INTERNAL BUG #4 [$s] IN BOINC: PLEASE CONTACT BOINC DEVELOPERS
    "; - return "Unknown"; -} - -function client_state_string($s) { - switch($s) { - case 0: return "New"; - case 1: return "Downloading"; - case 2: return "Downloaded"; - case 3: return "Compute error"; - case 4: return "Uploading"; - case 5: return "Uploaded"; - case 6: return "Aborted"; - } - echo "THIS IS AN INTERNAL BUG #5 [$s] IN BOINC: PLEASE CONTACT BOINC DEVELOPERS
    "; - return "Unknown"; -} - -function validate_state_str($s) { - switch($s) { - case 0: return "Initial"; - case 1: return "Valid"; - case 2: return "Invalid"; - case 3: return "Skipped"; - case 4: return "Inconclusive"; - case 5: return "Too late"; - } - echo "THIS IS AN INTERNAL BUG #6 [$s] IN BOINC: PLEASE CONTACT BOINC DEVELOPERS
    "; - return "Unknown"; -} - -function host_user_link($hostid) -{ +function host_user_link($hostid) { if (!$hostid) return '----'; $h = "$hostid"; @@ -1209,11 +968,11 @@ function outcome_color($outcome) { switch($outcome) { - case 0: return '9900cc'; // "Init", purple - case 1: return '33cc33'; // "Success", green - case 3: return 'ff3333'; // "Client error", red - case 4: return 'ff6699'; // "No reply", pink - case 6: return 'ffff33'; // "Validate error", yellow + case 0: return '9900cc'; // "Init", purple + case 1: return '33cc33'; // "Success", green + case 3: return 'ff3333'; // "Client error", red + case 4: return 'ff6699'; // "No reply", pink + case 6: return 'ffff33'; // "Validate error", yellow } return ''; } @@ -1226,10 +985,9 @@ } } -function show_result($result) { +function show_result_ops($result) { $wu_name = wu_name_by_id($result->workunitid); - start_table(); row("Created", time_str($result->create_time)); @@ -1239,9 +997,9 @@ row("Last time modified",mysqltime_str($result->mod_time)); row("Name", $result->name); row("Workunit", "workunitid\">" . wu_name_by_id($result->workunitid) . " [$result->workunitid]" ); - row("Server state", server_state_string($result->server_state)." [$result->server_state]"); - row("Outcome", outcome_string($result->outcome)." [$result->outcome]"); - row("Client state", client_state_string($result->client_state)." [$result->client_state]"); + row("Server state", result_server_state_string($result)." [$result->server_state]"); + row("Outcome", result_outcome_string($result)." [$result->outcome]"); + row("Client state", result_client_state_string($result)." [$result->client_state]"); row("Exit status", exit_status_string($result)); row("Host ID", "hostid\">" . host_name_by_id($result->hostid) . " [$result->hostid]"); row("User ID", "userid\">" . user_name_by_id($result->userid) . " [$result->userid]"); @@ -1252,7 +1010,7 @@ } row("Batch", $result->batch); row("File delete state", file_delete_state_str($result->file_delete_state)." [$result->file_delete_state]"); - row("Validate state", validate_state_str($result->validate_state)." [$result->validate_state]"); + row("Validate state", validate_state_str($result)." [$result->validate_state]"); row("claimed credit", $result->claimed_credit); row("Granted credit", $result->granted_credit); row("Application", "appid\">".app_name_by_id($result->appid).""); @@ -1297,12 +1055,12 @@ } function show_result_short($result) { - $ss = server_state_string($result->server_state)." [$result->server_state]"; - $oc = outcome_string($result->outcome)." [$result->outcome]"; - $vs = validate_state_str($result->validate_state)." [$result->validate_state]"; - $cs2 = client_state_string($result->client_state)." [$result->client_state]"; + $ss = result_server_state_string($result)." [$result->server_state]"; + $oc = result_outcome_string($result)." [$result->outcome]"; + $vs = validate_state_str($result)." [$result->validate_state]"; + $cs2 = result_client_state_string($result)." [$result->client_state]"; if ($result->outcome == 3) { - $cs = client_state_string($result->client_state); + $cs = result_client_state_string($result); $oc = "$oc ($cs)"; } if ($result->received_time) @@ -1322,7 +1080,8 @@ $received = "". time_str($result->report_deadline) . ""; } } - $version = "$result->app_version_num/$result->app_version_id"; + $av = BoincAppVersion::lookup_id($result->app_version_id); + $version = sprintf("%.2f", $result->app_version_num/100)." [$av->plan_class]"; $outcome_color = outcome_color($result->outcome); $validate_color = validate_color($result->validate_state); $host_user = host_user_link($result->hostid); @@ -1375,9 +1134,10 @@ $top_country = array(); $top_language = array(); $stats_res = mysql_query("select max(id) as maxuser, - SUM(case when has_profile = '1' then 1 else 0 end) as profuser, - SUM(case when teamid != '0' then 1 else 0 end) as teamuser - from user"); + SUM(case when has_profile = '1' then 1 else 0 end) as profuser, + SUM(case when teamid != '0' then 1 else 0 end) as teamuser + from user" + ); $stats = mysql_fetch_assoc($stats_res); if ($maxuser > $stats['maxuser']) { $maxuser = $stats['maxuser']; @@ -1425,14 +1185,14 @@ foreach ($top_country as $key => $value) { row2_plain($key, $value); - } + } echo "
    Client state# results
    \n"; echo "\n"; arsort($top_language); foreach ($top_language as $key => $value) { row2_plain($key, $value); - } + } echo "
    Language# users
    "; @@ -1504,5 +1264,5 @@ } } -$cvs_version_tracker[]="\$Id: db_ops.inc 24405 2011-10-16 06:04:13Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: db_ops.inc 25171 2012-01-31 07:21:42Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/inc/forum.inc boinc-7.0.14+dfsg/html/inc/forum.inc --- boinc-7.0.7+dfsg/html/inc/forum.inc 2011-09-27 07:35:26.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/forum.inc 2011-12-24 15:37:20.000000000 +0000 @@ -532,8 +532,8 @@ $url = "pm.php?action=new&userid=".$user->id; $name = $user->name; - show_button($url, "Send message", "Send $name a private message"); - echo "
    Joined: ", gmdate('j M y', $user->create_time), "
    "; + show_button($url, tra("Send message"), tra("Send %1 a private message",$name)); + echo "
    ".tra("Joined: %1", gmdate('j M y', $user->create_time)), "
    "; if (!isset($user->nposts)) { $user->nposts = BoincPost::count("user=$user->id"); @@ -542,14 +542,14 @@ if (function_exists('project_forum_user_info')){ project_forum_user_info($user); } else { - echo "Posts: $user->nposts
    "; + echo tra("Posts: %1", $user->nposts)."
    "; // circumvent various forms of identity spoofing // by displaying the user id of the poster. // //echo "ID: ".$user->id."
    "; if (!no_computing()) { - echo "Credit: ".number_format($user->total_credit)."
    "; - echo "RAC: ".number_format($user->expavg_credit)."
    "; + echo tra("Credit: %1", number_format($user->total_credit)) ."
    "; + echo tra("RAC: %1", number_format($user->expavg_credit))."
    "; } // to use this feature: // - get flags from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip @@ -571,27 +571,27 @@ } if ($logged_in_user && $post->timestamp>$last_visit){ - show_image(NEW_IMAGE, "You haven't read this message yet", "Unread", NEW_IMAGE_HEIGHT); + show_image(NEW_IMAGE, tra("You haven't read this message yet"), tra("Unread"), NEW_IMAGE_HEIGHT); } - echo " id."&nowrap=true#$post->id\">Message ".$post->id." - "; - if ($post->hidden) echo "[hidden] "; - echo "Posted: ", pretty_time_str($post->timestamp), " "; + echo " id."&nowrap=true#$post->id\">".tra("Message %1", $post->id)." - "; + if ($post->hidden) echo "[".tra("hidden")."] "; + echo tra("Posted: %1", pretty_time_str($post->timestamp)), " "; if ($post->parent_post) { - echo " - in response to id."&nowrap=true#".$post->parent_post."\">Message ".$post->parent_post."."; + echo tra(" - in response to ")."id."&nowrap=true#".$post->parent_post."\">".tra("Message %1", $post->parent_post)."."; } if ($can_edit && $controls != NO_CONTROLS) { - show_button("forum_edit.php?id=".$post->id."$tokens", "Edit", "Edit this message"); + show_button("forum_edit.php?id=".$post->id."$tokens", tra("Edit"), tra("Edit this message")); } if (is_moderator($logged_in_user, $forum)) { show_post_moderation_links($config, $logged_in_user, $post, $forum, $tokens); } if ($post->modified) { - echo "
    Last modified: ", pretty_time_Str($post->modified); + echo "
    ".tra("Last modified: %1", pretty_time_Str($post->modified)); } if ($ignore_poster && $filter){ - echo "
    This post is not shown because the sender is on your 'ignore' list. Click id."&filter=false#".$post->id."\">here to view this post"; + echo "
    ".tra("This post is not shown because the sender is on your 'ignore' list. Click %1here%2 to view this post","id."&filter=false#".$post->id."\">",""); } if ($controls == FORUM_CONTROLS) { echo "\n"; @@ -619,26 +619,26 @@ echo "ID: ", $post->id; if ($no_forum_rating) { echo " | id."\">"; - show_image(REPORT_POST_IMAGE, "Report this post as offensive", "Report as offensive", REPORT_POST_IMAGE_HEIGHT); + show_image(REPORT_POST_IMAGE, tra("Report this post as offensive"), tra("Report as offensive"), REPORT_POST_IMAGE_HEIGHT); echo ""; } else { $rating = $post->rating(); - echo " | Rating: ", $rating, " | rate: + echo " | ".tra("Rating: %1", $rating)." | ".tra("rate: ")." id."&choice=p$tokens\"> "; - show_image(RATE_POSITIVE_IMAGE, "Click if you like this message", "Rate +", RATE_POSITIVE_IMAGE_HEIGHT); + show_image(RATE_POSITIVE_IMAGE, tra("Click if you like this message"), tra("Rate +"), RATE_POSITIVE_IMAGE_HEIGHT); echo " / id."&choice=n$tokens\">"; - show_image(RATE_NEGATIVE_IMAGE, "Click if you don't like this message", "Rate -", RATE_NEGATIVE_IMAGE_HEIGHT); + show_image(RATE_NEGATIVE_IMAGE, tra("Click if you don't like this message"), tra("Rate -"), RATE_NEGATIVE_IMAGE_HEIGHT); echo " id."\">"; - show_image(REPORT_POST_IMAGE, "Report this post as offensive", "Report as offensive", REPORT_POST_IMAGE_HEIGHT); + show_image(REPORT_POST_IMAGE, tra("Report this post as offensive"), tra("Report as offensive"), REPORT_POST_IMAGE_HEIGHT); echo ""; } if (($controls == FORUM_CONTROLS) && (can_reply($thread, $forum, $logged_in_user))) { echo "    "; $url = "forum_reply.php?thread=" . $thread->id . "&post=" . $post->id . "&no_quote=1#input"; - show_button($url, "Reply", "Post a reply to this message"); + show_button($url, tra("Reply"), tra("Post a reply to this message")); $url = "forum_reply.php?thread=" . $thread->id . "&post=" . $post->id . "#input"; - show_button($url, "Quote", "Post a reply by quoting this message"); + show_button($url, tra("Quote"), tra("Post a reply by quoting this message")); } echo ""; } else { @@ -659,7 +659,7 @@ $title = cleanup_title($thread->title); $m = $n%2; if ($post->hidden) { - $deleted = "
    [Hidden by a moderator]"; + $deleted = "
    [".tra("Hidden by a moderator")."]"; } else { $deleted = ""; } @@ -678,9 +678,9 @@ break; } echo " - (id."&nowrap=true#".$post->id."\">Message ".$post->id.") + (id."&nowrap=true#".$post->id."\">".tra("Message %1", $post->id).")
    - Posted $when by ".user_links($user)." $deleted + ".tra("Posted %1 by %2", $when, user_links($user))." $deleted


    $content @@ -698,7 +698,7 @@ function check_banished($user) { if (is_banished($user)) { error_page( - "You may not post or rate messages until ".gmdate('M j, Y', $user->prefs->banished_until) + tra("You may not post or rate messages until %1", gmdate('M j, Y', $user->prefs->banished_until)) ); } } @@ -709,7 +709,7 @@ } else { $project_rules=""; } - return " + return tra("
    • Posts must be 'kid friendly': they may not contain content that is obscene, hate-related, @@ -722,7 +722,7 @@
    • No messages that are deliberately hostile or insulting.
    • No abusive comments involving race, religion, nationality, gender, class or sexuality. - ".$project_rules." + ").$project_rules."
    "; } @@ -731,9 +731,8 @@ return "

    - Rules: - ".post_rules()." - More info + ".tra("Rules:").post_rules()." + ".tra("More info")."
    "; @@ -1006,35 +1005,35 @@ $moderators_vote_to_ban = parse_bool($config, "moderators_vote_to_ban"); if ($post->hidden) { - show_button("forum_moderate_post_action.php?action=unhide&id=".$post->id."$tokens", "Unhide", "Unhide this post"); + show_button("forum_moderate_post_action.php?action=unhide&id=".$post->id."$tokens", tra("Unhide"), tra("Unhide this post")); } else { - show_button("forum_moderate_post.php?action=hide&id=".$post->id."$tokens", "Hide", "Hide this post"); + show_button("forum_moderate_post.php?action=hide&id=".$post->id."$tokens", tra("Hide"), tra("Hide this post")); } show_button( "forum_moderate_post.php?action=move&id=".$post->id."$tokens", - "Move", "Move post to a different thread" + tra("Move"), tra("Move post to a different thread") ); if ($forum->parent_type == 0) { if ($logged_in_user->prefs->privilege(S_ADMIN) || ($logged_in_user->prefs->privilege(S_MODERATOR) && $moderators_allowed_to_ban)) { - show_button("forum_moderate_post.php?action=banish_user&id=".$post->id."&userid=".$post->user."$tokens", "Banish author"); + show_button("forum_moderate_post.php?action=banish_user&id=".$post->id."&userid=".$post->user."$tokens", tra("Banish author")); } if ($logged_in_user->prefs->privilege(S_MODERATOR) && $moderators_vote_to_ban) { require_once("../inc/forum_banishment_vote.inc"); if (vote_is_in_progress($post->user)) { show_button( "forum_banishment_vote.php?action=yes&userid=".$post->user, - "Vote to banish author" + tra("Vote to banish author") ); show_button( "forum_banishment_vote.php?action=no&userid=".$post->user, - "Vote not to banish author" + tra("Vote not to banish author") ); } else { show_button( "forum_banishment_vote.php?action=start&userid=".$post->user, - "Start vote to banish author" + tra("Start vote to banish author") ); } } @@ -1067,7 +1066,7 @@ // non-team-members can't post // if ($user->teamid != $team->id) { - error_page("Only team members can post to the team message board"); + error_page(tra("Only team members can post to the team message board")); } break; } @@ -1091,12 +1090,12 @@ function check_reply_access($user, $forum, $thread) { if ($thread->locked && !is_moderator($user, $forum)) { error_page( - "This thread is locked. Only forum moderators and administrators are allowed to post there." + tra("This thread is locked. Only forum moderators and administrators are allowed to post there.") ); } if ($thread->hidden) { error_page( - "Can't post to a hidden thread." + tra("Can't post to a hidden thread.") ); } @@ -1186,13 +1185,13 @@ function subscribed_post_web_line($notify) { $thread = BoincThread::lookup_id($notify->opaque); - return "New posts in the thread id>$thread->title"; + return tra("New posts in the thread %1","id>$thread->title"); } function subscribe_rss($notify, &$title, &$msg, &$url) { $thread = BoincThread::lookup_id($notify->opaque); - $title = "New posts in subscribed thread"; - $msg = "There are new posts in the thread '$thread->title'"; + $title = tra("New posts in subscribed thread"); + $msg = tra("There are new posts in the thread '%1'",$thread->title); $url = URL_BASE."forum_thread.php?id=$thread->id"; } diff -Nru boinc-7.0.7+dfsg/html/inc/host.inc boinc-7.0.14+dfsg/html/inc/host.inc --- boinc-7.0.7+dfsg/html/inc/host.inc 2011-11-03 02:35:04.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/host.inc 2011-12-24 02:01:54.000000000 +0000 @@ -238,7 +238,7 @@ return BoincResult::count("hostid=$host->id"); } -// Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers], +// Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers], // return a human-readable version of the GPU info // function gpu_desc($x) { @@ -249,8 +249,9 @@ $desc = trim($desc, "["); $d = explode("|", $desc); //print_r($d); - if ($d[0] == "BOINC") continue; - if ($str) $str .= ", "; + if ($d[0] == "BOINC") continue; + if ($d[0] == "vbox") continue; + if ($str) $str .= ", "; if ($d[2]!="" && $d[2]!="1") $str .= "[".$d[2]."] "; if ($d[0] == "CUDA") { $str .= "NVIDIA"; @@ -377,61 +378,79 @@ echo "\n"; } -// return true if it's possible that the hosts are actually -// the same machine +// Logic for deciding whether two host records might actually +// be the same machine, based on CPU info // -function ghz($x) { - $y = explode(" ", $x); +// p_vendor is typically either AuthenticAMD or GenuineIntel. +// Over time we've changed the contents of p_model. +// Some examples: +// Intel(R) Core(TM)2 Duo CPU E7300 @ 2.66GHz [Family 6 Model 23 Stepping 6] +// AMD Athlon(tm) II X2 250 Processor [Family 16 Model 6 Stepping 3] +// Intel(R) Xeon(R) CPU X5650 @ 2.67GHz [x86 Family 6 Model 44 Stepping 2] +// Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz [Intel64 Family 6 Model 42 Stepping 7] +// +// in the last 2 cases, let's call x86 and Intel64 the "architecture" +// +// so, here's the policy: +// +// if p_ncpus different, return false +// if p_vendor different, return false +// if both have family/model/stepping info +// if info disagrees, return false +// if both have GHz info, and they disagree, return false +// if both have architecture, and they disagree, return false +// return true +// if p_model different, return false +// return true +// + +// parse p_model to produce the following structure: +// x->speed "3.00GHz" etc. or null +// x->arch "x86" etc. or null +// x->info "Family 6 Model 23 Stepping 6" etc. or null +// +function parse_model($model) { + $y = explode(" ", $model); + $x = null; + $x->speed = null; + $x->arch = null; + $x->info = null; foreach ($y as $z) { - if (strstr($z, "GHz")) return $z; - if (strstr($z, "MHz")) return $z; + if (strstr($z, "GHz")) $x->speed = $z; + if (strstr($z, "MHz")) $x->speed = $z; } + $pos1 = strpos($model, '['); + if ($pos1 === false) return $x; + $pos2 = strpos($model, ']'); + if ($pos2 === false) return $x; + $a = substr($model, $pos1+1, $pos2-$pos1-1); + $y = explode(" ", $a); + if (count($y) == 0) return $x; + if ($y[0] == "Family") { + $x->info = $a; + } else { + $x->arch = $y[0]; + $x->info = substr($a, strlen($y[0])+1); + } + return $x; } function cpus_compatible($host1, $host2) { - // we screwed around with Intel processor names, - // so count them as compatible if both contain "Intel" and "Pentium", - // and don't have conflicting clock rate info - - // Get rid of cpu capabilities before check - $pos = strpos($host1->p_model, '['); - $host1pm = $host1->p_model; - if($pos) { - $host1pm = trim(substr($host1->p_model, 0, $pos)); - } - $pos = strpos($host2->p_model, '['); - $host2pm = $host2->p_model; - if($pos) { - $host2pm = trim(substr($host2->p_model, 0, $pos)); - } - $p1 = "$host1->p_vendor $host1pm"; - $p2 = "$host2->p_vendor $host2pm"; - - if (strstr($p1, "Pentium") && strstr($p1, "Intel") - && strstr($p2, "Pentium") && strstr($p2, "Intel") - ) { - $g1 = ghz($p1); - $g2 = ghz($p2); - if ($g1 && $g2) { - if ($g1 != $g2) { - return false; - } - } else if ($g1 && !$g2) { - return false; - } else if (!$g1 && $g2) { - return false; + if ($host1->p_ncpus != $host2->p_ncpus) return false; + if ($host1->p_vendor != $host2->p_vendor) return false; + $x1 = parse_model($host1->p_model); + $x2 = parse_model($host2->p_model); + if ($x1->info && $x2->info) { + if ($x1->info != $x2->info) return false; + if ($x1->speed && $x2->speed) { + if ($x1->speed != $x2->speed) return false; } - } else if (strstr($p1, "AuthenticAMD") && strstr($p2, "AuthenticAMD")) { - return true; - } else { - if ($host2->p_vendor != $host1->p_vendor) return false; - - // they're compatible if models are the same, - // or contents of [family/model/stepping] are the same - if ($host1pm != $host2pm) { - return false; + if ($x1->arch && $x2->arch) { + if ($x1->arch != $x2->arch) return false; } + return true; } + if ($host1->p_model != $host2->p_model) return false; return true; } @@ -703,6 +722,6 @@ } } -$cvs_version_tracker[]="\$Id: host.inc 24510 2011-11-03 02:35:04Z romw $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: host.inc 24882 2011-12-24 02:01:54Z romw $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/inc/pm.inc boinc-7.0.14+dfsg/html/inc/pm.inc --- boinc-7.0.7+dfsg/html/inc/pm.inc 2011-08-26 18:30:13.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/pm.inc 2011-12-24 15:37:20.000000000 +0000 @@ -45,7 +45,7 @@ if ($replyto) { $message = BoincPrivateMessage::lookup_id($replyto); if (!$message || $message->userid != $g_logged_in_user->id) { - error_page("no such message"); + error_page(tra("no such message")); } $content = "[quote]".$message->content."[/quote]\n"; $userid = $message->senderid; diff -Nru boinc-7.0.7+dfsg/html/inc/prefs.inc boinc-7.0.14+dfsg/html/inc/prefs.inc --- boinc-7.0.7+dfsg/html/inc/prefs.inc 2011-07-31 05:09:08.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/prefs.inc 2012-01-27 19:24:20.000000000 +0000 @@ -214,16 +214,15 @@ $net_prefs = array( new PREF_NUM( tra( - "Computer is connected to the Internet about every %1 Leave blank or 0 if always connected. %2 BOINC will try to maintain at least this much work (max 10 days). %3", + "Maintain enough tasks to keep busy for%1(max 10 days).%2", "
    ", - "
    ", "
    " ), "work_buf_min_days", new NUM_SPEC(tra("days"), 0, 10, 0) ), new PREF_NUM( - tra("Maintain enough work for an additional"), + tra("Maintain additional tasks to keep busy for up to"), "work_buf_additional_days", new NUM_SPEC(tra("days"), 0, 10, .25) ), diff -Nru boinc-7.0.7+dfsg/html/inc/result.inc boinc-7.0.14+dfsg/html/inc/result.inc --- boinc-7.0.7+dfsg/html/inc/result.inc 2011-10-11 18:58:54.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/result.inc 2012-01-01 23:54:58.000000000 +0000 @@ -257,6 +257,24 @@ return tra("Unknown"); } +function assimilate_state_str($s) { + switch($s) { + case 0: return "Initial"; + case 1: return "Ready to assimilate"; + case 2: return "Assimilated"; + } + return "Unknown"; +} + +function file_delete_state_str($s) { + switch($s) { + case 0: return "Initial"; + case 1: return "Ready to delete"; + case 2: return "Deleted"; + case 3: return "Delete Error"; + } + return "Unknown"; +} function wu_error_mask_str($s) { $x = ""; if ($s & 1) { @@ -408,6 +426,155 @@ return sprintf("%.2f", $version_num/100); } } + +// Decode ErrorNumber into human readable, taken from lib/error_numbers.h keep this up to date +// @return String A human readable error message +// @param Integer $x An error number +function result_error_mask_str($x){ + switch($x){ + case 0: return ""; + case 192: return "EXIT_STATEFILE_WRITE"; + case 193: return "EXIT_SIGNAL"; + case 194: return "EXIT_ABORTED_BY_CLIENT"; + case 195: return "EXIT_CHILD_FAILED"; + case -100: return "ERR_SELECT"; + case -102: return "ERR_READ"; + case -103: return "ERR_WRITE"; + case -104: return "ERR_FREAD"; + case -105: return "ERR_FWRITE"; + case -106: return "ERR_IO"; + case -107: return "ERR_CONNECT"; + case -108: return "ERR_FOPEN"; + case -109: return "ERR_RENAME"; + case -110: return "ERR_UNLINK"; + case -111: return "ERR_OPENDIR"; + case -112: return "ERR_XML_PARSE"; + case -113: return "ERR_GETHOSTBYNAME"; + case -114: return "ERR_GIVEUP_DOWNLOAD"; + case -115: return "ERR_GIVEUP_UPLOAD"; + case -116: return "ERR_NULL"; + case -117: return "ERR_NEG"; + case -118: return "ERR_BUFFER_OVERFLOW"; + case -119: return "ERR_MD5_FAILED"; + case -120: return "ERR_RSA_FAILED"; + case -121: return "ERR_OPEN"; + case -122: return "ERR_DUP2"; + case -123: return "ERR_NO_SIGNATURE"; + case -124: return "ERR_THREAD"; + case -125: return "ERR_SIGNAL_CATCH"; + case -126: return "ERR_QUIT_REQUEST"; + case -127: return "ERR_UPLOAD_TRANSIENT"; + case -128: return "ERR_UPLOAD_PERMANENT"; + case -129: return "ERR_IDLE_PERIOD"; + case -130: return "ERR_ALREADY_ATTACHED"; + case -131: return "ERR_FILE_TOO_BIG"; + case -132: return "ERR_GETRUSAGE"; + case -133: return "ERR_BENCHMARK_FAILED"; + case -134: return "ERR_BAD_HEX_FORMAT"; + case -135: return "ERR_USER_REJECTED"; + case -136: return "ERR_DB_NOT_FOUND"; + case -137: return "ERR_DB_NOT_UNIQUE"; + case -138: return "ERR_DB_CANT_CONNECT"; + case -139: return "ERR_GETS"; + case -140: return "ERR_SCANF"; + case -141: return "ERR_STRCHR"; + case -142: return "ERR_STRSTR"; + case -143: return "ERR_READDIR"; + case -144: return "ERR_SHMGET"; + case -145: return "ERR_SHMCTL"; + case -146: return "ERR_SHMAT"; + case -147: return "ERR_FORK"; + case -148: return "ERR_EXEC"; + case -149: return "ERR_NOT_EXITED"; + case -150: return "ERR_NOT_IMPLEMENTED"; + case -151: return "ERR_GETHOSTNAME"; + case -152: return "ERR_NETOPEN"; + case -153: return "ERR_SOCKET"; + case -154: return "ERR_FCNTL"; + case -155: return "ERR_AUTHENTICATOR"; + case -156: return "ERR_SCHED_SHMEM"; + case -157: return "ERR_ASYNCSELECT"; + case -158: return "ERR_BAD_RESULT_STATE"; + case -159: return "ERR_DB_CANT_INIT"; + case -160: return "ERR_NOT_UNIQUE"; + case -161: return "ERR_NOT_FOUND"; + case -162: return "ERR_NO_EXIT_STATUS"; + case -163: return "ERR_FILE_MISSING"; + case -164: return "ERR_NESTED_UNHANDLED_EXCEPTION_DETECTED"; + case -165: return "ERR_SEMGET"; + case -166: return "ERR_SEMCTL"; + case -167: return "ERR_SEMOP"; + case -168: return "ERR_FTOK"; + case -169: return "ERR_SOCKS_UNKNOWN_FAILURE"; + case -170: return "ERR_SOCKS_REQUEST_FAILED"; + case -171: return "ERR_SOCKS_BAD_USER_PASS"; + case -172: return "ERR_SOCKS_UNKNOWN_SERVER_VERSION"; + case -173: return "ERR_SOCKS_UNSUPPORTED"; + case -174: return "ERR_SOCKS_CANT_REACH_HOST"; + case -175: return "ERR_SOCKS_CONN_REFUSED"; + case -176: return "ERR_TIMER_INIT"; + case -177: return "ERR_RSC_LIMIT_EXCEEDED"; + case -178: return "ERR_INVALID_PARAM"; + case -179: return "ERR_SIGNAL_OP"; + case -180: return "ERR_BIND"; + case -181: return "ERR_LISTEN"; + case -182: return "ERR_TIMEOUT"; + case -183: return "ERR_PROJECT_DOWN"; + case -184: return "ERR_HTTP_ERROR"; + case -185: return "ERR_RESULT_START"; + case -186: return "ERR_RESULT_DOWNLOAD"; + case -187: return "ERR_RESULT_UPLOAD"; + case -189: return "ERR_INVALID_URL"; + case -190: return "ERR_MAJOR_VERSION"; + case -191: return "ERR_NO_OPTION"; + case -192: return "ERR_MKDIR"; + case -193: return "ERR_INVALID_EVENT"; + case -194: return "ERR_ALREADY_RUNNING"; + case -195: return "ERR_NO_APP_VERSION"; + case -196: return "ERR_WU_USER_RULE"; + case -197: return "ERR_ABORTED_VIA_GUI"; + case -198: return "ERR_INSUFFICIENT_RESOURCE"; + case -199: return "ERR_RETRY"; + case -200: return "ERR_WRONG_SIZE"; + case -201: return "ERR_USER_PERMISSION"; + case -202: return "ERR_SHMEM_NAME"; + case -203: return "ERR_NO_NETWORK_CONNECTION"; + case -204: return "ERR_IN_PROGRESS"; + case -205: return "ERR_BAD_EMAIL_ADDR"; + case -206: return "ERR_BAD_PASSWD"; + case -207: return "ERR_NONUNIQUE_EMAIL"; + case -208: return "ERR_ACCT_CREATION_DISABLED"; + case -209: return "ERR_ATTACH_FAIL_INIT"; + case -210: return "ERR_ATTACH_FAIL_DOWNLOAD"; + case -211: return "ERR_ATTACH_FAIL_PARSE"; + case -212: return "ERR_ATTACH_FAIL_BAD_KEY"; + case -213: return "ERR_ATTACH_FAIL_FILE_WRITE"; + case -214: return "ERR_ATTACH_FAIL_SERVER_ERROR"; + case -215: return "ERR_SIGNING_KEY"; + case -216: return "ERR_FFLUSH"; + case -217: return "ERR_FSYNC"; + case -218: return "ERR_TRUNCATE"; + case -219: return "ERR_WRONG_URL"; + case -220: return "ERR_DUP_NAME"; + case -221: return "ERR_ABORTED_BY_PROJECT"; + case -222: return "ERR_GETGRNAM"; + case -223: return "ERR_CHOWN"; + case -224: return "ERR_FILE_NOT_FOUND"; + case -225: return "ERR_BAD_FILENAME"; + case -226: return "ERR_TOO_MANY_EXITS"; + case -227: return "ERR_RMDIR"; + case -228: return "ERR_CHILD_FAILED"; + case -229: return "ERR_SYMLINK"; + case -230: return "ERR_DB_CONN_LOST"; + case -231: return "ERR_CRYPTO"; + case -232: return "ERR_ABORTED_ON_EXIT"; + case -233: return "ERR_UNSTARTED_LATE"; + case -234: return "ERR_MISSING_COPROC"; + case -235: return "ERR_PROC_PARSE"; + default: return "Unknown error number"; + } +} + function exit_status_string($result) { $x = $result->exit_status; if ($x == 0) { @@ -416,7 +583,7 @@ $x = (int)$y; } } - return sprintf("%d (0x%x)", $x, $x); + return sprintf("%d (0x%x)", $x, $x). " ".result_error_mask_str($x); } function show_result($result, $show_outfile_links=false) { @@ -544,6 +711,6 @@ return $x; } -$cvs_version_tracker[]="\$Id: result.inc 24379 2011-10-11 18:58:54Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: result.inc 24964 2012-01-01 23:54:58Z romw $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/inc/sandbox.inc boinc-7.0.14+dfsg/html/inc/sandbox.inc --- boinc-7.0.7+dfsg/html/inc/sandbox.inc 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/sandbox.inc 2012-01-03 09:30:43.000000000 +0000 @@ -0,0 +1,88 @@ +. + +// Utility functions for user file sandbox feature + +require_once("../inc/util.inc"); +require_once("../inc/dir_hier.inc"); + +// Return path of sandbox directory for the given user. +// Create dir if not present. +// +function sandbox_dir($user) { + if (!is_dir("../../sandbox")) { + mkdir("../../sandbox"); + } + $d = "../../sandbox/$user->id"; + if (!is_dir($d)) { + mkdir($d); + } + return $d; +} + +function sandbox_write_link_file($path, $size, $md5) { + file_put_contents($path, "sb $size $md5"); +} + +// parse a link file and return +// (error, size, md5) +// +function sandbox_parse_link_file($path) { + $x = file_get_contents($path); + $n = sscanf($x, "%s %d %s", $s, $size, $md5); + if ($n != 3) return array(true, null, null); + if ($s != 'sb') return array(true, null, null); + return array(false, $size, $md5); +} + +$fanout = parse_config(get_config(), ""); + +// return the path of the file in the download directory +// +function sandbox_physical_path($user, $md5) { + global $fanout; + $f = "sb_".$user->id."_".$md5; + return dir_hier_path($f, "../../download", $fanout); +} + +// return list of files in sandbox +// +function sandbox_file_names($user) { + $d = opendir(sandbox_dir($user)); + $names = array(); + while (($f = readdir($d)) !== false) { + if ($f == '.') continue; + if ($f == '..') continue; + $names[] = $f; + } + return $names; +} + +// return a \n"; + $files = sandbox_file_names($user); + foreach ($files as $f) { + $x .= "\n"; + } + $x .= "\n"; + return $x; +} + +?> diff -Nru boinc-7.0.7+dfsg/html/inc/submit.inc boinc-7.0.14+dfsg/html/inc/submit.inc --- boinc-7.0.7+dfsg/html/inc/submit.inc 2011-09-21 21:26:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/submit.inc 2011-12-31 08:57:53.000000000 +0000 @@ -16,17 +16,27 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// Remote job submission API. +// BOINC's remote job submission system allows users to: +// 1) manage a set of files on the server, +// with physical names that are isolated from other users +// 2) submit batches of jobs +// +// These features can be provided by a "portal" web site +// that is distinct from the BOINC server. +// +// This file contains library functions that can be used by portals. +// It communicates (using HTTP/XML) with the BOINC server. +// // Functions: -// boinc_estimate_batch(); esimate completion time of a batch of jobs -// boinc_submit_batch(): submit a batch -// boinc_query_batches(): get list of batches -// boinc_query_batch(): get detaills of a batch -// boinc_query_job(): get details of a job // boinc_abort_batch(): abort a batch +// boinc_estimate_batch(); estimate completion time of a batch // boinc_get_output_file(): get the URL for an output file // boinc_get_output_files(): get the URL for zipped batch output +// boinc_query_batch(): get detaills of a batch +// boinc_query_batches(): get list of batches +// boinc_query_job(): get details of a job // boinc_retire_batch(): retire a batch; delete output files +// boinc_submit_batch(): submit a batch //// Implementation stuff follows @@ -71,7 +81,7 @@ } function do_http_op($project, $xml) { - $ch = curl_init("$project/submit.php"); + $ch = curl_init("$project/submit_rpc_handler.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "request=$xml"); @@ -292,5 +302,4 @@ } } - ?> diff -Nru boinc-7.0.7+dfsg/html/inc/submit_util.inc boinc-7.0.14+dfsg/html/inc/submit_util.inc --- boinc-7.0.7+dfsg/html/inc/submit_util.inc 2011-09-21 21:26:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/submit_util.inc 2011-12-31 08:57:53.000000000 +0000 @@ -17,10 +17,46 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// utility functions for remote job submissions and control +// server-side utility functions for remote job submissions and control require_once("../inc/submit_db.inc"); +// given its WUs, compute params of a batch +// NOTE: eventually this should be done by server components +// (transitioner, validator etc.) as jobs complete or time out +// +// TODO: update est_completion_time +// +function get_batch_params($batch, $wus) { + $fp_total = 0; + $fp_done = 0; + $completed = true; + $batch->nerror_jobs = 0; + $batch->credit_canonical = 0; + foreach ($wus as $wu) { + $fp_total += $wu->rsc_fpops_est; + if ($wu->canonical_resultid) { + $fp_done += $wu->rsc_fpops_est; + $batch->credit_canonical += $wu->canonical_credit; + } else if ($wu->error_mask) { + $batch->nerror_jobs++; + } else { + $completed = false; + } + } + if ($fp_total) { + $batch->fraction_done = $fp_done / $fp_total; + } + if ($completed && $batch->state < BATCH_STATE_COMPLETE) { + $batch->state = BATCH_STATE_COMPLETE; + $batch->completion_time = time(); + } + $batch->update("fraction_done = $batch->fraction_done, nerror_jobs = $batch->nerror_jobs, state=$batch->state, completion_time = $batch->completion_time, credit_canonical = $batch->credit_canonical"); + + $batch->credit_estimate = flops_to_credit($fp_total); + return $batch; +} + function get_outfile_names($result) { $names = array(); $xml = "".$result->xml_doc_out.""; @@ -83,4 +119,15 @@ return "unknown state $state"; } +function boinc_get_output_file_url($user, $result, $i) { + $name = $result->name; + $auth_str = md5($user->authenticator.$name); + return "get_output.php?instance_name=$name&file_num=$i&auth_str=$auth_str"; +} + +function boinc_get_output_files_url($user, $batch_id) { + $auth_str = md5($user->authenticator.$batch_id); + return "get_output.php?batch_id=$batch_id&auth_str=$auth_str"; +} + ?> diff -Nru boinc-7.0.7+dfsg/html/inc/text_transform.inc boinc-7.0.14+dfsg/html/inc/text_transform.inc --- boinc-7.0.7+dfsg/html/inc/text_transform.inc 2011-02-14 19:06:42.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/text_transform.inc 2011-11-20 17:26:32.000000000 +0000 @@ -114,6 +114,7 @@ "@\[b\](.*?)\[/b\]@is", "@\[i\](.*?)\[/i\]@is", "@\[u\](.*?)\[/u\]@is", + "@\[sup\](.*?)\[/sup\]@is", "@\[url=$httpsregex\](.*?)\[/url\]@is", "@\[url\]$httpsregex\[/url\]@is", "@\[link=$urlregex\](.*?)\[/link\]@is", @@ -146,6 +147,7 @@ "\\1", "\\1", "\\1", + "\\1", "\\2", "https://\\1", "\\3", @@ -173,6 +175,7 @@ "\\1", "\\1", "\\1", + "\\1", "\\2", "https://\\1", "\\3", @@ -265,5 +268,5 @@ } } -$cvs_version_tracker[]="\$Id: text_transform.inc 23029 2011-02-14 19:06:42Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: text_transform.inc 24622 2011-11-20 17:26:32Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/inc/util.inc boinc-7.0.14+dfsg/html/inc/util.inc --- boinc-7.0.7+dfsg/html/inc/util.inc 2011-11-14 23:31:12.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/util.inc 2012-01-02 05:53:42.000000000 +0000 @@ -536,7 +536,7 @@ } function html_info() { - return "
    ".tra("Use BBCode tags to format your text")."\n"; + return "
    ".tra("Use BBCode tags to format your text")."\n"; } // strip slashes if magic quotes in effect @@ -714,6 +714,10 @@ if (!$desc) $desc = $text; echo "".$text."\n"; } +function button_text($url, $text, $desc=null, $class="button") { + if (!$desc) $desc = $text; + return "".$text."\n"; +} // When multiple buttons (or actions) are presented in a list you can // use this convenience method to avoid having to wrap each button in
  • elements @@ -850,6 +854,6 @@ return $c/(200/24); } -$cvs_version_tracker[]="\$Id: util.inc 24593 2011-11-14 23:31:12Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: util.inc 24968 2012-01-02 05:53:42Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/inc/util_ops.inc boinc-7.0.14+dfsg/html/inc/util_ops.inc --- boinc-7.0.7+dfsg/html/inc/util_ops.inc 2011-07-13 21:50:48.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/util_ops.inc 2012-01-02 07:33:08.000000000 +0000 @@ -104,19 +104,18 @@ $host = "localhost"; } $in = fopen("php://stdin","r"); - print "Database username for $db_name@$host: "; + print "Database username (if not current user): "; $user = rtrim(fgets($in, 80)); - print "Database password for $db_name@host: "; + print "Database password (if any): "; $pass = rtrim(fgets($in, 80)); $retval = mysql_pconnect($host, $user, $pass); if (!$retval) { - return 1; + die("Can't connect to DB\n"); } if (!mysql_select_db($db_name)) { - return 2; + die("Can't select DB\n"); } - return 0; } function print_login_form_ops($next_url='') { @@ -243,5 +242,5 @@ auth_ops(); } -$cvs_version_tracker[]="\$Id: util_ops.inc 23840 2011-07-13 21:50:48Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: util_ops.inc 24969 2012-01-02 07:33:08Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/inc/wap.inc boinc-7.0.14+dfsg/html/inc/wap.inc --- boinc-7.0.7+dfsg/html/inc/wap.inc 2008-08-05 22:43:14.000000000 +0000 +++ boinc-7.0.14+dfsg/html/inc/wap.inc 2012-01-18 20:59:24.000000000 +0000 @@ -33,6 +33,6 @@ } function wap_timestamp() { - return strftime("%d %b %Y %H:%M:%S UTC", mktime()); + return gmdate('j M Y G:i:s', time()) . " UTC"; } ?> diff -Nru boinc-7.0.7+dfsg/html/ops/db_action.php boinc-7.0.14+dfsg/html/ops/db_action.php --- boinc-7.0.7+dfsg/html/ops/db_action.php 2008-09-07 07:40:56.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/db_action.php 2011-12-21 18:29:11.000000000 +0000 @@ -208,7 +208,7 @@ show_workunit($res); break; case "result": - show_result($res); + show_result_ops($res); break; case "team": show_team($res); @@ -228,5 +228,5 @@ } admin_page_tail(); -$cvs_version_tracker[]="\$Id: db_action.php 15975 2008-09-07 07:40:56Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: db_action.php 24857 2011-12-21 18:29:11Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/ops/db_update.php boinc-7.0.14+dfsg/html/ops/db_update.php --- boinc-7.0.7+dfsg/html/ops/db_update.php 2011-09-21 21:26:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/db_update.php 2012-02-02 00:18:42.000000000 +0000 @@ -796,6 +796,17 @@ add manage tinyint not null "); } + +function update_1_30_2012() { + do_query(" + alter table workunit + add transitioner_flags tinyint not null + "); + do_query( + "alter table assignment add index asgn_target(target_type, target_id)" + ); +} + // Updates are done automatically if you use "upgrade". // // If you need to do updates manually, @@ -819,6 +830,7 @@ array(24137, "update_9_6_2011"), array(24225, "update_9_15_2011"), array(24248, "update_9_20_2011"), + array(25169, "update_1_30_2012"), ); diff -Nru boinc-7.0.7+dfsg/html/ops/failure_result_summary_by_host.php boinc-7.0.14+dfsg/html/ops/failure_result_summary_by_host.php --- boinc-7.0.7+dfsg/html/ops/failure_result_summary_by_host.php 2008-08-05 22:43:14.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/failure_result_summary_by_host.php 2012-01-31 07:21:42.000000000 +0000 @@ -19,14 +19,15 @@ require_once("../inc/util_ops.inc"); db_init(); -admin_page_head("Result Failure Summary by Host"); +admin_page_head("Failures grouped by app version and host"); $query_appid = $_GET['appid']; $query_received_time = time() - $_GET['nsecs']; $main_query = " SELECT - app_version_num AS App_Version, + app_version_id, + app_version_num, hostid AS Host_ID, case when INSTR(host.os_name, 'Darwin') then 'Darwin' @@ -55,54 +56,34 @@ outcome = '3' and received_time > '$query_received_time' GROUP BY - app_version_num DESC, - hostid, - OS_Name, - OS_Version, - host.nresults_today + app_version_id, + hostid +order by error_count desc "; $result = mysql_query($main_query); -echo "\n"; -echo "\n"; +start_table(); +table_header( + "App version", "Host ID", "OS Version", "Results today", + "Error count" +); while ($res = mysql_fetch_object($result)) { - - echo ""; - - echo ""; - - echo ""; - - echo ""; - - echo ""; - - echo ""; - - echo ""; - - echo "\n"; - + $av = BoincAppVersion::lookup_id($res->app_version_id); + $p = BoincPlatform::lookup_id($av->platformid); + table_row( + sprintf("%.2f", $res->app_version_num/100)." $p->name [$av->plan_class]", + $res->Host_ID, + $res->OS_Version, $res->Results_Today, + "Host_ID&app_version_id=$res->app_version_id&server_state=5&outcome=3>$res->error_count" + ); } mysql_free_result($result); -echo "
    App VersionHost IDOS NameOS VersionResults TodayError Count
    "; - echo $res->App_Version; - echo ""; - echo $res->Host_ID; - echo ""; - echo $res->OS_Name; - echo ""; - echo $res->OS_Version; - echo ""; - echo $res->Results_Today; - echo ""; - echo $res->error_count; - echo "
    \n"; +end_table(); admin_page_tail(); -$cvs_version_tracker[]="\$Id: failure_result_summary_by_host.php 15758 2008-08-05 22:43:14Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: failure_result_summary_by_host.php 25171 2012-01-31 07:21:42Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/ops/failure_result_summary_by_platform.php boinc-7.0.14+dfsg/html/ops/failure_result_summary_by_platform.php --- boinc-7.0.7+dfsg/html/ops/failure_result_summary_by_platform.php 2008-08-05 22:43:14.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/failure_result_summary_by_platform.php 2012-01-31 07:21:42.000000000 +0000 @@ -19,7 +19,7 @@ require_once("../inc/util_ops.inc"); db_init(); -admin_page_head("Result Failure Summary by Platform"); +admin_page_head("Failure summary by (app version, error)"); $query_appid = $_GET['appid']; $query_received_time = time() - $_GET['nsecs']; @@ -29,7 +29,8 @@ $main_query = " SELECT - app_version_num AS App_Version, + app_version_id, + app_version.plan_class, case when INSTR(host.os_name, 'Darwin') then 'Darwin' when INSTR(host.os_name, 'Linux') then 'Linux' @@ -43,52 +44,43 @@ COUNT(*) AS error_count FROM result left join host on result.hostid = host.id + left join app_version on result.app_version_id = app_version.id WHERE - appid = '$query_appid' and + result.appid = '$query_appid' and server_state = '5' and outcome = '3' and received_time > '$query_received_time' GROUP BY - app_version_num DESC, - OS_Name, + app_version_id, exit_status +order by error_count desc "; $urlquery = $q->urlquery; $result = mysql_query($main_query); -echo "\n"; -echo "\n"; +start_table(); +table_header( + "App version", "Exit Status", "Error Count" +); while ($res = mysql_fetch_object($result)) { - - echo ""; - - echo ""; - - echo ""; - - echo ""; - - echo ""; - - echo "\n"; - + $av = BoincAppVersion::lookup_id($res->app_version_id); + $p = BoincPlatform::lookup_id($av->platformid); + table_row( + sprintf("%.2f", $av->version_num/100)." $p->name [$av->plan_class]", + link_results( + exit_status_string($res), $urlquery, "$exit_status_condition", "" + ), + $res->error_count + ); } mysql_free_result($result); -echo "
    App VersionOSExit StatusError Count
    "; - echo $res->App_Version; - echo ""; - echo $res->OS_Name; - echo ""; $exit_status_condition = "exit_status=$res->exit_status"; - echo link_results(exit_status_string($res), $urlquery, "$exit_status_condition", ""); - echo ""; - echo $res->error_count; - echo "
    \n"; +end_table(); admin_page_tail(); -$cvs_version_tracker[]="\$Id: failure_result_summary_by_platform.php 15758 2008-08-05 22:43:14Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: failure_result_summary_by_platform.php 25171 2012-01-31 07:21:42Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/ops/index.php boinc-7.0.14+dfsg/html/ops/index.php --- boinc-7.0.7+dfsg/html/ops/index.php 2011-10-16 06:04:13.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/index.php 2012-01-31 07:21:42.000000000 +0000 @@ -151,7 +151,7 @@
    • Screen user profiles
    • User privileges
    • -
    • User job submission privileges
    • +
    • User job submission privileges
    • Send mass email to a selected set of users
    • Email user with misconfigured host
    • @@ -175,26 +175,39 @@ if (in_array($app->id, $show_only) || ( in_array("all", $show_only) && (!$app->deprecated || $show_deprecated) - ) - ) { + )) { - echo " - Result summary for $app->name: - - "; + echo " + Results for $app->name: + "; } - } +} mysql_free_result($result); if ($show_deprecated) { @@ -219,5 +232,5 @@ admin_page_tail(); -$cvs_version_tracker[]="\$Id: index.php 24405 2011-10-16 06:04:13Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: index.php 25171 2012-01-31 07:21:42Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/ops/manage_apps.php boinc-7.0.14+dfsg/html/ops/manage_apps.php --- boinc-7.0.7+dfsg/html/ops/manage_apps.php 2011-07-12 05:19:15.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/manage_apps.php 2012-01-21 00:04:54.000000000 +0000 @@ -25,7 +25,7 @@ * Some of the fields can be changed. * * Eric Myers - 4 June 2006 - * @(#) $Id: manage_apps.php 23835 2011-07-12 05:19:15Z davea $ + * @(#) $Id: manage_apps.php 25115 2012-01-21 00:04:54Z davea $ \***********************************************************************/ // TODO - code cleanup and use new DB interface @@ -48,7 +48,6 @@ } mysql_free_result($result); - /***************************************************\ * Action: process form input for changes \***************************************************/ @@ -85,7 +84,6 @@ } - /* Minimum version limit */ $field="weight_".$id; $new_v= $_POST[$field] + 0; $old_v=$item->weight; @@ -133,20 +131,26 @@ admin_page_head("Manage Applications"); -if(isset($commands)) echo $commands; +if (strlen($commands)) { + echo "The following updates were done: $commands +

      + You must stop and restart the project + for these changes to take effect. +"; +} $self=$_SERVER['PHP_SELF']; echo "\n"; -start_table("align='center'"); +start_table(); echo "ID # Name and description
      Click for details Created - minimum
      client
      version + minimum app version for HR weight - homogeneous
      redundancy
      type (0=none) + homogeneous redundancy type (0=none) deprecated? \n"; @@ -245,5 +249,5 @@ admin_page_tail(); //Generated automatically - do not edit -$cvs_version_tracker[]="\$Id: manage_apps.php 23835 2011-07-12 05:19:15Z davea $"; +$cvs_version_tracker[]="\$Id: manage_apps.php 25115 2012-01-21 00:04:54Z davea $"; ?> diff -Nru boinc-7.0.7+dfsg/html/ops/manage_app_versions.php boinc-7.0.14+dfsg/html/ops/manage_app_versions.php --- boinc-7.0.7+dfsg/html/ops/manage_app_versions.php 2011-08-03 16:45:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/manage_app_versions.php 2012-01-21 00:04:54.000000000 +0000 @@ -25,7 +25,7 @@ * Some of the fields can be changed. * * Eric Myers - 4 June 2006 - * @(#) $Id: manage_app_versions.php 23923 2011-08-03 16:45:00Z davea $ + * @(#) $Id: manage_app_versions.php 25115 2012-01-21 00:04:54Z davea $ \***********************************************************************/ // TODO: rewrite this using the new DB interface @@ -112,7 +112,13 @@ admin_page_head("Manage Application Versions"); -if($commands) echo $commands; // show the last DB commands given +if (strlen($commands)) { + echo "The following updates were done: $commands +

      + You must stop and restart the project + for these changes to take effect. +"; +} $self=$_SERVER['PHP_SELF']; echo "\n"; @@ -193,5 +199,5 @@ admin_page_tail(); //Generated automatically - do not edit -$cvs_version_tracker[]="\$Id: manage_app_versions.php 23923 2011-08-03 16:45:00Z davea $"; +$cvs_version_tracker[]="\$Id: manage_app_versions.php 25115 2012-01-21 00:04:54Z davea $"; ?> diff -Nru boinc-7.0.7+dfsg/html/ops/pass_percentage_by_platform.php boinc-7.0.14+dfsg/html/ops/pass_percentage_by_platform.php --- boinc-7.0.7+dfsg/html/ops/pass_percentage_by_platform.php 2011-06-20 17:17:56.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/pass_percentage_by_platform.php 2012-01-31 20:25:26.000000000 +0000 @@ -19,21 +19,18 @@ require_once("../inc/util_ops.inc"); db_init(); -admin_page_head("Pass percentage by platform"); +admin_page_head("Result summary per app version"); -/* - modified by Bernd Machenschalk 2007 - - 1. distinguish between Darwin x86 and Darwin PPC - 2. lists the "fail rates" for individual client states to allow for - distinguishing between download errors, computing errors and aborts - 3. optionally list individual "unknown" OS by name - 4. optionally list "unofficial" application versions - - 3. and 4. are probably rather confusing on open-source projects like SETI, - but I found them helpful e.g. on Einstein - -*/ +// modified by Bernd Machenschalk 2007 +// +// 1. distinguish between Darwin x86 and Darwin PPC +// 2. lists the "fail rates" for individual client states to allow for +// distinguishing between download errors, computing errors and aborts +// 3. optionally list individual "unknown" OS by name +// 4. optionally list "unofficial" application versions +// +// 3. and 4. are probably rather confusing on open-source projects like SETI, +// but I found them helpful e.g. on Einstein $query_appid = get_int('appid'); $query_nsecs = get_int('nsecs'); @@ -45,43 +42,30 @@ $allversions = ""; if ($query_all_platforms == "1") { - $unknown_platform = "host.os_name"; - $allplatforms = "checked"; + $unknown_platform = "host.os_name"; + $allplatforms = "checked"; } else { - $unknown_platform = "'unknown'"; + $unknown_platform = "'unknown'"; } if ($query_all_versions == "1") { - $limit_app_versions = ""; - $query_order = "platform"; - $allversions = "checked"; + $limit_app_versions = ""; + $query_order = "platform"; + $allversions = "checked"; } else { - // First lets get the most recent version numbers per platform - $valid_app_versions = ""; - - $app_version_query = " - SELECT DISTINCT - platformid, - MAX(version_num) AS app_version_num - FROM app_version - left join platform on app_version.platformid = platform.id - WHERE - app_version.deprecated <> 1 and - appid = '$query_appid' - GROUP BY - platformid - "; - - $result = mysql_query($app_version_query); - while ($res = mysql_fetch_object($result)) { - if (strlen($valid_app_versions) == 0) { - $valid_app_versions = "$res->app_version_num"; - } else { - $valid_app_versions = "$valid_app_versions, $res->app_version_num"; + // get the most recent version per (platform, plan class) + // + $app_versions = latest_avs_app($query_appid); + $valid_app_versions = ""; + + foreach ($app_versions as $av) { + if (strlen($valid_app_versions) == 0) { + $valid_app_versions = "$av->id"; + } else { + $valid_app_versions .= ", $av->id"; + } } - } - mysql_free_result($result); - $limit_app_versions = "app_version_num IN ( $valid_app_versions ) AND"; - $query_order = "version DESC"; + $limit_app_versions = "app_version_id IN ( $valid_app_versions ) AND"; + $query_order = "app_version_id DESC"; } // Now that we have a valid list of app_version_nums' @@ -89,7 +73,7 @@ $main_query = " SELECT - app_version_num AS version, + app_version_id, CASE when INSTR(host.os_name, 'Darwin') then (CASE WHEN INSTR(host.p_vendor, 'Power') THEN 'Darwin PPC' ELSE 'Darwin x86' END) @@ -117,7 +101,7 @@ $limit_app_versions received_time > '$query_received_time' GROUP BY - version DESC, + app_version_id DESC, platform ORDER BY $query_order @@ -125,24 +109,18 @@ $result = mysql_query($main_query); -//echo "\n"; -echo "
      \n"; -echo ""; -echo ""; -echo ""; -echo "\n"; +start_table(); +table_header( + "App version", "Total
      Results", "Pass Rate", "Fail Rate", + "Failed
      Downloading", "Failed
      Downloaded", "Failed
      Computing", + "Failed
      Uploading", "Failed
      Uploaded", "Aborted" +); while ($res = mysql_fetch_object($result)) { - - echo ""; - - - echo ""; - + $av = BoincAppVersion::lookup_id($res->app_version_id); + $p = BoincPlatform::lookup_id($av->platformid); echo ""; echo "\n"; return; } - $max_count = 0; + $max_count = 0; foreach ($models as $model=>$x) { - if ($x->count > $max_count) $max_count = $x->count; - $x->avg_time = $x->time/$x->count; - } - $min_time = 1e9; + if ($x->count > $max_count) $max_count = $x->count; + $x->avg_time = $x->time/$x->count; + } + $min_time = 1e9; foreach ($models as $model=>$x) { - if ($x->count < $max_count/10) continue; - if ($x->avg_time < $min_time) $min_time = $x->avg_time; - } + if ($x->count < $max_count/10) continue; + if ($x->avg_time < $min_time) $min_time = $x->avg_time; + } uasort($models, 'gpucmp'); echo "
        \n"; foreach ($models as $model=>$x) { - if ($x->count < $max_count/10) continue; - $s = number_format($min_time/$x->avg_time, 3); + if ($x->count < $max_count/10) continue; + $s = number_format($min_time/$x->avg_time, 3); echo "
      1. ($s) $model\n"; } echo "
      \n"; diff -Nru boinc-7.0.7+dfsg/html/user/gpu_ratios.php boinc-7.0.14+dfsg/html/user/gpu_ratios.php --- boinc-7.0.7+dfsg/html/user/gpu_ratios.php 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/gpu_ratios.php 2011-11-16 20:13:13.000000000 +0000 @@ -0,0 +1,67 @@ +. + +// generate XML showing the average PFC of GPU versions +// relative to CPU versions. +// This can be used to scale GPU credit +// for projects that have only GPU versions + +require_once("../inc/boinc_db.inc"); +require_once("../inc/xml.inc"); + +$cpu_scale_sum = 0; +$cpu_credit_sum = 0; +$ati_scale_sum = 0; +$ati_credit_sum = 0; +$nvidia_scale_sum = 0; +$nvidia_credit_sum = 0; +$total_credit_sum= 0; + +$apps = BoincApp::enum("deprecated=0"); +foreach ($apps as $app) { + $avs = BoincAppVersion::enum("appid=$app->id and deprecated=0"); + foreach ($avs as $av) { + if (strstr($av->plan_class, "ati")) { + $ati_scale_sum += $av->pfc_scale * $av->expavg_credit; + $ati_credit_sum += $av->expavg_credit; + } else if (strstr($av->plan_class, "nvidia") || strstr($av->plan_class, "cuda")) { + $nvidia_scale_sum += $av->pfc_scale * $av->expavg_credit; + $nvidia_credit_sum += $av->expavg_credit; + } else { + $cpu_scale_sum += $av->pfc_scale * $av->expavg_credit; + $cpu_credit_sum += $av->expavg_credit; + } + $total_credit_sum += $av->expavg_credit; + } +} + +xml_header(); +echo " + $total_credit_sum +"; +if ($cpu_credit_sum) { + echo " ", $cpu_scale_sum/$cpu_credit_sum, "\n"; +} +if ($ati_credit_sum) { + echo " ", $ati_scale_sum/$ati_credit_sum, "\n"; +} +if ($nvidia_credit_sum) { + echo " ", $nvidia_scale_sum/$nvidia_credit_sum, "\n"; +} +echo "\n"; +?> diff -Nru boinc-7.0.7+dfsg/html/user/host_app_versions.php boinc-7.0.14+dfsg/html/user/host_app_versions.php --- boinc-7.0.7+dfsg/html/user/host_app_versions.php 2011-08-25 22:12:48.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/host_app_versions.php 2012-01-24 04:44:08.000000000 +0000 @@ -53,7 +53,7 @@ function show_hav($hav) { row1(av_desc($hav->app_version_id)); - row2(tra("Number of tasks completed"), $hav->pfc_n); + row2(tra("Number of tasks completed"), $hav->et_n); row2(tra("Max tasks per day"), $hav->max_jobs_per_day); row2(tra("Number of tasks today"), $hav->n_jobs_today); row2(tra("Consecutive valid tasks"), $hav->consecutive_valid); diff -Nru boinc-7.0.7+dfsg/html/user/lammps.php boinc-7.0.14+dfsg/html/user/lammps.php --- boinc-7.0.7+dfsg/html/user/lammps.php 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/lammps.php 2012-01-18 09:04:35.000000000 +0000 @@ -0,0 +1,309 @@ + strlen($start_line) + && substr_compare($line, $start_line, 0, strlen($start_line)) == 0 + ) { + $start = 1; + continue; + } + if (!$start) continue; + $arr = preg_split("/\s+/", $line); + if (count($arr)!=6 || !is_numeric($arr[1])) { + continue; + } + $step = (int)$arr[1]; + $cpu = (float)$arr[2]; + if ($cpu==0) { + $start_step = $step; + } else { + $cur_step = $step; + if ($cur_step-$start_step>=5) { + $avg_cpu = $cpu/($cur_step-$start_step); + //echo "avg_cpu is ".$avg_cpu; + break; + } + } + } + return $avg_cpu; +} + +function area_select() { + return " + + "; +} + +function show_submit_form($user) { + page_head("Submit LAMMPS jobs"); + echo " + + + "; + start_table(); + row2("Structure file", sandbox_file_select($user, "structure_file")); + row2("Script file", sandbox_file_select($user, "command_file")); + row2("Command-line file
      List of command lines, one per job", sandbox_file_select($user, "cmdline_file")); + row2("Zipped potential files", sandbox_file_select($user, "pot_files")); + row2("Area", area_select()); + row2("", ""); + end_table(); + echo " +

      + File sandbox + "; + + page_tail(); +} + +// verify that an input file exists in sandbox, and return its physical path +// +function get_file_path($user, $name) { + $fname = get_str($name); + + // verify that the files exist in sandbox + // + $sbdir = sandbox_dir($user); + list($error, $size, $md5) = sandbox_parse_link_file("$sbdir/$fname"); + if ($error) error_page("no $name file"); + + return sandbox_physical_path($user, $md5); +} + +function project_flops() { + $x = BoincUser::sum("expavg_credit"); + if ($x == 0) $x = 200; + $y = 1e9*$x/200; + return $y; +} + +// Estimate how long a batch will take. +// Let N = # jobs, M = # hosts +// If N < M we can start all the jobs more or less now, +// so let T = F/H, where H is the median FLOPS of the hosts. +// If N > M we'll have to do the jobs in stages, +// so let T = ceil(N/M)*F/H. +// +// Note: these are both extremely optimistic estimates +// +function estimated_makespan($njobs, $flops_per_job) { + $nhosts = BoincHost::count("expavg_credit > 1"); + if ($nhosts < 10) { + $median_flops = 2e9; + } else { + $n = $nhosts/2; + $hs = BoincHost::enum("expavg_credit>1 order by p_fpops limit 1"); + $h = $hs[0]; + $median_flops = $h->p_fpops; + } + + if ($njobs < $nhosts) { + return $flops_per_job/$median_flops; + } else { + $k = (int)(($njobs+$nhosts-1)/$nhosts); + return $k*$flops_per_job/$median_flops; + } +} + +function prepare_batch($user) { + $structure_file_path = get_file_path($user, 'structure_file'); + $command_file_path = get_file_path($user, 'command_file'); + $cmdline_file_path = get_file_path($user, 'cmdline_file'); + $pot_files_path = get_file_path($user, 'pot_files'); + + $info = null; + $info->structure_file_path = $structure_file_path; + $info->command_file_path = $command_file_path; + $info->cmdline_file_path = $cmdline_file_path; + $info->pot_files_path = $pot_files_path; + $info->area = get_str("area"); + + // get the directory in which to run the test, + // clear it out, + // and set up links to the input files + // + $test_dir = "../../lammps_test/$user->id"; + //echo "test_dir is ".$test_dir; + if (!is_dir($test_dir)) { + mkdir($test_dir); + } + if (!chdir($test_dir)) { + error_page("Can't chdir"); + } + system("rm *"); + symlink($structure_file_path, "structure_file"); + symlink($command_file_path, "lammps_script"); + symlink($cmdline_file_path, "cmd_variables"); + symlink($pot_files_path, "pot_files"); + list($error, $est_cpu_time, $disk) = lammps_est(); + + if ($error==0) { + error_page("LAMMPS test failed"); + } + + + system("rm *"); + $info->rsc_fpops_est = $est_cpu_time * 5e9; + + $info->rsc_disk_bound = 1e8; + + $tmpfile = tempnam("/tmp", "lammps_"); + file_put_contents($tmpfile, serialize($info)); + + // get the # of jobs + // + $njobs = count(file($cmdline_file_path)); + $secs_est = estimated_makespan($njobs, $info->rsc_fpops_est); + $hrs_est = number_format($secs_est/3600, 1); + $client_mb = $info->rsc_disk_bound/1e6; + $server_mb = $njobs*$client_mb; + + page_head("Batch prepared"); + echo " + Your batch has $njobs jobs. +

      + Estimated time to completion: $hrs_est hours. +

      + Estimated client disk usage: $client_mb MB +

      + Estimated server disk usage: $server_mb MB +

      + "; + show_button("lammps.php?action=submit&tmpfile=$tmpfile", "Submit Batch"); + page_tail(); +} + +function submit_job($app, $batch_id, $info, $cmdline, $i) { + $cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $info->rsc_fpops_est"; + if ($cmdline) { + $cmd .= " --command_line \"$cmdline\""; + } + $cmd .= " --wu_name batch_".$batch_id."_".$i; + $cmd .= " ".basename($info->structure_file_path); + $cmd .= " ".basename($info->command_file_path); + $cmd .= " ".basename($info->pot_files_path); + echo "
      $cmd\n"; + + $ret = system($cmd); + if ($ret === FALSE) { + error_page("can't create job"); + } +} + +function submit_batch($user, $app) { + $tmpfile = get_str('tmpfile'); + $x = file_get_contents("$tmpfile"); + $info = unserialize($x); + + $cmdlines = file($info->cmdline_file_path); + $njobs = count($cmdlines); + + $now = time(); + $batch_name = $info->area; + + $batch_id = BoincBatch::insert( + "(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)" + ); +// $batch_id=99; + + $i = 0; + foreach ($cmdlines as $cmdline) { + submit_job($app, $batch_id, $info, $cmdline, $i); + $i++; + } +} + +$user = get_logged_in_user(); +$user_submit = BoincUserSubmit::lookup_userid($user->id); +if (!$user_submit) error_page("no submit access"); +$app = BoincApp::lookup("name='lammps'"); +if (!$app) error_page("no lammps app"); + +if (!$user_submit->submit_all) { + $usa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id"); + if (!$usa) { + error_page("no submit access"); + } +} + +$action = get_str('action', true); +switch ($action) { +case '': show_submit_form($user); break; +case 'prepare': prepare_batch($user); break; +case 'submit': submit_batch($user, $app); break; +default: error_page("no such action $action"); +} +?> diff -Nru boinc-7.0.7+dfsg/html/user/merge_by_name.php boinc-7.0.14+dfsg/html/user/merge_by_name.php --- boinc-7.0.7+dfsg/html/user/merge_by_name.php 2011-02-09 22:11:34.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/merge_by_name.php 2011-12-24 05:19:21.000000000 +0000 @@ -30,7 +30,7 @@ // find the newest one // $newest_host = $list[0]; - echo "

      Processing $newest_host->domain_name\n"; + echo "

      ".tra("Processing %1", $newest_host->domain_name)."\n"; foreach ($list as $host) { if ($host->create_time > $newest_host->create_time) { $newest_host = $host; @@ -42,7 +42,7 @@ } $error = merge_hosts($host, $newest_host); if (!$error) { - echo "
      Merged $host->id into $newest_host->id\n"; + echo "
      ".tra("Merged %1 into %2",$host->id,$newest_host->id)."\n"; } else { echo "
      $error\n"; } @@ -64,26 +64,25 @@ $user = get_logged_in_user(); -page_head("Merge computers by name"); +page_head(tra("Merge computers by name")); if ($confirmed) { check_tokens($user->authenticator); merge_by_name($user->id); echo "

      - Return to the list of your computers. + ".tra("Return to the list of your computers").". "; } else { $tokens = url_tokens($user->authenticator); - echo " - This operation merges computers based on their domain name. + echo tra("This operation merges computers based on their domain name.

      For each domain name, it will merge all older computers having that name with the newest computer having that name. Incompatible computers will not be merged. -

      - Go ahead and do this. -

      Return to the list of computers. +

      ")." + ".tra("Go ahead and do this").". +

      ".tra("Return to the list of computers").". "; } page_tail(); diff -Nru boinc-7.0.7+dfsg/html/user/moderation.php boinc-7.0.14+dfsg/html/user/moderation.php --- boinc-7.0.7+dfsg/html/user/moderation.php 2011-02-09 22:11:34.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/moderation.php 2011-12-24 15:37:20.000000000 +0000 @@ -23,11 +23,11 @@ check_get_args(array()); page_head("Moderation"); -echo " +echo tra(" To maximize discussion and flow of information, our message boards are moderated. Message board postings are subject to the following posting rules: -".post_rules()." +").post_rules().tra("

      Moderators may delete posts that violate any of these rules. The authors of deleted posts will be notified via email. @@ -58,10 +58,10 @@ and potentially incendiary. If you have a legitimate claim, send email to the address below.

      -This moderation policy is set by the ".PROJECT." project. -If you have comments about the policy, email ".SYS_ADMIN_EMAIL.". +This moderation policy is set by the %1 project. +If you have comments about the policy, email %2. -"; +",PROJECT,SYS_ADMIN_EMAIL); page_tail(); ?> diff -Nru boinc-7.0.7+dfsg/html/user/pending.php boinc-7.0.14+dfsg/html/user/pending.php --- boinc-7.0.7+dfsg/html/user/pending.php 2011-02-09 22:11:34.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/pending.php 2011-12-24 05:19:21.000000000 +0000 @@ -61,9 +61,9 @@ $user = get_logged_in_user(); $sum = 0; - page_head("Pending credit"); + page_head(tra("Pending credit")); start_table(); - echo "

      \n"; + echo "\n"; $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0"); foreach($results as $result) { echo "\n"; @@ -76,9 +76,9 @@ } end_table(); - echo "Pending credit: ".format_credit($sum); + echo tra("Pending credit: %1", format_credit($sum)); page_tail(); } -$cvs_version_tracker[]="\$Id: pending.php 23010 2011-02-09 22:11:34Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: pending.php 24885 2011-12-24 05:19:21Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/user/pm.php boinc-7.0.14+dfsg/html/user/pm.php --- boinc-7.0.7+dfsg/html/user/pm.php 2011-08-06 07:11:17.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/pm.php 2011-12-24 15:37:20.000000000 +0000 @@ -29,7 +29,7 @@ function show_block_link($userid) { echo " "; - show_image(REPORT_POST_IMAGE, "Block messages from this user", "Block user", REPORT_POST_IMAGE_HEIGHT); + show_image(REPORT_POST_IMAGE, tra("Block messages from this user"), tra("Block user"), REPORT_POST_IMAGE_HEIGHT); echo ""; } @@ -103,15 +103,15 @@ echo "
      ".time_str($msg->date)."\n"; echo "\n"; } echo " + + + + + "; } - echo "\n"; + end_table(); + echo "

      Return to job control page\n"; + page_tail(); } -function n_outfiles($wu) { - $path = "../../$wu->result_template_file"; - $r = simplexml_load_file($path); - return count($r->file_info); -} +// show the details of a job, including links to see the output files +// +function handle_query_job($user) { + $wuid = get_int('wuid'); -function query_batch($r) { - list($user, $user_submit) = authenticate_user($r, null); - $batch_id = (int)($r->batch_id); - $batch = BoincBatch::lookup_id($batch_id); - if (!$batch) { - error("no such batch"); - } - if ($batch->user_id != $user->id) { - error("not owner"); - } + page_head("Job $wuid"); - $wus = BoincWorkunit::enum("batch = $batch_id"); - $batch = get_batch_params($batch, $wus); - echo "\n"; - print_batch_params($batch); - $n_outfiles = n_outfiles($wus[0]); - foreach ($wus as $wu) { - echo " - $wu->id - $wu->canonical_resultid - $n_outfiles - -"; - } - echo "\n"; -} + echo "View workunit page\n"; -function query_job($r) { - list($user, $user_submit) = authenticate_user($r, null); - $job_id = (int)($r->job_id); - $wu = BoincWorkunit::lookup_id($job_id); - if (!$wu) error("no such job"); - $batch = BoincBatch::lookup_id($wu->batch); - if ($batch->user_id != $user->id) { - error("not owner"); - } - echo "\n"; - $results = BoincResult::enum("workunitid=$job_id"); - foreach ($results as $result) { - echo " - $result->name - $result->id - ".state_string($result)." -"; - if ($result->server_state == 5) { // over? - $paths = get_outfile_paths($result); - foreach($paths as $path) { - if (is_file($path)) { - $size = filesize($path); - echo " - $size - + // show input files + // + echo "

      Input files

      \n"; + $wu = BoincWorkunit::lookup_id($wuid); + $x = "".$wu->xml_doc.""; + $x = simplexml_load_string($x); + start_table(); + table_header("Logical name
      (click to view)", + "Size (bytes)", "MD5" + ); + $fanout = parse_config(get_config(), ""); + foreach ($x->workunit->file_ref as $fr) { + $pname = (string)$fr->file_name; + $lname = (string)$fr->open_name; + $dir = filename_hash($pname, $fanout); + $path = "../../download/$dir/$pname"; + $md5 = md5_file($path); + $s = stat($path); + $size = $s['size']; + table_row( + "$lname", + $size, + $md5 + ); + } + end_table(); + + echo "

      Instances

      \n"; + start_table(); + table_header( + "Instance ID
      click for result page", + "State", "Output files" + ); + $results = BoincResult::enum("workunitid=$wuid"); + foreach($results as $result) { + echo "
      + + + \n"; } - echo "\n"; + end_table(); + echo "

      Return to job control page\n"; + page_tail(); } -function handle_abort_batch($r) { - list($user, $user_submit) = authenticate_user($r, null); - $batch_id = (int)($r->batch_id); +function handle_abort_batch_confirm() { + $batch_id = get_int('batch_id'); + page_head("Confirm abort batch"); + echo " + Aborting a batch will cancel all unstarted jobs. + Are you sure you want to do this? +

      + "; + show_button( + "submit.php?action=abort_batch&batch_id=$batch_id", + "Yes - abort batch" + ); + echo "

      Return to job control page\n"; + page_tail(); +} + +function handle_abort_batch() { + $batch_id = get_int('batch_id'); $batch = BoincBatch::lookup_id($batch_id); + if (!$batch) error("no such batch"); if ($batch->user_id != $user->id) { error("not owner"); } abort_batch($batch); - echo "1"; + page_head("Batch aborted"); + echo "

      Return to job control page\n"; + page_tail(); +} + +function handle_retire_batch_confirm() { + $batch_id = get_int('batch_id'); + page_head("Confirm retire batch"); + echo " + Retiring a batch will remove all of its output files. + Are you sure you want to do this? +

      + "; + show_button( + "submit.php?action=retire_batch&batch_id=$batch_id", + "Yes - retire batch" + ); + echo "

      Return to job control page\n"; + page_tail(); } -function handle_retire_batch($r) { - list($user, $user_submit) = authenticate_user($r, null); - $batch_id = (int)($r->batch_id); +function handle_retire_batch() { + $batch_id = get_int('batch_id'); $batch = BoincBatch::lookup_id($batch_id); if ($batch->user_id != $user->id) { - error("not owner"); + error_page("not owner"); } retire_batch($batch); - echo "1"; -} - -if (0) { -$r = simplexml_load_string(" - - x - 54 - -"); -query_batch($r); -exit; -} - -if (0) { -$r = simplexml_load_string(" - - x - 312173 - -"); -query_job($r); -exit; -} - -if (0) { -$r = simplexml_load_string(" - - x - - remote_test - Aug 6 batch 2 - - 19000000000 - --t 19 - - http://google.com/ - - - - -"); -submit_batch($r); -exit; -} - -xml_header(); -$r = simplexml_load_string($_POST['request']); - -if (!$r) { - error("can't parse request message"); -} - -switch ($r->getName()) { - case 'estimate_batch': estimate_batch($r); break; - case 'submit_batch': submit_batch($r); break; - case 'query_batches': query_batches($r); break; - case 'query_batch': query_batch($r); break; - case 'query_job': query_job($r); break; - case 'abort_batch': handle_abort_batch($r); break; - case 'retire_batch': handle_retire_batch($r); break; - default: error("bad command"); + page_head("Batch retired"); + echo "

      Return to job control page\n"; + page_tail(); +} + +$user = get_logged_in_user(); + +$action = get_str('action', true); + +switch ($action) { +case '': handle_main($user); break; +case 'abort_batch': handle_abort_batch(); break; +case 'abort_batch_confirm': handle_abort_batch_confirm(); break; +case 'query_batch': handle_query_batch($user); break; +case 'query_job': handle_query_job($user); break; +case 'retire_batch': handle_retire_batch(); break; +case 'retire_batch_confirm': handle_retire_batch_confirm(); break; +default: + error_page('no such action'); } ?> diff -Nru boinc-7.0.7+dfsg/html/user/submit_rpc_handler.php boinc-7.0.14+dfsg/html/user/submit_rpc_handler.php --- boinc-7.0.7+dfsg/html/user/submit_rpc_handler.php 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/submit_rpc_handler.php 2011-12-31 08:57:53.000000000 +0000 @@ -0,0 +1,379 @@ +. + +// Handler for remote job submission. +// See http://boinc.berkeley.edu/trac/wiki/RemoteJobs + +require_once("../inc/boinc_db.inc"); +require_once("../inc/submit_db.inc"); +require_once("../inc/xml.inc"); +require_once("../inc/dir_hier.inc"); +require_once("../inc/result.inc"); +require_once("../inc/submit_util.inc"); + +error_reporting(E_ALL); +ini_set('display_errors', true); +ini_set('display_startup_errors', true); + +function error($s) { + echo "\n$s\n\n"; + exit; +} + +function authenticate_user($r, $app) { + $auth = (string)$r->authenticator; + if (!$auth) error("no authenticator"); + $user = BoincUser::lookup("authenticator='$auth'"); + if (!$user) error("bad authenticator"); + $user_submit = BoincUserSubmit::lookup_userid($user->id); + if (!$user_submit) error("no submit access"); + if ($app && !$user_submit->submit_all) { + $usa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id"); + if (!$usa) { + error("no submit access"); + } + } + return array($user, $user_submit); +} + +function get_app($r) { + $name = (string)($r->batch->app_name); + $app = BoincApp::lookup("name='$name'"); + if (!$app) error("no app"); + return $app; +} + +function batch_flop_count($r) { + $x = 0; + foreach($r->batch->job as $job) { + $x += (double)$job->rsc_fpops_est; + } + return $x; +} + +// estimate project FLOPS based on recent average credit +// +function project_flops() { + $x = BoincUser::sum("expavg_credit"); + if ($x == 0) $x = 200; + $y = 1e9*$x/200; + return $y; +} + +function est_elapsed_time($r) { + // crude estimate: batch FLOPs / project FLOPS + // + return batch_flop_count($r) / project_flops(); +} + +function estimate_batch($r) { + $app = get_app($r); + list($user, $user_submit) = authenticate_user($r, $app); + + $e = est_elapsed_time($r); + echo "\n$e\n\n"; +} + +function read_input_template($app) { + $path = "../../templates/$app->name"."_in"; + return simplexml_load_file($path); +} + +function validate_batch($jobs, $template) { + $i = 0; + $n = count($template->file_info); + foreach($jobs as $job) { + $m = count($job->input_files); + if ($n != $m) { + error("wrong # of input files for job $i: need $n, got $m"); + } + $i++; + } +} + +$fanout = parse_config(get_config(), ""); + +// stage a file, and return the physical name +// +function stage_file($file) { + global $fanout; + + $md5 = md5_file($file->source); + if (!$md5) { + error("Can't get MD5 of file $source"); + } + $name = "batch_$md5"; + $path = dir_hier_path($name, "../../download", $fanout); + if (file_exists($path)) return $name; + if (!copy($file->source, $path)) { + error("can't copy file from $file->source to $path"); + } + return $name; +} + +// stage all the files +// +function stage_files(&$jobs, $template) { + foreach($jobs as $job) { + foreach ($job->input_files as $file) { + $file->name = stage_file($file); + } + } +} + +function submit_job($job, $template, $app, $batch_id, $i) { + $cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $job->rsc_fpops_est"; + if ($job->command_line) { + $cmd .= " --command_line \"$job->command_line\""; + } + $cmd .= " --wu_name batch_".$batch_id."_".$i; + foreach ($job->input_files as $file) { + $cmd .= " $file->name"; + } + $ret = system($cmd); + if ($ret === FALSE) { + error("can't create job"); + } +} + +function xml_get_jobs($r) { + $jobs = array(); + foreach($r->batch->job as $j) { + $job = null; + $job->input_files = array(); + $job->command_line = (string)$j->command_line; + $job->rsc_fpops_est = (double)$j->rsc_fpops_est; + foreach ($j->input_file as $f) { + $file = null; + $file->source = (string)$f->source; + $job->input_files[] = $file; + } + $jobs[] = $job; + } + return $jobs; +} + +function submit_batch($r) { + $app = get_app($r); + list($user, $user_submit) = authenticate_user($r, $app); + $template = read_input_template($app); + $jobs = xml_get_jobs($r); + validate_batch($jobs, $template); + stage_files($jobs, $template); + $njobs = count($jobs); + $now = time(); + $batch_name = (string)($r->batch->batch_name); + $batch_id = BoincBatch::insert( + "(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)" + ); + $i = 0; + foreach($jobs as $job) { + submit_job($job, $template, $app, $batch_id, $i++); + } + $batch = BoincBatch::lookup_id($batch_id); + $batch->update("state=".BATCH_STATE_IN_PROGRESS); + echo "$batch_id\n"; +} + +function print_batch_params($batch) { + $app = BoincApp::lookup_id($batch->app_id); + if (!$app) $app->name = "none"; + echo " + $batch->id + $batch->create_time + $batch->est_completion_time + $batch->njobs + $batch->fraction_done + $batch->nerror_jobs + $batch->state + $batch->completion_time + $batch->credit_estimate + $batch->credit_canonical + $batch->name + $app->name +"; +} + +function query_batches($r) { + list($user, $user_submit) = authenticate_user($r, null); + $batches = BoincBatch::enum("user_id = $user->id"); + echo "\n"; + foreach ($batches as $batch) { + if ($batch->state < BATCH_STATE_COMPLETE) { + $wus = BoincWorkunit::enum("batch = $batch->id"); + $batch = get_batch_params($batch, $wus); + } + echo " \n"; + print_batch_params($batch); + echo " \n"; + } + echo "\n"; +} + +function n_outfiles($wu) { + $path = "../../$wu->result_template_file"; + $r = simplexml_load_file($path); + return count($r->file_info); +} + +function query_batch($r) { + list($user, $user_submit) = authenticate_user($r, null); + $batch_id = (int)($r->batch_id); + $batch = BoincBatch::lookup_id($batch_id); + if (!$batch) { + error("no such batch"); + } + if ($batch->user_id != $user->id) { + error("not owner"); + } + + $wus = BoincWorkunit::enum("batch = $batch_id"); + $batch = get_batch_params($batch, $wus); + echo "\n"; + print_batch_params($batch); + $n_outfiles = n_outfiles($wus[0]); + foreach ($wus as $wu) { + echo " + $wu->id + $wu->canonical_resultid + $n_outfiles + +"; + } + echo "\n"; +} + +function query_job($r) { + list($user, $user_submit) = authenticate_user($r, null); + $job_id = (int)($r->job_id); + $wu = BoincWorkunit::lookup_id($job_id); + if (!$wu) error("no such job"); + $batch = BoincBatch::lookup_id($wu->batch); + if ($batch->user_id != $user->id) { + error("not owner"); + } + echo "\n"; + $results = BoincResult::enum("workunitid=$job_id"); + foreach ($results as $result) { + echo " + $result->name + $result->id + ".state_string($result)." +"; + if ($result->server_state == 5) { // over? + $paths = get_outfile_paths($result); + foreach($paths as $path) { + if (is_file($path)) { + $size = filesize($path); + echo " + $size + +"; + } + } + } + echo "\n"; + } + echo "\n"; +} + +function handle_abort_batch($r) { + list($user, $user_submit) = authenticate_user($r, null); + $batch_id = (int)($r->batch_id); + $batch = BoincBatch::lookup_id($batch_id); + if (!$batch) error("no such batch"); + if ($batch->user_id != $user->id) { + error("not owner"); + } + abort_batch($batch); + echo "1"; +} + +function handle_retire_batch($r) { + list($user, $user_submit) = authenticate_user($r, null); + $batch_id = (int)($r->batch_id); + $batch = BoincBatch::lookup_id($batch_id); + if ($batch->user_id != $user->id) { + error("not owner"); + } + retire_batch($batch); + echo "1"; +} + +if (0) { +$r = simplexml_load_string(" + + x + 54 + +"); +query_batch($r); +exit; +} + +if (0) { +$r = simplexml_load_string(" + + x + 312173 + +"); +query_job($r); +exit; +} + +if (0) { +$r = simplexml_load_string(" + + x + + remote_test + Aug 6 batch 2 + + 19000000000 + --t 19 + + http://google.com/ + + + + +"); +submit_batch($r); +exit; +} + +xml_header(); +$r = simplexml_load_string($_POST['request']); + +if (!$r) { + error("can't parse request message"); +} + +switch ($r->getName()) { + case 'abort_batch': handle_abort_batch($r); break; + case 'estimate_batch': estimate_batch($r); break; + case 'query_batch': query_batch($r); break; + case 'query_batches': query_batches($r); break; + case 'query_job': query_job($r); break; + case 'retire_batch': handle_retire_batch($r); break; + case 'submit_batch': submit_batch($r); break; + default: error("bad command"); +} + +?> diff -Nru boinc-7.0.7+dfsg/html/user/user_search.php boinc-7.0.14+dfsg/html/user/user_search.php --- boinc-7.0.7+dfsg/html/user/user_search.php 2011-10-13 19:21:25.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/user_search.php 2012-02-01 03:30:14.000000000 +0000 @@ -20,46 +20,6 @@ require_once("../inc/util.inc"); require_once("../inc/user.inc"); -check_get_args(array("search_string", "search_type", "country", "profile", "team", "action")); - -// We have indices on id, name, total credit, and RAC. -// So we provide the following searches: -// - new users in last N days (1, 7) -// - users with names starting with X -// - users ordered by decreasing total credit -// - users ordered by decreasing RAC -// -// In addition you can filter by: -// - a given country -// - with/without profile -// - with/without team -// -// We don't do the filtering in the SQL, because that would -// lead to table scans in the worst case. -// Instead we use the following policies: -// - a given search can scan no more than MAX_ROWS rows -// - a given search can return no more than MAX_RESULTS results -// -// here's how we do this: -// result_list = empty -// while ndo_country && $user->country!=$filter->country) return false; - if ($filter->do_profile) { - if ($user->has_profile and !$filter->has_profile) return false; - if (!$user->has_profile and $filter->has_profile) return false; - } - if ($filter->do_team) { - if ($filter->team xor $user->teamid!=0) return false; - } - return true; -} - function show_user($user) { echo "

      @@ -82,44 +42,14 @@ "; } -function do_search($order, $filter) { - $filtered_list = array(); - $nrows_scanned = 0; - $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated"; - while (1) { - if (count($filtered_list) > 500) break; - $limit_clause = " limit $nrows_scanned, 1000"; - $users = BoincUser::enum_fields($fields, null, $order.$limit_clause); - $n = count($users); - $nrows_scanned += $n; - if ($nrows_scanned > 10000) break; - if ($n==0) break; - foreach($users as $user) { - if (filter_user($user, $filter)) { - $filtered_list[] = $user; - } - } - } - page_head(tra("User search results")); - start_table(); - table_header(tra("Name"), tra("Team"), tra("Average credit"), tra("Total credit"), tra("Country"), tra("Joined")); - foreach ($filtered_list as $user) { - show_user($user); - } - end_table(); - page_tail(); -} - function search_form() { page_head("User search"); - echo ""; + echo " + + "; start_table(); - row1(tra("Search type"), 2, "heading"); - row2(tra("User name starts with")." ", ""); - row2(tra("Decreasing sign-up time"), ""); - row2(tra("Decreasing average credit"), ""); - row2(tra("Decreasing total credit"), ""); row1(tra("Filters"), 2, "heading"); + row2(tra("User name starts with"), ""); row2_init(tra("Country"), ""; @@ -133,6 +63,10 @@ ".tra("No")." ".tra("Yes")." "); + row1(tra("Ordering"), 2, "heading"); + row2(tra("Decreasing sign-up time"), ""); + row2(tra("Decreasing average credit"), ""); + row2(tra("Decreasing total credit"), ""); row2("", ""); end_table(); echo " @@ -142,26 +76,69 @@ page_tail(); } -function name_search($filter) { - $count = 100; - $search_string = get_str('search_string'); +function compare_create_time($u1, $u2) { + if ($u1->create_time < $u2->create_time) return 1; + if ($u1->create_time > $u2->create_time) return -1; + return 0; +} +function compare_expavg_credit($u1, $u2) { + if ($u1->expavg_credit < $u2->expavg_credit) return 1; + if ($u1->expavg_credit > $u2->expavg_credit) return -1; + return 0; +} +function compare_total_credit($u1, $u2) { + if ($u1->total_credit < $u2->total_credit) return 1; + if ($u1->total_credit > $u2->total_credit) return -1; + return 0; +} - if (strlen($search_string)<3) { - error_page(tra("search string must be at least 3 characters")); +function search_action() { + $where = "true"; + $search_string = get_str('search_string'); + if (strlen($search_string)) { + if (strlen($search_string)<3) { + error_page(tra("search string must be at least 3 characters")); + } + $s = BoincDb::escape_string($search_string); + $s = escape_pattern($s); + $where .= " and name like '$s%'"; + } + $country = get_str('country'); + if ($country != 'any') { + $s = BoincDb::escape_string($country); + $where .= " and country='$s'"; + } + $t = get_str('team'); + if ($t == 'yes') { + $where .= " and teamid<>0"; + } else if ($t == 'no') { + $where .= " and teamid=0"; + } + $t = get_str('profile'); + if ($t == 'yes') { + $where .= " and has_profile<>0"; + } else if ($t == 'no') { + $where .= " and has_profile=0"; } - page_head(tra("User search results")); - $s = BoincDb::escape_string($search_string); - $s = escape_pattern($s); $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated"; - $users = BoincUser::enum_fields($fields, "name like '$s%'", "limit $count"); + $users = BoincUser::enum_fields($fields, $where, "limit 100"); + $search_type = get_str('search_type', true); + if ($search_type == 'date') { + usort($users, 'compare_create_time'); + } else if ($search_type == 'rac') { + usort($users, 'compare_expavg_credit'); + } else { + usort($users, 'compare_total_credit'); + } + page_head(tra("User search results")); $n=0; foreach ($users as $user) { - if (!filter_user($user, $filter)) continue; if ($n==0) { - echo "

      ".tra("User names starting with")." '".htmlspecialchars($search_string)."'

      \n"; start_table(); - table_header(tra("Name"), tra("Team"), tra("Average credit"), tra("Total credit"), tra("Country"), tra("Joined")); - + table_header( + tra("Name"), tra("Team"), tra("Average credit"), + tra("Total credit"), tra("Country"), tra("Joined") + ); } show_user($user); $n++; @@ -173,71 +150,12 @@ page_tail(); } -function main() { - $search_type = get_str('search_type', true); - if ($search_type) { - switch ($search_type) { - case 'date': - $order = 'order by id desc'; - break; - case 'rac': - $order = 'order by expavg_credit desc'; - break; - case 'total': - $order = 'order by total_credit desc'; - break; - case 'name_prefix': - break; - default: - error_page("missing search type"); - } - - $filter = null; - $filter->do_country = false; - $filter->do_profile = false; - $filter->do_team = false; - $country = get_str('country'); - if ($country != 'any') { - $filter->do_country = true; - $filter->country = $country; - } - switch (get_str('profile')) { - case 'yes': - $filter->do_profile = true; - $filter->has_profile = true; - break; - case 'no': - $filter->do_profile = true; - $filter->has_profile = false; - break; - case 'either': - $filter->do_profile = false; - break; - } - switch (get_str('team')) { - case 'yes': - $filter->do_team = true; - $filter->team = true; - break; - case 'no': - $filter->do_team = true; - $filter->team = false; - break; - case 'either': - $filter->do_team = false; - break; - } - if ($search_type == 'name_prefix') { - name_search($filter); - } else { - do_search($order, $filter); - } - } else { - search_form(); - } +$action = get_str('action', true); +if ($action) { + search_action(); +} else { + search_form(); } -main(); - $cvs_version_tracker[]="\$Id: user_search.php 13586 2007-09-13 09:46:36Z Rytis $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/user/userw.php boinc-7.0.14+dfsg/html/user/userw.php --- boinc-7.0.7+dfsg/html/user/userw.php 2011-03-13 20:05:25.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/userw.php 2012-01-18 20:59:24.000000000 +0000 @@ -30,35 +30,29 @@ function show_user_wap($userid) { wap_begin(); - $cache = unserialize(get_cached_data(USER_PAGE_TTL, "userid=".$userid)); - if (!$cache) { - $cache = new stdClass; - $cache->user = BoincUser::lookup_id($userid); - if ($cache->user->teamid) { - $cache->team = BoincTeam::lookup_id($cache->user->teamid); - } - $cache->wap_timestamp = wap_timestamp(); - set_cached_data(USER_PAGE_TTL, serialize($cache), "userid=".$userid); - } - - if (!$cache->user) { + $user = BoincUser::lookup_id($userid); + if (!$user) { echo "
      ".tra("User not found!")."
      "; wap_end(); return; } + + if ($user->teamid) { + $team = BoincTeam::lookup_id($user->teamid); + } - // keep a 'running tab' in wapstr in case exceeds 1K WAP limit - $wapstr = PROJECT."
      ".tra("Account Data
      for %1
      Time:", $cache->user->name)." ".$cache->wap_timestamp; - $wapstr .= show_credit_wap($cache->user); - if ($cache->user->teamid) { - $wapstr .= "
      ".tra("Team:")." ".$cache->team->name."
      "; - $wapstr .= tra("Team TotCred:")." " . format_credit($cache->team->total_credit) . "
      "; - $wapstr .= tra("Team AvgCred:")." " . format_credit($cache->team->expavg_credit) . "
      "; + $wapstr = PROJECT."
      ".tra("Account Data
      for %1
      Time:", $user->name)." ".wap_timestamp(); + $wapstr .= show_credit_wap($user); + if ($user->teamid && $team) { + $wapstr .= "
      ".tra("Team:")." ".$team->name."
      "; + $wapstr .= tra("Team TotCred:")." " . format_credit($team->total_credit) . "
      "; + $wapstr .= tra("Team AvgCred:")." " . format_credit($team->expavg_credit) . "
      "; } else { $wapstr .= "
      ".tra("Team: None")."
      "; } - // don't want to send more than 1KB probably? + // don't want to send more than 1KB (WAP limit) + // if (strlen($wapstr) > 1024) { $wapstr = substr($wapstr, 0, 1024); } diff -Nru boinc-7.0.7+dfsg/html/user/weak_auth.php boinc-7.0.14+dfsg/html/user/weak_auth.php --- boinc-7.0.7+dfsg/html/user/weak_auth.php 2011-02-09 22:11:34.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/weak_auth.php 2011-12-24 05:19:21.000000000 +0000 @@ -60,8 +60,8 @@ "
      ",
           htmlspecialchars(
       "
      -    PROJECT_URL
      -    WEAK_ACCOUNT_KEY
      +    ".URL_BASE."
      +    ".$weak_auth."
       "),
           "
      ", "

      ", diff -Nru boinc-7.0.7+dfsg/lib/app_ipc.cpp boinc-7.0.14+dfsg/lib/app_ipc.cpp --- boinc-7.0.7+dfsg/lib/app_ipc.cpp 2011-12-14 16:41:22.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/app_ipc.cpp 2012-01-20 13:30:47.000000000 +0000 @@ -118,6 +118,7 @@ fraction_done_start = a.fraction_done_start; fraction_done_end = a.fraction_done_end; gpu_device_num = a.gpu_device_num; + gpu_opencl_dev_index = a.gpu_opencl_dev_index; ncpus = a.ncpus; checkpoint_period = a.checkpoint_period; wu_cpu_time = a.wu_cpu_time; @@ -204,6 +205,7 @@ "%f\n" "%s\n" "%d\n" + "%d\n" "%f\n" "%f\n" "%f\n" @@ -224,6 +226,7 @@ ai.fraction_done_end, ai.gpu_type, ai.gpu_device_num, + ai.gpu_opencl_dev_index, ai.ncpus, ai.rsc_fpops_est, ai.rsc_fpops_bound, @@ -280,6 +283,8 @@ checkpoint_period = 0; strcpy(gpu_type, ""); gpu_device_num = 0; + // -1 means an older version without gpu_opencl_dev_index field + gpu_opencl_dev_index = -1; ncpus = 0; memset(&shmem_seg_name, 0, sizeof(shmem_seg_name)); wu_cpu_time = 0; @@ -378,6 +383,7 @@ if (xp.parse_double("checkpoint_period", ai.checkpoint_period)) continue; if (xp.parse_str("gpu_type", ai.gpu_type, sizeof(ai.gpu_type))) continue; if (xp.parse_int("gpu_device_num", ai.gpu_device_num)) continue; + if (xp.parse_int("gpu_opencl_dev_index", ai.gpu_opencl_dev_index)) continue; if (xp.parse_double("ncpus", ai.ncpus)) continue; if (xp.parse_double("fraction_done_start", ai.fraction_done_start)) continue; if (xp.parse_double("fraction_done_end", ai.fraction_done_end)) continue; @@ -397,13 +403,8 @@ return true; } -bool MSG_CHANNEL::has_msg() { - if (buf[0]) return true; - return false; -} - bool MSG_CHANNEL::send_msg(const char *msg) { - if (buf[0]) return false; + if (has_msg()) return false; strlcpy(buf+1, msg, MSG_CHANNEL_SIZE-1); buf[0] = 1; return true; diff -Nru boinc-7.0.7+dfsg/lib/app_ipc.h boinc-7.0.14+dfsg/lib/app_ipc.h --- boinc-7.0.7+dfsg/lib/app_ipc.h 2011-12-14 16:41:22.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/app_ipc.h 2012-01-20 13:30:47.000000000 +0000 @@ -53,7 +53,9 @@ struct MSG_CHANNEL { char buf[MSG_CHANNEL_SIZE]; bool get_msg(char*); // returns a message and clears pending flag - bool has_msg(); + inline bool has_msg() { + return buf[0]?true:false; + } bool send_msg(const char*); // if there is not a message in the segment, // writes specified message and sets pending flag void send_msg_overwrite(const char*); @@ -193,6 +195,7 @@ // char gpu_type[64]; int gpu_device_num; + int gpu_opencl_dev_index; // info for multicore apps: how many cores to use // diff -Nru boinc-7.0.7+dfsg/lib/cc_config.cpp boinc-7.0.14+dfsg/lib/cc_config.cpp --- boinc-7.0.7+dfsg/lib/cc_config.cpp 2011-11-14 23:31:12.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/cc_config.cpp 2012-01-02 05:53:42.000000000 +0000 @@ -70,6 +70,7 @@ if (xp.parse_bool("cpu_sched_debug", cpu_sched_debug)) continue; if (xp.parse_bool("cpu_sched_status", cpu_sched_status)) continue; if (xp.parse_bool("dcf_debug", dcf_debug)) continue; + if (xp.parse_bool("disk_usage_debug", disk_usage_debug)) continue; if (xp.parse_bool("priority_debug", priority_debug)) continue; if (xp.parse_bool("std_debug", std_debug)) continue; if (xp.parse_bool("file_xfer_debug", file_xfer_debug)) continue; @@ -114,6 +115,7 @@ " %d\n" " %d\n" " %d\n" + " %d\n" " %d\n" " %d\n" " %d\n" @@ -151,6 +153,7 @@ cpu_sched_debug ? 1 : 0, cpu_sched_status ? 1 : 0, dcf_debug ? 1 : 0, + disk_usage_debug ? 1 : 0, priority_debug ? 1 : 0, file_xfer_debug ? 1 : 0, gui_rpc_debug ? 1 : 0, diff -Nru boinc-7.0.7+dfsg/lib/cc_config.h boinc-7.0.14+dfsg/lib/cc_config.h --- boinc-7.0.7+dfsg/lib/cc_config.h 2011-11-14 23:31:12.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/cc_config.h 2012-01-02 05:53:42.000000000 +0000 @@ -67,6 +67,8 @@ // show what's running bool dcf_debug; // show changes to duration correction factors + bool disk_usage_debug; + // disk usage and project share info bool priority_debug; // info related to REC and scheduling priority bool file_xfer_debug; diff -Nru boinc-7.0.7+dfsg/lib/common_defs.h boinc-7.0.14+dfsg/lib/common_defs.h --- boinc-7.0.7+dfsg/lib/common_defs.h 2011-10-11 17:41:10.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/common_defs.h 2012-01-30 22:39:13.000000000 +0000 @@ -179,7 +179,6 @@ #define CLIENT_AUTH_FILENAME "client_auth.xml" #define LOCK_FILE_NAME "lockfile" #define GRAPHICS_APP_FILENAME "graphics_app" -#define ASSIGNED_WU_STR "asgn" #define GUI_RPC_PASSWD_FILE "gui_rpc_auth.cfg" #define SS_CONFIG_FILE "ss_config.xml" diff -Nru boinc-7.0.7+dfsg/lib/coproc.cpp boinc-7.0.14+dfsg/lib/coproc.cpp --- boinc-7.0.7+dfsg/lib/coproc.cpp 2011-12-14 16:56:55.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/coproc.cpp 2012-01-23 21:59:12.000000000 +0000 @@ -259,13 +259,12 @@ void OPENCL_DEVICE_PROP::description(char* buf, const char* type) { char s1[256], s2[256]; int n; - // openCL_device_version may have a trailing space strlcpy(s1, opencl_device_version, sizeof(s1)); n = (int)strlen(s1) - 1; if ((n > 0) && (s1[n] == ' ')) s1[n] = '\0'; - sprintf(s2, "%s (driver version %s, device version %s, %.0fMB)", - name, opencl_driver_version, s1, global_mem_size/MEGA + sprintf(s2, "%s (driver version %s, device version %s, %.0fMB, %.0fMB available)", + name, opencl_driver_version, s1, global_mem_size/MEGA, opencl_available_ram/MEGA ); switch(is_used) { @@ -302,18 +301,16 @@ } int COPROCS::parse(XML_PARSER& xp) { - char buf[1024]; int retval; clear(); n_rsc = 1; strcpy(coprocs[0].type, "CPU"); - MIOFILE& in = *(xp.f); - while (in.fgets(buf, sizeof(buf))) { - if (match_tag(buf, "")) { + while (!xp.get_tag()) { + if (xp.match_tag("/coprocs")) { return 0; } - if (match_tag(buf, "")) { + if (xp.match_tag("coproc_cuda")) { retval = nvidia.parse(xp); if (retval) { nvidia.clear(); @@ -322,7 +319,7 @@ } continue; } - if (match_tag(buf, "")) { + if (xp.match_tag("coproc_ati")) { retval = ati.parse(xp); if (retval) { ati.clear(); @@ -669,6 +666,7 @@ amdrt_detected = false; memset(&attribs, 0, sizeof(attribs)); memset(&info, 0, sizeof(info)); + version_num = 0; } int COPROC_ATI::parse(XML_PARSER& xp) { @@ -678,9 +676,13 @@ while (!xp.get_tag()) { if (xp.match_tag("/coproc_ati")) { - int major, minor, release; - sscanf(version, "%d.%d.%d", &major, &minor, &release); - version_num = ati_version_int(major, minor, release); + if (strlen(version)) { + int major, minor, release; + n = sscanf(version, "%d.%d.%d", &major, &minor, &release); + if (n ==3) { + version_num = ati_version_int(major, minor, release); + } + } if (!peak_flops) { set_peak_flops(); diff -Nru boinc-7.0.7+dfsg/lib/coproc.h boinc-7.0.14+dfsg/lib/coproc.h --- boinc-7.0.7+dfsg/lib/coproc.h 2011-12-14 16:56:55.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/coproc.h 2012-01-30 10:09:44.000000000 +0000 @@ -76,6 +76,8 @@ #include "cal_boinc.h" #include "cl_boinc.h" +#define DEFER_ON_GPU_AVAIL_RAM 0 + #define MAX_COPROC_INSTANCES 64 #define MAX_RSC 8 // max # of processing resources types @@ -131,6 +133,8 @@ int device_num; // temp used in scan process double peak_flops; // temp used in scan process COPROC_USAGE is_used; // temp used in scan process + double opencl_available_ram; // temp used in scan process + int opencl_device_index; // temp used in scan process #ifndef _USING_FCGI_ void write_xml(MIOFILE&); @@ -181,10 +185,14 @@ int device_num; // temp used in scan process cl_device_id opencl_device_ids[MAX_COPROC_INSTANCES]; int opencl_device_count; + int opencl_device_indexes[MAX_COPROC_INSTANCES]; + bool running_graphics_app[MAX_COPROC_INSTANCES]; // is this GPU running a graphics app (NVIDIA only) - double available_ram_temp[MAX_COPROC_INSTANCES]; +#if DEFER_ON_GPU_AVAIL_RAM + double available_ram_temp[MAX_COPROC_INSTANCES]; // used during job scheduling +#endif double last_print_time; diff -Nru boinc-7.0.7+dfsg/lib/crypt.cpp boinc-7.0.14+dfsg/lib/crypt.cpp --- boinc-7.0.7+dfsg/lib/crypt.cpp 2011-08-27 16:52:04.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/crypt.cpp 2012-01-26 23:13:00.000000000 +0000 @@ -331,17 +331,21 @@ } int verify_file( - const char* path, R_RSA_PUBLIC_KEY& key, DATA_BLOCK& signature, bool& answer + const char* path, const char* md5, R_RSA_PUBLIC_KEY& key, DATA_BLOCK& signature, bool& answer ) { char md5_buf[MD5_LEN], clear_buf[MD5_LEN]; double file_length; int n, retval; DATA_BLOCK clear_signature; - retval = md5_file(path, md5_buf, file_length); - if (retval) { - fprintf(stderr, "error: verify_file: md5_file error %d\n", retval); - return retval; + if (md5) { + strcpy(md5_buf, md5); + } else { + retval = md5_file(path, md5_buf, file_length); + if (retval) { + fprintf(stderr, "error: verify_file: md5_file error %d\n", retval); + return retval; + } } n = (int)strlen(md5_buf); clear_signature.data = (unsigned char*)clear_buf; @@ -356,7 +360,7 @@ } int verify_file2( - const char* path, const char* signature_text, const char* key_text, bool& answer + const char* path, const char* md5, const char* signature_text, const char* key_text, bool& answer ) { R_RSA_PUBLIC_KEY key; unsigned char signature_buf[SIGNATURE_SIZE_BINARY]; @@ -372,7 +376,7 @@ signature.len = sizeof(signature_buf); retval = sscan_hex_data(signature_text, signature); if (retval) return retval; - return verify_file(path, key, signature, answer); + return verify_file(path, md5, key, signature, answer); } // verify, where both text and signature are char strings diff -Nru boinc-7.0.7+dfsg/lib/crypt.h boinc-7.0.14+dfsg/lib/crypt.h --- boinc-7.0.7+dfsg/lib/crypt.h 2011-08-11 17:41:48.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/crypt.h 2012-01-26 23:13:00.000000000 +0000 @@ -101,10 +101,10 @@ DATA_BLOCK& data, R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature ); extern int verify_file( - const char* path, R_RSA_PUBLIC_KEY&, DATA_BLOCK& signature, bool& + const char* path, const char* md5, R_RSA_PUBLIC_KEY&, DATA_BLOCK& signature, bool& ); extern int verify_file2( - const char* path, const char* signature, const char* key, bool& + const char* path, const char* md5, const char* signature, const char* key, bool& ); extern int verify_string( const char* text, const char* signature, R_RSA_PUBLIC_KEY&, bool& diff -Nru boinc-7.0.7+dfsg/lib/crypt_prog.cpp boinc-7.0.14+dfsg/lib/crypt_prog.cpp --- boinc-7.0.7+dfsg/lib/crypt_prog.cpp 2010-10-05 23:06:20.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/crypt_prog.cpp 2012-01-26 23:13:00.000000000 +0000 @@ -190,7 +190,7 @@ signature.len = 256; retval = scan_hex_data(f, signature); if (retval) die("scan_hex_data"); - retval = verify_file(argv[2], public_key, signature, is_valid); + retval = verify_file(argv[2], NULL, public_key, signature, is_valid); if (retval) die("verify_file"); if (is_valid) { printf("file is valid\n"); @@ -393,4 +393,4 @@ return 0; } -const char *BOINC_RCSID_6633b596b9 = "$Id: crypt_prog.cpp 22448 2010-10-05 23:06:20Z davea $"; +const char *BOINC_RCSID_6633b596b9 = "$Id: crypt_prog.cpp 25157 2012-01-26 23:13:00Z davea $"; diff -Nru boinc-7.0.7+dfsg/lib/gui_rpc_client.h boinc-7.0.14+dfsg/lib/gui_rpc_client.h --- boinc-7.0.7+dfsg/lib/gui_rpc_client.h 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/gui_rpc_client.h 2012-01-26 08:39:51.000000000 +0000 @@ -209,7 +209,7 @@ ~APP_VERSION(); int parse(XML_PARSER&); - int parse_coproc(MIOFILE&); + int parse_coproc(XML_PARSER&); void print(); void clear(); }; @@ -277,6 +277,7 @@ bool edf_scheduled; char graphics_exec_path[512]; char web_graphics_url[256]; + char remote_desktop_addr[256]; char slot_path[512]; // only present if graphics_exec_path is char resources[256]; @@ -299,7 +300,7 @@ std::string name; std::string project_url; std::string project_name; - double nbytes; + double nbytes; // total # of bytes to be transferred bool uploaded; bool is_upload; bool generated_locally; // deprecated; for compatibility w/ old clients @@ -307,8 +308,8 @@ bool pers_xfer_active; bool xfer_active; int num_retries; - int first_request_time; - int next_request_time; + double first_request_time; + double next_request_time; int status; double time_so_far; double bytes_xferred; diff -Nru boinc-7.0.7+dfsg/lib/gui_rpc_client_ops.cpp boinc-7.0.14+dfsg/lib/gui_rpc_client_ops.cpp --- boinc-7.0.7+dfsg/lib/gui_rpc_client_ops.cpp 2011-12-27 01:36:47.000000000 +0000 +++ boinc-7.0.14+dfsg/lib/gui_rpc_client_ops.cpp 2012-01-23 05:03:52.000000000 +0000 @@ -100,14 +100,13 @@ } int GUI_URL::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (match_tag(buf, "")) break; - if (parse_str(buf, "", name)) continue; - if (parse_str(buf, "", description)) continue; - if (parse_str(buf, "", url)) continue; + while (!xp.get_tag()) { + if (!xp.is_tag) continue; + if (xp.match_tag("/gui_url")) return 0; + if (xp.match_tag("/gui_urls")) break; + if (xp.parse_string("name", name)) continue; + if (xp.parse_string("description", description)) continue; + if (xp.parse_string("url", url)) continue; } return ERR_XML_PARSE; } @@ -246,57 +245,55 @@ } int PROJECT::parse(XML_PARSER& xp) { - char buf[256]; int retval; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", master_url, sizeof(master_url))) continue; - if (parse_double(buf, "", resource_share)) continue; - if (parse_str(buf, "", project_name)) continue; - if (parse_str(buf, "", user_name)) { + while (!xp.get_tag()) { + if (xp.match_tag("/project")) return 0; + if (xp.parse_str("master_url", master_url, sizeof(master_url))) continue; + if (xp.parse_double("resource_share", resource_share)) continue; + if (xp.parse_string("project_name", project_name)) continue; + if (xp.parse_string("user_name", user_name)) { xml_unescape(user_name); continue; } - if (parse_str(buf, "", team_name)) { + if (xp.parse_string("team_name", team_name)) { xml_unescape(team_name); continue; } - if (parse_int(buf, "", hostid)) continue; - if (parse_double(buf, "", user_total_credit)) continue; - if (parse_double(buf, "", user_expavg_credit)) continue; - if (parse_double(buf, "", host_total_credit)) continue; - if (parse_double(buf, "", host_expavg_credit)) continue; - if (parse_double(buf, "", disk_usage)) continue; - if (parse_int(buf, "", nrpc_failures)) continue; - if (parse_int(buf, "", master_fetch_failures)) continue; - if (parse_double(buf, "", min_rpc_time)) continue; - if (parse_double(buf, "", download_backoff)) continue; - if (parse_double(buf, "", upload_backoff)) continue; - if (parse_double(buf, "", sched_priority)) continue; - if (parse_double(buf, "", cpu_backoff_time)) continue; - if (parse_double(buf, "", cpu_backoff_interval)) continue; - if (parse_double(buf, "", cuda_backoff_time)) continue; - if (parse_double(buf, "", cuda_backoff_interval)) continue; - if (parse_double(buf, "", ati_backoff_time)) continue; - if (parse_double(buf, "", ati_backoff_interval)) continue; - if (parse_double(buf, "", duration_correction_factor)) continue; - if (parse_bool(buf, "anonymous_platform", anonymous_platform)) continue; - if (parse_bool(buf, "master_url_fetch_pending", master_url_fetch_pending)) continue; - if (parse_int(buf, "", sched_rpc_pending)) continue; - if (parse_bool(buf, "non_cpu_intensive", non_cpu_intensive)) continue; - if (parse_bool(buf, "suspended_via_gui", suspended_via_gui)) continue; - if (parse_bool(buf, "dont_request_more_work", dont_request_more_work)) continue; - if (parse_bool(buf, "ended", ended)) continue; - if (parse_bool(buf, "scheduler_rpc_in_progress", scheduler_rpc_in_progress)) continue; - if (parse_bool(buf, "attached_via_acct_mgr", attached_via_acct_mgr)) continue; - if (parse_bool(buf, "detach_when_done", detach_when_done)) continue; - if (parse_bool(buf, "trickle_up_pending", trickle_up_pending)) continue; - if (match_tag(buf, "")) { - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) break; - if (match_tag(buf, "")) { + if (xp.parse_int("hostid", hostid)) continue; + if (xp.parse_double("user_total_credit", user_total_credit)) continue; + if (xp.parse_double("user_expavg_credit", user_expavg_credit)) continue; + if (xp.parse_double("host_total_credit", host_total_credit)) continue; + if (xp.parse_double("host_expavg_credit", host_expavg_credit)) continue; + if (xp.parse_double("disk_usage", disk_usage)) continue; + if (xp.parse_int("nrpc_failures", nrpc_failures)) continue; + if (xp.parse_int("master_fetch_failures", master_fetch_failures)) continue; + if (xp.parse_double("min_rpc_time", min_rpc_time)) continue; + if (xp.parse_double("download_backoff", download_backoff)) continue; + if (xp.parse_double("upload_backoff", upload_backoff)) continue; + if (xp.parse_double("sched_priority", sched_priority)) continue; + if (xp.parse_double("cpu_backoff_time", cpu_backoff_time)) continue; + if (xp.parse_double("cpu_backoff_interval", cpu_backoff_interval)) continue; + if (xp.parse_double("cuda_backoff_time", cuda_backoff_time)) continue; + if (xp.parse_double("cuda_backoff_interval", cuda_backoff_interval)) continue; + if (xp.parse_double("ati_backoff_time", ati_backoff_time)) continue; + if (xp.parse_double("ati_backoff_interval", ati_backoff_interval)) continue; + if (xp.parse_double("duration_correction_factor", duration_correction_factor)) continue; + if (xp.parse_bool("anonymous_platform", anonymous_platform)) continue; + if (xp.parse_bool("master_url_fetch_pending", master_url_fetch_pending)) continue; + if (xp.parse_int("sched_rpc_pending", sched_rpc_pending)) continue; + if (xp.parse_bool("non_cpu_intensive", non_cpu_intensive)) continue; + if (xp.parse_bool("suspended_via_gui", suspended_via_gui)) continue; + if (xp.parse_bool("dont_request_more_work", dont_request_more_work)) continue; + if (xp.parse_bool("ended", ended)) continue; + if (xp.parse_bool("scheduler_rpc_in_progress", scheduler_rpc_in_progress)) continue; + if (xp.parse_bool("attached_via_acct_mgr", attached_via_acct_mgr)) continue; + if (xp.parse_bool("detach_when_done", detach_when_done)) continue; + if (xp.parse_bool("trickle_up_pending", trickle_up_pending)) continue; + if (xp.match_tag("gui_urls")) { + while (!xp.get_tag()) { + if (xp.match_tag("/gui_urls")) break; + if (xp.match_tag("gui_url")) { GUI_URL gu; retval = gu.parse(xp); if (retval) break; @@ -306,12 +303,12 @@ } continue; } - if (parse_double(buf, "", project_files_downloaded_time)) continue; - if (parse_double(buf, "", last_rpc_time)) continue; - if (parse_bool(buf, "no_cpu_pref", no_cpu_pref)) continue; - if (parse_bool(buf, "no_cuda_pref", no_cuda_pref)) continue; - if (parse_bool(buf, "no_ati_pref", no_ati_pref)) continue; - if (parse_str(buf, "venue", venue, sizeof(venue))) continue; + if (xp.parse_double("project_files_downloaded_time", project_files_downloaded_time)) continue; + if (xp.parse_double("last_rpc_time", last_rpc_time)) continue; + if (xp.parse_bool("no_cpu_pref", no_cpu_pref)) continue; + if (xp.parse_bool("no_cuda_pref", no_cuda_pref)) continue; + if (xp.parse_bool("no_ati_pref", no_ati_pref)) continue; + if (xp.parse_str("venue", venue, sizeof(venue))) continue; } return ERR_XML_PARSE; } @@ -369,12 +366,10 @@ } int APP::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", name, sizeof(name))) continue; - if (parse_str(buf, "", user_friendly_name, sizeof(user_friendly_name))) continue; + while (!xp.get_tag()) { + if (xp.match_tag("/app")) return 0; + if (xp.parse_str("name", name, sizeof(name))) continue; + if (xp.parse_str("user_friendly_name", user_friendly_name, sizeof(user_friendly_name))) continue; } return ERR_XML_PARSE; } @@ -393,12 +388,12 @@ clear(); } -int APP_VERSION::parse_coproc(MIOFILE& in) { - char buf[256], type_buf[256]; +int APP_VERSION::parse_coproc(XML_PARSER& xp) { + char type_buf[256]; double count = 0; - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) { + while (!xp.get_tag()) { + if (xp.match_tag("/coproc")) { if (!strcmp(type_buf, "CUDA")) { ncudas = count; } else if (!strcmp(type_buf, GPU_TYPE_ATI)) { @@ -406,26 +401,24 @@ } return 0; } - if (parse_str(buf, "", type_buf, sizeof(type_buf))) continue; - if (parse_double(buf, "", count)) continue; + if (xp.parse_str("type", type_buf, sizeof(type_buf))) continue; + if (xp.parse_double("count", count)) continue; } return ERR_XML_PARSE; } int APP_VERSION::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", app_name, sizeof(app_name))) continue; - if (parse_int(buf, "", version_num)) continue; - if (parse_str(buf, "", plan_class, sizeof(plan_class))) continue; - if (parse_str(buf, "", platform, sizeof(platform))) continue; - if (parse_double(buf, "", avg_ncpus)) continue; - if (parse_double(buf, "", gpu_ram)) continue; - if (parse_double(buf, "", flops)) continue; - if (match_tag(buf, "")) { - parse_coproc(in); + while (!xp.get_tag()) { + if (xp.match_tag("/app_version")) return 0; + if (xp.parse_str("app_name", app_name, sizeof(app_name))) continue; + if (xp.parse_int("version_num", version_num)) continue; + if (xp.parse_str("plan_class", plan_class, sizeof(plan_class))) continue; + if (xp.parse_str("platform", platform, sizeof(platform))) continue; + if (xp.parse_double("avg_ncpus", avg_ncpus)) continue; + if (xp.parse_double("gpu_ram", gpu_ram)) continue; + if (xp.parse_double("flops", flops)) continue; + if (xp.match_tag("coproc")) { + parse_coproc(xp); continue; } } @@ -445,17 +438,15 @@ } int WORKUNIT::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", name, sizeof(name))) continue; - if (parse_str(buf, "", app_name, sizeof(app_name))) continue; - if (parse_int(buf, "", version_num)) continue; - if (parse_double(buf, "", rsc_fpops_est)) continue; - if (parse_double(buf, "", rsc_fpops_bound)) continue; - if (parse_double(buf, "", rsc_memory_bound)) continue; - if (parse_double(buf, "", rsc_disk_bound)) continue; + while (!xp.get_tag()) { + if (xp.match_tag("/workunit")) return 0; + if (xp.parse_str("name", name, sizeof(name))) continue; + if (xp.parse_str("app_name", app_name, sizeof(app_name))) continue; + if (xp.parse_int("version_num", version_num)) continue; + if (xp.parse_double("rsc_fpops_est", rsc_fpops_est)) continue; + if (xp.parse_double("rsc_fpops_bound", rsc_fpops_bound)) continue; + if (xp.parse_double("rsc_memory_bound", rsc_memory_bound)) continue; + if (xp.parse_double("rsc_disk_bound", rsc_disk_bound)) continue; } return ERR_XML_PARSE; } @@ -481,10 +472,8 @@ } int RESULT::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) { + while (!xp.get_tag()) { + if (xp.match_tag("/result")) { // if CPU time is nonzero but elapsed time is zero, // we must be talking to an old client. // Set elapsed = CPU @@ -498,54 +487,57 @@ } return 0; } - if (parse_str(buf, "", name, sizeof(name))) continue; - if (parse_str(buf, "", wu_name, sizeof(wu_name))) continue; - if (parse_int(buf, "", version_num)) continue; - if (parse_str(buf, "", plan_class, sizeof(plan_class))) continue; - if (parse_str(buf, "", project_url, sizeof(project_url))) continue; - if (parse_double(buf, "", report_deadline)) continue; - if (parse_double(buf, "", received_time)) continue; - if (parse_bool(buf, "ready_to_report", ready_to_report)) continue; - if (parse_bool(buf, "got_server_ack", got_server_ack)) continue; - if (parse_bool(buf, "suspended_via_gui", suspended_via_gui)) continue; - if (parse_bool(buf, "project_suspended_via_gui", project_suspended_via_gui)) continue; - if (parse_bool(buf, "coproc_missing", coproc_missing)) continue; - if (parse_bool(buf, "scheduler_wait", scheduler_wait)) continue; - if (parse_bool(buf, "network_wait", network_wait)) continue; - if (match_tag(buf, "")) { + if (xp.parse_str("name", name, sizeof(name))) continue; + if (xp.parse_str("wu_name", wu_name, sizeof(wu_name))) continue; + if (xp.parse_int("version_num", version_num)) continue; + if (xp.parse_str("plan_class", plan_class, sizeof(plan_class))) continue; + if (xp.parse_str("project_url", project_url, sizeof(project_url))) continue; + if (xp.parse_double("report_deadline", report_deadline)) continue; + if (xp.parse_double("received_time", received_time)) continue; + if (xp.parse_bool("ready_to_report", ready_to_report)) continue; + if (xp.parse_bool("got_server_ack", got_server_ack)) continue; + if (xp.parse_bool("suspended_via_gui", suspended_via_gui)) continue; + if (xp.parse_bool("project_suspended_via_gui", project_suspended_via_gui)) continue; + if (xp.parse_bool("coproc_missing", coproc_missing)) continue; + if (xp.parse_bool("scheduler_wait", scheduler_wait)) continue; + if (xp.parse_bool("network_wait", network_wait)) continue; + if (xp.match_tag("active_task")) { active_task = true; continue; } - if (parse_double(buf, "", final_cpu_time)) continue; - if (parse_double(buf, "", final_elapsed_time)) continue; - if (parse_int(buf, "", state)) continue; - if (parse_int(buf, "", scheduler_state)) continue; - if (parse_int(buf, "", exit_status)) continue; - if (parse_int(buf, "", signal)) continue; - if (parse_int(buf, "", active_task_state)) continue; + if (xp.parse_double("final_cpu_time", final_cpu_time)) continue; + if (xp.parse_double("final_elapsed_time", final_elapsed_time)) continue; + if (xp.parse_int("state", state)) continue; + if (xp.parse_int("scheduler_state", scheduler_state)) continue; + if (xp.parse_int("exit_status", exit_status)) continue; + if (xp.parse_int("signal", signal)) continue; + if (xp.parse_int("active_task_state", active_task_state)) continue; #if 0 - if (match_tag(buf, "")) { - copy_element_contents(in, "", stderr_out); + if (xp.match_tag("stderr_out")) { + char buf[65536]; + xp.element_contents(("", buf); + stderr_out = buf; continue; } #endif - if (parse_int(buf, "", app_version_num)) continue; - if (parse_int(buf, "", slot)) continue; - if (parse_int(buf, "", pid)) continue; - if (parse_double(buf, "", checkpoint_cpu_time)) continue; - if (parse_double(buf, "", current_cpu_time)) continue; - if (parse_double(buf, "", elapsed_time)) continue; - if (parse_double(buf, "", swap_size)) continue; - if (parse_double(buf, "", working_set_size_smoothed)) continue; - if (parse_double(buf, "", fraction_done)) continue; - if (parse_double(buf, "", estimated_cpu_time_remaining)) continue; - if (parse_bool(buf, "too_large", too_large)) continue; - if (parse_bool(buf, "needs_shmem", needs_shmem)) continue; - if (parse_bool(buf, "edf_scheduled", edf_scheduled)) continue; - if (parse_str(buf, "", graphics_exec_path, sizeof(graphics_exec_path))) continue; - if (parse_str(buf, "", web_graphics_url, sizeof(web_graphics_url))) continue; - if (parse_str(buf, "", slot_path, sizeof(slot_path))) continue; - if (parse_str(buf, "", resources, sizeof(resources))) continue; + if (xp.parse_int("app_version_num", app_version_num)) continue; + if (xp.parse_int("slot", slot)) continue; + if (xp.parse_int("pid", pid)) continue; + if (xp.parse_double("checkpoint_cpu_time", checkpoint_cpu_time)) continue; + if (xp.parse_double("current_cpu_time", current_cpu_time)) continue; + if (xp.parse_double("elapsed_time", elapsed_time)) continue; + if (xp.parse_double("swap_size", swap_size)) continue; + if (xp.parse_double("working_set_size_smoothed", working_set_size_smoothed)) continue; + if (xp.parse_double("fraction_done", fraction_done)) continue; + if (xp.parse_double("estimated_cpu_time_remaining", estimated_cpu_time_remaining)) continue; + if (xp.parse_bool("too_large", too_large)) continue; + if (xp.parse_bool("needs_shmem", needs_shmem)) continue; + if (xp.parse_bool("edf_scheduled", edf_scheduled)) continue; + if (xp.parse_str("graphics_exec_path", graphics_exec_path, sizeof(graphics_exec_path))) continue; + if (xp.parse_str("web_graphics_url", web_graphics_url, sizeof(web_graphics_url))) continue; + if (xp.parse_str("remote_desktop_addr", remote_desktop_addr, sizeof(remote_desktop_addr))) continue; + if (xp.parse_str("slot_path", slot_path, sizeof(slot_path))) continue; + if (xp.parse_str("resources", resources, sizeof(resources))) continue; } return ERR_XML_PARSE; } @@ -558,6 +550,7 @@ strcpy(project_url, ""); strcpy(graphics_exec_path, ""); strcpy(web_graphics_url, ""); + strcpy(remote_desktop_addr, ""); strcpy(slot_path, ""); strcpy(resources, ""); report_deadline = 0; @@ -608,40 +601,38 @@ } int FILE_TRANSFER::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", name)) continue; - if (parse_str(buf, "", project_url)) continue; - if (parse_str(buf, "", project_name)) continue; - if (parse_double(buf, "", nbytes)) continue; - if (parse_bool(buf, "sticky", sticky)) continue; - if (match_tag(buf, "")) { + while (!xp.get_tag()) { + if (xp.match_tag("/file_transfer")) return 0; + if (xp.parse_string("name", name)) continue; + if (xp.parse_string("project_url", project_url)) continue; + if (xp.parse_string("project_name", project_name)) continue; + if (xp.parse_double("nbytes", nbytes)) continue; + if (xp.parse_bool("sticky", sticky)) continue; + if (xp.match_tag("persistent_file_xfer")) { pers_xfer_active = true; continue; } - if (match_tag(buf, "")) { + if (xp.match_tag("file_xfer")) { xfer_active = true; continue; } - if (parse_bool(buf, "is_upload", is_upload)) { + if (xp.parse_bool("is_upload", is_upload)) { generated_locally = is_upload; continue; } - if (parse_bool(buf, "generated_locally", generated_locally)) { + if (xp.parse_bool("generated_locally", generated_locally)) { is_upload = generated_locally; } - if (parse_int(buf, "", num_retries)) continue; - if (parse_int(buf, "", first_request_time)) continue; - if (parse_int(buf, "", next_request_time)) continue; - if (parse_int(buf, "", status)) continue; - if (parse_double(buf, "", time_so_far)) continue; - if (parse_double(buf, "", bytes_xferred)) continue; - if (parse_double(buf, "", file_offset)) continue; - if (parse_double(buf, "", xfer_speed)) continue; - if (parse_str(buf, "", hostname)) continue; - if (parse_double(buf, "", project_backoff)) continue; + if (xp.parse_int("num_retries", num_retries)) continue; + if (xp.parse_double("first_request_time", first_request_time)) continue; + if (xp.parse_double("next_request_time", next_request_time)) continue; + if (xp.parse_int("status", status)) continue; + if (xp.parse_double("time_so_far", time_so_far)) continue; + if (xp.parse_double("last_bytes_xferred", bytes_xferred)) continue; + if (xp.parse_double("file_offset", file_offset)) continue; + if (xp.parse_double("xfer_speed", xfer_speed)) continue; + if (xp.parse_string("hostname", hostname)) continue; + if (xp.parse_double("project_backoff", project_backoff)) continue; } return ERR_XML_PARSE; } @@ -676,18 +667,18 @@ } int MESSAGE::parse(XML_PARSER& xp) { - char buf[256]; - MIOFILE& in = *(xp.f); - while (in.fgets(buf, 256)) { - if (match_tag(buf, "")) return 0; - if (parse_str(buf, "", project)) continue; - if (match_tag(buf, "" )) { - copy_element_contents(in, "", body); + char buf[1024]; + while (!xp.get_tag()) { + if (xp.match_tag("/msg")) return 0; + if (xp.parse_string("project", project)) continue; + if (xp.match_tag("body")) { + xp.element_contents("", buf, sizeof(buf)); + body = buf; continue; } - if (parse_int(buf, "", priority)) continue; - if (parse_int(buf, "

        \n" +"
      • Posts must be 'kid friendly': they may not contain\n" +" content that is obscene, hate-related,\n" +" sexually explicit or suggestive.\n" +"
      • No commercial advertisements.\n" +"
      • No links to web sites involving sexual content,\n" +" gambling, or intolerance of others.\n" +"
      • No messages intended to annoy or antagonize other people,\n" +" or to hijack a thread.\n" +"
      • No messages that are deliberately hostile or insulting.\n" +"
      • No abusive comments involving race, religion,\n" +" nationality, gender, class or sexuality.\n" +" " +msgstr "" + +#: ../inc/forum.inc:734 +msgid "Rules:" +msgstr "" + +#: ../inc/forum.inc:735 +msgid "More info" +msgstr "" + +#: ../inc/forum.inc:1008 ../user/forum_thread.php:185 +msgid "Unhide" +msgstr "" + +#: ../inc/forum.inc:1008 +msgid "Unhide this post" +msgstr "" + +#: ../inc/forum.inc:1010 ../user/forum_thread.php:191 +msgid "Hide" +msgstr "" + +#: ../inc/forum.inc:1010 +msgid "Hide this post" +msgstr "" + +#: ../inc/forum.inc:1015 ../user/forum_thread.php:224 +msgid "Move" +msgstr "" + +#: ../inc/forum.inc:1015 +msgid "Move post to a different thread" +msgstr "" + +#: ../inc/forum.inc:1020 +msgid "Banish author" +msgstr "" + +#: ../inc/forum.inc:1027 +msgid "Vote to banish author" +msgstr "" + +#: ../inc/forum.inc:1031 +msgid "Vote not to banish author" +msgstr "" + +#: ../inc/forum.inc:1036 +msgid "Start vote to banish author" +msgstr "" + +#: ../inc/forum.inc:1069 +msgid "Only team members can post to the team message board" +msgstr "" + +#: ../inc/forum.inc:1079 msgid "" "In order to create a new thread in %1 you must have a certain amount of " "credit. This is to prevent and protect against abuse of the system." msgstr "" -#: ../inc/forum.inc:1084 +#: ../inc/forum.inc:1086 msgid "" "You cannot create any more threads right now. Please wait a while before " "trying again. This delay has been enforced to protect against abuse of the " "system." msgstr "" -#: ../inc/forum.inc:1124 +#: ../inc/forum.inc:1093 +msgid "" +"This thread is locked. Only forum moderators and administrators are allowed " +"to post there." +msgstr "" + +#: ../inc/forum.inc:1098 +msgid "Can't post to a hidden thread." +msgstr "" + +#: ../inc/forum.inc:1126 msgid "Thread" msgstr "" -#: ../inc/forum.inc:1125 ../inc/team.inc:120 ../user/forum_forum.php:137 +#: ../inc/forum.inc:1127 ../inc/team.inc:120 ../user/forum_forum.php:135 #: ../user/forum_index.php:94 msgid "Posts" msgstr "" -#: ../inc/forum.inc:1126 ../user/forum_forum.php:138 +#: ../inc/forum.inc:1128 ../user/forum_forum.php:136 #: ../user/forum_reply.php:115 ../user/forum_report_post.php:75 -#: ../user/forum_thread.php:265 +#: ../user/forum_thread.php:263 msgid "Author" msgstr "" -#: ../inc/forum.inc:1127 ../user/forum_forum.php:139 +#: ../inc/forum.inc:1129 ../user/forum_forum.php:137 msgid "Views" msgstr "" -#: ../inc/forum.inc:1128 ../inc/team.inc:120 ../user/forum_forum.php:140 +#: ../inc/forum.inc:1130 ../inc/team.inc:120 ../user/forum_forum.php:138 #: ../user/forum_help_desk.php:46 ../user/forum_index.php:95 msgid "Last post" msgstr "" -#: ../inc/forum.inc:1201 +#: ../inc/forum.inc:1188 +msgid "New posts in the thread %1" +msgstr "" + +#: ../inc/forum.inc:1193 +msgid "New posts in subscribed thread" +msgstr "" + +#: ../inc/forum.inc:1194 +msgid "There are new posts in the thread '%1'" +msgstr "" + +#: ../inc/forum.inc:1204 msgid "Mark all threads as read" msgstr "" -#: ../inc/forum.inc:1201 -msgid "Mark all threads in all message boards as 'read'." +#: ../inc/forum.inc:1205 +msgid "Mark all threads in all message boards as read." msgstr "" #: ../inc/host.inc:24 @@ -181,41 +533,41 @@ msgid "UTC %1 hours" msgstr "" -#: ../inc/host.inc:98 ../inc/host.inc:612 ../inc/result.inc:419 +#: ../inc/host.inc:98 ../inc/host.inc:645 ../inc/result.inc:591 #: ../inc/team.inc:202 ../inc/team.inc:350 ../inc/user.inc:200 -#: ../user/account_finish.php:41 ../user/create_account_form.php:87 +#: ../user/account_finish.php:41 ../user/create_account_form.php:89 #: ../user/team_admins.php:62 ../user/team_change_founder_form.php:77 #: ../user/team_email_list.php:64 ../user/top_users.php:49 -#: ../user/user_search.php:104 ../user/user_search.php:160 +#: ../user/user_search.php:105 ../user/user_search.php:163 msgid "Name" msgstr "" -#: ../inc/host.inc:102 ../inc/host.inc:104 ../inc/host.inc:213 +#: ../inc/host.inc:102 ../inc/host.inc:104 ../inc/host.inc:216 msgid "Owner" msgstr "" -#: ../inc/host.inc:104 ../inc/host.inc:318 +#: ../inc/host.inc:104 ../inc/host.inc:333 msgid "Anonymous" msgstr "" -#: ../inc/host.inc:108 ../inc/result.inc:421 +#: ../inc/host.inc:108 ../inc/result.inc:593 msgid "Created" msgstr "" -#: ../inc/host.inc:109 ../inc/host.inc:217 ../inc/host.inc:222 -#: ../inc/host.inc:621 ../inc/team.inc:94 ../inc/team.inc:207 +#: ../inc/host.inc:109 ../inc/host.inc:220 ../inc/host.inc:225 +#: ../inc/host.inc:654 ../inc/team.inc:94 ../inc/team.inc:207 #: ../inc/team.inc:212 ../inc/team.inc:214 ../inc/team.inc:356 #: ../inc/team.inc:361 ../inc/user.inc:122 ../inc/user.inc:136 #: ../user/profile_search_action.php:43 #: ../user/team_change_founder_form.php:78 ../user/team_email_list.php:64 #: ../user/team_remove_inactive_form.php:41 ../user/top_users.php:54 -#: ../user/top_users.php:59 ../user/user_search.php:104 -#: ../user/user_search.php:160 +#: ../user/top_users.php:59 ../user/user_search.php:105 +#: ../user/user_search.php:163 msgid "Total credit" msgstr "" #: ../inc/host.inc:110 ../inc/user.inc:122 ../user/team_search.php:70 -#: ../user/user_search.php:104 ../user/user_search.php:160 +#: ../user/user_search.php:105 ../user/user_search.php:163 msgid "Average credit" msgstr "" @@ -235,11 +587,11 @@ msgid "Coprocessors" msgstr "" -#: ../inc/host.inc:119 ../inc/host.inc:627 +#: ../inc/host.inc:119 ../inc/host.inc:660 msgid "Operating System" msgstr "" -#: ../inc/host.inc:122 ../inc/host.inc:226 +#: ../inc/host.inc:122 ../inc/host.inc:229 msgid "BOINC version" msgstr "" @@ -295,9 +647,10 @@ msgid "%1 KB/sec" msgstr "" -#: ../inc/host.inc:153 ../inc/host.inc:160 ../inc/result.inc:192 -#: ../inc/result.inc:202 ../inc/result.inc:220 ../inc/result.inc:252 -#: ../user/explain_state.php:56 ../user/host_app_versions.php:29 +#: ../inc/host.inc:153 ../inc/host.inc:160 ../inc/result.inc:195 +#: ../inc/result.inc:205 ../inc/result.inc:223 ../inc/result.inc:241 +#: ../inc/result.inc:257 ../user/explain_state.php:56 +#: ../user/host_app_versions.php:29 msgid "Unknown" msgstr "" @@ -322,12 +675,12 @@ msgid "Show" msgstr "" -#: ../inc/host.inc:175 ../inc/host.inc:302 ../inc/user.inc:153 +#: ../inc/host.inc:175 ../inc/host.inc:317 ../inc/user.inc:153 msgid "Tasks" msgstr "" -#: ../inc/host.inc:179 -msgid "Number of times BOINC has contacted server" +#: ../inc/host.inc:179 ../inc/host.inc:200 +msgid "Number of times client has contacted server" msgstr "" #: ../inc/host.inc:180 @@ -357,7 +710,7 @@ msgid "Task duration correction factor" msgstr "" -#: ../inc/host.inc:192 ../inc/host.inc:614 +#: ../inc/host.inc:192 ../inc/host.inc:647 msgid "Location" msgstr "" @@ -373,20 +726,24 @@ msgid "Merge" msgstr "" -#: ../inc/host.inc:211 +#: ../inc/host.inc:201 ../inc/host.inc:662 +msgid "Last contact" +msgstr "" + +#: ../inc/host.inc:214 msgid "Computer info" msgstr "" -#: ../inc/host.inc:212 ../inc/host.inc:616 ../inc/team.inc:349 +#: ../inc/host.inc:215 ../inc/host.inc:649 ../inc/team.inc:349 #: ../user/top_users.php:48 msgid "Rank" msgstr "" -#: ../inc/host.inc:216 ../inc/host.inc:619 +#: ../inc/host.inc:219 ../inc/host.inc:652 msgid "Avg. credit" msgstr "" -#: ../inc/host.inc:221 ../inc/team.inc:95 ../inc/team.inc:208 +#: ../inc/host.inc:224 ../inc/team.inc:95 ../inc/team.inc:208 #: ../inc/team.inc:217 ../inc/team.inc:219 ../inc/team.inc:355 #: ../inc/team.inc:360 ../inc/user.inc:137 #: ../user/team_change_founder_form.php:79 ../user/team_email_list.php:64 @@ -395,96 +752,92 @@ msgid "Recent average credit" msgstr "" -#: ../inc/host.inc:227 ../inc/host.inc:624 ../inc/result.inc:45 +#: ../inc/host.inc:230 ../inc/host.inc:657 ../inc/result.inc:47 #: ../user/host_app_versions.php:25 msgid "CPU" msgstr "" -#: ../inc/host.inc:228 ../inc/host.inc:625 +#: ../inc/host.inc:231 ../inc/host.inc:658 msgid "GPU" msgstr "" -#: ../inc/host.inc:229 +#: ../inc/host.inc:232 msgid "Operating system" msgstr "" -#: ../inc/host.inc:281 +#: ../inc/host.inc:296 msgid "(%1 processors)" msgstr "" -#: ../inc/host.inc:301 +#: ../inc/host.inc:316 msgid "Details" msgstr "" -#: ../inc/host.inc:306 +#: ../inc/host.inc:321 msgid "Cross-project stats:" msgstr "" -#: ../inc/host.inc:460 +#: ../inc/host.inc:493 msgid "Host %1 has overlapping lifetime:" msgstr "" -#: ../inc/host.inc:467 +#: ../inc/host.inc:500 msgid "Host %1 has an incompatible OS:" msgstr "" -#: ../inc/host.inc:473 +#: ../inc/host.inc:506 msgid "Host %1 has an incompatible CPU:" msgstr "" -#: ../inc/host.inc:540 +#: ../inc/host.inc:573 msgid "same host" msgstr "" -#: ../inc/host.inc:543 +#: ../inc/host.inc:576 msgid "Can't merge host %1 into %2 - they're incompatible" msgstr "" -#: ../inc/host.inc:546 +#: ../inc/host.inc:579 msgid "Merging host %1 into host %2" msgstr "" -#: ../inc/host.inc:563 +#: ../inc/host.inc:596 msgid "Couldn't update credit of new computer" msgstr "" -#: ../inc/host.inc:567 +#: ../inc/host.inc:600 msgid "Couldn't update results" msgstr "" -#: ../inc/host.inc:572 +#: ../inc/host.inc:605 msgid "Couldn't retire old computer" msgstr "" -#: ../inc/host.inc:574 +#: ../inc/host.inc:607 msgid "Retired old computer %1" msgstr "" -#: ../inc/host.inc:597 ../inc/host.inc:600 +#: ../inc/host.inc:630 ../inc/host.inc:633 msgid "Show:" msgstr "" -#: ../inc/host.inc:597 ../inc/host.inc:600 +#: ../inc/host.inc:630 ../inc/host.inc:633 msgid "All computers" msgstr "" -#: ../inc/host.inc:597 ../inc/host.inc:600 +#: ../inc/host.inc:630 ../inc/host.inc:633 msgid "Only computers active in past 30 days" msgstr "" -#: ../inc/host.inc:609 ../inc/result.inc:428 +#: ../inc/host.inc:642 ../inc/result.inc:600 msgid "Computer ID" msgstr "" -#: ../inc/host.inc:622 +#: ../inc/host.inc:655 msgid "BOINC
        version" msgstr "" -#: ../inc/host.inc:629 -msgid "Last contact" -msgstr "" - -#: ../inc/host.inc:678 +#: ../inc/host.inc:711 ../user/merge_by_name.php:67 msgid "Merge computers by name" msgstr "" @@ -505,7 +858,7 @@ msgid "Write" msgstr "" -#: ../inc/pm.inc:33 ../inc/user.inc:374 +#: ../inc/pm.inc:33 ../inc/user.inc:373 msgid "Send private message" msgstr "" @@ -519,6 +872,10 @@ msgid "Preview" msgstr "" +#: ../inc/pm.inc:48 ../user/pm.php:131 +msgid "no such message" +msgstr "" + #: ../inc/pm.inc:82 msgid "To" msgstr "" @@ -533,7 +890,7 @@ #: ../inc/pm.inc:86 ../user/forum_edit.php:128 ../user/forum_edit.php:133 #: ../user/forum_post.php:116 ../user/forum_reply.php:115 -#: ../user/forum_report_post.php:75 ../user/forum_thread.php:265 +#: ../user/forum_report_post.php:75 ../user/forum_thread.php:263 #: ../user/pm.php:90 ../user/pm.php:144 msgid "Message" msgstr "" @@ -560,7 +917,7 @@ "time before sending more messages." msgstr "" -#: ../inc/pm.inc:176 ../user/forum_forum.php:186 +#: ../inc/pm.inc:176 ../user/forum_forum.php:184 msgid "unread" msgstr "" @@ -693,7 +1050,7 @@ msgstr "" #: ../inc/prefs.inc:223 ../inc/prefs.inc:228 ../inc/prefs.inc:270 -#: ../inc/util.inc:236 +#: ../inc/util.inc:244 msgid "days" msgstr "" @@ -818,21 +1175,17 @@ msgid "bad subset: %1" msgstr "" -#: ../inc/prefs.inc:625 -msgid "Default" -msgstr "" - #: ../inc/prefs.inc:657 ../inc/prefs.inc:660 ../inc/prefs.inc:1003 -#: ../inc/prefs_util.inc:93 ../project.sample/project_specific_prefs.inc:74 +#: ../inc/prefs_util.inc:93 ../project.sample/project_specific_prefs.inc:75 msgid "yes" msgstr "" #: ../inc/prefs.inc:657 ../inc/prefs.inc:660 ../inc/prefs.inc:1005 -#: ../inc/prefs_util.inc:93 ../project.sample/project_specific_prefs.inc:76 +#: ../inc/prefs_util.inc:93 ../project.sample/project_specific_prefs.inc:77 msgid "no" msgstr "" -#: ../inc/prefs.inc:665 +#: ../inc/prefs.inc:665 ../user/forum_search.php:53 msgid "no limit" msgstr "" @@ -840,10 +1193,6 @@ msgid "Add" msgstr "" -#: ../inc/prefs.inc:691 ../inc/prefs.inc:693 -msgid "Edit" -msgstr "" - #: ../inc/prefs.inc:692 ../inc/prefs.inc:818 #: ../user/edit_forum_preferences_form.php:161 ../user/team_admins.php:34 msgid "Remove" @@ -881,9 +1230,9 @@ msgid "Primary (default) preferences" msgstr "" -#: ../inc/prefs.inc:854 ../user/add_venue.php:43 ../user/add_venue.php:68 -#: ../user/prefs_edit.php:40 ../user/prefs_edit.php:65 -#: ../user/prefs_edit.php:93 +#: ../inc/prefs.inc:854 ../user/add_venue.php:43 ../user/add_venue.php:67 +#: ../user/prefs_edit.php:40 ../user/prefs_edit.php:64 +#: ../user/prefs_edit.php:92 msgid "Edit %1 preferences" msgstr "" @@ -972,336 +1321,332 @@ msgid "I %1do not like%2 this profile" msgstr "" -#: ../inc/result.inc:32 +#: ../inc/result.inc:34 msgid "Anonymous platform" msgstr "" -#: ../inc/result.inc:46 +#: ../inc/result.inc:48 msgid "NVIDIA GPU" msgstr "" -#: ../inc/result.inc:47 ../user/host_app_versions.php:27 +#: ../inc/result.inc:49 ../user/host_app_versions.php:27 msgid "ATI GPU" msgstr "" -#: ../inc/result.inc:54 +#: ../inc/result.inc:56 msgid "Not in DB" msgstr "" -#: ../inc/result.inc:80 +#: ../inc/result.inc:82 msgid "pending" msgstr "" -#: ../inc/result.inc:102 ../user/forum_search.php:59 +#: ../inc/result.inc:104 ../user/forum_search.php:60 msgid "All" msgstr "" -#: ../inc/result.inc:103 ../inc/result.inc:160 ../inc/result.inc:199 +#: ../inc/result.inc:105 ../inc/result.inc:162 ../inc/result.inc:202 msgid "In progress" msgstr "" -#: ../inc/result.inc:104 ../user/workunit.php:67 +#: ../inc/result.inc:106 ../user/workunit.php:67 msgid "Pending" msgstr "" -#: ../inc/result.inc:105 ../inc/result.inc:242 +#: ../inc/result.inc:107 ../inc/result.inc:247 msgid "Valid" msgstr "" -#: ../inc/result.inc:106 ../inc/result.inc:245 +#: ../inc/result.inc:108 ../inc/result.inc:250 msgid "Invalid" msgstr "" -#: ../inc/result.inc:107 ../inc/result.inc:185 +#: ../inc/result.inc:109 ../inc/result.inc:188 msgid "Error" msgstr "" -#: ../inc/result.inc:158 ../inc/result.inc:197 ../user/explain_state.php:34 +#: ../inc/result.inc:160 ../inc/result.inc:200 ../user/explain_state.php:34 msgid "Inactive" msgstr "" -#: ../inc/result.inc:159 ../inc/result.inc:198 ../user/explain_state.php:37 +#: ../inc/result.inc:161 ../inc/result.inc:201 ../user/explain_state.php:37 msgid "Unsent" msgstr "" -#: ../inc/result.inc:165 +#: ../inc/result.inc:167 msgid "Completed, waiting for validation" msgstr "" -#: ../inc/result.inc:166 +#: ../inc/result.inc:168 msgid "Completed and validated" msgstr "" -#: ../inc/result.inc:167 +#: ../inc/result.inc:169 msgid "Completed, marked as invalid" msgstr "" -#: ../inc/result.inc:168 +#: ../inc/result.inc:170 msgid "Completed, can't validate" msgstr "" -#: ../inc/result.inc:169 +#: ../inc/result.inc:171 msgid "Completed, validation inconclusive" msgstr "" -#: ../inc/result.inc:170 +#: ../inc/result.inc:172 msgid "Completed, too late to validate" msgstr "" -#: ../inc/result.inc:172 +#: ../inc/result.inc:174 msgid "Completed" msgstr "" -#: ../inc/result.inc:173 ../inc/result.inc:209 ../user/explain_state.php:62 +#: ../inc/result.inc:175 ../inc/result.inc:212 ../user/explain_state.php:62 msgid "Couldn't send" msgstr "" -#: ../inc/result.inc:176 ../inc/result.inc:233 +#: ../inc/result.inc:178 ../inc/result.inc:236 msgid "Cancelled by server" msgstr "" -#: ../inc/result.inc:179 +#: ../inc/result.inc:181 msgid "Error while downloading" msgstr "" -#: ../inc/result.inc:181 +#: ../inc/result.inc:183 msgid "Error while computing" msgstr "" -#: ../inc/result.inc:182 +#: ../inc/result.inc:184 msgid "Error while uploading" msgstr "" -#: ../inc/result.inc:183 ../inc/result.inc:235 +#: ../inc/result.inc:185 ../inc/result.inc:238 msgid "Aborted by user" msgstr "" -#: ../inc/result.inc:186 +#: ../inc/result.inc:186 ../inc/result.inc:239 +msgid "Upload failed" +msgstr "" + +#: ../inc/result.inc:189 msgid "Timed out - no response" msgstr "" -#: ../inc/result.inc:187 ../inc/result.inc:216 ../user/explain_state.php:71 +#: ../inc/result.inc:190 ../inc/result.inc:219 ../user/explain_state.php:71 msgid "Didn't need" msgstr "" -#: ../inc/result.inc:188 ../inc/result.inc:217 ../user/explain_state.php:74 +#: ../inc/result.inc:191 ../inc/result.inc:220 ../user/explain_state.php:74 msgid "Validate error" msgstr "" -#: ../inc/result.inc:189 ../inc/result.inc:218 +#: ../inc/result.inc:192 ../inc/result.inc:221 msgid "Abandoned" msgstr "" -#: ../inc/result.inc:200 ../user/explain_state.php:43 +#: ../inc/result.inc:203 ../user/explain_state.php:43 msgid "Over" msgstr "" -#: ../inc/result.inc:208 ../user/explain_state.php:59 +#: ../inc/result.inc:211 ../user/explain_state.php:59 msgid "Success" msgstr "" -#: ../inc/result.inc:212 +#: ../inc/result.inc:215 msgid "Computation error" msgstr "" -#: ../inc/result.inc:214 +#: ../inc/result.inc:217 msgid "Redundant result" msgstr "" -#: ../inc/result.inc:215 ../user/explain_state.php:68 +#: ../inc/result.inc:218 ../user/explain_state.php:68 msgid "No reply" msgstr "" -#: ../inc/result.inc:225 ../user/explain_state.php:85 +#: ../inc/result.inc:228 ../user/explain_state.php:85 msgid "New" msgstr "" -#: ../inc/result.inc:226 ../user/explain_state.php:91 +#: ../inc/result.inc:229 ../user/explain_state.php:91 msgid "Downloading" msgstr "" -#: ../inc/result.inc:227 +#: ../inc/result.inc:230 msgid "Processing" msgstr "" -#: ../inc/result.inc:228 +#: ../inc/result.inc:231 msgid "Compute error" msgstr "" -#: ../inc/result.inc:229 ../user/explain_state.php:97 +#: ../inc/result.inc:232 ../user/explain_state.php:97 msgid "Uploading" msgstr "" -#: ../inc/result.inc:230 ../user/explain_state.php:88 +#: ../inc/result.inc:233 ../user/explain_state.php:88 msgid "Done" msgstr "" -#: ../inc/result.inc:241 +#: ../inc/result.inc:246 msgid "Initial" msgstr "" -#: ../inc/result.inc:247 +#: ../inc/result.inc:252 msgid "Not necessary" msgstr "" -#: ../inc/result.inc:248 +#: ../inc/result.inc:253 msgid "Workunit error - check skipped" msgstr "" -#: ../inc/result.inc:249 +#: ../inc/result.inc:254 msgid "Checked, but no consensus yet" msgstr "" -#: ../inc/result.inc:250 +#: ../inc/result.inc:255 msgid "Task was reported too late to validate" msgstr "" -#: ../inc/result.inc:258 +#: ../inc/result.inc:281 msgid "Couldn't send result" msgstr "" -#: ../inc/result.inc:262 +#: ../inc/result.inc:285 msgid "Too many errors (may have bug)" msgstr "" -#: ../inc/result.inc:266 +#: ../inc/result.inc:289 msgid "Too many results (may be nondeterministic)" msgstr "" -#: ../inc/result.inc:270 +#: ../inc/result.inc:293 msgid "Too many total results" msgstr "" -#: ../inc/result.inc:274 +#: ../inc/result.inc:297 msgid "WU cancelled" msgstr "" -#: ../inc/result.inc:278 +#: ../inc/result.inc:301 msgid "Unrecognized Error: %1" msgstr "" -#: ../inc/result.inc:305 +#: ../inc/result.inc:328 msgid "Task name" msgstr "" -#: ../inc/result.inc:305 ../inc/result.inc:310 ../inc/result.inc:313 -#: ../inc/result.inc:316 +#: ../inc/result.inc:328 ../inc/result.inc:333 ../inc/result.inc:336 +#: ../inc/result.inc:339 msgid "click for details" msgstr "" -#: ../inc/result.inc:305 +#: ../inc/result.inc:328 msgid "Show IDs" msgstr "" -#: ../inc/result.inc:310 +#: ../inc/result.inc:333 msgid "Show names" msgstr "" -#: ../inc/result.inc:313 +#: ../inc/result.inc:336 msgid "Task" msgstr "" -#: ../inc/result.inc:316 +#: ../inc/result.inc:339 msgid "Work unit" msgstr "" -#: ../inc/result.inc:319 +#: ../inc/result.inc:342 msgid "Computer" msgstr "" -#: ../inc/result.inc:322 ../inc/result.inc:422 +#: ../inc/result.inc:345 ../inc/result.inc:594 msgid "Sent" msgstr "" -#: ../inc/result.inc:323 +#: ../inc/result.inc:346 msgid "Time reported
        or deadline" msgstr "" -#: ../inc/result.inc:324 +#: ../inc/result.inc:347 msgid "explain" msgstr "" -#: ../inc/result.inc:326 ../user/server_status.php:246 +#: ../inc/result.inc:349 ../user/server_status.php:246 msgid "Status" msgstr "" -#: ../inc/result.inc:327 +#: ../inc/result.inc:350 msgid "Run time
        (sec)" msgstr "" -#: ../inc/result.inc:328 +#: ../inc/result.inc:351 msgid "CPU time
        (sec)" msgstr "" -#: ../inc/result.inc:329 ../inc/result.inc:433 +#: ../inc/result.inc:352 ../inc/result.inc:605 msgid "Credit" msgstr "" -#: ../inc/result.inc:330 ../inc/result.inc:515 +#: ../inc/result.inc:353 ../inc/result.inc:687 msgid "Application" msgstr "" -#: ../inc/result.inc:420 +#: ../inc/result.inc:592 msgid "Workunit" msgstr "" -#: ../inc/result.inc:423 +#: ../inc/result.inc:595 msgid "Received" msgstr "" -#: ../inc/result.inc:424 +#: ../inc/result.inc:596 msgid "Server state" msgstr "" -#: ../inc/result.inc:425 +#: ../inc/result.inc:597 msgid "Outcome" msgstr "" -#: ../inc/result.inc:426 +#: ../inc/result.inc:598 msgid "Client state" msgstr "" -#: ../inc/result.inc:427 +#: ../inc/result.inc:599 msgid "Exit status" msgstr "" -#: ../inc/result.inc:429 +#: ../inc/result.inc:601 msgid "Report deadline" msgstr "" -#: ../inc/result.inc:430 +#: ../inc/result.inc:602 msgid "Run time" msgstr "" -#: ../inc/result.inc:431 +#: ../inc/result.inc:603 msgid "CPU time" msgstr "" -#: ../inc/result.inc:432 +#: ../inc/result.inc:604 msgid "Validate state" msgstr "" -#: ../inc/result.inc:434 +#: ../inc/result.inc:606 msgid "Application version" msgstr "" -#: ../inc/result.inc:447 +#: ../inc/result.inc:619 msgid "Output files" msgstr "" -#: ../inc/result.inc:450 +#: ../inc/result.inc:622 msgid "Stderr output" msgstr "" -#: ../inc/result.inc:486 -msgid "Previous" -msgstr "" - -#: ../inc/result.inc:495 -msgid "Next" -msgstr "" - -#: ../inc/result.inc:497 +#: ../inc/result.inc:669 msgid "State" msgstr "" @@ -1319,12 +1664,12 @@ #: ../inc/team.inc:36 ../inc/team.inc:114 ../inc/team.inc:225 #: ../inc/team.inc:365 ../inc/team.inc:449 ../inc/user.inc:206 -#: ../inc/user.inc:315 ../user/account_finish.php:45 -#: ../user/create_account_form.php:106 ../user/edit_user_info_form.php:40 +#: ../inc/user.inc:314 ../user/account_finish.php:45 +#: ../user/create_account_form.php:108 ../user/edit_user_info_form.php:40 #: ../user/profile_search_action.php:42 ../user/team_email_list.php:64 #: ../user/team_search.php:72 ../user/top_users.php:63 -#: ../user/user_search.php:104 ../user/user_search.php:121 -#: ../user/user_search.php:160 +#: ../user/user_search.php:105 ../user/user_search.php:123 +#: ../user/user_search.php:163 msgid "Country" msgstr "" @@ -1336,7 +1681,7 @@ msgid "Show only active teams" msgstr "" -#: ../inc/team.inc:45 ../user/profile_menu.php:77 ../user/user_search.php:134 +#: ../inc/team.inc:45 ../user/profile_menu.php:77 ../user/user_search.php:136 msgid "Search" msgstr "" @@ -1356,8 +1701,8 @@ msgid "founder response deadline is %1" msgstr "" -#: ../inc/team.inc:65 ../inc/team.inc:549 ../inc/user.inc:279 -#: ../inc/user.inc:367 +#: ../inc/team.inc:65 ../inc/team.inc:549 ../inc/user.inc:278 +#: ../inc/user.inc:366 msgid "None" msgstr "" @@ -1393,7 +1738,7 @@ msgid "Message board" msgstr "" -#: ../inc/team.inc:120 ../user/forum_forum.php:136 ../user/forum_index.php:93 +#: ../inc/team.inc:120 ../user/forum_forum.php:134 ../user/forum_index.php:93 msgid "Threads" msgstr "" @@ -1459,13 +1804,13 @@ msgid "Admin" msgstr "" -#: ../inc/team.inc:269 ../user/forum_user_posts.php:116 +#: ../inc/team.inc:269 ../user/forum_user_posts.php:122 #: ../user/top_hosts.php:93 ../user/top_teams.php:121 #: ../user/top_users.php:127 msgid "Previous %1" msgstr "" -#: ../inc/team.inc:273 ../user/forum_user_posts.php:125 +#: ../inc/team.inc:273 ../user/forum_user_posts.php:131 #: ../user/profile_search_action.php:61 ../user/top_hosts.php:98 #: ../user/top_teams.php:126 ../user/top_users.php:132 msgid "Next %1" @@ -1563,12 +1908,12 @@ msgid "Computing and credit" msgstr "" -#: ../inc/user.inc:150 +#: ../inc/user.inc:150 ../user/pending.php:64 msgid "Pending credit" msgstr "" #: ../inc/user.inc:150 ../inc/user.inc:152 ../inc/user.inc:153 -#: ../inc/user.inc:241 ../inc/user.inc:323 ../inc/user.inc:398 +#: ../inc/user.inc:240 ../inc/user.inc:322 ../inc/user.inc:397 #: ../user/view_profile.php:56 msgid "View" msgstr "" @@ -1589,8 +1934,8 @@ msgid "Account" msgstr "" -#: ../inc/user.inc:166 ../inc/user.inc:279 ../inc/user.inc:365 -#: ../inc/user.inc:367 ../user/user_search.php:104 ../user/user_search.php:160 +#: ../inc/user.inc:166 ../inc/user.inc:278 ../inc/user.inc:364 +#: ../inc/user.inc:366 ../user/user_search.php:105 ../user/user_search.php:163 msgid "Team" msgstr "" @@ -1619,7 +1964,7 @@ msgid "Email address" msgstr "" -#: ../inc/user.inc:204 ../inc/user.inc:317 +#: ../inc/user.inc:204 ../inc/user.inc:316 msgid "URL" msgstr "" @@ -1627,7 +1972,7 @@ msgid "Postal code" msgstr "" -#: ../inc/user.inc:208 ../inc/user.inc:314 +#: ../inc/user.inc:208 ../inc/user.inc:313 msgid "%1 member since" msgstr "" @@ -1647,7 +1992,7 @@ msgid "other account info" msgstr "" -#: ../inc/user.inc:214 ../inc/user.inc:313 +#: ../inc/user.inc:214 ../inc/user.inc:312 msgid "User ID" msgstr "" @@ -1655,136 +2000,124 @@ msgid "Used in community functions" msgstr "" -#: ../inc/user.inc:216 -msgid "Account key" -msgstr "" - -#: ../inc/user.inc:216 -msgid "Provides full access to your account" -msgstr "" - -#: ../inc/user.inc:217 ../user/weak_auth.php:27 +#: ../inc/user.inc:216 ../user/weak_auth.php:27 msgid "Weak account key" msgstr "" -#: ../inc/user.inc:217 +#: ../inc/user.inc:216 msgid "Provides %1limited access%2 to your account" msgstr "" -#: ../inc/user.inc:220 +#: ../inc/user.inc:219 msgid "Preferences" msgstr "" -#: ../inc/user.inc:223 +#: ../inc/user.inc:222 msgid "When and how BOINC uses your computer" msgstr "" -#: ../inc/user.inc:224 +#: ../inc/user.inc:223 msgid "Computing preferences" msgstr "" -#: ../inc/user.inc:227 +#: ../inc/user.inc:226 msgid "Message boards and private messages" msgstr "" -#: ../inc/user.inc:228 ../user/edit_forum_preferences_form.php:31 +#: ../inc/user.inc:227 ../user/edit_forum_preferences_form.php:31 msgid "Community preferences" msgstr "" -#: ../inc/user.inc:231 +#: ../inc/user.inc:230 msgid "Preferences for this project" msgstr "" -#: ../inc/user.inc:232 ../user/prefs.php:33 +#: ../inc/user.inc:231 ../user/prefs.php:33 msgid "%1 preferences" msgstr "" -#: ../inc/user.inc:238 ../user/sample_index.php:107 +#: ../inc/user.inc:237 ../user/sample_index.php:114 msgid "Community" msgstr "" -#: ../inc/user.inc:241 ../user/pm.php:107 ../user/pm.php:147 +#: ../inc/user.inc:240 ../user/pm.php:107 ../user/pm.php:147 msgid "Delete" msgstr "" -#: ../inc/user.inc:243 +#: ../inc/user.inc:242 msgid "Create" msgstr "" -#: ../inc/user.inc:245 ../inc/user.inc:398 ../inc/util.inc:476 +#: ../inc/user.inc:244 ../inc/user.inc:397 ../inc/util.inc:484 msgid "Profile" msgstr "" -#: ../inc/user.inc:248 ../inc/user.inc:371 +#: ../inc/user.inc:247 ../inc/user.inc:370 msgid "%1 posts" msgstr "" -#: ../inc/user.inc:260 ../user/edit_forum_preferences_form.php:51 +#: ../inc/user.inc:259 ../user/edit_forum_preferences_form.php:51 msgid "Notifications" msgstr "" -#: ../inc/user.inc:267 +#: ../inc/user.inc:266 msgid "Quit team" msgstr "" -#: ../inc/user.inc:269 ../inc/user.inc:286 +#: ../inc/user.inc:268 ../inc/user.inc:285 msgid "Administer" msgstr "" -#: ../inc/user.inc:275 ../inc/user.inc:288 +#: ../inc/user.inc:274 ../inc/user.inc:287 msgid "(foundership change request pending)" msgstr "" -#: ../inc/user.inc:277 +#: ../inc/user.inc:276 msgid "Member of team" msgstr "" -#: ../inc/user.inc:279 +#: ../inc/user.inc:278 msgid "find a team" msgstr "" -#: ../inc/user.inc:290 +#: ../inc/user.inc:289 msgid "Founder but not member of" msgstr "" -#: ../inc/user.inc:296 +#: ../inc/user.inc:295 msgid "Find friends" msgstr "" -#: ../inc/user.inc:303 ../inc/user.inc:305 ../inc/user.inc:381 -#: ../inc/user.inc:383 ../inc/user.inc:392 +#: ../inc/user.inc:302 ../inc/user.inc:304 ../inc/user.inc:380 +#: ../inc/user.inc:382 ../inc/user.inc:391 msgid "Friends" msgstr "" -#: ../inc/user.inc:323 ../inc/user.inc:325 ../user/server_status.php:396 +#: ../inc/user.inc:322 ../inc/user.inc:324 ../user/server_status.php:396 msgid "Computers" msgstr "" -#: ../inc/user.inc:325 ../user/forum_forum.php:174 -msgid "hidden" -msgstr "" - -#: ../inc/user.inc:332 +#: ../inc/user.inc:331 msgid "Donor" msgstr "" -#: ../inc/user.inc:374 +#: ../inc/user.inc:373 msgid "Contact" msgstr "" -#: ../inc/user.inc:377 +#: ../inc/user.inc:376 msgid "This person is a friend" msgstr "" -#: ../inc/user.inc:378 ../user/friend.php:238 +#: ../inc/user.inc:377 ../user/friend.php:238 msgid "Cancel friendship" msgstr "" -#: ../inc/user.inc:381 ../user/friend.php:37 +#: ../inc/user.inc:380 ../user/friend.php:37 msgid "Request pending" msgstr "" -#: ../inc/user.inc:383 +#: ../inc/user.inc:382 msgid "Add as friend" msgstr "" @@ -1796,73 +2129,73 @@ msgid "log in" msgstr "" -#: ../inc/util.inc:171 ../user/login_form.php:37 ../user/login_form.php:60 +#: ../inc/util.inc:174 ../user/login_form.php:37 ../user/login_form.php:62 msgid "Log in" msgstr "" -#: ../inc/util.inc:172 ../user/create_account_form.php:38 +#: ../inc/util.inc:175 ../user/create_account_form.php:38 msgid "Create an account" msgstr "" -#: ../inc/util.inc:173 +#: ../inc/util.inc:176 msgid "Server status page" msgstr "" -#: ../inc/util.inc:210 +#: ../inc/util.inc:218 msgid "" "A database error occurred while handling your request; please try again " "later." msgstr "" -#: ../inc/util.inc:219 +#: ../inc/util.inc:227 msgid "Unable to handle request" msgstr "" -#: ../inc/util.inc:239 +#: ../inc/util.inc:247 msgid "hours" msgstr "" -#: ../inc/util.inc:242 +#: ../inc/util.inc:250 msgid "min" msgstr "" -#: ../inc/util.inc:245 +#: ../inc/util.inc:253 msgid "sec" msgstr "" -#: ../inc/util.inc:406 +#: ../inc/util.inc:414 msgid "Link has timed out. Please click Back, refresh the page, and try again." msgstr "" -#: ../inc/util.inc:475 +#: ../inc/util.inc:483 msgid "View the profile of %1" msgstr "" -#: ../inc/util.inc:531 +#: ../inc/util.inc:539 msgid "Use BBCode tags to format your text" msgstr "" -#: ../inc/util.inc:735 +#: ../inc/util.inc:750 msgid "Project down for maintenance" msgstr "" -#: ../inc/util.inc:738 +#: ../inc/util.inc:753 msgid "%1 is temporarily shut down for maintenance. Please try again later." msgstr "" -#: ../inc/util.inc:756 +#: ../inc/util.inc:771 msgid "Unable to connect to database - please try again later" msgstr "" -#: ../inc/util.inc:757 +#: ../inc/util.inc:772 msgid "Error:" msgstr "" -#: ../inc/util.inc:761 +#: ../inc/util.inc:776 msgid "Unable to select database - please try again later" msgstr "" -#: ../inc/util_ops.inc:131 ../user/get_passwd.php:72 +#: ../inc/util_ops.inc:130 ../user/get_passwd.php:72 msgid "Stay logged in on this computer" msgstr "" @@ -1870,35 +2203,35 @@ msgid "Finish account setup" msgstr "" -#: ../user/account_finish.php:41 ../user/create_account_form.php:87 +#: ../user/account_finish.php:41 ../user/create_account_form.php:89 msgid "Identifies you on our web site. Use your real name or a nickname." msgstr "" -#: ../user/account_finish.php:45 ../user/create_account_form.php:106 +#: ../user/account_finish.php:45 ../user/create_account_form.php:108 msgid "Select the country you want to represent, if any." msgstr "" -#: ../user/account_finish.php:51 ../user/create_account_form.php:112 +#: ../user/account_finish.php:51 ../user/create_account_form.php:114 msgid "Postal or ZIP Code" msgstr "" -#: ../user/account_finish.php:51 ../user/create_account_form.php:112 +#: ../user/account_finish.php:51 ../user/create_account_form.php:114 msgid "Optional" msgstr "" -#: ../user/account_finish_action.php:27 ../user/create_account_action.php:84 +#: ../user/account_finish_action.php:27 ../user/create_account_action.php:86 msgid "You must supply a name for your account" msgstr "" -#: ../user/account_finish_action.php:30 ../user/create_account_action.php:87 +#: ../user/account_finish_action.php:30 ../user/create_account_action.php:89 msgid "HTML tags not allowed in name" msgstr "" -#: ../user/add_venue.php:86 +#: ../user/add_venue.php:85 msgid "Add %1 preferences for %2" msgstr "" -#: ../user/apps.php:32 ../user/sample_index.php:102 +#: ../user/apps.php:32 ../user/sample_index.php:109 msgid "Applications" msgstr "" @@ -1951,70 +2284,74 @@ msgstr "" #: ../user/bbcode.php:35 -msgid "Big text" +msgid "Superscript" msgstr "" #: ../user/bbcode.php:36 -msgid "Red text" +msgid "Big text" msgstr "" #: ../user/bbcode.php:37 -msgid "link to website" +msgid "Red text" msgstr "" #: ../user/bbcode.php:38 +msgid "link to website" +msgstr "" + +#: ../user/bbcode.php:39 msgid "Quoted text" msgstr "" -#: ../user/bbcode.php:38 +#: ../user/bbcode.php:39 msgid "use for quoted blocks of text" msgstr "" -#: ../user/bbcode.php:39 +#: ../user/bbcode.php:40 msgid "use to display an image" msgstr "" -#: ../user/bbcode.php:40 +#: ../user/bbcode.php:41 msgid "Code snippet here" msgstr "" -#: ../user/bbcode.php:40 +#: ../user/bbcode.php:41 msgid "use to display some code" msgstr "" -#: ../user/bbcode.php:41 +#: ../user/bbcode.php:42 msgid "Pre-formatted text" msgstr "" -#: ../user/bbcode.php:41 +#: ../user/bbcode.php:42 msgid "use to display pre-formatted (usually monospaced) text" msgstr "" -#: ../user/bbcode.php:42 +#: ../user/bbcode.php:43 msgid "Item 1" msgstr "" -#: ../user/bbcode.php:42 +#: ../user/bbcode.php:43 msgid "Item2" msgstr "" -#: ../user/bbcode.php:42 +#: ../user/bbcode.php:43 msgid "Item 2" msgstr "" -#: ../user/bbcode.php:44 +#: ../user/bbcode.php:45 msgid "use to link to Trac ticket on BOINC website" msgstr "" -#: ../user/bbcode.php:46 +#: ../user/bbcode.php:47 msgid "use to link to Trac Wiki on BOINC website" msgstr "" -#: ../user/bbcode.php:48 +#: ../user/bbcode.php:49 msgid "use to link to SVN changeset on BOINC website" msgstr "" -#: ../user/bbcode.php:52 +#: ../user/bbcode.php:53 msgid "" "If you don't close a tag or don't specify a parameter correctly,\n" "the raw tag itself will display instead of the formatted text." @@ -2028,51 +2365,51 @@ msgid "Click your browser's Back button to try again." msgstr "" -#: ../user/create_account_action.php:36 ../user/create_account_action.php:38 +#: ../user/create_account_action.php:38 ../user/create_account_action.php:40 #: ../user/create_account_form.php:43 msgid "Account creation is disabled" msgstr "" -#: ../user/create_account_action.php:39 +#: ../user/create_account_action.php:41 msgid "" "Sorry, this project has disabled the creation of new accounts.\n" "Please try again later." msgstr "" -#: ../user/create_account_action.php:51 +#: ../user/create_account_action.php:53 msgid "Your reCAPTCHA response was not correct. Please try again." msgstr "" -#: ../user/create_account_action.php:75 +#: ../user/create_account_action.php:77 msgid "You must supply an invitation code to create an account." msgstr "" -#: ../user/create_account_action.php:78 +#: ../user/create_account_action.php:80 msgid "The invitation code you gave is not valid." msgstr "" -#: ../user/create_account_action.php:92 +#: ../user/create_account_action.php:94 msgid "" "Invalid email address: you must enter a valid address of the form name@domain" msgstr "" -#: ../user/create_account_action.php:96 +#: ../user/create_account_action.php:98 msgid "There's already an account with that email address." msgstr "" -#: ../user/create_account_action.php:102 ../user/edit_passwd_action.php:33 +#: ../user/create_account_action.php:104 ../user/edit_passwd_action.php:33 msgid "New passwords are different" msgstr "" -#: ../user/create_account_action.php:109 ../user/edit_passwd_action.php:41 +#: ../user/create_account_action.php:111 ../user/edit_passwd_action.php:41 msgid "Passwords may only include ASCII characters." msgstr "" -#: ../user/create_account_action.php:114 ../user/edit_passwd_action.php:45 +#: ../user/create_account_action.php:116 ../user/edit_passwd_action.php:45 msgid "New password is too short: minimum password length is %1 characters." msgstr "" -#: ../user/create_account_action.php:135 +#: ../user/create_account_action.php:137 msgid "Couldn't create account" msgstr "" @@ -2082,49 +2419,49 @@ #: ../user/create_account_form.php:53 msgid "" -"NOTE: If you use the BOINC Manager, don't use this form. Just run BOINC, " -"select Add Project, and enter an email address and password." +"Don't use this form. Just run BOINC, select Add Project, and enter an email " +"address and password." msgstr "" -#: ../user/create_account_form.php:69 +#: ../user/create_account_form.php:71 msgid "" "This account will belong to the team %1 and will have the project " "preferences of its founder." msgstr "" -#: ../user/create_account_form.php:81 +#: ../user/create_account_form.php:83 msgid "Invitation Code" msgstr "" -#: ../user/create_account_form.php:81 +#: ../user/create_account_form.php:83 msgid "A valid invitation code is required to create an account." msgstr "" -#: ../user/create_account_form.php:91 +#: ../user/create_account_form.php:93 msgid "Email Address" msgstr "" -#: ../user/create_account_form.php:91 +#: ../user/create_account_form.php:93 msgid "Must be a valid address of the form 'name@domain'." msgstr "" -#: ../user/create_account_form.php:100 ../user/edit_email_form.php:48 +#: ../user/create_account_form.php:102 ../user/edit_email_form.php:48 msgid "Password" msgstr "" -#: ../user/create_account_form.php:101 +#: ../user/create_account_form.php:103 msgid "Must be at least %1 characters" msgstr "" -#: ../user/create_account_form.php:104 +#: ../user/create_account_form.php:106 msgid "Confirm password" msgstr "" -#: ../user/create_account_form.php:122 +#: ../user/create_account_form.php:123 msgid "Please enter the words shown in the image" msgstr "" -#: ../user/create_account_form.php:128 +#: ../user/create_account_form.php:129 msgid "Create account" msgstr "" @@ -2270,8 +2607,8 @@ #: ../user/delete_account.php:79 ../user/delete_profile.php:52 #: ../user/donations.php:322 ../user/donations.php:326 ../user/friend.php:238 -#: ../user/prefs_remove.php:55 ../user/user_search.php:127 -#: ../user/user_search.php:132 +#: ../user/prefs_remove.php:55 ../user/user_search.php:129 +#: ../user/user_search.php:134 msgid "Yes" msgstr "" @@ -2280,8 +2617,8 @@ msgstr "" #: ../user/delete_account.php:80 ../user/delete_profile.php:53 -#: ../user/friend.php:239 ../user/user_search.php:126 -#: ../user/user_search.php:131 +#: ../user/friend.php:239 ../user/user_search.php:128 +#: ../user/user_search.php:133 msgid "No" msgstr "" @@ -2318,7 +2655,7 @@ #: ../user/delete_profile.php:48 msgid "" -"If you're sure, click 'Delete'\n" +"If you're sure, click 'Yes'\n" "to remove your profile from our database." msgstr "" @@ -2970,8 +3307,8 @@ #: ../user/ffmail_action.php:94 msgid "" -"You forgot to enter your friends' names and/or email addresses; Please %" -"1return to the form%2 and enter them." +"You forgot to enter your friends' names and/or email addresses; Please " +"%1return to the form%2 and enter them." msgstr "" #: ../user/ffmail_form.php:31 @@ -3105,7 +3442,7 @@ msgid "You are not authorized to edit this post." msgstr "" -#: ../user/forum_edit.php:86 ../user/forum_search.php:71 +#: ../user/forum_edit.php:86 ../user/forum_search.php:72 msgid "Forum" msgstr "" @@ -3127,83 +3464,83 @@ msgid "Not visible to you" msgstr "" -#: ../user/forum_forum.php:82 +#: ../user/forum_forum.php:80 msgid "Team message board for %1" msgstr "" -#: ../user/forum_forum.php:98 +#: ../user/forum_forum.php:96 msgid "New thread" msgstr "" -#: ../user/forum_forum.php:98 +#: ../user/forum_forum.php:96 msgid "Add a new thread to this forum" msgstr "" -#: ../user/forum_forum.php:118 +#: ../user/forum_forum.php:116 msgid "This message board is available as an %1RSS feed%2" msgstr "" -#: ../user/forum_forum.php:174 +#: ../user/forum_forum.php:172 msgid "This thread is hidden" msgstr "" -#: ../user/forum_forum.php:178 +#: ../user/forum_forum.php:176 msgid "This thread is sticky and locked, and you haven't read it yet" msgstr "" -#: ../user/forum_forum.php:178 +#: ../user/forum_forum.php:176 msgid "sticky/locked/unread" msgstr "" -#: ../user/forum_forum.php:180 +#: ../user/forum_forum.php:178 msgid "This thread is sticky and you haven't read it yet" msgstr "" -#: ../user/forum_forum.php:180 +#: ../user/forum_forum.php:178 msgid "sticky/unread" msgstr "" -#: ../user/forum_forum.php:184 +#: ../user/forum_forum.php:182 msgid "You haven't read this thread yet, and it's locked" msgstr "" -#: ../user/forum_forum.php:184 +#: ../user/forum_forum.php:182 msgid "unread/locked" msgstr "" -#: ../user/forum_forum.php:186 +#: ../user/forum_forum.php:184 msgid "You haven't read this thread yet" msgstr "" -#: ../user/forum_forum.php:192 +#: ../user/forum_forum.php:190 msgid "This thread is sticky and locked" msgstr "" -#: ../user/forum_forum.php:192 +#: ../user/forum_forum.php:190 msgid "sticky/locked" msgstr "" -#: ../user/forum_forum.php:194 +#: ../user/forum_forum.php:192 msgid "This thread is sticky" msgstr "" -#: ../user/forum_forum.php:194 +#: ../user/forum_forum.php:192 msgid "sticky" msgstr "" -#: ../user/forum_forum.php:198 +#: ../user/forum_forum.php:196 msgid "This thread is locked" msgstr "" -#: ../user/forum_forum.php:198 +#: ../user/forum_forum.php:196 msgid "locked" msgstr "" -#: ../user/forum_forum.php:200 +#: ../user/forum_forum.php:198 msgid "You read this thread" msgstr "" -#: ../user/forum_forum.php:200 +#: ../user/forum_forum.php:198 msgid "read" msgstr "" @@ -3213,8 +3550,8 @@ #: ../user/forum_help_desk.php:30 msgid "" -"Talk live via Skype with a volunteer, in any of several languages. Go to %" -"1BOINC Online Help%2." +"Talk live via Skype with a volunteer, in any of several languages. Go to " +"%1BOINC Online Help%2." msgstr "" #: ../user/forum_help_desk.php:44 ../user/forum_index.php:92 @@ -3445,8 +3782,8 @@ "modify your text and try again." msgstr "" -#: ../user/forum_reply.php:87 ../user/forum_thread.php:156 -#: ../user/forum_thread.php:276 +#: ../user/forum_reply.php:87 ../user/forum_thread.php:154 +#: ../user/forum_thread.php:274 msgid "Post to thread" msgstr "" @@ -3484,6 +3821,10 @@ "may take a little while, so please be patient" msgstr "" +#: ../user/forum_report_post.php:70 +msgid "Report a forum post" +msgstr "" + #: ../user/forum_report_post.php:72 msgid "" "Before reporting this post, consider using the +/- rating system instead. If " @@ -3595,15 +3936,15 @@ msgid "1 year" msgstr "" -#: ../user/forum_search.php:72 +#: ../user/forum_search.php:73 msgid "Only display posts from this forum" msgstr "" -#: ../user/forum_search.php:83 +#: ../user/forum_search.php:84 msgid "Sort by" msgstr "" -#: ../user/forum_search.php:87 +#: ../user/forum_search.php:88 msgid "Start the search" msgstr "" @@ -3611,25 +3952,25 @@ msgid "Forum search results" msgstr "" -#: ../user/forum_search_action.php:169 +#: ../user/forum_search_action.php:174 msgid "Thread titles matching your query:" msgstr "" -#: ../user/forum_search_action.php:189 +#: ../user/forum_search_action.php:194 msgid "Messages matching your query:" msgstr "" -#: ../user/forum_search_action.php:212 +#: ../user/forum_search_action.php:217 msgid "" "Sorry, couldn't find anything matching your search query. You can try to " "broaden your search by using less words (or less specific words)." msgstr "" -#: ../user/forum_search_action.php:214 +#: ../user/forum_search_action.php:219 msgid "You can also %1try the same search on Google.%2" msgstr "" -#: ../user/forum_search_action.php:219 +#: ../user/forum_search_action.php:224 msgid "Perform another search" msgstr "" @@ -3683,119 +4024,107 @@ msgid "This thread has been hidden by moderators." msgstr "" -#: ../user/forum_thread.php:127 +#: ../user/forum_thread.php:125 msgid "My question was answered" msgstr "" -#: ../user/forum_thread.php:128 +#: ../user/forum_thread.php:126 msgid "Click here if your question has been adequately answered" msgstr "" -#: ../user/forum_thread.php:136 +#: ../user/forum_thread.php:134 msgid "I've also got this question" msgstr "" -#: ../user/forum_thread.php:157 ../user/forum_thread.php:277 +#: ../user/forum_thread.php:155 ../user/forum_thread.php:275 msgid "Add a new message to this thread" msgstr "" -#: ../user/forum_thread.php:169 +#: ../user/forum_thread.php:167 msgid "Unsubscribe" msgstr "" -#: ../user/forum_thread.php:170 +#: ../user/forum_thread.php:168 msgid "You are subscribed to this thread. Click here to unsubscribe." msgstr "" -#: ../user/forum_thread.php:176 +#: ../user/forum_thread.php:174 msgid "Subscribe" msgstr "" -#: ../user/forum_thread.php:177 +#: ../user/forum_thread.php:175 msgid "Click to get email when there are new posts in this thread" msgstr "" -#: ../user/forum_thread.php:187 -msgid "Unhide" -msgstr "" - -#: ../user/forum_thread.php:188 +#: ../user/forum_thread.php:186 msgid "Unhide this thread" msgstr "" -#: ../user/forum_thread.php:193 -msgid "Hide" -msgstr "" - -#: ../user/forum_thread.php:194 +#: ../user/forum_thread.php:192 msgid "Hide this thread" msgstr "" -#: ../user/forum_thread.php:200 +#: ../user/forum_thread.php:198 msgid "Make unsticky" msgstr "" -#: ../user/forum_thread.php:201 +#: ../user/forum_thread.php:199 msgid "Make this thread not sticky" msgstr "" -#: ../user/forum_thread.php:206 +#: ../user/forum_thread.php:204 msgid "Make sticky" msgstr "" -#: ../user/forum_thread.php:207 +#: ../user/forum_thread.php:205 msgid "Make this thread sticky" msgstr "" -#: ../user/forum_thread.php:213 +#: ../user/forum_thread.php:211 msgid "Unlock" msgstr "" -#: ../user/forum_thread.php:214 +#: ../user/forum_thread.php:212 msgid "Unlock this thread" msgstr "" -#: ../user/forum_thread.php:219 +#: ../user/forum_thread.php:217 msgid "Lock" msgstr "" -#: ../user/forum_thread.php:220 +#: ../user/forum_thread.php:218 msgid "Lock this thread" msgstr "" -#: ../user/forum_thread.php:226 -msgid "Move" -msgstr "" - -#: ../user/forum_thread.php:227 +#: ../user/forum_thread.php:225 msgid "Move this thread to a different forum" msgstr "" -#: ../user/forum_thread.php:232 +#: ../user/forum_thread.php:230 msgid "Edit title" msgstr "" -#: ../user/forum_thread.php:233 +#: ../user/forum_thread.php:231 msgid "Edit thread title" msgstr "" -#: ../user/forum_thread.php:243 -msgid "Export" +#: ../user/forum_thread.php:241 +msgid "Export as Notice" msgstr "" -#: ../user/forum_thread.php:244 +#: ../user/forum_thread.php:242 msgid "Export this news item as a Notice" msgstr "" -#: ../user/forum_thread.php:249 +#: ../user/forum_thread.php:247 msgid "Don't export" msgstr "" -#: ../user/forum_thread.php:250 +#: ../user/forum_thread.php:248 msgid "Don't export this news item as a Notice" msgstr "" -#: ../user/forum_thread.php:258 +#: ../user/forum_thread.php:256 ../user/forum_thread.php:258 msgid "Sort" msgstr "" @@ -3997,6 +4326,20 @@ msgid "Log in with authenticator" msgstr "" +#: ../user/gpu_list.php:126 ../user/gpu_list.php:152 +msgid "No GPU tasks reported" +msgstr "" + +#: ../user/gpu_list.php:182 ../user/stats.php:33 +msgid "Top GPU models" +msgstr "" + +#: ../user/gpu_list.php:183 +msgid "" +"The following lists show the most productive GPU models on different " +"platforms. Relative speeds are shown in parentheses." +msgstr "" + #: ../user/home.php:42 msgid "Welcome to %1" msgstr "" @@ -4216,7 +4559,7 @@ msgid "You can also use ampersand notation for special characters." msgstr "" -#: ../user/info.php:24 ../user/sample_index.php:73 +#: ../user/info.php:24 ../user/sample_index.php:74 msgid "Read our rules and policies" msgstr "" @@ -4272,8 +4615,8 @@ #: ../user/info.php:45 msgid "" "To participate in %1, you must give an address where you receive email. This " -"address will not be shown on the %1 web site or shared with organizations. %" -"1 may send you periodic newsletters; however, you can opt out at any time." +"address will not be shown on the %1 web site or shared with organizations. " +"%1 may send you periodic newsletters; however, you can opt out at any time." msgstr "" #: ../user/info.php:46 @@ -4326,8 +4669,8 @@ #: ../user/info.php:54 msgid "" "%1 and %2 assume no liability for damage to your computer, loss of data, or " -"any other event or condition that may occur as a result of participating in %" -"1." +"any other event or condition that may occur as a result of participating in " +"%1." msgstr "" #: ../user/info.php:56 @@ -4389,34 +4732,139 @@ #: ../user/language_select.php:110 msgid "" -"Translations are done by volunteers. If your native language is not here, %" -"1you can provide a translation%2." +"Translations are done by volunteers. If your native language is not here, " +"%1you can provide a translation%2." msgstr "" -#: ../user/login_form.php:50 +#: ../user/login_form.php:52 msgid "Email address:" msgstr "" -#: ../user/login_form.php:50 +#: ../user/login_form.php:52 msgid "forgot email address?" msgstr "" -#: ../user/login_form.php:52 +#: ../user/login_form.php:54 msgid "Password:" msgstr "" -#: ../user/login_form.php:52 +#: ../user/login_form.php:54 msgid "forgot password?" msgstr "" -#: ../user/login_form.php:55 +#: ../user/login_form.php:57 msgid "Stay logged in" msgstr "" -#: ../user/login_form.php:61 +#: ../user/login_form.php:63 msgid "or %1create an account%2." msgstr "" +#: ../user/merge_by_name.php:33 +msgid "Processing %1" +msgstr "" + +#: ../user/merge_by_name.php:45 +msgid "Merged %1 into %2" +msgstr "" + +#: ../user/merge_by_name.php:74 +msgid "Return to the list of your computers" +msgstr "" + +#: ../user/merge_by_name.php:78 +msgid "" +"This operation merges computers based on their domain name.\n" +"

        \n" +" For each domain name, it will merge all older computers\n" +" having that name with the newest computer having that name.\n" +" Incompatible computers will not be merged.\n" +"

        " +msgstr "" + +#: ../user/merge_by_name.php:84 +msgid "Go ahead and do this" +msgstr "" + +#: ../user/merge_by_name.php:85 +msgid "Return to the list of computers" +msgstr "" + +#: ../user/moderation.php:26 +msgid "" +"\n" +"To maximize discussion and flow of information,\n" +"our message boards are moderated.\n" +"Message board postings are subject to the following posting rules:\n" +msgstr "" + +#: ../user/moderation.php:30 +msgid "" +"\n" +"

        \n" +"Moderators may delete posts that violate any of these rules.\n" +"The authors of deleted posts will be notified via email.\n" +"Gross offenders may have their ability to post messages temporarily revoked\n" +"(though to prevent abuse only project administrators have the ability to do " +"so).\n" +"Additional kinds of bad behavior (\"bugging\" posts to trap the\n" +"IP addresses of other participants, excessive thread creation to spam\n" +"the forums, etc.), while not listed in the formal rules, may still\n" +"lead to similar penalties.\n" +"

        \n" +"If you think a post violates any of the posting rules,\n" +"click the red X on the post and fill out the form;\n" +"moderators will be notified of your complaint.\n" +"Please use this button only for clear violations - not\n" +"personal disputes.\n" +"

        \n" +"We try to be as fair as we can when moderating,\n" +"but in a large community of users, with many different viewpoints,\n" +"there will always be some people that will not be happy\n" +"with our moderation decisions.\n" +"While we regret that this happens,\n" +"please realize that we cannot suit all of the people all of the time\n" +"and have to make decisions based on our resources and\n" +"what is best for the forum overall.\n" +"Please don't discuss our moderation policy on the forums. We aren't\n" +"a social engineering project nor are we in the business of creating\n" +"a perfectly fair system. So such discussions tend to be counterproductive\n" +"and potentially incendiary. If you have a legitimate claim,\n" +"send email to the address below.\n" +"

        \n" +"This moderation policy is set by the %1 project.\n" +"If you have comments about the policy, email %2.\n" +"\n" +msgstr "" + +#: ../user/pending.php:66 +msgid "Result ID" +msgstr "" + +#: ../user/pending.php:66 +msgid "Workunit ID" +msgstr "" + +#: ../user/pending.php:66 +msgid "Host ID" +msgstr "" + +#: ../user/pending.php:66 +msgid "Claimed credit" +msgstr "" + +#: ../user/pending.php:79 +msgid "Pending credit: %1" +msgstr "" + +#: ../user/pm.php:32 +msgid "Block messages from this user" +msgstr "" + +#: ../user/pm.php:32 +msgid "Block user" +msgstr "" + #: ../user/pm.php:73 msgid "Your message has been sent." msgstr "" @@ -4429,8 +4877,20 @@ msgid "Sender and date" msgstr "" -#: ../user/pm.php:106 ../user/pm.php:146 -msgid "Reply" +#: ../user/pm.php:106 +msgid "Reply to this message" +msgstr "" + +#: ../user/pm.php:107 +msgid "Delete this message" +msgstr "" + +#: ../user/pm.php:112 +msgid "Select all" +msgstr "" + +#: ../user/pm.php:114 +msgid "Unselect all" msgstr "" #: ../user/pm.php:117 @@ -4449,6 +4909,13 @@ msgid "You need to fill all fields to send a private message" msgstr "" +#: ../user/pm.php:188 +msgid "" +"Your message was flagged as spam\n" +" by the Akismet anti-spam system.\n" +" Please modify your text and try again." +msgstr "" + #: ../user/pm.php:205 msgid "Could not find user with id %1" msgstr "" @@ -4493,6 +4960,10 @@ msgid "No, cancel" msgstr "" +#: ../user/pm.php:260 ../user/team_admins.php:97 +msgid "no such user" +msgstr "" + #: ../user/pm.php:263 msgid "User %1 blocked" msgstr "" @@ -4505,6 +4976,10 @@ msgid "To unblock, visit %1message board preferences%2" msgstr "" +#: ../user/pm.php:302 +msgid "Unknown action" +msgstr "" + #: ../user/prefs.php:36 msgid "" "Your preferences have been updated, and\n" @@ -4512,11 +4987,11 @@ " or you issue the %2Update%3 command from the BOINC Manager." msgstr "" -#: ../user/prefs_edit.php:66 ../user/prefs_edit.php:94 +#: ../user/prefs_edit.php:65 ../user/prefs_edit.php:93 msgid "%1 for %2" msgstr "" -#: ../user/prefs_edit.php:111 +#: ../user/prefs_edit.php:110 msgid "Back to preferences" msgstr "" @@ -4536,7 +5011,7 @@ msgid "Cancel" msgstr "" -#: ../user/profile_menu.php:35 ../user/sample_index.php:109 +#: ../user/profile_menu.php:35 ../user/sample_index.php:116 msgid "Profiles" msgstr "" @@ -4668,7 +5143,7 @@ msgid "No tasks to display" msgstr "" -#: ../user/sample_index.php:173 +#: ../user/sample_index.php:180 msgid "User of the day" msgstr "" @@ -4844,19 +5319,19 @@ msgid "Top teams" msgstr "" -#: ../user/stats.php:36 +#: ../user/stats.php:37 msgid "" "More detailed statistics for %1 and other BOINC-based projects are available " "at several web sites:" msgstr "" -#: ../user/stats.php:39 +#: ../user/stats.php:40 msgid "" "You can also get your current statistics in the form of a \"signature image" "\":" msgstr "" -#: ../user/stats.php:42 +#: ../user/stats.php:43 msgid "" "Additionally you can get your individual statistics summed across all BOINC " "projects from several sites; see your %1home page%2." @@ -4996,10 +5471,6 @@ msgid "failed to remove admin" msgstr "" -#: ../user/team_admins.php:97 -msgid "no such user" -msgstr "" - #: ../user/team_admins.php:98 msgid "User is not member of team" msgstr "" @@ -5426,8 +5897,8 @@ #: ../user/team_lookup.php:104 msgid "" -"End of results. %1 If you cannot find the team you are looking for, you may %" -"2create a team%3 yourself." +"End of results. %1 If you cannot find the team you are looking for, you may " +"%2create a team%3 yourself." msgstr "" #: ../user/team_manage.php:26 @@ -5669,66 +6140,66 @@ msgid "User of the Day for %1: %2" msgstr "" -#: ../user/user_search.php:104 ../user/user_search.php:160 +#: ../user/user_search.php:103 ../user/user_search.php:152 +msgid "User search results" +msgstr "" + +#: ../user/user_search.php:105 ../user/user_search.php:163 msgid "Joined" msgstr "" -#: ../user/user_search.php:115 +#: ../user/user_search.php:117 msgid "Search type" msgstr "" -#: ../user/user_search.php:116 +#: ../user/user_search.php:118 msgid "User name starts with" msgstr "" -#: ../user/user_search.php:117 +#: ../user/user_search.php:119 msgid "Decreasing sign-up time" msgstr "" -#: ../user/user_search.php:118 +#: ../user/user_search.php:120 msgid "Decreasing average credit" msgstr "" -#: ../user/user_search.php:119 +#: ../user/user_search.php:121 msgid "Decreasing total credit" msgstr "" -#: ../user/user_search.php:120 +#: ../user/user_search.php:122 msgid "Filters" msgstr "" -#: ../user/user_search.php:121 +#: ../user/user_search.php:123 msgid "Any" msgstr "" -#: ../user/user_search.php:124 +#: ../user/user_search.php:126 msgid "With profile?" msgstr "" -#: ../user/user_search.php:125 ../user/user_search.php:130 +#: ../user/user_search.php:127 ../user/user_search.php:132 msgid "Either" msgstr "" -#: ../user/user_search.php:129 +#: ../user/user_search.php:131 msgid "On a team?" msgstr "" -#: ../user/user_search.php:148 +#: ../user/user_search.php:150 msgid "search string must be at least 3 characters" msgstr "" -#: ../user/user_search.php:158 +#: ../user/user_search.php:161 msgid "User names starting with" msgstr "" -#: ../user/user_search.php:168 +#: ../user/user_search.php:171 msgid "No users match your search criteria." msgstr "" -#: ../user/user_search.php:226 -msgid "User search results" -msgstr "" - #: ../user/userw.php:45 msgid "User not found!" msgstr "" @@ -5932,6 +6403,6 @@ "applications?" msgstr "" -#: ../project.sample/project_specific_prefs.inc:80 +#: ../project.sample/project_specific_prefs.inc:81 msgid "(all applications)" msgstr "" Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/locale/tr/BOINC-Web.mo and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/locale/tr/BOINC-Web.mo differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/locale/uk/BOINC-Web.mo and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/locale/uk/BOINC-Web.mo differ diff -Nru boinc-7.0.7+dfsg/locale/updatetrans.sh boinc-7.0.14+dfsg/locale/updatetrans.sh --- boinc-7.0.7+dfsg/locale/updatetrans.sh 2010-10-21 14:55:01.000000000 +0000 +++ boinc-7.0.14+dfsg/locale/updatetrans.sh 2011-12-16 00:55:04.000000000 +0000 @@ -39,6 +39,19 @@ done +# Iterrate through the various PO files looking for those that need to be added to SVN. +# +for file in `find -name 'BOINC-Web.po'` ; do + dir=`dirname $file` + locale=`basename $dir` + template_name=${projdir}/${locale}/BOINC-Web + + # Add any missing PO files to SVN + svn add ${template_name}.po > /dev/null 2> /dev/null + svn propset svn:mime-type 'text/plain;charset=UTF-8' ${template_name}.po > /dev/null 2> /dev/null +done + + # Iterrate through the various PO files looking for those that need to be compiled. # for file in `find -name 'BOINC-Manager.po'` ; do @@ -87,6 +100,30 @@ done +# Iterrate through the various PO files looking for those that need to be compiled. +# +for file in `find -name 'BOINC-Web.po'` ; do + dir=`dirname $file` + locale=`basename $dir` + template_name=${projdir}/${locale}/BOINC-Web + + if test ${template_name}.po -nt ${template_name}.mo + then + + # Compile the PO file into an MO file. + pocompile ${template_name}.po ${template_name}.mo > /dev/null 2> /dev/null + + # Add any new MO files to SVN + svn add ${template_name}.mo > /dev/null 2> /dev/null + + # Touch each file to adjust timestamps + touch ${template_name}.po + touch ${template_name}.mo + + fi +done + + # Determine if we need to update the various languages using the templates. # This will be done by the use of a tag file which should have a matching # timestamp as the template files. If the timestamps do not match update all Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/locale/zh_CN/BOINC-Web.mo and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/locale/zh_CN/BOINC-Web.mo differ Binary files /tmp/iJY7GkV030/boinc-7.0.7+dfsg/locale/zh_TW/BOINC-Web.mo and /tmp/9iS1KlyrUc/boinc-7.0.14+dfsg/locale/zh_TW/BOINC-Web.mo differ diff -Nru boinc-7.0.7+dfsg/Makefile.am boinc-7.0.14+dfsg/Makefile.am --- boinc-7.0.7+dfsg/Makefile.am 2011-10-13 21:59:40.000000000 +0000 +++ boinc-7.0.14+dfsg/Makefile.am 2012-01-14 05:48:01.000000000 +0000 @@ -1,5 +1,5 @@ ## -*- mode: makefile; tab-width: 4 -*- -## $Id: Makefile.am 24395 2011-10-13 21:59:40Z romw $ +## $Id: Makefile.am 25056 2012-01-14 05:48:01Z davea $ AUTOMAKE_OPTIONS = foreign @@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I m4 if ENABLE_LIBRARIES - API_SUBDIRS = api lib + API_SUBDIRS = api lib zip endif if ENABLE_SERVER diff -Nru boinc-7.0.7+dfsg/py/Boinc/setup_project.py boinc-7.0.14+dfsg/py/Boinc/setup_project.py --- boinc-7.0.7+dfsg/py/Boinc/setup_project.py 2011-10-21 06:58:35.000000000 +0000 +++ boinc-7.0.14+dfsg/py/Boinc/setup_project.py 2011-12-24 05:07:20.000000000 +0000 @@ -1,4 +1,4 @@ -## $Id: setup_project.py 24447 2011-10-21 06:58:35Z davea $ +## $Id: setup_project.py 24884 2011-12-24 05:07:20Z davea $ # module for setting up a new project (either a real project or a test project # see tools/makeproject, test/testbase.py). @@ -379,7 +379,7 @@ 'single_job_assimilator', 'assimilator.py', 'pymw_assimilator.py', 'update_stats', 'db_dump', 'db_purge', 'show_shmem', 'census', - 'delete_file', 'request_file_list', 'get_file', 'put_file' ]) + 'delete_file', 'get_file', 'put_file' ]) map(lambda (s): install(srcdir('tools',s), dir('bin',s)), [ 'appmgr', 'create_work', 'xadd', 'dbcheck_files_exist', 'run_in_ops', 'update_versions', 'parse_config', 'grep_logs', 'db_query', diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/floppyio.cpp boinc-7.0.14+dfsg/samples/vboxwrapper/floppyio.cpp --- boinc-7.0.7+dfsg/samples/vboxwrapper/floppyio.cpp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/floppyio.cpp 2012-01-11 23:21:17.000000000 +0000 @@ -0,0 +1,371 @@ +// This file is part Floppy I/O, a Virtual Machine - Hypervisor intercommunication system. +// Copyright (C) 2011 Ioannis Charalampidis +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program 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 +// along with this program. If not, see . + +// File: FloppyIO.cpp +// Author: Ioannis Charalampidis +// License: GNU Lesser General Public License - Version 3.0 +// +// Hypervisor-Virtual machine bi-directional communication +// through floppy disk. +// +// This class provides the hypervisor-side of the script. +// For the guest-side, check the perl scripts that +// were available with this code. +// +// Here is the layout of the floppy disk image (Example of 28k): +// +// +-----------------+------------------------------------------------+ +// | 0x0000 - 0x37FF | Hypervisor -> Guest Buffer | +// | 0x3800 - 0x6FFE | Guest -> Hypervisor Buffer | +// | 0x6FFF | "Data available for guest" flag byte | +// | 0x7000 | "Data available for hypervisor" flag byte | +// +-----------------+------------------------------------------------+ +// +// Updated at January 5, 2012, 13:06 PM + +#ifdef _WIN32 +#include "boinc_win.h" +#else +#include +#include +#include +#include +#include +#include +#endif + +#include "util.h" +#include "floppyio.h" + +using namespace std; + +// FloppyIO Exception singleton +static FloppyIOException __FloppyIOExceptionSingleton; + +// Advanced Floppy file constructor +// +// This constructor allows you to open a floppy disk image with extra flags. +// +// F_NOINIT Disables the reseting of the image file at open +// F_NOCREATE Does not truncate the file at open (If not exists, the file will be created) +// F_SYNCHRONIZED The communication is synchronized, meaning that the code will block until the +// data are read/written from the guest. +// F_EXCEPTIONS Throw exceptions if something goes wrong. +// F_CLIENT Swap in/out buffers for use from within the guest. +// +// @param filename The filename of the floppy disk image +// @param flags The flags that define how the FloppyIO class should function +// + +FloppyIO::FloppyIO(const char * filename, int flags) { + // Clear error flag + this->error = 0; + + // Prepare open flags and create file stream + ios_base::openmode fOpenFlags = fstream::in | fstream::out; + if ((flags & F_NOCREATE) == 0) fOpenFlags |= fstream::trunc; + this->fIO = new fstream( ); + + // Enable exceptions on fIO if told so + if ((flags & F_EXCEPTIONS) != 0) { + fIO->exceptions( ifstream::failbit | ifstream::badbit ); + this->useExceptions=true; + } else { + this->useExceptions=false; + } + + // Try to open the file + fIO->open(filename, fOpenFlags); + + // Check for errors while F_NOCREATE is there + if ((flags & F_NOCREATE) != 0) { + if ( fIO->fail() ) { + + // Clear error flags + fIO->clear(); + + // Try to create file + fOpenFlags |= fstream::trunc; + fIO->open(filename, fOpenFlags); + + // Still errors? + if ( fIO->fail() ) { + this->setError(-3, "Error while creating floppy I/O file, because it wasn't found even though F_NOCREATE was specified!"); + return; + } + + // Managed to open it? Reset it... + flags &= ~F_NOINIT; + } + + } else { + + // Check for failures on open + if ( fIO->fail() ) { + this->setError(-3, "Error while creating floppy I/O file!"); + return; + } + + } + + // Prepare floppy info + this->szFloppy = DEFAULT_FIO_FLOPPY_SIZE; + + // Setup offsets and sizes of the I/O parts + if ((flags & F_CLIENT) != 0) { + // Guest mode + this->szOutput = this->szFloppy/2-1; + this->szInput = this->szOutput; + this->ofsOutput = this->szInput; + this->ofsInput = 0; + this->ofsCtrlByteIn = this->szInput+this->szOutput; + this->ofsCtrlByteOut = this->szInput+this->szOutput+1; + + } else { + // Hypervisor mode + this->szOutput = this->szFloppy/2-1; + this->szInput = this->szOutput; + this->ofsOutput = 0; + this->ofsInput = this->szOutput; + this->ofsCtrlByteOut = this->szInput+this->szOutput; + this->ofsCtrlByteIn = this->szInput+this->szOutput+1; + } + + // Update synchronization flags + this->synchronized = false; + this->syncTimeout = DEFAULT_FIO_SYNC_TIMEOUT; + if ((flags & F_SYNCHRONIZED) != 0) this->synchronized=true; + + // Reset floppy file + if ((flags & F_NOINIT) == 0) this->reset(); + +} + + +// FloppyIO Destructor +// Closes the file descriptor and releases used memory + +FloppyIO::~FloppyIO() { + // Close file + this->fIO->close(); + + // Release memory + delete this->fIO; +} + +// Reset the floppy disk image +// This function zeroes-out the contents of the FD image + +void FloppyIO::reset() { + // Check for ready state + if (!this->ready()) { + this->setError(-4, "Stream is not ready!"); + return; + } + + // Reset to the beginnig of file and fill with zeroes + this->fIO->seekp(0); + char * buffer = new char[this->szFloppy]; + memset(buffer, 0, this->szFloppy); + this->fIO->write(buffer, this->szFloppy); + delete[] buffer; +} + + +// Send data to the floppy image I/O +// +// @param strData The string to send +// @return The number of bytes sent if successful or -1 if an error occured. +// +int FloppyIO::send(string strData) { + // Prepare send buffer + char * dataToSend = new char[this->szOutput]; + memset(dataToSend, 0, this->szOutput); + + // Check for ready state + if (!this->ready()) return this->setError(-4, "Stream is not ready!"); + + // Initialize variables + int szData = (int)strData.length(); + int bytesSent = szData; + + // Copy the first szInput bytes + if (szData > this->szOutput-1) { // -1 for the null-termination + // Data more than the pad size? Trim... + strData.copy(dataToSend, this->szOutput-1, 0); + bytesSent = this->szOutput-1; + } else { + // Else, copy the string to send buffer + strData.copy(dataToSend, szData, 0); + } + + // Check for stream status + if (!this->fIO->good()) return this->setError(-1, "I/O Stream reported no-good state while sending!"); + + // Write the data to file + this->fIO->seekp(this->ofsOutput); + this->fIO->write(dataToSend, this->szOutput); + + // Check if something went wrong after writing + if (!this->fIO->good()) return this->setError(-1, "I/O Stream reported no-good state while sending!"); + + // Notify the client that we placed data (Client should clear this on read) + this->fIO->seekp(this->ofsCtrlByteOut); + this->fIO->write("\x01", 1); + this->fIO->flush(); + + // If synchronized, wait for data to be written + if (this->synchronized) { + // Wait for input control byte to become 1 + int iState = this->waitForSync(this->ofsCtrlByteOut, 0, this->syncTimeout); + if (iState<0) return iState; + } + + // Return number of bytes sent + return bytesSent; + +} + +// +// Receive the input buffer contents +// +// @return Returns a string object with the buffer contents +// +string FloppyIO::receive() { + static string ansBuffer; + this->receive(&ansBuffer); + return ansBuffer; +} + +// +// Receive the input buffer contents +// +// @param string A pointer to a string object that will receive the data +// @return Returns the length of the data received or -1 if an error occured. +// +int FloppyIO::receive(string * ansBuffer) { + char * dataToReceive = new char[this->szInput]; + + // Check for ready state + if (!this->ready()) return this->setError(-4, "Stream is not ready!"); + + // If synchronized, wait for input data + if (this->synchronized) { + // Wait for input control byte to become 1 + int iState = this->waitForSync(this->ofsCtrlByteIn, 1, this->syncTimeout); + if (iState<0) return iState; + } + + // Check for stream status + if (!this->fIO->good()) return this->setError(-1, "I/O Stream reported no-good state while receiving!"); + + // Read the input bytes from FD + this->fIO->seekg(this->ofsInput, ios_base::beg); + this->fIO->read(dataToReceive, this->szInput); + + // Notify the client that we have read the data + this->fIO->seekp(this->ofsCtrlByteIn); + this->fIO->write("\x00", 1); + this->fIO->flush(); + + // Copy input data to string object + *ansBuffer = dataToReceive; + return (int)ansBuffer->length(); + +} + +// Wait for synchronization byte to be cleared. +// This function blocks until the byte at controlByteOffset has +// the synchronization bit cleared. +// +// @param controlByteOffset The offset (from the beginning of file) where to look for the control byte +// @param state The state the controlByte must be for this function to exit. +// @param timeout The time (in seconds) to wait for a change. 0 Will wait forever +// @return Returns 0 if everything succeeded, -1 if an error occured, -2 if timed out. + +int FloppyIO::waitForSync(int controlByteOffset, char state, int timeout) { + time_t tExpired = time (NULL) + timeout; + char cStatusByte; + + // Wait until expired or forever. + while ((timeout == 0) || ( time(NULL) <= tExpired)) { + + // Check for stream status + if (!this->fIO->good()) return this->setError(-1, "I/O Stream reported no-good state while waiting for sync!"); + + // Check the synchronization byte + this->fIO->seekg(controlByteOffset, ios_base::beg); + this->fIO->read(&cStatusByte, 1); + + // Is the control byte 0? Our job is finished... + if (cStatusByte == state) return 0; + + // Sleep for a few milliseconds to decrease CPU-load + boinc_sleep(0.250); + } + + // If we reached this point, we timed out + return this->setError(-2, "Timed-out while waiting for sync!"); + +} + +// +// Set last error. +// This is a short-hand function to update the error variables. +// +// @param code The error code +// @param message The error message +// @return The error code +// +int FloppyIO::setError(int code, const string message) { + this->error = code; + + // Chain errors + if (this->errorStr.empty()) { + this->errorStr = message; + } else { + this->errorStr = message + " (" + this->errorStr + ")"; + } + + // Should we raise an exception? + if (this->useExceptions) + throw *__FloppyIOExceptionSingleton.set(code, message); + + // Otherwise return code + // (Useful for using single-lined: return this->setError(-1, "message..'); + return code; +} + +// +// Clear error state flags +// +void FloppyIO::clear() { + this->error = 0; + this->errorStr = ""; + this->fIO->clear(); +} + +// +// Check if everything is in ready state +// @return Returns true if there are no errors and stream hasn't failed +// +bool FloppyIO::ready() { + if (this->error!=0) return false; + return this->fIO->good(); +} + + + diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/floppyio.h boinc-7.0.14+dfsg/samples/vboxwrapper/floppyio.h --- boinc-7.0.7+dfsg/samples/vboxwrapper/floppyio.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/floppyio.h 2012-01-11 23:21:17.000000000 +0000 @@ -0,0 +1,185 @@ +// This file is part Floppy I/O, a Virtual Machine - Hypervisor intercommunication system. +// Copyright (C) 2011 Ioannis Charalampidis +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program 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 +// along with this program. If not, see . + +// File: FloppyIO.h +// Author: Ioannis Charalampidis +// License: GNU Lesser General Public License - Version 3.0 +// +// Hypervisor-Virtual machine bi-directional communication +// through floppy disk. +// +// This class provides the hypervisor-side of the script. +// For the guest-side, check the perl scripts that +// were available with this code. +// +// Here is the layout of the floppy disk image (Example of 28k): +// +// +-----------------+------------------------------------------------+ +// | 0x0000 - 0x37FF | Hypervisor -> Guest Buffer | +// | 0x3800 - 0x6FFE | Guest -> Hypervisor Buffer | +// | 0x6FFF | "Data available for guest" flag byte | +// | 0x7000 | "Data available for hypervisor" flag byte | +// +-----------------+------------------------------------------------+ +// +// Updated at January 5, 2012, 13:06 PM +// + +#ifndef FLOPPYIO_H +#define FLOPPYIO_H + +// Do not initialize (reset) floppy disk image at open. +// (Flag used by the FloppyIO constructor) +#define F_NOINIT 1 + +// Do not create the filename (assume it exists) +// (Flag used by the FloppyIO constructor) +#define F_NOCREATE 2 + +// Synchronize I/O. +// This flag will block the script until the guest has read/written the data. +// (Flag used by the FloppyIO constructor) +#define F_SYNCHRONIZED 4 + +// Use exceptions instead of error codes +// (Flag used by the FloppyIO constructor) +#define F_EXCEPTIONS 8 + +// Initialize FloppyIO in client mode. +// This flag will swap the input/output buffers, making the script usable from +// within the virtual machine. +// (Flag used by the FloppyIO constructor) +#define F_CLIENT 16 + +// +// Error code constants +// +#define FPIO_NOERR 0 // No error occured +#define FPIO_ERR_IO -1 // There was an I/O error on the strea, +#define FPIO_ERR_TIMEOUT -2 // The operation timed out +#define FPIO_ERR_CREATE -3 // Unable to freate the floppy file +#define FPIO_ERR_NOTREADY -4 // The I/O object is not ready + +// +// Structure of the synchronization control byte. +// +// This byte usually resides at the beginning of the +// floppy file for the receive buffer and at the end +// of the file for the sending buffer. +// +// It's purpose is to force the entire floppy image +// to be re-written/re-read by the hypervisor/guest OS and +// to synchronize the I/O in case of large ammount of +// data being exchanged. +// +typedef struct fpio_ctlbyte { + unsigned short bDataPresent : 1; + unsigned short bReserved : 7; +} fpio_ctlbytex; + +// Default floppy disk size (In bytes) +// +// VirtualBox complains if bigger than 28K +// It's supposed to go till 1474560 however (1.44 Mb) + +#define DEFAULT_FIO_FLOPPY_SIZE 28672 + +// Default synchronization timeout (seconds). +// This constant defines how long we should wait for synchronization +// feedback from the guest before aborting. + +#define DEFAULT_FIO_SYNC_TIMEOUT 5 + +// +// Floppy I/O Communication class +// +class FloppyIO { +public: + + // Construcors + FloppyIO(const char * filename, int flags = 0); + virtual ~FloppyIO(); + + // Functions + void reset(); + int send(std::string strData); + std::string receive(); + int receive(std::string* strBuffer); + + // Topology info + int ofsInput; // Input buffer offset & size + int szInput; + int ofsOutput; // Output buffer offset & size + int szOutput; + + int ofsCtrlByteIn; // Control byte offset for input + int ofsCtrlByteOut; // Control byte offset for output + + // Synchronization stuff + bool synchronized; // The read/writes are synchronized + int syncTimeout; // For how long should we wait + + // Error reporting and checking + int error; + std::string errorStr; + bool useExceptions; // If TRUE errors will raise exceptions + + void clear(); // Clear errors + bool ready(); // Returns TRUE if there are no errors + +private: + + // Floppy Info + std::fstream* fIO; + int szFloppy; + + // Functions + int waitForSync(int controlByteOffset, char state, int timeout); + int setError(int code, std::string message); + +}; + +// +// Floppy I/O Exceptions +// +class FloppyIOException: public std::exception { +public: + + int code; + std::string message; + + // Default constructor/destructor + FloppyIOException() { this->code=0; this->message=""; }; + virtual ~FloppyIOException() throw() { }; + + // Get description + virtual const char* what() const throw() { + static std::ostringstream oss (std::ostringstream::out); + oss << this->message << ". Error code = " << this->code; + return oss.str().c_str(); + } + + // Change the message and return my instance + // (Used for singleton format) + FloppyIOException * set(int _code, std::string _message) { + this->code = _code; + this->message = _message; + return this; + } + +}; + +#endif // FLOPPYIO_H + diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/Makefile boinc-7.0.14+dfsg/samples/vboxwrapper/Makefile --- boinc-7.0.7+dfsg/samples/vboxwrapper/Makefile 2011-08-03 22:36:29.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/Makefile 2011-12-22 14:31:02.000000000 +0000 @@ -27,8 +27,11 @@ distclean: /bin/rm -f $(PROGS) *.o libstdc++.a +floppyio.o: floppyio.cpp + g++ $(CXXFLAGS) -c floppyio.cpp + vbox.o: vbox.cpp g++ $(CXXFLAGS) -c vbox.cpp -vboxwrapper: vboxwrapper.o vbox.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a - g++ $(CXXFLAGS) -o vboxwrapper vboxwrapper.o vbox.o libstdc++.a -pthread -lboinc_api -lboinc +vboxwrapper: vboxwrapper.o vbox.o floppyio.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a + g++ $(CXXFLAGS) -o vboxwrapper vboxwrapper.o vbox.o floppyio.o libstdc++.a -pthread -lboinc_api -lboinc diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/vbox.cpp boinc-7.0.14+dfsg/samples/vboxwrapper/vbox.cpp --- boinc-7.0.7+dfsg/samples/vboxwrapper/vbox.cpp 2011-11-03 02:35:04.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/vbox.cpp 2012-01-24 23:36:10.000000000 +0000 @@ -1,938 +1,1571 @@ -// This file is part of BOINC. -// http://boinc.berkeley.edu -// Copyright (C) 2010 University of California -// -// BOINC is free software; you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License -// as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// BOINC 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 -// along with BOINC. If not, see . - -#ifdef _WIN32 -#include "boinc_win.h" -#include "win_util.h" -#else -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -using std::string; - -#if defined(_MSC_VER) -#define getcwd _getcwd -#endif - -#include "diagnostics.h" -#include "filesys.h" -#include "parse.h" -#include "str_util.h" -#include "str_replace.h" -#include "util.h" -#include "error_numbers.h" -#include "procinfo.h" -#include "boinc_api.h" -#include "vbox.h" - -VBOX_VM::VBOX_VM() { - os_name.clear(); - memory_size_mb.clear(); - image_filename.clear(); - suspended = false; - network_suspended = false; - enable_network = false; - enable_shared_directory = false; - register_only = false; -} - -int VBOX_VM::run() { - int retval; - - retval = initialize(); - if (retval) return retval; - - if (!is_registered()) { - if (is_hdd_registered()) { - // Handle the case where a previous instance of the same projects VM - // was already initialized for the current slot directory but aborted - // while the task was suspended and unloaded from memory. - retval = deregister_stale_vm(); - if (retval) return retval; - } - retval = register_vm(); - if (retval) return retval; - } - - // The user has requested that we exit after registering the VM, so return an - // error to stop further processing. - if (register_only) return ERR_FOPEN; - - retval = start(); - if (retval) return retval; - - // Give time enough for external processes to begin the VM boot process - boinc_sleep(1.0); - - return 0; -} - -void VBOX_VM::poll() { - return; -} - -void VBOX_VM::cleanup() { - stop(); - deregister_vm(); - - // Give time enough for external processes to finish the cleanup process - boinc_sleep(5.0); -} - -// Execute the vbox manage application and copy the output to the buffer. -// -int VBOX_VM::vbm_popen(string& arguments, string& output, const char* item) { - char buf[256]; - string command; - int retval = 0; - - // Initialize command line - command = "VBoxManage -q " + arguments; - -#ifdef _WIN32 - - STARTUPINFO si; - PROCESS_INFORMATION pi; - SECURITY_ATTRIBUTES sa; - SECURITY_DESCRIPTOR sd; - HANDLE hReadPipe, hWritePipe; - void* pBuf; - DWORD dwCount; - unsigned long ulExitCode = 0; - - memset(&si, 0, sizeof(si)); - memset(&pi, 0, sizeof(pi)); - memset(&sa, 0, sizeof(sa)); - memset(&sd, 0, sizeof(sd)); - - InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION); - SetSecurityDescriptorDacl(&sd, true, NULL, false); - - sa.nLength = sizeof(SECURITY_ATTRIBUTES); - sa.bInheritHandle = TRUE; - sa.lpSecurityDescriptor = &sd; - - if (!CreatePipe(&hReadPipe, &hWritePipe, &sa, NULL)) { - fprintf( - stderr, - "%s CreatePipe failed! (%d).\n", - boinc_msg_prefix(buf, sizeof(buf)), - GetLastError() - ); - goto CLEANUP; - } - SetHandleInformation(hReadPipe, HANDLE_FLAG_INHERIT, 0); - - si.cb = sizeof(STARTUPINFO); - si.dwFlags |= STARTF_FORCEOFFFEEDBACK | STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; - si.wShowWindow = SW_HIDE; - si.hStdOutput = hWritePipe; - si.hStdError = hWritePipe; - si.hStdInput = NULL; - - // Execute command - if (!CreateProcess(NULL, (LPTSTR)command.c_str(), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) { - fprintf( - stderr, - "%s CreateProcess failed! (%d).\n", - boinc_msg_prefix(buf, sizeof(buf)), - GetLastError() - ); - goto CLEANUP; - } - - // Wait until process has completed - while(1) { - GetExitCodeProcess(pi.hProcess, &ulExitCode); - - // Copy stdout/stderr to output buffer, handle in the loop so that we can - // copy the pipe as it is populated and prevent the child process from blocking - // in case the output is bigger than pipe buffer. - PeekNamedPipe(hReadPipe, NULL, NULL, NULL, &dwCount, NULL); - if (dwCount) { - pBuf = malloc(dwCount+1); - memset(pBuf, 0, dwCount+1); - - if (ReadFile(hReadPipe, pBuf, dwCount, &dwCount, NULL)) { - output += (char*)pBuf; - } - - free(pBuf); - } - - if (ulExitCode != STILL_ACTIVE) break; - Sleep(100); - } - -CLEANUP: - if (pi.hThread) CloseHandle(pi.hThread); - if (pi.hProcess) CloseHandle(pi.hProcess); - if (hReadPipe) CloseHandle(hReadPipe); - if (hWritePipe) CloseHandle(hWritePipe); - - if ((ulExitCode != 0) || (!pi.hProcess)) { - retval = ERR_FOPEN; - } -#else - - FILE* fp; - - // redirect stderr to stdout for the child process so we can trap it with popen. - string modified_command = command + " 2>&1"; - - // Execute command - fp = popen(modified_command.c_str(), "r"); - if (fp == NULL){ - fprintf( - stderr, - "%s vbm_popen popen failed! errno = %d\n", - boinc_msg_prefix(buf, sizeof(buf)), - errno - ); - retval = ERR_FOPEN; - } else { - // Copy output to buffer - while (fgets(buf, 256, fp)) { - output += buf; - } - - // Close stream - pclose(fp); - retval = 0; - } - -#endif - if (retval) { - fprintf( - stderr, - "%s Error in %s for VM: %d\nCommand:\n%s\nOutput:\n%s\n", - boinc_msg_prefix(buf, sizeof(buf)), - item, - retval, - command.c_str(), - output.c_str() - ); - } - return retval; -} - -// Returns the current directory in which the executable resides. -// -int VBOX_VM::get_slot_directory( string& dir ) { - char slot_dir[256]; - - getcwd(slot_dir, sizeof(slot_dir)); - dir = slot_dir; - - if (!dir.empty()) { - return 1; - } - return 0; -} - -bool VBOX_VM::is_registered() { - string command; - string output; - - command = "showvminfo \"" + vm_name + "\" "; - command += "--machinereadable "; - - if (vbm_popen(command, output, "registration") == 0) { - if (output.find("VBOX_E_OBJECT_NOT_FOUND") == string::npos) { - // Error message not found in text - return true; - } - } - return false; -} - -bool VBOX_VM::is_hdd_registered() { - string command; - string output; - string virtual_machine_root_dir; - - get_slot_directory(virtual_machine_root_dir); - - command = "showhdinfo \"" + virtual_machine_root_dir + "/" + image_filename + "\" "; - - if (vbm_popen(command, output, "hdd registration") == 0) { - if ((output.find("VBOX_E_FILE_ERROR") == string::npos) && (output.find("VBOX_E_OBJECT_NOT_FOUND") == string::npos)) { - // Error message not found in text - return true; - } - } - return false; -} - -bool VBOX_VM::is_running() { - string command; - string output; - string vmstate; - size_t vmstate_start; - size_t vmstate_end; - - command = "showvminfo \"" + vm_name + "\" "; - command += "--machinereadable "; - - if (vbm_popen(command, output, "VM state") == 0) { - vmstate_start = output.find("VMState=\""); - if (vmstate_start != string::npos) { - vmstate_start += 9; - vmstate_end = output.find("\"", vmstate_start); - vmstate = output.substr(vmstate_start, vmstate_end - vmstate_start); - - // VirtualBox Documentation suggests that that a VM is running when its - // machine state is between MachineState_FirstOnline and MachineState_LastOnline - // which as of this writing is 5 and 17. - // - // VboxManage's source shows more than that though: - // see: http://www.virtualbox.org/browser/trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp - // - // So for now, go with what VboxManage is reporting. - // - if (vmstate == "running") return true; - if (vmstate == "paused") return true; - if (vmstate == "gurumeditation") return true; - if (vmstate == "livesnapshotting") return true; - if (vmstate == "teleporting") return true; - if (vmstate == "starting") return true; - if (vmstate == "stopping") return true; - if (vmstate == "saving") return true; - if (vmstate == "restoring") return true; - if (vmstate == "teleportingpausedvm") return true; - if (vmstate == "teleportingin") return true; - if (vmstate == "restoringsnapshot") return true; - if (vmstate == "deletingsnapshot") return true; - if (vmstate == "deletingsnapshotlive") return true; - } - } - return false; -} - -int VBOX_VM::get_install_directory(string& virtualbox_install_directory ) { -#ifdef _WIN32 - LONG lReturnValue; - HKEY hkSetupHive; - LPTSTR lpszRegistryValue = NULL; - DWORD dwSize = 0; - - // change the current directory to the boinc data directory if it exists - lReturnValue = RegOpenKeyEx( - HKEY_LOCAL_MACHINE, - _T("SOFTWARE\\Oracle\\VirtualBox"), - 0, - KEY_READ, - &hkSetupHive - ); - if (lReturnValue == ERROR_SUCCESS) { - // How large does our buffer need to be? - lReturnValue = RegQueryValueEx( - hkSetupHive, - _T("InstallDir"), - NULL, - NULL, - NULL, - &dwSize - ); - if (lReturnValue != ERROR_FILE_NOT_FOUND) { - // Allocate the buffer space. - lpszRegistryValue = (LPTSTR) malloc(dwSize); - (*lpszRegistryValue) = NULL; - - // Now get the data - lReturnValue = RegQueryValueEx( - hkSetupHive, - _T("InstallDir"), - NULL, - NULL, - (LPBYTE)lpszRegistryValue, - &dwSize - ); - - virtualbox_install_directory = lpszRegistryValue; - } - } - - if (hkSetupHive) RegCloseKey(hkSetupHive); - if (lpszRegistryValue) free(lpszRegistryValue); -#else - virtualbox_install_directory = ""; -#endif - return 0; -} - -int VBOX_VM::initialize() { - string virtualbox_install_directory; - string old_path; - string new_path; - string virtualbox_user_home; - APP_INIT_DATA aid; - char buf[256]; - - boinc_get_init_data_p(&aid); - get_install_directory(virtualbox_install_directory); - - // Prep the environment so we can execute the vboxmanage application - // - // TODO: Fix for non-Windows environments if we ever find another platform - // where vboxmanage is not already in the search path -#ifdef _WIN32 - if (!virtualbox_install_directory.empty()) - { - old_path = getenv("PATH"); - new_path = virtualbox_install_directory + ";" + old_path; - - if (!SetEnvironmentVariable("PATH", const_cast(new_path.c_str()))) { - fprintf( - stderr, - "%s Failed to modify the search path.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - } - } -#endif - - // Set the location in which the VirtualBox Configuration files can be - // stored for this instance. - // - if (aid.using_sandbox) { - virtualbox_user_home = aid.project_dir; - virtualbox_user_home += "/../virtualbox"; - - if (!boinc_file_exists(virtualbox_user_home.c_str())) boinc_mkdir(virtualbox_user_home.c_str()); - -#ifdef _WIN32 - if (!SetEnvironmentVariable("VBOX_USER_HOME", const_cast(virtualbox_user_home.c_str()))) { - fprintf( - stderr, - "%s Failed to modify the search path.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - } -#else - // putenv does not copy its input buffer, so we must use setenv - if (setenv("VBOX_USER_HOME", const_cast(virtualbox_user_home.c_str()), 1)) { - fprintf( - stderr, - "%s Failed to modify the VBOX_USER_HOME path.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - } -#endif - } - - return 0; -} - -int VBOX_VM::register_vm() { - string command; - string output; - string virtual_machine_slot_directory; - char buf[256]; - int retval; - - get_slot_directory(virtual_machine_slot_directory); - - fprintf( - stderr, - "%s Registering virtual machine. (%s) \n", - boinc_msg_prefix(buf, sizeof(buf)), - vm_name.c_str() - ); - - - // Create and register the VM - // - fprintf( - stderr, - "%s Registering virtual machine with VirtualBox.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "createvm "; - command += "--name \"" + vm_name + "\" "; - command += "--basefolder \"" + virtual_machine_slot_directory + "\" "; - command += "--ostype \"" + os_name + "\" "; - command += "--register"; - - retval = vbm_popen(command, output, "register"); - if (retval) return retval; - - // Tweak the VM from it's default configuration - // - fprintf( - stderr, - "%s Modifying virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "modifyvm \"" + vm_name + "\" "; - command += "--memory " + memory_size_mb + " "; - command += "--acpi on "; - command += "--ioapic on "; - command += "--boot1 disk "; - command += "--boot2 none "; - command += "--boot3 none "; - command += "--boot4 none "; - command += "--nic1 nat "; - command += "--natdnsproxy1 on "; - command += "--cableconnected1 off "; - - retval = vbm_popen(command, output, "modify"); - if (retval) return retval; - - // Add storage controller to VM - // - fprintf( - stderr, - "%s Adding storage controller to virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "storagectl \"" + vm_name + "\" "; - command += "--name \"IDE Controller\" "; - command += "--add ide "; - command += "--controller PIIX4 "; - - retval = vbm_popen(command, output, "add storage controller"); - if (retval) return retval; - - // Adding virtual hard drive to VM - // - fprintf( - stderr, - "%s Adding virtual disk drive to virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "storageattach \"" + vm_name + "\" "; - command += "--storagectl \"IDE Controller\" "; - command += "--port 0 "; - command += "--device 0 "; - command += "--type hdd "; - command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; - - retval = vbm_popen(command, output, "storage attach"); - if (retval) return retval; - - // Enable the network adapter if a network connection is required. - // - if (enable_network) { - set_network_access(true); - } - - // Enable the shared folder if a shared folder is specified. - // - if (enable_shared_directory) { - fprintf( - stderr, - "%s Enabling shared directory for virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "sharedfolder add \"" + vm_name + "\" "; - command += "--name \"shared\" "; - command += "--hostpath \"" + virtual_machine_slot_directory + "/shared\""; - - retval = vbm_popen(command, output, "enable shared dir"); - if (retval) return retval; - } - return 0; -} - -int VBOX_VM::deregister_vm() { - string command; - string output; - string virtual_machine_slot_directory; - char buf[256]; - int retval; - - get_slot_directory(virtual_machine_slot_directory); - - fprintf( - stderr, - "%s Deregistering virtual machine. (%s)\n", - boinc_msg_prefix(buf, sizeof(buf)), - vm_name.c_str() - ); - - - // First step in deregistering a VM is to delete its storage controller - // - fprintf( - stderr, - "%s Removing storage controller from virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "storagectl \"" + vm_name + "\" "; - command += "--name \"IDE Controller\" "; - command += "--remove "; - - retval = vbm_popen(command, output, "deregister"); - if (retval) return retval; - - // Next delete VM - // - fprintf( - stderr, - "%s Removing virtual machine from VirtualBox.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "unregistervm \"" + vm_name + "\" "; - command += "--delete "; - - retval = vbm_popen(command, output, "delete VM"); - if (retval) return retval; - - // Lastly delete medium from Virtual Box Media Registry - // - fprintf( - stderr, - "%s Removing virtual disk drive from VirtualBox.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "closemedium disk \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; - - retval = vbm_popen(command, output, "remove virtual disk"); - if (retval) return retval; - return 0; -} - -int VBOX_VM::deregister_stale_vm() { - string command; - string output; - string virtual_machine_slot_directory; - size_t uuid_start; - size_t uuid_end; - int retval; - - get_slot_directory(virtual_machine_slot_directory); - - // We need to determine what the name or uuid is of the previous VM which owns - // this virtual disk - // - command = "showhdinfo \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; - - retval = vbm_popen(command, output, "get HDD info"); - if (retval) return retval; - - // Output should look a little like this: - // UUID: c119acaf-636c-41f6-86c9-38e639a31339 - // Accessible: yes - // Logical size: 10240 MBytes - // Current size on disk: 0 MBytes - // Type: normal (base) - // Storage format: VDI - // Format variant: dynamic default - // In use by VMs: test2 (UUID: 000ab2be-1254-4c6a-9fdc-1536a478f601) - // Location: C:\Users\romw\VirtualBox VMs\test2\test2.vdi - // - uuid_start = output.find("(UUID: "); - if (uuid_start != string::npos) { - // We can parse the virtual machine ID from the output - uuid_start += 7; - uuid_end = output.find(")", uuid_start); - vm_name = output.substr(uuid_start, uuid_end - uuid_start); - - // Deregister stale VM by UUID - return deregister_vm(); - } else { - // Did the user delete the VM in VirtualBox and not the medium? If so, - // just remove the medium. - command = "closemedium disk \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; - retval = vbm_popen(command, output, "remove medium"); - } - return 0; -} - -int VBOX_VM::start() { - string command; - string output; - char buf[256]; - int retval; - - fprintf( - stderr, - "%s Starting virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "startvm \"" + vm_name + "\" --type headless"; - retval = vbm_popen(command, output, "start VM"); - if (retval) return retval; - return 0; -} - -int VBOX_VM::stop() { - string command; - string output; - char buf[256]; - int retval; - - fprintf( - stderr, - "%s Stopping virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - if (is_running()) { - command = "controlvm \"" + vm_name + "\" savestate"; - retval = vbm_popen(command, output, "stop VM"); - if (retval) return retval; - } else { - fprintf( - stderr, - "%s Virtual machine is already in a stopped state.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - } - return 0; -} - -int VBOX_VM::pause() { - string command; - string output; - int retval; - - command = "controlvm \"" + vm_name + "\" pause"; - retval = vbm_popen(command, output, "pause VM"); - if (retval) return retval; - suspended = true; - return 0; -} - -int VBOX_VM::resume() { - string command; - string output; - int retval; - - command = "controlvm \"" + vm_name + "\" resume"; - retval = vbm_popen(command, output, "resume VM"); - if (retval) return retval; - suspended = false; - return 0; -} - -// Enable the network adapter if a network connection is required. -// NOTE: Network access should never be allowed if the code running in a -// shared directory or the VM itself is NOT signed. Doing so opens up -// the network behind the firewall to attack. -// -int VBOX_VM::set_network_access(bool enabled) { - string command; - string output; - char buf[256]; - int retval; - - network_suspended = !enabled; - - if (enabled) { - fprintf( - stderr, - "%s Enabling network access for virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "modifyvm \"" + vm_name + "\" "; - command += "--cableconnected1 on "; - - retval = vbm_popen(command, output, "enable network"); - if (retval) return retval; - } else { - fprintf( - stderr, - "%s Disabling network access for virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - command = "modifyvm \"" + vm_name + "\" "; - command += "--cableconnected1 off "; - - retval = vbm_popen(command, output, "disable network"); - if (retval) return retval; - } - return 0; -} - -int VBOX_VM::set_cpu_usage_fraction(double x) { - string command; - string output; - char buf[256]; - int retval; - - // the arg to modifyvm is percentage - // - fprintf( - stderr, - "%s Setting cpu throttle for virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - sprintf(buf, "%d", (int)(x*100.)); - command = "modifyvm \"" + vm_name + "\" "; - command += "--cpuexecutioncap "; - command += buf; - command += " "; - - retval = vbm_popen(command, output, "CPU throttle"); - if (retval) return retval; - return 0; -} - -int VBOX_VM::set_network_max_bytes_sec(double x) { - string command; - string output; - char buf[256]; - int retval; - - - // the argument to modifyvm is in Kbps - // - fprintf( - stderr, - "%s Setting network throttle for virtual machine.\n", - boinc_msg_prefix(buf, sizeof(buf)) - ); - sprintf(buf, "%d", (int)(x*8./1000.)); - command = "modifyvm \"" + vm_name + "\" "; - command += "--nicspeed1 "; - command += buf; - command += " "; - - retval = vbm_popen(command, output, "network throttle"); - if (retval) return retval; - return 0; -} - -int VBOX_VM::get_process_id(int& process_id) { - string command; - string output; - string pid; - size_t pid_start; - size_t pid_end; - char buf[256]; - int retval; - - command = "showvminfo \"" + vm_name + "\" "; - command += "--log 0 "; - - retval = vbm_popen(command, output, "get process ID"); - if (retval) return retval; - - // Output should look like this: - // VirtualBox 4.1.0 r73009 win.amd64 (Jul 19 2011 13:05:53) release log - // 00:00:06.008 Log opened 2011-09-01T23:00:59.829170900Z - // 00:00:06.008 OS Product: Windows 7 - // 00:00:06.009 OS Release: 6.1.7601 - // 00:00:06.009 OS Service Pack: 1 - // 00:00:06.015 Host RAM: 4094MB RAM, available: 876MB - // 00:00:06.015 Executable: C:\Program Files\Oracle\VirtualBox\VirtualBox.exe - // 00:00:06.015 Process ID: 6128 - // 00:00:06.015 Package type: WINDOWS_64BITS_GENERIC - // 00:00:06.015 Installed Extension Packs: - // 00:00:06.015 None installed! - // - pid_start = output.find("Process ID: "); - if (pid_start == string::npos) { - fprintf(stderr, "%s couldn't find 'Process ID: ' in %s\n", boinc_msg_prefix(buf, sizeof(buf)), output.c_str()); - return ERR_NOT_FOUND; - } - pid_start += 12; - pid_end = output.find("\n", pid_start); - pid = output.substr(pid_start, pid_end - pid_start); - if (pid.size() <= 0) { - fprintf(stderr, "%s no PID: location %d length %d\n", - boinc_msg_prefix(buf, sizeof(buf)), (int)pid_start, (int)(pid_end - pid_start) - ); - return ERR_NOT_FOUND; - } - process_id = atol(pid.c_str()); - if (process_id) { - fprintf(stderr, "%s Virtual Machine PID %d Detected\n", - boinc_msg_prefix(buf, sizeof(buf)), process_id - ); - } - return 0; -} - -int VBOX_VM::get_network_bytes_received(double& received) { - string command; - string output; - string counter_value; - size_t counter_start; - size_t counter_end; - int retval; - - command = "debugvm \"" + vm_name + "\" "; - command += "statistics --pattern \"/Devices/*/ReceiveBytes\" "; - - retval = vbm_popen(command, output, "get bytes received"); - if (retval) return retval; - - // Output should look like this: - // - // - // - // - // - - // add up the counter(s) - // - received = 0; - counter_start = output.find("c=\""); - while (counter_start != string::npos) { - counter_start += 3; - counter_end = output.find("\"", counter_start); - counter_value = output.substr(counter_start, counter_end - counter_start); - received += atof(counter_value.c_str()); - counter_start = output.find("\n", counter_start); - } - - return 0; -} - -int VBOX_VM::get_network_bytes_sent(double& sent) { - string command; - string output; - string counter_value; - size_t counter_start; - size_t counter_end; - int retval; - - command = "debugvm \"" + vm_name + "\" "; - command += "statistics --pattern \"/Devices/*/TransmitBytes\" "; - - retval = vbm_popen(command, output, "get bytes sent"); - if (retval) return retval; - - // Output should look like this: - // - // - // - // - // - - // add up the counter(s) - // - sent = 0; - counter_start = output.find("c=\""); - while (counter_start != string::npos) { - counter_start += 3; - counter_end = output.find("\"", counter_start); - counter_value = output.substr(counter_start, counter_end - counter_start); - sent += atof(counter_value.c_str()); - counter_start = output.find("\n", counter_start); - } - return 0; -} +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2010-2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + +#ifdef _WIN32 +#include "boinc_win.h" +#include "win_util.h" +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +using std::string; + +#if defined(_MSC_VER) +#define getcwd _getcwd +#endif + +#include "diagnostics.h" +#include "filesys.h" +#include "parse.h" +#include "str_util.h" +#include "str_replace.h" +#include "util.h" +#include "error_numbers.h" +#include "procinfo.h" +#include "network.h" +#include "boinc_api.h" +#include "floppyio.h" +#include "vboxwrapper.h" +#include "vbox.h" + +VBOX_VM::VBOX_VM() { + pFloppy = NULL; + vm_master_name.clear(); + vm_name.clear(); + vm_cpu_count.clear(); + os_name.clear(); + memory_size_mb.clear(); + image_filename.clear(); + floppy_image_filename.clear(); + job_duration = 0.0; + suspended = false; + network_suspended = false; + online = false; + crashed = false; + enable_cern_dataformat = false; + enable_shared_directory = false; + enable_floppyio = false; + enable_remotedesktop = false; + register_only = false; + enable_network = false; + pf_guest_port = 0; + pf_host_port = 0; +#ifndef _WIN32 + vm_pid = 0; +#else + vm_pid_handle = 0; +#endif +} + +VBOX_VM::~VBOX_VM() { + if (pFloppy) { + delete pFloppy; + pFloppy = NULL; + } +#ifdef _WIN32 + if (vm_pid_handle) { + CloseHandle(vm_pid_handle); + vm_pid_handle = NULL; + } +#endif +} + +int VBOX_VM::initialize() { + string virtualbox_install_directory; + string old_path; + string new_path; + string virtualbox_user_home; + APP_INIT_DATA aid; + char buf[256]; + + boinc_get_init_data_p(&aid); + get_install_directory(virtualbox_install_directory); + + // Prep the environment so we can execute the vboxmanage application + // + // TODO: Fix for non-Windows environments if we ever find another platform + // where vboxmanage is not already in the search path +#ifdef _WIN32 + if (!virtualbox_install_directory.empty()) + { + old_path = getenv("PATH"); + new_path = virtualbox_install_directory + ";" + old_path; + + if (!SetEnvironmentVariable("PATH", const_cast(new_path.c_str()))) { + fprintf( + stderr, + "%s Failed to modify the search path.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } + } +#endif + + // Set the location in which the VirtualBox Configuration files can be + // stored for this instance. + // + if (aid.using_sandbox) { + virtualbox_user_home = aid.project_dir; + virtualbox_user_home += "/../virtualbox"; + + if (!boinc_file_exists(virtualbox_user_home.c_str())) boinc_mkdir(virtualbox_user_home.c_str()); + +#ifdef _WIN32 + if (!SetEnvironmentVariable("VBOX_USER_HOME", const_cast(virtualbox_user_home.c_str()))) { + fprintf( + stderr, + "%s Failed to modify the search path.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } + + // Launch VboxSVC.exe before going any further. if we don't, it'll be launched by + // svchost.exe with its environment block which will not contain the reference + // to VBOX_USER_HOME which is required for running in the BOINC account-based + // sandbox. + STARTUPINFO si; + PROCESS_INFORMATION pi; + string command; + + memset(&si, 0, sizeof(si)); + memset(&pi, 0, sizeof(pi)); + + si.cb = sizeof(STARTUPINFO); + si.dwFlags |= STARTF_FORCEOFFFEEDBACK | STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; + + command = "\"" + virtualbox_install_directory + "\\VBoxSVC.exe\" -Embedding"; + + if (!CreateProcess(NULL, (LPTSTR)command.c_str(), NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) { + fprintf( + stderr, + "%s Creating VBoxSVC.exe failed! (%d).\n", + boinc_msg_prefix(buf, sizeof(buf)), + GetLastError() + ); + } + + if (pi.hThread) CloseHandle(pi.hThread); + if (pi.hProcess) CloseHandle(pi.hProcess); +#else + // putenv does not copy its input buffer, so we must use setenv + if (setenv("VBOX_USER_HOME", const_cast(virtualbox_user_home.c_str()), 1)) { + fprintf( + stderr, + "%s Failed to modify the VBOX_USER_HOME path.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } +#endif + } + + return 0; +} + +int VBOX_VM::run() { + int retval; + + retval = initialize(); + if (retval) return retval; + + if (!is_registered()) { + if (is_hdd_registered()) { + // Handle the case where a previous instance of the same projects VM + // was already initialized for the current slot directory but aborted + // while the task was suspended and unloaded from memory. + retval = deregister_stale_vm(); + if (retval) return retval; + } + retval = register_vm(); + if (retval) return retval; + } + + // The user has requested that we exit after registering the VM, so return an + // error to stop further processing. + if (register_only) return ERR_FOPEN; + + // If we are restarting an already registered VM, then the vm_name variable + // will be empty right now, so populate it with the master name so all of the + // various other functions will work. + vm_name = vm_master_name; + + retval = start(); + if (retval) return retval; + + return 0; +} + +int VBOX_VM::start() { + string command; + string output; + double timeout; + char buf[256]; + int retval; + + fprintf( + stderr, + "%s Starting virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "startvm \"" + vm_name + "\" --type headless"; + retval = vbm_popen(command, output, "start VM"); + if (retval) return retval; + + // Wait for up to 5 minutes for the VM to switch states. A system + // under load can take a while. Since the poll function can wait for up + // to a minute to execute a command we need to make this time based instead + // of interation based. + timeout = dtime() + 300; + do { + poll(false); + if (online) break; + boinc_sleep(1.0); + } while (timeout >= dtime()); + + if (!online) { + fprintf( + stderr, + "%s VM did not start in a timely fashion, aborting job.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + return ERR_EXEC; + } + + return 0; +} + +int VBOX_VM::stop() { + string command; + string output; + double timeout; + char buf[256]; + int retval; + + fprintf( + stderr, + "%s Stopping virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + if (online) { + command = "controlvm \"" + vm_name + "\" savestate"; + retval = vbm_popen(command, output, "stop VM"); + if (retval) return retval; + + // Wait for up to 5 minutes for the VM to switch states. A system + // under load can take a while. Since the poll function can wait for up + // to a minute to execute a command we need to make this time based instead + // of interation based. + timeout = dtime() + 300; + do { + poll(false); + if (!online) break; + boinc_sleep(1.0); + } while (timeout >= dtime()); + + if (online) { + fprintf( + stderr, + "%s VM did not stop in a timely fashion.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + return ERR_EXEC; + } + } + + return 0; +} + +int VBOX_VM::pause() { + string command; + string output; + int retval; + + command = "controlvm \"" + vm_name + "\" pause"; + retval = vbm_popen(command, output, "pause VM"); + if (retval) return retval; + suspended = true; + return 0; +} + +int VBOX_VM::resume() { + string command; + string output; + int retval; + + command = "controlvm \"" + vm_name + "\" resume"; + retval = vbm_popen(command, output, "resume VM"); + if (retval) return retval; + suspended = false; + return 0; +} + +void VBOX_VM::cleanup() { + stop(); + deregister_vm(); + + // Give time enough for external processes to finish the cleanup process + boinc_sleep(5.0); +} + +void VBOX_VM::poll(bool log_state) { + char buf[256]; + string command; + string output; + string vmstate; + size_t vmstate_start; + size_t vmstate_end; + + command = "showvminfo \"" + vm_name + "\" "; + command += "--machinereadable "; + + if (vbm_popen(command, output, "VM state", false, false) == 0) { + vmstate_start = output.find("VMState=\""); + if (vmstate_start != string::npos) { + vmstate_start += 9; + vmstate_end = output.find("\"", vmstate_start); + vmstate = output.substr(vmstate_start, vmstate_end - vmstate_start); + + // VirtualBox Documentation suggests that that a VM is running when its + // machine state is between MachineState_FirstOnline and MachineState_LastOnline + // which as of this writing is 5 and 17. + // + // VboxManage's source shows more than that though: + // see: http://www.virtualbox.org/browser/trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp + // + // So for now, go with what VboxManage is reporting. + // + if (vmstate == "running") { + online = true; + suspended = false; + } else if (vmstate == "paused") { + online = true; + suspended = true; + } else if (vmstate == "starting") { + online = true; + } else if (vmstate == "stopping") { + online = true; + } else if (vmstate == "saving") { + online = true; + } else if (vmstate == "restoring") { + online = true; + } else if (vmstate == "gurumeditation") { + online = false; + crashed = true; + } else { + online = false; + if (log_state) { + fprintf( + stderr, + "%s Virtual machine is no longer is a running state. It is in '%s'.\n", + boinc_msg_prefix(buf, sizeof(buf)), + vmstate.c_str() + ); + } + } + } + } +} + +bool VBOX_VM::is_hdd_registered() { + string command; + string output; + string virtual_machine_root_dir; + + get_slot_directory(virtual_machine_root_dir); + + command = "showhdinfo \"" + virtual_machine_root_dir + "/" + image_filename + "\" "; + + if (vbm_popen(command, output, "hdd registration", false, false) == 0) { + if ((output.find("VBOX_E_FILE_ERROR") == string::npos) && (output.find("VBOX_E_OBJECT_NOT_FOUND") == string::npos)) { + // Error message not found in text + return true; + } + } + return false; +} + +bool VBOX_VM::is_registered() { + string command; + string output; + + command = "showvminfo \"" + vm_master_name + "\" "; + command += "--machinereadable "; + + if (vbm_popen(command, output, "registration", false, false) == 0) { + if (output.find("VBOX_E_OBJECT_NOT_FOUND") == string::npos) { + // Error message not found in text + return true; + } + } + return false; +} + +bool VBOX_VM::is_extpack_installed() { + string command; + string output; + + command = "list extpacks"; + + if (vbm_popen(command, output, "extpack detection", false, false) == 0) { + if ((output.find("Oracle VM VirtualBox Extension Pack") != string::npos) && (output.find("VBoxVRDP") != string::npos)) { + return true; + } + } + return false; +} + +int VBOX_VM::register_vm() { + string command; + string output; + string virtual_machine_slot_directory; + APP_INIT_DATA aid; + char buf[256]; + int retval; + + boinc_get_init_data_p(&aid); + get_slot_directory(virtual_machine_slot_directory); + + + // Reset VM name in case it was changed while deregistering a stale VM + // + vm_name = vm_master_name; + + + fprintf( + stderr, + "%s Registering virtual machine. (%s) \n", + boinc_msg_prefix(buf, sizeof(buf)), + vm_name.c_str() + ); + + + // Create and register the VM + // + command = "createvm "; + command += "--name \"" + vm_name + "\" "; + command += "--basefolder \"" + virtual_machine_slot_directory + "\" "; + command += "--ostype \"" + os_name + "\" "; + command += "--register"; + + retval = vbm_popen(command, output, "register"); + if (retval) return retval; + + // Tweak the VM from it's default configuration + // + fprintf( + stderr, + "%s Modifying virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "modifyvm \"" + vm_name + "\" "; + command += "--cpus " + vm_cpu_count + " "; + command += "--memory " + memory_size_mb + " "; + command += "--acpi on "; + command += "--ioapic on "; + command += "--boot1 disk "; + command += "--boot2 none "; + command += "--boot3 none "; + command += "--boot4 none "; + command += "--nic1 nat "; + command += "--natdnsproxy1 on "; + command += "--cableconnected1 off "; + + retval = vbm_popen(command, output, "modify"); + if (retval) return retval; + + if ((vm_cpu_count == "1") || + (!strstr(aid.host_info.p_features, "vmx") && !strstr(aid.host_info.p_features, "svm"))) { + // Check to see if the processor supports hardware acceleration for virtualization + // If it doesn't, disable the use of it in VirtualBox. Multi-core jobs require hardware + // acceleration and actually override this setting. + // + fprintf( + stderr, + "%s Disabling hardware acceleration support for virtualization.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "modifyvm \"" + vm_name + "\" "; + command += "--hwvirtex off "; + + retval = vbm_popen(command, output, "VT-x/AMD-V support"); + if (retval) return retval; + } + + // Add storage controller to VM + // + fprintf( + stderr, + "%s Adding storage controller to virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "storagectl \"" + vm_name + "\" "; + command += "--name \"IDE Controller\" "; + command += "--add ide "; + command += "--controller PIIX4 "; + + retval = vbm_popen(command, output, "add storage controller (fixed disk)"); + if (retval) return retval; + + // Add storage controller for a floppy device if desired + // + if (enable_floppyio) { + command = "storagectl \"" + vm_name + "\" "; + command += "--name \"Floppy Controller\" "; + command += "--add floppy "; + + retval = vbm_popen(command, output, "add storage controller (floppy)"); + if (retval) return retval; + } + + // Adding virtual hard drive to VM + // + fprintf( + stderr, + "%s Adding virtual disk drive to virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "storageattach \"" + vm_name + "\" "; + command += "--storagectl \"IDE Controller\" "; + command += "--port 0 "; + command += "--device 0 "; + command += "--type hdd "; + command += "--setuuid \"\" "; + command += "--medium \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; + + retval = vbm_popen(command, output, "storage attach (fixed disk)"); + if (retval) return retval; + + // Adding virtual floppy disk drive to VM + // + if (enable_floppyio) { + + // Put in place the FloppyIO abstraction + // + // NOTE: This creates the floppy.img file at runtime for use by the VM. + // + pFloppy = new FloppyIO(floppy_image_filename.c_str()); + if (!pFloppy->ready()) { + fprintf( + stderr, + "%s Creating virtual floppy image failed.\n" + "%s Error Code '%d' Error Message '%s'\n", + boinc_msg_prefix(buf, sizeof(buf)), + boinc_msg_prefix(buf, sizeof(buf)), + pFloppy->error, + pFloppy->errorStr.c_str() + ); + return ERR_FWRITE; + } + + fprintf( + stderr, + "%s Adding virtual floppy disk drive to virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "storageattach \"" + vm_name + "\" "; + command += "--storagectl \"Floppy Controller\" "; + command += "--port 0 "; + command += "--device 0 "; + command += "--medium \"" + virtual_machine_slot_directory + "/" + floppy_image_filename + "\" "; + + retval = vbm_popen(command, output, "storage attach (floppy disk)"); + if (retval) return retval; + + } + + // Enable the network adapter if a network connection is required. + // + if (enable_network) { + set_network_access(true); + + // If the VM wants to open up a port through the VirtualBox virtual + // network firewall/nat do that here. + // + if (pf_guest_port) { + if (!pf_host_port) { + retval = get_port_forwarding_port(); + if (retval) return retval; + } + + fprintf( + stderr, + "%s Enabling virtual machine firewall rules.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + + // Add new firewall rule + // + sprintf(buf, "vboxwrapper,tcp,127.0.0.1,%d,,%d", pf_host_port, pf_guest_port); + command = "modifyvm \"" + vm_name + "\" "; + command += "--natpf1 \"" + string(buf) + "\" "; + + retval = vbm_popen(command, output, "add updated port forwarding rule"); + if(retval) return retval; + } + } + + // If the VM wants to enable remote desktop for the VM do it here + // + if (enable_remotedesktop) { + fprintf( + stderr, + "%s Enabling remote desktop for virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + if (!is_extpack_installed()) { + fprintf( + stderr, + "%s Required extension pack not installed, remote desktop not enabled.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else { + retval = get_remote_desktop_port(); + if (retval) return retval; + + sprintf(buf, "%d", rd_host_port); + command = "modifyvm \"" + vm_name + "\" "; + command += "--vrde on "; + command += "--vrdeextpack default "; + command += "--vrdeauthlibrary default "; + command += "--vrdeauthtype null "; + command += "--vrdeport " + string(buf) + " "; + + retval = vbm_popen(command, output, "remote desktop"); + if(retval) return retval; + } + } + + // Enable the shared folder if a shared folder is specified. + // + if (enable_shared_directory) { + fprintf( + stderr, + "%s Enabling shared directory for virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "sharedfolder add \"" + vm_name + "\" "; + command += "--name \"shared\" "; + command += "--hostpath \"" + virtual_machine_slot_directory + "/shared\""; + + retval = vbm_popen(command, output, "enable shared dir"); + if (retval) return retval; + } + + return 0; +} + +int VBOX_VM::deregister_vm() { + string command; + string output; + string virtual_machine_slot_directory; + char buf[256]; + + get_slot_directory(virtual_machine_slot_directory); + + fprintf( + stderr, + "%s Deregistering virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + + + // Discard any saved state information + // + fprintf( + stderr, + "%s Discarding saved state of virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "discardstate \"" + vm_name + "\" "; + + vbm_popen(command, output, "discard state", false); + + // Delete its storage controller(s) + // + fprintf( + stderr, + "%s Removing storage controller(s) from virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "storagectl \"" + vm_name + "\" "; + command += "--name \"IDE Controller\" "; + command += "--remove "; + + vbm_popen(command, output, "deregister storage controller (fixed disk)"); + + if (enable_floppyio) { + command = "storagectl \"" + vm_name + "\" "; + command += "--name \"Floppy Controller\" "; + command += "--remove "; + + vbm_popen(command, output, "deregister storage controller (floppy disk)"); + } + + // Next delete VM + // + fprintf( + stderr, + "%s Removing virtual machine from VirtualBox.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "unregistervm \"" + vm_name + "\" "; + command += "--delete "; + + vbm_popen(command, output, "delete VM"); + + // Lastly delete medium from Virtual Box Media Registry + // + fprintf( + stderr, + "%s Removing virtual disk drive from VirtualBox.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "closemedium disk \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; + + vbm_popen(command, output, "remove virtual disk"); + return 0; +} + +int VBOX_VM::deregister_stale_vm() { + string command; + string output; + string virtual_machine_slot_directory; + size_t uuid_start; + size_t uuid_end; + int retval; + + get_slot_directory(virtual_machine_slot_directory); + + // We need to determine what the name or uuid is of the previous VM which owns + // this virtual disk + // + command = "showhdinfo \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; + + retval = vbm_popen(command, output, "get HDD info"); + if (retval) return retval; + + // Output should look a little like this: + // UUID: c119acaf-636c-41f6-86c9-38e639a31339 + // Accessible: yes + // Logical size: 10240 MBytes + // Current size on disk: 0 MBytes + // Type: normal (base) + // Storage format: VDI + // Format variant: dynamic default + // In use by VMs: test2 (UUID: 000ab2be-1254-4c6a-9fdc-1536a478f601) + // Location: C:\Users\romw\VirtualBox VMs\test2\test2.vdi + // + uuid_start = output.find("(UUID: "); + if (uuid_start != string::npos) { + // We can parse the virtual machine ID from the output + uuid_start += 7; + uuid_end = output.find(")", uuid_start); + vm_name = output.substr(uuid_start, uuid_end - uuid_start); + + // Deregister stale VM by UUID + return deregister_vm(); + } else { + // Did the user delete the VM in VirtualBox and not the medium? If so, + // just remove the medium. + command = "closemedium disk \"" + virtual_machine_slot_directory + "/" + image_filename + "\" "; + vbm_popen(command, output, "remove virtual disk ", false); + } + return 0; +} + +int VBOX_VM::get_install_directory(string& virtualbox_install_directory ) { +#ifdef _WIN32 + LONG lReturnValue; + HKEY hkSetupHive; + LPTSTR lpszRegistryValue = NULL; + DWORD dwSize = 0; + + // change the current directory to the boinc data directory if it exists + lReturnValue = RegOpenKeyEx( + HKEY_LOCAL_MACHINE, + _T("SOFTWARE\\Oracle\\VirtualBox"), + 0, + KEY_READ, + &hkSetupHive + ); + if (lReturnValue == ERROR_SUCCESS) { + // How large does our buffer need to be? + lReturnValue = RegQueryValueEx( + hkSetupHive, + _T("InstallDir"), + NULL, + NULL, + NULL, + &dwSize + ); + if (lReturnValue != ERROR_FILE_NOT_FOUND) { + // Allocate the buffer space. + lpszRegistryValue = (LPTSTR) malloc(dwSize); + (*lpszRegistryValue) = NULL; + + // Now get the data + lReturnValue = RegQueryValueEx( + hkSetupHive, + _T("InstallDir"), + NULL, + NULL, + (LPBYTE)lpszRegistryValue, + &dwSize + ); + + virtualbox_install_directory = lpszRegistryValue; + } + } + + if (hkSetupHive) RegCloseKey(hkSetupHive); + if (lpszRegistryValue) free(lpszRegistryValue); +#else + virtualbox_install_directory = ""; +#endif + return 0; +} + +// Returns the current directory in which the executable resides. +// +int VBOX_VM::get_slot_directory( string& dir ) { + char slot_dir[256]; + + getcwd(slot_dir, sizeof(slot_dir)); + dir = slot_dir; + + if (!dir.empty()) { + return 1; + } + return 0; +} + +int VBOX_VM::get_network_bytes_sent(double& sent) { + string command; + string output; + string counter_value; + size_t counter_start; + size_t counter_end; + int retval; + + command = "debugvm \"" + vm_name + "\" "; + command += "statistics --pattern \"/Devices/*/TransmitBytes\" "; + + retval = vbm_popen(command, output, "get bytes sent"); + if (retval) return retval; + + // Output should look like this: + // + // + // + // + // + + // add up the counter(s) + // + sent = 0; + counter_start = output.find("c=\""); + while (counter_start != string::npos) { + counter_start += 3; + counter_end = output.find("\"", counter_start); + counter_value = output.substr(counter_start, counter_end - counter_start); + sent += atof(counter_value.c_str()); + counter_start = output.find("c=\"", counter_start); + } + return 0; +} + +int VBOX_VM::get_network_bytes_received(double& received) { + string command; + string output; + string counter_value; + size_t counter_start; + size_t counter_end; + int retval; + + command = "debugvm \"" + vm_name + "\" "; + command += "statistics --pattern \"/Devices/*/ReceiveBytes\" "; + + retval = vbm_popen(command, output, "get bytes received"); + if (retval) return retval; + + // Output should look like this: + // + // + // + // + // + + // add up the counter(s) + // + received = 0; + counter_start = output.find("c=\""); + while (counter_start != string::npos) { + counter_start += 3; + counter_end = output.find("\"", counter_start); + counter_value = output.substr(counter_start, counter_end - counter_start); + received += atof(counter_value.c_str()); + counter_start = output.find("c=\"", counter_start); + } + + return 0; +} + +int VBOX_VM::get_system_log(string& log) { + string virtualbox_user_home; + string slot_directory; + string virtualbox_system_log_src; + string virtualbox_system_log_dst; + string::iterator iter; + char buf[256]; + int retval = 0; + + // Where is VirtualBox storing its configuration files? + if (getenv("VBOX_USER_HOME")) { + virtualbox_user_home = getenv("VBOX_USER_HOME"); + } else { + // If the override environment variable isn't specified then + // it is based of the current users HOME directory. +#ifdef _WIN32 + virtualbox_user_home = getenv("USERPROFILE"); +#else + virtualbox_user_home = getenv("HOME"); +#endif + virtualbox_user_home += "/.VirtualBox"; + } + + // Where should we copy temp files to? + get_slot_directory(slot_directory); + + // Locate and read log file + virtualbox_system_log_src = virtualbox_user_home + "/VBoxSVC.log"; + virtualbox_system_log_dst = slot_directory + "/VBoxSVC.log"; + + if (boinc_file_exists(virtualbox_system_log_src.c_str())) { + // Skip having to deal with various forms of file locks by just making a temp + // copy of the log file. + boinc_copy(virtualbox_system_log_src.c_str(), virtualbox_system_log_dst.c_str()); + + // Keep only the last 16k if it is larger than that. + read_file_string(virtualbox_system_log_dst.c_str(), log, 16384, true); + +#ifdef _WIN32 + // Remove \r from the log spew + iter = log.begin(); + while (iter != log.end()) { + if (*iter == '\r') { + iter = log.erase(iter); + } else { + ++iter; + } + } +#endif + + if (log.size() >= 16384) { + // Look for the next whole line of text. + iter = log.begin(); + while (iter != log.end()) { + if (*iter == '\n') { + log.erase(iter); + break; + } + iter = log.erase(iter); + } + } + } else { + fprintf( + stderr, + "%s Could not find the Hypervisor System Log at '%s'.\n", + boinc_msg_prefix(buf, sizeof(buf)), + virtualbox_system_log_src.c_str() + ); + retval = ERR_NOT_FOUND; + } + + return retval; +} + +int VBOX_VM::get_vm_log(string& log) { + string command; + string output; + string::iterator iter; + int retval; + + command = "showvminfo \"" + vm_name + "\" "; + command += "--log 0 "; + + retval = vbm_popen(command, output, "get vm log"); + if (retval) return retval; + + // Keep only the last 16k if it is larger than that. + size_t size = output.size(); + if (size > 16384) { + log = output.substr(size - 16384, size); + +#ifdef _WIN32 + // Remove \r from the log spew + iter = log.begin(); + while (iter != log.end()) { + if (*iter == '\r') { + iter = log.erase(iter); + } else { + ++iter; + } + } +#endif + + if (log.size() >= 16384) { + // Look for the next whole line of text. + iter = log.begin(); + while (iter != log.end()) { + if (*iter == '\n') { + log.erase(iter); + break; + } + iter = log.erase(iter); + } + } + } else { + log = output; + } + + return 0; +} + +int VBOX_VM::get_vm_exit_code(unsigned long& exit_code) { +#ifndef _WIN32 + int ec = 0; + waitpid(vm_pid, &ec, WNOHANG); + exit_code = ec; +#else + GetExitCodeProcess(vm_pid_handle, &exit_code); +#endif + return 0; +} + +int VBOX_VM::get_vm_process_id(int& process_id) { + string command; + string output; + string pid; + size_t pid_start; + size_t pid_end; + int retval; + + command = "showvminfo \"" + vm_name + "\" "; + command += "--log 0 "; + + retval = vbm_popen(command, output, "get process ID"); + if (retval) return retval; + + // Output should look like this: + // VirtualBox 4.1.0 r73009 win.amd64 (Jul 19 2011 13:05:53) release log + // 00:00:06.008 Log opened 2011-09-01T23:00:59.829170900Z + // 00:00:06.008 OS Product: Windows 7 + // 00:00:06.009 OS Release: 6.1.7601 + // 00:00:06.009 OS Service Pack: 1 + // 00:00:06.015 Host RAM: 4094MB RAM, available: 876MB + // 00:00:06.015 Executable: C:\Program Files\Oracle\VirtualBox\VirtualBox.exe + // 00:00:06.015 Process ID: 6128 + // 00:00:06.015 Package type: WINDOWS_64BITS_GENERIC + // 00:00:06.015 Installed Extension Packs: + // 00:00:06.015 None installed! + // + pid_start = output.find("Process ID: "); + if (pid_start == string::npos) { + return ERR_NOT_FOUND; + } + pid_start += 12; + pid_end = output.find("\n", pid_start); + pid = output.substr(pid_start, pid_end - pid_start); + if (pid.size() <= 0) { + return ERR_NOT_FOUND; + } + process_id = atol(pid.c_str()); + +#ifndef _WIN32 + vm_pid = process_id; +#else + vm_pid_handle = OpenProcess( + PROCESS_QUERY_INFORMATION | PROCESS_SET_INFORMATION, + FALSE, + process_id + ); +#endif + + return 0; +} + +int VBOX_VM::get_port_forwarding_port() { + struct sockaddr_in addr; + BOINC_SOCKLEN_T addrsize; + int sock; + int retval; + + addrsize = sizeof(struct sockaddr_in); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(pf_host_port); + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + retval = boinc_socket(sock); + if (retval) return retval; + + retval = bind(sock, (struct sockaddr *)&addr, addrsize); + if (retval < 0) { + boinc_close_socket(sock); + + // Lets see if we can get anything useable at this point + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(0); + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + retval = boinc_socket(sock); + if (retval) return retval; + + retval = bind(sock, (struct sockaddr *)&addr, addrsize); + if (retval < 0) { + boinc_close_socket(sock); + return ERR_BIND; + } + } + + getsockname(sock, (struct sockaddr *)&addr, &addrsize); + pf_host_port = addr.sin_port; + + boinc_close_socket(sock); + return 0; +} + +int VBOX_VM::get_remote_desktop_port() { + struct sockaddr_in addr; + BOINC_SOCKLEN_T addrsize; + int sock; + int retval; + + addrsize = sizeof(struct sockaddr_in); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(0); + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + retval = boinc_socket(sock); + if (retval) return retval; + + retval = bind(sock, (struct sockaddr *)&addr, addrsize); + if (retval < 0) { + boinc_close_socket(sock); + return ERR_BIND; + } + + getsockname(sock, (struct sockaddr *)&addr, &addrsize); + rd_host_port = addr.sin_port; + + boinc_close_socket(sock); + return 0; +} + +// Enable the network adapter if a network connection is required. +// NOTE: Network access should never be allowed if the code running in a +// shared directory or the VM image itself is NOT signed. Doing so +// opens up the network behind the company firewall to attack. +// +// Imagine a doomsday scenario where a project has been compromised and +// an unsigned executable/VM image has been tampered with. Volunteer +// downloads compromised code and executes it on a company machine. +// Now the compromised VM starts attacking other machines on the company +// network. The company firewall cannot help because the attacking +// machine is already behind the company firewall. +// +int VBOX_VM::set_network_access(bool enabled) { + string command; + string output; + char buf[256]; + int retval; + + network_suspended = !enabled; + + if (enabled) { + fprintf( + stderr, + "%s Enabling network access for virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "modifyvm \"" + vm_name + "\" "; + command += "--cableconnected1 on "; + + retval = vbm_popen(command, output, "enable network"); + if (retval) return retval; + } else { + fprintf( + stderr, + "%s Disabling network access for virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + command = "modifyvm \"" + vm_name + "\" "; + command += "--cableconnected1 off "; + + retval = vbm_popen(command, output, "disable network"); + if (retval) return retval; + } + return 0; +} + +int VBOX_VM::set_cpu_usage_fraction(double x) { + string command; + string output; + char buf[256]; + int retval; + + // the arg to modifyvm is percentage + // + fprintf( + stderr, + "%s Setting cpu throttle for virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + sprintf(buf, "%d", (int)(x*100.)); + command = "modifyvm \"" + vm_name + "\" "; + command += "--cpuexecutioncap "; + command += buf; + command += " "; + + retval = vbm_popen(command, output, "CPU throttle"); + if (retval) return retval; + return 0; +} + +int VBOX_VM::set_network_max_bytes_sec(double x) { + string command; + string output; + char buf[256]; + int retval; + + + // the argument to modifyvm is in Kbps + // + fprintf( + stderr, + "%s Setting network throttle for virtual machine.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + sprintf(buf, "%d", (int)(x*8./1000.)); + command = "modifyvm \"" + vm_name + "\" "; + command += "--nicspeed1 "; + command += buf; + command += " "; + + retval = vbm_popen(command, output, "network throttle"); + if (retval) return retval; + return 0; +} + +int VBOX_VM::read_floppy(std::string& data) { + if (enable_floppyio && pFloppy) { + data = pFloppy->receive(); + return 0; + } + return 1; +} + +int VBOX_VM::write_floppy(std::string& data) { + if (enable_floppyio && pFloppy) { + pFloppy->send(data); + return 0; + } + return 1; +} + +void VBOX_VM::reset_vm_process_priority() { +#ifndef _WIN32 + if (vm_pid) { + setpriority(PRIO_PROCESS, vm_pid, PROCESS_IDLE_PRIORITY); + } +#else + if (vm_pid_handle) { + SetPriorityClass(vm_pid_handle, BELOW_NORMAL_PRIORITY_CLASS); + } +#endif +} + +// If there are errors we can recover from, process them here. +// +int VBOX_VM::vbm_popen(string& arguments, string& output, const char* item, bool log_error, bool retry_failures) { + int retval = 0; + char buf[256]; + int retry_count = 0; + string retry_notes; + + do { + retval = vbm_popen_raw(arguments, output); + if (retval) { + + // VirtualBox designed the concept of sessions to prevent multiple applications using + // the VirtualBox COM API (virtualbox.exe, vboxmanage.exe) from modifying the same VM + // at the same time. + // + // The problem here is that vboxwrapper uses vboxmanage.exe to modify and control the + // VM. Vboxmanage.exe can only maintain the session lock for as long as it takes it + // to run. So that means 99% of the time that a VM is running under BOINC technology + // it is running without a session lock. + // + // If a volunteer opens another VirtualBox management application and goes poking around + // that application can aquire the session lock and not give it up for some time. + // + // If we detect that condition retry the desired command. + // + if ((output.find("VBOX_E_INVALID_OBJECT_STATE") != string::npos) && + (output.find("already locked") != string::npos)) + { + if (retry_notes.find("Another VirtualBox management") == string::npos) { + retry_notes += "Another VirtualBox management application has locked the session for\n"; + retry_notes += "this virtual machine. BOINC cannot properly monitor this virtual machine\n"; + retry_notes += "and so this job will be aborted.\n\n"; + } + } + + // Retry? + if (!retry_failures) break; + + // Timeout? + if (retry_count >= 6) break; + + retry_count++; + boinc_sleep(5.0); + } + } + while (retval); + +#ifdef _WIN32 + // Remove \r from the log spew + string::iterator iter = output.begin(); + while (iter != output.end()) { + if (*iter == '\r') { + iter = output.erase(iter); + } else { + ++iter; + } + } +#endif + + // Add all relivent notes to the output string and log errors + // + if (retval && log_error) { + if (!retry_notes.empty()) { + output += "\nNotes:\n\n" + retry_notes; + } + + fprintf( + stderr, + "%s Error in %s for VM: %d\nArguments:\n%s\nOutput:\n%s\n", + boinc_msg_prefix(buf, sizeof(buf)), + item, + retval, + arguments.c_str(), + output.c_str() + ); + } + + return retval; +} + +// Execute the vbox manage application and copy the output to the buffer. +// +int VBOX_VM::vbm_popen_raw(string& arguments, string& output) { + char buf[256]; + string command; + int retval = 0; + + // Initialize command line + command = "VBoxManage -q " + arguments; + + // Reset output buffer + output.clear(); + +#ifdef _WIN32 + + STARTUPINFO si; + PROCESS_INFORMATION pi; + SECURITY_ATTRIBUTES sa; + SECURITY_DESCRIPTOR sd; + HANDLE hReadPipe = NULL, hWritePipe = NULL; + void* pBuf = NULL; + DWORD dwCount = 0; + unsigned long ulExitCode = 0; + unsigned long ulExitTimeout = 0; + size_t errcode_start; + size_t errcode_end; + string errcode; + + memset(&si, 0, sizeof(si)); + memset(&pi, 0, sizeof(pi)); + memset(&sa, 0, sizeof(sa)); + memset(&sd, 0, sizeof(sd)); + + InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION); + SetSecurityDescriptorDacl(&sd, true, NULL, false); + + sa.nLength = sizeof(SECURITY_ATTRIBUTES); + sa.bInheritHandle = TRUE; + sa.lpSecurityDescriptor = &sd; + + if (!CreatePipe(&hReadPipe, &hWritePipe, &sa, NULL)) { + fprintf( + stderr, + "%s CreatePipe failed! (%d).\n", + boinc_msg_prefix(buf, sizeof(buf)), + GetLastError() + ); + goto CLEANUP; + } + SetHandleInformation(hReadPipe, HANDLE_FLAG_INHERIT, 0); + + si.cb = sizeof(STARTUPINFO); + si.dwFlags |= STARTF_FORCEOFFFEEDBACK | STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; + si.wShowWindow = SW_HIDE; + si.hStdOutput = hWritePipe; + si.hStdError = hWritePipe; + si.hStdInput = NULL; + + // Execute command + if (!CreateProcess( + NULL, + (LPTSTR)command.c_str(), + NULL, + NULL, + TRUE, + CREATE_NO_WINDOW, NULL, + NULL, + &si, + &pi + )) { + fprintf( + stderr, + "%s CreateProcess failed! (%d).\n", + boinc_msg_prefix(buf, sizeof(buf)), + GetLastError() + ); + goto CLEANUP; + } + + // Wait until process has completed + while(1) { + GetExitCodeProcess(pi.hProcess, &ulExitCode); + + // Copy stdout/stderr to output buffer, handle in the loop so that we can + // copy the pipe as it is populated and prevent the child process from blocking + // in case the output is bigger than pipe buffer. + PeekNamedPipe(hReadPipe, NULL, NULL, NULL, &dwCount, NULL); + if (dwCount) { + pBuf = malloc(dwCount+1); + memset(pBuf, 0, dwCount+1); + + if (ReadFile(hReadPipe, pBuf, dwCount, &dwCount, NULL)) { + output += (char*)pBuf; + } + + free(pBuf); + } + + if (ulExitCode != STILL_ACTIVE) break; + + // Timeout? + if (ulExitTimeout >= 60000) { + fprintf( + stderr, + "%s Process Timeout!.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + + TerminateProcess(pi.hProcess, EXIT_FAILURE); + Sleep(1000); + } + + Sleep(250); + ulExitTimeout += 250; + } + +CLEANUP: + if (pi.hThread) CloseHandle(pi.hThread); + if (pi.hProcess) CloseHandle(pi.hProcess); + if (hReadPipe) CloseHandle(hReadPipe); + if (hWritePipe) CloseHandle(hWritePipe); + + if ((ulExitCode != 0) || (!pi.hProcess)) { + + // Determine the real error code by parsing the output + errcode_start = output.find("(0x"); + if (errcode_start) { + errcode_start += 1; + errcode_end = output.find(")", errcode_start); + errcode = output.substr(errcode_start, errcode_end - errcode_start); + + sscanf(errcode.c_str(), "%x", &retval); + } + + // If something couldn't be found, just return ERR_FOPEN + if (!retval) retval = ERR_FOPEN; + } + +#else + + FILE* fp; + + // redirect stderr to stdout for the child process so we can trap it with popen. + string modified_command = command + " 2>&1"; + + // Execute command + fp = popen(modified_command.c_str(), "r"); + if (fp == NULL){ + fprintf( + stderr, + "%s vbm_popen popen failed! errno = %d\n", + boinc_msg_prefix(buf, sizeof(buf)), + errno + ); + retval = ERR_FOPEN; + } else { + // Copy output to buffer + while (fgets(buf, 256, fp)) { + output += buf; + } + + // Close stream + pclose(fp); + retval = 0; + } + +#endif + + return retval; +} diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/vbox.h boinc-7.0.14+dfsg/samples/vboxwrapper/vbox.h --- boinc-7.0.7+dfsg/samples/vboxwrapper/vbox.h 2011-09-22 15:39:08.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/vbox.h 2012-01-24 04:13:00.000000000 +0000 @@ -1,77 +1,139 @@ -// This file is part of BOINC. -// http://boinc.berkeley.edu -// Copyright (C) 2010 University of California -// -// BOINC is free software; you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License -// as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// BOINC 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 -// along with BOINC. If not, see . - - -// Provide cross-platform interfaces for making changes to VirtualBox - -#ifndef _VBOX_H_ -#define _VBOX_H_ - -// represents a VirtualBox VM - -struct VBOX_VM { - VBOX_VM(); - ~VBOX_VM(){}; - - // name of the OS the VM runs - std::string os_name; - // size of the memory allocation for the VM, in megabytes - std::string memory_size_mb; - // name of the virtual machine disk image file - std::string image_filename; - // unique name for the VM - std::string vm_name; - bool suspended; - // whether network access is temporarily suspended - bool network_suspended; - // whether to allow network access at all - bool enable_network; - bool enable_shared_directory; - // whether we were instructed to only register the VM. - // useful for debugging VMs. - bool register_only; - - void poll(); - int run(); - int stop(); - int pause(); - int resume(); - void cleanup(); - bool is_running(); - - int register_vm(); - bool is_hdd_registered(); - bool is_registered(); - int deregister_stale_vm(); - int deregister_vm(); - int start(); - int set_network_access(bool enabled); - int set_cpu_usage_fraction(double); - int set_network_max_bytes_sec(double); - int get_process_id(int& process_id); - int get_network_bytes_sent(double& sent); - int get_network_bytes_received(double& received); - - static int initialize(); - static int get_install_directory(std::string& dir); - static int get_slot_directory(std::string& dir); - static int vbm_popen( - std::string& command, std::string& output, const char* item - ); -}; - -#endif +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2010-2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + + +// Provide cross-platform interfaces for making changes to VirtualBox + +#ifndef _VBOX_H_ +#define _VBOX_H_ + +// raw floppy drive device +class FloppyIO; + +// represents a VirtualBox VM +struct VBOX_VM { + VBOX_VM(); + ~VBOX_VM(); + + // Floppy IO abstraction + FloppyIO* pFloppy; + + // unique master name for the VM + std::string vm_master_name; + // unique name for the VM or UUID of a stale VM if deregistering a stale VM + std::string vm_name; + // required CPU core count + std::string vm_cpu_count; + // name of the OS the VM runs + std::string os_name; + // size of the memory allocation for the VM, in megabytes + std::string memory_size_mb; + // name of the virtual machine disk image file + std::string image_filename; + // name of the virtual machine floppy disk image file + std::string floppy_image_filename; + // maximum amount of wall-clock time this VM is allowed to run before + // considering itself done. + double job_duration; + // is the VM suspended? + bool suspended; + // is network access temporarily suspended? + bool network_suspended; + // is VM even online? + bool online; + // Has the VM crashed? + bool crashed; + // whether to use CERN specific data structures + bool enable_cern_dataformat; + // whether to use shared directory infrastructure at all + bool enable_shared_directory; + // whether to use floppy io infrastructure at all + bool enable_floppyio; + // whether to enable remote desktop functionality + bool enable_remotedesktop; + // whether to allow network access at all + bool enable_network; + // whether we were instructed to only register the VM. + // useful for debugging VMs. + bool register_only; + // the following for optional port forwarding + int pf_host_port; + // specified in config file + int pf_guest_port; + // specified in config file + // the following for optional remote desktop + int rd_host_port; + // dynamically assigned +#ifdef _WIN32 + // the handle to the process for the VM + // NOTE: we get a handle to the pid right after we parse it from the + // log files so we can adjust the process priority and retrieve the process + // exit code in case it crashed or was terminated. Without an outstanding + // handle to the process, the OS is free to reuse the pid for some other + // executable. + HANDLE vm_pid_handle; +#else + // the pid to the VM process + int vm_pid; +#endif + + int initialize(); + int run(); + int start(); + int stop(); + int pause(); + int resume(); + void cleanup(); + void poll(bool log_state = true); + + bool is_hdd_registered(); + bool is_registered(); + bool is_extpack_installed(); + + int register_vm(); + int deregister_vm(); + int deregister_stale_vm(); + + int get_install_directory(std::string& dir); + int get_slot_directory(std::string& dir); + int get_network_bytes_sent(double& sent); + int get_network_bytes_received(double& received); + int get_system_log(std::string& log); + int get_vm_log(std::string& log); + int get_vm_exit_code(unsigned long& exit_code); + int get_vm_process_id(int& process_id); + int get_port_forwarding_port(); + int get_remote_desktop_port(); + + int set_network_access(bool enabled); + int set_cpu_usage_fraction(double); + int set_network_max_bytes_sec(double); + + int read_floppy(std::string& data); + int write_floppy(std::string& data); + + void reset_vm_process_priority(); + + int vbm_popen( + std::string& command, std::string& output, const char* item, bool log_error = true, bool retry_failures = true + ); + int vbm_popen_raw( + std::string& command, std::string& output + ); +}; + +#endif diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/vboxwrapper.cpp boinc-7.0.14+dfsg/samples/vboxwrapper/vboxwrapper.cpp --- boinc-7.0.7+dfsg/samples/vboxwrapper/vboxwrapper.cpp 2011-09-16 19:16:12.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/vboxwrapper.cpp 2012-01-25 09:09:35.000000000 +0000 @@ -1,376 +1,697 @@ -// This file is part of BOINC. -// http://boinc.berkeley.edu -// Copyright (C) 2010 University of California -// -// BOINC is free software; you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License -// as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// BOINC 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 -// along with BOINC. If not, see . - -// vboxwrapper [options] BOINC VirtualBox wrapper -// see: http://boinc.berkeley.edu/trac/wiki/VboxApps -// Options: -// --trickle X send a trickle message reporting elapsed time every X secs -// (use this for credit granting if your app does its -// own job management, like CernVM). -// -// Handles: -// - suspend/resume/quit/abort -// - reporting CPU time -// - loss of heartbeat from core client -// - checkpointing -// (at the level of task; or potentially within task) -// -// Contributors: -// Andrew J. Younge (ajy4490 AT umiacs DOT umd DOT edu) -// Jie Wu -// Daniel Lombraña González -// Rom Walton -// David Anderson - -// To debug a VM within the BOINC/VboxWrapper framework: -// 1. Launch BOINC with --exit_before_start -// 2. When BOINC exits, launch the VboxWrapper with the register_only -// 3. Set the VBOX_USER_HOME environment variable to the vbox directory -// under the slot directory. -// This changes where the VirtualBox applications look for the -// root VirtualBox configuration files. -// It may or may not apply to your installation of VirtualBox. -// It depends on where your copy of VirtualBox came from -// and what type of system it is installed on. -// 4. Now Launch the VM using the VirtualBox UI. -// You should now be able to interact with your VM. - -#ifdef _WIN32 -#include "boinc_win.h" -#include "win_util.h" -#else -#include -#include -#include -#include -#include -#include -#include -#endif - -#include "boinc_api.h" -#include "diagnostics.h" -#include "filesys.h" -#include "parse.h" -#include "str_util.h" -#include "str_replace.h" -#include "util.h" -#include "error_numbers.h" -#include "procinfo.h" -#include "vbox.h" - -using std::vector; - -#define IMAGE_FILENAME "vm_image.vdi" -#define JOB_FILENAME "vbox_job.xml" -#define CHECKPOINT_FILENAME "vbox_checkpoint.txt" -#define POLL_PERIOD 1.0 - -int parse_job_file(VBOX_VM& vm) { - MIOFILE mf; - char buf[256], buf2[256]; - - boinc_resolve_filename(JOB_FILENAME, buf, 1024); - FILE* f = boinc_fopen(buf, "r"); - if (!f) { - fprintf(stderr, - "%s can't open job file %s\n", - boinc_msg_prefix(buf2, sizeof(buf2)), buf - ); - return ERR_FOPEN; - } - mf.init_file(f); - XML_PARSER xp(&mf); - - if (!xp.parse_start("vbox_job")) return ERR_XML_PARSE; - while (!xp.get_tag()) { - if (!xp.is_tag) { - fprintf(stderr, "%s parse_job_file(): unexpected text %s\n", - boinc_msg_prefix(buf, sizeof(buf)), xp.parsed_tag - ); - continue; - } - if (xp.match_tag("/vbox_job")) { - fclose(f); - return 0; - } - else if (xp.parse_string("os_name", vm.os_name)) continue; - else if (xp.parse_string("memory_size_mb", vm.memory_size_mb)) continue; - else if (xp.parse_bool("enable_network", vm.enable_network)) continue; - else if (xp.parse_bool("enable_shared_directory", vm.enable_shared_directory)) continue; - fprintf(stderr, "%s parse_job_file(): unexpected tag %s\n", - boinc_msg_prefix(buf, sizeof(buf)), xp.parsed_tag - ); - } - fclose(f); - return ERR_XML_PARSE; -} - -void write_checkpoint(double cpu) { - boinc_begin_critical_section(); - FILE* f = fopen(CHECKPOINT_FILENAME, "w"); - if (!f) return; - fprintf(f, "%f\n", cpu); - fclose(f); - boinc_checkpoint_completed(); -} - -void read_checkpoint(double& cpu) { - double c; - cpu = 0; - FILE* f = fopen(CHECKPOINT_FILENAME, "r"); - if (!f) return; - int n = fscanf(f, "%lf", &c); - fclose(f); - if (n != 1) return; - cpu = c; -} - -// set CPU and network throttling if needed -// -void set_throttles(APP_INIT_DATA& aid, VBOX_VM& vm) { - double x = aid.global_prefs.cpu_usage_limit; - if (x && x<100) { - vm.set_cpu_usage_fraction(x/100.); - } - - // vbox doesn't distinguish up and down bandwidth; use the min of the prefs - // - x = aid.global_prefs.max_bytes_sec_up; - double y = aid.global_prefs.max_bytes_sec_down; - if (y) { - if (!x || y element has been specified.\n", - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)) - ); - } - } - - boinc_get_init_data_p(&aid); - vm.vm_name = "boinc_"; - if (boinc_is_standalone()) { - vm.vm_name += "standalone"; - vm.image_filename = IMAGE_FILENAME; - } else { - vm.vm_name += aid.result_name; - sprintf(buf, "%s_%d", IMAGE_FILENAME, aid.slot); - vm.image_filename = buf; - boinc_rename(IMAGE_FILENAME, buf); - } - - read_checkpoint(checkpoint_cpu_time); - - retval = vm.run(); - if (retval) { - boinc_finish(retval); - } - - set_throttles(aid, vm); - - while (1) { - vm.poll(); - is_running = vm.is_running(); - - if (boinc_status.no_heartbeat || boinc_status.quit_request) { - vm.stop(); - write_checkpoint(checkpoint_cpu_time); - boinc_temporary_exit(0); - } - if (boinc_status.abort_request) { - vm.cleanup(); - write_checkpoint(checkpoint_cpu_time); - boinc_finish(EXIT_ABORTED_BY_CLIENT); - } - if (!is_running) { - fprintf( - stderr, - "%s Virtual machine is no longer running, it must have completed its work.\n" - "%s NOTE: If this is in error, check the vboxwrapper source code for additional steps to debug this issue.\n", - boinc_msg_prefix(buf, sizeof(buf)), - boinc_msg_prefix(buf, sizeof(buf)) - ); - vm.cleanup(); - write_checkpoint(checkpoint_cpu_time); - boinc_finish(0); - } - if (boinc_status.suspended) { - if (!vm.suspended) { - vm.pause(); - } - } else { - if (vm.suspended) { - vm.resume(); - } - elapsed_time += POLL_PERIOD; - if (!vm_pid) { - vm.get_process_id(vm_pid); - report_vm_pid = true; - } - if (report_vm_pid || report_net_usage) { - retval = boinc_report_app_status_aux( - elapsed_time, checkpoint_cpu_time, 0, vm_pid, - bytes_sent, bytes_received - ); - if (!retval) { - report_vm_pid = false; - report_net_usage = false; - } - } else { - boinc_report_app_status(elapsed_time, checkpoint_cpu_time, 0); - } - if (trickle_period) { - trickle_cpu_time += POLL_PERIOD; - if (trickle_cpu_time >= trickle_period) { - sprintf(buf, "%f", trickle_cpu_time); - boinc_send_trickle_up(const_cast("cpu_time"), buf); - trickle_cpu_time = 0; - } - } - - // if we've been running for at least the scheduling period, - // do a checkpoint and temporary exit; - // the client will run us again if it wants. - // - if (elapsed_time > aid.global_prefs.cpu_scheduling_period()) { - vm.stop(); - write_checkpoint(checkpoint_cpu_time); - boinc_temporary_exit(0); - } - } - if (vm.enable_network) { - if (boinc_status.network_suspended) { - if (!vm.network_suspended) { - vm.set_network_access(false); - } - } else { - if (vm.network_suspended) { - vm.set_network_access(true); - } - } - } - if (boinc_status.reread_init_data_file) { - boinc_status.reread_init_data_file = false; - boinc_parse_init_data_file(); - boinc_get_init_data_p(&aid); - set_throttles(aid, vm); - } - - // report network usage every 10 min so the client can enforce quota - // - static double net_usage_timer=600; - if (aid.global_prefs.daily_xfer_limit_mb - && vm.enable_network - && !vm.suspended - ) { - net_usage_timer -= POLL_PERIOD; - if (net_usage_timer <= 0) { - net_usage_timer = 600; - double sent, received; - retval = vm.get_network_bytes_sent(sent); - if (!retval && (sent != bytes_sent)) { - bytes_sent = sent; - report_net_usage = true; - } - retval = vm.get_network_bytes_received(received); - if (!retval && (received != bytes_received)) { - bytes_received = received; - report_net_usage = true; - } - } - } - boinc_sleep(POLL_PERIOD); - } -} - -#ifdef _WIN32 - -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) { - LPSTR command_line; - char* argv[100]; - int argc; - - command_line = GetCommandLine(); - argc = parse_command_line(command_line, argv); - return main(argc, argv); -} - -#endif +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2010-2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + +// vboxwrapper [options] BOINC VirtualBox wrapper +// see: http://boinc.berkeley.edu/trac/wiki/VboxApps +// Options: +// --trickle X send a trickle message reporting elapsed time every X secs +// (use this for credit granting if your app does its +// own job management, like CernVM). +// +// Handles: +// - suspend/resume/quit/abort +// - reporting CPU time +// - loss of heartbeat from core client +// +// Contributors: +// Andrew J. Younge (ajy4490 AT umiacs DOT umd DOT edu) +// Jie Wu +// Daniel Lombraña González +// Rom Walton +// David Anderson + +// To debug a VM within the BOINC/VboxWrapper framework: +// 1. Launch BOINC with --exit_before_start +// 2. When BOINC exits, launch the VboxWrapper with the register_only +// 3. Set the VBOX_USER_HOME environment variable to the vbox directory +// under the slot directory. +// This changes where the VirtualBox applications look for the +// root VirtualBox configuration files. +// It may or may not apply to your installation of VirtualBox. +// It depends on where your copy of VirtualBox came from +// and what type of system it is installed on. +// 4. Now Launch the VM using the VirtualBox UI. +// You should now be able to interact with your VM. + +#ifdef _WIN32 +#include "boinc_win.h" +#include "win_util.h" +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include "boinc_api.h" +#include "diagnostics.h" +#include "filesys.h" +#include "parse.h" +#include "str_util.h" +#include "str_replace.h" +#include "util.h" +#include "error_numbers.h" +#include "procinfo.h" +#include "vboxwrapper.h" +#include "vbox.h" + +using std::vector; + +int parse_job_file(VBOX_VM& vm) { + MIOFILE mf; + char buf[1024], buf2[256]; + + boinc_resolve_filename(JOB_FILENAME, buf, sizeof(buf)); + FILE* f = boinc_fopen(buf, "r"); + if (!f) { + fprintf(stderr, + "%s can't open job file %s\n", + boinc_msg_prefix(buf2, sizeof(buf2)), buf + ); + return ERR_FOPEN; + } + mf.init_file(f); + XML_PARSER xp(&mf); + + if (!xp.parse_start("vbox_job")) return ERR_XML_PARSE; + while (!xp.get_tag()) { + if (!xp.is_tag) { + fprintf(stderr, "%s parse_job_file(): unexpected text %s\n", + boinc_msg_prefix(buf, sizeof(buf)), xp.parsed_tag + ); + continue; + } + if (xp.match_tag("/vbox_job")) { + fclose(f); + return 0; + } + else if (xp.parse_string("os_name", vm.os_name)) continue; + else if (xp.parse_string("memory_size_mb", vm.memory_size_mb)) continue; + else if (xp.parse_double("job_duration", vm.job_duration)) continue; + else if (xp.parse_bool("enable_cern_dataformat", vm.enable_cern_dataformat)) continue; + else if (xp.parse_bool("enable_network", vm.enable_network)) continue; + else if (xp.parse_bool("enable_shared_directory", vm.enable_shared_directory)) continue; + else if (xp.parse_bool("enable_floppyio", vm.enable_floppyio)) continue; + else if (xp.parse_bool("enable_remotedesktop", vm.enable_remotedesktop)) continue; + else if (xp.parse_int("pf_guest_port", vm.pf_guest_port)) continue; + else if (xp.parse_int("pf_host_port", vm.pf_host_port)) continue; + fprintf(stderr, "%s parse_job_file(): unexpected tag %s\n", + boinc_msg_prefix(buf, sizeof(buf)), xp.parsed_tag + ); + } + fclose(f); + return ERR_XML_PARSE; +} + +void write_checkpoint(double cpu, VBOX_VM& vm) { + FILE* f = fopen(CHECKPOINT_FILENAME, "w"); + if (!f) return; + fprintf(f, "%f %d %d\n", cpu, vm.pf_host_port, vm.rd_host_port); + fclose(f); +} + +void read_checkpoint(double& cpu, VBOX_VM& vm) { + double c; + int pf_host; + int rd_host; + cpu = 0.0; + vm.pf_host_port = 0; + vm.rd_host_port = 0; + FILE* f = fopen(CHECKPOINT_FILENAME, "r"); + if (!f) return; + int n = fscanf(f, "%lf %d %d", &c, &pf_host, &rd_host); + fclose(f); + if (n != 3) return; + cpu = c; + vm.pf_host_port = pf_host; + vm.rd_host_port = rd_host; +} + +// set CPU and network throttling if needed +// +void set_throttles(APP_INIT_DATA& aid, VBOX_VM& vm) { + double x = aid.global_prefs.cpu_usage_limit; + if (x && x<100) { + vm.set_cpu_usage_fraction(x/100.); + } + + // vbox doesn't distinguish up and down bandwidth; use the min of the prefs + // + x = aid.global_prefs.max_bytes_sec_up; + double y = aid.global_prefs.max_bytes_sec_down; + if (y) { + if (!x || y\n" + " \n" + " %d\n" + " %d\n" + " \n" + "\n", + vm.pf_host_port, + vm.pf_guest_port + ); + + fclose(f); + + sprintf(buf, "http://localhost:%d", vm.pf_host_port); + boinc_web_graphics_url(buf); + } +} + +// set remote desktop information if needed +// +void set_remote_desktop_info(APP_INIT_DATA& /* aid */, VBOX_VM& vm) { + char buf[256]; + + if (vm.rd_host_port) { + // Write info to disk + // + MIOFILE mf; + FILE* f = boinc_fopen(REMOTEDESKTOP_FILENAME, "w"); + mf.init_file(f); + + mf.printf( + "\n" + " %d\n" + "\n", + vm.rd_host_port + ); + + fclose(f); + + sprintf(buf, "localhost:%d", vm.rd_host_port); + boinc_remote_desktop_addr(buf); + } +} + +int main(int argc, char** argv) { + int retval; + BOINC_OPTIONS boinc_options; + VBOX_VM vm; + APP_INIT_DATA aid; + double elapsed_time = 0.0; + double trickle_period = 0.0; + double trickle_cpu_time = 0.0; + double fraction_done = 0.0; + double checkpoint_cpu_time = 0.0; + double last_status_report_time = 0.0; + double stopwatch_time = 0.0; + double sleep_time = 0.0; + double bytes_sent = 0.0; + double bytes_received = 0.0; + double ncpus = 0.0; + bool report_vm_pid = false; + bool report_net_usage = false; + int vm_pid = 0; + unsigned long vm_exit_code = 0; + std::string vm_log; + std::string system_log; + char buf[256]; + + memset(&boinc_options, 0, sizeof(boinc_options)); + boinc_options.main_program = true; + boinc_options.check_heartbeat = true; + boinc_options.handle_process_control = true; + boinc_init_options(&boinc_options); + + for (int i=1; i 1.0 || ncpus > 1.0) { + if (ncpus) { + sprintf(buf, "%d", (int)ceil(ncpus)); + } else { + sprintf(buf, "%d", (int)ceil(aid.ncpus)); + } + vm.vm_cpu_count = buf; + } else { + vm.vm_cpu_count = "1"; + } + + // Restore from checkpoint + read_checkpoint(checkpoint_cpu_time, vm); + elapsed_time = checkpoint_cpu_time; + + // Should we even try to start things up? + if (vm.job_duration && (elapsed_time > vm.job_duration)) { + return ERR_RSC_LIMIT_EXCEEDED; + } + + retval = vm.run(); + if (retval) { + // Get logs before cleanup + vm.get_system_log(system_log); + vm.get_vm_log(vm_log); + + // Cleanup + vm.cleanup(); + write_checkpoint(elapsed_time, vm); + + fprintf( + stderr, + "%s VM failed to start.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + if ((vm_log.find("VERR_VMX_MSR_LOCKED_OR_DISABLED") != std::string::npos) || (vm_log.find("VERR_SVM_DISABLED") != std::string::npos)) { + fprintf( + stderr, + "%s NOTE: BOINC has detected that your processor supports hardware acceleration for virtual machines\n" + " but the hypervisor failed to successfully launch with this feature enabled. This means that the\n" + " hardware acceleration feature has been disabled in the computers BIOS. Please enable this\n" + " feature in your BIOS.\n" + " Intel Processors call it 'VT-x'\n" + " AMD Processors call it 'AMD-V'\n" + " More information can be found here: http://en.wikipedia.org/wiki/X86_virtualization\n" + " Error Code: ERR_CPU_VM_EXTENSIONS_DISABLED\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else if ((vm_log.find("VERR_VMX_IN_VMX_ROOT_MODE") != std::string::npos) || (vm_log.find("VERR_SVM_IN_USE") != std::string::npos)) { + fprintf( + stderr, + "%s NOTE: VirtualBox hypervisor reports that another hypervisor has locked the hardware acceleration\n" + " for virtual machines feature in exclusive mode. You'll either need to reconfigure the other hypervisor\n" + " to not use the feature exclusively or just let BOINC run this project in software emulation mode.\n" + " Error Code: ERR_CPU_VM_EXTENSIONS_DISABLED\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else if ((vm_log.find("VERR_VMX_NO_VMX") != std::string::npos) || (vm_log.find("VERR_SVM_NO_SVM") != std::string::npos)) { + fprintf( + stderr, + "%s NOTE: VirtualBox has reported an improperly configured virtual machine. It was configured to require\n" + " hardware acceleration for virtual machines, but your processor does not support the required feature.\n" + " Please report this issue to the project so that it can be addresssed.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + } else { + fprintf( + stderr, + "%s Hypervisor System Log:\n\n" + "%s\n" + "%s VM Execution Log:\n\n" + "%s\n", + boinc_msg_prefix(buf, sizeof(buf)), + system_log.c_str(), + boinc_msg_prefix(buf, sizeof(buf)), + vm_log.c_str() + ); + } + + boinc_finish(retval); + } + + set_floppy_image(aid, vm); + set_port_forwarding_info(aid, vm); + set_remote_desktop_info(aid, vm); + set_throttles(aid, vm); + write_checkpoint(elapsed_time, vm); + + while (1) { + // Begin stopwatch timer + stopwatch_time = dtime(); + + // Discover the VM's current state + vm.poll(); + + if (boinc_status.no_heartbeat || boinc_status.quit_request) { + vm.stop(); + write_checkpoint(checkpoint_cpu_time, vm); + boinc_temporary_exit(0); + } + if (boinc_status.abort_request) { + vm.cleanup(); + write_checkpoint(elapsed_time, vm); + boinc_finish(EXIT_ABORTED_BY_CLIENT); + } + if (!vm.online) { + if (vm.crashed || (elapsed_time < vm.job_duration)) { + vm.get_system_log(system_log); + vm.get_vm_log(vm_log); + vm.get_vm_exit_code(vm_exit_code); + } + vm.cleanup(); + write_checkpoint(elapsed_time, vm); + + if (vm.crashed || (elapsed_time < vm.job_duration)) { + fprintf( + stderr, + "%s VM Premature Shutdown Detected.\n" + " Hypervisor System Log:\n\n" + "%s\n" + " VM Execution Log:\n\n" + "%s\n" + " VM Exit Code: %d (0x%x)\n\n", + boinc_msg_prefix(buf, sizeof(buf)), + system_log.c_str(), + vm_log.c_str(), + (unsigned int)vm_exit_code, + (unsigned int)vm_exit_code + ); + if (vm_exit_code) { + boinc_finish(vm_exit_code); + } else { + boinc_finish(EXIT_ABORTED_BY_CLIENT); + } + } else { + fprintf( + stderr, + "%s Virtual machine exited.\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + boinc_finish(0); + } + } + if (boinc_status.suspended) { + if (!vm.suspended) { + vm.pause(); + } + } else { + if (vm.suspended) { + vm.resume(); + } + + elapsed_time += POLL_PERIOD; + + if (!vm_pid) { + vm.get_vm_process_id(vm_pid); + if (vm_pid) { + vm.reset_vm_process_priority(); + report_vm_pid = true; + } + } + + if (boinc_time_to_checkpoint()) { + checkpoint_cpu_time = elapsed_time; + write_checkpoint(checkpoint_cpu_time, vm); + if (vm.job_duration) { + fraction_done = elapsed_time / vm.job_duration; + if (fraction_done > 1.0) { + fraction_done = 1.0; + } + } + boinc_report_app_status( + elapsed_time, + checkpoint_cpu_time, + fraction_done + ); + if ((elapsed_time - last_status_report_time) >= 6000.0) { + last_status_report_time = elapsed_time; + if (aid.global_prefs.daily_xfer_limit_mb) { + fprintf( + stderr, + "%s Status Report: Job Duration: '%f', Elapsed Time: '%f', Network Bytes Sent (Total): '%f', Network Bytes Received (Total): '%f'\n", + boinc_msg_prefix(buf, sizeof(buf)), + vm.job_duration, + elapsed_time, + bytes_sent, + bytes_received + ); + } else { + fprintf( + stderr, + "%s Status Report: Job Duration: '%f', Elapsed Time: '%f'\n", + boinc_msg_prefix(buf, sizeof(buf)), + vm.job_duration, + elapsed_time + ); + } + } + boinc_checkpoint_completed(); + } + + if (report_vm_pid || report_net_usage) { + retval = boinc_report_app_status_aux( + elapsed_time, + checkpoint_cpu_time, + fraction_done, + vm_pid, + bytes_sent, + bytes_received + ); + if (!retval) { + report_vm_pid = false; + report_net_usage = false; + } + } + + if (trickle_period) { + trickle_cpu_time += POLL_PERIOD; + if (trickle_cpu_time >= trickle_period) { + sprintf(buf, "%f", trickle_cpu_time); + boinc_send_trickle_up(const_cast("cpu_time"), buf); + trickle_cpu_time = 0; + } + } + + // if the VM has a maximum amount of time it is allowed to run, + // shut it down gacefully and exit. + // + if (vm.job_duration && (elapsed_time > vm.job_duration)) { + vm.cleanup(); + write_checkpoint(elapsed_time, vm); + boinc_finish(0); + } + } + if (vm.enable_network) { + if (boinc_status.network_suspended) { + if (!vm.network_suspended) { + vm.set_network_access(false); + } + } else { + if (vm.network_suspended) { + vm.set_network_access(true); + } + } + } + if (boinc_status.reread_init_data_file) { + boinc_status.reread_init_data_file = false; + + fprintf( + stderr, + "%s Preference change detected\n", + boinc_msg_prefix(buf, sizeof(buf)) + ); + + boinc_parse_init_data_file(); + boinc_get_init_data_p(&aid); + set_throttles(aid, vm); + } + + // report network usage every 10 min so the client can enforce quota + // + static double net_usage_timer=600; + if (aid.global_prefs.daily_xfer_limit_mb + && vm.enable_network + && !vm.suspended + ) { + net_usage_timer -= POLL_PERIOD; + if (net_usage_timer <= 0) { + net_usage_timer = 600; + double sent, received; + retval = vm.get_network_bytes_sent(sent); + if (!retval && (sent != bytes_sent)) { + bytes_sent = sent; + report_net_usage = true; + } + retval = vm.get_network_bytes_received(received); + if (!retval && (received != bytes_received)) { + bytes_received = received; + report_net_usage = true; + } + } + } + + // Sleep for the remainder of the polling period + sleep_time = POLL_PERIOD - (dtime() - stopwatch_time); + if (sleep_time > 0) { + boinc_sleep(sleep_time); + } + } + +#if defined(_WIN32) && defined(USE_WINSOCK) + WSACleanup(); +#endif +} + +#ifdef _WIN32 + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) { + LPSTR command_line; + char* argv[100]; + int argc; + + command_line = GetCommandLine(); + argc = parse_command_line(command_line, argv); + return main(argc, argv); +} + +#endif diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/vboxwrapper.h boinc-7.0.14+dfsg/samples/vboxwrapper/vboxwrapper.h --- boinc-7.0.7+dfsg/samples/vboxwrapper/vboxwrapper.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/vboxwrapper.h 2012-01-12 15:54:28.000000000 +0000 @@ -0,0 +1,35 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2010-2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + + +// Provide cross-platform interfaces for making changes to VirtualBox + +#ifndef _VBOXWRAPPER_H_ +#define _VBOXWRAPPER_H_ + +#define IMAGE_FILENAME_COMPLETE "vm_image.vdi" +#define IMAGE_FILENAME "vm_image" +#define IMAGE_FILENAME_EXTENSION "vdi" +#define FLOPPY_IMAGE_FILENAME "vm_floppy" +#define FLOPPY_IMAGE_FILENAME_EXTENSION "img" +#define JOB_FILENAME "vbox_job.xml" +#define CHECKPOINT_FILENAME "vbox_checkpoint.txt" +#define PORTFORWARD_FILENAME "vbox_port_forward.xml" +#define REMOTEDESKTOP_FILENAME "vbox_remote_desktop.xml" +#define POLL_PERIOD 1.0 + +#endif diff -Nru boinc-7.0.7+dfsg/samples/vboxwrapper/vboxwrapper.xcodeproj/project.pbxproj boinc-7.0.14+dfsg/samples/vboxwrapper/vboxwrapper.xcodeproj/project.pbxproj --- boinc-7.0.7+dfsg/samples/vboxwrapper/vboxwrapper.xcodeproj/project.pbxproj 2011-09-15 10:33:04.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/vboxwrapper/vboxwrapper.xcodeproj/project.pbxproj 2011-12-22 03:55:32.000000000 +0000 @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ DD3B677B140CF9470088683F /* vbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD90CE9E140CAB3D0074CF46 /* vbox.cpp */; }; DD3B677C140CF9470088683F /* vboxwrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD90CEA0140CAB3D0074CF46 /* vboxwrapper.cpp */; }; + DD52C39614A2D73900FC2A32 /* floppyio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD52C39414A2D73900FC2A32 /* floppyio.cpp */; }; + DD52C39814A2D75900FC2A32 /* floppyio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD52C39414A2D73900FC2A32 /* floppyio.cpp */; }; DD90CEA1140CAB3D0074CF46 /* vbox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD90CE9E140CAB3D0074CF46 /* vbox.cpp */; }; DD90CEA2140CAB3D0074CF46 /* vboxwrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD90CEA0140CAB3D0074CF46 /* vboxwrapper.cpp */; }; /* End PBXBuildFile section */ @@ -16,6 +18,8 @@ /* Begin PBXFileReference section */ 8DD76FB20486AB0100D96B5E /* vboxwrapper_1686 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = vboxwrapper_1686; sourceTree = BUILT_PRODUCTS_DIR; }; DD3B6783140CF9470088683F /* vboxwrapper_x86_64 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = vboxwrapper_x86_64; sourceTree = BUILT_PRODUCTS_DIR; }; + DD52C39414A2D73900FC2A32 /* floppyio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = floppyio.cpp; sourceTree = ""; }; + DD52C39514A2D73900FC2A32 /* floppyio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = floppyio.h; sourceTree = ""; }; DD90CE9E140CAB3D0074CF46 /* vbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vbox.cpp; sourceTree = SOURCE_ROOT; }; DD90CE9F140CAB3D0074CF46 /* vbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vbox.h; sourceTree = SOURCE_ROOT; }; DD90CEA0140CAB3D0074CF46 /* vboxwrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vboxwrapper.cpp; sourceTree = SOURCE_ROOT; }; @@ -51,6 +55,8 @@ 08FB7795FE84155DC02AAC07 /* Source */ = { isa = PBXGroup; children = ( + DD52C39414A2D73900FC2A32 /* floppyio.cpp */, + DD52C39514A2D73900FC2A32 /* floppyio.h */, DD90CE9E140CAB3D0074CF46 /* vbox.cpp */, DD90CE9F140CAB3D0074CF46 /* vbox.h */, DD90CEA0140CAB3D0074CF46 /* vboxwrapper.cpp */, @@ -167,6 +173,7 @@ files = ( DD90CEA1140CAB3D0074CF46 /* vbox.cpp in Sources */, DD90CEA2140CAB3D0074CF46 /* vboxwrapper.cpp in Sources */, + DD52C39614A2D73900FC2A32 /* floppyio.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -176,6 +183,7 @@ files = ( DD3B677B140CF9470088683F /* vbox.cpp in Sources */, DD3B677C140CF9470088683F /* vboxwrapper.cpp in Sources */, + DD52C39814A2D75900FC2A32 /* floppyio.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -185,26 +193,18 @@ 1DEB928608733DD80010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - HEADER_SEARCH_PATHS = ( - ../../clientgui/mac, - "../../**", - "/usr/include/c++/4.0.0/i686-apple-darwin8", - ); PRODUCT_NAME = vboxwrapper_1686; - USER_HEADER_SEARCH_PATHS = "../../clientgui/mac ../../**"; + SDKROOT = macosx10.6; + USER_HEADER_SEARCH_PATHS = ../../clientgui/mac; }; name = Debug; }; 1DEB928708733DD80010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - HEADER_SEARCH_PATHS = ( - ../../clientgui/mac, - "../../**", - "/usr/include/c++/4.0.0/i686-apple-darwin8", - ); PRODUCT_NAME = vboxwrapper_1686; - USER_HEADER_SEARCH_PATHS = "../../clientgui/mac ../../**"; + SDKROOT = macosx10.6; + USER_HEADER_SEARCH_PATHS = ../../clientgui/mac; }; name = Release; }; @@ -223,7 +223,9 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../../clientgui/mac, - "../../**", + ../../lib, + ../../api, + ../.., ); LIBRARY_SEARCH_PATHS = "../../mac_build/build/Development/**"; OTHER_LDFLAGS = ( @@ -252,7 +254,9 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../../clientgui/mac, - "../../**", + ../../lib, + ../../api, + ../.., ); LIBRARY_SEARCH_PATHS = "../../mac_build/build/Deployment/**"; OTHER_LDFLAGS = ( diff -Nru boinc-7.0.7+dfsg/samples/wrapper/wrapper.cpp boinc-7.0.14+dfsg/samples/wrapper/wrapper.cpp --- boinc-7.0.7+dfsg/samples/wrapper/wrapper.cpp 2011-11-03 19:45:34.000000000 +0000 +++ boinc-7.0.14+dfsg/samples/wrapper/wrapper.cpp 2011-11-29 15:06:08.000000000 +0000 @@ -41,15 +41,16 @@ #include #endif -#include "proc_control.h" #include "boinc_api.h" #include "diagnostics.h" +#include "error_numbers.h" #include "filesys.h" #include "parse.h" +#include "proc_control.h" +#include "procinfo.h" #include "str_util.h" #include "str_replace.h" #include "util.h" -#include "error_numbers.h" #define JOB_FILENAME "job.xml" #define CHECKPOINT_FILENAME "wrapper_checkpoint.txt" @@ -485,7 +486,7 @@ thread_handle = process_info.hThread; SetThreadPriority(thread_handle, THREAD_PRIORITY_IDLE); #else - int retval, argc; + int retval; char* argv[256]; char arglist[4096]; FILE* stdout_file; @@ -534,7 +535,7 @@ // argv[0] = app_path; strlcpy(arglist, command_line.c_str(), sizeof(arglist)); - argc = parse_command_line(arglist, argv+1); + parse_command_line(arglist, argv+1); setpriority(PRIO_PROCESS, 0, PROCESS_IDLE_PRIORITY); if (!exec_dir.empty()) { retval = chdir(exec_dir.c_str()); @@ -617,18 +618,7 @@ } double TASK::cpu_time() { -#ifdef _WIN32 - double x; - int retval = boinc_process_cpu_time(pid_handle, x); - if (retval) return wall_cpu_time; - return x; -#elif defined(__APPLE__) - // There's no easy way to get another process's CPU time in Mac OS X - // - return wall_cpu_time; -#else - return linux_cpu_time(pid); -#endif + return process_tree_cpu_time(pid); } void poll_boinc_messages(TASK& task) { @@ -657,17 +647,6 @@ } } -void send_status_message( - TASK& task, double frac_done, double checkpoint_cpu_time -) { - double current_cpu_time = task.starting_cpu + task.cpu_time(); - boinc_report_app_status( - current_cpu_time, - checkpoint_cpu_time, - frac_done - ); -} - // Support for multiple tasks. // We keep a checkpoint file that says how many tasks we've completed // and how much CPU time has been used so far @@ -754,12 +733,14 @@ continue; } double frac_done = weight_completed/total_weight; + double cpu_time = 0; task.starting_cpu = checkpoint_cpu_time; retval = task.run(argc, argv); if (retval) { boinc_finish(retval); } + int counter = 0; while (1) { int status; if (task.poll(status)) { @@ -779,12 +760,25 @@ poll_boinc_messages(task); double task_fraction_done = task.fraction_done(); double delta = task_fraction_done*task.weight/total_weight; - send_status_message(task, frac_done+delta, checkpoint_cpu_time); + + // getting CPU time of task tree is inefficient, + // so do it only every 10 sec + // + if (counter%10 == 0) { + cpu_time = task.cpu_time(); + } + boinc_report_app_status( + task.starting_cpu + cpu_time, + checkpoint_cpu_time, + frac_done + delta + ); if (task.has_checkpointed()) { - checkpoint_cpu_time = task.starting_cpu + task.cpu_time(); + cpu_time = task.cpu_time(); + checkpoint_cpu_time = task.starting_cpu + cpu_time; write_checkpoint(i, checkpoint_cpu_time); } boinc_sleep(POLL_PERIOD); + counter++; } checkpoint_cpu_time = task.starting_cpu + task.final_cpu_time; write_checkpoint(i+1, checkpoint_cpu_time); diff -Nru boinc-7.0.7+dfsg/sched/census.cpp boinc-7.0.14+dfsg/sched/census.cpp --- boinc-7.0.7+dfsg/sched/census.cpp 2010-04-15 03:13:56.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/census.cpp 2012-01-09 17:35:48.000000000 +0000 @@ -15,10 +15,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// Census - create a file saying (for each HR type) -// how much RAC each HR class is getting. -// This info is used the feeder to decide how many shared-memory slots -// to devote to each HR class. +// Census - scan the DB and create summary file: see usage() below #include @@ -32,18 +29,16 @@ void usage(char *name) { fprintf(stderr, - "This program scans the 'host' DB table and creates two files:\n\n" + "This program scans the 'host' DB table and creates a file:\n\n" "%s: how much RAC each HR class is getting\n" " (needed if you use homogeneous redundancy).\n" - "%s: statistics of host performance\n" - " (needed if you use the 'job_size_matching' scheduling option).\n\n" "This should be run as a periodic task (about once a day) from config.xml.\n" "For more info, see http://boinc.berkeley.edu/trac/wiki/HomogeneousRedundancy\n\n" "Usage: %s [OPTION]...\n\n" "Options:\n" " -h --help shows this help text.\n" " -v --version shows version information.\n", - HR_INFO_FILENAME, PERF_INFO_FILENAME, name + HR_INFO_FILENAME, name ); } @@ -86,6 +81,5 @@ hri.init(); hri.scan_db(); hri.write_file(); - hri.perf_info.write_file(); log_messages.printf(MSG_NORMAL, "Finished\n"); } diff -Nru boinc-7.0.7+dfsg/sched/credit.cpp boinc-7.0.14+dfsg/sched/credit.cpp --- boinc-7.0.7+dfsg/sched/credit.cpp 2011-11-03 07:08:52.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/credit.cpp 2011-12-21 03:21:52.000000000 +0000 @@ -28,6 +28,7 @@ #include "error_numbers.h" #include "sched_config.h" +#include "sched_customize.h" #include "sched_msgs.h" #include "sched_util.h" #include "sched_shmem.h" @@ -208,6 +209,13 @@ return 0; } +#define DEFAULT_GPU_SCALE 0.1 +// if there are no CPU versions to compare against, +// multiply pfc_scale of GPU versions by this. +// This reflects the average lower efficiency of GPU apps compared to CPU apps. +// The observed values from SETI@home and Milkyway are 0.05 and 0.08. +// We'll be a little generous and call it 0.1 + // Update app version scale factors, // and find the min average PFC for each app. // Called periodically from the master feeder. @@ -233,7 +241,7 @@ retval = av.lookup_id(avr.id); if (retval) return retval; avr = av; // update shared mem array - if (strstr(av.plan_class, "cuda") || strstr(av.plan_class, "ati")) { + if (app_plan_uses_gpu(av.plan_class)) { if (config.debug_credit) { log_messages.printf(MSG_NORMAL, "add to gpu totals: (%d %s) %g %g\n", @@ -275,11 +283,11 @@ "CPU avg: %g\n", cpu_info.avg() ); scale_versions(app, cpu_info.avg(), ssp); - } else if (gpu_info.nvers_thresh > 1) { + } else if (gpu_info.nvers_thresh > 0) { log_messages.printf(MSG_NORMAL, "GPU avg: %g\n", gpu_info.avg() ); - scale_versions(app, gpu_info.avg(), ssp); + scale_versions(app, gpu_info.avg()*DEFAULT_GPU_SCALE, ssp); } } diff -Nru boinc-7.0.7+dfsg/sched/feeder.cpp boinc-7.0.14+dfsg/sched/feeder.cpp --- boinc-7.0.7+dfsg/sched/feeder.cpp 2011-11-09 20:24:48.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/feeder.cpp 2012-01-20 23:48:07.000000000 +0000 @@ -161,18 +161,6 @@ return; } -// put this here (instead of hr_info.C) so that FCGI compile -// won't choke on fscanf() -// -int PERF_INFO::read_file() { - FILE* f = fopen(PERF_INFO_FILENAME, "r"); - if (!f) return ERR_FOPEN; - int n = fscanf(f, "%lf %lf", &host_fpops_mean, &host_fpops_stdev); - fclose(f); - if (n != 2) return -1; - return 0; -} - void cleanup_shmem() { ssp->ready = false; detach_shmem((void*)ssp); @@ -190,6 +178,7 @@ ); ssp->init(num_work_items); ssp->scan_tables(); + ssp->perf_info.get_from_db(); int retval = unlink(config.project_path(REREAD_DB_FILENAME)); if (retval) { // if we can't remove trigger file, exit to avoid infinite loop @@ -870,14 +859,11 @@ ); } - if (config.job_size_matching) { - retval = ssp->perf_info.read_file(); - if (retval) { - log_messages.printf(MSG_CRITICAL, - "can't read perf_info file; run census\n" - ); - exit(1); - } + retval = ssp->perf_info.get_from_db(); + if (retval) { + log_messages.printf(MSG_CRITICAL, + "PERF_INFO::get_from_db(): %d\n", retval + ); } signal(SIGUSR1, show_state); @@ -885,4 +871,4 @@ feeder_loop(); } -const char *BOINC_RCSID_57c87aa242 = "$Id: feeder.cpp 24564 2011-11-09 20:24:48Z jeffc $"; +const char *BOINC_RCSID_57c87aa242 = "$Id: feeder.cpp 25114 2012-01-20 23:48:07Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/file_deleter.cpp boinc-7.0.14+dfsg/sched/file_deleter.cpp --- boinc-7.0.7+dfsg/sched/file_deleter.cpp 2011-09-27 19:45:27.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/file_deleter.cpp 2012-01-13 23:39:14.000000000 +0000 @@ -68,7 +68,7 @@ #define PIDFILE "file_deleter.pid" #define DEFAULT_SLEEP_INTERVAL 5 -#define RESULTS_PER_WU 4 // an estimate of redundancy +#define RESULTS_PER_WU 4 // an estimate of redundancy int id_modulus=0, id_remainder=0, appid=0; bool dont_retry_errors = false; @@ -143,12 +143,12 @@ char* p; char filename[256], pathname[256], buf[BLOB_SIZE]; bool no_delete=false; - int count_deleted = 0, retval, mthd_retval = 0; + int count_deleted = 0, count_deleted_md5 = 0, retval, mthd_retval = 0; if (strstr(wu.name, "nodelete")) return 0; safe_strcpy(buf, wu.xml_doc); - + p = strtok(buf, "\n"); strcpy(filename, ""); while (p) { @@ -167,7 +167,7 @@ if (retval == ERR_OPENDIR) { log_messages.printf(MSG_CRITICAL, "[WU#%d] missing dir for %s\n", - wu.id, filename + wu.id, pathname ); mthd_retval = ERR_UNLINK; } else if (retval) { @@ -176,14 +176,14 @@ wu.id, filename, boincerror(retval) ); } else { - log_messages.printf(MSG_NORMAL, - "[WU#%d] deleting %s\n", wu.id, filename + log_messages.printf(MSG_DEBUG, + "[WU#%d] deleting %s\n", wu.id, pathname ); retval = unlink(pathname); if (retval) { log_messages.printf(MSG_CRITICAL, "[WU#%d] unlink %s failed: %s\n", - wu.id, filename, boincerror(retval) + wu.id, pathname, boincerror(retval) ); mthd_retval = ERR_UNLINK; } else { @@ -193,15 +193,17 @@ // if (config.cache_md5_info) { strcat(pathname,".md5"); - log_messages.printf(MSG_NORMAL, - "[WU#%d] deleting %s\n", wu.id, filename + log_messages.printf(MSG_DEBUG, + "[WU#%d] deleting %s\n", wu.id, pathname ); retval = unlink(pathname); if (retval) { log_messages.printf(MSG_CRITICAL, "[WU#%d] unlink %s failed: %s\n", - wu.id, filename, boincerror(retval) + wu.id, pathname, boincerror(retval) ); + } else { + count_deleted_md5++; } } } @@ -209,8 +211,9 @@ } p = strtok(0, "\n"); } - log_messages.printf(MSG_DEBUG, - "[WU#%d] deleted %d file(s)\n", wu.id, count_deleted + log_messages.printf(MSG_NORMAL, + "[WU#%d] deleted %d input files and %d cached md5 files\n", + wu.id, count_deleted, count_deleted_md5 ); return mthd_retval; } @@ -269,7 +272,7 @@ ); } else { count_deleted++; - log_messages.printf(MSG_NORMAL, + log_messages.printf(MSG_DEBUG, "[RESULT#%d] unlinked %s\n", result.id, pathname ); } @@ -279,8 +282,8 @@ p = strtok(0, "\n"); } - log_messages.printf(MSG_DEBUG, - "[RESULT#%d] deleted %d file(s)\n", result.id, count_deleted + log_messages.printf(MSG_NORMAL, + "[RESULT#%d] deleted %d output file(s)\n", result.id, count_deleted ); return mthd_retval; } @@ -354,7 +357,7 @@ ); did_something = true; } - } + } } sprintf(buf, @@ -387,7 +390,7 @@ new_state = FILE_DELETE_DONE; } if (new_state != result.file_delete_state) { - sprintf(buf, "file_delete_state=%d", new_state); + sprintf(buf, "file_delete_state=%d", new_state); retval = result.update_field(buf); if (retval) { log_messages.printf(MSG_CRITICAL, @@ -399,8 +402,8 @@ ); did_something = true; } - } - } + } + } return did_something; } @@ -461,7 +464,7 @@ strcpy(timestamp, time_to_string(fr.date_modified)); log_messages.printf(MSG_DEBUG, "deleting [antique %s] %s\n", - timestamp, pathname + timestamp, pathname ); if (unlink(pathname)) { int save_error=errno; @@ -506,7 +509,7 @@ ); sprintf(command, "find %s -type f -mtime +%d -follow | head -%d", config.upload_dir, days, antique_limit); - + // Now execute the command, read output on a stream. We could use // find to also exec a 'delete' command. But we want to log all // file names into the log, and do lots of sanity checking, so @@ -576,12 +579,12 @@ fr.name = fname_at_end; files_to_delete.push_back(fr); nfiles++; - - } // while (fgets(single_line, 1024, fp)) { + + } // while (fgets(single_line, 1024, fp)) { pclose(fp); log_messages.printf(MSG_DEBUG, "Found %d antique files to delete\n", - nfiles + nfiles ); files_to_delete.sort(); files_to_delete.unique(); @@ -645,7 +648,7 @@ bool one_pass = false; int i; DB_APP app; - + check_stop_daemons(); *app.name='\0'; @@ -750,7 +753,7 @@ } if (*app.name && !appid) { - char buf[256]; + char buf[256]; sprintf(buf, "where name='%s'", app.name); retval = app.lookup(buf); if (retval) { @@ -800,4 +803,4 @@ } } -const char *BOINC_RCSID_bd0d4938a6 = "$Id: file_deleter.cpp 24303 2011-09-27 19:45:27Z davea $"; +const char *BOINC_RCSID_bd0d4938a6 = "$Id: file_deleter.cpp 25050 2012-01-13 23:39:14Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/handle_request.cpp boinc-7.0.14+dfsg/sched/handle_request.cpp --- boinc-7.0.7+dfsg/sched/handle_request.cpp 2011-10-08 05:17:44.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/handle_request.cpp 2011-12-29 06:30:18.000000000 +0000 @@ -499,8 +499,8 @@ g_request->coprocs.summary_string(buf2, sizeof(buf2)); strlcpy(host.serialnum, buf, sizeof(host.serialnum)); strlcat(host.serialnum, buf2, sizeof(host.serialnum)); - if (strlen(host.virtualbox_version)) { - sprintf(buf2, "[vbox|%s]", host.virtualbox_version); + if (strlen(g_request->host.virtualbox_version)) { + sprintf(buf2, "[vbox|%s]", g_request->host.virtualbox_version); strlcat(host.serialnum, buf2, sizeof(host.serialnum)); } if (strcmp(host.last_ip_addr, g_request->host.last_ip_addr)) { @@ -1362,7 +1362,6 @@ g_reply = &sreply; g_wreq = &sreply.wreq; - memset(&sreq, 0, sizeof(sreq)); sreply.nucleus_only = true; log_messages.set_indent_level(1); @@ -1398,4 +1397,4 @@ } } -const char *BOINC_RCSID_2ac231f9de = "$Id: handle_request.cpp 24353 2011-10-08 05:17:44Z davea $"; +const char *BOINC_RCSID_2ac231f9de = "$Id: handle_request.cpp 24937 2011-12-29 06:30:18Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/hr_info.cpp boinc-7.0.14+dfsg/sched/hr_info.cpp --- boinc-7.0.7+dfsg/sched/hr_info.cpp 2011-03-18 08:20:11.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/hr_info.cpp 2012-01-09 17:35:48.000000000 +0000 @@ -120,15 +120,6 @@ fprintf(stderr, "host enum: %d", retval); exit(1); } - // if no hosts, use reasonable defaults - // - if (n) { - perf_info.host_fpops_mean = sum/n; - perf_info.host_fpops_stdev = sqrt((sum_sqr - sum*perf_info.host_fpops_mean)/n); - } else { - perf_info.host_fpops_mean = 3e9; - perf_info.host_fpops_stdev = 1e9; - } } void HR_INFO::allocate(int total_slots) { @@ -211,18 +202,3 @@ } } } - -int PERF_INFO::write_file() { -#ifndef _USING_FCGI_ - FILE* f = fopen(PERF_INFO_FILENAME, "w"); -#else - FCGI_FILE* f = FCGI::fopen(PERF_INFO_FILENAME, "w"); -#endif - if (!f) return ERR_FOPEN; - fprintf(f, "%f %f\n", - host_fpops_mean, - host_fpops_stdev - ); - fclose(f); - return 0; -} diff -Nru boinc-7.0.7+dfsg/sched/hr_info.h boinc-7.0.14+dfsg/sched/hr_info.h --- boinc-7.0.7+dfsg/sched/hr_info.h 2008-08-06 18:36:30.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/hr_info.h 2012-01-09 17:35:48.000000000 +0000 @@ -20,19 +20,6 @@ #include "hr.h" -// statistics about the host population, -// and about the set of jobs in shared mem. -// -struct PERF_INFO { - double host_fpops_mean; - double host_fpops_stdev; - double wu_fpops_mean; - double wu_fpops_stdev; - - int write_file(); - int read_file(); -}; - struct HR_INFO { double *rac_per_class[HR_NTYPES]; // how much RAC per class @@ -46,7 +33,6 @@ // # of slots per type (fixed at start) bool type_being_used[HR_NTYPES]; // whether any app is actually using this HR type - PERF_INFO perf_info; int write_file(); int read_file(); @@ -59,6 +45,5 @@ }; #define HR_INFO_FILENAME "../hr_info.txt" -#define PERF_INFO_FILENAME "../perf_info.txt" #endif diff -Nru boinc-7.0.7+dfsg/sched/sched_assign.cpp boinc-7.0.14+dfsg/sched/sched_assign.cpp --- boinc-7.0.7+dfsg/sched/sched_assign.cpp 2011-11-09 20:24:48.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_assign.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -15,6 +15,9 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . // + +// scheduler functions to send assigned jobs. + #include "config.h" #ifdef _USING_FCGI_ @@ -38,10 +41,12 @@ #include "sched_assign.h" +// send a job for the given assignment +// static int send_assigned_job(ASSIGNMENT& asg) { int retval; DB_WORKUNIT wu; - char suffix[256], path[256], buf[256]; + char suffix[256], path[256]; const char *rtfpath; static bool first=true; static int seqno=0; @@ -90,22 +95,6 @@ retval = result.lookup_id(result_id); add_result_to_reply(result, wu, bavp, false); - // if this is a one-job assignment, fill in assignment.resultid - // so that it doesn't get sent again - // - if (!asg.multi && asg.target_type!=ASSIGN_NONE) { - DB_ASSIGNMENT db_asg; - db_asg.id = asg.id; - sprintf(buf, "resultid=%u", result_id); - retval = db_asg.update_field(buf); - if (retval) { - log_messages.printf(MSG_CRITICAL, - "assign update failed: %s\n", boincerror(retval) - ); - return retval; - } - asg.resultid = result_id; - } if (config.debug_assignment) { log_messages.printf(MSG_NORMAL, "[assign] [WU#%d] [RESULT#%d] [HOST#%d] send assignment %d\n", @@ -115,27 +104,26 @@ return 0; } -// Send this host any jobs assigned to it, or to its user/team +// Send this host any "multi" assigned jobs. // Return true iff we sent anything // -bool send_assigned_jobs() { +bool send_assigned_jobs_multi() { DB_RESULT result; int retval; char buf[256]; bool sent_something = false; for (int i=0; inassignments; i++) { - if (!work_needed(false)) break; ASSIGNMENT& asg = ssp->assignments[i]; if (config.debug_assignment) { log_messages.printf(MSG_NORMAL, - "[assign] processing assignment type %d\n", asg.target_type + "[assign] processing multi assignment type %d\n", + asg.target_type ); } // see if this assignment applies to this host // - if (asg.resultid) continue; switch (asg.target_type) { case ASSIGN_NONE: sprintf(buf, "where hostid=%d and workunitid=%d", @@ -147,22 +135,11 @@ if (!retval) sent_something = true; } break; - case ASSIGN_HOST: - if (g_reply->host.id != asg.target_id) continue; - sprintf(buf, "where workunitid=%d", asg.workunitid); - retval = result.lookup(buf); - if (retval == ERR_DB_NOT_FOUND) { - retval = send_assigned_job(asg); - if (!retval) sent_something = true; - } - break; case ASSIGN_USER: if (g_reply->user.id != asg.target_id) continue; - if (asg.multi) { - sprintf(buf, "where workunitid=%d and hostid=%d", asg.workunitid, g_reply->host.id); - } else { - sprintf(buf, "where workunitid=%d", asg.workunitid); - } + sprintf(buf, "where workunitid=%d and hostid=%d", + asg.workunitid, g_reply->host.id + ); retval = result.lookup(buf); if (retval == ERR_DB_NOT_FOUND) { retval = send_assigned_job(asg); @@ -171,11 +148,7 @@ break; case ASSIGN_TEAM: if (g_reply->team.id != asg.target_id) continue; - if (asg.multi) { - sprintf(buf, "where workunitid=%d and hostid=%d", asg.workunitid, g_reply->host.id); - } else { - sprintf(buf, "where workunitid=%d", asg.workunitid); - } + sprintf(buf, "where workunitid=%d and hostid=%d", asg.workunitid, g_reply->host.id); retval = result.lookup(buf); if (retval == ERR_DB_NOT_FOUND) { retval = send_assigned_job(asg); @@ -186,3 +159,76 @@ } return sent_something; } + +// send non-multi assigned jobs +// +bool send_assigned_jobs() { + DB_ASSIGNMENT asg; + DB_RESULT result; + DB_WORKUNIT wu; + bool sent_something = false; + int retval; + + // for now, only look for user assignments + // + char buf[256]; + sprintf(buf, "target_type=%d and target_id=%d and multi=0", + ASSIGN_USER, g_reply->user.id + ); + while (asg.enumerate(buf)) { + if (!work_needed(false)) continue; + + // if the WU doesn't exist, delete the assignment record. + // + retval = wu.lookup_id(asg.workunitid); + if (retval) { + asg.delete_from_db(); + continue; + } + // don't send if WU is validation pending or completed, + // or has transition pending + // + if (wu.need_validate) continue; + if (wu.canonical_resultid) continue; + if (wu.transition_time < time(0)) continue; + + // don't send if we already sent one to this host + // + sprintf(buf, "where workunitid=%d and hostid=%d", + asg.workunitid, + g_request->host.id + ); + retval = result.lookup(buf); + if (retval != ERR_DB_NOT_FOUND) continue; + + // don't send if there's already one in progress to this user + // + sprintf(buf, + "where workunitid=%d and userid=%d and server_state=%d", + asg.workunitid, + g_reply->user.id, + RESULT_SERVER_STATE_IN_PROGRESS + ); + retval = result.lookup(buf); + if (retval != ERR_DB_NOT_FOUND) continue; + + // OK, send the job + // + retval = send_assigned_job(asg); + if (retval) continue; + + sent_something = true; + + // update the WU's transition time to time out this job + // + retval = wu.lookup_id(asg.workunitid); + if (retval) continue; + int new_tt = time(0) + wu.delay_bound; + if (new_tt < wu.transition_time) { + char buf2[256]; + sprintf(buf2, "transition_time=%d", new_tt); + wu.update_field(buf2); + } + } + return sent_something; +} diff -Nru boinc-7.0.7+dfsg/sched/sched_assign.h boinc-7.0.14+dfsg/sched/sched_assign.h --- boinc-7.0.7+dfsg/sched/sched_assign.h 2008-12-19 18:14:02.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_assign.h 2012-01-30 22:39:13.000000000 +0000 @@ -16,3 +16,4 @@ // along with BOINC. If not, see . extern bool send_assigned_jobs(); +extern bool send_assigned_jobs_multi(); diff -Nru boinc-7.0.7+dfsg/sched/sched_config.cpp boinc-7.0.14+dfsg/sched/sched_config.cpp --- boinc-7.0.7+dfsg/sched/sched_config.cpp 2011-08-10 17:11:08.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_config.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -173,6 +173,7 @@ if (xp.parse_int("feeder_query_size", feeder_query_size)) continue; if (xp.parse_str("httpd_user", httpd_user, sizeof(httpd_user))) continue; if (xp.parse_bool("enable_assignment", enable_assignment)) continue; + if (xp.parse_bool("enable_assignment_multi", enable_assignment_multi)) continue; if (xp.parse_bool("job_size_matching", job_size_matching)) continue; if (xp.parse_bool("dont_send_jobs", dont_send_jobs)) continue; @@ -404,4 +405,4 @@ return (const char *)path; } -const char *BOINC_RCSID_3704204cfd = "$Id: sched_config.cpp 23978 2011-08-10 17:11:08Z davea $"; +const char *BOINC_RCSID_3704204cfd = "$Id: sched_config.cpp 25169 2012-01-30 22:39:13Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/sched_config.h boinc-7.0.14+dfsg/sched/sched_config.h --- boinc-7.0.7+dfsg/sched/sched_config.h 2011-05-17 21:11:39.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_config.h 2012-01-30 22:39:13.000000000 +0000 @@ -95,6 +95,7 @@ char httpd_user[256]; // user name under which web server runs (default: apache) bool enable_assignment; + bool enable_assignment_multi; bool job_size_matching; bool dont_send_jobs; diff -Nru boinc-7.0.7+dfsg/sched/sched_customize.cpp boinc-7.0.14+dfsg/sched/sched_customize.cpp --- boinc-7.0.7+dfsg/sched/sched_customize.cpp 2011-11-03 05:26:19.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_customize.cpp 2012-02-01 03:30:14.000000000 +0000 @@ -120,20 +120,19 @@ // the following is for an app that can use anywhere from 1 to 64 threads // -static inline bool app_plan_mt( - SCHEDULER_REQUEST& sreq, HOST_USAGE& hu -) { +static inline bool app_plan_mt(SCHEDULER_REQUEST&, HOST_USAGE& hu) { double ncpus = g_wreq->effective_ncpus; // number of usable CPUs, taking user prefs into account + if (ncpus < 2) return false; int nthreads = (int)ncpus; if (nthreads > 64) nthreads = 64; hu.avg_ncpus = nthreads; hu.max_ncpus = nthreads; sprintf(hu.cmdline, "--nthreads %d", nthreads); - hu.projected_flops = sreq.host.p_fpops*hu.avg_ncpus*.99; + hu.projected_flops = capped_host_fpops()*hu.avg_ncpus*.99; // the .99 ensures that on uniprocessors a sequential app // will be used in preferences to this - hu.peak_flops = sreq.host.p_fpops*hu.avg_ncpus; + hu.peak_flops = capped_host_fpops()*hu.avg_ncpus; if (config.debug_version_select) { log_messages.printf(MSG_NORMAL, "[version] Multi-thread app projected %.2fGS\n", @@ -175,13 +174,13 @@ hu.natis = ndevs; coproc_perf( - g_request->host.p_fpops, + capped_host_fpops(), flops_scale * hu.natis*c.peak_flops, cpu_frac, hu.projected_flops, hu.avg_ncpus ); - hu.peak_flops = hu.natis*c.peak_flops + hu.avg_ncpus*g_request->host.p_fpops; + hu.peak_flops = hu.natis*c.peak_flops + hu.avg_ncpus*capped_host_fpops(); hu.max_ncpus = hu.avg_ncpus; return true; } @@ -197,7 +196,7 @@ if (!strcmp(plan_class, "ati")) { if (!ati_check(c, hu, - 1000000, + ati_version_int(1, 0, 0), true, ATI_MIN_RAM, 1, @@ -210,7 +209,7 @@ if (!strcmp(plan_class, "ati13amd")) { if (!ati_check(c, hu, - 1003000, + ati_version_int(1, 3, 0), true, ATI_MIN_RAM, 1, .01, @@ -222,7 +221,7 @@ if (!strcmp(plan_class, "ati13ati")) { if (!ati_check(c, hu, - 1003186, + ati_version_int(1, 3, 186), false, ATI_MIN_RAM, 1, .01, @@ -234,7 +233,7 @@ if (!strcmp(plan_class, "ati14")) { if (!ati_check(c, hu, - 1004000, + ati_version_int(1, 4, 0), false, ATI_MIN_RAM, 1, .01, @@ -304,13 +303,13 @@ hu.ncudas = ndevs; coproc_perf( - g_request->host.p_fpops, + capped_host_fpops(), flops_scale * hu.ncudas*c.peak_flops, cpu_frac, hu.projected_flops, hu.avg_ncpus ); - hu.peak_flops = hu.ncudas*c.peak_flops + hu.avg_ncpus*g_request->host.p_fpops; + hu.peak_flops = hu.ncudas*c.peak_flops + hu.avg_ncpus*capped_host_fpops(); hu.max_ncpus = hu.avg_ncpus; return true; } @@ -393,15 +392,13 @@ // Say that we'll use 1% of a CPU. // This will cause the client (6.7+) to run it at non-idle priority // -static inline bool app_plan_nci( - SCHEDULER_REQUEST& sreq, HOST_USAGE& hu -) { +static inline bool app_plan_nci(SCHEDULER_REQUEST&, HOST_USAGE& hu) { hu.avg_ncpus = .01; hu.max_ncpus = .01; - hu.projected_flops = sreq.host.p_fpops*1.01; + hu.projected_flops = capped_host_fpops()*1.01; // The *1.01 is needed to ensure that we'll send this app // version rather than a non-plan-class one - hu.peak_flops = sreq.host.p_fpops*.01; + hu.peak_flops = capped_host_fpops()*.01; return true; } @@ -422,8 +419,8 @@ } hu.avg_ncpus = 1; hu.max_ncpus = 1; - hu.projected_flops = 1.1*sreq.host.p_fpops; - hu.peak_flops = sreq.host.p_fpops; + hu.projected_flops = 1.1*capped_host_fpops(); + hu.peak_flops = capped_host_fpops(); return true; } @@ -450,13 +447,13 @@ } coproc_perf( - g_request->host.p_fpops, + capped_host_fpops(), flops_scale * ndevs * cp.peak_flops, cpu_frac, hu.projected_flops, hu.avg_ncpus ); - hu.peak_flops = ndevs*cp.peak_flops + hu.avg_ncpus*g_request->host.p_fpops; + hu.peak_flops = ndevs*cp.peak_flops + hu.avg_ncpus*capped_host_fpops(); hu.max_ncpus = hu.avg_ncpus; return true; } @@ -502,6 +499,9 @@ ); return false; } + + // maybe add a clause for multicore CPU + } else { log_messages.printf(MSG_CRITICAL, "Unknown plan class: %s\n", plan_class @@ -510,10 +510,16 @@ } } +// handles vbox_[32|64][_mt] +// "mt" is tailored to the needs of CERN: +// use 1 or 2 CPUs + static inline bool app_plan_vbox( - SCHEDULER_REQUEST& sreq, HOST_USAGE& hu, bool is_64bit + SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu ) { - // make sure they have VirtualBox + bool can_use_multicore = true; + + // host must have VirtualBox 3.2 or later // if (strlen(sreq.host.virtualbox_version) == 0) return false; int n, maj, min, rel; @@ -522,19 +528,53 @@ if (maj < 3) return false; if (maj == 3 and min < 2) return false; + // host must have VM acceleration in order to run multi-core jobs + // + if (strstr(plan_class, "mt")) { + if ((!strstr(sreq.host.p_features, "vmx") && !strstr(sreq.host.p_features, "svm")) + || sreq.host.p_vm_extensions_disabled + ) { + can_use_multicore = false; + } + } + // only send the version for host's primary platform. // A Win64 host can't run a 32-bit VM app: // it will look in the 32-bit half of the registry and fail // PLATFORM* p = g_request->platforms.list[0]; - if (is_64bit != is_64b_platform(p->name)) { - return false; + if (is_64b_platform(p->name)) { + if (!strstr(plan_class, "64")) return false; + } else { + if (strstr(plan_class, "64")) return false; } + double flops_scale = 1; hu.avg_ncpus = 1; hu.max_ncpus = 1; - hu.projected_flops = 1.1*sreq.host.p_fpops; - hu.peak_flops = sreq.host.p_fpops; + if (strstr(plan_class, "mt")) { + if (can_use_multicore) { + // Use number of usable CPUs, taking user prefs into account + double ncpus = g_wreq->effective_ncpus; + // CernVM on average uses between 25%-50% of a second core + // Total on a dual-core machine is between 65%-75% + if (ncpus > 1.5) ncpus = 1.5; + hu.avg_ncpus = ncpus; + hu.max_ncpus = 2.0; + sprintf(hu.cmdline, "--nthreads %f", ncpus); + } + // use the non-mt version rather than the mt version with 1 CPU + // + flops_scale = .99; + } + hu.projected_flops = flops_scale * capped_host_fpops()*hu.avg_ncpus; + hu.peak_flops = capped_host_fpops()*hu.max_ncpus; + if (config.debug_version_select) { + log_messages.printf(MSG_NORMAL, + "[version] %s app projected %.2fG\n", + plan_class, hu.projected_flops/1e9 + ); + } return true; } @@ -544,6 +584,8 @@ bool app_plan(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu) { if (!strcmp(plan_class, "mt")) { return app_plan_mt(sreq, hu); + } else if (strstr(plan_class, "opencl")) { + return app_plan_opencl(sreq, plan_class, hu); } else if (strstr(plan_class, "ati")) { return app_plan_ati(sreq, plan_class, hu); } else if (strstr(plan_class, "cuda")) { @@ -552,12 +594,8 @@ return app_plan_nci(sreq, hu); } else if (!strcmp(plan_class, "sse3")) { return app_plan_sse3(sreq, hu); - } else if (!strcmp(plan_class, "vbox32")) { - return app_plan_vbox(sreq, hu, false); - } else if (!strcmp(plan_class, "vbox64")) { - return app_plan_vbox(sreq, hu, true); - } else if (strstr(plan_class, "opencl")) { - return app_plan_opencl(sreq, plan_class, hu); + } else if (strstr(plan_class, "vbox")) { + return app_plan_vbox(sreq, plan_class, hu); } log_messages.printf(MSG_CRITICAL, "Unknown plan class: %s\n", plan_class @@ -565,22 +603,6 @@ return false; } -// the following is used to enforce limits on in-progress jobs -// for GPUs and CPUs (see handle_request.cpp) -// -bool app_plan_uses_gpu(const char* plan_class) { - if (strstr(plan_class, "cuda")) { - return true; - } - if (strstr(plan_class, "nvidia")) { - return true; - } - if (strstr(plan_class, "ati")) { - return true; - } - return false; -} - // compute a "score" for sending this job to this host. // Return false if the WU is infeasible. // Otherwise set est_time and disk_usage. @@ -670,7 +692,7 @@ // match large jobs to fast hosts // if (config.job_size_matching) { - double host_stdev = (g_reply->host.p_fpops - ssp->perf_info.host_fpops_mean)/ ssp->perf_info.host_fpops_stdev; + double host_stdev = (capped_host_fpops() - ssp->perf_info.host_fpops_mean)/ ssp->perf_info.host_fpops_stddev; double diff = host_stdev - wu_result.fpops_size; score -= diff*diff; } diff -Nru boinc-7.0.7+dfsg/sched/sched_customize.h boinc-7.0.14+dfsg/sched/sched_customize.h --- boinc-7.0.7+dfsg/sched/sched_customize.h 2011-10-07 18:11:52.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_customize.h 2011-12-01 18:44:19.000000000 +0000 @@ -60,5 +60,4 @@ extern bool wu_is_infeasible_custom(WORKUNIT&, APP&, BEST_APP_VERSION&); extern bool app_plan(SCHEDULER_REQUEST&, char* plan_class, HOST_USAGE&); -extern bool app_plan_uses_gpu(const char* plan_class); extern void handle_file_xfer_results(); diff -Nru boinc-7.0.7+dfsg/sched/sched_result.cpp boinc-7.0.14+dfsg/sched/sched_result.cpp --- boinc-7.0.7+dfsg/sched/sched_result.cpp 2011-07-31 17:31:12.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_result.cpp 2011-12-26 14:31:14.000000000 +0000 @@ -96,7 +96,6 @@ unsigned int i; int retval; RESULT* rp; - bool changed_host=false; if (g_request->results.size() == 0) return 0; @@ -283,7 +282,6 @@ "[HOST#%d] [RESULT#%d] [WU#%d] Allowing result because same USER#%d\n", g_reply->host.id, srip->id, srip->workunitid, g_reply->host.userid ); - changed_host = true; } } // hostids do not match @@ -298,6 +296,20 @@ srip->cpu_time = rp->cpu_time; srip->elapsed_time = rp->elapsed_time; + // Some buggy clients sporadically report very low elapsed time + // but actual CPU time. + // Try to fix the elapsed time, since it's critical to credit + // + if (srip->elapsed_time < srip->cpu_time) { + int avid = srip->app_version_id; + if (avid > 0) { + APP_VERSION* avp = ssp->lookup_app_version(avid); + if (avp && !avp->is_multithread()) { + srip->elapsed_time = srip->cpu_time; + } + } + } + // check for impossible elapsed time // if (srip->elapsed_time < 0) { @@ -325,20 +337,6 @@ } } - // Some buggy clients sporadically report very low elapsed time - // but actual CPU time. - // Try to fix the elapsed time, since it's critical to credit - // - if (srip->elapsed_time < srip->cpu_time) { - int avid = srip->app_version_id; - if (avid > 0) { - APP_VERSION* avp = ssp->lookup_app_version(avid); - if (avp && !avp->is_multithread()) { - srip->elapsed_time = srip->cpu_time; - } - } - } - srip->exit_status = rp->exit_status; srip->app_version_num = rp->app_version_num; srip->server_state = RESULT_SERVER_STATE_OVER; diff -Nru boinc-7.0.7+dfsg/sched/sched_send.cpp boinc-7.0.14+dfsg/sched/sched_send.cpp --- boinc-7.0.7+dfsg/sched/sched_send.cpp 2011-11-09 23:50:09.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_send.cpp 2012-02-02 00:18:42.000000000 +0000 @@ -1737,7 +1737,7 @@ ); if (g_wreq->anonymous_platform) { log_messages.printf(MSG_NORMAL, - "Anonymous platform app versions:\n" + "[send] Anonymous platform app versions:\n" ); for (i=0; iclient_app_versions.size(); i++) { CLIENT_APP_VERSION& cav = g_request->client_app_versions[i]; @@ -1752,6 +1752,13 @@ ); } } + log_messages.printf(MSG_NORMAL, + "[send] p_vm_extensions_disabled: %s\n", + g_request->host.p_vm_extensions_disabled?"yes":"no" + ); + log_messages.printf(MSG_NORMAL, + "[send] CPU features: %s\n", g_request->host.p_features + ); } } @@ -1846,6 +1853,17 @@ } } + if (config.enable_assignment_multi) { + if (send_assigned_jobs_multi()) { + if (config.debug_assignment) { + log_messages.printf(MSG_NORMAL, + "[assign] [HOST#%d] sent assigned jobs\n", g_reply->host.id + ); + } + goto done; + } + } + if (config.workload_sim && g_request->have_other_results_list) { init_ip_results( g_request->global_prefs.work_buf_min(), @@ -1899,4 +1917,4 @@ send_user_messages(); } -const char *BOINC_RCSID_32dcd335e7 = "$Id: sched_send.cpp 24567 2011-11-09 23:50:09Z davea $"; +const char *BOINC_RCSID_32dcd335e7 = "$Id: sched_send.cpp 25183 2012-02-02 00:18:42Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/sched_shmem.cpp boinc-7.0.14+dfsg/sched/sched_shmem.cpp --- boinc-7.0.7+dfsg/sched/sched_shmem.cpp 2011-11-09 20:24:48.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_shmem.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -184,7 +184,7 @@ } n = 0; - while (!assignment.enumerate()) { + while (!assignment.enumerate("multi <> 0")) { assignments[n++] = assignment; if (n == MAX_ASSIGNMENTS) { overflow("assignments", "MAX_ASSIGNMENTS"); @@ -236,6 +236,19 @@ return NULL; } +APP_VERSION* SCHED_SHMEM::lookup_app_version_platform_plan_class( + int platformid, char* plan_class +) { + APP_VERSION* avp; + for (int i=0; iplatformid == platformid && !strcmp(avp->plan_class, plan_class)) { + return avp; + } + } + return NULL; +} + // see if there's any work. // If there is, reserve it for this process // (if we don't do this, there's a race condition where lots @@ -286,6 +299,14 @@ "hr: HR class\n" "nr: need reliable\n" ); + fprintf(f, + "host fpops mean %f stddev %f\n", + perf_info.host_fpops_mean, perf_info.host_fpops_stddev + ); + fprintf(f, + "host fpops 50th pctile %f 95th pctile %f\n", + perf_info.host_fpops_50_percentile, perf_info.host_fpops_95_percentile + ); fprintf(f, "ready: %d\n", ready); fprintf(f, "max_wu_results: %d\n", max_wu_results); for (int i=0; ihost.p_fpops; + if (x <= 0) { + return ssp->perf_info.host_fpops_50_percentile; + } + if (x > ssp->perf_info.host_fpops_95_percentile*1.1) { + return ssp->perf_info.host_fpops_95_percentile*1.1; + } + return x; +} + +const char *BOINC_RCSID_ea659117b3 = "$Id: sched_types.cpp 25176 2012-02-01 03:30:14Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/sched_types.h boinc-7.0.14+dfsg/sched/sched_types.h --- boinc-7.0.7+dfsg/sched/sched_types.h 2011-11-14 06:27:36.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_types.h 2012-01-09 17:35:48.000000000 +0000 @@ -84,15 +84,15 @@ peak_flops = 0; strcpy(cmdline, ""); } - void sequential_app(double x) { + void sequential_app(double flops) { ncudas = 0; natis = 0; gpu_ram = 0; avg_ncpus = 1; max_ncpus = 1; - if (x <= 0) x = 1e9; - projected_flops = x; - peak_flops = x; + if (flops <= 0) flops = 1e9; + projected_flops = flops; + peak_flops = flops; strcpy(cmdline, ""); } inline bool is_sequential_app() { @@ -511,6 +511,9 @@ char code_sign_key_signature[4096]; bool send_msg_ack; bool project_is_down; + std::vectorold_app_versions; + // superceded app versions that we consider using because of + // homogeneous app version. SCHEDULER_REPLY(); ~SCHEDULER_REPLY(); @@ -527,6 +530,7 @@ extern SCHEDULER_REQUEST* g_request; extern SCHEDULER_REPLY* g_reply; extern WORK_REQ* g_wreq; +extern double capped_host_fpops(); static inline void add_no_work_message(const char* m) { g_wreq->add_no_work_message(m); diff -Nru boinc-7.0.7+dfsg/sched/sched_util.cpp boinc-7.0.14+dfsg/sched/sched_util.cpp --- boinc-7.0.7+dfsg/sched/sched_util.cpp 2011-10-26 23:23:01.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_util.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -214,6 +214,25 @@ host.avg_turnaround = new_avg; } +int PERF_INFO::get_from_db() { + int retval, n; + DB_HOST host; + + host_fpops_mean = 2.2e9; + host_fpops_stddev = .7e9; + host_fpops_50_percentile = 3.3e9; + host_fpops_95_percentile = 3.3e9; + + retval = host.count(n); + if (retval) return retval; + if (n < 10) return 0; + retval = host.fpops_mean(host_fpops_mean); + retval = host.fpops_stddev(host_fpops_stddev); + retval = host.fpops_percentile(50, host_fpops_50_percentile); + retval = host.fpops_percentile(95, host_fpops_95_percentile); + return 0; +} + // Request lock on the given file with given fd. Returns: // 0 if we get lock // PID (>0) if another process has lock @@ -266,6 +285,66 @@ return false; } +// the following is used, among other things, +// to enforce limits on in-progress jobs +// for GPUs and CPUs (see handle_request.cpp) +// +bool app_plan_uses_gpu(const char* plan_class) { + if (strstr(plan_class, "cuda")) { + return true; + } + if (strstr(plan_class, "nvidia")) { + return true; + } + if (strstr(plan_class, "ati")) { + return true; + } + return false; +} + +// Arrange that further results for this workunit +// will be sent only to hosts with the given user ID. +// This could be used, for example, so that late workunits +// are sent only to cloud or cluster resources +// +int restrict_wu_to_user(DB_WORKUNIT& wu, int userid) { + DB_RESULT result; + DB_ASSIGNMENT asg; + char buf[256]; + int retval; + + // mark unsent results as DIDNT_NEED + // + sprintf(buf, "workunitid=%d and server_state=%d", + wu.id, RESULT_SERVER_STATE_UNSENT + ); + while (result.enumerate(buf)) { + char buf2[256]; + sprintf(buf2, "server_state=%d, outcome=%d", + RESULT_SERVER_STATE_OVER, + RESULT_OUTCOME_DIDNT_NEED + ); + result.update_field(buf2); + } + + // mark the WU as TRANSITION_NO_NEW_RESULTS + // + sprintf(buf, "transitioner_flags=%d", TRANSITION_NO_NEW_RESULTS); + retval = wu.update_field(buf); + if (retval) return retval; + + // create an assignment record + // + asg.clear(); + asg.create_time = time(0); + asg.target_id = userid; + asg.target_type = ASSIGN_USER; + asg.multi = 0; + asg.workunitid = wu.id; + retval = asg.insert(); + return retval; +} + #ifdef GCL_SIMULATOR void simulator_signal_handler(int signum) { @@ -304,4 +383,4 @@ #endif -const char *BOINC_RCSID_affa6ef1e4 = "$Id: sched_util.cpp 24500 2011-10-26 23:23:01Z davea $"; +const char *BOINC_RCSID_affa6ef1e4 = "$Id: sched_util.cpp 25169 2012-01-30 22:39:13Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/sched_util.h boinc-7.0.14+dfsg/sched/sched_util.h --- boinc-7.0.7+dfsg/sched/sched_util.h 2011-01-07 20:23:22.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_util.h 2012-01-30 22:39:13.000000000 +0000 @@ -55,6 +55,15 @@ extern void compute_avg_turnaround(HOST& host, double turnaround); +struct PERF_INFO { + double host_fpops_mean; + double host_fpops_stddev; + double host_fpops_50_percentile; + double host_fpops_95_percentile; + + int get_from_db(); +}; + // returns zero if we get lock on file with file descriptor fd. // returns < 0 if error // returns PID > 0 if another process has lock @@ -80,6 +89,10 @@ // extern bool is_arg(const char*, const char*); +extern bool app_plan_uses_gpu(const char* plan_class); + +extern int restrict_wu_to_user(DB_WORKUNIT& wu, int userid); + #ifdef GCL_SIMULATOR extern void simulator_signal_handler(int signum); extern void continue_simulation(const char *daemonname); diff -Nru boinc-7.0.7+dfsg/sched/sched_version.cpp boinc-7.0.14+dfsg/sched/sched_version.cpp --- boinc-7.0.7+dfsg/sched/sched_version.cpp 2011-11-03 05:26:19.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/sched_version.cpp 2012-01-09 17:35:48.000000000 +0000 @@ -243,14 +243,14 @@ // input: // cav.host_usage.projected_flops // This is the specified in app_info.xml -// If not specific there, it's a conservative estimate -// (CPU speed * (ncpus = ngpus)) +// If not specified there, it's a conservative estimate +// (CPU speed * (ncpus + ngpus)) // In either case, this value will be used by the client // to estimate job runtime and runtime limit // est runtime = wu.rsc_fpops_est/x // runtime limit = wu.rsc_fpops_bound/x // x may be way off from the actual speed. -// To get accurate runtime est, we need to adjust wu.rsc_fpops_est +// So to get accurate runtime est, we need to adjust wu.rsc_fpops_est // // output: // cav.host_usage.projected_flops @@ -332,8 +332,13 @@ } } -// if we have enough statistics to estimate the app version's -// actual FLOPS on this host, do so. +// compute HOST_USAGE::projected_flops as best we can: +// 1) if we have statistics for (host, app version) elapsed time, +// use those. +// 2) if we have statistics for app version elapsed time, use those. +// 3) else use a conservative estimate (p_fpops*(cpus+gpus)) +// This prevents jobs from aborting with "time limit exceeded" +// even if the estimate supplied by the plan class function is way off // void estimate_flops(HOST_USAGE& hu, APP_VERSION& av) { DB_HOST_APP_VERSION* havp = gavid_to_havp(av.id); @@ -371,9 +376,10 @@ ); } } else { + hu.projected_flops = g_reply->host.p_fpops * (hu.avg_ncpus + hu.ncudas + hu.natis); if (config.debug_version_select) { log_messages.printf(MSG_NORMAL, - "[version] [AV#%d] (%s) using unscaled projected flops: %.2fG\n", + "[version] [AV#%d] (%s) using conservative projected flops: %.2fG\n", av.id, av.plan_class, hu.projected_flops/1e9 ); } @@ -424,8 +430,36 @@ ) { static BEST_APP_VERSION bav; - bool found=false; + bool found; APP_VERSION *avp = ssp->lookup_app_version(wu.app_version_id); + if (!avp) { + // If the app version is not in shmem, + // it's been superceded or deprecated. + // Use it anyway. + // Keep an array of such app versions in + // SCHEDULER_REPLY::old_app_versions + // + found = false; + for (unsigned int i=0; iold_app_versions.size(); i++) { + APP_VERSION& av = g_reply->old_app_versions[i]; + if (av.id == wu.app_version_id) { + avp = &av; + found = true; + break; + } + } + if (!found) { + DB_APP_VERSION av; + int retval = av.lookup_id(wu.app_version_id); + if (retval) return NULL; + g_reply->old_app_versions.push_back(av); + avp = &(g_reply->old_app_versions.back()); + } + } + + // see if this host supports the version's platform + // + found = false; for (unsigned int i=0; iplatforms.list.size(); i++) { PLATFORM* p = g_request->platforms.list[i]; if (p->id == avp->platformid) { @@ -435,13 +469,19 @@ } } if (!found) return NULL; + + // and see if it supports the plan class + // if (strlen(avp->plan_class)) { if (!app_plan(*g_request, avp->plan_class, bav.host_usage)) { return NULL; } } else { - bav.host_usage.sequential_app(g_reply->host.p_fpops); + bav.host_usage.sequential_app(capped_host_fpops()); } + + // and see if the client is asking for this resource + // if (!need_this_resource(bav.host_usage, avp, NULL)) { return NULL; } diff -Nru boinc-7.0.7+dfsg/sched/transitioner.cpp boinc-7.0.14+dfsg/sched/transitioner.cpp --- boinc-7.0.7+dfsg/sched/transitioner.cpp 2011-06-06 03:40:42.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/transitioner.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -157,27 +157,6 @@ TRANSITIONER_ITEM& wu_item = items[0]; TRANSITIONER_ITEM wu_item_original = wu_item; - // "assigned" WUs aren't supposed to pass through the transitioner. - // If we get one, it's an error - // - if (config.enable_assignment && strstr(wu_item.name, ASSIGNED_WU_STR)) { - DB_WORKUNIT wu; - char buf[256]; - - wu.id = wu_item.id; - log_messages.printf(MSG_CRITICAL, - "Assigned WU %d unexpectedly found by transitioner\n", wu.id - ); - sprintf(buf, "transition_time=%d", INT_MAX); - retval = wu.update_field(buf); - if (retval) { - log_messages.printf(MSG_CRITICAL, - "update_field failed: %s\n", boincerror(retval) - ); - } - return 0; - } - // count up the number of results in various states, // and check for timed-out results // @@ -450,7 +429,9 @@ // std::string values; char value_buf[MAX_QUERY_LEN]; - if (n_new_results_needed > 0) { + if (wu_item.transitioner_flags != TRANSITION_NO_NEW_RESULTS + && n_new_results_needed > 0 + ) { log_messages.printf( MSG_NORMAL, "[WU#%d %s] Generating %d more results (%d target - %d unsent - %d in progress - %d success)\n", @@ -834,4 +815,4 @@ main_loop(); } -const char *BOINC_RCSID_be98c91511 = "$Id: transitioner.cpp 23636 2011-06-06 03:40:42Z davea $"; +const char *BOINC_RCSID_be98c91511 = "$Id: transitioner.cpp 25169 2012-01-30 22:39:13Z davea $"; diff -Nru boinc-7.0.7+dfsg/sched/validator.cpp boinc-7.0.14+dfsg/sched/validator.cpp --- boinc-7.0.7+dfsg/sched/validator.cpp 2011-09-16 16:43:15.000000000 +0000 +++ boinc-7.0.14+dfsg/sched/validator.cpp 2012-01-08 01:28:39.000000000 +0000 @@ -87,8 +87,6 @@ bool credit_from_wu = false; bool credit_from_runtime = false; double max_runtime = 0; -double fpops_50_percentile; // used if credit_from_runtime -double fpops_95_percentile; bool no_credit = false; WORKUNIT* g_wup; @@ -410,16 +408,16 @@ ); break; } - double fpops = host.p_fpops; - if (fpops <= 0) fpops = fpops_50_percentile; - if (fpops > fpops_95_percentile) { - fpops = fpops_95_percentile; - } double runtime = result.elapsed_time; if (runtime <=0 || runtime > max_runtime) { runtime = max_runtime; } - credit = (fpops * runtime) * COBBLESTONE_SCALE; + credit = result.flops_estimate * runtime * COBBLESTONE_SCALE; + log_messages.printf(MSG_NORMAL, + "[WU#%d][RESULT#%d] credit_from_runtime %.2f = %.0fs * %.2fGFLOPS\n", + wu.id, result.id, + credit, runtime, result.flops_estimate/1e9 + ); break; } } @@ -695,6 +693,7 @@ " --max_granted_credit X Grant no more than this amount of credit to a result\n" " --update_credited_job Add record to credited_job table after granting credit\n" " --credit_from_wu Credit is specified in WU XML\n" + " --credit_from_runtime X Grant credit based on runtime (max X seconds)and estimated FLOPS\n" " --no_credit Don't grant credit\n" " --sleep_interval n Set sleep-interval to n\n" " -d n, --debug_level n Set log verbosity level, 1-4\n" @@ -780,21 +779,9 @@ ); if (credit_from_runtime) { - DB_HOST host; - retval = host.fpops_percentile(50, fpops_50_percentile); - if (retval) { - log_messages.printf(MSG_CRITICAL, "fpops_percentile failed: %d\n", retval); - return retval; - } - retval = host.fpops_percentile(95, fpops_95_percentile); - if (retval) { - log_messages.printf(MSG_CRITICAL, "fpops_percentile failed: %d\n", retval); - return retval; - } - - log_messages.printf(MSG_NORMAL, "default FLOPS: %f\n", fpops_50_percentile); - log_messages.printf(MSG_NORMAL, "max FLOPS: %f\n", fpops_95_percentile); - log_messages.printf(MSG_NORMAL, "max runtime: %f\n", max_runtime); + log_messages.printf(MSG_NORMAL, + "using credit from runtime, max runtime: %f\n", max_runtime + ); } if (wu_id_modulus) { @@ -808,4 +795,4 @@ main_loop(); } -const char *BOINC_RCSID_634dbda0b9 = "$Id: validator.cpp 24225 2011-09-16 16:43:15Z davea $"; +const char *BOINC_RCSID_634dbda0b9 = "$Id: validator.cpp 25009 2012-01-08 01:28:39Z davea $"; diff -Nru boinc-7.0.7+dfsg/ssim/des.h boinc-7.0.14+dfsg/ssim/des.h --- boinc-7.0.7+dfsg/ssim/des.h 2011-11-03 03:29:07.000000000 +0000 +++ boinc-7.0.14+dfsg/ssim/des.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#include -#include - -using std::vector; - -struct EVENT { - double t; - virtual void handle(){} -}; - -bool compare(EVENT* e1, EVENT* e2) { - return (e1->t > e2->t); -} - -struct SIMULATOR { - vector events; - void insert(EVENT* e) { - events.push_back(e); - push_heap(events.begin(), events.end(), compare); - } - void simulate(double dur) { - while (events.size()) { - EVENT* e = events.front(); - pop_heap(events.begin(), events.end(), compare); - events.pop_back(); - if (e->t > dur) break; - e->handle(); - } - } -}; diff -Nru boinc-7.0.7+dfsg/ssim/makefile boinc-7.0.14+dfsg/ssim/makefile --- boinc-7.0.7+dfsg/ssim/makefile 2011-11-03 03:29:07.000000000 +0000 +++ boinc-7.0.14+dfsg/ssim/makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -ssim: ssim.cpp des.h - g++ -g -o ssim ssim.cpp diff -Nru boinc-7.0.7+dfsg/ssim/ssim.cpp boinc-7.0.14+dfsg/ssim/ssim.cpp --- boinc-7.0.7+dfsg/ssim/ssim.cpp 2011-11-14 06:27:36.000000000 +0000 +++ boinc-7.0.14+dfsg/ssim/ssim.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -// ssim - simulator for distributed storage - -#include -#include - -#include "des.h" - -using std::set; - -#define K 15 - // this many packets per meta-packet -#define N 10 - // need this many to reconstruct the meta-packet -#define META_K 15 - // similar, meta-packets per file -#define META_N 10 - -#define HOSTS_PER_DAY 10. -#define HOST_LIFE_MEAN 100.*86400 - -SIMULATOR sim; - -inline double drand() { - return (double)rand()/(double)RAND_MAX; -} - -// place-holder -double ran_exp(double mean) { - // gsl_ran_exponential(mean); - return (drand() + .5)*mean; -} - -struct HOST; - -set hosts; - -struct HOST : public EVENT { - double upload_bytes_sec; - double download_bytes_sec; - virtual void handle() { - // the host has departed - // - set::iterator i = hosts.find(this); - hosts.erase(i); - } -}; - -struct HOST_ARRIVAL : public EVENT { - virtual void handle() { - HOST* h = new HOST; - h->t = t + ran_exp(HOST_LIFE_MEAN); - hosts.insert(h); - sim.insert(h); - t += ran_exp(86400./HOSTS_PER_DAY); - sim.insert(this); - } -}; - -struct REPORT_STATS : public EVENT { - virtual void handle() { - printf("%f: %d hosts\n", t, hosts.size()); - t += 86400; - sim.insert(this); - } -}; - -// a packet is associated with at most one host -// -struct PACKET { - DFILE* dfile; - META_PACKET* meta_packet; - enum {DOWNLOADING, PRESENT, UPLOADING} state; - HOST* host; - bool present; // present on server - virtual void handle() { - // transfer has finished - // - } - - void assign() { - set::iterator i = dfile.unused_hosts.front(); - HOST* h = *i; - dfile.unused_hosts.erase(i); - double t = now + 1/h->bw_down; - } - - // This packet has been lost. - // If it's present on server, assign it to a host. - // Otherwise reassemble the meta-packet - // - void lost() { - if (present_on_server) { - assign(); - } else { - meta_packet->reassemble(); - } - } -}; - -struct META_PACKET { - vector packets; - int npackets_present; - - // we need to reassemble this meta-packet on the server - // - void reassemble() { - } - - void reassembly_complete() { - } -}; - -struct DFILE : EVENT { - vector meta_packets; - set unused_hosts; - // hosts that don't have any packets of this file - int nmeta_packets_present; - virtual void handle() { - for (int i=0; inpackets_present = K; - meta_packets.push_back(mp); - for (int j=0; jpresent = true; - mp->packets.push_back(p); - } - } - } -}; - -set dfiles; - -int main() { - HOST_ARRIVAL *h = new HOST_ARRIVAL; - h->t = 0; - sim.insert(h); - REPORT_STATS* r = new REPORT_STATS; - r->t = 0; - sim.insert(r); - - sim.simulate(200*86400); -} diff -Nru boinc-7.0.7+dfsg/tools/backend_lib.cpp boinc-7.0.14+dfsg/tools/backend_lib.cpp --- boinc-7.0.7+dfsg/tools/backend_lib.cpp 2011-10-18 07:15:04.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/backend_lib.cpp 2012-01-30 22:39:13.000000000 +0000 @@ -309,7 +309,7 @@ fprintf(stderr, "target_nresults > max_success_results; can't create job\n"); return ERR_INVALID_PARAM; } - if (strstr(wu.name, ASSIGNED_WU_STR)) { + if (wu.transitioner_flags & TRANSITION_NONE) { wu.transition_time = INT_MAX; } else { wu.transition_time = time(0); @@ -488,4 +488,4 @@ return 0; } -const char *BOINC_RCSID_b5f8b10eb5 = "$Id: backend_lib.cpp 24413 2011-10-18 07:15:04Z davea $"; +const char *BOINC_RCSID_b5f8b10eb5 = "$Id: backend_lib.cpp 25169 2012-01-30 22:39:13Z davea $"; diff -Nru boinc-7.0.7+dfsg/tools/create_work.cpp boinc-7.0.14+dfsg/tools/create_work.cpp --- boinc-7.0.7+dfsg/tools/create_work.cpp 2011-07-22 22:47:41.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/create_work.cpp 2012-01-31 20:25:26.000000000 +0000 @@ -44,6 +44,7 @@ " [ --wu_template filename ] default: appname_in\n" " [ --result_template filename ] default: appname_out\n" " [ --config_dir path ]\n" + " [ --command_line \"X\" ]\n" " [ --batch n ]\n" " [ --rsc_fpops_est n ]\n" " [ --rsc_fpops_bound n ]\n" @@ -56,13 +57,13 @@ " [ --max_total_results x ]\n" " [ --max_success_results x ]\n" " [ --additional_xml x ]\n" - " [ --assign_all ]\n" - " [ --assign_host ID ]\n" - " [ --assign_user_one ID ]\n" - " [ --assign_user_all ID ]\n" - " [ --assign_team_one ID ]\n" - " [ --assign_team_all ID ]\n" - " [ --wu_id N ] ID of existing the workunit record (used by boinc_submit)\n" + " [ --broadcast ]\n" + " [ --broadcast_user ID ]\n" + " [ --broadcast_team ID ]\n" + " [ --target_host ID ]\n" + " [ --target_user ID ]\n" + " [ --target_team ID ]\n" + " [ --wu_id N ] ID of existing workunit record (used by boinc_submit)\n" ); exit(1); } @@ -170,32 +171,35 @@ strcpy(additional_xml, argv[++i]); } else if (arg(argv, i, "wu_id")) { wu.id = atoi(argv[++i]); - } else if (arg(argv, i, "assign_all")) { + } else if (arg(argv, i, "broadcast")) { assign_multi = true; assign_flag = true; assign_type = ASSIGN_NONE; - } else if (arg(argv, i, "assign_host")) { - assign_flag = true; - assign_type = ASSIGN_HOST; - assign_id = atoi(argv[++i]); - } else if (arg(argv, i, "assign_user_one")) { + } else if (arg(argv, i, "broadcast_user")) { assign_flag = true; assign_type = ASSIGN_USER; + assign_multi = true; assign_id = atoi(argv[++i]); - } else if (arg(argv, i, "assign_user_all")) { + } else if (arg(argv, i, "broadcast_team")) { assign_flag = true; - assign_type = ASSIGN_USER; + assign_type = ASSIGN_TEAM; assign_multi = true; assign_id = atoi(argv[++i]); - } else if (arg(argv, i, "assign_team_one")) { + } else if (arg(argv, i, "target_host")) { assign_flag = true; - assign_type = ASSIGN_TEAM; + assign_type = ASSIGN_HOST; assign_id = atoi(argv[++i]); - } else if (arg(argv, i, "assign_team_all")) { + } else if (arg(argv, i, "target_user")) { + assign_flag = true; + assign_type = ASSIGN_USER; + assign_id = atoi(argv[++i]); + } else if (arg(argv, i, "target_team")) { assign_flag = true; assign_type = ASSIGN_TEAM; - assign_multi = true; assign_id = atoi(argv[++i]); + } else if (arg(argv, i, "help")) { + usage(); + exit(0); } else { if (!strncmp("-", argv[i], 1)) { fprintf(stderr, "create_work: bad argument '%s'\n", argv[i]); @@ -221,15 +225,7 @@ sprintf(result_template_file, "templates/%s_out", app.name); } - if (assign_flag) { - if (!strstr(wu.name, ASSIGNED_WU_STR)) { - fprintf(stderr, - "Assigned WU names must contain '%s'\n", ASSIGNED_WU_STR - ); - exit(1); - } - } - retval = config.parse_file(); + retval = config.parse_file(config_dir); if (retval) { fprintf(stderr, "Can't parse config file: %d\n", retval); exit(1); @@ -301,4 +297,4 @@ boinc_db.close(); } -const char *BOINC_RCSID_3865dbbf46 = "$Id: create_work.cpp 23868 2011-07-22 22:47:41Z davea $"; +const char *BOINC_RCSID_3865dbbf46 = "$Id: create_work.cpp 25175 2012-01-31 20:25:26Z davea $"; diff -Nru boinc-7.0.7+dfsg/tools/example_app_in boinc-7.0.14+dfsg/tools/example_app_in --- boinc-7.0.7+dfsg/tools/example_app_in 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/example_app_in 2011-12-10 22:03:43.000000000 +0000 @@ -0,0 +1,12 @@ + + + 0 + + + + 0 + in + + -cpu_time 30 + + diff -Nru boinc-7.0.7+dfsg/tools/example_app_in.xml boinc-7.0.14+dfsg/tools/example_app_in.xml --- boinc-7.0.7+dfsg/tools/example_app_in.xml 2010-11-10 18:17:20.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/example_app_in.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ - - 0 - - - - 0 - in - - -cpu_time 30 - diff -Nru boinc-7.0.7+dfsg/tools/example_app_out boinc-7.0.14+dfsg/tools/example_app_out --- boinc-7.0.7+dfsg/tools/example_app_out 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/example_app_out 2011-12-10 22:03:43.000000000 +0000 @@ -0,0 +1,15 @@ + + + + + + 5000000 + + + + + + out + + + diff -Nru boinc-7.0.7+dfsg/tools/example_app_out.xml boinc-7.0.14+dfsg/tools/example_app_out.xml --- boinc-7.0.7+dfsg/tools/example_app_out.xml 2010-11-10 00:10:32.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/example_app_out.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ - - - - - 5000000 - - - - - - out - - diff -Nru boinc-7.0.7+dfsg/tools/make_project boinc-7.0.14+dfsg/tools/make_project --- boinc-7.0.7+dfsg/tools/make_project 2011-10-21 06:58:35.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/make_project 2011-12-10 22:03:43.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -# $Id: make_project 24447 2011-10-21 06:58:35Z davea $ +# $Id: make_project 24774 2011-12-10 22:03:43Z davea $ # Creates a new BOINC project. import boinc_path_config @@ -306,8 +306,8 @@ app_dir = proot+'/apps/example_app/' os.mkdir(app_dir) os.system('cp -r ../samples/example_app/bin/* ' + app_dir); - shutil.copy('example_app_in.xml', proot+'/templates/') - shutil.copy('example_app_out.xml', proot+'/templates/') + shutil.copy('example_app_in', proot+'/templates/') + shutil.copy('example_app_out', proot+'/templates/') shutil.copy('../tools/create_work_example', proot+'/bin/') httpd_conf_template_filename = os.path.join( diff -Nru boinc-7.0.7+dfsg/tools/manage_privileges boinc-7.0.14+dfsg/tools/manage_privileges --- boinc-7.0.7+dfsg/tools/manage_privileges 2011-09-23 17:04:22.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/manage_privileges 2011-12-10 22:03:43.000000000 +0000 @@ -122,13 +122,13 @@ } } else { if ($grant) { - BoincUserSubmit::insert("user_id=$user->id and manage_all=1"); + BoincUserSubmit::insert("set user_id=$user->id, manage_all=1)"); } else { die("User $user->id does not have global manage access\n"); } } } else { - $app = BoincApp::lookup_name($argv[3]); + $app = BoincApp::lookup("name='".$argv[3]."'"); if (!$app) die("no such app: ".$argv[2]."\n"); $busa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id"); if ($busa) { @@ -149,9 +149,9 @@ if ($grant) { $bus = BoincUserSubmit::lookup_userid($user->id); if (!$bus) { - BoincUserSubmit::insert("user_id=$user->id=1"); + BoincUserSubmit::insert("set user_id=$user->id"); } - BoincUserSubmitApp::insert("user_id=$user->id and app_id=$app->id and manage=1"); + BoincUserSubmitApp::insert("set user_id=$user->id, app_id=$app->id, manage=1"); } else { die("User $user->id does not have manage access for $app->name\n"); } diff -Nru boinc-7.0.7+dfsg/tools/process_input_template.cpp boinc-7.0.14+dfsg/tools/process_input_template.cpp --- boinc-7.0.7+dfsg/tools/process_input_template.cpp 2011-09-01 20:26:12.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/process_input_template.cpp 2012-01-02 07:33:08.000000000 +0000 @@ -132,6 +132,8 @@ return; } +static bool input_file_found[1024]; + static int process_file_info( XML_PARSER& xp, string& out, int ninfiles, const char** infiles, SCHED_CONFIG& config_loc @@ -176,6 +178,13 @@ ); return ERR_XML_PARSE; } + if (input_file_found[file_number]) { + fprintf(stderr, + "Input file %d listed twice\n", file_number + ); + return ERR_XML_PARSE; + } + input_file_found[file_number] = true; if (generated_locally) { sprintf(buf, " %s\n" @@ -382,6 +391,10 @@ bool found_workunit=false; int nfiles_parsed = 0; + for (int i=0; i<1024; i++) { + input_file_found[i] = false; + } + out = ""; MIOFILE mf; XML_PARSER xp(&mf); diff -Nru boinc-7.0.7+dfsg/tools/update_versions boinc-7.0.14+dfsg/tools/update_versions --- boinc-7.0.7+dfsg/tools/update_versions 2011-10-21 20:14:54.000000000 +0000 +++ boinc-7.0.14+dfsg/tools/update_versions 2012-01-26 08:39:51.000000000 +0000 @@ -62,6 +62,9 @@ } } else { $xml .= " $fd->url\n"; + if ($fd->gzip) { + $xml .= " $fd->url.gz\n"; + } } if ($fd->executable || $fd->main_program) { $xml .= " \n"; @@ -70,9 +73,12 @@ $xml .= $fd->signature; $xml .= " \n". - " ".$fd->nbytes."\n". - "\n" + " ".$fd->nbytes."\n" ; + if ($fd->gzip) { + $xml .= " ".$fd->gzipped_nbytes."\n"; + } + $xml .= "\n"; return $xml; } @@ -135,8 +141,15 @@ } $fd->url = "$download_url/$name"; - if ($fd->gzip && !file_exists("$dl_path.gz")) { - system("gzip $dl_path"); + if ($fd->gzip) { + if (!file_exists("$dl_path.gz")) { + $tmp = "$dl_path.tmp"; + system("cp $dl_path $tmp"); + system("gzip $dl_path"); + system("mv $tmp $dl_path"); + } + $stat = stat("$dl_path.gz"); + $fd->gzipped_nbytes = $stat['size']; } return $fd; } @@ -343,6 +356,7 @@ $v = null; $v->files = $fds; $v->dont_throttle = get_bool($x, "dont_throttle"); + $v->needs_network = get_bool($x, "needs_network"); $v->file_prefix = (string)$x->file_prefix; return $v; } @@ -396,6 +410,9 @@ if ($vers->dont_throttle) { $xml .= " \n"; } + if ($vers->needs_network) { + $xml .= " \n"; + } if ($vers->file_prefix != "") { $xml .= " $vers->file_prefix\n"; } diff -Nru boinc-7.0.7+dfsg/vda/des.h boinc-7.0.14+dfsg/vda/des.h --- boinc-7.0.7+dfsg/vda/des.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/des.h 2011-12-16 19:45:31.000000000 +0000 @@ -0,0 +1,79 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2011 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + +// The world's smallest discrete event simulator. +// Uses the STL "heap" data structure for efficient event storage. + +#include +#include + +using std::vector; + +// base class for events. +// t is the time when the event occurs. +// handle() is the function to call then. +// +struct EVENT { + double t; + virtual void handle(){} +}; + +bool compare(EVENT* e1, EVENT* e2) { + return (e1->t > e2->t); +} + +struct SIMULATOR { + vector events; + double now; + + // add an event + // + void insert(EVENT* e) { + //printf("adding %x\n", e); + events.push_back(e); + push_heap(events.begin(), events.end(), compare); + } + + // remove an event + // + void remove(EVENT* e) { + vector::iterator i; + //printf("removing %x\n", e); + for (i=events.begin(); i!=events.end(); i++) { + if (*i == e) { + events.erase(i); + make_heap(events.begin(), events.end(), compare); + //printf("removed %x\n", e); + return; + } + } + //printf("%x not found\n", e); + } + + // run the simulator for the given time period + // + void simulate(double dur) { + while (events.size()) { + EVENT* e = events.front(); + pop_heap(events.begin(), events.end(), compare); + events.pop_back(); + now = e->t; + if (now > dur) break; + e->handle(); + } + } +}; diff -Nru boinc-7.0.7+dfsg/vda/makefile boinc-7.0.14+dfsg/vda/makefile --- boinc-7.0.7+dfsg/vda/makefile 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/makefile 2012-01-23 21:59:12.000000000 +0000 @@ -0,0 +1,16 @@ +all: ssim vda vdad + +CCFLAGS = -I /usr/include/mysql -I ../db -I ../lib + +LIBS = ../sched/libsched.a ../lib/libboinc.a + +MYSQL_LIBS = -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl + +vda_lib.o: vda_lib.cpp vda_lib.h + g++ -c vda_lib.cpp +ssim: ssim.cpp des.h vda_lib.o + g++ -g -Wall -o ssim ssim.cpp vda_lib.o +vdad: vdad.cpp vda_lib.o + g++ -g $(CCFLAGS) -Wall -o vdad vdad.cpp vda_lib.o $(LIBS) $(MYSQL_LIBS) +vda: vda.cpp vda_lib.o + g++ -g $(CCFLAGS) -Wall -o vda vda.cpp vda_lib.o $(LIBS) $(MYSQL_LIBS) diff -Nru boinc-7.0.7+dfsg/vda/plot boinc-7.0.14+dfsg/vda/plot --- boinc-7.0.7+dfsg/vda/plot 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/plot 2012-01-18 02:24:18.000000000 +0000 @@ -0,0 +1,6 @@ +#!/bin/sh + +gnuplot < disk.gp > disk.png +gnuplot < upload.gp > upload.png +gnuplot < download.gp > download.png +gnuplot < fault_tol.gp > fault_tol.png diff -Nru boinc-7.0.7+dfsg/vda/ssim.cpp boinc-7.0.14+dfsg/vda/ssim.cpp --- boinc-7.0.7+dfsg/vda/ssim.cpp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/ssim.cpp 2012-01-23 08:04:41.000000000 +0000 @@ -0,0 +1,976 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2011 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + +// ssim - simulator for distributed storage +// +// Simulates the storage of files on a dynamic set of hosts. + +// usage: ssim +// [--policy filename] +// [--host_life_mean x] +// [--connect_interval x] +// [--mean_xfer_rate x] +// [--file_size x] +// +// outputs: +// stdout: log info +// summary.txt: format +// fault tolerance min +// disk_usage mean +// upload_mean +// download_mean + +#include +#include +#include +#include +#include + +#include "des.h" +#include "vda_lib.h" + +using std::set; + +// We simulate policies based on coding and replication. +// +// Coding means that data is divided into M = N+K units, +// of which any N are sufficient to reconstruct the original data. +// When we need to reconstruct an encoded unit on the server, +// we try to upload N_UPLOAD subunits, +// where N <= N_UPLOAD <= M +// The units in an encoding can themselves be encoded. +// +// The bottom-level data units ("chunks") are stored on hosts, +// possibly with replication + +struct PARAMS { + // The model of the host population is: + // - the population is unbounded + // - host lifetime is exponentially distributed + // - the time needed to transfer n bytes of data to/from a host is + // U1*connect_interval + (U2+.5)*n/mean_xfer_rate; + // where U1 and U2 are uniform random vars + // (U1 is per-transfer, U2 is per-host) + // + double host_life_mean; + double connect_interval; + double mean_xfer_rate; + double file_size; + double sim_duration; + + PARAMS() { + // default parameters + // + host_life_mean = 100.*86400; + connect_interval = 86400.; + mean_xfer_rate = .2e6; + file_size = 1e12; + sim_duration = 1000.*86400; + } +} params; + +POLICY policy; + +// Terminology: +// +// A data unit is "recoverable" if it can be recovered on the server +// by uploading data from hosts. +// A chunk is recoverable if it's present on the server or on at least 1 host. +// (note: if it's downloading, it's still present on the server) +// An encoded data unit is recoverable if at least N +// of its subunits are recoverable. + +// Figures of merit +// +// for each file, we compute: +// - the average and peak server network rate, up and down +// - the average and peak disk usage +// - the average and min fault tolerance level +// (i.e. number of simultaneous host failures needed to lose the file) +// +// These are measured starting from the time when the file's +// initial downloads have all succeeded or failed + +#define EVENT_DEBUG +#define SAMPLE_DEBUG +//#define RECOVERY_DEBUG + +SIMULATOR sim; +int next_file_id=0; +int next_host_id=0; + +inline double drand() { + return (double)rand()/(double)RAND_MAX; +} + +double ran_exp(double mean) { + return -log(drand())*mean; +} + +char* time_str(double t) { + static char buf[256]; + struct tm; + int n = (int)t; + int nsec = n % 60; + n /= 60; + int nmin = n % 60; + n /= 60; + int nhour = n % 24; + n /= 24; + sprintf(buf, "%4d days %02d:%02d:%02d", n, nhour, nmin, nsec); + return buf; +} + +char* now_str() { + return time_str(sim.now); +} + +struct CHUNK; +struct CHUNK_ON_HOST; +struct META_CHUNK; +struct DFILE; +struct HOST; +set hosts; + +// Represents a host. +// The associated EVENT is the disappearance of the host +// +struct HOST : public EVENT { + int id; + double transfer_rate; + set chunks; // chunks present or downloading + virtual void handle(); + HOST() { + t = sim.now + ran_exp(params.host_life_mean); + id = next_host_id++; + transfer_rate = params.mean_xfer_rate*(drand() + .5); + hosts.insert(this); + } +}; + +#if 0 +// The host arrival process. +// The associated EVENT is the arrival of a host +// +struct HOST_ARRIVAL : public EVENT { + virtual void handle() { + sim.insert(new HOST); + t += ran_exp(86400./HOSTS_PER_DAY); + sim.insert(this); + } +}; +#endif + +void die(const char* msg) { + printf("%s: %s\n", now_str(), msg); + exit(1); +} + +// The status of a chunk on a particular host. +// The associated event is the completion of an upload or download +// +struct CHUNK_ON_HOST : public EVENT { + HOST* host; + CHUNK* chunk; + char name[256]; + bool present_on_host; + bool transfer_wait; // waiting to start transfer + bool transfer_in_progress; // upload if present_on_host, else download + virtual void handle(); + void start_upload(); + void start_download(); + inline bool download_in_progress() { + return (transfer_in_progress && !present_on_host); + } + void remove(); +}; + +#define PRESENT 0 +#define RECOVERABLE 1 +#define UNRECOVERABLE 2 + +// base class for chunks and meta-chunks +// +struct DATA_UNIT { + virtual void recovery_plan(){}; + virtual void recovery_action(){}; + int status; + bool in_recovery_set; + bool data_now_present; + bool data_needed; + double cost; + int min_failures; + // min # of host failures that would make this unrecoverable + char name[64]; +}; + +struct CHUNK : DATA_UNIT { + set hosts; + META_CHUNK* parent; + double size; + bool present_on_server; + + CHUNK(META_CHUNK* mc, double s, int index); + + void start_upload(); + void host_failed(CHUNK_ON_HOST* p); + bool download_in_progress(); + void upload_complete(); + void download_complete(); + void assign(); + virtual void recovery_plan(); + virtual void recovery_action(); +}; + +struct META_CHUNK : DATA_UNIT { + vector children; + META_CHUNK* parent; + int n_children_present; + bool have_unrecoverable_children; + DFILE* dfile; + bool uploading; + CODING coding; + + META_CHUNK( + DFILE* d, META_CHUNK* par, double size, int coding_level, int index + ); + + virtual void recovery_plan(); + virtual void recovery_action(); +}; + +// keeps track of a time-varying property of a file +// (server disk usage, up/download rate, fault tolerance level) +// + +typedef enum {DISK, NETWORK, FAULT_TOLERANCE} STATS_KIND; + +struct STATS_ITEM { + STATS_KIND kind; + double value; + double integral; + double extreme_val; + double extreme_val_time; + double prev_t; + double start_time; + bool first; + char name[256]; + FILE* f; + + void init(const char* n, const char* filename, STATS_KIND k) { + f = fopen(filename, "w"); + strcpy(name, n); + kind = k; + value = 0; + integral = 0; + switch (kind) { + case DISK: + case NETWORK: + extreme_val = 0; + break; + case FAULT_TOLERANCE: + extreme_val = INT_MAX; + break; + } + extreme_val_time = 0; + first = true; + } + + void sample(double v, bool collecting_stats) { +#ifdef SAMPLE_DEBUG + switch (kind) { + case DISK: + printf("%s: %s: %fGB -> %fGB\n", now_str(), name, value/1e9, v/1e9); + break; + case NETWORK: + printf("%s: %s: %fMbps -> %fMbps\n", now_str(), name, value/1e6, v/1e6); + break; + case FAULT_TOLERANCE: + printf("%s: %s: %.0f -> %.0f\n", now_str(), name, value, v); + break; + } +#endif + double old_val = value; + value = v; + if (!collecting_stats) return; + if (first) { + first = false; + prev_t = sim.now; + return; + } + double dt = sim.now - prev_t; + prev_t = sim.now; + integral += dt*old_val; + switch (kind) { + case DISK: + case NETWORK: + if (v > extreme_val) { + extreme_val = v; + extreme_val_time = sim.now; + } + break; + case FAULT_TOLERANCE: + if (v < extreme_val) { + extreme_val = v; + extreme_val_time = sim.now; + } + break; + } + + fprintf(f, "%f %f\n", sim.now, old_val); + fprintf(f, "%f %f\n", sim.now, v); + } + + void sample_inc(double inc, bool collecting_stats) { + sample(value+inc, collecting_stats); + } + + void print() { + sample_inc(0, true); + double dt = sim.now - start_time; + switch (kind) { + case DISK: + printf(" mean: %fGB. Max: %fGB at %s\n", + (integral/dt)/1e9, extreme_val/1e9, time_str(extreme_val_time) + ); + break; + case NETWORK: + printf(" mean: %fMbps. Max: %fMbps at %s\n", + (integral/dt)/1e6, extreme_val/1e6, time_str(extreme_val_time) + ); + break; + case FAULT_TOLERANCE: + printf(" mean: %.2f. Min: %.0f at %s\n", + integral/dt, extreme_val, time_str(extreme_val_time) + ); + break; + } + } + void print_summary(FILE* f) { + double dt = sim.now - start_time; + switch (kind) { + case DISK: + fprintf(f, "%f\n", integral/dt); + break; + case NETWORK: + fprintf(f, "%f\n", integral/dt); + break; + case FAULT_TOLERANCE: + fprintf(f, "%f\n", extreme_val); + break; + } + } +}; + +// represents a file to be stored. +// The associated EVENT is the arrival of the file +// +struct DFILE : EVENT { + META_CHUNK* meta_chunk; + double size; + int id; +#if 0 + set unused_hosts; + // hosts that don't have any chunks of this file +#endif + int pending_init_downloads; + // # of initial downloads pending. + // When this is zero, we start collecting stats for the file + double accounting_start_time; + STATS_ITEM disk_usage; + STATS_ITEM upload_rate; + STATS_ITEM download_rate; + STATS_ITEM fault_tolerance; + + DFILE(double s) { + id = next_file_id++; +#if 0 + unused_hosts = hosts; +#endif + size = s; + disk_usage.init("Disk usage", "disk.dat", DISK); + upload_rate.init("Upload rate", "upload.dat", NETWORK); + download_rate.init("Download rate", "download.dat", NETWORK); + fault_tolerance.init("Fault tolerance", "fault_tol.dat", FAULT_TOLERANCE); + } + + // the creation of a file + // + virtual void handle() { + meta_chunk = new META_CHUNK(this, NULL, size, 0, id); +#ifdef EVENT_DEBUG + printf("created file %d: size %f encoded size %f\n", + id, size, disk_usage.value + ); +#endif + meta_chunk->recovery_plan(); + meta_chunk->recovery_action(); + } + + inline bool collecting_stats() { + return (pending_init_downloads == 0); + } + + void recover() { + meta_chunk->recovery_plan(); + meta_chunk->recovery_action(); + fault_tolerance.sample(meta_chunk->min_failures-1, collecting_stats()); + } + + void print_stats() { + printf("Statistics for file %d\n", id); + printf(" Server disk usage:\n"); + disk_usage.print(); + printf(" Upload rate:\n"); + upload_rate.print(); + printf(" Download rate:\n"); + download_rate.print(); + printf(" Fault tolerance level:\n"); + fault_tolerance.print(); + + FILE* f = fopen("summary.txt", "w"); + fault_tolerance.print_summary(f); + disk_usage.print_summary(f); + upload_rate.print_summary(f); + download_rate.print_summary(f); + fclose(f); + } +}; + +//////////////////// method defs //////////////////// + +void CHUNK_ON_HOST::start_upload() { + transfer_in_progress = true; + transfer_wait = true; + t = sim.now + drand()*params.connect_interval; +#ifdef EVENT_DEBUG + printf("%s: waiting to start upload of %s\n", now_str(), name); +#endif + sim.insert(this); +} + +void CHUNK_ON_HOST::start_download() { + transfer_in_progress = true; + transfer_wait = true; + t = sim.now + drand()*params.connect_interval; +#ifdef EVENT_DEBUG + printf("%s: waiting to start download of %s\n", now_str(), name); +#endif + sim.insert(this); +} + + +// transfer or transfer wait has finished +// +void CHUNK_ON_HOST::handle() { + if (transfer_wait) { + transfer_wait = false; + if (present_on_host) { +#ifdef EVENT_DEBUG + printf("%s: starting upload of %s\n", now_str(), name); +#endif + chunk->parent->dfile->upload_rate.sample_inc( + host->transfer_rate, + chunk->parent->dfile->collecting_stats() + ); + } else { +#ifdef EVENT_DEBUG + printf("%s: starting download of %s\n", now_str(), name); +#endif + chunk->parent->dfile->download_rate.sample_inc( + host->transfer_rate, + chunk->parent->dfile->collecting_stats() + ); + } + t = sim.now + chunk->size/host->transfer_rate; + sim.insert(this); + return; + } + transfer_in_progress = false; + if (present_on_host) { + // it was an upload +#ifdef EVENT_DEBUG + printf("%s: upload of %s completed\n", now_str(), name); +#endif + chunk->parent->dfile->upload_rate.sample_inc( + -host->transfer_rate, + chunk->parent->dfile->collecting_stats() + ); + chunk->upload_complete(); + } else { + present_on_host = true; +#ifdef EVENT_DEBUG + printf("%s: download of %s completed\n", now_str(), name); +#endif + chunk->parent->dfile->download_rate.sample_inc( + -host->transfer_rate, + chunk->parent->dfile->collecting_stats() + ); + chunk->download_complete(); + } +} + +void CHUNK_ON_HOST::remove() { + if (transfer_in_progress) { + sim.remove(this); + if (!transfer_wait) { + if (present_on_host) { + chunk->parent->dfile->upload_rate.sample_inc( + -host->transfer_rate, + chunk->parent->dfile->collecting_stats() + ); + } else { + chunk->parent->dfile->download_rate.sample_inc( + -host->transfer_rate, + chunk->parent->dfile->collecting_stats() + ); + } + } + } +} + +// the host has failed +// +void HOST::handle() { + set::iterator i = hosts.find(this); + hosts.erase(i); + +#ifdef EVENT_DEBUG + printf("%s: host %d failed\n", now_str(), id); +#endif + set::iterator p; + for (p = chunks.begin(); p != chunks.end(); p++) { + CHUNK_ON_HOST* c = *p; + c->chunk->host_failed(c); + c->remove(); + delete c; + } +} + +CHUNK::CHUNK(META_CHUNK* mc, double s, int index) { + parent = mc; + present_on_server = true; + size = s; + sprintf(name, "%s.%d", parent->name, index); + parent->dfile->pending_init_downloads += policy.replication; + parent->dfile->disk_usage.sample_inc(size, false); +} + +// if there aren't enough replicas of this chunk, +// pick new hosts and start downloads +// +void CHUNK::assign() { + if (!present_on_server) return; + while ((int)(hosts.size()) < policy.replication) { +#if 0 + if (parent->dfile->unused_hosts.size() == 0) { + die("no more hosts!\n"); + } + set::iterator i = parent->dfile->unused_hosts.begin(); + HOST* h = *i; + parent->dfile->unused_hosts.erase(i); +#else + HOST* h = new HOST; + sim.insert(h); +#endif + CHUNK_ON_HOST *c = new CHUNK_ON_HOST(); + sprintf(c->name, "chunk %s on host %d", name, h->id); +#ifdef EVENT_DEBUG + printf("%s: assigning chunk %s to host %d\n", now_str(), name, h->id); +#endif + c->host = h; + c->chunk = this; + h->chunks.insert(c); + hosts.insert(c); + c->start_download(); + } +} + +bool CHUNK::download_in_progress() { + set::iterator i; + for (i=hosts.begin(); i!=hosts.end(); i++) { + CHUNK_ON_HOST* c = *i; + if (c->download_in_progress()) return true; + } + return false; +} + +void CHUNK::start_upload() { + // if no upload of this chunk is in progress, start one. + // NOTE: all instances are inherently present_on_host, + // since this is only called if chunk is not present on server + // + CHUNK_ON_HOST* c; + set::iterator i; + for (i=hosts.begin(); i!=hosts.end(); i++) { + c = *i; + if (c->transfer_in_progress) return; + } + c = *(hosts.begin()); + c->start_upload(); +} + +void CHUNK::host_failed(CHUNK_ON_HOST* p) { + set::iterator i = hosts.find(p); + hosts.erase(i); +#ifdef EVENT_DEBUG + printf("%s: handling loss of %s\n", now_str(), p->name); +#endif + parent->dfile->recover(); +} + +void CHUNK::upload_complete() { + if (!present_on_server) { + present_on_server = true; + parent->dfile->disk_usage.sample_inc( + size, + parent->dfile->collecting_stats() + ); + } + parent->dfile->recover(); +} + +void CHUNK::download_complete() { + if (parent->dfile->pending_init_downloads) { + parent->dfile->pending_init_downloads--; + } + parent->dfile->recover(); +} + +META_CHUNK::META_CHUNK( + DFILE* d, META_CHUNK* par, double size, int coding_level, int index +) { + dfile = d; + parent = par; + coding = policy.codings[coding_level]; + if (parent) { + sprintf(name, "%s.%d", parent->name, index); + } else { + sprintf(name, "%d", index); + } + if (coding_levelcost < d2->cost; +} + +// sort by increase min_failures +// +bool compare_min_failures(const DATA_UNIT* d1, const DATA_UNIT* d2) { + return d1->min_failures < d2->min_failures; +} + +// Recovery logic: decide what to do in response to +// host failures and upload/download completions. +// +// One way to do this would be to store a bunch of state info +// with each node in the file's tree, +// and do things by local tree traversal. +// +// However, it's a lot simpler (for me, the programmer) +// to store minimal state info, +// and to reconstruct state info using +// a top-down tree traversal in response to each event. +// Actually we do 2 traversals: +// 1) plan phase: +// We see whether every node recoverable, +// and if so compute its "recovery set": +// the set of children from which it can be recovered +// with minimal cost (i.e. network traffic). +// Decide whether each chunk currently on the server needs to remain. +// 2) action phase +// Based on the results of phase 1, +// decide whether to start upload/download of chunks, +// and whether to delete data currently on server +// +void META_CHUNK::recovery_plan() { + vector recoverable; + vector present; + + unsigned int i; + have_unrecoverable_children = false; + + // make lists of children in various states + // + for (i=0; iin_recovery_set = false; + c->data_needed = false; + c->data_now_present = false; + c->recovery_plan(); + switch (c->status) { + case PRESENT: + present.push_back(c); + break; + case RECOVERABLE: + recoverable.push_back(c); + break; + case UNRECOVERABLE: + have_unrecoverable_children = true; + break; + } + } + + // based on states of children, decide what state we're in + // + if ((int)(present.size()) >= coding.n) { + status = PRESENT; + sort(present.begin(), present.end(), compare_cost); + present.resize(coding.n); + cost = 0; + for (i=0; icost; + c->in_recovery_set = true; + } + } else if ((int)(present.size() + recoverable.size()) >= coding.n) { + status = RECOVERABLE; + unsigned int j = coding.n - present.size(); + sort(recoverable.begin(), recoverable.end(), compare_cost); + cost = 0; + for (i=0; iin_recovery_set = true; + } + for (i=0; iin_recovery_set = true; + cost += c->cost; + } + + } else { + status = UNRECOVERABLE; + } +} + +const char* status_str(int status) { + switch (status) { + case PRESENT: return "present"; + case RECOVERABLE: return "recoverable"; + case UNRECOVERABLE: return "unrecoverable"; + } + return "unknown"; +} + +void CHUNK::recovery_plan() { + if (present_on_server) { + status = PRESENT; + cost = 0; + min_failures = INT_MAX; + } else if (hosts.size() > 0) { + status = RECOVERABLE; + cost = size; + if ((int)(hosts.size()) < policy.replication) { + data_needed = true; + } + min_failures = hosts.size(); + } else { + status = UNRECOVERABLE; + min_failures = 0; + } +#ifdef DEBUG_RECOVERY + printf("chunk plan %s: status %s\n", name, status_str(status)); +#endif +} + +void META_CHUNK::recovery_action() { + unsigned int i; + if (data_now_present) { + status = PRESENT; + } +#ifdef DEBUG_RECOVERY + printf("meta chunk action %s state %s unrec children %d\n", + name, status_str(status), have_unrecoverable_children + ); +#endif + for (i=0; iname, status_str(c->status), c->in_recovery_set + ); +#endif + switch (status) { + case PRESENT: + if (c->status == UNRECOVERABLE) { + c->data_now_present = true; + } + break; + case RECOVERABLE: + if (c->in_recovery_set && have_unrecoverable_children) { + c->data_needed = true; + } + break; + case UNRECOVERABLE: + break; + } + c->recovery_action(); + } + + // because of recovery action, some of our children may have changed + // status and fault tolerance, source may have changed too. + // Recompute them. + // + vector recoverable; + vector present; + for (i=0; istatus) { + case PRESENT: + present.push_back(c); + break; + case RECOVERABLE: + recoverable.push_back(c); + break; + } + } + if ((int)(present.size()) >= coding.n) { + status = PRESENT; + min_failures = INT_MAX; + } else if ((int)(present.size() + recoverable.size()) >= coding.n) { + status = RECOVERABLE; + + // our min_failures is the least X such that some X host failures + // would make this node unrecoverable + // + sort(recoverable.begin(), recoverable.end(), compare_min_failures); + min_failures = 0; + unsigned int k = coding.n - present.size(); + // we'd need to recover K recoverable children + unsigned int j = recoverable.size() - k + 1; + // a loss of J recoverable children would make this impossible + + // the loss of J recoverable children would make us unrecoverable + // Sum the min_failures of the J children with smallest min_failures + // + for (i=0; iname, c->min_failures); + min_failures += c->min_failures; + } + printf(" our min failures: %d\n", min_failures); + } +} + +void CHUNK::recovery_action() { + if (data_now_present) { + present_on_server = true; + parent->dfile->disk_usage.sample_inc( + size, + parent->dfile->collecting_stats() + ); + status = PRESENT; + } + if (status == PRESENT && (int)(hosts.size()) < policy.replication) { + assign(); + } + if (download_in_progress()) { + data_needed = true; + } +#ifdef DEBUG_RECOVERY + printf("chunk action: %s data_needed %d present_on_server %d\n", + name, data_needed, present_on_server + ); +#endif + if (data_needed) { + if (!present_on_server) { + start_upload(); + } + } else { + if (present_on_server) { + present_on_server = false; + status = RECOVERABLE; + min_failures = policy.replication; +#ifdef EVENT_DEBUG + printf("%s: %s replicated, removing from server\n", now_str(), name); +#endif + parent->dfile->disk_usage.sample_inc( + -size, + parent->dfile->collecting_stats() + ); + } + } +} + +set dfiles; + +int main(int argc, char** argv) { + + // default policy + // + policy.replication = 2; + policy.coding_levels = 1; + policy.codings[0].n = 10; + policy.codings[0].k = 6; + policy.codings[0].m = 16; + policy.codings[0].n_upload = 12; + + for (int i=1; it = 0; + sim.insert(h); +#endif + +#if 0 + for (int i=0; i<500; i++) { + sim.insert(new HOST); + } +#endif + DFILE* dfile = new DFILE(params.file_size); + sim.insert(dfile); + + sim.simulate(params.sim_duration); + + printf("%s: simulation finished\n", now_str()); + dfile->print_stats(); +} diff -Nru boinc-7.0.7+dfsg/vda/ssim.php boinc-7.0.14+dfsg/vda/ssim.php --- boinc-7.0.7+dfsg/vda/ssim.php 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/ssim.php 2012-01-19 20:11:52.000000000 +0000 @@ -0,0 +1,118 @@ +name = $filename; + $x->policy = array(); + $x->policy_name = array(); + $f = fopen($filename, "r"); + if (!$f) die("no file $filename\n"); + while (($buf = fgets($f)) !== false) { + $w = explode(" ", $buf); + switch ($w[0]) { + case "policy": + $pfile = trim($w[1]); + $x->policy[] = $pfile; + $g = fopen($pfile, "r"); + $name = fgets($g); + fclose($g); + $x->policy_name[] = trim($name); + break; + case "host_life_mean": + $x->host_life_mean = array(); + for ($i=1; $ihost_life_mean[] = 86400 * (double)($w[$i]); + } + break; + case "connect_interval": + $x->connect_interval = (double)($w[1]); + break; + case "mean_xfer_rate": + $x->mean_xfer_rate = (double)($w[1]); + break; + case "file_size": + $x->file_size = (double)($w[1]); + break; + } + } + fclose($f); + return $x; +} + +function make_graph($input, $prefix, $title, $index) { + $gp_filename = $input->name."_$prefix.gp"; + $f = fopen($gp_filename, "w"); + fprintf($f, "set terminal png small size 1024, 768 +set yrange[0:] +set ylabel \"$title\" +set xlabel \"Mean host lifetime (days)\" +plot "); + $n = sizeof($input->policy); + for ($i=0; $i<$n; $i++) { + $p = $input->policy[$i]; + $pname = $input->policy_name[$i]; + $fname = $input->name."_$p.dat"; + fprintf($f, "\"$fname\" using 1:$index title \"$pname\" with lines"); + if ($i < $n-1) { + fprintf($f, ", \\"); + } + fprintf($f, "\n"); + } + fclose($f); + $png_filename = $input->name."_$prefix.png"; + $cmd = "gnuplot < $gp_filename > $png_filename"; + echo "$cmd\n"; + system($cmd); +} + +function parse_output_file($fname) { + $f = fopen($fname, "r"); + if (!$f) { + die("no output file $fname\n"); + } + $ft = (int)fgets($f); + $du = (double)fgets($f); + $ul = (double)fgets($f); + $dl = (double)fgets($f); + return array($ft, $du, $ul, $dl); +} + +if ($argc != 2) { + die("usage: ssim.php infile\n"); +} +$input = parse_input_file($argv[1]); +foreach ($input->policy as $p) { + $datafile = fopen($input->name."_$p.dat", "w"); + if (!file_exists($p)) { + die("no policy file '$p'\n"); + } + foreach ($input->host_life_mean as $hlm) { + $cmd = "ssim --policy $p --host_life_mean $hlm --connect_interval $input->connect_interval --mean_xfer_rate $input->mean_xfer_rate --file_size $input->file_size > /dev/null"; + echo "$cmd\n"; + system($cmd); + list($ft, $du, $ub, $db) = parse_output_file("summary.txt"); + $hlmd = $hlm/86400; + $du_rel = $du/$input->file_size; + fprintf($datafile, "$hlmd $ft $du_rel $ub $db\n"); + } + fclose($datafile); +} + +make_graph($input, "ft", "Fault tolerance", 2); +make_graph($input, "du", "Relative disk usage", 3); +make_graph($input, "ub", "Upload bandwidth (Mbps)", 4); +make_graph($input, "db", "Download bandwidth (Mbps)", 5); + +?> diff -Nru boinc-7.0.7+dfsg/vda/vdad.cpp boinc-7.0.14+dfsg/vda/vdad.cpp --- boinc-7.0.7+dfsg/vda/vdad.cpp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/vdad.cpp 2012-01-26 08:39:51.000000000 +0000 @@ -0,0 +1,188 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + +#include +#include + +#include "boinc_db.h" + +#include "util.h" + +#include "vda_lib.h" + +// return the name of a file created by Jerasure's encoder +// +// encoder creates files with names of the form +// Coding/fname_k01.ext +// Coding/fname_m01.ext +// +void encoder_filename( + const char* base, const char* ext, CODING& c, int i, char* buf +) { + int ndigits = 1; + if (c.m > 9) ndigits = 2; + else if (c.m > 99) ndigits = 3; + else if (c.m > 999) ndigits = 4; + int j; + char ch; + if (i >= c.n) { + j = i-c.n + 1; + ch = 'm'; + } else { + j = i+1; + ch = 'k'; + } + sprintf(buf, "%s_%c%0*d%s", base, ch, ndigits, j, ext); +} + +// encode a meta-chunk. +// precondition: "dir" contains a file "fname". +// postcondition: dir contains +// a subdir Coding with encoded chunks +// subdirs fname_k0 ... fname_mn, +// each containing a same-named symbolic link to the corresponding chunk +// +int encode(const char* dir, const char* fname, CODING& c) { + char cmd[1024]; + sprintf(cmd, + "cd %s; /mydisks/b/users/boincadm/vda_test/encoder %s %d %d cauchy_good 32 1024 500000", + dir, fname, c.n, c.k + ); + printf("%s\n", cmd); + int s = system(cmd); + if (WIFEXITED(s)) { + int status = WEXITSTATUS(s); + if (status != 32) return -1; // encoder returns 32 for some reason + } + + char base[256], ext[256]; + strcpy(base, fname); + char* p = strchr(base, '.'); + if (p) { + strcpy(ext, p); + *p = 0; + } else { + strcpy(ext, ""); + } + for (int i=0; i0")) { + found = true; + retval = handle_file(vf); + if (retval) { + fprintf(stderr, "handle_file() failed: %d\n", retval); + } else { + vf.need_update = 0; + vf.update(); + } + } + return found; +} + +void handle_chunk(VDA_CHUNK_HOST& ch) { +} + +bool scan_chunks() { + DB_VDA_CHUNK_HOST ch; + char buf[256]; + bool found = false; + + sprintf(buf, "transition_time < %f", dtime()); + while (ch.enumerate(buf)) { + found = true; + handle_chunk(ch); + } + return found; +} + +int main(int argc, char** argv) { + VDA_FILE vf; + strcpy(vf.dir, "/mydisks/b/users/boincadm/vda_test"); + strcpy(vf.name, "file.ext"); + init_file(vf); + exit(0); + while(1) { + bool action = scan_files(); + action |= scan_chunks(); + if (!action) boinc_sleep(5.); + } +} diff -Nru boinc-7.0.7+dfsg/vda/vda_lib.cpp boinc-7.0.14+dfsg/vda/vda_lib.cpp --- boinc-7.0.7+dfsg/vda/vda_lib.cpp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/vda/vda_lib.cpp 2012-01-23 08:04:41.000000000 +0000 @@ -0,0 +1,59 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC 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 +// along with BOINC. If not, see . + +#include +#include + +#include "vda_lib.h" + +int POLICY::parse(const char* filename) { + int n; + char buf[256], buf2[256]; + + strcpy(description, ""); + + FILE* f = fopen(filename, "r"); + if (!f) { + fprintf(stderr, "No policy file %s\n", filename); + return -1; + } + n = fscanf(f, "%d", &replication); + if (n != 1) { + fprintf(stderr, "parse error in %s\n", filename); + return -1; + } + n = fscanf(f, "%d", &coding_levels); + if (n != 1) { + fprintf(stderr, "parse error in %s\n", filename); + return -1; + } + for (int i=0; i. + +// APIs for volunteer data archival (VDA) + +// parameters of 1 level of coding +// +struct CODING { + int n; + int k; + int m; // n + k + int n_upload; +}; + +// description of overall coding +// (possibly w/ multiple coding levels and replication) +// +struct POLICY { + int replication; + int coding_levels; + CODING codings[10]; + + char description[256]; // derived from the above + + int parse(const char*); +}; diff -Nru boinc-7.0.7+dfsg/version.h boinc-7.0.14+dfsg/version.h --- boinc-7.0.7+dfsg/version.h 2011-12-30 17:44:49.000000000 +0000 +++ boinc-7.0.14+dfsg/version.h 2012-02-02 19:57:12.000000000 +0000 @@ -10,10 +10,10 @@ #define BOINC_MINOR_VERSION 0 /* Release part of BOINC version number */ -#define BOINC_RELEASE 7 +#define BOINC_RELEASE 14 /* String representation of BOINC version number */ -#define BOINC_VERSION_STRING "7.0.7" +#define BOINC_VERSION_STRING "7.0.14" /* Package is a pre-release (Alpha/Beta) package */ /* #define BOINC_PRERELEASE 1 */ @@ -29,13 +29,13 @@ #define PACKAGE_NAME "BOINC" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "BOINC 7.0.7" +#define PACKAGE_STRING "BOINC 7.0.14" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "boinc" /* Define to the version of this package. */ -#define PACKAGE_VERSION "7.0.7" +#define PACKAGE_VERSION "7.0.14" #endif /* #if (defined(_WIN32) || defined(__APPLE__)) */ diff -Nru boinc-7.0.7+dfsg/version.h.in boinc-7.0.14+dfsg/version.h.in --- boinc-7.0.7+dfsg/version.h.in 2008-04-17 16:18:16.000000000 +0000 +++ boinc-7.0.14+dfsg/version.h.in 2012-01-26 20:46:25.000000000 +0000 @@ -16,7 +16,7 @@ #define BOINC_VERSION_STRING "@BOINC_VERSION_STRING@" /* Package is a pre-release (Alpha/Beta) package */ -#define BOINC_PRERELEASE 1 +/* #define BOINC_PRERELEASE 1 */ #if (defined(_WIN32) || defined(__APPLE__)) /* Name of package */ diff -Nru boinc-7.0.7+dfsg/zip/aclocal.m4 boinc-7.0.14+dfsg/zip/aclocal.m4 --- boinc-7.0.7+dfsg/zip/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/aclocal.m4 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,948 @@ +# generated automatically by aclocal 1.8.5 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.8.5])]) + +# AM_AUX_DIR_EXPAND + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# serial 7 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 3 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# -*- Autoconf -*- + + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. + +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + diff -Nru boinc-7.0.7+dfsg/zip/boinc_zip.cpp boinc-7.0.14+dfsg/zip/boinc_zip.cpp --- boinc-7.0.7+dfsg/zip/boinc_zip.cpp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/boinc_zip.cpp 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,337 @@ +// this is the "wrapper" file for the zip/unzip functions to expose to BOINC clients + +#pragma warning( disable : 4786 ) // Disable warning messages for vector + +#ifdef __cplusplus +extern "C" { +#else +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 +#ifndef __APPLE_CC__ +#include "config.h" +#endif +#include +#include +using std::string; +#endif + +#include "boinc_zip.h" +#include "filesys.h" // from BOINC for DirScan +#include + +// send in an output filename, advanced options (usually NULL), and numFileIn, szfileIn + +#ifndef _MAX_PATH +#define _MAX_PATH 255 +#endif + +unsigned char g_ucSort; + + // a "binary predicate" for use by the std::sort algorithm + // return true if "first > second" according to the g_ucSort type + + bool StringVectorSort(const std::string& first, const std::string& second) + { + + bool bRet = false; + if (g_ucSort & SORT_NAME + && g_ucSort & SORT_ASCENDING + && strcmp(first.c_str(), second.c_str())<0) + bRet = true; + else if (g_ucSort & SORT_NAME + && g_ucSort & SORT_DESCENDING + && strcmp(first.c_str(), second.c_str())>0) + bRet = true; + else if (g_ucSort & SORT_TIME) + { + struct stat st[2]; + stat(first.c_str(), &st[0]); + stat(second.c_str(), &st[1]); + if (g_ucSort & SORT_ASCENDING) { + bRet = st[0].st_mtime < st[1].st_mtime; + } + else { + bRet = st[0].st_mtime > st[1].st_mtime; + } + } + + return bRet; + } + +int boinc_zip(int bZipType, const std::string szFileZip, const std::string szFileIn) +{ + ZipFileList tempvec; + tempvec.push_back(szFileIn); + return boinc_zip(bZipType, szFileZip, &tempvec); +} + +int boinc_zip(int bZipType, const char* szFileZip, const char* szFileIn) +{ // just use the regular boinc_zip + std::string strFileZip, strFileIn; + strFileZip.assign(szFileZip); + strFileIn.assign(szFileIn); + ZipFileList tempvec; + tempvec.push_back(strFileIn); + return boinc_zip(bZipType, strFileZip, &tempvec); +} + +int boinc_zip(int bZipType, const std::string szFileZip, + const ZipFileList* pvectszFileIn) +{ + int carg; + char** av; + int iRet = 0, i = 0, nVecSize = 0; + + if (pvectszFileIn) nVecSize = pvectszFileIn->size(); + + // if unzipping but no file out, so it just uses cwd, only 3 args + //if (bZipType == UNZIP_IT) + // carg = 3 + nVecSize; + //else + carg = 3 + nVecSize; + + // make a dynamic array + av = (char**) calloc(carg+1, sizeof(char*)); + for (i=0;i<(carg+1);i++) + av[i] = (char*) calloc(_MAX_PATH,sizeof(char)); + + // just form an argc/argv to spoof the "main" + // default options are to recurse into directories + //if (options && strlen(options)) + // strcpy(av[1], options); + + if (bZipType == ZIP_IT) + { + strcpy(av[0], "zip"); + // default zip options -- no dir names, no subdirs, highest compression, quiet mode + if (strlen(av[1])==0) + strcpy(av[1], "-j9q"); + strcpy(av[2], szFileZip.c_str()); + + //sz 3 onward will be each vector + int jj; + for (jj=0; jjat(jj).c_str()); + } + else + { + strcpy(av[0], "unzip"); + // default unzip options -- preserve subdirs, overwrite + if (strlen(av[1])==0) + strcpy(av[1], "-oq"); + strcpy(av[2], szFileZip.c_str()); + + // if they passed in a directory unzip there + if (carg == 4) + sprintf(av[3], "-d%s", pvectszFileIn->at(0).c_str()); + } + strcpy(av[carg], ""); // null arg + // printf("args: %s %s %s %s\n", av[0], av[1], av[2], av[3]); + + if (bZipType == ZIP_IT) + { + if (access(szFileZip.c_str(), 0) == 0) + { // old zip file exists so unlink (otherwise zip will reuse, doesn't seem to be a flag to + // bypass zip reusing it + unlink(szFileZip.c_str()); + } + iRet = zip_main(carg, av); + } + else { + // make sure zip file exists + if (access(szFileZip.c_str(), 0) == 0) + iRet = unzip_main(carg, av); + else + iRet = 2; + } + + for (i=0;iclear(); // removes old entries that may be in pList + + // first tack on a final slash on user dir if required + if (strUserDir[iLen-1] != '\\' + && strUserDir[iLen] != '/') + { + // need a final slash, but what type? + // / is safe on all OS's for CPDN at least + // but if they already used \ use that + // well they didn't use a backslash so just use a slash + if (strUserDir.find("\\") == string::npos) + strUserDir += "/"; + else + strUserDir += "\\"; + } + + // transform strDir to either all \\ or all / + int j; + for (j=0; j<(int)directory.size(); j++) { + // take off final / or backslash + if (j == ((int)directory.size()-1) + && (strDir[j] == '/' || strDir[j]=='\\')) + strDir.resize(directory.size()-1); + else { +#ifdef _WIN32 // transform paths appropriate for OS + if (directory[j] == '/') + strDir[j] = '\\'; +#else + if (directory[j] == '\\') + strDir[j] = '/'; +#endif + } + } + + DirScanner dirscan(strDir); + memset(strPart, 0x00, 3*32); + while (dirscan.scan(strFile)) + { + iCtr = 0; + lastPos = 0; + iPos[0] = -1; + iPos[1] = -1; + iPos[2] = -1; + // match the whole filename returned against the regexp to see if it's a hit + // first get all the |'s to get the pieces to verify + while (iCtr<3 && (iPos[iCtr] = (int) spattern.find('|', lastPos)) > -1) + { + if (iCtr==0) { + strncpy(strPart[0], spattern.c_str(), iPos[iCtr]); + } + else { + strncpy(strPart[iCtr], spattern.c_str()+lastPos, iPos[iCtr]-lastPos); + } + lastPos = iPos[iCtr]+1; + + iCtr++; + } + if (iCtr>0) // found a | so need to get the part from lastpos onward + { + strncpy(strPart[iCtr], spattern.c_str()+lastPos, spattern.length() - lastPos); + } + + // check no | were found at all + if (iCtr == 0) + { + strcpy(strPart[0], spattern.c_str()); + iCtr++; // fake iCtr up 1 to get in the loop below + } + + bool bFound = true; + for (i = 0; i <= iCtr && bFound; i++) + { + if (i==0) { + iFnd = (int) strFile.find(strPart[0]); + bFound = (bool) (iFnd > -1); + } + else { + // search forward of the old part found + iFnd = (int) strFile.find(strPart[i], iFnd+1); + bFound = bFound && (bool) (iFnd > -1); + } + } + + if (bFound) + { + // this pattern matched the file, add to vector + // NB: first get stat to make sure it really is a file + strFullPath = strUserDir + strFile; + // only add if the file really exists (i.e. not a directory) + if (is_file(strFullPath.c_str())) { + pList->push_back(strFullPath); + } + } + + } + + // sort by file creation time + if (pList->size()>1) { // sort if list is greather than 1 + std::sort(pList->begin(), pList->end(), StringVectorSort); // may as well sort it? + } + 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 ); + + memset( &buf, 0, sizeof(buf) ); // data-blocks needs to be empty + 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: boinc_zip.cpp 18195 2009-05-22 21:19:44Z davea $"; + diff -Nru boinc-7.0.7+dfsg/zip/boinc_zip.dsp boinc-7.0.14+dfsg/zip/boinc_zip.dsp --- boinc-7.0.7+dfsg/zip/boinc_zip.dsp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/boinc_zip.dsp 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,301 @@ +# Microsoft Developer Studio Project File - Name="boinc_zip" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=boinc_zip - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "boinc_zip.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "boinc_zip.mak" CFG="boinc_zip - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "boinc_zip - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "boinc_zip - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +F90=df.exe +RSC=rc.exe + +!IF "$(CFG)" == "boinc_zip - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE F90 /compile_only /nologo /warn:nofileopt +# ADD F90 /compile_only /nologo /threads /warn:nofileopt +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\lib" /I "..\\" /I ".\\" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"boinc_zip.lib" + +!ELSEIF "$(CFG)" == "boinc_zip - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt +# ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /threads /traceback /warn:argument_checking /warn:nofileopt +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\lib" /I "..\\" /I ".\\" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"boinc_zipd.lib" + +!ENDIF + +# Begin Target + +# Name "boinc_zip - Win32 Release" +# Name "boinc_zip - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" +# Begin Source File + +SOURCE=.\boinc_zip.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\boinc_zip.h +# End Source File +# End Group +# Begin Group "Unzip Header Files" + +# PROP Default_Filter "*.h" +# Begin Source File + +SOURCE=.\unzip\consts.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\ebcdic.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\globals.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\inflate.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\tables.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\ttyio.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\unzip.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\unzpriv.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\unzvers.h +# End Source File +# Begin Source File + +SOURCE=.\unzip\win32\w32cfg.h +# End Source File +# End Group +# Begin Group "Unzip Source Files" + +# PROP Default_Filter "*.c" +# Begin Source File + +SOURCE=.\unzip\apihelp.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\crc32.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\crctab.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\envargs.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\explode.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\extract.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\fileio.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\globals.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\inflate.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\list.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\match.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\process.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\ttyio.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\unreduce.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\unshrink.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\unzip.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\win32\win32.c +# End Source File +# Begin Source File + +SOURCE=.\unzip\zipinfo.c +# End Source File +# End Group +# Begin Group "Zip Header Files" + +# PROP Default_Filter "*.c" +# Begin Source File + +SOURCE=.\zip\win32\osdep.h +# End Source File +# Begin Source File + +SOURCE=.\zip\revision.h +# End Source File +# Begin Source File + +SOURCE=.\zip\tailor.h +# End Source File +# Begin Source File + +SOURCE=.\zip\z_ttyio.h +# End Source File +# Begin Source File + +SOURCE=.\zip\zip.h +# End Source File +# Begin Source File + +SOURCE=.\zip\ziperr.h +# End Source File +# End Group +# Begin Group "Zip Source Files" + +# PROP Default_Filter "*.c" +# Begin Source File + +SOURCE=.\zip\deflate.c +# End Source File +# Begin Source File + +SOURCE=.\zip\mktime.c +# End Source File +# Begin Source File + +SOURCE=.\zip\trees.c +# End Source File +# Begin Source File + +SOURCE=.\zip\util.c +# End Source File +# Begin Source File + +SOURCE=.\zip\win32\win32zip.c +# End Source File +# Begin Source File + +SOURCE=.\zip\z_fileio.c +# End Source File +# Begin Source File + +SOURCE=.\zip\z_globals.c +# End Source File +# Begin Source File + +SOURCE=.\zip\win32\z_win32.c +# End Source File +# Begin Source File + +SOURCE=.\zip\zip.c +# End Source File +# Begin Source File + +SOURCE=.\zip\zipfile.c +# End Source File +# Begin Source File + +SOURCE=.\zip\zipup.c +# End Source File +# End Group +# End Target +# End Project diff -Nru boinc-7.0.7+dfsg/zip/boinc_zip.h boinc-7.0.14+dfsg/zip/boinc_zip.h --- boinc-7.0.7+dfsg/zip/boinc_zip.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/boinc_zip.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,67 @@ +// this is the "wrapper" header file for the zip/unzip functions to expose to BOINC clients +// CMC - 18/03/2004, Oxford University for BOINC project +// released under the BOINC license + +// note that I've disabled zip encryption to try and simplify things +// (zip encryption is fairly weak and easy to break anyway) + +// you will need to link against the library (boinc_zip.lib on Windows-Release, +// boinc_zipd.lib for Windows-Debug, or libboinc_zip.a on Unix & Mac OSX) + +// also you will need to include filesys.C in your project +// (decided not to add that in the lib due to version problems that may arise) + +#ifdef __cplusplus +#include +#include +#endif +#include +#include + +#define ZIP_IT 1 +#define UNZIP_IT 0 + +// bitmasks for sort type on the ZipFileList +// optional but CPDN SmallExecs likes reverse date order +#define SORT_ASCENDING 0x01 +#define SORT_DESCENDING 0x02 + +#define SORT_TIME 0x10 +#define SORT_NAME 0x20 + +#ifdef __cplusplus +using std::string; + +typedef std::vector ZipFileList; + +// forward declarations for boinc_zip functions +// note it's basically like running zip/unzip, just comprise an argc/argv +// send in an input file or path wildcard, output filename, and basic options + +// default options for zip (bZip = true) are "-j9q" which is +// DON'T recurse/list subdirectories, best compression, quiet operation +// call it with bZiptype = ZIP_IP to zip, bZip = UNZIP_IT to unzip (duh) + +// note boinc_zip is overloaded for ease of use +// i.e. you can just send char filenames, or std::strings, or preferably +// a vector of std::string of filenames to add to the zip archive + +// there is also a crude but handy wildcard matching function to build +// the vector of string's, and probably better than using wildcards in zip +// across platforms + +bool boinc_filelist(const std::string directory, + const std::string pattern, + ZipFileList* pList, + const unsigned char ucSort = SORT_NAME | SORT_DESCENDING, + 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 +#endif +int boinc_zip(int bZipType, const char* szFileZip, const char* szFileIn); + diff -Nru boinc-7.0.7+dfsg/zip/boinc_zip.vcproj boinc-7.0.14+dfsg/zip/boinc_zip.vcproj --- boinc-7.0.7+dfsg/zip/boinc_zip.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/boinc_zip.vcproj 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,800 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru boinc-7.0.7+dfsg/zip/boinc_zip.xcodeproj/project.pbxproj boinc-7.0.14+dfsg/zip/boinc_zip.xcodeproj/project.pbxproj --- boinc-7.0.7+dfsg/zip/boinc_zip.xcodeproj/project.pbxproj 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/boinc_zip.xcodeproj/project.pbxproj 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,379 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + E32411B80FC5DBAB0006868A /* api.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411A60FC5DBAB0006868A /* api.c */; }; + E32411B90FC5DBAB0006868A /* apihelp.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411A70FC5DBAB0006868A /* apihelp.c */; }; + E32411BA0FC5DBAB0006868A /* crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411A80FC5DBAB0006868A /* crc32.c */; }; + E32411BB0FC5DBAB0006868A /* crctab.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411A90FC5DBAB0006868A /* crctab.c */; }; + E32411BC0FC5DBAB0006868A /* envargs.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411AA0FC5DBAB0006868A /* envargs.c */; }; + E32411BD0FC5DBAB0006868A /* explode.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411AB0FC5DBAB0006868A /* explode.c */; }; + E32411BE0FC5DBAB0006868A /* extract.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411AC0FC5DBAB0006868A /* extract.c */; }; + E32411BF0FC5DBAB0006868A /* fileio.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411AD0FC5DBAB0006868A /* fileio.c */; }; + E32411C00FC5DBAB0006868A /* globals.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411AE0FC5DBAB0006868A /* globals.c */; }; + E32411C10FC5DBAB0006868A /* inflate.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411AF0FC5DBAB0006868A /* inflate.c */; }; + E32411C20FC5DBAB0006868A /* list.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B00FC5DBAB0006868A /* list.c */; }; + E32411C30FC5DBAB0006868A /* match.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B10FC5DBAB0006868A /* match.c */; }; + E32411C40FC5DBAB0006868A /* process.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B20FC5DBAB0006868A /* process.c */; }; + E32411C50FC5DBAB0006868A /* ttyio.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B30FC5DBAB0006868A /* ttyio.c */; }; + E32411C60FC5DBAB0006868A /* unreduce.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B40FC5DBAB0006868A /* unreduce.c */; }; + E32411C70FC5DBAB0006868A /* unshrink.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B50FC5DBAB0006868A /* unshrink.c */; }; + E32411C80FC5DBAB0006868A /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B60FC5DBAB0006868A /* unzip.c */; }; + E32411C90FC5DBAB0006868A /* zipinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411B70FC5DBAB0006868A /* zipinfo.c */; }; + E32411D20FC5DBFA0006868A /* deflate.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411CA0FC5DBFA0006868A /* deflate.c */; }; + E32411D30FC5DBFA0006868A /* trees.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411CB0FC5DBFA0006868A /* trees.c */; }; + E32411D40FC5DBFA0006868A /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411CC0FC5DBFA0006868A /* util.c */; }; + E32411D50FC5DBFA0006868A /* z_fileio.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411CD0FC5DBFA0006868A /* z_fileio.c */; }; + E32411D60FC5DBFA0006868A /* z_globals.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411CE0FC5DBFA0006868A /* z_globals.c */; }; + E32411D70FC5DBFA0006868A /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411CF0FC5DBFA0006868A /* zip.c */; }; + E32411D80FC5DBFA0006868A /* zipfile.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411D00FC5DBFA0006868A /* zipfile.c */; }; + E32411D90FC5DBFA0006868A /* zipup.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411D10FC5DBFA0006868A /* zipup.c */; }; + E32411DB0FC5DC110006868A /* z_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411DA0FC5DC110006868A /* z_unix.c */; }; + E32411DD0FC5DC2B0006868A /* unix.c in Sources */ = {isa = PBXBuildFile; fileRef = E32411DC0FC5DC2B0006868A /* unix.c */; }; + E32411DF0FC5DC410006868A /* boinc_zip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E32411DE0FC5DC410006868A /* boinc_zip.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D2AAC046055464E500DB518D /* libboinc_zip.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libboinc_zip.a; sourceTree = BUILT_PRODUCTS_DIR; }; + E32411A60FC5DBAB0006868A /* api.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = api.c; path = unzip/api.c; sourceTree = ""; }; + E32411A70FC5DBAB0006868A /* apihelp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = apihelp.c; path = unzip/apihelp.c; sourceTree = ""; }; + E32411A80FC5DBAB0006868A /* crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crc32.c; path = unzip/crc32.c; sourceTree = ""; }; + E32411A90FC5DBAB0006868A /* crctab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crctab.c; path = unzip/crctab.c; sourceTree = ""; }; + E32411AA0FC5DBAB0006868A /* envargs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = envargs.c; path = unzip/envargs.c; sourceTree = ""; }; + E32411AB0FC5DBAB0006868A /* explode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = explode.c; path = unzip/explode.c; sourceTree = ""; }; + E32411AC0FC5DBAB0006868A /* extract.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = extract.c; path = unzip/extract.c; sourceTree = ""; }; + E32411AD0FC5DBAB0006868A /* fileio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fileio.c; path = unzip/fileio.c; sourceTree = ""; }; + E32411AE0FC5DBAB0006868A /* globals.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = globals.c; path = unzip/globals.c; sourceTree = ""; }; + E32411AF0FC5DBAB0006868A /* inflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inflate.c; path = unzip/inflate.c; sourceTree = ""; }; + E32411B00FC5DBAB0006868A /* list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = list.c; path = unzip/list.c; sourceTree = ""; }; + E32411B10FC5DBAB0006868A /* match.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = match.c; path = unzip/match.c; sourceTree = ""; }; + E32411B20FC5DBAB0006868A /* process.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = process.c; path = unzip/process.c; sourceTree = ""; }; + E32411B30FC5DBAB0006868A /* ttyio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ttyio.c; path = unzip/ttyio.c; sourceTree = ""; }; + E32411B40FC5DBAB0006868A /* unreduce.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unreduce.c; path = unzip/unreduce.c; sourceTree = ""; }; + E32411B50FC5DBAB0006868A /* unshrink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unshrink.c; path = unzip/unshrink.c; sourceTree = ""; }; + E32411B60FC5DBAB0006868A /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unzip.c; path = unzip/unzip.c; sourceTree = ""; }; + E32411B70FC5DBAB0006868A /* zipinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zipinfo.c; path = unzip/zipinfo.c; sourceTree = ""; }; + E32411CA0FC5DBFA0006868A /* deflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = deflate.c; path = zip/deflate.c; sourceTree = ""; }; + E32411CB0FC5DBFA0006868A /* trees.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = trees.c; path = zip/trees.c; sourceTree = ""; }; + E32411CC0FC5DBFA0006868A /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = zip/util.c; sourceTree = ""; }; + E32411CD0FC5DBFA0006868A /* z_fileio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = z_fileio.c; path = zip/z_fileio.c; sourceTree = ""; }; + E32411CE0FC5DBFA0006868A /* z_globals.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = z_globals.c; path = zip/z_globals.c; sourceTree = ""; }; + E32411CF0FC5DBFA0006868A /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = zip/zip.c; sourceTree = ""; }; + E32411D00FC5DBFA0006868A /* zipfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zipfile.c; path = zip/zipfile.c; sourceTree = ""; }; + E32411D10FC5DBFA0006868A /* zipup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zipup.c; path = zip/zipup.c; sourceTree = ""; }; + E32411DA0FC5DC110006868A /* z_unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = z_unix.c; path = zip/unix/z_unix.c; sourceTree = ""; }; + E32411DC0FC5DC2B0006868A /* unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unix.c; path = unzip/unix/unix.c; sourceTree = ""; }; + E32411DE0FC5DC410006868A /* boinc_zip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = boinc_zip.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D289987405E68DCB004EDB86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* boinc_zip */ = { + isa = PBXGroup; + children = ( + E32411A30FC5DB400006868A /* unzip */, + E32411A20FC5DB390006868A /* zip */, + 08FB7795FE84155DC02AAC07 /* Source */, + C6A0FF2B0290797F04C91782 /* Documentation */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = boinc_zip; + sourceTree = ""; + }; + 08FB7795FE84155DC02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + E32411DE0FC5DC410006868A /* boinc_zip.cpp */, + ); + name = Source; + sourceTree = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC046055464E500DB518D /* libboinc_zip.a */, + ); + name = Products; + sourceTree = ""; + }; + C6A0FF2B0290797F04C91782 /* Documentation */ = { + isa = PBXGroup; + children = ( + ); + name = Documentation; + sourceTree = ""; + }; + E32411A20FC5DB390006868A /* zip */ = { + isa = PBXGroup; + children = ( + E32411DA0FC5DC110006868A /* z_unix.c */, + E32411CA0FC5DBFA0006868A /* deflate.c */, + E32411CB0FC5DBFA0006868A /* trees.c */, + E32411CC0FC5DBFA0006868A /* util.c */, + E32411CD0FC5DBFA0006868A /* z_fileio.c */, + E32411CE0FC5DBFA0006868A /* z_globals.c */, + E32411CF0FC5DBFA0006868A /* zip.c */, + E32411D00FC5DBFA0006868A /* zipfile.c */, + E32411D10FC5DBFA0006868A /* zipup.c */, + ); + name = zip; + sourceTree = ""; + }; + E32411A30FC5DB400006868A /* unzip */ = { + isa = PBXGroup; + children = ( + E32411DC0FC5DC2B0006868A /* unix.c */, + E32411A60FC5DBAB0006868A /* api.c */, + E32411A70FC5DBAB0006868A /* apihelp.c */, + E32411A80FC5DBAB0006868A /* crc32.c */, + E32411A90FC5DBAB0006868A /* crctab.c */, + E32411AA0FC5DBAB0006868A /* envargs.c */, + E32411AB0FC5DBAB0006868A /* explode.c */, + E32411AC0FC5DBAB0006868A /* extract.c */, + E32411AD0FC5DBAB0006868A /* fileio.c */, + E32411AE0FC5DBAB0006868A /* globals.c */, + E32411AF0FC5DBAB0006868A /* inflate.c */, + E32411B00FC5DBAB0006868A /* list.c */, + E32411B10FC5DBAB0006868A /* match.c */, + E32411B20FC5DBAB0006868A /* process.c */, + E32411B30FC5DBAB0006868A /* ttyio.c */, + E32411B40FC5DBAB0006868A /* unreduce.c */, + E32411B50FC5DBAB0006868A /* unshrink.c */, + E32411B60FC5DBAB0006868A /* unzip.c */, + E32411B70FC5DBAB0006868A /* zipinfo.c */, + ); + name = unzip; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC043055464E500DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC045055464E500DB518D /* boinc_zip */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "boinc_zip" */; + buildPhases = ( + D2AAC043055464E500DB518D /* Headers */, + D2AAC044055464E500DB518D /* Sources */, + D289987405E68DCB004EDB86 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = boinc_zip; + productName = boinc_zip; + productReference = D2AAC046055464E500DB518D /* libboinc_zip.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "boinc_zip" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* boinc_zip */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D2AAC045055464E500DB518D /* boinc_zip */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC044055464E500DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E32411B80FC5DBAB0006868A /* api.c in Sources */, + E32411B90FC5DBAB0006868A /* apihelp.c in Sources */, + E32411BA0FC5DBAB0006868A /* crc32.c in Sources */, + E32411BB0FC5DBAB0006868A /* crctab.c in Sources */, + E32411BC0FC5DBAB0006868A /* envargs.c in Sources */, + E32411BD0FC5DBAB0006868A /* explode.c in Sources */, + E32411BE0FC5DBAB0006868A /* extract.c in Sources */, + E32411BF0FC5DBAB0006868A /* fileio.c in Sources */, + E32411C00FC5DBAB0006868A /* globals.c in Sources */, + E32411C10FC5DBAB0006868A /* inflate.c in Sources */, + E32411C20FC5DBAB0006868A /* list.c in Sources */, + E32411C30FC5DBAB0006868A /* match.c in Sources */, + E32411C40FC5DBAB0006868A /* process.c in Sources */, + E32411C50FC5DBAB0006868A /* ttyio.c in Sources */, + E32411C60FC5DBAB0006868A /* unreduce.c in Sources */, + E32411C70FC5DBAB0006868A /* unshrink.c in Sources */, + E32411C80FC5DBAB0006868A /* unzip.c in Sources */, + E32411C90FC5DBAB0006868A /* zipinfo.c in Sources */, + E32411D20FC5DBFA0006868A /* deflate.c in Sources */, + E32411D30FC5DBFA0006868A /* trees.c in Sources */, + E32411D40FC5DBFA0006868A /* util.c in Sources */, + E32411D50FC5DBFA0006868A /* z_fileio.c in Sources */, + E32411D60FC5DBFA0006868A /* z_globals.c in Sources */, + E32411D70FC5DBFA0006868A /* zip.c in Sources */, + E32411D80FC5DBFA0006868A /* zipfile.c in Sources */, + E32411D90FC5DBFA0006868A /* zipup.c in Sources */, + E32411DB0FC5DC110006868A /* z_unix.c in Sources */, + E32411DD0FC5DC2B0006868A /* unix.c in Sources */, + E32411DF0FC5DC410006868A /* boinc_zip.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB91EC08733DB70010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = ( + i386, + ppc, + x86_64, + ); + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + _THREAD_SAFE, + UNIX, + DLL, + PIC, + ); + HEADER_SEARCH_PATHS = ( + ./, + ../lib/, + ./zip/, + ./unzip/, + ); + INSTALL_PATH = /usr/local/lib; + ONLY_ACTIVE_ARCH = NO; + OTHER_CFLAGS = ( + "-I../lib", + "-Izip", + "-Iunzip", + "-I./", + ); + PRODUCT_NAME = boinc_zip; + SDKROOT = macosx10.4; + "SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; + "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Debug; + }; + 1DEB91ED08733DB70010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = ( + i386, + ppc, + x86_64, + ); + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_PREPROCESSOR_DEFINITIONS = ( + _THREAD_SAFE, + UNIX, + DLL, + PIC, + ); + HEADER_SEARCH_PATHS = ( + ./, + ../lib/, + ./zip/, + ./unzip/, + ); + INSTALL_PATH = /usr/local/lib; + ONLY_ACTIVE_ARCH = NO; + OTHER_CFLAGS = ( + "-I../lib", + "-Izip", + "-Iunzip", + "-I./", + ); + PRODUCT_NAME = boinc_zip; + SDKROOT = macosx10.4; + "SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; + "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; + }; + name = Release; + }; + 1DEB91F008733DB70010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.5; + }; + name = Debug; + }; + 1DEB91F108733DB70010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = macosx10.5; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "boinc_zip" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB91EC08733DB70010E9CD /* Debug */, + 1DEB91ED08733DB70010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "boinc_zip" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB91F008733DB70010E9CD /* Debug */, + 1DEB91F108733DB70010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff -Nru boinc-7.0.7+dfsg/zip/Makefile.am boinc-7.0.14+dfsg/zip/Makefile.am --- boinc-7.0.7+dfsg/zip/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/Makefile.am 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,75 @@ +## -*- mode: makefile; tab-width: 4 -*- +## $Id: Makefile.am 18003 2009-05-05 09:16:57Z davea $ + +## note: -D flags taken from a zip config build under Linux + +include ../Makefile.incl + +SUBDIRS = zip unzip + +AM_CPPFLAGS += -I$(top_srcdir)/zlib -I$(top_srcdir)/lib -I$(top_srcdir)/zip -I$(top_srcdir)/zip/zip -I$(top_srcdir)/zip/unzip -DUNIX -DDLL + +if INSTALL_HEADERS +pkginclude_HEADERS = boinc_zip.h +endif + +libboinc_zip_sources = \ +boinc_zip.cpp \ +./unzip/apihelp.c \ +./unzip/crc32.c \ +./unzip/crctab.c \ +./unzip/envargs.c \ +./unzip/explode.c \ +./unzip/extract.c \ +./unzip/fileio.c \ +./unzip/globals.c \ +./unzip/inflate.c \ +./unzip/list.c \ +./unzip/match.c \ +./unzip/process.c \ +./unzip/ttyio.c \ +./unzip/unreduce.c \ +./unzip/unshrink.c \ +./unzip/unzip.c \ +./unzip/zipinfo.c \ +./unzip/api.c \ +./zip/deflate.c \ +./zip/trees.c \ +./zip/util.c \ +./zip/z_fileio.c \ +./zip/z_globals.c \ +./zip/zip.c \ +./zip/zipfile.c \ +./zip/zipup.c \ +./zip/unix/z_unix.c \ +./unzip/unix/unix.c + +##noinst_PROGRAMS = test +if ENABLE_LIBRARIES + +lib_LTLIBRARIES = libboinc_zip.la +libboinc_zip_la_SOURCES = $(libboinc_zip_sources) +libboinc_zip_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) +libboinc_zip_la_LIBADD = + +# Some OSs may not prefix libraries with lib. +# For example OS2 +if OS_OS2 +LIBBOINC_ZIP_STATIC=boinc_zip.${LIBEXT} +else +LIBBOINC_ZIP_STATIC=libboinc_zip.${LIBEXT} +endif + + +if BUILD_STATIC_LIBS +all_local = $(LIBBOINC_ZIP_STATIC) + +endif + +all-local: $(all_local) + +$(LIBBOINC_ZIP_STATIC): libboinc_zip.la + rm -f $(LIBBOINC_ZIP_STATIC) + $(LN) .libs/$(LIBBOINC_ZIP_STATIC) . + +endif diff -Nru boinc-7.0.7+dfsg/zip/README.txt boinc-7.0.14+dfsg/zip/README.txt --- boinc-7.0.7+dfsg/zip/README.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/README.txt 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,92 @@ +boinc_zip -- any questions/comments please email carlc@comlab.ox.ac.uk + +boinc_zip is used on the climateprediction.net project to compress our +large input/output files. It is provided to BOINC developers as part +of the package, although it is not a "mandatory" component. It is +based on the "Info-Zip" libraries, but combines both zip & unzip +functionality in one library. (http://www.info-zip.org) + +Basically, it will allow you to build a library that you can link +against to provide basic zip/unzip compression functionality. It +should only add a few hundred KB to your app (basically like +distributing zip & unzip exe's for different platforms). + +Limitations: the "unzip" functionality is there, that is you can unzip +a file and it will create all directories & files in the zip file. +The "zip" functionality has some limitations due to the cross-platform +nature: mainly it doens't provide zipping recursively (i.e. +subdirectories); and wildcard handling is done using the "boinc_filelist" +function which will be explained below. + +Building: For Windows, you can just add the project "boinc_zip" to your +Visual Studio "Solution" or "Workspace." Basically just "Insert Existing +Project" from the Visual Studio IDE, navigate over to the boinc/zip +directory, and it should load the appropriate files. You can then build +"Debug" and "Release" versions of the library. Then just add the +appropriate reference to "boinc_zip.lib" (Release build) or "boinc_zipd.lib" +(Debug build) in your app. + +For Linux & Mac, you should be able to run "./configure" and then do a "make" +to build the "libboinc_zip.a" lib that you will link against. In extreme +cases, you may need to do an "aclocal && autoconf && automake" first, +to build properly for your platform. + +Also, please note that boinc_zip relies on some BOINC functions that you +will need (and will most likely be in your app already since they are handy) + -- namely boinc/lib/filesys.C and boinc/lib/util.C + +Using: +Basically, you will need to #include "boinc_zip.h" in your app (of course +your compiler will need to know where it is, i.e. -I../boinc/zip). + +Then you can just call the function "boinc_zip" with the appropriate arguments +to zip or unzip. There are three overridden boinc_zip's provided: + +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_zip(int bZipType, const char* szFileZip, const char* szFileIn); + +bZipType is ZIP_IT or UNZIP_IT (self-explanatory) + +szFileZip is the name of the zip file to create or extract +(I assume the user will provide it with the .zip extension) + +The main differences are in the file parameter. The zip library used was +exhibiting odd behavior when "coexisting" with unzip, particularly in the +wildcard handling. So a function was made that creates a "ZipFileList" class, +which is basically a vector of filenames. If you are just compressing a +single file, you can use either the std::string or const char* szFileIn overrides. + +You can also just pass in a "*" or a "*.*" to zip up all files in a directory. + +To zip multiple files in a "mix & match" fashion, you can use the boinc_filelist +function provided. Basically, it's a crude pattern matching of files in a +directory, but it has been useful for us on the CPDN project. Just create a +ZipFileList instance, and then pass this into boinc_filelist as follows: + +bool boinc_filelist(const std::string directory, + const std::string pattern, + ZipFileList* pList, + const unsigned char ucSort = SORT_NAME | SORT_DESCENDING, + const bool bClear = true); + +if you want to zip up all text (.txt) files in a directory, just pass in: +the directory as a std::string, the pattern, i.e. ".txt", &yourZipList + +The last two flags are the sort order of the file list (CPDN files need to be +in a certain order -- descending filenames, which is why that's the default). +The default is to "clear" your list, you can set that to "false" to keep adding +files to your "ZipFileList". + +When you have created your "ZipFileList" just pass that pointer to boinc_zip. +You will be able to add files in other directories this way. + +There is a "ziptest" Project for Windows provided to experiment, which can +also be run (the "ziptest.cpp") on Unix & Mac to experiment +with how boinc_zip work (just g++ with the boinc/lib/filesys.C & util.C as +described above). + +NB -- this library can now "co-exist" with zlib (libz) as of 19/08/2005 + took out the USE_ZLIB -- causing conflicts, so now this InfoZip based boinc_zip is "independent" of any zlib use/linkage you may have/need. \ No newline at end of file diff -Nru boinc-7.0.7+dfsg/zip/test.c boinc-7.0.14+dfsg/zip/test.c --- boinc-7.0.7+dfsg/zip/test.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/test.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,32 @@ +#define DIRREF long + +#include "config.h" +#include "boinc_zip.h" +#ifndef _WIN32 +#endif + +int main() +{ + int retval = -2; + ZipFileList zf; + +#ifdef _WIN32 + // replace with the path/file wildcard of your choice + int retval = boinc_zip(ZIP_IT, + "e:\\temp\\netsup.vxd e:\\temp\\vredir.vxd", + "e:\\temp\\test.zip", NULL); + retval = boinc_zip(UNZIP_IT, "e:\\temp\\test.zip", + "/home/carlc/testing", NULL); +#else + std::string zipfile = "test.zip"; + if (boinc_filelist("/var/home/carlc/", ".txt", &zf) && zf.size()) { + retval = boinc_zip(ZIP_IT, zipfile, &zf); + retval = boinc_zip(UNZIP_IT, zipfile, NULL); + } +#endif + + return retval; +} + + +const char *BOINC_RCSID_9f234ef8a3 = "$Id: test.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/api.c boinc-7.0.14+dfsg/zip/unzip/api.c --- boinc-7.0.7+dfsg/zip/unzip/api.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/api.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,611 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + api.c + + This module supplies an UnZip engine for use directly from C/C++ + programs. The functions are: + + UzpVer *UzpVersion(void); + void UzpVersion2(UzpVer2 *version) + int UzpMain(int argc, char *argv[]); + int UzpAltMain(int argc, char *argv[], UzpInit *init); + int UzpValidate(char *archive, int AllCodes); + void UzpFreeMemBuffer(UzpBuffer *retstr); + int UzpUnzipToMemory(char *zip, char *file, UzpOpts *optflgs, + UzpCB *UsrFuncts, UzpBuffer *retstr); + + non-WINDLL only (a special WINDLL variant is defined in windll/windll.c): + int UzpGrep(char *archive, char *file, char *pattern, int cmd, int SkipBin, + UzpCB *UsrFuncts); + + OS/2 only (for now): + int UzpFileTree(char *name, cbList(callBack), char *cpInclude[], + char *cpExclude[]); + + You must define `DLL' in order to include the API extensions. + + ---------------------------------------------------------------------------*/ + +#ifdef OS2 +# define INCL_DOSMEMMGR +# include +#endif +#include + +#define UNZIP_INTERNAL +#include "unzip.h" +#ifdef WINDLL +# include "windll/windll.h" +#endif +#include "unzvers.h" + +#ifdef DLL /* This source file supplies DLL-only interface code. */ + +jmp_buf dll_error_return; + +/*--------------------------------------------------------------------------- + Documented API entry points + ---------------------------------------------------------------------------*/ + + +UzpVer * UZ_EXP UzpVersion() /* should be pointer to const struct */ +{ + static UzpVer version; /* doesn't change between calls */ + + + version.structlen = UZPVER_LEN; + +#ifdef BETA + version.flag = 1; +#else + version.flag = 0; +#endif + version.betalevel = UZ_BETALEVEL; + version.date = UZ_VERSION_DATE; + +#ifdef ZLIB_VERSION + version.zlib_version = ZLIB_VERSION; + version.flag |= 2; +#else + version.zlib_version = NULL; +#endif + + /* someday each of these may have a separate patchlevel: */ + version.unzip.major = UZ_MAJORVER; + version.unzip.minor = UZ_MINORVER; + version.unzip.patchlevel = UZ_PATCHLEVEL; + + version.zipinfo.major = ZI_MAJORVER; + version.zipinfo.minor = ZI_MINORVER; + version.zipinfo.patchlevel = UZ_PATCHLEVEL; + + /* these are retained for backward compatibility only: */ + version.os2dll.major = UZ_MAJORVER; + version.os2dll.minor = UZ_MINORVER; + version.os2dll.patchlevel = UZ_PATCHLEVEL; + + version.windll.major = UZ_MAJORVER; + version.windll.minor = UZ_MINORVER; + version.windll.patchlevel = UZ_PATCHLEVEL; + + return &version; +} + +void UZ_EXP UzpVersion2(UzpVer2 *version) +{ + + version->structlen = UZPVER_LEN; + +#ifdef BETA + version->flag = 1; +#else + version->flag = 0; +#endif + strcpy(version->betalevel, UZ_BETALEVEL); + strcpy(version->date, UZ_VERSION_DATE); + +#ifdef ZLIB_VERSION + strcpy(version->zlib_version, ZLIB_VERSION); + version->flag |= 2; +#else + version->zlib_version[0] = '\0'; +#endif + + /* someday each of these may have a separate patchlevel: */ + version->unzip.major = UZ_MAJORVER; + version->unzip.minor = UZ_MINORVER; + version->unzip.patchlevel = UZ_PATCHLEVEL; + + version->zipinfo.major = ZI_MAJORVER; + version->zipinfo.minor = ZI_MINORVER; + version->zipinfo.patchlevel = UZ_PATCHLEVEL; + + /* these are retained for backward compatibility only: */ + version->os2dll.major = UZ_MAJORVER; + version->os2dll.minor = UZ_MINORVER; + version->os2dll.patchlevel = UZ_PATCHLEVEL; + + version->windll.major = UZ_MAJORVER; + version->windll.minor = UZ_MINORVER; + version->windll.patchlevel = UZ_PATCHLEVEL; +} + + + + + +#ifndef WINDLL + +int UZ_EXP UzpAltMain(int argc, char *argv[], UzpInit *init) +{ + int r, (*dummyfn)(); + + + CONSTRUCTGLOBALS(); + + if (init->structlen >= (sizeof(ulg) + sizeof(dummyfn)) && init->msgfn) + G.message = init->msgfn; + + if (init->structlen >= (sizeof(ulg) + 2*sizeof(dummyfn)) && init->inputfn) + G.input = init->inputfn; + + if (init->structlen >= (sizeof(ulg) + 3*sizeof(dummyfn)) && init->pausefn) + G.mpause = init->pausefn; + + if (init->structlen >= (sizeof(ulg) + 4*sizeof(dummyfn)) && init->userfn) + (*init->userfn)(); /* allow void* arg? */ + + r = unzip(__G__ argc, argv); + DESTROYGLOBALS(); + RETURN(r); +} + +#endif /* !WINDLL */ + + + + +#ifndef __16BIT__ + +void UZ_EXP UzpFreeMemBuffer(UzpBuffer *retstr) +{ + if (retstr->strptr != NULL) { + free(retstr->strptr); + retstr->strptr = NULL; + } +} + + + + +#ifndef WINDLL + +static int UzpDLL_Init OF((zvoid *pG, UzpCB *UsrFuncts)); + +static int UzpDLL_Init(pG, UsrFuncts) +zvoid *pG; +UzpCB *UsrFuncts; +{ + int (*dummyfn)(); + + if (UsrFuncts->structlen >= (sizeof(ulg) + sizeof(dummyfn)) && + UsrFuncts->msgfn) + ((Uz_Globs *)pG)->message = UsrFuncts->msgfn; + else + return FALSE; + + if (UsrFuncts->structlen >= (sizeof(ulg) + 2*sizeof(dummyfn)) && + UsrFuncts->inputfn) + ((Uz_Globs *)pG)->input = UsrFuncts->inputfn; + + if (UsrFuncts->structlen >= (sizeof(ulg) + 3*sizeof(dummyfn)) && + UsrFuncts->pausefn) + ((Uz_Globs *)pG)->mpause = UsrFuncts->pausefn; + + if (UsrFuncts->structlen >= (sizeof(ulg) + 4*sizeof(dummyfn)) && + UsrFuncts->passwdfn) + ((Uz_Globs *)pG)->decr_passwd = UsrFuncts->passwdfn; + + if (UsrFuncts->structlen >= (sizeof(ulg) + 5*sizeof(dummyfn)) && + UsrFuncts->statrepfn) + ((Uz_Globs *)pG)->statreportcb = UsrFuncts->statrepfn; + + return TRUE; +} + + +int UZ_EXP UzpUnzipToMemory(char *zip, char *file, UzpOpts *optflgs, + UzpCB *UsrFuncts, UzpBuffer *retstr) +{ + int r; +#if (defined(WINDLL) && !defined(CRTL_CP_IS_ISO)) + char *intern_zip, *intern_file; +#endif + + CONSTRUCTGLOBALS(); +#if (defined(WINDLL) && !defined(CRTL_CP_IS_ISO)) + intern_zip = (char *)malloc(strlen(zip)+1); + if (intern_zip == NULL) { + DESTROYGLOBALS(); + return PK_MEM; + } + intern_file = (char *)malloc(strlen(file)+1); + if (intern_file == NULL) { + DESTROYGLOBALS(); + free(intern_zip); + return PK_MEM; + } + ISO_TO_INTERN(zip, intern_zip); + ISO_TO_INTERN(file, intern_file); +# define zip intern_zip +# define file intern_file +#endif + /* Copy those options that are meaningful for UzpUnzipToMemory, instead of + * a simple "memcpy(G.UzO, optflgs, sizeof(UzpOpts));" + */ + uO.pwdarg = optflgs->pwdarg; + uO.aflag = optflgs->aflag; + uO.C_flag = optflgs->C_flag; + uO.qflag = optflgs->qflag; /* currently, overridden in unzipToMemory */ + + if (!UzpDLL_Init((zvoid *)&G, UsrFuncts)) { + DESTROYGLOBALS(); + return PK_BADERR; + } + G.redirect_data = 1; + + r = (unzipToMemory(__G__ zip, file, retstr) <= PK_WARN); + + DESTROYGLOBALS(); +#if (defined(WINDLL) && !defined(CRTL_CP_IS_ISO)) +# undef file +# undef zip + free(intern_file); + free(intern_zip); +#endif + if (!r && retstr->strlength) { + free(retstr->strptr); + retstr->strptr = NULL; + } + return r; +} +#endif /* !WINDLL */ +#endif /* !__16BIT__ */ + + + + + +#ifdef OS2DLL + +int UZ_EXP UzpFileTree(char *name, cbList(callBack), char *cpInclude[], + char *cpExclude[]) +{ + int r; + + CONSTRUCTGLOBALS(); + uO.qflag = 2; + uO.vflag = 1; + uO.C_flag = 1; + G.wildzipfn = name; + G.process_all_files = TRUE; + if (cpInclude) { + char **ptr = cpInclude; + + while (*ptr != NULL) ptr++; + G.filespecs = ptr - cpInclude; + G.pfnames = cpInclude, G.process_all_files = FALSE; + } + if (cpExclude) { + char **ptr = cpExclude; + + while (*ptr != NULL) ptr++; + G.xfilespecs = ptr - cpExclude; + G.pxnames = cpExclude, G.process_all_files = FALSE; + } + + G.processExternally = callBack; + r = process_zipfiles(__G)==0; + DESTROYGLOBALS(); + return r; +} + +#endif /* OS2DLL */ + + + + +/*--------------------------------------------------------------------------- + Helper functions + ---------------------------------------------------------------------------*/ + + +void setFileNotFound(__G) + __GDEF +{ + G.filenotfound++; +} + + + +int unzipToMemory(__GPRO__ char *zip, char *file, UzpBuffer *retstr) +{ + int r; + char *incname[2]; + + G.process_all_files = FALSE; + G.extract_flag = TRUE; + uO.qflag = 2; + G.wildzipfn = zip; + + G.pfnames = incname; + incname[0] = file; + incname[1] = NULL; + G.filespecs = 1; + + r = process_zipfiles(__G); + if (retstr) { + retstr->strptr = (char *)G.redirect_buffer; + retstr->strlength = G.redirect_size; + } + return r; /* returns `PK_???' error values */ +} + + + +int redirect_outfile(__G) + __GDEF +{ + if (G.redirect_size != 0 || G.redirect_buffer != NULL) + return FALSE; + +#ifndef NO_SLIDE_REDIR + G.redirect_slide = !G.pInfo->textmode; +#endif + G.redirect_size = (G.pInfo->textmode ? + G.lrec.ucsize * lenEOL : G.lrec.ucsize); +#ifdef OS2 + DosAllocMem((void **)&G.redirect_buffer, G.redirect_size+1, + PAG_READ|PAG_WRITE|PAG_COMMIT); + G.redirect_pointer = G.redirect_buffer; +#else +#ifdef __16BIT__ + if ((ulg)((extent)G.redirect_size) != G.redirect_size) + return FALSE; +#endif + G.redirect_pointer = + G.redirect_buffer = malloc((extent)(G.redirect_size+1)); +#endif + if (!G.redirect_buffer) + return FALSE; + G.redirect_pointer[G.redirect_size] = '\0'; + return TRUE; +} + + + +int writeToMemory(__GPRO__ ZCONST uch *rawbuf, extent size) +{ + if ((uch *)rawbuf != G.redirect_pointer) + memcpy(G.redirect_pointer, rawbuf, size); + G.redirect_pointer += size; + return 0; +} + + + + +int close_redirect(__G) + __GDEF +{ + if (G.pInfo->textmode) { + *G.redirect_pointer = '\0'; + G.redirect_size = (ulg)(G.redirect_pointer - G.redirect_buffer); + if ((G.redirect_buffer = + realloc(G.redirect_buffer, G.redirect_size + 1)) == NULL) { + G.redirect_size = 0; + return EOF; + } + } + return 0; +} + + + + +#ifndef __16BIT__ +#ifndef WINDLL + +/* Purpose: Determine if file in archive contains the string szSearch + + Parameters: archive = archive name + file = file contained in the archive. This cannot be + a wild card to be meaningful + pattern = string to search for + cmd = 0 - case-insensitive search + 1 - case-sensitve search + 2 - case-insensitive, whole words only + 3 - case-sensitive, whole words only + SkipBin = if true, skip any files that have control + characters other than CR, LF, or tab in the first + 100 characters. + + Returns: TRUE if a match is found + FALSE if no match is found + -1 on error + + Comments: This does not pretend to be as useful as the standard + Unix grep, which returns the strings associated with a + particular pattern, nor does it search past the first + matching occurrence of the pattern. + */ + +int UZ_EXP UzpGrep(char *archive, char *file, char *pattern, int cmd, + int SkipBin, UzpCB *UsrFuncts) +{ + int retcode = FALSE, compare; + ulg i, j, patternLen, buflen; + char * sz, *p; + UzpOpts flgopts; + UzpBuffer retstr; + + memzero(&flgopts, sizeof(UzpOpts)); /* no special options */ + + if (!UzpUnzipToMemory(archive, file, &flgopts, UsrFuncts, &retstr)) { + return -1; /* not enough memory, file not found, or other error */ + } + + if (SkipBin) { + if (retstr.strlength < 100) + buflen = retstr.strlength; + else + buflen = 100; + for (i = 0; i < buflen; i++) { + if (iscntrl(retstr.strptr[i])) { + if ((retstr.strptr[i] != 0x0A) && + (retstr.strptr[i] != 0x0D) && + (retstr.strptr[i] != 0x09)) + { + /* OK, we now think we have a binary file of some sort */ + free(retstr.strptr); + return FALSE; + } + } + } + } + + patternLen = strlen(pattern); + + if (retstr.strlength < patternLen) { + free(retstr.strptr); + return FALSE; + } + + sz = malloc(patternLen + 3); /* add two in case doing whole words only */ + if (cmd > 1) { + strcpy(sz, " "); + strcat(sz, pattern); + strcat(sz, " "); + } else + strcpy(sz, pattern); + + if ((cmd == 0) || (cmd == 2)) { + for (i = 0; i < strlen(sz); i++) + sz[i] = toupper(sz[i]); + for (i = 0; i < retstr.strlength; i++) + retstr.strptr[i] = toupper(retstr.strptr[i]); + } + + for (i = 0; i < (retstr.strlength - patternLen); i++) { + p = &retstr.strptr[i]; + compare = TRUE; + for (j = 0; j < patternLen; j++) { + /* We cannot do strncmp here, as we may be dealing with a + * "binary" file, such as a word processing file, or perhaps + * even a true executable of some sort. */ + if (p[j] != sz[j]) { + compare = FALSE; + break; + } + } + if (compare == TRUE) { + retcode = TRUE; + break; + } + } + + free(sz); + free(retstr.strptr); + + return retcode; +} +#endif /* !WINDLL */ +#endif /* !__16BIT__ */ + + + + +int UZ_EXP UzpValidate(char *archive, int AllCodes) +{ + int retcode; + CONSTRUCTGLOBALS(); + + uO.jflag = 1; + uO.tflag = 1; + uO.overwrite_none = 0; + G.extract_flag = (!uO.zipinfo_mode && + !uO.cflag && !uO.tflag && !uO.vflag && !uO.zflag +#ifdef TIMESTAMP + && !uO.T_flag +#endif + ); + + uO.qflag = 2; /* turn off all messages */ + G.fValidate = TRUE; + G.pfnames = (char **)&fnames[0]; /* assign default filename vector */ +#ifdef WINDLL + Wiz_NoPrinting(TRUE); +#endif + + if (archive == NULL) { /* something is screwed up: no filename */ + DESTROYGLOBALS(); + return PK_NOZIP; + } + + G.wildzipfn = (char *)malloc(FILNAMSIZ + 1); + strcpy(G.wildzipfn, archive); +#if (defined(WINDLL) && !defined(CRTL_CP_IS_ISO)) + _ISO_INTERN(G.wildzipfn); +#endif + + G.process_all_files = TRUE; /* for speed */ + + retcode = setjmp(dll_error_return); + + if (retcode) { +#ifdef WINDLL + Wiz_NoPrinting(FALSE); +#endif + free(G.wildzipfn); + DESTROYGLOBALS(); + return PK_BADERR; + } + + retcode = process_zipfiles(__G); + + free(G.wildzipfn); +#ifdef WINDLL + Wiz_NoPrinting(FALSE); +#endif + DESTROYGLOBALS(); + + /* PK_WARN == 1 and PK_FIND == 11. When we are just looking at an + archive, we should still be able to see the files inside it, + even if we can't decode them for some reason. + + We also still want to be able to get at files even if there is + something odd about the zip archive, hence allow PK_WARN, + PK_FIND, IZ_UNSUP as well as PK_ERR + */ + + if (AllCodes) + return retcode; + + if ((retcode == PK_OK) || (retcode == PK_WARN) || (retcode == PK_ERR) || + (retcode == IZ_UNSUP) || (retcode == PK_FIND)) + return TRUE; + else + return FALSE; +} + +#endif /* DLL */ + +const char *BOINC_RCSID_4f32a548c6 = "$Id: api.c 11875 2007-01-15 23:28:33Z rprix $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/apihelp.c boinc-7.0.14+dfsg/zip/unzip/apihelp.c --- boinc-7.0.7+dfsg/zip/unzip/apihelp.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/apihelp.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,157 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* apihelp.c */ + +#ifdef API_DOC + +#define UNZIP_INTERNAL +#include "unzip.h" +#include "unzvers.h" + + +APIDocStruct APIDoc[] = { + { + "UZPVERSION" , "UzpVersion" , + "UzpVer *UzpVersion(void);", + "Get version numbers of the API and the underlying UnZip code.\n\n" + "\t\tThis is used for comparing the version numbers of the run-time\n" + "\t\tDLL code with those expected from the unzip.h at compile time.\n" + "\t\tIf the version numbers do not match, there may be compatibility\n" + "\t\tproblems with further use of the DLL.\n\n" + " Example:\t/* Check the major version number of the DLL code. */\n" + "\t\tUzpVer *pVersion;\n" + "\t\tpVersion = UzpVersion();\n" + "\t\tif (pVersion->unzip.major != UZ_MAJORVER)\n" + "\t\t fprintf(stderr, \"error: using wrong version of DLL\\n\");\n\n" + "\t\tSee unzip.h for details and unzipstb.c for an example.\n" + }, + + { + "UZPMAIN" , "UzpMain" , + "int UzpMain(int argc, char *argv[]);", + "Provide a direct entry point to the command line interface.\n\n" + "\t\tThis is used by the UnZip stub but you can use it in your\n" + "\t\town program as well. Output is sent to stdout.\n" + "\t\t0 on return indicates success.\n\n" + " Example:\t/* Extract 'test.zip' silently, junking paths. */\n" + "\t\tchar *argv[] = { \"-q\", \"-j\", \"test.zip\" };\n" + "\t\tint argc = 3;\n" + "\t\tif (UzpMain(argc,argv))\n" + "\t\t printf(\"error: unzip failed\\n\");\n\n" + "\t\tSee unzip.h for details.\n" + }, + + { + "UZPALTMAIN" , "UzpAltMain" , + "int UzpAltMain(int argc, char *argv[], UzpInit *init);", + "Provide a direct entry point to the command line interface,\n" + "optionally installing replacement I/O handler functions.\n\n" + "\t\tAs with UzpMain(), output is sent to stdout by default.\n" + "\t\t`InputFn *inputfn' is not yet implemented. 0 on return\n" + "\t\tindicates success.\n\n" + " Example:\t/* Replace normal output and `more' functions. */\n" + "\t\tchar *argv[] = { \"-q\", \"-j\", \"test.zip\" };\n" + "\t\tint argc = 3;\n" + "\t\tUzpInit init = { 16, MyMessageFn, NULL, MyPauseFn };\n" + "\t\tif (UzpAltMain(argc,argv,&init))\n" + "\t\t printf(\"error: unzip failed\\n\");\n\n" + "\t\tSee unzip.h for details.\n" + }, + + { + "UZPUNZIPTOMEMORY", "UzpUnzipToMemory", + "int UzpUnzipToMemory(char *zip, char *file, UzpBuffer *retstr);", + "Pass the name of the zip file and the name of the file\n" + "\t\tyou wish to extract. UzpUnzipToMemory will create a\n" + "\t\tbuffer and return it in *retstr; 0 on return indicates\n" + "\t\tfailure.\n\n" + "\t\tSee unzip.h for details.\n" + }, + + { + "UZPFILETREE", "UzpFileTree", + "int UzpFileTree(char *name, cbList(callBack),\n" + "\t\t\tchar *cpInclude[], char *cpExclude[]);", + "Pass the name of the zip file, a callback function, an\n" + "\t\tinclude and exclude file list. UzpFileTree calls the\n" + "\t\tcallback for each valid file found in the zip file.\n" + "\t\t0 on return indicates failure.\n\n" + "\t\tSee unzip.h for details.\n" + }, + + { 0 } +}; + + +static int function_help OF((__GPRO__ APIDocStruct *doc, char *fname)); + + + +static int function_help(__G__ doc, fname) + __GDEF + APIDocStruct *doc; + char *fname; +{ + strcpy(slide, fname); + /* strupr(slide); non-standard */ + while (doc->compare && STRNICMP(doc->compare,slide,strlen(fname))) + doc++; + if (!doc->compare) + return 0; + else + Info(slide, 0, ((char *)slide, + " Function:\t%s\n\n Syntax:\t%s\n\n Purpose:\t%s", + doc->function, doc->syntax, doc->purpose)); + + return 1; +} + + + +void APIhelp(__G__ argc, argv) + __GDEF + int argc; + char **argv; +{ + if (argc > 1) { + struct APIDocStruct *doc; + + if (function_help(__G__ APIDoc, argv[1])) + return; +#ifdef SYSTEM_API_DETAILS + if (function_help(__G__ SYSTEM_API_DETAILS, argv[1])) + return; +#endif + Info(slide, 0, ((char *)slide, + "%s is not a documented command.\n\n", argv[1])); + } + + Info(slide, 0, ((char *)slide, "\ +This API provides a number of external C and REXX functions for handling\n\ +zipfiles in OS/2. Programmers are encouraged to expand this API.\n\ +\n\ +C functions: -- See unzip.h for details\n\ + UzpVer *UzpVersion(void);\n\ + int UzpMain(int argc, char *argv[]);\n\ + int UzpAltMain(int argc, char *argv[], UzpInit *init);\n\ + int UzpUnzipToMemory(char *zip, char *file, UzpBuffer *retstr);\n\ + int UzpFileTree(char *name, cbList(callBack),\n\ + char *cpInclude[], char *cpExclude[]);\n\n")); + +#ifdef SYSTEM_API_BRIEF + Info(slide, 0, ((char *)slide, SYSTEM_API_BRIEF)); +#endif + + Info(slide, 0, ((char *)slide, + "\nFor more information, type 'unzip -A '\n")); +} + +#endif /* API_DOC */ + +const char *BOINC_RCSID_99b98e9cf9 = "$Id: apihelp.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/BUGS boinc-7.0.14+dfsg/zip/unzip/BUGS --- boinc-7.0.7+dfsg/zip/unzip/BUGS 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/BUGS 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,80 @@ +Bogus bugs (not our fault!): +--------------------------- + + By far THE BIGGEST source of bug reports to Info-ZIP/zip-bugs is the + incorrect transfer of zipfiles (or of the UnZip executable itself). + ALWAYS TRANSFER IN BINARY MODE! This includes ftp transfers and *both* + ends of a Kermit connection ("set file type binary"). If your copy + isn't exactly the same size as the original, you made a mistake. + + Another common source of errors such as "compression method 8 not sup- + ported" is the existence of an old version of UnZip somewhere in your + path. Make sure you're using the version you think you're using; give + the full path explicitly if necessary. Executing "unzip" without any + options will print a help screen, at the top of which is the UnZip + version number and release date; and executing "unzip -v" without any + zipfile or other options will give information about what compiler was + used, the target operating system, any special UnZip options, and the + date of compilation--only for version 5.11 and later, though! (Also, + under Unix C shell and some Bourne shells, "which unzip" will print + the path of the unzip you're actually using. Under OS/2 and MS-DOS, + whch21gr.zip [on Simtel mirror sites] will do the same thing; in addi- + tion, "which -a unzip" will show *all* copies of "unzip" in your path.) + + +Bugs (real and/or imagined): +--------------------------- + + - [OS/2 DLL] when trying to use the REXX function UzUnZipToStem to extract a + file with `&' in its name, the DLL crashes (but UzUnZipToVar still works) + [Daniel H, 961215] + - UnZip has problems with archives bigger than 2GB; it may print "note: didn't + find end-of-central-dir signature at end of central dir" (harmless) or + may not be able to seek to member files [James Lemley 970107, Iris Spaniol + 970206, ...] + + - fix overwrite behavior: hidden/system problems?; etc. + - 32-bit DOS UnZip still unable to set volume labels? + - 32-bit DOS UnZip under OS/2 doesn't extract all wildcard zipfiles? + [DOS box: unzip386 (ver 5.12) x:\32bit\unix\emx09a\*.zip, Hobbes 3/95] + - 32-bit DOS UnZip under OS/2 doesn't set timestamp when overwriting files + on HPFS partition? (go32 and pmode/w both; emx/rsx OK) [Eberhard Mattes + 950726] + - USE_FWRITE still causes occasional CRC errors when extracting on Pyramid? + [Kevin Fritz 931102] + - still NT/W95 bug with "unzip -v d:*.zip" not matching properly? [Steve S + 940527] + 980427: bug no longer exists, Opendir() must have been corrected by someone + + - when ^Z received in no-echo mode, echo is not restored (works OK if + resume, however) + - signal() handler disabled after first use with one of BSD/SysV? + - MKS Korn shell: unzip assumes the MKS-style command-line environment + options are relevant to it, but this is not the case if unzip was called + by another program (e.g., from a .BAT file). A fix for this exists for + Borland compilers but not for MSC, Watcom, djgpp, etc. + - OS/2: for paths with one long component, the .LONGNAME EA may be saved for + all components (waste of disk space): how to check?? + - VMS: for extracting to other directories, only the VMS-style "-d [.foo]" + format is accepted; "-d foo" should also be allowed. Long filenames are + not automatically truncated to 39.39. + - Novell Netware: Netware drives may clear the archive bit on extracted + files under OS/2 and/or MS-DOS. UnZip always *tries* to set the archive + bit, however. [pynq@uchicago, 940527] + - DEC Ultrix: on long zipfiles, unzip will sometimes fail (bad CRC, not always + reproducible); this is apparently due either to a hardware bug (cache mem) + or OS bug (page faults?) [Igor, Jean-loup, bottom of BUGS.long] + - funzip/more/decryption/no-echo bug: race condition(?) causes terminal to + be "reset" to no-echo state + - Macintosh (100200), Atari (020000) external file attributes not interpreted + correctly (both unzip and zipinfo) + - pkbug error: zipfile with incorrect csize and/or ucsize--check for end of + compressed (csize) data in uncompression routines: + unreduce.c: while (((outpos + outcnt) < ucsize) && (!zipeof)) { + [James Birdsall, Mark, bottom of BUGS.long] + - OS/2: directory EAs not restored if directory exists [Kai Uwe, KG27515@uark] + (subsequent note: no way to determine which EAs are newer ==> cannot + restore without user input) + (update: as of UnZip 5.30, option -o forces restoring of directory EAs) + - MS-DOS: Borland executables don't allow other than 80-column, 25/43/50-line + screen modes (Borland bug) [Michael Stillwell] diff -Nru boinc-7.0.7+dfsg/zip/unzip/consts.h boinc-7.0.14+dfsg/zip/unzip/consts.h --- boinc-7.0.7+dfsg/zip/unzip/consts.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/consts.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,54 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + consts.h + + This file contains global, initialized variables that never change. It is + included by unzip.c and windll/windll.c. + + ---------------------------------------------------------------------------*/ + + +/* And'ing with mask_bits[n] masks the lower n bits */ +ZCONST ush near mask_bits[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +ZCONST char Far VersionDate[] = UZ_VERSION_DATE; /* now defined in unzvers.h */ + +#ifndef SFX + ZCONST char Far EndSigMsg[] = + "\nnote: didn't find end-of-central-dir signature at end of central dir.\n"; +#endif + +ZCONST char Far CentSigMsg[] = + "error: expected central file header signature not found (file #%lu).\n"; +ZCONST char Far SeekMsg[] = + "error [%s]: attempt to seek before beginning of zipfile\n%s"; +ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %s\n"; +ZCONST char Far ExclFilenameNotMatched[] = + "caution: excluded filename not matched: %s\n"; + +#ifdef VMS + ZCONST char Far ReportMsg[] = "\ + (please check that you have transferred or created the zipfile in the\n\ + appropriate BINARY mode--this includes ftp, Kermit, AND unzip'd zipfiles)\n"; +#else + ZCONST char Far ReportMsg[] = "\ + (please check that you have transferred or created the zipfile in the\n\ + appropriate BINARY mode and that you have compiled UnZip properly)\n"; +#endif + +#ifndef SFX + ZCONST char Far Zipnfo[] = "zipinfo"; + ZCONST char Far CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; +#endif diff -Nru boinc-7.0.7+dfsg/zip/unzip/Contents boinc-7.0.14+dfsg/zip/unzip/Contents --- boinc-7.0.7+dfsg/zip/unzip/Contents 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/Contents 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,82 @@ +Contents of the UnZip 5.50 source archive. The OS-specific subdirectories +at the end contain their own Contents listings: + + Contents this file + README what UnZip is; general information + LICENSE Info-ZIP license; terms for using and distributing UnZip + COPYING.OLD historic copyrights and distribution policy (obsolete) + INSTALL how to compile and install UnZip and related utilities + WHERE where Zip/UnZip and encryption/decryption support can be found + History.550 new features and fixes in this release + ToDo rough priority list of new features to be added in next release + BUGS known bugs, problems, and (possible) other features to be added + unzip.txt UnZip manual page, human-readable format + unzipsfx.txt UnZipSFX manual page, human-readable format + zipinfo.txt ZipInfo manual page, human-readable format + zipgrep.txt ZipGrep manual page, human-readable format + funzip.txt fUnZip manual page, human-readable format + file_id.diz BBS-oriented file describing this archive + testmake.zip test archive for checking whether newly compiled UnZip works + api.c generic DLL entry points, support functions (required for DLLs) + apihelp.c API help text for DLL versions (currently OS/2 only) + consts.h global, initialized variables that never change (required) + crc32.c code for calculation 32bit CRC of a string buffer (required*) + crc_i386.S fast assembler replacement for crc32.c (Intel 386 and newer) + crctab.c supplies polynomial table for CRC calculation + crypt.c de-/encryption routines (required*) + crypt.h de-/encryption header file (required*) + ebcdic.h static lookup table for ASCII <-> EBCDIC translation (required) + envargs.c code to read options from environment variables (required) + explode.c code for exploding (required) + extract.c high-level extraction and decryption code (required) + fileio.c file manipulation and password code (required) + funzip.c filter unzip: extracts in a pipe from stdin to stdout + gbloffs.c helper program to retrieve offsets of globals struct members + globals.c code to support global variables with reentrancy (required) + globals.h definition of global structure G (required) + inflate.c code for inflating (required*) + inflate.h header file for inflating (required*) + list.c UnZip listing routines, non-ZipInfo mode (required) + match.c pattern-matching code for filename wildcards (required) + process.c zipfile headers code (required) + tables.h static lookup tables used in fileio.c and funzip.c (required*) + timezone.c timezone and timestamp functions (required) + timezone.h header file for interface to "internal" tz functions (required) + ttyio.c code for handling nonecho tty input: password, pager (required) + ttyio.h header file for nonecho tty input: password, pager (required) + unreduce.c code for unreducing (required) + unshrink.c code for unshrinking (required) + unzip.c UnZip main(), usage and options code (required) + unzip.h public half of main UnZip header file (required*) + unzipstb.c minimal UnZip "stub" file demonstrating use of DLL versions + unzpriv.h private (internal) half of main UnZip header file (required*) + unzvers.h header with UnZip/UnZipSFX and ZipInfo version info (required) + zip.h dummy header for use with crypt.c (required*) + zipinfo.c UnZip listing routines, ZipInfo mode (required) + acorn/ support files for compiling under Acorn RISC OS + amiga/ support files for compiling under AmigaDOS + aosvs/ support files for compiling under Data General AOS/VS + atari/ support files for compiling under Atari TOS + beos/ support files for compiling under BeOS + cmsmvs/ support files for compiling under VM/CMS and MVS + flexos/ support files for compiling under FlexOS + human68k/ support files for compiling under X68000/Human68K + macos/ support files for compiling under Macintosh OS + msdos/ support files for compiling under MS-DOS + novell/ support files for compiling for Novell Netware NLM + os2/ support files for compiling under OS/2 (includes DLL stuff) + qdos/ support files for compiling under SMS/QDOS + tandem/ support files for compiling under Tandem NSK + theos/ support files for compiling under Theos + tops20/ support files for compiling under TOPS-20 + unix/ support files for compiling under Unix + vms/ support files for compiling under VMS + win32/ support files for compiling under Windows 9x and Windows NT + wince/ support files for compiling under Windows CE (GUI version) + windll/ support files for compiling Windows 3.x/9x/NT DLLs + man/ nroff man-page sources for the main user documentation + proginfo/ programming docs, additional technical info, contributor list + +Files marked "required*" are also needed to compile fUnZip. The normal +UnZip makefile targets now make both UnZipSFX and fUnZip, except in a few +cases; ZipInfo is now incorporated into UnZip (see zipinfo.txt for usage). diff -Nru boinc-7.0.7+dfsg/zip/unzip/crc32.c boinc-7.0.14+dfsg/zip/unzip/crc32.c --- boinc-7.0.7+dfsg/zip/unzip/crc32.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/crc32.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,66 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* $Id: crc32.c 7481 2005-08-25 21:33:28Z davea $ */ + +#define __CRC32_C /* identifies this source module */ + +#include "zip.h" + +#ifndef USE_ZLIB +#ifndef ASM_CRC + +#ifndef ZCONST +# define ZCONST const +#endif + +#ifdef CRC32 +# undef CRC32 +#endif +#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) +#define DO1(buf) crc = CRC32(crc, *buf++) +#define DO2(buf) DO1(buf); DO1(buf) +#define DO4(buf) DO2(buf); DO2(buf) +#define DO8(buf) DO4(buf); DO4(buf) + +/* ========================================================================= */ +ulg crc32(crc, buf, len) + register ulg crc; /* crc shift register */ + register ZCONST uch *buf; /* pointer to bytes to pump through */ + extent len; /* number of bytes in buf[] */ +/* Run a set of bytes through the crc shift register. If buf is a NULL + pointer, then initialize the crc shift register contents instead. + Return the current crc in either case. */ +{ + register ZCONST ulg near *crc_table; + + if (buf == NULL) return 0L; + + crc_table = get_crc_table_boinc(); + + crc = crc ^ 0xffffffffL; +#ifndef NO_UNROLLED_LOOPS + while (len >= 8) { + DO8(buf); + len -= 8; + } +#endif + if (len) do { + DO1(buf); + } while (--len); + return crc ^ 0xffffffffL; /* (instead of ~c for 64-bit machines) */ +} +#endif /* !ASM_CRC */ +#endif /* !USE_ZLIB */ + +const char *BOINC_RCSID_7a5ef6a9d8 = "$Id: crc32.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/crc_i386.S boinc-7.0.14+dfsg/zip/unzip/crc_i386.S --- boinc-7.0.7+dfsg/zip/unzip/crc_i386.S 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/crc_i386.S 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,232 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + * crc_i386.S, optimized CRC calculation function for Zip and UnZip, + * created by Paul Kienitz and Christian Spieler. Last revised 24 Dec 98. + * + * GRR 961110: incorporated Scott Field optimizations from win32/crc_i386.asm + * => overall 6% speedup in "unzip -tq" on 9MB zipfile (486-66) + * + * SPC 970402: revised for Rodney Brown's optimizations (32-bit-wide + * aligned reads for most of the data from buffer), can be + * disabled by defining the macro NO_32_BIT_LOADS + * + * SPC 971012: added Rodney Brown's additional tweaks for 32-bit-optimized + * CPUs (like the Pentium Pro, Pentium II, and probably some + * Pentium clones). This optimization is controlled by the + * preprocessor switch "__686" and is disabled by default. + * (This default is based on the assumption that most users + * do not yet work on a Pentium Pro or Pentium II machine ...) + * + * FLAT memory model assumed. Calling interface: + * - args are pushed onto the stack from right to left, + * - return value is given in the EAX register, + * - all other registers (with exception of EFLAGS) are preserved. (With + * GNU C 2.7.x, %edx and %ecx are `scratch' registers, but preserving + * them nevertheless adds only 4 single byte instructions.) + * + * This source generates the function + * ulg crc32(ulg crc, ZCONST uch *buf, extent len). + * + * The loop unrolling can be disabled by defining the macro NO_UNROLLED_LOOPS. + * This results in shorter code at the expense of reduced performance. + */ + +/* This file is NOT used in conjunction with zlib. */ +#ifndef USE_ZLIB + +/* Preprocess with -DNO_UNDERLINE if your C compiler does not prefix + * external symbols with an underline character '_'. + */ +#if defined(NO_UNDERLINE) || defined(__ELF__) +# define _crc32 crc32 +# define _get_crc_table get_crc_table_boinc +#endif +/* Use 16-byte alignment if your assembler supports it. Warning: gas + * uses a log(x) parameter (.align 4 means 16-byte alignment). On SVR4 + * the parameter is a number of bytes. + */ +#ifndef ALIGNMENT +# define ALIGNMENT .align 4,0x90 +#endif + +#if defined(i386) || defined(_i386) || defined(_I386) || defined(__i386) + +/* This version is for 386 Unix, OS/2, MSDOS in 32 bit mode (gcc & gas). + * Warning: it uses the AT&T syntax: mov source,dest + * This file is only optional. If you want to use the C version, + * remove -DASM_CRC from CFLAGS in Makefile and set OBJA to an empty string. + */ + + .file "crc_i386.S" + +#if defined(NO_STD_STACKFRAME) && defined(USE_STD_STACKFRAME) +# undef USE_STACKFRAME +#else + /* The default is to use standard stack frame entry, because it + * results in smaller code! + */ +# ifndef USE_STD_STACKFRAME +# define USE_STD_STACKFRAME +# endif +#endif + +#ifdef USE_STD_STACKFRAME +# define _STD_ENTRY pushl %ebp ; movl %esp,%ebp +# define arg1 8(%ebp) +# define arg2 12(%ebp) +# define arg3 16(%ebp) +# define _STD_LEAVE popl %ebp +#else /* !USE_STD_STACKFRAME */ +# define _STD_ENTRY +# define arg1 24(%esp) +# define arg2 28(%esp) +# define arg3 32(%esp) +# define _STD_LEAVE +#endif /* ?USE_STD_STACKFRAME */ + +/* + * These two (three) macros make up the loop body of the CRC32 cruncher. + * registers modified: + * eax : crc value "c" + * esi : pointer to next data byte (or lword) "buf++" + * registers read: + * edi : pointer to base of crc_table array + * scratch registers: + * ebx : index into crc_table array + * (requires upper three bytes = 0 when __686 is undefined) + */ +#ifndef __686 /* optimize for 386, 486, Pentium */ +#define Do_CRC /* c = (c >> 8) ^ table[c & 0xFF] */\ + movb %al, %bl ;/* tmp = c & 0xFF */\ + shrl $8, %eax ;/* c = (c >> 8) */\ + xorl (%edi, %ebx, 4), %eax ;/* c ^= table[tmp] */ +#else /* __686 : optimize for Pentium Pro and compatible CPUs */ +#define Do_CRC /* c = (c >> 8) ^ table[c & 0xFF] */\ + movzbl %al, %ebx ;/* tmp = c & 0xFF */\ + shrl $8, %eax ;/* c = (c >> 8) */\ + xorl (%edi, %ebx, 4), %eax ;/* c ^=table[tmp] */ +#endif /* ?__686 */ + +#define Do_CRC_byte /* c = (c >> 8) ^ table[(c^*buf++)&0xFF] */\ + xorb (%esi), %al ;/* c ^= *buf */\ + incl %esi ;/* buf++ */\ + Do_CRC + +#ifndef NO_32_BIT_LOADS +#define Do_CRC_lword \ + xorl (%esi), %eax ;/* c ^= *(ulg *)buf */\ + addl $4, %esi ;/* ((ulg *)buf)++ */\ + Do_CRC \ + Do_CRC \ + Do_CRC \ + Do_CRC +#endif /* !NO_32_BIT_LOADS */ + + + .text + + .globl _crc32 + +_crc32: /* ulg crc32(ulg crc, uch *buf, extent len) */ + _STD_ENTRY + pushl %edi + pushl %esi + pushl %ebx + pushl %edx + pushl %ecx + + movl arg2, %esi /* 2nd arg: uch *buf */ + subl %eax, %eax /* > if (!buf) */ + testl %esi, %esi /* > return 0; */ + jz .L_fine /* > else { */ + call _get_crc_table + movl %eax, %edi + movl arg1, %eax /* 1st arg: ulg crc */ +#ifndef __686 + subl %ebx, %ebx /* ebx=0; bl usable as dword */ +#endif + movl arg3, %ecx /* 3rd arg: extent len */ + notl %eax /* > c = ~crc; */ + + testl %ecx, %ecx +#ifndef NO_UNROLLED_LOOPS + jz .L_bail +# ifndef NO_32_BIT_LOADS + /* Assert now have positive length */ +.L_align_loop: + testl $3, %esi /* Align buf on lword boundary */ + jz .L_aligned_now + Do_CRC_byte + decl %ecx + jnz .L_align_loop +.L_aligned_now: +# endif /* !NO_32_BIT_LOADS */ + movl %ecx, %edx /* save len in edx */ + shrl $3, %ecx /* ecx = len / 8 */ + jz .L_No_Eights +/* align loop head at start of 486 internal cache line !! */ + ALIGNMENT +.L_Next_Eight: +# ifndef NO_32_BIT_LOADS + /* Do_CRC_lword */ + xorl (%esi), %eax ;/* c ^= *(ulg *)buf */ + addl $4, %esi ;/* ((ulg *)buf)++ */ + Do_CRC + Do_CRC + Do_CRC + Do_CRC + /* Do_CRC_lword */ + xorl (%esi), %eax ;/* c ^= *(ulg *)buf */ + addl $4, %esi ;/* ((ulg *)buf)++ */ + Do_CRC + Do_CRC + Do_CRC + Do_CRC +# else /* NO_32_BIT_LOADS */ + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte +# endif /* ?NO_32_BIT_LOADS */ + decl %ecx + jnz .L_Next_Eight + +.L_No_Eights: + movl %edx, %ecx + andl $7, %ecx /* ecx = len % 8 */ +#endif /* !NO_UNROLLED_LOOPS */ + jz .L_bail /* > if (len) */ +/* align loop head at start of 486 internal cache line !! */ + ALIGNMENT +.L_loupe: /* > do { */ + Do_CRC_byte /* c = CRC32(c, *buf++); */ + decl %ecx /* > } while (--len); */ + jnz .L_loupe + +.L_bail: /* > } */ + notl %eax /* > return ~c; */ +.L_fine: + popl %ecx + popl %edx + popl %ebx + popl %esi + popl %edi + _STD_LEAVE + ret + +#else + error: this asm version is for 386 only +#endif /* i386 || _i386 || _I386 || __i386 */ + +#endif /* !USE_ZLIB */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/crctab.c boinc-7.0.14+dfsg/zip/unzip/crctab.c --- boinc-7.0.7+dfsg/zip/unzip/crctab.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/crctab.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,229 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* crctab.c -- supply the CRC table needed for CRC-32 calculations. + * Copyright (C) 1995 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* $Id: crctab.c 7481 2005-08-25 21:33:28Z davea $ */ + +/* + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The table is simply the CRC of all possible eight bit values. This is all + the information needed to generate CRC's on data a byte at a time for all + combinations of CRC register values and incoming bytes. +*/ + +#define __CRCTAB_C /* identifies this source module */ + +#include "zip.h" + +#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) + +#ifndef ZCONST +# define ZCONST const +#endif + +#ifdef DYNAMIC_CRC_TABLE + +/* ========================================================================= + * Make the crc table. This function is needed only if you want to compute + * the table dynamically. + */ + +local void make_crc_table OF((void)); + +#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) + error: Dynamic allocation of CRC table not safe with reentrant code. +#endif /* DYNALLOC_CRCTAB && REENTRANT */ + +#ifdef DYNALLOC_CRCTAB + local ulg near *crc_table = NULL; +# if 0 /* not used, since sizeof("near *") <= sizeof(int) */ + /* Use this section when access to a "local int" is faster than access to + a "local pointer" (e.g.: i86 16bit code with far pointers). */ + local int crc_table_empty = 1; +# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) +# define MARK_CRCTAB_FILLED crc_table_empty = 0 +# define MARK_CRCTAB_EMPTY crc_table_empty = 1 +# else + /* Use this section on systems where the size of pointers and ints is + equal (e.g.: all 32bit systems). */ +# define CRC_TABLE_IS_EMPTY (crc_table == NULL) +# define MARK_CRCTAB_FILLED crc_table = crctab_p +# define MARK_CRCTAB_EMPTY crc_table = NULL +# endif +#else /* !DYNALLOC_CRCTAB */ + local ulg near crc_table[256]; + local int crc_table_empty = 1; +# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) +# define MARK_CRCTAB_FILLED crc_table_empty = 0 +#endif /* ?DYNALLOC_CRCTAB */ + + +local void make_crc_table() +{ + ulg c; /* crc shift register */ + int n; /* counter for all possible eight bit values */ + int k; /* byte being shifted into crc apparatus */ +#ifdef DYNALLOC_CRCTAB + ulg near *crctab_p; /* temporary pointer to allocated crc_table area */ +#else /* !DYNALLOC_CRCTAB */ +# define crctab_p crc_table +#endif /* DYNALLOC_CRCTAB */ + +#ifdef COMPUTE_XOR_PATTERN + /* This piece of code has been left here to explain how the XOR pattern + * used in the creation of the crc_table values can be recomputed. + * For production versions of this function, it is more efficient to + * supply the resultant pattern at compile time. + */ + ulg xor; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static uch p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320L) */ + xor = 0L; + for (i = 0; i < sizeof(p)/sizeof(uch); i++) + xor |= 1L << (31 - p[i]); +#else +# define xor 0xedb88320L +#endif + +#ifdef DYNALLOC_CRCTAB + crctab_p = (ulg near *) nearmalloc (256*sizeof(ulg)); + if (crctab_p == NULL) { + ziperr(ZE_MEM, "crc_table allocation"); + } +#endif /* DYNALLOC_CRCTAB */ + + for (n = 0; n < 256; n++) { + c = (ulg)n; + for (k = 8; k; k--) + c = c & 1 ? xor ^ (c >> 1) : c >> 1; + crctab_p[n] = c; + } + MARK_CRCTAB_FILLED; +} + +#else /* !DYNAMIC_CRC_TABLE */ + +#ifdef DYNALLOC_CRCTAB + error: Inconsistent flags, DYNALLOC_CRCTAB without DYNAMIC_CRC_TABLE. +#endif + +/* ======================================================================== + * Table of CRC-32's of all single-byte values (made by make_crc_table) + */ +local ZCONST ulg near crc_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; +#endif /* ?DYNAMIC_CRC_TABLE */ + +/* use "OF((void))" here to work around a Borland TC++ 1.0 problem */ +#ifdef USE_ZLIB +ZCONST uLongf *get_crc_table_boinc OF((void)) +#else +ZCONST ulg near *get_crc_table_boinc OF((void)) +#endif +{ +#ifdef DYNAMIC_CRC_TABLE + if (CRC_TABLE_IS_EMPTY) + make_crc_table(); +#endif +#ifdef USE_ZLIB + return (ZCONST uLongf *)crc_table; +#else + return (ZCONST ulg near *)crc_table; +#endif +} + +#ifdef DYNALLOC_CRCTAB +void free_crc_table() +{ + if (!CRC_TABLE_IS_EMPTY) + { + nearfree((ulg near *)crc_table); + MARK_CRCTAB_EMPTY; + } +} +#endif + +#endif /* !USE_ZLIB || USE_OWN_CRCTAB */ + +const char *BOINC_RCSID_f85bf4dc5f = "$Id: crctab.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/crypt.c boinc-7.0.14+dfsg/zip/unzip/crypt.c --- boinc-7.0.7+dfsg/zip/unzip/crypt.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/crypt.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,585 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + This encryption/decryption source code for Info-Zip software was + originally written in Europe. The whole source package can be + freely distributed, including from the USA. (Prior to January 2000, + re-export from the US was a violation of US law.) + + NOTE on copyright history: + Previous versions of this source package (up to version 2.8) were + not copyrighted and put in the public domain. If you cannot comply + with the Info-Zip LICENSE, you may want to look for one of those + public domain versions. + */ + +/* + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + */ + +#define ZCRYPT_INTERNAL +#include "zip.h" +#include "crypt.h" +#include "ttyio.h" + +#if CRYPT + +#ifndef FALSE +# define FALSE 0 +#endif + +#ifdef ZIP + /* For the encoding task used in Zip (and ZipCloak), we want to initialize + the crypt algorithm with some reasonably unpredictable bytes, see + the crypthead() function. The standard rand() library function is + used to supply these `random' bytes, which in turn is initialized by + a srand() call. The srand() function takes an "unsigned" (at least 16bit) + seed value as argument to determine the starting point of the rand() + pseudo-random number generator. + This seed number is constructed as "Seed = Seed1 .XOR. Seed2" with + Seed1 supplied by the current time (= "(unsigned)time()") and Seed2 + as some (hopefully) nondeterministic bitmask. On many (most) systems, + we use some "process specific" number, as the PID or something similar, + but when nothing unpredictable is available, a fixed number may be + sufficient. + NOTE: + 1.) This implementation requires the availability of the following + standard UNIX C runtime library functions: time(), rand(), srand(). + On systems where some of them are missing, the environment that + incorporates the crypt routines must supply suitable replacement + functions. + 2.) It is a very bad idea to use a second call to time() to set the + "Seed2" number! In this case, both "Seed1" and "Seed2" would be + (almost) identical, resulting in a (mostly) "zero" constant seed + number passed to srand(). + + The implementation environment defined in the "zip.h" header should + supply a reasonable definition for ZCR_SEED2 (an unsigned number; for + most implementations of rand() and srand(), only the lower 16 bits are + significant!). An example that works on many systems would be + "#define ZCR_SEED2 (unsigned)getpid()". + The default definition for ZCR_SEED2 supplied below should be regarded + as a fallback to allow successful compilation in "beta state" + environments. + */ +# include /* time() function supplies first part of crypt seed */ + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */ +# endif +# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ +# undef GLOBAL +# endif +# define GLOBAL(g) g +#else /* !ZIP */ +# define GLOBAL(g) G.g +#endif /* ?ZIP */ + + +#ifdef UNZIP + /* char *key = (char *)NULL; moved to globals.h */ +# ifndef FUNZIP + local int testp OF((__GPRO__ ZCONST uch *h)); + local int testkey OF((__GPRO__ ZCONST uch *h, ZCONST char *key)); +# endif +#endif /* UNZIP */ + +#ifndef UNZIP /* moved to globals.h for UnZip */ + local ulg keys[3]; /* keys defining the pseudo-random sequence */ +#endif /* !UNZIP */ + +#ifndef Trace +# ifdef CRYPT_DEBUG +# define Trace(x) fprintf x +# else +# define Trace(x) +# endif +#endif + +#ifndef CRC_32_TAB +# define CRC_32_TAB crc_32_tab +#endif + +#define CRC32(c, b) (CRC_32_TAB[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +int decrypt_byte(__G) + __GDEF +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)GLOBAL(keys[2]) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +int update_keys(__G__ c) + __GDEF + int c; /* byte of plain text */ +{ + GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c); + GLOBAL(keys[1]) += GLOBAL(keys[0]) & 0xff; + GLOBAL(keys[1]) = GLOBAL(keys[1]) * 134775813L + 1; + { + register int keyshift = (int)(GLOBAL(keys[1]) >> 24); + GLOBAL(keys[2]) = CRC32(GLOBAL(keys[2]), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +void init_keys(__G__ passwd) + __GDEF + ZCONST char *passwd; /* password string with which to modify keys */ +{ + GLOBAL(keys[0]) = 305419896L; + GLOBAL(keys[1]) = 591751049L; + GLOBAL(keys[2]) = 878082192L; + while (*passwd != '\0') { + update_keys(__G__ (int)*passwd); + passwd++; + } +} + + +#ifdef ZIP + +/*********************************************************************** + * Write encryption header to file zfile using the password passwd + * and the cyclic redundancy check crc. + */ +void crypthead(passwd, crc, zfile) + ZCONST char *passwd; /* password string */ + ulg crc; /* crc of file being encrypted */ + FILE *zfile; /* where to write header */ +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + int ztemp; /* temporary for zencoded value */ + uch header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the + * output of rand() to get less predictability, since rand() is + * often poorly implemented. + */ + if (++calls == 1) { + srand((unsigned)time(NULL) ^ ZCR_SEED2); + } + init_keys(passwd); + for (n = 0; n < RAND_HEAD_LEN-2; n++) { + c = (rand() >> 7) & 0xff; + header[n] = (uch)zencode(c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd); + for (n = 0; n < RAND_HEAD_LEN-2; n++) { + ztemp = zencode(header[n], t); + putc(ztemp, zfile); + } + ztemp = zencode((int)(crc >> 16) & 0xff, t); + putc(ztemp, zfile); + ztemp = zencode((int)(crc >> 24) & 0xff, t); + putc(ztemp, zfile); +} + + +#ifdef UTIL + +/*********************************************************************** + * Encrypt the zip entry described by z from file source to file dest + * using the password passwd. Return an error code in the ZE_ class. + */ +int zipcloak(z, source, dest, passwd) + struct zlist far *z; /* zip entry to encrypt */ + FILE *source, *dest; /* source and destination files */ + ZCONST char *passwd; /* password string */ +{ + int c; /* input byte */ + int res; /* result code */ + ulg n; /* holds offset and counts size */ + ush flag; /* previous flags */ + int t; /* temporary */ + int ztemp; /* temporary storage for zencode value */ + + /* Set encrypted bit, clear extended local header bit and write local + header to output file */ + if ((n = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; + z->off = n; + flag = z->flg; + z->flg |= 1, z->flg &= ~8; + z->lflg |= 1, z->lflg &= ~8; + z->siz += RAND_HEAD_LEN; + if ((res = putlocal(z, dest)) != ZE_OK) return res; + + /* Initialize keys with password and write random header */ + crypthead(passwd, z->crc, dest); + + /* Skip local header in input file */ + if (fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext), + SEEK_CUR)) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + + /* Encrypt data */ + for (n = z->siz - RAND_HEAD_LEN; n; n--) { + if ((c = getc(source)) == EOF) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + ztemp = zencode(c, t); + putc(ztemp, dest); + } + /* Skip extended local header in input file if there is one */ + if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + if (fflush(dest) == EOF) return ZE_TEMP; + return ZE_OK; +} + +/*********************************************************************** + * Decrypt the zip entry described by z from file source to file dest + * using the password passwd. Return an error code in the ZE_ class. + */ +int zipbare(z, source, dest, passwd) + struct zlist far *z; /* zip entry to encrypt */ + FILE *source, *dest; /* source and destination files */ + ZCONST char *passwd; /* password string */ +{ + int c0, c1; /* last two input bytes */ + ulg offset; /* used for file offsets */ + ulg size; /* size of input data */ + int r; /* size of encryption header */ + int res; /* return code */ + ush flag; /* previous flags */ + + /* Save position and skip local header in input file */ + if ((offset = (ulg)ftell(source)) == (ulg)-1L || + fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext), + SEEK_CUR)) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + /* Initialize keys with password */ + init_keys(passwd); + + /* Decrypt encryption header, save last two bytes */ + c1 = 0; + for (r = RAND_HEAD_LEN; r; r--) { + c0 = c1; + if ((c1 = getc(source)) == EOF) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + Trace((stdout, " (%02x)", c1)); + zdecode(c1); + Trace((stdout, " %02x", c1)); + } + Trace((stdout, "\n")); + + /* If last two bytes of header don't match crc (or file time in the + * case of an extended local header), back up and just copy. For + * pkzip 2.0, the check has been reduced to one byte only. + */ +#ifdef ZIP10 + if ((ush)(c0 | (c1<<8)) != + (z->flg & 8 ? (ush) z->tim & 0xffff : (ush)(z->crc >> 16))) { +#else + c0++; /* avoid warning on unused variable */ + if ((ush)c1 != (z->flg & 8 ? (ush) z->tim >> 8 : (ush)(z->crc >> 24))) { +#endif + if (fseek(source, offset, SEEK_SET)) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + if ((res = zipcopy(z, source, dest)) != ZE_OK) return res; + return ZE_MISS; + } + + /* Clear encrypted bit and local header bit, and write local header to + output file */ + if ((offset = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; + z->off = offset; + flag = z->flg; + z->flg &= ~9; + z->lflg &= ~9; + z->siz -= RAND_HEAD_LEN; + if ((res = putlocal(z, dest)) != ZE_OK) return res; + + /* Decrypt data */ + for (size = z->siz; size; size--) { + if ((c1 = getc(source)) == EOF) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + zdecode(c1); + putc(c1, dest); + } + /* Skip extended local header in input file if there is one */ + if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { + return ferror(source) ? ZE_READ : ZE_EOF; + } + if (fflush(dest) == EOF) return ZE_TEMP; + + return ZE_OK; +} + + +#else /* !UTIL */ + +/*********************************************************************** + * If requested, encrypt the data in buf, and in any case call fwrite() + * with the arguments to zfwrite(). Return what fwrite() returns. + */ +unsigned zfwrite(buf, item_size, nb, f) + zvoid *buf; /* data buffer */ + extent item_size; /* size of each item in bytes */ + extent nb; /* number of items */ + FILE *f; /* file to write to */ +{ + int t; /* temporary */ + + if (key != (char *)NULL) { /* key is the global password pointer */ + ulg size; /* buffer size */ + char *p = (char*)buf; /* steps through buffer */ + + /* Encrypt data in buffer */ + for (size = item_size*(ulg)nb; size != 0; p++, size--) { + *p = (char)zencode(*p, t); + } + } + /* Write the buffer out */ + return fwrite(buf, item_size, nb, f); +} + +#endif /* ?UTIL */ +#endif /* ZIP */ + + +#if (defined(UNZIP) && !defined(FUNZIP)) + +/*********************************************************************** + * Get the password and set up keys for current zipfile member. + * Return PK_ class error. + */ +int decrypt(__G__ passwrd) + __GDEF + ZCONST char *passwrd; +{ + ush b; + int n, r; + uch h[RAND_HEAD_LEN]; + + Trace((stdout, "\n[incnt = %d]: ", GLOBAL(incnt))); + + /* get header once (turn off "encrypted" flag temporarily so we don't + * try to decrypt the same data twice) */ + GLOBAL(pInfo->encrypted) = FALSE; + defer_leftover_input(__G); + for (n = 0; n < RAND_HEAD_LEN; n++) { + b = NEXTBYTE; + h[n] = (uch)b; + Trace((stdout, " (%02x)", h[n])); + } + undefer_input(__G); + GLOBAL(pInfo->encrypted) = TRUE; + + if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */ + GLOBAL(newzip) = FALSE; + if (passwrd != (char *)NULL) { /* user gave password on command line */ + if (!GLOBAL(key)) { + if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) == + (char *)NULL) + return PK_MEM2; + strcpy(GLOBAL(key), passwrd); + GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */ + } + } else if (GLOBAL(key)) { /* get rid of previous zipfile's key */ + free(GLOBAL(key)); + GLOBAL(key) = (char *)NULL; + } + } + + /* if have key already, test it; else allocate memory for it */ + if (GLOBAL(key)) { + if (!testp(__G__ h)) + return PK_COOL; /* existing password OK (else prompt for new) */ + else if (GLOBAL(nopwd)) + return PK_WARN; /* user indicated no more prompting */ + } else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL) + return PK_MEM2; + + /* try a few keys */ + n = 0; + do { + r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1, + GLOBAL(zipfn), GLOBAL(filename)); + if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */ + free (GLOBAL(key)); + GLOBAL(key) = NULL; + return PK_MEM2; + } + if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */ + *GLOBAL(key) = '\0'; /* We try the NIL password, ... */ + n = 0; /* and cancel fetch for this item. */ + } + if (!testp(__G__ h)) + return PK_COOL; + if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */ + GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */ + } while (n > 0); + + return PK_WARN; + +} /* end function decrypt() */ + + + +/*********************************************************************** + * Test the password. Return -1 if bad, 0 if OK. + */ +local int testp(__G__ h) + __GDEF + ZCONST uch *h; +{ + int r; + char *key_translated; + + /* On systems with "obscure" native character coding (e.g., EBCDIC), + * the first test translates the password to the "main standard" + * character coding. */ + +#ifdef STR_TO_CP1 + /* allocate buffer for translated password */ + if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) + return -1; + /* first try, test password translated "standard" charset */ + r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key))); +#else /* !STR_TO_CP1 */ + /* first try, test password as supplied on the extractor's host */ + r = testkey(__G__ h, GLOBAL(key)); +#endif /* ?STR_TO_CP1 */ + +#ifdef STR_TO_CP2 + if (r != 0) { +#ifndef STR_TO_CP1 + /* now prepare for second (and maybe third) test with translated pwd */ + if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) + return -1; +#endif + /* second try, password translated to alternate ("standard") charset */ + r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key))); +#ifdef STR_TO_CP3 + if (r != 0) + /* third try, password translated to another "standard" charset */ + r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key))); +#endif +#ifndef STR_TO_CP1 + free(key_translated); +#endif + } +#endif /* STR_TO_CP2 */ + +#ifdef STR_TO_CP1 + free(key_translated); + if (r != 0) { + /* last resort, test password as supplied on the extractor's host */ + r = testkey(__G__ h, GLOBAL(key)); + } +#endif /* STR_TO_CP1 */ + + return r; + +} /* end function testp() */ + + +local int testkey(__G__ h, key) + __GDEF + ZCONST uch *h; /* decrypted header */ + ZCONST char *key; /* decryption password to test */ +{ + ush b; +#ifdef ZIP10 + ush c; +#endif + int n; + uch *p; + uch hh[RAND_HEAD_LEN]; /* decrypted header */ + + /* set keys and save the encrypted header */ + init_keys(__G__ key); + memcpy(hh, h, RAND_HEAD_LEN); + + /* check password */ + for (n = 0; n < RAND_HEAD_LEN; n++) { + zdecode(hh[n]); + Trace((stdout, " %02x", hh[n])); + } + + Trace((stdout, + "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", + GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), + GLOBAL(pInfo->ExtLocHdr) ? "true":"false")); + Trace((stdout, " incnt = %d unzip offset into zipfile = %ld\n", + GLOBAL(incnt), + GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr)-GLOBAL(inbuf)))); + + /* same test as in zipbare(): */ + +#ifdef ZIP10 /* check two bytes */ + c = hh[RAND_HEAD_LEN-2], b = hh[RAND_HEAD_LEN-1]; + Trace((stdout, + " (c | (b<<8)) = %04x (crc >> 16) = %04x lrec.time = %04x\n", + (ush)(c | (b<<8)), (ush)(GLOBAL(lrec.crc32) >> 16), + ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff)))); + if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ? + ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) : + (ush)(GLOBAL(lrec.crc32) >> 16))) + return -1; /* bad */ +#else + b = hh[RAND_HEAD_LEN-1]; + Trace((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", + b, (ush)(GLOBAL(lrec.crc32) >> 24), + ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff)); + if (b != (GLOBAL(pInfo->ExtLocHdr) ? + ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff : + (ush)(GLOBAL(lrec.crc32) >> 24))) + return -1; /* bad */ +#endif + /* password OK: decrypt current buffer contents before leaving */ + for (n = (long)GLOBAL(incnt) > GLOBAL(csize) ? + (int)GLOBAL(csize) : GLOBAL(incnt), + p = GLOBAL(inptr); n--; p++) + zdecode(*p); + return 0; /* OK */ + +} /* end function testkey() */ + +#endif /* UNZIP && !FUNZIP */ + +#else /* !CRYPT */ + +/* something "externally visible" to shut up compiler/linker warnings */ +int zcr_dummy; + +#endif /* ?CRYPT */ + +const char *BOINC_RCSID_c52225ab42 = "$Id: crypt.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/crypt.h boinc-7.0.14+dfsg/zip/unzip/crypt.h --- boinc-7.0.7+dfsg/zip/unzip/crypt.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/crypt.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,178 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + crypt.h (full version) by Info-ZIP. Last revised: [see CR_VERSION_DATE] + + This encryption/decryption source code for Info-Zip software was + originally written in Europe. The whole source package can be + freely distributed, including from the USA. (Prior to January 2000, + re-export from the US was a violation of US law.) + + NOTE on copyright history: + Previous versions of this source package (up to version 2.8) were + not copyrighted and put in the public domain. If you cannot comply + with the Info-Zip LICENSE, you may want to look for one of those + public domain versions. + */ + +#ifndef __crypt_h /* don't include more than once */ +#define __crypt_h + +#ifdef CRYPT +# undef CRYPT +#endif +/* + Logic of selecting "full crypt" code: + a) default behaviour: + - dummy crypt code when used to compile Zip + (because we do not distribute encrypting versions of Zip from US + servers) + - dummy crypt code when compiling UnZipSFX stub, to minimize size + - full crypt code when used to compile UnZip and fUnZip + b) USE_CRYPT defined: + - always full crypt code + c) NO_CRYPT defined: + - never full crypt code + NO_CRYPT takes precedence over USE_CRYPT + */ +#if defined(NO_CRYPT) +# define CRYPT 0 /* dummy version */ +#else +#if defined(USE_CRYPT) +# define CRYPT 1 /* full version */ +#else +#if (!defined(ZIP) && !defined(SFX)) +# define CRYPT 1 /* full version */ +#else +# define CRYPT 0 /* dummy version */ +#endif +#endif /* ?USE_CRYPT */ +#endif /* ?NO_CRYPT */ + +#if CRYPT +/* full version */ + +#ifdef CR_BETA +# undef CR_BETA /* this is not a beta release */ +#endif + +#define CR_MAJORVER 2 +#define CR_MINORVER 9 +#ifdef CR_BETA +# define CR_BETA_VER "a BETA" +# define CR_VERSION_DATE "05 May 2000" /* last real code change */ +#else +# define CR_BETA_VER "" +# define CR_VERSION_DATE "05 May 2000" /* last public release date */ +# define CR_RELEASE +#endif + +#ifndef __G /* UnZip only, for now (DLL stuff) */ +# define __G +# define __G__ +# define __GDEF +# define __GPRO void +# define __GPRO__ +#endif + +#if defined(MSDOS) || defined(OS2) || defined(WIN32) +# ifndef DOS_OS2_W32 +# define DOS_OS2_W32 +# endif +#endif + +#if defined(DOS_OS2_W32) || defined(__human68k__) +# ifndef DOS_H68_OS2_W32 +# define DOS_H68_OS2_W32 +# endif +#endif + +#if defined(VM_CMS) || defined(MVS) +# ifndef CMS_MVS +# define CMS_MVS +# endif +#endif + +/* To allow combining of Zip and UnZip static libraries in a single binary, + * the Zip and UnZip versions of the crypt core functions have to be named + * differently. + */ +#ifdef ZIP +# ifdef REALLY_SHORT_SYMS +# define decrypt_byte zdcrby +# else +# define decrypt_byte zp_decrypt_byte +# endif +# define update_keys zp_update_keys +# define init_keys zp_init_keys +#else /* !ZIP */ +# ifdef REALLY_SHORT_SYMS +# define decrypt_byte dcrbyt +# endif +#endif /* ?ZIP */ + +#define IZ_PWLEN 80 /* input buffer size for reading encryption key */ +#ifndef PWLEN /* for compatibility with previous zcrypt release... */ +# define PWLEN IZ_PWLEN +#endif +#define RAND_HEAD_LEN 12 /* length of encryption random header */ + +/* the crc_32_tab array has to be provided externally for the crypt calculus */ +#ifndef CRC_32_TAB /* UnZip provides this in globals.h */ +# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) + extern ZCONST ulg near *crc_32_tab; +# else + extern ZCONST ulg Far *crc_32_tab; +# endif +#endif /* !CRC_32_TAB */ + +/* encode byte c, using temp t. Warning: c must not have side effects. */ +#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c)) + +/* decode byte c in place */ +#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G)) + +int decrypt_byte OF((__GPRO)); +int update_keys OF((__GPRO__ int c)); +void init_keys OF((__GPRO__ ZCONST char *passwd)); + +#ifdef ZIP + void crypthead OF((ZCONST char *, ulg, FILE *)); +# ifdef UTIL + int zipcloak OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); + int zipbare OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); +# else + unsigned zfwrite OF((zvoid *, extent, extent, FILE *)); + extern char *key; +# endif +#endif /* ZIP */ + +#if (defined(UNZIP) && !defined(FUNZIP)) + int decrypt OF((__GPRO__ ZCONST char *passwrd)); +#endif + +#ifdef FUNZIP + extern int encrypted; +# ifdef NEXTBYTE +# undef NEXTBYTE +# endif +# define NEXTBYTE \ + (encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in)) +#endif /* FUNZIP */ + +#else /* !CRYPT */ +/* dummy version */ + +#define zencode +#define zdecode + +#define zfwrite fwrite + +#endif /* ?CRYPT */ +#endif /* !__crypt_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/ebcdic.h boinc-7.0.14+dfsg/zip/unzip/ebcdic.h --- boinc-7.0.7+dfsg/zip/unzip/ebcdic.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/ebcdic.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,284 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + ebcdic.h + + The CECP 1047 (Extended de-facto EBCDIC) <-> ISO 8859-1 conversion tables, + from ftp://aix1.segi.ulg.ac.be/pub/docs/iso8859/iso8859.networking + + NOTES: + (OS/390 port 12/97) + These table no longer represent the standard mappings (for example in the + OS/390 iconv utility). In order to follow current standards I remapped + ebcdic x0a to ascii x15 and + ebcdic x85 to ascii x25 (and vice-versa) + Without these changes, newlines in auto-convert text files appeared + as literal \045. + I'm not sure what effect this remap would have on the MVS and CMS ports, so + I ifdef'd these changes. Hopefully these ifdef's can be removed when the + MVS/CMS folks test the new mappings. + + Christian Spieler , 27-Apr-1998 + The problem mentioned by Paul von Behren was already observed previously + on VM/CMS, during the preparation of the CMS&MVS port of UnZip 5.20 in + 1996. At that point, the ebcdic tables were not changed since they seemed + to be an adopted standard (to my knowledge, these tables are still used + as presented in mainfraime KERMIT). Instead, the "end-of-line" conversion + feature of Zip's and UnZip's "text-translation" mode was used to force + correct mappings between ASCII and EBCDIC newline markers. + Before interchanging the ASCII mappings of the EBCDIC control characters + "NL" 0x25 and "LF" 0x15 according to the OS/390 setting, we have to + make sure that EBCDIC 0x15 is never used as line termination. + + ---------------------------------------------------------------------------*/ + +#ifndef __ebcdic_h /* prevent multiple inclusions */ +#define __ebcdic_h + + +#ifndef ZCONST +# define ZCONST const +#endif + +#ifdef EBCDIC +#ifndef MTS /* MTS uses a slightly "special" EBCDIC code page */ + +ZCONST uch ebcdic[] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ +#ifdef OS390 + 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ +#else + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ +#endif + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, /* 58 - 5F */ + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ + 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ + 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ +#ifdef OS390 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, /* 80 - 87 */ +#else + 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ +#endif + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ + 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ + 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ + 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ + 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, /* A8 - AF */ + 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ + 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ + 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ + 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ + 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ + 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, /* D8 - DF */ + 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ + 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ + 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ + 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ +}; + +#if (defined(ZIP) || CRYPT) +ZCONST uch ascii[] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ + 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ +#ifdef OS390 + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, /* 10 - 17 */ +#else + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ +#endif + 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ +#ifdef OS390 + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, /* 20 - 27 */ +#else + 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ +#endif + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ + 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ + 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ + 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ + 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ + 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E, /* 58 - 5F */ + 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ + 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ + 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ + 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ + 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ + 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ + 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ + 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ + 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ + 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0x5B, 0xDE, 0xAE, /* A8 - AF */ + 0xAC, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ + 0xBD, 0xBE, 0xDD, 0xA8, 0xAF, 0x5D, 0xB4, 0xD7, /* B8 - BF */ + 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ + 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ + 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ + 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ + 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ + 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ + 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ +}; +#endif /* ZIP || CRYPT */ + +#else /* MTS */ + +/* + * This is the MTS ASCII->EBCDIC translation table. It provides a 1-1 + * translation from ISO 8859/1 8-bit ASCII to IBM Code Page 37 EBCDIC. + */ + +ZCONST uch ebcdic[] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ + 0xE7, 0xE8, 0xE9, 0xBA, 0xE0, 0xBB, 0xB0, 0x6D, /* 58 - 5F */ + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ + 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ + 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ + 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ + 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ + 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ + 0xBD, 0xB4, 0x9A, 0x8A, 0x5F, 0xCA, 0xAF, 0xBC, /* A8 - AF */ + 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ + 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ + 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ + 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ + 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ + 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xAD, 0xAE, 0x59, /* D8 - DF */ + 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ + 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ + 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ + 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ +}; + +#if (defined(ZIP) || CRYPT) +ZCONST uch ascii[] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ + 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ + 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ + 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ + 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ + 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ + 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ + 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAC, /* 58 - 5F */ + 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ + 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ + 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ + 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ + 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ + 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ + 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ + 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ + 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ + 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0xDD, 0xDE, 0xAE, /* A8 - AF */ + 0x5E, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ + 0xBD, 0xBE, 0x5B, 0x5D, 0xAF, 0xA8, 0xB4, 0xD7, /* B8 - BF */ + 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ + 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ + 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ + 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ + 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ + 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ + 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ +}; +#endif /* ZIP || CRYPT */ + +#endif /* ?MTS */ +#endif /* EBCDIC */ + +/*--------------------------------------------------------------------------- + + The following conversion tables translate between IBM PC CP 850 + (OEM codepage) and the "Western Europe & America" Windows codepage 1252. + The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage, + with some additional printable characters in the range (0x80 - 0x9F), + that is reserved to control codes in the ISO 8859-1 character table. + + The ISO <--> OEM conversion tables were constructed with the help + of the WIN32 (Win16?) API's OemToAnsi() and AnsiToOem() conversion + functions and have been checked against the CP850 and LATIN1 tables + provided in the MS-Kermit 3.14 distribution. + + ---------------------------------------------------------------------------*/ + +#ifdef IZ_ISO2OEM_ARRAY +ZCONST uch Far iso2oem[] = { + 0x3F, 0x3F, 0x27, 0x9F, 0x22, 0x2E, 0xC5, 0xCE, /* 80 - 87 */ + 0x5E, 0x25, 0x53, 0x3C, 0x4F, 0x3F, 0x3F, 0x3F, /* 88 - 8F */ + 0x3F, 0x27, 0x27, 0x22, 0x22, 0x07, 0x2D, 0x2D, /* 90 - 97 */ + 0x7E, 0x54, 0x73, 0x3E, 0x6F, 0x3F, 0x3F, 0x59, /* 98 - 9F */ + 0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* A0 - A7 */ + 0xF9, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE, /* A8 - AF */ + 0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* B0 - B7 */ + 0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8, /* B8 - BF */ + 0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* C0 - C7 */ + 0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* C8 - CF */ + 0xD1, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* D0 - D7 */ + 0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* D8 - DF */ + 0x85, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* E0 - E7 */ + 0x8A, 0x82, 0x88, 0x89, 0x8D, 0xA1, 0x8C, 0x8B, /* E8 - EF */ + 0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* F0 - F7 */ + 0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98 /* F8 - FF */ +}; +#endif /* IZ_ISO2OEM_ARRAY */ + +#ifdef IZ_OEM2ISO_ARRAY +ZCONST uch Far oem2iso[] = { + 0xC7, 0xFC, 0xE9, 0xE2, 0xE4, 0xE0, 0xE5, 0xE7, /* 80 - 87 */ + 0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5, /* 88 - 8F */ + 0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9, /* 90 - 97 */ + 0xFF, 0xD6, 0xDC, 0xF8, 0xA3, 0xD8, 0xD7, 0x83, /* 98 - 9F */ + 0xE1, 0xED, 0xF3, 0xFA, 0xF1, 0xD1, 0xAA, 0xBA, /* A0 - A7 */ + 0xBF, 0xAE, 0xAC, 0xBD, 0xBC, 0xA1, 0xAB, 0xBB, /* A8 - AF */ + 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xC1, 0xC2, 0xC0, /* B0 - B7 */ + 0xA9, 0xA6, 0xA6, 0x2B, 0x2B, 0xA2, 0xA5, 0x2B, /* B8 - BF */ + 0x2B, 0x2D, 0x2D, 0x2B, 0x2D, 0x2B, 0xE3, 0xC3, /* C0 - C7 */ + 0x2B, 0x2B, 0x2D, 0x2D, 0xA6, 0x2D, 0x2B, 0xA4, /* C8 - CF */ + 0xF0, 0xD0, 0xCA, 0xCB, 0xC8, 0x69, 0xCD, 0xCE, /* D0 - D7 */ + 0xCF, 0x2B, 0x2B, 0xA6, 0x5F, 0xA6, 0xCC, 0xAF, /* D8 - DF */ + 0xD3, 0xDF, 0xD4, 0xD2, 0xF5, 0xD5, 0xB5, 0xFE, /* E0 - E7 */ + 0xDE, 0xDA, 0xDB, 0xD9, 0xFD, 0xDD, 0xAF, 0xB4, /* E8 - EF */ + 0xAD, 0xB1, 0x3D, 0xBE, 0xB6, 0xA7, 0xF7, 0xB8, /* F0 - F7 */ + 0xB0, 0xA8, 0xB7, 0xB9, 0xB3, 0xB2, 0xA6, 0xA0 /* F8 - FF */ +}; +#endif /* IZ_OEM2ISO_ARRAY */ + +#if defined(THEOS) || defined(THEOS_SUPPORT) +# include "theos/charconv.h" +#endif + +#endif /* __ebcdic_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/envargs.c boinc-7.0.14+dfsg/zip/unzip/envargs.c --- boinc-7.0.7+dfsg/zip/unzip/envargs.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/envargs.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,319 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*----------------------------------------------------------------* + | envargs - add default options from environment to command line + |---------------------------------------------------------------- + | Author: Bill Davidsen, original 10/13/91, revised 23 Oct 1991. + | This program is in the public domain. + |---------------------------------------------------------------- + | Minor program notes: + | 1. Yes, the indirection is a tad complex + | 2. Parentheses were added where not needed in some cases + | to make the action of the code less obscure. + |---------------------------------------------------------------- + | UnZip notes: 24 May 92 ("v1.4"): + | 1. #include "unzip.h" for prototypes (24 May 92) + | 2. changed ch to type char (24 May 92) + | 3. added an ifdef to avoid Borland warnings (24 May 92) + | 4. included Rich Wales' mksargs() routine (for MS-DOS, maybe + | OS/2? NT?) (4 Dec 93) + | 5. added alternate-variable string envstr2 (21 Apr 94) + | 6. added support for quoted arguments (6 Jul 96) + *----------------------------------------------------------------*/ + + +#define __ENVARGS_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" + +#ifdef __EMX__ /* emx isspace() returns TRUE on extended ASCII !! */ +# define ISspace(c) ((c) & 0x80 ? 0 : isspace((unsigned)c)) +#else +# define ISspace(c) isspace((unsigned)c) +#endif /* ?__EMX__ */ + +static int count_args OF((ZCONST char *)); + + +/* envargs() returns PK-style error code */ + +int envargs(Pargc, Pargv, envstr, envstr2) + int *Pargc; + char ***Pargv; + ZCONST char *envstr, *envstr2; +{ +#ifndef RISCOS + char *getenv(); +#endif + char *envptr; /* value returned by getenv */ + char *bufptr; /* copy of env info */ + int argc = 0; /* internal arg count */ + register int ch; /* spare temp value */ + char **argv; /* internal arg vector */ + char **argvect; /* copy of vector address */ + + /* see if anything in the environment */ + if ((envptr = getenv(envstr)) != (char *)NULL) /* usual var */ + while (ISspace(*envptr)) /* must discard leading spaces */ + envptr++; + if (envptr == (char *)NULL || *envptr == '\0') + if ((envptr = getenv(envstr2)) != (char *)NULL) /* alternate var */ + while (ISspace(*envptr)) + envptr++; + if (envptr == (char *)NULL || *envptr == '\0') + return PK_OK; + + bufptr = malloc(1 + strlen(envptr)); + if (bufptr == (char *)NULL) + return PK_MEM; +#if (defined(WIN32) || defined(WINDLL)) +# ifdef WIN32 + if (IsWinNT()) { + /* SPC: don't know codepage of 'real' WinNT console */ + strcpy(bufptr, envptr); + } else { + /* Win95 environment is DOS and uses OEM character coding */ + OEM_TO_INTERN(envptr, bufptr); + } +# else /* !WIN32 */ + /* DOS environment uses OEM codepage */ + OEM_TO_INTERN(envptr, bufptr); +# endif +#else /* !(WIN32 || WINDLL) */ + strcpy(bufptr, envptr); +#endif /* ?(WIN32 || WINDLL) */ + + /* count the args so we can allocate room for them */ + argc = count_args(bufptr); + /* allocate a vector large enough for all args */ + argv = (char **)malloc((argc + *Pargc + 1) * sizeof(char *)); + if (argv == (char **)NULL) { + free(bufptr); + return PK_MEM; + } + argvect = argv; + + /* copy the program name first, that's always true */ + *(argv++) = *((*Pargv)++); + + /* copy the environment args next, may be changed */ + do { +#if defined(AMIGA) || defined(UNIX) + if (*bufptr == '"') { + char *argstart = ++bufptr; + + *(argv++) = argstart; + for (ch = *bufptr; ch != '\0' && ch != '\"'; + ch = *PREINCSTR(bufptr)) + if (ch == '\\' && bufptr[1] != '\0') + ++bufptr; /* advance to char after backslash */ + if (ch != '\0') + *(bufptr++) = '\0'; /* overwrite trailing " */ + + /* remove escape characters */ + while ((argstart = MBSCHR(argstart, '\\')) != (char *)NULL) { + strcpy(argstart, argstart + 1); + if (*argstart) + ++argstart; + } + } else { + *(argv++) = bufptr; + while ((ch = *bufptr) != '\0' && !ISspace(ch)) + INCSTR(bufptr); + if (ch != '\0') + *(bufptr++) = '\0'; + } +#else +#ifdef DOS_FLX_NLM_OS2_W32 + /* we do not support backslash-quoting of quotes in quoted + * strings under DOS_FLX_NLM_OS2_W32, because backslashes are + * directory separators and double quotes are illegal in filenames */ + if (*bufptr == '"') { + *(argv++) = ++bufptr; + while ((ch = *bufptr) != '\0' && ch != '\"') + INCSTR(bufptr); + if (ch != '\0') + *(bufptr++) = '\0'; + } else { + *(argv++) = bufptr; + while ((ch = *bufptr) != '\0' && !ISspace(ch)) + INCSTR(bufptr); + if (ch != '\0') + *(bufptr++) = '\0'; + } +#else + *(argv++) = bufptr; + while ((ch = *bufptr) != '\0' && !ISspace(ch)) + INCSTR(bufptr); + if (ch != '\0') + *(bufptr++) = '\0'; +#endif /* ?DOS_FLX_NLM_OS2_W32 */ +#endif /* ?(AMIGA || UNIX) */ + while ((ch = *bufptr) != '\0' && ISspace(ch)) + INCSTR(bufptr); + } while (ch); + + /* now save old argc and copy in the old args */ + argc += *Pargc; + while (--(*Pargc)) + *(argv++) = *((*Pargv)++); + + /* finally, add a NULL after the last arg, like Unix */ + *argv = (char *)NULL; + + /* save the values and return, indicating succes */ + *Pargv = argvect; + *Pargc = argc; + + return PK_OK; +} + + + +static int count_args(s) + ZCONST char *s; +{ + int count = 0; + char ch; + + do { + /* count and skip args */ + ++count; +#if defined(AMIGA) || defined(UNIX) + if (*s == '\"') { + for (ch = *PREINCSTR(s); ch != '\0' && ch != '\"'; + ch = *PREINCSTR(s)) + if (ch == '\\' && s[1] != '\0') + ++s; + if (*s) + ++s; /* trailing quote */ + } else +#else +#ifdef DOS_FLX_NLM_OS2_W32 + if (*s == '\"') { + ++s; /* leading quote */ + while ((ch = *s) != '\0' && ch != '\"') + INCSTR(s); + if (*s) + ++s; /* trailing quote */ + } else +#endif /* DOS_FLX_NLM_OS2_W32 */ +#endif /* ?(AMIGA || UNIX) */ + while ((ch = *s) != '\0' && !ISspace(ch)) /* note else-clauses above */ + INCSTR(s); + while ((ch = *s) != '\0' && ISspace(ch)) + INCSTR(s); + } while (ch); + + return count; +} + + + +#ifdef TEST + +int main(argc, argv) + int argc; + char **argv; +{ + int err; + + printf("Orig argv: %p\n", argv); + dump_args(argc, argv); + if ((err = envargs(&argc, &argv, "ENVTEST")) != PK_OK) { + perror("envargs: cannot get memory for arguments"); + EXIT(err); + } + printf(" New argv: %p\n", argv); + dump_args(argc, argv); +} + + + +void dump_args(argc, argv) + int argc; + char *argv[]; +{ + int i; + + printf("\nDump %d args:\n", argc); + for (i = 0; i < argc; ++i) + printf("%3d %s\n", i, argv[i]); +} + +#endif /* TEST */ + + + +#ifdef MSDOS /* DOS_OS2? DOS_OS2_W32? */ + +/* + * void mksargs(int *argcp, char ***argvp) + * + * Substitutes the extended command line argument list produced by + * the MKS Korn Shell in place of the command line info from DOS. + * + * The MKS shell gets around DOS's 128-byte limit on the length of + * a command line by passing the "real" command line in the envi- + * ronment. The "real" arguments are flagged by prepending a tilde + * (~) to each one. + * + * This "mksargs" routine creates a new argument list by scanning + * the environment from the beginning, looking for strings begin- + * ning with a tilde character. The new list replaces the original + * "argv" (pointed to by "argvp"), and the number of arguments + * in the new list replaces the original "argc" (pointed to by + * "argcp"). + * + * Rich Wales + */ +void mksargs(argcp, argvp) + int *argcp; + char ***argvp; +{ +#ifndef MSC /* declared differently in MSC 7.0 headers, at least */ +#ifndef __WATCOMC__ + extern char **environ; /* environment */ +#endif +#endif + char **envp; /* pointer into environment */ + char **newargv; /* new argument list */ + char **argp; /* pointer into new arg list */ + int newargc; /* new argument count */ + + /* sanity check */ + if (environ == NULL || argcp == NULL || argvp == NULL || *argvp == NULL) + return; + + /* find out how many environment arguments there are */ + for (envp = environ, newargc = 0; + *envp != NULL && (*envp)[0] == '~'; + envp++, newargc++) + ; + if (newargc == 0) + return; /* no environment arguments */ + + /* set up new argument list */ + newargv = (char **) malloc(sizeof(char **) * (newargc+1)); + if (newargv == NULL) + return; /* malloc failed */ + + for (argp = newargv, envp = environ; *envp != NULL && (*envp)[0] == '~'; + *argp++ = &(*envp++)[1]) + ; + *argp = NULL; /* null-terminate the list */ + + /* substitute new argument list in place of old one */ + *argcp = newargc; + *argvp = newargv; +} + +#endif /* MSDOS */ + +const char *BOINC_RCSID_8941b85739 = "$Id: envargs.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/explode.c boinc-7.0.14+dfsg/zip/unzip/explode.c --- boinc-7.0.7+dfsg/zip/unzip/explode.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/explode.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,617 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* explode.c -- by Mark Adler + version c15, 6 July 1996 */ + + +/* Copyright history: + - Starting with UnZip 5.41 of 16-April-2000, this source file + is covered by the Info-Zip LICENSE cited above. + - Prior versions of this source file, found in UnZip source packages + up to UnZip 5.40, were put in the public domain. + The original copyright note by Mark Adler was: + "You can do whatever you like with this source file, + though I would prefer that if you modify it and + redistribute it that you include comments to that effect + with your name and the date. Thank you." + + History: + vers date who what + ---- --------- -------------- ------------------------------------ + c1 30 Mar 92 M. Adler explode that uses huft_build from inflate + (this gives over a 70% speed improvement + over the original unimplode.c, which + decoded a bit at a time) + c2 4 Apr 92 M. Adler fixed bug for file sizes a multiple of 32k. + c3 10 Apr 92 M. Adler added a little memory tracking if DEBUG + c4 11 Apr 92 M. Adler added NOMEMCPY do kill use of memcpy() + c5 21 Apr 92 M. Adler added the WSIZE #define to allow reducing + the 32K window size for specialized + applications. + c6 31 May 92 M. Adler added typecasts to eliminate some warnings + c7 27 Jun 92 G. Roelofs added more typecasts. + c8 17 Oct 92 G. Roelofs changed ULONG/UWORD/byte to ulg/ush/uch. + c9 19 Jul 93 J. Bush added more typecasts (to return values); + made l[256] array static for Amiga. + c10 8 Oct 93 G. Roelofs added used_csize for diagnostics; added + buf and unshrink arguments to flush(); + undef'd various macros at end for Turbo C; + removed NEXTBYTE macro (now in unzip.h) + and bytebuf variable (not used); changed + memset() to memzero(). + c11 9 Jan 94 M. Adler fixed incorrect used_csize calculation. + c12 9 Apr 94 G. Roelofs fixed split comments on preprocessor lines + to avoid bug in Encore compiler. + c13 25 Aug 94 M. Adler fixed distance-length comment (orig c9 fix) + c14 22 Nov 95 S. Maxwell removed unnecessary "static" on auto array + c15 6 Jul 96 W. Haidinger added ulg typecasts to flush() calls. + c16 8 Feb 98 C. Spieler added ZCONST modifiers to const tables + and #ifdef DEBUG around debugging code. + c16b 25 Mar 98 C. Spieler modified DLL code for slide redirection. + c16d 05 Jul 99 C. Spieler take care of flush() return values and + stop processing in case of errors + c17 04 Feb 01 C. Spieler reorganized code to reduce repetitions + of large code parts; adapted huft decoding + to the changes in inflate's huft_build() + due to support of deflate64; fixed memory + leaks (huft tables were not free'd when + get_tree() failed). + c17b 16 Feb 02 C. Spieler changed type of the "extra lengths" array + "extra" from ush into uch (to save space) + */ + + +/* + Explode imploded (PKZIP method 6 compressed) data. This compression + method searches for as much of the current string of bytes (up to a length + of ~320) in the previous 4K or 8K bytes. If it doesn't find any matches + (of at least length 2 or 3), it codes the next byte. Otherwise, it codes + the length of the matched string and its distance backwards from the + current position. Single bytes ("literals") are preceded by a one (a + single bit) and are either uncoded (the eight bits go directly into the + compressed stream for a total of nine bits) or Huffman coded with a + supplied literal code tree. If literals are coded, then the minimum match + length is three, otherwise it is two. + + There are therefore four kinds of imploded streams: 8K search with coded + literals (min match = 3), 4K search with coded literals (min match = 3), + 8K with uncoded literals (min match = 2), and 4K with uncoded literals + (min match = 2). The kind of stream is identified in two bits of a + general purpose bit flag that is outside of the compressed stream. + + Distance-length pairs for matched strings are preceded by a zero bit (to + distinguish them from literals) and are always coded. The distance comes + first and is either the low six (4K) or low seven (8K) bits of the + distance (uncoded), followed by the high six bits of the distance coded. + Then the length is six bits coded (0..63 + min match length), and if the + maximum such length is coded, then it's followed by another eight bits + (uncoded) to be added to the coded length. This gives a match length + range of 2..320 or 3..321 bytes. + + The literal, length, and distance codes are all represented in a slightly + compressed form themselves. What is sent are the lengths of the codes for + each value, which is sufficient to construct the codes. Each byte of the + code representation is the code length (the low four bits representing + 1..16), and the number of values sequentially with that length (the high + four bits also representing 1..16). There are 256 literal code values (if + literals are coded), 64 length code values, and 64 distance code values, + in that order at the beginning of the compressed stream. Each set of code + values is preceded (redundantly) with a byte indicating how many bytes are + in the code description that follows, in the range 1..256. + + The codes themselves are decoded using tables made by huft_build() from + the bit lengths. That routine and its comments are in the inflate.c + module. + */ + +#define __EXPLODE_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" /* must supply slide[] (uch) array and NEXTBYTE macro */ + +#ifndef WSIZE +# define WSIZE 0x8000 /* window size--must be a power of two, and */ +#endif /* at least 8K for zip's implode method */ + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) +# define wszimpl (unsigned)(G._wsize) +#else +# if defined(USE_DEFLATE64) && defined(INT_16BIT) +# define wszimpl (unsigned)(WSIZE>>1) +# else /* !(USE_DEFLATE64 && INT_16BIT) */ +# define wszimpl WSIZE +# endif /* !(USE_DEFLATE64 && INT_16BIT) */ +#endif + +/* routines here */ +static int get_tree OF((__GPRO__ unsigned *l, unsigned n)); +static int explode_lit OF((__GPRO__ struct huft *tb, struct huft *tl, + struct huft *td, int bb, int bl, int bd, + unsigned bdl)); +static int explode_nolit OF((__GPRO__ struct huft *tl, struct huft *td, + int bl, int bd, unsigned bdl)); +int explode OF((__GPRO)); + + +/* The implode algorithm uses a sliding 4K or 8K byte window on the + uncompressed stream to find repeated byte strings. This is implemented + here as a circular buffer. The index is updated simply by incrementing + and then and'ing with 0x0fff (4K-1) or 0x1fff (8K-1). Here, the 32K + buffer of inflate is used, and it works just as well to always have + a 32K circular buffer, so the index is anded with 0x7fff. This is + done to allow the window to also be used as the output buffer. */ +/* This must be supplied in an external module useable like "uch slide[8192];" + or "uch *slide;", where the latter would be malloc'ed. In unzip, slide[] + is actually a 32K area for use by inflate, which uses a 32K sliding window. + */ + + +#define INVALID_CODE 99 +#define IS_INVALID_CODE(c) ((c) == INVALID_CODE) + +/* Tables for length and distance */ +static ZCONST ush cplen2[] = + {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65}; +static ZCONST ush cplen3[] = + {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66}; +static ZCONST uch extra[] = + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 8}; +static ZCONST ush cpdist4[] = + {1, 65, 129, 193, 257, 321, 385, 449, 513, 577, 641, 705, + 769, 833, 897, 961, 1025, 1089, 1153, 1217, 1281, 1345, 1409, 1473, + 1537, 1601, 1665, 1729, 1793, 1857, 1921, 1985, 2049, 2113, 2177, + 2241, 2305, 2369, 2433, 2497, 2561, 2625, 2689, 2753, 2817, 2881, + 2945, 3009, 3073, 3137, 3201, 3265, 3329, 3393, 3457, 3521, 3585, + 3649, 3713, 3777, 3841, 3905, 3969, 4033}; +static ZCONST ush cpdist8[] = + {1, 129, 257, 385, 513, 641, 769, 897, 1025, 1153, 1281, + 1409, 1537, 1665, 1793, 1921, 2049, 2177, 2305, 2433, 2561, 2689, + 2817, 2945, 3073, 3201, 3329, 3457, 3585, 3713, 3841, 3969, 4097, + 4225, 4353, 4481, 4609, 4737, 4865, 4993, 5121, 5249, 5377, 5505, + 5633, 5761, 5889, 6017, 6145, 6273, 6401, 6529, 6657, 6785, 6913, + 7041, 7169, 7297, 7425, 7553, 7681, 7809, 7937, 8065}; + + +/* Macros for inflate() bit peeking and grabbing. + The usage is: + + NEEDBITS(j) + x = b & mask_bits[j]; + DUMPBITS(j) + + where NEEDBITS makes sure that b has at least j bits in it, and + DUMPBITS removes the bits from b. The macros use the variable k + for the number of bits in b. Normally, b and k are register + variables for speed. + */ + +#define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE)<>=(n);k-=(n);} + +#define DECODEHUFT(htab, bits, mask) {\ + NEEDBITS((unsigned)(bits))\ + t = (htab) + ((~(unsigned)b)&(mask));\ + while (1) {\ + DUMPBITS(t->b)\ + if ((e=t->e) <= 32) break;\ + if (IS_INVALID_CODE(e)) return 1;\ + e &= 31;\ + NEEDBITS(e)\ + t = t->v.t + ((~(unsigned)b)&mask_bits[e]);\ + }\ +} + + +static int get_tree(__G__ l, n) + __GDEF +unsigned *l; /* bit lengths */ +unsigned n; /* number expected */ +/* Get the bit lengths for a code representation from the compressed + stream. If get_tree() returns 4, then there is an error in the data. + Otherwise zero is returned. */ +{ + unsigned i; /* bytes remaining in list */ + unsigned k; /* lengths entered */ + unsigned j; /* number of codes */ + unsigned b; /* bit length for those codes */ + + + /* get bit lengths */ + i = NEXTBYTE + 1; /* length/count pairs to read */ + k = 0; /* next code */ + do { + b = ((j = NEXTBYTE) & 0xf) + 1; /* bits in code (1..16) */ + j = ((j & 0xf0) >> 4) + 1; /* codes with those bits (1..16) */ + if (k + j > n) + return 4; /* don't overflow l[] */ + do { + l[k++] = b; + } while (--j); + } while (--i); + return k != n ? 4 : 0; /* should have read n of them */ +} + + + +static int explode_lit(__G__ tb, tl, td, bb, bl, bd, bdl) + __GDEF +struct huft *tb, *tl, *td; /* literal, length, and distance tables */ +int bb, bl, bd; /* number of bits decoded by those */ +unsigned bdl; /* number of distance low bits */ +/* Decompress the imploded data using coded literals and a sliding + window (of size 2^(6+bdl) bytes). */ +{ + ulg s; /* bytes to decompress */ + register unsigned e; /* table entry flag/number of extra bits */ + unsigned n, d; /* length and index for copy */ + unsigned w; /* current window position */ + struct huft *t; /* pointer to table entry */ + unsigned mb, ml, md; /* masks for bb, bl, and bd bits */ + unsigned mdl; /* mask for bdl (distance lower) bits */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + unsigned u; /* true if unflushed */ + int retval = 0; /* error code returned: initialized to "no error" */ + + + /* explode the coded data */ + b = k = w = 0; /* initialize bit buffer, window */ + u = 1; /* buffer unflushed */ + mb = mask_bits[bb]; /* precompute masks for speed */ + ml = mask_bits[bl]; + md = mask_bits[bd]; + mdl = mask_bits[bdl]; + s = G.lrec.ucsize; + while (s > 0) /* do until ucsize bytes uncompressed */ + { + NEEDBITS(1) + if (b & 1) /* then literal--decode it */ + { + DUMPBITS(1) + s--; + DECODEHUFT(tb, bb, mb) /* get coded literal */ + redirSlide[w++] = (uch)t->v.n; + if (w == wszimpl) + { + if ((retval = flush(__G__ redirSlide, (ulg)w, 0)) != 0) + return retval; + w = u = 0; + } + } + else /* else distance/length */ + { + DUMPBITS(1) + NEEDBITS(bdl) /* get distance low bits */ + d = (unsigned)b & mdl; + DUMPBITS(bdl) + DECODEHUFT(td, bd, md) /* get coded distance high bits */ + d = w - d - t->v.n; /* construct offset */ + DECODEHUFT(tl, bl, ml) /* get coded length */ + n = t->v.n; + if (e) /* get length extra bits */ + { + NEEDBITS(8) + n += (unsigned)b & 0xff; + DUMPBITS(8) + } + + /* do the copy */ + s = (s > (ulg)n ? s - (ulg)n : 0); + do { +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) { + /* &= w/ wszimpl not needed and wrong if redirect */ + if (d >= wszimpl) + return 1; + e = wszimpl - (d > w ? d : w); + } else +#endif + e = wszimpl - ((d &= wszimpl-1) > w ? d : w); + if (e > n) e = n; + n -= e; + if (u && w <= d) + { + memzero(redirSlide + w, e); + w += e; + d += e; + } + else +#ifndef NOMEMCPY + if (w - d >= e) /* (this test assumes unsigned comparison) */ + { + memcpy(redirSlide + w, redirSlide + d, e); + w += e; + d += e; + } + else /* do it slow to avoid memcpy() overlap */ +#endif /* !NOMEMCPY */ + do { + redirSlide[w++] = redirSlide[d++]; + } while (--e); + if (w == wszimpl) + { + if ((retval = flush(__G__ redirSlide, (ulg)w, 0)) != 0) + return retval; + w = u = 0; + } + } while (n); + } + } + + /* flush out redirSlide */ + if ((retval = flush(__G__ redirSlide, (ulg)w, 0)) != 0) + return retval; + if (G.csize + G.incnt + (k >> 3)) /* should have read csize bytes, but */ + { /* sometimes read one too many: k>>3 compensates */ + G.used_csize = G.lrec.csize - G.csize - G.incnt - (k >> 3); + return 5; + } + return 0; +} + + + +static int explode_nolit(__G__ tl, td, bl, bd, bdl) + __GDEF +struct huft *tl, *td; /* length and distance decoder tables */ +int bl, bd; /* number of bits decoded by tl[] and td[] */ +unsigned bdl; /* number of distance low bits */ +/* Decompress the imploded data using uncoded literals and a sliding + window (of size 2^(6+bdl) bytes). */ +{ + ulg s; /* bytes to decompress */ + register unsigned e; /* table entry flag/number of extra bits */ + unsigned n, d; /* length and index for copy */ + unsigned w; /* current window position */ + struct huft *t; /* pointer to table entry */ + unsigned ml, md; /* masks for bl and bd bits */ + unsigned mdl; /* mask for bdl (distance lower) bits */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + unsigned u; /* true if unflushed */ + int retval = 0; /* error code returned: initialized to "no error" */ + + + /* explode the coded data */ + b = k = w = 0; /* initialize bit buffer, window */ + u = 1; /* buffer unflushed */ + ml = mask_bits[bl]; /* precompute masks for speed */ + md = mask_bits[bd]; + mdl = mask_bits[bdl]; + s = G.lrec.ucsize; + while (s > 0) /* do until ucsize bytes uncompressed */ + { + NEEDBITS(1) + if (b & 1) /* then literal--get eight bits */ + { + DUMPBITS(1) + s--; + NEEDBITS(8) + redirSlide[w++] = (uch)b; + if (w == wszimpl) + { + if ((retval = flush(__G__ redirSlide, (ulg)w, 0)) != 0) + return retval; + w = u = 0; + } + DUMPBITS(8) + } + else /* else distance/length */ + { + DUMPBITS(1) + NEEDBITS(bdl) /* get distance low bits */ + d = (unsigned)b & mdl; + DUMPBITS(bdl) + DECODEHUFT(td, bd, md) /* get coded distance high bits */ + d = w - d - t->v.n; /* construct offset */ + DECODEHUFT(tl, bl, ml) /* get coded length */ + n = t->v.n; + if (e) /* get length extra bits */ + { + NEEDBITS(8) + n += (unsigned)b & 0xff; + DUMPBITS(8) + } + + /* do the copy */ + s = (s > (ulg)n ? s - (ulg)n : 0); + do { +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) { + /* &= w/ wszimpl not needed and wrong if redirect */ + if (d >= wszimpl) + return 1; + e = wszimpl - (d > w ? d : w); + } else +#endif + e = wszimpl - ((d &= wszimpl-1) > w ? d : w); + if (e > n) e = n; + n -= e; + if (u && w <= d) + { + memzero(redirSlide + w, e); + w += e; + d += e; + } + else +#ifndef NOMEMCPY + if (w - d >= e) /* (this test assumes unsigned comparison) */ + { + memcpy(redirSlide + w, redirSlide + d, e); + w += e; + d += e; + } + else /* do it slow to avoid memcpy() overlap */ +#endif /* !NOMEMCPY */ + do { + redirSlide[w++] = redirSlide[d++]; + } while (--e); + if (w == wszimpl) + { + if ((retval = flush(__G__ redirSlide, (ulg)w, 0)) != 0) + return retval; + w = u = 0; + } + } while (n); + } + } + + /* flush out redirSlide */ + if ((retval = flush(__G__ redirSlide, (ulg)w, 0)) != 0) + return retval; + if (G.csize + G.incnt + (k >> 3)) /* should have read csize bytes, but */ + { /* sometimes read one too many: k>>3 compensates */ + G.used_csize = G.lrec.csize - G.csize - G.incnt - (k >> 3); + return 5; + } + return 0; +} + + + +int explode(__G) + __GDEF +/* Explode an imploded compressed stream. Based on the general purpose + bit flag, decide on coded or uncoded literals, and an 8K or 4K sliding + window. Construct the literal (if any), length, and distance codes and + the tables needed to decode them (using huft_build() from inflate.c), + and call the appropriate routine for the type of data in the remainder + of the stream. The four routines are nearly identical, differing only + in whether the literal is decoded or simply read in, and in how many + bits are read in, uncoded, for the low distance bits. */ +{ + unsigned r; /* return codes */ + struct huft *tb; /* literal code table */ + struct huft *tl; /* length code table */ + struct huft *td; /* distance code table */ + int bb; /* bits for tb */ + int bl; /* bits for tl */ + int bd; /* bits for td */ + unsigned bdl; /* number of uncoded lower distance bits */ + unsigned l[256]; /* bit lengths for codes */ + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) + /* For 16-bit systems, it has already been checked at DLL entrance that + * the buffer size in G.redirect_size does not exceed unsigned range. + */ + G._wsize = G.redirect_size, redirSlide = G.redirect_buffer; + else +#if defined(USE_DEFLATE64) && defined(INT_16BIT) + /* For systems using 16-bit ints, reduce the used buffer size below + * the limit of "unsigned int" numbers range. + */ + G._wsize = WSIZE>>1, redirSlide = slide; +#else /* !(USE_DEFLATE64 && INT_16BIT) */ + G._wsize = WSIZE, redirSlide = slide; +#endif /* !(USE_DEFLATE64 && INT_16BIT) */ +#endif /* DLL && !NO_SLIDE_REDIR */ + + /* Tune base table sizes. Note: I thought that to truly optimize speed, + I would have to select different bl, bd, and bb values for different + compressed file sizes. I was surprised to find out that the values of + 7, 7, and 9 worked best over a very wide range of sizes, except that + bd = 8 worked marginally better for large compressed sizes. */ + bl = 7; + bd = (G.csize + G.incnt) > 200000L ? 8 : 7; + +#ifdef DEBUG + G.hufts = 0; /* initialize huft's malloc'ed */ +#endif + + if (G.lrec.general_purpose_bit_flag & 4) + /* With literal tree--minimum match length is 3 */ + { + bb = 9; /* base table size for literals */ + if ((r = get_tree(__G__ l, 256)) != 0) + return (int)r; + if ((r = huft_build(__G__ l, 256, 256, NULL, NULL, &tb, &bb)) != 0) + { + if (r == 1) + huft_free(tb); + return (int)r; + } + if ((r = get_tree(__G__ l, 64)) != 0) { + huft_free(tb); + return (int)r; + } + if ((r = huft_build(__G__ l, 64, 0, cplen3, extra, &tl, &bl)) != 0) + { + if (r == 1) + huft_free(tl); + huft_free(tb); + return (int)r; + } + } + else + /* No literal tree--minimum match length is 2 */ + { + tb = (struct huft *)NULL; + if ((r = get_tree(__G__ l, 64)) != 0) + return (int)r; + if ((r = huft_build(__G__ l, 64, 0, cplen2, extra, &tl, &bl)) != 0) + { + if (r == 1) + huft_free(tl); + return (int)r; + } + } + + if ((r = get_tree(__G__ l, 64)) != 0) { + huft_free(tl); + if (tb != (struct huft *)NULL) huft_free(tb); + return (int)r; + } + if (G.lrec.general_purpose_bit_flag & 2) /* true if 8K */ + { + bdl = 7; + r = huft_build(__G__ l, 64, 0, cpdist8, extra, &td, &bd); + } + else /* else 4K */ + { + bdl = 6; + r = huft_build(__G__ l, 64, 0, cpdist4, extra, &td, &bd); + } + if (r != 0) + { + if (r == 1) + huft_free(td); + huft_free(tl); + if (tb != (struct huft *)NULL) huft_free(tb); + return (int)r; + } + + if (tb != NULL) { + r = explode_lit(__G__ tb, tl, td, bb, bl, bd, bdl); + huft_free(tb); + } else { + r = explode_nolit(__G__ tl, td, bl, bd, bdl); + } + + huft_free(td); + huft_free(tl); + Trace((stderr, "<%u > ", G.hufts)); + return (int)r; +} + +/* so explode.c and inflate.c can be compiled together into one object: */ +#undef DECODEHUFT +#undef NEEDBITS +#undef DUMPBITS +#undef wszimpl + +const char *BOINC_RCSID_38cb7b3e92 = "$Id: explode.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/extract.c boinc-7.0.14+dfsg/zip/unzip/extract.c --- boinc-7.0.7+dfsg/zip/unzip/extract.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/extract.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,2275 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + extract.c + + This file contains the high-level routines ("driver routines") for extrac- + ting and testing zipfile members. It calls the low-level routines in files + explode.c, inflate.c, unreduce.c and unshrink.c. + + Contains: extract_or_test_files() + store_info() + extract_or_test_entrylist() + extract_or_test_member() + TestExtraField() + test_compr_eb() + memextract() + memflush() + extract_izvms_block() (VMS or VMS_TEXT_CONV) + fnfilter() + + ---------------------------------------------------------------------------*/ + + +#define __EXTRACT_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" +#ifdef WINDLL +# ifdef POCKET_UNZIP +# include "wince/intrface.h" +# else +# include "windll/windll.h" +# endif +#endif +//#ifdef CRYPT +//#include "crypt.h" +//#endif + +#undef NTSD_EAS + +#define GRRDUMP(buf,len) { \ + int i, j; \ + \ + for (j = 0; j < (len)/16; ++j) { \ + printf(" "); \ + for (i = 0; i < 16; ++i) \ + printf("%02x ", (uch)(buf)[i+(j<<4)]); \ + printf("\n "); \ + for (i = 0; i < 16; ++i) { \ + char c = (char)(buf)[i+(j<<4)]; \ + \ + if (c == '\n') \ + printf("\\n "); \ + else if (c == '\r') \ + printf("\\r "); \ + else \ + printf(" %c ", c); \ + } \ + printf("\n"); \ + } \ + if ((len) % 16) { \ + printf(" "); \ + for (i = j<<4; i < (len); ++i) \ + printf("%02x ", (uch)(buf)[i]); \ + printf("\n "); \ + for (i = j<<4; i < (len); ++i) { \ + char c = (char)(buf)[i]; \ + \ + if (c == '\n') \ + printf("\\n "); \ + else if (c == '\r') \ + printf("\\r "); \ + else \ + printf(" %c ", c); \ + } \ + printf("\n"); \ + } \ +} + +static int store_info OF((__GPRO)); +#ifdef SET_DIR_ATTRIB +static int extract_or_test_entrylist OF((__GPRO__ unsigned numchunk, + ulg *pfilnum, ulg *pnum_bad_pwd, LONGINT *pold_extra_bytes, + unsigned *pnum_dirs, dirtime **pdirlist, + int error_in_archive)); +#else +static int extract_or_test_entrylist OF((__GPRO__ unsigned numchunk, + ulg *pfilnum, ulg *pnum_bad_pwd, LONGINT *pold_extra_bytes, + int error_in_archive)); +#endif +static int extract_or_test_member OF((__GPRO)); +#ifndef SFX + static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); + static int test_compr_eb OF((__GPRO__ uch *eb, unsigned eb_size, + unsigned compr_offset, + int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size, + uch *eb_ucptr, ulg eb_ucsize))); +#endif +#if (defined(VMS) || defined(VMS_TEXT_CONV)) + static void decompress_bits OF((uch *outptr, unsigned needlen, + ZCONST uch *bitptr)); +#endif +#ifdef SET_DIR_ATTRIB + static int dircomp OF((ZCONST zvoid *a, ZCONST zvoid *b)); +#endif + + + +/*******************************/ +/* Strings used in extract.c */ +/*******************************/ + +static ZCONST char Far VersionMsg[] = + " skipping: %-22s need %s compat. v%u.%u (can do v%u.%u)\n"; +static ZCONST char Far ComprMsgNum[] = + " skipping: %-22s unsupported compression method %u\n"; +#ifndef SFX + static ZCONST char Far ComprMsgName[] = + " skipping: %-22s `%s' method not supported\n"; + static ZCONST char Far CmprNone[] = "store"; + static ZCONST char Far CmprShrink[] = "shrink"; + static ZCONST char Far CmprReduce[] = "reduce"; + static ZCONST char Far CmprImplode[] = "implode"; + static ZCONST char Far CmprTokenize[] = "tokenize"; + static ZCONST char Far CmprDeflate[] = "deflate"; + static ZCONST char Far CmprDeflat64[] = "deflate64"; + static ZCONST char Far CmprDCLImplode[] = "DCL implode"; + static ZCONST char Far *ComprNames[NUM_METHODS] = { + CmprNone, CmprShrink, CmprReduce, CmprReduce, CmprReduce, CmprReduce, + CmprImplode, CmprTokenize, CmprDeflate, CmprDeflat64, CmprDCLImplode + }; +#endif /* !SFX */ +static ZCONST char Far FilNamMsg[] = + "%s: bad filename length (%s)\n"; +static ZCONST char Far ExtFieldMsg[] = + "%s: bad extra field length (%s)\n"; +static ZCONST char Far OffsetMsg[] = + "file #%lu: bad zipfile offset (%s): %ld\n"; +static ZCONST char Far ExtractMsg[] = + "%8sing: %-22s %s%s"; +#ifndef SFX + static ZCONST char Far LengthMsg[] = + "%s %s: %ld bytes required to uncompress to %lu bytes;\n %s\ + supposed to require %lu bytes%s%s%s\n"; +#endif + +static ZCONST char Far BadFileCommLength[] = "%s: bad file comment length\n"; +static ZCONST char Far LocalHdrSig[] = "local header sig"; +static ZCONST char Far BadLocalHdr[] = "file #%lu: bad local header\n"; +static ZCONST char Far AttemptRecompensate[] = + " (attempting to re-compensate)\n"; +#ifndef SFX + static ZCONST char Far BackslashPathSep[] = + "warning: %s appears to use backslashes as path separators\n"; +#endif +static ZCONST char Far AbsolutePathWarning[] = + "warning: stripped absolute path spec from %s\n"; +static ZCONST char Far SkipVolumeLabel[] = + " skipping: %-22s %svolume label\n"; + +#ifdef SET_DIR_ATTRIB /* messages of code for setting directory attributes */ + static ZCONST char Far DirlistEntryNoMem[] = + "warning: cannot alloc memory for dir times/permissions/UID/GID\n"; + static ZCONST char Far DirlistSortNoMem[] = + "warning: cannot alloc memory to sort dir times/perms/etc.\n"; + static ZCONST char Far DirlistSetAttrFailed[] = + "warning: set times/attribs failed for %s\n"; +#endif + +#ifndef WINDLL + static ZCONST char Far ReplaceQuery[] = + "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: "; + static ZCONST char Far AssumeNone[] = " NULL\n(assuming [N]one)\n"; + static ZCONST char Far NewNameQuery[] = "new name: "; + static ZCONST char Far InvalidResponse[] = "error: invalid response [%c]\n"; +#endif /* !WINDLL */ + +static ZCONST char Far ErrorInArchive[] = + "At least one %serror was detected in %s.\n"; +static ZCONST char Far ZeroFilesTested[] = + "Caution: zero files tested in %s.\n"; + +#ifndef VMS + static ZCONST char Far VMSFormatQuery[] = + "\n%s: stored in VMS format. Extract anyway? (y/n) "; +#endif + +#if CRYPT + static ZCONST char Far SkipCannotGetPasswd[] = + " skipping: %-22s unable to get password\n"; + static ZCONST char Far SkipIncorrectPasswd[] = + " skipping: %-22s incorrect password\n"; + static ZCONST char Far FilesSkipBadPasswd[] = + "%lu file%s skipped because of incorrect password.\n"; + static ZCONST char Far MaybeBadPasswd[] = + " (may instead be incorrect password)\n"; +#else + static ZCONST char Far SkipEncrypted[] = + " skipping: %-22s encrypted (not supported)\n"; +#endif + +static ZCONST char Far NoErrInCompData[] = + "No errors detected in compressed data of %s.\n"; +static ZCONST char Far NoErrInTestedFiles[] = + "No errors detected in %s for the %lu file%s tested.\n"; +static ZCONST char Far FilesSkipped[] = + "%lu file%s skipped because of unsupported compression or encoding.\n"; + +static ZCONST char Far ErrUnzipFile[] = " error: %s%s %s\n"; +static ZCONST char Far ErrUnzipNoFile[] = "\n error: %s%s\n"; +static ZCONST char Far NotEnoughMem[] = "not enough memory to "; +static ZCONST char Far InvalidComprData[] = "invalid compressed data to "; +static ZCONST char Far Inflate[] = "inflate_boinc"; + +extern int inflate_boinc(__G__ is_defl64); + +#ifndef SFX + static ZCONST char Far Explode[] = "explode"; +#ifndef LZW_CLEAN + static ZCONST char Far Unshrink[] = "unshrink"; +#endif +#endif + +#if (!defined(DELETE_IF_FULL) || !defined(HAVE_UNLINK)) + static ZCONST char Far FileTruncated[] = + "warning: %s is probably truncated\n"; +#endif + +static ZCONST char Far FileUnknownCompMethod[] = + "%s: unknown compression method\n"; +static ZCONST char Far BadCRC[] = " bad CRC %08lx (should be %08lx)\n"; + + /* TruncEAs[] also used in OS/2 mapname(), close_outfile() */ +char ZCONST Far TruncEAs[] = " compressed EA data missing (%d bytes)%s"; +char ZCONST Far TruncNTSD[] = + " compressed WinNT security data missing (%d bytes)%s"; + +#ifndef SFX + static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \ + EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n"; + static ZCONST char Far InvalidComprDataEAs[] = + " invalid compressed data for EAs\n"; +# if (defined(WIN32) && defined(NTSD_EAS)) + static ZCONST char Far InvalidSecurityEAs[] = + " EAs fail security check\n"; +# endif + static ZCONST char Far UnsuppNTSDVersEAs[] = + " unsupported NTSD EAs version %d\n"; + static ZCONST char Far BadCRC_EAs[] = " bad CRC for extended attributes\n"; + static ZCONST char Far UnknComprMethodEAs[] = + " unknown compression method for EAs (%u)\n"; + static ZCONST char Far NotEnoughMemEAs[] = + " out of memory while inflating EAs\n"; + static ZCONST char Far UnknErrorEAs[] = + " unknown error on extended attributes\n"; +#endif /* !SFX */ + +static ZCONST char Far UnsupportedExtraField[] = + "\nerror: unsupported extra-field compression type (%u)--skipping\n"; +static ZCONST char Far BadExtraFieldCRC[] = + "error [%s]: bad extra-field CRC %08lx (should be %08lx)\n"; + + + + + +/**************************************/ +/* Function extract_or_test_files() */ +/**************************************/ + +int extract_or_test_files(__G) /* return PK-type error code */ + __GDEF +{ + unsigned i, j; + long cd_bufstart; + uch *cd_inptr; + int cd_incnt; + ulg filnum=0L, blknum=0L; + int reached_end, no_endsig_found; + int error, error_in_archive=PK_COOL; + int *fn_matched=NULL, *xn_matched=NULL; + unsigned members_processed; + ulg num_skipped=0L, num_bad_pwd=0L; + LONGINT old_extra_bytes = 0L; +#ifdef SET_DIR_ATTRIB + unsigned num_dirs=0; + dirtime *dirlist=(dirtime *)NULL, **sorted_dirlist=(dirtime **)NULL; +#endif + +/*--------------------------------------------------------------------------- + The basic idea of this function is as follows. Since the central di- + rectory lies at the end of the zipfile and the member files lie at the + beginning or middle or wherever, it is not very desirable to simply + read a central directory entry, jump to the member and extract it, and + then jump back to the central directory. In the case of a large zipfile + this would lead to a whole lot of disk-grinding, especially if each mem- + ber file is small. Instead, we read from the central directory the per- + tinent information for a block of files, then go extract/test the whole + block. Thus this routine contains two small(er) loops within a very + large outer loop: the first of the small ones reads a block of files + from the central directory; the second extracts or tests each file; and + the outer one loops over blocks. There's some file-pointer positioning + stuff in between, but that's about it. Btw, it's because of this jump- + ing around that we can afford to be lenient if an error occurs in one of + the member files: we should still be able to go find the other members, + since we know the offset of each from the beginning of the zipfile. + ---------------------------------------------------------------------------*/ + + G.pInfo = G.info; + +#if CRYPT + G.newzip = TRUE; +#endif +#ifndef SFX + G.reported_backslash = FALSE; +#endif + + /* malloc space for check on unmatched filespecs (OK if one or both NULL) */ + if (G.filespecs > 0 && + (fn_matched=(int *)malloc(G.filespecs*sizeof(int))) != (int *)NULL) + for (i = 0; i < G.filespecs; ++i) + fn_matched[i] = FALSE; + if (G.xfilespecs > 0 && + (xn_matched=(int *)malloc(G.xfilespecs*sizeof(int))) != (int *)NULL) + for (i = 0; i < G.xfilespecs; ++i) + xn_matched[i] = FALSE; + +/*--------------------------------------------------------------------------- + Begin main loop over blocks of member files. We know the entire central + directory is on this disk: we would not have any of this information un- + less the end-of-central-directory record was on this disk, and we would + not have gotten to this routine unless this is also the disk on which + the central directory starts. In practice, this had better be the ONLY + disk in the archive, but we'll add multi-disk support soon. + ---------------------------------------------------------------------------*/ + + members_processed = 0; + no_endsig_found = FALSE; + reached_end = FALSE; + while (!reached_end) { + j = 0; +#ifdef AMIGA + memzero(G.filenotes, DIR_BLKSIZ * sizeof(char *)); +#endif + + /* + * Loop through files in central directory, storing offsets, file + * attributes, case-conversion and text-conversion flags until block + * size is reached. + */ + + while ((j < DIR_BLKSIZ)) { + G.pInfo = &G.info[j]; + + if (readbuf(__G__ G.sig, 4) == 0) { + error_in_archive = PK_EOF; + reached_end = TRUE; /* ...so no more left to do */ + break; + } + if (strncmp(G.sig, central_hdr_sig, 4)) { /* is it a new entry? */ + /* no new central directory entry + * -> is the number of processed entries compatible with the + * number of entries as stored in the end_central record? + */ + if ((members_processed & (unsigned)0xFFFF) == + (unsigned)G.ecrec.total_entries_central_dir) { + /* yes, so look if we ARE back at the end_central record + */ + no_endsig_found = + (strncmp(G.sig, end_central_sig, 4) != 0); + } else { + /* no; we have found an error in the central directory + * -> report it and stop searching for more Zip entries + */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1)); + Info(slide, 0x401, ((char *)slide, + LoadFarString(ReportMsg))); + error_in_archive = PK_BADERR; + } + reached_end = TRUE; /* ...so no more left to do */ + break; + } + /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag */ + if ((error = process_cdir_file_hdr(__G)) != PK_COOL) { + error_in_archive = error; /* only PK_EOF defined */ + reached_end = TRUE; /* ...so no more left to do */ + break; + } + if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != + PK_COOL) + { + if (error > error_in_archive) + error_in_archive = error; + if (error > PK_WARN) { /* fatal: no more left to do */ + Info(slide, 0x401, ((char *)slide, LoadFarString(FilNamMsg), + FnFilter1(G.filename), "central")); + reached_end = TRUE; + break; + } + } + if ((error = do_string(__G__ G.crec.extra_field_length, + EXTRA_FIELD)) != 0) + { + if (error > error_in_archive) + error_in_archive = error; + if (error > PK_WARN) { /* fatal */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(ExtFieldMsg), + FnFilter1(G.filename), "central")); + reached_end = TRUE; + break; + } + } +#ifdef AMIGA + G.filenote_slot = j; + if ((error = do_string(__G__ G.crec.file_comment_length, + uO.N_flag ? FILENOTE : SKIP)) != PK_COOL) +#else + if ((error = do_string(__G__ G.crec.file_comment_length, SKIP)) + != PK_COOL) +#endif + { + if (error > error_in_archive) + error_in_archive = error; + if (error > PK_WARN) { /* fatal */ + Info(slide, 0x421, ((char *)slide, + LoadFarString(BadFileCommLength), + FnFilter1(G.filename))); + reached_end = TRUE; + break; + } + } + if (G.process_all_files) { + if (store_info(__G)) + ++j; /* file is OK; info[] stored; continue with next */ + else + ++num_skipped; + } else { + int do_this_file; + + if (G.filespecs == 0) + do_this_file = TRUE; + else { /* check if this entry matches an `include' argument */ + do_this_file = FALSE; + for (i = 0; i < G.filespecs; i++) + if (match(G.filename, G.pfnames[i], uO.C_flag)) { + do_this_file = TRUE; /* ^-- ignore case or not? */ + if (fn_matched) + fn_matched[i] = TRUE; + break; /* found match, so stop looping */ + } + } + if (do_this_file) { /* check if this is an excluded file */ + for (i = 0; i < G.xfilespecs; i++) + if (match(G.filename, G.pxnames[i], uO.C_flag)) { + do_this_file = FALSE; /* ^-- ignore case or not? */ + if (xn_matched) + xn_matched[i] = TRUE; + break; + } + } + if (do_this_file) { + if (store_info(__G)) + ++j; /* file is OK */ + else + ++num_skipped; /* unsupp. compression or encryption */ + } + } /* end if (process_all_files) */ + + members_processed++; + + } /* end while-loop (adding files to current block) */ + + /* save position in central directory so can come back later */ + cd_bufstart = G.cur_zipfile_bufstart; + cd_inptr = G.inptr; + cd_incnt = G.incnt; + + /*----------------------------------------------------------------------- + Second loop: process files in current block, extracting or testing + each one. + -----------------------------------------------------------------------*/ + + error = extract_or_test_entrylist(__G__ j, + &filnum, &num_bad_pwd, &old_extra_bytes, +#ifdef SET_DIR_ATTRIB + &num_dirs, &dirlist, +#endif + error_in_archive); + if (error != PK_COOL) { + if (error > error_in_archive) + error_in_archive = error; /* ...and keep going */ + if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) { + if (fn_matched) + free((zvoid *)fn_matched); + if (xn_matched) + free((zvoid *)xn_matched); + return error_in_archive; /* (unless disk full) */ + } + } + + + /* + * Jump back to where we were in the central directory, then go and do + * the next batch of files. + */ + +#ifdef USE_STRM_INPUT + fseek((FILE *)G.zipfd, (LONGINT)cd_bufstart, SEEK_SET); + G.cur_zipfile_bufstart = ftell((FILE *)G.zipfd); +#else /* !USE_STRM_INPUT */ + G.cur_zipfile_bufstart = + lseek(G.zipfd, (LONGINT)cd_bufstart, SEEK_SET); +#endif /* ?USE_STRM_INPUT */ + read(G.zipfd, (char *)G.inbuf, INBUFSIZ); /* been here before... */ + G.inptr = cd_inptr; + G.incnt = cd_incnt; + ++blknum; + +#ifdef TEST + printf("\ncd_bufstart = %ld (%.8lXh)\n", cd_bufstart, cd_bufstart); + printf("cur_zipfile_bufstart = %ld (%.8lXh)\n", cur_zipfile_bufstart, + cur_zipfile_bufstart); + printf("inptr-inbuf = %d\n", G.inptr-G.inbuf); + printf("incnt = %d\n\n", G.incnt); +#endif + + } /* end while-loop (blocks of files in central directory) */ + +/*--------------------------------------------------------------------------- + Go back through saved list of directories, sort and set times/perms/UIDs + and GIDs from the deepest level on up. + ---------------------------------------------------------------------------*/ + +#ifdef SET_DIR_ATTRIB + if (num_dirs > 0) { + sorted_dirlist = (dirtime **)malloc(num_dirs*sizeof(dirtime *)); + if (sorted_dirlist == (dirtime **)NULL) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(DirlistSortNoMem))); + while (dirlist != (dirtime *)NULL) { + dirtime *d = dirlist; + + dirlist = dirlist->next; + free(d); + } + } else { + if (num_dirs == 1) + sorted_dirlist[0] = dirlist; + else { + for (i = 0; i < num_dirs; ++i) { + sorted_dirlist[i] = dirlist; + dirlist = dirlist->next; + } + qsort((char *)sorted_dirlist, num_dirs, sizeof(dirtime *), + dircomp); + } + + Trace((stderr, "setting directory times/perms/attributes\n")); + for (i = 0; i < num_dirs; ++i) { + dirtime *d = sorted_dirlist[i]; + + Trace((stderr, "dir = %s\n", d->fn)); + if ((error = set_direc_attribs(__G__ d)) != PK_OK) { + Info(slide, 0x201, ((char *)slide, + LoadFarString(DirlistSetAttrFailed), d->fn)); + if (!error_in_archive) + error_in_archive = error; + } + free(d->fn); + free(d); + } + free(sorted_dirlist); + } + } +#endif /* SET_DIR_ATTRIB */ + +#if (defined(WIN32) && defined(NTSD_EAS)) + process_defer_NT(__G); /* process any deferred items for this .zip file */ +#endif + +/*--------------------------------------------------------------------------- + Check for unmatched filespecs on command line and print warning if any + found. Free allocated memory. + ---------------------------------------------------------------------------*/ + + if (fn_matched) { + for (i = 0; i < G.filespecs; ++i) + if (!fn_matched[i]) { +#ifdef DLL + if (!G.redirect_data && !G.redirect_text) + Info(slide, 0x401, ((char *)slide, + LoadFarString(FilenameNotMatched), G.pfnames[i])); + else + setFileNotFound(__G); +#else + Info(slide, 1, ((char *)slide, + LoadFarString(FilenameNotMatched), G.pfnames[i])); +#endif + if (error_in_archive <= PK_WARN) + error_in_archive = PK_FIND; /* some files not found */ + } + free((zvoid *)fn_matched); + } + if (xn_matched) { + for (i = 0; i < G.xfilespecs; ++i) + if (!xn_matched[i]) + Info(slide, 0x401, ((char *)slide, + LoadFarString(ExclFilenameNotMatched), G.pxnames[i])); + free((zvoid *)xn_matched); + } + +/*--------------------------------------------------------------------------- + Double-check that we're back at the end-of-central-directory record, and + print quick summary of results, if we were just testing the archive. We + send the summary to stdout so that people doing the testing in the back- + ground and redirecting to a file can just do a "tail" on the output file. + ---------------------------------------------------------------------------*/ + +#ifndef SFX + if (no_endsig_found) { /* just to make sure */ + Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); + Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg))); + if (!error_in_archive) /* don't overwrite stronger error */ + error_in_archive = PK_WARN; + } +#endif /* !SFX */ + if (uO.tflag) { + ulg num = filnum - num_bad_pwd; + + if (uO.qflag < 2) { /* GRR 930710: was (uO.qflag == 1) */ + if (error_in_archive) + Info(slide, 0, ((char *)slide, LoadFarString(ErrorInArchive), + (error_in_archive == PK_WARN)? "warning-" : "", G.zipfn)); + else if (num == 0L) + Info(slide, 0, ((char *)slide, LoadFarString(ZeroFilesTested), + G.zipfn)); + else if (G.process_all_files && (num_skipped+num_bad_pwd == 0L)) + Info(slide, 0, ((char *)slide, LoadFarString(NoErrInCompData), + G.zipfn)); + else + Info(slide, 0, ((char *)slide, LoadFarString(NoErrInTestedFiles) + , G.zipfn, num, (num==1L)? "":"s")); + if (num_skipped > 0L) + Info(slide, 0, ((char *)slide, LoadFarString(FilesSkipped), + num_skipped, (num_skipped==1L)? "":"s")); +#if CRYPT + if (num_bad_pwd > 0L) + Info(slide, 0, ((char *)slide, LoadFarString(FilesSkipBadPasswd) + , num_bad_pwd, (num_bad_pwd==1L)? "":"s")); +#endif /* CRYPT */ + } else if ((uO.qflag == 0) && !error_in_archive && (num == 0)) + Info(slide, 0, ((char *)slide, LoadFarString(ZeroFilesTested), + G.zipfn)); + } + + /* give warning if files not tested or extracted (first condition can still + * happen if zipfile is empty and no files specified on command line) */ + + if ((filnum == 0) && error_in_archive <= PK_WARN) { + if (num_skipped > 0L) + error_in_archive = IZ_UNSUP; /* unsupport. compression/encryption */ + else + error_in_archive = PK_FIND; /* no files found at all */ + } +#if CRYPT + else if ((filnum == num_bad_pwd) && error_in_archive <= PK_WARN) + error_in_archive = IZ_BADPWD; /* bad passwd => all files skipped */ +#endif + else if ((num_skipped > 0L) && error_in_archive <= PK_WARN) + error_in_archive = IZ_UNSUP; /* was PK_WARN; Jean-loup complained */ +#if CRYPT + else if ((num_bad_pwd > 0L) && !error_in_archive) + error_in_archive = PK_WARN; +#endif + + return error_in_archive; + +} /* end function extract_or_test_files() */ + + + + + +/***************************/ +/* Function store_info() */ +/***************************/ + +static int store_info(__G) /* return 0 if skipping, 1 if OK */ + __GDEF +{ +#ifdef SFX +# ifdef USE_DEFLATE64 +# define UNKN_COMPR \ + (G.crec.compression_method!=STORED && G.crec.compression_methodENHDEFLATED) +# else +# define UNKN_COMPR \ + (G.crec.compression_method!=STORED && G.crec.compression_method!=DEFLATED) +# endif +#else +# ifdef COPYRIGHT_CLEAN /* no reduced files */ +# define UNKN_RED (G.crec.compression_method >= REDUCED1 && \ + G.crec.compression_method <= REDUCED4) +# else +# define UNKN_RED FALSE /* reducing not unknown */ +# endif +# ifdef LZW_CLEAN /* no shrunk files */ +# define UNKN_SHR (G.crec.compression_method == SHRUNK) +# else +# define UNKN_SHR FALSE /* unshrinking not unknown */ +# endif +# ifdef USE_DEFLATE64 +# define UNKN_COMPR (UNKN_RED || UNKN_SHR || \ + G.crec.compression_method==TOKENIZED || \ + G.crec.compression_method>ENHDEFLATED) +# else +# define UNKN_COMPR (UNKN_RED || UNKN_SHR || \ + G.crec.compression_method==TOKENIZED || \ + G.crec.compression_method>DEFLATED) +# endif +#endif + +/*--------------------------------------------------------------------------- + Check central directory info for version/compatibility requirements. + ---------------------------------------------------------------------------*/ + + G.pInfo->encrypted = G.crec.general_purpose_bit_flag & 1; /* bit field */ + G.pInfo->ExtLocHdr = (G.crec.general_purpose_bit_flag & 8) == 8; /* bit */ + G.pInfo->textfile = G.crec.internal_file_attributes & 1; /* bit field */ + G.pInfo->crc = G.crec.crc32; + G.pInfo->compr_size = G.crec.csize; + G.pInfo->uncompr_size = G.crec.ucsize; + + switch (uO.aflag) { + case 0: + G.pInfo->textmode = FALSE; /* bit field */ + break; + case 1: + G.pInfo->textmode = G.pInfo->textfile; /* auto-convert mode */ + break; + default: /* case 2: */ + G.pInfo->textmode = TRUE; + break; + } + + if (G.crec.version_needed_to_extract[1] == VMS_) { + if (G.crec.version_needed_to_extract[0] > VMS_UNZIP_VERSION) { + if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) + Info(slide, 0x401, ((char *)slide, LoadFarString(VersionMsg), + FnFilter1(G.filename), "VMS", + G.crec.version_needed_to_extract[0] / 10, + G.crec.version_needed_to_extract[0] % 10, + VMS_UNZIP_VERSION / 10, VMS_UNZIP_VERSION % 10)); + return 0; + } +#ifndef VMS /* won't be able to use extra field, but still have data */ + else if (!uO.tflag && !IS_OVERWRT_ALL) { /* if -o, extract anyway */ + Info(slide, 0x481, ((char *)slide, LoadFarString(VMSFormatQuery), + FnFilter1(G.filename))); + fgets(G.answerbuf, 9, stdin); + if ((*G.answerbuf != 'y') && (*G.answerbuf != 'Y')) + return 0; + } +#endif /* !VMS */ + /* usual file type: don't need VMS to extract */ + } else if (G.crec.version_needed_to_extract[0] > UNZIP_VERSION) { + if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) + Info(slide, 0x401, ((char *)slide, LoadFarString(VersionMsg), + FnFilter1(G.filename), "PK", + G.crec.version_needed_to_extract[0] / 10, + G.crec.version_needed_to_extract[0] % 10, + UNZIP_VERSION / 10, UNZIP_VERSION % 10)); + return 0; + } + + if UNKN_COMPR { + if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) { +#ifndef SFX + if (G.crec.compression_method < NUM_METHODS) + Info(slide, 0x401, ((char *)slide, LoadFarString(ComprMsgName), + FnFilter1(G.filename), + LoadFarStringSmall(ComprNames[G.crec.compression_method]))); + else +#endif + Info(slide, 0x401, ((char *)slide, LoadFarString(ComprMsgNum), + FnFilter1(G.filename), + G.crec.compression_method)); + } + return 0; + } +#if (!CRYPT) + if (G.pInfo->encrypted) { + if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) + Info(slide, 0x401, ((char *)slide, LoadFarString(SkipEncrypted), + FnFilter1(G.filename))); + return 0; + } +#endif /* !CRYPT */ + + /* map whatever file attributes we have into the local format */ + mapattr(__G); /* GRR: worry about return value later */ + + G.pInfo->diskstart = G.crec.disk_number_start; + G.pInfo->offset = (long)G.crec.relative_offset_local_header; + return 1; + +} /* end function store_info() */ + + + + + +/******************************************/ +/* Function extract_or_test_entrylist() */ +/******************************************/ + +static int extract_or_test_entrylist(__G__ numchunk, + pfilnum, pnum_bad_pwd, pold_extra_bytes, +#ifdef SET_DIR_ATTRIB + pnum_dirs, pdirlist, +#endif + error_in_archive) /* return PK-type error code */ + __GDEF + unsigned numchunk; + ulg *pfilnum; + ulg *pnum_bad_pwd; + LONGINT *pold_extra_bytes; +#ifdef SET_DIR_ATTRIB + unsigned *pnum_dirs; + dirtime **pdirlist; +#endif + int error_in_archive; +{ + unsigned i; + int renamed, query; + int skip_entry; + long bufstart, inbuf_offset, request; + int error, errcode; + +/* possible values for local skip_entry flag: */ +#define SKIP_NO 0 /* do not skip this entry */ +#define SKIP_Y_EXISTING 1 /* skip this entry, do not overwrite file */ +#define SKIP_Y_NONEXIST 2 /* skip this entry, do not create new file */ + + /*----------------------------------------------------------------------- + Second loop: process files in current block, extracting or testing + each one. + -----------------------------------------------------------------------*/ + + for (i = 0; i < numchunk; ++i) { + (*pfilnum)++; /* *pfilnum = i + blknum*DIR_BLKSIZ + 1; */ + G.pInfo = &G.info[i]; +#ifdef NOVELL_BUG_FAILSAFE + G.dne = FALSE; /* assume file exists until stat() says otherwise */ +#endif + + /* if the target position is not within the current input buffer + * (either haven't yet read far enough, or (maybe) skipping back- + * ward), skip to the target position and reset readbuf(). */ + + /* seek_zipf(__G__ pInfo->offset); */ + request = G.pInfo->offset + G.extra_bytes; + inbuf_offset = request % INBUFSIZ; + bufstart = request - inbuf_offset; + + Trace((stderr, "\ndebug: request = %ld, inbuf_offset = %ld\n", + request, inbuf_offset)); + Trace((stderr, + "debug: bufstart = %ld, cur_zipfile_bufstart = %ld\n", + bufstart, G.cur_zipfile_bufstart)); + if (request < 0) { + Info(slide, 0x401, ((char *)slide, LoadFarStringSmall(SeekMsg), + G.zipfn, LoadFarString(ReportMsg))); + error_in_archive = PK_ERR; + if (*pfilnum == 1 && G.extra_bytes != 0L) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(AttemptRecompensate))); + *pold_extra_bytes = G.extra_bytes; + G.extra_bytes = 0L; + request = G.pInfo->offset; /* could also check if != 0 */ + inbuf_offset = request % INBUFSIZ; + bufstart = request - inbuf_offset; + Trace((stderr, "debug: request = %ld, inbuf_offset = %ld\n", + request, inbuf_offset)); + Trace((stderr, + "debug: bufstart = %ld, cur_zipfile_bufstart = %ld\n", + bufstart, G.cur_zipfile_bufstart)); + /* try again */ + if (request < 0) { + Trace((stderr, + "debug: recompensated request still < 0\n")); + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(SeekMsg), + G.zipfn, LoadFarString(ReportMsg))); + error_in_archive = PK_BADERR; + continue; + } + } else { + error_in_archive = PK_BADERR; + continue; /* this one hosed; try next */ + } + } + + if (bufstart != G.cur_zipfile_bufstart) { + Trace((stderr, "debug: bufstart != cur_zipfile_bufstart\n")); +#ifdef USE_STRM_INPUT + fseek((FILE *)G.zipfd, (LONGINT)bufstart, SEEK_SET); + G.cur_zipfile_bufstart = ftell((FILE *)G.zipfd); +#else /* !USE_STRM_INPUT */ + G.cur_zipfile_bufstart = + lseek(G.zipfd, (LONGINT)bufstart, SEEK_SET); +#endif /* ?USE_STRM_INPUT */ + if ((G.incnt = read(G.zipfd,(char *)G.inbuf,INBUFSIZ)) <= 0) + { + Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), + *pfilnum, "lseek", bufstart)); + error_in_archive = PK_BADERR; + continue; /* can still do next file */ + } + G.inptr = G.inbuf + (int)inbuf_offset; + G.incnt -= (int)inbuf_offset; + } else { + G.incnt += (int)(G.inptr-G.inbuf) - (int)inbuf_offset; + G.inptr = G.inbuf + (int)inbuf_offset; + } + + /* should be in proper position now, so check for sig */ + if (readbuf(__G__ G.sig, 4) == 0) { /* bad offset */ + Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), + *pfilnum, "EOF", request)); + error_in_archive = PK_BADERR; + continue; /* but can still try next one */ + } + if (strncmp(G.sig, local_hdr_sig, 4)) { + Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), + *pfilnum, LoadFarStringSmall(LocalHdrSig), request)); + /* + GRRDUMP(G.sig, 4) + GRRDUMP(local_hdr_sig, 4) + */ + error_in_archive = PK_ERR; + if ((*pfilnum == 1 && G.extra_bytes != 0L) || + (G.extra_bytes == 0L && *pold_extra_bytes != 0L)) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(AttemptRecompensate))); + if (G.extra_bytes) { + *pold_extra_bytes = G.extra_bytes; + G.extra_bytes = 0L; + } else + G.extra_bytes = *pold_extra_bytes; /* third attempt */ + if (((error = seek_zipf(__G__ G.pInfo->offset)) != PK_OK) || + (readbuf(__G__ G.sig, 4) == 0)) { /* bad offset */ + if (error != PK_BADERR) + Info(slide, 0x401, ((char *)slide, + LoadFarString(OffsetMsg), *pfilnum, "EOF", request)); + error_in_archive = PK_BADERR; + continue; /* but can still try next one */ + } + if (strncmp(G.sig, local_hdr_sig, 4)) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(OffsetMsg), *pfilnum, + LoadFarStringSmall(LocalHdrSig), request)); + error_in_archive = PK_BADERR; + continue; + } + } else + continue; /* this one hosed; try next */ + } + if ((error = process_local_file_hdr(__G)) != PK_COOL) { + Info(slide, 0x421, ((char *)slide, LoadFarString(BadLocalHdr), + *pfilnum)); + error_in_archive = error; /* only PK_EOF defined */ + continue; /* can still try next one */ + } + if ((error = do_string(__G__ G.lrec.filename_length, DS_FN_L)) != + PK_COOL) + { + if (error > error_in_archive) + error_in_archive = error; + if (error > PK_WARN) { + Info(slide, 0x401, ((char *)slide, LoadFarString(FilNamMsg), + FnFilter1(G.filename), "local")); + continue; /* go on to next one */ + } + } + if (G.extra_field != (uch *)NULL) { + free(G.extra_field); + G.extra_field = (uch *)NULL; + } + if ((error = + do_string(__G__ G.lrec.extra_field_length, EXTRA_FIELD)) != 0) + { + if (error > error_in_archive) + error_in_archive = error; + if (error > PK_WARN) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(ExtFieldMsg), + FnFilter1(G.filename), "local")); + continue; /* go on */ + } + } + +#if CRYPT + if (G.pInfo->encrypted && + (error = decrypt(__G__ uO.pwdarg)) != PK_COOL) { + if (error == PK_WARN) { + if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) + Info(slide, 0x401, ((char *)slide, + LoadFarString(SkipIncorrectPasswd), + FnFilter1(G.filename))); + ++(*pnum_bad_pwd); + } else { /* (error > PK_WARN) */ + if (error > error_in_archive) + error_in_archive = error; + Info(slide, 0x401, ((char *)slide, + LoadFarString(SkipCannotGetPasswd), + FnFilter1(G.filename))); + } + continue; /* go on to next file */ + } +#endif /* CRYPT */ + + /* + * just about to extract file: if extracting to disk, check if + * already exists, and if so, take appropriate action according to + * fflag/uflag/overwrite_all/etc. (we couldn't do this in upper + * loop because we don't store the possibly renamed filename[] in + * info[]) + */ +#ifdef DLL + if (!uO.tflag && !uO.cflag && !G.redirect_data) +#else + if (!uO.tflag && !uO.cflag) +#endif + { + renamed = FALSE; /* user hasn't renamed output file yet */ + +startover: + query = FALSE; + skip_entry = SKIP_NO; + /* for files from DOS FAT, check for use of backslash instead + * of slash as directory separator (bug in some zipper(s); so + * far, not a problem in HPFS, NTFS or VFAT systems) + */ +#ifndef SFX + if (G.pInfo->hostnum == FS_FAT_ && !MBSCHR(G.filename, '/')) { + char *p=G.filename; + + if (*p) do { + if (*p == '\\') { + if (!G.reported_backslash) { + Info(slide, 0x21, ((char *)slide, + LoadFarString(BackslashPathSep), G.zipfn)); + G.reported_backslash = TRUE; + if (!error_in_archive) + error_in_archive = PK_WARN; + } + *p = '/'; + } + } while (*PREINCSTR(p)); + } +#endif /* !SFX */ + + if (!renamed) { + /* remove absolute path specs */ + if (G.filename[0] == '/') { + Info(slide, 0x401, ((char *)slide, + LoadFarString(AbsolutePathWarning), + FnFilter1(G.filename))); + if (!error_in_archive) + error_in_archive = PK_WARN; + do { + char *p = G.filename + 1; + do { + *(p-1) = *p; + } while (*p++ != '\0'); + } while (G.filename[0] == '/'); + } + } + + /* mapname can create dirs if not freshening or if renamed */ + error = mapname(__G__ renamed); + if ((errcode = error & ~MPN_MASK) != PK_OK && + error_in_archive < errcode) + error_in_archive = errcode; + if ((errcode = error & MPN_MASK) > MPN_INF_TRUNC) { + if (errcode == MPN_CREATED_DIR) { +#ifdef SET_DIR_ATTRIB + dirtime *d_entry; + + d_entry = (dirtime *)malloc(sizeof(dirtime)); + if (d_entry == (dirtime *)NULL) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(DirlistEntryNoMem))); + } else { + unsigned eb_izux_flg; + + d_entry->next = (*pdirlist); + (*pdirlist) = d_entry; + (*pdirlist)->fn = + (char *)malloc(strlen(G.filename) + 1); + if ((*pdirlist)->fn == (char *)NULL) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(DirlistEntryNoMem))); + (*pdirlist) = d_entry->next; + free(d_entry); + if (!error_in_archive) + error_in_archive = PK_WARN; + continue; + } + strcpy((*pdirlist)->fn, G.filename); + (*pdirlist)->perms = G.pInfo->file_attr; +#ifdef USE_EF_UT_TIME + eb_izux_flg = G.extra_field? ef_scan_for_izux( + G.extra_field, G.lrec.extra_field_length, 0, + G.lrec.last_mod_dos_datetime, +#ifdef IZ_CHECK_TZ + (G.tz_is_valid ? &((*pdirlist)->u.t3) : NULL), +#else + &((*pdirlist)->u.t3), +#endif + (*pdirlist)->uidgid) + : 0; +#else /* !USE_EF_UT_TIME */ + eb_izux_flg = 0; +#endif /* ?USE_EF_UT_TIME */ + if (eb_izux_flg & EB_UT_FL_MTIME) { + TTrace((stderr, + "\nextract: Unix dir e.f. modtime = %ld\n", + (*pdirlist)->u.t3.mtime)); + } else { + (*pdirlist)->u.t3.mtime = dos_to_unix_time( + G.lrec.last_mod_dos_datetime); + } + if (eb_izux_flg & EB_UT_FL_ATIME) { + TTrace((stderr, + "\nextract: Unix dir e.f. actime = %ld\n", + (*pdirlist)->u.t3.atime)); + } else { + (*pdirlist)->u.t3.atime = + (*pdirlist)->u.t3.mtime; + } + (*pdirlist)->have_uidgid = +#ifdef RESTORE_UIDGID + (uO.X_flag && (eb_izux_flg & EB_UX2_VALID)); +#else + 0; +#endif + ++(*pnum_dirs); + } +#endif /* SET_DIR_ATTRIB */ + } else if (errcode == MPN_VOL_LABEL) { +#ifdef DOS_OS2_W32 + Info(slide, 0x401, ((char *)slide, + LoadFarString(SkipVolumeLabel), + FnFilter1(G.filename), + uO.volflag? "hard disk " : "")); +#else + Info(slide, 1, ((char *)slide, + LoadFarString(SkipVolumeLabel), + FnFilter1(G.filename), "")); +#endif + } else if (errcode > MPN_INF_SKIP && + error_in_archive < PK_ERR) + error_in_archive = PK_ERR; + Trace((stderr, "mapname(%s) returns error code = %d\n", + FnFilter1(G.filename), error)); + continue; /* go on to next file */ + } + +#ifdef QDOS + QFilename(__G__ G.filename); +#endif + switch (check_for_newer(__G__ G.filename)) { + case DOES_NOT_EXIST: +#ifdef NOVELL_BUG_FAILSAFE + G.dne = TRUE; /* stat() says file DOES NOT EXIST */ +#endif + /* freshen (no new files): skip unless just renamed */ + if (uO.fflag && !renamed) + skip_entry = SKIP_Y_NONEXIST; + break; + case EXISTS_AND_OLDER: +#ifdef UNIXBACKUP + if (!uO.B_flag) +#endif + { + if (IS_OVERWRT_NONE) + /* never overwrite: skip file */ + skip_entry = SKIP_Y_EXISTING; + else if (!IS_OVERWRT_ALL) + query = TRUE; + } + break; + case EXISTS_AND_NEWER: /* (or equal) */ +#ifdef UNIXBACKUP + if ((!uO.B_flag && IS_OVERWRT_NONE) || +#else + if (IS_OVERWRT_NONE || +#endif + (uO.uflag && !renamed)) { + /* skip if update/freshen & orig name */ + skip_entry = SKIP_Y_EXISTING; + } else { +#ifdef UNIXBACKUP + if (!IS_OVERWRT_ALL && !uO.B_flag) +#else + if (!IS_OVERWRT_ALL) +#endif + query = TRUE; + } + break; + } + if (query) { +#ifdef WINDLL + switch (G.lpUserFunctions->replace != NULL ? + (*G.lpUserFunctions->replace)(G.filename) : + IDM_REPLACE_NONE) { + case IDM_REPLACE_RENAME: + _ISO_INTERN(G.filename); + renamed = TRUE; + goto startover; + case IDM_REPLACE_ALL: + G.overwrite_mode = OVERWRT_ALWAYS; + /* FALL THROUGH, extract */ + case IDM_REPLACE_YES: + break; + case IDM_REPLACE_NONE: + G.overwrite_mode = OVERWRT_NEVER; + /* FALL THROUGH, skip */ + case IDM_REPLACE_NO: + skip_entry = SKIP_Y_EXISTING; + break; + } +#else /* !WINDLL */ + extent fnlen; +reprompt: + Info(slide, 0x81, ((char *)slide, + LoadFarString(ReplaceQuery), + FnFilter1(G.filename))); + if (fgets(G.answerbuf, 9, stdin) == (char *)NULL) { + Info(slide, 1, ((char *)slide, + LoadFarString(AssumeNone))); + *G.answerbuf = 'N'; + if (!error_in_archive) + error_in_archive = 1; /* not extracted: warning */ + } + switch (*G.answerbuf) { + case 'r': + case 'R': + do { + Info(slide, 0x81, ((char *)slide, + LoadFarString(NewNameQuery))); + fgets(G.filename, FILNAMSIZ, stdin); + /* usually get \n here: better check for it */ + fnlen = strlen(G.filename); + if (lastchar(G.filename, fnlen) == '\n') + G.filename[--fnlen] = '\0'; + } while (fnlen == 0); +#ifdef WIN32 /* WIN32 fgets( ... , stdin) returns OEM coded strings */ + _OEM_INTERN(G.filename); +#endif + renamed = TRUE; + goto startover; /* sorry for a goto */ + case 'A': /* dangerous option: force caps */ + G.overwrite_mode = OVERWRT_ALWAYS; + /* FALL THROUGH, extract */ + case 'y': + case 'Y': + break; + case 'N': + G.overwrite_mode = OVERWRT_NEVER; + /* FALL THROUGH, skip */ + case 'n': + /* skip file */ + skip_entry = SKIP_Y_EXISTING; + break; + default: + Info(slide, 1, ((char *)slide, + LoadFarString(InvalidResponse), *G.answerbuf)); + goto reprompt; /* yet another goto? */ + } /* end switch (*answerbuf) */ +#endif /* ?WINDLL */ + } /* end if (query) */ + if (skip_entry != SKIP_NO) { +#ifdef WINDLL + if (skip_entry == SKIP_Y_EXISTING) { + /* report skipping of an existing entry */ + Info(slide, 0, ((char *)slide, + ((IS_OVERWRT_NONE || !uO.uflag || renamed) ? + "Target file exists.\nSkipping %s\n" : + "Target file newer.\nSkipping %s\n"), + FnFilter1(G.filename))); + } +#endif /* WINDLL */ + continue; + } + } /* end if (extracting to disk) */ + +#ifdef DLL + if ((G.statreportcb != NULL) && + (*G.statreportcb)(__G__ UZ_ST_START_EXTRACT, G.zipfn, + G.filename, NULL)) { + return IZ_CTRLC; /* cancel operation by user request */ + } +#endif +#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ + UserStop(); +#endif +#ifdef AMIGA + G.filenote_slot = i; +#endif + G.disk_full = 0; + if ((error = extract_or_test_member(__G)) != PK_COOL) { + if (error > error_in_archive) + error_in_archive = error; /* ...and keep going */ +#ifdef DLL + if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) { +#else + if (G.disk_full > 1) { +#endif + return error_in_archive; /* (unless disk full) */ + } + } +#ifdef DLL + if ((G.statreportcb != NULL) && + (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn, + G.filename, (zvoid *)&G.lrec.ucsize)) { + return IZ_CTRLC; /* cancel operation by user request */ + } +#endif +#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ + UserStop(); +#endif + } /* end for-loop (i: files in current block) */ + + return error_in_archive; + +} /* end function extract_or_test_entrylist() */ + + + + + +/***************************************/ +/* Function extract_or_test_member() */ +/***************************************/ + +static int extract_or_test_member(__G) /* return PK-type error code */ + __GDEF +{ + char *nul="[empty] ", *txt="[text] ", *bin="[binary]"; +#ifdef CMS_MVS + char *ebc="[ebcdic]"; +#endif + register int b; + int r, error=PK_COOL; +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + ulg wsize; +#else +# define wsize WSIZE +#endif + + +/*--------------------------------------------------------------------------- + Initialize variables, buffers, etc. + ---------------------------------------------------------------------------*/ + + G.bits_left = 0; + G.bitbuf = 0L; /* unreduce and unshrink only */ + G.zipeof = 0; + G.newfile = TRUE; + G.crc32val = CRCVAL_INITIAL; + +#ifdef SYMLINKS + /* if file came from Unix and is a symbolic link and we are extracting + * to disk, prepare to restore the link */ + if (S_ISLNK(G.pInfo->file_attr) && + (G.pInfo->hostnum == UNIX_ || G.pInfo->hostnum == ATARI_ || + G.pInfo->hostnum == BEOS_) && + !uO.tflag && !uO.cflag && (G.lrec.ucsize > 0)) + G.symlnk = TRUE; + else + G.symlnk = FALSE; +#endif /* SYMLINKS */ + + if (uO.tflag) { + if (!uO.qflag) + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), "test", + FnFilter1(G.filename), "", "")); + } else { +#ifdef DLL + if (uO.cflag && !G.redirect_data) +#else + if (uO.cflag) +#endif + { +#if (defined(OS2) && defined(__IBMC__) && (__IBMC__ >= 200)) + G.outfile = freopen("", "wb", stdout); /* VAC++ ignores setmode */ +#else + G.outfile = stdout; +#endif +#ifdef DOS_FLX_NLM_OS2_W32 +#if (defined(__HIGHC__) && !defined(FLEXOS)) + setmode(G.outfile, _BINARY); +#else /* !(defined(__HIGHC__) && !defined(FLEXOS)) */ + setmode(fileno(G.outfile), O_BINARY); +#endif /* ?(defined(__HIGHC__) && !defined(FLEXOS)) */ +# define NEWLINE "\r\n" +#else /* !DOS_FLX_NLM_OS2_W32 */ +# define NEWLINE "\n" +#endif /* ?DOS_FLX_NLM_OS2_W32 */ +#ifdef VMS + if (open_outfile(__G)) /* VMS: required even for stdout! */ + return PK_DISK; +#endif + } else if (open_outfile(__G)) + return PK_DISK; + } + +/*--------------------------------------------------------------------------- + Unpack the file. + ---------------------------------------------------------------------------*/ + + defer_leftover_input(__G); /* so NEXTBYTE bounds check will work */ + switch (G.lrec.compression_method) { + case STORED: + if (!uO.tflag && QCOND2) { +#ifdef SYMLINKS + if (G.symlnk) /* can also be deflated, but rarer... */ + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), + "link", FnFilter1(G.filename), "", "")); + else +#endif /* SYMLINKS */ + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), + "extract", FnFilter1(G.filename), + (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? + "" : (G.lrec.ucsize == 0L? nul : (G.pInfo->textfile? txt : + bin)), uO.cflag? NEWLINE : "")); + } +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) { + wsize = G.redirect_size; redirSlide = G.redirect_buffer; + } else { + wsize = WSIZE; redirSlide = slide; + } +#endif + G.outptr = redirSlide; + G.outcnt = 0L; + while ((b = NEXTBYTE) != EOF) { + *G.outptr++ = (uch)b; + if (++G.outcnt == wsize) { + error = flush(__G__ redirSlide, G.outcnt, 0); + G.outptr = redirSlide; + G.outcnt = 0L; + if (error != PK_COOL || G.disk_full) break; + } + } + if (G.outcnt) /* flush final (partial) buffer */ + flush(__G__ redirSlide, G.outcnt, 0); + break; + +#ifndef SFX +#ifndef LZW_CLEAN + case SHRUNK: + if (!uO.tflag && QCOND2) { + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), + LoadFarStringSmall(Unshrink), FnFilter1(G.filename), + (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? + "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); + } + if ((r = unshrink(__G)) != PK_COOL) { + if (r < PK_DISK) { + if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipFile), + LoadFarString(NotEnoughMem), + LoadFarStringSmall2(Unshrink), + FnFilter1(G.filename))); + else + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipNoFile), + LoadFarString(NotEnoughMem), + LoadFarStringSmall2(Unshrink))); + } + error = r; + } + break; +#endif /* !LZW_CLEAN */ + +#ifndef COPYRIGHT_CLEAN + case REDUCED1: + case REDUCED2: + case REDUCED3: + case REDUCED4: + if (!uO.tflag && QCOND2) { + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), + "unreduc", FnFilter1(G.filename), + (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? + "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); + } + if ((r = unreduce(__G)) != PK_COOL) { + /* unreduce() returns only PK_COOL, PK_DISK, or IZ_CTRLC */ + error = r; + } + break; +#endif /* !COPYRIGHT_CLEAN */ + + case IMPLODED: + if (!uO.tflag && QCOND2) { + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), + "explod", FnFilter1(G.filename), + (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? + "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); + } + if (((r = explode(__G)) != 0) && (r != 5)) { /* treat 5 specially */ + if (r < PK_DISK) { + if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipFile), r == 3? + LoadFarString(NotEnoughMem) : + LoadFarString(InvalidComprData), + LoadFarStringSmall2(Explode), + FnFilter1(G.filename))); + else + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipNoFile), r == 3? + LoadFarString(NotEnoughMem) : + LoadFarString(InvalidComprData), + LoadFarStringSmall2(Explode))); + error = (r == 3)? PK_MEM3 : PK_ERR; + } else { + error = r; + } + } + if (r == 5) { + int warning = ((ulg)G.used_csize <= G.lrec.csize); + + if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) + Info(slide, 0x401, ((char *)slide, LoadFarString(LengthMsg), + "", warning? "warning" : "error", G.used_csize, + G.lrec.ucsize, warning? " " : "", G.lrec.csize, + " [", FnFilter1(G.filename), "]")); + else + Info(slide, 0x401, ((char *)slide, LoadFarString(LengthMsg), + "\n", warning? "warning" : "error", G.used_csize, + G.lrec.ucsize, warning? " ":"", G.lrec.csize, + "", "", ".")); + error = warning? PK_WARN : PK_ERR; + } + break; +#endif /* !SFX */ + + case DEFLATED: +#ifdef USE_DEFLATE64 + case ENHDEFLATED: +#endif + if (!uO.tflag && QCOND2) { + Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), + "inflat", FnFilter1(G.filename), + (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? + "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); + } +#ifndef USE_ZLIB /* zlib's function is called inflate(), too */ +# define UZinflate inflate_boinc +#endif + if ((r = UZinflate(__G__ + (G.lrec.compression_method == ENHDEFLATED))) + != 0) { + if (r < PK_DISK) { + if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipFile), r == 3? + LoadFarString(NotEnoughMem) : + LoadFarString(InvalidComprData), + LoadFarStringSmall2(Inflate), + FnFilter1(G.filename))); + else + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipNoFile), r == 3? + LoadFarString(NotEnoughMem) : + LoadFarString(InvalidComprData), + LoadFarStringSmall2(Inflate))); + error = (r == 3)? PK_MEM3 : PK_ERR; + } else { + error = r; + } + } + break; + + default: /* should never get to this point */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(FileUnknownCompMethod), FnFilter1(G.filename))); + /* close and delete file before return? */ + undefer_input(__G); + return PK_WARN; + + } /* end switch (compression method) */ + +/*--------------------------------------------------------------------------- + Close the file and set its date and time (not necessarily in that order), + and make sure the CRC checked out OK. Logical-AND the CRC for 64-bit + machines (redundant on 32-bit machines). + ---------------------------------------------------------------------------*/ + +#ifdef VMS /* VMS: required even for stdout! (final flush) */ + if (!uO.tflag) /* don't close NULL file */ + close_outfile(__G); +#else +#ifdef DLL + if (!uO.tflag && (!uO.cflag || G.redirect_data)) { + if (G.redirect_data) + FINISH_REDIRECT(); + else + close_outfile(__G); + } +#else + if (!uO.tflag && !uO.cflag) /* don't close NULL file or stdout */ + close_outfile(__G); +#endif +#endif /* VMS */ + + /* GRR: CONVERT close_outfile() TO NON-VOID: CHECK FOR ERRORS! */ + + + if (G.disk_full) { /* set by flush() */ + if (G.disk_full > 1) { +#if (defined(DELETE_IF_FULL) && defined(HAVE_UNLINK)) + /* delete the incomplete file if we can */ + if (unlink(G.filename) != 0) + Trace((stderr, "extract.c: could not delete %s\n", + FnFilter1(G.filename))); +#else + /* warn user about the incomplete file */ + Info(slide, 0x421, ((char *)slide, LoadFarString(FileTruncated), + FnFilter1(G.filename))); +#endif + error = PK_DISK; + } else { + error = PK_WARN; + } + } + + if (error > PK_WARN) {/* don't print redundant CRC error if error already */ + undefer_input(__G); + return error; + } + if (G.crc32val != G.lrec.crc32) { + /* if quiet enough, we haven't output the filename yet: do it */ + if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) + Info(slide, 0x401, ((char *)slide, "%-22s ", + FnFilter1(G.filename))); + Info(slide, 0x401, ((char *)slide, LoadFarString(BadCRC), G.crc32val, + G.lrec.crc32)); +#if CRYPT + if (G.pInfo->encrypted) + Info(slide, 0x401, ((char *)slide, LoadFarString(MaybeBadPasswd))); +#endif + error = PK_ERR; + } else if (uO.tflag) { +#ifndef SFX + if (G.extra_field) { + if ((r = TestExtraField(__G__ G.extra_field, + G.lrec.extra_field_length)) > error) + error = r; + } else +#endif /* !SFX */ + if (!uO.qflag) + Info(slide, 0, ((char *)slide, " OK\n")); + } else { + if (QCOND2 && !error) /* GRR: is stdout reset to text mode yet? */ + Info(slide, 0, ((char *)slide, "\n")); + } + + undefer_input(__G); + return error; + +} /* end function extract_or_test_member() */ + + + + + +#ifndef SFX + +/*******************************/ +/* Function TestExtraField() */ +/*******************************/ + +static int TestExtraField(__G__ ef, ef_len) + __GDEF + uch *ef; + unsigned ef_len; +{ + ush ebID; + unsigned ebLen; + unsigned eb_cmpr_offs = 0; + int r; + + /* we know the regular compressed file data tested out OK, or else we + * wouldn't be here ==> print filename if any extra-field errors found + */ + while (ef_len >= EB_HEADSIZE) { + ebID = makeword(ef); + ebLen = (unsigned)makeword(ef+EB_LEN); + + if (ebLen > (ef_len - EB_HEADSIZE)) { + /* Discovered some extra field inconsistency! */ + if (uO.qflag) + Info(slide, 1, ((char *)slide, "%-22s ", + FnFilter1(G.filename))); + Info(slide, 1, ((char *)slide, LoadFarString(InconsistEFlength), + ebLen, (ef_len - EB_HEADSIZE))); + return PK_ERR; + } + + switch (ebID) { + case EF_OS2: + case EF_ACL: + case EF_MAC3: + case EF_BEOS: + switch (ebID) { + case EF_OS2: + case EF_ACL: + eb_cmpr_offs = EB_OS2_HLEN; + break; + case EF_MAC3: + if (ebLen >= EB_MAC3_HLEN && + (makeword(ef+(EB_HEADSIZE+EB_FLGS_OFFS)) + & EB_M3_FL_UNCMPR) && + (makelong(ef+EB_HEADSIZE) == ebLen - EB_MAC3_HLEN)) + eb_cmpr_offs = 0; + else + eb_cmpr_offs = EB_MAC3_HLEN; + break; + case EF_BEOS: + if (ebLen >= EB_BEOS_HLEN && + (*(ef+(EB_HEADSIZE+EB_FLGS_OFFS)) & EB_BE_FL_UNCMPR) && + (makelong(ef+EB_HEADSIZE) == ebLen - EB_BEOS_HLEN)) + eb_cmpr_offs = 0; + else + eb_cmpr_offs = EB_BEOS_HLEN; + break; + } + if ((r = test_compr_eb(__G__ ef, ebLen, eb_cmpr_offs, NULL)) + != PK_OK) { + if (uO.qflag) + Info(slide, 1, ((char *)slide, "%-22s ", + FnFilter1(G.filename))); + switch (r) { + case IZ_EF_TRUNC: + Info(slide, 1, ((char *)slide, + LoadFarString(TruncEAs), + ebLen-(eb_cmpr_offs+EB_CMPRHEADLEN), "\n")); + break; + case PK_ERR: + Info(slide, 1, ((char *)slide, + LoadFarString(InvalidComprDataEAs))); + break; + case PK_MEM3: + case PK_MEM4: + Info(slide, 1, ((char *)slide, + LoadFarString(NotEnoughMemEAs))); + break; + default: + if ((r & 0xff) != PK_ERR) + Info(slide, 1, ((char *)slide, + LoadFarString(UnknErrorEAs))); + else { + ush m = (ush)(r >> 8); + if (m == DEFLATED) /* GRR KLUDGE! */ + Info(slide, 1, ((char *)slide, + LoadFarString(BadCRC_EAs))); + else + Info(slide, 1, ((char *)slide, + LoadFarString(UnknComprMethodEAs), m)); + } + break; + } + return r; + } + break; + + case EF_NTSD: + Trace((stderr, "ebID: %i / ebLen: %u\n", ebID, ebLen)); + r = ebLen < EB_NTSD_L_LEN ? IZ_EF_TRUNC : + ((ef[EB_HEADSIZE+EB_NTSD_VERSION] > EB_NTSD_MAX_VER) ? + (PK_WARN | 0x4000) : + test_compr_eb(__G__ ef, ebLen, EB_NTSD_L_LEN, PK_OK)); + //test_compr_eb(__G__ ef, ebLen, EB_NTSD_L_LEN, TEST_NTSD)); + if (r != PK_OK) { + if (uO.qflag) + Info(slide, 1, ((char *)slide, "%-22s ", + FnFilter1(G.filename))); + switch (r) { + case IZ_EF_TRUNC: + Info(slide, 1, ((char *)slide, + LoadFarString(TruncNTSD), + ebLen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), "\n")); + break; +#if (defined(WIN32) && defined(NTSD_EAS)) + case PK_WARN: + Info(slide, 1, ((char *)slide, + LoadFarString(InvalidSecurityEAs))); + break; +#endif + case PK_ERR: + Info(slide, 1, ((char *)slide, + LoadFarString(InvalidComprDataEAs))); + break; + case PK_MEM3: + case PK_MEM4: + Info(slide, 1, ((char *)slide, + LoadFarString(NotEnoughMemEAs))); + break; + case (PK_WARN | 0x4000): + Info(slide, 1, ((char *)slide, + LoadFarString(UnsuppNTSDVersEAs), + (int)ef[EB_HEADSIZE+EB_NTSD_VERSION])); + r = PK_WARN; + break; + default: + if ((r & 0xff) != PK_ERR) + Info(slide, 1, ((char *)slide, + LoadFarString(UnknErrorEAs))); + else { + ush m = (ush)(r >> 8); + if (m == DEFLATED) /* GRR KLUDGE! */ + Info(slide, 1, ((char *)slide, + LoadFarString(BadCRC_EAs))); + else + Info(slide, 1, ((char *)slide, + LoadFarString(UnknComprMethodEAs), m)); + } + break; + } + return r; + } + break; + case EF_PKVMS: + if (makelong(ef+EB_HEADSIZE) != + crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4), + (extent)(ebLen-4))) + Info(slide, 1, ((char *)slide, + LoadFarString(BadCRC_EAs))); + break; + case EF_PKW32: + case EF_PKUNIX: + case EF_ASIUNIX: + case EF_IZVMS: + case EF_IZUNIX: + case EF_VMCMS: + case EF_MVS: + case EF_SPARK: + case EF_TANDEM: + case EF_THEOS: + case EF_AV: + default: + break; + } + ef_len -= (ebLen + EB_HEADSIZE); + ef += (ebLen + EB_HEADSIZE); + } + + if (!uO.qflag) + Info(slide, 0, ((char *)slide, " OK\n")); + + return PK_COOL; + +} /* end function TestExtraField() */ + + + + + +/******************************/ +/* Function test_compr_eb() */ +/******************************/ + +#ifdef PROTO +static int test_compr_eb( + __GPRO__ + uch *eb, + unsigned eb_size, + unsigned compr_offset, + int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size, + uch *eb_ucptr, ulg eb_ucsize)) +#else /* !PROTO */ +static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata) + __GDEF + uch *eb; + unsigned eb_size; + unsigned compr_offset; + int (*test_uc_ebdata)(); +#endif /* ?PROTO */ +{ + ulg eb_ucsize; + uch *eb_ucptr; + int r; + + if (compr_offset < 4) /* field is not compressed: */ + return PK_OK; /* do nothing and signal OK */ + + if ((eb_size < (EB_UCSIZE_P + 4)) || + ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L && + eb_size <= (compr_offset + EB_CMPRHEADLEN))) + return IZ_EF_TRUNC; /* no compressed data! */ + + if ((eb_ucptr = (uch *)malloc((extent)eb_ucsize)) == (uch *)NULL) + return PK_MEM4; + + r = memextract(__G__ eb_ucptr, eb_ucsize, + eb + (EB_HEADSIZE + compr_offset), + (ulg)(eb_size - compr_offset)); + + if (r == PK_OK && test_uc_ebdata != NULL) + r = (*test_uc_ebdata)(__G__ eb, eb_size, eb_ucptr, eb_ucsize); + + free(eb_ucptr); + return r; + +} /* end function test_compr_eb() */ + +#endif /* !SFX */ + + + + + +/***************************/ +/* Function memextract() */ +/***************************/ + +int memextract(__G__ tgt, tgtsize, src, srcsize) /* extract compressed */ + __GDEF /* extra field block; */ + uch *tgt; /* return PK-type error */ + ulg tgtsize; /* level */ + ZCONST uch *src; + ulg srcsize; +{ + long old_csize=G.csize; + uch *old_inptr=G.inptr; + int old_incnt=G.incnt; + int r, error=PK_OK; + ush method; + ulg extra_field_crc; + + + method = makeword(src); + extra_field_crc = makelong(src+2); + + /* compressed extra field exists completely in memory at this location: */ + G.inptr = (uch *)src + (2 + 4); /* method and extra_field_crc */ + G.incnt = (int)(G.csize = (long)(srcsize - (2 + 4))); + G.mem_mode = TRUE; + G.outbufptr = tgt; + G.outsize = tgtsize; + + switch (method) { + case STORED: + memcpy((char *)tgt, (char *)G.inptr, (extent)G.incnt); + G.outcnt = G.csize; /* for CRC calculation */ + break; + case DEFLATED: +#ifdef USE_DEFLATE64 + case ENHDEFLATED: +#endif + G.outcnt = 0L; + if ((r = UZinflate(__G__ (method == ENHDEFLATED))) != 0) { + if (!uO.tflag) + Info(slide, 0x401, ((char *)slide, + LoadFarStringSmall(ErrUnzipNoFile), r == 3? + LoadFarString(NotEnoughMem) : + LoadFarString(InvalidComprData), + LoadFarStringSmall2(Inflate))); + error = (r == 3)? PK_MEM3 : PK_ERR; + } + if (G.outcnt == 0L) /* inflate's final FLUSH sets outcnt */ + break; + break; + default: + if (uO.tflag) + error = PK_ERR | ((int)method << 8); + else { + Info(slide, 0x401, ((char *)slide, + LoadFarString(UnsupportedExtraField), method)); + error = PK_ERR; /* GRR: should be passed on up via SetEAs() */ + } + break; + } + + G.inptr = old_inptr; + G.incnt = old_incnt; + G.csize = old_csize; + G.mem_mode = FALSE; + + if (!error) { + register ulg crcval = crc32(CRCVAL_INITIAL, tgt, (extent)G.outcnt); + + if (crcval != extra_field_crc) { + if (uO.tflag) + error = PK_ERR | (DEFLATED << 8); /* kludge for now */ + else { + Info(slide, 0x401, ((char *)slide, + LoadFarString(BadExtraFieldCRC), G.zipfn, crcval, + extra_field_crc)); + error = PK_ERR; + } + } + } + return error; + +} /* end function memextract() */ + + + + + +/*************************/ +/* Function memflush() */ +/*************************/ + +int memflush(__G__ rawbuf, size) + __GDEF + ZCONST uch *rawbuf; + ulg size; +{ + if (size > G.outsize) + /* Here, PK_DISK is a bit off-topic, but in the sense of marking + "overflow of output space", its use may be tolerated. */ + return PK_DISK; /* more data than output buffer can hold */ + + + + memcpy((char *)G.outbufptr, (char *)rawbuf, (extent)size); + G.outbufptr += (unsigned int)size; + G.outsize -= size; + G.outcnt += size; + + return 0; + +} /* end function memflush() */ + + + + + +#if (defined(VMS) || defined(VMS_TEXT_CONV)) + +/************************************/ +/* Function extract_izvms_block() */ +/************************************/ + +/* + * Extracts block from p. If resulting length is less then needed, fill + * extra space with corresponding bytes from 'init'. + * Currently understands 3 formats of block compression: + * - Simple storing + * - Compression of zero bytes to zero bits + * - Deflation (see memextract()) + * The IZVMS block data is returned in malloc'd space. + */ +uch *extract_izvms_block(__G__ ebdata, size, retlen, init, needlen) + __GDEF + ZCONST uch *ebdata; + unsigned size; + unsigned *retlen; + ZCONST uch *init; + unsigned needlen; +{ + uch *ucdata; /* Pointer to block allocated */ + int cmptype; + unsigned usiz, csiz; + + cmptype = (makeword(ebdata+EB_IZVMS_FLGS) & EB_IZVMS_BCMASK); + csiz = size - EB_IZVMS_HLEN; + usiz = (cmptype == EB_IZVMS_BCSTOR ? + csiz : makeword(ebdata+EB_IZVMS_UCSIZ)); + + if (retlen) + *retlen = usiz; + + if ((ucdata = (uch *)malloc(MAX(needlen, usiz))) == NULL) + return NULL; + + if (init && (usiz < needlen)) + memcpy((char *)ucdata, (ZCONST char *)init, needlen); + + switch (cmptype) + { + case EB_IZVMS_BCSTOR: /* The simplest case */ + memcpy(ucdata, ebdata+EB_IZVMS_HLEN, usiz); + break; + case EB_IZVMS_BC00: + decompress_bits(ucdata, usiz, ebdata+EB_IZVMS_HLEN); + break; + case EB_IZVMS_BCDEFL: + memextract(__G__ ucdata, (ulg)usiz, + ebdata+EB_IZVMS_HLEN, (ulg)csiz); + break; + default: + free(ucdata); + ucdata = NULL; + } + return ucdata; + +} /* end of extract_izvms_block */ + + + + + +/********************************/ +/* Function decompress_bits() */ +/********************************/ +/* + * Simple uncompression routine. The compression uses bit stream. + * Compression scheme: + * + * if (byte!=0) + * putbit(1),putbyte(byte) + * else + * putbit(0) + */ +static void decompress_bits(outptr, needlen, bitptr) + uch *outptr; /* Pointer into output block */ + unsigned needlen; /* Size of uncompressed block */ + ZCONST uch *bitptr; /* Pointer into compressed data */ +{ + ulg bitbuf = 0; + int bitcnt = 0; + +#define _FILL { bitbuf |= (*bitptr++) << bitcnt;\ + bitcnt += 8; \ + } + + while (needlen--) + { + if (bitcnt <= 0) + _FILL; + + if (bitbuf & 1) + { + bitbuf >>= 1; + if ((bitcnt -= 1) < 8) + _FILL; + *outptr++ = (uch)bitbuf; + bitcnt -= 8; + bitbuf >>= 8; + } + else + { + *outptr++ = '\0'; + bitcnt -= 1; + bitbuf >>= 1; + } + } +} /* end function decompress_bits() */ + +#endif /* VMS || VMS_TEXT_CONV */ + + + + + +/*************************/ +/* Function fnfilter() */ /* here instead of in list.c for SFX */ +/*************************/ + +char *fnfilter(raw, space) /* convert name to safely printable form */ + ZCONST char *raw; + uch *space; +{ +#ifndef NATIVE /* ASCII: filter ANSI escape codes, etc. */ + ZCONST uch *r=(ZCONST uch *)raw; + uch *s=space; + + while (*r) { +#ifdef QDOS + if (qlflag & 2) { + if (*r == '/' || *r == '.') { + ++r; + *s++ = '_'; + continue; + } + } else +#endif + if (*r < 32) { + *s++ = '^', *s++ = (uch)(64 + *r++); + } else { +#ifdef _MBCS + unsigned i; + for (i = CLEN(r); i > 0; i--) + *s++ = *r++; +#else + *s++ = *r++; +#endif + } + } + *s = '\0'; + +#ifdef WINDLL + INTERN_TO_ISO((char *)space, (char *)space); /* translate to ANSI */ +#else +#ifdef WIN32 + /* Win9x console always uses OEM character coding, and + WinNT console is set to OEM charset by default, too */ + INTERN_TO_OEM((char *)space, (char *)space); +#endif /* WIN32 */ +#endif /* ?WINDLL */ + + return (char *)space; + +#else /* NATIVE: EBCDIC or whatever */ + return (char *)raw; +#endif + +} /* end function fnfilter() */ + + + + + +#ifdef SET_DIR_ATTRIB +/* must sort saved directories so can set perms from bottom up */ + +/************************/ +/* Function dircomp() */ +/************************/ + +static int dircomp(a, b) /* used by qsort(); swiped from Zip */ + ZCONST zvoid *a, *b; +{ + /* order is significant: this sorts in reverse order (deepest first) */ + return strcmp((*(dirtime **)b)->fn, (*(dirtime **)a)->fn); + /* return namecmp((*(dirtime **)b)->fn, (*(dirtime **)a)->fn); */ +} + + + +#if 0 /* not used in Unix, but maybe for future OSes? */ + +/************************/ +/* Function namecmp() */ +/************************/ + +static int namecmp(s1, s2) /* [not] used by dircomp(); swiped from Zip */ + ZCONST char *s1, *s2; +{ + int d; + + for (;;) { + d = (int)(uch)case_map(*s1) + - (int)(uch)case_map(*s2); + + if (d || *s1 == 0 || *s2 == 0) + return d; + + s1++; + s2++; + } +} + +#endif /* 0 */ +#endif /* SET_DIR_ATTRIB */ + +const char *BOINC_RCSID_909bf7f202 = "$Id: extract.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/file_id.diz boinc-7.0.14+dfsg/zip/unzip/file_id.diz --- boinc-7.0.7+dfsg/zip/unzip/file_id.diz 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/file_id.diz 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,10 @@ +Info-ZIP's UnZip 5.5: generic C sources + Complete C source code for Info-ZIP's + PKUNZIP-compatible .zip extractor, for + all supported compilers and platforms + (Unix, OS/2, MS-DOS, NT, VMS, Amiga, + Atari, Mac, Acorn, VM/CMS, etc.), plus + lots of pretty decent documentation. +This is FREE (but copyrighted) software. +See LICENSE for details on distribution +and reuse. diff -Nru boinc-7.0.7+dfsg/zip/unzip/fileio.c boinc-7.0.14+dfsg/zip/unzip/fileio.c --- boinc-7.0.7+dfsg/zip/unzip/fileio.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/fileio.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,2536 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + fileio.c + + This file contains routines for doing direct but relatively generic input/ + output, file-related sorts of things, plus some miscellaneous stuff. Most + of the stuff has to do with opening, closing, reading and/or writing files. + + Contains: open_input_file() + open_outfile() (not: VMS, AOS/VS, CMSMVS, MACOS, TANDEM) + undefer_input() + defer_leftover_input() + readbuf() + readbyte() + fillinbuf() + seek_zipf() + flush() (non-VMS) + is_vms_varlen_txt() (non-VMS, VMS_TEXT_CONV only) + disk_error() (non-VMS) + UzpMessagePrnt() + UzpMessageNull() (DLL only) + UzpInput() + UzpMorePause() + UzpPassword() (non-WINDLL) + handler() + dos_to_unix_time() (non-VMS, non-VM/CMS, non-MVS) + check_for_newer() (non-VMS, non-OS/2, non-VM/CMS, non-MVS) + do_string() + makeword() + makelong() + str2iso() (CRYPT && NEED_STR2ISO, only) + str2oem() (CRYPT && NEED_STR2OEM, only) + memset() (ZMEM only) + memcpy() (ZMEM only) + zstrnicmp() (NO_STRNICMP only) + zstat() (REGULUS only) + plastchar() (_MBCS only) + uzmbschr() (_MBCS && NEED_UZMBSCHR, only) + uzmbsrchr() (_MBCS && NEED_UZMBSRCHR, only) + fLoadFarString() (SMALL_MEM only) + fLoadFarStringSmall() (SMALL_MEM only) + fLoadFarStringSmall2() (SMALL_MEM only) + zfstrcpy() (SMALL_MEM only) + + ---------------------------------------------------------------------------*/ + + +#define __FILEIO_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" +//#ifdef WINDLL +//# include "windll/windll.h" +//# include +//#endif +//#ifdef CRYPT +//#include "crypt.h" +//#endif +#undef CRYPT +#include "ttyio.h" + +/* setup of codepage conversion for decryption passwords */ +#if CRYPT +# if (defined(CRYP_USES_ISO2OEM) && !defined(IZ_ISO2OEM_ARRAY)) +# define IZ_ISO2OEM_ARRAY /* pull in iso2oem[] table */ +# endif +# if (defined(CRYP_USES_OEM2ISO) && !defined(IZ_OEM2ISO_ARRAY)) +# define IZ_OEM2ISO_ARRAY /* pull in oem2iso[] table */ +# endif +#endif +#include "ebcdic.h" /* definition/initialization of ebcdic[] */ + + +/* + Note: Under Windows, the maximum size of the buffer that can be used + with any of the *printf calls is 16,384, so win_fprintf was used to + feed the fprintf clone no more than 16K chunks at a time. This should + be valid for anything up to 64K (and probably beyond, assuming your + buffers are that big). +*/ +#ifdef WINDLL +# define WriteError(buf,len,strm) \ + (win_fprintf(pG, strm, (extent)len, (char far *)buf) != (int)(len)) +#else /* !WINDLL */ +# ifdef USE_FWRITE +# define WriteError(buf,len,strm) \ + ((extent)fwrite((char *)(buf),1,(extent)(len),strm) != (extent)(len)) +# else +# define WriteError(buf,len,strm) \ + ((extent)write(fileno(strm),(char *)(buf),(extent)(len)) != (extent)(len)) +# endif +#endif /* ?WINDLL */ + +#if (defined(USE_DEFLATE64) && defined(__16BIT__)) +static int partflush OF((__GPRO__ uch *rawbuf, ulg size, int unshrink)); +#endif +#ifdef VMS_TEXT_CONV +static int is_vms_varlen_txt OF((__GPRO__ uch *ef_buf, unsigned ef_len)); +#endif +static int disk_error OF((__GPRO)); + + +/****************************/ +/* Strings used in fileio.c */ +/****************************/ + +static ZCONST char Far CannotOpenZipfile[] = + "error: cannot open zipfile [ %s ]\n"; + +#if (!defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)) +#if (!defined(TANDEM)) +#if (defined(BEO_THS_UNX) || defined(DOS_FLX_NLM_OS2_W32)) + static ZCONST char Far CannotDeleteOldFile[] = + "error: cannot delete old %s\n"; +#ifdef UNIXBACKUP + static ZCONST char Far CannotRenameOldFile[] = + "error: cannot rename old %s\n"; + static ZCONST char Far BackupSuffix[] = "~"; +#endif +#endif /* BEO_THS_UNX || DOS_FLX_NLM_OS2_W32 */ +#ifdef NOVELL_BUG_FAILSAFE + static ZCONST char Far NovellBug[] = + "error: %s: stat() says does not exist, but fopen() found anyway\n"; +#endif + static ZCONST char Far CannotCreateFile[] = "error: cannot create %s\n"; +#endif /* !TANDEM */ +#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */ + +static ZCONST char Far ReadError[] = "error: zipfile read error\n"; +static ZCONST char Far FilenameTooLongTrunc[] = + "warning: filename too long--truncating.\n"; +static ZCONST char Far ExtraFieldTooLong[] = + "warning: extra field too long (%d). Ignoring...\n"; + +#ifdef WINDLL + static ZCONST char Far DiskFullQuery[] = + "%s: write error (disk full?).\n"; +#else + static ZCONST char Far DiskFullQuery[] = + "%s: write error (disk full?). Continue? (y/n/^C) "; + static ZCONST char Far ZipfileCorrupt[] = + "error: zipfile probably corrupt (%s)\n"; +# ifdef SYMLINKS + static ZCONST char Far FileIsSymLink[] = + "%s exists and is a symbolic link%s.\n"; +# endif +# ifdef MORE + static ZCONST char Far MorePrompt[] = "--More--(%lu)"; +# endif + static ZCONST char Far QuitPrompt[] = + "--- Press `Q' to quit, or any other key to continue ---"; + static ZCONST char Far HidePrompt[] = /* "\r \r"; */ + "\r \r"; +# if CRYPT +# ifdef MACOS + /* SPC: are names on MacOS REALLY so much longer than elsewhere ??? */ + static ZCONST char Far PasswPrompt[] = "[%s]\n %s password: "; +# else + static ZCONST char Far PasswPrompt[] = "[%s] %s password: "; +# endif + static ZCONST char Far PasswPrompt2[] = "Enter password: "; + static ZCONST char Far PasswRetry[] = "password incorrect--reenter: "; +# endif /* CRYPT */ +#endif /* !WINDLL */ + + + + + +/******************************/ +/* Function open_input_file() */ +/******************************/ + +int open_input_file(__G) /* return 1 if open failed */ + __GDEF +{ + /* + * open the zipfile for reading and in BINARY mode to prevent cr/lf + * translation, which would corrupt the bitstreams + */ + +#ifdef VMS + G.zipfd = open(G.zipfn, O_RDONLY, 0, "ctx=stm"); +#else /* !VMS */ +#ifdef MACOS + G.zipfd = open(G.zipfn, 0); +#else /* !MACOS */ +#ifdef CMS_MVS + G.zipfd = vmmvs_open_infile(__G); +#else /* !CMS_MVS */ +#ifdef USE_STRM_INPUT + G.zipfd = fopen(G.zipfn, FOPR); +#else /* !USE_STRM_INPUT */ +# ifdef O_BINARY + G.zipfd = open(G.zipfn, O_RDONLY | O_BINARY); +# else + G.zipfd = open(G.zipfn, O_RDONLY); +# endif +#endif /* ?USE_STRM_INPUT */ +#endif /* ?CMS_MVS */ +#endif /* ?MACOS */ +#endif /* ?VMS */ + +#ifdef USE_STRM_INPUT + if (G.zipfd == NULL) +#else + /* if (G.zipfd < 0) */ /* no good for Windows CE port */ + if (G.zipfd == -1) +#endif + { + Info(slide, 0x401, ((char *)slide, LoadFarString(CannotOpenZipfile), + G.zipfn)); + return 1; + } + return 0; + +} /* end function open_input_file() */ + + + + +#if (!defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)) +#if (!defined(TANDEM)) + +/***************************/ +/* Function open_outfile() */ +/***************************/ + +int open_outfile(__G) /* return 1 if fail */ + __GDEF +{ +#ifdef DLL + if (G.redirect_data) + return (redirect_outfile(__G) == FALSE); +#endif +#ifdef QDOS + QFilename(__G__ G.filename); +#endif +#if (defined(DOS_FLX_NLM_OS2_W32) || defined(BEO_THS_UNX)) +#ifdef BORLAND_STAT_BUG + /* Borland 5.0's stat() barfs if the filename has no extension and the + * file doesn't exist. */ + if (access(G.filename, 0) == -1) { + FILE *tmp = fopen(G.filename, "wb+"); + + /* file doesn't exist, so create a dummy file to keep stat() from + * failing (will be over-written anyway) */ + fputc('0', tmp); /* just to have something in the file */ + fclose(tmp); + } +#endif /* BORLAND_STAT_BUG */ +#ifdef SYMLINKS + if (SSTAT(G.filename, &G.statbuf) == 0 || lstat(G.filename,&G.statbuf) == 0) +#else + if (SSTAT(G.filename, &G.statbuf) == 0) +#endif /* ?SYMLINKS */ + { + Trace((stderr, "open_outfile: stat(%s) returns 0: file exists\n", + FnFilter1(G.filename))); +#ifdef UNIXBACKUP + if (uO.B_flag) { /* do backup */ + char *tname; + struct stat tmpstat; + int blen, flen, tlen; + + blen = strlen(BackupSuffix); + flen = strlen(G.filename); + tlen = flen + blen + 6; /* includes space for 5 digits */ + if (tlen >= FILNAMSIZ) { /* in case name is too long, truncate */ + tname = (char *)malloc(FILNAMSIZ); + if (tname == NULL) + return 1; /* in case we run out of space */ + tlen = FILNAMSIZ - 1 - blen; + strcpy(tname, G.filename); /* make backup name */ + tname[tlen] = '\0'; + if (flen > tlen) flen = tlen; + tlen = FILNAMSIZ; + } else { + tname = (char *)malloc(tlen); + if (tname == NULL) + return 1; /* in case we run out of space */ + strcpy(tname, G.filename); /* make backup name */ + } + strcpy(tname+flen, BackupSuffix); + + if (IS_OVERWRT_ALL) { + /* If there is a previous backup file, delete it, + * otherwise the following rename operation may fail. + */ + if (SSTAT(tname, &tmpstat) == 0) + unlink(tname); + } else { + /* Check if backupname exists, and, if it's true, try + * appending numbers of up to 5 digits to the BackupSuffix, + * until an unused name is found. + */ + unsigned maxtail, i; + char *numtail = tname + flen + blen; + + maxtail = 65535; + switch (tlen - flen - blen - 1) { + case 4: maxtail = 9999; break; + case 3: maxtail = 999; break; + case 2: maxtail = 99; break; + case 1: maxtail = 9; break; + case 0: maxtail = 0; break; + } + /* while filename exists */ + for (i = 0; (i <= maxtail) && (SSTAT(tname, &tmpstat) == 0);) + sprintf(numtail,"%u", ++i); + } + + if (rename(G.filename, tname) != 0) { /* move file */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(CannotRenameOldFile), FnFilter1(G.filename))); + free(tname); + return 1; + } + Trace((stderr, "open_outfile: %s now renamed into %s\n", + FnFilter1(G.filename), FnFilter2(tname))); + free(tname); + } else +#endif /* UNIXBACKUP */ + { +#ifdef DOS_FLX_OS2_W32 + if (!(G.statbuf.st_mode & S_IWRITE)) { + Trace((stderr, + "open_outfile: existing file %s is read-only\n", + FnFilter1(G.filename))); + chmod(G.filename, S_IREAD | S_IWRITE); + Trace((stderr, "open_outfile: %s now writable\n", + FnFilter1(G.filename))); + } +#endif /* DOS_FLX_OS2_W32 */ +#ifdef NLM + /* Give the file read/write permission (non-POSIX shortcut) */ + chmod(G.filename, 0); +#endif /* NLM */ + if (unlink(G.filename) != 0) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(CannotDeleteOldFile), FnFilter1(G.filename))); + return 1; + } + Trace((stderr, "open_outfile: %s now deleted\n", + FnFilter1(G.filename))); + } + } +#endif /* DOS_FLX_NLM_OS2_W32 || BEO_THS_UNX */ +#ifdef RISCOS + if (SWI_OS_File_7(G.filename,0xDEADDEAD,0xDEADDEAD,G.lrec.ucsize)!=NULL) { + Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), + FnFilter1(G.filename))); + return 1; + } +#endif /* RISCOS */ +#ifdef TOPS20 + char *tfilnam; + + if ((tfilnam = (char *)malloc(2*strlen(G.filename)+1)) == (char *)NULL) + return 1; + strcpy(tfilnam, G.filename); + upper(tfilnam); + enquote(tfilnam); + if ((G.outfile = fopen(tfilnam, FOPW)) == (FILE *)NULL) { + Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), + tfilnam)); + free(tfilnam); + return 1; + } + free(tfilnam); +#else /* !TOPS20 */ +#ifdef MTS + if (uO.aflag) + G.outfile = fopen(G.filename, FOPWT); + else + G.outfile = fopen(G.filename, FOPW); + if (G.outfile == (FILE *)NULL) { + Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), + FnFilter1(G.filename))); + return 1; + } +#else /* !MTS */ +#ifdef DEBUG + Info(slide, 1, ((char *)slide, + "open_outfile: doing fopen(%s) for reading\n", FnFilter1(G.filename))); + if ((G.outfile = fopen(G.filename, FOPR)) == (FILE *)NULL) + Info(slide, 1, ((char *)slide, + "open_outfile: fopen(%s) for reading failed: does not exist\n", + FnFilter1(G.filename))); + else { + Info(slide, 1, ((char *)slide, + "open_outfile: fopen(%s) for reading succeeded: file exists\n", + FnFilter1(G.filename))); + fclose(G.outfile); + } +#endif /* DEBUG */ +#ifdef NOVELL_BUG_FAILSAFE + if (G.dne && ((G.outfile = fopen(G.filename, FOPR)) != (FILE *)NULL)) { + Info(slide, 0x401, ((char *)slide, LoadFarString(NovellBug), + FnFilter1(G.filename))); + fclose(G.outfile); + return 1; /* with "./" fix in checkdir(), should never reach here */ + } +#endif /* NOVELL_BUG_FAILSAFE */ + Trace((stderr, "open_outfile: doing fopen(%s) for writing\n", + FnFilter1(G.filename))); + if ((G.outfile = fopen(G.filename, FOPW)) == (FILE *)NULL) { + Info(slide, 0x401, ((char *)slide, LoadFarString(CannotCreateFile), + FnFilter1(G.filename))); + return 1; + } + Trace((stderr, "open_outfile: fopen(%s) for writing succeeded\n", + FnFilter1(G.filename))); +#endif /* !MTS */ +#endif /* !TOPS20 */ + +#ifdef USE_FWRITE +#ifdef DOS_NLM_OS2_W32 + /* 16-bit MSC: buffer size must be strictly LESS than 32K (WSIZE): bogus */ + setbuf(G.outfile, (char *)NULL); /* make output unbuffered */ +#else /* !DOS_NLM_OS2_W32 */ +#ifndef RISCOS +#ifdef _IOFBF /* make output fully buffered (works just about like write()) */ + setvbuf(G.outfile, (char *)slide, _IOFBF, WSIZE); +#else + setbuf(G.outfile, (char *)slide); +#endif +#endif /* !RISCOS */ +#endif /* ?DOS_NLM_OS2_W32 */ +#endif /* USE_FWRITE */ +#ifdef OS2_W32 + /* preallocate the final file size to prevent file fragmentation */ + SetFileSize(G.outfile, G.pInfo->uncompr_size); +#endif + return 0; + +} /* end function open_outfile() */ + +#endif /* !TANDEM */ +#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */ + + + + + +/* + * These functions allow NEXTBYTE to function without needing two bounds + * checks. Call defer_leftover_input() if you ever have filled G.inbuf + * by some means other than readbyte(), and you then want to start using + * NEXTBYTE. When going back to processing bytes without NEXTBYTE, call + * undefer_input(). For example, extract_or_test_member brackets its + * central section that does the decompression with these two functions. + * If you need to check the number of bytes remaining in the current + * file while using NEXTBYTE, check (G.csize + G.incnt), not G.csize. + */ + +/****************************/ +/* function undefer_input() */ +/****************************/ + +void undefer_input(__G) + __GDEF +{ + if (G.incnt > 0) + G.csize += G.incnt; + if (G.incnt_leftover > 0) { + /* We know that "(G.csize < MAXINT)" so we can cast G.csize to int: + * This condition was checked when G.incnt_leftover was set > 0 in + * defer_leftover_input(), and it is NOT allowed to touch G.csize + * before calling undefer_input() when (G.incnt_leftover > 0) + * (single exception: see read_byte()'s "G.csize <= 0" handling) !! + */ + G.incnt = G.incnt_leftover + (int)G.csize; + G.inptr = G.inptr_leftover - (int)G.csize; + G.incnt_leftover = 0; + } else if (G.incnt < 0) + G.incnt = 0; +} /* end function undefer_input() */ + + + + + +/***********************************/ +/* function defer_leftover_input() */ +/***********************************/ + +void defer_leftover_input(__G) + __GDEF +{ + if ((long)G.incnt > G.csize) { + /* (G.csize < MAXINT), we can safely cast it to int !! */ + if (G.csize < 0L) + G.csize = 0L; + G.inptr_leftover = G.inptr + (int)G.csize; + G.incnt_leftover = G.incnt - (int)G.csize; + G.incnt = (int)G.csize; + } else + G.incnt_leftover = 0; + G.csize -= G.incnt; +} /* end function defer_leftover_input() */ + + + + + +/**********************/ +/* Function readbuf() */ +/**********************/ + +unsigned readbuf(__G__ buf, size) /* return number of bytes read into buf */ + __GDEF + char *buf; + register unsigned size; +{ + register unsigned count; + unsigned n; + + n = size; + while (size) { + if (G.incnt <= 0) { + if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) + return (n-size); + else if (G.incnt < 0) { + /* another hack, but no real harm copying same thing twice */ + (*G.message)((zvoid *)&G, + (uch *)LoadFarString(ReadError), /* CANNOT use slide */ + (ulg)strlen(LoadFarString(ReadError)), 0x401); + return 0; /* discarding some data; better than lock-up */ + } + /* buffer ALWAYS starts on a block boundary: */ + G.cur_zipfile_bufstart += INBUFSIZ; + G.inptr = G.inbuf; + } + count = MIN(size, (unsigned)G.incnt); + memcpy(buf, G.inptr, count); + buf += count; + G.inptr += count; + G.incnt -= count; + size -= count; + } + return n; + +} /* end function readbuf() */ + + + + + +/***********************/ +/* Function readbyte() */ +/***********************/ + +int readbyte(__G) /* refill inbuf and return a byte if available, else EOF */ + __GDEF +{ + if (G.mem_mode) + return EOF; + if (G.csize <= 0) { + G.csize--; /* for tests done after exploding */ + G.incnt = 0; + return EOF; + } + if (G.incnt <= 0) { + if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) { + G.incnt = 0; /* do not allow negative value to affect stuff */ + return EOF; + } else if (G.incnt < 0) { /* "fail" (abort, retry, ...) returns this */ + /* another hack, but no real harm copying same thing twice */ + (*G.message)((zvoid *)&G, + (uch *)LoadFarString(ReadError), + (ulg)strlen(LoadFarString(ReadError)), 0x401); + echon(); +#ifdef WINDLL + longjmp(dll_error_return, 1); +#else + DESTROYGLOBALS(); + EXIT(PK_BADERR); /* totally bailing; better than lock-up */ +#endif + } + G.cur_zipfile_bufstart += INBUFSIZ; /* always starts on block bndry */ + G.inptr = G.inbuf; + defer_leftover_input(__G); /* decrements G.csize */ + } + +#if CRYPT + if (G.pInfo->encrypted) { + uch *p; + int n; + + /* This was previously set to decrypt one byte beyond G.csize, when + * incnt reached that far. GRR said, "but it's required: why?" This + * was a bug in fillinbuf() -- was it also a bug here? + */ + for (n = G.incnt, p = G.inptr; n--; p++) + zdecode(*p); + } +#endif /* CRYPT */ + + --G.incnt; + return *G.inptr++; + +} /* end function readbyte() */ + + + + + +#ifdef USE_ZLIB + +/************************/ +/* Function fillinbuf() */ +/************************/ + +int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */ + __GDEF +{ + if (G.mem_mode || + (G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) + return 0; + G.cur_zipfile_bufstart += INBUFSIZ; /* always starts on a block boundary */ + G.inptr = G.inbuf; + defer_leftover_input(__G); /* decrements G.csize */ + +#if CRYPT + if (G.pInfo->encrypted) { + uch *p; + int n; + + for (n = G.incnt, p = G.inptr; n--; p++) + zdecode(*p); + } +#endif /* CRYPT */ + + return G.incnt; + +} /* end function fillinbuf() */ + +#endif /* USE_ZLIB */ + + + + + +/************************/ +/* Function seek_zipf() */ +/************************/ + +int seek_zipf(__G__ abs_offset) + __GDEF + LONGINT abs_offset; +{ +/* + * Seek to the block boundary of the block which includes abs_offset, + * then read block into input buffer and set pointers appropriately. + * If block is already in the buffer, just set the pointers. This function + * is used by do_seekable (process.c), extract_or_test_entrylist (extract.c) + * and do_string (fileio.c). Also, a slightly modified version is embedded + * within extract_or_test_entrylist (extract.c). readbyte() and readbuf() + * (fileio.c) are compatible. NOTE THAT abs_offset is intended to be the + * "proper offset" (i.e., if there were no extra bytes prepended); + * cur_zipfile_bufstart contains the corrected offset. + * + * Since seek_zipf() is never used during decompression, it is safe to + * use the slide[] buffer for the error message. + * + * returns PK error codes: + * PK_BADERR if effective offset in zipfile is negative + * PK_EOF if seeking past end of zipfile + * PK_OK when seek was successful + */ + LONGINT request = abs_offset + G.extra_bytes; + LONGINT inbuf_offset = request % INBUFSIZ; + LONGINT bufstart = request - inbuf_offset; + + if (request < 0) { + Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg), + G.zipfn, LoadFarString(ReportMsg))); + return(PK_BADERR); + } else if (bufstart != G.cur_zipfile_bufstart) { + Trace((stderr, + "fpos_zip: abs_offset = %ld, G.extra_bytes = %ld\n", + abs_offset, G.extra_bytes)); +#ifdef USE_STRM_INPUT + fseek(G.zipfd, (LONGINT)bufstart, SEEK_SET); + G.cur_zipfile_bufstart = ftell(G.zipfd); +#else /* !USE_STRM_INPUT */ + G.cur_zipfile_bufstart = lseek(G.zipfd, (LONGINT)bufstart, SEEK_SET); +#endif /* ?USE_STRM_INPUT */ + Trace((stderr, + " request = %ld, (abs+extra) = %ld, inbuf_offset = %ld\n", + request, (abs_offset+G.extra_bytes), inbuf_offset)); + Trace((stderr, " bufstart = %ld, cur_zipfile_bufstart = %ld\n", + bufstart, G.cur_zipfile_bufstart)); + if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) + return(PK_EOF); + G.incnt -= (int)inbuf_offset; + G.inptr = G.inbuf + (int)inbuf_offset; + } else { + G.incnt += (G.inptr-G.inbuf) - (int)inbuf_offset; + G.inptr = G.inbuf + (int)inbuf_offset; + } + return(PK_OK); +} /* end function seek_zipf() */ + + + + + +#ifndef VMS /* for VMS use code in vms.c */ + +/********************/ +/* Function flush() */ /* returns PK error codes: */ +/********************/ /* if cflag => always 0; PK_DISK if write error */ + +int flush(__G__ rawbuf, size, unshrink) + __GDEF + uch *rawbuf; + ulg size; + int unshrink; +#if (defined(USE_DEFLATE64) && defined(__16BIT__)) +{ + int ret; + + /* On 16-bit systems (MSDOS, OS/2 1.x), the standard C library functions + * cannot handle writes of 64k blocks at once. For these systems, the + * blocks to flush are split into pieces of 32k or less. + */ + while (size > 0x8000L) { + ret = partflush(__G__ rawbuf, 0x8000L, unshrink); + if (ret != PK_OK) + return ret; + size -= 0x8000L; + rawbuf += (unsigned)0x8000; + } + return partflush(__G__ rawbuf, size, unshrink); +} /* end function flush() */ + + +/************************/ +/* Function partflush() */ /* returns PK error codes: */ +/************************/ /* if cflag => always 0; PK_DISK if write error */ + +static int partflush(__G__ rawbuf, size, unshrink) + __GDEF + uch *rawbuf; /* cannot be ZCONST, gets passed to (*G.message)() */ + ulg size; + int unshrink; +#endif /* USE_DEFLATE64 && __16BIT__ */ +{ + register uch *p; + register uch *q; + uch *transbuf; +#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) + ulg transbufsiz; +#endif + /* static int didCRlast = FALSE; moved to globals.h */ + + +/*--------------------------------------------------------------------------- + Compute the CRC first; if testing or if disk is full, that's it. + ---------------------------------------------------------------------------*/ + + G.crc32val = crc32(G.crc32val, rawbuf, (extent)size); + +#ifdef DLL + if ((G.statreportcb != NULL) && + (*G.statreportcb)(__G__ UZ_ST_IN_PROGRESS, G.zipfn, G.filename, NULL)) + return IZ_CTRLC; /* cancel operation by user request */ +#endif + + if (uO.tflag || size == 0L) /* testing or nothing to write: all done */ + return PK_OK; + + if (G.disk_full) + return PK_DISK; /* disk already full: ignore rest of file */ + +/*--------------------------------------------------------------------------- + Write the bytes rawbuf[0..size-1] to the output device, first converting + end-of-lines and ASCII/EBCDIC as needed. If SMALL_MEM or MED_MEM are NOT + defined, outbuf is assumed to be at least as large as rawbuf and is not + necessarily checked for overflow. + ---------------------------------------------------------------------------*/ + + if (!G.pInfo->textmode) { /* write raw binary data */ + /* GRR: note that for standard MS-DOS compilers, size argument to + * fwrite() can never be more than 65534, so WriteError macro will + * have to be rewritten if size can ever be that large. For now, + * never more than 32K. Also note that write() returns an int, which + * doesn't necessarily limit size to 32767 bytes if write() is used + * on 16-bit systems but does make it more of a pain; however, because + * at least MSC 5.1 has a lousy implementation of fwrite() (as does + * DEC Ultrix cc), write() is used anyway. + */ +#ifdef DLL + if (G.redirect_data) + writeToMemory(__G__ rawbuf, (extent)size); + else +#endif + if (!uO.cflag && WriteError(rawbuf, size, G.outfile)) + return disk_error(__G); + else if (uO.cflag && (*G.message)((zvoid *)&G, rawbuf, size, 0)) + return PK_OK; + } else { /* textmode: aflag is true */ + if (unshrink) { + /* rawbuf = outbuf */ + transbuf = G.outbuf2; +#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) + transbufsiz = TRANSBUFSIZ; +#endif + } else { + /* rawbuf = slide */ + transbuf = G.outbuf; +#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) + transbufsiz = OUTBUFSIZ; + Trace((stderr, "\ntransbufsiz = OUTBUFSIZ = %u\n", + (unsigned)OUTBUFSIZ)); +#endif + } + if (G.newfile) { +#ifdef VMS_TEXT_CONV + if (G.pInfo->hostnum == VMS_ && G.extra_field && + is_vms_varlen_txt(__G__ G.extra_field, + G.lrec.extra_field_length)) + G.VMS_line_state = 0; /* 0: ready to read line length */ + else + G.VMS_line_state = -1; /* -1: don't treat as VMS text */ +#endif + G.didCRlast = FALSE; /* no previous buffers written */ + G.newfile = FALSE; + } + +#ifdef VMS_TEXT_CONV + if (G.VMS_line_state >= 0) + { + /* GRR: really want to check for actual VMS extra field, and + * ideally for variable-length record format */ +/* + printf("\n>>>>>> GRR: file is VMS text and has an extra field\n"); + */ + + p = rawbuf; + q = transbuf; + while (p < rawbuf+(unsigned)size) { + switch (G.VMS_line_state) { + + /* 0: ready to read line length */ + case 0: + G.VMS_line_length = 0; + if (p == rawbuf+(unsigned)size-1) { /* last char */ + G.VMS_line_length = (unsigned)(*p++); + G.VMS_line_state = 1; + } else { + G.VMS_line_length = makeword(p); + p += 2; + G.VMS_line_state = 2; + } + G.VMS_line_pad = + ((G.VMS_line_length & 1) != 0); /* odd */ + break; + + /* 1: read one byte of length, need second */ + case 1: + G.VMS_line_length += ((unsigned)(*p++) << 8); + G.VMS_line_state = 2; + break; + + /* 2: ready to read VMS_line_length chars */ + case 2: + { + extent remaining = rawbuf+(unsigned)size-p; + extent outroom; + + if (G.VMS_line_length < remaining) { + remaining = G.VMS_line_length; + G.VMS_line_state = 3; + } + + outroom = transbuf+(unsigned)transbufsiz-q; + if (remaining >= outroom) { + remaining -= outroom; + for (;outroom > 0; p++, outroom--) + *q++ = native(*p); +#ifdef DLL + if (G.redirect_data) + writeToMemory(__G__ transbuf, + (extent)(q-transbuf)); + else +#endif + if (!uO.cflag && WriteError(transbuf, + (extent)(q-transbuf), G.outfile)) + return disk_error(__G); + else if (uO.cflag && (*G.message)((zvoid *)&G, + transbuf, (ulg)(q-transbuf), 0)) + return PK_OK; + q = transbuf; + /* fall through to normal case */ + } + G.VMS_line_length -= remaining; + for (;remaining > 0; p++, remaining--) + *q++ = native(*p); + } + break; + + /* 3: ready to PutNativeEOL */ + case 3: + if (q > transbuf+(unsigned)transbufsiz-lenEOL) { +#ifdef DLL + if (G.redirect_data) + writeToMemory(__G__ transbuf, + (extent)(q-transbuf)); + else +#endif + if (!uO.cflag && + WriteError(transbuf, (extent)(q-transbuf), + G.outfile)) + return disk_error(__G); + else if (uO.cflag && (*G.message)((zvoid *)&G, + transbuf, (ulg)(q-transbuf), 0)) + return PK_OK; + q = transbuf; + } + PutNativeEOL + G.VMS_line_state = G.VMS_line_pad ? 4 : 0; + break; + + /* 4: ready to read pad byte */ + case 4: + ++p; + G.VMS_line_state = 0; + break; + } + } /* end while */ + + } else +#endif /* VMS_TEXT_CONV */ + + /*----------------------------------------------------------------------- + Algorithm: CR/LF => native; lone CR => native; lone LF => native. + This routine is only for non-raw-VMS, non-raw-VM/CMS files (i.e., + stream-oriented files, not record-oriented). + -----------------------------------------------------------------------*/ + + /* else not VMS text */ { + p = rawbuf; + if (*p == LF && G.didCRlast) + ++p; + G.didCRlast = FALSE; + for (q = transbuf; p < rawbuf+(unsigned)size; ++p) { + if (*p == CR) { /* lone CR or CR/LF: treat as EOL */ + PutNativeEOL + if (p == rawbuf+(unsigned)size-1) /* last char in buffer */ + G.didCRlast = TRUE; + else if (p[1] == LF) /* get rid of accompanying LF */ + ++p; + } else if (*p == LF) /* lone LF */ + PutNativeEOL + else +#ifndef DOS_FLX_OS2_W32 + if (*p != CTRLZ) /* lose all ^Z's */ +#endif + *q++ = native(*p); + +#if (defined(SMALL_MEM) || defined(MED_MEM)) +# if (lenEOL == 1) /* don't check unshrink: both buffers small but equal */ + if (!unshrink) +# endif + /* check for danger of buffer overflow and flush */ + if (q > transbuf+(unsigned)transbufsiz-lenEOL) { + Trace((stderr, + "p - rawbuf = %u q-transbuf = %u size = %lu\n", + (unsigned)(p-rawbuf), (unsigned)(q-transbuf), size)); + if (!uO.cflag && WriteError(transbuf, + (extent)(q-transbuf), G.outfile)) + return disk_error(__G); + else if (uO.cflag && (*G.message)((zvoid *)&G, + transbuf, (ulg)(q-transbuf), 0)) + return PK_OK; + q = transbuf; + continue; + } +#endif /* SMALL_MEM || MED_MEM */ + } + } + + /*----------------------------------------------------------------------- + Done translating: write whatever we've got to file (or screen). + -----------------------------------------------------------------------*/ + + Trace((stderr, "p - rawbuf = %u q-transbuf = %u size = %lu\n", + (unsigned)(p-rawbuf), (unsigned)(q-transbuf), size)); + if (q > transbuf) { +#ifdef DLL + if (G.redirect_data) + writeToMemory(__G__ transbuf, (extent)(q-transbuf)); + else +#endif + if (!uO.cflag && WriteError(transbuf, (extent)(q-transbuf), + G.outfile)) + return disk_error(__G); + else if (uO.cflag && (*G.message)((zvoid *)&G, transbuf, + (ulg)(q-transbuf), 0)) + return PK_OK; + } + } + + return PK_OK; + +} /* end function flush() [resp. partflush() for 16-bit Deflate64 support] */ + + + + + +#ifdef VMS_TEXT_CONV + +/********************************/ +/* Function is_vms_varlen_txt() */ +/********************************/ + +static int is_vms_varlen_txt(__G__ ef_buf, ef_len) + __GDEF + uch *ef_buf; /* buffer containing extra field */ + unsigned ef_len; /* total length of extra field */ +{ + unsigned eb_id; + unsigned eb_len; + uch *eb_data; + unsigned eb_datlen; +#define VMSREC_C_UNDEF 0 +#define VMSREC_C_VAR 2 + uch vms_rectype = VMSREC_C_UNDEF; + uch vms_fileorg = 0; + +#define VMSPK_ITEMID 0 +#define VMSPK_ITEMLEN 2 +#define VMSPK_ITEMHEADSZ 4 + +#define VMSATR_C_RECATTR 4 +#define VMS_FABSIG 0x42414656 /* "VFAB" */ +/* offsets of interesting fields in VMS fabdef structure */ +#define VMSFAB_B_RFM 31 /* record format byte */ +#define VMSFAB_B_ORG 29 /* file organization byte */ + + if (ef_len == 0 || ef_buf == NULL) + return FALSE; + + while (ef_len >= EB_HEADSIZE) { + eb_id = makeword(EB_ID + ef_buf); + eb_len = makeword(EB_LEN + ef_buf); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + /* discovered some extra field inconsistency! */ + Trace((stderr, + "is_vms_varlen_txt: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } + + switch (eb_id) { + case EF_PKVMS: + /* The PKVMS e.f. raw data part consists of: + * a) 4 bytes CRC checksum + * b) list of uncompressed variable-length data items + * Each data item is introduced by a fixed header + * - 2 bytes data type ID + * - 2 bytes of data + * - bytes of actual attribute data + */ + + /* get pointer to start of data and its total length */ + eb_data = ef_buf+(EB_HEADSIZE+4); + eb_datlen = eb_len-4; + + /* test the CRC checksum */ + if (makelong(ef_buf+EB_HEADSIZE) != + crc32(CRCVAL_INITIAL, eb_data, (extent)eb_datlen)) + { + Info(slide, 1, ((char *)slide, + "[Warning: CRC error, discarding PKWARE extra field]\n")); + /* skip over the data analysis code */ + break; + } + + /* scan through the attribute data items */ + while (eb_datlen > 4) + { + unsigned fldsize = makeword(&eb_data[VMSPK_ITEMLEN]); + + /* check the item type word */ + switch (makeword(&eb_data[VMSPK_ITEMID])) { + case VMSATR_C_RECATTR: + /* we have found the (currently only) interesting + * data item */ + if (fldsize >= 1) { + vms_rectype = eb_data[VMSPK_ITEMHEADSZ] & 15; + vms_fileorg = eb_data[VMSPK_ITEMHEADSZ] >> 4; + } + break; + default: + break; + } + /* skip to next data item */ + eb_datlen -= fldsize + VMSPK_ITEMHEADSZ; + eb_data += fldsize + VMSPK_ITEMHEADSZ; + } + break; + + case EF_IZVMS: + if (makelong(ef_buf+EB_HEADSIZE) == VMS_FABSIG) { + if ((eb_data = extract_izvms_block(__G__ + ef_buf+EB_HEADSIZE, eb_len, + &eb_datlen, NULL, 0)) + != NULL) + { + if (eb_datlen >= VMSFAB_B_RFM+1) { + vms_rectype = eb_data[VMSFAB_B_RFM] & 15; + vms_fileorg = eb_data[VMSFAB_B_ORG] >> 4; + } + free(eb_data); + } + } + break; + + default: + break; + } + + /* Skip this extra field block */ + ef_buf += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } + + return (vms_rectype == VMSREC_C_VAR); + +} /* end function is_vms_varlen_txtfile() */ + +#endif /* VMS_TEXT_CONV */ + + + + +/*************************/ +/* Function disk_error() */ +/*************************/ + +static int disk_error(__G) + __GDEF +{ + /* OK to use slide[] here because this file is finished regardless */ + Info(slide, 0x4a1, ((char *)slide, LoadFarString(DiskFullQuery), + FnFilter1(G.filename))); + +#ifndef WINDLL + fgets(G.answerbuf, 9, stdin); + if (*G.answerbuf == 'y') /* stop writing to this file */ + G.disk_full = 1; /* (outfile bad?), but new OK */ + else +#endif + G.disk_full = 2; /* no: exit program */ + + return PK_DISK; + +} /* end function disk_error() */ + +#endif /* !VMS */ + + + + + +/*****************************/ +/* Function UzpMessagePrnt() */ +/*****************************/ + +int UZ_EXP UzpMessagePrnt(pG, buf, size, flag) + zvoid *pG; /* globals struct: always passed */ + uch *buf; /* preformatted string to be printed */ + ulg size; /* length of string (may include nulls) */ + int flag; /* flag bits */ +{ + /* IMPORTANT NOTE: + * The name of the first parameter of UzpMessagePrnt(), which passes + * the "Uz_Globs" address, >>> MUST <<< be identical to the string + * expansion of the __G__ macro in the REENTRANT case (see globals.h). + * This name identity is mandatory for the LoadFarString() macro + * (in the SMALL_MEM case) !!! + */ + int error; + uch *q=buf, *endbuf=buf+(unsigned)size; +#ifdef MORE + uch *p=buf; +#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) + int islinefeed = FALSE; +#endif +#endif + FILE *outfp; + + +/*--------------------------------------------------------------------------- + These tests are here to allow fine-tuning of UnZip's output messages, + but none of them will do anything without setting the appropriate bit + in the flag argument of every Info() statement which is to be turned + *off*. That is, all messages are currently turned on for all ports. + To turn off *all* messages, use the UzpMessageNull() function instead + of this one. + ---------------------------------------------------------------------------*/ + +#if (defined(OS2) && defined(DLL)) + if (MSG_NO_DLL2(flag)) /* if OS/2 DLL bit is set, do NOT print this msg */ + return 0; +#endif +#ifdef WINDLL + if (MSG_NO_WDLL(flag)) + return 0; +#endif +#ifdef WINDLL + if (MSG_NO_WGUI(flag)) + return 0; +#endif +/* +#ifdef ACORN_GUI + if (MSG_NO_AGUI(flag)) + return 0; +#endif + */ +#ifdef DLL /* don't display message if data is redirected */ + if (((Uz_Globs *)pG)->redirect_data && + !((Uz_Globs *)pG)->redirect_text) + return 0; +#endif + + if (MSG_STDERR(flag) && !((Uz_Globs *)pG)->UzO.tflag) + outfp = (FILE *)stderr; + else + outfp = (FILE *)stdout; + +#ifdef QUERY_TRNEWLN + /* some systems require termination of query prompts with '\n' to force + * immediate display */ + if (MSG_MNEWLN(flag)) { /* assumes writable buffer (e.g., slide[]) */ + *endbuf++ = '\n'; /* with room for one more char at end of buf */ + ++size; /* (safe assumption: only used for four */ + } /* short queries in extract.c and fileio.c) */ +#endif + + if (MSG_TNEWLN(flag)) { /* again assumes writable buffer: fragile... */ + if ((!size && !((Uz_Globs *)pG)->sol) || + (size && (endbuf[-1] != '\n'))) + { + *endbuf++ = '\n'; + ++size; + } + } + +#ifdef MORE +# ifdef SCREENSIZE + /* room for --More-- and one line of overlap: */ +# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) + SCREENSIZE(&((Uz_Globs *)pG)->height, &((Uz_Globs *)pG)->width); +# else + SCREENSIZE(&((Uz_Globs *)pG)->height, (int *)NULL); +# endif + ((Uz_Globs *)pG)->height -= 2; +# else + /* room for --More-- and one line of overlap: */ + ((Uz_Globs *)pG)->height = SCREENLINES - 2; +# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) + ((Uz_Globs *)pG)->width = SCREENWIDTH; +# endif +# endif +#endif /* MORE */ + + if (MSG_LNEWLN(flag) && !((Uz_Globs *)pG)->sol) { + /* not at start of line: want newline */ +#ifdef OS2DLL + if (!((Uz_Globs *)pG)->redirect_text) { +#endif + putc('\n', outfp); + fflush(outfp); +#ifdef MORE + if (((Uz_Globs *)pG)->M_flag) + { +#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) + ((Uz_Globs *)pG)->chars = 0; +#endif + ++((Uz_Globs *)pG)->numlines; + ++((Uz_Globs *)pG)->lines; + if (((Uz_Globs *)pG)->lines >= ((Uz_Globs *)pG)->height) + (*((Uz_Globs *)pG)->mpause)((zvoid *)pG, + LoadFarString(MorePrompt), 1); + } +#endif /* MORE */ + if (MSG_STDERR(flag) && ((Uz_Globs *)pG)->UzO.tflag && + !isatty(1) && isatty(2)) + { + /* error output from testing redirected: also send to stderr */ + putc('\n', stderr); + fflush(stderr); + } +#ifdef OS2DLL + } else + REDIRECTC('\n'); +#endif + ((Uz_Globs *)pG)->sol = TRUE; + } + + /* put zipfile name, filename and/or error/warning keywords here */ + +#ifdef MORE + if (((Uz_Globs *)pG)->M_flag +#ifdef OS2DLL + && !((Uz_Globs *)pG)->redirect_text +#endif + ) + { + while (p < endbuf) { + if (*p == '\n') { +#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) + islinefeed = TRUE; + } else if (SCREENLWRAP) { + if (*p == '\r') { + ((Uz_Globs *)pG)->chars = 0; + } else { +# ifdef TABSIZE + if (*p == '\t') + ((Uz_Globs *)pG)->chars += + (TABSIZE - (((Uz_Globs *)pG)->chars % TABSIZE)); + else +# endif + ++((Uz_Globs *)pG)->chars; + + if (((Uz_Globs *)pG)->chars >= ((Uz_Globs *)pG)->width) + islinefeed = TRUE; + } + } + if (islinefeed) { + islinefeed = FALSE; + ((Uz_Globs *)pG)->chars = 0; +#endif /* (SCREENWIDTH && SCREEN_LWRAP) */ + ++((Uz_Globs *)pG)->numlines; + ++((Uz_Globs *)pG)->lines; + if (((Uz_Globs *)pG)->lines >= ((Uz_Globs *)pG)->height) + { + if ((error = WriteError(q, p-q+1, outfp)) != 0) + return error; + fflush(outfp); + ((Uz_Globs *)pG)->sol = TRUE; + q = p + 1; + (*((Uz_Globs *)pG)->mpause)((zvoid *)pG, + LoadFarString(MorePrompt), 1); + } + } + INCSTR(p); + } /* end while */ + size = (ulg)(p - q); /* remaining text */ + } +#endif /* MORE */ + + if (size) { +#ifdef OS2DLL + if (!((Uz_Globs *)pG)->redirect_text) { +#endif + if ((error = WriteError(q, size, outfp)) != 0) + return error; + fflush(outfp); + if (MSG_STDERR(flag) && ((Uz_Globs *)pG)->UzO.tflag && + !isatty(1) && isatty(2)) + { + /* error output from testing redirected: also send to stderr */ + if ((error = WriteError(q, size, stderr)) != 0) + return error; + fflush(stderr); + } +#ifdef OS2DLL + } else { /* GRR: this is ugly: hide with macro */ + if ((error = REDIRECTPRINT(q, size)) != 0) + return error; + } +#endif /* OS2DLL */ + ((Uz_Globs *)pG)->sol = (endbuf[-1] == '\n'); + } + return 0; + +} /* end function UzpMessagePrnt() */ + + + + + +#ifdef DLL + +/*****************************/ +/* Function UzpMessageNull() */ /* convenience routine for no output at all */ +/*****************************/ + +int UZ_EXP UzpMessageNull(pG, buf, size, flag) + zvoid *pG; /* globals struct: always passed */ + uch *buf; /* preformatted string to be printed */ + ulg size; /* length of string (may include nulls) */ + int flag; /* flag bits */ +{ + return 0; + +} /* end function UzpMessageNull() */ + +#endif /* DLL */ + + + + + +/***********************/ +/* Function UzpInput() */ /* GRR: this is a placeholder for now */ +/***********************/ + +int UZ_EXP UzpInput(pG, buf, size, flag) + zvoid *pG; /* globals struct: always passed */ + uch *buf; /* preformatted string to be printed */ + int *size; /* (address of) size of buf and of returned string */ + int flag; /* flag bits (bit 0: no echo) */ +{ + /* tell picky compilers to shut up about "unused variable" warnings */ + pG = pG; buf = buf; flag = flag; + + *size = 0; + return 0; + +} /* end function UzpInput() */ + + + + + +#if (!defined(WINDLL) && !defined(MACOS)) + +/***************************/ +/* Function UzpMorePause() */ +/***************************/ + +void UZ_EXP UzpMorePause(pG, prompt, flag) + zvoid *pG; /* globals struct: always passed */ + ZCONST char *prompt; /* "--More--" prompt */ + int flag; /* 0 = any char OK; 1 = accept only '\n', ' ', q */ +{ + uch c; + +/*--------------------------------------------------------------------------- + Print a prompt and wait for the user to press a key, then erase prompt + if possible. + ---------------------------------------------------------------------------*/ + + if (!((Uz_Globs *)pG)->sol) + fprintf(stderr, "\n"); + /* numlines may or may not be used: */ + fprintf(stderr, prompt, ((Uz_Globs *)pG)->numlines); + fflush(stderr); + if (flag & 1) { + do { + c = (uch)FGETCH(0); + } while ( +#ifdef THEOS + c != 17 && /* standard QUIT key */ +#endif + c != '\r' && c != '\n' && c != ' ' && c != 'q' && c != 'Q'); + } else + c = (uch)FGETCH(0); + + /* newline was not echoed, so cover up prompt line */ + fprintf(stderr, LoadFarString(HidePrompt)); + fflush(stderr); + + if ( +#ifdef THEOS + (c == 17) || /* standard QUIT key */ +#endif + (ToLower(c) == 'q')) { + DESTROYGLOBALS(); + EXIT(PK_COOL); + } + + ((Uz_Globs *)pG)->sol = TRUE; + +#ifdef MORE + /* space for another screen, enter for another line. */ + if ((flag & 1) && c == ' ') + ((Uz_Globs *)pG)->lines = 0; +#endif /* MORE */ + +} /* end function UzpMorePause() */ + +#endif /* !WINDLL && !MACOS */ + + + + +#ifndef WINDLL + +/**************************/ +/* Function UzpPassword() */ +/**************************/ + +int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn) + zvoid *pG; /* pointer to UnZip's internal global vars */ + int *rcnt; /* retry counter */ + char *pwbuf; /* buffer for password */ + int size; /* size of password buffer */ + ZCONST char *zfn; /* name of zip archive */ + ZCONST char *efn; /* name of archive entry being processed */ +{ +#if CRYPT + int r = IZ_PW_ENTERED; + char *m; + char *prompt; + +#ifndef REENTRANT + /* tell picky compilers to shut up about "unused variable" warnings */ + pG = pG; +#endif + + if (*rcnt == 0) { /* First call for current entry */ + *rcnt = 2; + if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) { + sprintf(prompt, LoadFarString(PasswPrompt), + FnFilter1(zfn), FnFilter2(efn)); + m = prompt; + } else + m = (char *)LoadFarString(PasswPrompt2); + } else { /* Retry call, previous password was wrong */ + (*rcnt)--; + prompt = NULL; + m = (char *)LoadFarString(PasswRetry); + } + + m = getp(__G__ m, pwbuf, size); + if (prompt != (char *)NULL) { + free(prompt); + } + if (m == (char *)NULL) { + r = IZ_PW_ERROR; + } + else if (*pwbuf == '\0') { + r = IZ_PW_CANCELALL; + } + return r; + +#else /* !CRYPT */ + /* tell picky compilers to shut up about "unused variable" warnings */ + pG = pG; rcnt = rcnt; pwbuf = pwbuf; size = size; zfn = zfn; efn = efn; + + return IZ_PW_ERROR; /* internal error; function should never get called */ +#endif /* ?CRYPT */ + +} /* end function UzpPassword() */ + + + + + +/**********************/ +/* Function handler() */ +/**********************/ + +void handler(signal) /* upon interrupt, turn on echo and exit cleanly */ + int signal; +{ + GETGLOBALS(); + + + echon(); + + /* probably ctrl-C */ + DESTROYGLOBALS(); +#if defined(AMIGA) && defined(__SASC) + _abort(); +#endif + EXIT(IZ_CTRLC); /* was EXIT(0), then EXIT(PK_ERR) */ +} + +#endif /* !WINDLL */ + + + + +#if (!defined(VMS) && !defined(CMS_MVS)) +#if (!defined(OS2) || defined(TIMESTAMP)) + +#if (!defined(HAVE_MKTIME) || defined(WIN32)) +/* also used in amiga/filedate.c and win32/win32.c */ +ZCONST ush ydays[] = + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; +#endif + +/*******************************/ +/* Function dos_to_unix_time() */ /* used for freshening/updating/timestamps */ +/*******************************/ + +time_t dos_to_unix_time(dosdatetime) + ulg dosdatetime; +{ + time_t m_time; + +#ifdef HAVE_MKTIME + + ZCONST time_t now = time(NULL); + struct tm *tm; +# define YRBASE 1900 + + tm = localtime(&now); + tm->tm_isdst = -1; /* let mktime determine if DST is in effect */ + + /* dissect date */ + tm->tm_year = ((int)(dosdatetime >> 25) & 0x7f) + (1980 - YRBASE); + tm->tm_mon = ((int)(dosdatetime >> 21) & 0x0f) - 1; + tm->tm_mday = ((int)(dosdatetime >> 16) & 0x1f); + + /* dissect time */ + tm->tm_hour = (int)((unsigned)dosdatetime >> 11) & 0x1f; + tm->tm_min = (int)((unsigned)dosdatetime >> 5) & 0x3f; + tm->tm_sec = (int)((unsigned)dosdatetime << 1) & 0x3e; + + m_time = mktime(tm); + NATIVE_TO_TIMET(m_time) /* NOP unless MSC 7.0 or Macintosh */ + TTrace((stderr, " final m_time = %lu\n", (ulg)m_time)); + +#else /* !HAVE_MKTIME */ + + int yr, mo, dy, hh, mm, ss; +#ifdef TOPS20 +# define YRBASE 1900 + struct tmx *tmx; + char temp[20]; +#else /* !TOPS20 */ +# define YRBASE 1970 + int leap; + unsigned days; + struct tm *tm; +#if (!defined(MACOS) && !defined(RISCOS) && !defined(QDOS) && !defined(TANDEM)) +#ifdef WIN32 + TIME_ZONE_INFORMATION tzinfo; + DWORD res; +#else /* ! WIN32 */ +#ifndef BSD4_4 /* GRR: change to !defined(MODERN) ? */ +#if (defined(BSD) || defined(MTS) || defined(__GO32__)) + struct timeb tbp; +#else /* !(BSD || MTS || __GO32__) */ +#ifdef DECLARE_TIMEZONE + extern time_t timezone; +#endif +#endif /* ?(BSD || MTS || __GO32__) */ +#endif /* !BSD4_4 */ +#endif /* ?WIN32 */ +#endif /* !MACOS && !RISCOS && !QDOS && !TANDEM */ +#endif /* ?TOPS20 */ + + + /* dissect date */ + yr = ((int)(dosdatetime >> 25) & 0x7f) + (1980 - YRBASE); + mo = ((int)(dosdatetime >> 21) & 0x0f) - 1; + dy = ((int)(dosdatetime >> 16) & 0x1f) - 1; + + /* dissect time */ + hh = (int)((unsigned)dosdatetime >> 11) & 0x1f; + mm = (int)((unsigned)dosdatetime >> 5) & 0x3f; + ss = (int)((unsigned)dosdatetime & 0x1f) * 2; + +#ifdef TOPS20 + tmx = (struct tmx *)malloc(sizeof(struct tmx)); + sprintf (temp, "%02d/%02d/%02d %02d:%02d:%02d", mo+1, dy+1, yr, hh, mm, ss); + time_parse(temp, tmx, (char *)0); + m_time = time_make(tmx); + free(tmx); + +#else /* !TOPS20 */ + +/*--------------------------------------------------------------------------- + Calculate the number of seconds since the epoch, usually 1 January 1970. + ---------------------------------------------------------------------------*/ + + /* leap = # of leap yrs from YRBASE up to but not including current year */ + leap = ((yr + YRBASE - 1) / 4); /* leap year base factor */ + + /* calculate days from BASE to this year and add expired days this year */ + days = (yr * 365) + (leap - 492) + ydays[mo]; + + /* if year is a leap year and month is after February, add another day */ + if ((mo > 1) && ((yr+YRBASE)%4 == 0) && ((yr+YRBASE) != 2100)) + ++days; /* OK through 2199 */ + + /* convert date & time to seconds relative to 00:00:00, 01/01/YRBASE */ + m_time = (time_t)((unsigned long)(days + dy) * 86400L + + (unsigned long)hh * 3600L + + (unsigned long)(mm * 60 + ss)); + /* - 1; MS-DOS times always rounded up to nearest even second */ + TTrace((stderr, "dos_to_unix_time:\n")); + TTrace((stderr, " m_time before timezone = %lu\n", (ulg)m_time)); + +/*--------------------------------------------------------------------------- + Adjust for local standard timezone offset. + ---------------------------------------------------------------------------*/ + +#if (!defined(MACOS) && !defined(RISCOS) && !defined(QDOS) && !defined(TANDEM)) +#ifdef WIN32 + /* account for timezone differences */ + res = GetTimeZoneInformation(&tzinfo); + if (res != TIME_ZONE_ID_INVALID) + { + m_time += 60*(tzinfo.Bias); +#else /* !WIN32 */ +#if (defined(BSD) || defined(MTS) || defined(__GO32__)) +#ifdef BSD4_4 + if ( (dosdatetime >= DOSTIME_2038_01_18) && + (m_time < (time_t)0x70000000L) ) + m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ + if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ + m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ + if ((tm = localtime(&m_time)) != (struct tm *)NULL) + m_time -= tm->tm_gmtoff; /* sec. EAST of GMT: subtr. */ +#else /* !(BSD4_4 */ + ftime(&tbp); /* get `timezone' */ + m_time += tbp.timezone * 60L; /* seconds WEST of GMT: add */ +#endif /* ?(BSD4_4 || __EMX__) */ +#else /* !(BSD || MTS || __GO32__) */ + /* tzset was already called at start of process_zipfiles() */ + /* tzset(); */ /* set `timezone' variable */ +#ifndef __BEOS__ /* BeOS DR8 has no timezones... */ + m_time += timezone; /* seconds WEST of GMT: add */ +#endif +#endif /* ?(BSD || MTS || __GO32__) */ +#endif /* ?WIN32 */ + TTrace((stderr, " m_time after timezone = %lu\n", (ulg)m_time)); + +/*--------------------------------------------------------------------------- + Adjust for local daylight savings (summer) time. + ---------------------------------------------------------------------------*/ + +#ifndef BSD4_4 /* (DST already added to tm_gmtoff, so skip tm_isdst) */ + if ( (dosdatetime >= DOSTIME_2038_01_18) && + (m_time < (time_t)0x70000000L) ) + m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ + if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ + m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ + TIMET_TO_NATIVE(m_time) /* NOP unless MSC 7.0 or Macintosh */ + if (((tm = localtime((time_t *)&m_time)) != NULL) && tm->tm_isdst) +#ifdef WIN32 + m_time += 60L * tzinfo.DaylightBias; /* adjust with DST bias */ + else + m_time += 60L * tzinfo.StandardBias; /* add StdBias (normally 0) */ +#else + m_time -= 60L * 60L; /* adjust for daylight savings time */ +#endif + NATIVE_TO_TIMET(m_time) /* NOP unless MSC 7.0 or Macintosh */ + TTrace((stderr, " m_time after DST = %lu\n", (ulg)m_time)); +#endif /* !BSD4_4 */ +#ifdef WIN32 + } +#endif +#endif /* !MACOS && !RISCOS && !QDOS && !TANDEM */ +#endif /* ?TOPS20 */ + +#endif /* ?HAVE_MKTIME */ + + if ( (dosdatetime >= DOSTIME_2038_01_18) && + (m_time < (time_t)0x70000000L) ) + m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ + if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ + m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ + + return m_time; + +} /* end function dos_to_unix_time() */ + +#endif /* !OS2 || TIMESTAMP */ +#endif /* !VMS && !CMS_MVS */ + + + +#if (!defined(VMS) && !defined(OS2) && !defined(CMS_MVS)) + +/******************************/ +/* Function check_for_newer() */ /* used for overwriting/freshening/updating */ +/******************************/ + +int check_for_newer(__G__ filename) /* return 1 if existing file is newer */ + __GDEF /* or equal; 0 if older; -1 if doesn't */ + char *filename; /* exist yet */ +{ + time_t existing, archive; +#ifdef USE_EF_UT_TIME + iztimes z_utime; +#endif +#ifdef AOS_VS + long dyy, dmm, ddd, dhh, dmin, dss; + + + dyy = (lrec.last_mod_dos_datetime >> 25) + 1980; + dmm = (lrec.last_mod_dos_datetime >> 21) & 0x0f; + ddd = (lrec.last_mod_dos_datetime >> 16) & 0x1f; + dhh = (lrec.last_mod_dos_datetime >> 11) & 0x1f; + dmin = (lrec.last_mod_dos_datetime >> 5) & 0x3f; + dss = (lrec.last_mod_dos_datetime & 0x1f) * 2; + + /* under AOS/VS, file times can only be set at creation time, + * with the info in a special DG format. Make sure we can create + * it here - we delete it later & re-create it, whether or not + * it exists now. + */ + if (!zvs_create(filename, (((ulg)dgdate(dmm, ddd, dyy)) << 16) | + (dhh*1800L + dmin*30L + dss/2L), -1L, -1L, (char *) -1, -1, -1, -1)) + return DOES_NOT_EXIST; +#endif /* AOS_VS */ + + Trace((stderr, "check_for_newer: doing stat(%s)\n", FnFilter1(filename))); + if (SSTAT(filename, &G.statbuf)) { + Trace((stderr, + "check_for_newer: stat(%s) returns %d: file does not exist\n", + FnFilter1(filename), SSTAT(filename, &G.statbuf))); +#ifdef SYMLINKS + Trace((stderr, "check_for_newer: doing lstat(%s)\n", + FnFilter1(filename))); + /* GRR OPTION: could instead do this test ONLY if G.symlnk is true */ + if (lstat(filename, &G.statbuf) == 0) { + Trace((stderr, + "check_for_newer: lstat(%s) returns 0: symlink does exist\n", + FnFilter1(filename))); + if (QCOND2 && !IS_OVERWRT_ALL) + Info(slide, 0, ((char *)slide, LoadFarString(FileIsSymLink), + FnFilter1(filename), " with no real file")); + return EXISTS_AND_OLDER; /* symlink dates are meaningless */ + } +#endif /* SYMLINKS */ + return DOES_NOT_EXIST; + } + Trace((stderr, "check_for_newer: stat(%s) returns 0: file exists\n", + FnFilter1(filename))); + +#ifdef SYMLINKS + /* GRR OPTION: could instead do this test ONLY if G.symlnk is true */ + if (lstat(filename, &G.statbuf) == 0 && S_ISLNK(G.statbuf.st_mode)) { + Trace((stderr, "check_for_newer: %s is a symbolic link\n", + FnFilter1(filename))); + if (QCOND2 && !IS_OVERWRT_ALL) + Info(slide, 0, ((char *)slide, LoadFarString(FileIsSymLink), + FnFilter1(filename), "")); + return EXISTS_AND_OLDER; /* symlink dates are meaningless */ + } +#endif /* SYMLINKS */ + + NATIVE_TO_TIMET(G.statbuf.st_mtime) /* NOP unless MSC 7.0 or Macintosh */ + +#ifdef USE_EF_UT_TIME + /* The `Unix extra field mtime' should be used for comparison with the + * time stamp of the existing file >>>ONLY<<< when the EF info is also + * used to set the modification time of the extracted file. + */ + if (G.extra_field && +#ifdef IZ_CHECK_TZ + G.tz_is_valid && +#endif + (ef_scan_for_izux(G.extra_field, G.lrec.extra_field_length, 0, + G.lrec.last_mod_dos_datetime, &z_utime, NULL) + & EB_UT_FL_MTIME)) + { + TTrace((stderr, "check_for_newer: using Unix extra field mtime\n")); + existing = G.statbuf.st_mtime; + archive = z_utime.mtime; + } else { + /* round up existing filetime to nearest 2 seconds for comparison, + * but saturate in case of arithmetic overflow + */ + existing = ((G.statbuf.st_mtime & 1) && + (G.statbuf.st_mtime + 1 > G.statbuf.st_mtime)) ? + G.statbuf.st_mtime + 1 : G.statbuf.st_mtime; + archive = dos_to_unix_time(G.lrec.last_mod_dos_datetime); + } +#else /* !USE_EF_UT_TIME */ + /* round up existing filetime to nearest 2 seconds for comparison, + * but saturate in case of arithmetic overflow + */ + existing = ((G.statbuf.st_mtime & 1) && + (G.statbuf.st_mtime + 1 > G.statbuf.st_mtime)) ? + G.statbuf.st_mtime + 1 : G.statbuf.st_mtime; + archive = dos_to_unix_time(G.lrec.last_mod_dos_datetime); +#endif /* ?USE_EF_UT_TIME */ + + TTrace((stderr, "check_for_newer: existing %lu, archive %lu, e-a %ld\n", + (ulg)existing, (ulg)archive, (long)(existing-archive))); + + return (existing >= archive); + +} /* end function check_for_newer() */ + +#endif /* !VMS && !OS2 && !CMS_MVS */ + + + + + +/************************/ +/* Function do_string() */ +/************************/ + +int do_string(__G__ length, option) /* return PK-type error code */ + __GDEF + unsigned int length; /* without prototype, ush converted to this */ + int option; +{ + unsigned comment_bytes_left; + unsigned int block_len; + int error=PK_OK; +#ifdef AMIGA + char tmp_fnote[2 * AMIGA_FILENOTELEN]; /* extra room for squozen chars */ +#endif + + +/*--------------------------------------------------------------------------- + This function processes arbitrary-length (well, usually) strings. Four + major options are allowed: SKIP, wherein the string is skipped (pretty + logical, eh?); DISPLAY, wherein the string is printed to standard output + after undergoing any necessary or unnecessary character conversions; + DS_FN, wherein the string is put into the filename[] array after under- + going appropriate conversions (including case-conversion, if that is + indicated: see the global variable pInfo->lcflag); and EXTRA_FIELD, + wherein the `string' is assumed to be an extra field and is copied to + the (freshly malloced) buffer G.extra_field. The third option should + be OK since filename is dimensioned at 1025, but we check anyway. + + The string, by the way, is assumed to start at the current file-pointer + position; its length is given by 'length'. So start off by checking the + length of the string: if zero, we're already done. + ---------------------------------------------------------------------------*/ + + if (!length) + return PK_COOL; + + switch (option) { + +#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) + /* + * Special case: See if the comment begins with an autorun command line. + * Save that and display (or skip) the remainder. + */ + + case CHECK_AUTORUN: + case CHECK_AUTORUN_Q: + comment_bytes_left = length; + if (length >= 10) + { + block_len = readbuf(__G__ (char *)G.outbuf, 10); + if (block_len == 0) + return PK_EOF; + comment_bytes_left -= block_len; + G.outbuf[block_len] = '\0'; + if (!strcmp((char *)G.outbuf, "$AUTORUN$>")) { + char *eol; + length -= 10; + block_len = readbuf(__G__ G.autorun_command, + MIN(length, sizeof(G.autorun_command)-1)); + if (block_len == 0) + return PK_EOF; + comment_bytes_left -= block_len; + G.autorun_command[block_len] = '\0'; + A_TO_N(G.autorun_command); + eol = strchr(G.autorun_command, '\n'); + if (!eol) + eol = G.autorun_command + strlen(G.autorun_command) - 1; + length -= eol + 1 - G.autorun_command; + while (eol >= G.autorun_command && isspace(*eol)) + *eol-- = '\0'; +#ifdef WIN32 + /* Win9x console always uses OEM character coding, and + WinNT console is set to OEM charset by default, too */ + INTERN_TO_OEM(G.autorun_command, G.autorun_command); +#endif /* WIN32 */ + } + } + if (option == CHECK_AUTORUN_Q) /* don't display the remainder */ + length = 0; + /* seek to beginning of remaining part of comment -- rewind if */ + /* displaying entire comment, or skip to end if discarding it */ + seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + + (G.inptr - G.inbuf) + comment_bytes_left - length); + if (!length) + break; + /* FALL THROUGH... */ +#endif /* SFX && CHEAP_SFX_AUTORUN */ + + /* + * First normal case: print string on standard output. First set loop + * variables, then loop through the comment in chunks of OUTBUFSIZ bytes, + * converting formats and printing as we go. The second half of the + * loop conditional was added because the file might be truncated, in + * which case comment_bytes_left will remain at some non-zero value for + * all time. outbuf and slide are used as scratch buffers because they + * are available (we should be either before or in between any file pro- + * cessing). + */ + + case DISPLAY: + case DISPL_8: + comment_bytes_left = length; + block_len = OUTBUFSIZ; /* for the while statement, first time */ + while (comment_bytes_left > 0 && block_len > 0) { + register uch *p = G.outbuf; + register uch *q = G.outbuf; + + if ((block_len = readbuf(__G__ (char *)G.outbuf, + MIN((unsigned)OUTBUFSIZ, comment_bytes_left))) == 0) + return PK_EOF; + comment_bytes_left -= block_len; + + /* this is why we allocated an extra byte for outbuf: terminate + * with zero (ASCIIZ) */ + G.outbuf[block_len] = '\0'; + + /* remove all ASCII carriage returns from comment before printing + * (since used before A_TO_N(), check for CR instead of '\r') + */ + while (*p) { + while (*p == CR) + ++p; + *q++ = *p++; + } + /* could check whether (p - outbuf) == block_len here */ + *q = '\0'; + + if (option == DISPL_8) { + /* translate the text coded in the entry's host-dependent + "extended ASCII" charset into the compiler's (system's) + internal text code page */ + Ext_ASCII_TO_Native((char *)G.outbuf, G.pInfo->hostnum, + G.pInfo->hostver, G.pInfo->HasUxAtt, + FALSE); +#ifdef WINDLL + /* translate to ANSI (RTL internal codepage may be OEM) */ + INTERN_TO_ISO((char *)G.outbuf, (char *)G.outbuf); +#else /* !WINDLL */ +#ifdef WIN32 + /* Win9x console always uses OEM character coding, and + WinNT console is set to OEM charset by default, too */ + INTERN_TO_OEM((char *)G.outbuf, (char *)G.outbuf); +#endif /* WIN32 */ +#endif /* ?WINDLL */ + } else { + A_TO_N(G.outbuf); /* translate string to native */ + } + +#ifdef WINDLL + /* ran out of local mem -- had to cheat */ + win_fprintf((zvoid *)&G, stdout, length, (char *)G.outbuf); + win_fprintf((zvoid *)&G, stdout, 2, (char *)"\n\n"); +#else /* !WINDLL */ +#ifdef NOANSIFILT /* GRR: can ANSI be used with EBCDIC? */ + (*G.message)((zvoid *)&G, G.outbuf, (ulg)(q-G.outbuf), 0); +#else /* ASCII, filter out ANSI escape sequences and handle ^S (pause) */ + p = G.outbuf - 1; + q = slide; + while (*++p) { + int pause = FALSE; + + if (*p == 0x1B) { /* ASCII escape char */ + *q++ = '^'; + *q++ = '['; + } else if (*p == 0x13) { /* ASCII ^S (pause) */ + pause = TRUE; + if (p[1] == LF) /* ASCII LF */ + *q++ = *++p; + else if (p[1] == CR && p[2] == LF) { /* ASCII CR LF */ + *q++ = *++p; + *q++ = *++p; + } + } else + *q++ = *p; + if ((unsigned)(q-slide) > WSIZE-3 || pause) { /* flush */ + (*G.message)((zvoid *)&G, slide, (ulg)(q-slide), 0); + q = slide; + if (pause && G.extract_flag) /* don't pause for list/test */ + (*G.mpause)((zvoid *)&G, LoadFarString(QuitPrompt), 0); + } + } + (*G.message)((zvoid *)&G, slide, (ulg)(q-slide), 0); +#endif /* ?NOANSIFILT */ +#endif /* ?WINDLL */ + } + /* add '\n' if not at start of line */ + (*G.message)((zvoid *)&G, slide, 0L, 0x40); + break; + + /* + * Second case: read string into filename[] array. The filename should + * never ever be longer than FILNAMSIZ-1 (1024), but for now we'll check, + * just to be sure. + */ + + case DS_FN: + case DS_FN_L: + if (length >= FILNAMSIZ) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(FilenameTooLongTrunc))); + error = PK_WARN; + /* remember excess length in block_len */ + block_len = length - (FILNAMSIZ - 1); + length = FILNAMSIZ - 1; + } else + /* no excess size */ + block_len = 0; + if (readbuf(__G__ G.filename, length) == 0) + return PK_EOF; + G.filename[length] = '\0'; /* terminate w/zero: ASCIIZ */ + + /* translate the Zip entry filename coded in host-dependent "extended + ASCII" into the compiler's (system's) internal text code page */ + Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, + G.pInfo->HasUxAtt, (option == DS_FN_L)); + + if (G.pInfo->lcflag) /* replace with lowercase filename */ + STRLOWER(G.filename, G.filename); + + if (G.pInfo->vollabel && length > 8 && G.filename[8] == '.') { + char *p = G.filename+8; + while (*p++) + p[-1] = *p; /* disk label, and 8th char is dot: remove dot */ + } + + if (!block_len) /* no overflow, we're done here */ + break; + + /* + * We truncated the filename, so print what's left and then fall + * through to the SKIP routine. + */ + Info(slide, 0x401, ((char *)slide, "[ %s ]\n", FnFilter1(G.filename))); + length = block_len; /* SKIP the excess bytes... */ + /* FALL THROUGH... */ + + /* + * Third case: skip string, adjusting readbuf's internal variables + * as necessary (and possibly skipping to and reading a new block of + * data). + */ + + case SKIP: + /* cur_zipfile_bufstart already takes account of extra_bytes, so don't + * correct for it twice: */ + seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + + (G.inptr-G.inbuf) + length); + break; + + /* + * Fourth case: assume we're at the start of an "extra field"; malloc + * storage for it and read data into the allocated space. + */ + + case EXTRA_FIELD: + if (G.extra_field != (uch *)NULL) + free(G.extra_field); + if ((G.extra_field = (uch *)malloc(length)) == (uch *)NULL) { + Info(slide, 0x401, ((char *)slide, LoadFarString(ExtraFieldTooLong), + length)); + /* cur_zipfile_bufstart already takes account of extra_bytes, + * so don't correct for it twice: */ + seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + + (G.inptr-G.inbuf) + length); + } else + if (readbuf(__G__ (char *)G.extra_field, length) == 0) + return PK_EOF; + break; + +#ifdef AMIGA + /* + * Fifth case, for the Amiga only: take the comment that would ordinarily + * be skipped over, and turn it into a 79 character string that will be + * attached to the file as a "filenote" after it is extracted. + */ + + case FILENOTE: + if ((block_len = readbuf(__G__ tmp_fnote, (unsigned) + MIN(length, 2 * AMIGA_FILENOTELEN - 1))) == 0) + return PK_EOF; + if ((length -= block_len) > 0) /* treat remainder as in case SKIP: */ + seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + + (G.inptr - G.inbuf) + length); + /* convert multi-line text into single line with no ctl-chars: */ + tmp_fnote[block_len] = '\0'; + while ((short int) --block_len >= 0) + if ((unsigned) tmp_fnote[block_len] < ' ') + if (tmp_fnote[block_len+1] == ' ') /* no excess */ + strcpy(tmp_fnote+block_len, tmp_fnote+block_len+1); + else + tmp_fnote[block_len] = ' '; + tmp_fnote[AMIGA_FILENOTELEN - 1] = '\0'; + if (G.filenotes[G.filenote_slot]) + free(G.filenotes[G.filenote_slot]); /* should not happen */ + G.filenotes[G.filenote_slot] = NULL; + if (tmp_fnote[0]) { + if (!(G.filenotes[G.filenote_slot] = malloc(strlen(tmp_fnote)+1))) + return PK_MEM; + strcpy(G.filenotes[G.filenote_slot], tmp_fnote); + } + break; +#endif /* AMIGA */ + + } /* end switch (option) */ + + return error; + +} /* end function do_string() */ + + + + + +/***********************/ +/* Function makeword() */ +/***********************/ + +ush makeword(b) + ZCONST uch *b; +{ + /* + * Convert Intel style 'short' integer to non-Intel non-16-bit + * host format. This routine also takes care of byte-ordering. + */ + return (ush)((b[1] << 8) | b[0]); +} + + + + + +/***********************/ +/* Function makelong() */ +/***********************/ + +ulg makelong(sig) + ZCONST uch *sig; +{ + /* + * Convert intel style 'long' variable to non-Intel non-16-bit + * host format. This routine also takes care of byte-ordering. + */ + return (((ulg)sig[3]) << 24) + + (((ulg)sig[2]) << 16) + + (((ulg)sig[1]) << 8) + + ((ulg)sig[0]); +} + + + +#if CRYPT + +#ifdef NEED_STR2ISO +/**********************/ +/* Function str2iso() */ +/**********************/ + +char *str2iso(dst, src) + char *dst; /* destination buffer */ + register ZCONST char *src; /* source string */ +{ +#ifdef INTERN_TO_ISO + INTERN_TO_ISO(src, dst); +#else + register uch c; + register char *dstp = dst; + + do { + c = (uch)foreign(*src++); + *dstp++ = (char)ASCII2ISO(c); + } while (c != '\0'); +#endif + + return dst; +} +#endif /* NEED_STR2ISO */ + + +#ifdef NEED_STR2OEM +/**********************/ +/* Function str2oem() */ +/**********************/ + +char *str2oem(dst, src) + char *dst; /* destination buffer */ + register ZCONST char *src; /* source string */ +{ +#ifdef INTERN_TO_OEM + INTERN_TO_OEM(src, dst); +#else + register uch c; + register char *dstp = dst; + + do { + c = (uch)foreign(*src++); + *dstp++ = (char)ASCII2OEM(c); + } while (c != '\0'); +#endif + + return dst; +} +#endif /* NEED_STR2OEM */ + +#endif /* CRYPT */ + + +#ifdef ZMEM /* memset/memcmp/memcpy for systems without either them or */ + /* bzero/bcmp/bcopy */ + /* (no known systems as of 960211) */ + +/*********************/ +/* Function memset() */ +/*********************/ + +zvoid *memset(buf, init, len) + register zvoid *buf; /* buffer location */ + register int init; /* initializer character */ + register unsigned int len; /* length of the buffer */ +{ + zvoid *start; + + start = buf; + while (len--) + *((char *)buf++) = (char)init; + return start; +} + + + +/*********************/ +/* Function memcmp() */ +/*********************/ + +int memcmp(b1, b2, len) + register ZCONST zvoid *b1; + register ZCONST zvoid *b2; + register unsigned int len; +{ + register int c; + + if (len > 0) do { + if ((c = (int)(*((ZCONST unsigned char *)b1)++) - + (int)(*((ZCONST unsigned char *)b2)++)) != 0) + return c; + } while (--len > 0) + return 0; +} + + + +/*********************/ +/* Function memcpy() */ +/*********************/ + +zvoid *memcpy(dst, src, len) + register zvoid *dst; + register ZCONST zvoid *src; + register unsigned int len; +{ + zvoid *start; + + start = dst; + while (len-- > 0) + *((char *)dst)++ = *((ZCONST char *)src)++; + return start; +} + +#endif /* ZMEM */ + + + + +#ifdef NO_STRNICMP + +/************************/ +/* Function zstrnicmp() */ +/************************/ + +int zstrnicmp(s1, s2, n) + register ZCONST char *s1, *s2; + register unsigned n; +{ + for (; n > 0; --n, ++s1, ++s2) { + + if (ToLower(*s1) != ToLower(*s2)) + /* test includes early termination of one string */ + return (ToLower(*s1) < ToLower(*s2))? -1 : 1; + + if (*s1 == '\0') /* both strings terminate early */ + return 0; + } + return 0; +} + +#endif /* NO_STRNICMP */ + + + + +#ifdef REGULUS /* returns the inode number on success(!)...argh argh argh */ +# undef stat + +/********************/ +/* Function zstat() */ +/********************/ + +int zstat(p, s) + ZCONST char *p; + struct stat *s; +{ + return (stat((char *)p,s) >= 0? 0 : (-1)); +} + +#endif /* REGULUS */ + + + + +#ifdef _MBCS + +/* DBCS support for Info-ZIP's zip (mainly for japanese (-: ) + * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) + * This code is public domain! Date: 1998/12/20 + */ + +/************************/ +/* Function plastchar() */ +/************************/ + +char *plastchar(ptr, len) + ZCONST char *ptr; + extent len; +{ + unsigned clen; + ZCONST char *oldptr = ptr; + while(*ptr != '\0' && len > 0){ + oldptr = ptr; + clen = CLEN(ptr); + ptr += clen; + len -= clen; + } + return (char *)oldptr; +} + + +#ifdef NEED_UZMBSCHR +/***********************/ +/* Function uzmbschr() */ +/***********************/ + +unsigned char *uzmbschr(str, c) + ZCONST unsigned char *str; + unsigned int c; +{ + while(*str != '\0'){ + if (*str == c) {return (unsigned char *)str;} + INCSTR(str); + } + return NULL; +} +#endif /* NEED_UZMBSCHR */ + + +#ifdef NEED_UZMBSRCHR +/************************/ +/* Function uzmbsrchr() */ +/************************/ + +unsigned char *uzmbsrchr(str, c) + ZCONST unsigned char *str; + unsigned int c; +{ + unsigned char *match = NULL; + while(*str != '\0'){ + if (*str == c) {match = (unsigned char *)str;} + INCSTR(str); + } + return match; +} +#endif /* NEED_UZMBSRCHR */ +#endif /* _MBCS */ + + + + + +#ifdef SMALL_MEM + +/*******************************/ +/* Function fLoadFarString() */ /* (and friends...) */ +/*******************************/ + +char *fLoadFarString(__GPRO__ const char Far *sz) +{ + (void)zfstrcpy(G.rgchBigBuffer, sz); + return G.rgchBigBuffer; +} + +char *fLoadFarStringSmall(__GPRO__ const char Far *sz) +{ + (void)zfstrcpy(G.rgchSmallBuffer, sz); + return G.rgchSmallBuffer; +} + +char *fLoadFarStringSmall2(__GPRO__ const char Far *sz) +{ + (void)zfstrcpy(G.rgchSmallBuffer2, sz); + return G.rgchSmallBuffer2; +} + + + + +#if (!defined(_MSC_VER) || (_MSC_VER < 600)) +/*************************/ +/* Function zfstrcpy() */ /* portable clone of _fstrcpy() */ +/*************************/ + +char Far * Far zfstrcpy(char Far *s1, const char Far *s2) +{ + char Far *p = s1; + + while ((*s1++ = *s2++) != '\0'); + return p; +} +#endif /* !_MSC_VER || (_MSC_VER < 600) */ + +#endif /* SMALL_MEM */ + +const char *BOINC_RCSID_eb8fddfb0f = "$Id: fileio.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/funzip.c boinc-7.0.14+dfsg/zip/unzip/funzip.c --- boinc-7.0.7+dfsg/zip/unzip/funzip.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/funzip.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,564 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* funzip.c -- by Mark Adler */ + +#define VERSION "3.94 of 20 January 2002" + + +/* Copyright history: + - Starting with UnZip 5.41 of 16-April-2000, this source file + is covered by the Info-Zip LICENSE cited above. + - Prior versions of this source file, found in UnZip source packages + up to UnZip 5.40, were put in the public domain. + The original copyright note by Mark Adler was: + "You can do whatever you like with this source file, + though I would prefer that if you modify it and + redistribute it that you include comments to that effect + with your name and the date. Thank you." + + History: + vers date who what + ---- --------- -------------- ------------------------------------ + 1.0 13 Aug 92 M. Adler really simple unzip filter. + 1.1 13 Aug 92 M. Adler cleaned up somewhat, give help if + stdin not redirected, warn if more + zip file entries after the first. + 1.2 15 Aug 92 M. Adler added check of lengths for stored + entries, added more help. + 1.3 16 Aug 92 M. Adler removed redundant #define's, added + decryption. + 1.4 27 Aug 92 G. Roelofs added exit(0). + 1.5 1 Sep 92 K. U. Rommel changed read/write modes for OS/2. + 1.6 6 Sep 92 G. Roelofs modified to use dummy crypt.c and + crypt.h instead of -DCRYPT. + 1.7 23 Sep 92 G. Roelofs changed to use DOS_OS2; included + crypt.c under MS-DOS. + 1.8 9 Oct 92 M. Adler improved inflation error msgs. + 1.9 17 Oct 92 G. Roelofs changed ULONG/UWORD/byte to ulg/ush/uch; + renamed inflate_entry() to inflate(); + adapted to use new, in-place zdecode. + 2.0 22 Oct 92 M. Adler allow filename argument, prompt for + passwords and don't echo, still allow + command-line password entry, but as an + option. + 2.1 23 Oct 92 J-l. Gailly fixed crypt/store bug, + G. Roelofs removed crypt.c under MS-DOS, fixed + decryption check to compare single byte. + 2.2 28 Oct 92 G. Roelofs removed declaration of key. + 2.3 14 Dec 92 M. Adler replaced fseek (fails on stdin for SCO + Unix V.3.2.4). added quietflg for + inflate.c. + 3.0 11 May 93 M. Adler added gzip support + 3.1 9 Jul 93 K. U. Rommel fixed OS/2 pipe bug (PIPE_ERROR) + 3.2 4 Sep 93 G. Roelofs moved crc_32_tab[] to tables.h; used FOPx + from unzip.h; nuked OUTB macro and outbuf; + replaced flush(); inlined FlushOutput(); + renamed decrypt to encrypted + 3.3 29 Sep 93 G. Roelofs replaced ReadByte() with NEXTBYTE macro; + revised (restored?) flush(); added FUNZIP + 3.4 21 Oct 93 G. Roelofs renamed quietflg to qflag; changed outcnt, + H. Gessau second updcrc() arg and flush() arg to ulg; + added inflate_free(); added "g =" to null + getc(in) to avoid compiler warnings + 3.5 31 Oct 93 H. Gessau changed DOS_OS2 to DOS_NT_OS2 + 3.6 6 Dec 93 H. Gessau added "near" to mask_bits[] + 3.7 9 Dec 93 G. Roelofs added extent typecasts to fwrite() checks + 3.8 28 Jan 94 GRR/JlG initialized g variable in main() for gcc + 3.81 22 Feb 94 M. Hanning-Lee corrected usage message + 3.82 27 Feb 94 G. Roelofs added some typecasts to avoid warnings + 3.83 22 Jul 94 G. Roelofs changed fprintf to macro for DLLs + - 2 Aug 94 - public release with UnZip 5.11 + - 28 Aug 94 - public release with UnZip 5.12 + 3.84 1 Oct 94 K. U. Rommel changes for Metaware High C + 3.85 29 Oct 94 G. Roelofs changed fprintf macro to Info + 3.86 7 May 95 K. Davis RISCOS patches; + P. Kienitz Amiga patches + 3.87 12 Aug 95 G. Roelofs inflate_free(), DESTROYGLOBALS fixes + 3.88 4 Sep 95 C. Spieler reordered macro to work around MSC 5.1 bug + 3.89 22 Nov 95 PK/CS ifdef'd out updcrc() for ASM_CRC + 3.9 17 Dec 95 G. Roelofs modified for USE_ZLIB (new fillinbuf()) + - 30 Apr 96 - public release with UnZip 5.2 + 3.91 17 Aug 96 G. Roelofs main() -> return int (Peter Seebach) + 3.92 13 Apr 97 G. Roelofs minor cosmetic fixes to messages + - 22 Apr 97 - public release with UnZip 5.3 + - 31 May 97 - public release with UnZip 5.31 + 3.93 20 Sep 97 G. Roelofs minor cosmetic fixes to messages + - 3 Nov 97 - public release with UnZip 5.32 + - 28 Nov 98 - public release with UnZip 5.4 + - 16 Apr 00 - public release with UnZip 5.41 + - 14 Jan 01 - public release with UnZip 5.42 + 3.94 20 Feb 01 C. Spieler added support for Deflate64(tm) + */ + + +/* + + All funzip does is take a zipfile from stdin and decompress the + first entry to stdout. The entry has to be either deflated or + stored. If the entry is encrypted, then the decryption password + must be supplied on the command line as the first argument. + + funzip needs to be linked with inflate.o and crypt.o compiled from + the unzip source. If decryption is desired, the full version of + crypt.c (and crypt.h) from zcrypt28.zip or later must be used. + + */ + +#ifndef FUNZIP +# define FUNZIP +#endif +#define UNZIP_INTERNAL +#include "unzip.h" +//#include "crypt.h" +#include "ttyio.h" + +#ifdef EBCDIC +# undef EBCDIC /* don't need ebcdic[] */ +#endif +#include "tables.h" /* crc_32_tab[] */ + +#ifndef USE_ZLIB /* zlib's function is called inflate(), too */ +# define UZinflate inflate +#endif + +/* PKZIP header definitions */ +#define ZIPMAG 0x4b50 /* two-byte zip lead-in */ +#define LOCREM 0x0403 /* remaining two bytes in zip signature */ +#define LOCSIG 0x04034b50L /* full signature */ +#define LOCFLG 4 /* offset of bit flag */ +#define CRPFLG 1 /* bit for encrypted entry */ +#define EXTFLG 8 /* bit for extended local header */ +#define LOCHOW 6 /* offset of compression method */ +#define LOCTIM 8 /* file mod time (for decryption) */ +#define LOCCRC 12 /* offset of crc */ +#define LOCSIZ 16 /* offset of compressed size */ +#define LOCLEN 20 /* offset of uncompressed length */ +#define LOCFIL 24 /* offset of file name field length */ +#define LOCEXT 26 /* offset of extra field length */ +#define LOCHDR 28 /* size of local header, including LOCREM */ +#define EXTHDR 16 /* size of extended local header, inc sig */ + +/* GZIP header definitions */ +#define GZPMAG 0x8b1f /* two-byte gzip lead-in */ +#define GZPHOW 0 /* offset of method number */ +#define GZPFLG 1 /* offset of gzip flags */ +#define GZPMUL 2 /* bit for multiple-part gzip file */ +#define GZPISX 4 /* bit for extra field present */ +#define GZPISF 8 /* bit for filename present */ +#define GZPISC 16 /* bit for comment present */ +#define GZPISE 32 /* bit for encryption */ +#define GZPTIM 2 /* offset of Unix file modification time */ +#define GZPEXF 6 /* offset of extra flags */ +#define GZPCOS 7 /* offset of operating system compressed on */ +#define GZPHDR 8 /* length of minimal gzip header */ + +#ifdef THEOS +/* Macros cause stack overflow in compiler */ +ush SH(uch* p) { return ((ush)(uch)((p)[0]) | ((ush)(uch)((p)[1]) << 8)); } +ulg LG(uch* p) { return ((ulg)(SH(p)) | ((ulg)(SH((p)+2)) << 16)); } +#else /* !THEOS */ +/* Macros for getting two-byte and four-byte header values */ +#define SH(p) ((ush)(uch)((p)[0]) | ((ush)(uch)((p)[1]) << 8)) +#define LG(p) ((ulg)(SH(p)) | ((ulg)(SH((p)+2)) << 16)) +#endif /* ?THEOS */ + +/* Function prototypes */ +static void err OF((int, char *)); +#if (defined(USE_DEFLATE64) && defined(__16BIT__)) +static int partflush OF((uch *rawbuf, unsigned w)); +#endif +int main OF((int, char **)); + +/* Globals */ +FILE *out; /* output file (*in moved to G struct) */ +ulg outsiz; /* total bytes written to out */ +int encrypted; /* flag to turn on decryption */ + +/* Masks for inflate.c */ +ZCONST ush near mask_bits[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + + +#ifdef USE_ZLIB + +int fillinbuf(__G) +__GDEF +/* Fill input buffer for pull-model inflate() in zlib. Return the number of + * bytes in inbuf. */ +{ +/* GRR: check return value from fread(): same as read()? check errno? */ + if ((G.incnt = fread((char *)G.inbuf, 1, INBUFSIZ, G.in)) <= 0) + return 0; + G.inptr = G.inbuf; + +#if CRYPT + if (encrypted) { + uch *p; + int n; + + for (n = G.incnt, p = G.inptr; n--; p++) + zdecode(*p); + } +#endif /* CRYPT */ + + return G.incnt; + +} + +#endif /* USE_ZLIB */ + + +#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) +#ifdef USE_ZLIB +ZCONST uLongf *get_crc_table_boinc() +{ + return (ZCONST uLongf *)crc_32_tab; +} +#else /* !USE_ZLIB */ +ZCONST ulg near *get_crc_table_boinc() +{ + return crc_32_tab; +} +#endif /* ?USE_ZLIB */ +#endif /* !USE_ZLIB || USE_OWN_CRCTAB */ + + +static void err(n, m) +int n; +char *m; +/* Exit on error with a message and a code */ +{ + Info(slide, 1, ((char *)slide, "funzip error: %s\n", m)); + DESTROYGLOBALS(); + EXIT(n); +} + + +#if (defined(USE_DEFLATE64) && defined(__16BIT__)) + +static int partflush(rawbuf, w) +uch *rawbuf; /* start of buffer area to flush */ +extent w; /* number of bytes to flush */ +{ + G.crc32val = crc32(G.crc32val, rawbuf, (extent)w); + if (fwrite((char *)rawbuf,1,(extent)w,out) != (extent)w && !PIPE_ERROR) + err(9, "out of space on stdout"); + outsiz += w; + return 0; +} + + +int flush(w) /* used by inflate.c (FLUSH macro) */ +ulg w; /* number of bytes to flush */ +{ + uch *rawbuf; + int ret; + + /* On 16-bit systems (MSDOS, OS/2 1.x), the standard C library functions + * cannot handle writes of 64k blocks at once. For these systems, the + * blocks to flush are split into pieces of 32k or less. + */ + rawbuf = slide; + while (w > 0x8000L) { + ret = partflush(rawbuf, 0x8000); + if (ret != PK_OK) + return ret; + w -= 0x8000L; + rawbuf += (unsigned)0x8000; + } + return partflush(rawbuf, (extent)w); +} /* end function flush() */ + +#else /* !(USE_DEFLATE64 && __16BIT__) */ + +int flush(w) /* used by inflate.c (FLUSH macro) */ +ulg w; /* number of bytes to flush */ +{ + G.crc32val = crc32(G.crc32val, slide, (extent)w); + if (fwrite((char *)slide,1,(extent)w,out) != (extent)w && !PIPE_ERROR) + err(9, "out of space on stdout"); + outsiz += w; + return 0; +} + +#endif /* ?(USE_DEFLATE64 && __16BIT__) */ + + +int main(argc, argv) +int argc; +char **argv; +/* Given a zipfile on stdin, decompress the first entry to stdout. */ +{ + ush n; + uch h[LOCHDR]; /* first local header (GZPHDR < LOCHDR) */ + int g = 0; /* true if gzip format */ + unsigned method = 0; /* initialized here to shut up gcc warning */ +#if CRYPT + char *s = " [-password]"; + char *p; /* password */ +#else /* !CRYPT */ + char *s = ""; +#endif /* ?CRYPT */ + CONSTRUCTGLOBALS(); + + /* skip executable name */ + argc--; + argv++; + +#if CRYPT + /* get the command line password, if any */ + p = (char *)NULL; + if (argc && **argv == '-') + { + argc--; + p = 1 + *argv++; + } +#endif /* CRYPT */ + +#ifdef MALLOC_WORK + /* The following expression is a cooked-down simplyfication of the + calculation for the work area size of UnZip (see unzip.c). For + fUnZip, the work area does not need to match the granularity + of the complex unshrink structures, because it only supports + inflation. But, like in UnZip, the zcalloc() wrapper function + is needed for the allocation, to support the 64kByte buffer on + 16-bit systems. + */ +# define UZ_SLIDE_CHUNK (sizeof(shrint)+sizeof(uch)+sizeof(uch)) +# define UZ_NUMOF_CHUNKS (unsigned)( (WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK ) + G.area.Slide = (uch *)zcalloc(UZ_NUMOF_CHUNKS, UZ_SLIDE_CHUNK); +# undef UZ_SLIDE_CHUNK +# undef UZ_NUMOF_CHUNKS +#endif + + /* if no file argument and stdin not redirected, give the user help */ + if (argc == 0 && isatty(0)) + { + Info(slide, 1, ((char *)slide, "fUnZip (filter UnZip), version %s\n", + VERSION)); + Info(slide, 1, ((char *)slide, "usage: ... | funzip%s | ...\n", s)); + Info(slide, 1, ((char *)slide, " ... | funzip%s > outfile\n", s)); + Info(slide, 1, ((char *)slide, " funzip%s infile.zip > outfile\n",s)); + Info(slide, 1, ((char *)slide, " funzip%s infile.gz > outfile\n", s)); + Info(slide, 1, ((char *)slide, "Extracts to stdout the gzip file or first\ + zip entry of stdin or the given file.\n")); + DESTROYGLOBALS(); + EXIT(3); + } + + /* prepare to be a binary filter */ + if (argc) + { + if ((G.in = fopen(*argv, FOPR)) == (FILE *)NULL) + err(2, "cannot find input file"); + } + else + { +#ifdef DOS_FLX_NLM_OS2_W32 +#if (defined(__HIGHC__) && !defined(FLEXOS)) + setmode(stdin, _BINARY); +#else + setmode(0, O_BINARY); /* some buggy C libraries require BOTH setmode() */ +#endif /* call AND the fdopen() in binary mode :-( */ +#endif /* DOS_FLX_NLM_OS2_W32 */ + +#ifdef RISCOS + G.in = stdin; +#else + if ((G.in = fdopen(0, FOPR)) == (FILE *)NULL) + err(2, "cannot find stdin"); +#endif + } + +#ifdef DOS_FLX_H68_NLM_OS2_W32 +#if (defined(__HIGHC__) && !defined(FLEXOS)) + setmode(stdout, _BINARY); +#else + setmode(1, O_BINARY); +#endif +#endif /* DOS_FLX_H68_NLM_OS2_W32 */ + +#ifdef RISCOS + out = stdout; +#else + if ((out = fdopen(1, FOPW)) == (FILE *)NULL) + err(2, "cannot write to stdout"); +#endif + + /* read local header, check validity, and skip name and extra fields */ + n = getc(G.in); n |= getc(G.in) << 8; + if (n == ZIPMAG) + { + if (fread((char *)h, 1, LOCHDR, G.in) != LOCHDR || SH(h) != LOCREM) + err(3, "invalid zipfile"); + switch (method = SH(h + LOCHOW)) { + case STORED: + case DEFLATED: +#ifdef USE_DEFLATE64 + case ENHDEFLATED: +#endif + break; + default: + err(3, "first entry not deflated or stored--cannot unpack"); + break; + } + for (n = SH(h + LOCFIL); n--; ) g = getc(G.in); + for (n = SH(h + LOCEXT); n--; ) g = getc(G.in); + g = 0; + encrypted = h[LOCFLG] & CRPFLG; + } + else if (n == GZPMAG) + { + if (fread((char *)h, 1, GZPHDR, G.in) != GZPHDR) + err(3, "invalid gzip file"); + if ((method = h[GZPHOW]) != DEFLATED && method != ENHDEFLATED) + err(3, "gzip file not deflated"); + if (h[GZPFLG] & GZPMUL) + err(3, "cannot handle multi-part gzip files"); + if (h[GZPFLG] & GZPISX) + { + n = getc(G.in); n |= getc(G.in) << 8; + while (n--) g = getc(G.in); + } + if (h[GZPFLG] & GZPISF) + while ((g = getc(G.in)) != 0 && g != EOF) ; + if (h[GZPFLG] & GZPISC) + while ((g = getc(G.in)) != 0 && g != EOF) ; + g = 1; + encrypted = h[GZPFLG] & GZPISE; + } + else + err(3, "input not a zip or gzip file"); + + /* if entry encrypted, decrypt and validate encryption header */ + if (encrypted) +#if CRYPT + { + ush i, e; + + if (p == (char *)NULL) { + if ((p = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL) + err(1, "out of memory"); + else if ((p = getp("Enter password: ", p, IZ_PWLEN+1)) == (char *)NULL) + err(1, "no tty to prompt for password"); + } +#if (defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB)) + /* initialize crc_32_tab pointer for decryption */ + CRC_32_TAB = (ZCONST ulg Far *)get_crc_table_boinc(); +#endif + init_keys(p); + for (i = 0; i < RAND_HEAD_LEN; i++) + e = NEXTBYTE; + if (e != (ush)(h[LOCFLG] & EXTFLG ? h[LOCTIM + 1] : h[LOCCRC + 3])) + err(3, "incorrect password for first entry"); + } +#else /* !CRYPT */ + err(3, "cannot decrypt entry (need to recompile with full crypt.c)"); +#endif /* ?CRYPT */ + + /* prepare output buffer and crc */ + G.outptr = slide; + G.outcnt = 0L; + outsiz = 0L; + G.crc32val = CRCVAL_INITIAL; + + /* decompress */ + if (g || h[LOCHOW]) + { /* deflated entry */ + int r; + +#ifdef USE_ZLIB + /* need to allocate and prepare input buffer */ + if ((G.inbuf = (uch *)malloc(INBUFSIZ)) == (uch *)NULL) + err(1, "out of memory"); +#endif /* USE_ZLIB */ + if ((r = UZinflate(__G__ (method == ENHDEFLATED))) != 0) { + if (r == 3) + err(1, "out of memory"); + else + err(4, "invalid compressed data--format violated"); + } + inflate_free(__G); + } + else + { /* stored entry */ + register ulg n; + + n = LG(h + LOCLEN); +#if CRYPT + if (n != LG(h + LOCSIZ) - (encrypted ? RAND_HEAD_LEN : 0)) { +#else + if (n != LG(h + LOCSIZ)) { +#endif + Info(slide, 1, ((char *)slide, "len %ld, siz %ld\n", n, LG(h + LOCSIZ))); + err(4, "invalid compressed data--length mismatch"); + } + while (n--) { + ush c = getc(G.in); +#if CRYPT + if (encrypted) + zdecode(c); +#endif + *G.outptr++ = (uch)c; +#if (defined(USE_DEFLATE64) && defined(__16BIT__)) + if (++G.outcnt == (WSIZE>>1)) /* do FlushOutput() */ +#else + if (++G.outcnt == WSIZE) /* do FlushOutput() */ +#endif + { + G.crc32val = crc32(G.crc32val, slide, (extent)G.outcnt); + if (fwrite((char *)slide, 1,(extent)G.outcnt,out) != (extent)G.outcnt + && !PIPE_ERROR) + err(9, "out of space on stdout"); + outsiz += G.outcnt; + G.outptr = slide; + G.outcnt = 0L; + } + } + } + if (G.outcnt) /* flush one last time; no need to reset G.outptr/outcnt */ + { + G.crc32val = crc32(G.crc32val, slide, (extent)G.outcnt); + if (fwrite((char *)slide, 1,(extent)G.outcnt,out) != (extent)G.outcnt + && !PIPE_ERROR) + err(9, "out of space on stdout"); + outsiz += G.outcnt; + } + fflush(out); + + /* if extended header, get it */ + if (g) + { + if (fread((char *)h + LOCCRC, 1, 8, G.in) != 8) + err(3, "gzip file ended prematurely"); + } + else + if ((h[LOCFLG] & EXTFLG) && + fread((char *)h + LOCCRC - 4, 1, EXTHDR, G.in) != EXTHDR) + err(3, "zipfile ended prematurely"); + + /* validate decompression */ + if (LG(h + LOCCRC) != G.crc32val) + err(4, "invalid compressed data--crc error"); + if (LG((g ? (h + LOCSIZ) : (h + LOCLEN))) != outsiz) + err(4, "invalid compressed data--length error"); + + /* check if there are more entries */ + if (!g && fread((char *)h, 1, 4, G.in) == 4 && LG(h) == LOCSIG) + Info(slide, 1, ((char *)slide, + "funzip warning: zipfile has more than one entry--rest ignored\n")); + + DESTROYGLOBALS(); + RETURN (0); +} + +const char *BOINC_RCSID_b041382118 = "$Id: funzip.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/funzip.txt boinc-7.0.14+dfsg/zip/unzip/funzip.txt --- boinc-7.0.7+dfsg/zip/unzip/funzip.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/funzip.txt 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,106 @@ + +FUNZIP(1L) FUNZIP(1L) + +NAME + funzip - filter for extracting from a ZIP archive in a + pipe + +SYNOPSIS + funzip [-password] [input[.zip|.gz]] + +ARGUMENTS + [-password] + Optional password to be used if ZIP archive is + encrypted. Decryption may not be supported at some + sites. See DESCRIPTION for more details. + + [input[.zip|.gz]] + Optional input archive file specification. See + DESCRIPTION for details. + +DESCRIPTION + funzip without a file argument acts as a filter; that is, + it assumes that a ZIP archive (or a gzip'd(1) file) is + being piped into standard input, and it extracts the first + member from the archive to stdout. When stdin comes from + a tty device, funzip assumes that this cannot be a stream + of (binary) compressed data and shows a short help text, + instead. If there is a file argument, then input is read + from the specified file instead of from stdin. + + A password for encrypted zip files can be specified on the + command line (preceding the file name, if any) by prefix- + ing the password with a dash. Note that this constitutes + a security risk on many systems; currently running pro- + cesses are often visible via simple commands (e.g., ps(1) + under Unix), and command-line histories can be read. If + the first entry of the zip file is encrypted and no pass- + word is specified on the command line, then the user is + prompted for a password and the password is not echoed on + the console. + + Given the limitation on single-member extraction, funzip + is most useful in conjunction with a secondary archiver + program such as tar(1). The following section includes an + example illustrating this usage in the case of disk back- + ups to tape. + +EXAMPLES + To use funzip to extract the first member file of the + archive test.zip and to pipe it into more(1): + + funzip test.zip | more + + To use funzip to test the first member file of test.zip + (any errors will be reported on standard error): + + funzip test.zip > /dev/null + +Info-ZIP 17 February 2002 (v3.94) 1 + +FUNZIP(1L) FUNZIP(1L) + + To use zip and funzip in place of compress(1) and zcat(1) + (or gzip(1L) and gzcat(1L)) for tape backups: + + tar cf - . | zip -7 | dd of=/dev/nrst0 obs=8k + dd if=/dev/nrst0 ibs=8k | funzip | tar xf - + + (where, for example, nrst0 is a SCSI tape drive). + +BUGS + When piping an encrypted file into more and allowing fun- + zip to prompt for password, the terminal may sometimes be + reset to a non-echo mode. This is apparently due to a + race condition between the two programs; funzip changes + the terminal mode to non-echo before more reads its state, + and more then ``restores'' the terminal to this mode + before exiting. To recover, run funzip on the same file + but redirect to /dev/null rather than piping into more; + after prompting again for the password, funzip will reset + the terminal properly. + + There is presently no way to extract any member but the + first from a ZIP archive. This would be useful in the + case where a ZIP archive is included within another + archive. In the case where the first member is a direc- + tory, funzip simply creates the directory and exits. + + The functionality of funzip should be incorporated into + unzip itself (future release). + +SEE ALSO + gzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zipcloak(1L), + zipinfo(1L), zipnote(1L), zipsplit(1L) + +URL + The Info-ZIP home page is currently at + http://www.info-zip.org/pub/infozip/ + or + ftp://ftp.info-zip.org/pub/infozip/ . + +AUTHOR + Mark Adler (Info-ZIP) + +Info-ZIP 17 February 2002 (v3.94) 2 + diff -Nru boinc-7.0.7+dfsg/zip/unzip/gbloffs.c boinc-7.0.14+dfsg/zip/unzip/gbloffs.c --- boinc-7.0.7+dfsg/zip/unzip/gbloffs.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/gbloffs.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,106 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* Write out a fragment of assembly source giving offsets in "Uz_Globs" + * and "struct huft": + */ + +#define UNZIP_INTERNAL +#include "unzip.h" +//#include "crypt.h" + +#ifndef REENTRANT + Uz_Globs G; +#endif + +static int asm_setflag(const char *flagname); +static int ccp_setflag(const char *flagname); + +static int asm_setflag(const char *flagname) +{ + static const char asm_flagdef[] = "%-15s EQU 1\n"; + return printf(asm_flagdef, flagname); +} +static int ccp_setflag(const char *flagname) +{ + static const char ccp_flagdef[] = "#ifndef %s\n# define %s\n#endif\n"; + return printf(ccp_flagdef, flagname, flagname); +} + +int main(argc, argv) + int argc; + char **argv; +{ +#ifdef REENTRANT + Uz_Globs *pG = NULL; +#endif + struct huft *t = NULL; + static const char asm_offsdef[] = "%-15s EQU %lu\n"; + static const char ccp_offsdef[] = "#define %-15s %lu\n"; + + const char *out_format; + int (*set_flag)(const char *flagname); + int ccp_select = 0; + + if (argc > 1 && argv[1] != NULL && !strcmp(argv[1], "-ccp")) + ccp_select = 1; + + if (ccp_select) { + out_format = ccp_offsdef; + set_flag = ccp_setflag; + } else { + out_format = asm_offsdef; + set_flag = asm_setflag; + } + + printf(out_format, "h_e", (ulg)&t->e - (ulg)t); + printf(out_format, "h_b", (ulg)&t->b - (ulg)t); + printf(out_format, "h_v_n", (ulg)&t->v.n - (ulg)t); + printf(out_format, "h_v_t", (ulg)&t->v.t - (ulg)t); + printf(out_format, "SIZEOF_huft", (ulg)sizeof(struct huft)); + + printf(out_format, "bb", (ulg)&G.bb - (ulg)&G); + printf(out_format, "bk", (ulg)&G.bk - (ulg)&G); + printf(out_format, "wp", (ulg)&G.wp - (ulg)&G); +#ifdef FUNZIP + printf(out_format, "in", (ulg)&G.in - (ulg)&G); +#else + printf(out_format, "incnt", (ulg)&G.incnt - (ulg)&G); + printf(out_format, "inptr", (ulg)&G.inptr - (ulg)&G); + printf(out_format, "csize", (ulg)&G.csize - (ulg)&G); + printf(out_format, "mem_mode", (ulg)&G.mem_mode - (ulg)&G); +#endif + printf(out_format, "redirslide", (ulg)&redirSlide - (ulg)&G); + printf(out_format, "SIZEOF_slide", (ulg)sizeof(redirSlide)); +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + printf(out_format, "_wsize", (ulg)&G._wsize - (ulg)&G); +#endif /* DLL && !NO_SLIDE_REDIR */ + printf(out_format, "CRYPT", (ulg)CRYPT); +#ifdef FUNZIP + (*set_flag)("FUNZIP"); +#endif +#ifdef SFX + (*set_flag)("SFX"); +#endif +#ifdef REENTRANT + (*set_flag)("REENTRANT"); +#endif +#ifdef DLL + (*set_flag)("DLL"); +# ifdef NO_SLIDE_REDIR + (*set_flag)("NO_SLIDE_REDIR"); +# endif +#endif +#ifdef USE_DEFLATE64 + (*set_flag)("USE_DEFLATE64"); +#endif + + return 0; +} + +const char *BOINC_RCSID_b45580ebc4 = "$Id: gbloffs.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/globals.c boinc-7.0.14+dfsg/zip/unzip/globals.c --- boinc-7.0.7+dfsg/zip/unzip/globals.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/globals.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,216 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + globals.c + + Routines to allocate and initialize globals, with or without threads. + + Contents: registerGlobalPointer() + deregisterGlobalPointer() + getGlobalPointer() + globalsCtor() + + ---------------------------------------------------------------------------*/ + + +#define UNZIP_INTERNAL +#include "unzip.h" + +#ifndef FUNZIP +/* initialization of sigs is completed at runtime so unzip(sfx) executable + * won't look like a zipfile + */ +char central_hdr_sig[4] = {0, 0, 0x01, 0x02}; +char local_hdr_sig[4] = {0, 0, 0x03, 0x04}; +char end_central_sig[4] = {0, 0, 0x05, 0x06}; +/* extern char extd_local_sig[4] = {0, 0, 0x07, 0x08}; NOT USED YET */ + +ZCONST char *fnames[2] = {"*", NULL}; /* default filenames vector */ +#endif + +#ifndef REENTRANT + Uz_Globs G; +#else /* REENTRANT */ + +# ifndef USETHREADID + Uz_Globs *GG; +# else /* USETHREADID */ +# define THREADID_ENTRIES 0x40 + + int lastScan; + Uz_Globs *threadPtrTable[THREADID_ENTRIES]; + ulg threadIdTable [THREADID_ENTRIES] = { + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* Make sure there are */ + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* THREADID_ENTRIES 0s */ + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 + }; + + static ZCONST char Far TooManyThreads[] = + "error: more than %d simultaneous threads.\n\ + Some threads are probably not calling DESTROYTHREAD()\n"; + static ZCONST char Far EntryNotFound[] = + "error: couldn't find global pointer in table.\n\ + Maybe somebody accidentally called DESTROYTHREAD() twice.\n"; + static ZCONST char Far GlobalPointerMismatch[] = + "error: global pointer in table does not match pointer passed as\ + parameter\n"; + +static void registerGlobalPointer OF((__GPRO)); + + + +static void registerGlobalPointer(__G) + __GDEF +{ + int scan=0; + ulg tid = GetThreadId(); + + while (threadIdTable[scan] && scan < THREADID_ENTRIES) + scan++; + + if (scan == THREADID_ENTRIES) { + ZCONST char *tooMany = LoadFarString(TooManyThreads); + Info(slide, 0x421, ((char *)slide, tooMany, THREADID_ENTRIES)); + free(pG); + EXIT(PK_MEM); /* essentially memory error before we've started */ + } + + threadIdTable [scan] = tid; + threadPtrTable[scan] = pG; + lastScan = scan; +} + + + +void deregisterGlobalPointer(__G) + __GDEF +{ + int scan=0; + ulg tid = GetThreadId(); + + + while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES) + scan++; + +/*--------------------------------------------------------------------------- + There are two things we can do if we can't find the entry: ignore it or + scream. The most likely reason for it not to be here is the user calling + this routine twice. Since this could cause BIG problems if any globals + are accessed after the first call, we'd better scream. + ---------------------------------------------------------------------------*/ + + if (scan == THREADID_ENTRIES || threadPtrTable[scan] != pG) { + ZCONST char *noEntry; + if (scan == THREADID_ENTRIES) + noEntry = LoadFarString(EntryNotFound); + else + noEntry = LoadFarString(GlobalPointerMismatch); + Info(slide, 0x421, ((char *)slide, noEntry)); + EXIT(PK_WARN); /* programming error, but after we're all done */ + } + + threadIdTable [scan] = 0; + lastScan = scan; + free(threadPtrTable[scan]); +} + + + +Uz_Globs *getGlobalPointer() +{ + int scan=0; + ulg tid = GetThreadId(); + + while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES) + scan++; + +/*--------------------------------------------------------------------------- + There are two things we can do if we can't find the entry: ignore it or + scream. The most likely reason for it not to be here is the user calling + this routine twice. Since this could cause BIG problems if any globals + are accessed after the first call, we'd better scream. + ---------------------------------------------------------------------------*/ + + if (scan == THREADID_ENTRIES) { + ZCONST char *noEntry = LoadFarString(EntryNotFound); + fprintf(stderr, noEntry); /* can't use Info w/o a global pointer */ + EXIT(PK_ERR); /* programming error while still working */ + } + + return threadPtrTable[scan]; +} + +# endif /* ?USETHREADID */ +#endif /* ?REENTRANT */ + + + +Uz_Globs *globalsCtor() +{ +#ifdef REENTRANT + Uz_Globs *pG = (Uz_Globs *)malloc(sizeof(Uz_Globs)); + + if (!pG) + return (Uz_Globs *)NULL; +#endif /* REENTRANT */ + + /* for REENTRANT version, G is defined as (*pG) */ + + memzero(&G, sizeof(Uz_Globs)); + +#ifndef FUNZIP +#ifdef CMS_MVS + uO.aflag=1; + uO.C_flag=1; +#endif +#ifdef TANDEM + uO.aflag=1; /* default to '-a' auto create Text Files as type 101 */ +#endif + + uO.lflag=(-1); + G.wildzipfn = ""; + G.pfnames = (char **)fnames; + G.pxnames = (char **)&fnames[1]; + G.pInfo = G.info; + G.sol = TRUE; /* at start of line */ + + G.message = UzpMessagePrnt; + G.input = UzpInput; /* not used by anyone at the moment... */ +#if defined(WINDLL) || defined(MACOS) + G.mpause = NULL; /* has scrollbars: no need for pausing */ +#else + G.mpause = UzpMorePause; +#endif + G.decr_passwd = UzpPassword; +#endif /* !FUNZIP */ + +#if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS)) +#if (!defined(MACOS) && !defined(ATARI) && !defined(VMS)) + G.echofd = -1; +#endif /* !(MACOS || ATARI || VMS) */ +#endif /* !(DOS_FLX_H68_NLM_OS2_W32 || AMIGA || RISCOS) */ + +#ifdef SYSTEM_SPECIFIC_CTOR + SYSTEM_SPECIFIC_CTOR(__G); +#endif + +#ifdef REENTRANT +#ifdef USETHREADID + registerGlobalPointer(__G); +#else + GG = &G; +#endif /* ?USETHREADID */ +#endif /* REENTRANT */ + + return &G; +} + +const char *BOINC_RCSID_65afe0efe7 = "$Id: globals.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/globals.h boinc-7.0.14+dfsg/zip/unzip/globals.h --- boinc-7.0.7+dfsg/zip/unzip/globals.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/globals.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,425 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + globals.h + + There is usually no need to include this file since unzip.h includes it. + + This header file is used by all of the UnZip source files. It contains + a struct definition that is used to "house" all of the global variables. + This is done to allow for multithreaded environments (OS/2, NT, Win95, + Unix) to call UnZip through an API without a semaphore. REENTRANT should + be defined for all platforms that require this. + + GLOBAL CONSTRUCTOR AND DESTRUCTOR (API WRITERS READ THIS!!!) + ------------------------------------------------------------ + + No, it's not C++, but it's as close as we can get with K&R. + + The main() of each process that uses these globals must include the + CONSTRUCTGLOBALS; statement. This will malloc enough memory for the + structure and initialize any variables that require it. This must + also be done by any API function that jumps into the middle of the + code. + + The DESTROYGLOBALS(); statement should be inserted before EVERY "EXIT(n)". + Naturally, it also needs to be put before any API returns as well. + In fact, it's much more important in API functions since the process + will NOT end, and therefore the memory WON'T automatically be freed + by the operating system. + + USING VARIABLES FROM THE STRUCTURE + ---------------------------------- + + All global variables must now be prefixed with `G.' which is either a + global struct (in which case it should be the only global variable) or + a macro for the value of a local pointer variable that is passed from + function to function. Yes, this is a pain. But it's the only way to + allow full reentrancy. + + ADDING VARIABLES TO THE STRUCTURE + --------------------------------- + + If you make the inclusion of any variables conditional, be sure to only + check macros that are GUARANTEED to be included in every module. + For instance, newzip and pwdarg are needed only if CRYPT is TRUE, + but this is defined after unzip.h has been read. If you are not careful, + some modules will expect your variable to be part of this struct while + others won't. This will cause BIG problems. (Inexplicable crashes at + strange times, car fires, etc.) When in doubt, always include it! + + Note also that UnZipSFX needs a few variables that UnZip doesn't. However, + it also includes some object files from UnZip. If we were to conditionally + include the extra variables that UnZipSFX needs, the object files from + UnZip would not mesh with the UnZipSFX object files. Result: we just + include the UnZipSFX variables every time. (It's only an extra 4 bytes + so who cares!) + + ADDING FUNCTIONS + ---------------- + + To support this new global struct, all functions must now conditionally + pass the globals pointer (pG) to each other. This is supported by 5 macros: + __GPRO, __GPRO__, __G, __G__ and __GDEF. A function that needs no other + parameters would look like this: + + int extract_or_test_files(__G) + __GDEF + { + ... stuff ... + } + + A function with other parameters would look like: + + int memextract(__G__ tgt, tgtsize, src, srcsize) + __GDEF + uch *tgt, *src; + ulg tgtsize, srcsize; + { + ... stuff ... + } + + In the Function Prototypes section of unzpriv.h, you should use __GPRO and + __GPRO__ instead: + + int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); + int process_zipfiles OF((__GPRO)); + + Note that there is NO comma after __G__ or __GPRO__ and no semi-colon after + __GDEF. I wish there was another way but I don't think there is. + + + TESTING THE CODE + ----------------- + + Whether your platform requires reentrancy or not, you should always try + building with REENTRANT defined if any functions have been added. It is + pretty easy to forget a __G__ or a __GDEF and this mistake will only show + up if REENTRANT is defined. All platforms should run with REENTRANT + defined. Platforms that can't take advantage of it will just be paying + a performance penalty needlessly. + + SIGNAL MADNESS + -------------- + + This whole pointer passing scheme falls apart when it comes to SIGNALs. + I handle this situation 2 ways right now. If you define USETHREADID, + UnZip will include a 64-entry table. Each entry can hold a global + pointer and thread ID for one thread. This should allow up to 64 + threads to access UnZip simultaneously. Calling DESTROYGLOBALS() + will free the global struct and zero the table entry. If somebody + forgets to call DESTROYGLOBALS(), this table will eventually fill up + and UnZip will exit with an error message. A good way to test your + code to make sure you didn't forget a DESTROYGLOBALS() is to change + THREADID_ENTRIES to 3 or 4 in globals.c, making the table real small. + Then make a small test program that calls your API a dozen times. + + Those platforms that don't have threads still need to be able to compile + with REENTRANT defined to test and see if new code is correctly written + to work either way. For these platforms, I simply keep a global pointer + called GG that points to the Globals structure. Good enough for testing. + + I believe that NT has thread level storage. This could probably be used + to store a global pointer for the sake of the signal handler more cleanly + than my table approach. + + ---------------------------------------------------------------------------*/ + +#ifndef __globals_h +#define __globals_h + +#ifdef USE_ZLIB +# include "zlib.h" +#endif + + +/*************/ +/* Globals */ +/*************/ + +typedef struct Globals { +#ifdef DLL + zvoid *callerglobs; /* pointer to structure of pass-through global vars */ +#endif + + /* command options of general use */ + UzpOpts UzO; /* command options of general use */ + +#ifndef FUNZIP + /* command options specific to the high level command line interface */ +#ifdef MORE + int M_flag; /* -M: built-in "more" function */ +#endif + + /* internal flags and general globals */ +#ifdef MORE + int height; /* check for SIGWINCH, etc., eventually... */ + int lines; /* count of lines displayed on current screen */ +# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) + int width; + int chars; /* count of screen characters in current line */ +# endif +#endif /* MORE */ +#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) + int tz_is_valid; /* indicates that timezone info can be used */ +#endif + int noargs; /* did true command line have *any* arguments? */ + unsigned filespecs; /* number of real file specifications to be matched */ + unsigned xfilespecs; /* number of excluded filespecs to be matched */ + int process_all_files; + int overwrite_mode; /* 0 - query, 1 - always, 2 - never */ + int create_dirs; /* used by main(), mapname(), checkdir() */ + int extract_flag; + int newzip; /* reset in extract.c; used in crypt.c */ + LONGINT real_ecrec_offset; + LONGINT expect_ecrec_offset; + long csize; /* used by decompr. (NEXTBYTE): must be signed */ + long used_csize; /* used by extract_or_test_member(), explode() */ + +#ifdef DLL + int fValidate; /* true if only validating an archive */ + int filenotfound; + int redirect_data; /* redirect data to memory buffer */ + int redirect_text; /* redirect text output to buffer */ +# ifndef NO_SLIDE_REDIR + int redirect_slide; /* redirect decompression area to mem buffer */ +# if (defined(USE_DEFLATE64) && defined(INT_16BIT)) + ulg _wsize; /* size of sliding window exceeds "unsigned" range */ +# else + unsigned _wsize; /* sliding window size can be hold in unsigned */ +# endif +# endif + ulg redirect_size; /* size of redirected output buffer */ + uch *redirect_buffer; /* pointer to head of allocated buffer */ + uch *redirect_pointer; /* pointer past end of written data */ +# ifndef NO_SLIDE_REDIR + uch *redirect_sldptr; /* head of decompression slide buffer */ +# endif +# ifdef OS2DLL + cbList(processExternally); /* call-back list */ +# endif +#endif /* DLL */ + + char **pfnames; + char **pxnames; + char sig[4]; + char answerbuf[10]; + min_info info[DIR_BLKSIZ]; + min_info *pInfo; +#endif /* !FUNZIP */ + union work area; /* see unzpriv.h for definition of work */ + +#ifndef FUNZIP +# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) + ZCONST ulg near *crc_32_tab; +# else + ZCONST ulg Far *crc_32_tab; +# endif +#endif + ulg crc32val; /* CRC shift reg. (was static in funzip) */ + +#ifdef FUNZIP + FILE *in; /* file descriptor of compressed stream */ +#endif + uch *inbuf; /* input buffer (any size is OK) */ + uch *inptr; /* pointer into input buffer */ + int incnt; + +#ifndef FUNZIP + ulg bitbuf; + int bits_left; /* unreduce and unshrink only */ + int zipeof; + char *argv0; /* used for NT and EXE_EXTENSION */ + char *wildzipfn; + char *zipfn; /* GRR: WINDLL: must nuke any malloc'd zipfn... */ +#ifdef USE_STRM_INPUT + FILE *zipfd; /* zipfile file descriptor */ +#else + int zipfd; /* zipfile file handle */ +#endif + LONGINT ziplen; + LONGINT cur_zipfile_bufstart; /* extract_or_test, readbuf, ReadByte */ + LONGINT extra_bytes; /* used in unzip.c, misc.c */ + uch *extra_field; /* Unix, VMS, Mac, OS/2, Acorn, ... */ + uch *hold; + + local_file_hdr lrec; /* used in unzip.c, extract.c */ + cdir_file_hdr crec; /* used in unzip.c, extract.c, misc.c */ + ecdir_rec ecrec; /* used in unzip.c, extract.c */ + struct stat statbuf; /* used by main, mapname, check_for_newer */ + + int mem_mode; + uch *outbufptr; /* extract.c static */ + ulg outsize; /* extract.c static */ + int reported_backslash; /* extract.c static */ + int disk_full; + int newfile; + + int didCRlast; /* fileio static */ + ulg numlines; /* fileio static: number of lines printed */ + int sol; /* fileio static: at start of line */ + int no_ecrec; /* process static */ +#ifdef SYMLINKS + int symlnk; +#endif +#ifdef NOVELL_BUG_FAILSAFE + int dne; /* true if stat() says file doesn't exist */ +#endif + + FILE *outfile; + uch *outbuf; + uch *realbuf; + +#ifndef VMS /* if SMALL_MEM, outbuf2 is initialized in */ + uch *outbuf2; /* process_zipfiles() (never changes); */ +#endif /* else malloc'd ONLY if unshrink and -a */ +#endif /* !FUNZIP */ + uch *outptr; + ulg outcnt; /* number of chars stored in outbuf */ +#ifndef FUNZIP + char filename[FILNAMSIZ]; /* also used by NT for temporary SFX path */ + +#ifdef CMS_MVS + char *tempfn; /* temp file used; erase on close */ +#endif + + char *key; /* crypt static: decryption password or NULL */ + int nopwd; /* crypt static */ +#endif /* !FUNZIP */ + ulg keys[3]; /* crypt static: keys defining pseudo-random sequence */ + +#if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS)) +#if (!defined(MACOS) && !defined(ATARI) && !defined(VMS)) + int echofd; /* ttyio static: file descriptor whose echo is off */ +#endif /* !(MACOS || ATARI || VMS) */ +#endif /* !(DOS_FLX_H68_NLM_OS2_W32 || AMIGA || RISCOS) */ + + unsigned hufts; /* track memory usage */ + +#ifdef USE_ZLIB + int inflInit; /* inflate static: zlib inflate() initialized */ + z_stream dstrm; /* inflate global: decompression stream */ +#else + struct huft *fixed_tl; /* inflate static */ + struct huft *fixed_td; /* inflate static */ + int fixed_bl, fixed_bd; /* inflate static */ +#ifdef USE_DEFLATE64 + struct huft *fixed_tl64; /* inflate static */ + struct huft *fixed_td64; /* inflate static */ + int fixed_bl64, fixed_bd64; /* inflate static */ + struct huft *fixed_tl32; /* inflate static */ + struct huft *fixed_td32; /* inflate static */ + int fixed_bl32, fixed_bd32; /* inflate static */ + ZCONST ush *cplens; /* inflate static */ + ZCONST uch *cplext; /* inflate static */ + ZCONST uch *cpdext; /* inflate static */ +#endif + unsigned wp; /* inflate static: current position in slide */ + ulg bb; /* inflate static: bit buffer */ + unsigned bk; /* inflate static: bits in bit buffer */ +#endif /* ?USE_ZLIB */ + +#ifndef FUNZIP +#ifdef SMALL_MEM + char rgchBigBuffer[512]; + char rgchSmallBuffer[96]; + char rgchSmallBuffer2[160]; /* boosted to 160 for local3[] in unzip.c */ +#endif + + MsgFn *message; + InputFn *input; + PauseFn *mpause; + PasswdFn *decr_passwd; + StatCBFn *statreportcb; +#ifdef WINDLL + LPUSERFUNCTIONS lpUserFunctions; +#endif + + int incnt_leftover; /* so improved NEXTBYTE does not waste input */ + uch *inptr_leftover; + +#ifdef VMS_TEXT_CONV + unsigned VMS_line_length; /* so native VMS variable-length text files */ + int VMS_line_state; /* are readable on other platforms */ + int VMS_line_pad; +#endif + +#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) + char autorun_command[FILNAMSIZ]; +#endif +#endif /* !FUNZIP */ + +#ifdef SYSTEM_SPECIFIC_GLOBALS + SYSTEM_SPECIFIC_GLOBALS +#endif + +} Uz_Globs; /* end of struct Globals */ + + +/***************************************************************************/ + + +#ifdef FUNZIP +# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) + extern ZCONST ulg near crc_32_tab[256]; +# else + extern ZCONST ulg Far *crc_32_tab; +# endif +# define CRC_32_TAB crc_32_tab +#else +# define CRC_32_TAB G.crc_32_tab +#endif + + +Uz_Globs *globalsCtor OF((void)); + +/* pseudo constant sigs; they are initialized at runtime so unzip executable + * won't look like a zipfile + */ +extern char local_hdr_sig[4]; +extern char central_hdr_sig[4]; +extern char end_central_sig[4]; +/* extern char extd_local_sig[4]; NOT USED YET */ + +#ifdef REENTRANT +# define G (*(Uz_Globs *)pG) +# define __G pG +# define __G__ pG, +# define __GPRO Uz_Globs *pG +# define __GPRO__ Uz_Globs *pG, +# define __GDEF Uz_Globs *pG; +# ifdef USETHREADID + extern int lastScan; + void deregisterGlobalPointer OF((__GPRO)); + Uz_Globs *getGlobalPointer OF((void)); +# define GETGLOBALS() Uz_Globs *pG = getGlobalPointer() +# define DESTROYGLOBALS() do {free_G_buffers(pG); \ + deregisterGlobalPointer(pG);} while (0) +# else + extern Uz_Globs *GG; +# define GETGLOBALS() Uz_Globs *pG = GG +# define DESTROYGLOBALS() do {free_G_buffers(pG); free(pG);} while (0) +# endif /* ?USETHREADID */ +# define CONSTRUCTGLOBALS() Uz_Globs *pG = globalsCtor() +#else /* !REENTRANT */ + extern Uz_Globs G; +# define __G +# define __G__ +# define __GPRO void +# define __GPRO__ +# define __GDEF +# define GETGLOBALS() +# define CONSTRUCTGLOBALS() globalsCtor() +# define DESTROYGLOBALS() +#endif /* ?REENTRANT */ + +#define uO G.UzO + +#endif /* __globals_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/History.550 boinc-7.0.14+dfsg/zip/unzip/History.550 --- boinc-7.0.7+dfsg/zip/unzip/History.550 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/History.550 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,273 @@ +UnZip, version 5.5, 17 February 2002 + +Features added (or removed): + +5.5a (04 Feb 01): + - unzip.1: added documentation for the new Acorn NFS filetype features [SPC] + - generic (inflate.c, globals.h, fileio.c, unzpriv.h): integrated support of + Deflate64 for all ports with exception of MSDOS and OS/2 16-bit [SPC] + +5.5b (11 Feb 01): + - added Deflate64 support to fUnZip [SPC] + - added Deflate64 support for 16-bit environments [SPC] + +5.5c (18 Apr 01): + - SFX: made SFX_EXDIR default, added NO_SFXEXDIR option to allow switching + off the "-d exdir" support [SPC] + - OS2, WIN32: added presetting of file size for extracted files, to reduce + file fragmentation [Pavel Lastovicka, Kai Uwe Rommel, SPC] + - VMS, new functionality of -b option: when extracting to standard output + (-c or -p), -b switches to "binary piping mode" by disabling text data + conversion [SPC] + +5.5d (28 Apr 01): + - SFX: added simple "execute command after extraction" feature that uses a + command specification supplied with the Zip archive comment, controlled + by the CHEAP_SFX_AUTORUN compile time option [Paul Kienitz] + - SFX: slightly refined the CHEAP_SFX_AUTORUN code, switched off SFX_EXDIR + when CHEAP_SFX_AUTORUN is enabled, documented the new autorun feature [SPC] + - VMS: extended new "binary piping" functionality of -b switch to extraction + of archive entries with VMS attributes saved [SPC] + +5.5f (30 Sep 01): + - extract.c, TestExtraField(): added crc32 check for PKVMS e.f. type [SPC] + - added real VMS-e.f. analysis for fool-proof detection of VMS "variable + length record" text files, enabled VMS_TEXT_CONV as default (but not for + SFX stub) [SPC] + - added support for optional ACORN_FTYPE_NFS feature to more OS that allow + long filenames and commas within filenames (BeOS, Novell, OS/2, Theos, + Win32) [SPC] + +5.5g (05 Nov 01): + - extract.c, extract_or_test_entrylist(): added code for "stripping off + absolute path spec" when extracting [SPC] + +5.5h (12 Jan 02): + - unzip.h, unzip.c; mapname() in all ports except CMS/MVS, Tandem, TOPS20: + added code to strip "../" path components from extracted names and new + option "-:" to allow deactivating this security feature; changed mapname() + calling interface to allow reporting warning error levels to caller [SPC] + - man/unzip.1: documented the new "-:" option [SPC] + - vms/cmdline.c etc.: added support for "-:" option to VMS DCL interface; + updated VMS help files with description of "-:" option [SPC] + - windll/windll.{c|txt}: modified handling of DCL struct's "ndflag" member + to allow setting the "-:" option through the windll interface [SPC] + - unzpriv.h, zipinfo.c: rudimentary support for recognizing PKWARE's new + "64-bit size specs" extra field [SPC] + +5.5 (17 Feb 02): + - unix/Makefile: added separate makefile symbol INSTALL_PROGRAM for command + to install "binary" (compiled and linked) program files [Santiago Vila] + + +Bugs fixed: + +5.5a (04 Feb 01): + - all OS with Unix-compatible file attributes (Acorn, AosVS, BeOS, QDOS, Unix, + and others), mapattr(): corrected wrong masking expression in check for + missing directory attribute; added this check for ports where it was + still missing [Eric Siegerman, SPC] + - inflate.c: reorganized inner loop function for slight performance gain [SPC] + - explode.c: reorganized code (2 instead of 4 inner-loop function versions), + fixed memory leaks when get_tree() fails (added huft_free() calls) [SPC] + +5.5b (11 Feb 01): + - inflate.c: some more optimizations (also resulting in easier readable code) + [SPC] + - unzip.c: revised work area size calculation in the WORK_MALLOC case, when + the decompression buffer is malloc'ed separately; removed suspicious + "one unit excess" allocation (8193 instead of 8192, not clear why this + was introduced in ancient times) [SPC] + - VMS - cvthelp.tpu, unzip_cli.help: reformatted CLI help file to show negated + form of negatable options on a separate line in the header of qualifier + descriptions [Hunter Goatley] + - generic: renamed version.h into unzvers.h (for better distinction from zip + sources) and updated all makefiles [SPC] + - windll: changed windll.rc to get version info directly from unzvers.h and + killed windll/unzver.h [SPC] + - api.c, global.h, extract.c, explode.c, inflate.c, unshrink.c: corrected + declarations of variables and function parameters holding redirected buffer + size (unsigned vs. ulg issues), added/modified appropiate type casts [SPC] + +5.5c (18 Apr 01): + - most make procedures: unzipsfx compilation requires completely separate + object files (exception: crc32), because global structure is now different + from unzip setup (sfx: no Deflate64!) [Thom Schmidt, SPC] + - inflate.c: moved macro definitions for invalid huft code marker out of + "no ZLIB only" code part; it is used in huft_build() [Thomas Klausner] + - AMIGA, HUMAN68K: replaced specific mkGoff.c helper program sources by a more + generic gbloffs.c source (located in the top level directory); adapted + makefiles to this change [SPC] + - win32/win32: modified version() to recognize Borland C++ 5.5.1 [SPC] + - AMIGA: adapted assembler core routine flate.a to Deflate64 and the 64k + extraction buffer; adapted inflate setup to allow for 16bit ints in + an otherwise 32-bit environment [Paul Kienitz] + - human68k/flate.s: incorporated Paul's updates of amiga/flate.a in the + HUMAN68K source variant [SPC] + - MacOS: updates from MacZip release 1.07b [Dirk Haase] + - unzpriv.h: updated exceptions of "made by FAT -> filename charset is OEM" + rule to now include the PKZIP 4.0 case [SPC] + - unzpriv.h, extract.c zipinfo.c: in preparation to multivolume support, + struct min_info has been extended to hold the entry's disk volume number + (to conserve space, hostnum & hostver members are shortened to uch) [SPC] + - extract.c, extract_or_test_files() function: isolated code of "second loop" + in a separate function, in preparation for multivolume support [SPC] + - os2/os2.c: use posix-style mkdir definition whenever __GNUC__ is defined, + for better compatibility with non-EMX gcc ports [Pavel Lastovicka, SPC] + - windll/windll.c: added missing SETLOCALE() initialization to Wiz_Init() + [Kevin Cheng] + - WINDLL port: in windll.c, changed FreeDllMem() scope into static; tried + to clarify in windll.txt that Wiz_SetOpts() and Wiz_Unzip() must be + used as a pair of functions [SPC] + - VMS: removed unused and undocumented /TYPE switch from CLI interface [SPC] + +5.5d (28 Apr 01): + - unix/Makefile: correction for LynxOS target [Mark Clayton] + - extract.c: synchronized extract_or_test_entrylist() prototype declaration + for the SET_DIR_ATTRIB case with actually used function interface [SPC] + - vms/descrip.mms: corrected typo in match_$O rule [Michael Lemke] + - vms/vms.c: limit buffer size for single block output to less than 64k + (RMS limit on VAX); corrected record overflow checks to use the right + RMS limit of (32k-1) [Mike Freeman, SPC] + - unzver.h: renamed COMPANY_NAME symbol to IZ_COMPANY_NAME, check for + symbol being already defined; restrict definition of OS/2-DLL specific + version symbols to OS/2 port [Mike White, SPC] + - windll/uzexampl.c: corrected inclusion path of unzver.h [Mike White] + - acorn/GMakefile: need NO_STRNICMP, fixed missing renaming of version.h + into unzvers.h [Andy Wingate] + - vms/vms.c: fixed long standing bug BUFS512 expression - clipping to a + multiple of 512 is achieved by ANDing with ~511 instead of ~512 [SPC] + +5.5e (29 Apr 01): + - vms/vms.c: added missing -c handling in WriteBuffer() to make the "-b" + binary piping mode functional [SPC] + +5.5f (30 Sep 01): + - OS2, WIN32: reenable -X "restore ACLs" option (has been broken since + version 5.42 due to incomplete change by SPC [Michael Ringe, SPC] + - moved IZVMS specific e.f. decompression from vms/vms.c into extract.c, this + functionality is now needed for generic VMS_TEXT_CONV feature [SPC] + - zipinfo.c: fixed 16-bit specific bug in verbose IZVMS e.f. report [SPC] + - unix/unxcfg.h: fixed setup for GNU/Hurd [Marcus Brinkmann] + - tandem/tandem.c: fixed copy&paste typo in stat() [] + - vms/cmdline.c: verbatim '%' signs in format specification strings are + "escaped" by doubling them, to prevent compiler warnings for newest + DEC (COMPAQ) C versions [Dirk Munk, SPC] + - tandem/tanunz.c, tandem/tandem.[ch], fileio.c: created Tandem-specific + version of open_outfile(), moved UNZIP part of zipopen() code into this + function [SPC] + - generic: added ZCONST attributes to several function string pointer + parameters when the function does not modify the string contents [SPC] + - Contents, README, INSTALL, ToDo, WHERE: documentation updates [SPC] + +5.5g (05 Nov 01): + - win32/Makefile.bc: completed support for guisfx stub and static lib [SPC] + - vms/vms.c: in find_vms_attrs(), fixed IZVMS ef-block parser which has been + broken by changes for 5.5f beta [SPC] + - acorn/acorn.c: fixed missing semicolon in setRISCOSexfield() prototype + declaration [Andy Wingate] + - win32/Makefile.bc: removed -q flag for compatibility with older versions + of Borland C++ Builder [E-Yen Tan] + +5.5h (12 Jan 02): + - man/*.1: modified manpages to be more "friendly" to automatic conversion + tools into the OpenSource "DocBook" format [Eric S. Raymond]; + tested new manpages and corrected some formatting quirks [SPC] + - extract.c: corrected size mismatches between format specifiers and actual + numeric arguments [SPC] + - msdos/msdos.c: cleanup of token concatenation preprocessor warnings emitted + by GCC 3.02 [SPC] + - process.c: moved definition of symbol SPARKID_2 from acorn/riscos.h into + this file (symbol used by getRISCOSexfield()) [Santiago Vila, SPC] + - unzip.c, unzip() main function, REENTRANT code: fixed signal handler "leak" + by saving previous state of all allocated signal handlers and restoring + them at function exit [Jim Mathies, SPC] + - unzip.h, unzpriv.h: moved "internal" function return codes (IZ_DIR etc.) + into the private main header unzpriv.h [SPC] + - extract.c, fileio.c: extended UNIXBACKUP optional functionality to create + "numbered" backup filenames, fixed behaviour when backup file already + exists (-o option switches off numbered backup files and overwrites the + first backup file when neccessary) [Mauricio Ponzo, SPC] + - unzpriv.h, fileio.c, process.c: changed ZLSEEK macro into a real function + seek_zipf() (located in fileio.c); added check of return code to its + calls; fixed filehandle leak in do_seekable() that occured in case of + ZLSEEK errors [Miki Shapiro, SPC] + - wince/intrface.cpp: added SetFileSize() function to preallocate extraction + file space, as implemented in the win32 port (dummy function for WinCE + native compiles because availability of system service is unknown) [SPC] + - funzip.c: changed skope of err() helper function to "static" [Mark Adler] + +5.5i (01 Feb 02): + - acorn/acorn.c: correct dir traversal security fix (Acorn uses '^'as parent + folder reference); update and enhance the special character translations; + static printRISCOSexfield() functions must only be declared when its + definition is active [Darren Salt] + - unzip.h, unzip.c, man/unzip.1: disabled -: option for Acorn [SPC] + - amiga/flate.a, amiga/makefile.azt: modified the way of including gbloffs' + output in the assembler inflate code [Paul Kienitz] + - gbloffs.c: corrected USE_DEFLATE64 symbol name, added missing type cast to + CRYPT symbol handling [Paul Kienitz] + - unix/Makefile: corrected and renamed target(s) for MacOS X [Mark Adler, SPC] + - acorn/makefile: make does not like recursive macro definitions [Darren Salt] + - unreduce.c: indented the #error message directive to hide it from pure + traditional K&R C style preprocessors [Peter Jones, SPC] + - amiga/filedate.c: exclude time handling code from Zip utility compiles + (a Zip change) [Paul Kienitz] + - acorn/GMakeFile: updated machine-specific options, used standard "gcc" as + command driver for linking [Andy Wingate] + - unix/unix.c, mapname(): removed extranous opening parentesis from optional + ACORN_FTYPE_NFS only code [Santiago Vila, SPC] + - acorn/acorn.c: corrected location of the MimeMap module [Darren Salt] + - acorn/riscos.c: fixed problem with readdir() sometimes not detecting end- + of-dir on "RISCOS V4 long directory format" FSs [Darren Salt] + - msdos/makefile.wat, os2/makefile.os2, win32/Makefile.wat: updated the + Watcom C support, checked MSDOS builds, added win32 DLL target [SPC] + +5.5j (11 Feb 02): + - acorn/GMakefile, acorn/Contents: made clean target working as expected, + updated and moved version info of gcc used (Andy Wingate) + - tandem/make: added support for switching on/off of CRYPT option [Dave Smith] + - tandem/HISTORY: updated "version of current binaries" info [Dave Smith] + - tandem/tanunz.c, open_outfile(): removed unneeded fopen redefines [SPC] + - tandem/tanunz.c, checkdir(): fixed missing closing ')' of FnFilter2 macro + calls [Dave Smith] + - LICENSE: clarification that unmodified UnZipSFX stub binaries can be + distributed as part of SFX Zip archives without any further documentation + requirements [Christian Spieler, Ian E. Gorman, Greg Roelofs] + +5.5 (17 Feb 02): + - inflate.c, explode.c, globals.h, unzpriv.h: changed type of "extra bits" + arrays used to build the decoding huffman trees from "ush" into "uch" for + optimization and adapted corresponding variable types [SPC] + - tandem/tandem.c: small cosmetic changes to catch up with Zip mods [SPC] + - unzpriv.h, tandem/tandem.h: removed Zip-specific settings, implemented the + USE_EF_UT_TIME default setting for both Zip and UnZip in tandem.h, removed + corresponding entry from unzpriv.h [SPC] + - LICENSE: refinement of the SFX stub related insertion [Greg Roelofs] + - windll/windll.rc: updated copyright year [SPC] + - msdos/makefile.dj1, msdos/makefile.dj2: added missing header dependencies, + corrected wrong object list for unzipsfx target (only .dj1) [SPC] + - tandem/tanunz.c, open_outfile(): repaired wrong variable names, added + "upshifting" of filename before executing system calls [Dave Smith] + - unzpriv.h, TANDEM setup: define INT_16BIT symbol when compiling in NON WIDE + mode to get DEFLATE64 option to work [Dave Smith] + - win32/Makefile.wat: finished "$(OBJS)" -> "$(OBJU) conversion [Paul Kienitz] + - win32/w32cfg.h: Watcom C requires IZTZ_DEFINESTDGLOBALS setting when using + the timehandling replacement code from timezone.c [Paul Kienitz] + - README, unzvers.h: removed BETA notes for public release [SPC] + - os2/os2.c, SetFileSize(): 16-bit OS/2 needs fake code here [Kai-Uwe Rommel] + - unzpriv.h: added ZCONST to varmessage() buf arg [Kai-Uwe Rommel, SPC] + - os2/os2.c: added #ifndef FUNZIP sections to allow inclusion of this module + in the object modules list for 16-bit fUnZip targets [SPC] + - os2/makefile.os2: fixed 16-bit targets to include os2f.obj resp. msdosf.obj + in the fUnZip object modules list [SPC] + - fileio.c, do_string(): added typecasts in CHEAP_SFX_AUTORUN option code to + remove signed/unsigned mismatch warnings [Hunter Goatley] + +================== + +These changes occurred in beta versions 5.5a to 5.5. This list may have +left out some bugfixes and even some features...void where prohibited, your +mileage may vary, etc., etc. + +Christian Spieler diff -Nru boinc-7.0.7+dfsg/zip/unzip/inflate.c boinc-7.0.14+dfsg/zip/unzip/inflate.c --- boinc-7.0.7+dfsg/zip/unzip/inflate.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/inflate.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1501 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* inflate.c -- by Mark Adler + version c17a, 04 Feb 2001 */ + + +/* Copyright history: + - Starting with UnZip 5.41 of 16-April-2000, this source file + is covered by the Info-Zip LICENSE cited above. + - Prior versions of this source file, found in UnZip source packages + up to UnZip 5.40, were put in the public domain. + The original copyright note by Mark Adler was: + "You can do whatever you like with this source file, + though I would prefer that if you modify it and + redistribute it that you include comments to that effect + with your name and the date. Thank you." + + History: + vers date who what + ---- --------- -------------- ------------------------------------ + a ~~ Feb 92 M. Adler used full (large, one-step) lookup table + b1 21 Mar 92 M. Adler first version with partial lookup tables + b2 21 Mar 92 M. Adler fixed bug in fixed-code blocks + b3 22 Mar 92 M. Adler sped up match copies, cleaned up some + b4 25 Mar 92 M. Adler added prototypes; removed window[] (now + is the responsibility of unzip.h--also + changed name to slide[]), so needs diffs + for unzip.c and unzip.h (this allows + compiling in the small model on MSDOS); + fixed cast of q in huft_build(); + b5 26 Mar 92 M. Adler got rid of unintended macro recursion. + b6 27 Mar 92 M. Adler got rid of nextbyte() routine. fixed + bug in inflate_fixed(). + c1 30 Mar 92 M. Adler removed lbits, dbits environment variables. + changed BMAX to 16 for explode. Removed + OUTB usage, and replaced it with flush()-- + this was a 20% speed improvement! Added + an explode.c (to replace unimplod.c) that + uses the huft routines here. Removed + register union. + c2 4 Apr 92 M. Adler fixed bug for file sizes a multiple of 32k. + c3 10 Apr 92 M. Adler reduced memory of code tables made by + huft_build significantly (factor of two to + three). + c4 15 Apr 92 M. Adler added NOMEMCPY do kill use of memcpy(). + worked around a Turbo C optimization bug. + c5 21 Apr 92 M. Adler added the WSIZE #define to allow reducing + the 32K window size for specialized + applications. + c6 31 May 92 M. Adler added some typecasts to eliminate warnings + c7 27 Jun 92 G. Roelofs added some more typecasts (444: MSC bug). + c8 5 Oct 92 J-l. Gailly added ifdef'd code to deal with PKZIP bug. + c9 9 Oct 92 M. Adler removed a memory error message (~line 416). + c10 17 Oct 92 G. Roelofs changed ULONG/UWORD/byte to ulg/ush/uch, + removed old inflate, renamed inflate_entry + to inflate, added Mark's fix to a comment. + c10.5 14 Dec 92 M. Adler fix up error messages for incomplete trees. + c11 2 Jan 93 M. Adler fixed bug in detection of incomplete + tables, and removed assumption that EOB is + the longest code (bad assumption). + c12 3 Jan 93 M. Adler make tables for fixed blocks only once. + c13 5 Jan 93 M. Adler allow all zero length codes (pkzip 2.04c + outputs one zero length code for an empty + distance tree). + c14 12 Mar 93 M. Adler made inflate.c standalone with the + introduction of inflate.h. + c14b 16 Jul 93 G. Roelofs added (unsigned) typecast to w at 470. + c14c 19 Jul 93 J. Bush changed v[N_MAX], l[288], ll[28x+3x] arrays + to static for Amiga. + c14d 13 Aug 93 J-l. Gailly de-complicatified Mark's c[*p++]++ thing. + c14e 8 Oct 93 G. Roelofs changed memset() to memzero(). + c14f 22 Oct 93 G. Roelofs renamed quietflg to qflag; made Trace() + conditional; added inflate_free(). + c14g 28 Oct 93 G. Roelofs changed l/(lx+1) macro to pointer (Cray bug) + c14h 7 Dec 93 C. Ghisler huft_build() optimizations. + c14i 9 Jan 94 A. Verheijen set fixed_t{d,l} to NULL after freeing; + G. Roelofs check NEXTBYTE macro for EOF. + c14j 23 Jan 94 G. Roelofs removed Ghisler "optimizations"; ifdef'd + EOF check. + c14k 27 Feb 94 G. Roelofs added some typecasts to avoid warnings. + c14l 9 Apr 94 G. Roelofs fixed split comments on preprocessor lines + to avoid bug in Encore compiler. + c14m 7 Jul 94 P. Kienitz modified to allow assembler version of + inflate_codes_boinc() (define ASM_INFLATECODES) + c14n 22 Jul 94 G. Roelofs changed fprintf to macro for DLL versions + c14o 23 Aug 94 C. Spieler added a newline to a debug statement; + G. Roelofs added another typecast to avoid MSC warning + c14p 4 Oct 94 G. Roelofs added (voidp *) cast to free() argument + c14q 30 Oct 94 G. Roelofs changed fprintf macro to MESSAGE() + c14r 1 Nov 94 G. Roelofs fixed possible redefinition of CHECK_EOF + c14s 7 May 95 S. Maxwell OS/2 DLL globals stuff incorporated; + P. Kienitz "fixed" ASM_INFLATECODES macro/prototype + c14t 18 Aug 95 G. Roelofs added UZinflate_boinc() to use zlib functions; + changed voidp to zvoid; moved huft_build() + and huft_free() to end of file + c14u 1 Oct 95 G. Roelofs moved G into definition of MESSAGE macro + c14v 8 Nov 95 P. Kienitz changed ASM_INFLATECODES to use a regular + call with __G__ instead of a macro + c15 3 Aug 96 M. Adler fixed bomb-bug on random input data (Adobe) + c15b 24 Aug 96 M. Adler more fixes for random input data + c15c 28 Mar 97 G. Roelofs changed USE_ZLIB fatal exit code from + PK_MEM2 to PK_MEM3 + c16 20 Apr 97 J. Altman added memzero(v[]) in huft_build() + c16b 29 Mar 98 C. Spieler modified DLL code for slide redirection + c16c 04 Apr 99 C. Spieler fixed memory leaks when processing gets + stopped because of input data errors + c16d 05 Jul 99 C. Spieler take care of FLUSH() return values and + stop processing in case of errors + c17 31 Dec 00 C. Spieler added preliminary support for Deflate64 + c17a 04 Feb 01 C. Spieler complete integration of Deflate64 support + c17b 16 Feb 02 C. Spieler changed type of "extra bits" arrays and + corresponding huft_buid() parameter e from + ush into uch, to save space + */ + + +/* + Inflate deflated (PKZIP's method 8 compressed) data. The compression + method searches for as much of the current string of bytes (up to a + length of 258) in the previous 32K bytes. If it doesn't find any + matches (of at least length 3), it codes the next byte. Otherwise, it + codes the length of the matched string and its distance backwards from + the current position. There is a single Huffman code that codes both + single bytes (called "literals") and match lengths. A second Huffman + code codes the distance information, which follows a length code. Each + length or distance code actually represents a base value and a number + of "extra" (sometimes zero) bits to get to add to the base value. At + the end of each deflated block is a special end-of-block (EOB) literal/ + length code. The decoding process is basically: get a literal/length + code; if EOB then done; if a literal, emit the decoded byte; if a + length then get the distance and emit the referred-to bytes from the + sliding window of previously emitted data. + + There are (currently) three kinds of inflate blocks: stored, fixed, and + dynamic. The compressor outputs a chunk of data at a time and decides + which method to use on a chunk-by-chunk basis. A chunk might typically + be 32K to 64K, uncompressed. If the chunk is uncompressible, then the + "stored" method is used. In this case, the bytes are simply stored as + is, eight bits per byte, with none of the above coding. The bytes are + preceded by a count, since there is no longer an EOB code. + + If the data are compressible, then either the fixed or dynamic methods + are used. In the dynamic method, the compressed data are preceded by + an encoding of the literal/length and distance Huffman codes that are + to be used to decode this block. The representation is itself Huffman + coded, and so is preceded by a description of that code. These code + descriptions take up a little space, and so for small blocks, there is + a predefined set of codes, called the fixed codes. The fixed method is + used if the block ends up smaller that way (usually for quite small + chunks); otherwise the dynamic method is used. In the latter case, the + codes are customized to the probabilities in the current block and so + can code it much better than the pre-determined fixed codes can. + + The Huffman codes themselves are decoded using a multi-level table + lookup, in order to maximize the speed of decoding plus the speed of + building the decoding tables. See the comments below that precede the + lbits and dbits tuning parameters. + + GRR: return values(?) + 0 OK + 1 incomplete table + 2 bad input + 3 not enough memory + the following return codes are passed through from FLUSH() errors + 50 (PK_DISK) "overflow of output space" + 80 (IZ_CTRLC) "canceled by user's request" + */ + + +/* + Notes beyond the 1.93a appnote.txt: + + 1. Distance pointers never point before the beginning of the output + stream. + 2. Distance pointers can point back across blocks, up to 32k away. + 3. There is an implied maximum of 7 bits for the bit length table and + 15 bits for the actual data. + 4. If only one code exists, then it is encoded using one bit. (Zero + would be more efficient, but perhaps a little confusing.) If two + codes exist, they are coded using one bit each (0 and 1). + 5. There is no way of sending zero distance codes--a dummy must be + sent if there are none. (History: a pre 2.0 version of PKZIP would + store blocks with no distance codes, but this was discovered to be + too harsh a criterion.) Valid only for 1.93a. 2.04c does allow + zero distance codes, which is sent as one code of zero bits in + length. + 6. There are up to 286 literal/length codes. Code 256 represents the + end-of-block. Note however that the static length tree defines + 288 codes just to fill out the Huffman codes. Codes 286 and 287 + cannot be used though, since there is no length base or extra bits + defined for them. Similarily, there are up to 30 distance codes. + However, static trees define 32 codes (all 5 bits) to fill out the + Huffman codes, but the last two had better not show up in the data. + 7. Unzip can check dynamic Huffman blocks for complete code sets. + The exception is that a single code would not be complete (see #4). + 8. The five bits following the block type is really the number of + literal codes sent minus 257. + 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits + (1+6+6). Therefore, to output three times the length, you output + three codes (1+1+1), whereas to output four times the same length, + you only need two codes (1+3). Hmm. + 10. In the tree reconstruction algorithm, Code = Code + Increment + only if BitLength(i) is not zero. (Pretty obvious.) + 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) + 12. Note: length code 284 can represent 227-258, but length code 285 + really is 258. The last length deserves its own, short code + since it gets used a lot in very redundant files. The length + 258 is special since 258 - 3 (the min match length) is 255. + 13. The literal/length and distance code bit lengths are read as a + single stream of lengths. It is possible (and advantageous) for + a repeat code (16, 17, or 18) to go across the boundary between + the two sets of lengths. + 14. The Deflate64 (PKZIP method 9) variant of the compression algorithm + differs from "classic" deflate in the following 3 aspect: + a) The size of the sliding history window is expanded to 64 kByte. + b) The previously unused distance codes #30 and #31 code distances + from 32769 to 49152 and 49153 to 65536. Both codes take 14 bits + of extra data to determine the exact position in their 16 kByte + range. + c) The last lit/length code #285 gets a different meaning. Instead + of coding a fixed maximum match length of 258, it is used as a + "generic" match length code, capable of coding any length from + 3 (min match length + 0) to 65538 (min match length + 65535). + This means that the length code #285 takes 16 bits (!) of uncoded + extra data, added to a fixed min length of 3. + Changes a) and b) would have been transparent for valid deflated + data, but change c) requires to switch decoder configurations between + Deflate and Deflate64 modes. + */ + + +#define PKZIP_BUG_WORKAROUND /* PKZIP 1.93a problem--live with it */ + +/* + inflate.h must supply the uch slide[WSIZE] array, the zvoid typedef + (void if (void *) is accepted, else char) and the NEXTBYTE, + FLUSH() and memzero macros. If the window size is not 32K, it + should also define WSIZE. If INFMOD is defined, it can include + compiled functions to support the NEXTBYTE and/or FLUSH() macros. + There are defaults for NEXTBYTE and FLUSH() below for use as + examples of what those functions need to do. Normally, you would + also want FLUSH() to compute a crc on the data. inflate.h also + needs to provide these typedefs: + + typedef unsigned char uch; + typedef unsigned short ush; + typedef unsigned long ulg; + + This module uses the external functions malloc() and free() (and + probably memset() or bzero() in the memzero() macro). Their + prototypes are normally found in and . + */ + +#define __INFLATE_C /* identifies this source module */ + +/* #define DEBUG */ +#define INFMOD /* tell inflate.h to include code to be compiled */ +#include "inflate.h" + + +/* marker for "unused" huft code, and corresponding check macro */ +#define INVALID_CODE 99 +#define IS_INVALID_CODE(c) ((c) == INVALID_CODE) + +#ifndef WSIZE /* default is 32K resp. 64K */ +# ifdef USE_DEFLATE64 +# define WSIZE 65536L /* window size--must be a power of two, and */ +# else /* at least 64K for PKZip's deflate64 method */ +# define WSIZE 0x8000 /* window size--must be a power of two, and */ +# endif /* at least 32K for zip's deflate method */ +#endif + +/* some buffer counters must be capable of holding 64k for Deflate64 */ +#if (defined(USE_DEFLATE64) && defined(INT_16BIT)) +# define UINT_D64 ulg +#else +# define UINT_D64 unsigned +#endif + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) +# define wsize G._wsize /* wsize is a variable */ +#else +# define wsize WSIZE /* wsize is a constant */ +#endif + + +#ifndef NEXTBYTE /* default is to simply get a byte from stdin */ +# define NEXTBYTE getchar() +#endif + +#ifndef MESSAGE /* only used twice, for fixed strings--NOT general-purpose */ +# define MESSAGE(str,len,flag) fprintf(stderr,(char *)(str)) +#endif + +#ifndef FLUSH /* default is to simply write the buffer to stdout */ +# define FLUSH(n) \ + (((extent)fwrite(redirSlide, 1, (extent)(n), stdout) == (extent)(n)) ? \ + 0 : PKDISK) +#endif +/* Warning: the fwrite above might not work on 16-bit compilers, since + 0x8000 might be interpreted as -32,768 by the library function. When + support for Deflate64 is enabled, the window size is 64K and the + simple fwrite statement is definitely broken for 16-bit compilers. */ + +#ifndef Trace +# ifdef DEBUG +# define Trace(x) fprintf x +# else +# define Trace(x) +# endif +#endif + + +/*---------------------------------------------------------------------------*/ +#ifdef USE_ZLIB + + +/* + GRR: return values for both original inflate_boinc() and UZinflate_boinc() + 0 OK + 1 incomplete table(?) + 2 bad input + 3 not enough memory + */ + +/**************************/ +/* Function UZinflate_boinc() */ +/**************************/ + +int UZinflate_boinc(__G__ is_defl64) + __GDEF + int is_defl64; +/* decompress an inflated entry using the zlib routines */ +{ + int retval = 0; /* return code: 0 = "no error" */ + int err=Z_OK; + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) + wsize = G.redirect_size, redirSlide = G.redirect_buffer; + else + wsize = WSIZE, redirSlide = slide; +#endif + + G.dstrm.next_out = redirSlide; + G.dstrm.avail_out = wsize; + + G.dstrm.next_in = G.inptr; + G.dstrm.avail_in = G.incnt; + + if (!G.inflInit) { + unsigned i; + int windowBits; + + /* only need to test this stuff once */ + if (zlib_version[0] != ZLIB_VERSION[0]) { + Info(slide, 0x21, ((char *)slide, + "error: incompatible zlib version (expected %s, found %s)\n", + ZLIB_VERSION, zlib_version)); + return 3; + } else if (strcmp(zlib_version, ZLIB_VERSION) != 0) + Info(slide, 0x21, ((char *)slide, + "warning: different zlib version (expected %s, using %s)\n", + ZLIB_VERSION, zlib_version)); + + /* windowBits = log2(wsize) */ + for (i = (unsigned)wsize, windowBits = 0; + !(i & 1); i >>= 1, ++windowBits); + if ((unsigned)windowBits > (unsigned)15) + windowBits = 15; + else if (windowBits < 8) + windowBits = 8; + + G.dstrm.zalloc = (alloc_func)Z_NULL; + G.dstrm.zfree = (free_func)Z_NULL; + + Trace((stderr, "initializing inflate_boinc()\n")); + err = inflateInit2(&G.dstrm, -windowBits); + + if (err == Z_MEM_ERROR) + return 3; + else if (err != Z_OK) + Trace((stderr, "oops! (inflateInit2() err = %d)\n", err)); + G.inflInit = 1; + } + +#ifdef FUNZIP + while (err != Z_STREAM_END) { +#else /* !FUNZIP */ + while (G.csize > 0) { + Trace((stderr, "first loop: G.csize = %ld\n", G.csize)); +#endif /* ?FUNZIP */ + while (G.dstrm.avail_out > 0) { + err = inflate_boinc(&G.dstrm, Z_PARTIAL_FLUSH); + + if (err == Z_DATA_ERROR) { + retval = 2; goto uzinflate_cleanup_exit; + } else if (err == Z_MEM_ERROR) { + retval = 3; goto uzinflate_cleanup_exit; + } else if (err != Z_OK && err != Z_STREAM_END) + Trace((stderr, "oops! (inflate_boinc(first loop) err = %d)\n", err)); + +#ifdef FUNZIP + if (err == Z_STREAM_END) /* "END-of-entry-condition" ? */ +#else /* !FUNZIP */ + if (G.csize <= 0L) /* "END-of-entry-condition" ? */ +#endif /* ?FUNZIP */ + break; + + if (G.dstrm.avail_in <= 0) { + if (fillinbuf(__G) == 0) { + /* no "END-condition" yet, but no more data */ + retval = 2; goto uzinflate_cleanup_exit; + } + + G.dstrm.next_in = G.inptr; + G.dstrm.avail_in = G.incnt; + } + Trace((stderr, " avail_in = %d\n", G.dstrm.avail_in)); + } + /* flush slide[] */ + if ((retval = FLUSH(wsize - G.dstrm.avail_out)) != 0) + goto uzinflate_cleanup_exit; + Trace((stderr, "inside loop: flushing %ld bytes (ptr diff = %ld)\n", + (long)(wsize - G.dstrm.avail_out), + (long)(G.dstrm.next_out-(Bytef *)redirSlide))); + G.dstrm.next_out = redirSlide; + G.dstrm.avail_out = wsize; + } + + /* no more input, so loop until we have all output */ + Trace((stderr, "beginning final loop: err = %d\n", err)); + while (err != Z_STREAM_END) { + err = inflate_boinc(&G.dstrm, Z_PARTIAL_FLUSH); + if (err == Z_DATA_ERROR) { + retval = 2; goto uzinflate_cleanup_exit; + } else if (err == Z_MEM_ERROR) { + retval = 3; goto uzinflate_cleanup_exit; + } else if (err == Z_BUF_ERROR) { /* DEBUG */ + Trace((stderr, + "zlib inflate_boinc() did not detect stream end (%s, %s)\n", + G.zipfn, G.filename)); + break; + } else if (err != Z_OK && err != Z_STREAM_END) { + Trace((stderr, "oops! (inflate_boinc(final loop) err = %d)\n", err)); + DESTROYGLOBALS(); + EXIT(PK_MEM3); + } + /* final flush of slide[] */ + if ((retval = FLUSH(wsize - G.dstrm.avail_out)) != 0) + goto uzinflate_cleanup_exit; + Trace((stderr, "final loop: flushing %ld bytes (ptr diff = %ld)\n", + (long)(wsize - G.dstrm.avail_out), + (long)(G.dstrm.next_out-(Bytef *)redirSlide))); + G.dstrm.next_out = redirSlide; + G.dstrm.avail_out = wsize; + } + Trace((stderr, "total in = %ld, total out = %ld\n", G.dstrm.total_in, + G.dstrm.total_out)); + + G.inptr = (uch *)G.dstrm.next_in; + G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */ + +uzinflate_cleanup_exit: + err = inflateReset(&G.dstrm); + if (err != Z_OK) + Trace((stderr, "oops! (inflateReset() err = %d)\n", err)); + + return retval; +} + + +/*---------------------------------------------------------------------------*/ +#else /* !USE_ZLIB */ + + +/* Function prototypes */ +#ifndef OF +# ifdef __STDC__ +# define OF(a) a +# else +# define OF(a) () +# endif +#endif /* !OF */ +int inflate_codes_boinc OF((__GPRO__ struct huft *tl, struct huft *td, + int bl, int bd)); +static int inflate_stored OF((__GPRO)); +static int inflate_fixed OF((__GPRO)); +static int inflate_dynamic OF((__GPRO)); +static int inflate_block OF((__GPRO__ int *e)); + + +/* The inflate algorithm uses a sliding 32K byte window on the uncompressed + stream to find repeated byte strings. This is implemented here as a + circular buffer. The index is updated simply by incrementing and then + and'ing with 0x7fff (32K-1). */ +/* It is left to other modules to supply the 32K area. It is assumed + to be usable as if it were declared "uch slide[32768];" or as just + "uch *slide;" and then malloc'ed in the latter case. The definition + must be in unzip.h, included above. */ + + +/* unsigned wp; moved to globals.h */ /* current position in slide */ + +/* Tables for deflate from PKZIP's appnote.txt. */ +/* - Order of the bit length code lengths */ +static ZCONST unsigned border[] = { + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + +/* - Copy lengths for literal codes 257..285 */ +#ifdef USE_DEFLATE64 +static ZCONST ush cplens64[] = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 3, 0, 0}; + /* For Deflate64, the code 285 is defined differently. */ +#else +# define cplens32 cplens +#endif +static ZCONST ush cplens32[] = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* note: see note #13 above about the 258 in this list. */ +/* - Extra bits for literal codes 257..285 */ +#ifdef USE_DEFLATE64 +static ZCONST uch cplext64[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 16, INVALID_CODE, INVALID_CODE}; +#else +# define cplext32 cplext +#endif +static ZCONST uch cplext32[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, INVALID_CODE, INVALID_CODE}; + +/* - Copy offsets for distance codes 0..29 (0..31 for Deflate64) */ +static ZCONST ush cpdist[] = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, +#if (defined(USE_DEFLATE64) || defined(PKZIP_BUG_WORKAROUND)) + 8193, 12289, 16385, 24577, 32769, 49153}; +#else + 8193, 12289, 16385, 24577}; +#endif + +/* - Extra bits for distance codes 0..29 (0..31 for Deflate64) */ +#ifdef USE_DEFLATE64 +static ZCONST uch cpdext64[] = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13, 14, 14}; +#else +# define cpdext32 cpdext +#endif +static ZCONST uch cpdext32[] = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, +#ifdef PKZIP_BUG_WORKAROUND + 12, 12, 13, 13, INVALID_CODE, INVALID_CODE}; +#else + 12, 12, 13, 13}; +#endif + +#ifdef PKZIP_BUG_WORKAROUND +# define MAXLITLENS 288 +#else +# define MAXLITLENS 286 +#endif +#if (defined(USE_DEFLATE64) || defined(PKZIP_BUG_WORKAROUND)) +# define MAXDISTS 32 +#else +# define MAXDISTS 30 +#endif + + +/* moved to consts.h (included in unzip.c), resp. funzip.c */ +#if 0 +/* And'ing with mask_bits[n] masks the lower n bits */ +ZCONST ush near mask_bits[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; +#endif /* 0 */ + + +/* Macros for inflate_boinc() bit peeking and grabbing. + The usage is: + + NEEDBITS(j) + x = b & mask_bits[j]; + DUMPBITS(j) + + where NEEDBITS makes sure that b has at least j bits in it, and + DUMPBITS removes the bits from b. The macros use the variable k + for the number of bits in b. Normally, b and k are register + variables for speed and are initialized at the begining of a + routine that uses these macros from a global bit buffer and count. + + In order to not ask for more bits than there are in the compressed + stream, the Huffman tables are constructed to only ask for just + enough bits to make up the end-of-block code (value 256). Then no + bytes need to be "returned" to the buffer at the end of the last + block. See the huft_build() routine. + */ + +/* These have been moved to globals.h */ +#if 0 +ulg bb; /* bit buffer */ +unsigned bk; /* bits in bit buffer */ +#endif + +#ifndef CHECK_EOF +# define CHECK_EOF /* default as of 5.13/5.2 */ +#endif + +#ifndef CHECK_EOF +# define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE)<>=(n);k-=(n);} + + +/* + Huffman code decoding is performed using a multi-level table lookup. + The fastest way to decode is to simply build a lookup table whose + size is determined by the longest code. However, the time it takes + to build this table can also be a factor if the data being decoded + are not very long. The most common codes are necessarily the + shortest codes, so those codes dominate the decoding time, and hence + the speed. The idea is you can have a shorter table that decodes the + shorter, more probable codes, and then point to subsidiary tables for + the longer codes. The time it costs to decode the longer codes is + then traded against the time it takes to make longer tables. + + This results of this trade are in the variables lbits and dbits + below. lbits is the number of bits the first level table for literal/ + length codes can decode in one step, and dbits is the same thing for + the distance codes. Subsequent tables are also less than or equal to + those sizes. These values may be adjusted either when all of the + codes are shorter than that, in which case the longest code length in + bits is used, or when the shortest code is *longer* than the requested + table size, in which case the length of the shortest code in bits is + used. + + There are two different values for the two tables, since they code a + different number of possibilities each. The literal/length table + codes 286 possible values, or in a flat code, a little over eight + bits. The distance table codes 30 possible values, or a little less + than five bits, flat. The optimum values for speed end up being + about one bit more than those, so lbits is 8+1 and dbits is 5+1. + The optimum values may differ though from machine to machine, and + possibly even between compilers. Your mileage may vary. + */ + + +static ZCONST int lbits = 9; /* bits in base literal/length lookup table */ +static ZCONST int dbits = 6; /* bits in base distance lookup table */ + + +#ifndef ASM_INFLATECODES + +int inflate_codes_boinc(__G__ tl, td, bl, bd) + __GDEF +struct huft *tl, *td; /* literal/length and distance decoder tables */ +int bl, bd; /* number of bits decoded by tl[] and td[] */ +/* inflate (decompress) the codes in a deflated (compressed) block. + Return an error code or zero if it all goes ok. */ +{ + register unsigned e; /* table entry flag/number of extra bits */ + unsigned d; /* index for copy */ + UINT_D64 n; /* length for copy (deflate64: might be 64k+2) */ + UINT_D64 w; /* current window position (deflate64: up to 64k) */ + struct huft *t; /* pointer to table entry */ + unsigned ml, md; /* masks for bl and bd bits */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + int retval = 0; /* error code returned: initialized to "no error" */ + + + /* make local copies of globals */ + b = G.bb; /* initialize bit buffer */ + k = G.bk; + w = G.wp; /* initialize window position */ + + + /* inflate the coded data */ + ml = mask_bits[bl]; /* precompute masks for speed */ + md = mask_bits[bd]; + while (1) /* do until end of block */ + { + NEEDBITS((unsigned)bl) + t = tl + ((unsigned)b & ml); + while (1) { + DUMPBITS(t->b) + + if ((e = t->e) == 32) /* then it's a literal */ + { + redirSlide[w++] = (uch)t->v.n; + if (w == wsize) + { + if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; + w = 0; + } + break; + } + + if (e < 31) /* then it's a length */ + { + /* get length of block to copy */ + NEEDBITS(e) + n = t->v.n + ((unsigned)b & mask_bits[e]); + DUMPBITS(e) + + /* decode distance of block to copy */ + NEEDBITS((unsigned)bd) + t = td + ((unsigned)b & md); + while (1) { + DUMPBITS(t->b) + if ((e = t->e) < 32) + break; + if (IS_INVALID_CODE(e)) + return 1; + e &= 31; + NEEDBITS(e) + t = t->v.t + ((unsigned)b & mask_bits[e]); + } + NEEDBITS(e) + d = (unsigned)w - t->v.n - ((unsigned)b & mask_bits[e]); + DUMPBITS(e) + + /* do the copy */ + do { +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) { + /* &= w/ wsize unnecessary & wrong if redirect */ + if ((UINT_D64)d >= wsize) + return 1; /* invalid compressed data */ + e = (unsigned)(wsize - (d > (unsigned)w ? (UINT_D64)d : w)); + } + else +#endif + e = (unsigned)(wsize - + ((d &= (unsigned)(wsize-1)) > (unsigned)w ? + (UINT_D64)d : w)); + if ((UINT_D64)e > n) e = (unsigned)n; + n -= e; +#ifndef NOMEMCPY + if ((unsigned)w - d >= e) + /* (this test assumes unsigned comparison) */ + { + memcpy(redirSlide + (unsigned)w, redirSlide + d, e); + w += e; + d += e; + } + else /* do it slowly to avoid memcpy() overlap */ +#endif /* !NOMEMCPY */ + do { + redirSlide[w++] = redirSlide[d++]; + } while (--e); + if (w == wsize) + { + if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; + w = 0; + } + } while (n); + break; + } + + if (e == 31) /* it's the EOB signal */ + { + /* sorry for this goto, but we have to exit two loops at once */ + goto cleanup_decode; + } + + if (IS_INVALID_CODE(e)) + return 1; + + e &= 31; + NEEDBITS(e) + t = t->v.t + ((unsigned)b & mask_bits[e]); + } + } +cleanup_decode: + + /* restore the globals from the locals */ + G.wp = (unsigned)w; /* restore global window pointer */ + G.bb = b; /* restore global bit buffer */ + G.bk = k; + + +cleanup_and_exit: + /* done */ + return retval; +} + +#endif /* ASM_INFLATECODES */ + + + +static int inflate_stored(__G) + __GDEF +/* "decompress" an inflated type 0 (stored) block. */ +{ + UINT_D64 w; /* current window position (deflate64: up to 64k!) */ + unsigned n; /* number of bytes in block */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + int retval = 0; /* error code returned: initialized to "no error" */ + + + /* make local copies of globals */ + Trace((stderr, "\nstored block")); + b = G.bb; /* initialize bit buffer */ + k = G.bk; + w = G.wp; /* initialize window position */ + + + /* go to byte boundary */ + n = k & 7; + DUMPBITS(n); + + + /* get the length and its complement */ + NEEDBITS(16) + n = ((unsigned)b & 0xffff); + DUMPBITS(16) + NEEDBITS(16) + if (n != (unsigned)((~b) & 0xffff)) + return 1; /* error in compressed data */ + DUMPBITS(16) + + + /* read and output the compressed data */ + while (n--) + { + NEEDBITS(8) + redirSlide[w++] = (uch)b; + if (w == wsize) + { + if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; + w = 0; + } + DUMPBITS(8) + } + + + /* restore the globals from the locals */ + G.wp = (unsigned)w; /* restore global window pointer */ + G.bb = b; /* restore global bit buffer */ + G.bk = k; + +cleanup_and_exit: + return retval; +} + + +/* Globals for literal tables (built once) */ +/* Moved to globals.h */ +#if 0 +struct huft *fixed_tl = (struct huft *)NULL; +struct huft *fixed_td; +int fixed_bl, fixed_bd; +#endif + +static int inflate_fixed(__G) + __GDEF +/* decompress an inflated type 1 (fixed Huffman codes) block. We should + either replace this with a custom decoder, or at least precompute the + Huffman tables. */ +{ + /* if first time, set up tables for fixed blocks */ + Trace((stderr, "\nliteral block")); + if (G.fixed_tl == (struct huft *)NULL) + { + int i; /* temporary variable */ + unsigned l[288]; /* length list for huft_build */ + + /* literal table */ + for (i = 0; i < 144; i++) + l[i] = 8; + for (; i < 256; i++) + l[i] = 9; + for (; i < 280; i++) + l[i] = 7; + for (; i < 288; i++) /* make a complete, but wrong code set */ + l[i] = 8; + G.fixed_bl = 7; +#ifdef USE_DEFLATE64 + if ((i = huft_build(__G__ l, 288, 257, G.cplens, G.cplext, + &G.fixed_tl, &G.fixed_bl)) != 0) +#else + if ((i = huft_build(__G__ l, 288, 257, cplens, cplext, + &G.fixed_tl, &G.fixed_bl)) != 0) +#endif + { + G.fixed_tl = (struct huft *)NULL; + return i; + } + + /* distance table */ + for (i = 0; i < MAXDISTS; i++) /* make an incomplete code set */ + l[i] = 5; + G.fixed_bd = 5; +#ifdef USE_DEFLATE64 + if ((i = huft_build(__G__ l, MAXDISTS, 0, cpdist, G.cpdext, + &G.fixed_td, &G.fixed_bd)) > 1) +#else + if ((i = huft_build(__G__ l, MAXDISTS, 0, cpdist, cpdext, + &G.fixed_td, &G.fixed_bd)) > 1) +#endif + { + huft_free(G.fixed_tl); + G.fixed_td = G.fixed_tl = (struct huft *)NULL; + return i; + } + } + + /* decompress until an end-of-block code */ + return inflate_codes_boinc(__G__ G.fixed_tl, G.fixed_td, + G.fixed_bl, G.fixed_bd); +} + + + +static int inflate_dynamic(__G) + __GDEF +/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +{ + int i; /* temporary variables */ + unsigned j; + unsigned l; /* last length */ + unsigned m; /* mask for bit lengths table */ + unsigned n; /* number of lengths to get */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned nb; /* number of bit length codes */ + unsigned nl; /* number of literal/length codes */ + unsigned nd; /* number of distance codes */ + unsigned ll[MAXLITLENS+MAXDISTS]; /* lit./length and distance code lengths */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + int retval = 0; /* error code returned: initialized to "no error" */ + + + /* make local bit buffer */ + Trace((stderr, "\ndynamic block")); + b = G.bb; + k = G.bk; + + + /* read in table lengths */ + NEEDBITS(5) + nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ + DUMPBITS(5) + NEEDBITS(5) + nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ + DUMPBITS(5) + NEEDBITS(4) + nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ + DUMPBITS(4) + if (nl > MAXLITLENS || nd > MAXDISTS) + return 1; /* bad lengths */ + + + /* read in bit-length-code lengths */ + for (j = 0; j < nb; j++) + { + NEEDBITS(3) + ll[border[j]] = (unsigned)b & 7; + DUMPBITS(3) + } + for (; j < 19; j++) + ll[border[j]] = 0; + + + /* build decoding table for trees--single level, 7 bit lookup */ + bl = 7; + retval = huft_build(__G__ ll, 19, 19, NULL, NULL, &tl, &bl); + if (bl == 0) /* no bit lengths */ + retval = 1; + if (retval) + { + if (retval == 1) + huft_free(tl); + return retval; /* incomplete code set */ + } + + + /* read in literal and distance code lengths */ + n = nl + nd; + m = mask_bits[bl]; + i = l = 0; + while ((unsigned)i < n) + { + NEEDBITS((unsigned)bl) + j = (td = tl + ((unsigned)b & m))->b; + DUMPBITS(j) + j = td->v.n; + if (j < 16) /* length of code in bits (0..15) */ + ll[i++] = l = j; /* save last length in l */ + else if (j == 16) /* repeat last length 3 to 6 times */ + { + NEEDBITS(2) + j = 3 + ((unsigned)b & 3); + DUMPBITS(2) + if ((unsigned)i + j > n) + return 1; + while (j--) + ll[i++] = l; + } + else if (j == 17) /* 3 to 10 zero length codes */ + { + NEEDBITS(3) + j = 3 + ((unsigned)b & 7); + DUMPBITS(3) + if ((unsigned)i + j > n) + return 1; + while (j--) + ll[i++] = 0; + l = 0; + } + else /* j == 18: 11 to 138 zero length codes */ + { + NEEDBITS(7) + j = 11 + ((unsigned)b & 0x7f); + DUMPBITS(7) + if ((unsigned)i + j > n) + return 1; + while (j--) + ll[i++] = 0; + l = 0; + } + } + + + /* free decoding table for trees */ + huft_free(tl); + + + /* restore the global bit buffer */ + G.bb = b; + G.bk = k; + + + /* build the decoding tables for literal/length and distance codes */ + bl = lbits; +#ifdef USE_DEFLATE64 + retval = huft_build(__G__ ll, nl, 257, G.cplens, G.cplext, &tl, &bl); +#else + retval = huft_build(__G__ ll, nl, 257, cplens, cplext, &tl, &bl); +#endif + if (bl == 0) /* no literals or lengths */ + retval = 1; + if (retval) + { + if (retval == 1) { + if (!uO.qflag) + MESSAGE((uch *)"(incomplete l-tree) ", 21L, 1); + huft_free(tl); + } + return retval; /* incomplete code set */ + } + bd = dbits; +#ifdef USE_DEFLATE64 + retval = huft_build(__G__ ll + nl, nd, 0, cpdist, G.cpdext, &td, &bd); +#else + retval = huft_build(__G__ ll + nl, nd, 0, cpdist, cpdext, &td, &bd); +#endif +#ifdef PKZIP_BUG_WORKAROUND + if (retval == 1) + retval = 0; +#endif + if (bd == 0 && nl > 257) /* lengths but no distances */ + retval = 1; + if (retval) + { + if (retval == 1) { + if (!uO.qflag) + MESSAGE((uch *)"(incomplete d-tree) ", 21L, 1); + huft_free(td); + } + huft_free(tl); + return retval; + } + + /* decompress until an end-of-block code */ + retval = inflate_codes_boinc(__G__ tl, td, bl, bd); + +cleanup_and_exit: + /* free the decoding tables, return */ + huft_free(tl); + huft_free(td); + return retval; +} + + + +static int inflate_block(__G__ e) + __GDEF + int *e; /* last block flag */ +/* decompress an inflated block */ +{ + unsigned t; /* block type */ + register ulg b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + int retval = 0; /* error code returned: initialized to "no error" */ + + + /* make local bit buffer */ + b = G.bb; + k = G.bk; + + + /* read in last block bit */ + NEEDBITS(1) + *e = (int)b & 1; + DUMPBITS(1) + + + /* read in block type */ + NEEDBITS(2) + t = (unsigned)b & 3; + DUMPBITS(2) + + + /* restore the global bit buffer */ + G.bb = b; + G.bk = k; + + + /* inflate that block type */ + if (t == 2) + return inflate_dynamic(__G); + if (t == 0) + return inflate_stored(__G); + if (t == 1) + return inflate_fixed(__G); + + + /* bad block type */ + retval = 2; + +cleanup_and_exit: + return retval; +} + + + +int inflate_boinc(__G__ is_defl64) + __GDEF + int is_defl64; +/* decompress an inflated entry */ +{ + int e; /* last block flag */ + int r; /* result code */ +#ifdef DEBUG + unsigned h = 0; /* maximum struct huft's malloc'ed */ +#endif + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) + wsize = G.redirect_size, redirSlide = G.redirect_buffer; + else + wsize = WSIZE, redirSlide = slide; /* how they're #defined if !DLL */ +#endif + + /* initialize window, bit buffer */ + G.wp = 0; + G.bk = 0; + G.bb = 0; + +#ifdef USE_DEFLATE64 + if (is_defl64) { + G.cplens = cplens64; + G.cplext = cplext64; + G.cpdext = cpdext64; + G.fixed_tl = G.fixed_tl64; + G.fixed_bl = G.fixed_bl64; + G.fixed_td = G.fixed_td64; + G.fixed_bd = G.fixed_bd64; + } else { + G.cplens = cplens32; + G.cplext = cplext32; + G.cpdext = cpdext32; + G.fixed_tl = G.fixed_tl32; + G.fixed_bl = G.fixed_bl32; + G.fixed_td = G.fixed_td32; + G.fixed_bd = G.fixed_bd32; + } +#else /* !USE_DEFLATE64 */ + if (is_defl64) { + /* This should not happen unless UnZip is built from object files + * compiled with inconsistent option setting. Handle this by + * returning with "bad input" error code. + */ + Trace((stderr, "\nThis inflate_boinc() cannot handle Deflate64!\n")); + return 2; + } +#endif /* ?USE_DEFLATE64 */ + + /* decompress until the last block */ + do { +#ifdef DEBUG + G.hufts = 0; +#endif + if ((r = inflate_block(__G__ &e)) != 0) + return r; +#ifdef DEBUG + if (G.hufts > h) + h = G.hufts; +#endif + } while (!e); + + Trace((stderr, "\n%u bytes in Huffman tables (%u/entry)\n", + h * (unsigned)sizeof(struct huft), (unsigned)sizeof(struct huft))); + +#ifdef USE_DEFLATE64 + if (is_defl64) { + G.fixed_tl64 = G.fixed_tl; + G.fixed_bl64 = G.fixed_bl; + G.fixed_td64 = G.fixed_td; + G.fixed_bd64 = G.fixed_bd; + } else { + G.fixed_tl32 = G.fixed_tl; + G.fixed_bl32 = G.fixed_bl; + G.fixed_td32 = G.fixed_td; + G.fixed_bd32 = G.fixed_bd; + } +#endif + + /* flush out redirSlide and return (success, unless final FLUSH failed) */ + return (FLUSH(G.wp)); +} + + + +int inflate_free(__G) + __GDEF +{ + if (G.fixed_tl != (struct huft *)NULL) + { + huft_free(G.fixed_td); + huft_free(G.fixed_tl); + G.fixed_td = G.fixed_tl = (struct huft *)NULL; + } + return 0; +} + +#endif /* ?USE_ZLIB */ + + +/* + * GRR: moved huft_build() and huft_free() down here; used by explode() + * and fUnZip regardless of whether USE_ZLIB defined or not + */ + + +/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ +#define BMAX 16 /* maximum bit length of any code (16 for explode) */ +#define N_MAX 288 /* maximum number of codes in any set */ + + +int huft_build(__G__ b, n, s, d, e, t, m) + __GDEF + ZCONST unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ + unsigned n; /* number of codes (assumed <= N_MAX) */ + unsigned s; /* number of simple-valued codes (0..s-1) */ + ZCONST ush *d; /* list of base values for non-simple codes */ + ZCONST uch *e; /* list of extra bits for non-simple codes */ + struct huft **t; /* result: starting table */ + int *m; /* maximum lookup bits, returns actual */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return zero on success, one if + the given code set is incomplete (the tables are still built in this + case), two if the input is invalid (all zero length codes or an + oversubscribed set of lengths), and three if not enough memory. + The code with value 256 is special, and the tables are constructed + so that no bits beyond that code are fetched when that code is + decoded. */ +{ + unsigned a; /* counter for codes of length k */ + unsigned c[BMAX+1]; /* bit length count table */ + unsigned el; /* length of EOB code (value 256) */ + unsigned f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register unsigned i; /* counter, current code */ + register unsigned j; /* counter */ + register int k; /* number of bits in current code */ + int lx[BMAX+1]; /* memory for l[-1..BMAX-1] */ + int *l = lx+1; /* stack of bits per table */ + register unsigned *p; /* pointer into c[], b[], or v[] */ + register struct huft *q; /* points to current table */ + struct huft r; /* table entry for structure assignment */ + struct huft *u[BMAX]; /* table stack */ + unsigned v[N_MAX]; /* values in order of bit length */ + register int w; /* bits before this table == (l * h) */ + unsigned x[BMAX+1]; /* bit offsets, then code stack */ + unsigned *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + unsigned z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + el = n > 256 ? b[256] : BMAX; /* set length of EOB code, if any */ + memzero((char *)c, sizeof(c)); + p = (unsigned *)b; i = n; + do { + c[*p]++; p++; /* assume all entries <= BMAX */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (struct huft *)NULL; + *m = 0; + return 0; + } + + + /* Find minimum and maximum length, bound *m by those */ + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((unsigned)*m < j) + *m = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((unsigned)*m > i) + *m = i; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1) + if ((y -= c[j]) < 0) + return 2; /* bad input: more codes than bits */ + if ((y -= c[i]) < 0) + return 2; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + memzero((char *)v, sizeof(v)); + p = (unsigned *)b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + n = x[g]; /* set n to length of v */ + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = l[-1] = 0; /* no bits decoded yet */ + u[0] = (struct huft *)NULL; /* just to keep compilers happy */ + q = (struct huft *)NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l[h]) + { + w += l[h++]; /* add bits already decoded */ + + /* compute minimum size table less than or equal to *m bits */ + z = (z = g - w) > (unsigned)*m ? *m : z; /* upper limit */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + if ((unsigned)w + j > el && (unsigned)w < el) + j = el - w; /* make EOB code end at table */ + z = 1 << j; /* table entries for j-bit table */ + l[h] = j; /* set table size in stack */ + + /* allocate and link in new table */ + if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == + (struct huft *)NULL) + { + if (h) + huft_free(u[0]); + return 3; /* not enough memory */ + } +#ifdef DEBUG + G.hufts += z + 1; /* track memory usage */ +#endif + *t = q + 1; /* link to list for huft_free() */ + *(t = &(q->v.t)) = (struct huft *)NULL; + u[h] = ++q; /* table starts after link */ + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.b = (uch)l[h-1]; /* bits to dump before this table */ + r.e = (uch)(32 + j); /* bits in this table */ + r.v.t = q; /* pointer to this table */ + j = (i & ((1 << w) - 1)) >> (w - l[h-1]); + u[h-1][j] = r; /* connect to last table */ + } + } + + /* set up table entry in r */ + r.b = (uch)(k - w); + if (p >= v + n) + r.e = INVALID_CODE; /* out of values--invalid code */ + else if (*p < s) + { + r.e = (uch)(*p < 256 ? 32 : 31); /* 256 is end-of-block code */ + r.v.n = (ush)*p++; /* simple code is just the value */ + } + else + { + r.e = e[*p - s]; /* non-simple--look up in lists */ + r.v.n = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + while ((i & ((1 << w) - 1)) != x[h]) + w -= l[--h]; /* don't need to update q */ + } + } + + + /* return actual size of base table */ + *m = l[0]; + + + /* Return true (1) if we were given an incomplete table */ + return y != 0 && g != 1; +} + + + +int huft_free(t) +struct huft *t; /* table to free */ +/* Free the malloc'ed tables built by huft_build(), which makes a linked + list of the tables it made, with the links in a dummy first entry of + each table. */ +{ + register struct huft *p, *q; + + + /* Go through linked list, freeing from the malloced (t[-1]) address. */ + p = t; + while (p != (struct huft *)NULL) + { + q = (--p)->v.t; + free((zvoid *)p); + p = q; + } + return 0; +} + +const char *BOINC_RCSID_0f7484c9b3 = "$Id: inflate.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/inflate.h boinc-7.0.14+dfsg/zip/unzip/inflate.h --- boinc-7.0.7+dfsg/zip/unzip/inflate.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/inflate.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,39 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* inflate.h for UnZip -- by Mark Adler + version c14f, 23 November 1995 */ + + +/* Copyright history: + - Starting with UnZip 5.41 of 16-April-2000, this source file + is covered by the Info-Zip LICENSE cited above. + - Prior versions of this source file, found in UnZip source packages + up to UnZip 5.40, were put in the public domain. + The original copyright note by Mark Adler was: + "You can do whatever you like with this source file, + though I would prefer that if you modify it and + redistribute it that you include comments to that effect + with your name and the date. Thank you." + + History: + vers date who what + ---- --------- -------------- ------------------------------------ + c14 12 Mar 93 M. Adler made inflate.c standalone with the + introduction of inflate.h. + c14d 28 Aug 93 G. Roelofs replaced flush/FlushOutput with new version + c14e 29 Sep 93 G. Roelofs moved everything into unzip.h; added crypt.h + c14f 23 Nov 95 G. Roelofs added UNZIP_INTERNAL to accommodate newly + split unzip.h + */ + +#define UNZIP_INTERNAL +#include "unzip.h" /* provides slide[], typedefs and macros */ +//#ifdef FUNZIP +//# include "crypt.h" /* provides NEXTBYTE macro for crypt version of funzip */ +//#endif diff -Nru boinc-7.0.7+dfsg/zip/unzip/INSTALL boinc-7.0.14+dfsg/zip/unzip/INSTALL --- boinc-7.0.7+dfsg/zip/unzip/INSTALL 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/INSTALL 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,603 @@ +__________________________________________________________________________ + + This is the Info-ZIP file INSTALL (for UnZip), last updated 28 Apr 2001. +__________________________________________________________________________ + + Yes, this is a rather long file, but don't be intimidated: much of its + length is due to coverage of multiple operating systems and of optional + customization features, large portions of which may be skipped. +__________________________________________________________________________ + + + +To compile UnZip, UnZipSFX and/or fUnZip (quick-start instructions): +======================================== + +(1) Unpack everything into a work directory somewhere, and make sure you're + in the main UnZip directory (the one with this file in it). + * (See note below concerning line termination format used in the source + distribution) + +(2) Copy the appropriate makefile into the current directory, except under + OS/2. + +(3) Run your "make" utility on the makefile (e.g., "nmake -f makefile.msc"). + +(4) Try out your new UnZip the way you would any new utility: read the + docs first. + + Ah ha ha ha!! Oh, that kills me. But seriously...for VMS, UnZip must + be installed as a "foreign symbol"; see the Install section below or + [.vms]readme.vms for details. (It basically involves adding a line + sort of like this to login.com: $ unzip == "$disk:[dir]unzip.exe") + + For DOS and other OSes without explicit timezone support (i.e., everybody + but Unix, Windows 95 and NT), make sure the "TZ" environment variable is + set to a valid and reasonable value; see your compiler docs for details. + +(*) The unzip sources as well as other Info-ZIP source archives are packaged + in Unix format. All text files use single LF (Ascii 0x0a) characters as + line terminators. On systems that use different conventions for plain text + files (e.g.:DOS,Win9x,WinNT,OS/2 -> combined CR+LF; MacOS -> single CR), + some utilities (editors, compilers, etc.) may not accept source files + with LF line terminators. + For these systems, we recommend to use Info-ZIP's UnZip utility for + extraction of our distribution archives, applying the command option + "-a" (= translate text files to native format) in the extraction command. + In case this procedure is not applicable, an appropiate third-party + conversion utility may be used to achieve the desired line termination + style (examples: "flip", available for Unix, DOS, OS/2; or "tr" on Unix). + + +To compile UnZip, UnZipSFX and/or fUnZip (detailed instructions): +======================================== + +(1) Unpack *.c and *.h (the actual source files), preserving the directory + structure (e.g., ./unix/unix.c). The sole exception is TOPS-20, where + tops20/* should be unpacked into the current directory, but TOPS-20 + is no longer fully supported anyway. + + As of UnZip 5.41, full decryption support has been integrated in the + UnZip source distribution. If you wish to compile binaries without + decryption support, you must define the preprocessor flag NO_CRYPT. + For many environments, you may add this flag to the custom compilation + flags supplied by the environment variable LOCAL_UNZIP. For more + details, see the make procedures and accompanied documentation for your + particular target OS. + + +(2) Choose the appropriate makefile based on the description in the Con- + tents file for your OS (that is, there's only one for Unix or OS/2, but + MS-DOS and several other OSes have several, depending on the compiler). + Copy it into the current directory and rename if necessary or desired. + (Some makefiles can be invoked in place; see (5) below.) + + Don't be afraid to read the makefile! Many options will be explained only + in the comments contained therein. The defaults may not quite suit your + system. When making changes, remember that some "make" utilities expect + tabs as part of the makefile syntax. Failure with cryptic error messages + will result if your editor quietly replaces those tabs with spaces. + + Special point of confusion: some non-MSDOS makefiles contain MS-DOS + targets (useful for cross-compilations). An example is the OS/2 makefile + os2/makefile.os2 that contains the gccdos target for DOS emx+gcc and + some more DOS related targets for Watcom C and MSC. But since version 5.3, + the msdos subdirectory contains makefiles for all supported DOS compilers. + [The old djgpp, djgpp1 and gcc_dos targets in unix/Makefile have been + removed in 5.3; use msdos/makefile.dj* instead.] + + Extra-special point of confusion: makefile.os2 expects to remain in + the os2 subdirectory. Invoke it via "nmake -f os2/makefile.os2 gcc", + for example. + + +(3) If you want a non-standard version of UnZip, define one or more of the + following optional macros, either by adding them to the LOCAL_UNZIP + environment variable or by editing your makefile as appropriate. The + syntax differs from compiler to compiler, but macros are often defined + via "-DMACRO_NAME" or similar (for one called MACRO_NAME). Note that + some of these may not be fully supported in future releases (or even + in the current release). Note also that very short command lines in + MS-DOS (128 characters) may place severe limits on how many of these + can be used; if need be, the definitions can be placed at the top of + unzip.h instead (it is included in all source files)--for example, + "#define MACRO_NAME", one macro per line. + + DOSWILD (MS-DOS only) + Treat trailing "*.*" like Unix "*" (i.e., matches anything); treat + trailing "*." as match for files without a dot (i.e., matches any- + thing, as long as no dots in name). Special treatment only occurs + if patterns are at end of arguments; i.e., "a*.*" matches all files + starting with "a", but "*.*c" matches all files ending in "c" *only* + if they have a dot somewhere before the "c". [The default method of + specifying files without a dot would be "* -x *.*", making use of + UnZip's exclude-files option.] The matching is actually the same as + Unix, if you assume that undotted filenames really have an invisible + dot at the end, which is how DOS and related systems treat filenames + in general. All other regular expressions (including "?" and + "[range_of_chars]") retain their Unix-like behavior. + + WILD_STOP_AT_DIR + Modifies the pattern matching routine so that both '?' (single-char + wildcard) and '*' (multi-char wildcard) do not match the directory + separator character '/'. Examples: + "*.c" matches "foo.c" but not "mydir/foo.c" + "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c" + "??*/*" matches "ab/foo" and "abc/foo" but not "a/foo" or "a/b/foo" + This modified behaviour is equivalent to the pattern matching style + used by the shells of some of UnZip's supported target OSs (one + example is Acorn RISC OS). + + VMSWILD (VMS only) + Use parentheses rather than brackets to delimit sets (ranges), and + use '%' instead of '?' as the single-character wildcard for internal + filename matching. (External matching of zipfile names always uses + the standard VMS wildcard facilities; character sets are disallowed.) + + VMSCLI (VMS only) + Use VMS-style "slash options" (/FOOBAR) instead of the default Unix- + style hyphenated options (-f). This capability does not affect options + stored in environment variables (UNZIP_OPTS or ZIPINFO_OPTS); those use + the Unix style regardless. Beginning with UnZip 5.32, the supplied + VMS Makefiles and make procedures generate both VMS-style and default + "UNIX style" executables; you should NOT add VMSCLI to the custom + options. + + CHECK_VERSIONS (VMS only) + UnZip "extra fields" are used to store VMS (RMS) filesystem info, + and the format of this information may differ in various versions + of VMS. Defining this option will enable UnZip warnings when the + stored extra-field VMS version(s) do(es) not match the version of + VMS currently being used. This is a common occurrence in zipfiles + received from other sites, but since the format of the filesystem + does not seem to have changed in years (including on Alpha and Open- + VMS systems), the warnings are not enabled by default. + + RETURN_CODES (VMS only) + VMS interprets return codes according to a rigid set of guidelines, + which means it misinterprets normal UnZip return codes as all sorts + of really nasty errors. Therefore VMS UnZip returns an alternate set + of return codes; since these may be difficult to interpret, define + RETURN_CODES for human-readable explanations. + + VMS_TEXT_CONV (everybody except VMS) + VMS text files archived with the "-V" option are only semi-readable at + best when extracted on other systems. Defining this option enables + UnZip's -aa option to attempt to convert such files to native text + format. Non-VMS UnZips don't actually detect the precise VMS format + of the files, however, but instead rely on some reasonably good + heuristics (i.e., guesses). Therefore this option is not enabled by + default, but it can be extremely useful on those rare occasions when + a VMS text file must be extracted as normal text. + + USE_DJGPP_ENV (MS-DOS DJGPP 2.0x only) + Regular DJGPP v2.0x compiled programs which use ENVIRONMENT are + able to read from the file "djgpp.env" as well as those set in the + environment. This adds about 1KB to the size of the executable. + This option is disabled by default in Info-ZIP source. If you are + able to use "djgpp.env" and don't like to clutter the environment + with many special purpose variables, you may want to compile with + this option set. + + USE_DJGPP_GLOB (MS-DOS DJGPP 2.0x only) + If you like to get UnZip binaries that handle command line arguments + similar to Unix tools which are run in an Unix shell, you might want + to set this compilation option. This option enables the support for + globbing command line arguments containing wild card that is built + into the DJGPP startup code. When using a binary compiled with this + option, you may have to enclose wildcard arguments in double quotes + to get them passed to the program unmodified. Enabling this option + is not recommended, because it results in Info-Zip binaries that do + not behave as expected for MS-DOS programs. + + USE_VFAT (MS-DOS only, for using same executable under DOS and Win95/NT) + djgpp 2.x and emx/gcc+RSX 5.1 can detect when they are running under a + Win32 DOS box and will accordingly enable long-filename support. For + now only djgpp 2.x and emx/gcc with RSX 5.1 or later have this feature + (and it is defined by default in msdos/makefile.dj2 and makefile.emx), + but if/when other compilers build in similar support, define this + macro to enable its use. See also msdos/doscfg.h. [Note that djgpp + 2.0's LFN support is flaky; users should upgrade to 2.01 or later.] + + NOTIMESTAMP + This option disables the -T option, which basically does exactly what + Zip's -go options do (i.e., set the timestamp of the zipfile to that of + the newest file in the archive without rewriting the archive). Unlike + Zip, however, UnZip supports wildcard specifications for the archive + name; for example, "unzip -T *.zip" will set the dates of all zipfiles + in the current directory. (UnZip's option is also much faster.) + + DATE_FORMAT=DF_DMY or DF_MDY or DF_YMD + This option controls the order in which date components are printed + in listings: day-month-year or month-day-year or year-month-day. + For DOS derivatives the format is automatically obtained from the + operating system; most others default to DF_MDY. + + ACORN_FTYPE_NFS (needs support for long filenames with embedded commas) + This option enables a -F option that instructs UnZip to interpret the + filetype information extracted from Acorn RiscOS extra field blocks. + The filetype IDs are translated into "NFS filetype extensions" and + appended to the names of the extracted files. This feature facilitates + maintance of Unix-based NFS volumes that are exported to Acorn RiscOS + systems. + + QLZIP (Unix only) + Add some support for QDOS extra fields. This option enables Unix + UnZip to append "datalen info" to QDOS exec type files in the same + format as used by QDOS cross-compilers on Unix or the qltools v2.2(+). + + UNIXBACKUP (Unix only) + This option enables a -B option that instructs UnZip to rename files + that would normally be overwritten. The renamed files are given a + tilde suffix (`~'). Note that previously renamed files may be over- + written without notice, even if the -n option is given. + + OS2_EAS + List the sizes of OS/2 EAs and ACLs for each file as two extra columns + in "unzip -l" output. This is primarily useful for OS/2 systems, but + because zipfiles are portable, OS2_EAS can be defined for any system. + (May be extended someday to show sizes of Mac resource forks, RISCOS + and VMS file info, etc.) + + DELETE_IF_FULL (anybody with unlink() function) + If a write error is encountered (most likely due to a full disk), + enabling this option will cause the incomplete file to be deleted + instead of closed normally. This is particularly useful for the + Windows CE port, which must generally contend with extremely limited + resources. + + ASM_CRC (Amiga/Aztec C; many x86 systems: DOS, OS/2, Win32, Unix) + Use an assembler routine to calculate the CRC for each file (speed). + + ASM_INFLATECODES (Amiga/Aztec C only, for now) + Use an assembler version of inflate_codes() for speed. + + OLD_EXDIR + No longer supported. + + SFX_EXDIR + Enable the "-d " option for UnZipSFX. This is now + enabled by default (since UnZip 5.5) to facilitate use with + automated installation scripts and the like. For disabling + this feature, see the NO_SFX_EXDIR option. + + NO_SFX_EXDIR + Disables the "-d " option for UnZipSFX to generate the + smallest possible executable stub. (Prior to the UnZip 5.5 release, + this was the default.) + + CHEAP_SFX_AUTORUN + Enable a simple "run command after extraction" feature for + the (command line) UnZipSFX stub. This feature is currently + incompatible with the "-d " command line option, + therefore CHEAP_SFX_AUTORUN implicitely sets the NO_SFX_EXDIR + option. + + NO_ZIPINFO + Compile without ZipInfo mode (-Z) enabled; makes a smaller executable + because many text strings are left out. Automatically enabled for + some small-model compiles under MS-DOS and OS/2, so ordinarily there + is no need to specify this explicitly. (Note that even with this + defined, the resulting executable may still be too big to extract + some zipfiles correctly, if compiled with the small memory model.) + + USE_DEFLATE64 (default for UnZip and fUnZip) + NO_DEFLATE64 (default for UnZipSFX stub) + The "deflate64" algorithm from PKZIP 4.0 (or newer) is an enhanced + variant of the deflate algorithm that achieves slightly better + compression ratios on highly redundant data. Normally, UnZip should + be compiled with support for this compression algorithm enabled. + However, this results in significantly larger memory requirements + to run the program. For 16-bit executables (DOS and OS/2), the + special memory management to support the 64k history buffer results + in a slight performance (= speed) penalty. And for the SFX stub, + "deflate64" support might be unnessessary as long as the Info-ZIP + Zip utility does not support it (quite likely, this will never + get implemented). So, the NO_DEFLATE64 option is provided to allow + exclusion of the deflate64 support. + + MULT_VOLUME (experimental for 5.5x, do NOT use in production versions!) + NO_MULT_VOLUME (default) + The symbol MULT_VOLUME is used to flag code portions needed for + support of multi-volume archives. For now, this flag MUST NOT be + used to compile a production versions of UnZip. This flag has been + introduced to allow integration of experimental code for multi-volume + support in the master source tree. This feature will become a default + option in the future 6.0 release of UnZip. + + LZW_CLEAN (now default) + USE_UNSHRINK + The "shrinking" algorithm from PKZIP 1.0 is an LZW variant. Unisys + patented the Lempel-Ziv-Welch algorithm in 1985 and has publicly + claimed that decompression is covered by it. (IBM also patented the + same thing in a filing 3 weeks prior to Unisys's.) Therefore un- + shrinking is disabled by default, but those with LZW licenses can + enable it by defining USE_UNSHRINK. (Unshrinking was used by PKZIP + 1.0 and 1.1, and Zip 1.0 and 1.1. All newer archives use only the + deflation method.) + + COPYRIGHT_CLEAN (now default) + USE_SMITH_CODE + The last chunk of code in UnZip that was blatantly derived from Sam + Smith's unzip 2.0 (as in, "substantially similar") is in unreduce.c. + Since reducing was only used by very early PKZIP beta versions (0.9x), + support for it is now omitted by default (COPYRIGHT_CLEAN). To in- + clude unreducing capability, define USE_SMITH_CODE. Note that this + subjects UnZip to any and all restrictions in Smith's copyright; see + the UnZip COPYING file for details. + + USE_CRYPT + Enable decryption support for all binaries. The default setting + is to disable decryption support for the SFX stub to keep its size + as small as possible. For other binaries of the UnZip distribution, + decryption support is enabled by default. + + NO_CRYPT + Disable decryption support for all binaries. + + PASSWD_FROM_STDIN (with full crypt sources only; Unix, VMS only) + Used to allow the password on encrypted files to be read from stdin + rather than the default stderr. This was useful for those who wished + to automate the testing or decoding of encrypted archives (say, in a + shell script via ``echo "password" | unzip -tq archive''), but as of + version 5.3, UnZip has a -P option for passing a password directly to + the program. PASSWD_FROM_STDIN will therefore probably be phased out + in future versions. Note that the same security warnings given in the + description of the -P option apply here as well. + + DEBUG + Used for debugging purposes; enables Trace() statements. Generally + it's best to compile only one or two modules this way. + + DEBUG_TIME + Used for debugging the timezone code in fileio.c; enables TTrace() + statements. This code is only used for the freshen/update options + (-f and -u), and non-Unix compilers often get it wrong. + + +(4) If you regularly compile new versions of UnZip and always want the same + non-standard option(s), you may wish to add it (them) to the LOCAL_UNZIP + environment variable (assuming it's supported in your makefile). Under + MS-DOS, for example, add this to AUTOEXEC.BAT: + + set LOCAL_UNZIP=-DDOSWILD -DDATE_FORMAT=DF_DMY + + You can also use the variable to hold special compiler options (e.g., + -FPi87 for Microsoft C, if the x87 libraries are the only ones on your + disk and they follow Microsoft's default naming conventions; MSC also + supports the CL environment variable, however). + + +(5) Run the make utility on your chosen makefile: + + Unix + For most systems it's possible to invoke the makefile in place, at + the possible cost of an ignorable warning; do "make -f unix/Makefile + list" to get a list of possible system targets, and then "make -f + unix/Makefile target" for your chosen target. The "generic" target + works for most systems, but if it fails with a message about ftime() + unresolved or timezone redefined, do "make clean", "make help", and + then either "make generic2" or "make generic3" as instructed. If all + else fails, read the makefile itself; it contains numerous comments. + (One of these days we'll make a configure script that automates this + procedure better.) + + VMS + For a one-time build of the default UnZip, simply run the supplied + command file MAKE_UNZ.COM. To use either DEC C on an Alpha or the + default compiler (DEC C if available, else VAX C) on a VAX, type + "@make_unz" (after copying make_unz.com into the current directory; + otherwise do "@[.vms]make_unz" to invoke it in place). + If you want to force the use of VAX C when both VAX C and DEC C are + available, do "@make_unz vaxc" (or "@[.vms]make_unz vaxc"). + To use GNU C (gcc) on either platform, do "@make_unz gnuc". + (NOTE: Currently, gcc for VMS(AXP) is not yet available!) + The command procedure MAKE_UNZ.COM now recognizes custom feature + options supplied in the logical name LOCAL_UNZIP; details are + explained in the comments at the top of MAKE_UNZ.COM. + + For repeated makes or other hacker-like tinkering with the sources, + or to create a custom version of UnZip, you may use the included "MMS" + makefile, DESCRIP.MMS. Copy it into the current directory, read the + comments at the top of it and run MadGoat's free MMS clone "MMK" on it. + Newer versions of DEC's MMS should work, too, but older ones apparently + choke on some MMK-specific extensions in DESCRIP.MMS. (If somebody + has an "older" version that works, let us know and we'll remove this + caveat.) + + MS-DOS + See the msdos\Contents file for notes regarding which makefile(s) to + use with which compiler. In summary: pick one of msdos\makefile.* + as appropriate, or (as noted above) use the OS/2 gccdos target for + emx+gcc. There is also an mscdos cross-compilation target in + os2\makefile.os2 and a sco_dos cross-compilation target in the Unix + makefile. For Watcom 16-bit or 32-bit versions, see the comments in + the OS/2 section below. + + After choosing the appropriate makefile and editing as necessary or + desired, invoke the corresponding make utility. Microsoft's NMAKE + and the free dmake and GNU make utilities are generally the most + versatile. The makefiles in the msdos directory can be invoked in + place ("nmake -f msdos\makefile.msc", for example). + + OS/2 + Either GNU make, nmake or dmake may be used with the OS/2 makefile; + all are freely available on the net. Do "nmake -f os2\makefile.os2", + for example, to get a list of supported targets. More generally, + read the comments at the top of the makefile for an explanation of + the differences between some of the same-compiler targets. + + Win32 (WinNT or Win95) + You will need Microsoft Visual C++ 2.x for Win95 or NT (Intel, MIPS, + Alpha, PowerPC?), or Watcom C++ for Win95 or NT (Intel only). As an + alternative for Intel platforms, GNU C (the emx/rsxnt port) is now + supported as well. DEC C/C++ for NT/Alpha may or may not still work. + For the Watcom compiler, use WMAKE and win32\makefile.wat; for the + others, use NMAKE and win32\Makefile. With emx+gcc, a good choice is + GNUMake 3.75 from the djgpp V2.01 distribution. + + WinCE (WinCE or WinNT) + Only Microsoft Visual C++ 5.0 or later is supported. Use the included + project file and check wince\README for details. + + AmigaDOS + SAS/Lattice C and Manx Aztec C are supported. For SAS C 6.x do "smake + -f amiga/smakefile all"; for Aztec C do "make -f amiga/makefile.azt + all". The Aztec C version supports assembly-language versions of two + routines; these are enabled by default. + + Atari TOS + Turbo C is no longer supported; use gcc and the MiNT libraries, and + do "make". Note that all versions of gcc prior to 2.5.8 have a bug + affecting 68000-based machines (optimizer adds 68020 instructions). + See atari\README for comments on using other compilers. + + Macintosh + Metrowerks CodeWarrior Pro 4 with Universal Interfaces 3.1 is the only + currently supported compiler, although the Mac Programmer's Workbench + (MPW) and Think C were supported at one time and still have some hooks. + Other Compilers may work too, no compiler specific instructions + (pragma, header, macros, ...) were used in the code. + For CodeWarrior Pro 4, un-BinHex the CodeWarrior project file and + UnZip resource file (using Stuffit Expander or BinHex 4.0 or later), + then open the project and click on the compile button. + See ":macos:Contents" for the possible project targets. + Link order of the standard libraries is very important: Link all + sources first and all standard libraries last. + + Acorn (RISC OS) + Extract the files from the archive and place in standard 'Acorn' C + form (i.e., *.c, *.h and *.s become c.*, h.* and s.*, respectively), + either using the UNZIP$EXTS environment variable and a pre-built UnZip + binary, or using Spark[FS] and doing it manually. Then copy the + Acorn.Makefile to the main UnZip directory and either type 'amu' or + use the desktop make utility. + + VM/CMS + Unpack all the files and transfer them with ASCII -> EBCDIC conver- + sion to an appropriate directory/minidisk/whatever, then execute + UNZVMC to compile and link all the sources. This may require C/370 + version 2.1 or later and certain `nucleus extensions,' although + UnZip 5.3 has been reported to compile fine with the `ADCYCLE C/370 + v1.2 compiler.' Note that it will abend without access to the C/370 + runtime library. See the README.CMS file for more details. + + MVS + Unpack all the files and transfer them to an appropriate PDS with + ASCII -> EBCDIC conversion enabled, then edit UNZMVSC.JOB as required, + and execute it to compile and link all the sources. C/370 2.1 or + later is required. See README.MVS for further details. [This is a + new port and may need a little more work even to compile.] + + Human68K + [This is a Japanese machine and OS.] It appears that GNU make and + gcc are required; presumably just do "gmake -f human68k/Makefile.gcc" + to build everything. This port has not been tested since the 5.12 + release. + + TOPS-20 + [No longer fully supported due to new, unported features, although + patches are always accepted.] Unpack all files into the current + directory only (including those in the zipfile's tops20 directory), + then use make.mic and "do make". + + BeOS + You can run the BeOS makefile in place by typing "make -f + beos/Makefile". In fact, this is how the author tests it. + + Running the appropriate make utility should produce three executables on + most systems, one for UnZip/ZipInfo, one for UnZipSFX, and one for fUnZip. + (VMS is one prominent exception: fUnZip makes no sense on it. The Amiga + produces a fourth executable called MakeSFX, which is necessary because + Amiga self-extracting archives cannot be created by simple concatenation. + If necessary the source amiga/makesfx.c can be compiled on other systems.) + Read any OS-specific README files for notes on setting things up for + normal use (especially for VMS) and for warnings about known quirks and + bugs in various compilers (especially for MS-DOS). + + Also note that many OSes require a timezone variable to be set correctly + (often "TZ"); Unix and VMS generally do so by default, Win95/NT do if set + up properly, but other OSes generally do not. See the discussion of the + -f and -u options in the UnZip man page (or unzip.txt). BeOS doesn't + currently support timezone information at all, but this will probably be + added soon. + + Then test your new UnZip on a few archives and let us know if there are + problems (but *please* first make certain that the archives aren't actu- + ally corrupted and that you didn't make one of the silly mistakes dis- + cussed in the documentation). If possible, double-check any problems + with PKUNZIP or with a previous version of UnZip prior to reporting a + "bug." The zipfile itself may be damaged. + + + +To install: +=========== + +Unix + The default prefix for the installation location is /usr/local (things + go into the bin and man/man1 subdirectories beneath the prefix), and + the default man-page extension is "1" (corresponding to man/man1, above). + To install as per the defaults, do "make install"; otherwise do "make + prefix=/your/path manext=your_extension install". (For Intel Unix flavors + where the assembler CRC routines were used [ASM_CRC], use the install_asm + target instead of the regular install target.) For example, to install + in your home directory with "l" as the man-page extension (for "local"), + do "make prefix=$HOME manext=l install". Permissions will be 755 for the + executables and 644 for the man pages. In general root must perform in- + stallation into a public directory. Do "rehash" if your shell requires + it in order to find the new executables. + +VMS + Install UnZip as foreign symbol by adding this to login.com: + + $ unzip == "$disk:[dir]unzip.exe" + $ zipinfo == "$disk:[dir]unzip.exe ""-Z""" + + where "disk" and "dir" are the location of the UnZip executable; the "$" + before the disk name is important, as are the double-double-quotes around + the -Z. Some people, including the author, prefer a short alias such as + "ii" instead of "zipinfo"; edit to taste. Optionally also install unzipsfx + for use with the MAKESFX.COM command file. See vms/README (or [.VMS]README.) + for details on this and for notes/warnings about zipfiles and UnZip under + VMS. + +OS/2, MS-DOS, NT, Atari, Amiga + Move or copy unzip.exe (or unzip.ttp, or UnZip, or whatever) to a direc- + tory in your path; also possibly copy the UnZip executable to zipinfo.exe + (or ii.exe), or else create an alias or a batch/command file for ZipInfo + ("@unzip -Z %1 %2 %3 %4 %5 %6 %7 %8 %9" under MS-DOS). The latter is only + relevant if NO_ZIPINFO was *not* defined, obviously... Under djgpp 2.x, + zipinfo.exe is a 2K stub symbolically linked to unzip.exe. + +Acorn RISC OS + Copy the executables unzip, funzip and zipinfo to somewhere in your + Run$Path. See your Welcome manual if you don't know about Run$Path. + +BeOS + The default prefix for the installation location is /boot/usr/local + (things go into the bin and man/man1 subdirectories beneath the prefix), + and the default man-page extension is "1" (corresponding to the man/man1, + above). Of course, these Unix man-pages aren't useful until someone ports + something that can format them... plain text versions are also installed + with an extension of ".txt". To install, do a "make install", or to + change the prefix, do "make prefix=/your/path install". For example, to + install in /boot/bin, do "make prefix=/boot/bin install". + +Macintosh + MacZip requires at least System 7 and a Macintosh with a minimum of a + Motorola 68020 or PowerPC 601 processor. Other configurations may work + but it is not tested at all. + The application (MacZip) is distributed as a combination of zip and unzip + in one program. The offical release is a fat binary with both regular 68K + and native PowerPC versions included. + Move the executable(s) somewhere--for example, drag it (or them) to your + Applications folder. For easy access, make an alias in the Launcher Control + Panel or directly on your desktop. + This port supports also Apple-event.So you can install it in your + WWW-Browser as a helper-app. + Look into "macos/README.TXT" (or ":macos:README.TXT" on Mac) for further + info. + +Human68K, TOPS-20, AOS/VS, MVS, VM/CMS, etc. + Dunno, sorry... diff -Nru boinc-7.0.7+dfsg/zip/unzip/LICENSE boinc-7.0.14+dfsg/zip/unzip/LICENSE --- boinc-7.0.7+dfsg/zip/unzip/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/LICENSE 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,53 @@ +This is version 2002-Feb-16 of the Info-ZIP copyright and license. +The definitive version of this document should be available at +ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely. + + +Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + +For the purposes of this copyright and license, "Info-ZIP" is defined as +the following set of individuals: + + Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, + Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, + Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, + Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, + Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, + Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, + Paul von Behren, Rich Wales, Mike White + +This software is provided "as is," without warranty of any kind, express +or implied. In no event shall Info-ZIP or its contributors be held liable +for any direct, indirect, incidental, special or consequential damages +arising out of the use of or inability to use this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. Redistributions of source code must retain the above copyright notice, + definition, disclaimer, and this list of conditions. + + 2. Redistributions in binary form (compiled executables) must reproduce + the above copyright notice, definition, disclaimer, and this list of + conditions in documentation and/or other materials provided with the + distribution. The sole exception to this condition is redistribution + of a standard UnZipSFX binary as part of a self-extracting archive; + that is permitted without inclusion of this license, as long as the + normal UnZipSFX banner has not been removed from the binary or disabled. + + 3. Altered versions--including, but not limited to, ports to new operating + systems, existing ports with new graphical interfaces, and dynamic, + shared, or static library versions--must be plainly marked as such + and must not be misrepresented as being the original source. Such + altered versions also must not be misrepresented as being Info-ZIP + releases--including, but not limited to, labeling of the altered + versions with the names "Info-ZIP" (or any variation thereof, including, + but not limited to, different capitalizations), "Pocket UnZip," "WiZ" + or "MacZip" without the explicit permission of Info-ZIP. Such altered + versions are further prohibited from misrepresentative use of the + Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). + + 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," + "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its + own source and binary releases. diff -Nru boinc-7.0.7+dfsg/zip/unzip/list.c boinc-7.0.14+dfsg/zip/unzip/list.c --- boinc-7.0.7+dfsg/zip/unzip/list.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/list.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,673 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + list.c + + This file contains the non-ZipInfo-specific listing routines for UnZip. + + Contains: list_files() + get_time_stamp() [optional feature] + ratio() + fnprint() + + ---------------------------------------------------------------------------*/ + + +#define UNZIP_INTERNAL +#include "unzip.h" +#ifdef WINDLL +# ifdef POCKET_UNZIP +# include "wince/intrface.h" +# else +# include "windll/windll.h" +# endif +#endif + + +#ifdef TIMESTAMP + static int fn_is_dir OF((__GPRO)); +#endif + +#ifndef WINDLL + static ZCONST char Far CompFactorStr[] = "%c%d%%"; + static ZCONST char Far CompFactor100[] = "100%%"; + +#ifdef OS2_EAS + static ZCONST char Far HeadersS[] = + " Length EAs ACLs Date Time Name"; + static ZCONST char Far HeadersS1[] = + " -------- --- ---- ---- ---- ----"; +#else + static ZCONST char Far HeadersS[] = " Length Date Time Name"; + static ZCONST char Far HeadersS1[] = " -------- ---- ---- ----"; +#endif + + static ZCONST char Far HeadersL[] = + " Length Method Size Ratio Date Time CRC-32 Name"; + static ZCONST char Far HeadersL1[] = + "-------- ------ ------- ----- ---- ---- ------ ----"; + static ZCONST char Far *Headers[][2] = + { {HeadersS, HeadersS1}, {HeadersL, HeadersL1} }; + + static ZCONST char Far CaseConversion[] = + "%s (\"^\" ==> case\n%s conversion)\n"; + static ZCONST char Far LongHdrStats[] = + "%8lu %-7s%8lu %4s %02u-%02u-%02u %02u:%02u %08lx %c"; + static ZCONST char Far LongFileTrailer[] = + "-------- ------- --- \ + -------\n%8lu %8lu %4s %lu file%s\n"; +#ifdef OS2_EAS + static ZCONST char Far ShortHdrStats[] = + "%9lu %6lu %6lu %02u-%02u-%02u %02u:%02u %c"; + static ZCONST char Far ShortFileTrailer[] = " -------- ----- ----- \ + -------\n%9lu %6lu %6lu %lu file%s\n"; + static ZCONST char Far OS2ExtAttrTrailer[] = + "%lu file%s %lu bytes of OS/2 extended attributes attached.\n"; + static ZCONST char Far OS2ACLTrailer[] = + "%lu file%s %lu bytes of access control lists attached.\n"; +#else + static ZCONST char Far ShortHdrStats[] = + "%9lu %02u-%02u-%02u %02u:%02u %c"; + static ZCONST char Far ShortFileTrailer[] = " -------- \ + -------\n%9lu %lu file%s\n"; +#endif /* ?OS2_EAS */ +#endif /* !WINDLL */ + + + + + +/*************************/ +/* Function list_files() */ +/*************************/ + +int list_files(__G) /* return PK-type error code */ + __GDEF +{ + int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL; +#ifndef WINDLL + char sgn, cfactorstr[10]; + int longhdr=(uO.vflag>1); +#endif + int date_format; + ulg j, members=0L; + unsigned methnum; +#ifdef USE_EF_UT_TIME + iztimes z_utime; + struct tm *t; +#endif + unsigned yr, mo, dy, hh, mm; + ulg csiz, tot_csize=0L, tot_ucsize=0L; +#ifdef OS2_EAS + ulg ea_size, tot_easize=0L, tot_eafiles=0L; + ulg acl_size, tot_aclsize=0L, tot_aclfiles=0L; +#endif + min_info info; + char methbuf[8]; + static ZCONST char dtype[]="NXFS"; /* see zi_short() */ + static ZCONST char Far method[NUM_METHODS+1][8] = + {"Stored", "Shrunk", "Reduce1", "Reduce2", "Reduce3", "Reduce4", + "Implode", "Token", "Defl:#", "Def64#", "ImplDCL", "Unk:###"}; + + + +/*--------------------------------------------------------------------------- + Unlike extract_or_test_files(), this routine confines itself to the cen- + tral directory. Thus its structure is somewhat simpler, since we can do + just a single loop through the entire directory, listing files as we go. + + So to start off, print the heading line and then begin main loop through + the central directory. The results will look vaguely like the following: + + Length Method Size Ratio Date Time CRC-32 Name ("^" ==> case +-------- ------ ------- ----- ---- ---- ------ ---- conversion) + 44004 Implode 13041 71% 11-02-89 19:34 8b4207f7 Makefile.UNIX + 3438 Shrunk 2209 36% 09-15-90 14:07 a2394fd8 ^dos-file.ext + 16717 Defl:X 5252 69% 11-03-97 06:40 1ce0f189 WHERE +-------- ------- --- ------- + 64159 20502 68% 3 files + ---------------------------------------------------------------------------*/ + + G.pInfo = &info; + date_format = DATE_FORMAT; + +#ifndef WINDLL + if (uO.qflag < 2) { + if (uO.L_flag) + Info(slide, 0, ((char *)slide, LoadFarString(CaseConversion), + LoadFarStringSmall(Headers[longhdr][0]), + LoadFarStringSmall2(Headers[longhdr][1]))); + else + Info(slide, 0, ((char *)slide, "%s\n%s\n", + LoadFarString(Headers[longhdr][0]), + LoadFarStringSmall(Headers[longhdr][1]))); + } +#endif /* !WINDLL */ + + for (j = 1L;;j++) { + + if (readbuf(__G__ G.sig, 4) == 0) + return PK_EOF; + if (strncmp(G.sig, central_hdr_sig, 4)) { /* is it a CentDir entry? */ + if (((unsigned)(j - 1) & (unsigned)0xFFFF) == + (unsigned)G.ecrec.total_entries_central_dir) { + /* "j modulus 64k" matches the reported 16-bit-unsigned + * number of directory entries -> probably, the regular + * end of the central directory has been reached + */ + break; + } else { + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, + ((char *)slide, LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } + /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag, ...: */ + if ((error = process_cdir_file_hdr(__G)) != PK_COOL) + return error; /* only PK_EOF defined */ + + /* + * We could DISPLAY the filename instead of storing (and possibly trun- + * cating, in the case of a very long name) and printing it, but that + * has the disadvantage of not allowing case conversion--and it's nice + * to be able to see in the listing precisely how you have to type each + * filename in order for unzip to consider it a match. Speaking of + * which, if member names were specified on the command line, check in + * with match() to see if the current file is one of them, and make a + * note of it if it is. + */ + + if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != + PK_COOL) /* ^--(uses pInfo->lcflag) */ + { + error_in_archive = error; + if (error > PK_WARN) /* fatal: can't continue */ + return error; + } + if (G.extra_field != (uch *)NULL) { + free(G.extra_field); + G.extra_field = (uch *)NULL; + } + if ((error = do_string(__G__ G.crec.extra_field_length, EXTRA_FIELD)) + != 0) + { + error_in_archive = error; + if (error > PK_WARN) /* fatal */ + return error; + } + if (!G.process_all_files) { /* check if specified on command line */ + unsigned i; + + do_this_file = FALSE; + for (i = 0; i < G.filespecs; i++) + if (match(G.filename, G.pfnames[i], uO.C_flag)) { + do_this_file = TRUE; + break; /* found match, so stop looping */ + } + if (do_this_file) { /* check if this is an excluded file */ + for (i = 0; i < G.xfilespecs; i++) + if (match(G.filename, G.pxnames[i], uO.C_flag)) { + do_this_file = FALSE; /* ^-- ignore case in match */ + break; + } + } + } + /* + * If current file was specified on command line, or if no names were + * specified, do the listing for this file. Otherwise, get rid of the + * file comment and go back for the next file. + */ + + if (G.process_all_files || do_this_file) { + +#ifdef OS2DLL + /* this is used by UzpFileTree() to allow easy processing of lists + * of zip directory contents */ + if (G.processExternally) { + if ((G.processExternally)(G.filename, &G.crec)) + break; + ++members; + } else { +#endif +#ifdef OS2_EAS + { + uch *ef_ptr = G.extra_field; + int ef_size, ef_len = G.crec.extra_field_length; + ea_size = acl_size = 0; + + while (ef_len >= EB_HEADSIZE) { + ef_size = makeword(&ef_ptr[EB_LEN]); + switch (makeword(&ef_ptr[EB_ID])) { + case EF_OS2: + ea_size = makelong(&ef_ptr[EB_HEADSIZE]); + break; + case EF_ACL: + acl_size = makelong(&ef_ptr[EB_HEADSIZE]); + break; + } + ef_ptr += (ef_size + EB_HEADSIZE); + ef_len -= (ef_size + EB_HEADSIZE); + } + } +#endif +#ifdef USE_EF_UT_TIME + if (G.extra_field && +#ifdef IZ_CHECK_TZ + G.tz_is_valid && +#endif + (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, + G.crec.last_mod_dos_datetime, &z_utime, NULL) + & EB_UT_FL_MTIME)) + { + TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0, Mac */ + t = localtime(&(z_utime.mtime)); + } else + t = (struct tm *)NULL; + if (t != (struct tm *)NULL) { + mo = (unsigned)(t->tm_mon + 1); + dy = (unsigned)(t->tm_mday); + yr = (unsigned)(t->tm_year % 100); + hh = (unsigned)(t->tm_hour); + mm = (unsigned)(t->tm_min); + } else +#endif /* USE_EF_UT_TIME */ + { + yr = ((((unsigned)(G.crec.last_mod_dos_datetime >> 25) & 0x7f) + + 80) % (unsigned)100); + mo = ((unsigned)(G.crec.last_mod_dos_datetime >> 21) & 0x0f); + dy = ((unsigned)(G.crec.last_mod_dos_datetime >> 16) & 0x1f); + hh = (((unsigned)G.crec.last_mod_dos_datetime >> 11) & 0x1f); + mm = (((unsigned)G.crec.last_mod_dos_datetime >> 5) & 0x3f); + } + /* permute date so it displays according to nat'l convention + * ('methnum' is not yet set, it is used as temporary buffer) */ + switch (date_format) { + case DF_YMD: + methnum = mo; + mo = yr; yr = dy; dy = methnum; + break; + case DF_DMY: + methnum = mo; + mo = dy; dy = methnum; + } + + csiz = G.crec.csize; + if (G.crec.general_purpose_bit_flag & 1) + csiz -= 12; /* if encrypted, don't count encryption header */ + if ((cfactor = ratio(G.crec.ucsize, csiz)) < 0) { +#ifndef WINDLL + sgn = '-'; +#endif + cfactor = (-cfactor + 5) / 10; + } else { +#ifndef WINDLL + sgn = ' '; +#endif + cfactor = (cfactor + 5) / 10; + } + + methnum = MIN(G.crec.compression_method, NUM_METHODS); + zfstrcpy(methbuf, method[methnum]); + if (methnum == DEFLATED || methnum == ENHDEFLATED) { + methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3]; + } else if (methnum >= NUM_METHODS) { + sprintf(&methbuf[4], "%03u", G.crec.compression_method); + } + +#if 0 /* GRR/Euro: add this? */ +#if defined(DOS_FLX_NLM_OS2_W32) || defined(THEOS) || defined(UNIX) + for (p = G.filename; *p; ++p) + if (!isprint(*p)) + *p = '?'; /* change non-printable chars to '?' */ +#endif /* DOS_FLX_NLM_OS2_W32 || THEOS || UNIX */ +#endif /* 0 */ + +#ifdef WINDLL + /* send data to application for formatting and printing */ + (*G.lpUserFunctions->SendApplicationMessage)(G.crec.ucsize, csiz, + (unsigned)cfactor, mo, dy, yr, hh, mm, + (char)(G.pInfo->lcflag ? '^' : ' '), + (LPSTR)fnfilter(G.filename, slide), (LPSTR)methbuf, G.crec.crc32, + (char)((G.crec.general_purpose_bit_flag & 1) ? 'E' : ' ')); +#else /* !WINDLL */ + if (cfactor == 100) + sprintf(cfactorstr, LoadFarString(CompFactor100)); + else + sprintf(cfactorstr, LoadFarString(CompFactorStr), sgn, cfactor); + if (longhdr) + Info(slide, 0, ((char *)slide, LoadFarString(LongHdrStats), + G.crec.ucsize, methbuf, csiz, cfactorstr, mo, dy, + yr, hh, mm, G.crec.crc32, (G.pInfo->lcflag? '^':' '))); + else +#ifdef OS2_EAS + Info(slide, 0, ((char *)slide, LoadFarString(ShortHdrStats), + G.crec.ucsize, ea_size, acl_size, + mo, dy, yr, hh, mm, (G.pInfo->lcflag? '^':' '))); +#else + Info(slide, 0, ((char *)slide, LoadFarString(ShortHdrStats), + G.crec.ucsize, + mo, dy, yr, hh, mm, (G.pInfo->lcflag? '^':' '))); +#endif + fnprint(__G); +#endif /* ?WINDLL */ + + if ((error = do_string(__G__ G.crec.file_comment_length, + QCOND? DISPL_8 : SKIP)) != 0) + { + error_in_archive = error; /* might be just warning */ + if (error > PK_WARN) /* fatal */ + return error; + } + tot_ucsize += G.crec.ucsize; + tot_csize += csiz; + ++members; +#ifdef OS2_EAS + if (ea_size) { + tot_easize += ea_size; + ++tot_eafiles; + } + if (acl_size) { + tot_aclsize += acl_size; + ++tot_aclfiles; + } +#endif +#ifdef OS2DLL + } /* end of "if (G.processExternally) {...} else {..." */ +#endif + } else { /* not listing this file */ + SKIP_(G.crec.file_comment_length) + } + } /* end for-loop (j: files in central directory) */ + +/*--------------------------------------------------------------------------- + Print footer line and totals (compressed size, uncompressed size, number + of members in zipfile). + ---------------------------------------------------------------------------*/ + + if (uO.qflag < 2 +#ifdef OS2DLL + && !G.processExternally +#endif + ) { + if ((cfactor = ratio(tot_ucsize, tot_csize)) < 0) { +#ifndef WINDLL + sgn = '-'; +#endif + cfactor = (-cfactor + 5) / 10; + } else { +#ifndef WINDLL + sgn = ' '; +#endif + cfactor = (cfactor + 5) / 10; + } +#ifdef WINDLL + /* pass the totals back to the calling application */ + G.lpUserFunctions->TotalSizeComp = tot_csize; + G.lpUserFunctions->TotalSize = tot_ucsize; + G.lpUserFunctions->CompFactor = (ulg)cfactor; + G.lpUserFunctions->NumMembers = members; + +#else /* !WINDLL */ + if (cfactor == 100) + sprintf(cfactorstr, LoadFarString(CompFactor100)); + else + sprintf(cfactorstr, LoadFarString(CompFactorStr), sgn, cfactor); + if (longhdr) { + Info(slide, 0, ((char *)slide, LoadFarString(LongFileTrailer), + tot_ucsize, tot_csize, cfactorstr, members, members==1? "":"s")); +#ifdef OS2_EAS + if (tot_easize || tot_aclsize) + Info(slide, 0, ((char *)slide, "\n")); + if (tot_eafiles && tot_easize) + Info(slide, 0, ((char *)slide, LoadFarString(OS2ExtAttrTrailer), + tot_eafiles, tot_eafiles == 1? " has" : "s have a total of", + tot_easize)); + if (tot_aclfiles && tot_aclsize) + Info(slide, 0, ((char *)slide, LoadFarString(OS2ACLTrailer), + tot_aclfiles, tot_aclfiles == 1? " has" : "s have a total of", + tot_aclsize)); +#endif /* OS2_EAS */ + } else +#ifdef OS2_EAS + Info(slide, 0, ((char *)slide, LoadFarString(ShortFileTrailer), + tot_ucsize, tot_easize, tot_aclsize, members, members == 1? + "" : "s")); +#else + Info(slide, 0, ((char *)slide, LoadFarString(ShortFileTrailer), + tot_ucsize, members, members == 1? "" : "s")); +#endif /* OS2_EAS */ +#endif /* ?WINDLL */ + } + +/*--------------------------------------------------------------------------- + Double check that we're back at the end-of-central-directory record. + ---------------------------------------------------------------------------*/ + + if (strncmp(G.sig, end_central_sig, 4)) { /* just to make sure again */ + Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; /* didn't find sig */ + } + if (members == 0L && error_in_archive <= PK_WARN) + error_in_archive = PK_FIND; + + return error_in_archive; + +} /* end function list_files() */ + + + + + +#ifdef TIMESTAMP + +/************************/ +/* Function fn_is_dir() */ +/************************/ + +static int fn_is_dir(__G) /* returns TRUE if G.filename is directory */ + __GDEF +{ + extent fn_len = strlen(G.filename); + register char endc; + + return fn_len > 0 && + ((endc = lastchar(G.filename, fn_len)) == '/' || + (G.pInfo->hostnum == FS_FAT_ && !MBSCHR(G.filename, '/') && + endc == '\\')); +} + + + + + +/*****************************/ +/* Function get_time_stamp() */ +/*****************************/ + +int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */ + __GDEF + time_t *last_modtime; + ulg *nmember; +{ + int do_this_file=FALSE, error, error_in_archive=PK_COOL; + ulg j; +#ifdef USE_EF_UT_TIME + iztimes z_utime; +#endif + min_info info; + + +/*--------------------------------------------------------------------------- + Unlike extract_or_test_files() but like list_files(), this function works + on information in the central directory alone. Thus we have a single, + large loop through the entire directory, searching for the latest time + stamp. + ---------------------------------------------------------------------------*/ + + *last_modtime = 0L; /* assuming no zipfile data older than 1970 */ + *nmember = 0L; + G.pInfo = &info; + + for (j = 1L;; j++) { + + if (readbuf(__G__ G.sig, 4) == 0) + return PK_EOF; + if (strncmp(G.sig, central_hdr_sig, 4)) { /* is it a CentDir entry? */ + if (((unsigned)(j - 1) & (unsigned)0xFFFF) == + (unsigned)G.ecrec.total_entries_central_dir) { + /* "j modulus 64k" matches the reported 16-bit-unsigned + * number of directory entries -> probably, the regular + * end of the central directory has been reached + */ + break; + } else { + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, + ((char *)slide, LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } + /* process_cdir_file_hdr() sets pInfo->lcflag: */ + if ((error = process_cdir_file_hdr(__G)) != PK_COOL) + return error; /* only PK_EOF defined */ + if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != PK_OK) + { /* ^-- (uses pInfo->lcflag) */ + error_in_archive = error; + if (error > PK_WARN) /* fatal: can't continue */ + return error; + } + if (G.extra_field != (uch *)NULL) { + free(G.extra_field); + G.extra_field = (uch *)NULL; + } + if ((error = do_string(__G__ G.crec.extra_field_length, EXTRA_FIELD)) + != 0) + { + error_in_archive = error; + if (error > PK_WARN) /* fatal */ + return error; + } + if (!G.process_all_files) { /* check if specified on command line */ + unsigned i; + + do_this_file = FALSE; + for (i = 0; i < G.filespecs; i++) + if (match(G.filename, G.pfnames[i], uO.C_flag)) { + do_this_file = TRUE; + break; /* found match, so stop looping */ + } + if (do_this_file) { /* check if this is an excluded file */ + for (i = 0; i < G.xfilespecs; i++) + if (match(G.filename, G.pxnames[i], uO.C_flag)) { + do_this_file = FALSE; /* ^-- ignore case in match */ + break; + } + } + } + + /* If current file was specified on command line, or if no names were + * specified, check the time for this file. Either way, get rid of the + * file comment and go back for the next file. + * Directory entries are always ignored, to stay compatible with both + * Zip and PKZIP. + */ + if ((G.process_all_files || do_this_file) && !fn_is_dir(__G)) { +#ifdef USE_EF_UT_TIME + if (G.extra_field && +#ifdef IZ_CHECK_TZ + G.tz_is_valid && +#endif + (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, + G.crec.last_mod_dos_datetime, &z_utime, NULL) + & EB_UT_FL_MTIME)) + { + if (*last_modtime < z_utime.mtime) + *last_modtime = z_utime.mtime; + } else +#endif /* USE_EF_UT_TIME */ + { + time_t modtime = dos_to_unix_time(G.crec.last_mod_dos_datetime); + + if (*last_modtime < modtime) + *last_modtime = modtime; + } + ++*nmember; + } + SKIP_(G.crec.file_comment_length) + + } /* end for-loop (j: files in central directory) */ + +/*--------------------------------------------------------------------------- + Double check that we're back at the end-of-central-directory record. + ---------------------------------------------------------------------------*/ + + if (strncmp(G.sig, end_central_sig, 4)) { /* just to make sure again */ + Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; + } + if (*nmember == 0L && error_in_archive <= PK_WARN) + error_in_archive = PK_FIND; + + return error_in_archive; + +} /* end function get_time_stamp() */ + +#endif /* TIMESTAMP */ + + + + + +/********************/ +/* Function ratio() */ /* also used by ZipInfo routines */ +/********************/ + +int ratio(uc, c) + ulg uc, c; +{ + ulg denom; + + if (uc == 0) + return 0; + if (uc > 2000000L) { /* risk signed overflow if multiply numerator */ + denom = uc / 1000L; + return ((uc >= c) ? + (int) ((uc-c + (denom>>1)) / denom) : + -((int) ((c-uc + (denom>>1)) / denom))); + } else { /* ^^^^^^^^ rounding */ + denom = uc; + return ((uc >= c) ? + (int) ((1000L*(uc-c) + (denom>>1)) / denom) : + -((int) ((1000L*(c-uc) + (denom>>1)) / denom))); + } /* ^^^^^^^^ rounding */ +} + + + + + +/************************/ +/* Function fnprint() */ /* also used by ZipInfo routines */ +/************************/ + +void fnprint(__G) /* print filename (after filtering) and newline */ + __GDEF +{ + char *name = fnfilter(G.filename, slide); + + (*G.message)((zvoid *)&G, (uch *)name, (ulg)strlen(name), 0); + (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); + +} /* end function fnprint() */ + +const char *BOINC_RCSID_670c4eb825 = "$Id: list.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/Contents boinc-7.0.14+dfsg/zip/unzip/macos/Contents --- boinc-7.0.7+dfsg/zip/unzip/macos/Contents 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/Contents 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,62 @@ +Contents of the "macos" sub-archive for UnZip 5.42 and later: + + Contents this file + README.TXT Dirk Haase's infos on updated Macintosh ports of Zip/UnZip + HISTORY.TXT Dirk Haase's MacOS specific ChangeLog + + UnZp.h config header used to build standalone app with GUI + UnZpLib.h config header used to build a static library + UnZpSFX.h config header used to build the SFX stub + UnZpSx.h config header for building a standalone app. with MW Sioux + UnZpPrj.xml Metrowerks CodeWarrior pro5 project file (xml export file) + + source/ subdirectory containing all sources: + a) UnZip specific code + macbin3.c macbinary III code, used for extraction of ZipIt archives + macbin3.h macbinary III header, macbinary docu + public prototyping + macos.c Mac-specific filesystem code + maccfg.h Mac-specific configuration and global declarations + macdir.c Macintosh Posix-style directory emulation ("dirent") + macdir.h header file for directory emulation + macscreen.c screen functions to be used in standalone UnZip application + macstat.c Macintosh stat() emulation + macstat.h header file for stat() emulation + macunzip.c Macintosh standalone version main function + sxunzip.c main function for use with static library (SIOUX) + unzip_rc.hqx UnZip resource file for standalone application (BinHex) + + b) general utilities shared between Zip and UnZip + charmap.h character mapping tables ISO 8859-1 <--> MacRoman + getenv.c simulation of unix compatible getenv() on MacOS + helpers.c some helper functions + helpers.h + macstuff.h wrapper to pull in some "MoreFiles" filemanager stuff + mactime.c replacement for broken Metrowerks RTL time functions + mactime.h + pathname.c functions for handling MacOS HFS path- /filenames + pathname.h + +The new UnZpPrj.hqx project file should be "un-BinHex'ed" into UnZpPrj, +which builds the following targets: + Unzip (68k) -> standalone unzip for 68k + Unzip (PPC) -> standalone unzip for PPC + Unzip Lib (68k) -> static library 68k + Unzip Lib (PPC) -> static library PPC + Unzip Sioux (68k) -> MW Sioux standoalone App, good for debugging + Unzip Sioux (PPC) -> MW Sioux standoalone App, good for debugging + + +Before you start a build on your Macintosh: + +Extract "*.hqx" and "source:*.hqx" first! +And PLEASE, read the MacOS specific documentation in README.TXT! + + +The resource files and the compiler project files are in BinHex form because +they contain Macintosh resource forks. The resource info cannot be +maintained when handling (e.g. repacking) the master source collection on +non-Macintosh systems. The BinHex form is the traditional way for +transferring such files via non-Macintosh systems. +It's also the safest since it uses only printable characters. The ".hqx" +files must be converted with StuffitExpander or BinHex 4.0 (or equivalent) +on a Macintosh system before using them. diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/HISTORY.TXT boinc-7.0.14+dfsg/zip/unzip/macos/HISTORY.TXT --- boinc-7.0.7+dfsg/zip/unzip/macos/HISTORY.TXT 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/HISTORY.TXT 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,600 @@ +A free Macintosh Port of Info-ZIP's +Zip and UnZip +By Dirk Haase, d_haase@sitec.net +Home page: www.sitec.net/maczip +Mirror page: +www.haase-online.de/dirk/maczip +================================ + + + + + +Release MacZip ver1.07 beta 1 +22. Februray 2001 +----------------- + +1) CHG: {unzip} switch to latest final release + unzip 5.42 + +2) CHG: {zip} switch to latest beta release + zip 2.40a + + + + + +Release MacZip ver1.06 final +22. Februray 2001 +----------------- + +1) CHG: {unzip} switch to latest final release + unzip 5.42 + +2) CHG: switch to latest release of Apples + Universal Interfaces 3.3.2 + +3) CHG: switch to latest release of + Morefiles 1.5 + + + + +Release MacZip ver1.06 beta 2 +02. August 2000 +--------------- + +1) CHG: {unzip} switch to latest beta release + unzip 5.42d + + + + + +Release MacZip ver1.06 beta 1 +27. July 2000 +------------- + +1) CHG: {zip} switch to latest beta release + unzip 2.30 + +2) CHG: {unzip} switch to latest beta release + unzip 5.42c + + + + + +Release MacZip ver1.05 final +27. July 2000 +------------- + +1) CHG: {unzip} switch to latest final release + unzip 5.41 + +2) FIX: {unzip} Fixed "unique unzip folder" foldername handling + +3) FIX: {unzip} added prototype crc32() in macbin3.c + +4) CHG: {unzip/zip} added exported Codewarrior project-file in xml-format + +5) ADD: {unzip} added extra-field recognition for Mac SmartZip in + zipinfo.c and unzpriv.h. + + + + + +Release MacZip ver1.04 final +25. January 2000 +---------------- + + +Final release of MacZip. All parts now +in final release state !! + +1) Switch to MW Codewarrior pro 5.3 + +2) CHG: {zip} switch (back) to latest final release + unzip 2.30 + +3) CHG: {unzip} switch (back) to latest final release + unzip 5.40 + + + + +Release MacZip ver1.04 beta 3 +05. October 1999 +---------------- + +1) CHG: {zip} switch to latest source level + unzip 2.30o beta release + +2) CHG: {unzip} switch to latest source level + unzip 5.41c beta release + +3) ADD: {console} added menu to print the license + + + + +Release MacZip ver1.04 beta 2 +02. June 1999 +-------------- + +1) FIX: {unzip} added one more criteria to make the recognition + of macbinary more save. + +2) FIX: {unzip} sometimes, archive entries without any extra field + caused problems; the default setting of the extra field + was not set back to 'unknown' properly. + +3) FIX: {zip} Archive filename with invalid characters like '/' gets + renamed. However, I do not check the complete path - needs + some more work here. + +4) FIX: {zip} Filename match was case sensitive. + +6) CHG: {zip} switch to latest source level + unzip 2.30m beta release + +7) CHG: {unzip} switch to latest source level + unzip 5.41b beta release + +8) FIX: {zip/unzip 68k only) I have found a wrong compiler setting + for the 68k version. Because of this wrong setting the 68k + version crashed. + + + + +Release MacZip ver1.04 beta 1 +30. March 1999 +-------------- + +1) CHG: {unzip) switch to latest source level + unzip 5.41a beta release + +2) ADD: {all} Added message logging support for Syslogd + by Brian Bergstrand. Syslogd can be found at + http://www.classicalguitar.net/brian/apps/syslogd/ + This feature is 'under construction'. + +3) FIX: {all} many small fixes and code cleanups + + + + +Release MacZip ver1.03 +27. March 1999 +-------------- + +1) CHG: {console} Like Stuffit Expander MacZip quits automatically when + used with drag'n drop or as Helper App (Web-Browser). + +2) CHG: {console} Since Macintosh users are used to be guided by their + software in order not to do something stupid, I added a check + to post an extra warning if the options -m and data fork only + are both checked. + This behavior can be disabled: See Applescript example and + "maczip.env". + +3) CHG: {zip} switch from immediate deletion to moving to the + trash. Immediate deletion is now an option in "maczip.env". + +4) CHG: {zip} enhanced progress display. + +5) CHG: {zip) switch to latest source level + zip 2.3l beta release + +6) CHG: {unzip} The zip archive contains file names greater than + 31 characters. When MacZip tries to unzip the file, the + FSpCreate command fails because the filename length is to + long. MacZip correct this problem by trying to truncate + the file names to the 31 character limit. + +7) FIX: {zip/console} A couple of minor fixes + +8) CHG: {zip} Switched file-globbing to the Info-ZIP version. + + + + +Release MacZip ver1.02 +14. February 1999 +----------------- + +1) CHG: {zip} Changed the rule of file inclusion if switch '-X' + is set. Following conditions are checked: + a) if length of resource-fork is equal zero *and* the + length of data-fork is equal zero include the file. + b) if length of resource-fork greater zero *and* the + length of data-fork is equal zero don't include the file. + c) if length of data-fork greater zero include the file. + +2) CHG: {Console} Some users are very confused by the buttons "START PATH" + and "ZIP ARCHIVE". Somehow, it wasn't clear what the intended + meaning was. I changed the buttons to more clear labels on + them like: "file or folder to compress" and "location of + compressed file" + +3) CHG: {Console} I changed the menu structure to be more intuitive. + +4) FIX: {Console} Found a nasty bug which sometimes caused crashes + when the Zip / Unzip Dialogbox was used. + +5) CHG: {Console} Handling of file dialog is now a bit more restricted: + e.g: it's not possible to select a file if you have to select + a folder. + + + + +Release MacZip ver1.01 +30. January 1999 +---------------------- + +1) CHG: {console} The use of the "Current App" mechanism was clumsy + and forces the user into the Zip or Unzip modes. This kind + of modality is not so good for the command line. It's now + neccessary to enter zip or unzip to choose the action. + +2) FIX: {console} When Applescript sends quit to MacZip the script + that is running shows a spinning cursor and MacZip + does not quit. + +3) FIX: {console} MacZip gots accidentally the wrong creator code + (from BBedit) + + + + +Final Release MacZip ver1.0 +--------------------------- + +Released 21. January 1999 + + + + +9. Beta release 06.December.1998 +--------------------------------- + +1) CHG: {console} The checkbox of Filedialog (for extract path and file path) + "Show all files" is now selected by default. + +2) CHG: {unzip/standalone} changed prototypes of mac[f]printf() to return + an int number (better ANSI conformance); + +3) FIX: {unzip} repaired "stdout/stderr" mode of macwrite(). So func + MacMessagePrnt() is now obsolete and removed. + +4) ADD: {zip/unzip} Compressed Mac3 extra-fields are now supported + (Thanks to Christian Spieler) + +5) ADD: {unzip} Extraction of ZipIt archive are now supported. This support + is not complete: Filenames are correct but folder names are only + restored with the public directory names. + +6) ADD: {zip/unzip} Improved documentation. + +7) FIX: {unzip} Function isZipfile() is completely rewritten. + +8) CHG: {zip/unzip) switch to latest source level + zip 2.3i beta and unzip 5.4 final release + +9) ADD: Applescript event "do_cmd". + +Unless there are big bugs found, this release will be the last +beta release. The final release will come out in January 1999. + + + + +8. Beta release 20.November.1998 +--------------------------------- + +1) CHG: {zip/unzip) switch to latest source level + zip 2.3h beta and unzip 5.4 final release + +2) ADD: {zip} Zip finds "namelocked" files also, if switch "-S" + is set. + +3) FIX: {unzip} Function isZipfile() fails if the zip archive + has a comment. + +4) CHG: {zip} added some small speed improvements to pattern matching and + isZipFile() function. + +5) FIX: {unzip} Display of comments is fixed. + UzpMessagePrnt() is replaced by MacMessagePrnt(). I do not care + about ansi-bombs. I'm not sure, so this fix may be changed later. + +6) RMV: {unzip} Buildin More capability is removed since it's already built + into the GUI-App. + + + +7. Beta release 09.November.1998 +--------------------------------- + +1) CHG: {all} switched to Metrowerks Codewarrior Pro 4 + +2) FIX: {unzip} Display of comments stored in the zip-file is + now fixed + +3) FIX: {zip} Fixed display of the zip help-screen. + +4) CHG: {zip/unzip} Changed special dir 'Re$0urce.Fk' to 'XtraStuf.mac' + (see entry at 13.June.1998 item 3). I found it more descriptive for + users outside the mac-community. + +5) CHG: {all} switched to MoreFiles 1.4.9. + +6) CHG: {console} changed behaivor of the file open dialog: The select + button is now always enabled. + +7) ADD: {all} Environment variables are now supported. + Basically, it is possible to add timezone (= TZ environment variable) + support here, but it's not yet implemented. + See "MacZip.Env" for further info. + +8) RMV: {console} Targets "zip only" and "unzip only" are removed. + + + +6. Beta release 09.September.1998 +--------------------------------- + + +1) CHG: {Zip/Unzip} Metrowerks Standardlibrary time funktions are + rather broken and incomplete so I was forced to rewrite the + funktions: mktime(), localtime(), gmtime() and time(). + +2) ADD: {Console} Added Pause Funktion for screen output. + The Pause-Function is selfadjusting: Count of lines is depending + on the window size. + +3) CHG: Extra-Field layout is changed: All datas are now in little-endian + format (see appnote) + +4) ADD: {Console} Added an option to test the archive automatically + after zipping. This option is only via Zip-Dialogbox available + because it needs the unzip-module also. + +5) CHG: {Zip} code is now up to date with the latest beta 2.3f. + +6) ADD: {Console} Added (drag'n) drop support. Drop on the MacZip icon. + The following situations are supported: + 1. drop of one or more zipfiles (action = unzip) + each archive will be extracted in a separate folder + 2. drop of a folder (action = zip -r ) + The complete folder (inclusive sub-folders) + will be zipped + Not (yet) supported is currently: dropping more than one file + to compress. Workaround: Put all your files in one folder and + drop that folder on MacZip. + MacZip recognize zip-archives automatically. + + +5. Beta release 21.Aug.1998 +---------------------------- + + +1) ADD: {Console} Userinterface has now a Statusbar to show the + Progress. + +2) ADD: {Console} It's now possible to stop the run of Zip/Unzip + with the well known shortcut [Command] + [.] + +3) CHG: {Console} Improved user-entry routine. + +4) ADD: {Zip/Unzip} Crypt-code added. It's now possible to + encrypt/decrypt archives. + +5) RMV: {Unzip} Removed the warning of PKZip/Mac archive. + Unzip gets confused with the extra field of PKZip/Mac. So I assume + the extra field isn't compatible with Info-ZIP's definition. + +6) CHG: switched to Metrowerks Codewarrior Pro 3 + this includes: + - new Universal Interfaces 3.1 Headers + - improved codegeneration + +7) CHG: {Zip} code is now up to date with the latest beta 2.3e. + +8) CHG: {Unzip} changed function names wprintf, wgets .. to macprintf, macgets .. + to avoid naming conflict standart library. + +9) ADD: {Zip/Unzip} FXinfo, Mac-Pathname, file-dates and Finder-Comments + are now stored in the extra-field. Extra-field layout is + changed accordingly. Unzip uses now the filename stored in the + extra-field when unzipping. + +10) CHG: {Unzip} code is now up to date with the latest beta 5.33g. + +11) CHG: {Unzip} code is (again) up to date with the latest beta 5.33h. + +12) ADD: {Unzip} following switches were added: + -J [MacOS only] ignore mac extra info. All macintosh + info are not restored. Datafork and resource-fork + are restored separatly. + + -i [MacOS only] ignore filenames stored in mac extra + field. Use the most compatible filename stored in + the public field. + + -E [MacOS only] show mac extra field during restoring + +13) ADD: {Zip/Unzip} Charset MacRoman to ISO8859 Latin and vice versa + +14) RMV: {Zip} -N option removed. This MacZip crashes using this option. + I will fix it later. + + +I think I'm very close for a final release of "MacZip 1.0" :-) + + + +4. Beta release 27.June.1998 +---------------------------- + +26.June.1998 +------------ + +1) FIX: {Zip} extra field size value was wrong. + + + +25.June.1998 +------------ + +1) CHG: {Zip} code is now up to date with the latest beta 2.3d. + So both modules, zip & unzip, uses now latest beta. + +2) ADD: {Zip} added a UT extra-field for better compatibility. + +3) CHG: {Unzip} changed the code to find the mac extra-field. + Unzip has to look for a mac extra-field because + mac-archives has now two extra-fields (UT + M3). + +4) CHG: {Unzip} changed the method to move extra-field data to + the internal extra-structure. + Old method was just BlockMove of the ef_structptr to ef_memptr. + This method was dangerous because not all members of the + structure seamless aligned. There are may be some fill + bytes in the structure depending on the compiler setting. + +5) ADD: {Unzip} added a warning if unzipping a ZipIt/PKZip archive. + ZipIt/PKZip archives are usually additionally coded somehow. + InfoZip's Unzip will *not* decode the files. So extracted + files are may be not decoded. (see also 6. and 7.) + +6) ADD: ZipIt (the Shareware Tool) has now a new extra-field signature: + 0x2705. Found in "ZipIt 1.3.8". I added a new macro: EF_ZIPIT2 + +7) ADD: Added PKWare's extra-field signature: 0xCF77. + Found in "PKZIP v2.03". I added a new macro: EF_PKMAC + +8) ADD: {console} It's now possible to save all screen outputs + to the disk. + +9) RMV: {console} this is the first beta without expire-date. + + +16.June.1998 +------------ + +1) FIX: {Unzip/console} Extract path now defaults to current-dir if + no path is given. + +2> CHG: {Unzip} creates now a extract-folder by default. This behavior + differs to the commandline tool of Unzip on other platforms. + However, for a mac-user is this behavior more convenient. + + +3. Beta release 15.June.1998 +---------------------------- + +15.June.1998 +------------ + +1) CHG: {unzip/zip} I changed the layout of the extra field + to support more data. + + +14.June.1998 +------------ + +1) FIX: {Unzip} adjusted time_t value with an correct offset value. + +2) FIX: {Unzip} removed all unused code based on unfinished ideas by + former porter(s). + +3) CHG: use of shared code izshr 032. + +13.June.1998 +------------ + +1) FIX: {Unzip} Filenames are only converted when needed. When zipping + with the switch 'datafork only' the filenames are shorted which + was wrong. + +2) CHG: {Unzip} code is now up to date with the latest beta 5.33f. + +3) CHG: {Zip} Changed the naming rule of filenames from old Johnny Lee's + to my implementation. Johnny Lee's idea is based on change of the + filenames which cases several problems when unziping on a non mac + plattform. My idea is to add a special directory: 'Re$0urce.Fk'. + For the future: Zip will create archives according the new nameing + rule. However unzip will be compatible with old nameing rule. + See also 4. + +4} ADD: {Unzip} Added a new nameing rule for resource forks filename. + Resource forks are now stored in a special directory: 'Re$0urce.Fk'. + This naming rule make it easier to for other platforms to use + mac zip-files. + + + +11.June.1998 +------------ +1) FIX: {Zip} Internal file attribute is set to BINARY by default + when zipping resource forks otherwise Unzip will create + sometimes wrong resource-forks. + +2) CHG: {Unzip} code is now up to date with the latest beta 5.33e. + + + + +2. Beta release 10.June.1998 +-------------------------- + +1) FIX: {Unzip} Long pathname fix solved. Unzip is now able to extract + archives with path longer than 256 chars. + +2) CHG: {Unzip} removed all conversion from c-style string to + pascal-string (see fix 1) + +3) ADD: {Unzip} Finderinfo of folders are also restored. + +4) ADD: {Console} Added info about current path in the command-line box. + +5) FIX: {Console} Construction of the command-line of the unzip-dialog + box fixed. + + + +First beta release 06.June.1998 +----------------------------- + +no history. +Just to many code was neccessary to build the first mac-port. + + +Start of the port MacZip +February 1998 + + +-------------------------------------------------------------------------------- +Legende: + +FIX: fixes a bug +CHG: inform about changed items. +ADD: added feature +RMV: removed Item + +{Unzip} -> only related to the Unzip-module +{Zip} -> only related to the Zip-module + These are just libraries and are linked into the console-app. + +{Console} -> only related to the Userinterface (not SIOUX) + MacOS has no tool like a command-line. So it's neccessary + to write wrapper around the command-line tools. + + + + +Dirk Haase diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/README.TXT boinc-7.0.14+dfsg/zip/unzip/macos/README.TXT --- boinc-7.0.7+dfsg/zip/unzip/macos/README.TXT 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/README.TXT 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,569 @@ +A free Macintosh Port of Info-ZIP's +Zip and UnZip +By Dirk Haase, d_haase@sitec.net +Home page: www.sitec.net/maczip +Mirror page: +www.haase-online.de/dirk/maczip +================================ + + + +Abstract: +--------- +MacZip is a cross-platform compatible tool that includes +both Zip (for compression) and UnZip (for extraction). + +Zip is a compression and file packaging utility for Unix, +VMS, MSDOS, OS/2, Windows 9x, Windows NT, Atari, Macintosh, +Amiga, Acorn RISC OS, and other systems. + +UnZip unpacks zip archives. The Zip and UnZip programs can +process archives produced by PKZIP, and PKZIP and PKUNZIP +can work with archives produced by zip. Zip version 2.2 is +compatible with PKZIP 2.04. + +If you are new to MacZip please read first the file +"ReadMe.1st". + + + +License: +-------- + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html + + + +Requirements +------------ +MacZip requires at least System 7 and a Macintosh with a +minimum of a Motorola 68020 or PowerPC 601 processor. Other +configurations may work but it is not tested at all. + +The application is distributed as a fat binary with both +regular 68K and native PowerPC versions included. + + + +Installation +------------ +Move the executable(s) somewhere--for example, drag it (or +them) to your Applications folder. For easy access, make an +alias in the Launcher Control Panel or directly on your +desktop. The GUI is very simple. It was not my intention to +make a full-blown GUI, however I think it is comfortable +enough to use it as regular tool. + +This port supports also Apple-event. So you can install it +in your WWW-Browser as a helper app. + +For more Info about the contents of this package, take a +look into the "macos/Contents" (or :macos:Contents) file. +Some notes on how to rebuild the Macintosh applications can +be found in INSTALL. + + + +Usage: +------ + +Basically there are four ways to start MacZip: + +a) Drag'n Drop +b) using the Dialog box (Menu: File -> Zip/Unzip): + +Please read the file "ReadMe.1st" +for the description of the items a and b. + +c) Using the Command line (Menu: File->Command Line): + The Zip & UnZip tools are command line tools. So the + behavior is exactly the same like the Zip & UnZip tools on + Unix or Windows/DOS. This means, if you want to zip some + files, you have to write a command line like this: "zip + [switches] path_to_zip_archive path_to_files_folders" + + - Go to "File", select "Command Line" and the + "MacZip Entry box" Dialog Box appears. + + An example: + + a: your zip may be created at + Macintosh HD:applications:archive.zip + + b: your files may be found at + Macintosh HD:somewhere:my_folder_to_archive:* + + Note: At the end of the path there must be a filename or + a wild card ! + (see Footnotes: 1 wild card, 2 Mac path names) + + So the command line should look like (one line!): + + zip "Macintosh HD:applications:archive.zip" "Macintosh HD:somewhere:my_folder_to_archive:*" + + - Click on "Enter" to start the task. + + Since you can not set a default folder you have to enter + always a full qualified path names. Full-qualified path + names are path names including the Volume name ! (see + Footnote: 2 Mac path names) + + + +d) Using Applescript: + +There is only one additional event defined: "do_cmd". You +can enter every valid command line. The first word must be +"zip" or "unzip" to select the action (compress or +extraction). + +See sample Applescript: + + tell application "MacZip (PPC)" + activate + with timeout of 90000 seconds + do_cmd "zip -rjjN Volume:archive \"My Volume:*\" " + end timeout + end tell + +This script opens MacZip, brings it to the foreground on the +Mac, starts the zip action with the command line: zip -rjjN +Volume:archive "My Volume:*" . + + +A short introduction is also available online: +http://www.sitec.net/maczip/How-To-Do/ + +It's possible to stop the run of Zip/Unzip with the well +known shortcut [Command] + [.]. + + +--------------------------------------------------------------------------- + +There are some Mac-specific switches available. +Zip Module: + -df [MacOS] Include only data-fork of files zipped into + the archive. Good for exporting files to foreign + operating-systems. Resource-forks will be ignored + at all. + + -jj [MacOS] record Fullpath (+ Volname). The complete + path including volume will be stored. By default + the relative path will be stored. + + -S [MSDOS, OS/2, WIN32 and ATARI] Include system and + hidden files. + [MacOS] Includes finder invisible files, which are + ignored otherwise. + +Unzip Module: + -E [MacOS only] display contents of MacOS extra field + during restore operation. + + -i [MacOS only] ignore filenames stored in MacOS extra + fields. Instead, the most compatible filename + stored in the generic part of the entry's header is + used. + + -J [MacOS only] ignore MacOS extra fields. All Macin- + tosh specific info is skipped. Data-fork and + resource-fork are restored as separate files. + + +Select [File]->[Get Help on Zip/Unzip] for a complete list +of switches. + + + +Limitations / Problems: +----------------------- + + - Aliases are not supported. I tried, but I got broken + aliases. This port will silently ignore all aliases. + It's on my to-do list for future releases. + + - Zip needs much memory to compress many files: You may need + to increase the 'Preferred Size' in 'Get Info'. Values of 12 + Megabytes or more are possible + + - Unzip needs about 500 Kbytes of memory to unzip no matter + how many files were compressed and expanded. + + - and finally one big macintosh-related problem: + This port has one weak point: It's based on path names. + As you may be already know: Path names are not unique on a Mac ! + The main reason is that an attempt to implement support exact + saving of the MacOS specific internal file structures would + require a throughout rewrite of major parts of shared code, + probably sacrifying compatibility with other systems. I have + no solution at the moment. The port will just warn you if you + try zip from / to a volume which has a duplicate name. + MacZip has problems to find the archive or the files. My + (Big) recommendation: Name all your volumes with a unique + name and MacZip will run without any problem. + + +Known Bugs: + + - crypted files in a zip archive are sometimes corrupt: + I get an error message: invalid compressed data to inflate. + Appearance of this error is purely be chance: I did a small + test: Unzipping an archive containing 3589 files 56 files + fails to unzip, so about 1.5%. Root cause is completely + unclear to me :( + +I strongly recommend to test your archive (e.g. unzip -t archive). + + + + + +Zip Programs / Macintosh Extra-Data: +----------------------------------------- +A brief overview: +Currently, as far as I know, there are 6 Zip programs +available for the Macintosh platform. These programs build +(of course) different variants of Zip files: + + - Info-ZIP's first Port of Zip. Ported by Johnny Lee + This port is rather outdated and no longer supported (since 1992). + 68K only. Only minimal Mac-info is stored + (Creator/Type, Finder attributes). Creator/Type: '????' / '????' + Until year 1998, only UnZip 5.32 survived. + + - ZipIt by Tom Brown. This is Shareware and still supported I think. + ZipIt has a nice GUI, but I found it can't handle large Zip files + quite well. ZipIt compresses Macintosh files using the Mac Binary + format. So, transferring files to other platforms is not so easy. + Only minimal Mac-info is stored (Creator/Type, Finder attributes). + Mac filenames are changed to a most compatible filename. + Creator/Type: 'ZIP ' / 'ZIP ' + + - PKZIP/mac v2.03/210d. This is Shareware. + This Zip implementation for the Mac can be found on ASI's web site + (http://www.asizip.com/products/products.htm). The name of this + program is misleading, it is NOT a product from PKWARE. ASI's last + release version is v2.03, and they also offer a newer beta version + PKZIP/mac 210d. But even the Beta version is rather outdated (1995). + Only minimal Mac-info is stored (Creator/Type, Finder attributes). + The Zipfile format looks like incompatible to other platforms. + (More details about the compatibility issue can be found in + proginfo/3rdparty.bug!). Type: 'PKz1' + Mac filenames are restored without any change. + + - Aladdin DropZip 1999, This is Shareware. Aladdin chose + the format of ZipIt. Therefore, it has the some drawbacks + like ZipIt. + Creator/Type: 'SITx' / 'ZIP ' + + - SmartZip 1.0 1999 - by Marco Bambini Vampire Software. + This is Shareware. SmartZip compresses Macintosh files using the + Mac Binary. Therefore, it has the same drawbacks like ZipIt. + Creator/Type: 'dZIP' / 'ZIP ' + +and finally: + - Info-ZIP's latest Port of Zip. MacZip 1.0. Ported by me :-) + It is supported (of course) and up to date. Full set of macintosh + info is stored: Creator/Type, Finder attributes, Finder comments, + MacOS 8.0 Folder settings, Icon/Folder Positions ... + Mac filenames are restored without any change. + Creator/Type: 'IZip' / 'ZIP ' + + +Compatibility of my port; Extraction: + - Archives from Info-ZIP's first port (by Johnny Lee) are + still compatible. + - Extraction of ZipIt archives is supported. This support + is not complete: Filenames are correct but Directory names + are sometimes mangled to a DOS compatible form. Segmented + archives are not supported. + - PKZiP/mac archive files are extracted without resource-forks + and without any Finder info. I have no information about + that zip format. + +Compatibility of my port; Compression: + - My port supports only the new Info-ZIP format (introduced + with this port). Therefore archives created by MacZip 1.0 + (March 1999) must be extracted with this version or later + releases of Info-ZIP's UnZip to restore the complete set of + Macintosh attributes. + +Note: This port is complete unrelated to the shareware ZipIt. +Even more, handling of special Macintosh attributes is +incompatible with ZipIt. This port (MacZip) may be used to +extract archives created by ZipIt, but make sure that you +get the result as you expected. + + + +Macintosh Files; File Forks: +---------------------------- + +All Macintosh files comprise two forks, known as the data +fork and the resource fork. Unlike the bytes stored in the +resource fork, the bytes in the data fork do not have to +exhibit any particular internal structure. The application +is responsible for interpreting the bytes in the data fork +in whatever manner is appropriate. The bytes in the resource +fork usually have a defined internal structure and contain +data object like menus, dialog boxes, icons and pictures. +Although all Macintosh files contain both a data fork and a +resource fork, one or both of these forks may be empty. + +MacZip stores data-forks and resource-forks separately. The +Zipfile format does not allow to store two archive entries +using exactly the same name. My solution is to modify the +Path name of the resource-fork. All resource-fork names are +prepended with a leading special directory named +"XtraStuf.mac". So, when extracting on a Mac, you should +never see this directory "XtraStuf.mac" on your *disk*. + +On all foreign systems that support directories in filenames +(e.g.: OS/2, Unix, DOS/Windows, VMS) you will get a +directory "XtraStuf.mac" when extracting MacZip archives. +You can delete the complete directory "XtraStuf.mac" since +Mac resources do not make much sense outside the MacOS +world. + + + +Text encoding; Charsets of the Filenames: +----------------------------------------- + +The following information is only important if you plan to +transfer archives across different platforms/language systems: + +A typical Zip archive does not support different charsets. +All filenames stored in the public area (= accessible by +foreign systems other than MacOS) must be coded in the +charset ISO-8859-1 (CP1252 in the Microsoft Windows world) +or CP850 (DOSLatin1). The latter should only be used by Zip +programs that mark the archive entries as "created under +DOS". Apart from Macs, the commonly used platforms either +support ISO-8859-1 directly, or are compatible with it. To +achieve maximum compatibility, MacZip convert filenames from +the Mac OS Roman character set to ISO-8859-1 and vice versa. +But not every char of the charset MacRoman has their +equivalent in ISO-8859-1. To make the mapping in most cases +possible, I chose most similar chars or at least the MIDDLE +DOT. + +Mac OS Roman character set is used for at least the +following Mac OS localizations: U.S., British, Canadian +French, French, Swiss French, German, Swiss German, Italian, +Swiss Italian, Dutch, Swedish, Norwegian, Danish, Finnish, +Spanish, Catalan, Portuguese, Brazilian, and the default +International system. + +In all Mac OS encodings, character codes 0x00-0x7F are +identical to ASCII, except that + - in Mac OS Japanese, yen sign replaces reverse solidus + - in Mac OS Arabic, Farsi, and Hebrew, some of the + punctuation in this range is treated as having strong + left-right directionality, although the corresponding + Unicode characters have neutral directionality +So, for best compatibility, confine filenames to the standard +7-bit ASCII character set. + +If you generate a filename list of your archive (unzip -l), +you will see the converted filenames. Your can also extract +the archive with the switch '-i' (= ignore mac filenames), +and test your result. + +This MacZip port uses its own filename stored in the +archive. At the moment, the filename will be not converted. +However, I'm planning to add support for Unicode. + +Currently, the following Mac OS encodings are NOT supported: +Japanese, ChineseTrad, Korean, Arabic, Hebrew, Greek, +Cyrillic, Devanagari, Gurmukhi, Gujarati, Oriya, Bengali, +Tamil, Telugu Kannada, Malayalam, Sinhalese, Burmese, Khmer, +Thai, Laotian, Georgian, Armenian, ChineseSimp, Tibetan, +Mongolian, Ethiopic, Vietnamese, ExtArabic and finally: +Symbol - this is the encoding for the font named "Symbol". +Dingbats - this is the encoding for the font named "Zapf Dingbats". +If you extract an archive coded with one of these +charsets you will probably get filenames with funny +characters. + +These problems apply only to filenames and NOT to the file +content. +of course: The content of the files will NEVER be converted !! + + + +File-/Creator Type: +------------- + +This port uses the creator type 'IZip' and it is registered +at Apple (since 08. March 1998). File types can not be +registered any more. This port uses 'ZIP ' for Zip archive +files. The creator 'IZip' type should be used for all future +versions of MacZip. + + + +Hints for proper restoration of file-time stamps: +------------------------------------------------- + +UnZip requires the host computer to have proper time zone +information in order to handle certain tasks correctly (see +unzip.txt). To set the time zone on the Macintosh, go to +the Map Control Panel and enter the correct number of hours +(and, in a few locales, minutes) offset from Universal +Time/Greenwich Mean Time. For example, the US Pacific time +zone is -8 hours from UTC/GMT during standard (winter) time +and -7 hours from UTC/GMT during Daylight Savings Time. The +US Eastern time zone is -5 hours during the winter and -4 +hours during the summer. + +Discussion of Daylight Savings Time +----------------------------------- +The setting in the Date & Time control panel for Daylight +Savings time is a universal setting. That is, it assumes +everybody in the world is observing Daylight Savings time +when its check box is selected. + +If other areas of the world are not observing Daylight +Savings time when the check box is selected in the Date & +Time control panel, then the Map control panel will be off +by an hour for all areas that are not recognizing Daylight +Savings time. + +Conversely, if you set the Map control panel to an area that +does not observe Daylight Savings time and deselect/uncheck +the check box for Daylight Savings time in the Date & Time +control panel, then time in all areas celebrating Daylight +Savings time will be off by an hour in the Map control +panel. + +Example: + In the case of Hawaiians, sometimes they are three hours + behind Pacific Standard Time (PST) and sometimes two hours + behind Pacific Daylight Time (PDT). The Map control panel + can only calculate differences between time zones relative + to Greenwich Mean Time (GMT). Hawaii will always show up as + three hours past the Pacific time zone and five hours past + the Central time zone. + + When Hawaiians are not observing Daylight Savings time, but + the rest of the country is, there is no combination of + settings in Map and Date & Time control panels which will + enable you to display Hawaiian local time correctly AND + concurrently display the correct time in other places that + do observe Daylight Savings time. + + The knowledge about which countries observe Daylight Savings + time and which do not is not built into the Map control + panel, so it does not allow for such a complex calculation. + + This same situation also occurs in other parts of the world + besides Hawaii. Phoenix, Arizona is an example of an area of + the U.S. which also does not observe Daylight Savings time. + +Conclusion: +MacZip only knows the GMT and DST offsets of the +current time, not for the time in question. + + +Projects & Packages: +-------------------- + +A Note to version numbers: Version of MacZip is currently +1.06 and is based on the zip code version 2.3 and unzip code +version 5.42. See About Box for current version and compiler +build date. + +Because of the amount of sources I splitted this port into +several projects. See http://www.sitec.net/maczip for +updates. + +- core source parts: + unzxxx.zip + zipxxx.zip + These archives contains the main parts of the port. You can + build libraries and a standalone App with Metrowerks + standard console SIOUX. They contain only sources, no + executables. These archives are exact copies of the standard + Info-ZIP source distributions; they were only repackaged + under MacOS using MacZip, with one minor addition: For those + files that are stored in BinHex'ed format in the Info-ZIP + reference source archives, unpacked version that are ready + for use have been added. + +- additional source part: + MacZipxxx.zip: contains all the GUI stuff and the project + files to build the main-app. Only sources of the GUI, no + zip or unzip code. To build MacZip successfully you will + need to also download the zip and unzip packages. + +- executables: + MacZipxxxnc.hqx: contains only executables and 'README.TXT', + This version is without en-/decryption support ! + MacZipxxxc.hqx: contains only executables and 'README.TXT', + This version supports en-/decryption ! + +- encryption sources: + zcryptxx.zip: To build crypt versions of MacZip. + download from ftp://ftp.icce.rug.nl/infozip/ (and subdirectories) + +- documentation: + MacZipDocu.zip: contains some further docus about the algorithm, + limits, Info-ZIP's appnote and a How-to-do Webpage. + + +Credits: +-------- + +Macstuff.c and recurse.c: All the functions are from More Files. +More Files fixes many of the broken or underfunctional parts of +the file system. Thanks to Jim Luther. (see morefiles.doc) + + + + +--------------------------------------------------------------------------- +Footnotes: + +1. wild card: + The '*' is a wild card and means 'all files' + Just in case you don't know wild cards: + '*' is a place holder for any character. + e.g.: + "this*" matches with "this_file" or "this_textfile" but it + doesn't match with "only_this_file" or "first_this_textfile" + "*this*" matches with "this_file" or "this_textfile" AND + matches with "only_this_file" or "first_this_textfile" + + +2. Mac pathnames: +The following characteristics of Macintosh pathnames should +be noted: + + A full pathname never begins with a colon, but must contain + at least one colon. + A partial pathname always begins with a colon separator except + in the case where the file partial pathname is a simple file or + directory name. + Single trailing separator colons in full or partial pathnames + are ignored except in the case of full pathnames to volumes. + In full pathnames to volumes, the trailing separator colon is + required. + Consecutive separator colons can be used to ascend a level + from a directory to its parent directory. Two consecutive + separator colons will ascend one level, three consecutive + separator colons will ascend two levels, and so on. Ascending + can only occur from a directory; not a file. + + + + + +--------------------------------------------------------------------------- + +Dirk Haase +========== diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/charmap.h boinc-7.0.14+dfsg/zip/unzip/macos/source/charmap.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/charmap.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/charmap.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,380 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +#ifndef __macos_charmap_h +#define __macos_charmap_h + +/* + +Conversion table from MacOS Roman to +"Western Europe & America" Windows codepage 1252 + + Notes on Mac OS Roman: + ---------------------- + + Mac OS Roman character set is used for at least the following Mac OS + localizations: U.S., British, Canadian French, French, Swiss + French, German, Swiss German, Italian, Swiss Italian, Dutch, + Swedish, Norwegian, Danish, Finnish, Spanish, Catalan, + Portuguese, Brazilian, and the default International system. + + Not every char of the charset MacRoman has their equivalent + in Windows CodePage1252. + To make the mapping in most cases possible, I choosed + most similar chars or at least the BULLET. Chars that + do not have a direct match are marked with '***' + + The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage, + with some additional printable characters in the range (0x80 - 0x9F), + that is reserved to control codes in the ISO 8859-1 character table. + +In all Mac OS encodings, character codes 0x00-0x7F are identical to ASCII + +*/ + + + +ZCONST unsigned char MacRoman_to_WinCP1252[128] = { +/* Win CP1252 UniCode UniCode Names */ + 0xC4 , /* 0x00C4 #LATIN CAPITAL LETTER A WITH DIAERESIS */ + 0xC5 , /* 0x00C5 #LATIN CAPITAL LETTER A WITH RING ABOVE */ + 0xC7 , /* 0x00C7 #LATIN CAPITAL LETTER C WITH CEDILLA */ + 0xC9 , /* 0x00C9 #LATIN CAPITAL LETTER E WITH ACUTE */ + 0xD1 , /* 0x00D1 #LATIN CAPITAL LETTER N WITH TILDE */ + 0xD6 , /* 0x00D6 #LATIN CAPITAL LETTER O WITH DIAERESIS */ + 0xDC , /* 0x00DC #LATIN CAPITAL LETTER U WITH DIAERESIS */ + 0xE1 , /* 0x00E1 #LATIN SMALL LETTER A WITH ACUTE */ + 0xE0 , /* 0x00E0 #LATIN SMALL LETTER A WITH GRAVE */ + 0xE2 , /* 0x00E2 #LATIN SMALL LETTER A WITH CIRCUMFLEX */ + 0xE4 , /* 0x00E4 #LATIN SMALL LETTER A WITH DIAERESIS */ + 0xE3 , /* 0x00E3 #LATIN SMALL LETTER A WITH TILDE */ + 0xE5 , /* 0x00E5 #LATIN SMALL LETTER A WITH RING ABOVE */ + 0xE7 , /* 0x00E7 #LATIN SMALL LETTER C WITH CEDILLA */ + 0xE9 , /* 0x00E9 #LATIN SMALL LETTER E WITH ACUTE */ + 0xE8 , /* 0x00E8 #LATIN SMALL LETTER E WITH GRAVE */ + 0xEA , /* 0x00EA #LATIN SMALL LETTER E WITH CIRCUMFLEX */ + 0xEB , /* 0x00EB #LATIN SMALL LETTER E WITH DIAERESIS */ + 0xED , /* 0x00ED #LATIN SMALL LETTER I WITH ACUTE */ + 0xEC , /* 0x00EC #LATIN SMALL LETTER I WITH GRAVE */ + 0xEE , /* 0x00EE #LATIN SMALL LETTER I WITH CIRCUMFLEX */ + 0xEF , /* 0x00EF #LATIN SMALL LETTER I WITH DIAERESIS */ + 0xF1 , /* 0x00F1 #LATIN SMALL LETTER N WITH TILDE */ + 0xF3 , /* 0x00F3 #LATIN SMALL LETTER O WITH ACUTE */ + 0xF2 , /* 0x00F2 #LATIN SMALL LETTER O WITH GRAVE */ + 0xF4 , /* 0x00F4 #LATIN SMALL LETTER O WITH CIRCUMFLEX */ + 0xF6 , /* 0x00F6 #LATIN SMALL LETTER O WITH DIAERESIS */ + 0xF5 , /* 0x00F5 #LATIN SMALL LETTER O WITH TILDE */ + 0xFA , /* 0x00FA #LATIN SMALL LETTER U WITH ACUTE */ + 0xF9 , /* 0x00F9 #LATIN SMALL LETTER U WITH GRAVE */ + 0xFB , /* 0x00FB #LATIN SMALL LETTER U WITH CIRCUMFLEX */ + 0xFC , /* 0x00FC #LATIN SMALL LETTER U WITH DIAERESIS */ + 0x86 , /* 0x2020 #DAGGER */ + 0xB0 , /* 0x00B0 #DEGREE SIGN */ + 0xA2 , /* 0x00A2 #CENT SIGN */ + 0xA3 , /* 0x00A3 #POUND SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 #BULLET */ + 0xB6 , /* 0x00B6 #PILCROW SIGN */ + 0xDF , /* 0x00DF #LATIN SMALL LETTER SHARP S */ + 0xAE , /* 0x00AE #REGISTERED SIGN */ + 0xA9 , /* 0x00A9 #COPYRIGHT SIGN */ + 0x99 , /* 0x2122 #TRADE MARK SIGN */ + 0xB4 , /* 0x00B4 #ACUTE ACCENT */ + 0xA8 , /* 0x00A8 #DIAERESIS */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xC6 , /* 0x00C6 #LATIN CAPITAL LETTER AE */ + 0xD8 , /* 0x00D8 #LATIN CAPITAL LETTER O WITH STROKE */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xB1 , /* 0x00B1 #PLUS-MINUS SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x00A5 #YEN SIGN */ + 0xB5 , /* 0x00B5 #MICRO SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xAA , /* 0x00AA #FEMININE ORDINAL INDICATOR */ + 0xBA , /* 0x00BA #MASCULINE ORDINAL INDICATOR */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xE6 , /* 0x00E6 #LATIN SMALL LETTER AE */ + 0xF8 , /* 0x00F8 #LATIN SMALL LETTER O WITH STROKE */ + 0xBF , /* 0x00BF #INVERTED QUESTION MARK */ + 0xA1 , /* 0x00A1 #INVERTED EXCLAMATION MARK */ + 0xAC , /* 0x00AC #NOT SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x83 , /* 0x0192 #LATIN SMALL LETTER F WITH HOOK */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xAB , /* 0x00AB #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0xBB , /* 0x00BB #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0x85 , /* 0x2026 #HORIZONTAL ELLIPSIS */ + 0xA0 , /* 0x00A0 #NO-BREAK SPACE */ + 0xC0 , /* 0x00C0 #LATIN CAPITAL LETTER A WITH GRAVE */ + 0xC3 , /* 0x00C3 #LATIN CAPITAL LETTER A WITH TILDE */ + 0xD5 , /* 0x00D5 #LATIN CAPITAL LETTER O WITH TILDE */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x96 , /* 0x2013 #EN DASH */ + 0x97 , /* 0x2014 #EM DASH */ + 0x93 , /* 0x201C #LEFT DOUBLE QUOTATION MARK */ + 0x94 , /* 0x201D #RIGHT DOUBLE QUOTATION MARK */ + 0x91 , /* 0x2018 #LEFT SINGLE QUOTATION MARK */ + 0x92 , /* 0x2019 #RIGHT SINGLE QUOTATION MARK */ + 0xF7 , /* 0x00F7 #DIVISION SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xFF , /* 0x00FF #LATIN SMALL LETTER Y WITH DIAERESIS */ + 0x9F , /* 0x0178 #LATIN CAPITAL LETTER Y WITH DIAERESIS */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xA4 , /* 0x00A4 #CURRENCY SIGN */ + 0x8B , /* 0x2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ + 0x9B , /* 0x203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x87 , /* 0x2021 #DOUBLE DAGGER */ + 0xB7 , /* 0x00B7 #MIDDLE DOT */ + 0x82 , /* 0x201A #SINGLE LOW-9 QUOTATION MARK */ + 0x84 , /* 0x201E #DOUBLE LOW-9 QUOTATION MARK */ + 0x89 , /* 0x2030 #PER MILLE SIGN */ + 0xC2 , /* 0x00C2 #LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ + 0xCA , /* 0x00CA #LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ + 0xC1 , /* 0x00C1 #LATIN CAPITAL LETTER A WITH ACUTE */ + 0xCB , /* 0x00CB #LATIN CAPITAL LETTER E WITH DIAERESIS */ + 0xC8 , /* 0x00C8 #LATIN CAPITAL LETTER E WITH GRAVE */ + 0xCD , /* 0x00CD #LATIN CAPITAL LETTER I WITH ACUTE */ + 0xCE , /* 0x00CE #LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ + 0xCF , /* 0x00CF #LATIN CAPITAL LETTER I WITH DIAERESIS */ + 0xCC , /* 0x00CC #LATIN CAPITAL LETTER I WITH GRAVE */ + 0xD3 , /* 0x00D3 #LATIN CAPITAL LETTER O WITH ACUTE */ + 0xD4 , /* 0x00D4 #LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xD2 , /* 0x00D2 #LATIN CAPITAL LETTER O WITH GRAVE */ + 0xDA , /* 0x00DA #LATIN CAPITAL LETTER U WITH ACUTE */ + 0xDB , /* 0x00DB #LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ + 0xD9 , /* 0x00D9 #LATIN CAPITAL LETTER U WITH GRAVE */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x88 , /* 0x02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT */ + 0x98 , /* 0x02DC #SMALL TILDE */ + 0xAF , /* 0x00AF #MACRON */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xB8 , /* 0x00B8 #CEDILLA */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 /* 0x2022 # *** BULLET */ + }; + + + +ZCONST unsigned char WinCP1252_to_MacRoman[128] = { +/* Mac Roman UniCode UniCode Names */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xE2 , /* 0x201A # SINGLE LOW-9 QUOTATION MARK */ + 0xC4 , /* 0x0192 # LATIN SMALL LETTER F WITH HOOK */ + 0xE3 , /* 0x201E # DOUBLE LOW-9 QUOTATION MARK */ + 0xC9 , /* 0x2026 # HORIZONTAL ELLIPSIS */ + 0xA0 , /* 0x2020 # DAGGER */ + 0xE0 , /* 0x2021 # DOUBLE DAGGER */ + 0xF6 , /* 0x02C6 # MODIFIER LETTER CIRCUMFLEX ACCENT */ + 0xE4 , /* 0x2030 # PER MILLE SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xDC , /* 0x2039 # SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xD4 , /* 0x2018 # LEFT SINGLE QUOTATION MARK */ + 0xD5 , /* 0x2019 # RIGHT SINGLE QUOTATION MARK */ + 0xD2 , /* 0x201C # LEFT DOUBLE QUOTATION MARK */ + 0xD3 , /* 0x201D # RIGHT DOUBLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # BULLET */ + 0xD0 , /* 0x2013 # EN DASH */ + 0xD1 , /* 0x2014 # EM DASH */ + 0xF7 , /* 0x02DC # SMALL TILDE */ + 0xAA , /* 0x2122 # TRADE MARK SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xDD , /* 0x203A # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xD9 , /* 0x0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS */ + 0xCA , /* 0x00A0 # NO-BREAK SPACE */ + 0xC1 , /* 0x00A1 # INVERTED EXCLAMATION MARK */ + 0xA2 , /* 0x00A2 # CENT SIGN */ + 0xA3 , /* 0x00A3 # POUND SIGN */ + 0xDB , /* 0x00A4 # CURRENCY SIGN */ + 0xB4 , /* 0x00A5 # YEN SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xAC , /* 0x00A8 # DIAERESIS */ + 0xA9 , /* 0x00A9 # COPYRIGHT SIGN */ + 0xBB , /* 0x00AA # FEMININE ORDINAL INDICATOR */ + 0xC7 , /* 0x00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0xC2 , /* 0x00AC # NOT SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA8 , /* 0x00AE # REGISTERED SIGN */ + 0xF8 , /* 0x00AF # MACRON */ + 0xA1 , /* 0x00B0 # DEGREE SIGN */ + 0xB1 , /* 0x00B1 # PLUS-MINUS SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xAB , /* 0x00B4 # ACUTE ACCENT */ + 0xB5 , /* 0x00B5 # MICRO SIGN */ + 0xA6 , /* 0x00B6 # PILCROW SIGN */ + 0xE1 , /* 0x00B7 # MIDDLE DOT */ + 0xFC , /* 0x00B8 # CEDILLA */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xBC , /* 0x00BA # MASCULINE ORDINAL INDICATOR */ + 0xC8 , /* 0x00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xC0 , /* 0x00BF # INVERTED QUESTION MARK */ + 0xCB , /* 0x00C0 # LATIN CAPITAL LETTER A WITH GRAVE */ + 0xE7 , /* 0x00C1 # LATIN CAPITAL LETTER A WITH ACUTE */ + 0xE5 , /* 0x00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ + 0xCC , /* 0x00C3 # LATIN CAPITAL LETTER A WITH TILDE */ + 0x80 , /* 0x00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS */ + 0x81 , /* 0x00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE */ + 0xAE , /* 0x00C6 # LATIN CAPITAL LETTER AE */ + 0x82 , /* 0x00C7 # LATIN CAPITAL LETTER C WITH CEDILLA */ + 0xE9 , /* 0x00C8 # LATIN CAPITAL LETTER E WITH GRAVE */ + 0x83 , /* 0x00C9 # LATIN CAPITAL LETTER E WITH ACUTE */ + 0xE6 , /* 0x00CA # LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ + 0xE8 , /* 0x00CB # LATIN CAPITAL LETTER E WITH DIAERESIS */ + 0xED , /* 0x00CC # LATIN CAPITAL LETTER I WITH GRAVE */ + 0xEA , /* 0x00CD # LATIN CAPITAL LETTER I WITH ACUTE */ + 0xEB , /* 0x00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ + 0xEC , /* 0x00CF # LATIN CAPITAL LETTER I WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0x84 , /* 0x00D1 # LATIN CAPITAL LETTER N WITH TILDE */ + 0xF1 , /* 0x00D2 # LATIN CAPITAL LETTER O WITH GRAVE */ + 0xEE , /* 0x00D3 # LATIN CAPITAL LETTER O WITH ACUTE */ + 0xEF , /* 0x00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ + 0xCD , /* 0x00D5 # LATIN CAPITAL LETTER O WITH TILDE */ + 0x85 , /* 0x00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xAF , /* 0x00D8 # LATIN CAPITAL LETTER O WITH STROKE */ + 0xF4 , /* 0x00D9 # LATIN CAPITAL LETTER U WITH GRAVE */ + 0xF2 , /* 0x00DA # LATIN CAPITAL LETTER U WITH ACUTE */ + 0xF3 , /* 0x00DB # LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ + 0x86 , /* 0x00DC # LATIN CAPITAL LETTER U WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA7 , /* 0x00DF # LATIN SMALL LETTER SHARP S */ + 0x88 , /* 0x00E0 # LATIN SMALL LETTER A WITH GRAVE */ + 0x87 , /* 0x00E1 # LATIN SMALL LETTER A WITH ACUTE */ + 0x89 , /* 0x00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX */ + 0x8B , /* 0x00E3 # LATIN SMALL LETTER A WITH TILDE */ + 0x8A , /* 0x00E4 # LATIN SMALL LETTER A WITH DIAERESIS */ + 0x8C , /* 0x00E5 # LATIN SMALL LETTER A WITH RING ABOVE */ + 0xBE , /* 0x00E6 # LATIN SMALL LETTER AE */ + 0x8D , /* 0x00E7 # LATIN SMALL LETTER C WITH CEDILLA */ + 0x8F , /* 0x00E8 # LATIN SMALL LETTER E WITH GRAVE */ + 0x8E , /* 0x00E9 # LATIN SMALL LETTER E WITH ACUTE */ + 0x90 , /* 0x00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX */ + 0x91 , /* 0x00EB # LATIN SMALL LETTER E WITH DIAERESIS */ + 0x93 , /* 0x00EC # LATIN SMALL LETTER I WITH GRAVE */ + 0x92 , /* 0x00ED # LATIN SMALL LETTER I WITH ACUTE */ + 0x94 , /* 0x00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX */ + 0x95 , /* 0x00EF # LATIN SMALL LETTER I WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0x96 , /* 0x00F1 # LATIN SMALL LETTER N WITH TILDE */ + 0x98 , /* 0x00F2 # LATIN SMALL LETTER O WITH GRAVE */ + 0x97 , /* 0x00F3 # LATIN SMALL LETTER O WITH ACUTE */ + 0x99 , /* 0x00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX */ + 0x9B , /* 0x00F5 # LATIN SMALL LETTER O WITH TILDE */ + 0x9A , /* 0x00F6 # LATIN SMALL LETTER O WITH DIAERESIS */ + 0xD6 , /* 0x00F7 # DIVISION SIGN */ + 0xBF , /* 0x00F8 # LATIN SMALL LETTER O WITH STROKE */ + 0x9D , /* 0x00F9 # LATIN SMALL LETTER U WITH GRAVE */ + 0x9C , /* 0x00FA # LATIN SMALL LETTER U WITH ACUTE */ + 0x9E , /* 0x00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX */ + 0x9F , /* 0x00FC # LATIN SMALL LETTER U WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xD8 /* 0x00FF # LATIN SMALL LETTER Y WITH DIAERESIS */ + }; + + +/* + +The following characters has no equivalent +to each other: + +MacCodes +164 0xA4 0x00A7 # SECTION SIGN +253 0xFD 0x02DD # DOUBLE ACUTE ACCENT +189 0xBD 0x03A9 # GREEK CAPITAL LETTER OMEGA +185 0xB9 0x03C0 # GREEK SMALL LETTER PI +255 0xFF 0x02C7 # CARON +249 0xF9 0x02D8 # BREVE +250 0xFA 0x02D9 # DOT ABOVE +251 0xFB 0x02DA # RING ABOVE +254 0xFE 0x02DB # OGONEK +218 0xDA 0x2044 # FRACTION SLASH +182 0xB6 0x2202 # PARTIAL DIFFERENTIAL +198 0xC6 0x2206 # INCREMENT +184 0xB8 0x220F # N-ARY PRODUCT +183 0xB7 0x2211 # N-ARY SUMMATION +195 0xC3 0x221A # SQUARE ROOT +176 0xB0 0x221E # INFINITY +186 0xBA 0x222B # INTEGRAL +197 0xC5 0x2248 # ALMOST EQUAL TO +173 0xAD 0x2260 # NOT EQUAL TO +178 0xB2 0x2264 # LESS-THAN OR EQUAL TO +179 0xB3 0x2265 # GREATER-THAN OR EQUAL TO +215 0xD7 0x25CA # LOZENGE +240 0xF0 0xF8FF # Apple logo +222 0xDE 0xFB01 # LATIN SMALL LIGATURE FI +223 0xDF 0xFB02 # LATIN SMALL LIGATURE FL +245 0xF5 0x0131 # LATIN SMALL LETTER DOTLESS I +206 0xCE 0x0152 # LATIN CAPITAL LIGATURE OE +207 0xCF 0x0153 # LATIN SMALL LIGATURE OE + +WinCodes +129 0x81 #UNDEFINED +141 0x8D #UNDEFINED +143 0x8F #UNDEFINED +144 0x90 #UNDEFINED +157 0x9D #UNDEFINED +167 0xA7 0x00A7 #SECTION SIGN +173 0xAD 0x00AD #SOFT HYPHEN +178 0xB2 0x00B2 #SUPERSCRIPT TWO +179 0xB3 0x00B3 #SUPERSCRIPT THREE +185 0xB9 0x00B9 #SUPERSCRIPT ONE +188 0xBC 0x00BC #VULGAR FRACTION ONE QUARTER +189 0xBD 0x00BD #VULGAR FRACTION ONE HALF +190 0xBE 0x00BE #VULGAR FRACTION THREE QUARTERS +208 0xD0 0x00D0 #LATIN CAPITAL LETTER ETH +215 0xD7 0x00D7 #MULTIPLICATION SIGN +221 0xDD 0x00DD #LATIN CAPITAL LETTER Y WITH ACUTE +222 0xDE 0x00DE #LATIN CAPITAL LETTER THORN +240 0xF0 0x00F0 #LATIN SMALL LETTER ETH +253 0xFD 0x00FD #LATIN SMALL LETTER Y WITH ACUTE +254 0xFE 0x00FE #LATIN SMALL LETTER THORN +140 0x8C 0x0152 #LATIN CAPITAL LIGATURE OE +156 0x9C 0x0153 #LATIN SMALL LIGATURE OE +138 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON +154 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON +142 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON +158 0x9E 0x017E #LATIN SMALL LETTER Z WITH CARON +128 0x80 0x20AC #EURO SIGN +166 0xA6 0x00A6 #BROKEN BAR + + +*/ + + + + +#endif /* !__macos_charmap_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/getenv.c boinc-7.0.14+dfsg/zip/unzip/macos/source/getenv.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/getenv.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/getenv.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,400 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + +This file implements the getenv() function. + +# Background: +# Under Unix: Each Process (= running Program) has a set of +# associated variables. The variables are called enviroment +# variables and, together, constitute the process environment. +# These variables include the search path, the terminal type, +# and the user's login name. + +# Unfortunatelly the MacOS has no equivalent. So we need +# a file to define the environment variables. +# Name of this file is "MacZip.Env". It can be placed +# in the current folder of MacZip or in the +# preference folder of the system disk. +# If MacZip founds the "MacZip.Env" file in the current +# the folder of MacZip the "MacZip.Env" file in the +# preference folder will be ignored. + +# An environment variable has a name and a value: +# Name=Value +# Note: Spaces are significant: +# ZIPOPT=-r and +# ZIPOPT = -r are different !!! + + + */ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "pathname.h" +#include "helpers.h" + +/*****************************************************************************/ +/* Module level Vars */ +/*****************************************************************************/ + +static char ListAllKeyValues = 0; +static unsigned LineNumber = 0; +static char CompletePath[NAME_MAX]; +Boolean IgnoreEnvironment = false; /* used by dialog.c and initfunc.c + of the Mainapp */ + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +typedef struct _EnviromentPair { + char *key; + char *value; +} EnviromentPair; + + +#define MAX_COMMAND 1024 + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + + +int get_char(FILE *file); +void unget_char(int ch,FILE *file); +int get_string(char *string,int size, FILE *file, char *terms); +void skip_comments(FILE *file); +char *load_entry(FILE *file); +char *getenv(const char *name); +EnviromentPair *ParseLine(char *line); +OSErr FSpFindFolder_Name(short vRefNum, OSType folderType, + Boolean createFolder,FSSpec *spec, unsigned char *name); +FILE * FSp_fopen(ConstFSSpecPtr spec, const char * open_mode); +void ShowAllKeyValues(void); +void Set_LineNum(unsigned ln); + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +/* get_string(str, max, file, termstr) : like fgets() but + * (1) has terminator string which should include \n + * (2) will always leave room for the null + * (3) uses get_char() so LineNumber will be accurate + * (4) returns EOF or terminating character, whichever + */ +int get_string(char *string, int size, FILE *file, char *terms) +{ + int ch; + + while (EOF != (ch = get_char(file)) && !strchr(terms, ch)) { + if (size > 1) { + *string++ = (char) ch; + size--; + } + } + + if (size > 0) + { + *string = '\0'; + } + + return ch; +} + + + + +void Set_LineNum(unsigned ln) +{ + LineNumber = ln; +} + + + +/* get_char(file) : like getc() but increment LineNumber on newlines + */ +int get_char(FILE *file) +{ + int ch; + + ch = getc(file); + if (ch == '\n') + { + Set_LineNum(LineNumber + 1); + } + + return ch; +} + + + + +/* skip_comments(file) : read past comment (if any) + */ +void skip_comments(FILE *file) +{ + int ch; + + while (EOF != (ch = get_char(file))) + { + /* ch is now the first character of a line. + */ + + while (ch == ' ' || ch == '\t') + { + ch = get_char(file); + } + + if (ch == EOF) + { + break; + } + + /* ch is now the first non-blank character of a line. + */ + + if (ch != '\n' && ch != '#') + { + break; + } + + /* ch must be a newline or comment as first non-blank + * character on a line. + */ + + while (ch != '\n' && ch != EOF) + { + ch = get_char(file); + } + + /* ch is now the newline of a line which we're going to + * ignore. + */ + } + + if (ch != EOF) + { + unget_char(ch, file); + } +} + + + + +/* unget_char(ch, file) : like ungetc but do LineNumber processing + */ +void unget_char(int ch, FILE *file) +{ + ungetc(ch, file); + if (ch == '\n') + { + Set_LineNum(LineNumber - 1); + } +} + + +/* this function reads one file entry -- the next -- from a file. +* it skips any leading blank lines, ignores comments, and returns +* NULL if for any reason the entry can't be read and parsed. +*/ + +char *load_entry(FILE *file) +{ + int ch; + static char cmd[MAX_COMMAND]; + + skip_comments(file); + + ch = get_string(cmd, MAX_COMMAND, file, "\n"); + + if (ch == EOF) + { + return NULL; + } + + return cmd; +} + + + + + +EnviromentPair *ParseLine(char *line) +{ +char *tmpPtr; +static EnviromentPair *Env; +unsigned short length = strlen(line); + +Env->key = ""; +Env->value = ""; + +for (tmpPtr = line; *tmpPtr; tmpPtr++) + { + if (*tmpPtr == '=') + { + *tmpPtr = 0; + Env->key = line; + if (strlen(Env->key) < length) + { + Env->value = ++tmpPtr; + } + return Env; + } + } +return Env; +} + + + + + +char *getenv(const char *name) +{ +FILE *fp; +char *LineStr = NULL; +EnviromentPair *Env1; +FSSpec spec; +OSErr err; + +if (IgnoreEnvironment) + return NULL; /* user wants to ignore the environment vars */ + +if (name == NULL) + return NULL; + +GetCompletePath(CompletePath,"MacZip.Env",&spec,&err); + +/* try open the file in the current folder */ +fp = FSp_fopen(&spec,"r"); +if (fp == NULL) + { /* Okey, lets try open the file in the preference folder */ + FSpFindFolder_Name( + kOnSystemDisk, + kPreferencesFolderType, + kDontCreateFolder, + &spec, + "\pMacZip.Env"); + fp = FSp_fopen(&spec,"r"); + if (fp == NULL) + { + return NULL; /* there is no enviroment-file */ + } + } + +LineStr = load_entry(fp); +while (LineStr != NULL) + { /* parse the file line by line */ + Env1 = ParseLine(LineStr); + if (strlen(Env1->value) > 0) + { /* we found a key/value pair */ + if (ListAllKeyValues) + printf("\n Line:%3d [%s] = [%s]",LineNumber,Env1->key,Env1->value); + if (stricmp(name,Env1->key) == 0) + { /* we found the value of a given key */ + return Env1->value; + } + } + LineStr = load_entry(fp); /* read next line */ + } +fclose(fp); + +return NULL; +} + + + + + +OSErr FSpFindFolder_Name( + short vRefNum, /* Volume reference number. */ + OSType folderType, /* Folder type taken by FindFolder. */ + Boolean createFolder, /* Should we create it if non-existant. */ + FSSpec *spec, /* Pointer to resulting directory. */ + unsigned char *name) /* Name of the file in the folder */ +{ + short foundVRefNum; + long foundDirID; + OSErr err; + + err = FindFolder(vRefNum, folderType, createFolder, + &foundVRefNum, &foundDirID); + if (err != noErr) + { + return err; + } + + err = FSMakeFSSpec(foundVRefNum, foundDirID, name, spec); + return err; +} + + + + +void ShowAllKeyValues(void) +{ +OSErr err; +FSSpec spec; +Boolean tmpIgnoreEnvironment = IgnoreEnvironment; + +ListAllKeyValues = 1; +IgnoreEnvironment = false; + +GetCompletePath(CompletePath,"MacZip.Env",&spec,&err); +if (err != 0) + { /* Okey, lets try open the file in the preference folder */ + FSpFindFolder_Name( + kOnSystemDisk, + kPreferencesFolderType, + kDontCreateFolder, + &spec, + "\pMacZip.Env"); + GetFullPathFromSpec(CompletePath,&spec, &err); + if (err != 0) + { + return; /* there is no enviroment-file */ + } + } + +printf("\nLocation of the current \"MacZip.Env\" file:\n [%s]",CompletePath); + +printf("\n\nList of all environment variables\n"); +getenv(" "); +printf("\n\nEnd\n\n"); + +/* restore used variables */ +ListAllKeyValues = 0; +LineNumber = 0; +IgnoreEnvironment = tmpIgnoreEnvironment; +} + + + + + + + + + + + +const char *BOINC_RCSID_0094939622 = "$Id: getenv.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/helpers.c boinc-7.0.14+dfsg/zip/unzip/macos/source/helpers.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/helpers.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/helpers.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,481 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + helpers.c + + Some useful functions Used by unzip and zip. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include "zip.h" +#include +#include +#include + +#include "macstuff.h" +#include "helpers.h" +#include "pathname.h" + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + + +extern int noisy; +extern char MacPathEnd; +extern char *zipfile; /* filename of the Zipfile */ +extern char *tempzip; /* Temporary zip file name */ +extern ZCONST unsigned char MacRoman_to_WinCP1252[128]; + + +static char argStr[1024]; +static char *argv[MAX_ARGS + 1]; + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +/* +** Copy a C string to a Pascal string +** +*/ + +unsigned char *CToPCpy(unsigned char *pstr, char *cstr) +{ + register char *dptr; + register unsigned len; + + len=0; + dptr=(char *)pstr+1; + while (len<255 && (*dptr++ = *cstr++)!='\0') ++len; + *pstr= (unsigned char)len; + return pstr; +} + + +/* +** Copy a Pascal string to a C string +** +*/ + +char *PToCCpy(unsigned char *pstr, char *cstr) +{ +strncpy(cstr, (char *) &pstr[1], *pstr); + cstr[pstr[0]] = '\0'; /* set endmarker for c-string */ +return cstr; +} + + +/* +** strcpy() and strcat() work-alikes which allow overlapping buffers. +*/ + +char *sstrcpy(char *to,const char *from) +{ + memmove(to, from, 1+strlen(from)); + return to; +} + +char *sstrcat(char *to,const char *from) +{ + sstrcpy(to + strlen(to), from); + return to; +} + + + +/* +** Alloc memory and init it +** +*/ + +char *StrCalloc(unsigned short size) +{ +char *strPtr = NULL; + +if ((strPtr = calloc(size, sizeof(char))) == NULL) + printerr("StrCalloc failed:", -1, size, __LINE__, __FILE__, ""); + +Assert_it(strPtr,"strPtr == NULL","") +return strPtr; +} + + + +/* +** Release only non NULL pointers +** +*/ + +char *StrFree(char *strPtr) +{ + +if (strPtr != NULL) + { + free(strPtr); + } + +return NULL; +} + + + + +/* +** Return a value in a binary string +** +*/ + +char *sBit2Str(unsigned short value) +{ + static char str[sizeof(value)*8]; + int biz = 16; + int strwid = 16; + int i, j; + char *tempPtr = str; + + j = strwid - (biz + (biz >> 2)- (biz % 4 ? 0 : 1)); + + for (i = 0; i < j; i++) { + *tempPtr++ = ' '; + } + while (--biz >= 0) + { + *tempPtr++ = ((value >> biz) & 1) + '0'; + if (!(biz % 4) && biz) { + *tempPtr++ = ' '; + } + } + *tempPtr = '\0'; + + return str; +} + + + + +/* +** Parse commandline style arguments +** +*/ + +int ParseArguments(char *s, char ***arg) +{ + int n = 1, Quote = 0; + char *p = s, *p1, c; + + argv[0] = GetAppName(); + + *arg = argv; + + p1 = (char *) argStr; + while ((c = *p++) != 0) { + if (c==' ') continue; + argv[n++] = p1; + if (n > MAX_ARGS) + return (n-1); + do { + if (c=='\\' && *p++) + c = *p++; + else + if ((c=='"') || (c == '\'')) { + if (!Quote) { + Quote = c; + continue; + } + if (c == Quote) { + Quote = 0; + continue; + } + } + *p1++ = c; + } while (*p && ((c = *p++) != ' ' || Quote)); + *p1++ = '\0'; + } + return n; +} + + + +/* +** Print commandline style arguments +** +*/ + +void PrintArguments(int argc, char **argv) +{ + +printf("\n Arguments:"); +printf("\n --------------------------"); + +while(--argc >= 0) + printf("\n argc: %d argv: [%s]", argc, &*argv[argc]); + +printf("\n --------------------------\n\n"); +return; +} + + + +/* +** return some error-msg on file-system +** +*/ + +int PrintUserHFSerr(int cond, int err, char *msg2) +{ +char *msg; + +if (cond != 0) + { + switch (err) + { + case -35: + msg = "No such Volume"; + break; + + case -56: + msg = "No such Drive"; + break; + + case -37: + msg = "Bad Volume Name"; + break; + + case -49: + msg = "File is already open for writing"; + break; + + case -43: + msg = "Directory/File not found"; + break; + + case -120: + msg = "Directory/File not found or incomplete pathname"; + break; + + default: return err; + } + fprintf(stderr, "\n\n Error: %s ->%s", msg, msg2); + exit(err); + } + +return 0; +} + + + +/* +** Check mounted volumes and return number of volumes +** with the same name. +*/ + +short CheckMountedVolumes(char *FullPath) +{ +FSSpec volumes[50]; /* 50 Volumes should be enough */ +char VolumeName[257], volume[257]; +short actVolCount, volIndex = 1, VolCount = 0; +OSErr err; +int i; + +GetVolumeFromPath(FullPath, VolumeName); + +err = OnLine(volumes, 50, &actVolCount, &volIndex); +printerr("OnLine:", (err != -35) && (err != 0), err, __LINE__, __FILE__, ""); + +for (i=0; i < actVolCount; i++) + { + PToCCpy(volumes[i].name,volume); + if (stricmp(volume, VolumeName) == 0) VolCount++; + } +printerr("OnLine: ", (VolCount == 0), VolCount, __LINE__, __FILE__, FullPath); + +return VolCount; +} + + + + + + + + +/* +** compares strings, ignoring differences in case +** +*/ + +int stricmp(const char *p1, const char *p2) +{ +int diff; + +while (*p1 && *p2) + { + if (*p1 != *p2) + { + if (isalpha(*p1) && isalpha(*p2)) + { + diff = toupper(*p1) - toupper(*p2); + if (diff) return diff; + } + else break; + } + p1++; + p2++; + } +return *p1 - *p2; +} + + + +/* +** Convert the MacOS-Strings (Filenames/Findercomments) to a most compatible. +** These strings will be stored in the public area of the zip-archive. +** Every foreign platform (outside macos) will access these strings +** for extraction. +*/ + +void MakeCompatibleString(char *MacOS_Str, + const char SpcChar1, const char SpcChar2, + const char SpcChar3, const char SpcChar4, + short CurrTextEncodingBase) +{ + char *tmpPtr; + register uch curch; + + Assert_it(MacOS_Str,"MakeCompatibleString MacOS_Str == NULL","") + for (tmpPtr = MacOS_Str; (curch = *tmpPtr) != '\0'; tmpPtr++) + { + if (curch == SpcChar1) + *tmpPtr = SpcChar2; + else + if (curch == SpcChar3) + *tmpPtr = SpcChar4; + else /* default */ + /* now convert from MacRoman to ISO-8859-1 */ + /* but convert only if MacRoman is activ */ + if ((CurrTextEncodingBase == kTextEncodingMacRoman) && + (curch > 127)) + { + *tmpPtr = (char)MacRoman_to_WinCP1252[curch - 128]; + } + } /* end for */ +} + + + + +Boolean CheckForSwitch(char *Switch, int argc, char **argv) +{ + char *p; /* steps through option arguments */ + int i; /* arg counter, root directory flag */ + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + if (argv[i][1]) + { + for (p = argv[i]+1; *p; p++) + { + if (*p == Switch[0]) + { + return true; + } + if ((Switch[1] != NULL) && + ((*p == Switch[0]) && (*p == Switch[1]))) + { + return true; + } + } + } + } + } + +return false; +} + + + + + + + +#if (defined(USE_SIOUX) || defined(MACUNZIP_STANDALONE)) + +/* +** checks the condition and returns an error-msg +** this function is for internal use only +*/ + +OSErr printerr(const char *msg, int cond, int err, int line, char *file, + const char *msg2) +{ + +if (cond != 0) + { + fprintf(stderr, "\nint err: %d: %s %d [%d/%s] {%s}\n", clock(), msg, err, + line, file, msg2); + } + +return cond; +} + + +/* +fake-functions: +Not Implemented for metrowerks SIOUX +*/ + +void leftStatusString(char *status) +{ +status = status; +} + + +void rightStatusString(char *status) +{ +status = status; +} + + + +void DoWarnUserDupVol( char *FullPath ) +{ + char VolName[257]; + GetVolumeFromPath(FullPath, VolName); + + printf("\n There are more than one volume that has the same name !!\n"); + + printf("\n Volume: %s\n",VolName); + + printf("\n This port has one weak point:"); + printf("\n It is based on pathnames. As you may be already know:"); + printf("\n Pathnames are not unique on a Mac !"); + printf("\n MacZip has problems to find the correct location of"); + printf("\n the archive or the files.\n"); + + printf("\n My (Big) recommendation: Name all your volumes with an"); + printf("\n unique name and MacZip will run without any problem."); +} + + + +#endif + +const char *BOINC_RCSID_f6b4b545d7 = "$Id: helpers.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/helpers.h boinc-7.0.14+dfsg/zip/unzip/macos/source/helpers.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/helpers.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/helpers.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,57 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +#ifndef HELPERS_H +#define HELPERS_H 1 + + /* Convert a C string to a Pascal string */ +unsigned char *CToPCpy(unsigned char *pstr, char *cstr); + + /* Convert a Pascal string to a C string */ +char *PToCCpy(unsigned char *pstr, char *cstr); + +char *sstrcpy(char *to,const char *from); +char *sstrcat(char *to,const char *from); + +char *StrCalloc(unsigned short size); +char *StrFree(char *strPtr); + +char *sBit2Str(unsigned short value); + +void print_extra_info(void); + +int ParseArguments(char *s, char ***arg); +void PrintArguments(int argc, char **argv); + +Boolean IsZipFile(char *name); +OSErr printerr(const char *msg, int cond, int err, int line, char *file, + const char *msg2); +int PrintUserHFSerr(int cond, int err, char *msg2); + +short CheckMountedVolumes(char *FullPath); +void DoWarnUserDupVol(char *path); + +void PrintFileInfo(void); + +int stricmp(const char *p1, const char *p2); +void leftStatusString(char *status); +void rightStatusString(char *status); + +Boolean isZipFile(FSSpec *fileToOpen); + +unsigned long MacFileDate_to_UTime(unsigned long mactime); +Boolean CheckForSwitch(char *Switch, int argc, char **argv); + +void MakeCompatibleString(char *MacOS_Str, + const char SpcChar1, const char SpcChar2, + const char SpcChar3, const char SpcChar4, + short CurrTextEncodingBase); + +#define MAX_ARGS 25 + +#endif /* HELPERS_H */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macbin3.c boinc-7.0.14+dfsg/zip/unzip/macos/source/macbin3.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macbin3.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macbin3.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,765 @@ +/**************************************************************** + MacBinaryIII.c + + Copyright 1997 Christopher Evans (cevans@poppybank.com) + + Basic encoding and decoding of Macintosh files to the + MacBinary III spec. + + This file is part of the MacBinaryIII_src_C.sit package + see macbin3.h for more information + +****************************************************************/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include "macbin3.h" + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +/* source (the macbinary file) will be deleted */ +#define DELETE_MACBINARY_SOURCE + +/* enable encoding +#define INCLUDE_ENCODE_MACBINARY */ + +/* enable decoding */ +#define INCLUDE_DECODE_MACBINARY + +/* include own CRC 32 Bit Calculation +#define INCLUDE_CRC32CALC */ + +/* produce some helpful printouts for tracing +#define TRACE_MACBINARY */ + + + +#define LONG_AT_OFFSET(data, offset) *((long *)((unsigned char *)&data[offset])) +#define WORD_AT_OFFSET(data, offset) *((Word *)((unsigned char *)&data[offset])) +#define BYTE_AT_OFFSET(data, offset) *((Byte *)((unsigned char *)&data[offset])) +#define PTR_AT_OFFSET(data, offset) ((Ptr)((unsigned char *)&data[offset])) + +typedef unsigned short Word; + +#define kOldVersionOffset 0 +#define kFileNameLengthOffset 1 +#define kFileNameOffset 2 +#define kFileTypeOffset 65 +#define kFileCreatorOffset 69 +#define kFinderFlagsHiOffset 73 +#define kVersionCheckZero 74 +#define kFileVPositionOffset 75 +#define kFileHPositionOffset 77 +#define kFileFolderIDOffset 79 +#define kProtectedFlagOffset 81 +#define kVersionOneCheckZero 82 +#define kDataForkLengthOffset 83 +#define kResourceForkLengthOffset 87 +#define kFileCreationDateOffset 91 +#define kFileModificationDateOffset 95 +#define kGetInfoCommentLengthOffset 99 +#define kFinderFlagsLowOffset 101 +#define kMacbinarySigOffset 102 +#define kFilenameScriptOffset 106 +#define kExtendedFinderFlagsOffset 107 +#define kTotalFileLengthOffset 116 +#define kSecondaryHeaderLengthOffset 120 +#define kCurrentVersionOffset 122 +#define kMinimumVersionOffset 123 +#define kCRCOffset 124 + +#define kResourceForkMaxLen (1024 * 1024 * 16) + + +/*****************************************************************************/ +/* Module level Vars */ +/*****************************************************************************/ + +#ifdef INCLUDE_CRC32CALC +static unsigned long crc_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; +#endif + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +static Boolean HeaderIsMacBinary(char *header, + Word *version, + long maxDataLen); +static Boolean FSpExists(FSSpec *file); +#ifdef INCLUDE_CRC32CALC +static unsigned long crc32(unsigned long seed, unsigned char *p, size_t len); +#else +extern unsigned long crc32(unsigned long seed, unsigned char *p, size_t len); +#endif +static OSErr GetDesktopComment(FSSpec *file, char*comment, long *length); +static OSErr SetDesktopComment(FSSpec *file, char*comment, long length); +static Handle EncodeMacbinary(FSSpec *file); +static OSErr DecodeMacBinary(Handle data, FSSpec *destination); + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +#ifdef INCLUDE_CRC32CALC +/* taken from the mcvert source code */ +static unsigned long crc32(unsigned long seed, unsigned char *p, size_t len) +{ + unsigned long hold; /* crc computed so far */ + size_t i; /* index into data */ + + hold = seed; /* start with seed */ + for (i = 0; i < len; i++, p++) + { + hold ^= (*p << 8); + hold = (hold << 8) ^ crc_table[(unsigned char) (hold >> 8)]; + } + + return (hold); +} /* crc32() */ +#endif + + + +static Boolean FSpExists(FSSpec *file) +{ + FInfo fndrInfo; + + return FSpGetFInfo(file, &fndrInfo) == noErr; +} + + +static Boolean HeaderIsMacBinary(char *header, + Word *version, + long maxDataLen) +{ + Boolean isIt = false; + unsigned long resourceForkLength, dataForkLength, df_rf_length; + short commentLength; + Byte mbVersion; + +#ifdef TRACE_MACBINARY +printf("\n\n Function HeaderIsMacBinary(): "); +#endif + + if(LONG_AT_OFFSET(header, kMacbinarySigOffset) == 'mBIN') + { + isIt = true; + mbVersion = 130; + } + else + if(BYTE_AT_OFFSET(header, kVersionCheckZero) == 0 && + BYTE_AT_OFFSET(header, kOldVersionOffset) == 0) + { + if(WORD_AT_OFFSET(header, kCRCOffset) == + crc32(0, (unsigned char*) &header, 124)) + { + isIt = true; + mbVersion = 129; + } + else + { + if(BYTE_AT_OFFSET(header, kVersionOneCheckZero) == 0) + { + isIt = true; + mbVersion = 128; + } + } + } + +#ifdef TRACE_MACBINARY +printf("\n mbVersion: %d",mbVersion); +#endif + + resourceForkLength = LONG_AT_OFFSET(header, kResourceForkLengthOffset); + dataForkLength = LONG_AT_OFFSET(header, kDataForkLengthOffset); + commentLength = WORD_AT_OFFSET(header, kGetInfoCommentLengthOffset); + df_rf_length = dataForkLength + resourceForkLength; + +#ifdef TRACE_MACBINARY +printf("\n resourceForkLength: %d",resourceForkLength); +printf("\n dataForkLength: %d",dataForkLength); +printf("\n commentLength: %d",commentLength); +printf("\n df_rf_length: %d",df_rf_length); +printf("\n 1. isIt: bool: %d", + isIt); +printf("\n BYTE_AT_OFFSET(header, kFileNameLengthOffset) >= 1 bool: %d", + BYTE_AT_OFFSET(header, kFileNameLengthOffset) >= 1); +printf("\n BYTE_AT_OFFSET(header, kFileNameLengthOffset) <= 31 bool: %d", + BYTE_AT_OFFSET(header, kFileNameLengthOffset) <= 31); +printf("\n dataForkLength >= 0 bool: %d", + dataForkLength >= 0); +printf("\n resourceForkLength >= 0 bool: %d", + resourceForkLength >= 0); +printf("\n resourceForkLength <= 0x%8x bool: %d", + kResourceForkMaxLen, resourceForkLength <= kResourceForkMaxLen); +printf("\n dataForkLength <= %8u bool: %d", + maxDataLen, dataForkLength <= maxDataLen); +printf("\n df_rf_length > 0 bool: %d", + df_rf_length > 0); +printf("\n df_rf_length <= %8u bool: %d", + maxDataLen, df_rf_length <= maxDataLen); +#endif + + if(isIt && + BYTE_AT_OFFSET(header, kFileNameLengthOffset) >= 1 && + BYTE_AT_OFFSET(header, kFileNameLengthOffset) <= 31 && + dataForkLength >= 0 && + resourceForkLength >= 0 && + resourceForkLength <= kResourceForkMaxLen && + df_rf_length > 0 && + df_rf_length <= maxDataLen) + { + isIt = true; + } + else + isIt = false; /* something is wrong with the header */ + +#ifdef TRACE_MACBINARY +printf("\n 2. isIt: bool: %d", + isIt); +#endif + + if(version) + *version = mbVersion; + return isIt; +} + + + +Boolean FSpIsMacBinary(FSSpec *file) +{ + char header[128]; + short dfRefNum = 0; + OSErr err; + long size; + Boolean isIt = false; + CInfoPBRec pb; + long maxDataLen; + + memset(&pb, 0, sizeof(CInfoPBRec)); + pb.hFileInfo.ioNamePtr = file->name; + pb.hFileInfo.ioVRefNum = file->vRefNum; + pb.hFileInfo.ioFDirIndex = 0; /* query a file */ + pb.hFileInfo.ioDirID = file->parID; + err = PBGetCatInfo(&pb,false); + maxDataLen = pb.hFileInfo.ioFlLgLen; + + memset(header, 0, 128); + + err = FSpOpenDF(file, fsRdPerm, &dfRefNum); + if(!err) + { + err = GetEOF(dfRefNum, &size); + if(size > 128) + { + size = 128; + err = FSRead(dfRefNum, &size, &header); + + if(err == noErr) + { + isIt = HeaderIsMacBinary(header, nil, maxDataLen); + } + } + FSClose(dfRefNum); + } + return isIt; +} + + + +#ifdef INCLUDE_ENCODE_MACBINARY + +static OSErr GetDesktopComment(FSSpec *file, char*comment, long *length) +{ + DTPBRec pb; + OSErr err; + + pb.ioCompletion = nil; + pb.ioNamePtr = NULL; + pb.ioVRefNum = file->vRefNum; + + err = PBDTGetPath(&pb); + + if(err == noErr) + { + pb.ioNamePtr = file->name; + pb.ioDTBuffer = comment; + pb.ioDirID = file->parID; + err = PBDTGetComment(&pb, false); + *length = pb.ioDTActCount; + } + return err; +} + + + + +OSErr EncodeMacbinaryFile(FSSpec *file) +{ + Handle data; + OSErr err = paramErr; + short dfRefNum; + + data = EncodeMacbinary(file); + + if(data) + { + if(file->name[0] > 27) + file->name[0] = 27; + + PtoCstr(file->name); + strcat((char*)file->name, ".bin"); + CtoPstr((char *)file->name); + + FSpDelete(file); + if(FSpCreate(file, 'dMB3', 'mBIN', smSystemScript) == noErr) + { + err = FSpOpenDF(file, fsWrPerm, &dfRefNum); + if(err == noErr) + { + long inOutCount = GetHandleSize(data); + + HLock(data); + err = FSWrite(dfRefNum,&inOutCount,*data); + HUnlock(data); + FSClose(dfRefNum); + } + } + DisposeHandle(data); + } + return err; +} + + + + + +static Handle EncodeMacbinary(FSSpec *file) +{ + Handle result = nil; + FInfo fndrInfo; + FXInfo fndrXInfo; + OSErr err; + CInfoPBRec pb; + short dfRefNum, rfRefNum; + long ioCount; + char buffer[128]; + char header[128]; + char comment[256]; + long resourceForkLength, dataForkLength, commentLength; + + memset(&header, 0, sizeof(header)); + err = FSpGetFInfo(file, &fndrInfo); + + memset(&pb, 0, sizeof(CInfoPBRec)); + pb.hFileInfo.ioNamePtr = file->name; + pb.hFileInfo.ioVRefNum = file->vRefNum; + pb.hFileInfo.ioFDirIndex = 0; //query a file + pb.hFileInfo.ioDirID = file->parID; + err = PBGetCatInfo(&pb,false); + + fndrXInfo = pb.hFileInfo.ioFlXFndrInfo; + + BYTE_AT_OFFSET(header, kFileNameLengthOffset) = file->name[0]; + BlockMoveData( &(file->name[1]), + PTR_AT_OFFSET(header, + kFileNameOffset), + file->name[0]); + LONG_AT_OFFSET(header, kFileTypeOffset) = fndrInfo.fdType; + LONG_AT_OFFSET(header, kFileCreatorOffset) = fndrInfo.fdCreator; + + BYTE_AT_OFFSET(header, kFinderFlagsHiOffset) = + (fndrInfo.fdFlags & 0xFF00) >> 8; + BYTE_AT_OFFSET(header, kFinderFlagsLowOffset) = + (fndrInfo.fdFlags & 0x00FF); + + WORD_AT_OFFSET(header, kFileVPositionOffset) = fndrInfo.fdLocation.v; + WORD_AT_OFFSET(header, kFileHPositionOffset) = fndrInfo.fdLocation.h; + WORD_AT_OFFSET(header, kFileFolderIDOffset) = fndrInfo.fdFldr; + + LONG_AT_OFFSET(header, kFileCreationDateOffset) = pb.hFileInfo.ioFlCrDat; + LONG_AT_OFFSET(header, kFileModificationDateOffset) = + pb.hFileInfo.ioFlMdDat; + + LONG_AT_OFFSET(header, kMacbinarySigOffset) = 'mBIN'; + BYTE_AT_OFFSET(header, kFilenameScriptOffset) = fndrXInfo.fdScript; + BYTE_AT_OFFSET(header, kExtendedFinderFlagsOffset) = fndrXInfo.fdXFlags; + + LONG_AT_OFFSET(header, kTotalFileLengthOffset) = 0; + WORD_AT_OFFSET(header, kSecondaryHeaderLengthOffset) = 0; + + WORD_AT_OFFSET(header, kCurrentVersionOffset) = 130; + WORD_AT_OFFSET(header, kMinimumVersionOffset) = 129; + + err = FSpOpenDF(file,fsRdPerm,&dfRefNum); + if(err == noErr) + { + err = GetEOF(dfRefNum,&dataForkLength); + LONG_AT_OFFSET(header, kDataForkLengthOffset) = dataForkLength; + } + else + { + dfRefNum = 0; + } + + err = FSpOpenRF(file,fsRdPerm,&rfRefNum); + if(err == noErr) + { + err = GetEOF(rfRefNum,&resourceForkLength); + LONG_AT_OFFSET(header, kResourceForkLengthOffset) = resourceForkLength; + } + else + { + rfRefNum = 0; + } + + memset(comment, 0, 256); + if(GetDesktopComment(file, comment, &commentLength) != noErr) + commentLength = 0; + + WORD_AT_OFFSET(header, kGetInfoCommentLengthOffset) = commentLength; + WORD_AT_OFFSET(header, kCRCOffset) = + crc32( 0, (unsigned char*) &header, 124); + + result = TempNewHandle(0, &err); + if(result) + { + err = PtrAndHand(&header,result,128); + + if(dfRefNum && dataForkLength) + { + err = noErr; + while(dataForkLength > 0 && err == noErr) + { + ioCount = 128; + err = FSRead(dfRefNum,&ioCount,&buffer); + + if(err == noErr || err == eofErr) + err = PtrAndHand(&buffer,result,128); + + dataForkLength -= ioCount; + } + } + + if(rfRefNum && resourceForkLength) + { + err = noErr; + while(resourceForkLength > 0 && err == noErr) + { + ioCount = 128; + err = FSRead(rfRefNum,&ioCount,&buffer); + + if(err == noErr || err == eofErr) + err = PtrAndHand(&buffer,result,128); + + resourceForkLength -= ioCount; + } + } + + if(commentLength) + { + PtrAndHand(&comment,result,commentLength); + } + } + + if(rfRefNum) + FSClose(rfRefNum); + + if(dfRefNum) + FSClose(dfRefNum); + + return result; +} + +#endif /* INCLUDE_ENCODE_MACBINARY */ + + + +#ifdef INCLUDE_DECODE_MACBINARY + +static OSErr SetDesktopComment(FSSpec *file, char*comment, long length) +{ + DTPBRec pb; + OSErr err; + + pb.ioCompletion = nil; + pb.ioNamePtr = NULL; + pb.ioVRefNum = file->vRefNum; + + err = PBDTGetPath(&pb); + + if(err == noErr) + { + pb.ioNamePtr = file->name; + pb.ioDTBuffer = comment; + pb.ioDirID = file->parID; + pb.ioDTReqCount = length; + err = PBDTSetComment(&pb, false); + } + return err; +} + + + + +OSErr DecodeMacBinaryFile(FSSpec *source) +{ + Handle data = nil; + OSErr err; + short dfRefNum = 0; + long size; + FSSpec McBin_source; + + memcpy(McBin_source.name,source->name,source->name[0]+1); + McBin_source.vRefNum = source->vRefNum; + McBin_source.parID = source->parID; + + err = FSpOpenDF(source, fsRdPerm, &dfRefNum); + if(!err) + { + err = GetEOF(dfRefNum, &size); + + data = TempNewHandle(size, &err); + + if(data) + { + HLock(data); + err = FSRead(dfRefNum,&size,*data); + HUnlock(data); + } + FSClose(dfRefNum); + } + + if(data && err == noErr) + { + err = DecodeMacBinary(data, source); + DisposeHandle(data); + } + +#ifdef DELETE_MACBINARY_SOURCE + if (err == noErr) + err = FSpDelete(&McBin_source); +#endif + + return err; +} + + + + + +static OSErr DecodeMacBinary(Handle data, FSSpec *destination) +{ + Handle result = nil; + FInfo fndrInfo; + OSErr err; + CInfoPBRec pb; + short dfRefNum, rfRefNum; + long ioCount; + char header[128]; + char comment[256]; + long resourceForkLength, dataForkLength, commentLength; + Boolean isMacBinaryFile = false; + short headerEnd = 128; + long rfOffset; + long maxDataLen; + + memset(&pb, 0, sizeof(CInfoPBRec)); + pb.hFileInfo.ioNamePtr = destination->name; + pb.hFileInfo.ioVRefNum = destination->vRefNum; + pb.hFileInfo.ioFDirIndex = 0; /* query a file */ + pb.hFileInfo.ioDirID = destination->parID; + err = PBGetCatInfo(&pb,false); + maxDataLen = pb.hFileInfo.ioFlLgLen; + + HLock(data); + memcpy(header, *data, 128); + + /* already checked with FSpIsMacBinary() */ + isMacBinaryFile = HeaderIsMacBinary(header, nil, maxDataLen);; + + if(!isMacBinaryFile) + return paramErr; + + if(WORD_AT_OFFSET(header, kSecondaryHeaderLengthOffset)) + { + headerEnd = WORD_AT_OFFSET(header, kSecondaryHeaderLengthOffset); + headerEnd = (headerEnd + 127) & ~127L; + } + + resourceForkLength = LONG_AT_OFFSET(header, kResourceForkLengthOffset); + dataForkLength = LONG_AT_OFFSET(header, kDataForkLengthOffset); + commentLength = WORD_AT_OFFSET(header, kGetInfoCommentLengthOffset); + + memcpy( destination->name, + PTR_AT_OFFSET(header, + kFileNameLengthOffset), + BYTE_AT_OFFSET(header, + kFileNameLengthOffset)); + + fndrInfo.fdType = LONG_AT_OFFSET(header, kFileTypeOffset); + fndrInfo.fdCreator = LONG_AT_OFFSET(header, kFileCreatorOffset); + + fndrInfo.fdFlags = BYTE_AT_OFFSET(header, kFinderFlagsHiOffset); + fndrInfo.fdFlags << 8; + fndrInfo.fdFlags |= BYTE_AT_OFFSET(header, kFinderFlagsLowOffset); + + fndrInfo.fdLocation.v = WORD_AT_OFFSET(header, kFileVPositionOffset); + fndrInfo.fdLocation.h = WORD_AT_OFFSET(header, kFileHPositionOffset); + fndrInfo.fdFldr = WORD_AT_OFFSET(header, kFileFolderIDOffset); +/* + index = 1; + checkFile = *destination; + while(FSpExists(&checkFile)) + { + checkFile = *destination; + + if(index < 10) + checkFile.name[++checkFile.name[0]] = '0' + index; + else + checkFile.name[++checkFile.name[0]] = ('a' - 10) + index; + index++; + } + *destination = checkFile; +*/ + err = FSpCreate(destination, + fndrInfo.fdCreator, + fndrInfo.fdType, + smSystemScript); + + dfRefNum = 0; + if(err == noErr) + { + err = FSpOpenDF(destination, fsRdWrPerm, &dfRefNum); + } + + if(err == noErr && dfRefNum) + { + ioCount = dataForkLength; + err = FSWrite(dfRefNum,&ioCount,*data + headerEnd); + FSClose(dfRefNum); + } + + rfRefNum = 0; + if(err == noErr) + { + err = FSpOpenRF(destination, fsRdWrPerm, &rfRefNum); + } + + rfOffset = headerEnd + dataForkLength; + rfOffset = (rfOffset + 127) & ~127L; + + if(err == noErr && rfRefNum) + { + ioCount = resourceForkLength; + err = FSWrite(rfRefNum,&ioCount,*data + rfOffset); + FSClose(rfRefNum); + } + + rfOffset += resourceForkLength; + rfOffset = (rfOffset + 127) & ~127L; + + if(err == noErr) + { + FSpSetFInfo(destination,&fndrInfo); + + memset(&pb, 0, sizeof(CInfoPBRec)); + pb.hFileInfo.ioNamePtr = destination->name; + pb.hFileInfo.ioVRefNum = destination->vRefNum; + pb.hFileInfo.ioFDirIndex = 0; /* query a file */ + pb.hFileInfo.ioDirID = destination->parID; + err = PBGetCatInfo(&pb,false); + + if(err == noErr) + { + pb.hFileInfo.ioDirID = destination->parID; + pb.hFileInfo.ioFlCrDat = + LONG_AT_OFFSET(header, kFileCreationDateOffset); + pb.hFileInfo.ioFlMdDat = + LONG_AT_OFFSET(header, kFileModificationDateOffset); + pb.hFileInfo.ioFlXFndrInfo.fdXFlags = + BYTE_AT_OFFSET(header, kExtendedFinderFlagsOffset); + pb.hFileInfo.ioFlXFndrInfo.fdScript = + BYTE_AT_OFFSET(header, kFilenameScriptOffset); + err = PBSetCatInfo(&pb, false); + } + + if(commentLength) + { + memcpy(comment,*data + rfOffset, commentLength); + SetDesktopComment(destination, comment, commentLength); + } + + } + HUnlock(data); + return err; +} + +#endif /* INCLUDE_DECODE_MACBINARY */ + + + + +const char *BOINC_RCSID_96de42feda = "$Id: macbin3.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macbin3.h boinc-7.0.14+dfsg/zip/unzip/macos/source/macbin3.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macbin3.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macbin3.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,153 @@ +#ifndef __MCBINIII_H__ +#define __MCBINIII_H__ + + +/**************************************************************** + MacBinaryIII.h + + Copyright 1997 Christopher Evans (cevans@poppybank.com) + + Basic encoding and decoding of Macintosh files to the + MacBinary III spec. +****************************************************************/ + + +/* +-------------------------------------------------------------------- +This source is copyrighted by Christopher Evans (cevans@poppybank.com) +(available at ftp://ftp.lazerware.com/MacBinaryIII_src_C.sit + homepage of Leonard Rosenthol leonardr@netcom.com) + + + +I made the following changes: + * renamed files MacBinaryIII.h / MacBinaryIII.c to + macbin3.c / macbin3.h + * removed pragmas: + #pragma once + #pragma options align=mac68k + * added 5 macros to make the migration into other projects easier: + DELETE_MACBINARY_SOURCE -> delete the macbinary file after + decoding + INCLUDE_ENCODE_MACBINARY -> include the encode-part of the source + INCLUDE_DECODE_MACBINARY -> include the decode-part of the source + INCLUDE_CRC32CALC -> include the CRC32 calculation + TRACE_MACBINARY -> produce some diagnostic printouts + * changed the source layout to fit into a 80 col window + * removed non-ASCII characters from the sources + * renamed the function CalculateCRC() to crc32() and changed + the order of the arguments. So the crc32() func of the InfoZip + package can be used instead. + * moved module specific macros and protos to the mcbiniii.c + * added comments and enhanced the documention of the MacBinary Spec + * changed definition crc_table[] from short to unsigned long. + * improved the HeaderIsMacBinary() function to be more restrictive + +The specification says: + "Offsets 83 and 87, Long Word, (the length of the forks) + should be in the range of 0-$007FFFFF " +However, I do not understand the reason of this range. The data fork +can be much larger than $007FFFFF ( 2 Gigabytes! ) and the size of the +resource fork can be until 16 MByte. ZipIt and Stuffit seems to be +ignore this limit. +I changed this limit (see kResourceForkMaxLen), and I removed the +maximum check of the data fork. + +Dirk Haase (d_haase@sitec.de); 05.Dec.1998 + +-------------------------------------------------------------------- + + + +MacBinary III + +MacBinary is a standard format for binary transfer of arbitrary Macintosh +documents via a telecommunication link. It is intended for use both between +Macintoshes and for use in uploading arbitrary Macintosh documents to remote +systems (where it is presumed that they will be stored as an exact image of +the data transmitted). It does this by combing both the resource and data +forks (as well as the "Finder Info") of a standard Macintosh file into a +single data fork only file that can be stored on non-Macintosh machines. + + +The format of the header for MacBinary III is as follows: + Offset Length Contents + 000 Byte old version number, must be kept at zero for + compatibility + 001 Byte Length of filename (must be in the range 1-31) + 002 1 to 63 Bytes filename (only "length" bytes are significant). + 065 Long Word file type (normally expressed as four characters) + 069 Long Word file creator (normally expressed as four + characters) + 073 Byte original Finder flags + Bit 7 - isAlias. + Bit 6 - isInvisible. + Bit 5 - hasBundle. + Bit 4 - nameLocked. + Bit 3 - isStationery. + Bit 2 - hasCustomIcon. + Bit 1 - reserved. + Bit 0 - hasBeenInited. + 074 Byte zero fill, must be zero for compatibility + 075 Word file's vertical position within its window. + 077 Word file's horizontal position within its window. + 079 Word file's window or folder ID. + 081 Byte "Protected" flag (in low order bit). + 082 Byte zero fill, must be zero for compatibility + 083 Long Word Data Fork length (bytes, zero if no Data Fork). + 087 Long Word Resource Fork length (bytes, zero if no R.F.). + 091 Long Word File's creation date + 095 Long Word File's "last modified" date. + 099 Word length of Get Info comment to be sent after the + resource fork (if implemented, see below). + 101 Byte Finder Flags, bits 0-7. (Bits 8-15 are already in + byte 73) + Bit 7 - hasNoInits + Bit 6 - isShared + Bit 5 - requiresSwitchLaunch + Bit 4 - ColorReserved + Bits 1-3 - color + Bit 0 - isOnDesk + *102 Long Word signature for indentification purposes ('mBIN') + *106 Byte script of file name (from the fdScript field of an + fxInfo record) + *107 Byte extended Finder flags (from the fdXFlags field of + an fxInfo record) + 108-115 Unused (must be zeroed by creators, must be + ignored by readers) + 116 Long Word Length of total files when packed files are + unpacked. As of the writing of this document, this + field has never been used. + 120 Word Length of a secondary header. If this is non-zero, + skip this many bytes (rounded up to the next + multiple of 128). This is for future expansion + only, when sending files with MacBinary, this word + should be zero. + *122 Byte Version number of MacBinary III that the uploading + program is written for (the version is 130 for + MacBinary III) + 123 Byte Minimum MacBinary version needed to read this file + (set this value at 129 for backwards compatibility + with MacBinary II) + 124 Word CRC of previous 124 bytes + +*These fields have changed for MacBinary III. + + All values are stored in normal 68000 order, with Most Significant Byte +appearing first then the file. Any bytes in the header not defined above +should be set to zero. + +*/ + + +/* +Public functions +*/ + +OSErr EncodeMacbinaryFile(FSSpec *file); +OSErr DecodeMacBinaryFile(FSSpec *source); +Boolean FSpIsMacBinary(FSSpec *file); + + +#endif + diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/maccfg.h boinc-7.0.14+dfsg/zip/unzip/macos/source/maccfg.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/maccfg.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/maccfg.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,258 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + MACOS specific configuration and declarations: + ---------------------------------------------------------------------------*/ + +#ifndef __maccfg_h +#define __maccfg_h + + +/*****************************************************************************/ +/* Macros, missing RTL declarations, compatibility typedefs */ +/*****************************************************************************/ + + +#if defined(__MWERKS__) && defined(macintosh) +# include + + typedef unsigned long mode_t; +# define _STAT + +# if (defined(MacStaticLib) || defined(USE_SIOUX)) +# define MAIN UZ_EXP UzpMain /* was UzpUnzip */ +# else +# define MAIN _dummy_main +# endif +#endif + +#ifdef THINK_C +# ifndef __STDC__ /* if Think C hasn't defined __STDC__ ... */ +# define __STDC__ 1 /* make sure it's defined: it needs it */ +# else +# if !__STDC__ /* sometimes __STDC__ is defined as 0; */ +# undef __STDC__ /* it needs to be 1 or required header */ +# define __STDC__ 1 /* files are not properly included. */ +# endif /* !__STDC__ */ +# endif +# define IOCompletionUPP ProcPtr +# define CREATOR 'KAHL' +# define MAIN _dummy_main +#endif /* THINK_C */ + +#ifdef MPW +# include +# include +# include +# include +# include +# ifndef QUERY_TRNEWLN +# define QUERY_TRNEWLN +# endif +# ifdef fileno +# undef fileno +# endif +# ifdef MCH_MACINTOSH +# define CREATOR 'Manx' +# else +# define CREATOR 'MPS ' +# endif +#endif /* MPW */ + +#include /* O_BINARY for open() w/o CR/LF translation */ +#define fileno(x) ((x) == stdout ? 1 : ((x) == stderr ? 2 : (short)(x))) +#define open macopen +#define close macclose +#define fclose(x) macclose(fileno((x))) +#define read macread +#define write macwrite +#define lseek maclseek +#define creat(x,y) maccreat((x)) +#define stat UZmacstat +#define lstat UZmacstat +#define dup +#ifndef MCH_MACINTOSH +# define NO_STRNICMP +#endif + +#define DIR_END ':' +#ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY +#endif +#define lenEOL 1 +#define PutNativeEOL *q++ = native(CR); +#define NOANSIFILT /* MWRKS C creates broken code for the ANSI-ESC filter */ +#define MALLOC_WORK +#define INT_SPRINTF + +#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) +# define USE_EF_UT_TIME +#endif + +#undef IZ_CHECK_TZ +#undef MORE +#undef DYNAMIC_CRC_TABLE + + +#ifndef MPW +# ifndef MacStaticLib +# ifndef USE_SIOUX +# define fgets macfgets +# define fflush(f) +# define fprintf macfprintf +# define fputs(s,f) macfprintf((f), "%s", (s)) +# define printf macprintf +# ifdef putc +# undef putc +# endif +# define putc(c,f) macfprintf((f), "%c", (c)) +# endif /* !USE_SIOUX */ +# else +# ifdef putc +# undef putc +# endif +# define putc(c,f) fprintf((f), "%c", (c)) +# endif + +# define isatty(f) (((f) >= 0) || ((f) <= 2)) +#endif + +#ifndef isascii +# define isascii(c) ((unsigned char)(c) <= 0x3F) +#endif + +#include "macstat.h" +#include "macdir.h" + +#ifdef CR +# undef CR +#endif + + +#ifdef foreign +# undef foreign +#endif +#define foreign(c) ((c) & 0x80 ? MacRoman_to_WinCP1252[(c) & 0x7f] : (c)) + +#ifdef native +# undef native +#endif +#define native(c) ((c) & 0x80 ? WinCP1252_to_MacRoman[(c) & 0x7f] : (c)) +#define NATIVE "MacRoman charset" + +#ifdef _ISO_INTERN +# undef _ISO_INTERN +#endif +#define _ISO_INTERN(str1) {register uch *p;\ + for (p=(uch *)(str1); *p; p++)\ + *p = (*p & 0x80) ? WinCP1252_to_MacRoman[*p & 0x7f] : *p;} + +#ifdef _OEM_INTERN +# undef _OEM_INTERN +#endif +#ifndef IZ_OEM2ISO_ARRAY +# define IZ_OEM2ISO_ARRAY +#endif +#define _OEM_INTERN(str1) {register uch *p;\ + for (p=(uch *)(str1); *p; p++)\ + *p = (*p & 0x80) ? WinCP1252_to_MacRoman[oem2iso[*p & 0x7f]] : *p;} + +#ifdef __FILEIO_C /* get the ISO8859-1 <--> MacROMAN conversion tables */ +# include "charmap.h" +#else + extern ZCONST uch WinCP1252_to_MacRoman[128]; + extern ZCONST uch MacRoman_to_WinCP1252[128]; +#endif + + +#define EB_M3_FL_NOCHANGE 0x02 /* filename will be not changed */ +/* other EB_M3 flags are defined in unzpriv.h */ +#define EB_MAC3_SIZE (EB_HEADSIZE + EB_MAC3_HLEN) + +/*****************************************************************************/ +/* Structure typedefs */ +/*****************************************************************************/ + +typedef struct _ZipExtraHdr { + ush header; /* 2 bytes */ + ush data; /* 2 bytes */ +} ZIP_EXTRA_HEADER; + + +/* the following structure is a combination of the old and the new + extra-field definition; so it's *not* the definition of the extra-field */ + +typedef struct _MacInfo { + unsigned char *filename; /* for ZipIt ef */ + ush header; /* tag for this extra block type */ + ush data; /* total data size for this block */ + ulg size; /* uncompressed finder attribute data size */ + + ush flags; /* info bits: + bit 0 if set, file is a data fork + bit 1 if set, filename will be not changed + bit 2 if set, Attribs is uncompressed + bit 3 if set, date and times are in 64 bit; + if zero, date and times are in 32 bit + bit 4 if set, "local time - UTC" offsets are + omitted + bits 5-15 reserved; not tested; */ + + ush CompType; + ulg CRCvalue; + + CInfoPBRec fpb; /* Macintosh FInfo / FXInfo structure */ + long Cr_UTCoffs; /* difference "local time - UTC" for Creat-time */ + long Md_UTCoffs; /* difference "local time - UTC" for Modif-time */ + long Bk_UTCoffs; /* difference "local time - UTC" for Bckup-time */ + + short TextEncodingBase; /* TextEncodingBase (Charset) */ + char *FullPath; /* Path of the current file */ + char *FinderComment; /* Finder Comment of current file */ +} MACINFO; + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +#define SYSTEM_SPECIFIC_GLOBALS \ + short giCursor;\ + CursHandle rghCursor[4]; /* status cursors */ + +#define SYSTEM_SPECIFIC_CTOR MacGlobalsInit + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +void screenOpen OF((char *)); /* macscreen.c */ +void screenControl OF((char *, int)); /* macscreen.c */ +void screenDump OF((char *, long)); /* macscreen.c */ +void screenUpdate OF((WindowPtr)); /* macscreen.c */ +void screenClose OF((void)); /* macscreen.c */ +int macgetch OF((void)); /* macscreen.c */ + +int macmkdir OF((char *)); /* macos.c */ +short macopen OF((char *, short)); /* macos.c */ +short maccreat OF((char *)); /* macos.c */ +short macread OF((short, char *, unsigned)); /* macos.c */ +long macwrite OF((short, char *, unsigned)); /* macos.c */ +short macclose OF((short)); /* macos.c */ +long maclseek OF((short, long, short)); /* macos.c */ +char *macfgets OF((char *, int, FILE *)); /* macos.c */ +int macfprintf OF((FILE *, char *, ...)); /* macos.c */ +int macprintf OF((char *, ...)); /* macos.c */ + +ulg makePPClong(ZCONST uch *sig); +ush makePPCword(ZCONST uch *b); +void UserStop(void); + +#endif /* !__maccfg_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macdir.c boinc-7.0.14+dfsg/zip/unzip/macos/source/macdir.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macdir.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macdir.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,171 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + macdir.c + + * This file provides dirent-style directory-reading procedures + * for V7 Unix systems that don't have such procedures. + * + * + ---------------------------------------------------------------------------*/ + + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "macdir.h" +#include "helpers.h" +#include "pathname.h" + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +int closedir(DIR *dPtr) +{ + free(dPtr); + + return 0; +} + + +DIR *opendir(char *dirName) +{ + int fullPath; + unsigned pathLen; + char *s; + HParamBlockRec hPB; + CInfoPBRec cPB; + DIR *dPtr; + OSErr err; + FSSpec spec; + char CompletePath[NAME_MAX]; + + GetCompletePath(CompletePath, dirName, &spec, &err); + printerr("GetCompletePath", err, err, __LINE__, __FILE__, dirName); + + if (dirName == NULL || *dirName == '\0' || + (pathLen = strlen(dirName)) >= 256) { + errno = EINVAL; + return NULL; + } + + + /* Get information about volume. */ + memset(&hPB, '\0', sizeof(hPB)); + + if (((s = strchr(dirName, ':')) == NULL) || (*dirName == ':')) { + fullPath = false; + } else { + *(s + 1) = '\0'; + hPB.volumeParam.ioVolIndex = -1; + fullPath = true; + } + + hPB.volumeParam.ioNamePtr = spec.name; + + err = PBHGetVInfoSync(&hPB); + + if ((err != noErr) || (hPB.volumeParam.ioVFSID != 0)) { + errno = ENOENT; + return NULL; + } + + /* Get information about file. */ + + memset(&cPB, '\0', sizeof(cPB)); + + if (fullPath) + cPB.hFileInfo.ioVRefNum = hPB.volumeParam.ioVRefNum; + + cPB.hFileInfo.ioNamePtr = spec.name; + + err = PBGetCatInfoSync(&cPB); + + if (err != noErr) { + errno = (err == fnfErr) ? ENOENT : EIO; + return NULL; + } + + if (!(cPB.hFileInfo.ioFlAttrib & ioDirMask)) { + errno = ENOTDIR; + return NULL; + } + + /* Get space for, and fill in, DIR structure. */ + + if ((dPtr = (DIR *)malloc(sizeof(DIR))) == NULL) { + return NULL; + } + + dPtr->ioVRefNum = cPB.dirInfo.ioVRefNum; + dPtr->ioDrDirID = cPB.dirInfo.ioDrDirID; + dPtr->ioFDirIndex = 1; + dPtr->flags = 0; + + return dPtr; +} + + +struct dirent *readdir(DIR *dPtr) +{ + struct dirent *dirPtr; + CInfoPBRec cPB; + char name[256]; + OSErr err; + + if (dPtr->flags) { + return NULL; + } + + /* Get information about file. */ + + memset(&cPB, '\0', sizeof(cPB)); + + cPB.hFileInfo.ioNamePtr = (StringPtr)name; + cPB.hFileInfo.ioFDirIndex = dPtr->ioFDirIndex; + cPB.hFileInfo.ioVRefNum = dPtr->ioVRefNum; + cPB.hFileInfo.ioDirID = dPtr->ioDrDirID; + + err = PBGetCatInfoSync(&cPB); + + if (err != noErr) { + dPtr->flags = 0xff; + errno = (err == fnfErr) ? ENOENT : EIO; + return NULL; + } + + p2cstr((StringPtr)name); + + dirPtr = &dPtr->currEntry; + + dirPtr->d_fileno = dPtr->ioFDirIndex++; + dirPtr->d_namlen = strlen(name); + strcpy(dirPtr->d_name, name); + dirPtr->d_reclen = sizeof(struct dirent) - sizeof(dirPtr->d_name) + + dirPtr->d_namlen; + + return dirPtr; +} + +const char *BOINC_RCSID_ce8da9987d = "$Id: macdir.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macdir.h boinc-7.0.14+dfsg/zip/unzip/macos/source/macdir.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macdir.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macdir.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,62 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/***************************************************************** + * + * dirent.h + * + *****************************************************************/ + +#ifndef __DIRENT_H +#define __DIRENT_H + +#include + +#ifndef EINVAL +#define EINVAL 9 +#endif + +#ifndef EIO +#define EIO 10 +#endif + +#ifndef ENOTDIR +#define ENOTDIR 20 +#endif + +#ifndef ENOENT +#define ENOENT 39 +#endif + +#ifndef NAME_MAX +#define NAME_MAX 1024 +#endif + +struct dirent { + unsigned long d_fileno; + short d_reclen; + short d_namlen; + char d_name[NAME_MAX + 1]; +}; + +typedef struct { + short ioFDirIndex; + short ioVRefNum; + long ioDrDirID; + short flags; + struct dirent currEntry; +} DIR; + +#define direct dirent + +DIR *opendir(char *); +struct dirent *readdir(DIR *); +void rewinddir(DIR *); +int closedir(DIR *); + +#endif /* !__DIRENT_H */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macos.c boinc-7.0.14+dfsg/zip/unzip/macos/source/macos.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macos.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macos.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1988 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + macos.c + + Macintosh-specific routines for use with Info-ZIP's UnZip 5.4 and later. + + Contains: + do_wild () + mapattr () + checkdir () + version () + macmkdir () + macopen () + maccreat () + macread () + macwrite () + macclose () + maclseek () + BuildMacFilename() + SetFinderInfo () + isMacOSexfield () + makePPClong () + makePPCword () + PrintMacExtraInfo () + GetExtraFieldData () + DecodeMac3ExtraField () + DecodeJLEEextraField () + PrintTextEncoding () + MacGlobalsInit () + + ---------------------------------------------------------------------------*/ + + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#define UNZIP_INTERNAL +#include "unzip.h" + +#include +#include + +#include "pathname.h" +#include "helpers.h" +#include "macstuff.h" +#include "mactime.h" +#include "macbin3.h" + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +/* disable ZipIt support +#define SwitchZIPITefSupportOff */ + +#define read_only file_attr /* for readability only */ +#define EB_MAX_OF_VARDATA 1300 /* max possible datasize of extra-field */ + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +/* Note: sizeof() returns the size of this allusion + 13 is current length of "XtraStuf.mac:" */ +extern const char ResourceMark[13]; /* var is initialized in file pathname.c */ + +Boolean MacUnzip_Noisy; /* MacUnzip_Noisy is also used by console */ + +MACINFO newExtraField; /* contains all extra-field data */ +short MacZipMode; + + +/*****************************************************************************/ +/* Module level Vars */ +/*****************************************************************************/ + +static const char MacPathEnd = ':'; /* the Macintosh dir separator */ + +static int created_dir; /* used in mapname(), checkdir() */ +static int renamed_fullpath; /* ditto */ +static FSSpec CurrentFile; + +static Boolean OpenZipFile = true; +static Boolean UseUT_ExtraField = false; +static Boolean IgnoreEF_Macfilename = false; +static short fileSystemID; + +static uch *attrbuff = NULL; +static uch *malloced_attrbuff = NULL; + +const short HFS_fileSystem = 0; + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +extern char *GetUnZipInfoVersions(void); + +static OSErr SetFinderInfo(FSSpec *spec, MACINFO *mi); +static Boolean GetExtraFieldData(short *MacZipMode, MACINFO *mi); +static uch *scanMacOSexfield(uch *ef_ptr, unsigned ef_len, + short *MacZipMode); +static Boolean isMacOSexfield(unsigned id, unsigned size, short *MacZipMode); +static void PrintMacExtraInfo(MACINFO *mi); +static OSErr SetFileTime(void); +static void DecodeMac3ExtraField(ZCONST uch *buff, MACINFO *mi); +static void DecodeJLEEextraField(ZCONST uch *buff, MACINFO *mi); +static void DecodeZPITextraField(ZCONST uch *buff, MACINFO *mi); +static char *PrintTextEncoding(short script); +static void BuildMacFilename(void); + +/*****************************************************************************/ +/* Constants (strings, etc.) */ +/*****************************************************************************/ + +static ZCONST char Far CannotCreateFile[] = "error: cannot create %s\n"; + +static ZCONST char Far OutOfMemEF[] = "Can't allocate memory to uncompress"\ + " file attributes.\n"; + +static ZCONST char Far ErrUncmpEF[] = "Error uncompressing file attributes.\n"; + +static ZCONST char Far No64Time[] = "Don't support 64 bit Timevalues; get "\ + " a newer version of MacZip \n"; + +static ZCONST char Far NoUniCode[] = "Don't support Unicoded Filenames; get"\ + " a newer version of MacZip\n"; + +static ZCONST char Far ZitIt_EF[] = "warning: found ZipIt extra field "\ + " -> file is probably not "\ + "usable!!\n"; + +static ZCONST char Far CantAllocateWildcard[] = + "warning: cannot allocate wildcard buffers\n"; + +static ZCONST char Far ErrNoTimeSet[] = "error (%d): cannot set the time for"\ + " %s\n"; + +static ZCONST char Far MacBinaryMsg[] = "\n ... decoding MacBinary "; + +static ZCONST char Far WarnDirTraversSkip[] = + "warning: skipped \"../\" path component(s) in %s\n"; + +static ZCONST char Far Creating[] = " creating: %s\n"; + +static ZCONST char Far ConversionFailed[] = + "mapname: conversion of %s failed\n"; + +static ZCONST char Far PathTooLong[] = "checkdir error: path too long: %s\n"; + +static ZCONST char Far CantCreateDir[] = "checkdir error: cannot create %s\n\ + unable to process %s.\n"; + +static ZCONST char Far DirIsntDirectory[] = + "checkdir error: %s exists but is not directory\n\ + unable to process %s.\n"; + +static ZCONST char Far PathTooLongTrunc[] = + "checkdir warning: path too long; truncating\n %s\n\ + -> %s\n"; + +static ZCONST char Far CantCreateExtractDir[] = + "checkdir: cannot create extraction directory: %s\n"; + +static ZCONST char Far FilenameToLong[] = + "Filename is to long; truncated: %s\n"; + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +#ifndef SFX + +/**********************/ +/* Function do_wild() */ /* for porting: dir separator; match(ignore_case) */ +/**********************/ + +char *do_wild(__G__ wildspec) + __GDEF + ZCONST char *wildspec; /* only used first time on a given dir */ +{ + static DIR *wild_dir = (DIR *)NULL; + static ZCONST char *wildname; + static char *dirname, matchname[FILNAMSIZ]; + static int notfirstcall=FALSE, have_dirname; + static unsigned long dirnamelen; + struct dirent *file; + + /* Even when we're just returning wildspec, we *always* do so in + * matchname[]--calling routine is allowed to append four characters + * to the returned string, and wildspec may be a pointer to argv[]. + */ + if (!notfirstcall) { /* first call: must initialize everything */ + notfirstcall = TRUE; + + /* Folder names must always end with a colon */ + if (uO.exdir[strlen(uO.exdir)-1] != ':') { + strcat(uO.exdir, ":"); + } + + MacUnzip_Noisy = !uO.qflag; + + if (MacUnzip_Noisy) printf("%s \n\n", GetUnZipInfoVersions()); + + /* break the wildspec into a directory part and a wildcard filename */ + if ((wildname = strrchr(wildspec, ':')) == (ZCONST char *)NULL) { + dirname = ":"; + dirnamelen = 1; + have_dirname = FALSE; + wildname = wildspec; + } else { + ++wildname; /* point at character after ':' */ + dirnamelen = wildname - wildspec; + if ((dirname = (char *)malloc(dirnamelen+1)) == (char *)NULL) { + Info(slide, 0x201, ((char *)slide, + LoadFarString(CantAllocateWildcard))); + strcpy(matchname, wildspec); + return matchname; /* but maybe filespec was not a wildcard */ + } + strncpy(dirname, wildspec, dirnamelen); + dirname[dirnamelen] = '\0'; /* terminate for strcpy below */ + have_dirname = TRUE; + } + + if ((wild_dir = opendir(dirname)) != (DIR *)NULL) { + while ((file = readdir(wild_dir)) != (struct dirent *)NULL) { + if (match(file->d_name, wildname, 0)) { /* 0 == case sens. */ + if (have_dirname) { + strcpy(matchname, dirname); + strcpy(matchname+dirnamelen, file->d_name); + } else + strcpy(matchname, file->d_name); + return matchname; + } + } + /* if we get to here directory is exhausted, so close it */ + closedir(wild_dir); + wild_dir = (DIR *)NULL; + } + + /* return the raw wildspec in case that works (e.g., directory not + * searchable, but filespec was not wild and file is readable) */ + strcpy(matchname, wildspec); + return matchname; + } + + /* last time through, might have failed opendir but returned raw wildspec */ + if (wild_dir == (DIR *)NULL) { + notfirstcall = FALSE; /* nothing left to try--reset for new wildspec */ + if (have_dirname) + free(dirname); + return (char *)NULL; + } + + /* If we've gotten this far, we've read and matched at least one entry + * successfully (in a previous call), so dirname has been copied into + * matchname already. + */ + while ((file = readdir(wild_dir)) != (struct dirent *)NULL) + if (match(file->d_name, wildname, 0)) { /* 0 == don't ignore case */ + if (have_dirname) { + /* strcpy(matchname, dirname); */ + strcpy(matchname+dirnamelen, file->d_name); + } else + strcpy(matchname, file->d_name); + return matchname; + } + + closedir(wild_dir); /* have read at least one entry; nothing left */ + wild_dir = (DIR *)NULL; + notfirstcall = FALSE; /* reset for new wildspec */ + if (have_dirname) + free(dirname); + return (char *)NULL; + +} /* end function do_wild() */ + +#endif /* !SFX */ + + + + + +/***************************/ +/* Function open_outfile() */ +/***************************/ + +int open_outfile(__G) /* return 1 if fail */ + __GDEF +{ + short outfd, fDataFork = true; + +#ifdef DLL + if (G.redirect_data) + return (redirect_outfile(__G) == FALSE); +#endif + Trace((stderr, "open_outfile: trying to open (%s) for writing\n", + FnFilter1(G.filename))); + + if (!uO.aflag) { + /* unknown type documents */ + /* all files are considered to be of type 'TEXT' and creator 'hscd' */ + /* this is the default type for CDROM ISO-9660 without Apple extensions */ + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdType = 'TEXT'; + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdCreator = 'hscd'; + } else { + /* unknown text-files defaults to 'TEXT' */ + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdType = 'TEXT'; + /* Bare Bones BBEdit */ + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdCreator = 'R*ch'; + } + + BuildMacFilename(); + + if (MacZipMode <= TomBrownZipIt2_EF) + { + fDataFork = true; + } + else + { + fDataFork = (newExtraField.flags & EB_M3_FL_DATFRK) ? TRUE : FALSE; + } + + + if ((outfd = maccreat(G.filename)) != -1) { + outfd = macopen(G.filename, (fDataFork) ? 1 : 2); + } + + if (outfd == -1) { + G.outfile = (FILE *)NULL; + Info(slide, 0x401, ((char *)slide, LoadFarString(CannotCreateFile), + FnFilter1(G.filename))); + return 1; + } + G.outfile = (FILE *)outfd; + Trace((stderr, "open_outfile: successfully opened (%s) for writing\n", + FnFilter1(G.filename))); + + return 0; + +} /* end function open_outfile() */ + + + + + +/**********************/ +/* Function mapattr() */ +/**********************/ + +int mapattr(__G) + __GDEF +{ + /* only care about read-only bit, so just look at MS-DOS side of attrs */ + G.pInfo->read_only = (unsigned)(G.crec.external_file_attributes & 1); + return 0; + +} /* end function mapattr() */ + + + + + +/************************/ +/* Function mapname() */ +/************************/ + +int mapname(__G__ renamed) + __GDEF + int renamed; +/* + * returns: + * MPN_OK - no problem detected + * MPN_INF_TRUNC - caution (truncated filename) + * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) + * MPN_ERR_SKIP - error -> skip entry + * MPN_ERR_TOOLONG - error -> path is too long + * MPN_NOMEM - error (memory allocation failed) -> skip entry + * [also MPN_VOL_LABEL, MPN_CREATED_DIR] + */ +{ + char pathcomp[FILNAMSIZ]; /* path-component buffer */ + char *pp, *cp=(char *)NULL; /* character pointers */ + char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */ + int quote = FALSE; /* flags */ + int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ + int error = MPN_OK; + register unsigned workch; /* hold the character being tested */ + + +/*--------------------------------------------------------------------------- + Initialize various pointers and counters and stuff. + ---------------------------------------------------------------------------*/ + + if (G.pInfo->vollabel) + return MPN_VOL_LABEL; /* can't set disk volume labels on Macintosh */ + + /* can create path as long as not just freshening, or if user told us */ + G.create_dirs = (!uO.fflag || renamed); + + created_dir = FALSE; /* not yet */ + + /* user gave full pathname: don't prepend rootpath */ + renamed_fullpath = (renamed && (*G.filename == '/')); + + if (checkdir(__G__ (char *)NULL, INIT) == MPN_NOMEM) + return MPN_NOMEM; /* initialize path buffer, unless no memory */ + + *pathcomp = '\0'; /* initialize translation buffer */ + pp = pathcomp; /* point to translation buffer */ + + if (uO.jflag) /* junking directories */ + cp = (char *)strrchr(G.filename, '/'); + if (cp == (char *)NULL) { /* no '/' or not junking dirs */ + cp = G.filename; /* point to internal zipfile-member pathname */ + if (renamed_fullpath) + ++cp; /* skip over leading '/' */ + } else + ++cp; /* point to start of last component of path */ + +/*--------------------------------------------------------------------------- + Begin main loop through characters in filename. + ---------------------------------------------------------------------------*/ + + while ((workch = (uch)*cp++) != 0) { + + if (quote) { /* if character quoted, */ + *pp++ = (char)workch; /* include it literally */ + quote = FALSE; + } else + switch (workch) { + case '/': /* can assume -j flag not given */ + *pp = '\0'; + if (((error = checkdir(__G__ pathcomp, APPEND_DIR)) & MPN_MASK) + > MPN_INF_TRUNC) + return error; + pp = pathcomp; /* reset conversion buffer for next piece */ + lastsemi = (char *)NULL; + /* leave directory semi-colons alone */ + break; + + case '.': + if (pp == pathcomp) { /* nothing appended yet... */ + if (*cp == '/') { /* don't bother appending "./" to */ + ++cp; /* the path: skip behind the '/' */ + break; + } else if (!uO.ddotflag && *cp == '.' && cp[1] == '/') { + /* "../" dir traversal detected */ + cp += 2; /* skip over behind the '/' */ + killed_ddot = TRUE; /* set "show message" flag */ + break; + } + } + *pp++ = '.'; + break; + + case ':': + *pp++ = '/'; /* ':' is a pathseperator for HFS */ + break; + + case ';': /* VMS version (or DEC-20 attrib?) */ + lastsemi = pp; /* keep for now; remove VMS ";##" */ + *pp++ = (char)workch; /* later, if requested */ + break; + + case '\026': /* control-V quote for special chars */ + quote = TRUE; /* set flag for next character */ + break; + + default: + /* allow European characters in filenames: */ + if (isprint(workch) || (128 <= workch && workch <= 254)) + *pp++ = (char)workch; + } /* end switch */ + + } /* end while loop */ + + /* Show warning when stripping insecure "parent dir" path components */ + if (killed_ddot && QCOND2) { + Info(slide, 0, ((char *)slide, LoadFarString(WarnDirTraversSkip), + FnFilter1(G.filename))); + if (!(error & ~MPN_MASK)) + error = (error & MPN_MASK) | PK_WARN; + } + +/*--------------------------------------------------------------------------- + Report if directory was created (and no file to create: filename ended + in '/'), check name to be sure it exists, and combine path and name be- + fore exiting. + ---------------------------------------------------------------------------*/ + + if (G.filename[strlen(G.filename) - 1] == '/') { + checkdir(__G__ G.filename, GETPATH); + if (created_dir) { + if (QCOND2) { + Info(slide, 0, ((char *)slide, LoadFarString(Creating), + FnFilter1(G.filename))); + } + /* set dir time (note trailing '/') */ + return (error & ~MPN_MASK) | MPN_CREATED_DIR; + } + /* dir existed already; don't look for data to extract */ + return (error & ~MPN_MASK) | MPN_INF_SKIP; + } + + *pp = '\0'; /* done with pathcomp: terminate it */ + + /* if not saving them, remove VMS version numbers (appended ";###") */ + if (!uO.V_flag && lastsemi) { + pp = lastsemi + 1; + while (isdigit((uch)(*pp))) + ++pp; + if (*pp == '\0') /* only digits between ';' and end: nuke */ + *lastsemi = '\0'; + } + + if (*pathcomp == '\0') { + Info(slide, 1, ((char *)slide, LoadFarString(ConversionFailed), + FnFilter1(G.filename))); + return (error & ~MPN_MASK) | MPN_ERR_SKIP; + } + + checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ + checkdir(__G__ G.filename, GETPATH); + + return error; + +} /* end function mapname() */ + + + + + +/***********************/ +/* Function checkdir() */ +/***********************/ + +int checkdir(__G__ pathcomp, flag) + __GDEF + char *pathcomp; + int flag; +/* + * returns: + * MPN_OK - no problem detected + * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename + * MPN_INF_SKIP - path doesn't exist, not allowed to create + * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path + * exists and is not a directory, but is supposed to be + * MPN_ERR_TOOLONG - path is too long + * MPN_NOMEM - can't allocate memory for filename buffers + */ +{ + static int rootlen = 0; /* length of rootpath */ + static char *rootpath; /* user's "extract-to" directory */ + static char *buildpath; /* full path (so far) to extracted file */ + static char *end; /* pointer to end of buildpath ('\0') */ + +# define FN_MASK 7 +# define FUNCTION (flag & FN_MASK) + + +/*--------------------------------------------------------------------------- + APPEND_DIR: append the path component to the path being built and check + for its existence. If doesn't exist and we are creating directories, do + so for this one; else signal success or error as appropriate. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == APPEND_DIR) { + int too_long = FALSE; +#ifdef SHORT_NAMES + char *old_end = end; +#endif + + Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); + while ((*end = *pathcomp++) != '\0') + ++end; +#ifdef SHORT_NAMES /* path components restricted to 14 chars, typically */ + if ((end-old_end) > NAME_MAX) + *(end = old_end + NAME_MAX) = '\0'; +#endif + + /* GRR: could do better check, see if overrunning buffer as we go: + * check end-buildpath after each append, set warning variable if + * within 20 of FILNAMSIZ; then if var set, do careful check when + * appending. Clear variable when begin new path. */ + + if ((end-buildpath) > NAME_MAX-3) /* need ':', one-char name, '\0' */ + too_long = TRUE; /* check if extracting directory? */ + if (stat(buildpath, &G.statbuf)) { /* path doesn't exist */ + if (!G.create_dirs) { /* told not to create (freshening) */ + free(buildpath); + return MPN_INF_SKIP; /* path doesn't exist: nothing to do */ + } + if (too_long) { + Info(slide, 1, ((char *)slide, LoadFarString(PathTooLong), + FnFilter1(buildpath))); + free(buildpath); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + if (macmkdir(buildpath) == -1) { /* create the directory */ + Info(slide, 1, ((char *)slide, LoadFarString(CantCreateDir), + FnFilter2(buildpath), FnFilter1(G.filename))); + free(buildpath); + /* path didn't exist, tried to create, failed */ + return MPN_ERR_SKIP; + } + created_dir = TRUE; + } else if (!S_ISDIR(G.statbuf.st_mode)) { + Info(slide, 1, ((char *)slide, LoadFarString(DirIsntDirectory), + FnFilter2(buildpath), FnFilter1(G.filename))); + free(buildpath); + /* path existed but wasn't dir */ + return MPN_ERR_SKIP; + } + if (too_long) { + Info(slide, 1, ((char *)slide, LoadFarString(PathTooLong), + FnFilter1(buildpath))); + free(buildpath); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + *end++ = ':'; + *end = '\0'; + Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath))); + return MPN_OK; + + } /* end if (FUNCTION == APPEND_DIR) */ + +/*--------------------------------------------------------------------------- + GETPATH: copy full path to the string pointed at by pathcomp, and free + buildpath. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == GETPATH) { + strcpy(pathcomp, buildpath); + Trace((stderr, "getting and freeing path [%s]\n", + FnFilter1(pathcomp))); + free(buildpath); + buildpath = end = (char *)NULL; + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + APPEND_NAME: assume the path component is the filename; append it and + return without checking for existence. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == APPEND_NAME) { +#ifdef SHORT_NAMES + char *old_end = end; +#endif + + Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); + while ((*end = *pathcomp++) != '\0') { + ++end; +#ifdef SHORT_NAMES /* truncate name at 14 characters, typically */ + if ((end-old_end) > NAME_MAX) + *(end = old_end + NAME_MAX) = '\0'; +#endif + if ((end-buildpath) >= NAME_MAX) { + *--end = '\0'; + Info(slide, 0x201, ((char *)slide, + LoadFarString(PathTooLongTrunc), + FnFilter1(G.filename), FnFilter2(buildpath))); + return MPN_INF_TRUNC; /* filename truncated */ + } + } + Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath))); + /* could check for existence here, prompt for new name... */ + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + INIT: allocate and initialize buffer space for the file currently being + extracted. If file was renamed with an absolute path, don't prepend the + extract-to path. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == INIT) { + Trace((stderr, "initializing buildpath to ")); + if ((buildpath = (char *)malloc(strlen(G.filename)+rootlen+2)) + == (char *)NULL) + return MPN_NOMEM; + if ((rootlen > 0) && !renamed_fullpath) { + strcpy(buildpath, rootpath); + end = buildpath + rootlen; + } else { + end = buildpath; + if (!renamed_fullpath && !uO.jflag) { + *end++ = ':'; /* indicate relative path */ + } + *end = '\0'; + } + Trace((stderr, "[%s]\n", FnFilter1(buildpath))); + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + ROOT: if appropriate, store the path in rootpath and create it if + necessary; else assume it's a zipfile member and return. This path + segment gets used in extracting all members from every zipfile specified + on the command line. + ---------------------------------------------------------------------------*/ + +#if (!defined(SFX) || defined(SFX_EXDIR)) + if (FUNCTION == ROOT) { + Trace((stderr, "initializing root path to [%s]\n", + FnFilter1pathcomp))); + if (pathcomp == (char *)NULL) { + rootlen = 0; + return MPN_OK; + } + if (rootlen > 0) /* rootpath was already set, nothing to do */ + return MPN_OK; + if ((rootlen = strlen(pathcomp)) > 0) { + char *tmproot; + + if ((tmproot = (char *)malloc(rootlen+2)) == (char *)NULL) { + rootlen = 0; + return MPN_NOMEM; + } + strcpy(tmproot, pathcomp); + if (tmproot[rootlen-1] == ':') { + tmproot[--rootlen] = '\0'; /* strip trailing delimiter */ + } + if (rootlen > 0 && (stat(tmproot, &G.statbuf) || + !S_ISDIR(G.statbuf.st_mode))) + { /* path does not exist */ + if (!G.create_dirs /* || iswild(tmproot) */ ) { + free(tmproot); + rootlen = 0; + /* skip (or treat as stored file) */ + return MPN_INF_SKIP; + } + /* create the directory (could add loop here scanning tmproot + * to create more than one level, but why really necessary?) */ + if (macmkdir(tmproot) == -1) { + Info(slide, 1, ((char *)slide, + LoadFarString(CantCreateExtractDir), + FnFilter1(tmproot))); + free(tmproot); + rootlen = 0; + /* path didn't exist, tried to create, and failed: */ + /* file exists, or 2+ subdir levels required */ + return MPN_ERR_SKIP; + } + } + tmproot[rootlen++] = ':'; + tmproot[rootlen] = '\0'; + if ((rootpath = (char *)realloc(tmproot, rootlen+1)) == NULL) { + free(tmproot); + rootlen = 0; + return MPN_NOMEM; + } + Trace((stderr, "rootpath now = [%s]\n", FnFilter1(rootpath))); + } + return MPN_OK; + } +#endif /* !SFX || SFX_EXDIR */ + +/*--------------------------------------------------------------------------- + END: free rootpath, immediately prior to program exit. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == END) { + Trace((stderr, "freeing rootpath\n")); + if (rootlen > 0) { + free(rootpath); + rootlen = 0; + } + return MPN_OK; + } + + return MPN_INVALID; /* should never reach */ + +} /* end function checkdir() */ + + + + + +/****************************/ +/* Function close_outfile() */ +/****************************/ + +void close_outfile(__G) + __GDEF +{ + OSErr err; + + if (fileno(G.outfile) == 1) + return; /* don't attempt to close or set time on stdout */ + + err = (OSErr)fclose(G.outfile); + + /* finally set FinderInfo */ + if (MacZipMode >= JohnnyLee_EF) + { + err = SetFinderInfo(&CurrentFile, &newExtraField); + printerr("close_outfile SetFinderInfo ", err, err, + __LINE__, __FILE__, G.filename); + } + else /* unknown extra field, set at least file time/dates */ + { + err = SetFileTime(); + } + +#ifndef SwitchZIPITefSupportOff + if ((MacZipMode == TomBrownZipIt1_EF) || + (MacZipMode == TomBrownZipIt2_EF)) + { + if(FSpIsMacBinary(&CurrentFile)) + { + Info(slide, 0, ((char *)slide, LoadFarString(MacBinaryMsg))); + err = DecodeMacBinaryFile(&CurrentFile); + printerr("close_outfile DecodeMacBinaryFile ", err, err, + __LINE__, __FILE__, G.filename); + } + } +#endif + + /* set read-only perms if needed */ + if ((err == noErr) && G.pInfo->read_only) + { + err = FSpSetFLock(&CurrentFile); + printerr("FSpSetFLock",err,err,__LINE__,__FILE__,G.filename); + } + + if (malloced_attrbuff != NULL) + { + attrbuff = malloced_attrbuff; + } + +} /* end function close_outfile() */ + + + + +/****************************/ +/* Function SetFileTime() */ +/****************************/ + +static OSErr SetFileTime(void) +{ +#ifdef USE_EF_UT_TIME + iztimes z_utime; + unsigned eb_izux_flg; +#endif + OSErr err; + CInfoPBRec fpb; + + fpb.hFileInfo.ioNamePtr = CurrentFile.name; + fpb.hFileInfo.ioVRefNum = CurrentFile.vRefNum; + fpb.hFileInfo.ioDirID = CurrentFile.parID; + fpb.hFileInfo.ioFDirIndex = 0; + + err = PBGetCatInfoSync((CInfoPBPtr)&fpb); + printerr("PBGetCatInfoSync", err, err, __LINE__, __FILE__, G.filename); + + if ((MacZipMode == UnKnown_EF) || UseUT_ExtraField ) { + +#ifdef USE_EF_UT_TIME + eb_izux_flg = ef_scan_for_izux(G.extra_field, G.lrec.extra_field_length, 0, + G.lrec.last_mod_dos_datetime, &z_utime, NULL); + + if (G.extra_field && (eb_izux_flg & EB_UT_FL_MTIME)) + { + fpb.hFileInfo.ioFlMdDat = UnixFtime2MacFtime(z_utime.mtime); + fpb.hFileInfo.ioFlCrDat = UnixFtime2MacFtime(z_utime.ctime); + } + +#ifdef DEBUG_TIME + { + struct tm *tp = gmtime(&z_utime.ctime); + printf( + "SetFileTime: Unix e.f. creat. time = %d/%2d/%2d %2d:%2d:%2d -> %lu UTC\n", + tp->tm_year, tp->tm_mon+1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, z_utime.ctime); + tp = gmtime(&z_utime.mtime); + printf( + "SetFileTime: Unix e.f. modif. time = %d/%2d/%2d %2d:%2d:%2d -> %lu UTC\n", + tp->tm_year, tp->tm_mon+1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec, z_utime.mtime); + } +#endif /* DEBUG_TIME */ + + + else /* no Unix time field found - use dostime */ +#endif /* !USE_EF_UT_TIME */ + { + TTrace((stderr, "SetFileTime: using DOS-Datetime ! \n", + z_utime.mtime)); + fpb.hFileInfo.ioFlMdDat = dos_to_unix_time(G.lrec.last_mod_dos_datetime); + UNIX_TO_MACOS(fpb.hFileInfo.ioFlMdDat); + fpb.hFileInfo.ioFlCrDat = fpb.hFileInfo.ioFlMdDat; + } + + /* Restore ioDirID field in pb which was changed by PBGetCatInfoSync */ + fpb.hFileInfo.ioDirID = CurrentFile.parID; + + if (err == noErr) + { + err = PBSetCatInfoSync((CInfoPBPtr)&fpb); + printerr("PBSetCatInfoSync",err,err,__LINE__,__FILE__,G.filename); + } + if (err != noErr) + Info(slide, 0x201, ((char *)slide, LoadFarString(ErrNoTimeSet), + FnFilter1(G.filename))); + } + +return err; +} /* end function SetFileTime() */ + + + + +#ifndef SFX + +/************************/ +/* Function version() */ +/************************/ + +void version(__G) + __GDEF +{ +/* +ZCONST char Far CompiledWith[] = + "Compiled with %s%s for %s%s%s%s.\n\n"; */ + +char DateTime[50]; + +#ifdef __MWERKS__ +char CompVer[10]; +sprintf(CompVer, "%x", __MWERKS__); +#endif + + sprintf(DateTime,"%s %s",__DATE__, __TIME__); + + sprintf((char *)slide, LoadFarString(CompiledWith), + +#ifdef __MWERKS__ + + " Metrowerks CodeWarrior version ",CompVer, +#else + " ", " ", +#endif + +#ifdef __MC68K__ + " MC68K Processor", +#else + " PowerPC Processor", +#endif + +#ifdef __DATE__ + + "\n compile time: ", DateTime, "" +#else + "", "", "" +#endif + ); + + (*G.message)((zvoid *)&G, slide, (ulg)strlen((char *)slide), 0); + +} /* end function version() */ + +#endif /* !SFX */ + + + + + +/***********************/ +/* Function macmkdir() */ +/***********************/ + +int macmkdir(char *path) +{ + OSErr err = -1; + OSErr err_rc; + char CompletePath[NAME_MAX], CompletePath2[NAME_MAX]; + Boolean isDirectory = false; + short CurrentFork; + unsigned pathlen; + long dirID; + + AssertStr(path, path) + + GetExtraFieldData(&MacZipMode, &newExtraField); + + if (MacZipMode >= JohnnyLee_EF) { + RfDfFilen2Real(CompletePath, G.filename, MacZipMode, + (newExtraField.flags & EB_M3_FL_NOCHANGE), &CurrentFork); + if (CurrentFork == ResourceFork) + /* don't build a 'XtraStuf.mac:' dir */ + return 0; + } + + if (!IgnoreEF_Macfilename) + { + pathlen = strlen(path); + strcpy(CompletePath, uO.exdir); + strcat(CompletePath, newExtraField.FullPath); + CompletePath[pathlen] = 0x00; + } + else + { + strcpy(CompletePath, path); + } + + GetCompletePath(CompletePath2, CompletePath, &CurrentFile, &err); + printerr("GetCompletePath", (err != -43) && (err != -120) && (err != 0), + err, __LINE__, __FILE__, CompletePath2); + + + err = FSpGetDirectoryID(&CurrentFile, &dirID, &isDirectory); + printerr("macmkdir FSpGetDirectoryID ", (err != -43) && (err != 0), + err, __LINE__, __FILE__, CompletePath2); + + if (err != -43) /* -43 = file/directory not found */ + return 0; + else { + HParamBlockRec hpbr; + + hpbr.fileParam.ioCompletion = NULL; + hpbr.fileParam.ioNamePtr = CurrentFile.name; + hpbr.fileParam.ioVRefNum = CurrentFile.vRefNum; + hpbr.fileParam.ioDirID = CurrentFile.parID; + err = PBDirCreateSync(&hpbr); + printerr("macmkdir PBDirCreateSync ", err, + err, __LINE__, __FILE__, CompletePath2); + + /* finally set FinderInfo */ + if (MacZipMode >= JohnnyLee_EF) + { + err_rc = SetFinderInfo(&CurrentFile, &newExtraField); + printerr("macmkdir SetFinderInfo ", err_rc, err_rc, + __LINE__, __FILE__, CompletePath2); + } + } + + return (int)err; +} /* macmkdir */ + + + + +/**********************/ +/* Function macopen() */ +/**********************/ + +short macopen(char *sz, short nFlags) +{ + OSErr err; + char chPerms = (!nFlags) ? fsRdPerm : fsRdWrPerm; + short nFRefNum; + + AssertStr(sz, sz) + + /* we only need the filespec of the zipfile; + filespec of the other files (to be extracted) will be + determined by open_outfile() */ + if (OpenZipFile) + { + char CompletePath[NAME_MAX]; + FSSpec zipfile; + GetCompletePath(CompletePath, sz, &zipfile, &err); + printerr("GetCompletePath", (err != -43) && (err != 0), + err, __LINE__, __FILE__, sz); + if (CheckMountedVolumes(CompletePath) > 1) + DoWarnUserDupVol(CompletePath); + err = HOpen(zipfile.vRefNum, zipfile.parID, zipfile.name, + chPerms, &nFRefNum); + printerr("Zipfile HOpen", err, err, __LINE__, __FILE__, sz); + OpenZipFile = false; + } + else /* open zipfile entries */ + { + if (nFlags > 1) + { + err = HOpenRF(CurrentFile.vRefNum, CurrentFile.parID, CurrentFile.name, + chPerms, &nFRefNum); + printerr("HOpenRF", (err != -43) && (err != 0) && (err != -54), + err, __LINE__, __FILE__, sz); + } + else + { + err = HOpen(CurrentFile.vRefNum, CurrentFile.parID, CurrentFile.name, + chPerms, &nFRefNum); + printerr("HOpen", (err != -43) && (err != 0), + err, __LINE__, __FILE__, sz); + } + } + + if ( err || (nFRefNum == 1) ) + { + printerr("macopen", err, err, __LINE__, __FILE__, + (char *) CurrentFile.name); + return -1; + } + else + { + if ( nFlags ) + SetEOF( nFRefNum, 0 ); + return nFRefNum; + } +} + + + + + +/***********************/ +/* Function maccreat() */ +/***********************/ + +short maccreat(char *sz) +{ + OSErr err; + char scriptTag = newExtraField.fpb.hFileInfo.ioFlXFndrInfo.fdScript; + static char Num = 0; + + sz = sz; + + /* Set fdScript in FXInfo + * The negative script constants (smSystemScript, smCurrentScript, + * and smAllScripts) don't make sense on disk. So only use scriptTag + * if scriptTag >= smRoman (smRoman is 0). + * fdScript is valid if high bit is set (see IM-6, page 9-38) + */ + scriptTag = (scriptTag >= smRoman) ? + ((char)scriptTag | (char)0x80) : (smRoman); + newExtraField.fpb.hFileInfo.ioFlXFndrInfo.fdScript = scriptTag; + + err = FSpCreate(&CurrentFile, + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdCreator, + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdType, + newExtraField.fpb.hFileInfo.ioFlXFndrInfo.fdScript); + + /* -37 = bad filename; make the filename shorter and try again */ + /* filename must not be longer than 32 chars */ + if (err == -37) + { + strcpy((char *)CurrentFile.name, + MakeFilenameShorter(P2CStr(CurrentFile.name))); + Info(slide, 0x401, ((char *)slide, LoadFarString(FilenameToLong), + FnFilter1((char *)CurrentFile.name))); + C2PStr((char *)CurrentFile.name); + err = FSpCreate(&CurrentFile, + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdCreator, + newExtraField.fpb.hFileInfo.ioFlFndrInfo.fdType, + newExtraField.fpb.hFileInfo.ioFlXFndrInfo.fdScript); + } + + err = printerr("FSpCreate maccreat ", (err != -48) && (err != 0), + err, __LINE__, __FILE__, G.filename); + + if (err == noErr) + return noErr; + else + return -1; +} + + + + + +/**********************/ +/* Function macread() */ +/**********************/ + +short macread(short nFRefNum, char *pb, unsigned cb) +{ + long lcb = cb; + + (void)FSRead( nFRefNum, &lcb, pb ); + return (short)lcb; +} + + + + +/***********************/ +/* Function macwrite() */ +/***********************/ + +long macwrite(short nFRefNum, char *pb, unsigned cb) +{ + long lcb = cb; + OSErr err; + FILE *stream; + + if ( (nFRefNum == 1) || (nFRefNum == 2) ) + { + stream = (nFRefNum == 1 ? stdout : stderr); + pb[cb] = '\0'; /* terminate C-string */ + /* assumes writable buffer (e.g., slide[]) */ + /* with room for one more char at end of buf */ + lcb = fprintf(stream, pb); + } + else + err = FSWrite( nFRefNum, &lcb, pb ); + + if (err != 0) + { + errno = ERANGE; + return -1; + } + + return (long)lcb; +} + + + + + +/***********************/ +/* Function macclose() */ +/***********************/ + +short macclose(short nFRefNum) +{ +OSErr err; + +err = FSClose( nFRefNum ); +printerr("macclose FSClose ",err,err, __LINE__,__FILE__,G.filename); + + +return err; +} + + + + + +/***********************/ +/* Function maclseek() */ +/***********************/ + +long maclseek(short nFRefNum, long lib, short nMode) +{ + ParamBlockRec pbr; + + if (nMode == SEEK_SET) + nMode = fsFromStart; + else if (nMode == SEEK_CUR) + nMode = fsFromMark; + else if (nMode == SEEK_END) + nMode = fsFromLEOF; + pbr.ioParam.ioRefNum = nFRefNum; + pbr.ioParam.ioPosMode = nMode; + pbr.ioParam.ioPosOffset = lib; + (void)PBSetFPosSync(&pbr); + return pbr.ioParam.ioPosOffset; +} + + + +static void BuildMacFilename(void) +{ +char CompletePath[NAME_MAX]; +char ArchiveDir[NAME_MAX]; +unsigned exdirlen = strlen(uO.exdir); +short CurrentFork; +OSErr err; + +GetExtraFieldData(&MacZipMode, &newExtraField); + +if (MacZipMode >= JohnnyLee_EF) + { + if (IgnoreEF_Macfilename) + { + strcpy(ArchiveDir, &G.filename[exdirlen+1]); + G.filename[exdirlen+1] = '\0'; + RfDfFilen2Real(ArchiveDir, ArchiveDir, MacZipMode, + (newExtraField.flags & EB_M3_FL_DATFRK), &CurrentFork); + strcat(G.filename, ArchiveDir); + } + else + { /* use the filename of mac extra-field */ + G.filename[exdirlen] = '\0'; /* cut resource-path */ + strcat(G.filename,newExtraField.FullPath); + } + } + +GetCompletePath(CompletePath, G.filename, &CurrentFile, &err); +printerr("GetCompletePath BuildMacFilename ", (err != -43) && (err != 0), + err, __LINE__, __FILE__, CompletePath); + +err = GetVolFileSystemID(C2PStr(CompletePath), CurrentFile.vRefNum, + &fileSystemID); +printerr("GetVolFileSystemID BuildMacFilename ", err, err, __LINE__, __FILE__, + CompletePath); + +if (MacZipMode == TomBrownZipIt1_EF) + { + memcpy(CurrentFile.name, newExtraField.filename, newExtraField.filename[0]+1); + CurrentFile.name[0] = CurrentFile.name[0] - 1; + } + +} + + + + +/* The following functions are dealing with the extra-field handling, only. */ + +/****************************/ +/* Function SetFinderInfo() */ +/****************************/ + +static OSErr SetFinderInfo(FSSpec *spec, MACINFO *mi) +{ + OSErr err; + CInfoPBRec fpb; + + fpb.hFileInfo.ioNamePtr = (StringPtr) &(spec->name); + fpb.hFileInfo.ioVRefNum = spec->vRefNum; + fpb.hFileInfo.ioDirID = spec->parID; + fpb.hFileInfo.ioFDirIndex = 0; + + err = PBGetCatInfoSync(&fpb); + printerr("PBGetCatInfo SetFinderInfo ", err, err, + __LINE__, __FILE__, G.filename); + + if ((MacZipMode == JohnnyLee_EF) || (MacZipMode == NewZipMode_EF)) + { + if (!UseUT_ExtraField) { + fpb.hFileInfo.ioFlCrDat = mi->fpb.hFileInfo.ioFlCrDat; + fpb.hFileInfo.ioFlMdDat = mi->fpb.hFileInfo.ioFlMdDat; + } + + fpb.hFileInfo.ioFlFndrInfo = mi->fpb.hFileInfo.ioFlFndrInfo; + } + + if (MacZipMode == NewZipMode_EF) + { + if (uO.E_flag) PrintMacExtraInfo(mi); + fpb.hFileInfo.ioFlXFndrInfo = mi->fpb.hFileInfo.ioFlXFndrInfo; + + fpb.hFileInfo.ioFVersNum = mi->fpb.hFileInfo.ioFVersNum; + fpb.hFileInfo.ioACUser = mi->fpb.hFileInfo.ioACUser; + + if (!UseUT_ExtraField) { + fpb.hFileInfo.ioFlBkDat = mi->fpb.hFileInfo.ioFlBkDat; +#ifdef USE_EF_UT_TIME + if (!(mi->flags & EB_M3_FL_NOUTC)) + { +#ifdef DEBUG_TIME + { + printf("\nSetFinderInfo: Mac modif: %lu local -> UTOffset: "\ + "%d before AdjustForTZmoveMac\n", + fpb.hFileInfo.ioFlCrDat, mi->Cr_UTCoffs); + } +#endif /* DEBUG_TIME */ + fpb.hFileInfo.ioFlCrDat = + AdjustForTZmoveMac(fpb.hFileInfo.ioFlCrDat, mi->Cr_UTCoffs); + fpb.hFileInfo.ioFlMdDat = + AdjustForTZmoveMac(fpb.hFileInfo.ioFlMdDat, mi->Md_UTCoffs); + fpb.hFileInfo.ioFlBkDat = + AdjustForTZmoveMac(fpb.hFileInfo.ioFlBkDat, mi->Bk_UTCoffs); +#ifdef DEBUG_TIME + { + printf("SetFinderInfo: Mac modif: %lu local -> UTOffset: "\ + "%d after AdjustForTZmoveMac\n", + fpb.hFileInfo.ioFlCrDat, mi->Cr_UTCoffs); + } +#endif /* DEBUG_TIME */ + + } +#endif /* USE_EF_UT_TIME */ + } + + if ((mi->FinderComment) && + (fileSystemID == HFS_fileSystem)) { + C2PStr(mi->FinderComment); + err = FSpDTSetComment(spec, (unsigned char *) mi->FinderComment); + printerr("FSpDTSetComment:",err , err, + __LINE__, __FILE__, mi->FullPath); + } + } + + /* Restore ioDirID field in pb which was changed by PBGetCatInfo */ + fpb.hFileInfo.ioDirID = spec->parID; + err = PBSetCatInfoSync(&fpb); + + return err; +} /* SetFinderInfo() */ + + + + +/* +** Scan the extra fields in extra_field, and look for a MacOS EF; return a +** pointer to that EF, or NULL if it's not there. +*/ +static uch *scanMacOSexfield(uch *ef_ptr, unsigned ef_len, + short *MacZipMode) +{ + while (ef_ptr != NULL && ef_len >= EB_HEADSIZE) { + unsigned eb_id = makeword(EB_ID + ef_ptr); + unsigned eb_len = makeword(EB_LEN + ef_ptr); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + Trace((stderr, + "scanMacOSexfield: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } + + if (isMacOSexfield(eb_id, eb_len, MacZipMode)) { + return ef_ptr; + } + + ef_ptr += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } + + return NULL; +} + + + + +static Boolean isMacOSexfield(unsigned id, unsigned size, short *MacZipMode) +{ +size = size; + + switch (id) + { + case EF_ZIPIT: + { /* we do not (yet) support ZipIt's format completely */ + *MacZipMode = TomBrownZipIt1_EF; + IgnoreEF_Macfilename = true; + return true; + } + + case EF_ZIPIT2: + { /* we do not (yet) support ZipIt's format completely */ + *MacZipMode = TomBrownZipIt2_EF; + IgnoreEF_Macfilename = true; + return true; + } + + case EF_MAC3: + { /* the new maczip format */ + *MacZipMode = NewZipMode_EF; + IgnoreEF_Macfilename = false; + return true; + } + + case EF_JLMAC: + { /* Johnny Lee's old maczip format */ + *MacZipMode = JohnnyLee_EF; + IgnoreEF_Macfilename = true; + return true; + } + + default: + { /* any other format */ + *MacZipMode = UnKnown_EF; + IgnoreEF_Macfilename = true; + return false; + } + } + + return false; +} + + + + +/* +** Return a unsigned long from a four-byte sequence +** in big endian format +*/ + +ulg makePPClong(ZCONST uch *sig) +{ + return (((ulg)sig[0]) << 24) + + (((ulg)sig[1]) << 16) + + (((ulg)sig[2]) << 8) + + ((ulg)sig[3]); +} + + + + +/* +** Return a unsigned short from a two-byte sequence +** in big endian format +*/ + +ush makePPCword(ZCONST uch *b) +{ + return (ush)((b[0] << 8) | b[1]); +} + + + + +/* +** Print mac extra-field +** +*/ + +static void PrintMacExtraInfo(MACINFO *mi) +{ +#define MY_FNDRINFO fpb.hFileInfo.ioFlFndrInfo + DateTimeRec MacTime; + static ZCONST char space[] = " "; + static ZCONST char line[] = "------------------------------------"\ + "------------------------------"; + + printf("\n\n%s", line); + + printf("\nFullPath = [%s]", mi->FullPath); + printf("\nFinderComment = [%s]", mi->FinderComment); + printf("\nText Encoding Base (Filename) \"%s\" \n", + PrintTextEncoding(mi->fpb.hFileInfo.ioFlXFndrInfo.fdScript)); + + printf("\nExtraField Flags : %s 0x%x %4d", + sBit2Str(mi->flags), mi->flags, mi->flags); + + printf("\n%sExtra Field is %s", space, + (mi->flags & EB_M3_FL_UNCMPR ? + "Uncompressed" : "Compressed")); + printf("\n%sFile Dates are in %u Bit", space, + (mi->flags & EB_M3_FL_TIME64 ? 64 : 32)); + printf("\n%sFile UTC time adjustments are %ssupported", space, + (mi->flags & EB_M3_FL_NOUTC ? "not " : "")); + printf("\n%sFile Name is %schanged", space, + (mi->flags & EB_M3_FL_NOCHANGE ? "not " : "")); + printf("\n%sFile is a %s\n", space, + (mi->flags & EB_M3_FL_DATFRK ? + "Datafork" : "Resourcefork")); + + /* not all type / creator codes are printable */ + if (isprint((char)(mi->MY_FNDRINFO.fdType >> 24)) && + isprint((char)(mi->MY_FNDRINFO.fdType >> 16)) && + isprint((char)(mi->MY_FNDRINFO.fdType >> 8)) && + isprint((char)mi->MY_FNDRINFO.fdType)) + { + printf("\nFile Type = [%c%c%c%c] 0x%lx", + (char)(mi->MY_FNDRINFO.fdType >> 24), + (char)(mi->MY_FNDRINFO.fdType >> 16), + (char)(mi->MY_FNDRINFO.fdType >> 8), + (char)(mi->MY_FNDRINFO.fdType), + mi->MY_FNDRINFO.fdType); + } + else + { + printf("\nFile Type = 0x%lx", + mi->MY_FNDRINFO.fdType); + } + + if (isprint((char)(mi->MY_FNDRINFO.fdCreator >> 24)) && + isprint((char)(mi->MY_FNDRINFO.fdCreator >> 16)) && + isprint((char)(mi->MY_FNDRINFO.fdCreator >> 8)) && + isprint((char)mi->MY_FNDRINFO.fdCreator)) + { + printf("\nFile Creator = [%c%c%c%c] 0x%lx", + (char)(mi->MY_FNDRINFO.fdCreator >> 24), + (char)(mi->MY_FNDRINFO.fdCreator >> 16), + (char)(mi->MY_FNDRINFO.fdCreator >> 8), + (char)(mi->MY_FNDRINFO.fdCreator), + mi->MY_FNDRINFO.fdCreator); + } + else + { + printf("\nFile Creator = 0x%lx", + mi->MY_FNDRINFO.fdCreator); + } + + printf("\n\nDates (local time of archiving location):"); + SecondsToDate(mi->fpb.hFileInfo.ioFlCrDat, &MacTime); + printf("\n Created = %4d/%2d/%2d %2d:%2d:%2d ", + MacTime.year, MacTime.month, MacTime.day, + MacTime.hour, MacTime.minute, MacTime.second); + SecondsToDate(mi->fpb.hFileInfo.ioFlMdDat, &MacTime); + printf("\n Modified = %4d/%2d/%2d %2d:%2d:%2d ", + MacTime.year, MacTime.month, MacTime.day, + MacTime.hour, MacTime.minute, MacTime.second); + SecondsToDate(mi->fpb.hFileInfo.ioFlBkDat, &MacTime); + printf("\n Backup = %4d/%2d/%2d %2d:%2d:%2d ", + MacTime.year, MacTime.month, MacTime.day, + MacTime.hour, MacTime.minute, MacTime.second); + + if (!(mi->flags & EB_M3_FL_NOUTC)) { + printf("\nGMT Offset of Creation time = %4ld sec %2d h", + mi->Cr_UTCoffs, (int)mi->Cr_UTCoffs / (60 * 60)); + printf("\nGMT Offset of Modification time = %4ld sec %2d h", + mi->Md_UTCoffs, (int)mi->Md_UTCoffs / (60 * 60)); + printf("\nGMT Offset of Backup time = %4ld sec %2d h", + mi->Bk_UTCoffs, (int)mi->Bk_UTCoffs / (60 * 60)); + } + + printf("\n\nFinder Flags : %s 0x%x %4d", + sBit2Str(mi->MY_FNDRINFO.fdFlags), + mi->MY_FNDRINFO.fdFlags, + mi->MY_FNDRINFO.fdFlags); + + printf("\nFinder Icon Position = X: %4d", + mi->MY_FNDRINFO.fdLocation.h); + + printf("\n Y: %4d", + mi->MY_FNDRINFO.fdLocation.v); + + printf("\n\nText Encoding Base (System/MacZip) \"%s\"", + PrintTextEncoding(mi->TextEncodingBase)); + + printf("\n%s\n", line); +#undef MY_FNDRINFO +} + + + + +/* +** Decode mac extra-field and assign the data to the structure +** +*/ + +static Boolean GetExtraFieldData(short *MacZipMode, MACINFO *mi) +{ +uch *ptr; +int retval = PK_OK; + +ptr = scanMacOSexfield(G.extra_field, G.lrec.extra_field_length, MacZipMode); + +/* MacOS is no preemptive OS therefore do some (small) event-handling */ +UserStop(); + +if (uO.J_flag) + { + *MacZipMode = UnKnown_EF; + IgnoreEF_Macfilename = true; + return false; + } + +if (ptr != NULL) +{ /* Collect the data from the extra field buffer. */ + mi->header = makeword(ptr); ptr += 2; + mi->data = makeword(ptr); ptr += 2; + + switch (*MacZipMode) + { + case NewZipMode_EF: + { + mi->size = makelong(ptr); ptr += 4; + mi->flags = makeword(ptr); ptr += 2; + /* Type/Creator are always uncompressed */ + mi->fpb.hFileInfo.ioFlFndrInfo.fdType = makePPClong(ptr); + ptr += 4; + mi->fpb.hFileInfo.ioFlFndrInfo.fdCreator = makePPClong(ptr); + ptr += 4; + + if (!(mi->flags & EB_M3_FL_UNCMPR)) + { + + retval = memextract(__G__ attrbuff, mi->size, ptr, + mi->data - EB_MAC3_HLEN); + + if (retval != PK_OK) /* error uncompressing attributes */ + { + Info(slide, 0x201, ((char *)slide, + LoadFarString(ErrUncmpEF))); + *MacZipMode = UnKnown_EF; + return false; /* EF-Block unusable, ignore it */ + } + + } + else + { /* file attributes are uncompressed */ + attrbuff = ptr; + } + + DecodeMac3ExtraField(attrbuff, mi); + + return true; + break; + } + + case JohnnyLee_EF: + { + if (strncmp((char *)ptr, "JLEE", 4) == 0) + { /* Johnny Lee's old MacZip e.f. was found */ + attrbuff = ptr + 4; + DecodeJLEEextraField(attrbuff, mi); + return true; + } + else + { /* second signature did not match, ignore EF block */ + *MacZipMode = UnKnown_EF; + return false; + } + break; + } + + + case TomBrownZipIt1_EF: + case TomBrownZipIt2_EF: + { + if (strncmp((char *)ptr, "ZPIT", 4) == 0) + { /* Johnny Lee's old MacZip e.f. was found */ + attrbuff = ptr + 4; + DecodeZPITextraField(attrbuff, mi); + return true; + } + else + { /* second signature did not match, ignore EF block */ + *MacZipMode = UnKnown_EF; + return false; + } + break; + } + + + default: + { /* just to make sure */ + *MacZipMode = UnKnown_EF; + IgnoreEF_Macfilename = true; + return false; + break; + } + } +} /* if (ptr != NULL) */ + +/* no Mac extra field was found */ +return false; +} + + + + +/* +** Assign the new Mac3 Extra-Field to the structure +** +*/ + +static void DecodeMac3ExtraField(ZCONST uch *buff, MACINFO *mi) +{ /* extra-field info of the new MacZip implementation */ + /* compresssed extra-field starts here (if compressed) */ + +Assert_it(buff, "", ""); + +mi->fpb.hFileInfo.ioFlFndrInfo.fdFlags = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlFndrInfo.fdLocation.v = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlFndrInfo.fdLocation.h = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlFndrInfo.fdFldr = makeword(buff); buff += 2; + +mi->fpb.hFileInfo.ioFlXFndrInfo.fdIconID = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdReserved[0] = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdReserved[1] = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdReserved[2] = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdScript = *buff; buff += 1; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdXFlags = *buff; buff += 1; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdComment = makeword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlXFndrInfo.fdPutAway = makelong(buff); buff += 4; + +mi->fpb.hFileInfo.ioFVersNum = *buff; buff += 1; +mi->fpb.hFileInfo.ioACUser = *buff; buff += 1; + +/* +This implementation does not use the 64 bit time values, therefore +use the UT extra field instead +*/ +if (mi->flags & EB_M3_FL_TIME64) + { + Info(slide, 0x201, ((char *)slide, LoadFarString(No64Time))); + UseUT_ExtraField = true; + buff += 24; /* jump over the date values */ + } +else + { + UseUT_ExtraField = false; + mi->fpb.hFileInfo.ioFlCrDat = makelong(buff); buff += 4; + mi->fpb.hFileInfo.ioFlMdDat = makelong(buff); buff += 4; + mi->fpb.hFileInfo.ioFlBkDat = makelong(buff); buff += 4; + } + +if (!(mi->flags & EB_M3_FL_NOUTC)) + { + mi->Cr_UTCoffs = makelong(buff); buff += 4; + mi->Md_UTCoffs = makelong(buff); buff += 4; + mi->Bk_UTCoffs = makelong(buff); buff += 4; + } + +/* TextEncodingBase type & values */ +/* (values 0-32 correspond to the Script Codes defined in "Inside Macintosh", + Text pages 6-52 and 6-53) */ +mi->TextEncodingBase = makeword(buff); buff += 2; + +if (mi->TextEncodingBase >= kTextEncodingUnicodeV1_1) + { + Info(slide, 0x201, ((char *)slide, LoadFarString(NoUniCode))); + IgnoreEF_Macfilename = true; + } + +mi->FullPath = (char *)buff; buff += strlen(mi->FullPath) + 1; +mi->FinderComment = (char *)buff; buff += strlen(mi->FinderComment) + 1; + +if (uO.i_flag) IgnoreEF_Macfilename = true; + +} + + + + +/* +** Assign the new JLEE Extra-Field to the structure +** +*/ + +static void DecodeJLEEextraField(ZCONST uch *buff, MACINFO *mi) +{ /* extra-field info of Johnny Lee's old MacZip */ + +Assert_it(buff, "", ""); + +mi->fpb.hFileInfo.ioFlFndrInfo.fdType = makePPClong(buff); buff += 4; +mi->fpb.hFileInfo.ioFlFndrInfo.fdCreator = makePPClong(buff); buff += 4; +mi->fpb.hFileInfo.ioFlFndrInfo.fdFlags = makePPCword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlFndrInfo.fdLocation.v = makePPCword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlFndrInfo.fdLocation.h = makePPCword(buff); buff += 2; +mi->fpb.hFileInfo.ioFlFndrInfo.fdFldr = makePPCword(buff); buff += 2; + +mi->fpb.hFileInfo.ioFlCrDat = makePPClong(buff); buff += 4; +mi->fpb.hFileInfo.ioFlMdDat = makePPClong(buff); buff += 4; +mi->flags = makePPClong(buff); buff += 4; + +newExtraField.fpb.hFileInfo.ioFlXFndrInfo.fdScript = smSystemScript; +} + + + + +/* +** Assign the new JLEE Extra-Field to the structure +** +*/ + +static void DecodeZPITextraField(ZCONST uch *buff, MACINFO *mi) +{ /* extra-field info of Johnny Lee's old MacZip */ +unsigned char filelen; + +Assert_it(buff, "", ""); + +#ifdef SwitchZIPITefSupportOff +MacZipMode = UnKnown_EF; +Info(slide, 0x221, ((char *)slide,LoadFarString(ZitIt_EF))); +return; +#endif + +if (MacZipMode == TomBrownZipIt1_EF) + { + filelen = *buff; + newExtraField.filename = buff; + buff += 1; + buff += filelen; + mi->fpb.hFileInfo.ioFlFndrInfo.fdType = makePPClong(buff); + buff += 4; + mi->fpb.hFileInfo.ioFlFndrInfo.fdCreator = makePPClong(buff); + buff += 4; + } +else /* if (MacZipMode == TomBrownZipIt2_EF) */ + { + mi->fpb.hFileInfo.ioFlFndrInfo.fdType = makePPClong(buff); + buff += 4; + mi->fpb.hFileInfo.ioFlFndrInfo.fdCreator = makePPClong(buff); + buff += 4; + } + +newExtraField.fpb.hFileInfo.ioFlXFndrInfo.fdScript = smSystemScript; +} + + + +/* +** Return char* to describe the text encoding +** +*/ + +static char *PrintTextEncoding(short script) +{ +char *info; +static char buffer[14]; +/* TextEncodingBase type & values */ +/* (values 0-32 correspond to the Script Codes defined in + Inside Macintosh: Text pages 6-52 and 6-53 */ + +switch (script) { /* Mac OS encodings*/ + case kTextEncodingMacRoman: info = "Roman"; break; + case kTextEncodingMacJapanese: info = "Japanese"; break; + case kTextEncodingMacChineseTrad: info = "ChineseTrad"; break; + case kTextEncodingMacKorean: info = "Korean"; break; + case kTextEncodingMacArabic: info = "Arabic"; break; + case kTextEncodingMacHebrew: info = "Hebrew"; break; + case kTextEncodingMacGreek: info = "Greek"; break; + case kTextEncodingMacCyrillic: info = "Cyrillic"; break; + case kTextEncodingMacDevanagari: info = "Devanagari"; break; + case kTextEncodingMacGurmukhi: info = "Gurmukhi"; break; + case kTextEncodingMacGujarati: info = "Gujarati"; break; + case kTextEncodingMacOriya: info = "Oriya"; break; + case kTextEncodingMacBengali: info = "Bengali"; break; + case kTextEncodingMacTamil: info = "Tamil"; break; + case kTextEncodingMacTelugu: info = "Telugu"; break; + case kTextEncodingMacKannada: info = "Kannada"; break; + case kTextEncodingMacMalayalam: info = "Malayalam"; break; + case kTextEncodingMacSinhalese: info = "Sinhalese"; break; + case kTextEncodingMacBurmese: info = "Burmese"; break; + case kTextEncodingMacKhmer: info = "Khmer"; break; + case kTextEncodingMacThai: info = "Thai"; break; + case kTextEncodingMacLaotian: info = "Laotian"; break; + case kTextEncodingMacGeorgian: info = "Georgian"; break; + case kTextEncodingMacArmenian: info = "Armenian"; break; + case kTextEncodingMacChineseSimp: info = "ChineseSimp"; break; + case kTextEncodingMacTibetan: info = "Tibetan"; break; + case kTextEncodingMacMongolian: info = "Mongolian"; break; + case kTextEncodingMacEthiopic: info = "Ethiopic"; break; + case kTextEncodingMacCentralEurRoman: info = "CentralEurRoman"; break; + case kTextEncodingMacVietnamese: info = "Vietnamese"; break; + case kTextEncodingMacExtArabic: info = "ExtArabic"; break; + + case kTextEncodingUnicodeV1_1: info = "Unicode V 1.1"; break; + case kTextEncodingUnicodeV2_0: info = "Unicode V 2.0"; break; + + default: { + sprintf(buffer,"Code: 0x%x",(short) script); + info = buffer; + break; + } + } + +return info; +} + + + +/* +** Init Globals +** +*/ + +void MacGlobalsInit(__GPRO) +{ +newExtraField.FullPath = NULL; +newExtraField.FinderComment = NULL; + +OpenZipFile = true; + +MacZipMode = UnKnown_EF; +IgnoreEF_Macfilename = true; + +if (malloced_attrbuff == NULL) + { + /* make room for extra-field */ + attrbuff = (uch *)malloc(EB_MAX_OF_VARDATA); + + if (attrbuff == NULL) + { /* No memory to uncompress attributes */ + Info(slide, 0x201, ((char *)slide, LoadFarString(OutOfMemEF))); + exit(PK_MEM); + } + else + { + malloced_attrbuff = attrbuff; + } + } +else + { + attrbuff = malloced_attrbuff; + } + +} + + + +const char *BOINC_RCSID_9a13346eb1 = "$Id: macos.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macscreen.c boinc-7.0.14+dfsg/zip/unzip/macos/source/macscreen.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macscreen.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macscreen.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,464 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + macscreen.c + This file is only linked into the standalone version (not SIOUX) of unzip. + Macintosh-GUI routines. + + ---------------------------------------------------------------------------*/ + + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include + +#include +#include +#include + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define bufferSize 4096 + +#define screenWindow 128 + +#define pauseOption 0x0001 +#define scrollOption 0x0002 + + +/*****************************************************************************/ +/* Module level Vars */ +/*****************************************************************************/ + +static Rect scrollRect, pauseRect; +static WindowPtr theWindow; +static RgnHandle scrollRgn; + +static short fontHeight, fontWidth, screenHeight, screenWidth; +static short currentPosition, maxPosition, pausePosition; + +static short *screenLength, startLine, endLine; +static char *screenImage, **screenLine; + +static int screenOptions; + + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +void screenOpen(char *); +void screenControl(char *, int); +void screenClose(void); +void screenUpdate(WindowPtr); +void screenDisplay(char *); +void screenDump(char *, long); + +char *macfgets(char *, int, FILE *); +int macfprintf(FILE *, char *, ...); +int macprintf(char *, ...); +int macgetch(void); + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +void screenOpen(char *Title) { + FontInfo fontInfo; + int n; + short fontFamID; + + theWindow = GetNewWindow(screenWindow, nil, (WindowPtr)(-1)); + + if ((Title != NULL) && (*Title != '\0')) { + c2pstr(Title); + SetWTitle(theWindow, (StringPtr)Title); + p2cstr((StringPtr)Title); + } + + ShowWindow(theWindow); + + SetPort(theWindow); + GetFNum( "\pMonaco", &fontFamID ); + TextFont(fontFamID); + TextSize(9); + + GetFontInfo(&fontInfo); + fontHeight = fontInfo.ascent + fontInfo.descent + fontInfo.leading; + fontWidth = fontInfo.widMax; + + scrollRgn = NewRgn(); + + screenWidth = (theWindow->portRect.right - theWindow->portRect.left - 10) / + fontWidth; + screenHeight = (theWindow->portRect.bottom - theWindow->portRect.top) / + fontHeight; + maxPosition = screenHeight * fontHeight; + pausePosition = maxPosition - (currentPosition = fontHeight); + + SetRect(&scrollRect, theWindow->portRect.left, + theWindow->portRect.top + fontInfo.descent, + theWindow->portRect.right, + theWindow->portRect.bottom); + SetRect(&pauseRect, theWindow->portRect.left, + pausePosition + fontInfo.descent, + theWindow->portRect.right, + theWindow->portRect.bottom); + + MoveTo(5, currentPosition); + + n = (sizeof(char *) + sizeof(short) + screenWidth) * screenHeight; + + screenLine = (char **)NewPtr(n); + + screenLength = (short *)&screenLine[screenHeight]; + screenImage = (char *)&screenLength[screenHeight]; + + for (n = 0; n < screenHeight; n++) { + screenLine[n] = &screenImage[n * screenWidth]; + screenLength[n] = 0; + } + + startLine = endLine = 0; + + screenOptions = 0; + + return; +} + + + + +void screenControl(char *options, int setting) { + int n = 0; + + while (*options) { + switch (*options) { + case 'p': + n |= pauseOption; + break; + case 's': + n |= scrollOption; + break; + default: + break; + } + options += 1; + } + + if (setting == 0) + screenOptions &= (n ^ (-1)); + else + screenOptions |= n; + + if ((pausePosition = maxPosition - currentPosition) == 0) + pausePosition = maxPosition - fontHeight; + + return; +} + + + + +void screenClose(void) { + DisposePtr((Ptr)screenLine); + + DisposeWindow(theWindow); + + return; +} + + + + +void screenUpdate(WindowPtr window) { + GrafPort *savePort; + int m, n; + + if (window == theWindow) { + BeginUpdate(window); + if (!EmptyRgn(window->visRgn)) { + GetPort(&savePort); + SetPort(window); + n = startLine; + for (m = 1; ; m++) { + MoveTo(5, m * fontHeight); + if (screenLength[n] != 0) + DrawText(screenLine[n], 0, screenLength[n]); + if (n == endLine) break; + if ((n += 1) == screenHeight) n = 0; + } + SetPort(savePort); + } + EndUpdate(window); + } + + return; +} + + + + +static void screenNewline(void) { + MoveTo(5, currentPosition += fontHeight); + if (currentPosition > maxPosition) { + if (screenOptions & scrollOption) { + ScrollRect(&scrollRect, 0, -fontHeight, scrollRgn); + MoveTo(5, currentPosition = maxPosition); + if ((startLine += 1) == screenHeight) startLine = 0; + } else { + ScrollRect(&scrollRect, 0, -maxPosition + fontHeight, scrollRgn); + MoveTo(5, currentPosition = fontHeight + fontHeight); + startLine = endLine; + } + } + pausePosition -= fontHeight; + + if ((endLine += 1) == screenHeight) endLine = 0; + screenLength[endLine] = 0; + + return; +} + + + + +static char waitChar(void) { + WindowPtr whichWindow; + EventRecord theEvent; + + for ( ; ; ) { + SystemTask(); + if (GetNextEvent(everyEvent, &theEvent)) { + switch (theEvent.what) { + case keyDown: + if ((theEvent.modifiers & cmdKey) && + ((theEvent.message & charCodeMask) == '.')) + ExitToShell(); + return(theEvent.message & charCodeMask); + case mouseDown: + if (FindWindow(theEvent.where, &whichWindow) == inSysWindow) + SystemClick(&theEvent, whichWindow); + break; + case updateEvt: + screenUpdate((WindowPtr)theEvent.message); + break; + } + } + } +} + + + + +static void screenPause(void) { + if (pausePosition == 0) { + if (screenOptions & pauseOption) { + DrawText("Press any key to continue ...", 0, 29); + memcpy(screenLine[endLine], "Press any key to continue ...", 29); + screenLength[endLine] = 29; + + (void)waitChar(); + + EraseRect(&pauseRect); + MoveTo(5, currentPosition); + screenLength[endLine] = 0; + } + + pausePosition = maxPosition - fontHeight; + } + + return; +} + + + + +void screenDisplay(char *s) { + GrafPort *savePort; + int m, n; + char *t; + + GetPort(&savePort); + SetPort(theWindow); + + while (*s) { + screenPause(); + + for (t = s; (*s) && (*s != '\n') && (*s != '\r'); s++) + ; /* empty body */ + + if ((n = s - t) > (m = screenWidth - screenLength[endLine])) n = m; + + if (n > 0) { + DrawText(t, 0, n); + memcpy(screenLine[endLine] + screenLength[endLine], t, n); + screenLength[endLine] += n; + } + + if ((*s == '\n') || (*s == '\r')) { + screenNewline(); + s += 1; + } + } + + SetPort(savePort); + + return; +} + + + + +void screenDump(char *s, long n) { + GrafPort *savePort; + int k, m; + char *t; + + GetPort(&savePort); + SetPort(theWindow); + + while (n) { + screenPause(); + + for (t = s; (n) && (*s != '\n') && (*s != '\r'); s++, n--) + ; /* empty body */ + + if ((k = s - t) > (m = screenWidth - screenLength[endLine])) k = m; + + if (k > 0) { + DrawText(t, 0, k); + memcpy(screenLine[endLine] + screenLength[endLine], t, k); + screenLength[endLine] += k; + } + + if ((*s == '\n') || (*s == '\r')) { + screenNewline(); + s += 1; + n -= 1; + } + } + + SetPort(savePort); + + return; +} + + + + +char *macfgets(char *s, int n, FILE *stream) { + GrafPort *savePort; + char c, *t = s; + + stream = stream; + + GetPort(&savePort); + SetPort(theWindow); + + for (n -= 1; (n > 0) && ((c = waitChar()) != '\r'); n -= 1) { + DrawChar(*t++ = c); + if (screenLength[endLine] < screenWidth) + screenLine[endLine][screenLength[endLine]++] = c; + } + + if (c == '\r') screenNewline(); + + *t = '\0'; + + SetPort(savePort); + + return(s); +} + + + + +int macfprintf(FILE *stream, char *format, ...) +{ + char buffer[bufferSize]; + va_list ap; + int rc; + + stream = stream; + + va_start(ap, format); + rc = vsprintf(buffer, format, ap); + va_end(ap); + + screenDisplay(buffer); + + return rc; +} + + + + +int macprintf(char *format, ...) +{ + char buffer[bufferSize]; + va_list ap; + int rc; + + va_start(ap, format); + rc = vsprintf(buffer, format, ap); + va_end(ap); + + screenDisplay(buffer); + + return rc; +} + + + +/***********************/ +/* Function macgetch() */ +/***********************/ + +int macgetch(void) +{ + WindowPtr whichWindow; + EventRecord theEvent; + char c; /* one-byte buffer for read() to use */ + + do { + SystemTask(); + if (!GetNextEvent(everyEvent, &theEvent)) + theEvent.what = nullEvent; + else { + switch (theEvent.what) { + case keyDown: + c = theEvent.message & charCodeMask; + break; + case mouseDown: + if (FindWindow(theEvent.where, &whichWindow) == + inSysWindow) + SystemClick(&theEvent, whichWindow); + break; + case updateEvt: + screenUpdate((WindowPtr)theEvent.message); + break; + } + } + } while (theEvent.what != keyDown); + + macprintf("*"); + + return (int)c; +} + +const char *BOINC_RCSID_fb3c7c859b = "$Id: macscreen.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macstat.c boinc-7.0.14+dfsg/zip/unzip/macos/source/macstat.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macstat.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macstat.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,189 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + macstat.c + + * This file provides a unix like file-stat routine + * for V7 Unix systems that don't have such procedures. + * + * + ---------------------------------------------------------------------------*/ + + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include + +#define UNZIP_INTERNAL +#include "unzip.h" + +#include "macstat.h" +#include "helpers.h" +#include "pathname.h" +#include "macstuff.h" +#include "mactime.h" + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +extern int errno; +extern MACINFO newExtraField; /* contains all extra-field data */ +extern short MacZipMode; + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +int UZmacstat(const char *path, struct stat *buf) +{ + Boolean isDirectory; + long dirID; + char fullpath[NAME_MAX], UnmangledPath[NAME_MAX]; + CInfoPBRec fpb; + HVolumeParam vpb; + FSSpec fileSpec; + OSErr err, err2; + short CurrentFork; + + AssertStr(path,path) + Assert_it(buf,"","") + + memset(buf,0,sizeof(buf)); /* zero out all fields */ + + RfDfFilen2Real(UnmangledPath, path, MacZipMode, + (newExtraField.flags & EB_M3_FL_NOCHANGE), &CurrentFork); + GetCompletePath(fullpath, path, &fileSpec, &err); + err2 = PrintUserHFSerr((err != -43) && (err != 0) && (err != -120), + err, path); + printerr("GetCompletePath:", err2, err2, __LINE__, __FILE__, path); + + if (err != noErr) { + errno = err; + return -1; + } + + /* + * Fill the fpb & vpb struct up with info about file or directory. + */ + + FSpGetDirectoryID(&fileSpec, &dirID, &isDirectory); + vpb.ioVRefNum = fpb.hFileInfo.ioVRefNum = fileSpec.vRefNum; + vpb.ioNamePtr = fpb.hFileInfo.ioNamePtr = fileSpec.name; + if (isDirectory) { + fpb.hFileInfo.ioDirID = fileSpec.parID; + } else { + fpb.hFileInfo.ioDirID = dirID; + } + + fpb.hFileInfo.ioFDirIndex = 0; + err = PBGetCatInfo(&fpb, false); + if (err == noErr) { + vpb.ioVolIndex = 0; + err = PBHGetVInfoSync((HParmBlkPtr)&vpb); + if (err == noErr && buf != NULL) { + /* + * Files are always readable by everyone. + */ + buf->st_mode |= S_IRUSR | S_IRGRP | S_IROTH; + + /* + * Use the Volume Info & File Info to fill out stat buf. + */ + if (fpb.hFileInfo.ioFlAttrib & 0x10) { + buf->st_mode |= S_IFDIR; + buf->st_nlink = 2; + } else { + buf->st_nlink = 1; + if (fpb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000) { + buf->st_mode |= S_IFLNK; + } else { + buf->st_mode |= S_IFREG; + } + } + if ((fpb.hFileInfo.ioFlAttrib & 0x10) || + (fpb.hFileInfo.ioFlFndrInfo.fdType == 'APPL')) { + /* + * Directories and applications are executable by everyone. + */ + + buf->st_mode |= S_IXUSR | S_IXGRP | S_IXOTH; + } + if ((fpb.hFileInfo.ioFlAttrib & 0x01) == 0) { + /* + * If not locked, then everyone has write acces. + */ + + buf->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; + } + buf->st_ino = fpb.hFileInfo.ioDirID; + buf->st_dev = fpb.hFileInfo.ioVRefNum; + buf->st_uid = -1; + buf->st_gid = -1; + buf->st_rdev = 0; + + if (CurrentFork == ResourceFork) + buf->st_size = fpb.hFileInfo.ioFlRLgLen; + else + buf->st_size = fpb.hFileInfo.ioFlLgLen; + + buf->st_blksize = vpb.ioVAlBlkSiz; + buf->st_blocks = (buf->st_size + buf->st_blksize - 1) + / buf->st_blksize; + + /* + * The times returned by the Mac file system are in the + * local time zone. We convert them to GMT so that the + * epoch starts from GMT. This is also consistent with + * what is returned from "clock seconds". + */ + + buf->st_mtime = MacFtime2UnixFtime(fpb.hFileInfo.ioFlMdDat); + buf->st_ctime = MacFtime2UnixFtime(fpb.hFileInfo.ioFlCrDat); + buf->st_atime = buf->st_ctime; /* best guess */ + +#ifdef DEBUG_TIME + { + struct tm *tp = localtime(&buf->st_mtime); + printf( + "\nUZmacstat: local buf->st_mtime is %ld = %d/%2d/%2d %2d:%2d:%2d", + buf->st_mtime, tp->tm_year, tp->tm_mon+1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec); + tp = gmtime(&buf->st_mtime); + printf( + "\nUZmacstat: UTC buf->st_mtime is %ld = %d/%2d/%2d %2d:%2d:%2d\n", + buf->st_mtime, tp->tm_year, tp->tm_mon+1, tp->tm_mday, + tp->tm_hour, tp->tm_min, tp->tm_sec); + } +#endif /* DEBUG_TIME */ + } + } + + if (err != noErr) { + errno = err; + } + + return (err == noErr ? 0 : -1); +} + +const char *BOINC_RCSID_b6b6ca3001 = "$Id: macstat.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macstat.h boinc-7.0.14+dfsg/zip/unzip/macos/source/macstat.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macstat.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macstat.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,72 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/***************************************************************** + * + * stat.h + * + *****************************************************************/ + +#ifndef __macstat_h +#define __macstat_h + +#include +typedef long dev_t; +typedef long ino_t; +typedef long off_t; + +#define _STAT + +struct stat { + dev_t st_dev; + ino_t st_ino; + unsigned short st_mode; + short st_nlink; + short st_uid; + short st_gid; + dev_t st_rdev; + off_t st_size; + time_t st_atime, st_mtime, st_ctime; + long st_blksize; + long st_blocks; +}; + +#define S_IFMT 0xF000 +#define S_IFIFO 0x1000 +#define S_IFCHR 0x2000 +#define S_IFDIR 0x4000 +#define S_IFBLK 0x6000 +#define S_IFREG 0x8000 +#define S_IFLNK 0xA000 +#define S_IFSOCK 0xC000 +#define S_ISUID 0x800 +#define S_ISGID 0x400 +#define S_ISVTX 0x200 +#define S_IREAD 0x100 +#define S_IWRITE 0x80 +#define S_IEXEC 0x40 + +#define S_IRUSR 00400 +#define S_IWUSR 00200 +#define S_IXUSR 00100 +#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) /* = 00700 */ + +#define S_IRGRP 00040 +#define S_IWGRP 00020 +#define S_IXGRP 00010 +#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) /* = 00070 */ + +#define S_IROTH 00004 +#define S_IWOTH 00002 +#define S_IXOTH 00001 +#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) /* = 00007 */ + + +extern int UZmacstat(const char *path, struct stat *buf); + +#endif /* !__macstat_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macstuff.h boinc-7.0.14+dfsg/zip/unzip/macos/source/macstuff.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macstuff.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macstuff.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,18 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +#ifndef _MACSTUFF_H +#define _MACSTUFF_H 1 + +#include "MoreFilesExtras.h" +#include "MoreDesktopMgr.h" +#include "MoreFiles.h" +#include "FSpCompat.h" +#include "FullPath.h" + +#endif /* _MACSTUFF_H */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/mactime.c boinc-7.0.14+dfsg/zip/unzip/macos/source/mactime.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/mactime.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/mactime.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,453 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* ----------------------------------------------------------------------------- + +The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime, +mktime and time do not work correctly. The supplied link library mactime.c +contains replacement functions for them. + + * Caveat: On a Mac, we only know the GMT and DST offsets for + * the current time, not for the time in question. + * Mac has no support for DST handling. + * DST changeover is all manually set by the user. + + +------------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "mactime.h" + + +/* +The MacOS function GetDateTime returns the +number of seconds elapsed since midnight, January 1, 1904. +*/ +const unsigned long MacOS_2_Unix = 2082844800L; + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + + +#ifndef TEST_TIME_LIB +#define my_gmtime gmtime +#define my_localtime localtime +#define my_mktime mktime +#define my_time time +#endif + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ +/* internal prototypes */ +static void clear_tm(struct tm * tm); +static long GMTDelta(void); +static Boolean DaylightSaving(void); +static time_t GetTimeMac(void); +static time_t Mactime(time_t *timer); +static void normalize(int *i,int *j,int norm); +static struct tm *time2tm(const time_t *timer); +static time_t tm2time(struct tm *tp); + +/* Because serial port and SLIP conflict with ReadXPram calls, + we cache the call here so we don't hang on calling ReadLocation() */ +static void myReadLocation(MachineLocation * loc); + + +/* prototypes for STD lib replacement functions */ +struct tm *my_gmtime(const time_t *t); +struct tm *my_localtime(const time_t *t); +time_t my_mktime(struct tm *tp); +time_t my_time(time_t *t); + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + /* + * Mac file times are based on 1904 Jan 1 00:00 local time, + * not 1970 Jan 1 00:00 UTC. + * So we have to convert the time stamps into UNIX UTC + * compatible values. + */ +time_t MacFtime2UnixFtime(unsigned long macftime) +{ + long UTCoffset; + + GetGMToffsetMac(macftime, &UTCoffset); + MACOS_TO_UNIX(macftime); + macftime -= UTCoffset; + + return macftime; +} + + + /* + * Mac file times are based on 1904 Jan 1 00:00 local time, + * not 1970 Jan 1 00:00 UTC. + * So we have to convert the time stamps into MacOS local + * compatible values. + */ +unsigned long UnixFtime2MacFtime(time_t unxftime) +{ + long UTCoffset; + unsigned long macftime = unxftime; + + UNIX_TO_MACOS(macftime); + GetGMToffsetMac(macftime, &UTCoffset); + macftime += UTCoffset; + + return macftime; +} + + + + + +/* +* This function convert a file-localtime to an another +* file-localtime. +*/ +time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs) +{ + time_t MacGMTTime; + long UTCoffset; + + /* convert macloctim into corresponding UTC value */ + MacGMTTime = macloctim - s_gmtoffs; + GetGMToffsetMac(macloctim, &UTCoffset); + + return (MacGMTTime + UTCoffset); +} /* AdjustForTZmove() */ + + + + +/* + * This function calculates the difference between the supplied Mac + * ftime value (local time) and the corresponding UTC time in seconds. + */ +Boolean GetGMToffsetMac(unsigned long mactime, long *UTCoffset) +{ + +mactime = mactime; +/* + * Caveat: On a Mac, we only know the GMT and DST offsets for + * the current time, not for the time in question. + * Mac has no support for DST handling. + * DST changeover is all manually set by the user. + + May be later I can include a support of GMT offset calculation for the + time in question here. +*/ + *UTCoffset = GMTDelta(); + + return true; +} + + + + + + + +/***************************************************************************** + * Standard Library Replacement Functions + * gmtime(), mktime(), localtime(), time() + * + * The unix epoch is used here. + * These functions gmtime(), mktime(), localtime() and time() + * expects and returns unix times. + * + * At midnight Jan. 1, 1970 GMT, the local time was + * midnight Jan. 1, 1970 + GMTDelta(). + * + * + *****************************************************************************/ + + +struct tm *my_gmtime(const time_t *timer) +{ + return time2tm(timer); +} + + + + +struct tm *my_localtime(const time_t *timer) +{ + time_t maclocal; + + maclocal = *timer; + maclocal += GMTDelta(); + + return time2tm(&maclocal); +} + + + + +time_t my_mktime(struct tm *tp) +{ + time_t maclocal; + + maclocal = tm2time(tp); + maclocal -= GMTDelta(); + + return maclocal; +} + + + + + + +time_t my_time(time_t *time) +{ +time_t tmp_time; + +GetDateTime(&tmp_time); + +MACOS_TO_UNIX(tmp_time); + +if (time) + { + *time = tmp_time; + } + +return tmp_time; +} + + + +/*****************************************************************************/ +/* static module level functions +/*****************************************************************************/ + + +/* + * The geographic location and time zone information of a Mac + * are stored in extended parameter RAM. The ReadLocation + * produdure uses the geographic location record, MachineLocation, + * to read the geographic location and time zone information in + * extended parameter RAM. + * + * Because serial port and SLIP conflict with ReadXPram calls, + * we cache the call here. + * + * Caveat: this caching will give the wrong result if a session + * extend across the DST changeover time, but + * this function resets itself every 2 hours. + */ +static void myReadLocation(MachineLocation * loc) +{ + static MachineLocation storedLoc; /* InsideMac, OSUtilities, page 4-20 */ + static time_t first_call = 0, last_call = 86400; + + if ((last_call - first_call) > 7200) + { + GetDateTime(&first_call); + ReadLocation(&storedLoc); + } + + GetDateTime(&last_call); + *loc = storedLoc; +} + + + + +static Boolean DaylightSaving(void) +{ + MachineLocation loc; + unsigned char dlsDelta; + + myReadLocation(&loc); + dlsDelta = loc.u.dlsDelta; + + return (dlsDelta != 0); +} + + + + +/* current local time = GMTDelta() + GMT + GMT = local time - GMTDelta() */ +static long GMTDelta(void) +{ + MachineLocation loc; + long gmtDelta; + + myReadLocation(&loc); + + /* + * On a Mac, the GMT value is in seconds east of GMT. For example, + * San Francisco is at -28,800 seconds (8 hours * 3600 seconds per hour) + * east of GMT. The gmtDelta field is a 3-byte value contained in a + * long word, so you must take care to get it properly. + */ + gmtDelta = loc.u.gmtDelta & 0x00FFFFFF; + if ((gmtDelta & 0x00800000) != 0) + { + gmtDelta |= 0xFF000000; + } + + return gmtDelta; +} + + + +/* This routine simulates stdclib time(), time in seconds since 1.1.1970 + The time is in GMT */ +static time_t GetTimeMac(void) +{ + unsigned long maclocal; + + + /* + * Get the current time expressed as the number of seconds + * elapsed since the Mac epoch, midnight, Jan. 1, 1904 (local time). + * On a Mac, current time accuracy is up to a second. + */ + + GetDateTime(&maclocal); /* Get Mac local time */ + maclocal -= GMTDelta(); /* Get Mac GMT */ + MACOS_TO_UNIX(maclocal); + + return maclocal; /* return unix GMT */ +} + + + + +/* + * clear_tm - sets a broken-down time to the equivalent of 1970/1/1 00:00:00 + */ + +static void clear_tm(struct tm * tm) +{ + tm->tm_sec = 0; + tm->tm_min = 0; + tm->tm_hour = 0; + tm->tm_mday = 1; + tm->tm_mon = 0; + tm->tm_year = 0; + tm->tm_wday = 1; + tm->tm_yday = 0; + tm->tm_isdst = -1; +} + + +static void normalize(int *i,int *j,int norm) +{ + while(*i < 0) + { + *i += norm; + (*j)--; + } + + while(*i >= norm) + { + *i -= norm; + (*j)++; + } +} + + + +/* Returns the GMT times */ +static time_t Mactime(time_t *timer) +{ + time_t t = GetTimeMac(); + + if (timer != NULL) + *timer = t; + + return t; +} + + + + +static struct tm *time2tm(const time_t *timer) +{ + DateTimeRec dtr; + MachineLocation loc; + time_t macLocal = *timer; + + static struct tm statictime; + static const short monthday[12] = + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + + UNIX_TO_MACOS(macLocal); + SecondsToDate(macLocal, &dtr); + + statictime.tm_sec = dtr.second; /* second, from 0 to 59 */ + statictime.tm_min = dtr.minute; /* minute, from 0 to 59 */ + statictime.tm_hour = dtr.hour; /* hour, from 0 to 23 */ + statictime.tm_mday = dtr.day; /* day of the month, from 1 to 31 */ + statictime.tm_mon = dtr.month - 1; /* month, 1= January and 12 = December */ + statictime.tm_year = dtr.year - 1900; /* year, ranging from 1904 to 2040 */ + statictime.tm_wday = dtr.dayOfWeek - 1; /* day of the week, 1 = Sun, 7 = Sat */ + + statictime.tm_yday = monthday[statictime.tm_mon] + + statictime.tm_mday - 1; + + if (2 < statictime.tm_mon && !(statictime.tm_year & 3)) + { + ++statictime.tm_yday; + } + + myReadLocation(&loc); + statictime.tm_isdst = DaylightSaving(); + + return(&statictime); +} + + + + + +static time_t tm2time(struct tm *tp) +{ +time_t intMacTime; +DateTimeRec dtr; + + normalize(&tp->tm_sec, &tp->tm_min, 60); + normalize(&tp->tm_min, &tp->tm_hour,60); + normalize(&tp->tm_hour,&tp->tm_mday,24); + normalize(&tp->tm_mon, &tp->tm_year,12); + + dtr.year = tp->tm_year + 1900; /* years since 1900 */ + dtr.month = tp->tm_mon + 1; /* month, 0 = January and 11 = December */ + dtr.day = tp->tm_mday; /* day of the month, from 1 to 31 */ + dtr.hour = tp->tm_hour; /* hour, from 0 to 23 */ + dtr.minute = tp->tm_min; /* minute, from 0 to 59 */ + dtr.second = tp->tm_sec; /* second, from 0 to 59 */ + + DateToSeconds(&dtr, &intMacTime); + + MACOS_TO_UNIX(intMacTime); + + return intMacTime; +} + +const char *BOINC_RCSID_d08b93ae6f = "$Id: mactime.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/mactime.h boinc-7.0.14+dfsg/zip/unzip/macos/source/mactime.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/mactime.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/mactime.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,61 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +#ifndef _MACTIME_H_ +#define _MACTIME_H_ +/* ----------------------------------------------------------------------------- + +The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime, +mktime and time do not work correctly. The supplied link library mactime.c +contains replacement functions for them. + + * Caveat: On a Mac, we only know the GMT and DST offsets for + * the current time, not for the time in question. + * Mac has no support for DST handling. + * DST changeover is all manually set by the user. + + +------------------------------------------------------------------------------*/ + +#include +#include + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + + + /* + * ARGH. Mac times are based on 1904 Jan 1 00:00, not 1970 Jan 1 00:00. + * So we have to diddle time_t's appropriately: add or subtract 66 years' + * worth of seconds == number of days times 86400 == (66*365 regular days + + * 17 leap days ) * 86400 == (24090 + 17) * 86400 == 2082844800L seconds. + * We hope time_t is an unsigned long (ulg) on the Macintosh... + */ +/* +This Offset is only used by MacFileDate_to_UTime() +*/ + +#define MACOS_TO_UNIX(x) (x) -= (unsigned long)MacOS_2_Unix +#define UNIX_TO_MACOS(x) (x) += (unsigned long)MacOS_2_Unix + +/* +The MacOS function GetDateTime returns the +number of seconds elapsed since midnight, January 1, 1904. +*/ +extern const unsigned long MacOS_2_Unix; + + +/* prototypes for public utility functions */ +time_t MacFtime2UnixFtime(unsigned long macftime); +unsigned long UnixFtime2MacFtime(time_t unxftime); +time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs); +Boolean GetGMToffsetMac(unsigned long macftime, long *UTCoffset); + + +#endif diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/macunzip.c boinc-7.0.14+dfsg/zip/unzip/macos/source/macunzip.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/macunzip.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/macunzip.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,852 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + macunzip.c + + Main-function for use with the standalone Unzip App. + + ---------------------------------------------------------------------------*/ + + + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#define UNZIP_INTERNAL +#include "unzip.h" +#include "unzvers.h" +#include "pathname.h" +#include "helpers.h" + +#include + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define aboutAlert 128 + +#define selectDialog 129 +#define okItem 1 +#define cancelItem 2 +#define editItem 3 +#define staticItem 4 + +#define unzipMenuBar 128 + +#define appleMenu 128 +#define aboutItem 1 + +#define fileMenu 129 +#define extractItem 1 +#define infoItem 2 +#define listItem 3 +#define testItem 4 +#define commentItem 6 +#define freshenItem 8 +#define updateItem 9 +#define quitItem 11 + +#define editMenu 130 +#define cutItem 1 +#define copyItem 2 +#define pasteItem 3 + +#define modifierMenu 131 +#define excludeItem 1 +#define selectItem 2 +#define quietItem 9 +#define verboseItem 10 + +#define screenMenu 132 +#define pauseItem 1 +#define scrollItem 2 + +#define extractMenu 133 +#define screenItem 3 +#define junkItem 5 + +#define caseMenu 134 +#define insensitiveItem 1 +#define lowercaseItem 2 + +#define convertMenu 135 +#define autoItem 1 +#define binaryItem 2 +#define textItem 3 + +#define overwriteMenu 136 +#define alwaysItem 1 +#define neverItem 2 +#define promptItem 3 + +#define infoMenu 137 +#define prtCommentItem 2 +#define prtHeaderItem 3 +#define prtTotalsItem 4 + +#define formatMenu 138 +#define filenameItem 1 +#define longItem 2 +#define mediumItem 3 +#define shortItem 4 + +#define allFlags 0x000FFFFF + +#define quietFlag 0x00000001 +#define verboseFlag 0x00000002 + +#define pauseFlag 0x00080000 +#define scrollFlag 0x00040000 + +#define screenFlag 0x00000004 +#define junkFlag 0x00000008 + +#define insensitiveFlag 0x00000010 +#define lowercaseFlag 0x00000020 + +#define autoFlag 0x00000040 +#define textFlag 0x00000080 + +#define neverFlag 0x00000100 +#define overwriteFlag 0x00000200 + +#define prtCommentFlag 0x00000400 +#define prtHeaderFlag 0x00000800 +#define prtTotalsFlag 0x00001000 + +#define filenameFlag 0x00002000 +#define longFlag 0x00004000 +#define mediumFlag 0x00008000 +#define shortFlag 0x00010000 + +#define extractMask 0x000003FD +#define infoMask 0x0001FE02 +#define listMask 0x00000001 +#define testMask 0x00000001 +#define commentMask 0x00000000 +#define freshenMask 0x000003FD +#define updateMask 0x000003FD + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +char UnzipVersion[32], ZipinfoVersion[32]; + +long modifiers, modifierMask; + +EventRecord myevent; +MenuHandle appleHandle, modifierHandle, screenHandle, extractHandle; +MenuHandle caseHandle, convertHandle, overwriteHandle, infoHandle; +MenuHandle formatHandle; +Handle menubar, itemHandle; +short itemType; +Rect itemRect; + +char command; +extern char fileList[256]; + +Boolean stop; + +SysEnvRec sysRec; + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +static void domousedown(EventRecord *myevent); + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +static Boolean TrapAvailable(machineType, trapNumber, trapType) +short machineType; +short trapNumber; +TrapType trapType; +{ + if (machineType < 0) + return (false); + + if ((trapType == ToolTrap) && + (machineType > envMachUnknown) && + (machineType < envMacII)) { + if ((trapNumber &= 0x03FF) > 0x01FF) + trapNumber = _Unimplemented; + } + return (NGetTrapAddress(trapNumber, trapType) != +#ifdef __MWERKS__ + NGetTrapAddress(_Unimplemented, trapType)); +#else + GetTrapAddress(_Unimplemented)); +#endif +} + + + +/* +** excute menu-command +** +*/ + +static void domenu(menucommand) long menucommand; +{ + short themenu, theitem; + DialogPtr thedialog; + Str255 name; + long check; + + themenu = HiWord(menucommand); + theitem = LoWord(menucommand); + + switch (themenu) { + + case appleMenu: + if (theitem == aboutItem) { + ParamText((StringPtr)UnzipVersion, (StringPtr)ZipinfoVersion, nil, nil); + Alert(aboutAlert, nil); + } else { + GetMenuItemText(appleHandle, theitem, name); + theitem = OpenDeskAcc(name); + } + break; + + case fileMenu: + switch (theitem) { + case extractItem: + if (modifiers & screenFlag) + command = 'c'; + else + command = 'x'; + modifierMask = extractMask; + break; + case infoItem: + command = 'Z'; + modifierMask = infoMask; + break; + case listItem: + if (modifiers & verboseFlag) + command = 'v'; + else + command = 'l'; + modifierMask = listMask; + break; + case testItem: + command = 't'; + modifierMask = testMask; + break; + case commentItem: + command = 'z'; + modifierMask = commentMask; + break; + case freshenItem: + command = 'f'; + modifierMask = freshenMask; + break; + case updateItem: + command = 'u'; + modifierMask = updateMask; + break; + case quitItem: + stop = true; + break; + default: + break; + } + break; + + case editMenu: + break; + + case modifierMenu: + switch (theitem) { + case excludeItem: + check = -1; + break; + case selectItem: + thedialog = GetNewDialog(selectDialog, nil, (WindowPtr)(-1)); + SetPort(thedialog); + do + ModalDialog(nil, &theitem); + while ((theitem != okItem) && (theitem != cancelItem)); + if (theitem == okItem) { + GetDialogItem(thedialog, editItem, &itemType, &itemHandle, + &itemRect); + GetDialogItemText(itemHandle, (StringPtr)&fileList); + p2cstr((StringPtr)fileList); + } + DisposeDialog(thedialog); + check = -1; + break; + case quietItem: + check = (modifiers ^= quietFlag) & quietFlag; + break; + case verboseItem: + check = (modifiers ^= verboseFlag) & verboseFlag; + break; + default: + break; + } + if (check == 0) + CheckItem(modifierHandle, theitem, false); + else if (check > 0) + CheckItem(modifierHandle, theitem, true); + break; + + case screenMenu: + switch (theitem) { + case pauseItem: + check = (modifiers ^= pauseFlag) & pauseFlag; + screenControl("p", check); + break; + case scrollItem: + check = (modifiers ^= scrollFlag) & scrollFlag; + screenControl("s", check); + break; + default: + break; + } + if (check == 0) + CheckItem(screenHandle, theitem, false); + else if (check > 0) + CheckItem(screenHandle, theitem, true); + break; + + case extractMenu: + switch (theitem) { + case screenItem: + check = (modifiers ^= screenFlag) & screenFlag; + break; + case junkItem: + check = (modifiers ^= junkFlag) & junkFlag; + break; + default: + break; + } + if (check == 0) + CheckItem(extractHandle, theitem, false); + else if (check > 0) + CheckItem(extractHandle, theitem, true); + break; + + case caseMenu: + switch (theitem) { + case insensitiveItem: + check = (modifiers ^= insensitiveFlag) & insensitiveFlag; + break; + case lowercaseItem: + check = (modifiers ^= lowercaseFlag) & lowercaseFlag; + break; + default: + break; + } + if (check == 0) + CheckItem(caseHandle, theitem, false); + else if (check > 0) + CheckItem(caseHandle, theitem, true); + break; + + case convertMenu: + switch (theitem) { + case autoItem: + CheckItem(convertHandle, autoItem, true); + CheckItem(convertHandle, binaryItem, false); + CheckItem(convertHandle, textItem, false); + modifiers &= (allFlags ^ textFlag); + modifiers |= autoFlag; + break; + case binaryItem: + CheckItem(convertHandle, autoItem, false); + CheckItem(convertHandle, binaryItem, true); + CheckItem(convertHandle, textItem, false); + modifiers &= (allFlags ^ (autoFlag | textFlag)); + break; + case textItem: + CheckItem(convertHandle, autoItem, false); + CheckItem(convertHandle, binaryItem, false); + CheckItem(convertHandle, textItem, true); + modifiers &= (allFlags ^ autoFlag); + modifiers |= textFlag; + break; + default: + break; + } + break; + + case overwriteMenu: + switch (theitem) { + case alwaysItem: + CheckItem(overwriteHandle, alwaysItem, true); + CheckItem(overwriteHandle, neverItem, false); + CheckItem(overwriteHandle, promptItem, false); + modifiers &= (allFlags ^ neverFlag); + modifiers |= overwriteFlag; + break; + case neverItem: + CheckItem(overwriteHandle, alwaysItem, false); + CheckItem(overwriteHandle, neverItem, true); + CheckItem(overwriteHandle, promptItem, false); + modifiers &= (allFlags ^ overwriteFlag); + modifiers |= neverFlag; + break; + case promptItem: + CheckItem(overwriteHandle, alwaysItem, false); + CheckItem(overwriteHandle, neverItem, false); + CheckItem(overwriteHandle, promptItem, true); + modifiers &= (allFlags ^ (neverFlag | overwriteFlag)); + break; + default: + break; + } + break; + + case infoMenu: + switch (theitem) { + case prtCommentItem: + check = (modifiers ^= prtCommentFlag) & prtCommentFlag; + break; + case prtHeaderItem: + check = (modifiers ^= prtHeaderFlag) & prtHeaderFlag; + break; + case prtTotalsItem: + check = (modifiers ^= prtTotalsFlag) & prtTotalsFlag; + break; + default: + break; + } + if (check == 0) + CheckItem(infoHandle, theitem, false); + else if (check > 0) + CheckItem(infoHandle, theitem, true); + break; + + case formatMenu: + switch (theitem) { + case filenameItem: + CheckItem(formatHandle, filenameItem, true); + CheckItem(formatHandle, longItem, false); + CheckItem(formatHandle, mediumItem, false); + CheckItem(formatHandle, shortItem, false); + modifiers &= (allFlags ^ (longFlag | mediumFlag | shortFlag)); + modifiers |= filenameFlag; + break; + case longItem: + CheckItem(formatHandle, filenameItem, false); + CheckItem(formatHandle, longItem, true); + CheckItem(formatHandle, mediumItem, false); + CheckItem(formatHandle, shortItem, false); + modifiers &= (allFlags ^ (filenameFlag | mediumFlag | shortFlag)); + modifiers |= longFlag; + break; + case mediumItem: + CheckItem(formatHandle, filenameItem, false); + CheckItem(formatHandle, longItem, false); + CheckItem(formatHandle, mediumItem, true); + CheckItem(formatHandle, shortItem, false); + modifiers &= (allFlags ^ (filenameFlag | longFlag | shortFlag)); + modifiers |= mediumFlag; + break; + case shortItem: + CheckItem(formatHandle, filenameItem, false); + CheckItem(formatHandle, longItem, false); + CheckItem(formatHandle, mediumItem, false); + CheckItem(formatHandle, shortItem, true); + modifiers &= (allFlags ^ (filenameFlag | longFlag | mediumFlag)); + modifiers |= shortFlag; + break; + default: + break; + } + break; + + default: + break; + + } + + HiliteMenu(0); + return; +} + + + +/* +** work with shortcuts +** +*/ + +static void dokey(myevent) EventRecord *myevent; +{ + char code; + + code = (char)(myevent->message & charCodeMask); + + if (myevent->modifiers & cmdKey) { + if (myevent->what != autoKey) { + domenu(MenuKey(code)); + } + } + + return; +} + + + +/* +** work with mouse-events +** +*/ + +static void domousedown(EventRecord *myevent) +{ + WindowPtr whichwindow; + long code; + + code = FindWindow(myevent->where, &whichwindow); + + switch (code) { + + case inSysWindow: + SystemClick(myevent, whichwindow); + break; + + case inMenuBar: + domenu(MenuSelect(myevent->where)); + break; + + } + + return; +} + + + +/* +** Do a little event-handling and let the user stop +** th current action +*/ + +void UserStop(void) +{ + EventRecord theEvent; + + if ( WaitNextEvent( everyEvent, &theEvent, 0, nil )) { + + switch (theEvent.what) { + + case mouseDown: + domousedown( &theEvent ); + break; + + case autoKey: + case keyDown: + { + if ((theEvent.modifiers & cmdKey) && + ((theEvent.message & charCodeMask) == '.')) + { + printf("\n\n <- User Canceled -> \n"); + exit(1); /* setjmp() must be already called */ + } + return; + } + + } /* switch (theEvent.what) */ + } /* if ( WaitNextEvent(... */ +} + + + +/* +** The Standalone Unzip starts here +** +*/ + +int main(argc, argv) int argc; char *argv[]; +{ + Uz_Globs saveGlobals; + Boolean haveEvent, useWNE; + short markChar; + char *ArchivePath, *ExtractPath; + OSErr err; + + FlushEvents(everyEvent, 0); + InitGraf(&qd.thePort); + InitFonts(); + InitWindows(); + InitMenus(); + TEInit(); + InitDialogs(nil); + InitCursor(); + + CONSTRUCTGLOBALS(); + + sprintf(UnzipVersion, "%d.%d%d%s of %s", UZ_MAJORVER, UZ_MINORVER, + UZ_PATCHLEVEL, UZ_BETALEVEL, UZ_VERSION_DATE); + sprintf(ZipinfoVersion, "%d.%d%d%s of %s", ZI_MAJORVER, ZI_MINORVER, + UZ_PATCHLEVEL, UZ_BETALEVEL, UZ_VERSION_DATE); + + c2pstr(UnzipVersion); + c2pstr(ZipinfoVersion); + + SysEnvirons(1, &sysRec); + useWNE = TrapAvailable(sysRec.machineType, _WaitNextEvent, ToolTrap); + + SetMenuBar(menubar = GetNewMBar(unzipMenuBar)); + DisposeHandle(menubar); + InsertMenu(GetMenu(screenMenu), -1); + InsertMenu(GetMenu(extractMenu), -1); + InsertMenu(GetMenu(caseMenu), -1); + InsertMenu(GetMenu(convertMenu), -1); + InsertMenu(GetMenu(overwriteMenu), -1); + InsertMenu(GetMenu(infoMenu), -1); + InsertMenu(GetMenu(formatMenu), -1); + AppendResMenu(appleHandle = GetMenuHandle(appleMenu), 'DRVR'); + modifierHandle = GetMenuHandle(modifierMenu); + screenHandle = GetMenuHandle(screenMenu); + extractHandle = GetMenuHandle(extractMenu); + caseHandle = GetMenuHandle(caseMenu); + convertHandle = GetMenuHandle(convertMenu); + overwriteHandle = GetMenuHandle(overwriteMenu); + infoHandle = GetMenuHandle(infoMenu); + formatHandle = GetMenuHandle(formatMenu); + DrawMenuBar(); + + screenOpen("Unzip"); + + modifiers = 0; + + GetItemMark(modifierHandle, quietItem, &markChar); + if (markChar) modifiers ^= quietFlag; + GetItemMark(modifierHandle, verboseItem, &markChar); + if (markChar) modifiers ^= verboseFlag; + + GetItemMark(screenHandle, pauseItem, &markChar); + if (markChar) modifiers ^= pauseFlag; + screenControl("p", markChar); + GetItemMark(screenHandle, scrollItem, &markChar); + if (markChar) modifiers ^= scrollFlag; + screenControl("s", markChar); + + GetItemMark(extractHandle, screenItem, &markChar); + if (markChar) modifiers ^= screenFlag; + GetItemMark(extractHandle, junkItem, &markChar); + if (markChar) modifiers ^= junkFlag; + + GetItemMark(caseHandle, insensitiveItem, &markChar); + if (markChar) modifiers ^= insensitiveFlag; + GetItemMark(caseHandle, lowercaseItem, &markChar); + if (markChar) modifiers ^= lowercaseFlag; + + GetItemMark(convertHandle, autoItem, &markChar); + if (markChar) modifiers ^= autoFlag; + GetItemMark(convertHandle, textItem, &markChar); + if (markChar) modifiers ^= textFlag; + + if ((modifiers & (autoFlag | textFlag)) == (autoFlag | textFlag)) { + CheckItem(convertHandle, textItem, false); + modifiers &= (allFlags ^ textFlag); + } else if (modifiers & (autoFlag | textFlag)) + CheckItem(convertHandle, binaryItem, false); + else + CheckItem(convertHandle, binaryItem, true); + + GetItemMark(overwriteHandle, alwaysItem, &markChar); + if (markChar) modifiers ^= overwriteFlag; + GetItemMark(overwriteHandle, neverItem, &markChar); + if (markChar) modifiers ^= neverFlag; + + if ((modifiers & (neverFlag | overwriteFlag)) == (neverFlag | overwriteFlag)) { + CheckItem(overwriteHandle, alwaysItem, false); + CheckItem(overwriteHandle, neverItem, false); + CheckItem(overwriteHandle, promptItem, true); + modifiers &= (allFlags ^ (neverFlag | overwriteFlag)); + } else if (modifiers & (neverFlag | overwriteFlag)) + CheckItem(overwriteHandle, promptItem, false); + else + CheckItem(overwriteHandle, promptItem, true); + + GetItemMark(infoHandle, prtCommentItem, &markChar); + if (markChar) modifiers ^= prtCommentFlag; + GetItemMark(infoHandle, prtHeaderItem, &markChar); + if (markChar) modifiers ^= prtHeaderFlag; + GetItemMark(infoHandle, prtTotalsItem, &markChar); + if (markChar) modifiers ^= prtTotalsFlag; + + GetItemMark(formatHandle, filenameItem, &markChar); + if (markChar) modifiers ^= filenameFlag; + GetItemMark(formatHandle, longItem, &markChar); + if (markChar) modifiers ^= longFlag; + GetItemMark(formatHandle, mediumItem, &markChar); + if (markChar) modifiers ^= mediumFlag; + GetItemMark(formatHandle, shortItem, &markChar); + if (markChar) modifiers ^= shortFlag; + + if (modifiers & longFlag) { + CheckItem(formatHandle, filenameItem, false); + CheckItem(formatHandle, mediumItem, false); + CheckItem(formatHandle, shortItem, false); + modifiers &= (allFlags ^ (filenameFlag | mediumFlag | shortFlag)); + } else if (modifiers & mediumFlag) { + CheckItem(formatHandle, filenameItem, false); + CheckItem(formatHandle, shortItem, false); + modifiers &= (allFlags ^ (filenameFlag | shortFlag)); + } else if (modifiers & shortFlag) { + CheckItem(formatHandle, filenameItem, false); + modifiers &= (allFlags ^ filenameFlag); + } + + command = ' '; + + stop = false; + while (!stop) { + SetCursor(&qd.arrow); + + if (useWNE) { + haveEvent = WaitNextEvent(everyEvent, &myevent, LONG_MAX, NULL); + } else { + SystemTask(); + haveEvent = GetNextEvent(everyEvent, &myevent); + } + + if (haveEvent) { + switch (myevent.what) { + + case activateEvt: + break; + + case keyDown: + case autoKey: + dokey(&myevent); + break; + + case mouseDown: + domousedown(&myevent); + break; + + case updateEvt: + screenUpdate((WindowPtr)myevent.message); + break; + + case mouseUp: + case keyUp: + break; + + default: + break; + + } + } + + if (command != ' ') { + char *s, **v, modifierString[32]; + Point p; + int m, n; + SFTypeList myTypes = {'TEXT', 'ZIP '}; + StandardFileReply myReply; + + SetPt(&p, 40, 40); + + StandardGetFile(nil, 2, myTypes, &myReply); + + ArchivePath = StrCalloc(512); + ExtractPath = StrCalloc(512); + + GetFullPathFromSpec(ArchivePath, &myReply.sfFile, &err); + + strcpy(ExtractPath,ArchivePath); + FindNewExtractFolder(ExtractPath, false); + + if (myReply.sfGood && (CheckMountedVolumes(ArchivePath) == 1)) { + modifierMask &= modifiers; + + s = modifierString; + + *s++ = '-'; + if ((command != 'x') && (command != 'Z')) *s++ = command; + + if (modifierMask) { + if (modifierMask & (autoFlag | textFlag)) *s++ = 'a'; + if (modifierMask & textFlag) *s++ = 'a'; + if (modifierMask & insensitiveFlag) *s++ = 'C'; + if (modifierMask & junkFlag) *s++ = 'j'; + if (modifierMask & lowercaseFlag) *s++ = 'L'; + if (modifierMask & neverFlag) *s++ = 'n'; + if (modifierMask & overwriteFlag) *s++ = 'o'; + if (modifierMask & quietFlag) *s++ = 'q'; + if (modifierMask & verboseFlag) *s++ = 'v'; + + if (modifierMask & prtCommentFlag) *s++ = 'z'; + if (modifierMask & prtHeaderFlag) *s++ = 'h'; + if (modifierMask & prtTotalsFlag) *s++ = 't'; + if (modifierMask & filenameFlag) *s++ = '2'; + if (modifierMask & longFlag) *s++ = 'l'; + if (modifierMask & mediumFlag) *s++ = 'm'; + if (modifierMask & shortFlag) *s++ = 's'; + } + + if (*(s - 1) == '-') s -= 1; + + *s++ = 'd'; + *s = '\0'; + + v = (char **)malloc(sizeof(char *)); + *v = "unzip"; + argc = 1; + + envargs(&argc, &v, NULL, NULL); + + argv = (char **)malloc((argc + 3) * sizeof(char *)); + + argv[m = 0] = (command == 'Z') ? "zipinfo" : "unzip"; + if (*modifierString) argv[++m] = modifierString; + argv[++m] = ExtractPath; + argv[++m] = ArchivePath; + for (n = 1; n < argc; n++) argv[n + m] = v[n]; + argv[argc += m] = NULL; + + free(v); + + for (n = 0; argv[n] != NULL; n++) printf("%s ", argv[n]); + printf("...\n\n"); + + memcpy(&saveGlobals, &G, sizeof(Uz_Globs)); + + unzip(__G__ argc, argv); + + memcpy(&G, &saveGlobals, sizeof(Uz_Globs)); + + ArchivePath = StrFree(ArchivePath); + ExtractPath = StrFree(ExtractPath); + + printf("\nDone\n"); + } + + fileList[0] = '\0'; + command = ' '; + } + } + + screenClose(); + + DESTROYGLOBALS(); + + ExitToShell(); + +return 0; +} + +const char *BOINC_RCSID_f7a4101d27 = "$Id: macunzip.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/pathname.c boinc-7.0.14+dfsg/zip/unzip/macos/source/pathname.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/pathname.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/pathname.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,728 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + pathname.c + + Function dealing with the pathname. Mostly C-string work. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include + +#include "pathname.h" +#include "helpers.h" +#include "macstuff.h" + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +const char ResourceMark[] = "XtraStuf.mac:"; /* see also macos.c */ + + +#include "zip.h" + + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +/* + *---------------------------------------------------------------------- + * + * FSpFindFolder -- + * + * This function is a version of the FindFolder function that + * returns the result as a FSSpec rather than a vRefNum and dirID. + * + * Results: + * Results will be simaler to that of the FindFolder function. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +OSErr +FSpFindFolder( + short vRefNum, /* Volume reference number. */ + OSType folderType, /* Folder type taken by FindFolder. */ + Boolean createFolder, /* Should we create it if non-existant. */ + FSSpec *spec) /* Pointer to resulting directory. */ +{ + short foundVRefNum; + long foundDirID; + OSErr err; + + err = FindFolder(vRefNum, folderType, createFolder, + &foundVRefNum, &foundDirID); + if (err != noErr) { + return err; + } + + err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", spec); + return err; +} + + +/* +** return volumename from pathname +** +*/ + +unsigned short GetVolumeFromPath(const char *FullPath, char *VolumeName) +{ +const char *VolEnd, *tmpPtr1; +char *tmpPtr2 = VolumeName; + +AssertStr(FullPath,"GetVolumeFromPath") + +for (VolEnd = FullPath; *VolEnd != '\0' && *VolEnd != ':'; VolEnd++) + ; +if (*VolEnd == '\0') return 0; + +for (tmpPtr1 = FullPath; tmpPtr1 != VolEnd;) + { + *tmpPtr2++ = *tmpPtr1++; + } + +*tmpPtr2 = '\0'; + +return (unsigned short) strlen(VolumeName); +} + + + +/***********************************/ +/* Function FindNewExtractFolder() */ +/***********************************/ + +char *FindNewExtractFolder(char *ExtractPath, Boolean uniqueFolder) +{ +char buffer[NAME_MAX], *tmpPtr, *namePtr; +char *last_dotpos = ExtractPath; +short count = 0, folderCount = 0; +OSErr err; +FSSpec Spec; +long theDirID; +Boolean isDirectory; +unsigned short namelen, pathlen = strlen(ExtractPath); +unsigned long ext_length = 0; +unsigned long num_to_cut = 0; +long firstpart_length = pathlen; + +AssertStr(ExtractPath,"FindNewExtractFolder ExtractPath == NULL") + +for (tmpPtr = ExtractPath; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') + { + folderCount++; + namePtr = tmpPtr; + } + +if (folderCount > 1) { + namelen = strlen(namePtr); +} else { + namelen = strlen(ExtractPath); +} + +if (uniqueFolder) { + for (count = 0; count < 99; count++) + { + memset(buffer,0,sizeof(buffer)); + + if (namelen >= 28) + ExtractPath[pathlen-2] = 0x0; + else + ExtractPath[pathlen-1] = 0x0; + + sprintf(buffer,"%s%d",ExtractPath,count); + GetCompletePath(ExtractPath, buffer, &Spec,&err); + err = FSpGetDirectoryID(&Spec, &theDirID, &isDirectory); + if (err == -43) break; + } +} else { + /* Look for the last extension pos */ + for (tmpPtr = ExtractPath; *tmpPtr; tmpPtr++) + if (*tmpPtr == '.') last_dotpos = tmpPtr; + + ext_length = strlen(last_dotpos); + + if (ext_length < 6) { /* up to 5 chars are treated as a */ + /* normal extension like ".html" or ".class" */ + int nameLength = last_dotpos - ExtractPath; + if (nameLength > 1) { + ExtractPath[nameLength] = 0x0; + } else { + ExtractPath[pathlen-1] = 0x0; + } + } else { + ExtractPath[pathlen-1] = 0x0; + } + + GetCompletePath(ExtractPath, ExtractPath, &Spec,&err); +} + +/* Foldernames must always end with a colon */ +sstrcat(ExtractPath,":"); +return ExtractPath; +} + + + +/* +** creates an archive file name +** +*/ + +void createArchiveName(char *thePath) +{ +char *tmpPtr, *namePtr; +short folderCount = 0; +unsigned short namelen, pathlen = strlen(thePath); + +if (thePath[pathlen-1] == ':') thePath[pathlen-1] = 0x0; + +for (tmpPtr = thePath; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') + { + folderCount++; + namePtr = tmpPtr; + } + +namelen = strlen(namePtr); + + /* we have to eliminate illegal chars: + * The name space for Mac filenames and Zip filenames (unix style names) + * do both include all printable extended-ASCII characters. The only + * difference we have to take care of is the single special character + * used as path delimiter: + * ':' on MacOS and '/' on Unix and '\' on Dos. + * So, to convert between Mac filenames and Unix filenames without any + * loss of information, we simply interchange ':' and '/'. Additionally, + * we try to convert the coding of the extended-ASCII characters into + * InfoZip's standard ISO 8859-1 codepage table. + */ + MakeCompatibleString(namePtr, '/', '_', '.', '-', -1); + + /* Avoid filenames like: "Archive..zip" */ +if (thePath[pathlen-1] == '.') + { + thePath[pathlen-1] = 0; + } + +if (folderCount >= 1) + { /* path contains at least one folder */ + + if (namelen >= 28) + { + pathlen = pathlen-4; + } + + thePath[pathlen] = '.'; + thePath[pathlen+1] = 'z'; + thePath[pathlen+2] = 'i'; + thePath[pathlen+3] = 'p'; + thePath[pathlen+4] = 0x0; + return; + } +else + { /* path contains no folder */ + FindDesktopFolder(thePath); + createArchiveName(thePath); + } +} + + + +/* +** finds the desktop-folder on a volume with +** largest amount of free-space. +*/ + +void FindDesktopFolder(char *Path) +{ +char buffer[255]; +FSSpec volumes[50]; /* 50 Volumes should be enough */ +short actVolCount, volIndex = 1, VolCount = 0; +OSErr err; +short i, foundVRefNum; +FSSpec spec; +UInt64 freeBytes; +UInt64 totalBytes; +UInt64 MaxFreeBytes; + +err = OnLine(volumes, 50, &actVolCount, &volIndex); +printerr("OnLine:", (err != -35) && (err != 0), err, __LINE__, __FILE__, ""); + +MaxFreeBytes = 0; + +for (i=0; i < actVolCount; i++) + { + XGetVInfo(volumes[i].vRefNum, + volumes[i].name, + &volumes[i].vRefNum, + &freeBytes, + &totalBytes); + + if (MaxFreeBytes < freeBytes) { + MaxFreeBytes = freeBytes; + foundVRefNum = volumes[i].vRefNum; + } + + if ((freeBytes == 0) && (MaxFreeBytes < freeBytes)) { + MaxFreeBytes = freeBytes; + foundVRefNum = volumes[i].vRefNum; + } + +} + + FSpFindFolder(foundVRefNum, kDesktopFolderType, + kDontCreateFolder,&spec); + + GetFullPathFromSpec(buffer, &spec , &err); + sstrcat(buffer,Path); + sstrcpy(Path,buffer); +} + + +/* +** return the path without the filename +** +*/ + +char *TruncFilename(char *DirPath, const char *FilePath) +{ +char *tmpPtr; +char *dirPtr = NULL; + +AssertStr(DirPath,"TruncFilename") +Assert_it(Spec,"TruncFilename","") + +sstrcpy(DirPath, FilePath); + +for (tmpPtr = DirPath; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') + dirPtr = tmpPtr; + +if (dirPtr) + *++dirPtr = '\0'; +else + printerr("TruncFilename: FilePath has no Folders", -1, + -1, __LINE__, __FILE__, FilePath); + +return DirPath; +} + + + +/* +** return only filename +** +*/ + +char *GetFilename(char *FileName, const char *FilePath) +{ +const char *tmpPtr; +const char *dirPtr = NULL; + +Assert_it(FileName,"GetFilename","") +Assert_it(FilePath,"GetFilename","") + +for (tmpPtr = FilePath; *tmpPtr; tmpPtr++) + { + if (*tmpPtr == ':') + { + dirPtr = tmpPtr; + } + } + +if (dirPtr) + { + ++dirPtr; /* jump over the ':' */ + } +else + { + return strcpy(FileName, FilePath); /* FilePath has no Folders */ + } + +return strcpy(FileName, dirPtr); +} + + + +/* +** return fullpathname from folder/dir-id +** +*/ + +char *GetFullPathFromID(char *CompletePath, short vRefNum, long dirID, + ConstStr255Param name, OSErr *err) +{ +FSSpec spec; + + *err = FSMakeFSSpecCompat(vRefNum, dirID, name, &spec); + printerr("FSMakeFSSpecCompat:", (*err != -43) && (*err != 0), *err, + __LINE__, __FILE__, ""); + if ( (*err == noErr) || (*err == fnfErr) ) + { + return GetFullPathFromSpec(CompletePath, &spec, err); + } + +return NULL; +} + + + +/* +** convert real-filename to archive-filename +** +*/ + +char *Real2RfDfFilen(char *RfDfFilen, const char *RealPath, + short CurrentFork, short MacZipMode, Boolean DataForkOnly) +{ + +AssertStr(RealPath,"Real2RfDfFilen") +AssertStr(RfDfFilen,"Real2RfDfFilen") + +if (DataForkOnly) /* make no changes */ + { + return sstrcpy(RfDfFilen, RealPath); + } + +switch (MacZipMode) + { + case JohnnyLee_EF: + { + sstrcpy(RfDfFilen, RealPath); + if (CurrentFork == DataFork) /* data-fork */ + return sstrcat(RfDfFilen, "d"); + if (CurrentFork == ResourceFork) /* resource-fork */ + return sstrcat(RfDfFilen, "r"); + break; + } + + case NewZipMode_EF: + { + switch (CurrentFork) + { + case DataFork: + { + sstrcpy(RfDfFilen, RealPath); + return RfDfFilen; /* data-fork */ + break; + } + case ResourceFork: + { + sstrcpy(RfDfFilen, ResourceMark); + sstrcat(RfDfFilen, RealPath); /* resource-fork */ + return RfDfFilen; + break; + } + default: + { + printerr("Real2RfDfFilen:", -1, -1, + __LINE__, __FILE__, RealPath); + return NULL; /* function should never reach this point */ + } + } + break; + } + default: + { + printerr("Real2RfDfFilen:", -1, -1, __LINE__, __FILE__, RealPath); + return NULL; /* function should never reach this point */ + } + } + +printerr("Real2RfDfFilen:", -1, -1, __LINE__, __FILE__, RealPath); +return NULL; /* function should never come reach this point */ +} + + + +/* +** convert archive-filename into a real filename +** +*/ + +char *RfDfFilen2Real(char *RealFn, const char *RfDfFilen, short MacZipMode, + Boolean DataForkOnly, short *CurrentFork) +{ +short length; +int result; + +AssertStr(RfDfFilen,"RfDfFilen2Real") + +if (DataForkOnly || + (MacZipMode == UnKnown_EF) || + (MacZipMode < JohnnyLee_EF)) + { + *CurrentFork = DataFork; + return sstrcpy(RealFn,RfDfFilen); + } + +result = strncmp(RfDfFilen, ResourceMark, sizeof(ResourceMark)-2); +if (result == 0) + { + MacZipMode = NewZipMode_EF; + } + +switch (MacZipMode) + { + case JohnnyLee_EF: + { + sstrcpy(RealFn, RfDfFilen); + length = strlen(RealFn); /* determine Fork type */ + if (RealFn[length-1] == 'd') *CurrentFork = DataFork; + else *CurrentFork = ResourceFork; + RealFn[length-1] = '\0'; /* simply cut one char */ + return RealFn; + break; + } + + case NewZipMode_EF: + { /* determine Fork type */ + result = strncmp(RfDfFilen, ResourceMark, sizeof(ResourceMark)-2); + if (result != 0) + { + *CurrentFork = DataFork; + sstrcpy(RealFn, RfDfFilen); + return RealFn; /* data-fork */ + } + else + { + *CurrentFork = ResourceFork; + if (strlen(RfDfFilen) > (sizeof(ResourceMark) - 1)) + { + sstrcpy(RealFn, &RfDfFilen[sizeof(ResourceMark)-1]); + } + else RealFn[0] = '\0'; + return RealFn; /* resource-fork */ + } + break; + } + default: + { + *CurrentFork = NoFork; + printerr("RfDfFilen2Real():", -1, MacZipMode, + __LINE__, __FILE__, RfDfFilen); + return NULL; /* function should never reach this point */ + } + } + +printerr("RfDfFilen2Real():", -1, MacZipMode, __LINE__, __FILE__, RfDfFilen); +return NULL; /* function should never reach this point */ +} + + + +/* +** return the applications name (argv[0]) +** +*/ + +char *GetAppName(void) +{ +ProcessSerialNumber psn; +static Str255 AppName; +ProcessInfoRec pinfo; +OSErr err; + +GetCurrentProcess(&psn); +pinfo.processName = AppName; +pinfo.processInfoLength = sizeof(pinfo); +pinfo.processAppSpec = NULL; + +err = GetProcessInformation(&psn,&pinfo); +AppName[AppName[0]+1] = 0x00; + +return (char *)&AppName[1]; +} + + + +/* +** return fullpathname from FSSpec +** +*/ + +char *GetFullPathFromSpec(char *FullPath, FSSpec *Spec, OSErr *err) +{ +Handle hFullPath; +short len; + +Assert_it(Spec,"GetFullPathFromSpec","") + +*err = FSpGetFullPath(Spec, &len, &hFullPath); +printerr("FSpGetFullPath:", (*err != -43) && (*err != 0), *err, + __LINE__, __FILE__, ""); + +memmove(FullPath, (Handle) *hFullPath, len); +FullPath[len] = '\0'; /* make c-string */ + +DisposeHandle((Handle)hFullPath); /* we don't need it any more */ + +printerr("Warning path length exceeds limit: ", len >= NAME_MAX, len, + __LINE__, __FILE__, " chars "); + +return FullPath; +} + + + + +/* +* This function expands a given partial path to a complete path. +* Path expansions are relative to the running app. +* This function follows the notation: +* 1. relative path: +* a: ":subfolder:filename" -> ":current folder:subfolder:filename" +* b: "::folder2:filename" -> folder2 is beside the current +* folder on the same level +* c: "filename" -> in current folder +* +* An absolute path will be returned. + +The following characteristics of Macintosh pathnames should be noted: + + A full pathname never begins with a colon, but must contain at + least one colon. + A partial pathname always begins with a colon separator except in + the case where the file partial pathname is a simple file or + directory name. + Single trailing separator colons in full or partial pathnames are + ignored except in the case of full pathnames to volumes. + In full pathnames to volumes, the trailing separator colon is required. + Consecutive separator colons can be used to ascend a level from a + directory to its parent directory. Two consecutive separator colons + will ascend one level, three consecutive separator colons will ascend + two levels, and so on. Ascending can only occur from a directory; + not a file. +*/ + +char *GetCompletePath(char *CompletePath, const char *name, FSSpec *Spec, + OSErr *err) +{ +Boolean hasDirName = false; +char currentdir[NAME_MAX]; +char *tmpPtr; +unsigned short pathlen; + +AssertStr(name,"GetCompletePath") +Assert_it(Spec,"GetCompletePath","") +Assert_it((CompletePath != name),"GetCompletePath","") + +for (tmpPtr = name; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') hasDirName = true; + +if (name[0] != ':') /* case c: path including volume name or only filename */ + { + if (hasDirName) + { /* okey, starts with volume name, so it must be a complete path */ + sstrcpy(CompletePath, name); + } + else + { /* only filename: add cwd and return */ + getcwd(currentdir, NAME_MAX); + sstrcat(currentdir, name); + sstrcpy(CompletePath, currentdir); + } + } +else if (name[1] == ':') /* it's case b: "::folder2:filename" */ + { + printerr("GetCompletePath ", -1, *err, __LINE__, __FILE__, "not implemented"); + /* it's not yet implemented; do we really need this case ?*/ + return NULL; + } +else /* it's case a: ":subfolder:filename" */ + { + getcwd(CompletePath, NAME_MAX); /* we don't need a second colon */ + CompletePath[strlen(CompletePath)-1] = '\0'; + sstrcat(CompletePath, name); + } + +pathlen = strlen(CompletePath); +*err = FSpLocationFromFullPath(pathlen, CompletePath, Spec); + +return CompletePath; +} + + + +char *MakeFilenameShorter(const char *LongFilename) +{ +static char filename[35]; /* contents should be never longer than 32 chars */ +static unsigned char Num = 0; /* change the number for every call */ + /* this var will rollover without a problem */ +char tempLongFilename[1024], charnum[5]; +char *last_dotpos = tempLongFilename; +unsigned long full_length = strlen(LongFilename); +unsigned long ext_length = 0; +unsigned long num_to_cut = 0; +long firstpart_length; +char *tmpPtr; +short MaxLength = 31; + +if (full_length <= MaxLength) /* filename is not long */ + { + return strcpy(filename,LongFilename); + } + +Num++; +strcpy(tempLongFilename,LongFilename); + +/* Look for the last extension pos */ +for (tmpPtr = tempLongFilename; *tmpPtr; tmpPtr++) + if (*tmpPtr == '.') last_dotpos = tmpPtr; + +ext_length = strlen(last_dotpos); +firstpart_length = last_dotpos - tempLongFilename; + +if (ext_length > 6) /* up to 5 chars are treated as a */ + { /* normal extension like ".html" or ".class" */ + firstpart_length = 0; + } + +num_to_cut = full_length - MaxLength; + +/* number the files to make the names unique */ +sprintf(charnum,"~%x", Num); +num_to_cut += strlen(charnum); + +if (firstpart_length == 0) + { + firstpart_length = full_length; + tempLongFilename[firstpart_length - num_to_cut] = 0; + sprintf(filename,"%s%s", tempLongFilename, charnum); + } +else + { + tempLongFilename[firstpart_length - num_to_cut] = 0; + sprintf(filename,"%s%s%s", tempLongFilename, charnum, last_dotpos); + } + +return filename; +} + +const char *BOINC_RCSID_20a7780104 = "$Id: pathname.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/pathname.h boinc-7.0.14+dfsg/zip/unzip/macos/source/pathname.h --- boinc-7.0.7+dfsg/zip/unzip/macos/source/pathname.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/pathname.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,64 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +#ifndef PATHNAME_H +#define PATHNAME_H 1 + + +char *StripPartialDir(char *CompletePath, + const char *PartialPath, const char *FullPath); + +char *Real2RfDfFilen(char *RfDfFilen, const char *RealPath, short CurrentFork, + short MacZipMode, Boolean DataForkOnly); +char *RfDfFilen2Real(char *RealFn, const char *RfDfFilen, short MacZipMode, + Boolean DataForkOnly, short *CurrentFork); + +unsigned short GetVolumeFromPath(const char *FullPath, char *VolumeName); +char *GetCompletePath(char *CompletePath, const char *name, FSSpec *Spec, + OSErr *err); +char *TruncFilename(char *DirPath, const char *FilePath); +char *GetFilename(char *CompletePath, const char *name); +char *GetFullPathFromSpec(char *CompletePath, FSSpec *Spec, OSErr *err); +char *GetFullPathFromID(char *CompletePath, short vRefNum, long dirID, + ConstStr255Param name, OSErr *err); + +char *GetAppName(void); +void createArchiveName(char *Path); +void FindDesktopFolder(char *Path); +char *FindNewExtractFolder(char *ExtractPath, Boolean uniqueFolder); +OSErr FSpFindFolder( + short vRefNum, /* Volume reference number. */ + OSType folderType, /* Folder type taken by FindFolder. */ + Boolean createFolder, /* Should we create it if non-existant. */ + FSSpec *spec); /* Pointer to resulting directory. */ + +char *MakeFilenameShorter(const char *LongFilename); + +/* +Rule: UnKnown_EF should always be zero. + JohnnyLee_EF, NewZipMode_EF should always greater than all + other definitions +*/ +#define UnKnown_EF 0 +#define TomBrownZipIt1_EF 10 +#define TomBrownZipIt2_EF 20 +#define JohnnyLee_EF 30 +#define NewZipMode_EF 40 + + + +#define ResourceFork -1 +#define DataFork 1 +#define NoFork 0 + + +#ifndef NAME_MAX +#define NAME_MAX 1024 +#endif + +#endif /* PATHNAME_H */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/sxunzip.c boinc-7.0.14+dfsg/zip/unzip/macos/source/sxunzip.c --- boinc-7.0.7+dfsg/zip/unzip/macos/source/sxunzip.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/sxunzip.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,146 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include "unzvers.h" +#include + + +#ifdef USE_SIOUX +# include +# include +# include +# include +#endif /* USE_SIOUX */ + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +char fileList[256]; + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +int UzpMain(int argc,char **argv); + +char *GetUnZipLocalVersion(void); +char *GetUnZipInfoVersions(void); +int macgetch(void); +void UserStop(void); + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +#ifndef MacStaticLib +#ifndef MACUNZIP_STANDALONE + +/* +Program execution starts here with Metrowerks SIOUX-Console */ +int main(int argc,char **argv) +{ + int return_code; + + SIOUXSettings.asktosaveonclose = FALSE; + SIOUXSettings.showstatusline = TRUE; + + SIOUXSettings.columns = 100; + SIOUXSettings.rows = 40; + + argc = ccommand(&argv); + + return_code = UzpMain(argc,argv); + + printf("\n\n Finish %d",return_code); + + return return_code; +} + + + +int macgetch(void) +{ + WindowPtr whichWindow; + EventRecord theEvent; + char c; /* one-byte buffer for read() to use */ + + do { + SystemTask(); + if (!GetNextEvent(everyEvent, &theEvent)) + theEvent.what = nullEvent; + else { + switch (theEvent.what) { + case keyDown: + c = theEvent.message & charCodeMask; + break; + case mouseDown: + if (FindWindow(theEvent.where, &whichWindow) == + inSysWindow) + SystemClick(&theEvent, whichWindow); + break; + case updateEvt: + break; + } + } + } while (theEvent.what != keyDown); + + printf("*"); + fflush(stdout); + + return (int)c; +} + + +/* SIOUX needs no extra event handling */ +void UserStop(void) +{ +} + +#endif /* #ifndef MACUNZIP_STANDALONE */ +#endif /* #ifndef MacStaticLib */ + + + + +char *GetUnZipLocalVersion(void) +{ +static char UnZipVersionLocal[50]; + +memset(UnZipVersionLocal,0,sizeof(UnZipVersionLocal)); + +sprintf(UnZipVersionLocal, "[%s %s]", __DATE__, __TIME__); + +return UnZipVersionLocal; +} + + + + +char *GetUnZipInfoVersions(void) +{ +static char UnzipVersion[200]; + +memset(UnzipVersion,0,sizeof(UnzipVersion)); + +sprintf(UnzipVersion, "Unzip Module\n%d.%d%d%s of %s", UZ_MAJORVER, + UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, UZ_VERSION_DATE); + +return UnzipVersion; +} + +const char *BOINC_RCSID_d6fe878ae3 = "$Id: sxunzip.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/source/unzip_rc.hqx boinc-7.0.14+dfsg/zip/unzip/macos/source/unzip_rc.hqx --- boinc-7.0.7+dfsg/zip/unzip/macos/source/unzip_rc.hqx 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/source/unzip_rc.hqx 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,92 @@ +(This file must be converted with BinHex 4.0) +:#d&bBfKTGQ8ZFfPd!&0*9%46593K!*!%%23!N!65[90*9#%!!J!!%24b6'&e!TN +!N!-@QCN0!!KeERTTF#jbBaEf1!6lrh3!6%TU!*!$J!#3"!8$bq6#IJ#3&!Y[!*! +%rj!%8P053e*6483K!,'+E[HbPeU-!!!FrJ#3"JVT!*!%KNX!N!MBC3`!&CjkAB5 +YAEECeXrEK!)``L9EH[`m0leZ$pK[bPfEGECTRT`1q"0'1'%ARKUq$XpGhcEqDm, +*FGHDf*-4Mh#bM``fZAf%Cq6jNGq%Gf56#5I()i``-Q+E8"lEK*(EC%,**Z`f18D +1NpYNXM*bE0+[E"AiqVj*hqGQK"ej6UDEE,*I-YTNX-P[XJ&H"ddL4#+%2,fHN!# +0m2Sq-Bc'B(8eT@q`L0,ClAYMACV4fd9IS-QiYVdUPCM9NNe'*%)E`Z(1aSKUUUE +CX+Ya6$A-aQ$#4`D("MX(KlUlYK$b$[N,Q#ZIAjp,h1E)jTaQ@[5jj'aMm)dJT3H +95'mLUJ-KVS(EL"+,kC%'fV+0QYUXUNGTJfNCUBMP#$8fIKp8iG'!#TU0!+%25MZ +4(ZiB9#-dSL9($G5K0+`B5V`$2"e&SU""'SBUGk3Kh)#Lf`pTb@G01S**TP(G3+m +l(a#Y#4A*@X,5cBPYY&02cKMDq)4&hf[C[IYli+FVF,kq194e6$iQfckiZ6QilGR +fl*Bl'c1"mi3!2a1kFbal,'[RR)YSk%ipij-!A1i$G)lF',JfIq(%m6RILH2c&`D +Z(ERKk2cGamE-PMZB!F`%U%"@-$ZKU[VQIrVBd%bVNTZR@l0[jN!MPmZq1GfDh%b +V0[c$ab5TB&fJ4fSKKk5il"[i!FHKD4b5[L(l1j9%4)dacR0N)pNMaGI`[V%1d+e +5['VR8&+0D0%C'Y9L+NdSFEA"E+43QdR&XP3MJDLPde'9UY1@S83XG@`2kUmQ$A! +rNqC)ZUX,m+mcr-I5ViJNXAB)C`k$Vj%QXNVUN@i3ZG$"!ZhKF*q!$[@'+GIFfJX +Y!Q+TCl#lKe(5%-heG[Brik%3rejBI&q5bHqN0MI[Q0@I5'e9lidN`!Jph,b0MXj +3hRYk`dh"X'jBQTi`D81NNEEXhV8Ek800G(m6(BTVeN46-!LkV)-HKTi*j(jebTT +5$*8UL6(@Vk*D!J)pGY5NLT@h&Ka53@%d08i003Nf65`E*@90k!C6JTkh(GKQfp6 +4e14d5a1%6HTB#V2f&'qHmRHDGZjBaEXM3N"C"8@6KS`I*bF!E3"-(0Zf2jI@V@i +Ie9-@EkJAN5CYG`6HjYA(Y6ir)[G!H9Gema+q5!B)UF68A55pJ26"#('43$9@$UZ +)$$Y'eR4TCM+Qc%"RMXI9"&"GMc8pKQT1U!Q+aNa'$)iNaa4,c61iP2aL5V2)Lc` +Cqb'AAJirP,[(0%XH5BcTj*!!SeI4QE,)+k#,m`$TK,5%&G05b8Z!G-C8aA!-r)* +9KI#5qe2e3Ae-LfS`3p9d6dGLU6%h&@!'bM1Q`Y`M'%0Z(SFLKJTT(%LbaN!fR46 +%@P%X([-8@FdkJdXi+k4@3B*9'+Rd-CAeXjG8Be3h!9[,FY016ZC6ETFGV`iV+91 +PR)553B$d@#c2`(1FR#UB@-V1QNi&6DJ*8l1d5FfD)CY1NpT126%*j3!#2$QEjNQ +G)`cGbA&)528!k%`C'P6CTM1NEP#0kj-U$([@"1f(NF"dV,H6q@)@bJDVfe1@(PF +X,B*TmhGS#F@BB5eJ'+B(4hNh19-`iARhYmHQP"PQYV*I"4BLrV#Kaj-JcZ[J9A+ +f)&kX5(q2ES"lXZNF#BB0Q#UG[X@k%fIX9a@FXYN)`aR$ZUA%h!`I)+F,rTEVUUi +hB3S8CeFV-X'D4CmqT4S4e",e`V1eMj`VZ"%*UX%QK+1@53F5-9iJIATLR+AlS$U +QTH+X"SCJGR#U"SBUk(%q!0JEbNNqkT0b)Cq8PRa!KAJG['ZPh%Fr*'rrmJKjpf` +[@AJ,XAEblNF+@8K,8Xl9JKLed32c)RbK4c"lKS6X-i55+[BqBfI)AL!$Y`+5k,j +ALkKYCq(056RE*YN[AZ5@00&$J5(mh`(rKCIjKmd++c8X*(%bJ1-V6[!+iRrQjim +,#apcA'Lj1&GN12#bb(I`l-,#!QJc(F&R4rLk`U4V,f&dem-A--5mC$,4k15N[X! +%-TGU5HBe[pm26-5cQ8Z3!#`JN!#lk)rBUff5m41r2jTNZ+Y(#-1C([TjMH0-MbF +DFHlA``%+&[2e-*r&I+203Md`[&3[D!(2HH%$mqiF*`q&HR420LKJ3ACaF-D1Lhm +Xl,LiPd@ZRrIP,K(bYS[(SDmXcI"mqUNJfJ!9$hNH6j&ImR@2RcIQmF9aS@8q!a" +LCiAr)+&Z[Y`-)qPj&l5G2*EiH3((MNdZ`rNYh-ZB#Nq!!!BSm!NmH!X&aFbL'K+ +%!VV1'`3kj`-6qH#5j2NVrV!JlrPcme2LHri+"Hee#6HrprNLI&aIrkV24rAYC20 +[r5(2Ip*I4"EFipCrZGkAcP)p21b2+mF'Lb9f@AQ&ch1@6p%brf&b22k6j$c+9eZ +p[Ilkl6UlEVlHVV&VlYE-eGYeYq[@Akqh!jr*[N#fhUkhiF%,I,J-`b#3!)1E"3p +TCh)KY6J@,8"`"6#-NB1cA5h%YReVr"KfRFbYD*6(ij1e'-038ZYjm25j(jL0(#i +$lU+F'()BNFhd5dA'#YXT0e%F'2''i"@,D!#m1J61$VC1865X&b)1K",1Qf'q9hV +kHArhr4Ib)mTjTAiGF,P91AK"$@GkCi4daM`SVq)-jq$1Z1[L!R"a-4pl1%GF2m+ +LJ`I&b1RJ`!#mN!!Ga2-cp!0qILH3!-IC6S$MqCd!`r-l!DlRl33BRYm*Z(TL*q$ +k%6X"efq"AmErRFqPHLML6+@!)k')BlplJZIVhA%YC[S[*aAlC[%X#bcaEbk0%d[ +mXX!+[b4`Mem8@-j21BYPrXfPL@L*cc4+,G8jbrcbc2U9IQ%-,16K2VmJi2*,1i9 +lr1*1iEkr`NlK(Vqi8hMXMmhmMr2cN!"IfKPmaIqI"rAjCApic2F%([*GK8GmCkl +l$rq,G8+Tc8XN!+YH'Ii9bHcA5c@m9@Piff45Ha8Q")S[U0'd*1*em+iP&2EG&2E +G&2EG&2EG&2EG&2EG6-I9%V(`d3a[+l`KmEB'B$*%r`%l#fm1AK[I0,cRiEhU[*! +!V[qq`JGiYE2`fZ*&$#HYYY"9fN`ED+XYfr)m[,Cm9jjM-IA63#JAZKU#Ef'KV,e +mJ@Z(F(HHCRAQE-ECTPH-cJb(QCr9h"8hCRX1L2QH!f+fjd!Fpac)a`(1dh0L2QM +#QS6(h"KcMRZ0jAeXH@TcF6&#HAa8+24"E((,Z1JR,Llf(N8F##@FQh6eKHN(rXT +iSERaPPV%miTZcV%)5Yp#jFASYDdI!Q@cEjDX`Amc)(#ZFf4`#(la[G291p`(q1@ +Z[S&pS2(APh[lm9rGVIDq3Ib2jH0ri+5DM[iZq+NPIC2rN!#6GQJ4%hN(Y%KX&m5 +MJ'-m#rLh)Ii4i"LrIl#MI4"d,acXlKq"$hPri$rYI)2iVm-G%Ab)9Ec!X,4Y3fY +mQ@&c$2XC`iicl"1'R8"-qTDM!IkQ('d`ShXm(rq[ahP2HjKdhF-#Sr,LF!2AHkT +$AKbr)I6fbB[DK-"Dj-@*2Z'T&E#6R&H6!#c'HHYlS0*HjEa9VmZ,"lSiEqeHm24 +ccU[p,RKkKI-fe)$H"jaA&38IdjbhCSqmq2T@iHmhS,G"q$X(HMrP[!TH(aaM[lq +i4X9EAUh)M8kY`+U$IIMM(m)U0c2X&,EA5S9Kmk3H-&jEC`M8PAmE`ml#TbRLeaK +f'Rjh%MrlA`HrLm"r!,S,1iHKdkb9&dFq+(ma@rSXY[aYbrf"9Ia1YIchbIQq0$# +98!hijQMU+51LrKm0!!YeERTTF(0QBbjbB`6lrh3!6%TU!*!$J!#3"!8$bq5qFJ# +3%4B!N!MrN!458e*$8P0&4#%!XBTZpl+A@GJ!!!Nf!*!'"48!N!6(q`#3##3`)d3 +1)LTG595#b[aFefGjh@l'cV8kJ@fHHiB5P2Af)&[1-QPjVLHVETBc4L,Qdf2KF'" +@M"[F-'SAciTchCMP9Ch8(HN1G%GDJY1)ER1JFEr[AU,qfNBdLf6$C,-cQfGjcr8 +beLR&fY@%"X)F'@jR5)ULa@TCBadcj-eF5l"D`p5c-E-J0'M@k9#&8JBUD!i#K$i +%&K$d((mhMl'BR1R9KBl!`T)ZTIh`G*-J5M5))DpihM$D3#%kj'`j-p0JDd6)3N, +6KGHK[bI@T,JJPkQQCU6U@%$,$1Pb-Q@bIBe,PT`'2r1Sb%Sj`p&)Cc[5,QIADKX +R2`$Hee85N!$8'&FX6J5G3%XGk5Tl,[b"KMV5CI-M'4k6%d-X)5ZFU9+DeaUc',a +A5DE*G9@J04VVjB`2QVS8-hPmUG$A85fq&XGf'Ji'JIH`m0@1qmMKX-BGhK,4q*' +2bKfYMPq5kmL%UTV$iBim0,8pc'c0d(D-!24-DhG,Ud@T3lHN24#D2ST#rd,HiPD +(Lcl[D"V*(92pQU1TE0mD&8D%FaVU@1m3XfGVE0MR$@Zk+@ZU`@TMXeMMNX9,"$h +2apTm,*+@cC62ki8Zh4$6X41!R-d(c!&*jda5ipBmPXSUQNUPcf#51@E01m+K8*4 +0-TeRB0-UaUB`DkBdh9+#Q4i#YV9TS#rE2pMS3a[&ieQ4@S#p(2L&[[RcbZhT4`J +S@Ja0(4*I5KF!$3FQ29XZpe[(a)VQALeVfJ[MH8&MjKB%lV1R6p5kZ-(9L[&@YpJ +Mr$ae%4@,k*kRGL"C@*(2%kC4%H8#b5mB-3CP)k0)3pJmFp*F"GAZ8GqUFb2&95D +-@5fLpjT-A$,j'%18iXr-bLDGDBGK3CD1$(Hk@Z+bk9UMaM8kZk$("E)QVBFZlMX +53#`jNQ&b@JXN6H'5AM#`dCS+b8[E0pfG@Pa1b,J4p#f$-58E(iN#c-"iPR2XGBQ +40j*MANcRL(&maPS-j+3GHD)K2b`1jZe8B@d'1q(1[*3@!CIJC+L-FfZI6H*kVfB +!ml@b5D8GBj(EIZGB&jDb"QFf#5@p!98UbKJ$he+km)J*GcV'J#4-P+L'E-VpXMP +%*ee%P3&0lFFiJ)!B6TqG9&d3KZdN1i3VD6adjZXbTUc2,UVZjQQYRq1BU8Qa%%i +#Dm&k+ZdmQN+R38eceY65NLR(4'a+[ka+qT!!Y3,bF6h)bYI3VL-Q(0k9cFU!0'5 +C9B3i@)JS`lU@cN"FR)0TG2%4mID*9,CU1Yb6NbiKEeM(e56[,EUG4)D&5q++T#H +-b-MA6%NC56L6,MVLVfZZI0T9)irLE9B65eR,)NXEi(T-D%Rc)UBeKLijiNB+5#q +@%*jD9YDP+[D!C'PUdSTl()r,fE3e!hQi(Ha6J`G2aaR0rpA'(6-H"XAN1*rFBJj +")$IB(Ze!2c[Bd389F[kkpT!!Z-rZEZlSaPiR0rP$3A&hEFTI@$XkrFhGiU)Dea* +DJh[MN!"pJ6&RNb1A'lR@@)'aTpKA(H90YV!kJ6&GVVq+RTcRrF,e9mQp0Sqm0DT +"[MkQ0p$e9r+b21B$62,%R1ckUp5$0Smp$Eci2$BD@,LY`@k#aMSk2jGc8C(Ep9I +YLqN#`H2@J,I+AV6F)@$ef*F'c&8UmRJG@bXBf%r!@iRP%ihCdJ&V`#kj4Pa#J"9 +MlM1!E3&@J+Q&I"@r"SEM24d6CiD24hkhZYe,Z'XGfMGEqjVUfLRb@KJrS()Gjk0 +9bqSarMi!*p!!!!: diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/UnZp.h boinc-7.0.14+dfsg/zip/unzip/macos/UnZp.h --- boinc-7.0.7+dfsg/zip/unzip/macos/UnZp.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/UnZp.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,151 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + UnZp.h + + This header-files is global to the project Unzip standalone. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define MACUNZIP_STANDALONE +#define MACUNZIP + +/* These functions are defined as a macro instead of a function. +so we have to undefine them for replacing */ +#undef getc +#undef getchar +#undef putchar +#undef putc + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + +/*****************************************************************************/ +/* Includes standard headers */ +/*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + +/* +#define MAC_DEBUG 1 + */ + + +#ifdef MAC_DEBUG +#define LOG_DEBUG 7 /* debug-level messages */ +int Print2Syslog(UInt8 priority, const char *format, ...); +#include + + +#define Notify(msg) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ + msg, __FILE__, __LINE__); \ + } + + + +#define Assert_it(cond,msg,kind) \ + { \ + if (!(cond)) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s failed: [%s] cond: [%s] (file: %s line: %d)", \ + kind, msg, #cond, __FILE__, __LINE__); \ + } \ + } + + + +#define AssertBool(b,msg) \ + Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) + + + +#define AssertStr(s,msg) \ + { \ + int s_i = 0; \ + Assert_it ((s),(msg),("1. AssertStr ")); \ + while ((s)[s_i]) { \ + Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ + ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ + s_i++; \ + } \ + } + + + +#define AssertTime(t,msg) \ + Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ + ((t).tm_min >= 0) && ((t).tm_min < 60) && \ + ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ + ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ + ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ + ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ + ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) + + + +#define AssertIntRange(myvalue,minimum,maximum, msg) \ + Assert_it (((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), \ + msg,("AssertIntRange ")) + + + +#define AssertStrNoOverlap(str1,str2,msg) \ + { \ + long s_i = 0; \ + AssertStr((str1),(msg)) \ + AssertStr((str2),(msg)) \ + if ((str1) < (str2)) \ + { \ + s_i = strlen((str2)); \ + Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ + } \ + else \ + { \ + s_i = strlen((str1)); \ + Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ + } \ + } \ + + + + +#else /* !MAC_DEBUG */ +#define Assert_it(cond,msg,kind) +#define AssertBool(b,msg) +#define AssertStr(s,msg) +#define AssertTime(t,msg) +#define AssertIntRange(myvalue,minimum,maximum,msg) +#define AssertStrNoOverlap(str1,str2,msg) +#endif /* ?MAC_DEBUG */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/UnZpLib.h boinc-7.0.14+dfsg/zip/unzip/macos/UnZpLib.h --- boinc-7.0.7+dfsg/zip/unzip/macos/UnZpLib.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/UnZpLib.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,161 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + UnZpLib.h + + This header-files is global to the project UnZpLib. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define MacStaticLib +#define MACUNZIP + +/* These functions are defined as a macro instead of a function. +so we have to undefine them for replacing (see printf.c) */ +#undef getc +#undef getchar +#undef putchar +#undef putc + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + +/* +#define DEBUG_TIME + */ + + +#define USE_EF_UT_TIME + +/* since we have no TZ environment variable on Macs + this option must be disabled */ +#undef IZ_CHECK_TZ + + +/*****************************************************************************/ +/* Includes standard headers */ +/*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* +#define MAC_DEBUG 1 + */ + + +#ifdef MAC_DEBUG +#define LOG_DEBUG 7 /* debug-level messages */ +int Print2Syslog(UInt8 priority, const char *format, ...); +#include + + +#define Notify(msg) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ + msg, __FILE__, __LINE__); \ + } + + + +#define Assert_it(cond,msg,kind) \ + { \ + if (!(cond)) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s failed: [%s] cond: [%s] (file: %s line: %d)", \ + kind, msg, #cond, __FILE__, __LINE__); \ + } \ + } + + + +#define AssertBool(b,msg) \ + Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) + + + +#define AssertStr(s,msg) \ + { \ + int s_i = 0; \ + Assert_it ((s),(msg),("1. AssertStr ")); \ + while ((s)[s_i]) { \ + Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ + ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ + s_i++; \ + } \ + } + + + +#define AssertTime(t,msg) \ + Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ + ((t).tm_min >= 0) && ((t).tm_min < 60) && \ + ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ + ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ + ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ + ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ + ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) + + + +#define AssertIntRange(myvalue,minimum,maximum, msg) \ + Assert_it (((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), \ + msg,("AssertIntRange ")) + + + +#define AssertStrNoOverlap(str1,str2,msg) \ + { \ + long s_i = 0; \ + AssertStr((str1),(msg)) \ + AssertStr((str2),(msg)) \ + if ((str1) < (str2)) \ + { \ + s_i = strlen((str2)); \ + Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ + } \ + else \ + { \ + s_i = strlen((str1)); \ + Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ + } \ + } \ + + + + +#else /* !MAC_DEBUG */ +#define Assert_it(cond,msg,kind) +#define AssertBool(b,msg) +#define AssertStr(s,msg) +#define AssertTime(t,msg) +#define AssertIntRange(myvalue,minimum,maximum,msg) +#define AssertStrNoOverlap(str1,str2,msg) +#endif /* ?MAC_DEBUG */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/UnZpPrj.xml boinc-7.0.14+dfsg/zip/unzip/macos/UnZpPrj.xml --- boinc-7.0.7+dfsg/zip/unzip/macos/UnZpPrj.xml 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/UnZpPrj.xml 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,9943 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + Unzip Sioux (68k) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS 68K Linker + PreLinker + PostLinker + TargetnameUnzip Sioux (68k) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeOBJ + FileExtension + CompilerMPW Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.seg + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowserfalse + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeLarge + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames1 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel0 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym0 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle0 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeApplication + MWProject_68K_outfileUnzip Sioux (68k) + MWProject_68K_symfilename + MWProject_68K_filecreator1230662000 + MWProject_68K_filetype1095782476 + MWProject_68K_size1024 + MWProject_68K_flags22720 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a40 + MWProject_68K_minsize512 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen0 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs1 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZpSx.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma0 + MWWarning_C_warn_emptydecl0 + MWWarning_C_warn_possunwant0 + MWWarning_C_warn_unusedvar0 + MWWarning_C_warn_unusedarg0 + MWWarning_C_warn_extracomma0 + MWWarning_C_pedantic0 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual0 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentMC68K + MWCodeGen_PPC_tracebacktablesNone + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole1 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeApplication + MWProject_PPC_outfilea.out + MWProject_PPC_filecreator1061109567 + MWProject_PPC_filetype1095782476 + MWProject_PPC_size384 + MWProject_PPC_minsize384 + MWProject_PPC_stacksize64 + MWProject_PPC_flags22720 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + crc32.c + MacOS + Text + + + + Name + crctab.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + ttyio.c + MacOS + Text + + + + Name + envargs.c + MacOS + Text + + + + Name + helpers.c + MacOS + Text + + + + Name + helpers.h + MacOS + Text + + + + Name + macstuff.h + MacOS + Text + + + + Name + pathname.c + MacOS + Text + + + + Name + pathname.h + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + UnZpSx.h + MacOS + Text + + + + Name + mactime.c + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + unzip.rc + MacOS + Resource + + + + Name + charmap.h + MacOS + Text + + + + Name + FSp_fopen.c + MacOS + Text + + + + Name + getenv.c + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + MSL Runtime68K.Lib + MacOS + Library + + + + Name + MacOS.lib + MacOS + Library + + + + Name + MathLib68K (2i).Lib + MacOS + Library + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + First Segment + Protected, Locked + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + crc32.c + MacOS + + + Name + crctab.c + MacOS + + + Name + crypt.c + MacOS + + + Name + ttyio.c + MacOS + + + Name + envargs.c + MacOS + + + Name + helpers.c + MacOS + + + Name + helpers.h + MacOS + + + Name + macstuff.h + MacOS + + + Name + pathname.c + MacOS + + + Name + pathname.h + MacOS + + + Name + maccfg.h + MacOS + + + Name + sxunzip.c + MacOS + + + Name + UnZpSx.h + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + charmap.h + MacOS + + + Name + FSp_fopen.c + MacOS + + + Name + getenv.c + MacOS + + + Name + mactime.c + MacOS + + + Name + unzip.rc + MacOS + + + Name + macos.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + MSL Runtime68K.Lib + MacOS + + + Name + MacOS.lib + MacOS + + + Name + MathLib68K (2i).Lib + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + + Unzip Sioux (PPC) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameUnzip Sioux (PPC) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeSmart + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames1 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel0 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym1 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle0 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeApplication + MWProject_68K_outfileToolbox68k.out + MWProject_68K_symfilename + MWProject_68K_filecreator1061109567 + MWProject_68K_filetype1095782476 + MWProject_68K_size384 + MWProject_68K_flags22688 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a40 + MWProject_68K_minsize384 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen0 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs1 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZpSx.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma0 + MWWarning_C_warn_emptydecl0 + MWWarning_C_warn_possunwant0 + MWWarning_C_warn_unusedvar0 + MWWarning_C_warn_unusedarg0 + MWWarning_C_warn_extracomma0 + MWWarning_C_pedantic0 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual0 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesInline + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym0 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs1 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeApplication + MWProject_PPC_outfileUnzip Sioux (PPC) + MWProject_PPC_filecreator1230662000 + MWProject_PPC_filetype1095782476 + MWProject_PPC_size2048 + MWProject_PPC_minsize1024 + MWProject_PPC_stacksize512 + MWProject_PPC_flags22720 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + MSL C.PPC.Lib + MacOS + Library + + + + Name + MSL C++.PPC.Lib + MacOS + Library + + + + Name + InterfaceLib + MacOS + Library + + + + Name + MathLib + MacOS + Library + + + + Name + MSL RuntimePPC.Lib + MacOS + Library + + + + Name + MSL SIOUX.PPC.Lib + MacOS + Library + Debug + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + envargs.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + crc32.c + MacOS + Text + + + + Name + crctab.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + ttyio.c + MacOS + Text + + + + Name + helpers.c + MacOS + Text + + + + Name + helpers.h + MacOS + Text + + + + Name + macstuff.h + MacOS + Text + + + + Name + pathname.c + MacOS + Text + + + + Name + pathname.h + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + UnZpSx.h + MacOS + Text + + + + Name + mactime.c + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + unzip.rc + MacOS + Resource + + + + Name + charmap.h + MacOS + Text + + + + Name + FSp_fopen.c + MacOS + Text + + + + Name + getenv.c + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + envargs.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + crc32.c + MacOS + + + Name + crctab.c + MacOS + + + Name + crypt.c + MacOS + + + Name + ttyio.c + MacOS + + + Name + helpers.c + MacOS + + + Name + helpers.h + MacOS + + + Name + macstuff.h + MacOS + + + Name + pathname.c + MacOS + + + Name + pathname.h + MacOS + + + Name + maccfg.h + MacOS + + + Name + sxunzip.c + MacOS + + + Name + UnZpSx.h + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + unzip.rc + MacOS + + + Name + charmap.h + MacOS + + + Name + FSp_fopen.c + MacOS + + + Name + mactime.c + MacOS + + + Name + getenv.c + MacOS + + + Name + macos.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + MSL SIOUX.PPC.Lib + MacOS + + + Name + MSL C.PPC.Lib + MacOS + + + Name + MSL C++.PPC.Lib + MacOS + + + Name + InterfaceLib + MacOS + + + Name + MathLib + MacOS + + + Name + MSL RuntimePPC.Lib + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + Unzip Lib (PPC) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameUnzip Lib (PPC) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeSmart + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames1 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel0 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym1 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle0 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeApplication + MWProject_68K_outfileToolbox68k.out + MWProject_68K_symfilename + MWProject_68K_filecreator1061109567 + MWProject_68K_filetype1095782476 + MWProject_68K_size384 + MWProject_68K_flags22688 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a40 + MWProject_68K_minsize384 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen0 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs0 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZpLib.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings1 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined1 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesInline + MWCodeGen_PPC_processorP603e + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule1 + MWCodeGen_PPC_peephole1 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel4 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym0 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs1 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeLibrary + MWProject_PPC_outfileUnzip Lib (PPC) + MWProject_PPC_filecreator1061109567 + MWProject_PPC_filetype1061109567 + MWProject_PPC_size0 + MWProject_PPC_minsize0 + MWProject_PPC_stacksize0 + MWProject_PPC_flags0 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + UnZpLib.h + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + ttyio.c + MacOS + Text + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + maccfg.h + MacOS + + + Name + sxunzip.c + MacOS + + + Name + UnZpLib.h + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + macos.c + MacOS + + + Name + crypt.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + ttyio.c + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + Unzip Lib (68k) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS 68K Linker + PreLinker + PostLinker + TargetnameUnzip Lib (68k) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeOBJ + FileExtension + CompilerMPW Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.seg + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeLarge + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames0 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel4 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym0 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle1 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeLibrary + MWProject_68K_outfileUnzip Lib (68k) + MWProject_68K_symfilename + MWProject_68K_filecreator1061109567 + MWProject_68K_filetype1061109567 + MWProject_68K_size0 + MWProject_68K_flags0 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a41 + MWProject_68K_minsize0 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen0 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs1 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZpLib.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings1 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentMC68K + MWCodeGen_PPC_tracebacktablesNone + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole1 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeApplication + MWProject_PPC_outfilea.out + MWProject_PPC_filecreator1061109567 + MWProject_PPC_filetype1095782476 + MWProject_PPC_size384 + MWProject_PPC_minsize384 + MWProject_PPC_stacksize64 + MWProject_PPC_flags22720 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + UnZpLib.h + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + ttyio.c + MacOS + Text + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + First Segment + Protected, Locked + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + maccfg.h + MacOS + + + Name + sxunzip.c + MacOS + + + Name + UnZpLib.h + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + macos.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + crypt.c + MacOS + + + Name + ttyio.c + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + + Unzip (PPC) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS PPC Linker + PreLinker + PostLinker + TargetnameUnzip (PPC) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal PPC + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.s + CompilerPPCAsm + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeXCOF + FileExtension + CompilerXCOFF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import PPC + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeSmart + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames1 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel0 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym1 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle0 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeApplication + MWProject_68K_outfileToolbox68k.out + MWProject_68K_symfilename + MWProject_68K_filecreator1061109567 + MWProject_68K_filetype1095782476 + MWProject_68K_size384 + MWProject_68K_flags22688 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a40 + MWProject_68K_minsize384 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen0 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs1 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZp.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma0 + MWWarning_C_warn_emptydecl0 + MWWarning_C_warn_possunwant0 + MWWarning_C_warn_unusedvar0 + MWWarning_C_warn_unusedarg0 + MWWarning_C_warn_extracomma0 + MWWarning_C_pedantic0 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual0 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesInline + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym0 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs1 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeApplication + MWProject_PPC_outfileUnzip (PPC) + MWProject_PPC_filecreator1230662000 + MWProject_PPC_filetype1095782476 + MWProject_PPC_size2048 + MWProject_PPC_minsize1024 + MWProject_PPC_stacksize512 + MWProject_PPC_flags22720 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + MSL C.PPC.Lib + MacOS + Library + + + + Name + MSL C++.PPC.Lib + MacOS + Library + + + + Name + InterfaceLib + MacOS + Library + + + + Name + MathLib + MacOS + Library + + + + Name + MSL RuntimePPC.Lib + MacOS + Library + + + + Name + MSL SIOUX.PPC.Lib + MacOS + Library + Debug + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + crc32.c + MacOS + Text + + + + Name + crctab.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + ttyio.c + MacOS + Text + + + + Name + helpers.c + MacOS + Text + + + + Name + helpers.h + MacOS + Text + + + + Name + macstuff.h + MacOS + Text + + + + Name + pathname.c + MacOS + Text + + + + Name + pathname.h + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + macscreen.c + MacOS + Text + + + + Name + macunzip.c + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + envargs.c + MacOS + Text + + + + Name + UnZp.h + MacOS + Text + + + + Name + mactime.c + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + unzip.rc + MacOS + Resource + + + + Name + charmap.h + MacOS + Text + + + + Name + FSp_fopen.c + MacOS + Text + + + + Name + getenv.c + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + console.stubs.c + MacOS + Text + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + crc32.c + MacOS + + + Name + crctab.c + MacOS + + + Name + crypt.c + MacOS + + + Name + ttyio.c + MacOS + + + Name + helpers.c + MacOS + + + Name + helpers.h + MacOS + + + Name + macstuff.h + MacOS + + + Name + pathname.c + MacOS + + + Name + pathname.h + MacOS + + + Name + maccfg.h + MacOS + + + Name + macscreen.c + MacOS + + + Name + macunzip.c + MacOS + + + Name + sxunzip.c + MacOS + + + Name + envargs.c + MacOS + + + Name + UnZp.h + MacOS + + + Name + mactime.c + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + charmap.h + MacOS + + + Name + FSp_fopen.c + MacOS + + + Name + getenv.c + MacOS + + + Name + unzip.rc + MacOS + + + Name + MSL C.PPC.Lib + MacOS + + + Name + MSL C++.PPC.Lib + MacOS + + + Name + InterfaceLib + MacOS + + + Name + MathLib + MacOS + + + Name + MSL RuntimePPC.Lib + MacOS + + + Name + MSL SIOUX.PPC.Lib + MacOS + + + Name + macos.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + console.stubs.c + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + Unzip (68k) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS 68K Linker + PreLinker + PostLinker + TargetnameUnzip (68k) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeOBJ + FileExtension + CompilerMPW Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.seg + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeLarge + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames1 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel4 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym0 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle0 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeApplication + MWProject_68K_outfileUnzip (68k) + MWProject_68K_symfilename + MWProject_68K_filecreator1061109567 + MWProject_68K_filetype1095782476 + MWProject_68K_size384 + MWProject_68K_flags22720 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a40 + MWProject_68K_minsize384 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen0 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs1 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZp.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings0 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma0 + MWWarning_C_warn_emptydecl0 + MWWarning_C_warn_possunwant0 + MWWarning_C_warn_unusedvar0 + MWWarning_C_warn_unusedarg0 + MWWarning_C_warn_extracomma0 + MWWarning_C_pedantic0 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual0 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentPPC + MWCodeGen_PPC_tracebacktablesInline + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole0 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym0 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs1 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeApplication + MWProject_PPC_outfileUnzip (PPC) + MWProject_PPC_filecreator1230662000 + MWProject_PPC_filetype1095782476 + MWProject_PPC_size2048 + MWProject_PPC_minsize1024 + MWProject_PPC_stacksize512 + MWProject_PPC_flags22720 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + envargs.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + crc32.c + MacOS + Text + + + + Name + crctab.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + ttyio.c + MacOS + Text + + + + Name + helpers.c + MacOS + Text + + + + Name + helpers.h + MacOS + Text + + + + Name + macstuff.h + MacOS + Text + + + + Name + pathname.c + MacOS + Text + + + + Name + pathname.h + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + macscreen.c + MacOS + Text + + + + Name + macunzip.c + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + UnZp.h + MacOS + Text + + + + Name + mactime.c + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + unzip.rc + MacOS + Resource + + + + Name + charmap.h + MacOS + Text + + + + Name + FSp_fopen.c + MacOS + Text + + + + Name + getenv.c + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + console.stubs.c + MacOS + Text + + + + Name + MSL Runtime68K.Lib + MacOS + Library + + + + Name + MacOS.lib + MacOS + Library + + + + Name + MathLib68K (2i).Lib + MacOS + Library + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + First Segment + Preloaded, Protected, Locked + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + envargs.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + crc32.c + MacOS + + + Name + crctab.c + MacOS + + + Name + crypt.c + MacOS + + + Name + ttyio.c + MacOS + + + Name + helpers.c + MacOS + + + Name + helpers.h + MacOS + + + Name + macstuff.h + MacOS + + + Name + pathname.c + MacOS + + + Name + pathname.h + MacOS + + + Name + maccfg.h + MacOS + + + Name + macscreen.c + MacOS + + + Name + macunzip.c + MacOS + + + Name + sxunzip.c + MacOS + + + Name + UnZp.h + MacOS + + + Name + mactime.c + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + charmap.h + MacOS + + + Name + FSp_fopen.c + MacOS + + + Name + getenv.c + MacOS + + + Name + unzip.rc + MacOS + + + Name + macos.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + console.stubs.c + MacOS + + + Name + MSL Runtime68K.Lib + MacOS + + + Name + MacOS.lib + MacOS + + + Name + MathLib68K (2i).Lib + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + + Unzip Lib (CFM68k) + + + + UserSourceTrees + + + CustomColor1 + Red0 + Green32767 + Blue0 + + CustomColor2 + Red0 + Green32767 + Blue0 + + CustomColor3 + Red0 + Green32767 + Blue0 + + CustomColor4 + Red0 + Green32767 + Blue0 + + + + AlwaysSearchUserPathsfalse + InterpretDOSAndUnixPathsfalse + UserSearchPaths + + SearchPath + Path: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::izshr:macos: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:CHeaders: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:PascalInterfaces: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:::MoreFiles:Sources: + PathFormatMacOS + PathRootProject + + Recursivetrue + HostFlagsAll + + + SystemSearchPaths + + SearchPath + Path:MSL: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path:MacOS Support: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + SearchPath + Path: + PathFormatMacOS + PathRootCodeWarrior + + Recursivetrue + HostFlagsAll + + + + + LinkerMacOS 68K Linker + PreLinker + PostLinker + TargetnameUnzip Lib (CFM68k) + OutputDirectory + Path: + PathFormatMacOS + PathRootProject + + SaveEntriesUsingRelativePathsfalse + + + FileMappings + + FileTypeAPPL + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeAppl + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeMMLB + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMPLF + FileExtension + CompilerLib Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeMWCD + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeOBJ + FileExtension + CompilerMPW Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeRSRC + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.bh + CompilerBalloon Help + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.c++ + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cc + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.cpp + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.exp + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.h + CompilerMW C/C++ 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMaketrue + + + FileTypeTEXT + FileExtension.p + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pas + CompilerMW Pascal 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.pch++ + CompilerMW C/C++ 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.ppu + CompilerMW Pascal 68K + Precompiletrue + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.r + CompilerRez + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypeTEXT + FileExtension.seg + Compiler + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypedocu + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypersrc + FileExtension + Compiler + Precompilefalse + Launchabletrue + ResourceFiletrue + IgnoredByMakefalse + + + FileTypeshlb + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileTypestub + FileExtension + CompilerPEF Import 68K + Precompilefalse + Launchablefalse + ResourceFilefalse + IgnoredByMakefalse + + + FileExtension.doc + Compiler + Precompilefalse + Launchabletrue + ResourceFilefalse + IgnoredByMaketrue + + + + + CacheModDatestrue + ActivateBrowsertrue + DumpBrowserInfofalse + CacheSubprojectstrue + UseThirdPartyDebuggerfalse + DebuggerCommandLine + Debugger Runtime + 0002000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000 + + + + LogSystemMessagestrue + AutoTargetDLLsfalse + StopAtWatchpointstrue + PauseWhileRunningfalse + PauseInterval5 + PauseUIFlags0 + AltExePath + Path + PathFormatGeneric + PathRootAbsolute + + StopAtTempBPOnLaunchtrue + CacheSymbolicstrue + TempBPFunctionNamemain + TempBPTypefalse + + + MWCodeGen_68K_codesizeLarge + MWCodeGen_68K_structalignmentMC68K + MWCodeGen_68K_fp_modeSANE + MWCodeGen_68K_code680200 + MWCodeGen_68K_profiler0 + MWCodeGen_68K_mpwc0 + MWCodeGen_68K_fourbyteints1 + MWCodeGen_68K_IEEEdoubles1 + MWCodeGen_68K_fardata1 + MWCodeGen_68K_farvtables1 + MWCodeGen_68K_farstrings1 + MWCodeGen_68K_pcrelstrings0 + MWCodeGen_68K_macsbugNew + MWCodeGen_68K_a6frames1 + + + MWDisassembler_68K_showcode1 + MWDisassembler_68K_mix0 + MWDisassembler_68K_nohex0 + MWDisassembler_68K_showdata1 + MWDisassembler_68K_showexceptions1 + MWDisassembler_68K_showsym0 + MWDisassembler_68K_shownames1 + + + GlobalOptimizer_68K_optimizationlevelLevel4 + GlobalOptimizer_68K_optforSpeed + + + MWLinker_68K_linksym0 + MWLinker_68K_symfullpath1 + MWLinker_68K_linksingle0 + MWLinker_68K_fastlink1 + MWLinker_68K_generateMap0 + MWLinker_68K_nolinkwarnings0 + MWLinker_68K_glueintosegone1 + MWLinker_68K_dontdeadstripinitcode0 + + + MWProject_68K_typeLibrary + MWProject_68K_outfileUnzip Lib (CFM68k) + MWProject_68K_symfilename + MWProject_68K_filecreator1061109567 + MWProject_68K_filetype1061109567 + MWProject_68K_size0 + MWProject_68K_flags0 + MWProject_68K_rsrcheaderStandard + MWProject_68K_rsrcname + MWProject_68K_rsrctype1061109567 + MWProject_68K_rsrcid0 + MWProject_68K_rsrcmulti0 + MWProject_68K_rsrcstore0 + MWProject_68K_rsrcmerge0 + MWProject_68K_rsrcflags0 + MWProject_68K_a40 + MWProject_68K_minsize0 + MWProject_68K_rsrcsegtype0 + MWProject_68K_cfm68kcodegen1 + MWProject_68K_stacksize0 + MWProject_68K_thedebugger0 + MWProject_68K_rsrc_custom0 + MWProject_68K_is_rseg_app0 + MWProject_68K_is_pilot_lib0 + MWProject_68K_pilot_main_entry + + + MWFrontEnd_C_cplusplus0 + MWFrontEnd_C_checkprotos1 + MWFrontEnd_C_arm0 + MWFrontEnd_C_trigraphs1 + MWFrontEnd_C_onlystdkeywords0 + MWFrontEnd_C_enumsalwaysint0 + MWFrontEnd_C_mpwpointerstyle0 + MWFrontEnd_C_prefixnameUnZpLib.h + MWFrontEnd_C_ansistrict1 + MWFrontEnd_C_mpwcnewline0 + MWFrontEnd_C_wchar_type1 + MWFrontEnd_C_enableexceptions0 + MWFrontEnd_C_dontreusestrings1 + MWFrontEnd_C_poolstrings0 + MWFrontEnd_C_dontinline0 + MWFrontEnd_C_useRTTI0 + MWFrontEnd_C_multibyteaware0 + MWFrontEnd_C_unsignedchars0 + MWFrontEnd_C_autoinline0 + MWFrontEnd_C_booltruefalse1 + MWFrontEnd_C_direct_to_som0 + MWFrontEnd_C_som_env_check0 + MWFrontEnd_C_alwaysinline0 + MWFrontEnd_C_inlinelevel0 + MWFrontEnd_C_ecplusplus0 + MWFrontEnd_C_objective_c0 + MWFrontEnd_C_defer_codegen0 + + + MWWarning_C_warn_illpragma1 + MWWarning_C_warn_emptydecl1 + MWWarning_C_warn_possunwant1 + MWWarning_C_warn_unusedvar1 + MWWarning_C_warn_unusedarg1 + MWWarning_C_warn_extracomma1 + MWWarning_C_pedantic1 + MWWarning_C_warningerrors0 + MWWarning_C_warn_hidevirtual1 + MWWarning_C_warn_implicitconv0 + MWWarning_C_warn_notinlined0 + MWWarning_C_warn_structclass0 + + + MWCFM68K_exportsNone + MWCFM68K_olddefversion0 + MWCFM68K_oldimpversion0 + MWCFM68K_currentversion0 + MWCFM68K_farthreshold256 + PCFM68K_sharedata0 + MWCFM68K_fragmentname + MWCFM68K_initname + MWCFM68K_mainname__start + MWCFM68K_termname + MWCFM68K_libfolder0 + MWCFM68K_alignmentAlign_2 + + + MWFTP_Post_hostName + MWFTP_Post_username + MWFTP_Post_password + MWFTP_Post_remoteDir + MWFTP_Post_uploadDir + MWFTP_Post_ftp_port21 + MWFTP_Post_SendBin1 + MWFTP_Post_ShouldLog1 + + + MWCommandLine_Java_clsName + MWCommandLine_Java_args + + + MWJava_Language_optimize0 + MWJava_Language_warnDeprecated0 + MWJava_Language_emitMap0 + MWJava_Language_strictFileNames0 + MWJava_Language_strictFileHierarchy0 + MWJava_Language_emitHeadersNoNativeHeaders + MWJava_Language_packageFilter + MWJava_Language_genComments1 + MWJava_Language_genHeaders0 + + + MWJava_MacOS_typeJBindery + MWJava_MacOS_grow0 + MWJava_MacOS_profile0 + MWJava_MacOS_verify0 + MWJava_MacOS_useHttpProxy0 + MWJava_MacOS_useFTPProxy0 + MWJava_MacOS_useFirewallProxy0 + MWJava_MacOS_outfileJBoundApp + MWJava_MacOS_outcreator1061109567 + MWJava_MacOS_maxMem1048576 + MWJava_MacOS_minMem524288 + MWJava_MacOS_red65535 + MWJava_MacOS_green65535 + MWJava_MacOS_blue65535 + MWJava_MacOS_stdoutType1464421956 + MWJava_MacOS_stdinType1853189228 + MWJava_MacOS_httpProxyPort0 + MWJava_MacOS_fTPProxyPort0 + MWJava_MacOS_firewallProxyPort0 + MWJava_MacOS_httpProxy + MWJava_MacOS_fTPProxy + MWJava_MacOS_firewallProxy + MWJava_MacOS_merge0 + MWJava_MacOS_write_old_rsrcs1 + MWJava_MacOS_jbindrundebug0 + MWJava_MacOS_stdoutfile + MWJava_MacOS_stdinfile + + + MWJava_Output_outputtypeJarFile + MWJava_Output_outfileJavaClasses.jar + MWJava_Output_ftype1514754080 + MWJava_Output_fcreator1297570384 + MWJava_Output_compress0 + MWJava_Output_genManifest0 + MWJava_Output_trunctypeFront + MWJava_Output_deleteClasses0 + MWJava_Output_consoleApp1 + + + MWJava_Proj_projtypeApplet + MWJava_Proj_runtimeArgs + MWJava_Proj_mainClassName + MWJava_Proj_HTMLAppCreator1297303877 + MWJava_Proj_HTMLAppNameInternet Explorer + MWJava_Proj_HTMLAppWin32NameIexplore.exe + MWJava_Proj_compress0 + MWJava_Proj_useVM1 + MWJava_Proj_workingDir + MWJava_Proj_vmarguments + MWJava_Proj_vmName + + + MWJavaDoc_Proj_Version1 + MWJavaDoc_Proj_Depricated0 + MWJavaDoc_Proj_Author1 + MWJavaDoc_Proj_Index1 + MWJavaDoc_Proj_Tree1 + MWJavaDoc_Proj_SunResolveToSame1 + MWJavaDoc_Proj_Shortnames1 + MWJavaDoc_Proj_Folder0 + MWJavaDoc_Proj_GenerateAPILinks0 + MWJavaDoc_Proj_scopePublic + MWJavaDoc_Proj_fcreator1297303877 + MWJavaDoc_Proj_encodingName + MWJavaDoc_Proj_decodingName + MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ + + + MWMerge_MacOS_projectTypeApplication + MWMerge_MacOS_outputNameMerge Out + MWMerge_MacOS_outputCreator1061109567 + MWMerge_MacOS_outputType1095782476 + MWMerge_MacOS_suppressWarning0 + MWMerge_MacOS_copyFragments1 + MWMerge_MacOS_copyResources1 + MWMerge_MacOS_skipResources + + + ‰aˆ + + + + + MWCodeGen_PPC_structalignmentMC68K + MWCodeGen_PPC_tracebacktablesNone + MWCodeGen_PPC_processorGeneric + MWCodeGen_PPC_readonlystrings0 + MWCodeGen_PPC_tocdata1 + MWCodeGen_PPC_profiler0 + MWCodeGen_PPC_fpcontract1 + MWCodeGen_PPC_schedule0 + MWCodeGen_PPC_peephole1 + MWCodeGen_PPC_processorspecific0 + MWCodeGen_PPC_altivec0 + MWCodeGen_PPC_vectortocdata0 + MWCodeGen_PPC_vrsave0 + + + MWDisassembler_PPC_showcode1 + MWDisassembler_PPC_extended1 + MWDisassembler_PPC_mix0 + MWDisassembler_PPC_nohex0 + MWDisassembler_PPC_showdata1 + MWDisassembler_PPC_showexceptions1 + MWDisassembler_PPC_showsym0 + MWDisassembler_PPC_shownames1 + + + GlobalOptimizer_PPC_optimizationlevelLevel0 + GlobalOptimizer_PPC_optforSpeed + + + MWLinker_PPC_linksym1 + MWLinker_PPC_symfullpath1 + MWLinker_PPC_linkmap0 + MWLinker_PPC_nolinkwarnings0 + MWLinker_PPC_dontdeadstripinitcode0 + MWLinker_PPC_permitmultdefs0 + MWLinker_PPC_linkmodeFast + MWLinker_PPC_initname + MWLinker_PPC_mainname__start + MWLinker_PPC_termname + + + MWPEF_exportsNone + MWPEF_libfolder0 + MWPEF_sortcodeNone + MWPEF_expandbss0 + MWPEF_sharedata0 + MWPEF_olddefversion0 + MWPEF_oldimpversion0 + MWPEF_currentversion0 + MWPEF_fragmentname + MWPEF_collapsereloads0 + + + MWProject_PPC_typeApplication + MWProject_PPC_outfilea.out + MWProject_PPC_filecreator1061109567 + MWProject_PPC_filetype1095782476 + MWProject_PPC_size384 + MWProject_PPC_minsize384 + MWProject_PPC_stacksize64 + MWProject_PPC_flags22720 + MWProject_PPC_symfilename + MWProject_PPC_rsrcname + MWProject_PPC_rsrcheaderNative + MWProject_PPC_rsrctype1061109567 + MWProject_PPC_rsrcid0 + MWProject_PPC_rsrcflags0 + MWProject_PPC_rsrcstore0 + MWProject_PPC_rsrcmerge0 + + + MWAssembler_PPC_auxheader0 + MWAssembler_PPC_symmodeMac + MWAssembler_PPC_dialectPPC + MWAssembler_PPC_prefixfile + MWAssembler_PPC_typecheck0 + MWAssembler_PPC_warnings0 + MWAssembler_PPC_casesensitive0 + + + MWRez_Language_maxwidth80 + MWRez_Language_scriptRoman + MWRez_Language_alignmentAlign1 + MWRez_Language_filtermodeFilterSkip + MWRez_Language_suppresswarnings0 + MWRez_Language_escapecontrolchars1 + MWRez_Language_prefixname + MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' + + + + Name + inflate.h + MacOS + Text + + + + Name + globals.h + MacOS + Text + + + + Name + unzip.h + MacOS + Text + + + + Name + unzip.c + MacOS + Text + + + + Name + explode.c + MacOS + Text + + + + Name + extract.c + MacOS + Text + + + + Name + fileio.c + MacOS + Text + + + + Name + list.c + MacOS + Text + + + + Name + globals.c + MacOS + Text + + + + Name + match.c + MacOS + Text + + + + Name + zipinfo.c + MacOS + Text + + + + Name + inflate.c + MacOS + Text + + + + Name + process.c + MacOS + Text + + + + Name + unshrink.c + MacOS + Text + + + + Name + unreduce.c + MacOS + Text + + + + Name + unzpriv.h + MacOS + Text + + + + Name + macdir.c + MacOS + Text + + + + Name + maccfg.h + MacOS + Text + + + + Name + sxunzip.c + MacOS + Text + + + + Name + UnZpLib.h + MacOS + Text + + + + Name + macstat.c + MacOS + Text + + + + Name + macstat.h + MacOS + Text + + + + Name + macos.c + MacOS + Text + + + + Name + macbin3.h + MacOS + Text + + + + Name + macbin3.c + MacOS + Text + + + + Name + crypt.c + MacOS + Text + + + + Name + DirectoryCopy.h + MacOS + Text + + + + Name + FileCopy.h + MacOS + Text + + + + Name + FSpCompat.h + MacOS + Text + + + + Name + FullPath.h + MacOS + Text + + + + Name + IterateDirectory.h + MacOS + Text + + + + Name + MoreDesktopMgr.h + MacOS + Text + + + + Name + MoreFiles.h + MacOS + Text + + + + Name + MoreFilesExtras.h + MacOS + Text + + + + Name + Optimization.h + MacOS + Text + + + + Name + OptimizationEnd.h + MacOS + Text + + + + Name + Search.h + MacOS + Text + + + + + + First Segment + Protected, Locked + + Name + inflate.h + MacOS + + + Name + globals.h + MacOS + + + Name + unzip.h + MacOS + + + Name + unzip.c + MacOS + + + Name + explode.c + MacOS + + + Name + extract.c + MacOS + + + Name + fileio.c + MacOS + + + Name + list.c + MacOS + + + Name + globals.c + MacOS + + + Name + match.c + MacOS + + + Name + zipinfo.c + MacOS + + + Name + inflate.c + MacOS + + + Name + process.c + MacOS + + + Name + unshrink.c + MacOS + + + Name + unreduce.c + MacOS + + + Name + unzpriv.h + MacOS + + + Name + macdir.c + MacOS + + + Name + maccfg.h + MacOS + + + Name + sxunzip.c + MacOS + + + Name + UnZpLib.h + MacOS + + + Name + macstat.c + MacOS + + + Name + macstat.h + MacOS + + + Name + macos.c + MacOS + + + Name + macbin3.h + MacOS + + + Name + macbin3.c + MacOS + + + Name + crypt.c + MacOS + + + Name + DirectoryCopy.h + MacOS + + + Name + FileCopy.h + MacOS + + + Name + FSpCompat.h + MacOS + + + Name + FullPath.h + MacOS + + + Name + IterateDirectory.h + MacOS + + + Name + MoreDesktopMgr.h + MacOS + + + Name + MoreFiles.h + MacOS + + + Name + MoreFilesExtras.h + MacOS + + + Name + Optimization.h + MacOS + + + Name + OptimizationEnd.h + MacOS + + + Name + Search.h + MacOS + + + + + + + + Unzip Sioux (68k) + Unzip Sioux (PPC) + Unzip Lib (PPC) + Unzip Lib (68k) + Unzip (PPC) + Unzip (68k) + Unzip Lib (CFM68k) + + + + Sources + + Unzip (PPC) + Name + UnZp.h + MacOS + + + Unzip Lib (PPC) + Name + UnZpLib.h + MacOS + + + Unzip Sioux (68k) + Name + UnZpSx.h + MacOS + + Mac-Specific + include + + Unzip Sioux (68k) + Name + maccfg.h + MacOS + + + Unzip Sioux (68k) + Name + macstat.h + MacOS + + + Unzip Sioux (68k) + Name + macbin3.h + MacOS + + + source + + Unzip Sioux (68k) + Name + macos.c + MacOS + + + Unzip Sioux (68k) + Name + macbin3.c + MacOS + + + Unzip Sioux (68k) + Name + macdir.c + MacOS + + + Unzip Sioux (68k) + Name + macstat.c + MacOS + + + Unzip (PPC) + Name + macunzip.c + MacOS + + + Unzip Sioux (68k) + Name + sxunzip.c + MacOS + + + Unzip (PPC) + Name + macscreen.c + MacOS + + + + UnZip_H + + Unzip Sioux (68k) + Name + inflate.h + MacOS + + + Unzip Sioux (68k) + Name + globals.h + MacOS + + + Unzip Sioux (68k) + Name + unzpriv.h + MacOS + + + Unzip Sioux (68k) + Name + unzip.h + MacOS + + + shared code Unzip & Zip + + Unzip Sioux (68k) + Name + getenv.c + MacOS + + + Unzip Sioux (68k) + Name + ttyio.c + MacOS + + + Unzip Sioux (68k) + Name + crc32.c + MacOS + + + Unzip Sioux (68k) + Name + crctab.c + MacOS + + + Unzip Sioux (68k) + Name + crypt.c + MacOS + + + Unzip Sioux (68k) + Name + helpers.c + MacOS + + + Unzip Sioux (68k) + Name + helpers.h + MacOS + + + Unzip Sioux (68k) + Name + mactime.c + MacOS + + + Unzip Sioux (68k) + Name + macstuff.h + MacOS + + + Unzip Sioux (68k) + Name + pathname.c + MacOS + + + Unzip Sioux (68k) + Name + pathname.h + MacOS + + + Unzip Sioux (68k) + Name + charmap.h + MacOS + + + ObjS1 + + Unzip Sioux (68k) + Name + unzip.c + MacOS + + + Unzip Sioux (68k) + Name + envargs.c + MacOS + + + Unzip Sioux (68k) + Name + explode.c + MacOS + + + ObjS2 + + Unzip Sioux (68k) + Name + extract.c + MacOS + + + Unzip Sioux (68k) + Name + fileio.c + MacOS + + + Unzip Sioux (68k) + Name + list.c + MacOS + + + Unzip Sioux (68k) + Name + globals.c + MacOS + + + Unzip Sioux (68k) + Name + match.c + MacOS + + + Unzip Sioux (68k) + Name + zipinfo.c + MacOS + + + Unzip Sioux (68k) + Name + inflate.c + MacOS + + + ObjS3 + + Unzip Sioux (68k) + Name + process.c + MacOS + + + Unzip Sioux (68k) + Name + unshrink.c + MacOS + + + Unzip Sioux (68k) + Name + unreduce.c + MacOS + + + + Mac Libraries + 68k + + Unzip Sioux (68k) + Name + MSL Runtime68K.Lib + MacOS + + + Unzip Sioux (68k) + Name + MacOS.lib + MacOS + + + Unzip Sioux (68k) + Name + MathLib68K (2i).Lib + MacOS + + + PPC + + Unzip Sioux (PPC) + Name + InterfaceLib + MacOS + + + Unzip Sioux (PPC) + Name + MathLib + MacOS + + + Unzip Sioux (PPC) + Name + MSL RuntimePPC.Lib + MacOS + + + + Unzip (PPC) + Name + console.stubs.c + MacOS + + + ANSI Libraries + 68k + + PPC + + Unzip Sioux (PPC) + Name + MSL C.PPC.Lib + MacOS + + + Unzip Sioux (PPC) + Name + MSL C++.PPC.Lib + MacOS + + + Unzip Sioux (PPC) + Name + MSL SIOUX.PPC.Lib + MacOS + + + + Unzip Sioux (68k) + Name + FSp_fopen.c + MacOS + + + FAT Target Files + + Resources + + Unzip Sioux (68k) + Name + unzip.rc + MacOS + + + MoreFiles + CHeaders + + Unzip Sioux (68k) + Name + DirectoryCopy.h + MacOS + + + Unzip Sioux (68k) + Name + FileCopy.h + MacOS + + + Unzip Sioux (68k) + Name + FSpCompat.h + MacOS + + + Unzip Sioux (68k) + Name + FullPath.h + MacOS + + + Unzip Sioux (68k) + Name + IterateDirectory.h + MacOS + + + Unzip Sioux (68k) + Name + MoreDesktopMgr.h + MacOS + + + Unzip Sioux (68k) + Name + MoreFiles.h + MacOS + + + Unzip Sioux (68k) + Name + MoreFilesExtras.h + MacOS + + + Unzip Sioux (68k) + Name + Optimization.h + MacOS + + + Unzip Sioux (68k) + Name + OptimizationEnd.h + MacOS + + + Unzip Sioux (68k) + Name + Search.h + MacOS + + + + + + diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/UnZpSFX.h boinc-7.0.14+dfsg/zip/unzip/macos/UnZpSFX.h --- boinc-7.0.7+dfsg/zip/unzip/macos/UnZpSFX.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/UnZpSFX.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,158 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + UnZpSFX.h + + This header-files is global to the project UnzipSFX standalone. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define MACUNZIP_STANDALONE +#define MACUNZIP + +/* These functions are defined as a macro instead of a function. +so we have to undefine them for replacing */ +#undef getc +#undef getchar +#undef putchar +#undef putc + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + +#define SFX + +/*****************************************************************************/ +/* Includes standard headers */ +/*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int ratio(unsigned long uc,unsigned long c); + void fnprint(void); + + +/* +#define MAC_DEBUG 1 + */ + + + +#include + + +#ifdef MAC_DEBUG +#define LOG_DEBUG 7 /* debug-level messages */ +int Print2Syslog(UInt8 priority, const char *format, ...); +#include + + +#define Notify(msg) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ + msg, __FILE__, __LINE__); \ + } + + + +#define Assert_it(cond,msg,kind) \ + { \ + if (!(cond)) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s failed: [%s] cond: [%s] (file: %s line: %d)", \ + kind, msg, #cond, __FILE__, __LINE__); \ + } \ + } + + + +#define AssertBool(b,msg) \ + Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) + + + +#define AssertStr(s,msg) \ + { \ + int s_i = 0; \ + Assert_it ((s),(msg),("1. AssertStr ")); \ + while ((s)[s_i]) { \ + Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ + ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ + s_i++; \ + } \ + } + + + +#define AssertTime(t,msg) \ + Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ + ((t).tm_min >= 0) && ((t).tm_min < 60) && \ + ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ + ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ + ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ + ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ + ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) + + + +#define AssertIntRange(myvalue,minimum,maximum, msg) \ + Assert_it (((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), \ + msg,("AssertIntRange ")) + + + +#define AssertStrNoOverlap(str1,str2,msg) \ + { \ + long s_i = 0; \ + AssertStr((str1),(msg)) \ + AssertStr((str2),(msg)) \ + if ((str1) < (str2)) \ + { \ + s_i = strlen((str2)); \ + Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ + } \ + else \ + { \ + s_i = strlen((str1)); \ + Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ + } \ + } \ + + + + +#else /* !MAC_DEBUG */ +#define Assert_it(cond,msg,kind) +#define AssertBool(b,msg) +#define AssertStr(s,msg) +#define AssertTime(t,msg) +#define AssertIntRange(myvalue,minimum,maximum,msg) +#define AssertStrNoOverlap(str1,str2,msg) +#endif /* ?MAC_DEBUG */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/macos/UnZpSx.h boinc-7.0.14+dfsg/zip/unzip/macos/UnZpSx.h --- boinc-7.0.7+dfsg/zip/unzip/macos/UnZpSx.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/macos/UnZpSx.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,142 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + UnZpSx.h + + This header-files is global to the project Unzip Sioux. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define USE_SIOUX +#define MACUNZIP + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + + +/*****************************************************************************/ +/* Includes standard headers */ +/*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* +#define MAC_DEBUG 1 + */ + + +#ifdef MAC_DEBUG +#define LOG_DEBUG 7 /* debug-level messages */ +int Print2Syslog(UInt8 priority, const char *format, ...); +#include + + +#define Notify(msg) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ + msg, __FILE__, __LINE__); \ + } + + + +#define Assert_it(cond,msg,kind) \ + { \ + if (!(cond)) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s failed: [%s] cond: [%s] (file: %s line: %d)", \ + kind, msg, #cond, __FILE__, __LINE__); \ + } \ + } + + + +#define AssertBool(b,msg) \ + Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) + + + +#define AssertStr(s,msg) \ + { \ + int s_i = 0; \ + Assert_it ((s),(msg),("1. AssertStr ")); \ + while ((s)[s_i]) { \ + Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ + ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ + s_i++; \ + } \ + } + + + +#define AssertTime(t,msg) \ + Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ + ((t).tm_min >= 0) && ((t).tm_min < 60) && \ + ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ + ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ + ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ + ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ + ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) + + + +#define AssertIntRange(myvalue,minimum,maximum, msg) \ + Assert_it (((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), \ + msg,("AssertIntRange ")) + + + +#define AssertStrNoOverlap(str1,str2,msg) \ + { \ + long s_i = 0; \ + AssertStr((str1),(msg)) \ + AssertStr((str2),(msg)) \ + if ((str1) < (str2)) \ + { \ + s_i = strlen((str2)); \ + Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ + } \ + else \ + { \ + s_i = strlen((str1)); \ + Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ + } \ + } \ + + + + +#else /* !MAC_DEBUG */ +#define Assert_it(cond,msg,kind) +#define AssertBool(b,msg) +#define AssertStr(s,msg) +#define AssertTime(t,msg) +#define AssertIntRange(myvalue,minimum,maximum,msg) +#define AssertStrNoOverlap(str1,str2,msg) +#endif /* ?MAC_DEBUG */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/Makefile.am boinc-7.0.14+dfsg/zip/unzip/Makefile.am --- boinc-7.0.7+dfsg/zip/unzip/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/Makefile.am 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,15 @@ +## -*- mode: makefile; tab-width: 4 -*- +## $Id: Makefile.am 15375 2008-06-08 22:18:52Z davea $ + +EXTRA_DIST = BUGS WHERE envargs.c inflate.c ttyio.h unzvers.h \ +api.c explode.c inflate.h unix win32 \ +Contents apihelp.c extract.c list.c unreduce.c zip.h \ +History.550 consts.h file_id.diz macos unshrink.c zipgrep.txt \ +INSTALL crc32.c fileio.c match.c unzip.c zipinfo.c \ +LICENSE crc_i386.S funzip.c process.c unzip.h zipinfo.txt \ +Makefile.am crctab.c funzip.txt tables.h unzip.txt \ +crypt.c gbloffs.c timezone.c unzipsfx.txt \ +README crypt.h globals.c timezone.h unzipstb.c \ +ToDo ebcdic.h globals.h ttyio.c unzpriv.h + + diff -Nru boinc-7.0.7+dfsg/zip/unzip/match.c boinc-7.0.14+dfsg/zip/unzip/match.c --- boinc-7.0.7+dfsg/zip/unzip/match.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/match.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,345 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + match.c + + The match() routine recursively compares a string to a "pattern" (regular + expression), returning TRUE if a match is found or FALSE if not. This + version is specifically for use with unzip.c: as did the previous match() + routines from SEA and J. Kercheval, it leaves the case (upper, lower, or + mixed) of the string alone, but converts any uppercase characters in the + pattern to lowercase if indicated by the global var pInfo->lcflag (which + is to say, string is assumed to have been converted to lowercase already, + if such was necessary). + + GRR: reversed order of text, pattern in matche() (now same as match()); + added ignore_case/ic flags, Case() macro. + + PaulK: replaced matche() with recmatch() from Zip, modified to have an + ignore_case argument; replaced test frame with simpler one. + + --------------------------------------------------------------------------- + + Copyright on recmatch() from Zip's util.c (although recmatch() was almost + certainly written by Mark Adler...ask me how I can tell :-) ): + + Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, + Kai Uwe Rommel and Igor Mandrichenko. + + Permission is granted to any individual or institution to use, copy, + or redistribute this software so long as all of the original files are + included unmodified, that it is not sold for profit, and that this copy- + right notice is retained. + + --------------------------------------------------------------------------- + + Match the pattern (wildcard) against the string (fixed): + + match(string, pattern, ignore_case); + + returns TRUE if string matches pattern, FALSE otherwise. In the pattern: + + `*' matches any sequence of characters (zero or more) + `?' matches any single character + [SET] matches any character in the specified set, + [!SET] or [^SET] matches any character not in the specified set. + + A set is composed of characters or ranges; a range looks like ``character + hyphen character'' (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of + characters allowed in the [..] pattern construct. Other characters are + allowed (i.e., 8-bit characters) if your system will support them. + + To suppress the special syntactic significance of any of ``[]*?!^-\'', in- + side or outside a [..] construct, and match the character exactly, precede + it with a ``\'' (backslash). + + Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is + defined. See the DOSWILD section below for an explanation. Note also + that with VMSWILD defined, '%' is used instead of '?', and sets (ranges) + are delimited by () instead of []. + + ---------------------------------------------------------------------------*/ + + +#define __MATCH_C /* identifies this source module */ + +/* define ToLower() in here (for Unix, define ToLower to be macro (using + * isupper()); otherwise just use tolower() */ +#define UNZIP_INTERNAL +#include "unzip.h" + +#ifndef THEOS /* the Theos port defines its own variant of match() */ + +#if 0 /* this is not useful until it matches Amiga names insensitively */ +#ifdef AMIGA /* some other platforms might also want to use this */ +# define ANSI_CHARSET /* MOVE INTO UNZIP.H EVENTUALLY */ +#endif +#endif /* 0 */ + +#ifdef ANSI_CHARSET +# ifdef ToLower +# undef ToLower +# endif + /* uppercase letters are values 41 thru 5A, C0 thru D6, and D8 thru DE */ +# define IsUpper(c) (c>=0xC0 ? c<=0xDE && c!=0xD7 : c>=0x41 && c<=0x5A) +# define ToLower(c) (IsUpper((uch) c) ? (unsigned) c | 0x20 : (unsigned) c) +#endif +#define Case(x) (ic? ToLower(x) : (x)) + +#ifdef VMSWILD +# define WILDCHAR '%' +# define BEG_RANGE '(' +# define END_RANGE ')' +#else +# define WILDCHAR '?' +# define BEG_RANGE '[' +# define END_RANGE ']' +#endif + +#if 0 /* GRR: add this to unzip.h someday... */ +#if !(defined(MSDOS) && defined(DOSWILD)) +#define match(s,p,ic) (recmatch((ZCONST uch *)p,(ZCONST uch *)s,ic) == 1) +int recmatch OF((ZCONST uch *pattern, ZCONST uch *string, int ignore_case)); +#endif +#endif /* 0 */ +static int recmatch OF((ZCONST uch *pattern, ZCONST uch *string, + int ignore_case)); + + + +/* match() is a shell to recmatch() to return only Boolean values. */ + +int match(string, pattern, ignore_case) + ZCONST char *string, *pattern; + int ignore_case; +{ +#if (defined(MSDOS) && defined(DOSWILD)) + char *dospattern; + int j = strlen(pattern); + +/*--------------------------------------------------------------------------- + Optional MS-DOS preprocessing section: compare last three chars of the + wildcard to "*.*" and translate to "*" if found; else compare the last + two characters to "*." and, if found, scan the non-wild string for dots. + If in the latter case a dot is found, return failure; else translate the + "*." to "*". In either case, continue with the normal (Unix-like) match + procedure after translation. (If not enough memory, default to normal + match.) This causes "a*.*" and "a*." to behave as MS-DOS users expect. + ---------------------------------------------------------------------------*/ + + if ((dospattern = (char *)malloc(j+1)) != NULL) { + strcpy(dospattern, pattern); + if (!strcmp(dospattern+j-3, "*.*")) { + dospattern[j-2] = '\0'; /* nuke the ".*" */ + } else if (!strcmp(dospattern+j-2, "*.")) { + char *p = MBSCHR(string, '.'); + + if (p) { /* found a dot: match fails */ + free(dospattern); + return 0; + } + dospattern[j-1] = '\0'; /* nuke the end "." */ + } + j = recmatch((uch *)dospattern, (uch *)string, ignore_case); + free(dospattern); + return j == 1; + } else +#endif /* MSDOS && DOSWILD */ + return recmatch((uch *)pattern, (uch *)string, ignore_case) == 1; +} + + + +static int recmatch(p, s, ic) + ZCONST uch *p; /* sh pattern to match */ + ZCONST uch *s; /* string to which to match it */ + int ic; /* true for case insensitivity */ +/* Recursively compare the sh pattern p with the string s and return 1 if + * they match, and 0 or 2 if they don't or if there is a syntax error in the + * pattern. This routine recurses on itself no more deeply than the number + * of characters in the pattern. */ +{ + unsigned int c; /* pattern char or start of range in [-] loop */ + + /* Get first character, the pattern for new recmatch calls follows */ + c = *p; INCSTR(p); + + /* If that was the end of the pattern, match if string empty too */ + if (c == 0) + return *s == 0; + + /* '?' (or '%') matches any character (but not an empty string). + * If WILD_STOP_AT_DIR is defined, it won't match '/' */ + if (c == WILDCHAR) +#ifdef WILD_STOP_AT_DIR + return (*s && *s != '/') ? recmatch(p, s + CLEN(s), ic) : 0; +#else + return *s ? recmatch(p, s + CLEN(s), ic) : 0; +#endif + + /* '*' matches any number of characters, including zero */ +#ifdef AMIGA + if (c == '#' && *p == '?') /* "#?" is Amiga-ese for "*" */ + c = '*', p++; +#endif /* AMIGA */ + if (c == '*') { +#ifdef WILD_STOP_AT_DIR +# ifdef AMIGA + if ((c = p[0]) == '#' && p[1] == '?') /* "#?" is Amiga-ese for "*" */ + c = '*', p++; + if (c != '*') { +# else /* !AMIGA */ + if (*p != '*') { +# endif /* ?AMIGA */ + /* single '*': this doesn't match slashes */ + for (; *s && *s != '/'; INCSTR(s)) + if ((c = recmatch(p, s, ic)) != 0) + return (int)c; + /* end of pattern: matched if at end of string, else continue */ + if (*p == 0) + return (*s == 0); + /* continue to match if at '/' in pattern, else give up */ + return (*p == '/' || (*p == '\\' && p[1] == '/')) + ? recmatch(p, s, ic) : 2; + } + /* '**': this matches slashes */ + ++p; /* move p behind the second '*' */ + /* continue with the non-WILD_STOP_AT_DIR code variant */ +#endif /* WILD_STOP_AT_DIR */ + if (*p == 0) + return 1; + for (; *s; INCSTR(s)) + if ((c = recmatch(p, s, ic)) != 0) + return (int)c; + return 2; /* 2 means give up--match will return false */ + } + + /* Parse and process the list of characters and ranges in brackets */ + if (c == BEG_RANGE) { + int e; /* flag true if next char to be taken literally */ + ZCONST uch *q; /* pointer to end of [-] group */ + int r; /* flag true to match anything but the range */ + + if (*s == 0) /* need a character to match */ + return 0; + p += (r = (*p == '!' || *p == '^')); /* see if reverse */ + for (q = p, e = 0; *q; INCSTR(q)) /* find closing bracket */ + if (e) + e = 0; + else + if (*q == '\\') /* GRR: change to ^ for MS-DOS, OS/2? */ + e = 1; + else if (*q == END_RANGE) + break; + if (*q != END_RANGE) /* nothing matches if bad syntax */ + return 0; + for (c = 0, e = (*p == '-'); p < q; INCSTR(p)) { + /* go through the list */ + if (!e && *p == '\\') /* set escape flag if \ */ + e = 1; + else if (!e && *p == '-') /* set start of range if - */ + c = *(p-1); + else { + unsigned int cc = Case(*s); + + if (*(p+1) != '-') + for (c = c ? c : *p; c <= *p; c++) /* compare range */ + if ((unsigned)Case(c) == cc) /* typecast for MSC bug */ + return r ? 0 : recmatch(q + 1, s + 1, ic); + c = e = 0; /* clear range, escape flags */ + } + } + return r ? recmatch(q + CLEN(q), s + CLEN(s), ic) : 0; + /* bracket match failed */ + } + + /* if escape ('\'), just compare next character */ + if (c == '\\' && (c = *p++) == 0) /* if \ at end, then syntax error */ + return 0; + + /* just a character--compare it */ +#ifdef QDOS + return QMatch(Case((uch)c), Case(*s)) ? recmatch(p, s + CLEN(s), ic) : 0; +#else + return Case((uch)c) == Case(*s) ? recmatch(p, s + CLEN(s), ic) : 0; +#endif + +} /* end function recmatch() */ + +#endif /* !THEOS */ + + + + +int iswild(p) /* originally only used for stat()-bug workaround in */ + ZCONST char *p; /* VAX C, Turbo/Borland C, Watcom C, Atari MiNT libs; */ +{ /* now used in process_zipfiles() as well */ + for (; *p; INCSTR(p)) + if (*p == '\\' && *(p+1)) + ++p; +#ifdef THEOS + else if (*p == '?' || *p == '*' || *p=='#'|| *p == '@') +#else /* !THEOS */ +#ifdef VMS + else if (*p == '%' || *p == '*') +#else /* !VMS */ +#ifdef AMIGA + else if (*p == '?' || *p == '*' || (*p=='#' && p[1]=='?') || *p == '[') +#else /* !AMIGA */ + else if (*p == '?' || *p == '*' || *p == '[') +#endif /* ?AMIGA */ +#endif /* ?VMS */ +#endif /* ?THEOS */ +#ifdef QDOS + return (int)p; +#else + return TRUE; +#endif + + return FALSE; + +} /* end function iswild() */ + + + + + +#ifdef TEST_MATCH + +#define put(s) {fputs(s,stdout); fflush(stdout);} +#ifdef main +# undef main +#endif + +int main(int argc, char **argv) +{ + char pat[256], str[256]; + + for (;;) { + put("Pattern (return to exit): "); + gets(pat); + if (!pat[0]) + break; + for (;;) { + put("String (return for new pattern): "); + gets(str); + if (!str[0]) + break; + printf("Case sensitive: %s insensitive: %s\n", + match(str, pat, 0) ? "YES" : "NO", + match(str, pat, 1) ? "YES" : "NO"); + } + } + EXIT(0); +} + +#endif /* TEST_MATCH */ + +const char *BOINC_RCSID_7b1daf8eb1 = "$Id: match.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/process.c boinc-7.0.14+dfsg/zip/unzip/process.c --- boinc-7.0.7+dfsg/zip/unzip/process.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/process.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1661 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + process.c + + This file contains the top-level routines for processing multiple zipfiles. + + Contains: process_zipfiles() + free_G_buffers() + do_seekable() + find_ecrec() + uz_end_central() + process_cdir_file_hdr() + get_cdir_ent() + process_local_file_hdr() + ef_scan_for_izux() + getRISCOSexfield() + + ---------------------------------------------------------------------------*/ + + +#define UNZIP_INTERNAL +#include "unzip.h" +#ifdef WINDLL +# ifdef POCKET_UNZIP +# include "wince/intrface.h" +# else +# include "windll/windll.h" +# endif +#endif + +static int do_seekable OF((__GPRO__ int lastchance)); +static int find_ecrec OF((__GPRO__ long searchlen)); + +static ZCONST char Far CannotAllocateBuffers[] = + "error: cannot allocate unzip buffers\n"; + +#ifdef SFX + static ZCONST char Far CannotFindMyself[] = + "unzipsfx: cannot find myself! [%s]\n"; +# ifdef CHEAP_SFX_AUTORUN + static ZCONST char Far AutorunPrompt[] = + "\nAuto-run command: %s\nExecute this command? [y/n] "; + static ZCONST char Far NotAutoRunning[] = + "Not executing auto-run command."; +# endif + +#else /* !SFX */ + /* process_zipfiles() strings */ +# if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) + static ZCONST char Far WarnInvalidTZ[] = + "Warning: TZ environment variable not found, cannot use UTC times!!\n"; +# endif + static ZCONST char Far FilesProcessOK[] = + "%d archive%s successfully processed.\n"; + static ZCONST char Far ArchiveWarning[] = + "%d archive%s had warnings but no fatal errors.\n"; + static ZCONST char Far ArchiveFatalError[] = + "%d archive%s had fatal errors.\n"; + static ZCONST char Far FileHadNoZipfileDir[] = + "%d file%s had no zipfile directory.\n"; + static ZCONST char Far ZipfileWasDir[] = "1 \"zipfile\" was a directory.\n"; + static ZCONST char Far ManyZipfilesWereDir[] = + "%d \"zipfiles\" were directories.\n"; + static ZCONST char Far NoZipfileFound[] = "No zipfiles found.\n"; + + /* do_seekable() strings */ +# ifdef UNIX + static ZCONST char Far CannotFindZipfileDirMsg[] = + "%s: cannot find zipfile directory in one of %s or\n\ + %s%s.zip, and cannot find %s, period.\n"; + static ZCONST char Far CannotFindEitherZipfile[] = + "%s: cannot find %s, %s.zip or %s.\n"; +# else /* !UNIX */ +# ifndef AMIGA + static ZCONST char Far CannotFindWildcardMatch[] = + "%s: cannot find any matches for wildcard specification \"%s\".\n"; +# endif /* !AMIGA */ + static ZCONST char Far CannotFindZipfileDirMsg[] = + "%s: cannot find zipfile directory in %s,\n\ + %sand cannot find %s, period.\n"; + static ZCONST char Far CannotFindEitherZipfile[] = + "%s: cannot find either %s or %s.\n"; +# endif /* ?UNIX */ + extern ZCONST char Far Zipnfo[]; /* in unzip.c */ +#ifndef WINDLL + static ZCONST char Far Unzip[] = "unzip"; +#else + static ZCONST char Far Unzip[] = "UnZip DLL"; +#endif + static ZCONST char Far MaybeExe[] = + "note: %s may be a plain executable, not an archive\n"; + static ZCONST char Far CentDirNotInZipMsg[] = "\n\ + [%s]:\n\ + Zipfile is disk %u of a multi-disk archive, and this is not the disk on\n\ + which the central zipfile directory begins (disk %u).\n"; + static ZCONST char Far EndCentDirBogus[] = + "\nwarning [%s]: end-of-central-directory record claims this\n\ + is disk %u but that the central directory starts on disk %u; this is a\n\ + contradiction. Attempting to process anyway.\n"; +# ifdef NO_MULTIPART + static ZCONST char Far NoMultiDiskArcSupport[] = + "\nerror [%s]: zipfile is part of multi-disk archive\n\ + (sorry, not yet supported).\n"; + static ZCONST char Far MaybePakBug[] = "warning [%s]:\ + zipfile claims to be 2nd disk of a 2-part archive;\n\ + attempting to process anyway. If no further errors occur, this archive\n\ + was probably created by PAK v2.51 or earlier. This bug was reported to\n\ + NoGate in March 1991 and was supposed to have been fixed by mid-1991; as\n\ + of mid-1992 it still hadn't been. (If further errors do occur, archive\n\ + was probably created by PKZIP 2.04c or later; UnZip does not yet support\n\ + multi-part archives.)\n"; +# else + static ZCONST char Far MaybePakBug[] = "warning [%s]:\ + zipfile claims to be last disk of a multi-part archive;\n\ + attempting to process anyway, assuming all parts have been concatenated\n\ + together in order. Expect \"errors\" and warnings...true multi-part support\ +\n doesn't exist yet (coming soon).\n"; +# endif + static ZCONST char Far ExtraBytesAtStart[] = + "warning [%s]: %ld extra byte%s at beginning or within zipfile\n\ + (attempting to process anyway)\n"; +#endif /* ?SFX */ + +static ZCONST char Far MissingBytes[] = + "error [%s]: missing %ld bytes in zipfile\n\ + (attempting to process anyway)\n"; +static ZCONST char Far NullCentDirOffset[] = + "error [%s]: NULL central directory offset\n\ + (attempting to process anyway)\n"; +static ZCONST char Far ZipfileEmpty[] = "warning [%s]: zipfile is empty\n"; +static ZCONST char Far CentDirStartNotFound[] = + "error [%s]: start of central directory not found;\n\ + zipfile corrupt.\n%s"; +#ifndef SFX + static ZCONST char Far CentDirTooLong[] = + "error [%s]: reported length of central directory is\n\ + %ld bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1\n\ + zipfile?). Compensating...\n"; + static ZCONST char Far CentDirEndSigNotFound[] = "\ + End-of-central-directory signature not found. Either this file is not\n\ + a zipfile, or it constitutes one disk of a multi-part archive. In the\n\ + latter case the central directory and zipfile comment will be found on\n\ + the last disk(s) of this archive.\n"; +#else /* SFX */ + static ZCONST char Far CentDirEndSigNotFound[] = + " End-of-central-directory signature not found.\n"; +#endif /* ?SFX */ +static ZCONST char Far ZipfileCommTrunc1[] = + "\ncaution: zipfile comment truncated\n"; + + + + +/*******************************/ +/* Function process_zipfiles() */ +/*******************************/ + +int process_zipfiles(__G) /* return PK-type error code */ + __GDEF +{ +#ifndef SFX + char *lastzipfn = (char *)NULL; + int NumWinFiles, NumLoseFiles, NumWarnFiles; + int NumMissDirs, NumMissFiles; +#endif + int error=0, error_in_archive=0; + + +/*--------------------------------------------------------------------------- + Start by allocating buffers and (re)constructing the various PK signature + strings. + ---------------------------------------------------------------------------*/ + + G.inbuf = (uch *)malloc(INBUFSIZ + 4); /* 4 extra for hold[] (below) */ + G.outbuf = (uch *)malloc(OUTBUFSIZ + 1); /* 1 extra for string term. */ + + if ((G.inbuf == (uch *)NULL) || (G.outbuf == (uch *)NULL)) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(CannotAllocateBuffers))); + return(PK_MEM); + } + G.hold = G.inbuf + INBUFSIZ; /* to check for boundary-spanning sigs */ +#ifndef VMS /* VMS uses its own buffer scheme for textmode flush(). */ +#ifdef SMALL_MEM + G.outbuf2 = G.outbuf+RAWBUFSIZ; /* never changes */ +#endif +#endif /* !VMS */ + +#if 0 /* CRC_32_TAB has been NULLified by CONSTRUCTGLOBALS !!!! */ + /* allocate the CRC table only later when we know we have a zipfile */ + CRC_32_TAB = NULL; +#endif /* 0 */ + + /* finish up initialization of magic signature strings */ + local_hdr_sig[0] /* = extd_local_sig[0] */ = /* ASCII 'P', */ + central_hdr_sig[0] = end_central_sig[0] = 0x50; /* not EBCDIC */ + + local_hdr_sig[1] /* = extd_local_sig[1] */ = /* ASCII 'K', */ + central_hdr_sig[1] = end_central_sig[1] = 0x4B; /* not EBCDIC */ + +/*--------------------------------------------------------------------------- + Make sure timezone info is set correctly; localtime() returns GMT on + some OSes (e.g., Solaris 2.x) if this isn't done first. The ifdefs were + initially copied from dos_to_unix_time() in fileio.c. probably, they are + still too strict; any listed OS that supplies tzset(), regardless of + whether the function does anything, should be removed from the ifdefs. + ---------------------------------------------------------------------------*/ + +#if (defined(WIN32) && defined(USE_EF_UT_TIME)) + /* For the Win32 environment, we may have to "prepare" the environment + prior to the tzset() call, to work around tzset() implementation bugs. + */ + iz_w32_prepareTZenv(); +#endif + +#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) +# ifndef VALID_TIMEZONE +# define VALID_TIMEZONE(tmp) \ + (((tmp = getenv("TZ")) != NULL) && (*tmp != '\0')) +# endif + { + char *p; + G.tz_is_valid = VALID_TIMEZONE(p); +# ifndef SFX + if (!G.tz_is_valid) { + Info(slide, 0x401, ((char *)slide, LoadFarString(WarnInvalidTZ))); + error_in_archive = error = PK_WARN; + } +# endif /* !SFX */ + } +#endif /* IZ_CHECK_TZ && USE_EF_UT_TIME */ + +/* For systems that do not have tzset() but supply this function using another + name (_tzset() or something similar), an appropiate "#define tzset ..." + should be added to the system specifc configuration section. */ +#if (!defined(T20_VMS) && !defined(MACOS) && !defined(RISCOS) && !defined(QDOS)) +#if (!defined(BSD) && !defined(MTS) && !defined(CMS_MVS) && !defined(TANDEM)) + tzset(); +#endif +#endif + +/*--------------------------------------------------------------------------- + Initialize the internal flag holding the mode of processing "overwrite + existing file" cases. We do not use the calling interface flags directly + because the overwrite mode may be changed by user interaction while + processing archive files. Such a change should not affect the option + settings as passed through the DLL calling interface. + In case of conflicting options, the 'safer' flag uO.overwrite_none takes + precedence. + ---------------------------------------------------------------------------*/ + G.overwrite_mode = (uO.overwrite_none ? OVERWRT_NEVER : + (uO.overwrite_all ? OVERWRT_ALWAYS : OVERWRT_QUERY)); + +/*--------------------------------------------------------------------------- + Match (possible) wildcard zipfile specification with existing files and + attempt to process each. If no hits, try again after appending ".zip" + suffix. If still no luck, give up. + ---------------------------------------------------------------------------*/ + +#ifdef SFX + if ((error = do_seekable(__G__ 0)) == PK_NOZIP) { +#ifdef EXE_EXTENSION + int len=strlen(G.argv0); + + /* append .exe if appropriate; also .sfx? */ + if ( (G.zipfn = (char *)malloc(len+sizeof(EXE_EXTENSION))) != + (char *)NULL ) { + strcpy(G.zipfn, G.argv0); + strcpy(G.zipfn+len, EXE_EXTENSION); + error = do_seekable(__G__ 0); + free(G.zipfn); + G.zipfn = G.argv0; /* for "cannot find myself" message only */ + } +#endif /* EXE_EXTENSION */ +#ifdef WIN32 + G.zipfn = G.argv0; /* for "cannot find myself" message only */ +#endif + } + if (error) { + if (error == IZ_DIR) + error_in_archive = PK_NOZIP; + else + error_in_archive = error; + if (error == PK_NOZIP) + Info(slide, 1, ((char *)slide, LoadFarString(CannotFindMyself), + G.zipfn)); + } +#ifdef CHEAP_SFX_AUTORUN + if (G.autorun_command[0] && !uO.qflag) { /* NO autorun without prompt! */ + Info(slide, 0x81, ((char *)slide, LoadFarString(AutorunPrompt), + FnFilter1(G.autorun_command))); + if (fgets(G.answerbuf, 9, stdin) != (char *)NULL + && toupper(*G.answerbuf) == 'Y') + system(G.autorun_command); + else + Info(slide, 1, ((char *)slide, LoadFarString(NotAutoRunning))); + } +#endif /* CHEAP_SFX_AUTORUN */ + +#else /* !SFX */ + NumWinFiles = NumLoseFiles = NumWarnFiles = 0; + NumMissDirs = NumMissFiles = 0; + + while ((G.zipfn = do_wild(__G__ G.wildzipfn)) != (char *)NULL) { + Trace((stderr, "do_wild( %s ) returns %s\n", G.wildzipfn, G.zipfn)); + + lastzipfn = G.zipfn; + + /* print a blank line between the output of different zipfiles */ + if (!uO.qflag && error != PK_NOZIP && error != IZ_DIR +#ifdef TIMESTAMP + && (!uO.T_flag || uO.zipinfo_mode) +#endif + && (NumWinFiles+NumLoseFiles+NumWarnFiles+NumMissFiles) > 0) + (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); + + if ((error = do_seekable(__G__ 0)) == PK_WARN) + ++NumWarnFiles; + else if (error == IZ_DIR) + ++NumMissDirs; + else if (error == PK_NOZIP) + ++NumMissFiles; + else if (error) + ++NumLoseFiles; + else + ++NumWinFiles; + + Trace((stderr, "do_seekable(0) returns %d\n", error)); + if (error != IZ_DIR && error > error_in_archive) + error_in_archive = error; +#ifdef WINDLL + if (error == IZ_CTRLC) { + free_G_buffers(__G); + return error; + } +#endif + + } /* end while-loop (wildcard zipfiles) */ + + if ((NumWinFiles + NumWarnFiles + NumLoseFiles) == 0 && + (NumMissDirs + NumMissFiles) == 1 && lastzipfn != (char *)NULL) + { + NumMissDirs = NumMissFiles = 0; + if (error_in_archive == PK_NOZIP) + error_in_archive = PK_COOL; + +#if (!defined(UNIX) && !defined(AMIGA)) /* filenames with wildcard characters */ + if (iswild(G.wildzipfn)) + Info(slide, 0x401, ((char *)slide, + LoadFarString(CannotFindWildcardMatch), uO.zipinfo_mode? + LoadFarStringSmall(Zipnfo) : LoadFarStringSmall(Unzip), + G.wildzipfn)); + else +#endif + { + char *p = lastzipfn + strlen(lastzipfn); + + G.zipfn = lastzipfn; + strcpy(p, ZSUFX); + +#if defined(UNIX) || defined(QDOS) + /* only Unix has case-sensitive filesystems */ + /* Well FlexOS (sometimes) also has them, but support is per media */ + /* and a pig to code for, so treat as case insensitive for now */ + /* we do this under QDOS to check for .zip as well as _zip */ + if ((error = do_seekable(__G__ 0)) == PK_NOZIP || error == IZ_DIR) { + if (error == IZ_DIR) + ++NumMissDirs; + strcpy(p, ALT_ZSUFX); + error = do_seekable(__G__ 1); + } +#else + error = do_seekable(__G__ 1); +#endif + Trace((stderr, "do_seekable(1) returns %d\n", error)); + switch (error) { + case PK_WARN: + ++NumWarnFiles; + break; + case IZ_DIR: + ++NumMissDirs; + error = PK_NOZIP; + break; + case PK_NOZIP: + /* increment again => bug: + "1 file had no zipfile directory." */ + /* ++NumMissFiles */ ; + break; + default: + if (error) + ++NumLoseFiles; + else + ++NumWinFiles; + break; + } + + if (error > error_in_archive) + error_in_archive = error; +#ifdef WINDLL + if (error == IZ_CTRLC) { + free_G_buffers(__G); + return error; + } +#endif + } + } +#endif /* ?SFX */ + +/*--------------------------------------------------------------------------- + Print summary of all zipfiles, assuming zipfile spec was a wildcard (no + need for a summary if just one zipfile). + ---------------------------------------------------------------------------*/ + +#ifndef SFX + if (iswild(G.wildzipfn) && uO.qflag < 3 +#ifdef TIMESTAMP + && !(uO.T_flag && uO.qflag && !uO.zipinfo_mode) +#endif + ) + { + if ((NumMissFiles + NumLoseFiles + NumWarnFiles > 0 || NumWinFiles != 1) +#ifdef TIMESTAMP + && !(uO.T_flag && !uO.zipinfo_mode) +#endif + && !(uO.tflag && uO.qflag > 1)) + (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0x401); + if ((NumWinFiles > 1) || (NumWinFiles == 1 && + NumMissDirs + NumMissFiles + NumLoseFiles + NumWarnFiles > 0)) + Info(slide, 0x401, ((char *)slide, LoadFarString(FilesProcessOK), + NumWinFiles, (NumWinFiles == 1)? " was" : "s were")); + if (NumWarnFiles > 0) + Info(slide, 0x401, ((char *)slide, LoadFarString(ArchiveWarning), + NumWarnFiles, (NumWarnFiles == 1)? "" : "s")); + if (NumLoseFiles > 0) + Info(slide, 0x401, ((char *)slide, LoadFarString(ArchiveFatalError), + NumLoseFiles, (NumLoseFiles == 1)? "" : "s")); + if (NumMissFiles > 0) + Info(slide, 0x401, ((char *)slide, + LoadFarString(FileHadNoZipfileDir), NumMissFiles, + (NumMissFiles == 1)? "" : "s")); + if (NumMissDirs == 1) + Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileWasDir))); + else if (NumMissDirs > 0) + Info(slide, 0x401, ((char *)slide, + LoadFarString(ManyZipfilesWereDir), NumMissDirs)); + if (NumWinFiles + NumLoseFiles + NumWarnFiles == 0) + Info(slide, 0x401, ((char *)slide, LoadFarString(NoZipfileFound))); + } +#endif /* !SFX */ + + /* free allocated memory */ + free_G_buffers(__G); + + return error_in_archive; + +} /* end function process_zipfiles() */ + + + + + +/*****************************/ +/* Function free_G_buffers() */ +/*****************************/ + +void free_G_buffers(__G) /* releases all memory allocated in global vars */ + __GDEF +{ + inflate_free(__G); + checkdir(__G__ (char *)NULL, END); + +#ifdef DYNALLOC_CRCTAB + if (CRC_32_TAB) { + free_crc_table(); + CRC_32_TAB = NULL; + } +#endif + + if (G.key != (char *)NULL) { + free(G.key); + G.key = (char *)NULL; + } + + if (G.extra_field != (uch *)NULL) { + free(G.extra_field); + G.extra_field = (uch *)NULL; + } + +#if (!defined(VMS) && !defined(SMALL_MEM)) + /* VMS uses its own buffer scheme for textmode flush() */ + if (G.outbuf2) { + free(G.outbuf2); /* malloc'd ONLY if unshrink and -a */ + G.outbuf2 = (uch *)NULL; + } +#endif + + if (G.outbuf) + free(G.outbuf); + if (G.inbuf) + free(G.inbuf); + G.inbuf = G.outbuf = (uch *)NULL; + +#ifdef MALLOC_WORK + if (G.area.Slide) { + free(G.area.Slide); + G.area.Slide = (uch *)NULL; + } +#endif + +} /* end function free_G_buffers() */ + + + + + +/**************************/ +/* Function do_seekable() */ +/**************************/ + +static int do_seekable(__G__ lastchance) /* return PK-type error code */ + __GDEF + int lastchance; +{ +#ifndef SFX + /* static int no_ecrec = FALSE; SKM: moved to globals.h */ + int maybe_exe=FALSE; + int too_weird_to_continue=FALSE; +#ifdef TIMESTAMP + time_t uxstamp; + ulg nmember = 0L; +#endif +#endif + int error=0, error_in_archive; + + +/*--------------------------------------------------------------------------- + Open the zipfile for reading in BINARY mode to prevent CR/LF translation, + which would corrupt the bit streams. + ---------------------------------------------------------------------------*/ + + if (SSTAT(G.zipfn, &G.statbuf) || +#ifdef THEOS + (error = S_ISLIB(G.statbuf.st_mode)) != 0 || +#endif + (error = S_ISDIR(G.statbuf.st_mode)) != 0) + { +#ifndef SFX + if (lastchance && (uO.qflag < 3)) { +#if defined(UNIX) || defined(QDOS) + if (G.no_ecrec) + Info(slide, 1, ((char *)slide, + LoadFarString(CannotFindZipfileDirMsg), uO.zipinfo_mode? + LoadFarStringSmall(Zipnfo) : LoadFarStringSmall(Unzip), + G.wildzipfn, uO.zipinfo_mode? " " : "", G.wildzipfn, + G.zipfn)); + else + Info(slide, 1, ((char *)slide, + LoadFarString(CannotFindEitherZipfile), uO.zipinfo_mode? + LoadFarStringSmall(Zipnfo) : LoadFarStringSmall(Unzip), + G.wildzipfn, G.wildzipfn, G.zipfn)); +#else /* !(UNIX || QDOS) */ + if (G.no_ecrec) + Info(slide, 0x401, ((char *)slide, + LoadFarString(CannotFindZipfileDirMsg), uO.zipinfo_mode? + LoadFarStringSmall(Zipnfo) : LoadFarStringSmall(Unzip), + G.wildzipfn, uO.zipinfo_mode? " " : "", G.zipfn)); + else + Info(slide, 0x401, ((char *)slide, + LoadFarString(CannotFindEitherZipfile), uO.zipinfo_mode? + LoadFarStringSmall(Zipnfo) : LoadFarStringSmall(Unzip), + G.wildzipfn, G.zipfn)); +#endif /* ?(UNIX || QDOS) */ + } +#endif /* !SFX */ + return error? IZ_DIR : PK_NOZIP; + } + G.ziplen = G.statbuf.st_size; + +#ifndef SFX +#if defined(UNIX) || defined(DOS_OS2_W32) || defined(THEOS) + if (G.statbuf.st_mode & S_IEXEC) /* no extension on Unix exes: might */ + maybe_exe = TRUE; /* find unzip, not unzip.zip; etc. */ +#endif +#endif /* !SFX */ + +#ifdef VMS + if (check_format(__G)) /* check for variable-length format */ + return PK_ERR; +#endif + + if (open_input_file(__G)) /* this should never happen, given */ + return PK_NOZIP; /* the stat() test above, but... */ + +/*--------------------------------------------------------------------------- + Find and process the end-of-central-directory header. UnZip need only + check last 65557 bytes of zipfile: comment may be up to 65535, end-of- + central-directory record is 18 bytes, and signature itself is 4 bytes; + add some to allow for appended garbage. Since ZipInfo is often used as + a debugging tool, search the whole zipfile if zipinfo_mode is true. + ---------------------------------------------------------------------------*/ + + /* initialize the CRC table pointer (once) */ + if (CRC_32_TAB == NULL) { + if ((CRC_32_TAB = get_crc_table_boinc()) == NULL) { + CLOSE_INFILE(); + return PK_MEM; + } + } + +#if (!defined(SFX) || defined(SFX_EXDIR)) + /* check out if specified extraction root directory exists */ + if (uO.exdir != (char *)NULL && G.extract_flag) { + G.create_dirs = !uO.fflag; + if ((error = checkdir(__G__ uO.exdir, ROOT)) > MPN_INF_SKIP) { + /* out of memory, or file in way */ + CLOSE_INFILE(); + return (error == MPN_NOMEM ? PK_MEM : PK_ERR); + } + } +#endif /* !SFX || SFX_EXDIR */ + + G.cur_zipfile_bufstart = 0; + G.inptr = G.inbuf; + +#if (!defined(WINDLL) && !defined(SFX)) +#ifdef TIMESTAMP + if (!uO.zipinfo_mode && !uO.qflag && !uO.T_flag) +#else + if (!uO.zipinfo_mode && !uO.qflag) +#endif +#ifdef WIN32 /* Win32 console may require codepage conversion for G.zipfn */ + Info(slide, 0, ((char *)slide, "Archive: %s\n", FnFilter1(G.zipfn))); +#else + Info(slide, 0, ((char *)slide, "Archive: %s\n", G.zipfn)); +#endif +#endif /* !WINDLL && !SFX */ + + if (( +#ifndef NO_ZIPINFO + uO.zipinfo_mode && + ((error_in_archive = find_ecrec(__G__ G.ziplen)) != 0 || + (error_in_archive = zi_end_central(__G)) > PK_WARN)) + || (!uO.zipinfo_mode && +#endif + ((error_in_archive = find_ecrec(__G__ MIN(G.ziplen,66000L))) != 0 || + (error_in_archive = uz_end_central(__G)) > PK_WARN))) + { + CLOSE_INFILE(); + +#ifdef SFX + ++lastchance; /* avoid picky compiler warnings */ + return error_in_archive; +#else + if (maybe_exe) + Info(slide, 0x401, ((char *)slide, LoadFarString(MaybeExe), + G.zipfn)); + if (lastchance) + return error_in_archive; + else { + G.no_ecrec = TRUE; /* assume we found wrong file: e.g., */ + return PK_NOZIP; /* unzip instead of unzip.zip */ + } +#endif /* ?SFX */ + } + + if ((uO.zflag > 0) && !uO.zipinfo_mode) { /* unzip: zflag = comment ONLY */ + CLOSE_INFILE(); + return error_in_archive; + } + +/*--------------------------------------------------------------------------- + Test the end-of-central-directory info for incompatibilities (multi-disk + archives) or inconsistencies (missing or extra bytes in zipfile). + ---------------------------------------------------------------------------*/ + +#ifdef NO_MULTIPART + error = !uO.zipinfo_mode && (G.ecrec.number_this_disk == 1) && + (G.ecrec.num_disk_start_cdir == 1); +#else + error = !uO.zipinfo_mode && (G.ecrec.number_this_disk != 0); +#endif + +#ifndef SFX + if (uO.zipinfo_mode && + G.ecrec.number_this_disk != G.ecrec.num_disk_start_cdir) + { + if (G.ecrec.number_this_disk > G.ecrec.num_disk_start_cdir) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(CentDirNotInZipMsg), G.zipfn, + G.ecrec.number_this_disk, G.ecrec.num_disk_start_cdir)); + error_in_archive = PK_FIND; + too_weird_to_continue = TRUE; + } else { + Info(slide, 0x401, ((char *)slide, + LoadFarString(EndCentDirBogus), G.zipfn, + G.ecrec.number_this_disk, G.ecrec.num_disk_start_cdir)); + error_in_archive = PK_WARN; + } +#ifdef NO_MULTIPART /* concatenation of multiple parts works in some cases */ + } else if (!uO.zipinfo_mode && !error && G.ecrec.number_this_disk != 0) { + Info(slide, 0x401, ((char *)slide, LoadFarString(NoMultiDiskArcSupport), + G.zipfn)); + error_in_archive = PK_FIND; + too_weird_to_continue = TRUE; +#endif + } + + if (!too_weird_to_continue) { /* (relatively) normal zipfile: go for it */ + if (error) { + Info(slide, 0x401, ((char *)slide, LoadFarString(MaybePakBug), + G.zipfn)); + error_in_archive = PK_WARN; + } +#endif /* !SFX */ + if ((G.extra_bytes = G.real_ecrec_offset-G.expect_ecrec_offset) < + (LONGINT)0) + { + Info(slide, 0x401, ((char *)slide, LoadFarString(MissingBytes), + G.zipfn, (long)(-G.extra_bytes))); + error_in_archive = PK_ERR; + } else if (G.extra_bytes > 0) { + if ((G.ecrec.offset_start_central_directory == 0) && + (G.ecrec.size_central_directory != 0)) /* zip 1.5 -go bug */ + { + Info(slide, 0x401, ((char *)slide, + LoadFarString(NullCentDirOffset), G.zipfn)); + G.ecrec.offset_start_central_directory = G.extra_bytes; + G.extra_bytes = 0; + error_in_archive = PK_ERR; + } +#ifndef SFX + else { + Info(slide, 0x401, ((char *)slide, + LoadFarString(ExtraBytesAtStart), G.zipfn, + (long)G.extra_bytes, (G.extra_bytes == 1)? "":"s")); + error_in_archive = PK_WARN; + } +#endif /* !SFX */ + } + + /*----------------------------------------------------------------------- + Check for empty zipfile and exit now if so. + -----------------------------------------------------------------------*/ + + if (G.expect_ecrec_offset==0L && G.ecrec.size_central_directory==0) { + if (uO.zipinfo_mode) + Info(slide, 0, ((char *)slide, "%sEmpty zipfile.\n", + uO.lflag>9? "\n " : "")); + else + Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileEmpty), + G.zipfn)); + CLOSE_INFILE(); + return (error_in_archive > PK_WARN)? error_in_archive : PK_WARN; + } + + /*----------------------------------------------------------------------- + Compensate for missing or extra bytes, and seek to where the start + of central directory should be. If header not found, uncompensate + and try again (necessary for at least some Atari archives created + with STZip, as well as archives created by J.H. Holm's ZIPSPLIT 1.1). + -----------------------------------------------------------------------*/ + + error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); + if (error == PK_BADERR) { + CLOSE_INFILE(); + return PK_BADERR; + } +#ifdef OLD_SEEK_TEST + if (error != PK_OK || readbuf(__G__ G.sig, 4) == 0) { + CLOSE_INFILE(); + return PK_ERR; /* file may be locked, or possibly disk error(?) */ + } + if (strncmp(G.sig, central_hdr_sig, 4)) +#else + if ((error != PK_OK) || (readbuf(__G__ G.sig, 4) == 0) || + strncmp(G.sig, central_hdr_sig, 4)) +#endif + { +#ifndef SFX + long tmp = G.extra_bytes; +#endif + + G.extra_bytes = 0; + error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); + if ((error != PK_OK) || (readbuf(__G__ G.sig, 4) == 0) || + strncmp(G.sig, central_hdr_sig, 4)) + { + if (error != PK_BADERR) + Info(slide, 0x401, ((char *)slide, + LoadFarString(CentDirStartNotFound), G.zipfn, + LoadFarStringSmall(ReportMsg))); + CLOSE_INFILE(); + return (error != PK_OK ? error : PK_BADERR); + } +#ifndef SFX + Info(slide, 0x401, ((char *)slide, LoadFarString(CentDirTooLong), + G.zipfn, -tmp)); +#endif + error_in_archive = PK_ERR; + } + + /*----------------------------------------------------------------------- + Seek to the start of the central directory one last time, since we + have just read the first entry's signature bytes; then list, extract + or test member files as instructed, and close the zipfile. + -----------------------------------------------------------------------*/ + + error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); + if (error != PK_OK) { + CLOSE_INFILE(); + return error; + } + + Trace((stderr, "about to extract/list files (error = %d)\n", + error_in_archive)); + +#ifdef DLL + /* G.fValidate is used only to look at an archive to see if + it appears to be a valid archive. There is no interest + in what the archive contains, nor in validating that the + entries in the archive are in good condition. This is + currently used only in the Windows DLLs for purposes of + checking archives within an archive to determine whether + or not to display the inner archives. + */ + if (!G.fValidate) +#endif + { +#ifndef NO_ZIPINFO + if (uO.zipinfo_mode) + error = zipinfo(__G); /* ZIPINFO 'EM */ + else +#endif +#ifndef SFX +#ifdef TIMESTAMP + if (uO.T_flag) + error = get_time_stamp(__G__ &uxstamp, &nmember); + else +#endif + if (uO.vflag && !uO.tflag && !uO.cflag) + error = list_files(__G); /* LIST 'EM */ + else +#endif /* !SFX */ + error = extract_or_test_files(__G); /* EXTRACT OR TEST 'EM */ + + Trace((stderr, "done with extract/list files (error = %d)\n", + error)); + } + + if (error > error_in_archive) /* don't overwrite stronger error */ + error_in_archive = error; /* with (for example) a warning */ +#ifndef SFX + } /* end if (!too_weird_to_continue) */ +#endif + + CLOSE_INFILE(); + +#ifdef TIMESTAMP + if (uO.T_flag && !uO.zipinfo_mode && (nmember > 0L)) { +# ifdef WIN32 + if (stamp_file(__G__ G.zipfn, uxstamp)) { /* TIME-STAMP 'EM */ +# else + if (stamp_file(G.zipfn, uxstamp)) { /* TIME-STAMP 'EM */ +# endif + if (uO.qflag < 3) + Info(slide, 0x201, ((char *)slide, + "warning: cannot set time for %s\n", G.zipfn)); + if (error_in_archive < PK_WARN) + error_in_archive = PK_WARN; + } + } +#endif + return error_in_archive; + +} /* end function do_seekable() */ + + + + + +/*************************/ +/* Function find_ecrec() */ +/*************************/ + +static int find_ecrec(__G__ searchlen) /* return PK-class error */ + __GDEF + long searchlen; +{ + int i, numblks, found=FALSE; + LONGINT tail_len; + ec_byte_rec byterec; + + +/*--------------------------------------------------------------------------- + Treat case of short zipfile separately. + ---------------------------------------------------------------------------*/ + + if (G.ziplen <= INBUFSIZ) { + lseek(G.zipfd, 0L, SEEK_SET); + if ((G.incnt = read(G.zipfd,(char *)G.inbuf,(unsigned int)G.ziplen)) + == (int)G.ziplen) + + /* 'P' must be at least (ECREC_SIZE+4) bytes from end of zipfile */ + for (G.inptr = G.inbuf+(int)G.ziplen-(ECREC_SIZE+4); + G.inptr >= G.inbuf; + --G.inptr) { + if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ + !strncmp((char *)G.inptr, end_central_sig, 4)) { + G.incnt -= (int)(G.inptr - G.inbuf); + found = TRUE; + break; + } + } + +/*--------------------------------------------------------------------------- + Zipfile is longer than INBUFSIZ: may need to loop. Start with short + block at end of zipfile (if not TOO short). + ---------------------------------------------------------------------------*/ + + } else { + if ((tail_len = G.ziplen % INBUFSIZ) > ECREC_SIZE) { +#ifdef USE_STRM_INPUT + fseek((FILE *)G.zipfd, G.ziplen-tail_len, SEEK_SET); + G.cur_zipfile_bufstart = ftell((FILE *)G.zipfd); +#else /* !USE_STRM_INPUT */ + G.cur_zipfile_bufstart = lseek(G.zipfd, G.ziplen-tail_len, + SEEK_SET); +#endif /* ?USE_STRM_INPUT */ + if ((G.incnt = read(G.zipfd, (char *)G.inbuf, + (unsigned int)tail_len)) != (int)tail_len) + goto fail; /* it's expedient... */ + + /* 'P' must be at least (ECREC_SIZE+4) bytes from end of zipfile */ + for (G.inptr = G.inbuf+(int)tail_len-(ECREC_SIZE+4); + G.inptr >= G.inbuf; + --G.inptr) { + if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ + !strncmp((char *)G.inptr, end_central_sig, 4)) { + G.incnt -= (int)(G.inptr - G.inbuf); + found = TRUE; + break; + } + } + /* sig may span block boundary: */ + memcpy((char *)G.hold, (char *)G.inbuf, 3); + } else + G.cur_zipfile_bufstart = G.ziplen - tail_len; + + /*----------------------------------------------------------------------- + Loop through blocks of zipfile data, starting at the end and going + toward the beginning. In general, need not check whole zipfile for + signature, but may want to do so if testing. + -----------------------------------------------------------------------*/ + + numblks = (int)((searchlen - tail_len + (INBUFSIZ-1)) / INBUFSIZ); + /* ==amount= ==done== ==rounding== =blksiz= */ + + for (i = 1; !found && (i <= numblks); ++i) { + G.cur_zipfile_bufstart -= INBUFSIZ; + lseek(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET); + if ((G.incnt = read(G.zipfd,(char *)G.inbuf,INBUFSIZ)) + != INBUFSIZ) + break; /* fall through and fail */ + + for (G.inptr = G.inbuf+INBUFSIZ-1; G.inptr >= G.inbuf; + --G.inptr) + if ((native(*G.inptr) == 'P') && + !strncmp((char *)G.inptr, end_central_sig, 4)) { + G.incnt -= (int)(G.inptr - G.inbuf); + found = TRUE; + break; + } + /* sig may span block boundary: */ + memcpy((char *)G.hold, (char *)G.inbuf, 3); + } + } /* end if (ziplen > INBUFSIZ) */ + +/*--------------------------------------------------------------------------- + Searched through whole region where signature should be without finding + it. Print informational message and die a horrible death. + ---------------------------------------------------------------------------*/ + +fail: + if (!found) { + if (uO.qflag || uO.zipinfo_mode) + Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); + Info(slide, 0x401, ((char *)slide, + LoadFarString(CentDirEndSigNotFound))); + return PK_ERR; /* failed */ + } + +/*--------------------------------------------------------------------------- + Found the signature, so get the end-central data before returning. Do + any necessary machine-type conversions (byte ordering, structure padding + compensation) by reading data into character array and copying to struct. + ---------------------------------------------------------------------------*/ + + G.real_ecrec_offset = G.cur_zipfile_bufstart + (G.inptr-G.inbuf); +#ifdef TEST + printf("\n found end-of-central-dir signature at offset %ld (%.8lXh)\n", + G.real_ecrec_offset, G.real_ecrec_offset); + printf(" from beginning of file; offset %d (%.4Xh) within block\n", + G.inptr-G.inbuf, G.inptr-G.inbuf); +#endif + + if (readbuf(__G__ (char *)byterec, ECREC_SIZE+4) == 0) + return PK_EOF; + + G.ecrec.number_this_disk = + makeword(&byterec[NUMBER_THIS_DISK]); + G.ecrec.num_disk_start_cdir = + makeword(&byterec[NUM_DISK_WITH_START_CENTRAL_DIR]); + G.ecrec.num_entries_centrl_dir_ths_disk = + makeword(&byterec[NUM_ENTRIES_CENTRL_DIR_THS_DISK]); + G.ecrec.total_entries_central_dir = + makeword(&byterec[TOTAL_ENTRIES_CENTRAL_DIR]); + G.ecrec.size_central_directory = + makelong(&byterec[SIZE_CENTRAL_DIRECTORY]); + G.ecrec.offset_start_central_directory = + makelong(&byterec[OFFSET_START_CENTRAL_DIRECTORY]); + G.ecrec.zipfile_comment_length = + makeword(&byterec[ZIPFILE_COMMENT_LENGTH]); + + G.expect_ecrec_offset = G.ecrec.offset_start_central_directory + + G.ecrec.size_central_directory; + return PK_COOL; + +} /* end function find_ecrec() */ + + + + + +/*****************************/ +/* Function uz_end_central() */ +/*****************************/ + +int uz_end_central(__G) /* return PK-type error code */ + __GDEF +{ + int error = PK_COOL; + + +/*--------------------------------------------------------------------------- + Get the zipfile comment (up to 64KB long), if any, and print it out. + Then position the file pointer to the beginning of the central directory + and fill buffer. + ---------------------------------------------------------------------------*/ + +#ifdef WINDLL + /* for comment button: */ + if ((!G.fValidate) && (G.lpUserFunctions != NULL)) + G.lpUserFunctions->cchComment = G.ecrec.zipfile_comment_length; + if (G.ecrec.zipfile_comment_length && (uO.zflag > 0)) +#else /* !WINDLL */ + if (G.ecrec.zipfile_comment_length && (uO.zflag > 0 || + (uO.zflag == 0 && +#ifdef TIMESTAMP + !uO.T_flag && +#endif + !uO.qflag))) +#endif /* ?WINDLL */ + { +#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) + if (do_string(__G__ G.ecrec.zipfile_comment_length, CHECK_AUTORUN)) { +#else + if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) { +#endif + Info(slide, 0x401, ((char *)slide, + LoadFarString(ZipfileCommTrunc1))); + error = PK_WARN; + } + } +#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) + else if (G.ecrec.zipfile_comment_length) { + if (do_string(__G__ G.ecrec.zipfile_comment_length, CHECK_AUTORUN_Q)) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(ZipfileCommTrunc1))); + error = PK_WARN; + } + } +#endif + return error; + +} /* end function uz_end_central() */ + + + + + +/************************************/ +/* Function process_cdir_file_hdr() */ +/************************************/ + +int process_cdir_file_hdr(__G) /* return PK-type error code */ + __GDEF +{ + int error; + + +/*--------------------------------------------------------------------------- + Get central directory info, save host and method numbers, and set flag + for lowercase conversion of filename, depending on the OS from which the + file is coming. + ---------------------------------------------------------------------------*/ + + if ((error = get_cdir_ent(__G)) != 0) + return error; + + G.pInfo->hostver = G.crec.version_made_by[0]; + G.pInfo->hostnum = MIN(G.crec.version_made_by[1], NUM_HOSTS); +/* extnum = MIN(crec.version_needed_to_extract[1], NUM_HOSTS); */ + + G.pInfo->lcflag = 0; + if (uO.L_flag == 1) /* name conversion for monocase systems */ + switch (G.pInfo->hostnum) { + case FS_FAT_: /* PKZIP and zip -k store in uppercase */ + case CPM_: /* like MS-DOS, right? */ + case VM_CMS_: /* all caps? */ + case MVS_: /* all caps? */ + case TANDEM_: + case TOPS20_: + case VMS_: /* our Zip uses lowercase, but ASi's doesn't */ + /* case Z_SYSTEM_: ? */ + /* case QDOS_: ? */ + G.pInfo->lcflag = 1; /* convert filename to lowercase */ + break; + + default: /* AMIGA_, FS_HPFS_, FS_NTFS_, MAC_, UNIX_, ATARI_, */ + break; /* FS_VFAT_, BEOS_ (Z_SYSTEM_), THEOS_: */ + /* no conversion */ + } + else if (uO.L_flag > 1) /* let -LL force lower case for all names */ + G.pInfo->lcflag = 1; + + /* do Amigas (AMIGA_) also have volume labels? */ + if (IS_VOLID(G.crec.external_file_attributes) && + (G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ || + G.pInfo->hostnum == FS_NTFS_ || G.pInfo->hostnum == ATARI_)) + { + G.pInfo->vollabel = TRUE; + G.pInfo->lcflag = 0; /* preserve case of volume labels */ + } else + G.pInfo->vollabel = FALSE; + + /* this flag is needed to detect archives made by "PKZIP for Unix" when + deciding which kind of codepage conversion has to be applied to + strings (see do_string() function in fileio.c) */ + G.pInfo->HasUxAtt = (G.crec.external_file_attributes & 0xffff0000L) != 0L; + + return PK_COOL; + +} /* end function process_cdir_file_hdr() */ + + + + + +/***************************/ +/* Function get_cdir_ent() */ +/***************************/ + +int get_cdir_ent(__G) /* return PK-type error code */ + __GDEF +{ + cdir_byte_hdr byterec; + + +/*--------------------------------------------------------------------------- + Read the next central directory entry and do any necessary machine-type + conversions (byte ordering, structure padding compensation--do so by + copying the data from the array into which it was read (byterec) to the + usable struct (crec)). + ---------------------------------------------------------------------------*/ + + if (readbuf(__G__ (char *)byterec, CREC_SIZE) == 0) + return PK_EOF; + + G.crec.version_made_by[0] = byterec[C_VERSION_MADE_BY_0]; + G.crec.version_made_by[1] = byterec[C_VERSION_MADE_BY_1]; + G.crec.version_needed_to_extract[0] = + byterec[C_VERSION_NEEDED_TO_EXTRACT_0]; + G.crec.version_needed_to_extract[1] = + byterec[C_VERSION_NEEDED_TO_EXTRACT_1]; + + G.crec.general_purpose_bit_flag = + makeword(&byterec[C_GENERAL_PURPOSE_BIT_FLAG]); + G.crec.compression_method = + makeword(&byterec[C_COMPRESSION_METHOD]); + G.crec.last_mod_dos_datetime = + makelong(&byterec[C_LAST_MOD_DOS_DATETIME]); + G.crec.crc32 = + makelong(&byterec[C_CRC32]); + G.crec.csize = + makelong(&byterec[C_COMPRESSED_SIZE]); + G.crec.ucsize = + makelong(&byterec[C_UNCOMPRESSED_SIZE]); + G.crec.filename_length = + makeword(&byterec[C_FILENAME_LENGTH]); + G.crec.extra_field_length = + makeword(&byterec[C_EXTRA_FIELD_LENGTH]); + G.crec.file_comment_length = + makeword(&byterec[C_FILE_COMMENT_LENGTH]); + G.crec.disk_number_start = + makeword(&byterec[C_DISK_NUMBER_START]); + G.crec.internal_file_attributes = + makeword(&byterec[C_INTERNAL_FILE_ATTRIBUTES]); + G.crec.external_file_attributes = + makelong(&byterec[C_EXTERNAL_FILE_ATTRIBUTES]); /* LONG, not word! */ + G.crec.relative_offset_local_header = + makelong(&byterec[C_RELATIVE_OFFSET_LOCAL_HEADER]); + + return PK_COOL; + +} /* end function get_cdir_ent() */ + + + + + +/*************************************/ +/* Function process_local_file_hdr() */ +/*************************************/ + +int process_local_file_hdr(__G) /* return PK-type error code */ + __GDEF +{ + local_byte_hdr byterec; + + +/*--------------------------------------------------------------------------- + Read the next local file header and do any necessary machine-type con- + versions (byte ordering, structure padding compensation--do so by copy- + ing the data from the array into which it was read (byterec) to the + usable struct (lrec)). + ---------------------------------------------------------------------------*/ + + if (readbuf(__G__ (char *)byterec, LREC_SIZE) == 0) + return PK_EOF; + + G.lrec.version_needed_to_extract[0] = + byterec[L_VERSION_NEEDED_TO_EXTRACT_0]; + G.lrec.version_needed_to_extract[1] = + byterec[L_VERSION_NEEDED_TO_EXTRACT_1]; + + G.lrec.general_purpose_bit_flag = + makeword(&byterec[L_GENERAL_PURPOSE_BIT_FLAG]); + G.lrec.compression_method = makeword(&byterec[L_COMPRESSION_METHOD]); + G.lrec.last_mod_dos_datetime = makelong(&byterec[L_LAST_MOD_DOS_DATETIME]); + G.lrec.crc32 = makelong(&byterec[L_CRC32]); + G.lrec.csize = makelong(&byterec[L_COMPRESSED_SIZE]); + G.lrec.ucsize = makelong(&byterec[L_UNCOMPRESSED_SIZE]); + G.lrec.filename_length = makeword(&byterec[L_FILENAME_LENGTH]); + G.lrec.extra_field_length = makeword(&byterec[L_EXTRA_FIELD_LENGTH]); + + if ((G.lrec.general_purpose_bit_flag & 8) != 0) { + /* can't trust local header, use central directory: */ + G.lrec.crc32 = G.pInfo->crc; + G.lrec.csize = G.pInfo->compr_size; + G.lrec.ucsize = G.pInfo->uncompr_size; + } + + G.csize = (long)G.lrec.csize; + + return PK_COOL; + +} /* end function process_local_file_hdr() */ + + +#ifdef USE_EF_UT_TIME + +/*******************************/ +/* Function ef_scan_for_izux() */ +/*******************************/ + +unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime, + z_utim, z_uidgid) + ZCONST uch *ef_buf; /* buffer containing extra field */ + unsigned ef_len; /* total length of extra field */ + int ef_is_c; /* flag indicating "is central extra field" */ + ulg dos_mdatetime; /* last_mod_file_date_time in DOS format */ + iztimes *z_utim; /* return storage: atime, mtime, ctime */ + ush *z_uidgid; /* return storage: uid and gid */ +{ + unsigned flags = 0; + unsigned eb_id; + unsigned eb_len; + int have_new_type_eb = FALSE; + long i_time; /* buffer for Unix style 32-bit integer time value */ +#ifdef TIME_T_TYPE_DOUBLE + int ut_in_archive_sgn = 0; +#else + int ut_zip_unzip_compatible = FALSE; +#endif + +/*--------------------------------------------------------------------------- + This function scans the extra field for EF_TIME, EF_IZUNIX2, EF_IZUNIX, or + EF_PKUNIX blocks containing Unix-style time_t (GMT) values for the entry's + access, creation, and modification time. + If a valid block is found, the time stamps are copied to the iztimes + structure (provided the z_utim pointer is not NULL). + If a IZUNIX2 block is found or the IZUNIX block contains UID/GID fields, + and the z_uidgid array pointer is valid (!= NULL), the owner info is + transfered as well. + The presence of an EF_TIME or EF_IZUNIX2 block results in ignoring all + data from probably present obsolete EF_IZUNIX blocks. + If multiple blocks of the same type are found, only the information from + the last block is used. + The return value is a combination of the EF_TIME Flags field with an + additional flag bit indicating the presence of valid UID/GID info, + or 0 in case of failure. + ---------------------------------------------------------------------------*/ + + if (ef_len == 0 || ef_buf == NULL || (z_utim == 0 && z_uidgid == NULL)) + return 0; + + TTrace((stderr,"\nef_scan_for_izux: scanning extra field of length %u\n", + ef_len)); + + while (ef_len >= EB_HEADSIZE) { + eb_id = makeword(EB_ID + ef_buf); + eb_len = makeword(EB_LEN + ef_buf); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + /* discovered some extra field inconsistency! */ + TTrace((stderr, + "ef_scan_for_izux: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } + + switch (eb_id) { + case EF_TIME: + flags &= ~0x0ff; /* ignore previous IZUNIX or EF_TIME fields */ + have_new_type_eb = TRUE; + if ( eb_len >= EB_UT_MINLEN && z_utim != NULL) { + unsigned eb_idx = EB_UT_TIME1; + TTrace((stderr,"ef_scan_for_izux: found TIME extra field\n")); + flags |= (ef_buf[EB_HEADSIZE+EB_UT_FLAGS] & 0x0ff); + if ((flags & EB_UT_FL_MTIME)) { + if ((eb_idx+4) <= eb_len) { + i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); + eb_idx += 4; + TTrace((stderr," UT e.f. modification time = %ld\n", + i_time)); + +#ifdef TIME_T_TYPE_DOUBLE + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + if (dos_mdatetime == DOSTIME_MINIMUM) { + ut_in_archive_sgn = -1; + z_utim->mtime = + (time_t)((long)i_time | (~(long)0x7fffffffL)); + } else if (dos_mdatetime >= DOSTIME_2038_01_18) { + ut_in_archive_sgn = 1; + z_utim->mtime = + (time_t)((ulg)i_time & (ulg)0xffffffffL); + } else { + ut_in_archive_sgn = 0; + /* cannot determine sign of mtime; + without modtime: ignore complete UT field */ + flags &= ~0x0ff; /* no time_t times available */ + TTrace((stderr, + " UT modtime range error; ignore e.f.!\n")); + break; /* stop scanning this field */ + } + } else { + /* cannot determine, safe assumption is FALSE */ + ut_in_archive_sgn = 0; + z_utim->mtime = (time_t)i_time; + } +#else /* !TIME_T_TYPE_DOUBLE */ + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + ut_zip_unzip_compatible = + ((time_t)0x80000000L < (time_t)0L) + ? (dos_mdatetime == DOSTIME_MINIMUM) + : (dos_mdatetime >= DOSTIME_2038_01_18); + if (!ut_zip_unzip_compatible) { + /* UnZip interprets mtime differently than Zip; + without modtime: ignore complete UT field */ + flags &= ~0x0ff; /* no time_t times available */ + TTrace((stderr, + " UT modtime range error; ignore e.f.!\n")); + break; /* stop scanning this field */ + } + } else { + /* cannot determine, safe assumption is FALSE */ + ut_zip_unzip_compatible = FALSE; + } + z_utim->mtime = (time_t)i_time; +#endif /* ?TIME_T_TYPE_DOUBLE */ + } else { + flags &= ~EB_UT_FL_MTIME; + TTrace((stderr," UT e.f. truncated; no modtime\n")); + } + } + if (ef_is_c) { + break; /* central version of TIME field ends here */ + } + + if (flags & EB_UT_FL_ATIME) { + if ((eb_idx+4) <= eb_len) { + i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); + eb_idx += 4; + TTrace((stderr," UT e.f. access time = %ld\n", + i_time)); +#ifdef TIME_T_TYPE_DOUBLE + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + if (ut_in_archive_sgn == -1) + z_utim->atime = + (time_t)((long)i_time | (~(long)0x7fffffffL)); + } else if (ut_in_archive_sgn == 1) { + z_utim->atime = + (time_t)((ulg)i_time & (ulg)0xffffffffL); + } else { + /* sign of 32-bit time is unknown -> ignore it */ + flags &= ~EB_UT_FL_ATIME; + TTrace((stderr, + " UT access time range error: skip time!\n")); + } + } else { + z_utim->atime = (time_t)i_time; + } +#else /* !TIME_T_TYPE_DOUBLE */ + if (((ulg)(i_time) & (ulg)(0x80000000L)) && + !ut_zip_unzip_compatible) { + flags &= ~EB_UT_FL_ATIME; + TTrace((stderr, + " UT access time range error: skip time!\n")); + } else { + z_utim->atime = (time_t)i_time; + } +#endif /* ?TIME_T_TYPE_DOUBLE */ + } else { + flags &= ~EB_UT_FL_ATIME; + } + } + if (flags & EB_UT_FL_CTIME) { + if ((eb_idx+4) <= eb_len) { + i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); + TTrace((stderr," UT e.f. creation time = %ld\n", + i_time)); +#ifdef TIME_T_TYPE_DOUBLE + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + if (ut_in_archive_sgn == -1) + z_utim->ctime = + (time_t)((long)i_time | (~(long)0x7fffffffL)); + } else if (ut_in_archive_sgn == 1) { + z_utim->ctime = + (time_t)((ulg)i_time & (ulg)0xffffffffL); + } else { + /* sign of 32-bit time is unknown -> ignore it */ + flags &= ~EB_UT_FL_CTIME; + TTrace((stderr, + " UT creation time range error: skip time!\n")); + } + } else { + z_utim->ctime = (time_t)i_time; + } +#else /* !TIME_T_TYPE_DOUBLE */ + if (((ulg)(i_time) & (ulg)(0x80000000L)) && + !ut_zip_unzip_compatible) { + flags &= ~EB_UT_FL_CTIME; + TTrace((stderr, + " UT creation time range error: skip time!\n")); + } else { + z_utim->ctime = (time_t)i_time; + } +#endif /* ?TIME_T_TYPE_DOUBLE */ + } else { + flags &= ~EB_UT_FL_CTIME; + } + } + } + break; + + case EF_IZUNIX2: + if (!have_new_type_eb) { + flags &= ~0x0ff; /* ignore any previous IZUNIX field */ + have_new_type_eb = TRUE; + } + if (eb_len >= EB_UX2_MINLEN && z_uidgid != NULL) { + z_uidgid[0] = makeword((EB_HEADSIZE+EB_UX2_UID) + ef_buf); + z_uidgid[1] = makeword((EB_HEADSIZE+EB_UX2_GID) + ef_buf); + flags |= EB_UX2_VALID; /* signal success */ + } + break; + + case EF_IZUNIX: + case EF_PKUNIX: /* PKUNIX e.f. layout is identical to IZUNIX */ + if (eb_len >= EB_UX_MINLEN) { + TTrace((stderr,"ef_scan_for_izux: found %s extra field\n", + (eb_id == EF_IZUNIX ? "IZUNIX" : "PKUNIX"))); + if (have_new_type_eb) { + break; /* Ignore IZUNIX extra field block ! */ + } + if (z_utim != NULL) { + flags |= (EB_UT_FL_MTIME | EB_UT_FL_ATIME); + i_time = (long)makelong((EB_HEADSIZE+EB_UX_MTIME)+ef_buf); + TTrace((stderr," Unix EF modtime = %ld\n", i_time)); +#ifdef TIME_T_TYPE_DOUBLE + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + if (dos_mdatetime == DOSTIME_MINIMUM) { + ut_in_archive_sgn = -1; + z_utim->mtime = + (time_t)((long)i_time | (~(long)0x7fffffffL)); + } else if (dos_mdatetime >= DOSTIME_2038_01_18) { + ut_in_archive_sgn = 1; + z_utim->mtime = + (time_t)((ulg)i_time & (ulg)0xffffffffL); + } else { + ut_in_archive_sgn = 0; + /* cannot determine sign of mtime; + without modtime: ignore complete UT field */ + flags &= ~0x0ff; /* no time_t times available */ + TTrace((stderr, + " UX modtime range error: ignore e.f.!\n")); + } + } else { + /* cannot determine, safe assumption is FALSE */ + ut_in_archive_sgn = 0; + z_utim->mtime = (time_t)i_time; + } +#else /* !TIME_T_TYPE_DOUBLE */ + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + ut_zip_unzip_compatible = + ((time_t)0x80000000L < (time_t)0L) + ? (dos_mdatetime == DOSTIME_MINIMUM) + : (dos_mdatetime >= DOSTIME_2038_01_18); + if (!ut_zip_unzip_compatible) { + /* UnZip interpretes mtime differently than Zip; + without modtime: ignore complete UT field */ + flags &= ~0x0ff; /* no time_t times available */ + TTrace((stderr, + " UX modtime range error: ignore e.f.!\n")); + } + } else { + /* cannot determine, safe assumption is FALSE */ + ut_zip_unzip_compatible = FALSE; + } + z_utim->mtime = (time_t)i_time; +#endif /* ?TIME_T_TYPE_DOUBLE */ + i_time = (long)makelong((EB_HEADSIZE+EB_UX_ATIME)+ef_buf); + TTrace((stderr," Unix EF actime = %ld\n", i_time)); +#ifdef TIME_T_TYPE_DOUBLE + if ((ulg)(i_time) & (ulg)(0x80000000L)) { + if (ut_in_archive_sgn == -1) + z_utim->atime = + (time_t)((long)i_time | (~(long)0x7fffffffL)); + } else if (ut_in_archive_sgn == 1) { + z_utim->atime = + (time_t)((ulg)i_time & (ulg)0xffffffffL); + } else if (flags & 0x0ff) { + /* sign of 32-bit time is unknown -> ignore it */ + flags &= ~EB_UT_FL_ATIME; + TTrace((stderr, + " UX access time range error: skip time!\n")); + } + } else { + z_utim->atime = (time_t)i_time; + } +#else /* !TIME_T_TYPE_DOUBLE */ + if (((ulg)(i_time) & (ulg)(0x80000000L)) && + !ut_zip_unzip_compatible && (flags & 0x0ff)) { + /* atime not in range of UnZip's time_t */ + flags &= ~EB_UT_FL_ATIME; + TTrace((stderr, + " UX access time range error: skip time!\n")); + } else { + z_utim->atime = (time_t)i_time; + } +#endif /* ?TIME_T_TYPE_DOUBLE */ + } + if (eb_len >= EB_UX_FULLSIZE && z_uidgid != NULL) { + z_uidgid[0] = makeword((EB_HEADSIZE+EB_UX_UID) + ef_buf); + z_uidgid[1] = makeword((EB_HEADSIZE+EB_UX_GID) + ef_buf); + flags |= EB_UX2_VALID; + } + } + break; + + default: + break; + } + + /* Skip this extra field block */ + ef_buf += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } + + return flags; +} + +#endif /* USE_EF_UT_TIME */ + + +#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) + +#define SPARKID_2 0x30435241 /* = "ARC0" */ + +/*******************************/ +/* Function getRISCOSexfield() */ +/*******************************/ + +zvoid *getRISCOSexfield(ef_buf, ef_len) + ZCONST uch *ef_buf; /* buffer containing extra field */ + unsigned ef_len; /* total length of extra field */ +{ + unsigned eb_id; + unsigned eb_len; + +/*--------------------------------------------------------------------------- + This function scans the extra field for a Acorn SPARK filetype ef-block. + If a valid block is found, the function returns a pointer to the start + of the SPARK_EF block in the extra field buffer. Otherwise, a NULL + pointer is returned. + ---------------------------------------------------------------------------*/ + + if (ef_len == 0 || ef_buf == NULL) + return NULL; + + TTrace((stderr,"\ngetRISCOSexfield: scanning extra field of length %u\n", + ef_len)); + + while (ef_len >= EB_HEADSIZE) { + eb_id = makeword(EB_ID + ef_buf); + eb_len = makeword(EB_LEN + ef_buf); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + /* discovered some extra field inconsistency! */ + TTrace((stderr, + "getRISCOSexfield: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } + + if (eb_id == EF_SPARK && (eb_len == 24 || eb_len == 20)) { + if (makelong(EB_HEADSIZE + ef_buf) == SPARKID_2) { + /* Return a pointer to the valid SPARK filetype ef block */ + return (zvoid *)ef_buf; + } + } + + /* Skip this extra field block */ + ef_buf += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } + + return NULL; +} + +#endif /* (RISCOS || ACORN_FTYPE_NFS) */ + +const char *BOINC_RCSID_678d9914bf = "$Id: process.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/README boinc-7.0.14+dfsg/zip/unzip/README --- boinc-7.0.7+dfsg/zip/unzip/README 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/README 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,246 @@ +This is the README file for the 17 February 2002 public release of the +Info-ZIP group's portable UnZip zipfile-extraction program (and related +utilities). + +unzip550.zip portable UnZip, version 5.5, source code distribution +unzip550.tar.Z same as above, but compress'd tar format +unzip550.tar.gz same as above, but gzip'd tar format + +__________________________________________________________________________ + +BEFORE YOU ASK: UnZip, its companion utility Zip, and related utilities +and support files can be found in many places; read the file "WHERE" for +further details. To contact the authors with suggestions, bug reports, +or fixes, continue reading this file (README) and, if this is part of a +source distribution, the file "ZipPorts" in the proginfo directory. Also +in source distributions: read "BUGS" for a list of known bugs, non-bugs +and possible future bugs; INSTALL for instructions on how to build UnZip; +and "Contents" for a commented listing of all the distributed files. +__________________________________________________________________________ + + +GENERAL INFO +------------ +UnZip is an extraction utility for archives compressed in .zip format (also +called "zipfiles"). Although highly compatible both with PKWARE's PKZIP +and PKUNZIP utilities for MS-DOS and with Info-ZIP's own Zip program, our +primary objectives have been portability and non-MSDOS functionality. + +This version of UnZip has been ported to a stupendous array of hardware-- +from micros to supercomputers--and operating systems: Unix (many flavors), +VMS, OS/2 (including DLL version), Windows NT and Windows 95 (including DLL +version), Windows CE (GUI version), Windows 3.x (including DLL version), +MS-DOS, AmigaDOS, Atari TOS, Acorn RISC OS, BeOS, Macintosh (GUI version), +SMS/QDOS, MVS, VM/CMS, FlexOS, Tandem NSK, Human68k (mostly), AOS/VS (partly) +and TOPS-20 (partly). UnZip features not found in PKUNZIP include source +code; default extraction of directory trees (with a switch to defeat this, +rather than the reverse); system-specific extended file attributes; and, of +course, the ability to run under most of your favorite operating systems. +Plus, it's free. :-) + +For source distributions, see the main Contents file for a list of what's +included, and read INSTALL for instructions on compiling (including OS- +specific comments). The individual operating systems' Contents files (for +example, vms/Contents) may list important compilation info in addition to +explaining what files are what, so be sure to read them. Some of the ports +have their own, special README files, so be sure to look for those, too. + +See unzip.1 or unzip.txt for usage (or the corresponding UnZipSFX, ZipInfo, +fUnZip and ZipGrep docs). For VMS, unzip_def.rnh or unzip_cli.help may be +compiled into unzip.hlp and installed as a normal VMS help entry; see +vms/descrip.mms. + + +CHANGES AND NEW FEATURES +------------------------ +The main addition in the 5.5 release is support for PKWARE's new Deflate64(tm) +algorithm, which appeared first in PKZIP 4.0 (published November 2000). +As usual, some other bugfixes and clean-ups have been integrated: + + - support for Deflate64 (Zip compression method #9) + - support for extracting VMS variable length record text files on + any system + - optional "cheap autorun" feature for the SFX stub + - security fixes: + * strip leading slash from stored pathspecs, + * remove "../" parent dir path components from extracted file names + - new option "-:" to allow verbatim extraction of file names containing + "../" parent dir path specs + - fixed file handle leak for the DLL code + - repaired OS2 & WinNT ACL extraction which was broken in 5.42 + +The 5.42 maintance release fixes more bugs and cleans up the redistribution +conditions: + + - removal of unreduce.c and amiga/timelib.c code to get rid of the last + distribution restrictions beyond the BSD-like Info-ZIP LICENSE + - new generic timelib replacement (currently used by AMIGA port) + - more reasonable mapping rules of UNIX "leading-dot" filenames to the + DOS 8.3 name convention + - repaired screensize detection in MORE paging code + (was broken for DOS/OS2/WIN32 in 5.41) + +The 5.41 maintance release adds another new port and fixes some bugs. + + - new BSD-like LICENSE + - new Novell Netware NLM port + - supports extraction of archives with more than 64k entries + - attribute handling of VMS port was broken in UnZip 5.4 + - decryption support integrated in the main source distribution + +The 5.4 release adds new ports, again. Other important items are changes +to the listing format, new supplemental features and several bug fixes +(especially concerning time-stamp handling...): + + - new IBM OS/390 port, a UNIX derivate (POSIX with EBCDIC charset) + - complete revision of the MacOS port + - changed listing formats to enlarge the file size fields for more digits + - added capability to restore directory attributes on MSDOS, OS/2, WIN32 + - enabled support of symbolic links on BeOS + - Unix: optional Acorn filetype support, useful for volumes exported via NFS + - several changes/additions to the DLL API + - GUI SFX stub for Win16 (Windows 3.1) and Win32 (Windows 9x, Windows NT) + - new free GCC compiler environments supported on WIN32 + - many time-zone handling bug fixes for WIN32, AMIGA, ... + +The 5.32 release adds two new ports and a fix for at least one relatively +serious bug: + + - new FlexOS port + - new Tandem NSK port + - new Visual BASIC support (compatibility with the Windows DLLs) + - new -T option (set zipfile timestamp) for virtually all ports + - fix for timestamps beyond 2038 (e.g., 2097; crashed under DOS/Win95/NT) + - fix for undetected "dangling" symbolic links (i.e., no pointee) + - fix for VMS indexed-file extraction problem (stored with Zip 2.0 or 2.1) + - further performance optimizations + +The 5.31 release included nothing but small bug-fixes and typo corrections, +with the exception of some minor performance tweaks. + +The 5.3 release added still more ports and more cross-platform portability +features: + + - new BeOS port + - new SMS/QDOS port + - new Windows CE graphical port + - VM/CMS port fully updated and tested + - MVS port fully updated and tested + - updated Windows DLL port, with WiZ GUI spun off to a separate package + - full Universal Time (UTC or GMT) support for trans-timezone consistency + - cross-platform support for 8-bit characters (ISO Latin-1, OEM code pages) + - support for NT security descriptors (ACLs) + - support for overwriting OS/2 directory EAs if -o option given + - updated Solaris/SVR4 package facility + +What is (still!) not added is multi-part archive support (a.k.a. "diskette +spanning") and a unified and more powerful DLL interface. These are the +two highest priorities for the 6.x releases. Work on the former is almost +certain to have commenced by the time you read this. This time we mean it! +You betcha. :-) + +Although the DLLs are still basically a mess, the Windows DLLs (16- and 32- +bit) now have some documentation and a small example application. Note that +they should now be compatible with C/C++, Visual BASIC and Delphi. Weirder +languages (FoxBase, etc.) are probably Right Out. + +Finally, note that support for unshrinking has now been turned OFF by default, +although the source code is still available (as with unreducing). This was +done for legal reasons, not technical ones, and no, we're not any happier +about it than you are. :-( See the COPYING file for details. + + +INTERNET RESOURCES +------------------ + +Info-ZIP's web site is at http://www.info-zip.org/pub/infozip/ +and contains the most up-to-date information about coming releases, +links to binaries, and common problems. +(See http://www.info-zip.org/pub/infozip/FAQ.html for the latter.) +Files may also be retrieved via ftp://ftp.info-zip.org/pub/infozip/ . +Thanks to Walnut Creek CD-ROM for hosting our primary site. + + +DISTRIBUTION +------------ +If you have a question regarding redistribution of Info-ZIP software, either +as is, as packaging for a commercial product, or as an integral part of a +commercial product, please read the Frequently Asked Questions (FAQ) section +of the included COPYING file. + +Insofar as C compilers are rare on some platforms and the authors only have +direct access to a subset of the supported systems, others may wish to pro- +vide ready-to-run executables for new systems. In general there is no prob- +lem with this; we require only that such distributions include this README +file, the WHERE file, the COPYING file (contains copyright/redistribution +information), and the appropriate documentation files (unzip.txt and/or +unzip.1 for UnZip, etc.). If the local system provides a way to make self- +extracting archives in which both the executables and text files can be +stored together, that's best (in particular, use UnZipSFX if at all possible, +even if it's a few kilobytes bigger than the alternatives); otherwise we +suggest a bare UnZip executable and a separate zipfile containing the re- +maining text and binary files. If another archiving method is in common +use on the target system (for example, Zoo or LHa), that may also be used. + + +BUGS AND NEW PORTS: CONTACTING INFO-ZIP +---------------------------------------- +All bug reports and patches (context diffs only, please!) should go to +Zip-Bugs@lists.wku.edu, which is the e-mail address for the Info-ZIP +authors. (Note that a few rare systems require the Zip-Bugs part to be +capitalized as shown; most systems work OK with lowercase "zip-bugs," +however.) DO NOT MAIL US LARGE BINARIES--EVER. If you need to send us +a problem archive that happens to be large (> 20K), contact us first for +instructions. + +"Dumb questions" that aren't adequately answered in the documentation +should also be directed to Zip-Bugs rather than to a global forum such +as Usenet. (Kindly make certain that your question *isn't* answered by +the documentation, however--a great deal of effort has gone into making +it clear and complete.) + +Suggestions for new features can be discussed on Info-ZIP@lists.wku.edu, +a mailing list for Info-ZIP beta testers and interested parties; you need +to subscribe first, however (see below). We make no promises to act on all +suggestions or even all patches, but if it is something that is manifestly +useful, sending the required patches to Zip-Bugs directly (as per the +instructions in the ZipPorts file) is likely to produce a quicker response +than asking us to do it--the authors are always ridiculously short on time. +(Please do NOT send patches or encoded zipfiles to the Info-ZIP list. +Please DO read the ZipPorts file before sending any large patch. It would +be difficult to over-emphasize this point...) + +If you are considering a port, not only should you read the ZipPorts file, +but also please check in with Zip-Bugs BEFORE getting started, since the +code is constantly being updated behind the scenes. (For example, VxWorks, +VMOS and Netware ports were once claimed to be under construction, although +we have yet to see any up-to-date patches.) We will arrange to send you the +latest sources. The alternative is the possibility that your hard work will +be tucked away in a subdirectory and mostly ignored, or completely ignored +if someone else has already done the port (and you'd be surprised how often +this has happened). + + +BETA TESTING: JOINING INFO-ZIP +------------------------------- +If you'd like to keep up to date with our UnZip (and companion Zip utility) +development, join the ranks of beta testers, add your own thoughts and con- +tributions, or simply lurk, send a two-line mail message containing the +commands HELP and LIST (on separate lines in the body of the message, not +on the subject line) to mxserver@lists.wku.edu. You'll receive two messages +listing the various Info-ZIP mailing-list formats that are available (and +also various unrelated lists) and instructions on how to subscribe to one +or more of them (courtesy of Hunter Goatley). As of 1997, subscribing to +the announcements list required a command of the form + + SUBSCRIBE Info-ZIP-announce "Joe Isuzu" + +The discussion list is called Info-ZIP; it can be set for either normal or +digest-style delivery. + + +-- Greg Roelofs (sometimes known as Cave Newt), principal UnZip developer + guy, with inspiration from David Kirschbaum, was Author of this text. + +-- Christian Spieler (shorthand: SPC), current UnZip maintance coordinator, + applied the most recent changes. diff -Nru boinc-7.0.7+dfsg/zip/unzip/tables.h boinc-7.0.14+dfsg/zip/unzip/tables.h --- boinc-7.0.7+dfsg/zip/unzip/tables.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/tables.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,89 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + tables.h + + This file contains only the 32-bit CRC table used in fUnZip; + it is in a separate file because it is rather big and ugly and + gets in the way during editing. + This file can be included in no more than ONE source file per + executable, of course. + + ---------------------------------------------------------------------------*/ + +#ifndef __tables_h /* prevent multiple inclusions */ +#define __tables_h + +#ifdef FUNZIP +#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) + +/* Table of CRC-32's of all single-byte values (made by makecrc.c) */ +ZCONST ulg near crc_32_tab[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; + +#else /* USE_ZLIB && !USE_OWN_CRCTAB */ + +ZCONST uLongf *crc_32_tab = NULL; + +#endif /* ?(!USE_ZLIB || USE_OWN_CRCTAB) */ +#endif /* FUNZIP */ +#endif /* __tables_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/timezone.c boinc-7.0.14+dfsg/zip/unzip/timezone.c --- boinc-7.0.7+dfsg/zip/unzip/timezone.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/timezone.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,815 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* Replacement time library functions, based on platform independent public + * domain timezone code from ftp://elsie.nci.nih.gov/pub, with mktime and + * mkgmtime from our own mktime.c in Zip. + * + * Contains: tzset() + * __tzset() + * gmtime() + * localtime() + * mktime() + * mkgmtime() + * GetPlatformLocalTimezone() [different versions] + */ + +/* HISTORY/CHANGES + * 17 Jun 00, Paul Kienitz, added the PD-based tzset(), localtime(), and so on + * to amiga/filedate.c, replacing GNU-based functions which had + * replaced time_lib.c, both having been rejected for licensing + * reasons. Support for timezone files and leap seconds was removed. + * + * 23 Aug 00, Paul Kienitz, split into separate timezone.c file, made platform + * independent, copied in mktime() and mkgmtime() from Zip, renamed + * locale_TZ as GetPlatformLocalTimezone(), for use as a generic + * hook by other platforms. + */ + +#ifndef __timezone_c +#define __timezone_c + + +#include "zip.h" +#include "timezone.h" +#include +#include + +#ifdef IZTZ_DEFINESTDGLOBALS +long timezone = 0; +int daylight = 0; +char *tzname[2]; +#endif + +#ifndef IZTZ_GETLOCALETZINFO +# define IZTZ_GETLOCALETZINFO(ptzstruct, pgenrulefunct) (FALSE) +#endif + +int real_timezone_is_set = FALSE; /* set by tzset() */ + + +#define TZDEFRULESTRING ",M4.1.0,M10.5.0" +#define TZDEFAULT "EST5EDT" + +#define SECSPERMIN 60 +#define MINSPERHOUR 60 +#define HOURSPERDAY 24 +#define DAYSPERWEEK 7 +#define DAYSPERNYEAR 365 +#define DAYSPERLYEAR 366 +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) +#define MONSPERYEAR 12 + +#define EPOCH_WDAY 4 /* Jan 1, 1970 was thursday */ +#define EPOCH_YEAR 1970 +#define TM_YEAR_BASE 1900 +#define FIRST_GOOD_YEAR ((time_t) -1 < (time_t) 1 ? EPOCH_YEAR-68 : EPOCH_YEAR) +#define LAST_GOOD_YEAR (EPOCH_YEAR + ((time_t) -1 < (time_t) 1 ? 67 : 135)) + +#define YDAYS(month, year) yr_days[leap(year)][month] + +/* Nonzero if `y' is a leap year, else zero. */ +#define leap(y) (((y) % 4 == 0 && (y) % 100 != 0) || (y) % 400 == 0) + +/* Number of leap years from EPOCH_YEAR to `y' (not including `y' itself). */ +#define _P4 ((EPOCH_YEAR / 4) * 4 + 1) +#define _P100 ((EPOCH_YEAR / 100) * 100 + 1) +#define _P400 ((EPOCH_YEAR / 400) * 400 + 1) +#define nleap(y) (((y) - _P4) / 4 - ((y) - _P100) / 100 + ((y) - _P400) / 400) + +/* Length of month `m' (0 .. 11) */ +#define monthlen(m, y) (yr_days[0][(m)+1] - yr_days[0][m] + \ + ((m) == 1 && leap(y))) + +/* internal module-level constants */ +#ifndef IZ_MKTIME_ONLY +static ZCONST char gmt[] = "GMT"; +static ZCONST int mon_lengths[2][MONSPERYEAR] = { + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } +}; +#endif /* !IZ_MKTIME_ONLY */ +static ZCONST int yr_days[2][MONSPERYEAR+1] = { + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } +}; +#ifndef IZ_MKTIME_ONLY +static ZCONST int year_lengths[2] = { + DAYSPERNYEAR, DAYSPERLYEAR +}; + +/* internal variables */ +static struct state statism; + + +/* prototypes of static functions */ +static time_t transtime OF((ZCONST time_t janfirst, ZCONST int year, + ZCONST struct rule * ZCONST rulep, + ZCONST long offset)); +static void generate_transitions OF((register struct state * ZCONST sp, + ZCONST struct rule * ZCONST start, + ZCONST struct rule * ZCONST end)); +static ZCONST char *getzname OF((ZCONST char *strp)); +static ZCONST char *getnum OF((ZCONST char *strp, int * ZCONST nump, + ZCONST int min, ZCONST int max)); +static ZCONST char *getsecs OF((ZCONST char *strp, long * ZCONST secsp)); +static ZCONST char *getoffset OF((ZCONST char *strp, long * ZCONST offsetp)); +static ZCONST char *getrule OF((ZCONST char *strp, struct rule * ZCONST rulep)); +static int Parse_TZ OF((ZCONST char *name, register struct state * ZCONST sp)); + + +static time_t transtime(janfirst, year, rulep, offset) + ZCONST time_t janfirst; + ZCONST int year; + ZCONST struct rule * ZCONST rulep; + ZCONST long offset; +{ + register int leapyear; + register time_t value; + register int i; + int d, m1, yy0, yy1, yy2, dow; + + value = 0; + leapyear = leap(year); + switch (rulep->r_type) { + + case JULIAN_DAY: + /* + ** Jn - Julian day, 1 == January 1, 60 == March 1 even in leap + ** years. + ** In non-leap years, or if the day number is 59 or less, just + ** add SECSPERDAY times the day number-1 to the time of + ** January 1, midnight, to get the day. + */ + value = janfirst + (rulep->r_day - 1) * SECSPERDAY; + if (leapyear && rulep->r_day >= 60) + value += SECSPERDAY; + break; + + case DAY_OF_YEAR: + /* + ** n - day of year. + ** Just add SECSPERDAY times the day number to the time of + ** January 1, midnight, to get the day. + */ + value = janfirst + rulep->r_day * SECSPERDAY; + break; + + case MONTH_NTH_DAY_OF_WEEK: + /* + ** Mm.n.d - nth "dth day" of month m. + */ + value = janfirst; +/* + for (i = 0; i < rulep->r_mon - 1; ++i) + value += mon_lengths[leapyear][i] * SECSPERDAY; +*/ + value += yr_days[leapyear][rulep->r_mon - 1] * SECSPERDAY; + + /* + ** Use Zeller's Congruence to get day-of-week of first day of + ** month. + */ + m1 = (rulep->r_mon + 9) % 12 + 1; + yy0 = (rulep->r_mon <= 2) ? (year - 1) : year; + yy1 = yy0 / 100; + yy2 = yy0 % 100; + dow = ((26 * m1 - 2) / 10 + + 1 + yy2 + yy2 / 4 + yy1 / 4 - 2 * yy1) % 7; + if (dow < 0) + dow += DAYSPERWEEK; + + /* + ** "dow" is the day-of-week of the first day of the month. Get + ** the day-of-month (zero-origin) of the first "dow" day of the + ** month. + */ + d = rulep->r_day - dow; + if (d < 0) + d += DAYSPERWEEK; + for (i = 1; i < rulep->r_week; ++i) { + if (d + DAYSPERWEEK >= mon_lengths[leapyear][rulep->r_mon - 1]) + break; + d += DAYSPERWEEK; + } + + /* + ** "d" is the day-of-month (zero-origin) of the day we want. + */ + value += d * SECSPERDAY; + break; + } + + /* + ** "value" is the Epoch-relative time of 00:00:00 UTC on the day in + ** question. To get the Epoch-relative time of the specified local + ** time on that day, add the transition time and the current offset + ** from UTC. + */ + return value + rulep->r_time + offset; +} + +static void generate_transitions(sp, start, end) + register struct state * ZCONST sp; + ZCONST struct rule * ZCONST start; + ZCONST struct rule * ZCONST end; +{ + register int year; + register time_t janfirst; + time_t starttime; + time_t endtime; + long stdoffset = -sp->ttis[0].tt_gmtoff; + long dstoffset = -sp->ttis[1].tt_gmtoff; + register time_t * atp; + register unsigned char * typep; + + /* + ** Two transitions per year, from EPOCH_YEAR to LAST_GOOD_YEAR. + */ + sp->timecnt = 2 * (LAST_GOOD_YEAR - EPOCH_YEAR + 1); + atp = sp->ats; + typep = sp->types; + janfirst = 0; + for (year = EPOCH_YEAR; year <= LAST_GOOD_YEAR; ++year) { + starttime = transtime(janfirst, year, start, stdoffset); + endtime = transtime(janfirst, year, end, dstoffset); + if (starttime > endtime) { + *atp++ = endtime; + *typep++ = 0; /* DST ends */ + *atp++ = starttime; + *typep++ = 1; /* DST begins */ + } else { + *atp++ = starttime; + *typep++ = 1; /* DST begins */ + *atp++ = endtime; + *typep++ = 0; /* DST ends */ + } + janfirst += year_lengths[leap(year)] * SECSPERDAY; + } +} + +static ZCONST char *getzname(strp) + ZCONST char *strp; +{ + register char c; + + while ((c = *strp) != '\0' && !isdigit(c) && c != ',' && c != '-' && + c != '+') + ++strp; + return strp; +} + +static ZCONST char *getnum(strp, nump, min, max) + ZCONST char *strp; + int * ZCONST nump; + ZCONST int min; + ZCONST int max; +{ + register char c; + register int num; + + if (strp == NULL || !isdigit(c = *strp)) + return NULL; + num = 0; + do { + num = num * 10 + (c - '0'); + if (num > max) + return NULL; /* illegal value */ + c = *++strp; + } while (isdigit(c)); + if (num < min) + return NULL; /* illegal value */ + *nump = num; + return strp; +} + +static ZCONST char *getsecs(strp, secsp) + ZCONST char *strp; + long * ZCONST secsp; +{ + int num; + + /* + ** `HOURSPERDAY * DAYSPERWEEK - 1' allows quasi-Posix rules like + ** "M10.4.6/26", which does not conform to Posix, + ** but which specifies the equivalent of + ** ``02:00 on the first Sunday on or after 23 Oct''. + */ + strp = getnum(strp, &num, 0, HOURSPERDAY * DAYSPERWEEK - 1); + if (strp == NULL) + return NULL; + *secsp = num * (long) SECSPERHOUR; + if (*strp == ':') { + ++strp; + strp = getnum(strp, &num, 0, MINSPERHOUR - 1); + if (strp == NULL) + return NULL; + *secsp += num * SECSPERMIN; + if (*strp == ':') { + ++strp; + /* `SECSPERMIN' allows for leap seconds. */ + strp = getnum(strp, &num, 0, SECSPERMIN); + if (strp == NULL) + return NULL; + *secsp += num; + } + } + return strp; +} + +static ZCONST char *getoffset(strp, offsetp) + ZCONST char *strp; + long * ZCONST offsetp; +{ + register int neg = 0; + + if (*strp == '-') { + neg = 1; + ++strp; + } else if (*strp == '+') + ++strp; + strp = getsecs(strp, offsetp); + if (strp == NULL) + return NULL; /* illegal time */ + if (neg) + *offsetp = -*offsetp; + return strp; +} + +static ZCONST char *getrule(strp, rulep) + ZCONST char *strp; + struct rule * ZCONST rulep; +{ + if (*strp == 'J') { + /* + ** Julian day. + */ + rulep->r_type = JULIAN_DAY; + ++strp; + strp = getnum(strp, &rulep->r_day, 1, DAYSPERNYEAR); + } else if (*strp == 'M') { + /* + ** Month, week, day. + */ + rulep->r_type = MONTH_NTH_DAY_OF_WEEK; + ++strp; + strp = getnum(strp, &rulep->r_mon, 1, MONSPERYEAR); + if (strp == NULL) + return NULL; + if (*strp++ != '.') + return NULL; + strp = getnum(strp, &rulep->r_week, 1, 5); + if (strp == NULL) + return NULL; + if (*strp++ != '.') + return NULL; + strp = getnum(strp, &rulep->r_day, 0, DAYSPERWEEK - 1); + } else if (isdigit(*strp)) { + /* + ** Day of year. + */ + rulep->r_type = DAY_OF_YEAR; + strp = getnum(strp, &rulep->r_day, 0, DAYSPERLYEAR - 1); + } else return NULL; /* invalid format */ + if (strp == NULL) + return NULL; + if (*strp == '/') { + /* + ** Time specified. + */ + ++strp; + strp = getsecs(strp, &rulep->r_time); + } else + rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */ + return strp; +} + +static int Parse_TZ(name, sp) + ZCONST char *name; + register struct state * ZCONST sp; +{ + ZCONST char * stdname; + ZCONST char * dstname; + size_t stdlen; + size_t dstlen; + long stdoffset; + long dstoffset; + register char * cp; + + dstname = NULL; + stdname = name; + name = getzname(name); + stdlen = name - stdname; + if (stdlen < 3) + return -1; + if (*name == '\0') + return -1; + name = getoffset(name, &stdoffset); + if (name == NULL) + return -1; + if (*name != '\0') { + dstname = name; + name = getzname(name); + dstlen = name - dstname; /* length of DST zone name */ + if (dstlen < 3) + return -1; + if (*name != '\0' && *name != ',' && *name != ';') { + name = getoffset(name, &dstoffset); + if (name == NULL) + return -1; + } else + dstoffset = stdoffset - SECSPERHOUR; + if (*name == '\0') + name = TZDEFRULESTRING; + if (*name == ',' || *name == ';') { + struct rule start; + struct rule end; + + ++name; + if ((name = getrule(name, &start)) == NULL) + return -1; + if (*name++ != ',') + return -1; + if ((name = getrule(name, &end)) == NULL) + return -1; + if (*name != '\0') + return -1; + sp->typecnt = 2; /* standard time and DST */ + sp->ttis[0].tt_gmtoff = -stdoffset; + sp->ttis[0].tt_isdst = 0; + sp->ttis[0].tt_abbrind = 0; + sp->ttis[1].tt_gmtoff = -dstoffset; + sp->ttis[1].tt_isdst = 1; + sp->ttis[1].tt_abbrind = stdlen + 1; + generate_transitions(sp, &start, &end); + } + } else { + dstlen = 0; + sp->typecnt = 1; /* only standard time */ + sp->timecnt = 0; + sp->ttis[0].tt_gmtoff = -stdoffset; + sp->ttis[0].tt_isdst = 0; + sp->ttis[0].tt_abbrind = 0; + } + sp->charcnt = stdlen + 1; + if (dstlen != 0) + sp->charcnt += dstlen + 1; + if ((size_t) sp->charcnt > sizeof(sp->chars)) + return -1; + cp = sp->chars; + (void) strncpy(cp, stdname, stdlen); + cp += stdlen; + *cp++ = '\0'; + if (dstlen != 0) { + (void) strncpy(cp, dstname, dstlen); + *(cp + dstlen) = '\0'; + } + return 0; +} + +void tzset() +{ + char *TZstring; + int dstfirst; + static char *old_TZstring = NULL; + + TZstring = getenv("TZ"); /* read TZ envvar */ + if (old_TZstring && TZstring && !strcmp(old_TZstring, TZstring)) + /* do not repeatedly parse an unchanged TZ specification */ + return; + if ((TZstring && TZstring[0] && Parse_TZ(TZstring, &statism) == 0) + || IZTZ_GETLOCALETZINFO(&statism, generate_transitions) + || Parse_TZ(gmt, &statism) == 0) { + daylight = statism.typecnt > 1; + dstfirst = daylight && statism.ttis[0].tt_isdst && !statism.ttis[1].tt_isdst; + timezone = -statism.ttis[dstfirst].tt_gmtoff; + tzname[0] = statism.chars + statism.ttis[dstfirst].tt_abbrind; + tzname[1] = statism.chars + statism.ttis[!dstfirst].tt_abbrind; + real_timezone_is_set = TRUE; + if (TZstring) { + if (old_TZstring) + old_TZstring = realloc(old_TZstring, strlen(TZstring) + 1); + else + old_TZstring = malloc(strlen(TZstring) + 1); + if (old_TZstring) + strcpy(old_TZstring, TZstring); + } + } else { + timezone = 0; /* default is GMT0 which means no offsets */ + daylight = 0; /* from local system time */ + real_timezone_is_set = FALSE; + if (old_TZstring) { + free(old_TZstring); + old_TZstring = NULL; + } + } +#ifdef IZTZ_SETLOCALTZINFO + /* Some SAS/C library functions, e.g. stat(), call library */ + /* __tzset() themselves. So envvar TZ *must* exist in order to */ + /* to get the right offset from GMT. XXX TRY HARD to fix this! */ + set_TZ(timezone, daylight); +#endif /* IZTZ_SETLOCALTZINFO */ +} + +/* XXX Does this also help SAS/C library work? */ +void __tzset() +{ + if (!real_timezone_is_set) tzset(); +} + +static struct tm _tmbuf; + +struct tm *gmtime(when) + ZCONST time_t *when; +{ + long days = *when / SECSPERDAY; + long secs = *when % SECSPERDAY; + int isleap; + + memset(&_tmbuf, 0, sizeof(_tmbuf)); /* get any nonstandard fields */ + _tmbuf.tm_wday = (days + EPOCH_WDAY) % 7; + _tmbuf.tm_year = EPOCH_YEAR - TM_YEAR_BASE; + isleap = leap(_tmbuf.tm_year + TM_YEAR_BASE); + while (days >= year_lengths[isleap]) { + days -= year_lengths[isleap]; + _tmbuf.tm_year++; + isleap = leap(_tmbuf.tm_year + TM_YEAR_BASE); + } + _tmbuf.tm_mon = 0; + _tmbuf.tm_yday = days; + while (days >= mon_lengths[isleap][_tmbuf.tm_mon]) + days -= mon_lengths[isleap][_tmbuf.tm_mon++]; + _tmbuf.tm_mday = days + 1; + _tmbuf.tm_isdst = 0; + _tmbuf.tm_sec = secs % SECSPERMIN; + _tmbuf.tm_min = (secs / SECSPERMIN) % SECSPERMIN; + _tmbuf.tm_hour = secs / SECSPERHOUR; + return &_tmbuf; +} + +struct tm *localtime(when) + ZCONST time_t *when; +{ + time_t localwhen = *when; + int timetype; + struct tm *ret; + + __tzset(); + if (statism.timecnt == 0 || localwhen < statism.ats[0]) + timetype = statism.ttis[0].tt_isdst && statism.typecnt > 1 && + !statism.ttis[1].tt_isdst; + else { + for (timetype = 1; timetype < statism.timecnt; ++timetype) + if (localwhen < statism.ats[timetype]) + break; + timetype = statism.types[timetype - 1]; + } + localwhen += statism.ttis[timetype].tt_gmtoff; + ret = gmtime(&localwhen); + ret->tm_isdst = statism.ttis[timetype].tt_isdst; + return ret; +} + +#ifdef NEED__ISINDST +int _isindst(tb) + struct tm *tb; +{ + time_t localt; /* time_t equivalent of given tm struct */ + time_t univt; /* assumed UTC value of given time */ + long tzoffset_adj; /* timezone-adjustment `remainder' */ + int bailout_cnt; /* counter of tries for tz correction */ + int timetype; + + __tzset(); + + /* when DST is unsupported in current timezone, DST is always off */ + if (statism.typecnt <= 1) return FALSE; + + localt = mkgmtime(tb); + if (localt == (time_t)-1) + /* specified time is out-of-range, default to FALSE */ + return FALSE; + + univt = localt - statism.ttis[0].tt_gmtoff; + bailout_cnt = 3; + do { + if (statism.timecnt == 0 || univt < statism.ats[0]) + timetype = statism.ttis[0].tt_isdst && statism.typecnt > 1 && + !statism.ttis[1].tt_isdst; + else { + for (timetype = 1; timetype < statism.timecnt; ++timetype) + if (univt < statism.ats[timetype]) + break; + timetype = statism.types[timetype - 1]; + } + if ((tzoffset_adj = localt - univt - statism.ttis[timetype].tt_gmtoff) + == 0L) + break; + univt += tzoffset_adj; + } while (--bailout_cnt > 0); + + /* return TRUE when DST is active at given time */ + return (statism.ttis[timetype].tt_isdst); +} +#endif /* NEED__ISINDST */ +#endif /* !IZ_MKTIME_ONLY */ + +/* Return the equivalent in seconds past 12:00:00 a.m. Jan 1, 1970 GMT + of the local time and date in the exploded time structure `tm', + adjust out of range fields in `tm' and set `tm->tm_yday', `tm->tm_wday'. + If `tm->tm_isdst < 0' was passed to mktime(), the correct setting of + tm_isdst is determined and returned. Otherwise, mktime() assumes this + field as valid; its information is used when converting local time + to UTC. + Return -1 if time in `tm' cannot be represented as time_t value. */ + +time_t mktime(tm) + struct tm *tm; +{ + struct tm *ltm; /* Local time. */ + time_t loctime; /* The time_t value of local time. */ + time_t then; /* The time to return. */ + long tzoffset_adj; /* timezone-adjustment `remainder' */ + int bailout_cnt; /* counter of tries for tz correction */ + int save_isdst; /* Copy of the tm->isdst input value */ + + save_isdst = tm->tm_isdst; + loctime = mkgmtime(tm); + if (loctime == -1) { + tm->tm_isdst = save_isdst; + return (time_t)-1; + } + + /* Correct for the timezone and any daylight savings time. + The correction is verified and repeated when not correct, to + take into account the rare case that a change to or from daylight + savings time occurs between when it is the time in `tm' locally + and when it is that time in Greenwich. After the second correction, + the "timezone & daylight" offset should be correct in all cases. To + be sure, we allow a third try, but then the loop is stopped. */ + bailout_cnt = 3; + then = loctime; + do { + ltm = localtime(&then); + if (ltm == (struct tm *)NULL || + (tzoffset_adj = loctime - mkgmtime(ltm)) == 0L) + break; + then += tzoffset_adj; + } while (--bailout_cnt > 0); + + if (ltm == (struct tm *)NULL || tzoffset_adj != 0L) { + /* Signal failure if timezone adjustment did not converge. */ + tm->tm_isdst = save_isdst; + return (time_t)-1; + } + + if (save_isdst >= 0) { + if (ltm->tm_isdst && !save_isdst) + { + if (then + 3600 < then) + then = (time_t)-1; + else + then += 3600; + } + else if (!ltm->tm_isdst && save_isdst) + { + if (then - 3600 > then) + then = (time_t)-1; + else + then -= 3600; + } + ltm->tm_isdst = save_isdst; + } + + if (tm != ltm) /* `tm' may already point to localtime's internal storage */ + *tm = *ltm; + + return then; +} + + +#ifndef NO_TIME_T_MAX + /* Provide default values for the upper limit of the time_t range. + These are the result of the decomposition into a `struct tm' for + the time value 0xFFFFFFFEL ( = (time_t)-2 ). + Note: `(time_t)-1' is reserved for "invalid time"! */ +# ifndef TM_YEAR_MAX +# define TM_YEAR_MAX 2106 +# endif +# ifndef TM_MON_MAX +# define TM_MON_MAX 1 /* February */ +# endif +# ifndef TM_MDAY_MAX +# define TM_MDAY_MAX 7 +# endif +# ifndef TM_HOUR_MAX +# define TM_HOUR_MAX 6 +# endif +# ifndef TM_MIN_MAX +# define TM_MIN_MAX 28 +# endif +# ifndef TM_SEC_MAX +# define TM_SEC_MAX 14 +# endif +#endif /* NO_TIME_T_MAX */ + +/* Adjusts out-of-range values for `tm' field `tm_member'. */ +#define ADJUST_TM(tm_member, tm_carry, modulus) \ + if ((tm_member) < 0) { \ + tm_carry -= (1 - ((tm_member)+1) / (modulus)); \ + tm_member = (modulus-1) + (((tm_member)+1) % (modulus)); \ + } else if ((tm_member) >= (modulus)) { \ + tm_carry += (tm_member) / (modulus); \ + tm_member = (tm_member) % (modulus); \ + } + +/* Return the equivalent in seconds past 12:00:00 a.m. Jan 1, 1970 GMT + of the Greenwich Mean time and date in the exploded time structure `tm'. + This function does always put back normalized values into the `tm' struct, + parameter, including the calculated numbers for `tm->tm_yday', + `tm->tm_wday', and `tm->tm_isdst'. + Returns -1 if the time in the `tm' parameter cannot be represented + as valid `time_t' number. */ + +time_t mkgmtime(tm) + struct tm *tm; +{ + int years, months, days, hours, minutes, seconds; + + years = tm->tm_year + TM_YEAR_BASE; /* year - 1900 -> year */ + months = tm->tm_mon; /* 0..11 */ + days = tm->tm_mday - 1; /* 1..31 -> 0..30 */ + hours = tm->tm_hour; /* 0..23 */ + minutes = tm->tm_min; /* 0..59 */ + seconds = tm->tm_sec; /* 0..61 in ANSI C. */ + + ADJUST_TM(seconds, minutes, 60) + ADJUST_TM(minutes, hours, 60) + ADJUST_TM(hours, days, 24) + ADJUST_TM(months, years, 12) + if (days < 0) + do { + if (--months < 0) { + --years; + months = 11; + } + days += monthlen(months, years); + } while (days < 0); + else + while (days >= monthlen(months, years)) { + days -= monthlen(months, years); + if (++months >= 12) { + ++years; + months = 0; + } + } + + /* Restore adjusted values in tm structure */ + tm->tm_year = years - TM_YEAR_BASE; + tm->tm_mon = months; + tm->tm_mday = days + 1; + tm->tm_hour = hours; + tm->tm_min = minutes; + tm->tm_sec = seconds; + + /* Set `days' to the number of days into the year. */ + days += YDAYS(months, years); + tm->tm_yday = days; + + /* Now calculate `days' to the number of days since Jan 1, 1970. */ + days = (unsigned)days + 365 * (unsigned)(years - EPOCH_YEAR) + + (unsigned)(nleap (years)); + tm->tm_wday = ((unsigned)days + EPOCH_WDAY) % 7; + tm->tm_isdst = 0; + + if (years < EPOCH_YEAR) + return (time_t)-1; + +#if (defined(TM_YEAR_MAX) && defined(TM_MON_MAX) && defined(TM_MDAY_MAX)) +#if (defined(TM_HOUR_MAX) && defined(TM_MIN_MAX) && defined(TM_SEC_MAX)) + if (years > TM_YEAR_MAX || + (years == TM_YEAR_MAX && + (tm->tm_yday > (YDAYS(TM_MON_MAX, TM_YEAR_MAX) + (TM_MDAY_MAX - 1)) || + (tm->tm_yday == (YDAYS(TM_MON_MAX, TM_YEAR_MAX) + (TM_MDAY_MAX - 1)) && + (hours > TM_HOUR_MAX || + (hours == TM_HOUR_MAX && + (minutes > TM_MIN_MAX || + (minutes == TM_MIN_MAX && seconds > TM_SEC_MAX) ))))))) + return (time_t)-1; +#endif +#endif + + return (time_t)(SECSPERDAY * (unsigned long)(unsigned)days + + SECSPERHOUR * (unsigned long)hours + + (unsigned long)(SECSPERMIN * minutes + seconds)); +} + +#endif /* __timezone_c */ + +const char *BOINC_RCSID_f76bfd07b8 = "$Id: timezone.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/timezone.h boinc-7.0.14+dfsg/zip/unzip/timezone.h --- boinc-7.0.7+dfsg/zip/unzip/timezone.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/timezone.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,81 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +#ifndef __timezone_h +#define __timezone_h + +#ifndef IZ_MKTIME_ONLY + +/* limits for our timezone info data: + * we support only basic standard and daylight time, with max 2 transitions + * per year, but for the maximum range of years a 32-bit second counter + * can cover (these are 136 years plus a bit more than one month) + */ +#define TZ_MAX_TIMES 272 /* (=2*(LastGoodYr + 1 - FirstGoodYr) */ +#define TZ_MAX_TYPES 2 /* We only support basic standard and daylight */ +#ifdef WIN32 /* Win32 tzinfo supplies at max (2 * 32) chars of tz names */ +#define TZ_MAX_CHARS 64 /* Maximum number of abbreviation characters */ +#else +#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ +#endif + +/* supported types of transition rules */ +#define JULIAN_DAY 0 /* Jn - Julian day */ +#define DAY_OF_YEAR 1 /* n - day of year */ +#define MONTH_NTH_DAY_OF_WEEK 2 /* Mm.n.d - month, week, day of week */ + + +struct ttinfo { + long tt_gmtoff; /* UTC offset in seconds */ + int tt_isdst; /* used to set tm_isdst */ + int tt_abbrind; /* abbreviation list index */ +}; + +struct state { + int timecnt; + int typecnt; + int charcnt; + time_t ats[TZ_MAX_TIMES]; + unsigned char types[TZ_MAX_TIMES]; + struct ttinfo ttis[TZ_MAX_TYPES]; + char chars[TZ_MAX_CHARS]; +}; + +struct rule { + int r_type; /* type of rule--JULIAN_DAY etc */ + int r_day; /* day number of rule */ + int r_week; /* week number of rule */ + int r_mon; /* month number of rule */ + long r_time; /* transition time of rule */ +}; + +extern int real_timezone_is_set; /* set by tzset() */ + + +/* prototypes of functions not in time.h */ + +void __tzset OF((void)); + +#ifdef NEED__ISINDST +int _isindst OF((struct tm *tb)); +#endif + +/* callback function to be supplied by the program that uses this library */ +int GetPlatformLocalTimezone OF((register struct state * ZCONST sp, + void (*fill_tzstate_from_rules)(struct state * ZCONST sp_res, + ZCONST struct rule * ZCONST start, + ZCONST struct rule * ZCONST end))); +#ifdef IZTZ_SETLOCALTZINFO +void set_TZ OF((long time_zone, int day_light)); +#endif + +#endif /* !IZ_MKTIME_ONLY */ + +time_t mkgmtime OF((struct tm *tm)); + +#endif diff -Nru boinc-7.0.7+dfsg/zip/unzip/ToDo boinc-7.0.14+dfsg/zip/unzip/ToDo --- boinc-7.0.7+dfsg/zip/unzip/ToDo 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/ToDo 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,165 @@ +================================ +For UnZip 6.0/6.1/who knows: +================================ + + o implement handling of file sizes beyond the 32-bit limit of + 2GByte (resp. 4GByte), using the new 64-bit extra field extensions + as defined by PKWARE (this will not get implemented for the present + 16-bit ports - plain DOS and OS/2 1.x) + + top of the list for 6.0! + + o add multi-part zipfile handling + + major feature for 6.0! + + o add new low-level, binary API; rewrite "normal" (command-line) UnZip + to use it + + very soon (maybe 6.1) + + o use (simple!) configure script in combination with Unix Makefile + + very soon (6.0 or 6.1) + + o add precautions against extracting files outside the tree below + the current directory resp. the specified extraction folder. + (automatically remove absolute path specs from zip entries; emit + warnings when traversing outside the extraction tree...) + + o MSDOS/WIN32/others: detection of "reserved" names (= names of character + devices, or system extensions that look like a characters device driver) + at runtime; with the goal of emitting "meaningful" error messages and/or + rename queries. + (Currently, these reserved names are catched as "non-deletable files". + On MSDOS and WIN32, when the RTL stat() function allows to identify + character devices, the "reserved" names are automatically prefixed with + an underscore.) + + o redesign "file exists -- is newer/older -- overwrite/skip/rename" + logic in extract.c and the corresponding system specific mapname() + services; to prevent superfluous decryption key prompts for entry + that will be skipped, later. + + o rewrite to use fread/fseek/etc. [eventually: test + write(bytes) vs. fwrite(words), especially on Crays/Alphas] + + soon (probably in conjunction with multi-part handling) + + o incorporate new backfill version of inflate() + + wait for zlib version + + o check NEXTBYTE for EOF in crypt.c, funzip.c and explode.c, too + + whenever + + o add option to force completely non-interactive operation (no queries + for overwrite/rename, password, etc.); also allow some sort of non- + interactive password provision? (file? command-line? env. variable?) + + someday? + + o add testing of extra fields (if have CRC) + + later + + o rewrite to allow use as a filter + + way, way later... + + o add Unix hard-link support? + + way, way later... + + o add ".ini" file support as a (more elaborate) alternative to the presently + supported preconfiguring abilities via special environment variables + (UNZIP on many systems...)? + + way, way later (if ever)... + + o add option to search zipfile contents for a string and print the + results? ("zipgrep" option--e.g., unzip -g or unzip -S) (easy for + fixed strings, hard for wildcards/true regex's) + + way, way later, if at all...probably use libregex + + o add -y "display symlinks" option to zipinfo? various sorting options? + (-St date/time, -Sn name)? + + who knows + + o add "in-depth" option to zipinfo? (check local headers against + central, etc.)--make it a better debugging tool (or just create + zipfix) + + who knows (zip -F, -FF already exist) + +Some maintance or OS specific topics for 6.0 release: + + * add "unix-style-path -> partitioned-dataset filename" conversion + to MVS port + + * should we add support for (null) entry names (empty entry name field), to + conform to the PKWARE specification? + + +======================================= + +Requested features: + + - extract or exclude on basis of UID [Armin Bub, Armin.Bub@bk.bosch.de, 970904] + +======================================= + + o miscellaneous little stuff: whenever + -------------------------- + + - add support for setting directory time stamps to win32 port. This requires + a solution similar to the UNIX SET_DIR_ATTRIB optional code; maybe, it could + be combined with the delayed restoring of directory ACLs. Unfortunately, + the simple version used in the OS/2 case (setting dir time stamp just after + creating the directory) does not work, because WinNT updates directory + change times whenever the directory content gets modified (addition, + deletion, rename, file change), at least for NTFS file systems. + (SPC, 2000-11-16) + + - change DOS -f/-u stuff to use DOS API for getting filetimes, not stat() + + - add (-N?) option to lose all user input and/or switch to "(*input)()" + function, replaceable by UzpAltMain() param + - add -@ option to read from stdin (zip) or from file (PKZIP)? (go32 built-in) + - add -oo option to overwrite OS/2 and DOS system and hidden files, too + - add option to compute MD5 checksum on files and/or on entire zipfile? + + - decide whether to use WinGUI "skipping" diagnostics in extract.c + - combine "y/n/A/N" query/response stuff into unified section with query + function(s) (InputFn?) + - disable ^V code in remaining mapname() routines + + - change filename-matching logic so case-insensitive if case-sensitive fails? + + - allow multiple dir creation with -d option? [Bob Maynard] + + - use gcc -pg, gprof to do profiling on unzip + + - Doug Patriarche (doug.patriarche.bvdhp01@nt.com) Northern Telecom Canada Ltd. + "I need to do a port of zip/unzip for Wind River Systems' VxWorks OS" + [GRR: 15 March 95 -> "early June"] + + +Features from old BUGS file (mostly duplicates of other entries above): + + - ignore case for internal filename match on non-Unix systems, unless file- + specs enclosed in single quotes + - modify to decompress input stream if part of a pipe, but continue using + central directory if not (BIG job!)--extended local header capability + - add zipinfo option(s) to sort alphabetically, by date/time, in reverse, etc. + - when listing filenames, use '?' for non-printables? [Thomas Wolff, 92.6.1] + - add zipinfo "in-depth" option? (check local vs. central filenames, etc.) + - create zipcat program to concatenate zipfiles + - add -oo option (overwrite and override)? no user queries (if bad password, + skip file; if disk full, take default action; if VMS special on non-VMS, + unpack anyway; etc.) + - add -Q[Q[Q]] option (quiet mode on comments, cautions, warnings and errors)? + forget -oo, or make synonym? Default level -Q? diff -Nru boinc-7.0.7+dfsg/zip/unzip/ttyio.c boinc-7.0.14+dfsg/zip/unzip/ttyio.c --- boinc-7.0.7+dfsg/zip/unzip/ttyio.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/ttyio.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,702 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + ttyio.c + + This file contains routines for doing console input/output, including code + for non-echoing input. It is used by the encryption/decryption code but + does not contain any restricted code itself. This file is shared between + Info-ZIP's Zip and UnZip. + + Contains: echo() (VMS only) + Echon() (Unix only) + Echoff() (Unix only) + screensize() (Unix only) + zgetch() (Unix, VMS, and non-Unix/VMS versions) + getp() ("PC," Unix/Atari/Be, VMS/VMCMS/MVS) + + ---------------------------------------------------------------------------*/ + +#define __TTYIO_C /* identifies this source module */ + +#include "zip.h" +//#include "crypt.h" + +#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) +/* Non-echo console/keyboard input is needed for (en/de)cryption's password + * entry, and for UnZip(SFX)'s MORE and Pause features. + * (The corresponding #endif is found at the end of this module.) + */ + +#include "ttyio.h" + +#ifndef PUTC +# define PUTC putc +#endif + +#ifdef ZIP +# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ +# undef GLOBAL +# endif +# define GLOBAL(g) g +#else +# define GLOBAL(g) G.g +#endif + +#ifdef __BEOS__ /* why yes, we do */ +# define HAVE_TERMIOS_H +#endif + +#ifdef _POSIX_VERSION +# ifndef USE_POSIX_TERMIOS +# define USE_POSIX_TERMIOS /* use POSIX style termio (termios) */ +# endif +# ifndef HAVE_TERMIOS_H +# define HAVE_TERMIOS_H /* POSIX termios.h */ +# endif +#endif /* _POSIX_VERSION */ + +#ifdef UNZIP /* Zip handles this with the unix/configure script */ +# ifndef _POSIX_VERSION +# if (defined(SYSV) || defined(CRAY)) && !defined(__MINT__) +# ifndef USE_SYSV_TERMIO +# define USE_SYSV_TERMIO +# endif +# ifdef COHERENT +# ifndef HAVE_TERMIO_H +# define HAVE_TERMIO_H +# endif +# ifdef HAVE_SYS_TERMIO_H +# undef HAVE_SYS_TERMIO_H +# endif +# else /* !COHERENT */ +# ifdef HAVE_TERMIO_H +# undef HAVE_TERMIO_H +# endif +# ifndef HAVE_SYS_TERMIO_H +# define HAVE_SYS_TERMIO_H +# endif +# endif /* ?COHERENT */ +# endif /* (SYSV || CRAY) && !__MINT__ */ +# endif /* !_POSIX_VERSION */ +# if !(defined(BSD4_4) || defined(SYSV) || defined(__convexc__)) +# ifndef NO_FCNTL_H +# define NO_FCNTL_H +# endif +# endif /* !(BSD4_4 || SYSV || __convexc__) */ +#endif /* UNZIP */ + +#ifdef HAVE_TERMIOS_H +# ifndef USE_POSIX_TERMIOS +# define USE_POSIX_TERMIOS +# endif +#endif + +#if (defined(HAVE_TERMIO_H) || defined(HAVE_SYS_TERMIO_H)) +# ifndef USE_SYSV_TERMIO +# define USE_SYSV_TERMIO +# endif +#endif + +#if (defined(UNZIP) && !defined(FUNZIP) && defined(UNIX) && defined(MORE)) +# include +# define GOT_IOCTL_H + /* int ioctl OF((int, int, zvoid *)); GRR: may need for some systems */ +#endif + +#ifndef HAVE_WORKING_GETCH + /* include system support for switching of console echo */ +# ifdef VMS +# include +# include +# include +# include +# include +# else /* !VMS */ +# ifdef HAVE_TERMIOS_H +# include +# define sgttyb termios +# define sg_flags c_lflag +# define GTTY(f, s) tcgetattr(f, (zvoid *) s) +# define STTY(f, s) tcsetattr(f, TCSAFLUSH, (zvoid *) s) +# else /* !HAVE_TERMIOS_H */ +# ifdef USE_SYSV_TERMIO /* Amdahl, Cray, all SysV? */ +# ifdef HAVE_TERMIO_H +# include +# endif +# ifdef HAVE_SYS_TERMIO_H +# include +# endif +# ifdef NEED_PTEM +# include +# include +# endif +# define sgttyb termio +# define sg_flags c_lflag +# define GTTY(f,s) ioctl(f,TCGETA,(zvoid *)s) +# define STTY(f,s) ioctl(f,TCSETAW,(zvoid *)s) +# else /* !USE_SYSV_TERMIO */ +# ifndef CMS_MVS +# if (!defined(MINIX) && !defined(GOT_IOCTL_H)) +# include +# endif +# include +# define GTTY gtty +# define STTY stty +# ifdef UNZIP + /* + * XXX : Are these declarations needed at all ???? + */ + /* + * GRR: let's find out... Hmmm, appears not... + int gtty OF((int, struct sgttyb *)); + int stty OF((int, struct sgttyb *)); + */ +# endif +# endif /* !CMS_MVS */ +# endif /* ?USE_SYSV_TERMIO */ +# endif /* ?HAVE_TERMIOS_H */ +# ifndef NO_FCNTL_H +# ifndef UNZIP +# include +# endif +# else + char *ttyname OF((int)); +# endif +# endif /* ?VMS */ +#endif /* !HAVE_WORKING_GETCH */ + + + +#ifndef HAVE_WORKING_GETCH +#ifdef VMS + +static struct dsc$descriptor_s DevDesc = + {11, DSC$K_DTYPE_T, DSC$K_CLASS_S, "SYS$COMMAND"}; + /* {dsc$w_length, dsc$b_dtype, dsc$b_class, dsc$a_pointer}; */ + +/* + * Turn keyboard echoing on or off (VMS). Loosely based on VMSmunch.c + * and hence on Joe Meadows' file.c code. + */ +int echo(opt) + int opt; +{ + /* + * For VMS v5.x: + * IO$_SENSEMODE/SETMODE info: Programming, Vol. 7A, System Programming, + * I/O User's: Part I, sec. 8.4.1.1, 8.4.3, 8.4.5, 8.6 + * sys$assign(), sys$qio() info: Programming, Vol. 4B, System Services, + * System Services Reference Manual, pp. sys-23, sys-379 + * fixed-length descriptor info: Programming, Vol. 3, System Services, + * Intro to System Routines, sec. 2.9.2 + * Greg Roelofs, 15 Aug 91 + */ + + short DevChan, iosb[4]; + long status; + unsigned long ttmode[2]; /* space for 8 bytes */ + + + /* assign a channel to standard input */ + status = sys$assign(&DevDesc, &DevChan, 0, 0); + if (!(status & 1)) + return status; + + /* use sys$qio and the IO$_SENSEMODE function to determine the current + * tty status (for password reading, could use IO$_READVBLK function + * instead, but echo on/off will be more general) + */ + status = sys$qiow(0, DevChan, IO$_SENSEMODE, &iosb, 0, 0, + ttmode, 8, 0, 0, 0, 0); + if (!(status & 1)) + return status; + status = iosb[0]; + if (!(status & 1)) + return status; + + /* modify mode buffer to be either NOECHO or ECHO + * (depending on function argument opt) + */ + if (opt == 0) /* off */ + ttmode[1] |= TT$M_NOECHO; /* set NOECHO bit */ + else + ttmode[1] &= ~((unsigned long) TT$M_NOECHO); /* clear NOECHO bit */ + + /* use the IO$_SETMODE function to change the tty status */ + status = sys$qiow(0, DevChan, IO$_SETMODE, &iosb, 0, 0, + ttmode, 8, 0, 0, 0, 0); + if (!(status & 1)) + return status; + status = iosb[0]; + if (!(status & 1)) + return status; + + /* deassign the sys$input channel by way of clean-up */ + status = sys$dassgn(DevChan); + if (!(status & 1)) + return status; + + return SS$_NORMAL; /* we be happy */ + +} /* end function echo() */ + + +/* + * Read a single character from keyboard in non-echoing mode (VMS). + * (returns EOF in case of errors) + */ +int tt_getch() +{ + short DevChan, iosb[4]; + long status; + char kbbuf[16]; /* input buffer with - some - excess length */ + + /* assign a channel to standard input */ + status = sys$assign(&DevDesc, &DevChan, 0, 0); + if (!(status & 1)) + return EOF; + + /* read a single character from SYS$COMMAND (no-echo) and + * wait for completion + */ + status = sys$qiow(0,DevChan, + IO$_READVBLK|IO$M_NOECHO|IO$M_NOFILTR, + &iosb, 0, 0, + &kbbuf, 1, 0, 0, 0, 0); + if ((status&1) == 1) + status = iosb[0]; + + /* deassign the sys$input channel by way of clean-up + * (for this step, we do not need to check the completion status) + */ + sys$dassgn(DevChan); + + /* return the first char read, or EOF in case the read request failed */ + return (int)(((status&1) == 1) ? (uch)kbbuf[0] : EOF); + +} /* end function tt_getch() */ + + +#else /* !VMS: basically Unix */ + + +/* For VM/CMS and MVS, non-echo terminal input is not (yet?) supported. */ +#ifndef CMS_MVS + +#ifdef ZIP /* moved to globals.h for UnZip */ + static int echofd=(-1); /* file descriptor whose echo is off */ +#endif + +/* + * Turn echo off for file descriptor f. Assumes that f is a tty device. + */ +void Echoff(__G__ f) + __GDEF + int f; /* file descriptor for which to turn echo off */ +{ + struct sgttyb sg; /* tty device structure */ + + GLOBAL(echofd) = f; + GTTY(f, &sg); /* get settings */ + sg.sg_flags &= ~ECHO; /* turn echo off */ + STTY(f, &sg); +} + +/* + * Turn echo back on for file descriptor echofd. + */ +void Echon(__G) + __GDEF +{ + struct sgttyb sg; /* tty device structure */ + + if (GLOBAL(echofd) != -1) { + GTTY(GLOBAL(echofd), &sg); /* get settings */ + sg.sg_flags |= ECHO; /* turn echo on */ + STTY(GLOBAL(echofd), &sg); + GLOBAL(echofd) = -1; + } +} + +#endif /* !CMS_MVS */ +#endif /* ?VMS */ + + +#if (defined(UNZIP) && !defined(FUNZIP)) + +#if (defined(UNIX) || defined(__BEOS__)) +#ifdef MORE + +/* + * Get the number of lines on the output terminal. SCO Unix apparently + * defines TIOCGWINSZ but doesn't support it (!M_UNIX). + * + * GRR: will need to know width of terminal someday, too, to account for + * line-wrapping. + */ + +#if (defined(TIOCGWINSZ) && !defined(M_UNIX)) + +int screensize(tt_rows, tt_cols) + int *tt_rows; + int *tt_cols; +{ + struct winsize wsz; +#ifdef DEBUG_WINSZ + static int firsttime = TRUE; +#endif + + /* see termio(4) under, e.g., SunOS */ + if (ioctl(1, TIOCGWINSZ, &wsz) == 0) { +#ifdef DEBUG_WINSZ + if (firsttime) { + firsttime = FALSE; + fprintf(stderr, "ttyio.c screensize(): ws_row = %d\n", + wsz.ws_row); + fprintf(stderr, "ttyio.c screensize(): ws_col = %d\n", + wsz.ws_col); + } +#endif + /* number of rows */ + if (tt_rows != NULL) + *tt_rows = (int)((wsz.ws_row > 0) ? wsz.ws_row : 24); + /* number of columns */ + if (tt_cols != NULL) + *tt_cols = (int)((wsz.ws_col > 0) ? wsz.ws_col : 80); + return 0; /* signal success */ + } else { /* this happens when piping to more(1), for example */ +#ifdef DEBUG_WINSZ + if (firsttime) { + firsttime = FALSE; + fprintf(stderr, + "ttyio.c screensize(): ioctl(TIOCGWINSZ) failed\n")); + } +#endif + /* VT-100 assumed to be minimal hardware */ + if (tt_rows != NULL) + *tt_rows = 24; + if (tt_cols != NULL) + *tt_cols = 80; + return 1; /* signal failure */ + } +} + +#else /* !TIOCGWINSZ: service not available, fall back to semi-bogus method */ + +int screensize(tt_rows, tt_cols) + int *tt_rows; + int *tt_cols; +{ + char *envptr, *getenv(); + int n; + int errstat = 0; + + /* GRR: this is overly simplistic, but don't have access to stty/gtty + * system anymore + */ + if (tt_rows != NULL) { + envptr = getenv("LINES"); + if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) { + /* VT-100 assumed to be minimal hardware */ + *tt_rows = 24; + errstat = 1; /* signal failure */ + } else { + *tt_rows = n; + } + } + if (tt_cols != NULL) { + envptr = getenv("COLUMNS"); + if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) { + *tt_cols = 80; + errstat = 1; /* signal failure */ + } else { + *tt_cols = n; + } + } + return errstat; +} + +#endif /* ?(TIOCGWINSZ && !M_UNIX) */ +#endif /* MORE */ + + +/* + * Get a character from the given file descriptor without echo or newline. + */ +int zgetch(__G__ f) + __GDEF + int f; /* file descriptor from which to read */ +{ +#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) + char oldmin, oldtim; +#endif + char c; + struct sgttyb sg; /* tty device structure */ + + GTTY(f, &sg); /* get settings */ +#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) + oldmin = sg.c_cc[VMIN]; /* save old values */ + oldtim = sg.c_cc[VTIME]; + sg.c_cc[VMIN] = 1; /* need only one char to return read() */ + sg.c_cc[VTIME] = 0; /* no timeout */ + sg.sg_flags &= ~ICANON; /* canonical mode off */ +#else + sg.sg_flags |= CBREAK; /* cbreak mode on */ +#endif + sg.sg_flags &= ~ECHO; /* turn echo off, too */ + STTY(f, &sg); /* set cbreak mode */ + GLOBAL(echofd) = f; /* in case ^C hit (not perfect: still CBREAK) */ + + read(f, &c, 1); /* read our character */ + +#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) + sg.c_cc[VMIN] = oldmin; /* restore old values */ + sg.c_cc[VTIME] = oldtim; + sg.sg_flags |= ICANON; /* canonical mode on */ +#else + sg.sg_flags &= ~CBREAK; /* cbreak mode off */ +#endif + sg.sg_flags |= ECHO; /* turn echo on */ + STTY(f, &sg); /* restore canonical mode */ + GLOBAL(echofd) = -1; + + return (int)(uch)c; +} + + +#else /* !UNIX && !__BEOS__ */ +#ifndef VMS /* VMS supplies its own variant of getch() */ + + +int zgetch(__G__ f) + __GDEF + int f; /* file descriptor from which to read (must be open already) */ +{ + char c, c2; + +/*--------------------------------------------------------------------------- + Get a character from the given file descriptor without echo; can't fake + CBREAK mode (i.e., newline required), but can get rid of all chars up to + and including newline. + ---------------------------------------------------------------------------*/ + + echoff(f); + read(f, &c, 1); + if (c != '\n') + do { + read(f, &c2, 1); /* throw away all other chars up thru newline */ + } while (c2 != '\n'); + echon(); + return (int)c; +} + +#endif /* !VMS */ +#endif /* ?(UNIX || __BEOS__) */ + +#endif /* UNZIP && !FUNZIP */ +#endif /* !HAVE_WORKING_GETCH */ + + +#if CRYPT /* getp() is only used with full encryption */ + +/* + * Simple compile-time check for source compatibility between + * zcrypt and ttyio: + */ +#if (!defined(CR_MAJORVER) || (CR_MAJORVER < 2) || (CR_MINORVER < 7)) + error: This Info-ZIP tool requires zcrypt 2.7 or later. +#endif + +/* + * Get a password of length n-1 or less into *p using the prompt *m. + * The entered password is not echoed. + */ + +#ifdef HAVE_WORKING_GETCH +/* + * For the AMIGA, getch() is defined as Agetch(), which is in + * amiga/filedate.c; SAS/C 6.x provides a getch(), but since Agetch() + * uses the infrastructure that is already in place in filedate.c, it is + * smaller. With this function, echoff() and echon() are not needed. + * + * For the MAC, a non-echo macgetch() function is defined in the MacOS + * specific sources which uses the event handling mechanism of the + * desktop window manager to get a character from the keyboard. + * + * For the other systems in this section, a non-echo getch() function + * is either contained the C runtime library (conio package), or getch() + * is defined as an alias for a similar system specific RTL function. + */ + +#ifndef WINDLL /* WINDLL does not support a console interface */ +#ifndef QDOS /* QDOS supplies a variant of this function */ + +/* This is the getp() function for all systems (with TTY type user interface) + * that supply a working `non-echo' getch() function for "raw" console input. + */ +char *getp(__G__ m, p, n) + __GDEF + ZCONST char *m; /* prompt for password */ + char *p; /* return value: line input */ + int n; /* bytes available in p[] */ +{ + char c; /* one-byte buffer for read() to use */ + int i; /* number of characters input */ + char *w; /* warning on retry */ + + /* get password */ + w = ""; + do { + fputs(w, stderr); /* warning if back again */ + fputs(m, stderr); /* display prompt and flush */ + fflush(stderr); + i = 0; + do { /* read line, keeping first n characters */ + if ((c = (char)getch()) == '\r') + c = '\n'; /* until user hits CR */ + if (c == 8 || c == 127) { + if (i > 0) i--; /* the `backspace' and `del' keys works */ + } + else if (i < n) + p[i++] = c; /* truncate past n */ + } while (c != '\n'); + PUTC('\n', stderr); fflush(stderr); + w = "(line too long--try again)\n"; + } while (p[i-1] != '\n'); + p[i-1] = 0; /* terminate at newline */ + + return p; /* return pointer to password */ + +} /* end function getp() */ + +#endif /* !QDOS */ +#endif /* !WINDLL */ + + +#else /* !HAVE_WORKING_GETCH */ + + +#if (defined(UNIX) || defined(__MINT__) || defined(__BEOS__)) + +#ifndef _PATH_TTY +# ifdef __MINT__ +# define _PATH_TTY ttyname(2) +# else +# define _PATH_TTY "/dev/tty" +# endif +#endif + +char *getp(__G__ m, p, n) + __GDEF + ZCONST char *m; /* prompt for password */ + char *p; /* return value: line input */ + int n; /* bytes available in p[] */ +{ + char c; /* one-byte buffer for read() to use */ + int i; /* number of characters input */ + char *w; /* warning on retry */ + int f; /* file descriptor for tty device */ + +#ifdef PASSWD_FROM_STDIN + /* Read from stdin. This is unsafe if the password is stored on disk. */ + f = 0; +#else + /* turn off echo on tty */ + + if ((f = open(_PATH_TTY, 0)) == -1) + return NULL; +#endif + /* get password */ + w = ""; + do { + fputs(w, stderr); /* warning if back again */ + fputs(m, stderr); /* prompt */ + fflush(stderr); + i = 0; + echoff(f); + do { /* read line, keeping n */ + read(f, &c, 1); + if (i < n) + p[i++] = c; + } while (c != '\n'); + echon(); + PUTC('\n', stderr); fflush(stderr); + w = "(line too long--try again)\n"; + } while (p[i-1] != '\n'); + p[i-1] = 0; /* terminate at newline */ + +#ifndef PASSWD_FROM_STDIN + close(f); +#endif + + return p; /* return pointer to password */ + +} /* end function getp() */ + +#endif /* UNIX || __MINT__ || __BEOS__ */ + + + +#if (defined(VMS) || defined(CMS_MVS)) + +char *getp(__G__ m, p, n) + __GDEF + ZCONST char *m; /* prompt for password */ + char *p; /* return value: line input */ + int n; /* bytes available in p[] */ +{ + char c; /* one-byte buffer for read() to use */ + int i; /* number of characters input */ + char *w; /* warning on retry */ + FILE *f; /* file structure for SYS$COMMAND device */ + +#ifdef PASSWD_FROM_STDIN + f = stdin; +#else + if ((f = fopen(ctermid(NULL), "r")) == NULL) + return NULL; +#endif + + /* get password */ + fflush(stdout); + w = ""; + do { + if (*w) /* bug: VMS apparently adds \n to NULL fputs */ + fputs(w, stderr); /* warning if back again */ + fputs(m, stderr); /* prompt */ + fflush(stderr); + i = 0; + echoff(f); + do { /* read line, keeping n */ + if ((c = (char)getc(f)) == '\r') + c = '\n'; + if (i < n) + p[i++] = c; + } while (c != '\n'); + echon(); + PUTC('\n', stderr); fflush(stderr); + w = "(line too long--try again)\n"; + } while (p[i-1] != '\n'); + p[i-1] = 0; /* terminate at newline */ +#ifndef PASSWD_FROM_STDIN + fclose(f); +#endif + + return p; /* return pointer to password */ + +} /* end function getp() */ + +#endif /* VMS || CMS_MVS */ +#endif /* ?HAVE_WORKING_GETCH */ +#endif /* CRYPT */ +#endif /* CRYPT || (UNZIP && !FUNZIP) */ + +const char *BOINC_RCSID_5c8ee27dba = "$Id: ttyio.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/ttyio.h boinc-7.0.14+dfsg/zip/unzip/ttyio.h --- boinc-7.0.7+dfsg/zip/unzip/ttyio.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/ttyio.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,221 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + ttyio.h + */ + +#ifndef __ttyio_h /* don't include more than once */ +#define __ttyio_h + +//#ifndef __crypt_h +//# include "crypt.h" /* ensure that encryption header file has been seen */ +//#endif + +#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) +/* + * Non-echo keyboard/console input support is needed and enabled. + */ + +#ifndef __G /* UnZip only, for now (DLL stuff) */ +# define __G +# define __G__ +# define __GDEF +# define __GPRO void +# define __GPRO__ +#endif + +#ifndef ZCONST /* UnZip only (until have configure script like Zip) */ +# define ZCONST const +#endif + +#if (defined(MSDOS) || defined(OS2) || defined(WIN32)) +# ifndef DOS_OS2_W32 +# define DOS_OS2_W32 +# endif +#endif + +#if (defined(DOS_OS2_W32) || defined(__human68k__)) +# ifndef DOS_H68_OS2_W32 +# define DOS_H68_OS2_W32 +# endif +#endif + +#if (defined(DOS_OS2_W32) || defined(FLEXOS)) +# ifndef DOS_FLX_OS2_W32 +# define DOS_FLX_OS2_W32 +# endif +#endif + +#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) +# ifndef DOS_FLX_H68_OS2_W32 +# define DOS_FLX_H68_OS2_W32 +# endif +#endif + +#if (defined(VM_CMS) || defined(MVS)) +# ifndef CMS_MVS +# define CMS_MVS +# endif +#endif + + +/* Function prototypes */ + +/* The following systems supply a `non-echo' character input function "getch()" + * (or an alias) and do not need the echoff() / echon() function pair. + */ +#ifdef AMIGA +# define echoff(f) +# define echon() +# define getch() Agetch() +# define HAVE_WORKING_GETCH +#endif /* AMIGA */ + +#ifdef ATARI +# define echoff(f) +# define echon() +# include +# define getch() (Cnecin() & 0x000000ff) +# define HAVE_WORKING_GETCH +#endif + +#ifdef MACOS +# define echoff(f) +# define echon() +# define getch() macgetch() +# define HAVE_WORKING_GETCH +#endif + +#ifdef NLM +# define echoff(f) +# define echon() +# define HAVE_WORKING_GETCH +#endif + +#ifdef QDOS +# define echoff(f) +# define echon() +# define HAVE_WORKING_GETCH +#endif + +#ifdef RISCOS +# define echoff(f) +# define echon() +# define getch() SWI_OS_ReadC() +# define HAVE_WORKING_GETCH +#endif + +#ifdef DOS_H68_OS2_W32 +# define echoff(f) +# define echon() +# ifdef WIN32 +# ifndef getch +# define getch() getch_win32() +# endif +# else /* !WIN32 */ +# ifdef __EMX__ +# ifndef getch +# define getch() _read_kbd(0, 1, 0) +# endif +# else /* !__EMX__ */ +# ifdef __GO32__ +# include +# define getch() getkey() +# else /* !__GO32__ */ +# include +# endif /* ?__GO32__ */ +# endif /* ?__EMX__ */ +# endif /* ?WIN32 */ +# define HAVE_WORKING_GETCH +#endif /* DOS_H68_OS2_W32 */ + +#ifdef FLEXOS +# define echoff(f) +# define echon() +# define getch() getchar() /* not correct, but may not be on a console */ +# define HAVE_WORKING_GETCH +#endif + +/* For VM/CMS and MVS, we do not (yet) have any support to switch terminal + * input echo on and off. The following "fake" definitions allow inclusion + * of crypt support and UnZip's "pause prompting" features, but without + * any echo suppression. + */ +#ifdef CMS_MVS +# define echoff(f) +# define echon() +#endif + +#ifdef TANDEM +# define echoff(f) +# define echon() +# define getch() zgetch() /* defined in TANDEMC */ +# define HAVE_WORKING_GETCH +#endif + +/* The THEOS C runtime library supplies the function conmask() to toggle + * terminal input echo on (conmask("e")) and off (conmask("n")). But, + * since THEOS C RTL also contains a working non-echo getch() function, + * the echo toggles are not needed. + */ +#ifdef THEOS +# define echoff(f) +# define echon() +# define HAVE_WORKING_GETCH +#endif + +/* VMS has a single echo() function in ttyio.c to toggle terminal + * input echo on and off. + */ +#ifdef VMS +# define echoff(f) echo(0) +# define echon() echo(1) +# define getch() tt_getch() +# define FGETCH(f) tt_getch() + int echo OF((int)); + int tt_getch OF((void)); +#endif + +/* For all other systems, ttyio.c supplies the two functions Echoff() and + * Echon() for suppressing and (re)enabling console input echo. + */ +#ifndef echoff +# define echoff(f) Echoff(__G__ f) +# define echon() Echon(__G) + void Echoff OF((__GPRO__ int f)); + void Echon OF((__GPRO)); +#endif + +/* this stuff is used by MORE and also now by the ctrl-S code; fileio.c only */ +#if (defined(UNZIP) && !defined(FUNZIP)) +# ifdef HAVE_WORKING_GETCH +# define FGETCH(f) getch() +# endif +# ifndef FGETCH + /* default for all systems where no getch()-like function is available */ + int zgetch OF((__GPRO__ int f)); +# define FGETCH(f) zgetch(__G__ f) +# endif +#endif /* UNZIP && !FUNZIP */ + +#if (CRYPT && !defined(WINDLL)) + char *getp OF((__GPRO__ ZCONST char *m, char *p, int n)); +#endif + +#else /* !(CRYPT || (UNZIP && !FUNZIP)) */ + +/* + * No need for non-echo keyboard/console input; provide dummy definitions. + */ +#define echoff(f) +#define echon() + +#endif /* ?(CRYPT || (UNZIP && !FUNZIP)) */ + +#endif /* !__ttyio_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Contents boinc-7.0.14+dfsg/zip/unzip/unix/Contents --- boinc-7.0.7+dfsg/zip/unzip/unix/Contents 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Contents 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,13 @@ +Contents of the "unix" subdirectory for UnZip 5.3 and later: + + Contents this file + Makefile makefile for UnZip for various architectures and OS's + unix.c Unix-specific support routines + unxcfg.h Unix-specific configuration settings + zipgrep script to scan zip archive entries for lines matching a pattern + Packaging/ subdirectory containing SysV.4 (e.g., Solaris 2.x) package info + +Type "make" or "make help" to get general compile instructions (beyond +those in the INSTALL file), or "make list" for a list of makefile targets. +Note that there are some MS-DOS and cross-compilation targets thrown in +just to make things more exciting. diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Makefile boinc-7.0.14+dfsg/zip/unzip/unix/Makefile --- boinc-7.0.7+dfsg/zip/unzip/unix/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Makefile 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,980 @@ +#============================================================================== +# Makefile for UnZip, UnZipSFX and fUnZip: Unix and MS-DOS ("real" makes only) +# Version: 5.5 16 February 2002 +#============================================================================== + + +# INSTRUCTIONS (such as they are): +# +# "make sunos" -- makes UnZip in current directory on a generic SunOS 4.x Sun +# "make list" -- lists all supported systems (targets) +# "make help" -- provides pointers on what targets to try if problems occur +# "make wombat" -- chokes and dies if you haven't added the specifics for your +# Wombat 68000 (or whatever) to the systems list +# +# CF are flags for the C compiler. LF are flags for the loader. LF2 are more +# flags for the loader, if they need to be at the end of the line instead of at +# the beginning (for example, some libraries). FL and FL2 are the corre- +# sponding flags for fUnZip. LOCAL_UNZIP is an environment variable that can +# be used to add default C flags to your compile without editing the Makefile +# (e.g., -DDEBUG_STRUC, or -FPi87 on PCs using Microsoft C). +# +# Some versions of make do not define the macro "$(MAKE)"; this is rare, but +# if things don't work, try using "make" instead of "$(MAKE)" in your system's +# makerule. Or try adding the following line to your .login file: +# setenv MAKE "make" +# (That never works--makes that are too stupid to define MAKE are also too +# stupid to look in the environment--but try it anyway for kicks. :-) ) +# +# Memcpy and memset are provided for those systems that don't have them; they +# are in fileio.c and will be used if -DZMEM is included in CF. These days +# almost all systems have them. +# +# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful compila- +# tion does not always imply a working program. + + +##################### +# MACRO DEFINITIONS # +##################### + +# Defaults most systems use (use LOCAL_UNZIP in environment to add flags, +# such as -DDOSWILD). + +# UnZip flags +CC = cc# try using "gcc" target rather than changing this (CC and LD +LD = $(CC)# must match, else "unresolved symbol: ___main" is possible) +AS = as +LOC = $(LOCAL_UNZIP) +AF = $(LOC) +CF = -O -I. $(LOC) +LF = -o unzip +LF2 = -s + +# UnZipSFX flags +SL = -o unzipsfx +SL2 = $(LF2) + +# fUnZip flags +FL = -o funzip +FL2 = $(LF2) + +# general-purpose stuff +#CP = cp +CP = ln +LN = ln +RM = rm -f +CHMOD = chmod +BINPERMS = 755 +MANPERMS = 644 +STRIP = strip +E = +O = .o +M = unix +SHELL = /bin/sh + +# Version info for unix/unix.c +HOST_VERSINFO=-DIZ_CC_NAME='\"\$$(CC) \"' -DIZ_OS_NAME='\"`uname -a`\"' + +# defaults for crc32 stuff and system dependent headers +CRC32 = crc32 +OSDEP_H = + +# object files +OBJS1 = unzip$O $(CRC32)$O crctab$O crypt$O envargs$O explode$O +OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O +OBJS3 = process$O ttyio$O unreduce$O unshrink$O zipinfo$O +OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O +LOBJS = $(OBJS) +OBJSDLL = $(OBJS:.o=.pic.o) api.pic.o +OBJX = unzipsfx$O $(CRC32)$O crctab_$O crypt_$O extract_$O fileio_$O \ + globals_$O inflate_$O match_$O process_$O ttyio_$O $M_$O +LOBJX = $(OBJX) +OBJF = funzip$O $(CRC32)$O cryptf$O globalsf$O inflatef$O ttyiof$O +#OBJS_OS2 = $(OBJS1:.o=.obj) $(OBJS2:.o=.obj) os2.obj +#OBJF_OS2 = $(OBJF:.o=.obj) +UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H) + +# installation +# (probably can change next two to `install' and `install -d' if you have it) +INSTALL = cp +INSTALL_PROGRAM = $(INSTALL) +INSTALL_D = mkdir -p +# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate +manext = 1 +prefix = /usr/local +BINDIR = $(prefix)/bin# where to install executables +MANDIR = $(prefix)/man/man$(manext)# where to install man pages +INSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/unzip$E $(BINDIR)/unzipsfx$E \ + $(BINDIR)/zipgrep$E $(BINDIR)/zipinfo$E +INSTALLEDMAN = $(MANDIR)/funzip.$(manext) $(MANDIR)/unzip.$(manext) \ + $(MANDIR)/unzipsfx.$(manext) $(MANDIR)/zipgrep.$(manext) \ + $(MANDIR)/zipinfo.$(manext) + +# Solaris 2.x stuff: +PKGDIR = IZunzip +VERSION = Version 5.5 + +UNZIPS = unzip$E funzip$E unzipsfx$E +# this is a little ugly...well, OK, it's a lot ugly: +MANS = man/funzip.1 man/unzip.1 man/unzipsfx.1 man/zipgrep.1 man/zipinfo.1 +DOCS = funzip.txt unzip.txt unzipsfx.txt zipgrep.txt zipinfo.txt + +# list of supported systems/targets in this version +SYSTEMSG = generic generic2 generic3 generic_zlib generic_shlib +SYSTEMS1 = 386i 3Bx 7300 7300_gcc aix aix_rt amdahl amdahl_eft apollo aviion +SYSTEMS2 = bsd bsdi bsdi_noasm bull coherent convex cray cray_opt cyber_sgi +SYSTEMS3 = dec dnix encore eta freebsd gcc gould hk68 hp hpux isc isc_gcc +SYSTEMS4 = isi linux linux_dos linux_noasm linux_shlib linux_shlibz lynx +SYSTEMS5 = maxosx macosx_gcc minix mips mpeix next next10 next2x next3x +SYSTEMS6 = nextfat osf1 pixel ptx pyramid qnxnto realix regulus rs6000 sco +SYSTEMS7 = sco_dos sco_sl sco_x286 sequent sgi solaris solaris_pkg stardent +SYSTEMS8 = stellar sunos3 sunos4 sysv sysv_gcc sysv6300 tahoe ti_sysv ultrix +SYSTEMS9 = vax v7 wombat xenix xos + + +#################### +# DEFAULT HANDLING # +#################### + +# By default, print help on which makefile targets to try. (The SYSTEM +# variable is no longer supported; use "make " instead.) + +help: + @echo "" + @echo\ + " If you're not sure about the characteristics of your system, try typing" + @echo\ + ' "make generic". If the compiler barfs and says something unpleasant about' + @echo\ + ' "timezone redefined," try typing "make clean" followed by "make generic2".' + @echo\ + ' If, on the other hand, it complains about an undefined symbol _ftime, try' + @echo\ + ' typing "make clean" followed by "make generic3". One of these actions' + @echo\ + ' should produce a working copy of unzip on most Unix systems. If you know' + @echo\ + ' a bit more about the machine on which you work, you might try "make list"' + @echo\ + ' for a list of the specific systems supported herein. (Many of them do' + @echo\ + " exactly the same thing, so don't agonize too much over which to pick if" + @echo\ + ' two or more sound equally likely.) Also check out the INSTALL file for' + @echo\ + ' notes on compiling various targets. As a last resort, feel free to read' + @echo\ + ' the numerous comments within the Makefile itself.' + @echo\ + ' Have a mostly pretty good day.' + @echo "" + +list: + @echo "" + @echo\ + 'Type "make ", where is one of the following:' + @echo "" + @echo " $(SYSTEMSG)" + @echo "" + @echo " $(SYSTEMS1)" + @echo " $(SYSTEMS2)" + @echo " $(SYSTEMS3)" + @echo " $(SYSTEMS4)" + @echo " $(SYSTEMS5)" + @echo " $(SYSTEMS6)" + @echo " $(SYSTEMS7)" + @echo " $(SYSTEMS8)" + @echo " $(SYSTEMS9)" +# @echo "" +# @echo\ +# 'Targets for related utilities (ZipInfo and fUnZip) include:' +# @echo "" +# @echo " $(SYS_UTIL1)" +# @echo " $(SYS_UTIL2)" + @echo "" + @echo\ + 'For further (very useful) information, please read the comments in Makefile.' + @echo "" + +generic_msg: + @echo "" + @echo\ + ' Attempting "make generic" now. If this fails for some reason, type' + @echo\ + ' "make help" and/or "make list" for suggestions.' + @echo "" + + +############################################### +# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES # +############################################### + +# this is for GNU make; comment out and notify zip-bugs if it causes errors +.SUFFIXES: .c .o .obj .pic.o + +# yes, we should be able to use the $O macro to combine these two, but it +# fails on some brain-damaged makes (e.g., AIX's)...no big deal +.c.o: + $(CC) -c $(CF) $*.c + +.c.obj: + $(CC) -c $(CF) $*.c + +.c.pic.o: + $(CC) -c $(CF) -o $@ $*.c + +# this doesn't work...directories are always a pain with implicit rules +#.1.txt: man/$< +# nroff -Tman -man $< | col -b | uniq | \ +# sed 's/Sun Release ..../Info-ZIP /' > $@ + + +# these rules may be specific to Linux (or at least the GNU groff package) +# and are really intended only for the authors' use in creating non-Unix +# documentation files (which are provided with both source and binary +# distributions). We should probably add a ".1.txt" rule for more generic +# systems... + +funzip.txt: man/funzip.1 + nroff -Tascii -man man/funzip.1 | col -b | uniq | expand > $@ + +unzip.txt: man/unzip.1 + nroff -Tascii -man man/unzip.1 | col -b | uniq | expand > $@ + +unzipsfx.txt: man/unzipsfx.1 + nroff -Tascii -man man/unzipsfx.1 | col -b | uniq | expand > $@ + +zipgrep.txt: man/zipgrep.1 + nroff -Tascii -man man/zipgrep.1 | col -b | uniq | expand > $@ + +zipinfo.txt: man/zipinfo.1 + nroff -Tascii -man man/zipinfo.1 | col -b | uniq | expand > $@ + + +all: generic_msg generic +unzips: $(UNZIPS) +objs: $(OBJS) +objsdll: $(OBJSDLL) +docs: $(DOCS) +unzipsman: unzips docs +unzipsdocs: unzips docs + + +# EDIT HERE FOR PARALLEL MAKES on Sequent (and others?)--screws up MS-DOS +# make utilities if default: change "unzip$E:" to "unzip$E:&" + +unzip$E: $(OBJS) # add `&' for parallel makes + $(LD) $(LF) $(LOBJS) $(LF2) + +unzipsfx$E: $(OBJX) # add `&' for parallel makes + $(LD) $(SL) $(LOBJX) $(SL2) + +funzip$E: $(OBJF) # add `&' for parallel makes + $(LD) $(FL) $(OBJF) $(FL2) + +zipinfo$E: unzip$E # `&' is pointless here... + @echo\ + ' This is a Unix-specific target. ZipInfo is not enabled in some MS-DOS' + @echo\ + ' versions of UnZip; if it is in yours, copy unzip.exe to zipinfo.exe' + @echo\ + ' or else invoke as "unzip -Z" (in a batch file, for example).' + $(LN) unzip$E zipinfo$E + + +crc32$O: crc32.c $(UNZIP_H) zip.h +crctab$O: crctab.c $(UNZIP_H) zip.h +crypt$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h +envargs$O: envargs.c $(UNZIP_H) +explode$O: explode.c $(UNZIP_H) +extract$O: extract.c $(UNZIP_H) crypt.h +fileio$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +funzip$O: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h +globals$O: globals.c $(UNZIP_H) +inflate$O: inflate.c inflate.h $(UNZIP_H) +list$O: list.c $(UNZIP_H) +match$O: match.c $(UNZIP_H) +process$O: process.c $(UNZIP_H) +ttyio$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce$O: unreduce.c $(UNZIP_H) +unshrink$O: unshrink.c $(UNZIP_H) +unzip$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo$O: zipinfo.c $(UNZIP_H) + +unzipsfx$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only + -$(CP) unzip.c unzipsfx.c + $(CC) -c $(CF) -DSFX unzipsfx.c + $(RM) unzipsfx.c + +crctab_$O: crctab.c $(UNZIP_H) zip.h + -$(CP) crctab.c crctab_.c + $(CC) -c $(CF) -DSFX crctab_.c + $(RM) crctab_.c + +crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + -$(CP) crypt.c crypt_.c + $(CC) -c $(CF) -DSFX crypt_.c + $(RM) crypt_.c + +extract_$O: extract.c $(UNZIP_H) crypt.h # unzipsfx only + -$(CP) extract.c extract_.c + $(CC) -c $(CF) -DSFX extract_.c + $(RM) extract_.c + +fileio_$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h + -$(CP) fileio.c fileio_.c + $(CC) -c $(CF) -DSFX fileio_.c + $(RM) fileio_.c + +globals_$O: globals.c $(UNZIP_H) # unzipsfx only + -$(CP) globals.c globals_.c + $(CC) -c $(CF) -DSFX globals_.c + $(RM) globals_.c + +inflate_$O: inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only + -$(CP) inflate.c inflate_.c + $(CC) -c $(CF) -DSFX inflate_.c + $(RM) inflate_.c + +match_$O: match.c $(UNZIP_H) # unzipsfx only + -$(CP) match.c match_.c + $(CC) -c $(CF) -DSFX match_.c + $(RM) match_.c + +process_$O: process.c $(UNZIP_H) # unzipsfx only + -$(CP) process.c process_.c + $(CC) -c $(CF) -DSFX process_.c + $(RM) process_.c + +ttyio_$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + -$(CP) ttyio.c ttyio_.c + $(CC) -c $(CF) -DSFX ttyio_.c + $(RM) ttyio_.c + + +cryptf$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + -$(CP) crypt.c cryptf.c + $(CC) -c $(CF) -DFUNZIP cryptf.c + $(RM) cryptf.c + +globalsf$O: globals.c $(UNZIP_H) # funzip only + -$(CP) globals.c globalsf.c + $(CC) -c $(CF) -DFUNZIP globalsf.c + $(RM) globalsf.c + +inflatef$O: inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only + -$(CP) inflate.c inflatef.c + $(CC) -c $(CF) -DFUNZIP inflatef.c + $(RM) inflatef.c + +ttyiof$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + -$(CP) ttyio.c ttyiof.c + $(CC) -c $(CF) -DFUNZIP ttyiof.c + $(RM) ttyiof.c + + +# optional assembler replacements +crc_i86$O: msdos/crc_i86.asm # 16bit only + $(AS) $(AF) msdos/crc_i86.asm $(ASEOL) + +crc_gcc$O: crc_i386.S # 32bit, GNU AS + $(AS) $(AF) -x assembler-with-cpp -c -o $@ crc_i386.S + +crc_gcc.pic.o: crc_i386.S # 32bit, GNU AS + $(AS) $(AF) -x assembler-with-cpp -c -o $@ crc_i386.S + +crc_sysv$O: crc_i386.S # 32bit, SysV AS + $(CC) -E $(AF) crc_i386.S >crc_i386.s + $(AS) -o $@ crc_i386.s + $(RM) crc_i386.s + +msdos$O: msdos/msdos.c $(UNZIP_H) unzvers.h # DOS only + $(CC) -c $(CF) msdos/msdos.c + +msdos_$O: msdos/msdos.c $(UNZIP_H) # DOS unzipsfx + -$(CP) msdos/msdos.c msdos_.c > nul + $(CC) -c $(CF) -DSFX msdos_.c + $(RM) msdos_.c + +#os2$O: os2/os2.c $(UNZIP_H) # OS/2 only +# $(CC) -c $(CF) os2/os2.c + +unix$O: unix/unix.c $(UNZIP_H) unzvers.h # Unix only + $(CC) -c $(CF) unix/unix.c + +unix_$O: unix/unix.c $(UNZIP_H) # Unix unzipsfx + -$(CP) unix/unix.c unix_.c + $(CC) -c $(CF) -DSFX unix_.c + $(RM) unix_.c + +unix.pic.o: unix/unix.c $(UNZIP_H) unzvers.h # Unix shlib + $(CC) -c $(CF) -o $@ unix/unix.c + + +unix_make: +# @echo\ +# '(Ignore any errors from `make'"' due to the following command; it's harmless.)" + -@2>&1 $(LN) unix/Makefile . > /dev/null || echo > /dev/null + +# this really only works for Unix targets, unless E and O specified on cmd line +clean: + @echo "" + @echo ' This is a Unix-specific target. (Just so you know.)' + @echo "" + rm -f $(UNZIPS) $(OBJS) $(OBJF) $(OBJX) api$O apihelp$O crc_gcc$O \ + crc_sysv$O unzipstb$O crypt_.c extract_.c globals_.c inflate_.c \ + ttyio_.c crc_i386.s msdos_.c process_.c unix_.c unzipsfx.c + rm -rf ./$(PKGDIR) + +# Package generation interface (by J.Bush). Originally tested under Sun +# Solaris 2.x. Other SVr4s may be very similar and could possibly use this. +# Note: expects version info to be stored in VERSION macro variable. +# See "README" under ./unix/Packaging +# +svr4package: unzips + @echo "Creating SVR4 package for Unix ..." + -@rm -rf ./$(PKGDIR) ./$(PKGDIR)_`uname -p`.pkg + -@sed -e "s/.VERSION./$(VERSION)/g" \ + -e "s/.PSTAMP./$(LOGNAME)_`date | tr ' ' '_'`/g" \ + -e "s/.ARCH./Solaris_`uname -rp | tr ' ' ','`/g" \ + ./unix/Packaging/pkginfo.in > ./unix/Packaging/pkginfo + -@sed -e "s/.ARCH./`uname -p`/g" \ + ./unix/Packaging/preinstall.in > ./unix/Packaging/preinstall + /usr/bin/pkgmk -d . -b . -r . -f ./unix/Packaging/prototype $(PKGDIR) + /usr/bin/pkgtrans -o -s . $(PKGDIR)_`uname -p`.pkg $(PKGDIR) + @echo " " + @echo "To install, copy $(PKGDIR)_`uname -p`.pkg to the target system, and" + @echo "issue the command (as root): pkgadd -d $(PKGDIR)_`uname -p`.pkg" + @echo " " + +install: $(MANS) + -$(INSTALL_D) $(BINDIR) + $(INSTALL_PROGRAM) $(UNZIPS) $(BINDIR) + $(INSTALL) unix/zipgrep $(BINDIR) + $(RM) $(BINDIR)/zipinfo$E + $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E + -$(INSTALL_D) $(MANDIR) + $(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext) + $(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext) + $(INSTALL) man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext) + $(INSTALL) man/zipgrep.1 $(MANDIR)/zipgrep.$(manext) + $(INSTALL) man/zipinfo.1 $(MANDIR)/zipinfo.$(manext) + $(CHMOD) $(BINPERMS) $(INSTALLEDBIN) + $(CHMOD) $(MANPERMS) $(INSTALLEDMAN) + +uninstall: + $(RM) $(INSTALLEDBIN) $(INSTALLEDMAN) + + +# the test zipfile +TESTZIP = testmake.zip + +# test some basic features of the build +test: check + +check: + @echo '##### This is a Unix-specific target. (Just so you know.)' + @echo '##### Make sure unzip, funzip and unzipsfx are compiled and' + @echo '##### in this directory.' + @if test ! -f ./unzip; then \ + echo "##### ERROR: can't find ./unzip"; exit 1; fi + @if test ! -f ./funzip; then \ + echo "##### ERROR: can't find ./funzip"; exit 1; fi + @if test ! -f ./unzipsfx; then \ + echo "##### ERROR: can't find ./unzipsfx"; exit 1; fi +# + @if test ! -f $(TESTZIP); then \ + echo "##### ERROR: can't find test file $(TESTZIP)"; exit 1; fi +# + @echo "##### testing extraction" + @./unzip -bo $(TESTZIP) testmake.zipinfo + @if test ! -f testmake.zipinfo ; then \ + echo "##### ERROR: file extraction from $(TESTZIP) failed"; \ + exit 1; fi +# + @echo '##### testing zipinfo (unzip -Z)' + @./unzip -Z $(TESTZIP) > testmake.unzip-Z + @if diff testmake.unzip-Z testmake.zipinfo; then echo "OK."; else \ + echo "##### WARNING: zipinfo output doesn't match stored version"; \ + echo '##### (If the only difference is the file times, compare your'; \ + echo '##### timezone with the Central European timezone, which is one'; \ + echo '##### hour east of Greenwich but effectively 2 hours east'; \ + echo '##### during summer Daylight Savings Time. The upper two'; \ + echo '##### lines should correspond to your local time when the'; \ + echo '##### files were created, on 19 November 1998 at 10:46pm CET.'; \ + echo '##### If the times are consistent, please ignore this warning.)'; \ + fi + @$(RM) testmake.unzip-Z testmake.zipinfo +# + @echo '##### testing unzip -d exdir option' + @./unzip -bo $(TESTZIP) -d testun notes + @cat testun/notes +# + @echo '##### testing unzip -o and funzip (ignore funzip warning)' + @./unzip -boq $(TESTZIP) notes -d testun + @./funzip < $(TESTZIP) > testun/notes2 + @if diff testun/notes testun/notes2; then true; else \ + echo '##### ERROR: funzip output disagrees with unzip'; fi +# + @echo '##### testing unzipsfx (self-extractor)' + @cat unzipsfx $(TESTZIP) > testsfx + @$(CHMOD) 0700 testsfx + @./testsfx -bo notes + @if diff notes testun/notes; then true; else \ + echo '##### ERROR: unzipsfx file disagrees with unzip'; fi + @$(RM) testsfx notes testun/notes testun/notes2 + @rmdir testun +# + @echo '##### testing complete.' + + +################################ +# INDIVIDUAL MACHINE MAKERULES # +################################ + +#---------------------------------------------------------------------------- +# Generic targets (can't assume make utility groks "$(MAKE)") +#---------------------------------------------------------------------------- + +generic: unzips # first try if unknown + +generic2: unix_make # second try if unknown: hope make is called "make" + make -f unix/Makefile unzips CF="$(CF) -DBSD" + +generic3: unix_make # third try if unknown: hope make is called "make" + make -f unix/Makefile unzips CF="$(CF) -DSYSV" + +# Generic unzip and funzip target using either shared or static zlib for +# inflate rather than the original UnZip version. (libz was libgz prior +# to 0.94) Need to figure out how to force unzipsfx to use static libz. + +generic_zlib: unix_make + @echo\ + "This target assumes zlib (libz.a or libz.so.*) is already installed." + $(MAKE) unzip funzip CF="$(CF) -DUSE_ZLIB" LF2="-lz $(LF2)" + +# Generic GNU C shared library. This is an example of how to compile UnZip as +# a shared library. (Doing so as a static library would be similar.) See also +# the linux_shlib target. + +generic_shlib: unix_make + @echo\ + 'This target requires GNU C. When done, do "setenv LD_LIBRARY_PATH `pwd`"' + @echo\ + 'or similar in order to test the shared library in place (with ./unzip_shlib ,' + @echo\ + 'which is UnZip linked with the DLL). This target is an example only.' + @echo "" + $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL $(LOC)" + gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL) + $(RM) libunzip.so.0 libunzip.so + $(LN) -s libunzip.so.0.4 libunzip.so.0 + $(LN) -s libunzip.so.0 libunzip.so + gcc -c -O unzipstb.c + gcc -o unzip_shlib unzipstb.o -L. -lunzip + +#---------------------------------------------------------------------------- +# "Normal" group (BSD vs. SysV may be set in unzip.h via predefined macros): +#---------------------------------------------------------------------------- + +386i: unzips # sun386i, SunOS 4.0.2 +#3Bx: unzips # AT&T 3B2/1000-80; should work on any WE32XXX machine +#aix_rt: unzips # IBM RT 6150 under AIX 2.2.1 +bull: unzips # Bull DPX/2, BOS 2.00.45 (doesn't require -Xk switch) +convex: unzips # Convex C-120 and C-210 (-O is enough; -ext is default) +cray: unzips # Cray-2 and Y-MP, using default (possibly old) compiler +dec: unzips # DEC 5820 (MIPS RISC), test version of Ultrix v4.0 +encore: unzips # Multimax +eta: unzips # ETA-10P*, hybrid SysV with BSD 4.3 enhancements +gould: unzips # Gould PN9000 running UTX/32 2.1Bu01 +hp: unzips # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver D +hpux: unzips # (to match zip's makefile entry) +mips: unzips # MIPS M120-5(?), SysV.3 [error in sys/param.h file?] +next10: unzips # NeXT (generic; use next2x or next3x for better opt.) +osf1: unzips # DECstation, including Alpha-based; DEC OSF/1 v1.x +pyr_: unzips # [failsafe target for pyramid target below] +pyr_ucb: unzips # Pyramids running BSD universe by default (see below) +realix: unzips # Modcomp Real/IX (SysV.3); note "gcc" = GLS C, not GNU +sco: unzips # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0. +sgi: unzips # Silicon Graphics; Irix 3.3.2, 4.0.x, 5.2, etc. +stellar: unzips # gs-2000 +sun: unzips # old target; no good with solaris...use "sunos" now +sunos: unzips # no good with SunOS 3.x...use "sunos3" or "sunos4" now +sunos4: unzips # Sun 3, 4; SunOS 4.x (SOME SYSTEMS ARE SYSTEM V!) +tahoe: unzips # tahoe (CCI Power6/32), 4.3BSD +ultrix: unzips # VAXen, DEC 58x0 (MIPS guts), DECstation 2100; v4.x +vax: unzips # general-purpose VAX target (not counting VMS) + +#---------------------------------------------------------------------------- +# BSD group (for timezone structs [struct timeb]): +#---------------------------------------------------------------------------- + +bsd: _bsd # generic BSD (BSD 4.2 & Ultrix handled in unzip.h) + +_bsd: unix_make + $(MAKE) unzips CF="$(CF) -DBSD" + +#---------------------------------------------------------------------------- +# SysV group (for extern long timezone and ioctl.h instead of sgtty.h): +#---------------------------------------------------------------------------- + +aix_rt: _sysv # IBM RT 6150 under AIX 2.2.1 +aviion: _sysv # Data General AViiONs, DG/UX 4.3x +pyr_att: _sysv # Pyramids running AT&T (SysV) universe by default +solaris: _sysv # Sun SPARC & x86, Solaris 2.x +solaris_pkg: _sysvp # Sun SPARC & x86, Solaris 2.x; make package when done +stardent: _sysv # Stardent ... +sysv: _sysv # generic System V Unix (Xenix handled in unzip.h) +xos: _sysv # Olivetti LSX-3005..3045, X/OS 2.3 and 2.4 + +_sysv: unix_make + $(MAKE) unzips CF="$(CF) -DSYSV" + +# extension to perform SVR4 package-creation after compilation +_sysvp: _sysv svr4package + +#---------------------------------------------------------------------------- +# Version 7 group (old/obsolescent): +#---------------------------------------------------------------------------- + +pixel: _v7 # Pixel 80, 100 (68000-based, V7/mostly BSD4.1 compat.) +v7: _v7 # generic Unix Version 7 box (prob. only Pixel...) + +_v7: + make -f unix/Makefile unzips \ + CF="$(CF) -DV7 -DNO_PARAM_H -DSHORT_NAMES -DBSD -DZMEM" + +#---------------------------------------------------------------------------- +# "Unique" group (require non-standard options): +#---------------------------------------------------------------------------- + +# AT&T 3B2/1000-80; should work on any WE32XXX machine +3Bx: unix_make + $(MAKE) unzips CF="$(CF) -DCBREAK=2" + +# AT&T 7300 (M68000/SysV.3) (add -DSYSV? -DNO_LIMITS?) +7300: unix_make + $(MAKE) unzips CF="$(CF) -DNO_DIR -DNO_MKDIR -DNO_STRNICMP -DNO_UID_GID -DCBREAK=2" + +7300_gcc: unix_make + $(MAKE) unzips CC=gcc LD=gcc LF2="" \ + CF="-O2 -I. -DNO_DIR -DNO_MKDIR -DNO_STDLIB_H -DNO_STRNICMP -DNO_UID_GID -DCBREAK=2 $(LOC)" + $(STRIP) $(UNZIPS) + +# IBM AIX 3.x on an RS/6000: see rs6000 target below +aix: rs6000 + +# Amdahl (IBMish) mainframe, UTS (SysV) 1.2.4, 2.0.1, 3.x +amdahl: unix_make + $(MAKE) unzips CF="$(CF) -DSYSV -DNO_UID_GID" + +# Amdahl UTS 2.1.4 with "extended file types" filesystem (aarrrggghhhh...) +amdahl_eft: unix_make + $(MAKE) unzips CF="$(CF) -eft -DSYSV -DNO_UID_GID" + +# Apollo Domain/OS machines (added -D...SOURCE options) [Gordon Fox, 960810] +apollo: unix_make + $(MAKE) unzips CF="$(CF) -D_INCLUDE_BSD_SOURCE -D_INCLUDE_XOPEN_SOURCE" + +# BSDI BSD/OS on 386 platform, using the assembler replacement for crc32.c +bsdi: unix_make + @echo 'NOTE: use bsdi_noasm target for non-Intel BSD/OS compiles.' + $(MAKE) unzips CC=gcc2 LD=shlicc2 AS=gcc2\ + CF="-O3 -Wall -I. -DASM_CRC -DBSD $(LOC)" CRC32=crc_gcc + +# BSDI BSD/OS +bsdi_noasm: unix_make +# @echo 'NOTE: use bsd target for non-Intel BSD/OS compiles.' + $(MAKE) unzips CC=gcc2 LD=shlicc2 AS=gcc2\ + CF="-O3 -Wall -I. -DBSD $(LOC)" + +# Coherent 3.x/4.x, Mark Williams C. ``For Coherent's CC, it needs either +# -T0 or -T150000 (or bigger) added to the CFLAGS, otherwise the compiler +# runs out of memory and dies in zipinfo.c.'' [Fred "Fredex" Smith, 940719] +coherent: unix_make + $(MAKE) unzips CF="$(CF) -T0" + +# Cray-2, Y-MP or C90, running Unicos 5.x to 8.x (SysV + BSD enhancements) +# and Standard (ANSI) C compiler 3.0 or later. +cray_opt: unix_make + $(MAKE) unzips CF="$(CF) -h scalar3 -h vector3" + +# The unzip41 build on a Cyber 910/SGI running Irix v3.3.3 was successful +# with the following change to Makefile: +cyber_sgi: unix_make + $(MAKE) unzips CF="$(CF) -I/usr/include/bsd"\ + LF="-lbsd $(LF)" SL="-lbsd $(SL)" + +# 680x0, DIAB dnix 5.2/5.3 (a Swedish System V clone) +# +# Options for the dnix cc: +# -X7 = cc is strict ANSI C +# -X9 = warnings if a function is used without a declaration +# +dnix: unix_make + $(MAKE) unzips CF="$(CF) -X7 -X9 -DDNIX" + +# FreeBSD on Intel: +freebsd: unix_make + @echo 'NOTE: use bsd target for non-Intel FreeBSD compiles (if any).' + $(MAKE) unzips CC=gcc LD=gcc AS=gcc\ + CF="-O3 -Wall -I. -DASM_CRC -DBSD $(LOC)"\ + AF="-Di386 $(AF)" CRC32=crc_gcc + +# Generic BSDish Unix gcc. ``The -O3 only works with later versions of gcc; +# you may have to use -O2 or -O for earlier versions. I have no idea why +# -s causes this bug in gcc.'' [Bug: "nm: unzip: no name list", "collect: +# /usr/bin/nm returned 1 exit status".] If you don't have strip, don't +# worry about it (it just makes the executable smaller and can be replaced +# with "echo" instead). +# +gcc: unix_make + $(MAKE) unzips CC=gcc LD=gcc CF="-O3 -I. $(LOC)" LF2="" + $(STRIP) $(UNZIPS) + +# Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000 +hk68: unix_make + $(MAKE) unzips CC="gcc" LD="gcc"\ + LF="-n $(LF)" SL="-n $(SL)" FL="-n $(FL)"\ + CF="-ga -X138 -I. $(LOC) -Dlocaltime=localti -Dtimezone=timezon" + +# ISC Unix on 386 platform +isc: unix_make + $(MAKE) unzips LF2="-lc_s $(LF2)" CRC32=crc_sysv \ + CF="-O -I. -DASM_CRC -DSYSV -DNO_UID_GID -DNEED_PTEM $(LOC)" \ + AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)" + +isc_gcc: unix_make + $(MAKE) unzips AS=gcc CC=gcc LD=gcc CRC32=crc_gcc LF="-shlib $(LF)" \ + SL="-shlib $(SL)" FL="-shlib $(FL)" \ + LF2="" CF="-O3 -I. -DSYSV -DASM_CRC -DNO_UID_GID -DNEED_PTEM $(LOC)" \ + AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)" + $(STRIP) $(UNZIPS) + +# "ISI machine (68025 CPU)" (based on e-mail from Rob White ; +# no further information). May also need DIRENT defined. +isi: unix_make + $(MAKE) unzips CF="$(CF) -DDECLARE_ERRNO" + +# Linux on 386 platform, using the assembler replacement for crc32.c. (-O4 and +# -fno-strength-reduce have virtually no effect beyond -O3. Add "-m486 +# -malign-functions=2 -malign-jumps=2 -malign-loops=2" for Pentium [Pro] +# systems.) +linux: unix_make + @echo 'NOTE: use linux_noasm target for non-Intel Linux compiles.' + $(MAKE) unzips CC=gcc LD=gcc AS=gcc\ + CF="-O3 -Wall -I. -DASM_CRC $(LOC)"\ + AF="-Di386 $(AF)" CRC32=crc_gcc +# GRR: this echo is pointless; if user gets this far, no difference to install +# @echo 'Be sure to use the install_asm target rather than the install target' + +linux_asm: linux + +# Linux (Posix, approximately SysV): virtually any version since before 0.96, +# for any platform. Change "-O" to "-O3" or whatever, as desired... +linux_noasm: unix_make + $(MAKE) unzips CC=gcc LD=gcc CF="-O -Wall -I. $(LOC)" + +# Linux with lcc compiler: __inline__ (stat.h) not recognized, and must edit +# /usr/include/gnu/types.h to get rid of "long long" if __LCC__ defined. -O3 +# (or -O2 or -O) is ignored. [GRR 960828: test target only] +# +linux_lcc: unix_make + $(MAKE) unzips CC=lcc LD=lcc CF="-O3 -Wall -I. -D__inline__= $(LOC)" + +# Linux host with go32 (djgpp) cross-compiler (go32crs.tgz) for 32-bit DOS. +linux_dos: unix_make + $(MAKE) unzips CC=go32gcc LD=go32gcc M=msdos CF="-O2 -Wall -I. $(LOC)" +# go32-strip unzip +# Due to limitations of the cross-compiling package, this has to be +# done manually: + @echo Copy $(UNZIPS) to your DOS partition and use coff2exe. + +# Linux ELF shared library (ooo, it's so easy). This is a test target for +# now, and it only makes the UnZip/ZipInfo stuff (not fUnZip or UnZipSFX). +# The version number may eventually change to match the UnZip version. Or +# not. Whatever. Also do "setenv LD_LIBRARY_PATH `pwd`" or similar to test +# the DLL in place (with unzip_shlib, which is UnZip linked with the shared +# library). +# +linux_shlib: unix_make +# $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL $(LOC)" + $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL -DASM_CRC $(LOC)"\ + AS=gcc AF="-fPIC -Di386 $(AF)" CRC32=crc_gcc + ln -sf crc_gcc.pic.o crc32.pic.o + gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL) + ln -sf libunzip.so.0.4 libunzip.so.0 + ln -sf libunzip.so.0 libunzip.so + gcc -c -O unzipstb.c + gcc -o unzip_shlib unzipstb.o -L. -lunzip + +# Linux ELF shared library, as above, but using inflate() from zlib (libz.so) +# instead of the original UnZip version. (libz was libgz prior to 0.94) +linux_shlibz: unix_make +# $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL -DUSE_ZLIB $(LOC)" + $(MAKE) objsdll CC=gcc AS=gcc AF="-fPIC -Di386 $(AF)" CRC32=crc_gcc\ + CF="-O3 -Wall -I. -fPIC -DDLL -DUSE_ZLIB -DASM_CRC $(LOC)" + ln -sf crc_gcc.pic.o crc32.pic.o + gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL) + ln -sf libunzip.so.0.4 libunzip.so.0 + gcc -c -O unzipstb.c + gcc -o unzip unzipstb.o -L. -lunzip -lz + +# LynxOS-x86 2.3.0 and newer, a real-time BSD-like OS; uses gcc. +lynx: unix_make + $(MAKE) unzips CC=gcc CF="$(CF) -DLynx -DLYNX -DBSD -DUNIX" + +# Macintosh MacOS X (Unix-compatible enviroment), using standard compiler +macosx: unix_make + $(MAKE) unzips CF="-O3 -Wall -I. -DBSD -DUNIX $(LOC)" LF2="" + $(STRIP) $(UNZIPS) + +# Macintosh MacOS X (Unix-compatible enviroment), using gcc +macosx_gcc: unix_make + $(MAKE) unzips CC=gcc CF="-O3 -Wall -I. -DBSD -DUNIX $(LOC)" LF2="" + $(STRIP) $(UNZIPS) + +# Minix 1.5 PC for the 386. Invoke as is to use default cc, or as "make +# minix CC=gcc" to use gcc. Try "make linux" if you have a working termios.h. +minix: unix_make + $(MAKE) unzips CF="$(CF) -DMINIX -DSHORT_NAMES" CC=$(CC) LD=$(CC) + +# MPE/iX, the Unix variant for HP 3000 systems. +mpeix: unix_make + $(MAKE) unzips CC=c89\ + CF="$(CF) -DUNIX -D_POSIX_SOURCE -DHAVE_TERMIOS_H -DPASSWD_FROM_STDIN -DNO_PARAM_H"\ + LF2=-lbsd CP=cp LN="ln -s" + +# NeXT info. +next: + @echo + @echo\ + ' Please pick a specific NeXT target: "make next10" will create a generic' + @echo\ + ' NeXT executable; "make next2x" will create a smaller executable (for' + @echo\ + ' NeXTstep 2.0 and higher); "make next3x" will create a small executable' + @echo\ + ' with significantly better optimization (NeXTstep 3.0 and higher only);' + @echo\ + ' "make nextfat" will create a fat, multi-architecture (NeXT plus Intel)' + @echo\ + ' executable (NeXTstep 3.1 and higher only).' + @echo + +# 68030 BSD 4.3+Mach. NeXT 2.x: make the executable smaller. +next2x: unix_make + $(MAKE) unzips LF2="-object -s" + +# NeXT 3.x: as above, plus better optimization. +next3x: unix_make + $(MAKE) unzips CF="-O2 -I. $(LOC)" LF2="-object -s" + +# NeXT 3.1+: make the executable fat (multi-architecture binary [MAB], +# for "black" [NeXT] and "white" [x86] hardware, so far). +nextfat: unix_make + $(MAKE) unzips CF="-O2 -I. $(LOC) -arch i386 -arch m68k" \ + LF2="-arch i386 -arch m68k -object -s" + +# IBM OS/390 (formerly MVS) compiled under "OpenEdition" shell +os390: unix_make + set -x; \ + $(MAKE) -f unix/Makefile unzips \ + CC=c89 LD="\$$(CC) -Wl,EDIT=NO" \ + CF="$(CF) -DSYSV -DUNIX -DOS390 -DEBCDIC -DNO_PARAM_H \ + -D_ALL_SOURCE $(HOST_VERSINFO)" LF2="" + +# Sequent Symmetry running Dynix/ptx (sort of SysV.3): needs to link +# with libseq to get symlink(). +ptx: unix_make + $(MAKE) unzips CF="$(CF) -DSYSV -DTERMIO -DPTX" LF2="$(LF2) -lseq" + +# Pyramid 90X (probably all) under >= OSx4.1, either universe. (This is an +# experimental target! If it fails, use either pyr_ucb or pyr_att instead.) +# The make in the BSD half is too stupid to understand $(MAKE), sigh... +pyramid: unix_make + -make -f unix/Makefile pyr_`universe` + +# QNX/Neutrino is "special" because you don't have any native development +# tools yet. Set ARCH to "x86", "ppcbe", "ppcle", "mipsbe", or "mipsle" +# to produce x86, PowerPC (big- or little-endian) and MIPS (big- +# or little-endian) using gcc. [cjh] +qnxnto: unix_make + @if [ "$(ARCH)" = "" ] ; then \ + echo "You didn't set ARCH; I'll assume you meant ARCH=x86..." ; \ + echo "" ; \ + $(MAKE) -f unix/Makefile CC="qcc -Vgcc_ntox86" unzips ; \ + else \ + echo "Making unzip for $(ARCH)..." ; \ + echo "" ; \ + $(MAKE) -f unix/Makefile CC="qcc -Vgcc_nto$(ARCH)" unzips ; \ + fi + +# REGULUS: 68040-based, "real-time" SysV.3 mutant; uses gcc, with "REGULUS" +# predefined. +regulus: unix_make + $(MAKE) unzips CF="$(CF) -traditional -DSYSV -DNO_MKDIR" + +# IBM RS/6000 under AIX 3.2 +rs6000: unix_make + $(MAKE) unzips CF="$(CF) -DBSD -D_BSD -DUNIX" LF2="-lbsd" + +# SCO cross compile from Unix to DOS. Tested with Xenix/386 and OpenDeskTop. +# Should work with Xenix/286 as well. (davidsen) Note that you *must* remove +# the Unix objects and executable before doing this! (Piet Plomp: gcc won't +# recognize the -M0 flag that forces 8086 code.) (GRR: may need to reduce +# stack to 0c00h if using 286/small-model code...?) +sco_dos: unix_make + $(MAKE) unzips CF="-O -I. $(LOC) -dos -M0" M=msdos \ + LF="-dos -F 2000" LF2="-o unzip.exe" \ + FL="-dos" FL2="-o funzip.exe" SL="-dos" SL2="-o unzipsfx.exe" + +# SCO UNIX with shared libraries and no international support. If you are +# not using a USA-style keyboard and display, you may want to remove -nointl +# to get support. It adds quite a bit to the size of the executable. +sco_sl: unix_make + $(MAKE) unzips LF="$(LF) -nointl" LF2="$(LF2) -lc_s"\ + SL="$(SL) -nointl" FL="$(FL) -nointl" + +# SCO Xenix/286 2.2.3 or later with development system 2.2.1 or later +sco_x286: unix_make + $(MAKE) unzips CF="$(CF) -Mel2 -LARGE -DNO_MKDIR" \ + LF="$(LF) -Mel2 -LARGE -lx" SL="$(SL) -Mel2 -LARGE" \ + FL="$(FL) -Mel2 -LARGE" + +# Sequent Symmetry with Dynix. (386, but needs -DZMEM) +# This should also work on Balance but I can't test it just yet. +sequent: unix_make + $(MAKE) unzips CF="$(CF) -DBSD -DZMEM" + +# Sun 2, 3, 4 running SunOS 3.x +sunos3: unix_make + $(MAKE) unzips CF="$(CF) -DNO_UID_GID -DUID_USHORT" + +# Generic System V + GNU C +sysv_gcc: unix_make + $(MAKE) unzips CC=gcc LD=gcc CF="-O2 -I. -DSYSV $(LOC)" LF2="" + $(STRIP) $(UNZIPS) + +# AT&T 6300+, System V.2 Unix: run-time out-of-memory error if don't use -Ml; +# also compile-time error if work arrays dimensioned at HSIZE+2 (>32K) +sysv6300: unix_make + $(MAKE) unzips CF="$(CF) -Ml -DSYSV" LF="$(LF) -Ml"\ + SL="$(SL) -Ml" FL="$(FL) -Ml" + +# Texas Instruments System V.3 (running on HP 9000-1500) +ti_sysv: unix_make + $(MAKE) unzips CF="$(CF) -DSYSV -DNO_UID_GID -DUID_USHORT" + +# SCO Xenix (Joe Foster 950508: "unzip needs to be linked with -lx [for the +# opendir(), readdir(), telldir(), rewinddir(), and closedir() calls]") +xenix: unix_make + $(MAKE) unzips LF2="$(LF2) -lx" + +# Wombat 68000 (or whatever). +# I didn't do this. I swear. No, really. +wombat: unix_make + @echo + @echo ' Ha ha! Just kidding.' + @echo diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/pkginfo.in boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/pkginfo.in --- boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/pkginfo.in 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/pkginfo.in 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,13 @@ +PKG=IZunzip +NAME=Info-ZIP UnZip Utilities +CATEGORY=application +VENDOR=Info-ZIP +EMAIL=Zip-Bugs@lists.wku.edu +HOTLINE=Zip-Bugs@lists.wku.edu +DESC=Copyrighted FREEWARE. See README, WHERE, and LICENSE docs in pkg's doc dir. +CLASSES=none +BASEDIR=/opt/Info-ZIP +#BASEDIR=/usr/local +VERSION=".VERSION." +PSTAMP=".PSTAMP." +ARCH=".ARCH." diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/postinstall boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/postinstall --- boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/postinstall 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/postinstall 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Post installation script (simply inform installer about PATH etc) +# +echo " " +echo " " +echo "Installation is complete. Now, you should add the following" +echo "(or equivalnet) commands to the appropriate initial user shell" +echo "scripts (such as .profile, .login, etc) -- " +echo " " +echo " For korn or bourne shell:" +echo " PATH=\${PATH}:${BASEDIR}/${PKG}/bin" +echo " MANPATH=\${MANPATH}:${BASEDIR}/${PKG}/man" +echo " export PATH MANPATH" +echo " " +echo " For C shell:" +echo " set path=(\$path ${BASEDIR}/${PKG}/bin)" +echo " setenv MANPATH \$MANPATH:${BASEDIR}/${PKG}/man" +echo " " +echo " See the files under ${BASEDIR}/${PKG}/doc for more information." +echo " " +exit 0 diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/preinstall.in boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/preinstall.in --- boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/preinstall.in 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/preinstall.in 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/sh +echo " " +echo "REPORT ALL BUGS, PROBLEMS, AND ACCOLADES TO:" +echo " " +echo " Zip-Bugs@lists.wku.edu" +echo " " +echo "Checking architecture platform for .ARCH. ..." +arch=`uname -p` +if [ "arch_${arch}" != "arch_.ARCH." ]; then + echo " " + echo "This product MUST be installed on a Solaris .ARCH. platform." + echo "Your machine looks like it is a ${arch} platform." + echo "Please install the version for the .ARCH. architecture." + echo "Aborting the installation because of this. " + echo " " + returncode=1 + else + echo " " + echo "This product works on .ARCH., which you happen to have!" + echo " " + returncode=0 +fi +echo " " +/usr/bin/sleep 4 +exit ${returncode:-1} +# diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/prototype boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/prototype --- boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/prototype 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/prototype 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,32 @@ +d none $BASEDIR 0755 root bin +d none $BASEDIR/$PKG 0755 root bin +d none $PKG/bin 0755 root bin +f none $PKG/bin/unzip=unzip 0755 root bin +f none $PKG/bin/funzip=funzip 0755 root bin +f none $PKG/bin/unzipsfx=unzipsfx 0755 root bin +f none $PKG/bin/zipgrep=unix/zipgrep 0755 root bin +s none $PKG/bin/zipinfo=unzip +d none $PKG/doc 0755 root bin +f none $PKG/doc/ZipPorts=proginfo/ZipPorts 0644 root bin +f none $PKG/doc/CONTRIBS=proginfo/CONTRIBS 0644 root bin +f none $PKG/doc/COPYING=COPYING 0644 root bin +f none $PKG/doc/README=README 0644 root bin +f none $PKG/doc/WHERE=WHERE 0644 root bin +f none $PKG/doc/INSTALL=INSTALL 0644 root bin +f none $PKG/doc/funzip.txt=funzip.txt 0644 root bin +f none $PKG/doc/unzip.txt=unzip.txt 0644 root bin +f none $PKG/doc/unzipsfx.txt=unzipsfx.txt 0644 root bin +f none $PKG/doc/zipgrep.txt=zipgrep.txt 0644 root bin +f none $PKG/doc/zipinfo.txt=zipinfo.txt 0644 root bin +d none $PKG/man 0755 root bin +d none $PKG/man/man1 0755 root bin +f none $PKG/man/man1/funzip.1=man/funzip.1 0644 root bin +f none $PKG/man/man1/unzip.1=man/unzip.1 0644 root bin +f none $PKG/man/man1/unzipsfx.1=man/unzipsfx.1 0644 root bin +f none $PKG/man/man1/zipgrep.1=man/zipgrep.1 0644 root bin +f none $PKG/man/man1/zipinfo.1=man/zipinfo.1 0644 root bin +i pkginfo +i prototype +i README +i preinstall +i postinstall diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/README boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/README --- boinc-7.0.7+dfsg/zip/unzip/unix/Packaging/README 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/Packaging/README 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,44 @@ +Solaris packaging +----------------- + +To generate a Solaris package for Info-ZIP UnZip utilities, +first see the top level INSTALL and README files. Do a +"make solaris", which will automatically build two Solaris +installable package files for the package, IZunzip. + + IZunzip -- Solaris installable package in directory format. + IZunzip_$(arch).pkg -- Solaris installable package in "stream" format. + + Where: $(arch) := system architecture, currently i386, sparc, or ppc. + (use "uname -p" to determine) + +The ".pkg" file is a single file datastream that can be compressed +and/or ftp'd. This is the recommended form, because all required +files are resident in the archive, and it is easily distributed. + +To install, simply: + + 1) copy the package to the target system's /tmp directory. + 2) login or su to root + 3) pkgadd -d /tmp/IZunzip_$(arch).pkg + 4) add /opt/Info-ZIP/IZunzip/bin to PATH + 5) add /opt/Info-ZIP/IZunzip/man to MANPATH + +This works for both SPARC and x86. + +Ongoing maintenance: + + Keep the files, "prototype" and "pkginfo.in" up to date. + Observe variable substitutions made by "Makefile". + See manpages for pkginfo(1), pkginfo(4), pkgmk(1), pkgproto(1) + +Variations: + + If you wish the base directory to be set to something other than + /opt/Info-ZIP, change the setting BASEDIR in pkginfo.in and + re-run the make. + + +-John Bush (John.Bush@East.Sun.COM) + July 20, 1996 + diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/unix.c boinc-7.0.14+dfsg/zip/unzip/unix/unix.c --- boinc-7.0.7+dfsg/zip/unzip/unix/unix.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/unix.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1530 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unix.c + + Unix-specific routines for use with Info-ZIP's UnZip 5.41 and later. + + Contains: readdir() + do_wild() <-- generic enough to put in fileio.c? + mapattr() + mapname() + checkdir() + mkdir() + close_outfile() + set_direc_attribs() + stamp_file() + version() + + ---------------------------------------------------------------------------*/ + +#ifndef _WIN32 +#define UNZIP_INTERNAL +#include "unzip.h" + +#ifdef SCO_XENIX +# define SYSNDIR +#else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */ +# if defined(__convexc__) || defined(SYSV) || defined(CRAY) || defined(BSD4_4) || defined(__HAIKU__) +# define DIRENT +# endif +#endif +#if defined(_AIX) || defined(__mpexl) +# define DIRENT +#endif +#ifdef COHERENT +# if defined(_I386) || (defined(__COHERENT__) && (__COHERENT__ >= 0x420)) +# define DIRENT +# endif +#endif + +/* GRR: may need to uncomment this: */ +#if 0 +#if defined(_POSIX_VERSION) +# define DIRENT +#endif +#endif + +#ifdef DIRENT +# include +#else +# ifdef SYSV +# ifdef SYSNDIR +# include +# else +# include +# endif +# else /* !SYSV */ +# ifndef NO_SYSDIR +# include +# endif +# endif /* ?SYSV */ +# ifndef dirent +# define dirent direct +# endif +#endif /* ?DIRENT */ + +#ifdef ACORN_FTYPE_NFS +/* Acorn bits for NFS filetyping */ +typedef struct { + uch ID[2]; + uch size[2]; + uch ID_2[4]; + uch loadaddr[4]; + uch execaddr[4]; + uch attr[4]; +} RO_extra_block; + +#endif /* ACORN_FTYPE_NFS */ + +/* static int created_dir; */ /* used in mapname(), checkdir() */ +/* static int renamed_fullpath; */ /* ditto */ + + +#ifndef SFX +#ifdef NO_DIR /* for AT&T 3B1 */ + +#define opendir(path) fopen(path,"r") +#define closedir(dir) fclose(dir) +typedef FILE DIR; +typedef struct zdir { + FILE *dirhandle; + struct dirent *entry; +} DIR +DIR *opendir OF((ZCONST char *dirspec)); +void closedir OF((DIR *dirp)); +struct dirent *readdir OF((DIR *dirp)); + +DIR *opendir(dirspec) + ZCONST char *dirspec; +{ + DIR *dirp; + + if ((dirp = malloc(sizeof(DIR)) != NULL) { + if ((dirp->dirhandle = fopen(dirspec, "r")) == NULL) { + free(dirp); + dirp = NULL; + } + } + return dirp; +} + +void closedir(dirp) + DIR *dirp; +{ + fclose(dirp->dirhandle); + free(dirp); +} + +/* + * Apparently originally by Rich Salz. + * Cleaned up and modified by James W. Birdsall. + */ +struct dirent *readdir(dirp) + DIR *dirp; +{ + + if (dirp == NULL) + return NULL; + + for (;;) + if (fread(&(dirp->entry), sizeof (struct dirent), 1, + dirp->dirhandle) == 0) + return (struct dirent *)NULL; + else if ((dirp->entry).d_ino) + return &(dirp->entry); + +} /* end function readdir() */ + +#endif /* NO_DIR */ + + +/**********************/ +/* Function do_wild() */ /* for porting: dir separator; match(ignore_case) */ +/**********************/ + +char *do_wild(__G__ wildspec) + __GDEF + ZCONST char *wildspec; /* only used first time on a given dir */ +{ +/* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in unxcfg.h: + static DIR *wild_dir = (DIR *)NULL; + static ZCONST char *wildname; + static char *dirname, matchname[FILNAMSIZ]; + static int notfirstcall=FALSE, have_dirname, dirnamelen; +*/ + struct dirent *file; + + /* Even when we're just returning wildspec, we *always* do so in + * matchname[]--calling routine is allowed to append four characters + * to the returned string, and wildspec may be a pointer to argv[]. + */ + if (!G.notfirstcall) { /* first call: must initialize everything */ + G.notfirstcall = TRUE; + + if (!iswild(wildspec)) { + strcpy(G.matchname, wildspec); + G.have_dirname = FALSE; + G.wild_dir = NULL; + return G.matchname; + } + + /* break the wildspec into a directory part and a wildcard filename */ + if ((G.wildname = (ZCONST char *)strrchr(wildspec, '/')) == NULL) { + G.dirname = "."; + G.dirnamelen = 1; + G.have_dirname = FALSE; + G.wildname = wildspec; + } else { + ++G.wildname; /* point at character after '/' */ + G.dirnamelen = G.wildname - wildspec; + if ((G.dirname = (char *)malloc(G.dirnamelen+1)) == (char *)NULL) { + Info(slide, 0x201, ((char *)slide, + "warning: cannot allocate wildcard buffers\n")); + strcpy(G.matchname, wildspec); + return G.matchname; /* but maybe filespec was not a wildcard */ + } + strncpy(G.dirname, wildspec, G.dirnamelen); + G.dirname[G.dirnamelen] = '\0'; /* terminate for strcpy below */ + G.have_dirname = TRUE; + } + + if ((G.wild_dir = (zvoid *)opendir(G.dirname)) != (zvoid *)NULL) { + while ((file = readdir((DIR *)G.wild_dir)) != + (struct dirent *)NULL) { + Trace((stderr, "do_wild: readdir returns %s\n", + FnFilter1(file->d_name))); + if (file->d_name[0] == '.' && G.wildname[0] != '.') + continue; /* Unix: '*' and '?' do not match leading dot */ + if (match(file->d_name, G.wildname, 0) && /* 0 == case sens. */ + /* skip "." and ".." directory entries */ + strcmp(file->d_name, ".") && strcmp(file->d_name, "..")) { + Trace((stderr, "do_wild: match() succeeds\n")); + if (G.have_dirname) { + strcpy(G.matchname, G.dirname); + strcpy(G.matchname+G.dirnamelen, file->d_name); + } else + strcpy(G.matchname, file->d_name); + return G.matchname; + } + } + /* if we get to here directory is exhausted, so close it */ + closedir((DIR *)G.wild_dir); + G.wild_dir = (zvoid *)NULL; + } + Trace((stderr, "do_wild: opendir(%s) returns NULL\n", + FnFilter1(G.dirname))); + + /* return the raw wildspec in case that works (e.g., directory not + * searchable, but filespec was not wild and file is readable) */ + strcpy(G.matchname, wildspec); + return G.matchname; + } + + /* last time through, might have failed opendir but returned raw wildspec */ + if ((DIR *)G.wild_dir == (DIR *)NULL) { + G.notfirstcall = FALSE; /* nothing left--reset for new wildspec */ + if (G.have_dirname) + free(G.dirname); + return (char *)NULL; + } + + /* If we've gotten this far, we've read and matched at least one entry + * successfully (in a previous call), so dirname has been copied into + * matchname already. + */ + while ((file = readdir((DIR *)G.wild_dir)) != (struct dirent *)NULL) { + Trace((stderr, "do_wild: readdir returns %s\n", + FnFilter1(file->d_name))); + if (file->d_name[0] == '.' && G.wildname[0] != '.') + continue; /* Unix: '*' and '?' do not match leading dot */ + if (match(file->d_name, G.wildname, 0)) { /* 0 == don't ignore case */ + Trace((stderr, "do_wild: match() succeeds\n")); + if (G.have_dirname) { + /* strcpy(G.matchname, G.dirname); */ + strcpy(G.matchname+G.dirnamelen, file->d_name); + } else + strcpy(G.matchname, file->d_name); + return G.matchname; + } + } + + closedir((DIR *)G.wild_dir); /* at least one entry read; nothing left */ + G.wild_dir = (zvoid *)NULL; + G.notfirstcall = FALSE; /* reset for new wildspec */ + if (G.have_dirname) + free(G.dirname); + return (char *)NULL; + +} /* end function do_wild() */ + +#endif /* !SFX */ + + + + + +/**********************/ +/* Function mapattr() */ +/**********************/ + +int mapattr(__G) + __GDEF +{ + ulg tmp = G.crec.external_file_attributes; + + G.pInfo->file_attr = 0; + /* initialized to 0 for check in "default" branch below... */ + + switch (G.pInfo->hostnum) { + case AMIGA_: + tmp = (unsigned)(tmp>>17 & 7); /* Amiga RWE bits */ + G.pInfo->file_attr = (unsigned)(tmp<<6 | tmp<<3 | tmp); + break; + case THEOS_: + tmp &= 0xF1FFFFFFL; + if ((tmp & 0xF0000000L) != 0x40000000L) + tmp &= 0x01FFFFFFL; /* not a dir, mask all ftype bits */ + else + tmp &= 0x41FFFFFFL; /* leave directory bit as set */ + /* fall through! */ + case UNIX_: + case VMS_: + case ACORN_: + case ATARI_: + case BEOS_: + case QDOS_: + case TANDEM_: + G.pInfo->file_attr = (unsigned)(tmp >> 16); + if (G.pInfo->file_attr != 0 || !G.extra_field) { + return 0; + } else { + /* Some (non-Info-ZIP) implementations of Zip for Unix and + * VMS (and probably others ??) leave 0 in the upper 16-bit + * part of the external_file_attributes field. Instead, they + * store file permission attributes in some extra field. + * As a work-around, we search for the presence of one of + * these extra fields and fall back to the MSDOS compatible + * part of external_file_attributes if one of the known + * e.f. types has been detected. + * Later, we might implement extraction of the permission + * bits from the VMS extra field. But for now, the work-around + * should be sufficient to provide "readable" extracted files. + * (For ASI Unix e.f., an experimental remap from the e.f. + * mode value IS already provided!) + */ + ush ebID; + unsigned ebLen; + uch *ef = G.extra_field; + unsigned ef_len = G.crec.extra_field_length; + int r = FALSE; + + while (!r && ef_len >= EB_HEADSIZE) { + ebID = makeword(ef); + ebLen = (unsigned)makeword(ef+EB_LEN); + if (ebLen > (ef_len - EB_HEADSIZE)) + /* discoverd some e.f. inconsistency! */ + break; + switch (ebID) { + case EF_ASIUNIX: + if (ebLen >= (EB_ASI_MODE+2)) { + G.pInfo->file_attr = + (unsigned)makeword(ef+(EB_HEADSIZE+EB_ASI_MODE)); + /* force stop of loop: */ + ef_len = (ebLen + EB_HEADSIZE); + break; + } + /* else: fall through! */ + case EF_PKVMS: + /* "found nondecypherable e.f. with perm. attr" */ + r = TRUE; + default: + break; + } + ef_len -= (ebLen + EB_HEADSIZE); + ef += (ebLen + EB_HEADSIZE); + } + if (!r) + return 0; + } + /* fall through! */ + /* all remaining cases: expand MSDOS read-only bit into write perms */ + case FS_FAT_: + /* PKWARE's PKZip for Unix marks entries as FS_FAT_, but stores the + * Unix attributes in the upper 16 bits of the external attributes + * field, just like Info-ZIP's Zip for Unix. We try to use that + * value, after a check for consistency with the MSDOS attribute + * bits (see below). + */ + G.pInfo->file_attr = (unsigned)(tmp >> 16); + /* fall through! */ + case FS_HPFS_: + case FS_NTFS_: + case MAC_: + case TOPS20_: + default: + /* Ensure that DOS subdir bit is set when the entry's name ends + * in a '/'. Some third-party Zip programs fail to set the subdir + * bit for directory entries. + */ + if ((tmp & 0x10) == 0) { + extent fnlen = strlen(G.filename); + if (fnlen > 0 && G.filename[fnlen-1] == '/') + tmp |= 0x10; + } + /* read-only bit --> write perms; subdir bit --> dir exec bit */ + tmp = !(tmp & 1) << 1 | (tmp & 0x10) >> 4; + if ((G.pInfo->file_attr & 0700) == (unsigned)(0400 | tmp<<6)) + /* keep previous G.pInfo->file_attr setting, when its "owner" + * part appears to be consistent with DOS attribute flags! + */ + return 0; + G.pInfo->file_attr = (unsigned)(0444 | tmp<<6 | tmp<<3 | tmp); + break; + } /* end switch (host-OS-created-by) */ + + /* for originating systems with no concept of "group," "other," "system": */ + umask( (int)(tmp=umask(0)) ); /* apply mask to expanded r/w(/x) perms */ + G.pInfo->file_attr &= ~tmp; + + return 0; + +} /* end function mapattr() */ + + + + + +/************************/ +/* Function mapname() */ +/************************/ + +int mapname(__G__ renamed) + __GDEF + int renamed; +/* + * returns: + * MPN_OK - no problem detected + * MPN_INF_TRUNC - caution (truncated filename) + * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) + * MPN_ERR_SKIP - error -> skip entry + * MPN_ERR_TOOLONG - error -> path is too long + * MPN_NOMEM - error (memory allocation failed) -> skip entry + * [also MPN_VOL_LABEL, MPN_CREATED_DIR] + */ +{ + char pathcomp[FILNAMSIZ]; /* path-component buffer */ + char *pp, *cp=(char *)NULL; /* character pointers */ + char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */ +#ifdef ACORN_FTYPE_NFS + char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ + RO_extra_block *ef_spark; /* pointer Acorn FTYPE ef block */ +#endif + int quote = FALSE; /* flags */ + int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ + int error = MPN_OK; + register unsigned workch; /* hold the character being tested */ + + +/*--------------------------------------------------------------------------- + Initialize various pointers and counters and stuff. + ---------------------------------------------------------------------------*/ + + if (G.pInfo->vollabel) + return MPN_VOL_LABEL; /* can't set disk volume labels in Unix */ + + /* can create path as long as not just freshening, or if user told us */ + G.create_dirs = (!uO.fflag || renamed); + + G.created_dir = FALSE; /* not yet */ + + /* user gave full pathname: don't prepend rootpath */ + G.renamed_fullpath = (renamed && (*G.filename == '/')); + + if (checkdir(__G__ (char *)NULL, INIT) == MPN_NOMEM) + return MPN_NOMEM; /* initialize path buffer, unless no memory */ + + *pathcomp = '\0'; /* initialize translation buffer */ + pp = pathcomp; /* point to translation buffer */ + if (uO.jflag) /* junking directories */ + cp = (char *)strrchr(G.filename, '/'); + if (cp == (char *)NULL) /* no '/' or not junking dirs */ + cp = G.filename; /* point to internal zipfile-member pathname */ + else + ++cp; /* point to start of last component of path */ + +/*--------------------------------------------------------------------------- + Begin main loop through characters in filename. + ---------------------------------------------------------------------------*/ + + while ((workch = (uch)*cp++) != 0) { + + if (quote) { /* if character quoted, */ + *pp++ = (char)workch; /* include it literally */ + quote = FALSE; + } else + switch (workch) { + case '/': /* can assume -j flag not given */ + *pp = '\0'; + if (((error = checkdir(__G__ pathcomp, APPEND_DIR)) & MPN_MASK) + > MPN_INF_TRUNC) + return error; + pp = pathcomp; /* reset conversion buffer for next piece */ + lastsemi = (char *)NULL; /* leave directory semi-colons alone */ + break; + + case '.': + if (pp == pathcomp) { /* nothing appended yet... */ + if (*cp == '/') { /* don't bother appending "./" to */ + ++cp; /* the path: skip behind the '/' */ + break; + } else if (!uO.ddotflag && *cp == '.' && cp[1] == '/') { + /* "../" dir traversal detected */ + cp += 2; /* skip over behind the '/' */ + killed_ddot = TRUE; /* set "show message" flag */ + break; + } + } + *pp++ = '.'; + break; + + case ';': /* VMS version (or DEC-20 attrib?) */ + lastsemi = pp; + *pp++ = ';'; /* keep for now; remove VMS ";##" */ + break; /* later, if requested */ + +#ifdef ACORN_FTYPE_NFS + case ',': /* NFS filetype extension */ + lastcomma = pp; + *pp++ = ','; /* keep for now; may need to remove */ + break; /* later, if requested */ +#endif + + case '\026': /* control-V quote for special chars */ + quote = TRUE; /* set flag for next character */ + break; + +#ifdef MTS + case ' ': /* change spaces to underscore under */ + *pp++ = '_'; /* MTS; leave as spaces under Unix */ + break; +#endif + + default: + /* allow European characters in filenames: */ + if (isprint(workch) || (128 <= workch && workch <= 254)) + *pp++ = (char)workch; + } /* end switch */ + + } /* end while loop */ + + /* Show warning when stripping insecure "parent dir" path components */ + if (killed_ddot && QCOND2) { + Info(slide, 0, ((char *)slide, + "warning: skipped \"../\" path component(s) in %s\n", + FnFilter1(G.filename))); + if (!(error & ~MPN_MASK)) + error = (error & MPN_MASK) | PK_WARN; + } + +/*--------------------------------------------------------------------------- + Report if directory was created (and no file to create: filename ended + in '/'), check name to be sure it exists, and combine path and name be- + fore exiting. + ---------------------------------------------------------------------------*/ + + if (G.filename[strlen(G.filename) - 1] == '/') { + checkdir(__G__ G.filename, GETPATH); + if (G.created_dir) { + if (QCOND2) { + Info(slide, 0, ((char *)slide, " creating: %s\n", + FnFilter1(G.filename))); + } +#ifndef NO_CHMOD + /* set approx. dir perms (make sure can still read/write in dir) */ + if (chmod(G.filename, (0xffff & G.pInfo->file_attr) | 0700)) + perror("chmod (directory attributes) error"); +#endif + /* set dir time (note trailing '/') */ + return (error & ~MPN_MASK) | MPN_CREATED_DIR; + } + /* dir existed already; don't look for data to extract */ + return (error & ~MPN_MASK) | MPN_INF_SKIP; + } + + *pp = '\0'; /* done with pathcomp: terminate it */ + + /* if not saving them, remove VMS version numbers (appended ";###") */ + if (!uO.V_flag && lastsemi) { + pp = lastsemi + 1; + while (isdigit((uch)(*pp))) + ++pp; + if (*pp == '\0') /* only digits between ';' and end: nuke */ + *lastsemi = '\0'; + } + +#ifdef ACORN_FTYPE_NFS + /* translate Acorn filetype information if asked to do so */ + if (uO.acorn_nfs_ext && + (ef_spark = (RO_extra_block *) + getRISCOSexfield(G.extra_field, G.lrec.extra_field_length)) + != (RO_extra_block *)NULL) + { + /* file *must* have a RISC OS extra field */ + long ft = (long)makelong(ef_spark->loadaddr); + /*32-bit*/ + if (lastcomma) { + pp = lastcomma + 1; + while (isxdigit((uch)(*pp))) ++pp; + if (pp == lastcomma+4 && *pp == '\0') *lastcomma='\0'; /* nuke */ + } + if ((ft & 1<<31)==0) ft=0x000FFD00; + sprintf(pathcomp+strlen(pathcomp), ",%03x", (int)(ft>>8) & 0xFFF); + } +#endif /* ACORN_FTYPE_NFS */ + + if (*pathcomp == '\0') { + Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n", + FnFilter1(G.filename))); + return (error & ~MPN_MASK) | MPN_ERR_SKIP; + } + + checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ + checkdir(__G__ G.filename, GETPATH); + + return error; + +} /* end function mapname() */ + + + + +#if 0 /*========== NOTES ==========*/ + + extract-to dir: a:path/ + buildpath: path1/path2/ ... (NULL-terminated) + pathcomp: filename + + mapname(): + loop over chars in zipfile member name + checkdir(path component, COMPONENT | CREATEDIR) --> map as required? + (d:/tmp/unzip/) (disk:[tmp.unzip.) + (d:/tmp/unzip/jj/) (disk:[tmp.unzip.jj.) + (d:/tmp/unzip/jj/temp/) (disk:[tmp.unzip.jj.temp.) + finally add filename itself and check for existence? (could use with rename) + (d:/tmp/unzip/jj/temp/msg.outdir) (disk:[tmp.unzip.jj.temp]msg.outdir) + checkdir(name, GETPATH) --> copy path to name and free space + +#endif /* 0 */ + + + + +/***********************/ +/* Function checkdir() */ +/***********************/ + +int checkdir(__G__ pathcomp, flag) + __GDEF + char *pathcomp; + int flag; +/* + * returns: + * MPN_OK - no problem detected + * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename + * MPN_INF_SKIP - path doesn't exist, not allowed to create + * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path + * exists and is not a directory, but is supposed to be + * MPN_ERR_TOOLONG - path is too long + * MPN_NOMEM - can't allocate memory for filename buffers + */ +{ + /* static int rootlen = 0; */ /* length of rootpath */ + /* static char *rootpath; */ /* user's "extract-to" directory */ + /* static char *buildpath; */ /* full path (so far) to extracted file */ + /* static char *end; */ /* pointer to end of buildpath ('\0') */ + +# define FN_MASK 7 +# define FUNCTION (flag & FN_MASK) + + + +/*--------------------------------------------------------------------------- + APPEND_DIR: append the path component to the path being built and check + for its existence. If doesn't exist and we are creating directories, do + so for this one; else signal success or error as appropriate. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == APPEND_DIR) { + int too_long = FALSE; +#ifdef SHORT_NAMES + char *old_end = end; +#endif + + Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); + while ((*G.end = *pathcomp++) != '\0') + ++G.end; +#ifdef SHORT_NAMES /* path components restricted to 14 chars, typically */ + if ((G.end-old_end) > FILENAME_MAX) /* GRR: proper constant? */ + *(G.end = old_end + FILENAME_MAX) = '\0'; +#endif + + /* GRR: could do better check, see if overrunning buffer as we go: + * check end-buildpath after each append, set warning variable if + * within 20 of FILNAMSIZ; then if var set, do careful check when + * appending. Clear variable when begin new path. */ + + /* next check: need to append '/', at least one-char name, '\0' */ + if ((G.end-G.buildpath) > FILNAMSIZ-3) + too_long = TRUE; /* check if extracting dir? */ + if (SSTAT(G.buildpath, &G.statbuf)) { /* path doesn't exist */ + if (!G.create_dirs) { /* told not to create (freshening) */ + free(G.buildpath); + return MPN_INF_SKIP; /* path doesn't exist: nothing to do */ + } + if (too_long) { + Info(slide, 1, ((char *)slide, + "checkdir error: path too long: %s\n", + FnFilter1(G.buildpath))); + free(G.buildpath); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + if (mkdir(G.buildpath, 0777) == -1) { /* create the directory */ + Info(slide, 1, ((char *)slide, + "checkdir error: cannot create %s\n\ + unable to process %s.\n", + FnFilter2(G.buildpath), FnFilter1(G.filename))); + free(G.buildpath); + /* path didn't exist, tried to create, failed */ + return MPN_ERR_SKIP; + } + G.created_dir = TRUE; + } else if (!S_ISDIR(G.statbuf.st_mode)) { + Info(slide, 1, ((char *)slide, + "checkdir error: %s exists but is not directory\n\ + unable to process %s.\n", + FnFilter2(G.buildpath), FnFilter1(G.filename))); + free(G.buildpath); + /* path existed but wasn't dir */ + return MPN_ERR_SKIP; + } + if (too_long) { + Info(slide, 1, ((char *)slide, + "checkdir error: path too long: %s\n", FnFilter1(G.buildpath))); + free(G.buildpath); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + *G.end++ = '/'; + *G.end = '\0'; + Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath))); + return MPN_OK; + + } /* end if (FUNCTION == APPEND_DIR) */ + +/*--------------------------------------------------------------------------- + GETPATH: copy full path to the string pointed at by pathcomp, and free + G.buildpath. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == GETPATH) { + strcpy(pathcomp, G.buildpath); + Trace((stderr, "getting and freeing path [%s]\n", + FnFilter1(pathcomp))); + free(G.buildpath); + G.buildpath = G.end = (char *)NULL; + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + APPEND_NAME: assume the path component is the filename; append it and + return without checking for existence. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == APPEND_NAME) { +#ifdef SHORT_NAMES + char *old_end = end; +#endif + + Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); + while ((*G.end = *pathcomp++) != '\0') { + ++G.end; +#ifdef SHORT_NAMES /* truncate name at 14 characters, typically */ + if ((G.end-old_end) > FILENAME_MAX) /* GRR: proper constant? */ + *(G.end = old_end + FILENAME_MAX) = '\0'; +#endif + if ((G.end-G.buildpath) >= FILNAMSIZ) { + *--G.end = '\0'; + Info(slide, 0x201, ((char *)slide, + "checkdir warning: path too long; truncating\n\ + %s\n -> %s\n", + FnFilter1(G.filename), FnFilter2(G.buildpath))); + return MPN_INF_TRUNC; /* filename truncated */ + } + } + Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath))); + /* could check for existence here, prompt for new name... */ + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + INIT: allocate and initialize buffer space for the file currently being + extracted. If file was renamed with an absolute path, don't prepend the + extract-to path. + ---------------------------------------------------------------------------*/ + +/* GRR: for VMS and TOPS-20, add up to 13 to strlen */ + + if (FUNCTION == INIT) { + Trace((stderr, "initializing buildpath to ")); +#ifdef ACORN_FTYPE_NFS + if ((G.buildpath = (char *)malloc(strlen(G.filename)+G.rootlen+ + (uO.acorn_nfs_ext ? 5 : 1))) +#else + if ((G.buildpath = (char *)malloc(strlen(G.filename)+G.rootlen+1)) +#endif + == (char *)NULL) + return MPN_NOMEM; + if ((G.rootlen > 0) && !G.renamed_fullpath) { + strcpy(G.buildpath, G.rootpath); + G.end = G.buildpath + G.rootlen; + } else { + *G.buildpath = '\0'; + G.end = G.buildpath; + } + Trace((stderr, "[%s]\n", FnFilter1(G.buildpath))); + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + ROOT: if appropriate, store the path in rootpath and create it if + necessary; else assume it's a zipfile member and return. This path + segment gets used in extracting all members from every zipfile specified + on the command line. + ---------------------------------------------------------------------------*/ + +#if (!defined(SFX) || defined(SFX_EXDIR)) + if (FUNCTION == ROOT) { + Trace((stderr, "initializing root path to [%s]\n", + FnFilter1(pathcomp))); + if (pathcomp == (char *)NULL) { + G.rootlen = 0; + return MPN_OK; + } + if (G.rootlen > 0) /* rootpath was already set, nothing to do */ + return MPN_OK; + if ((G.rootlen = strlen(pathcomp)) > 0) { + char *tmproot; + + if ((tmproot = (char *)malloc(G.rootlen+2)) == (char *)NULL) { + G.rootlen = 0; + return MPN_NOMEM; + } + strcpy(tmproot, pathcomp); + if (tmproot[G.rootlen-1] == '/') { + tmproot[--G.rootlen] = '\0'; + } + if (G.rootlen > 0 && (SSTAT(tmproot, &G.statbuf) || + !S_ISDIR(G.statbuf.st_mode))) + { /* path does not exist */ + if (!G.create_dirs /* || iswild(tmproot) */ ) { + free(tmproot); + G.rootlen = 0; + /* skip (or treat as stored file) */ + return MPN_INF_SKIP; + } + /* create the directory (could add loop here scanning tmproot + * to create more than one level, but why really necessary?) */ + if (mkdir(tmproot, 0777) == -1) { + Info(slide, 1, ((char *)slide, + "checkdir: cannot create extraction directory: %s\n", + FnFilter1(tmproot))); + free(tmproot); + G.rootlen = 0; + /* path didn't exist, tried to create, and failed: */ + /* file exists, or 2+ subdir levels required */ + return MPN_ERR_SKIP; + } + } + tmproot[G.rootlen++] = '/'; + tmproot[G.rootlen] = '\0'; + if ((G.rootpath = (char *)realloc(tmproot, G.rootlen+1)) == NULL) { + free(tmproot); + G.rootlen = 0; + return MPN_NOMEM; + } + Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath))); + } + return MPN_OK; + } +#endif /* !SFX || SFX_EXDIR */ + +/*--------------------------------------------------------------------------- + END: free rootpath, immediately prior to program exit. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == END) { + Trace((stderr, "freeing rootpath\n")); + if (G.rootlen > 0) { + free(G.rootpath); + G.rootlen = 0; + } + return MPN_OK; + } + + return MPN_INVALID; /* should never reach */ + +} /* end function checkdir() */ + + + + + +#ifdef NO_MKDIR + +/********************/ +/* Function mkdir() */ +/********************/ + +int mkdir(path, mode) + ZCONST char *path; + int mode; /* ignored */ +/* + * returns: 0 - successful + * -1 - failed (errno not set, however) + */ +{ + char command[FILNAMSIZ+40]; /* buffer for system() call */ + + /* GRR 930416: added single quotes around path to avoid bug with + * creating directories with ampersands in name; not yet tested */ + sprintf(command, "IFS=\" \t\n\" /bin/mkdir '%s' 2>/dev/null", path); + if (system(command)) + return -1; + return 0; +} + +#endif /* NO_MKDIR */ + + + + + +#ifndef MTS + +/****************************/ +/* Function close_outfile() */ +/****************************/ + +void close_outfile(__G) /* GRR: change to return PK-style warning level */ + __GDEF +{ + iztimes zt; + ush z_uidgid[2]; + unsigned eb_izux_flg; + +/*--------------------------------------------------------------------------- + If symbolic links are supported, allocate a storage area, put the uncom- + pressed "data" in it, and create the link. Since we know it's a symbolic + link to start with, we shouldn't have to worry about overflowing unsigned + ints with unsigned longs. + ---------------------------------------------------------------------------*/ + +#ifdef SYMLINKS + if (G.symlnk) { + unsigned ucsize = (unsigned)G.lrec.ucsize; + char *linktarget = (char *)malloc((unsigned)G.lrec.ucsize+1); + + fclose(G.outfile); /* close "data" file... */ + G.outfile = fopen(G.filename, FOPR); /* ...and reopen for reading */ + if (!linktarget || fread(linktarget, 1, ucsize, G.outfile) != + (int)ucsize) + { + Info(slide, 0x201, ((char *)slide, + "warning: symbolic link (%s) failed\n", FnFilter1(G.filename))); + if (linktarget) + free(linktarget); + fclose(G.outfile); + return; + } + fclose(G.outfile); /* close "data" file for good... */ + unlink(G.filename); /* ...and delete it */ + linktarget[ucsize] = '\0'; + if (QCOND2) + Info(slide, 0, ((char *)slide, "-> %s ", FnFilter1(linktarget))); + if (symlink(linktarget, G.filename)) /* create the real link */ + perror("symlink error"); + free(linktarget); + return; /* can't set time on symlinks */ + } +#endif /* SYMLINKS */ + + fclose(G.outfile); +#ifdef QLZIP + if (G.extra_field) { + static void qlfix OF((__GPRO__ uch *ef_ptr, unsigned ef_len)); + + qlfix(__G__ G.extra_field, G.lrec.extra_field_length); + } +#endif + +/*--------------------------------------------------------------------------- + Convert from MSDOS-format local time and date to Unix-format 32-bit GMT + time: adjust base year from 1980 to 1970, do usual conversions from + yy/mm/dd hh:mm:ss to elapsed seconds, and account for timezone and day- + light savings time differences. If we have a Unix extra field, however, + we're laughing: both mtime and atime are ours. On the other hand, we + then have to check for restoration of UID/GID. + ---------------------------------------------------------------------------*/ + + eb_izux_flg = (G.extra_field ? ef_scan_for_izux(G.extra_field, + G.lrec.extra_field_length, 0, G.lrec.last_mod_dos_datetime, +#ifdef IZ_CHECK_TZ + (G.tz_is_valid ? &zt : NULL), +#else + &zt, +#endif + z_uidgid) : 0); + if (eb_izux_flg & EB_UT_FL_MTIME) { + TTrace((stderr, "\nclose_outfile: Unix e.f. modif. time = %ld\n", + zt.mtime)); + } else { + zt.mtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime); + } + if (eb_izux_flg & EB_UT_FL_ATIME) { + TTrace((stderr, "close_outfile: Unix e.f. access time = %ld\n", + zt.atime)); + } else { + zt.atime = zt.mtime; + TTrace((stderr, "\nclose_outfile: modification/access times = %ld\n", + zt.mtime)); + } + + /* if -X option was specified and we have UID/GID info, restore it */ + if (uO.X_flag && eb_izux_flg & EB_UX2_VALID) { + TTrace((stderr, "close_outfile: restoring Unix UID/GID info\n")); + if (chown(G.filename, (uid_t)z_uidgid[0], (gid_t)z_uidgid[1])) + { + if (uO.qflag) + Info(slide, 0x201, ((char *)slide, + "warning: cannot set UID %d and/or GID %d for %s\n", + z_uidgid[0], z_uidgid[1], FnFilter1(G.filename))); + else + Info(slide, 0x201, ((char *)slide, + " (warning) cannot set UID %d and/or GID %d", + z_uidgid[0], z_uidgid[1])); + } + } + + /* set the file's access and modification times */ + if (utime(G.filename, (ztimbuf *)&zt)) { +#ifdef AOS_VS + if (uO.qflag) + Info(slide, 0x201, ((char *)slide, "... cannot set time for %s\n", + FnFilter1(G.filename))); + else + Info(slide, 0x201, ((char *)slide, "... cannot set time")); +#else + if (uO.qflag) + Info(slide, 0x201, ((char *)slide, + "warning: cannot set times for %s\n", FnFilter1(G.filename))); + else + Info(slide, 0x201, ((char *)slide, + " (warning) cannot set times")); +#endif /* ?AOS_VS */ + } + +/*--------------------------------------------------------------------------- + Change the file permissions from default ones to those stored in the + zipfile. + ---------------------------------------------------------------------------*/ + +#ifndef NO_CHMOD + if (chmod(G.filename, 0xffff & G.pInfo->file_attr)) + perror("chmod (file attributes) error"); +#endif + +} /* end function close_outfile() */ + +#endif /* !MTS */ + + + + +#ifdef SET_DIR_ATTRIB +/* messages of code for setting directory attributes */ +static ZCONST char Far DirlistUidGidFailed[] = + "warning: cannot set UID %d and/or GID %d for %s\n"; +static ZCONST char Far DirlistUtimeFailed[] = + "warning: cannot set modification, access times for %s\n"; +# ifndef NO_CHMOD + static ZCONST char Far DirlistChmodFailed[] = + "warning: cannot set permissions for %s\n"; +# endif + + +int set_direc_attribs(__G__ d) + __GDEF + dirtime *d; +{ + int errval = PK_OK; + + if (d->have_uidgid && + chown(d->fn, (uid_t)d->uidgid[0], (gid_t)d->uidgid[1])) + { + Info(slide, 0x201, ((char *)slide, + LoadFarString(DirlistUidGidFailed), + d->uidgid[0], d->uidgid[1], FnFilter1(d->fn))); + if (!errval) + errval = PK_WARN; + } + if (utime(d->fn, &d->u.t2)) { + Info(slide, 0x201, ((char *)slide, + LoadFarString(DirlistUtimeFailed), FnFilter1(d->fn))); + if (!errval) + errval = PK_WARN; + } +#ifndef NO_CHMOD + if (chmod(d->fn, 0xffff & d->perms)) { + Info(slide, 0x201, ((char *)slide, + LoadFarString(DirlistChmodFailed), FnFilter1(d->fn))); + /* perror("chmod (file attributes) error"); */ + if (!errval) + errval = PK_WARN; + } +#endif /* !NO_CHMOD */ + return errval; +} /* end function set_directory_attributes() */ + +#endif /* SET_DIR_ATTRIB */ + + + + +#ifdef TIMESTAMP + +/***************************/ +/* Function stamp_file() */ +/***************************/ + +int stamp_file(fname, modtime) + ZCONST char *fname; + time_t modtime; +{ + ztimbuf tp; + + tp.modtime = tp.actime = modtime; + return (utime(fname, &tp)); + +} /* end function stamp_file() */ + +#endif /* TIMESTAMP */ + + + + +#ifndef SFX + +/************************/ +/* Function version() */ +/************************/ + +void version(__G) + __GDEF +{ +#if (defined(__GNUC__) && defined(NX_CURRENT_COMPILER_RELEASE)) + char cc_namebuf[40]; + char cc_versbuf[40]; +#else +#if (defined(CRAY) && defined(_RELEASE)) + char cc_versbuf[40]; +#endif +#endif +#if ((defined(CRAY) || defined(cray)) && defined(_UNICOS)) + char os_namebuf[40]; +#else +#if defined(__NetBSD__) + char os_namebuf[40]; +#endif +#endif + + /* Pyramid, NeXT have problems with huge macro expansion, too: no Info() */ + sprintf((char *)slide, LoadFarString(CompiledWith), + +#ifdef __GNUC__ +# ifdef NX_CURRENT_COMPILER_RELEASE + (sprintf(cc_namebuf, "NeXT DevKit %d.%02d ", + NX_CURRENT_COMPILER_RELEASE/100, NX_CURRENT_COMPILER_RELEASE%100), + cc_namebuf), + (strlen(__VERSION__) > 8)? "(gcc)" : + (sprintf(cc_versbuf, "(gcc %s)", __VERSION__), cc_versbuf), +# else + "gcc ", __VERSION__, +# endif +#else +# if defined(CRAY) && defined(_RELEASE) + "cc ", (sprintf(cc_versbuf, "version %d", _RELEASE), cc_versbuf), +# else +# ifdef __VERSION__ +# ifndef IZ_CC_NAME +# define IZ_CC_NAME "cc " +# endif + IZ_CC_NAME, __VERSION__ +# else +# ifndef IZ_CC_NAME +# define IZ_CC_NAME "cc" +# endif + IZ_CC_NAME, "", +# endif +# endif +#endif /* ?__GNUC__ */ + +#ifndef IZ_OS_NAME +# define IZ_OS_NAME "Unix" +#endif + IZ_OS_NAME, + +#if defined(sgi) || defined(__sgi) + " (Silicon Graphics IRIX)", +#else +#ifdef sun +# ifdef sparc +# ifdef __SVR4 + " (Sun SPARC/Solaris)", +# else /* may or may not be SunOS */ + " (Sun SPARC)", +# endif +# else +# if defined(sun386) || defined(i386) + " (Sun 386i)", +# else +# if defined(mc68020) || defined(__mc68020__) + " (Sun 3)", +# else /* mc68010 or mc68000: Sun 2 or earlier */ + " (Sun 2)", +# endif +# endif +# endif +#else +#ifdef __hpux + " (HP/UX)", +#else +#ifdef __osf__ + " (DEC OSF/1)", +#else +#ifdef _AIX + " (IBM AIX)", +#else +#ifdef aiws + " (IBM RT/AIX)", +#else +#if defined(CRAY) || defined(cray) +# ifdef _UNICOS + (sprintf(os_namebuf, " (Cray UNICOS release %d)", _UNICOS), os_namebuf), +# else + " (Cray UNICOS)", +# endif +#else +#if defined(uts) || defined(UTS) + " (Amdahl UTS)", +#else +#ifdef NeXT +# ifdef mc68000 + " (NeXTStep/black)", +# else + " (NeXTStep for Intel)", +# endif +#else /* the next dozen or so are somewhat order-dependent */ +#ifdef LINUX +# ifdef __ELF__ + " (Linux ELF)", +# else + " (Linux a.out)", +# endif +#else +#ifdef MINIX + " (Minix)", +#else +#ifdef M_UNIX + " (SCO Unix)", +#else +#ifdef M_XENIX + " (SCO Xenix)", +#else +#ifdef __NetBSD__ +# ifdef NetBSD0_8 + (sprintf(os_namebuf, " (NetBSD 0.8%c)", (char)(NetBSD0_8 - 1 + 'A')), + os_namebuf), +# else +# ifdef NetBSD0_9 + (sprintf(os_namebuf, " (NetBSD 0.9%c)", (char)(NetBSD0_9 - 1 + 'A')), + os_namebuf), +# else +# ifdef NetBSD1_0 + (sprintf(os_namebuf, " (NetBSD 1.0%c)", (char)(NetBSD1_0 - 1 + 'A')), + os_namebuf), +# else + (BSD4_4 == 0.5)? " (NetBSD before 0.9)" : " (NetBSD 1.1 or later)", +# endif +# endif +# endif +#else +#ifdef __FreeBSD__ + (BSD4_4 == 0.5)? " (FreeBSD 1.x)" : " (FreeBSD 2.0 or later)", +#else +#ifdef __bsdi__ + (BSD4_4 == 0.5)? " (BSD/386 1.0)" : " (BSD/386 1.1 or later)", +#else +#ifdef __386BSD__ + (BSD4_4 == 1)? " (386BSD, post-4.4 release)" : " (386BSD)", +#else +#if defined(i486) || defined(__i486) || defined(__i486__) + " (Intel 486)", +#else +#if defined(i386) || defined(__i386) || defined(__i386__) + " (Intel 386)", +#else +#ifdef pyr + " (Pyramid)", +#else +#ifdef ultrix +# ifdef mips + " (DEC/MIPS)", +# else +# ifdef vax + " (DEC/VAX)", +# else /* __alpha? */ + " (DEC/Alpha)", +# endif +# endif +#else +#ifdef gould + " (Gould)", +#else +#ifdef MTS + " (MTS)", +#else +#ifdef __convexc__ + " (Convex)", +#else +#ifdef __QNX__ + " (QNX 4)", +#else +#ifdef __QNXNTO__ + " (QNX Neutrino)", +#else +#ifdef Lynx + " (LynxOS)", +#else + "", +#endif /* Lynx */ +#endif /* QNX Neutrino */ +#endif /* QNX 4 */ +#endif /* Convex */ +#endif /* MTS */ +#endif /* Gould */ +#endif /* DEC */ +#endif /* Pyramid */ +#endif /* 386 */ +#endif /* 486 */ +#endif /* 386BSD */ +#endif /* BSDI BSD/386 */ +#endif /* NetBSD */ +#endif /* FreeBSD */ +#endif /* SCO Xenix */ +#endif /* SCO Unix */ +#endif /* Minix */ +#endif /* Linux */ +#endif /* NeXT */ +#endif /* Amdahl */ +#endif /* Cray */ +#endif /* RT/AIX */ +#endif /* AIX */ +#endif /* OSF/1 */ +#endif /* HP/UX */ +#endif /* Sun */ +#endif /* SGI */ + +#ifdef __DATE__ + " on ", __DATE__ +#else + "", "" +#endif + ); + + (*G.message)((zvoid *)&G, slide, (ulg)strlen((char *)slide), 0); + +} /* end function version() */ + +#endif /* !SFX */ + + + + +#ifdef QLZIP + +struct qdirect { + long d_length __attribute__ ((packed)); /* file length */ + unsigned char d_access __attribute__ ((packed)); /* file access type */ + unsigned char d_type __attribute__ ((packed)); /* file type */ + long d_datalen __attribute__ ((packed)); /* data length */ + long d_reserved __attribute__ ((packed));/* Unused */ + short d_szname __attribute__ ((packed)); /* size of name */ + char d_name[36] __attribute__ ((packed));/* name area */ + long d_update __attribute__ ((packed)); /* last update */ + long d_refdate __attribute__ ((packed)); + long d_backup __attribute__ ((packed)); /* EOD */ +}; + +#define LONGID "QDOS02" +#define EXTRALEN (sizeof(struct qdirect) + 8) +#define JBLONGID "QZHD" +#define JBEXTRALEN (sizeof(jbextra) - 4 * sizeof(char)) + +typedef struct { + char eb_header[4] __attribute__ ((packed)); /* place_holder */ + char longid[8] __attribute__ ((packed)); + struct qdirect header __attribute__ ((packed)); +} qdosextra; + +typedef struct { + char eb_header[4]; /* place_holder */ + char longid[4]; + struct qdirect header; +} jbextra; + + + +/* The following two functions SH() and LG() convert big-endian short + * and long numbers into native byte order. They are some kind of + * counterpart to the generic UnZip's makeword() and makelong() functions. + */ +static ush SH(ush val) +{ + uch swapbuf[2]; + + swapbuf[1] = (uch)(val & 0xff); + swapbuf[0] = (uch)(val >> 8); + return (*(ush *)swapbuf); +} + + + +static ulg LG(ulg val) +{ + /* convert the big-endian unsigned long number `val' to the machine + * dependant representation + */ + ush swapbuf[2]; + + swapbuf[1] = SH((ush)(val & 0xffff)); + swapbuf[0] = SH((ush)(val >> 16)); + return (*(ulg *)swapbuf); +} + + + +static void qlfix(__G__ ef_ptr, ef_len) + __GDEF + uch *ef_ptr; + unsigned ef_len; +{ + while (ef_len >= EB_HEADSIZE) + { + unsigned eb_id = makeword(EB_ID + ef_ptr); + unsigned eb_len = makeword(EB_LEN + ef_ptr); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + /* discovered some extra field inconsistency! */ + Trace((stderr, + "qlfix: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } + + switch (eb_id) { + case EF_QDOS: + { + struct _ntc_ + { + long id; + long dlen; + } ntc; + long dlen = 0; + + qdosextra *extra = (qdosextra *)ef_ptr; + jbextra *jbp = (jbextra *)ef_ptr; + + if (!strncmp(extra->longid, LONGID, strlen(LONGID))) + { + if (eb_len != EXTRALEN) + if (uO.qflag) + Info(slide, 0x201, ((char *)slide, + "warning: invalid length in Qdos field for %s\n", + FnFilter1(G.filename))); + else + Info(slide, 0x201, ((char *)slide, + "warning: invalid length in Qdos field")); + + if (extra->header.d_type) + { + dlen = extra->header.d_datalen; + } + } + + if (!strncmp(jbp->longid, JBLONGID, strlen(JBLONGID))) + { + if (eb_len != JBEXTRALEN) + if (uO.qflag) + Info(slide, 0x201, ((char *)slide, + "warning: invalid length in QZ field for %s\n", + FnFilter1(G.filename))); + else + Info(slide, 0x201, ((char *)slide, + "warning: invalid length in QZ field")); + if(jbp->header.d_type) + { + dlen = jbp->header.d_datalen; + } + } + + if ((long)LG(dlen) > 0) + { + G.outfile = fopen(G.filename,"r+"); + fseek(G.outfile, -8, SEEK_END); + fread(&ntc, 8, 1, G.outfile); + if(ntc.id != *(long *)"XTcc") + { + ntc.id = *(long *)"XTcc"; + ntc.dlen = dlen; + fwrite (&ntc, 8, 1, G.outfile); + } + Info(slide, 0x201, ((char *)slide, "QData = %d", LG(dlen))); + fclose(G.outfile); + } + return; /* finished, cancel further extra field scanning */ + } + + default: + Trace((stderr,"qlfix: unknown extra field block, ID=%d\n", + eb_id)); + } + + /* Skip this extra field block */ + ef_ptr += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } +} +#endif /* QLZIP */ + +#endif + +const char *BOINC_RCSID_a72f75a0d4 = "$Id: unix.c 18213 2009-05-27 23:36:55Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/unxcfg.h boinc-7.0.14+dfsg/zip/unzip/unix/unxcfg.h --- boinc-7.0.7+dfsg/zip/unzip/unix/unxcfg.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/unxcfg.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,128 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + Unix specific configuration section: + ---------------------------------------------------------------------------*/ + +#ifndef __unxcfg_h +#define __unxcfg_h + +#ifndef _WIN32 +#include /* off_t, time_t, dev_t, ... */ +#include + +#ifndef COHERENT +# include /* O_BINARY for open() w/o CR/LF translation */ +#else /* COHERENT */ +# ifdef _I386 +# include /* Coherent 4.0.x, Mark Williams C */ +# else +# include /* Coherent 3.10, Mark Williams C */ +# endif +# define SHORT_SYMS +# ifndef __COHERENT__ /* Coherent 4.2 has tzset() */ +# define tzset settz +# endif +#endif /* ?COHERENT */ + +#ifndef NO_PARAM_H +# ifdef NGROUPS_MAX +# undef NGROUPS_MAX /* SCO bug: defined again in */ +# endif +# ifdef BSD +# define TEMP_BSD /* may be defined again in */ +# undef BSD +# endif +# include /* conflict with , some systems? */ +# ifdef TEMP_BSD +# undef TEMP_BSD +# ifndef BSD +# define BSD +# endif +# endif +#endif /* !NO_PARAM_H */ + +#ifdef __osf__ +# define DIRENT +# ifdef BSD +# undef BSD +# endif +#endif /* __osf__ */ + +#ifdef BSD +# include +# include +# if (defined(_AIX) || defined(__GNU__)) +# include +# endif +#else +# include + struct tm *gmtime(), *localtime(); +#endif + +#if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN))) +# include /* this includes utime.h on SGIs */ +# if (defined(BSD4_4) || defined(linux) || defined(__GNU__)) +# include +# define GOT_UTIMBUF +# endif +#endif + +#if (defined(V7) || defined(pyr_bsd)) +# define strchr index +# define strrchr rindex +#endif +#ifdef V7 +# define O_RDONLY 0 +# define O_WRONLY 1 +# define O_RDWR 2 +#endif + +#ifdef MINIX +# include +#endif +#if (!defined(HAVE_STRNICMP) & !defined(NO_STRNICMP)) +# define NO_STRNICMP +#endif +#ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY /* GRR: customize with locale.h somehow? */ +#endif +#define lenEOL 1 +#ifdef EBCDIC +# define PutNativeEOL *q++ = '\n'; +#else +# define PutNativeEOL *q++ = native(LF); +#endif +#define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) +#define SCREENWIDTH 80 +#define SCREENLWRAP 1 +#define USE_EF_UT_TIME +#define SET_DIR_ATTRIB +#if (!defined(TIMESTAMP) && !defined(NOTIMESTAMP)) /* GRR 970513 */ +# define TIMESTAMP +#endif +#define RESTORE_UIDGID + +/* Static variables that we have to add to Uz_Globs: */ +#define SYSTEM_SPECIFIC_GLOBALS \ + int created_dir, renamed_fullpath;\ + char *rootpath, *buildpath, *end;\ + ZCONST char *wildname;\ + char *dirname, matchname[FILNAMSIZ];\ + int rootlen, have_dirname, dirnamelen, notfirstcall;\ + zvoid *wild_dir; + +/* created_dir, and renamed_fullpath are used by both mapname() and */ +/* checkdir(). */ +/* rootlen, rootpath, buildpath and end are used by checkdir(). */ +/* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ +/* and notfirstcall are used by do_wild(). */ +#endif + +#endif /* !__unxcfg_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/unix/zipgrep boinc-7.0.14+dfsg/zip/unzip/unix/zipgrep --- boinc-7.0.7+dfsg/zip/unzip/unix/zipgrep 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unix/zipgrep 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,56 @@ +#! /bin/sh +# zipgrep: searches the given zip members for a string or pattern +# This shell script assumes that you have installed UnZip. + +pat="" +opt="" +while test $# -ne 0; do + case "$1" in + -e | -f) opt="$opt $1"; shift; pat="$1";; + -*) opt="$opt $1";; + *) if test -z "$pat"; then + pat="$1" + else + break; + fi;; + esac + shift +done + +if test $# = 0; then + echo "usage: `basename $0` [egrep_options] pattern zipfile [members...]" + echo searches the given zip members for a string or pattern + exit 1 +fi +zipfile="$1"; shift + +list=0 +silent=0 +opt=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'` +case "$opt" in + *l*) list=1; opt=`echo $opt | sed s/l//` +esac +case "$opt" in + *h*) silent=1 +esac +if test -n "$opt"; then + opt="-$opt" +fi + +res=0 +for i in `unzip -Z1 "$zipfile" ${1+"$@"}`; do + if test $list -eq 1; then + + unzip -p-L "$zipfile" "$i" | egrep $opt "$pat" > /dev/null && echo $i + r=$? + elif test $silent -eq 1; then + + unzip -p-L "$zipfile" "$i" | egrep $opt "$pat" + r=$? + else + unzip -p-L "$zipfile" "$i" | egrep $opt "$pat" | sed "s|^|${i}:|" + r=$? + fi + test "$r" -ne 0 && res="$r" +done +exit $res diff -Nru boinc-7.0.7+dfsg/zip/unzip/unreduce.c boinc-7.0.14+dfsg/zip/unzip/unreduce.c --- boinc-7.0.7+dfsg/zip/unzip/unreduce.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unreduce.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,37 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unreduce.c + + Copyright-clean dummy module, without any real code. + + If you really need unreduce support, replace this module by the full + source code, available as add-on package from our distribution site. + + ---------------------------------------------------------------------------*/ + + +#define __UNREDUCE_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" /* defines COPYRIGHT_CLEAN by default */ + + +#ifndef COPYRIGHT_CLEAN + + /* This line is indented to hide the #error directive from pure traditional + * K&R C preprocessors. These do not recognize the #error directive, but + * they also recognize only lines that start with a '#' in column 1 as + * preprocessor directives. + */ + #error This dummy-module does not support the unreduce method! + +#endif /* !COPYRIGHT_CLEAN */ + +const char *BOINC_RCSID_e98566230a = "$Id: unreduce.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/unshrink.c boinc-7.0.14+dfsg/zip/unzip/unshrink.c --- boinc-7.0.7+dfsg/zip/unzip/unshrink.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unshrink.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,316 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unshrink.c version 1.21 23 Nov 95 + + + NOTE: This code may or may not infringe on the so-called "Welch + patent" owned by Unisys. (From reading the patent, it appears + that a pure LZW decompressor is *not* covered, but this claim has + not been tested in court, and Unisys is reported to believe other- + wise.) It is therefore the responsibility of the user to acquire + whatever license(s) may be required for legal use of this code. + + THE INFO-ZIP GROUP DISCLAIMS ALL LIABILITY FOR USE OF THIS CODE + IN VIOLATION OF APPLICABLE PATENT LAW. + + + Shrinking is basically a dynamic LZW algorithm with allowed code sizes of + up to 13 bits; in addition, there is provision for partial clearing of + leaf nodes. PKWARE uses the special code 256 (decimal) to indicate a + change in code size or a partial clear of the code tree: 256,1 for the + former and 256,2 for the latter. [Note that partial clearing can "orphan" + nodes: the parent-to-be can be cleared before its new child is added, + but the child is added anyway (as an orphan, as though the parent still + existed). When the tree fills up to the point where the parent node is + reused, the orphan is effectively "adopted." Versions prior to 1.05 were + affected more due to greater use of pointers (to children and siblings + as well as parents).] + + This replacement version of unshrink.c was written from scratch. It is + based only on the algorithms described in Mark Nelson's _The Data Compres- + sion Book_ and in Terry Welch's original paper in the June 1984 issue of + IEEE _Computer_; no existing source code, including any in Nelson's book, + was used. + + Memory requirements have been reduced in this version and are now no more + than the original Sam Smith code. This is still larger than any of the + other algorithms: at a minimum, 8K+8K+16K (stack+values+parents) assuming + 16-bit short ints, and this does not even include the output buffer (the + other algorithms leave the uncompressed data in the work area, typically + called slide[]). For machines with a 64KB data space this is a problem, + particularly when text conversion is required and line endings have more + than one character. UnZip's solution is to use two roughly equal halves + of outbuf for the ASCII conversion in such a case; the "unshrink" argument + to flush() signals that this is the case. + + For large-memory machines, a second outbuf is allocated for translations, + but only if unshrinking and only if translations are required. + + | binary mode | text mode + --------------------------------------------------- + big mem | big outbuf | big outbuf + big outbuf2 <- malloc'd here + small mem | small outbuf | half + half small outbuf + + Copyright 1994, 1995 Greg Roelofs. See the accompanying file "COPYING" + in UnZip 5.20 (or later) source or binary distributions. + + ---------------------------------------------------------------------------*/ + + +#define __UNSHRINK_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" /* defines LZW_CLEAN by default */ + + +#ifndef LZW_CLEAN + +static void partial_clear OF((__GPRO)); + +#ifdef DEBUG +# define OUTDBG(c) \ + if ((c)<32 || (c)>=127) fprintf(stderr,"\\x%02x",(c)); else putc((c),stderr); +#else +# define OUTDBG(c) +#endif + +/* HSIZE is defined as 2^13 (8192) in unzip.h */ +#define BOGUSCODE 256 +#define FLAG_BITS parent /* upper bits of parent[] used as flag bits */ +#define CODE_MASK (HSIZE - 1) /* 0x1fff (lower bits are parent's index) */ +#define FREE_CODE HSIZE /* 0x2000 (code is unused or was cleared) */ +#define HAS_CHILD (HSIZE << 1) /* 0x4000 (code has a child--do not clear) */ + +#define parent G.area.shrink.Parent +#define Value G.area.shrink.value /* "value" conflicts with Pyramid ioctl.h */ +#define stack G.area.shrink.Stack + + +/***********************/ +/* Function unshrink() */ +/***********************/ + +int unshrink(__G) + __GDEF +{ + int offset = (HSIZE - 1); + uch *stacktop = stack + offset; + register uch *newstr; + int codesize=9, len, KwKwK, error; + shrint code, oldcode, freecode, curcode; + shrint lastfreecode; + unsigned int outbufsiz; +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + /* Normally realbuf and outbuf will be the same. However, if the data + * are redirected to a large memory buffer, realbuf will point to the + * new location while outbuf will remain pointing to the malloc'd + * memory buffer. */ + uch *realbuf = G.outbuf; +#else +# define realbuf G.outbuf +#endif + + +/*--------------------------------------------------------------------------- + Initialize various variables. + ---------------------------------------------------------------------------*/ + + lastfreecode = BOGUSCODE; + +#ifndef VMS /* VMS uses its own buffer scheme for textmode flush(). */ +#ifndef SMALL_MEM + /* non-memory-limited machines: allocate second (large) buffer for + * textmode conversion in flush(), but only if needed */ + if (G.pInfo->textmode && !G.outbuf2 && + (G.outbuf2 = (uch *)malloc(TRANSBUFSIZ)) == (uch *)NULL) + return PK_MEM3; +#endif +#endif /* !VMS */ + + for (code = 0; code < BOGUSCODE; ++code) { + Value[code] = (uch)code; + parent[code] = BOGUSCODE; + } + for (code = BOGUSCODE+1; code < HSIZE; ++code) + parent[code] = FREE_CODE; + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) + if (G.redirect_slide) { /* use normal outbuf unless we're a DLL routine */ + realbuf = G.redirect_buffer; + outbufsiz = (unsigned)G.redirect_size; + } else +#endif +#ifdef DLL + if (G.pInfo->textmode && !G.redirect_data) +#else + if (G.pInfo->textmode) +#endif + outbufsiz = RAWBUFSIZ; + else + outbufsiz = OUTBUFSIZ; + G.outptr = realbuf; + G.outcnt = 0L; + +/*--------------------------------------------------------------------------- + Get and output first code, then loop over remaining ones. + ---------------------------------------------------------------------------*/ + + READBITS(codesize, oldcode) + if (!G.zipeof) { + *G.outptr++ = (uch)oldcode; + OUTDBG((uch)oldcode) + ++G.outcnt; + } + + do { + READBITS(codesize, code) + if (G.zipeof) + break; + if (code == BOGUSCODE) { /* possible to have consecutive escapes? */ + READBITS(codesize, code) + if (code == 1) { + ++codesize; + Trace((stderr, " (codesize now %d bits)\n", codesize)); + } else if (code == 2) { + Trace((stderr, " (partial clear code)\n")); + partial_clear(__G); /* clear leafs (nodes with no children) */ + Trace((stderr, " (done with partial clear)\n")); + lastfreecode = BOGUSCODE; /* reset start of free-node search */ + } + continue; + } + + /*----------------------------------------------------------------------- + Translate code: traverse tree from leaf back to root. + -----------------------------------------------------------------------*/ + + newstr = stacktop; + curcode = code; + + if (parent[curcode] == FREE_CODE) { + /* or (FLAG_BITS[curcode] & FREE_CODE)? */ + KwKwK = TRUE; + Trace((stderr, " (found a KwKwK code %d; oldcode = %d)\n", code, + oldcode)); + --newstr; /* last character will be same as first character */ + curcode = oldcode; + } else + KwKwK = FALSE; + + do { + *newstr-- = Value[curcode]; + curcode = (shrint)(parent[curcode] & CODE_MASK); + } while (curcode != BOGUSCODE); + + len = (int)(stacktop - newstr++); + if (KwKwK) + *stacktop = *newstr; + + /*----------------------------------------------------------------------- + Write expanded string in reverse order to output buffer. + -----------------------------------------------------------------------*/ + + Trace((stderr, "code %4d; oldcode %4d; char %3d (%c); string [", code, + oldcode, (int)(*newstr), (*newstr<32 || *newstr>=127)? ' ':*newstr)); + + { + register uch *p; + + for (p = newstr; p < newstr+len; ++p) { + *G.outptr++ = *p; + OUTDBG(*p) + if (++G.outcnt == outbufsiz) { + Trace((stderr, "doing flush(), outcnt = %lu\n", G.outcnt)); + if ((error = flush(__G__ realbuf, G.outcnt, TRUE)) != 0) { + Trace((stderr, "unshrink: flush() error (%d)\n", + error)); + return error; + } + G.outptr = realbuf; + G.outcnt = 0L; + Trace((stderr, "done with flush()\n")); + } + } + } + + /*----------------------------------------------------------------------- + Add new leaf (first character of newstr) to tree as child of oldcode. + -----------------------------------------------------------------------*/ + + /* search for freecode */ + freecode = (shrint)(lastfreecode + 1); + /* add if-test before loop for speed? */ + while (parent[freecode] != FREE_CODE) + ++freecode; + lastfreecode = freecode; + Trace((stderr, "]; newcode %d\n", freecode)); + + Value[freecode] = *newstr; + parent[freecode] = oldcode; + oldcode = code; + + } while (!G.zipeof); + +/*--------------------------------------------------------------------------- + Flush any remaining data and return to sender... + ---------------------------------------------------------------------------*/ + + if (G.outcnt > 0L) { + Trace((stderr, "doing final flush(), outcnt = %lu\n", G.outcnt)); + if ((error = flush(__G__ realbuf, G.outcnt, TRUE)) != 0) { + Trace((stderr, "unshrink: flush() error (%d)\n", error)); + return error; + } + Trace((stderr, "done with flush()\n")); + } + + return PK_OK; + +} /* end function unshrink() */ + + + + + +/****************************/ +/* Function partial_clear() */ /* no longer recursive... */ +/****************************/ + +static void partial_clear(__G) + __GDEF +{ + register shrint code; + + /* clear all nodes which have no children (i.e., leaf nodes only) */ + + /* first loop: mark each parent as such */ + for (code = BOGUSCODE+1; code < HSIZE; ++code) { + register shrint cparent = (shrint)(parent[code] & CODE_MASK); + + if (cparent > BOGUSCODE && cparent != FREE_CODE) + FLAG_BITS[cparent] |= HAS_CHILD; /* set parent's child-bit */ + } + + /* second loop: clear all nodes *not* marked as parents; reset flag bits */ + for (code = BOGUSCODE+1; code < HSIZE; ++code) { + if (FLAG_BITS[code] & HAS_CHILD) /* just clear child-bit */ + FLAG_BITS[code] &= ~HAS_CHILD; + else { /* leaf: lose it */ + Trace((stderr, "%d\n", code)); + parent[code] = FREE_CODE; + } + } + + return; +} + +#endif /* !LZW_CLEAN */ + +const char *BOINC_RCSID_c6ab4f7f3b = "$Id: unshrink.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzip.c boinc-7.0.14+dfsg/zip/unzip/unzip.c --- boinc-7.0.7+dfsg/zip/unzip/unzip.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzip.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1938 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unzip.c + + UnZip - a zipfile extraction utility. See below for make instructions, or + read the comments in Makefile and the various Contents files for more de- + tailed explanations. To report a bug, send a *complete* description to + Zip-Bugs@lists.wku.edu; include machine type, operating system and ver- + sion, compiler and version, and reasonably detailed error messages or prob- + lem report. To join Info-ZIP, see the instructions in README. + + UnZip 5.x is a greatly expanded and partially rewritten successor to 4.x, + which in turn was almost a complete rewrite of version 3.x. For a detailed + revision history, see UnzpHist.zip at quest.jpl.nasa.gov. For a list of + the many (near infinite) contributors, see "CONTRIBS" in the UnZip source + distribution. + + --------------------------------------------------------------------------- + + [from original zipinfo.c] + + This program reads great gobs of totally nifty information, including the + central directory stuff, from ZIP archives ("zipfiles" for short). It + started as just a testbed for fooling with zipfiles, but at this point it + is actually a useful utility. It also became the basis for the rewrite of + UnZip (3.16 -> 4.0), using the central directory for processing rather than + the individual (local) file headers. + + As of ZipInfo v2.0 and UnZip v5.1, the two programs are combined into one. + If the executable is named "unzip" (or "unzip.exe", depending), it behaves + like UnZip by default; if it is named "zipinfo" or "ii", it behaves like + ZipInfo. The ZipInfo behavior may also be triggered by use of unzip's -Z + option; for example, "unzip -Z [zipinfo_options] archive.zip". + + Another dandy product from your buddies at Newtware! + + Author: Greg Roelofs, newt@pobox.com, http://pobox.com/~newt/ + 23 August 1990 -> April 1997 + + --------------------------------------------------------------------------- + + Version: unzip5??.{tar.Z | tar.gz | zip} for Unix, VMS, OS/2, MS-DOS, Amiga, + Atari, Windows 3.x/95/NT/CE, Macintosh, Human68K, Acorn RISC OS, + BeOS, SMS/QDOS, VM/CMS, MVS, AOS/VS, Tandem NSK, Theos and + TOPS-20. + + Copyrights: see accompanying file "LICENSE" in UnZip source distribution. + (This software is free but NOT IN THE PUBLIC DOMAIN.) + + ---------------------------------------------------------------------------*/ + + + +#define __UNZIP_C /* identifies this source module */ +#define UNZIP_INTERNAL +#include "unzip.h" /* includes, typedefs, macros, prototypes, etc. */ +//#include "crypt.h" +#include "unzvers.h" + +#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */ + +/***************************/ +/* Local type declarations */ +/***************************/ + +#ifdef REENTRANT +typedef struct _sign_info + { + struct _sign_info *previous; + void (*sighandler)(int); + int sigtype; + } savsigs_info; +#endif + +/*******************/ +/* Local Functions */ +/*******************/ + +#ifdef REENTRANT +static int setsignalhandler OF((__GPRO__ savsigs_info **p_savedhandler_chain, + int signal_type, void (*newhandler)(int))); +#endif +#ifndef SFX +static void show_version_info OF((__GPRO)); +#endif + + +/*************/ +/* Constants */ +/*************/ + +#include "consts.h" /* all constant global variables are in here */ + /* (non-constant globals were moved to globals.c) */ + +/* constant local variables: */ + +#ifndef SFX + static ZCONST char Far EnvUnZip[] = ENV_UNZIP; + static ZCONST char Far EnvUnZip2[] = ENV_UNZIP2; + static ZCONST char Far EnvZipInfo[] = ENV_ZIPINFO; + static ZCONST char Far EnvZipInfo2[] = ENV_ZIPINFO2; +#ifdef RISCOS + static ZCONST char Far EnvUnZipExts[] = ENV_UNZIPEXTS; +#endif /* RISCOS */ + static ZCONST char Far NoMemArguments[] = + "envargs: cannot get memory for arguments"; +#endif + +#ifdef REENTRANT + static ZCONST char Far CantSaveSigHandler[] = + "error: cannot save signal handler settings\n"; +#endif + +#if (!defined(SFX) || defined(SFX_EXDIR)) + static ZCONST char Far NotExtracting[] = + "caution: not extracting; -d ignored\n"; + static ZCONST char Far MustGiveExdir[] = + "error: must specify directory to which to extract with -d option\n"; + static ZCONST char Far OnlyOneExdir[] = + "error: -d option used more than once (only one exdir allowed)\n"; +#endif + +#if CRYPT + static ZCONST char Far MustGivePasswd[] = + "error: must give decryption password with -P option\n"; +#endif + +#ifndef SFX + static ZCONST char Far Zfirst[] = + "error: -Z must be first option for ZipInfo mode (check UNZIP variable?)\n"; +#endif +static ZCONST char Far InvalidOptionsMsg[] = "error:\ + -fn or any combination of -c, -l, -p, -t, -u and -v options invalid\n"; +static ZCONST char Far IgnoreOOptionMsg[] = + "caution: both -n and -o specified; ignoring -o\n"; + +/* usage() strings */ +#ifndef SFX +#ifdef VMS + static ZCONST char Far Example3[] = "vms.c"; + static ZCONST char Far Example2[] = " unzip\ + \"-V\" foo \"Bar\" => must quote uppercase options and filenames in VMS\n"; +#else /* !VMS */ + static ZCONST char Far Example3[] = "ReadMe"; +#ifdef RISCOS + static ZCONST char Far Example2[] = +" unzip foo -d RAM:$ => extract all files from foo into RAMDisc\n"; +#else /* !RISCOS */ +#if (defined(OS2) || (defined(DOS_FLX_OS2_W32) && defined(MORE))) + static ZCONST char Far Example2[] = + ""; /* no room: too many local3[] items */ +#else /* !OS2 */ +#ifdef MACOS + static ZCONST char Far Example2[] = ""; /* not needed */ +#else /* !MACOS */ + static ZCONST char Far Example2[] = " \ + unzip -p foo | more => send contents of foo.zip via pipe into program more\n"; +#endif /* ?MACOS */ +#endif /* ?OS2 */ +#endif /* ?RISCOS */ +#endif /* ?VMS */ + +/* local1[]: command options */ +#if (defined(DLL) && defined(API_DOC)) + static ZCONST char Far local1[] = + " -A print extended help for API functions"; +#else /* !(DLL && API_DOC) */ + static ZCONST char Far local1[] = ""; +#endif /* ?(DLL && API_DOC) */ + +/* local2[] and local3[]: modifier options */ +#ifdef DOS_FLX_H68_OS2_W32 +#ifdef FLEXOS + static ZCONST char Far local2[] = ""; +#else + static ZCONST char Far local2[] = + " -$ label removables (-$$ => fixed disks)"; +#endif +#ifdef OS2 +#ifdef MORE + static ZCONST char Far local3[] = "\ + -X restore ACLs if supported -s spaces in filenames => '_'\n\ + -M pipe through \"more\" pager\n"; +#else + static ZCONST char Far local3[] = " \ + -X restore ACLs if supported -s spaces in filenames => '_'\n\n"; +#endif /* ?MORE */ +#else /* !OS2 */ +#ifdef WIN32 +#ifdef NTSD_EAS +#ifdef MORE + static ZCONST char Far local3[] = "\ + -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\ + -M pipe through \"more\" pager\n"; +#else + static ZCONST char Far local3[] = " \ + -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\n"; +#endif /* ?MORE */ +#else /* !NTSD_EAS */ +#ifdef MORE + static ZCONST char Far local3[] = "\ + -M pipe through \"more\" pager \ + -s spaces in filenames => '_'\n\n"; +#else + static ZCONST char Far local3[] = " \ + -s spaces in filenames => '_'\n\n"; +#endif /* ?MORE */ +#endif /* ?NTSD_EAS */ +#else /* !WIN32 */ +#ifdef MORE + static ZCONST char Far local3[] = " -\ +M pipe through \"more\" pager -s spaces in filenames => '_'\n\n"; +#else + static ZCONST char Far local3[] = "\ + -s spaces in filenames => '_'\n"; +#endif +#endif /* ?WIN32 */ +#endif /* ?OS2 || ?WIN32 */ +#else /* !DOS_FLX_OS2_W32 */ +#ifdef VMS + static ZCONST char Far local2[] = "\"-X\" restore owner/protection info"; +#ifdef MORE + static ZCONST char Far local3[] = " \ + \"-M\" pipe through \"more\" pager\n"; +#else + static ZCONST char Far local3[] = "\n"; +#endif +#else /* !VMS */ +#ifdef BEO_UNX + static ZCONST char Far local2[] = " -X restore UID/GID info"; +#ifdef MORE + static ZCONST char Far local3[] = "\ + -M pipe through \"more\" pager\n"; +#else + static ZCONST char Far local3[] = "\n"; +#endif +#else /* !BEO_UNX */ +#ifdef TANDEM + static ZCONST char Far local2[] = " -X restore Tandem User ID"; +#ifdef MORE + static ZCONST char Far local3[] = "\ + -b create 'C' (180) text files -M pipe through \"more\" pager\n"; +#else + static ZCONST char Far local3[] = " -b create 'C' (180) text files\n"; +#endif +#else /* !TANDEM */ +#ifdef AMIGA + static ZCONST char Far local2[] = " -N restore comments as filenotes"; +#ifdef MORE + static ZCONST char Far local3[] = " \ + -M pipe through \"more\" pager\n"; +#else + static ZCONST char Far local3[] = "\n"; +#endif +#else /* !AMIGA */ +#ifdef MACOS + static ZCONST char Far local2[] = " -E show Mac info during extraction"; + static ZCONST char Far local3[] = " \ + -i ignore filenames in mac extra info -J junk (ignore) Mac extra info\n\ +\n"; +#else /* !MACOS */ +#ifdef MORE + static ZCONST char Far local2[] = " -M pipe through \"more\" pager"; + static ZCONST char Far local3[] = "\n"; +#else + static ZCONST char Far local2[] = ""; /* Atari, Mac, CMS/MVS etc. */ + static ZCONST char Far local3[] = ""; +#endif +#endif /* ?MACOS */ +#endif /* ?AMIGA */ +#endif /* ?TANDEM */ +#endif /* ?BEO_UNX */ +#endif /* ?VMS */ +#endif /* ?DOS_FLX_OS2_W32 */ +#endif /* !SFX */ + +#ifndef NO_ZIPINFO +#ifdef VMS + static ZCONST char Far ZipInfoExample[] = "* or % (e.g., \"*font-%.zip\")"; +#else + static ZCONST char Far ZipInfoExample[] = "*, ?, [] (e.g., \"[a-j]*.zip\")"; +#endif + +static ZCONST char Far ZipInfoUsageLine1[] = "\ +ZipInfo %d.%d%d%s of %s, by Greg Roelofs and the Info-ZIP group.\n\ +\n\ +List name, date/time, attribute, size, compression method, etc., about files\n\ +in list (excluding those in xlist) contained in the specified .zip archive(s).\ +\n\"file[.zip]\" may be a wildcard name containing %s.\n\n\ + usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n\ + or: unzip %s-Z%s [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n"; + +static ZCONST char Far ZipInfoUsageLine2[] = "\nmain\ + listing-format options: -s short Unix \"ls -l\" format (def.)\n\ + -1 filenames ONLY, one per line -m medium Unix \"ls -l\" format\n\ + -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\ + -v verbose, multi-page format\n"; + +static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ + -h print header line -t print totals for listed files or for all\n\ + -z print zipfile comment %c-T%c print file times in sortable decimal format\ +\n %c-C%c be case-insensitive %s\ + -x exclude filenames that follow from listing\n"; +#ifdef MORE +#ifdef VMS + static ZCONST char Far ZipInfoUsageLine4[] = + " \"-M\" page output through built-in \"more\"\n"; +#else + static ZCONST char Far ZipInfoUsageLine4[] = + " -M page output through built-in \"more\"\n"; +#endif +#else /* !MORE */ + static ZCONST char Far ZipInfoUsageLine4[] = ""; +#endif /* ?MORE */ +#endif /* !NO_ZIPINFO */ + +#ifdef BETA +# ifdef VMSCLI + /* BetaVersion[] is also used in vms/cmdline.c: do not make it static */ + ZCONST char Far BetaVersion[] = "%s\ + THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; +# else + static ZCONST char Far BetaVersion[] = "%s\ + THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; +# endif +#endif + +#ifdef SFX +# ifdef VMSCLI + /* UnzipSFXBanner[] is also used in vms/cmdline.c: do not make it static */ + ZCONST char Far UnzipSFXBanner[] = +# else + static ZCONST char Far UnzipSFXBanner[] = +# endif + "UnZipSFX %d.%d%d%s of %s, by Info-ZIP (Zip-Bugs@lists.wku.edu).\n"; +# ifdef SFX_EXDIR + static ZCONST char Far UnzipSFXOpts[] = + "Valid options are -tfupcz and -d ; modifiers are -abjnoqCL%sV%s.\n"; +# else + static ZCONST char Far UnzipSFXOpts[] = + "Valid options are -tfupcz; modifiers are -abjnoqCL%sV%s.\n"; +# endif +#else /* !SFX */ + static ZCONST char Far CompileOptions[] = + "UnZip special compilation options:\n"; + static ZCONST char Far CompileOptFormat[] = "\t%s\n"; + static ZCONST char Far EnvOptions[] = + "\nUnZip and ZipInfo environment options:\n"; + static ZCONST char Far EnvOptFormat[] = "%16s: %s\n"; + static ZCONST char Far None[] = "[none]"; +# ifdef ACORN_FTYPE_NFS + static ZCONST char Far AcornFtypeNFS[] = "ACORN_FTYPE_NFS"; +# endif +# ifdef ASM_CRC + static ZCONST char Far AsmCRC[] = "ASM_CRC"; +# endif +# ifdef ASM_INFLATECODES + static ZCONST char Far AsmInflateCodes[] = "ASM_INFLATECODES"; +# endif +# ifdef CHECK_VERSIONS + static ZCONST char Far Check_Versions[] = "CHECK_VERSIONS"; +# endif +# ifdef COPYRIGHT_CLEAN + static ZCONST char Far Copyright_Clean[] = + "COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)"; +# endif +# ifdef DEBUG + static ZCONST char Far UDebug[] = "DEBUG"; +# endif +# ifdef DEBUG_TIME + static ZCONST char Far DebugTime[] = "DEBUG_TIME"; +# endif +# ifdef DLL + static ZCONST char Far Dll[] = "DLL"; +# endif +# ifdef DOSWILD + static ZCONST char Far DosWild[] = "DOSWILD"; +# endif +# ifdef LZW_CLEAN + static ZCONST char Far LZW_Clean[] = + "LZW_CLEAN (PKZIP/Zip 1.x unshrinking method not supported)"; +# endif +# ifndef MORE + static ZCONST char Far No_More[] = "NO_MORE"; +# endif +# ifdef NO_ZIPINFO + static ZCONST char Far No_ZipInfo[] = "NO_ZIPINFO"; +# endif +# ifdef NTSD_EAS + static ZCONST char Far NTSDExtAttrib[] = "NTSD_EAS"; +# endif +# ifdef OLD_THEOS_EXTRA + static ZCONST char Far OldTheosExtra[] = + "OLD_THEOS_EXTRA (handle also old Theos port extra field)"; +# endif +# ifdef OS2_EAS + static ZCONST char Far OS2ExtAttrib[] = "OS2_EAS"; +# endif +# ifdef QLZIP + static ZCONST char Far SMSExFldOnUnix[] = "QLZIP"; +# endif +# ifdef REENTRANT + static ZCONST char Far Reentrant[] = "REENTRANT"; +# endif +# ifdef REGARGS + static ZCONST char Far RegArgs[] = "REGARGS"; +# endif +# ifdef RETURN_CODES + static ZCONST char Far Return_Codes[] = "RETURN_CODES"; +# endif +# ifdef SET_DIR_ATTRIB + static ZCONST char Far SetDirAttrib[] = "SET_DIR_ATTRIB"; +# endif +# ifdef TIMESTAMP + static ZCONST char Far TimeStamp[] = "TIMESTAMP"; +# endif +# ifdef UNIXBACKUP + static ZCONST char Far UnixBackup[] = "UNIXBACKUP"; +# endif +# ifdef USE_EF_UT_TIME + static ZCONST char Far Use_EF_UT_time[] = "USE_EF_UT_TIME"; +# endif +# ifndef LZW_CLEAN + static ZCONST char Far Use_Unshrink[] = + "USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)"; +# endif +# ifndef COPYRIGHT_CLEAN + static ZCONST char Far Use_Smith_Code[] = + "USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)"; +# endif +# ifdef USE_DEFLATE64 + static ZCONST char Far Use_Deflate64[] = + "USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)"; +# endif +# ifdef MULT_VOLUME + static ZCONST char Far Use_MultiVol[] = + "MULT_VOLUME (multi-volume archives supported)"; +# endif +# if (defined(__DJGPP__) && (__DJGPP__ >= 2)) +# ifdef USE_DJGPP_ENV + static ZCONST char Far Use_DJGPP_Env[] = "USE_DJGPP_ENV"; +# endif +# ifdef USE_DJGPP_GLOB + static ZCONST char Far Use_DJGPP_Glob[] = "USE_DJGPP_GLOB"; +# endif +# endif /* __DJGPP__ && (__DJGPP__ >= 2) */ +# ifdef USE_VFAT + static ZCONST char Far Use_VFAT_support[] = "USE_VFAT"; +# endif +# ifdef USE_ZLIB + static ZCONST char Far UseZlib[] = + "USE_ZLIB (compiled with version %s; using version %s)"; +# endif +# ifdef VMS_TEXT_CONV + static ZCONST char Far VmsTextConv[] = "VMS_TEXT_CONV"; +# endif +# ifdef VMSCLI + static ZCONST char Far VmsCLI[] = "VMSCLI"; +# endif +# ifdef VMSWILD + static ZCONST char Far VmsWild[] = "VMSWILD"; +# endif +# ifdef WILD_STOP_AT_DIR + static ZCONST char Far WildStopAtDir[] = "WILD_STOP_AT_DIR"; +# endif +# if CRYPT +# ifdef PASSWD_FROM_STDIN + static ZCONST char Far PasswdStdin[] = "PASSWD_FROM_STDIN"; +# endif + static ZCONST char Far Decryption[] = + "\t[decryption, version %d.%d%s of %s]\n"; + static ZCONST char Far CryptDate[] = CR_VERSION_DATE; +# endif +# ifndef __RSXNT__ +# ifdef __EMX__ + static ZCONST char Far EnvEMX[] = "EMX"; + static ZCONST char Far EnvEMXOPT[] = "EMXOPT"; +# endif +# if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) + static ZCONST char Far EnvGO32[] = "GO32"; + static ZCONST char Far EnvGO32TMP[] = "GO32TMP"; +# endif +# endif /* !__RSXNT__ */ + +#ifdef VMS +/* UnzipUsageLine1[] is also used in vms/cmdline.c: do not make it static */ + ZCONST char Far UnzipUsageLine1[] = "\ +UnZip %d.%d%d%s of %s, by Info-ZIP. For more details see: unzip -v.\n\n"; +#ifdef COPYRIGHT_CLEAN + static ZCONST char Far UnzipUsageLine1v[] = "\ +UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ +bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.\ +\n\n"; +#else + static ZCONST char Far UnzipUsageLine1v[] = "\ +UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ +Send bug reports to authors at Zip-Bugs@lists.wku.edu; see README for details.\ +\n\n"; +#endif /* ?COPYRIGHT_CLEAN */ +#else /* !VMS */ +#ifdef COPYRIGHT_CLEAN + static ZCONST char Far UnzipUsageLine1[] = "\ +UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ +bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.\ +\n\n"; +#else + static ZCONST char Far UnzipUsageLine1[] = "\ +UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ +Send bug reports to authors at Zip-Bugs@lists.wku.edu; see README for details.\ +\n\n"; +#endif /* ?COPYRIGHT_CLEAN */ +#define UnzipUsageLine1v UnzipUsageLine1 +#endif /* ?VMS */ + +static ZCONST char Far UnzipUsageLine2v[] = "\ +Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;\ +\nsee ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.\ +\n\n"; + +#ifdef MACOS +static ZCONST char Far UnzipUsageLine2[] = "\ +Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-d exdir]\n \ + Default action is to extract files in list, to exdir;\n\ + file[.zip] may be a wildcard. %s\n"; +#else /* !MACOS */ +#ifdef VM_CMS +static ZCONST char Far UnzipUsageLine2[] = "\ +Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d fm]\n \ + Default action is to extract files in list, except those in xlist, to disk fm;\ +\n file[.zip] may be a wildcard. %s\n"; +#else /* !VM_CMS */ +static ZCONST char Far UnzipUsageLine2[] = "\ +Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]\n \ + Default action is to extract files in list, except those in xlist, to exdir;\n\ + file[.zip] may be a wildcard. %s\n"; +#endif /* ?VM_CMS */ +#endif /* ?MACOS */ + +#ifdef NO_ZIPINFO +# define ZIPINFO_MODE_OPTION "" + static ZCONST char Far ZipInfoMode[] = + "(ZipInfo mode is disabled in this version.)"; +#else +# define ZIPINFO_MODE_OPTION "[-Z] " +# ifdef VMS + static ZCONST char Far ZipInfoMode[] = + "\"-Z\" => ZipInfo mode (`unzip \"-Z\"' for usage)."; +# else + static ZCONST char Far ZipInfoMode[] = + "-Z => ZipInfo mode (\"unzip -Z\" for usage)."; +# endif +#endif /* ?NO_ZIPINFO */ + +#ifdef VMS + static ZCONST char Far VMSusageLine2b[] = "\ +=> define foreign command symbol in LOGIN.COM: $ unzip :== $dev:[dir]unzip.exe\ +\n"; +#endif + +#ifdef MACOS +static ZCONST char Far UnzipUsageLine3[] = "\n\ + -d extract files into exdir -l list files (short format)\n\ + -f freshen existing files, create none -t test compressed archive data\n\ + -u update files, create if necessary -z display archive comment\n\ +%s\n"; +#else /* !MACOS */ +#ifdef VM_CMS +static ZCONST char Far UnzipUsageLine3[] = "\n\ + -p extract files to pipe, no messages -l list files (short format)\n\ + -f freshen existing files, create none -t test compressed archive data\n\ + -u update files, create if necessary -z display archive comment\n\ + -x exclude files that follow (in xlist) -d extract files onto disk fm\n\ +%s\n"; +#else /* !VM_CMS */ +static ZCONST char Far UnzipUsageLine3[] = "\n\ + -p extract files to pipe, no messages -l list files (short format)\n\ + -f freshen existing files, create none -t test compressed archive data\n\ + -u update files, create if necessary -z display archive comment\n\ + -x exclude files that follow (in xlist) -d extract files into exdir\n\ +%s\n"; +#endif /* ?VM_CMS */ +#endif /* ?MACOS */ + +static ZCONST char Far UnzipUsageLine4[] = "\ +modifiers: -q quiet mode (-qq => quieter)\n\ + -n never overwrite existing files -a auto-convert any text files\n\ + -o overwrite files WITHOUT prompting -aa treat ALL files as text\n \ + -j junk paths (do not make directories) -v be verbose/print version info\n\ + %c-C%c match filenames case-insensitively %c-L%c make (some) names \ +lowercase\n %-42s %c-V%c retain VMS version numbers\n%s"; + +static ZCONST char Far UnzipUsageLine5[] = "\ +Examples (see unzip.txt for more info):\n\ + unzip data1 -x joe => extract all files except joe from zipfile data1.zip\n\ +%s\ + unzip -fo foo %-6s => quietly replace existing %s if archive file newer\n"; +#endif /* ?SFX */ + + + + + +/*****************************/ +/* main() / UzpMain() stub */ +/*****************************/ +#include // for jmp stuff + +// set jump point +jmp_buf unzipdll_error_return; +int jmperrcode; + + +int unzip_main(argc, argv) /* return PK-type error code (except under VMS) */ + int argc; + char **argv; +{ + int r; + + CONSTRUCTGLOBALS(); + r = unzip(__G__ argc, argv); + DESTROYGLOBALS(); + RETURN(r); +} + + + + +/*******************************/ +/* Primary UnZip entry point */ +/*******************************/ + +int unzip(__G__ argc, argv) + __GDEF + int argc; + char *argv[]; +{ + +#ifndef NO_ZIPINFO + char *p; +#endif +#ifdef DOS_FLX_H68_NLM_OS2_W32 + int i; +#endif + int retcode,error=FALSE; + + SETLOCALE(LC_CTYPE,""); + +#if (defined(__IBMC__) && defined(__DEBUG_ALLOC__)) + extern void DebugMalloc(void); + + atexit(DebugMalloc); +#endif + +#ifdef MALLOC_WORK + /* The following (rather complex) expression determines the allocation + size of the decompression work area. It simulates what the + combined "union" and "struct" declaration of the "static" work + area reservation achieves automatically at compile time. + Any decent compiler should evaluate this expression completely at + compile time and provide constants to the zcalloc() call. + (For better readability, some subexpressions are encapsulated + in temporarly defined macros.) + */ +# define UZ_SLIDE_CHUNK (sizeof(shrint)+sizeof(uch)+sizeof(uch)) +# define UZ_NUMOF_CHUNKS \ + (unsigned)(((WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK > HSIZE) ? \ + (WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK : HSIZE) + G.area.Slide = (uch *)zcalloc(UZ_NUMOF_CHUNKS, UZ_SLIDE_CHUNK); +# undef UZ_SLIDE_CHUNK +# undef UZ_NUMOF_CHUNKS + G.area.shrink.Parent = (shrint *)G.area.Slide; + G.area.shrink.value = G.area.Slide + (sizeof(shrint)*(HSIZE)); + G.area.shrink.Stack = G.area.Slide + + (sizeof(shrint) + sizeof(uch))*(HSIZE); +#endif + +/*--------------------------------------------------------------------------- + Set signal handler for restoring echo, warn of zipfile corruption, etc. + ---------------------------------------------------------------------------*/ + jmperrcode = setjmp(unzipdll_error_return); + if (jmperrcode) { + return jmperrcode; + } + +#if (defined(WIN32) && defined(__RSXNT__)) + for (i = 0 ; i < argc; i++) { + _ISO_INTERN(argv[i]); + } +#endif + +/*--------------------------------------------------------------------------- + Macintosh initialization code. + ---------------------------------------------------------------------------*/ + +#ifdef MACOS + { + int a; + + for (a = 0; a < 4; ++a) + G.rghCursor[a] = GetCursor(a+128); + G.giCursor = 0; + } +#endif + +/*--------------------------------------------------------------------------- + NetWare initialization code. + ---------------------------------------------------------------------------*/ + +#ifdef NLM + InitUnZipConsole(); +#endif + +/*--------------------------------------------------------------------------- + Acorn RISC OS initialization code. + ---------------------------------------------------------------------------*/ + +#ifdef RISCOS + set_prefix(); +#endif + +/*--------------------------------------------------------------------------- + Theos initialization code. + ---------------------------------------------------------------------------*/ + +#ifdef THEOS + /* The easiest way found to force creation of libraries when selected + * members are to be unzipped. Explicitely add libraries names to the + * arguments list before the first member of the library. + */ + if (! _setargv(&argc, &argv)) { + Info(slide, 0x401, ((char *)slide, "cannot process argv\n")); + retcode = PK_MEM; + goto cleanup_and_exit; + } +#endif + +/*--------------------------------------------------------------------------- + First figure out if we're running in UnZip mode or ZipInfo mode, and put + the appropriate environment-variable options into the queue. Then rip + through any command-line options lurking about... + ---------------------------------------------------------------------------*/ + +#ifdef SFX + G.argv0 = argv[0]; +#if (defined(OS2) || defined(WIN32)) + G.zipfn = GetLoadPath(__G);/* non-MSC NT puts path into G.filename[] */ +#else + G.zipfn = G.argv0; +#endif + +#ifdef VMSCLI + { + ulg status = vms_unzip_cmdline(&argc, &argv); + if (!(status & 1)) { + retcode = (int)status; + goto cleanup_and_exit; + } + } +#endif /* VMSCLI */ + + uO.zipinfo_mode = FALSE; + error = uz_opts(__G__ &argc, &argv); /* UnZipSFX call only */ + +#else /* !SFX */ + +#ifdef RISCOS + /* get the extensions to swap from environment */ + getRISCOSexts(ENV_UNZIPEXTS); +#endif + +#ifdef MSDOS + /* extract MKS extended argument list from environment (before envargs!) */ + mksargs(&argc, &argv); +#endif + +#ifdef VMSCLI + { + ulg status = vms_unzip_cmdline(&argc, &argv); + if (!(status & 1)) { + retcode = (int)status; + goto cleanup_and_exit; + } + } +#endif /* VMSCLI */ + + G.noargs = (argc == 1); /* no options, no zipfile, no anything */ + +#ifndef NO_ZIPINFO + for (p = argv[0] + strlen(argv[0]); p >= argv[0]; --p) { + if (*p == DIR_END +#ifdef DIR_END2 + || *p == DIR_END2 +#endif + ) + break; + } + ++p; + +#ifdef THEOS + if (strncmp(p, "ZIPINFO.",8) == 0 || strstr(p, ".ZIPINFO:") != NULL || + strncmp(p, "II.",3) == 0 || strstr(p, ".II:") != NULL || +#else + if (STRNICMP(p, LoadFarStringSmall(Zipnfo), 7) == 0 || + STRNICMP(p, "ii", 2) == 0 || +#endif + (argc > 1 && strncmp(argv[1], "-Z", 2) == 0)) + { + uO.zipinfo_mode = TRUE; + if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvZipInfo), + LoadFarStringSmall2(EnvZipInfo2))) != PK_OK) + perror(LoadFarString(NoMemArguments)); + else + error = zi_opts(__G__ &argc, &argv); + } else +#endif /* NO_ZIPINFO */ + { + uO.zipinfo_mode = FALSE; + if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvUnZip), + LoadFarStringSmall2(EnvUnZip2))) != PK_OK) + perror(LoadFarString(NoMemArguments)); + else + error = uz_opts(__G__ &argc, &argv); + } + +#endif /* ?SFX */ + + if ((argc < 0) || error) { + retcode = error; + goto cleanup_and_exit; + } + +/*--------------------------------------------------------------------------- + Now get the zipfile name from the command line and then process any re- + maining options and file specifications. + ---------------------------------------------------------------------------*/ + +#ifdef DOS_FLX_H68_NLM_OS2_W32 + /* convert MSDOS-style 'backward slash' directory separators to Unix-style + * 'forward slashes' for user's convenience (include zipfile name itself) + */ +#ifdef SFX + for (G.pfnames = argv, i = argc; i > 0; --i) { +#else + /* argc does not include the zipfile specification */ + for (G.pfnames = argv, i = argc+1; i > 0; --i) { +#endif +#ifdef __human68k__ + extern char *_toslash(char *); + _toslash(*G.pfnames); +#else /* !__human68k__ */ + char *q; + + for (q = *G.pfnames; *q; ++q) + if (*q == '\\') + *q = '/'; + ++G.pfnames; +#endif /* ?__human68k__ */ + } +#endif /* DOS_FLX_H68_NLM_OS2_W32 */ + +#ifndef SFX + G.wildzipfn = *argv++; +#endif + +#if (defined(SFX) && !defined(SFX_EXDIR)) /* only check for -x */ + + G.filespecs = argc; + G.xfilespecs = 0; + + if (argc > 0) { + char **pp = argv-1; + + G.pfnames = argv; + while (*++pp) + if (strcmp(*pp, "-x") == 0) { + if (pp > argv) { + *pp = 0; /* terminate G.pfnames */ + G.filespecs = pp - G.pfnames; + } else { + G.pfnames = (char **)fnames; /* defaults */ + G.filespecs = 0; + } + G.pxnames = pp + 1; /* excluded-names ptr: _after_ -x */ + G.xfilespecs = argc - G.filespecs - 1; + break; /* skip rest of args */ + } + G.process_all_files = FALSE; + } else + G.process_all_files = TRUE; /* for speed */ + +#else /* !SFX || SFX_EXDIR */ /* check for -x or -d */ + + G.filespecs = argc; + G.xfilespecs = 0; + + if (argc > 0) { + int in_files=FALSE, in_xfiles=FALSE, ctr=0; // needs a counter loop + char **pp = argv-1; + + G.process_all_files = FALSE; + G.pfnames = argv; + while (*++pp && ctr 0 && *argv != NULL && **argv == '-')) { + s = *argv + 1; + while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ +#ifdef CMS_MVS + switch (tolower(c)) +#else + switch (c) +#endif + { + case ('-'): + ++negative; + break; +#ifdef RISCOS + case ('/'): + if (negative) { /* negative not allowed with -/ swap */ + Info(slide, 0x401, ((char *)slide, + "error: must give extensions list")); + return(PK_PARAM); /* don't extract here by accident */ + } + exts2swap = s; /* override Unzip$Exts */ + s += strlen(s); + break; +#endif + case ('a'): + if (negative) { + uO.aflag = MAX(uO.aflag-negative,0); + negative = 0; + } else + ++uO.aflag; + break; +#if (defined(DLL) && defined(API_DOC)) + case ('A'): /* extended help for API */ + APIhelp(__G__ argc, argv); + *pargc = -1; /* signal to exit successfully */ + return 0; +#endif + case ('b'): + if (negative) { +#if (defined(TANDEM) || defined(VMS)) + uO.bflag = MAX(uO.bflag-negative,0); +#endif + negative = 0; /* do nothing: "-b" is default */ + } else { +#ifdef VMS + if (uO.aflag == 0) + ++uO.bflag; +#endif +#ifdef TANDEM + ++uO.bflag; +#endif + uO.aflag = 0; + } + break; +#ifdef UNIXBACKUP + case ('B'): /* -B: back up existing files */ + if (negative) + uO.B_flag = FALSE, negative = 0; + else + uO.B_flag = TRUE; + break; +#endif + case ('c'): + if (negative) { + uO.cflag = FALSE, negative = 0; +#ifdef NATIVE + uO.aflag = 0; +#endif + } else { + uO.cflag = TRUE; +#ifdef NATIVE + uO.aflag = 2; /* so you can read it on the screen */ +#endif +#ifdef DLL + if (G.redirect_text) + G.redirect_data = 2; +#endif + } + break; +#ifndef CMS_MVS + case ('C'): /* -C: match filenames case-insensitively */ + if (negative) + uO.C_flag = FALSE, negative = 0; + else + uO.C_flag = TRUE; + break; +#endif /* !CMS_MVS */ +#if (!defined(SFX) || defined(SFX_EXDIR)) + case ('d'): + if (negative) { /* negative not allowed with -d exdir */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(MustGiveExdir))); + return(PK_PARAM); /* don't extract here by accident */ + } + if (uO.exdir != (char *)NULL) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(OnlyOneExdir))); + return(PK_PARAM); /* GRR: stupid restriction? */ + } else { + /* first check for "-dexdir", then for "-d exdir" */ + uO.exdir = s; + if (*uO.exdir == '\0') { + if (argc > 1) { + --argc; + uO.exdir = *++argv; + if (*uO.exdir == '-') { + Info(slide, 0x401, ((char *)slide, + LoadFarString(MustGiveExdir))); + return(PK_PARAM); + } + /* else uO.exdir points at extraction dir */ + } else { + Info(slide, 0x401, ((char *)slide, + LoadFarString(MustGiveExdir))); + return(PK_PARAM); + } + } + /* uO.exdir now points at extraction dir (-dexdir or + * -d exdir); point s at end of exdir to avoid mis- + * interpretation of exdir characters as more options + */ + if (*s != 0) + while (*++s != 0) + ; + } + break; +#endif /* !SFX || SFX_EXDIR */ + case ('e'): /* just ignore -e, -x options (extract) */ + break; +#ifdef MACOS + case ('E'): /* -E [MacOS] display Mac e.f. when restoring */ + if( negative ) { + uO.E_flag = FALSE, negative = 0; + } else { + uO.E_flag = TRUE; + } + break; +#endif /* MACOS */ + case ('f'): /* "freshen" (extract only newer files) */ + if (negative) + uO.fflag = uO.uflag = FALSE, negative = 0; + else + uO.fflag = uO.uflag = TRUE; + break; +#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) + case ('F'): /* Acorn filetype & NFS extension handling */ + if (negative) + uO.acorn_nfs_ext = FALSE, negative = 0; + else + uO.acorn_nfs_ext = TRUE; + break; +#endif /* RISCOS || ACORN_FTYPE_NFS */ + case ('h'): /* just print help message and quit */ + *pargc = -1; + return USAGE(PK_OK); +#ifdef MACOS + case ('i'): /* -i [MacOS] ignore filenames stored in Mac ef */ + if( negative ) { + uO.i_flag = FALSE, negative = 0; + } else { + uO.i_flag = TRUE; + } + break; +#endif /* MACOS */ + case ('j'): /* junk pathnames/directory structure */ + if (negative) + uO.jflag = FALSE, negative = 0; + else + uO.jflag = TRUE; + break; +#if (defined(__BEOS__) || defined(MACOS)) + case ('J'): /* Junk BeOS or MacOS file attributes */ + if( negative ) { + uO.J_flag = FALSE, negative = 0; + } else { + uO.J_flag = TRUE; + } + break; +#endif /* __BEOS__ || MACOS */ +#ifndef SFX + case ('l'): + if (negative) { + uO.vflag = MAX(uO.vflag-negative,0); + negative = 0; + } else + ++uO.vflag; + break; +#endif /* !SFX */ +#ifndef CMS_MVS + case ('L'): /* convert (some) filenames to lowercase */ + if (negative) { + uO.L_flag = MAX(uO.L_flag-negative,0); + negative = 0; + } else + ++uO.L_flag; + break; +#endif /* !CMS_MVS */ +#ifdef MORE +#ifdef CMS_MVS + case ('m'): +#endif + case ('M'): /* send all screen output through "more" fn. */ +/* GRR: eventually check for numerical argument => height */ + if (negative) + G.M_flag = FALSE, negative = 0; + else + G.M_flag = TRUE; + break; +#endif /* MORE */ + case ('n'): /* don't overwrite any files */ + if (negative) + uO.overwrite_none = FALSE, negative = 0; + else + uO.overwrite_none = TRUE; + break; +#ifdef AMIGA + case ('N'): /* restore comments as filenotes */ + if (negative) + uO.N_flag = FALSE, negative = 0; + else + uO.N_flag = TRUE; + break; +#endif /* AMIGA */ + case ('o'): /* OK to overwrite files without prompting */ + if (negative) { + uO.overwrite_all = MAX(uO.overwrite_all-negative,0); + negative = 0; + } else + ++uO.overwrite_all; + break; + case ('p'): /* pipes: extract to stdout, no messages */ + if (negative) { + uO.cflag = FALSE; + uO.qflag = MAX(uO.qflag-999,0); + negative = 0; + } else { + uO.cflag = TRUE; + uO.qflag += 999; + } + break; +#if CRYPT + /* GRR: yes, this is highly insecure, but dozens of people + * have pestered us for this, so here we go... */ + case ('P'): + if (negative) { /* negative not allowed with -P passwd */ + Info(slide, 0x401, ((char *)slide, + LoadFarString(MustGivePasswd))); + return(PK_PARAM); /* don't extract here by accident */ + } + if (uO.pwdarg != (char *)NULL) { +/* + GRR: eventually support multiple passwords? + Info(slide, 0x401, ((char *)slide, + LoadFarString(OnlyOnePasswd))); + return(PK_PARAM); + */ + } else { + /* first check for "-Ppasswd", then for "-P passwd" */ + uO.pwdarg = s; + if (*uO.pwdarg == '\0') { + if (argc > 1) { + --argc; + uO.pwdarg = *++argv; + if (*uO.pwdarg == '-') { + Info(slide, 0x401, ((char *)slide, + LoadFarString(MustGivePasswd))); + return(PK_PARAM); + } + /* else pwdarg points at decryption password */ + } else { + Info(slide, 0x401, ((char *)slide, + LoadFarString(MustGivePasswd))); + return(PK_PARAM); + } + } + /* pwdarg now points at decryption password (-Ppasswd or + * -P passwd); point s at end of passwd to avoid mis- + * interpretation of passwd characters as more options + */ + if (*s != 0) + while (*++s != 0) + ; + } + break; +#endif /* CRYPT */ + case ('q'): /* quiet: fewer comments/messages */ + if (negative) { + uO.qflag = MAX(uO.qflag-negative,0); + negative = 0; + } else + ++uO.qflag; + break; +#ifdef QDOS + case ('Q'): /* QDOS flags */ + qlflag ^= strtol(s, &s, 10); + break; /* we XOR this as we can config qlflags */ +#endif +#ifdef DOS_FLX_NLM_OS2_W32 + case ('s'): /* spaces in filenames: allow by default */ + if (negative) + uO.sflag = FALSE, negative = 0; + else + uO.sflag = TRUE; + break; +#endif /* DOS_FLX_NLM_OS2_W32 */ + case ('t'): + if (negative) + uO.tflag = FALSE, negative = 0; + else + uO.tflag = TRUE; + break; +#ifdef TIMESTAMP + case ('T'): + if (negative) + uO.T_flag = FALSE, negative = 0; + else + uO.T_flag = TRUE; + break; +#endif + case ('u'): /* update (extract only new and newer files) */ + if (negative) + uO.uflag = FALSE, negative = 0; + else + uO.uflag = TRUE; + break; +#ifndef CMS_MVS + case ('U'): /* obsolete; to be removed in version 6.0 */ + if (negative) + uO.L_flag = TRUE, negative = 0; + else + uO.L_flag = FALSE; + break; +#endif /* !CMS_MVS */ +#ifndef SFX + case ('v'): /* verbose */ + if (negative) { + uO.vflag = MAX(uO.vflag-negative,0); + negative = 0; + } else if (uO.vflag) + ++uO.vflag; + else + uO.vflag = 2; + break; +#endif /* !SFX */ +#ifndef CMS_MVS + case ('V'): /* Version (retain VMS/DEC-20 file versions) */ + if (negative) + uO.V_flag = FALSE, negative = 0; + else + uO.V_flag = TRUE; + break; +#endif /* !CMS_MVS */ + case ('x'): /* extract: default */ +#ifdef SFX + /* when 'x' is the only option in this argument, and the + * next arg is not an option, assume this initiates an + * exclusion list (-x xlist): terminate option-scanning + * and leave uz_opts with argv still pointing to "-x"; + * the xlist is processed later + */ + if (s - argv[0] == 2 && *s == '\0' && + argc > 1 && argv[1][0] != '-') { + /* break out of nested loops without "++argv;--argc" */ + goto opts_done; + } +#endif /* SFX */ + break; +#if (defined(RESTORE_UIDGID) || defined(RESTORE_ACL)) + case ('X'): /* restore owner/protection info (need privs?) */ + if (negative) { + uO.X_flag = MAX(uO.X_flag-negative,0); + negative = 0; + } else + ++uO.X_flag; + break; +#endif /* RESTORE_UIDGID || RESTORE_ACL */ + case ('z'): /* display only the archive comment */ + if (negative) { + uO.zflag = MAX(uO.zflag-negative,0); + negative = 0; + } else + ++uO.zflag; + break; +#ifndef SFX + case ('Z'): /* should have been first option (ZipInfo) */ + Info(slide, 0x401, ((char *)slide, LoadFarString(Zfirst))); + error = TRUE; + break; +#endif /* !SFX */ +#ifdef DOS_H68_OS2_W32 + case ('$'): + if (negative) { + uO.volflag = MAX(uO.volflag-negative,0); + negative = 0; + } else + ++uO.volflag; + break; +#endif /* DOS_H68_OS2_W32 */ +#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) + case (':'): + if (negative) { + uO.ddotflag = MAX(uO.ddotflag-negative,0); + negative = 0; + } else + ++uO.ddotflag; + break; +#endif /* !RISCOS && !CMS_MVS && !TANDEM */ + default: + error = TRUE; + break; + + } /* end switch */ + } /* end while (not end of argument string) */ + } /* end while (not done with switches) */ + +/*--------------------------------------------------------------------------- + Check for nonsensical combinations of options. + ---------------------------------------------------------------------------*/ + +#ifdef SFX +opts_done: /* yes, very ugly...but only used by UnZipSFX with -x xlist */ +#endif + + if ((uO.cflag && uO.tflag) || (uO.cflag && uO.uflag) || + (uO.tflag && uO.uflag) || (uO.fflag && uO.overwrite_none)) + { + Info(slide, 0x401, ((char *)slide, LoadFarString(InvalidOptionsMsg))); + error = TRUE; + } + if (uO.aflag > 2) + uO.aflag = 2; +#ifdef VMS + if (uO.bflag > 2) + uO.bflag = 2; +#endif + if (uO.overwrite_all && uO.overwrite_none) { + Info(slide, 0x401, ((char *)slide, LoadFarString(IgnoreOOptionMsg))); + uO.overwrite_all = FALSE; + } +#ifdef MORE + if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func. useless */ + G.M_flag = 0; +#endif + +#ifdef SFX + if (error) +#else + if ((argc-- == 0) || error) +#endif + { + *pargc = argc; + *pargv = argv; +#ifndef SFX + if (uO.vflag >= 2 && argc == -1) { /* "unzip -v" */ + show_version_info(__G); + return PK_OK; + } + if (!G.noargs && !error) + error = PK_PARAM; /* had options (not -h or -v) but no zipfile */ +#endif /* !SFX */ + return USAGE(error); + } + +#ifdef SFX + /* print our banner unless we're being fairly quiet */ + if (uO.qflag < 2) + Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), + UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, + LoadFarStringSmall(VersionDate))); +#ifdef BETA + /* always print the beta warning: no unauthorized distribution!! */ + Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", + "SFX")); +#endif +#endif /* SFX */ + + if (uO.cflag || uO.tflag || uO.vflag || uO.zflag +#ifdef TIMESTAMP + || uO.T_flag +#endif + ) + G.extract_flag = FALSE; + else + G.extract_flag = TRUE; + + *pargc = argc; + *pargv = argv; + return PK_OK; + +} /* end function uz_opts() */ + + + + +/********************/ +/* Function usage() */ +/********************/ + +#ifdef SFX +# ifdef VMS +# define LOCAL "X. Quote uppercase options" +# endif +# ifdef UNIX +# define LOCAL "X" +# endif +# ifdef DOS_OS2_W32 +# define LOCAL "s$" +# endif +# if (defined(FLEXOS) || defined(NLM)) +# define LOCAL "s" +# endif +# ifdef AMIGA +# define LOCAL "N" +# endif + /* Default for all other systems: */ +# ifndef LOCAL +# define LOCAL "" +# endif + +# ifdef MORE +# define SFXOPT1 "M" +# else +# define SFXOPT1 "" +# endif + +int usage(__G__ error) /* return PK-type error code */ + __GDEF + int error; +{ + Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), + UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, + LoadFarStringSmall(VersionDate))); + Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXOpts), + SFXOPT1, LOCAL)); +#ifdef BETA + Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", + "SFX")); +#endif + + if (error) + return PK_PARAM; + else + return PK_COOL; /* just wanted usage screen: no error */ + +} /* end function usage() */ + + + + + +#else /* !SFX */ +# ifdef VMS +# define QUOT '\"' +# define QUOTS "\"" +# else +# define QUOT ' ' +# define QUOTS "" +# endif + +int usage(__G__ error) /* return PK-type error code */ + __GDEF + int error; +{ + int flag = (error? 1 : 0); + + +/*--------------------------------------------------------------------------- + Print either ZipInfo usage or UnZip usage, depending on incantation. + (Strings must be no longer than 512 bytes for Turbo C, apparently.) + ---------------------------------------------------------------------------*/ + + if (uO.zipinfo_mode) { + +#ifndef NO_ZIPINFO + + Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine1), + ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, + LoadFarStringSmall(VersionDate), + LoadFarStringSmall2(ZipInfoExample), QUOTS,QUOTS)); + Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine2))); + Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine3), + QUOT,QUOT, QUOT,QUOT, LoadFarStringSmall(ZipInfoUsageLine4))); +#ifdef VMS + Info(slide, flag, ((char *)slide, "\nRemember that non-lowercase\ + filespecs must be quoted in VMS (e.g., \"Makefile\").\n")); +#endif + +#endif /* !NO_ZIPINFO */ + + } else { /* UnZip mode */ + + Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine1), + UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, + LoadFarStringSmall(VersionDate))); +#ifdef BETA + Info(slide, flag, ((char *)slide, LoadFarString(BetaVersion), "", "")); +#endif + + Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine2), + ZIPINFO_MODE_OPTION, LoadFarStringSmall(ZipInfoMode))); +#ifdef VMS + if (!error) /* maybe no command-line tail found; show extra help */ + Info(slide, flag, ((char *)slide, LoadFarString(VMSusageLine2b))); +#endif + + Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine3), + LoadFarStringSmall(local1))); + + Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine4), + QUOT,QUOT, QUOT,QUOT, LoadFarStringSmall(local2), QUOT,QUOT, + LoadFarStringSmall2(local3))); + + /* This is extra work for SMALL_MEM, but it will work since + * LoadFarStringSmall2 uses the same buffer. Remember, this + * is a hack. */ + Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine5), + LoadFarStringSmall(Example2), LoadFarStringSmall2(Example3), + LoadFarStringSmall2(Example3))); + + } /* end if (uO.zipinfo_mode) */ + + if (error) + return PK_PARAM; + else + return PK_COOL; /* just wanted usage screen: no error */ + +} /* end function usage() */ + +#endif /* ?SFX */ + + + + +#ifndef SFX + +/********************************/ +/* Function show_version_info() */ +/********************************/ + +static void show_version_info(__G) + __GDEF +{ + if (uO.qflag > 3) /* "unzip -vqqqq" */ + Info(slide, 0, ((char *)slide, "%d\n", + (UZ_MAJORVER*100 + UZ_MINORVER*10 + UZ_PATCHLEVEL))); + else { + char *envptr, *getenv(); + int numopts = 0; + + Info(slide, 0, ((char *)slide, LoadFarString(UnzipUsageLine1v), + UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, + LoadFarStringSmall(VersionDate))); + Info(slide, 0, ((char *)slide, + LoadFarString(UnzipUsageLine2v))); + version(__G); + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptions))); +#ifdef ACORN_FTYPE_NFS + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(AcornFtypeNFS))); + ++numopts; +#endif +#ifdef ASM_CRC + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(AsmCRC))); + ++numopts; +#endif +#ifdef ASM_INFLATECODES + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(AsmInflateCodes))); + ++numopts; +#endif +#ifdef CHECK_VERSIONS + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Check_Versions))); + ++numopts; +#endif +#ifdef COPYRIGHT_CLEAN + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Copyright_Clean))); + ++numopts; +#endif +#ifdef DEBUG + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(UDebug))); + ++numopts; +#endif +#ifdef DEBUG_TIME + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(DebugTime))); + ++numopts; +#endif +#ifdef DLL + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Dll))); + ++numopts; +#endif +#ifdef DOSWILD + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(DosWild))); + ++numopts; +#endif +#ifdef LZW_CLEAN + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(LZW_Clean))); + ++numopts; +#endif +#ifndef MORE + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(No_More))); + ++numopts; +#endif +#ifdef NO_ZIPINFO + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(No_ZipInfo))); + ++numopts; +#endif +#ifdef NTSD_EAS + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(NTSDExtAttrib))); + ++numopts; +#endif +#ifdef OLD_THEOS_EXTRA + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(OldTheosExtra))); + ++numopts; +#endif +#ifdef OS2_EAS + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(OS2ExtAttrib))); + ++numopts; +#endif +#ifdef QLZIP + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(SMSExFldOnUnix))); + ++numopts; +#endif +#ifdef REENTRANT + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Reentrant))); + ++numopts; +#endif +#ifdef REGARGS + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(RegArgs))); + ++numopts; +#endif +#ifdef RETURN_CODES + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Return_Codes))); + ++numopts; +#endif +#ifdef SET_DIR_ATTRIB + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(SetDirAttrib))); + ++numopts; +#endif +#ifdef TIMESTAMP + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(TimeStamp))); + ++numopts; +#endif +#ifdef UNIXBACKUP + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(UnixBackup))); + ++numopts; +#endif +#ifdef USE_EF_UT_TIME + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_EF_UT_time))); + ++numopts; +#endif +#ifndef COPYRIGHT_CLEAN + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_Smith_Code))); + ++numopts; +#endif +#ifndef LZW_CLEAN + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_Unshrink))); + ++numopts; +#endif +#ifdef USE_DEFLATE64 + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_Deflate64))); + ++numopts; +#endif +#ifdef MULT_VOLUME + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_MultiVol))); + ++numopts; +#endif +# if (defined(__DJGPP__) && (__DJGPP__ >= 2)) +# ifdef USE_DJGPP_ENV + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_DJGPP_Env))); + ++numopts; +# endif +# ifdef USE_DJGPP_GLOB + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_DJGPP_Glob))); + ++numopts; +# endif +# endif /* __DJGPP__ && (__DJGPP__ >= 2) */ +#ifdef USE_VFAT + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(Use_VFAT_support))); + ++numopts; +#endif +#ifdef USE_ZLIB + sprintf((char *)(slide+256), LoadFarStringSmall(UseZlib), + ZLIB_VERSION, zlib_version); + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + (char *)(slide+256))); + ++numopts; +#endif +#ifdef VMS_TEXT_CONV + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(VmsTextConv))); + ++numopts; +#endif +#ifdef VMSCLI + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(VmsCLI))); + ++numopts; +#endif +#ifdef VMSWILD + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(VmsWild))); + ++numopts; +#endif +#ifdef WILD_STOP_AT_DIR + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(WildStopAtDir))); + ++numopts; +#endif +#if CRYPT +# ifdef PASSWD_FROM_STDIN + Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), + LoadFarStringSmall(PasswdStdin))); +# endif + Info(slide, 0, ((char *)slide, LoadFarString(Decryption), + CR_MAJORVER, CR_MINORVER, CR_BETA_VER, + LoadFarStringSmall(CryptDate))); + ++numopts; +#endif /* CRYPT */ + if (numopts == 0) + Info(slide, 0, ((char *)slide, + LoadFarString(CompileOptFormat), + LoadFarStringSmall(None))); + + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptions))); + envptr = getenv(LoadFarStringSmall(EnvUnZip)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvUnZip), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); + envptr = getenv(LoadFarStringSmall(EnvUnZip2)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvUnZip2), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); + envptr = getenv(LoadFarStringSmall(EnvZipInfo)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvZipInfo), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); + envptr = getenv(LoadFarStringSmall(EnvZipInfo2)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvZipInfo2), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); +#ifndef __RSXNT__ +#ifdef __EMX__ + envptr = getenv(LoadFarStringSmall(EnvEMX)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvEMX), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); + envptr = getenv(LoadFarStringSmall(EnvEMXOPT)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvEMXOPT), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); +#endif /* __EMX__ */ +#if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) + envptr = getenv(LoadFarStringSmall(EnvGO32)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvGO32), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); + envptr = getenv(LoadFarStringSmall(EnvGO32TMP)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvGO32TMP), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); +#endif /* __GO32__ && !(__DJGPP__ >= 2) */ +#endif /* !__RSXNT__ */ +#ifdef RISCOS + envptr = getenv(LoadFarStringSmall(EnvUnZipExts)); + Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), + LoadFarStringSmall(EnvUnZipExts), + (envptr == (char *)NULL || *envptr == 0)? + LoadFarStringSmall2(None) : envptr)); +#endif /* RISCOS */ + } +} /* end function show_version() */ + +#endif /* !SFX */ +#endif /* !WINDLL */ + + +// CMC this is a super-duper goto for nested error handling to bypass exit() +// use in the unzip routines, akin to what's in the zip source but for some +// reason they didn't do it for unzip (presumably because people want a zip +// dll but not an unzip dll +int unzip_exit(c) +int c; +{ + longjmp(unzipdll_error_return, c); +} + +const char *BOINC_RCSID_b2803595c0 = "$Id: unzip.c 17210 2009-02-11 21:57:03Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzip.h boinc-7.0.14+dfsg/zip/unzip/unzip.h --- boinc-7.0.7+dfsg/zip/unzip/unzip.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzip.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,618 @@ +/*--------------------------------------------------------------------------- + + unzip.h (new) + + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + This header file contains the public macros and typedefs required by + both the UnZip sources and by any application using the UnZip API. If + UNZIP_INTERNAL is defined, it includes unzpriv.h (containing includes, + prototypes and extern variables used by the actual UnZip sources). + + ---------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------- +This is version 2000-Apr-09 of the Info-ZIP copyright and license. +The definitive version of this document should be available at +ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely. + + +Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + +For the purposes of this copyright and license, "Info-ZIP" is defined as +the following set of individuals: + + Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, + Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, + Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, + Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, + Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, + Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, + Paul von Behren, Rich Wales, Mike White + +This software is provided "as is," without warranty of any kind, express +or implied. In no event shall Info-ZIP or its contributors be held liable +for any direct, indirect, incidental, special or consequential damages +arising out of the use of or inability to use this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. Redistributions of source code must retain the above copyright notice, + definition, disclaimer, and this list of conditions. + + 2. Redistributions in binary form must reproduce the above copyright + notice, definition, disclaimer, and this list of conditions in + documentation and/or other materials provided with the distribution. + + 3. Altered versions--including, but not limited to, ports to new operating + systems, existing ports with new graphical interfaces, and dynamic, + shared, or static library versions--must be plainly marked as such + and must not be misrepresented as being the original source. Such + altered versions also must not be misrepresented as being Info-ZIP + releases--including, but not limited to, labeling of the altered + versions with the names "Info-ZIP" (or any variation thereof, including, + but not limited to, different capitalizations), "Pocket UnZip," "WiZ" + or "MacZip" without the explicit permission of Info-ZIP. Such altered + versions are further prohibited from misrepresentative use of the + Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). + + 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," + "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and + binary releases. + ---------------------------------------------------------------------------*/ + +#ifndef __unzip_h /* prevent multiple inclusions */ +#define __unzip_h + +/*--------------------------------------------------------------------------- + Predefined, machine-specific macros. + ---------------------------------------------------------------------------*/ + +#ifdef __GO32__ /* MS-DOS extender: NOT Unix */ +# ifdef unix +# undef unix +# endif +# ifdef _unix +# undef _unix +# endif +# ifdef __unix +# undef __unix +# endif +# ifdef __unix__ +# undef __unix__ +# endif +#endif + +#if ((defined(__convex__) || defined(__convexc__)) && !defined(CONVEX)) +# define CONVEX +#endif + +#if (defined(unix) || defined(_unix) || defined(__unix) || defined(__unix__)) +# ifndef UNIX +# define UNIX +# endif +#endif /* unix || _unix || __unix || __unix__ */ +#if (defined(M_XENIX) || defined(COHERENT) || defined(__hpux)) +# ifndef UNIX +# define UNIX +# endif +#endif /* M_XENIX || COHERENT || __hpux */ +#if (defined(CONVEX) || defined(MINIX) || defined(_AIX) || defined(__QNX__)) +# ifndef UNIX +# define UNIX +# endif +#endif /* CONVEX || MINIX || _AIX || __QNX__ */ + +#if (defined(VM_CMS) || defined(MVS)) +# define CMS_MVS +#endif + +#if (defined(__OS2__) && !defined(OS2)) +# define OS2 +#endif + +#if (defined(__TANDEM) && !defined(TANDEM)) +# define TANDEM +#endif + +#if (defined(__VMS) && !defined(VMS)) +# define VMS +#endif + +#if ((defined(__WIN32__) || defined(_WIN32)) && !defined(WIN32)) +# define WIN32 +#endif +#if ((defined(__WINNT__) || defined(__WINNT)) && !defined(WIN32)) +# define WIN32 +#endif + +#ifdef __COMPILER_KCC__ +# include +# ifdef SYS_T20 +# define TOPS20 +# endif +#endif /* __COMPILER_KCC__ */ + +/* Borland C does not define __TURBOC__ if compiling for a 32-bit platform */ +#ifdef __BORLANDC__ +# ifndef __TURBOC__ +# define __TURBOC__ +# endif +# if (!defined(__MSDOS__) && !defined(OS2) && !defined(WIN32)) +# define __MSDOS__ +# endif +#endif + +/* define MSDOS for Turbo C (unless OS/2) and Power C as well as Microsoft C */ +#ifdef __POWERC +# define __TURBOC__ +# define MSDOS +#endif /* __POWERC */ + +#if (defined(__MSDOS__) && !defined(MSDOS)) /* just to make sure */ +# define MSDOS +#endif + +/* RSXNTDJ (at least up to v1.3) compiles for WIN32 (RSXNT) using a derivate + of the EMX environment, but defines MSDOS and __GO32__. ARG !!! */ +#if (defined(MSDOS) && defined(WIN32)) +# undef MSDOS /* WIN32 is >>>not<<< MSDOS */ +#endif +#if (defined(__GO32__) && defined(__EMX__) && defined(__RSXNT__)) +# undef __GO32__ +#endif + +#if (defined(linux) && !defined(LINUX)) +# define LINUX +#endif + +#ifdef __riscos +# define RISCOS +#endif + +#if (defined(THINK_C) || defined(MPW)) +# define MACOS +#endif +#if (defined(__MWERKS__) && defined(macintosh)) +# define MACOS +#endif + +int unzip_main(int argc, char** argv); + +/* use prototypes and ANSI libraries if __STDC__, or Microsoft or Borland C, or + * Silicon Graphics, or Convex?, or IBM C Set/2, or GNU gcc/emx, or Watcom C, + * or Macintosh, or Windows NT, or Sequent, or Atari or IBM RS/6000. + */ +#if (defined(__STDC__) || defined(MSDOS) || defined(WIN32) || defined(__EMX__)) +# ifndef PROTO +# define PROTO +# endif +# ifndef MODERN +# define MODERN +# endif +#endif +#if (defined(__IBMC__) || defined(__BORLANDC__) || defined(__WATCOMC__)) +# ifndef PROTO +# define PROTO +# endif +# ifndef MODERN +# define MODERN +# endif +#endif +#if (defined(MACOS) || defined(ATARI_ST) || defined(RISCOS) || defined(THEOS)) +# ifndef PROTO +# define PROTO +# endif +# ifndef MODERN +# define MODERN +# endif +#endif +/* Sequent running Dynix/ptx: non-modern compiler */ +#if (defined(_AIX) || defined(sgi) || (defined(_SEQUENT_) && !defined(PTX))) +# ifndef PROTO +# define PROTO +# endif +# ifndef MODERN +# define MODERN +# endif +#endif +#if (defined(CMS_MVS) || defined(__BEOS__)) /* || defined(CONVEX) */ +# ifndef PROTO +# define PROTO +# endif +# ifndef MODERN +# define MODERN +# endif +#endif + +/* turn off prototypes if requested */ +#if (defined(NOPROTO) && defined(PROTO)) +# undef PROTO +#endif + +/* used to remove arguments in function prototypes for non-ANSI C */ +#ifdef PROTO +# define OF(a) a +#else +# define OF(a) () +#endif + +/* enable the "const" keyword only if MODERN and if not otherwise instructed */ +#ifdef MODERN +# if (!defined(ZCONST) && (defined(USE_CONST) || !defined(NO_CONST))) +# define ZCONST const +# endif +#endif + +#ifndef ZCONST +# define ZCONST +#endif + + +/*--------------------------------------------------------------------------- + Grab system-specific public include headers. + ---------------------------------------------------------------------------*/ + +#ifdef POCKET_UNZIP /* WinCE port */ +# include "wince/punzip.h" /* must appear before windows.h */ +#endif + +#ifdef WINDLL + /* for UnZip, the "basic" part of the win32 api is sufficient */ +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# define IZ_HASDEFINED_WIN32LEAN +# endif +# include +# include "windll/structs.h" +# ifdef IZ_HASDEFINEd_WIN32LEAN +# undef WIN32_LEAN_AND_MEAN +# undef IZ_HASDEFINED_WIN32LEAN +# endif +#endif + +/*--------------------------------------------------------------------------- + Grab system-dependent definition of EXPENTRY for prototypes below. + ---------------------------------------------------------------------------*/ + +#if 0 +#if (defined(OS2) && !defined(FUNZIP)) +# ifdef UNZIP_INTERNAL +# define INCL_NOPM +# define INCL_DOSNLS +# define INCL_DOSPROCESS +# define INCL_DOSDEVICES +# define INCL_DOSDEVIOCTL +# define INCL_DOSERRORS +# define INCL_DOSMISC +# ifdef OS2DLL +# define INCL_REXXSAA +# include +# endif +# endif /* UNZIP_INTERNAL */ +# include +# define UZ_EXP EXPENTRY +#endif /* OS2 && !FUNZIP */ +#endif /* 0 */ + +#if (defined(OS2) && !defined(FUNZIP)) +# if (defined(__IBMC__) || defined(__WATCOMC__)) +# define UZ_EXP _System /* compiler keyword */ +# else +# define UZ_EXP +# endif +#endif /* OS2 && !FUNZIP */ + +#if (defined(WINDLL) || defined(USE_UNZIP_LIB)) +# ifndef EXPENTRY +# define UZ_EXP WINAPI +# else +# define UZ_EXP EXPENTRY +# endif +#endif + +#ifndef UZ_EXP +# define UZ_EXP +#endif + + +/*--------------------------------------------------------------------------- + Public typedefs. + ---------------------------------------------------------------------------*/ + +#ifndef _IZ_TYPES_DEFINED +#ifdef MODERN +#ifndef ZVOID_DEC +#define ZVOID_DEC + typedef void zvoid; +#endif +#else /* !MODERN */ +# ifndef AOS_VS /* mostly modern? */ +# ifndef VAXC /* not fully modern, but has knows 'void' */ +# define void int +# endif /* !VAXC */ +# endif /* !AOS_VS */ + typedef char zvoid; +#endif /* ?MODERN */ +#ifndef UCH_TYPE +#define UCH_TYPE +typedef unsigned char uch; /* code assumes unsigned bytes; these type- */ +typedef unsigned short ush; /* defs replace byte/UWORD/ULONG (which are */ +typedef unsigned long ulg; /* predefined on some systems) & match zip */ +#endif + +#define _IZ_TYPES_DEFINED +#endif /* !_IZ_TYPES_DEFINED */ + +/* InputFn is not yet used and is likely to change: */ +#ifdef PROTO + typedef int (UZ_EXP MsgFn) (zvoid *pG, uch *buf, ulg size, int flag); + typedef int (UZ_EXP InputFn) (zvoid *pG, uch *buf, int *size, int flag); + typedef void (UZ_EXP PauseFn) (zvoid *pG, ZCONST char *prompt, int flag); + typedef int (UZ_EXP PasswdFn) (zvoid *pG, int *rcnt, char *pwbuf, + int size, ZCONST char *zfn, + ZCONST char *efn); + typedef int (UZ_EXP StatCBFn) (zvoid *pG, int fnflag, ZCONST char *zfn, + ZCONST char *efn, ZCONST zvoid *details); + typedef void (UZ_EXP UsrIniFn) (void); +#else /* !PROTO */ + typedef int (UZ_EXP MsgFn) (); + typedef int (UZ_EXP InputFn) (); + typedef void (UZ_EXP PauseFn) (); + typedef int (UZ_EXP PasswdFn) (); + typedef int (UZ_EXP StatCBFn) (); + typedef void (UZ_EXP UsrIniFn) (); +#endif /* ?PROTO */ + +typedef struct _UzpBuffer { /* rxstr */ + ulg strlength; /* length of string */ + char *strptr; /* pointer to string */ +} UzpBuffer; + +typedef struct _UzpInit { + ulg structlen; /* length of the struct being passed */ + + /* GRR: can we assume that each of these is a 32-bit pointer? if not, + * does it matter? add "far" keyword to make sure? */ + MsgFn *msgfn; + InputFn *inputfn; + PauseFn *pausefn; + UsrIniFn *userfn; /* user init function to be called after */ + /* globals constructed and initialized */ + + /* pointer to program's environment area or something? */ + /* hooks for performance testing? */ + /* hooks for extra unzip -v output? (detect CPU or other hardware?) */ + /* anything else? let me (Greg) know... */ +} UzpInit; + +typedef struct _UzpCB { + ulg structlen; /* length of the struct being passed */ + /* GRR: can we assume that each of these is a 32-bit pointer? if not, + * does it matter? add "far" keyword to make sure? */ + MsgFn *msgfn; + InputFn *inputfn; + PauseFn *pausefn; + PasswdFn *passwdfn; + StatCBFn *statrepfn; +} UzpCB; + +/* the collection of general UnZip option flags and option arguments */ +typedef struct _UzpOpts { +#ifndef FUNZIP + char *exdir; /* pointer to extraction root directory (-d option) */ + char *pwdarg; /* pointer to command-line password (-P option) */ + int zipinfo_mode; /* behave like ZipInfo or like normal UnZip? */ + int aflag; /* -a: do ASCII-EBCDIC and/or end-of-line translation */ +#ifdef VMS + int bflag; /* -b: force fixed record format for binary files */ +#endif +#ifdef TANDEM + int bflag; /* -b: create text files in 'C' format (180)*/ +#endif +#ifdef UNIXBACKUP + int B_flag; /* -B: back up existing files by renaming to *~ first */ +#endif + int cflag; /* -c: output to stdout */ + int C_flag; /* -C: match filenames case-insensitively */ +#ifdef MACOS + int E_flag; /* -E: [MacOS] show Mac extra field during restoring */ +#endif + int fflag; /* -f: "freshen" (extract only newer files) */ +#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) + int acorn_nfs_ext; /* -F: RISC OS types & NFS filetype extensions */ +#endif + int hflag; /* -h: header line (zipinfo) */ +#ifdef MACOS + int i_flag; /* -i: [MacOS] ignore filenames stored in Mac e.f. */ +#endif +#ifdef RISCOS + int scanimage; /* -I: scan image files */ +#endif + int jflag; /* -j: junk pathnames (unzip) */ +#if (defined(__BEOS__) || defined(MACOS)) + int J_flag; /* -J: ignore BeOS/MacOS extra field info (unzip) */ +#endif + int lflag; /* -12slmv: listing format (zipinfo) */ + int L_flag; /* -L: convert filenames from some OSes to lowercase */ + int overwrite_none; /* -n: never overwrite files (no prompting) */ +#ifdef AMIGA + int N_flag; /* -N: restore comments as AmigaDOS filenotes */ +#endif + int overwrite_all; /* -o: OK to overwrite files without prompting */ +#endif /* !FUNZIP */ + int qflag; /* -q: produce a lot less output */ +#ifndef FUNZIP +#if (defined(MSDOS) || defined(FLEXOS) || defined(OS2) || defined(WIN32)) + int sflag; /* -s: convert spaces in filenames to underscores */ +#endif +#if (defined(NLM)) + int sflag; /* -s: convert spaces in filenames to underscores */ +#endif +#if (defined(MSDOS) || defined(__human68k__) || defined(OS2) || defined(WIN32)) + int volflag; /* -$: extract volume labels */ +#endif + int tflag; /* -t: test (unzip) or totals line (zipinfo) */ + int T_flag; /* -T: timestamps (unzip) or dec. time fmt (zipinfo) */ + int uflag; /* -u: "update" (extract only newer/brand-new files) */ + int vflag; /* -v: (verbosely) list directory */ + int V_flag; /* -V: don't strip VMS version numbers */ +#if (defined(__BEOS__) || defined(TANDEM) || defined(THEOS) || defined(UNIX)) + int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ +#elif (defined(OS2) || defined(VMS) || defined(WIN32)) + int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ +#endif + int zflag; /* -z: display the zipfile comment (only, for unzip) */ +#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) + int ddotflag; /* -:: don't skip over "../" path elements */ +#endif +#endif /* !FUNZIP */ +} UzpOpts; + +/* intended to be a private struct: */ +typedef struct _ver { + uch major; /* e.g., integer 5 */ + uch minor; /* e.g., 2 */ + uch patchlevel; /* e.g., 0 */ + uch not_used; +} _version_type; + +typedef struct _UzpVer { + ulg structlen; /* length of the struct being passed */ + ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ + char *betalevel; /* e.g., "g BETA" or "" */ + char *date; /* e.g., "4 Sep 95" (beta) or "4 September 1995" */ + char *zlib_version; /* e.g., "0.95" or NULL */ + _version_type unzip; + _version_type zipinfo; + _version_type os2dll; + _version_type windll; +} UzpVer; + +/* for Visual BASIC access to Windows DLLs: */ +typedef struct _UzpVer2 { + ulg structlen; /* length of the struct being passed */ + ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ + char betalevel[10]; /* e.g., "g BETA" or "" */ + char date[20]; /* e.g., "4 Sep 95" (beta) or "4 September 1995" */ + char zlib_version[10]; /* e.g., "0.95" or NULL */ + _version_type unzip; + _version_type zipinfo; + _version_type os2dll; + _version_type windll; +} UzpVer2; + +typedef struct central_directory_file_header { /* CENTRAL */ + uch version_made_by[2]; + uch version_needed_to_extract[2]; + ush general_purpose_bit_flag; + ush compression_method; + ulg last_mod_dos_datetime; + ulg crc32; + ulg csize; + ulg ucsize; + ush filename_length; + ush extra_field_length; + ush file_comment_length; + ush disk_number_start; + ush internal_file_attributes; + ulg external_file_attributes; + ulg relative_offset_local_header; +} cdir_file_hdr; + + +#define UZPINIT_LEN sizeof(UzpInit) +#define UZPVER_LEN sizeof(UzpVer) +#define cbList(func) int (* UZ_EXP func)(char *filename, cdir_file_hdr *crec) + + +/*--------------------------------------------------------------------------- + Return (and exit) values of the public UnZip API functions. + ---------------------------------------------------------------------------*/ + +/* external return codes */ +#define PK_OK 0 /* no error */ +#define PK_COOL 0 /* no error */ +#define PK_WARN 1 /* warning error */ +#define PK_ERR 2 /* error in zipfile */ +#define PK_BADERR 3 /* severe error in zipfile */ +#define PK_MEM 4 /* insufficient memory (during initialization) */ +#define PK_MEM2 5 /* insufficient memory (password failure) */ +#define PK_MEM3 6 /* insufficient memory (file decompression) */ +#define PK_MEM4 7 /* insufficient memory (memory decompression) */ +#define PK_MEM5 8 /* insufficient memory (not yet used) */ +#define PK_NOZIP 9 /* zipfile not found */ +#define PK_PARAM 10 /* bad or illegal parameters specified */ +#define PK_FIND 11 /* no files found */ +#define PK_DISK 50 /* disk full */ +#define PK_EOF 51 /* unexpected EOF */ + +#define IZ_CTRLC 80 /* user hit ^C to terminate */ +#define IZ_UNSUP 81 /* no files found: all unsup. compr/encrypt. */ +#define IZ_BADPWD 82 /* no files found: all had bad password */ + +/* return codes of password fetches (negative = user abort; positive = error) */ +#define IZ_PW_ENTERED 0 /* got some password string; use/try it */ +#define IZ_PW_CANCEL -1 /* no password available (for this entry) */ +#define IZ_PW_CANCELALL -2 /* no password, skip any further pwd. request */ +#define IZ_PW_ERROR 5 /* = PK_MEM2 : failure (no mem, no tty, ...) */ + +/* flag values for status callback function */ +#define UZ_ST_START_EXTRACT 1 /* no details */ +#define UZ_ST_IN_PROGRESS 2 /* no details */ +#define UZ_ST_FINISH_MEMBER 3 /* 'details': extracted size */ + +/* return values of status callback function */ +#define UZ_ST_CONTINUE 0 +#define UZ_ST_BREAK 1 + + +/*--------------------------------------------------------------------------- + Prototypes for public UnZip API (DLL) functions. + ---------------------------------------------------------------------------*/ + +#define UzpMatch match + +int UZ_EXP UzpMain OF((int argc, char **argv)); +int UZ_EXP UzpAltMain OF((int argc, char **argv, UzpInit *init)); +UzpVer * UZ_EXP UzpVersion OF((void)); +void UZ_EXP UzpFreeMemBuffer OF((UzpBuffer *retstr)); +#ifndef WINDLL +int UZ_EXP UzpUnzipToMemory OF((char *zip, char *file, UzpOpts *optflgs, + UzpCB *UsrFunc, UzpBuffer *retstr)); +int UZ_EXP UzpGrep OF((char *archive, char *file, + char *pattern, int cmd, int SkipBin, + UzpCB *UsrFunc)); +#endif +#ifdef OS2 +int UZ_EXP UzpFileTree OF((char *name, cbList(callBack), + char *cpInclude[], char *cpExclude[])); +#endif + +void UZ_EXP UzpVersion2 OF((UzpVer2 *version)); +int UZ_EXP UzpValidate OF((char *archive, int AllCodes)); + + +/* default I/O functions (can be swapped out via UzpAltMain() entry point): */ + +int UZ_EXP UzpMessagePrnt OF((zvoid *pG, uch *buf, ulg size, int flag)); +int UZ_EXP UzpMessageNull OF((zvoid *pG, uch *buf, ulg size, int flag)); +int UZ_EXP UzpInput OF((zvoid *pG, uch *buf, int *size, int flag)); +void UZ_EXP UzpMorePause OF((zvoid *pG, ZCONST char *prompt, int flag)); +int UZ_EXP UzpPassword OF((zvoid *pG, int *rcnt, char *pwbuf, + int size, ZCONST char *zfn, + ZCONST char *efn)); + + +/*--------------------------------------------------------------------------- + Remaining private stuff for UnZip compilation. + ---------------------------------------------------------------------------*/ + +#ifdef UNZIP_INTERNAL +# include "unzpriv.h" +#endif + +int unzip_exit(int c); + +#endif /* !__unzip_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzipsfx.txt boinc-7.0.14+dfsg/zip/unzip/unzipsfx.txt --- boinc-7.0.7+dfsg/zip/unzip/unzipsfx.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzipsfx.txt 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,342 @@ + +UNZIPSFX(1L) UNZIPSFX(1L) + +NAME + unzipsfx - self-extracting stub for prepending to ZIP + archives + +SYNOPSIS + [-cfptuz[ajnoqsCLV$]] + [file(s) ... [-x xfile(s) ...]] + +DESCRIPTION + unzipsfx is a modified version of unzip(1L) designed to be + prepended to existing ZIP archives in order to form self- + extracting archives. Instead of taking its first non-flag + argument to be the zipfile(s) to be extracted, unzipsfx + seeks itself under the name by which it was invoked and + tests or extracts the contents of the appended archive. + Because the executable stub adds bulk to the archive (the + whole purpose of which is to be as small as possible), a + number of the less-vital capabilities in regular unzip + have been removed. Among these are the usage (or help) + screen, the listing and diagnostic functions (-l and -v), + the ability to decompress older compression formats (the + ``reduce,'' ``shrink'' and ``implode'' methods). The + ability to extract to a directory other than the current + one can be selected as a compile-time option, which is now + enabled by default since UnZipSFX version 5.5. Similary, + decryption is supported as a compile-time option but + should be avoided unless the attached archive contains + encrypted files. Starting with release 5.5, another com- + pile-time option adds a simple ``run command after extrac- + tion'' feature. This feature is currently incompatible + with the ``extract to different directory'' feature and + remains disabled by default. + + Note that self-extracting archives made with unzipsfx are + no more (or less) portable across different operating sys- + tems than is the unzip executable itself. In general a + self-extracting archive made on a particular Unix system, + for example, will only self-extract under the same flavor + of Unix. Regular unzip may still be used to extract the + embedded archive as with any normal zipfile, although it + will generate a harmless warning about extra bytes at the + beginning of the zipfile. Despite this, however, the + self-extracting archive is technically not a valid ZIP + archive, and PKUNZIP may be unable to test or extract it. + This limitation is due to the simplistic manner in which + the archive is created; the internal directory structure + is not updated to reflect the extra bytes prepended to the + original zipfile. + +ARGUMENTS + [file(s)] + An optional list of archive members to be pro- + cessed. Regular expressions (wildcards) similar to + those in Unix egrep(1) may be used to match + +Info-ZIP 17 February 2002 (v5.5) 1 + +UNZIPSFX(1L) UNZIPSFX(1L) + + multiple members. These wildcards may contain: + + * matches a sequence of 0 or more characters + + ? matches exactly 1 character + + [...] matches any single character found inside + the brackets; ranges are specified by a + beginning character, a hyphen, and an ending + character. If an exclamation point or a + caret (`!' or `^') follows the left bracket, + then the range of characters within the + brackets is complemented (that is, anything + except the characters inside the brackets is + considered a match). + + (Be sure to quote any character that might other- + wise be interpreted or modified by the operating + system, particularly under Unix and VMS.) + + [-x xfile(s)] + An optional list of archive members to be excluded + from processing. Since wildcard characters match + directory separators (`/'), this option may be used + to exclude any files that are in subdirectories. + For example, ``foosfx *.[ch] -x */*'' would extract + all C source files in the main directory, but none + in any subdirectories. Without the -x option, all + C source files in all directories within the zip- + file would be extracted. + + If unzipsfx is compiled with SFX_EXDIR defined, the fol- + lowing option is also enabled: + + [-d exdir] + An optional directory to which to extract files. + By default, all files and subdirectories are recre- + ated in the current directory; the -d option allows + extraction in an arbitrary directory (always assum- + ing one has permission to write to the directory). + The option and directory may be concatenated with- + out any white space between them, but note that + this may cause normal shell behavior to be sup- + pressed. In particular, ``-d ~'' (tilde) is + expanded by Unix C shells into the name of the + user's home directory, but ``-d~'' is treated as a + literal subdirectory ``~'' of the current direc- + tory. + +OPTIONS + unzipsfx supports the following unzip(1L) options: -c and + -p (extract to standard output/screen), -f and -u (freshen + and update existing files upon extraction), -t (test + archive) and -z (print archive comment). All normal + +Info-ZIP 17 February 2002 (v5.5) 2 + +UNZIPSFX(1L) UNZIPSFX(1L) + + listing options (-l, -v and -Z) have been removed, but the + testing option (-t) may be used as a ``poor man's'' list- + ing. Alternatively, those creating self-extracting + archives may wish to include a short listing in the zip- + file comment. + + See unzip(1L) for a more complete description of these + options. + +MODIFIERS + unzipsfx currently supports all unzip(1L) modifiers: -a + (convert text files), -n (never overwrite), -o (overwrite + without prompting), -q (operate quietly), -C (match names + case-insensitively), -L (convert uppercase-OS names to + lowercase), -j (junk paths) and -V (retain version num- + bers); plus the following operating-system specific + options: -X (restore VMS owner/protection info), -s (con- + vert spaces in filenames to underscores [DOS, OS/2, NT]) + and -$ (restore volume label [DOS, OS/2, NT, Amiga]). + + (Support for regular ASCII text-conversion may be removed + in future versions, since it is simple enough for the + archive's creator to ensure that text files have the + appropriate format for the local OS. EBCDIC conversion + will of course continue to be supported since the zipfile + format implies ASCII storage of text files.) + + See unzip(1L) for a more complete description of these + modifiers. + +ENVIRONMENT OPTIONS + unzipsfx uses the same environment variables as unzip(1L) + does, although this is likely to be an issue only for the + person creating and testing the self-extracting archive. + See unzip(1L) for details. + +DECRYPTION + Decryption is supported exactly as in unzip(1L); that is, + interactively with a non-echoing prompt for the pass- + word(s). See unzip(1L) for details. Once again, note + that if the archive has no encrypted files there is no + reason to use a version of unzipsfx with decryption sup- + port; that only adds to the size of the archive. + +AUTORUN COMMAND + When unzipsfx was compiled with CHEAP_SFX_AUTORUN defined, + a simple ``command autorun'' feature is supported. You may + enter a command into the Zip archive comment, using the + following format: + + $AUTORUN$>[command line string] + + When unzipsfxP recognizes the ``$AUTORUN$>'' token at the + beginning of the Zip archive comment, the remainder of the + +Info-ZIP 17 February 2002 (v5.5) 3 + +UNZIPSFX(1L) UNZIPSFX(1L) + + first line of the comment (until the first newline charac- + ter) is passed as a shell command to the operating system + using the C rtl ``system'' function. Before executing the + command, unzipsfxP displays the command on the console and + prompts the user for confirmation. When the user has + switched off prompting by specifying the -q option, + autorun commands are never executed. + + In case the archive comment contains additonal lines of + text, the remainder of the archive comment following the + first line is displayed normally, unless quiet operation + was requested by supplying a -q option. + +EXAMPLES + To create a self-extracting archive letters from a regular + zipfile letters.zip and change the new archive's permis- + sions to be world-executable under Unix: + + cat unzipsfx letters.zip > letters + chmod 755 letters + zip -A letters + + To create the same archive under MS-DOS, OS/2 or NT (note + the use of the /b [binary] option to the copy command): + + copy /b unzipsfx.exe+letters.zip letters.exe + zip -A letters.exe + + Under VMS: + + copy unzipsfx.exe,letters.zip letters.exe + letters == "$currentdisk:[currentdir]letters.exe" + zip -A letters.exe + + (The VMS append command may also be used. The second com- + mand installs the new program as a ``foreign command'' + capable of taking arguments. The third line assumes that + Zip is already installed as a foreign command.) Under + AmigaDOS: + + MakeSFX letters letters.zip UnZipSFX + + (MakeSFX is included with the UnZip source distribution + and with Amiga binary distributions. ``zip -A'' doesn't + work on Amiga self-extracting archives.) To test (or + list) the newly created self-extracting archive: + + letters -t + + To test letters quietly, printing only a summary message + indicating whether the archive is OK or not: + + letters -tqq + +Info-ZIP 17 February 2002 (v5.5) 4 + +UNZIPSFX(1L) UNZIPSFX(1L) + + To extract the complete contents into the current direc- + tory, recreating all files and subdirectories as neces- + sary: + + letters + + To extract all *.txt files (in Unix quote the `*'): + + letters *.txt + + To extract everything except the *.txt files: + + letters -x *.txt + + To extract only the README file to standard output (the + screen): + + letters -c README + + To print only the zipfile comment: + + letters -z + +LIMITATIONS + The principle and fundamental limitation of unzipsfx is + that it is not portable across architectures or operating + systems, and therefore neither are the resulting archives. + For some architectures there is limited portability, how- + ever (e.g., between some flavors of Intel-based Unix). + + Another problem with the current implementation is that + any archive with ``junk'' prepended to the beginning tech- + nically is no longer a zipfile (unless zip(1) is used to + adjust the zipfile offsets appropriately, as noted above). + unzip(1) takes note of the prepended bytes and ignores + them since some file-transfer protocols, notably MacBi- + nary, are also known to prepend junk. But PKWARE's + archiver suite may not be able to deal with the modified + archive unless its offsets have been adjusted. + + unzipsfx has no knowledge of the user's PATH, so in gen- + eral an archive must either be in the current directory + when it is invoked, or else a full or relative path must + be given. If a user attempts to extract the archive from + a directory in the PATH other than the current one, + unzipsfx will print a warning to the effect, ``can't find + myself.'' This is always true under Unix and may be true + in some cases under MS-DOS, depending on the compiler used + (Microsoft C fully qualifies the program name, but other + compilers may not). Under OS/2 and NT there are operat- + ing-system calls available that provide the full path + name, so the archive may be invoked from anywhere in the + user's path. The situation is not known for AmigaDOS, + Atari TOS, MacOS, etc. + +Info-ZIP 17 February 2002 (v5.5) 5 + +UNZIPSFX(1L) UNZIPSFX(1L) + + As noted above, a number of the normal unzip(1L) functions + have been removed in order to make unzipsfx smaller: + usage and diagnostic info, listing functions and extrac- + tion to other directories. Also, only stored and deflated + files are supported. The latter limitation is mainly rel- + evant to those who create SFX archives, however. + + VMS users must know how to set up self-extracting archives + as foreign commands in order to use any of unzipsfx's + options. This is not necessary for simple extraction, but + the command to do so then becomes, e.g., ``run letters'' + (to continue the examples given above). + + unzipsfx on the Amiga requires the use of a special pro- + gram, MakeSFX, in order to create working self-extracting + archives; simple concatenation does not work. (For tech- + nically oriented users, the attached archive is defined as + a ``debug hunk.'') There may be compatibility problems + between the ROM levels of older Amigas and newer ones. + + All current bugs in unzip(1L) exist in unzipsfx as well. + +DIAGNOSTICS + unzipsfx's exit status (error level) is identical to that + of unzip(1L); see the corresponding man page. + +SEE ALSO + funzip(1L), unzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), + zipinfo(1L), zipnote(1L), zipsplit(1L) + +URL + The Info-ZIP home page is currently at + http://www.info-zip.org/pub/infozip/ + or + ftp://ftp.info-zip.org/pub/infozip/ . + +AUTHORS + Greg Roelofs was responsible for the basic modifications + to UnZip necessary to create UnZipSFX. See unzip(1L) for + the current list of Zip-Bugs authors, or the file CONTRIBS + in the UnZip source distribution for the full list of + Info-ZIP contributors. + +Info-ZIP 17 February 2002 (v5.5) 6 + diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzipstb.c boinc-7.0.14+dfsg/zip/unzip/unzipstb.c --- boinc-7.0.7+dfsg/zip/unzip/unzipstb.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzipstb.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,58 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unzipstb.c + + Simple stub function for UnZip DLL (or shared library, whatever); does + exactly the same thing as normal UnZip, except for additional printf()s + of various version numbers, solely as a demonstration of what can/should + be checked when using the DLL. (If major version numbers ever differ, + assume program is incompatible with DLL--especially if DLL version is + older. This is not likely to be a problem with *this* simple program, + but most user programs will be much more complex.) + + ---------------------------------------------------------------------------*/ + +#include +#include "unzip.h" +#include "unzvers.h" + +int main(int argc, char *argv[]) +{ + static UzpVer *pVersion; /* no pervert jokes, please... */ + + pVersion = UzpVersion(); + + printf("UnZip stub: checking version numbers (DLL is dated %s)\n", + pVersion->date); + printf(" UnZip versions: expecting %d.%d%d, using %d.%d%d%s\n", + UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, pVersion->unzip.major, + pVersion->unzip.minor, pVersion->unzip.patchlevel, pVersion->betalevel); + printf(" ZipInfo versions: expecting %d.%d%d, using %d.%d%d\n", + ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, pVersion->zipinfo.major, + pVersion->zipinfo.minor, pVersion->zipinfo.patchlevel); + +/* + D2_M*VER and os2dll.* are obsolete, though retained for compatibility: + + printf(" OS2 DLL versions: expecting %d.%d%d, using %d.%d%d\n", + D2_MAJORVER, D2_MINORVER, D2_PATCHLEVEL, pVersion->os2dll.major, + pVersion->os2dll.minor, pVersion->os2dll.patchlevel); + */ + + if (pVersion->flag & 2) + printf(" using zlib version %s\n", pVersion->zlib_version); + printf("\n"); + + /* call the actual UnZip routine (string-arguments version) */ + return UzpMain(argc, argv); +} + +const char *BOINC_RCSID_0df1c7c635 = "$Id: unzipstb.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzip.txt boinc-7.0.14+dfsg/zip/unzip/unzip.txt --- boinc-7.0.7+dfsg/zip/unzip/unzip.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzip.txt 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,987 @@ + +UNZIP(1L) UNZIP(1L) + +NAME + unzip - list, test and extract compressed files in a ZIP + archive + +SYNOPSIS + unzip [-Z] [-cflptuvz[abjnoqsCLMVX$/:]] file[.zip] + [file(s) ...] [-x xfile(s) ...] [-d exdir] + +DESCRIPTION + unzip will list, test, or extract files from a ZIP + archive, commonly found on MS-DOS systems. The default + behavior (with no options) is to extract into the current + directory (and subdirectories below it) all files from the + specified ZIP archive. A companion program, zip(1L), cre- + ates ZIP archives; both programs are compatible with + archives created by PKWARE's PKZIP and PKUNZIP for MS-DOS, + but in many cases the program options or default behaviors + differ. + +ARGUMENTS + file[.zip] + Path of the ZIP archive(s). If the file specifica- + tion is a wildcard, each matching file is processed + in an order determined by the operating system (or + file system). Only the filename can be a wildcard; + the path itself cannot. Wildcard expressions are + similar to those supported in commonly used Unix + shells (sh, ksh, csh) and may contain: + + * matches a sequence of 0 or more characters + + ? matches exactly 1 character + + [...] matches any single character found inside + the brackets; ranges are specified by a + beginning character, a hyphen, and an ending + character. If an exclamation point or a + caret (`!' or `^') follows the left bracket, + then the range of characters within the + brackets is complemented (that is, anything + except the characters inside the brackets is + considered a match). + + (Be sure to quote any character that might other- + wise be interpreted or modified by the operating + system, particularly under Unix and VMS.) If no + matches are found, the specification is assumed to + be a literal filename; and if that also fails, the + suffix .zip is appended. Note that self-extracting + ZIP files are supported, as with any other ZIP + archive; just specify the .exe suffix (if any) + explicitly. + +Info-ZIP 17 February 2002 (v5.5) 1 + +UNZIP(1L) UNZIP(1L) + + [file(s)] + An optional list of archive members to be pro- + cessed, separated by spaces. (VMS versions com- + piled with VMSCLI defined must delimit files with + commas instead. See -v in OPTIONS below.) Regular + expressions (wildcards) may be used to match multi- + ple members; see above. Again, be sure to quote + expressions that would otherwise be expanded or + modified by the operating system. + + [-x xfile(s)] + An optional list of archive members to be excluded + from processing. Since wildcard characters match + directory separators (`/'), this option may be used + to exclude any files that are in subdirectories. + For example, ``unzip foo *.[ch] -x */*'' would + extract all C source files in the main directory, + but none in any subdirectories. Without the -x + option, all C source files in all directories + within the zipfile would be extracted. + + [-d exdir] + An optional directory to which to extract files. + By default, all files and subdirectories are recre- + ated in the current directory; the -d option allows + extraction in an arbitrary directory (always assum- + ing one has permission to write to the directory). + This option need not appear at the end of the com- + mand line; it is also accepted before the zipfile + specification (with the normal options), immedi- + ately after the zipfile specification, or between + the file(s) and the -x option. The option and + directory may be concatenated without any white + space between them, but note that this may cause + normal shell behavior to be suppressed. In partic- + ular, ``-d ~'' (tilde) is expanded by Unix C shells + into the name of the user's home directory, but + ``-d~'' is treated as a literal subdirectory ``~'' + of the current directory. + +OPTIONS + Note that, in order to support obsolescent hardware, + unzip's usage screen is limited to 22 or 23 lines and + should therefore be considered only a reminder of the + basic unzip syntax rather than an exhaustive list of all + possible flags. The exhaustive list follows: + + -Z zipinfo(1L) mode. If the first option on the com- + mand line is -Z, the remaining options are taken to + be zipinfo(1L) options. See the appropriate manual + page for a description of these options. + + -A [OS/2, Unix DLL] print extended help for the DLL's + programming interface (API). + +Info-ZIP 17 February 2002 (v5.5) 2 + +UNZIP(1L) UNZIP(1L) + + -c extract files to stdout/screen (``CRT''). This + option is similar to the -p option except that the + name of each file is printed as it is extracted, + the -a option is allowed, and ASCII-EBCDIC conver- + sion is automatically performed if appropriate. + This option is not listed in the unzip usage + screen. + + -f freshen existing files, i.e., extract only those + files that already exist on disk and that are newer + than the disk copies. By default unzip queries + before overwriting, but the -o option may be used + to suppress the queries. Note that under many + operating systems, the TZ (timezone) environment + variable must be set correctly in order for -f and + -u to work properly (under Unix the variable is + usually set automatically). The reasons for this + are somewhat subtle but have to do with the differ- + ences between DOS-format file times (always local + time) and Unix-format times (always in GMT/UTC) and + the necessity to compare the two. A typical TZ + value is ``PST8PDT'' (US Pacific time with auto- + matic adjustment for Daylight Savings Time or + ``summer time''). + + -l list archive files (short format). The names, + uncompressed file sizes and modification dates and + times of the specified files are printed, along + with totals for all files specified. If UnZip was + compiled with OS2_EAS defined, the -l option also + lists columns for the sizes of stored OS/2 extended + attributes (EAs) and OS/2 access control lists + (ACLs). In addition, the zipfile comment and indi- + vidual file comments (if any) are displayed. If a + file was archived from a single-case file system + (for example, the old MS-DOS FAT file system) and + the -L option was given, the filename is converted + to lowercase and is prefixed with a caret (^). + + -p extract files to pipe (stdout). Nothing but the + file data is sent to stdout, and the files are + always extracted in binary format, just as they are + stored (no conversions). + + -t test archive files. This option extracts each + specified file in memory and compares the CRC + (cyclic redundancy check, an enhanced checksum) of + the expanded file with the original file's stored + CRC value. + + -T [most OSes] set the timestamp on the archive(s) to + that of the newest file in each one. This corre- + sponds to zip's -go option except that it can be + used on wildcard zipfiles (e.g., ``unzip -T + +Info-ZIP 17 February 2002 (v5.5) 3 + +UNZIP(1L) UNZIP(1L) + + \*.zip'') and is much faster. + + -u update existing files and create new ones if + needed. This option performs the same function as + the -f option, extracting (with query) files that + are newer than those with the same name on disk, + and in addition it extracts those files that do not + already exist on disk. See -f above for informa- + tion on setting the timezone properly. + + -v be verbose or print diagnostic version info. This + option has evolved and now behaves as both an + option and a modifier. As an option it has two + purposes: when a zipfile is specified with no + other options, -v lists archive files verbosely, + adding to the basic -l info the compression method, + compressed size, compression ratio and 32-bit CRC. + When no zipfile is specified (that is, the complete + command is simply ``unzip -v''), a diagnostic + screen is printed. In addition to the normal + header with release date and version, unzip lists + the home Info-ZIP ftp site and where to find a list + of other ftp and non-ftp sites; the target operat- + ing system for which it was compiled, as well as + (possibly) the hardware on which it was compiled, + the compiler and version used, and the compilation + date; any special compilation options that might + affect the program's operation (see also DECRYPTION + below); and any options stored in environment vari- + ables that might do the same (see ENVIRONMENT + OPTIONS below). As a modifier it works in conjunc- + tion with other options (e.g., -t) to produce more + verbose or debugging output; this is not yet fully + implemented but will be in future releases. + + -z display only the archive comment. + +MODIFIERS + -a convert text files. Ordinarily all files are + extracted exactly as they are stored (as ``binary'' + files). The -a option causes files identified by + zip as text files (those with the `t' label in zip- + info listings, rather than `b') to be automatically + extracted as such, converting line endings, end-of- + file characters and the character set itself as + necessary. (For example, Unix files use line feeds + (LFs) for end-of-line (EOL) and have no end-of-file + (EOF) marker; Macintoshes use carriage returns + (CRs) for EOLs; and most PC operating systems use + CR+LF for EOLs and control-Z for EOF. In addition, + IBM mainframes and the Michigan Terminal System use + EBCDIC rather than the more common ASCII character + set, and NT supports Unicode.) Note that zip's + identification of text files is by no means + +Info-ZIP 17 February 2002 (v5.5) 4 + +UNZIP(1L) UNZIP(1L) + + perfect; some ``text'' files may actually be binary + and vice versa. unzip therefore prints ``[text]'' + or ``[binary]'' as a visual check for each file it + extracts when using the -a option. The -aa option + forces all files to be extracted as text, regard- + less of the supposed file type. + + -b [general] treat all files as binary (no text con- + versions). This is a shortcut for ---a. + + -b [Tandem] force the creation files with filecode + type 180 ('C') when extracting Zip entries marked + as "text". (On Tandem, -a is enabled by default, + see above). + + -b [VMS] auto-convert binary files (see -a above) to + fixed-length, 512-byte record format. Doubling the + option (-bb) forces all files to be extracted in + this format. When extracting to standard output (-c + or -p option in effect), the default conversion of + text record delimiters is disabled for binary (-b) + resp. all (-bb) files. + + -B [Unix only, and only if compiled with UNIXBACKUP + defined] save a backup copy of each overwritten + file with a tilde appended (e.g., the old copy of + ``foo'' is renamed to ``foo~''). This is similar + to the default behavior of emacs(1) in many loca- + tions. + + -C match filenames case-insensitively. unzip's phi- + losophy is ``you get what you ask for'' (this is + also responsible for the -L/-U change; see the rel- + evant options below). Because some file systems + are fully case-sensitive (notably those under the + Unix operating system) and because both ZIP + archives and unzip itself are portable across plat- + forms, unzip's default behavior is to match both + wildcard and literal filenames case-sensitively. + That is, specifying ``makefile'' on the command + line will only match ``makefile'' in the archive, + not ``Makefile'' or ``MAKEFILE'' (and similarly for + wildcard specifications). Since this does not cor- + respond to the behavior of many other operat- + ing/file systems (for example, OS/2 HPFS, which + preserves mixed case but is not sensitive to it), + the -C option may be used to force all filename + matches to be case-insensitive. In the example + above, all three files would then match ``make- + file'' (or ``make*'', or similar). The -C option + affects files in both the normal file list and the + excluded-file list (xlist). + + -E [MacOS only] display contents of MacOS extra field + +Info-ZIP 17 February 2002 (v5.5) 5 + +UNZIP(1L) UNZIP(1L) + + during restore operation. + + -F [Acorn only] suppress removal of NFS filetype + extension from stored filenames. + + -F [non-Acorn systems supporting long filenames with + embedded commas, and only if compiled with + ACORN_FTYPE_NFS defined] translate filetype infor- + mation from ACORN RISC OS extra field blocks into a + NFS filetype extension and append it to the names + of the extracted files. (When the stored filename + appears to already have an appended NFS filetype + extension, it is replaced by the info from the + extra field.) + + -i [MacOS only] ignore filenames stored in MacOS extra + fields. Instead, the most compatible filename + stored in the generic part of the entry's header is + used. + + -j junk paths. The archive's directory structure is + not recreated; all files are deposited in the + extraction directory (by default, the current one). + + -J [BeOS only] junk file attributes. The file's BeOS + file attributes are not restored, just the file's + data. + + -J [MacOS only] ignore MacOS extra fields. All Macin- + tosh specific info is skipped. Data-fork and + resource-fork are restored as separate files. + + -L convert to lowercase any filename originating on an + uppercase-only operating system or file system. + (This was unzip's default behavior in releases + prior to 5.11; the new default behavior is identi- + cal to the old behavior with the -U option, which + is now obsolete and will be removed in a future + release.) Depending on the archiver, files + archived under single-case file systems (VMS, old + MS-DOS FAT, etc.) may be stored as all-uppercase + names; this can be ugly or inconvenient when + extracting to a case-preserving file system such as + OS/2 HPFS or a case-sensitive one such as under + Unix. By default unzip lists and extracts such + filenames exactly as they're stored (excepting + truncation, conversion of unsupported characters, + etc.); this option causes the names of all files + from certain systems to be converted to lowercase. + The -LL option forces conversion of every filename + to lowercase, regardless of the originating file + system. + + -M pipe all output through an internal pager similar + +Info-ZIP 17 February 2002 (v5.5) 6 + +UNZIP(1L) UNZIP(1L) + + to the Unix more(1) command. At the end of a + screenful of output, unzip pauses with a + ``--More--'' prompt; the next screenful may be + viewed by pressing the Enter (Return) key or the + space bar. unzip can be terminated by pressing the + ``q'' key and, on some systems, the Enter/Return + key. Unlike Unix more(1), there is no forward- + searching or editing capability. Also, unzip + doesn't notice if long lines wrap at the edge of + the screen, effectively resulting in the printing + of two or more lines and the likelihood that some + text will scroll off the top of the screen before + being viewed. On some systems the number of avail- + able lines on the screen is not detected, in which + case unzip assumes the height is 24 lines. + + -n never overwrite existing files. If a file already + exists, skip the extraction of that file without + prompting. By default unzip queries before + extracting any file that already exists; the user + may choose to overwrite only the current file, + overwrite all files, skip extraction of the current + file, skip extraction of all existing files, or + rename the current file. + + -N [Amiga] extract file comments as Amiga filenotes. + File comments are created with the -c option of + zip(1L), or with the -N option of the Amiga port of + zip(1L), which stores filenotes as comments. + + -o overwrite existing files without prompting. This + is a dangerous option, so use it with care. (It is + often used with -f, however, and is the only way to + overwrite directory EAs under OS/2.) + + -P password + use password to decrypt encrypted zipfile entries + (if any). THIS IS INSECURE! Many multi-user oper- + ating systems provide ways for any user to see the + current command line of any other user; even on + stand-alone systems there is always the threat of + over-the-shoulder peeking. Storing the plaintext + password as part of a command line in an automated + script is even worse. Whenever possible, use the + non-echoing, interactive prompt to enter passwords. + (And where security is truly important, use strong + encryption such as Pretty Good Privacy instead of + the relatively weak encryption provided by standard + zipfile utilities.) + + -q perform operations quietly (-qq = even quieter). + Ordinarily unzip prints the names of the files it's + extracting or testing, the extraction methods, any + file or zipfile comments that may be stored in the + +Info-ZIP 17 February 2002 (v5.5) 7 + +UNZIP(1L) UNZIP(1L) + + archive, and possibly a summary when finished with + each archive. The -q[q] options suppress the + printing of some or all of these messages. + + -s [OS/2, NT, MS-DOS] convert spaces in filenames to + underscores. Since all PC operating systems allow + spaces in filenames, unzip by default extracts + filenames with spaces intact (e.g., + ``EA DATA. SF''). This can be awkward, however, + since MS-DOS in particular does not gracefully sup- + port spaces in filenames. Conversion of spaces to + underscores can eliminate the awkwardness in some + cases. + + -U (obsolete; to be removed in a future release) leave + filenames uppercase if created under MS-DOS, VMS, + etc. See -L above. + + -V retain (VMS) file version numbers. VMS files can + be stored with a version number, in the format + file.ext;##. By default the ``;##'' version num- + bers are stripped, but this option allows them to + be retained. (On file systems that limit filenames + to particularly short lengths, the version numbers + may be truncated or stripped regardless of this + option.) + + -X [VMS, Unix, OS/2, NT] restore owner/protection info + (UICs) under VMS, or user and group info (UID/GID) + under Unix, or access control lists (ACLs) under + certain network-enabled versions of OS/2 (Warp + Server with IBM LAN Server/Requester 3.0 to 5.0; + Warp Connect with IBM Peer 1.0), or security ACLs + under Windows NT. In most cases this will require + special system privileges, and doubling the option + (-XX) under NT instructs unzip to use privileges + for extraction; but under Unix, for example, a user + who belongs to several groups can restore files + owned by any of those groups, as long as the user + IDs match his or her own. Note that ordinary file + attributes are always restored--this option applies + only to optional, extra ownership info available on + some operating systems. [NT's access control lists + do not appear to be especially compatible with + OS/2's, so no attempt is made at cross-platform + portability of access privileges. It is not clear + under what conditions this would ever be useful + anyway.] + + -$ [MS-DOS, OS/2, NT] restore the volume label if the + extraction medium is removable (e.g., a diskette). + Doubling the option (-$$) allows fixed media (hard + disks) to be labelled as well. By default, volume + labels are ignored. + +Info-ZIP 17 February 2002 (v5.5) 8 + +UNZIP(1L) UNZIP(1L) + + -/ extensions + [Acorn only] overrides the extension list supplied + by Unzip$Ext environment variable. During extrac- + tion, filename extensions that match one of the + items in this extension list are swapped in front + of the base name of the extracted file. + + -: [all but Acorn, VM/CMS, MVS, Tandem] allows to + extract archive members into locations outside of + the current `` extraction root folder''. For secu- + rity reasons, unzip normally removes ``parent dir'' + path components (``../'') from the names of + extracted file. This safety feature (new for ver- + sion 5.50) prevents unzip from accidentally writing + files to ``sensitive'' areas outside the active + extraction folder tree head. The -: option lets + unzip switch back to its previous, more liberal + behaviour, to allow exact extraction of (older) + archives that used ``../'' components to create + multiple directory trees at the level of the cur- + rent extraction folder. + +ENVIRONMENT OPTIONS + unzip's default behavior may be modified via options + placed in an environment variable. This can be done with + any option, but it is probably most useful with the -a, + -L, -C, -q, -o, or -n modifiers: make unzip auto-convert + text files by default, make it convert filenames from + uppercase systems to lowercase, make it match names case- + insensitively, make it quieter, or make it always over- + write or never overwrite files as it extracts them. For + example, to make unzip act as quietly as possible, only + reporting errors, one would use one of the following com- + mands: + + Unix Bourne shell: + UNZIP=-qq; export UNZIP + + Unix C shell: + setenv UNZIP -qq + + OS/2 or MS-DOS: + set UNZIP=-qq + + VMS (quotes for lowercase): + define UNZIP_OPTS ""-qq"" + + Environment options are, in effect, considered to be just + like any other command-line options, except that they are + effectively the first options on the command line. To + override an environment option, one may use the ``minus + operator'' to remove it. For instance, to override one of + the quiet-flags in the example above, use the command + +Info-ZIP 17 February 2002 (v5.5) 9 + +UNZIP(1L) UNZIP(1L) + + unzip --q[other options] zipfile + + The first hyphen is the normal switch character, and the + second is a minus sign, acting on the q option. Thus the + effect here is to cancel one quantum of quietness. To + cancel both quiet flags, two (or more) minuses may be + used: + + unzip -t--q zipfile + unzip ---qt zipfile + + (the two are equivalent). This may seem awkward or con- + fusing, but it is reasonably intuitive: just ignore the + first hyphen and go from there. It is also consistent + with the behavior of Unix nice(1). + + As suggested by the examples above, the default variable + names are UNZIP_OPTS for VMS (where the symbol used to + install unzip as a foreign command would otherwise be con- + fused with the environment variable), and UNZIP for all + other operating systems. For compatibility with zip(1L), + UNZIPOPT is also accepted (don't ask). If both UNZIP and + UNZIPOPT are defined, however, UNZIP takes precedence. + unzip's diagnostic option (-v with no zipfile name) can be + used to check the values of all four possible unzip and + zipinfo environment variables. + + The timezone variable (TZ) should be set according to the + local timezone in order for the -f and -u to operate cor- + rectly. See the description of -f above for details. + This variable may also be necessary in order for times- + tamps on extracted files to be set correctly. Under Win- + dows 95/NT unzip should know the correct timezone even if + TZ is unset, assuming the timezone is correctly set in the + Control Panel. + +DECRYPTION + Encrypted archives are fully supported by Info-ZIP soft- + ware, but due to United States export restrictions, + de-/encryption support might be disabled in your compiled + binary. However, since spring 2000, US export restric- + tions have been liberated, and our source archives do now + include full crypt code. In case you need binary distri- + butions with crypt support enabled, see the file ``WHERE'' + in any Info-ZIP source or binary distribution for loca- + tions both inside and outside the US. + + Some compiled versions of unzip may not support decryp- + tion. To check a version for crypt support, either + attempt to test or extract an encrypted archive, or else + check unzip's diagnostic screen (see the -v option above) + for ``[decryption]'' as one of the special compilation + options. + +Info-ZIP 17 February 2002 (v5.5) 10 + +UNZIP(1L) UNZIP(1L) + + As noted above, the -P option may be used to supply a + password on the command line, but at a cost in security. + The preferred decryption method is simply to extract nor- + mally; if a zipfile member is encrypted, unzip will prompt + for the password without echoing what is typed. unzip + continues to use the same password as long as it appears + to be valid, by testing a 12-byte header on each file. + The correct password will always check out against the + header, but there is a 1-in-256 chance that an incorrect + password will as well. (This is a security feature of the + PKWARE zipfile format; it helps prevent brute-force + attacks that might otherwise gain a large speed advantage + by testing only the header.) In the case that an incor- + rect password is given but it passes the header test any- + way, either an incorrect CRC will be generated for the + extracted data or else unzip will fail during the extrac- + tion because the ``decrypted'' bytes do not constitute a + valid compressed data stream. + + If the first password fails the header check on some file, + unzip will prompt for another password, and so on until + all files are extracted. If a password is not known, + entering a null password (that is, just a carriage return + or ``Enter'') is taken as a signal to skip all further + prompting. Only unencrypted files in the archive(s) will + thereafter be extracted. (In fact, that's not quite true; + older versions of zip(1L) and zipcloak(1L) allowed null + passwords, so unzip checks each encrypted file to see if + the null password works. This may result in ``false posi- + tives'' and extraction errors, as noted above.) + + Archives encrypted with 8-bit passwords (for example, + passwords with accented European characters) may not be + portable across systems and/or other archivers. This + problem stems from the use of multiple encoding methods + for such characters, including Latin-1 (ISO 8859-1) and + OEM code page 850. DOS PKZIP 2.04g uses the OEM code + page; Windows PKZIP 2.50 uses Latin-1 (and is therefore + incompatible with DOS PKZIP); Info-ZIP uses the OEM code + page on DOS, OS/2 and Win3.x ports but Latin-1 everywhere + else; and Nico Mak's WinZip 6.x does not allow 8-bit pass- + words at all. UnZip 5.3 (or newer) attempts to use the + default character set first (e.g., Latin-1), followed by + the alternate one (e.g., OEM code page) to test passwords. + On EBCDIC systems, if both of these fail, EBCDIC encoding + will be tested as a last resort. (EBCDIC is not tested on + non-EBCDIC systems, because there are no known archivers + that encrypt using EBCDIC encoding.) ISO character encod- + ings other than Latin-1 are not supported. + +EXAMPLES + To use unzip to extract all members of the archive let- + ters.zip into the current directory and subdirectories + below it, creating any subdirectories as necessary: + +Info-ZIP 17 February 2002 (v5.5) 11 + +UNZIP(1L) UNZIP(1L) + + unzip letters + + To extract all members of letters.zip into the current + directory only: + + unzip -j letters + + To test letters.zip, printing only a summary message indi- + cating whether the archive is OK or not: + + unzip -tq letters + + To test all zipfiles in the current directory, printing + only the summaries: + + unzip -tq \*.zip + + (The backslash before the asterisk is only required if the + shell expands wildcards, as in Unix; double quotes could + have been used instead, as in the source examples + below.) To extract to standard output all members of let- + ters.zip whose names end in .tex, auto-converting to the + local end-of-line convention and piping the output into + more(1): + + unzip -ca letters \*.tex | more + + To extract the binary file paper1.dvi to standard output + and pipe it to a printing program: + + unzip -p articles paper1.dvi | dvips + + To extract all FORTRAN and C source files--*.f, *.c, *.h, + and Makefile--into the /tmp directory: + + unzip source.zip "*.[fch]" Makefile -d /tmp + + (the double quotes are necessary only in Unix and only if + globbing is turned on). To extract all FORTRAN and C + source files, regardless of case (e.g., both *.c and *.C, + and any makefile, Makefile, MAKEFILE or similar): + + unzip -C source.zip "*.[fch]" makefile -d /tmp + + To extract any such files but convert any uppercase MS-DOS + or VMS names to lowercase and convert the line-endings of + all of the files to the local standard (without respect to + any files that might be marked ``binary''): + + unzip -aaCL source.zip "*.[fch]" makefile -d /tmp + + To extract only newer versions of the files already in the + current directory, without querying (NOTE: be careful of + unzipping in one timezone a zipfile created in + +Info-ZIP 17 February 2002 (v5.5) 12 + +UNZIP(1L) UNZIP(1L) + + another--ZIP archives other than those created by Zip 2.1 + or later contain no timezone information, and a ``newer'' + file from an eastern timezone may, in fact, be older): + + unzip -fo sources + + To extract newer versions of the files already in the cur- + rent directory and to create any files not already there + (same caveat as previous example): + + unzip -uo sources + + To display a diagnostic screen showing which unzip and + zipinfo options are stored in environment variables, + whether decryption support was compiled in, the compiler + with which unzip was compiled, etc.: + + unzip -v + + In the last five examples, assume that UNZIP or UNZIP_OPTS + is set to -q. To do a singly quiet listing: + + unzip -l file.zip + + To do a doubly quiet listing: + + unzip -ql file.zip + + (Note that the ``.zip'' is generally not necessary.) To + do a standard listing: + + unzip --ql file.zip + or + unzip -l-q file.zip + or + unzip -l--q file.zip + (Extra minuses in options don't hurt.) + +TIPS + The current maintainer, being a lazy sort, finds it very + useful to define a pair of aliases: tt for ``unzip -tq'' + and ii for ``unzip -Z'' (or ``zipinfo''). One may then + simply type ``tt zipfile'' to test an archive, something + that is worth making a habit of doing. With luck unzip + will report ``No errors detected in compressed data of + zipfile.zip,'' after which one may breathe a sigh of + relief. + + The maintainer also finds it useful to set the UNZIP envi- + ronment variable to ``-aL'' and is tempted to add ``-C'' + as well. His ZIPINFO variable is set to ``-z''. + +DIAGNOSTICS + The exit status (or error level) approximates the exit + +Info-ZIP 17 February 2002 (v5.5) 13 + +UNZIP(1L) UNZIP(1L) + + codes defined by PKWARE and takes on the following values, + except under VMS: + + 0 normal; no errors or warnings detected. + + 1 one or more warning errors were encountered, + but processing completed successfully any- + way. This includes zipfiles where one or + more files was skipped due to unsupported + compression method or encryption with an + unknown password. + + 2 a generic error in the zipfile format was + detected. Processing may have completed + successfully anyway; some broken zipfiles + created by other archivers have simple work- + arounds. + + 3 a severe error in the zipfile format was + detected. Processing probably failed imme- + diately. + + 4 unzip was unable to allocate memory for one + or more buffers during program initializa- + tion. + + 5 unzip was unable to allocate memory or + unable to obtain a tty to read the decryp- + tion password(s). + + 6 unzip was unable to allocate memory during + decompression to disk. + + 7 unzip was unable to allocate memory during + in-memory decompression. + + 8 [currently not used] + + 9 the specified zipfiles were not found. + + 10 invalid options were specified on the com- + mand line. + + 11 no matching files were found. + + 50 the disk is (or was) full during extraction. + + 51 the end of the ZIP archive was encountered + prematurely. + + 80 the user aborted unzip prematurely with con- + trol-C (or similar) + + 81 testing or extraction of one or more files + +Info-ZIP 17 February 2002 (v5.5) 14 + +UNZIP(1L) UNZIP(1L) + + failed due to unsupported compression meth- + ods or unsupported decryption. + + 82 no files were found due to bad decryption + password(s). (If even one file is success- + fully processed, however, the exit status is + 1.) + + VMS interprets standard Unix (or PC) return values as + other, scarier-looking things, so unzip instead maps them + into VMS-style status codes. The current mapping is as + follows: 1 (success) for normal exit, 0x7fff0001 for + warning errors, and (0x7fff000? + 16*nor- + mal_unzip_exit_status) for all other errors, where the `?' + is 2 (error) for unzip values 2, 9-11 and 80-82, and 4 + (fatal error) for the remaining ones (3-8, 50, 51). In + addition, there is a compilation option to expand upon + this behavior: defining RETURN_CODES results in a human- + readable explanation of what the error status means. + +BUGS + Multi-part archives are not yet supported, except in con- + junction with zip. (All parts must be concatenated + together in order, and then ``zip -F'' must be performed + on the concatenated archive in order to ``fix'' it.) This + will definitely be corrected in the next major release. + + Archives read from standard input are not yet supported, + except with funzip (and then only the first member of the + archive can be extracted). + + Archives encrypted with 8-bit passwords (e.g., passwords + with accented European characters) may not be portable + across systems and/or other archivers. See the discussion + in DECRYPTION above. + + unzip's -M (``more'') option is overly simplistic in its + handling of screen output; as noted above, it fails to + detect the wrapping of long lines and may thereby cause + lines at the top of the screen to be scrolled off before + being read. unzip should detect and treat each occurrence + of line-wrap as one additional line printed. This + requires knowledge of the screen's width as well as its + height. In addition, unzip should detect the true screen + geometry on all systems. + + Dates, times and permissions of stored directories are not + restored except under Unix. + + [MS-DOS] When extracting or testing files from an archive + on a defective floppy diskette, if the ``Fail'' option is + chosen from DOS's ``Abort, Retry, Fail?'' message, older + versions of unzip may hang the system, requiring a reboot. + This problem appears to be fixed, but control-C (or + +Info-ZIP 17 February 2002 (v5.5) 15 + +UNZIP(1L) UNZIP(1L) + + control-Break) can still be used to terminate unzip. + + Under DEC Ultrix, unzip would sometimes fail on long zip- + files (bad CRC, not always reproducible). This was appar- + ently due either to a hardware bug (cache memory) or an + operating system bug (improper handling of page faults?). + Since Ultrix has been abandoned in favor of Digital Unix + (OSF/1), this may not be an issue anymore. + + [Unix] Unix special files such as FIFO buffers (named + pipes), block devices and character devices are not + restored even if they are somehow represented in the zip- + file, nor are hard-linked files relinked. Basically the + only file types restored by unzip are regular files, + directories and symbolic (soft) links. + + [OS/2] Extended attributes for existing directories are + only updated if the -o (``overwrite all'') option is + given. This is a limitation of the operating system; + because directories only have a creation time associated + with them, unzip has no way to determine whether the + stored attributes are newer or older than those on disk. + In practice this may mean a two-pass approach is required: + first unpack the archive normally (with or without fresh- + ening/updating existing files), then overwrite just the + directory entries (e.g., ``unzip -o foo */''). + + [VMS] When extracting to another directory, only the + [.foo] syntax is accepted for the -d option; the simple + Unix foo syntax is silently ignored (as is the less common + VMS foo.dir syntax). + + [VMS] When the file being extracted already exists, + unzip's query only allows skipping, overwriting or renam- + ing; there should additionally be a choice for creating a + new version of the file. In fact, the ``overwrite'' + choice does create a new version; the old version is not + overwritten or deleted. + +SEE ALSO + funzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), zip- + info(1L), zipnote(1L), zipsplit(1L) + +URL + The Info-ZIP home page is currently at + http://www.info-zip.org/pub/infozip/ + or + ftp://ftp.info-zip.org/pub/infozip/ . + +AUTHORS + The primary Info-ZIP authors (current semi-active members + of the Zip-Bugs workgroup) are: Greg ``Cave Newt'' + Roelofs (UnZip); Onno van der Linden (Zip); Jean-loup + Gailly (compression); Mark Adler (decompression, fUnZip); + +Info-ZIP 17 February 2002 (v5.5) 16 + +UNZIP(1L) UNZIP(1L) + + Christian Spieler (UnZip maintance coordination, VMS, MS- + DOS, Windows 95, NT, shared code, general Zip and UnZip + integration and optimization); Mike White (Windows GUI, + Windows DLLs); Kai Uwe Rommel (OS/2); Paul Kienitz (Amiga, + Windows 95); Chris Herborth (BeOS, QNX, Atari); Jonathan + Hudson (SMS/QDOS); Sergio Monesi (Acorn RISC OS); Harald + Denker (Atari, MVS); John Bush (Solaris, Amiga); Hunter + Goatley (VMS); Steve Salisbury (Windows 95, NT); Steve + Miller (Windows CE GUI), Johnny Lee (MS-DOS, Windows 95, + NT); and Dave Smith (Tandem NSK). The author of the orig- + inal unzip code upon which Info-ZIP's was based is Samuel + H. Smith; Carl Mascott did the first Unix port; and David + P. Kirschbaum organized and led Info-ZIP in its early + days with Keith Petersen hosting the original mailing list + at WSMR-SimTel20. The full list of contributors to UnZip + has grown quite large; please refer to the CONTRIBS file + in the UnZip source distribution for a relatively complete + version. + +VERSIONS + v1.2 15 Mar 89 Samuel H. Smith + v2.0 9 Sep 89 Samuel H. Smith + v2.x fall 1989 many Usenet contributors + v3.0 1 May 90 Info-ZIP (DPK, consolidator) + v3.1 15 Aug 90 Info-ZIP (DPK, consolidator) + v4.0 1 Dec 90 Info-ZIP (GRR, maintainer) + v4.1 12 May 91 Info-ZIP + v4.2 20 Mar 92 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.0 21 Aug 92 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.01 15 Jan 93 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.1 7 Feb 94 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.11 2 Aug 94 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.12 28 Aug 94 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.2 30 Apr 96 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.3 22 Apr 97 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.31 31 May 97 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.32 3 Nov 97 Info-ZIP (Zip-Bugs subgroup, GRR) + v5.4 28 Nov 98 Info-ZIP (Zip-Bugs subgroup, SPC) + v5.41 16 Apr 00 Info-ZIP (Zip-Bugs subgroup, SPC) + v5.42 14 Jan 01 Info-ZIP (Zip-Bugs subgroup, SPC) + v5.5 17 Feb 02 Info-ZIP (Zip-Bugs subgroup, SPC) + +Info-ZIP 17 February 2002 (v5.5) 17 + diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzpriv.h boinc-7.0.14+dfsg/zip/unzip/unzpriv.h --- boinc-7.0.7+dfsg/zip/unzip/unzpriv.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzpriv.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,2479 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unzpriv.h + + This header file contains private (internal) macros, typedefs, prototypes + and global-variable declarations used by all of the UnZip source files. + In a prior life it was part of the main unzip.h header, but now it is only + included by that header if UNZIP_INTERNAL is defined. + + ---------------------------------------------------------------------------*/ + + + +#ifndef __unzpriv_h /* prevent multiple inclusions */ +#define __unzpriv_h + +/* First thing: Signal all following code that we compile UnZip utilities! */ +#ifndef UNZIP +# define UNZIP +#endif + +/* GRR 960204: MORE defined here in preparation for removal altogether */ +#ifndef MORE +# ifndef RISCOS +# define MORE +# endif +#endif + +/* fUnZip should never need to be reentrant */ +#ifdef FUNZIP +# ifdef REENTRANT +# undef REENTRANT +# endif +# ifdef DLL +# undef DLL +# endif +# ifdef SFX /* fUnZip is NOT the sfx stub! */ +# undef SFX +# endif +#endif + +#ifdef NO_DEFLATE64 + /* disable support for Deflate64(tm) */ +# ifdef USE_DEFLATE64 +# undef USE_DEFLATE64 +# endif +#else + /* enable Deflate64(tm) support unless compiling for SFX stub */ +# if (!defined(USE_DEFLATE64) && !defined(SFX)) +# define USE_DEFLATE64 +# endif +#endif + +#if (defined(NO_VMS_TEXT_CONV) || defined(VMS)) +# ifdef VMS_TEXT_CONV +# undef VMS_TEXT_CONV +# endif +#else +# if (!defined(VMS_TEXT_CONV) && !defined(SFX)) +# define VMS_TEXT_CONV +# endif +#endif + +#if (defined(DLL) && !defined(REENTRANT)) +# define REENTRANT +#endif + +#if (!defined(DYNAMIC_CRC_TABLE) && !defined(FUNZIP)) +# define DYNAMIC_CRC_TABLE +#endif + +#if (defined(DYNAMIC_CRC_TABLE) && !defined(REENTRANT)) +# ifndef DYNALLOC_CRCTAB +# define DYNALLOC_CRCTAB +# endif +#endif + +/*--------------------------------------------------------------------------- + OS-dependent configuration for UnZip internals + ---------------------------------------------------------------------------*/ + +/* bad or (occasionally?) missing stddef.h: */ +#if (defined(M_XENIX) || defined(DNIX)) +# define NO_STDDEF_H +#endif + +#if (defined(M_XENIX) && !defined(M_UNIX)) /* SCO Xenix only, not SCO Unix */ +# define SCO_XENIX +# define NO_LIMITS_H /* no limits.h, but MODERN defined */ +# define NO_UID_GID /* no uid_t/gid_t */ +# define size_t int +#endif + +#ifdef realix /* Modcomp Real/IX, real-time SysV.3 variant */ +# define SYSV +# define NO_UID_GID /* no uid_t/gid_t */ +#endif + +#if (defined(_AIX) && !defined(_ALL_SOURCE)) +# define _ALL_SOURCE +#endif + +#if defined(apollo) /* defines __STDC__ */ +# define NO_STDLIB_H +#endif + +#ifdef DNIX +# define SYSV +# define SHORT_NAMES /* 14-char limitation on path components */ +/* # define FILENAME_MAX 14 */ +# define FILENAME_MAX NAME_MAX /* GRR: experiment */ +#endif + +#if (defined(SYSTEM_FIVE) || defined(__SYSTEM_FIVE)) +# ifndef SYSV +# define SYSV +# endif +#endif /* SYSTEM_FIVE || __SYSTEM_FIVE */ +#if (defined(M_SYSV) || defined(M_SYS5)) +# ifndef SYSV +# define SYSV +# endif +#endif /* M_SYSV || M_SYS5 */ +/* __SVR4 and __svr4__ catch Solaris on at least some combos of compiler+OS */ +#if (defined(__SVR4) || defined(__svr4__) || defined(sgi) || defined(__hpux)) +# ifndef SYSV +# define SYSV +# endif +#endif /* __SVR4 || __svr4__ || sgi || __hpux */ +#if (defined(LINUX) || defined(__QNX__)) +# ifndef SYSV +# define SYSV +# endif +#endif /* LINUX || __QNX__ */ + +#if (defined(ultrix) || defined(__ultrix) || defined(bsd4_2)) +# if (!defined(BSD) && !defined(SYSV)) +# define BSD +# endif +#endif /* ultrix || __ultrix || bsd4_2 */ +#if (defined(sun) || defined(pyr) || defined(CONVEX)) +# if (!defined(BSD) && !defined(SYSV)) +# define BSD +# endif +#endif /* sun || pyr || CONVEX */ + +#ifdef pyr /* Pyramid: has BSD and AT&T "universes" */ +# ifdef BSD +# define pyr_bsd +# define USE_STRINGS_H /* instead of more common string.h */ +# define ZMEM /* ZMEM now uses bcopy/bzero: not in AT&T universe */ +# endif /* (AT&T memcpy claimed to be very slow, though) */ +# define DECLARE_ERRNO +#endif /* pyr */ + +/* stat() bug for Borland, VAX C RTL, and Atari ST MiNT on TOS + * filesystems: returns 0 for wildcards! (returns 0xffffffff on Minix + * filesystem or `U:' drive under Atari MiNT.) Watcom C was previously + * included on this list; it would be good to know what version the problem + * was fixed at, if it did exist. */ +#if (defined(__TURBOC__) || defined(VMS) || defined(__MINT__)) +# define WILD_STAT_BUG +#endif + +/*--------------------------------------------------------------------------- + OS-dependent includes + ---------------------------------------------------------------------------*/ + +#ifdef EFT +# define LONGINT off_t /* Amdahl UTS nonsense ("extended file types") */ +#else +# define LONGINT long +#endif + +#ifdef MODERN +# ifndef NO_STDDEF_H +# include +# endif +# ifndef NO_STDLIB_H +# include /* standard library prototypes, malloc(), etc. */ +# endif + typedef size_t extent; +#else /* !MODERN */ +# ifndef AOS_VS /* mostly modern? */ + LONGINT lseek(); +# ifdef VAXC /* not fully modern, but does have stdlib.h and void */ +# include +# else + char *malloc(); +# endif /* ?VAXC */ +# endif /* !AOS_VS */ + typedef unsigned int extent; +#endif /* ?MODERN */ + + +#ifndef MINIX /* Minix needs it after all the other includes (?) */ +# include +#endif +#include /* skip for VMS, to use tolower() function? */ +#include /* used in mapname() */ +#ifdef USE_STRINGS_H +# include /* strcpy, strcmp, memcpy, index/rindex, etc. */ +#else +# include /* strcpy, strcmp, memcpy, strchr/strrchr, etc. */ +#endif +#if (defined(MODERN) && !defined(NO_LIMITS_H)) +# include /* GRR: EXPERIMENTAL! (can be deleted) */ +#endif + +/* this include must be down here for SysV.4, for some reason... */ +#include /* used in unzip.c, fileio.c */ + + +/*--------------------------------------------------------------------------- + API (DLL) section: + ---------------------------------------------------------------------------*/ + +#ifdef DLL +# define MAIN UZ_EXP UzpMain /* was UzpUnzip */ +# ifdef OS2DLL +# undef Info +# define REDIRECTC(c) varputchar(__G__ c) +# define REDIRECTPRINT(buf,size) varmessage(__G__ buf, size) +# define FINISH_REDIRECT() finish_REXX_redirect(__G) +# else +# define REDIRECTC(c) +# define REDIRECTPRINT(buf,size) 0 +# define FINISH_REDIRECT() close_redirect(__G) +# endif +#endif + +/*--------------------------------------------------------------------------- + Acorn RISCOS section: + ---------------------------------------------------------------------------*/ + +#ifdef RISCOS +# include "acorn/riscos.h" +#endif + +/*--------------------------------------------------------------------------- + Amiga section: + ---------------------------------------------------------------------------*/ + +#ifdef AMIGA +# include "amiga/amiga.h" +#endif + +/*--------------------------------------------------------------------------- + AOS/VS section (somewhat similar to Unix, apparently): + ---------------------------------------------------------------------------*/ + +#ifdef AOS_VS +# ifdef __FILEIO_C +# include "aosvs/aosvs.h" +# endif +#endif + +/*--------------------------------------------------------------------------- + Atari ST section: + ---------------------------------------------------------------------------*/ + +#ifdef ATARI +# include +# include +# include +# include +# define SYMLINKS +# define EXE_EXTENSION ".tos" +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_DMY +# endif +# define DIR_END '/' +# define INT_SPRINTF +# define timezone _timezone +# define lenEOL 2 +# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} +# undef SHORT_NAMES +# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) +# define TIMESTAMP +# endif +#endif + +/*--------------------------------------------------------------------------- + BeOS section: + ---------------------------------------------------------------------------*/ + +#ifdef __BEOS__ +# include /* [cjh]: This is pretty much a generic */ +# include /* POSIX 1003.1 system; see beos/ for */ +# include /* extra code to deal with our extra file */ +# include /* attributes. */ +# include +# include +# define DIRENT +# include +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY /* GRR: customize with locale.h somehow? */ +# endif +# define lenEOL 1 +# define PutNativeEOL *q++ = native(LF); +# define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) +# define SCREENWIDTH 80 +# define USE_EF_UT_TIME +# define SET_DIR_ATTRIB +# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) +# define TIMESTAMP +# endif +# define RESTORE_UIDGID +# define NO_STRNICMP /* not in the x86 headers at least */ +# define INT_SPRINTF +# define SYMLINKS +# define MAIN main_stub /* now that we're using a wrapper... */ +#endif + +/*--------------------------------------------------------------------------- + Human68k/X680x0 section: + ---------------------------------------------------------------------------*/ + +#ifdef __human68k__ + /* DO NOT DEFINE DOS_OS2 HERE! If Human68k is so much */ + /* like MS-DOS and/or OS/2, create DOS_H68_OS2 macro. */ +# ifndef _MBCS +# define _MBCS +# endif +# include +# include +# include +# include +# include +# ifdef HAVE_MBSTRING_H +# include +# endif +# ifdef HAVE_MBCTYPE_H +# include +# else +# ifndef _ismbblead +# define _ismbblead(c) (0x80 <= (c) && ((c) < 0xa0 || 0xe0 <= (c))) +# endif +# endif +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_YMD /* Japanese standard */ +# endif +# define lenEOL 1 +# define PutNativeEOL *q++ = native(LF); +# define INT_SPRINTF +# define SYMLINKS +# ifdef SFX +# define MAIN main_sfx +# endif +#endif + +/*--------------------------------------------------------------------------- + Mac section: + ---------------------------------------------------------------------------*/ + +#ifdef MACOS +# include "maccfg.h" +#endif /* MACOS */ + +/*--------------------------------------------------------------------------- + MS-DOS, OS/2, FLEXOS section: + ---------------------------------------------------------------------------*/ + +#ifdef WINDLL +# ifdef MORE +# undef MORE +# endif +# ifdef OS2_EAS +# undef OS2_EAS +# endif +#endif + +#if (defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__))) +# ifndef MSC +# define MSC /* This should work for older MSC, too! */ +# endif +#endif + +#if (defined(MSDOS) || defined(OS2) || defined(FLEXOS)) +# include /* off_t, time_t, dev_t, ... */ +# include +# include /* lseek(), open(), setftime(), dup(), creat() */ +# include /* localtime() */ +# include /* O_BINARY for open() w/o CR/LF translation */ + +# ifdef OS2 /* defined for all OS/2 compilers */ +# include "os2/os2cfg.h" +# else +# ifdef FLEXOS +# include "flexos/flxcfg.h" +# else +# include "msdos/doscfg.h" +# endif +# endif + +# if (defined(_MSC_VER) && (_MSC_VER == 700) && !defined(GRR)) + /* + * ARGH. MSC 7.0 libraries think times are based on 1899 Dec 31 00:00, not + * 1970 Jan 1 00:00. So we have to diddle time_t's appropriately: add or + * subtract 70 years' worth of seconds; i.e., number of days times 86400; + * i.e., (70*365 regular days + 17 leap days + 1 1899 day) * 86400 == + * (25550 + 17 + 1) * 86400 == 2209075200 seconds. We know time_t is an + * unsigned long (ulg) on the only system with this bug. + */ +# define TIMET_TO_NATIVE(x) (x) += (ulg)2209075200L; +# define NATIVE_TO_TIMET(x) (x) -= (ulg)2209075200L; +# endif +# if (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0450)) +# define timezone _timezone +# endif +# if (defined(__GO32__) || defined(FLEXOS)) +# define DIR_END '/' +# else +# define DIR_END '\\' /* OS uses '\\' as directory separator */ +# define DIR_END2 '/' /* also check for '/' (RTL may convert) */ +# endif +# ifdef DATE_FORMAT +# undef DATE_FORMAT +# endif +# define DATE_FORMAT dateformat() +# define lenEOL 2 +# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} +# define USE_EF_UT_TIME +#endif /* MSDOS || OS2 || FLEXOS */ + +/*--------------------------------------------------------------------------- + MTS section (piggybacks UNIX, I think): + ---------------------------------------------------------------------------*/ + +#ifdef MTS +# include /* off_t, time_t, dev_t, ... */ +# include +# include /* MTS uses this instead of fcntl.h */ +# include +# include +# include /* some important non-ANSI routines */ +# define mkdir(s,n) (-1) /* no "make directory" capability */ +# define EBCDIC /* set EBCDIC conversion on */ +# define NO_STRNICMP /* unzip's is as good the one in MTS */ +# define USE_FWRITE +# define close_outfile() fclose(G.outfile) /* can't set time on files */ +# define umask(n) /* don't have umask() on MTS */ +# define FOPWT "w" /* open file for writing in TEXT mode */ +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY +# endif +# define lenEOL 1 +# define PutNativeEOL *q++ = native(LF); +#endif /* MTS */ + + /*--------------------------------------------------------------------------- + Novell NLM section + ---------------------------------------------------------------------------*/ + +#ifdef NLM +# include "novell/nlmcfg.h" +#endif + + /*--------------------------------------------------------------------------- + QDOS section + ---------------------------------------------------------------------------*/ + +#ifdef QDOS +# define DIRENT +# include +# include +# include +# include +# include "qdos/izqdos.h" +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY +# endif +# define lenEOL 1 +# define PutNativeEOL *q++ = native(LF); +# define DIR_END '_' +# define RETURN QReturn +# undef PATH_MAX +# define PATH_MAX 36 +# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) +# define TIMESTAMP +# endif +# define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) +# define SCREENWIDTH 80 +#endif + +/*--------------------------------------------------------------------------- + Tandem NSK section: + ---------------------------------------------------------------------------*/ + +#ifdef TANDEM +# include "tandem.h" +# include +# if (!defined(__INT32) && !defined(INT_16BIT)) +# define INT_16BIT /* report "int" size is 16-bit to inflate setup */ +# endif + /* use a single LF delimiter so that writes to 101 text files work */ +# define PutNativeEOL *q++ = native(LF); +# define lenEOL 1 +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_DMY +# endif +# define SCREENLINES 25 + /* USE_EF_UT_TIME is set in tandem.h */ +# define RESTORE_UIDGID +# define NO_STRNICMP +#endif + +/*--------------------------------------------------------------------------- + THEOS section: + ---------------------------------------------------------------------------*/ + +#ifdef THEOS +# include "theos/thscfg.h" +#endif + +/*--------------------------------------------------------------------------- + TOPS-20 section: + ---------------------------------------------------------------------------*/ + +#ifdef TOPS20 +# include /* off_t, time_t, dev_t, ... */ +# include +# include +# include +# include +# include +# include +# include /* get amazing monsym() macro */ + extern int open(), close(), read(); + extern int stat(), unlink(), jsys(), fcntl(); + extern long lseek(), dup(), creat(); +# define strchr index /* GRR: necessary? */ +# define strrchr rindex +# define REALLY_SHORT_SYMS +# define NO_MKDIR +# ifndef HAVE_STRNICMP +# define NO_STRNICMP /* probably not provided by TOPS20 C RTL */ +# endif +# define DIR_BEG '<' +# define DIR_END '>' +# define DIR_EXT ".directory" +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY +# endif +# define EXE_EXTENSION ".exe" /* just a guess... */ +#endif /* TOPS20 */ + +/*--------------------------------------------------------------------------- + Unix section: + ---------------------------------------------------------------------------*/ + +#ifdef UNIX +# include "unix/unxcfg.h" +#endif /* UNIX */ + +/*--------------------------------------------------------------------------- + VM/CMS and MVS section: + ---------------------------------------------------------------------------*/ + +#ifdef CMS_MVS +# include "vmmvs.h" +# define CLOSE_INFILE() close_infile(__G) +#endif + +/*--------------------------------------------------------------------------- + VMS section: + ---------------------------------------------------------------------------*/ + +#ifdef VMS +# include /* GRR: experimenting... */ +# include +# include /* the usual non-BSD time functions */ +# include /* same things as fcntl.h has */ +# include +# include +# define _MAX_PATH (NAM$C_MAXRSS+1) /* to define FILNAMSIZ below */ +# ifndef HAVE_STRNICMP /* use our private zstrnicmp() */ +# define NO_STRNICMP /* unless explicitely overridden */ +# endif +# ifdef RETURN_CODES /* VMS interprets standard PK return codes incorrectly */ +# define RETURN(ret) return_VMS(__G__ (ret)) /* verbose version */ +# define EXIT(ret) return_VMS(__G__ (ret)) +# else +# define RETURN return_VMS /* quiet version */ +# define EXIT return_VMS +# endif +# ifdef VMSCLI +# define USAGE(ret) VMSCLI_usage(__G__ (ret)) +# endif +# define DIR_BEG '[' +# define DIR_END ']' +# define DIR_EXT ".dir" +# ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY +# endif +# define lenEOL 1 +# define PutNativeEOL *q++ = native(LF); +# define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) +# define SCREENWIDTH 80 +# define SCREENLWRAP screenlinewrap() +# if (defined(__VMS_VERSION) && !defined(VMS_VERSION)) +# define VMS_VERSION __VMS_VERSION +# endif +# if (defined(__VMS_VER) && !defined(__CRTL_VER)) +# define __CRTL_VER __VMS_VER +# endif +# if ((!defined(__CRTL_VER)) || (__CRTL_VER < 70000000)) +# define NO_GMTIME /* gmtime() of earlier VMS C RTLs is broken */ +# else +# if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) +# define USE_EF_UT_TIME +# endif +# endif +# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) +# define TIMESTAMP +# endif +# define RESTORE_UIDGID +#endif /* VMS */ + +/*--------------------------------------------------------------------------- + Win32 (Windows 95/NT) section: + ---------------------------------------------------------------------------*/ + +#if (defined(WIN32) && !defined(POCKET_UNZIP)) +# include "win32/w32cfg.h" +#endif + + + + + +/*************/ +/* Defines */ +/*************/ + +#ifdef USE_DEFLATE64 +# define UNZIP_VERSION 21 /* compatible with PKUNZIP 4.0 */ +#else +# define UNZIP_VERSION 20 /* compatible with PKUNZIP 2.0 */ +#endif +#define VMS_UNZIP_VERSION 42 /* if OS-needed-to-extract is VMS: can do */ + +#if (defined(MSDOS) || defined(OS2)) +# define DOS_OS2 +#endif + +#if (defined(OS2) || defined(WIN32)) +# define OS2_W32 +#endif + +#if (defined(DOS_OS2) || defined(WIN32)) +# define DOS_OS2_W32 +# define DOS_W32_OS2 /* historical: don't use */ +#endif + +#if (defined(DOS_OS2_W32) || defined(__human68k__)) +# define DOS_H68_OS2_W32 +#endif + +#if (defined(DOS_OS2) || defined(FLEXOS)) +# define DOS_FLX_OS2 +#endif + +#if (defined(DOS_OS2_W32) || defined(FLEXOS)) +# define DOS_FLX_OS2_W32 +#endif + +#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) +# define DOS_FLX_H68_OS2_W32 +#endif + +#if (defined(DOS_FLX_OS2) || defined(NLM)) +# define DOS_FLX_NLM_OS2 +#endif + +#if (defined(DOS_FLX_OS2_W32) || defined(NLM)) +# define DOS_FLX_NLM_OS2_W32 +#endif + +#if (defined(DOS_FLX_H68_OS2_W32) || defined(NLM)) +# define DOS_FLX_H68_NLM_OS2_W32 +#endif + +#if (defined(TOPS20) || defined(VMS)) +# define T20_VMS +#endif + +#if (defined(MSDOS) || defined(T20_VMS)) +# define DOS_T20_VMS +#endif + +#if (defined(__BEOS__) || defined(UNIX)) +# define BEO_UNX +#endif + +#if (defined(BEO_UNX) || defined(THEOS)) +# define BEO_THS_UNX +#endif + +/* clean up with a few defaults */ +#ifndef DIR_END +# define DIR_END '/' /* last char before program name or filename */ +#endif +#ifndef DATE_FORMAT +# define DATE_FORMAT DF_MDY /* defaults to US convention */ +#endif +#ifndef CLOSE_INFILE +# define CLOSE_INFILE() close(G.zipfd) +#endif +#ifndef RETURN +# define RETURN return /* only used in main() */ +#endif +#ifndef EXIT +# define EXIT unzip_exit +#endif +#ifndef USAGE +# define USAGE(ret) usage(__G__ (ret)) /* used in unzip.c, zipinfo.c */ +#endif +#ifndef TIMET_TO_NATIVE /* everybody but MSC 7.0 and Macintosh */ +# define TIMET_TO_NATIVE(x) +# define NATIVE_TO_TIMET(x) +#endif +#ifndef SSTAT +# ifdef WILD_STAT_BUG +# define SSTAT(path,pbuf) (iswild(path) || stat(path,pbuf)) +# else +# define SSTAT stat +# endif +#endif +#ifndef STRNICMP +# ifdef NO_STRNICMP +# define STRNICMP zstrnicmp +# else +# define STRNICMP strnicmp +# endif +#endif + + +#if (defined(DOS_FLX_NLM_OS2_W32) || defined(BEO_UNX) || defined(RISCOS)) +# ifndef HAVE_UNLINK +# define HAVE_UNLINK +# endif +#endif +#if (defined(AOS_VS) || defined(ATARI)) /* GRR: others? */ +# ifndef HAVE_UNLINK +# define HAVE_UNLINK +# endif +#endif + +/* OS-specific exceptions to the "ANSI <--> INT_SPRINTF" rule */ + +#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF)) +# if (defined(SYSV) || defined(CONVEX) || defined(NeXT) || defined(BSD4_4)) +# define INT_SPRINTF /* sprintf() returns int: SysVish/Posix */ +# endif +# if (defined(DOS_FLX_NLM_OS2_W32) || defined(VMS) || defined(AMIGA)) +# define INT_SPRINTF /* sprintf() returns int: ANSI */ +# endif +# if (defined(ultrix) || defined(__ultrix)) /* Ultrix 4.3 and newer */ +# if (defined(POSIX) || defined(__POSIX)) +# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */ +# endif +# ifdef __GNUC__ +# define PCHAR_SPRINTF /* undetermined actual return value */ +# endif +# endif +# if (defined(__osf__) || defined(_AIX) || defined(CMS_MVS) || defined(THEOS)) +# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */ +# endif +# if defined(sun) +# define PCHAR_SPRINTF /* sprintf() returns char *: SunOS cc *and* gcc */ +# endif +#endif + +/* defaults that we hope will take care of most machines in the future */ + +#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF)) +# ifdef __STDC__ +# define INT_SPRINTF /* sprintf() returns int: ANSI */ +# endif +# ifndef INT_SPRINTF +# define PCHAR_SPRINTF /* sprintf() returns char *: BSDish */ +# endif +#endif + +#define MSG_STDERR(f) (f & 1) /* bit 0: 0 = stdout, 1 = stderr */ +#define MSG_INFO(f) ((f & 6) == 0) /* bits 1 and 2: 0 = info */ +#define MSG_WARN(f) ((f & 6) == 2) /* bits 1 and 2: 1 = warning */ +#define MSG_ERROR(f) ((f & 6) == 4) /* bits 1 and 2: 2 = error */ +#define MSG_FATAL(f) ((f & 6) == 6) /* bits 1 and 2: (3 = fatal error) */ +#define MSG_ZFN(f) (f & 0x0008) /* bit 3: 1 = print zipfile name */ +#define MSG_FN(f) (f & 0x0010) /* bit 4: 1 = print filename */ +#define MSG_LNEWLN(f) (f & 0x0020) /* bit 5: 1 = leading newline if !SOL */ +#define MSG_TNEWLN(f) (f & 0x0040) /* bit 6: 1 = trailing newline if !SOL */ +#define MSG_MNEWLN(f) (f & 0x0080) /* bit 7: 1 = trailing NL for prompts */ +/* the following are subject to change */ +#define MSG_NO_WGUI(f) (f & 0x0100) /* bit 8: 1 = skip if Windows GUI */ +#define MSG_NO_AGUI(f) (f & 0x0200) /* bit 9: 1 = skip if Acorn GUI */ +#define MSG_NO_DLL2(f) (f & 0x0400) /* bit 10: 1 = skip if OS/2 DLL */ +#define MSG_NO_NDLL(f) (f & 0x0800) /* bit 11: 1 = skip if WIN32 DLL */ +#define MSG_NO_WDLL(f) (f & 0x1000) /* bit 12: 1 = skip if Windows DLL */ + +#if (defined(MORE) && !defined(SCREENLINES)) +# ifdef DOS_FLX_NLM_OS2_W32 +# define SCREENLINES 25 /* can be (should be) a function instead */ +# else +# define SCREENLINES 24 /* VT-100s are assumed to be minimal hardware */ +# endif +#endif +#if (defined(MORE) && !defined(SCREENSIZE)) +# ifndef SCREENWIDTH +# define SCREENSIZE(scrrows, scrcols) { \ + if ((scrrows) != NULL) *(scrrows) = SCREENLINES; } +# else +# define SCREENSIZE(scrrows, scrcols) { \ + if ((scrrows) != NULL) *(scrrows) = SCREENLINES; \ + if ((scrcols) != NULL) *(scrcols) = SCREENWIDTH; } +# endif +#endif + +#define DIR_BLKSIZ 64 /* number of directory entries per block + * (should fit in 4096 bytes, usually) */ +#ifndef WSIZE +# ifdef USE_DEFLATE64 +# define WSIZE 65536L /* window size--must be a power of two, and */ +# else /* at least 64K for PKZip's deflate64 method */ +# define WSIZE 0x8000 /* window size--must be a power of two, and */ +# endif /* at least 32K for zip's deflate method */ +#endif + +#ifndef INBUFSIZ +# if (defined(MED_MEM) || defined(SMALL_MEM)) +# define INBUFSIZ 2048 /* works for MS-DOS small model */ +# else +# define INBUFSIZ 8192 /* larger buffers for real OSes */ +# endif +#endif + +#ifdef __16BIT__ +# ifndef INT_16BIT +# define INT_16BIT /* on 16-bit systems int size is 16 bits */ +# endif +#else +# define nearmalloc malloc +# define nearfree free +# if (!defined(__IBMC__) || !defined(OS2)) +# ifndef near +# define near +# endif +# ifndef far +# define far +# endif +# endif +#endif + +#if (defined(DYNALLOC_CRCTAB) && !defined(DYNAMIC_CRC_TABLE)) +# undef DYNALLOC_CRCTAB +#endif + +#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) +# undef DYNALLOC_CRCTAB /* not safe with reentrant code */ +#endif + +#if (defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB)) +# ifdef DYNALLOC_CRCTAB +# undef DYNALLOC_CRCTAB +# endif +#endif + +#if (defined(USE_ZLIB) && defined(ASM_CRC)) +# undef ASM_CRC +#endif + +/* Logic for case of small memory, length of EOL > 1: if OUTBUFSIZ == 2048, + * OUTBUFSIZ>>1 == 1024 and OUTBUFSIZ>>7 == 16; therefore rawbuf is 1008 bytes + * and transbuf 1040 bytes. Have room for 32 extra EOL chars; 1008/32 == 31.5 + * chars/line, smaller than estimated 35-70 characters per line for C source + * and normal text. Hence difference is sufficient for most "average" files. + * (Argument scales for larger OUTBUFSIZ.) + */ +#ifdef SMALL_MEM /* i.e., 16-bit OSes: MS-DOS, OS/2 1.x, etc. */ +# define LoadFarString(x) fLoadFarString(__G__ (x)) +# define LoadFarStringSmall(x) fLoadFarStringSmall(__G__ (x)) +# define LoadFarStringSmall2(x) fLoadFarStringSmall2(__G__ (x)) +# if (defined(_MSC_VER) && (_MSC_VER >= 600)) +# define zfstrcpy(dest, src) _fstrcpy((dest), (src)) +# endif +# ifndef Far +# define Far far /* __far only works for MSC 6.00, not 6.0a or Borland */ +# endif +# define OUTBUFSIZ INBUFSIZ +# if (lenEOL == 1) +# define RAWBUFSIZ (OUTBUFSIZ>>1) +# else +# define RAWBUFSIZ ((OUTBUFSIZ>>1) - (OUTBUFSIZ>>7)) +# endif +# define TRANSBUFSIZ (OUTBUFSIZ-RAWBUFSIZ) + typedef short shrint; /* short/int or "shrink int" (unshrink) */ +#else +# define zfstrcpy(dest, src) strcpy((dest), (src)) +# ifdef QDOS +# define LoadFarString(x) Qstrfix(x) /* fix up _ for '.' */ +# define LoadFarStringSmall(x) Qstrfix(x) +# define LoadFarStringSmall2(x) Qstrfix(x) +# else +# define LoadFarString(x) (char *)(x) +# define LoadFarStringSmall(x) (char *)(x) +# define LoadFarStringSmall2(x) (char *)(x) +# endif +# ifdef MED_MEM +# define OUTBUFSIZ 0xFF80 /* can't malloc arrays of 0xFFE8 or more */ +# define TRANSBUFSIZ 0xFF80 + typedef short shrint; +# else +# define OUTBUFSIZ (lenEOL*WSIZE) /* more efficient text conversion */ +# define TRANSBUFSIZ (lenEOL*OUTBUFSIZ) +# ifdef AMIGA + typedef short shrint; +# else + typedef int shrint; /* for efficiency/speed, we hope... */ +# endif +# endif /* ?MED_MEM */ +# define RAWBUFSIZ OUTBUFSIZ +#endif /* ?SMALL_MEM */ + +#ifndef Far +# define Far +#endif + +#ifndef MAIN +# define MAIN main +#endif + +#ifdef SFX /* disable some unused features for SFX executables */ +# ifndef NO_ZIPINFO +# define NO_ZIPINFO +# endif +# ifdef TIMESTAMP +# undef TIMESTAMP +# endif +#endif + +#ifdef SFX +# ifdef CHEAP_SFX_AUTORUN +# ifndef NO_SFX_EXDIR +# define NO_SFX_EXDIR +# endif +# endif +# ifndef NO_SFX_EXDIR +# ifndef SFX_EXDIR +# define SFX_EXDIR +# endif +# else +# ifdef SFX_EXDIR +# undef SFX_EXDIR +# endif +# endif +#endif + +/* user may have defined both by accident... NOTIMESTAMP takes precedence */ +#if (defined(TIMESTAMP) && defined(NOTIMESTAMP)) +# undef TIMESTAMP +#endif + +#if (!defined(COPYRIGHT_CLEAN) && !defined(USE_SMITH_CODE)) +# define COPYRIGHT_CLEAN +#endif + +#if (!defined(LZW_CLEAN) && !defined(USE_UNSHRINK)) +# define LZW_CLEAN +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +#ifndef PIPE_ERROR +# define PIPE_ERROR (errno == EPIPE) +#endif + +/* File operations--use "b" for binary if allowed or fixed length 512 on VMS */ +#ifdef VMS +# define FOPR "r","ctx=stm" +# define FOPM "r+","ctx=stm","rfm=fix","mrs=512" +# define FOPW "w","ctx=stm","rfm=fix","mrs=512" +#endif /* VMS */ + +#ifdef CMS_MVS +/* Binary files must be RECFM=F,LRECL=1 for ftell() to get correct pos */ +/* ...unless byteseek is used. Let's try that for a while. */ +# define FOPR "rb,byteseek" +# define FOPM "r+b,byteseek" +# ifdef MVS +# define FOPW "wb,recfm=u,lrecl=32760,byteseek" /* New binary files */ +# define FOPWE "wb" /* Existing binary files */ +# define FOPWT "w,lrecl=133" /* New text files */ +# define FOPWTE "w" /* Existing text files */ +# else +# define FOPW "wb,recfm=v,lrecl=32760" +# define FOPWT "w" +# endif +#endif /* CMS_MVS */ + +#ifdef TOPS20 /* TOPS-20 MODERN? You kidding? */ +# define FOPW "w8" +#endif /* TOPS20 */ + +/* Defaults when nothing special has been defined previously. */ +#ifdef MODERN +# ifndef FOPR +# define FOPR "rb" +# endif +# ifndef FOPM +# define FOPM "r+b" +# endif +# ifndef FOPW +# define FOPW "wb" +# endif +# ifndef FOPWT +# define FOPWT "wt" +# endif +#else /* !MODERN */ +# ifndef FOPR +# define FOPR "r" +# endif +# ifndef FOPM +# define FOPM "r+" +# endif +# ifndef FOPW +# define FOPW "w" +# endif +# ifndef FOPWT +# define FOPWT "w" +# endif +#endif /* ?MODERN */ + +/* + * If exists on most systems, should include that, since it may + * define some or all of the following: NAME_MAX, PATH_MAX, _POSIX_NAME_MAX, + * _POSIX_PATH_MAX. + */ +#ifdef DOS_FLX_NLM_OS2_W32 +# include +#endif + +#ifndef PATH_MAX +# ifdef MAXPATHLEN +# define PATH_MAX MAXPATHLEN /* in on some systems */ +# else +# ifdef _MAX_PATH +# define PATH_MAX _MAX_PATH +# else +# if FILENAME_MAX > 255 +# define PATH_MAX FILENAME_MAX /* used like PATH_MAX on some systems */ +# else +# define PATH_MAX 1024 +# endif +# endif /* ?_MAX_PATH */ +# endif /* ?MAXPATHLEN */ +#endif /* !PATH_MAX */ + +#define FILNAMSIZ PATH_MAX + +/* DBCS support for Info-ZIP (mainly for japanese (-: ) + * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) + */ +#ifdef _MBCS +# include + /* Multi Byte Character Set */ +# define ___MBS_TMP_DEF char *___tmp_ptr; +# define ___TMP_PTR ___tmp_ptr +# define CLEN(ptr) mblen((ZCONST char *)(ptr), MB_CUR_MAX) +# ifndef PREINCSTR +# define PREINCSTR(ptr) (ptr += CLEN(ptr)) +# endif +# define POSTINCSTR(ptr) (___TMP_PTR=(char *)(ptr), PREINCSTR(ptr),___TMP_PTR) + char *plastchar OF((ZCONST char *ptr, extent len)); +# define lastchar(ptr, len) ((int)(unsigned)*plastchar(ptr, len)) +# ifndef MBSCHR +# define NEED_UZMBSCHR +# define MBSCHR(str,c) (char *)uzmbschr((ZCONST unsigned char *)(str), c) +# endif +# ifndef MBSRCHR +# define NEED_UZMBSRCHR +# define MBSRCHR(str,c) (char *)uzmbsrchr((ZCONST unsigned char *)(str), c) +# endif +# define SETLOCALE(category, locale) setlocale(category, locale) +#else /* !_MBCS */ +# define ___MBS_TMP_DEF +# define ___TMP_PTR +# define CLEN(ptr) 1 +# define PREINCSTR(ptr) (++(ptr)) +# define POSTINCSTR(ptr) ((ptr)++) +# define plastchar(ptr, len) (&ptr[(len)-1]) +# define lastchar(ptr, len) (ptr[(len)-1]) +# define MBSCHR(str, c) strchr(str, c) +# define MBSRCHR(str, c) strrchr(str, c) +# define SETLOCALE(category, locale) +#endif /* ?_MBCS */ +#define INCSTR(ptr) PREINCSTR(ptr) + + +#if (defined(MALLOC_WORK) && !defined(MY_ZCALLOC)) + /* Any system without a special calloc function */ +# define zcalloc(items, size) \ + (zvoid far *)calloc((unsigned)(items), (unsigned)(size)) +# define zcfree free +#endif /* MALLOC_WORK && !MY_ZCALLOC */ + +#ifdef REGULUS /* returns the inode number on success(!)...argh argh argh */ +# define stat(p,s) zstat((p),(s)) +#endif + +#if (defined(CRAY) && defined(ZMEM)) +# undef ZMEM +#endif + +#ifdef ZMEM +# undef ZMEM +# define memcmp(b1,b2,len) bcmp(b2,b1,len) +# define memcpy(dest,src,len) bcopy(src,dest,len) +# define memzero bzero +#else +# define memzero(dest,len) memset(dest,0,len) +#endif + +#ifndef TRUE +# define TRUE 1 /* sort of obvious */ +#endif +#ifndef FALSE +# define FALSE 0 +#endif + +#ifndef SEEK_SET +# define SEEK_SET 0 +# define SEEK_CUR 1 +# define SEEK_END 2 +#endif + +#if (!defined(S_IEXEC) && defined(S_IXUSR)) +# define S_IEXEC S_IXUSR +#endif + +#if (defined(UNIX) && defined(S_IFLNK) && !defined(MTS)) +# define SYMLINKS +# ifndef S_ISLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# endif +#endif /* UNIX && S_IFLNK && !MTS */ + +#ifndef S_ISDIR +# ifdef CMS_MVS +# define S_ISDIR(m) (FALSE) +# else +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# endif +#endif + +#ifndef IS_VOLID +# define IS_VOLID(m) ((m) & 0x08) +#endif + + +#ifdef SHORT_SYMS /* Mark Williams C, ...? */ +# define extract_or_test_files xtr_or_tst_files +# define extract_or_test_member xtr_or_tst_member +#endif + +#ifdef REALLY_SHORT_SYMS /* TOPS-20 linker: first 6 chars */ +# define process_cdir_file_hdr XXpcdfh +# define process_local_file_hdr XXplfh +# define extract_or_test_files XXxotf /* necessary? */ +# define extract_or_test_member XXxotm /* necessary? */ +# define check_for_newer XXcfn +# define overwrite_all XXoa +# define process_all_files XXpaf +# define extra_field XXef +# define explode_lit8 XXel8 +# define explode_lit4 XXel4 +# define explode_nolit8 XXnl8 +# define explode_nolit4 XXnl4 +# define cpdist8 XXcpdist8 +# define inflate_codes_boinc XXic +# define inflate_stored XXis +# define inflate_fixed XXif +# define inflate_dynamic XXid +# define inflate_block XXib +# define maxcodemax XXmax +#endif + +#ifndef S_TIME_T_MAX /* max value of signed (>= 32-bit) time_t */ +# define S_TIME_T_MAX ((time_t)(ulg)0x7fffffffL) +#endif +#ifndef U_TIME_T_MAX /* max value of unsigned (>= 32-bit) time_t */ +# define U_TIME_T_MAX ((time_t)(ulg)0xffffffffL) +#endif +#ifdef DOSTIME_MINIMUM /* min DOSTIME value (1980-01-01) */ +# undef DOSTIME_MINIMUM +#endif +#define DOSTIME_MINIMUM ((ulg)0x00210000L) +#ifdef DOSTIME_2038_01_18 /* approximate DOSTIME equivalent of */ +# undef DOSTIME_2038_01_18 /* the signed-32-bit time_t limit */ +#endif +#define DOSTIME_2038_01_18 ((ulg)0x74320000L) + +#ifdef QDOS +# define ZSUFX "_zip" +# define ALT_ZSUFX ".zip" +#else +# ifdef RISCOS +# define ZSUFX "/zip" +# else +# define ZSUFX ".zip" +# endif +# define ALT_ZSUFX ".ZIP" /* Unix-only so far (only case-sensitive fs) */ +#endif + +#define CENTRAL_HDR_SIG "\001\002" /* the infamous "PK" signature bytes, */ +#define LOCAL_HDR_SIG "\003\004" /* sans "PK" (so unzip executable not */ +#define END_CENTRAL_SIG "\005\006" /* mistaken for zipfile itself) */ +#define EXTD_LOCAL_SIG "\007\010" /* [ASCII "\113" == EBCDIC "\080" ??] */ + +/** internal-only return codes **/ +#define IZ_DIR 76 /* potential zipfile is a directory */ +/* special return codes for mapname() */ +#define MPN_OK 0 /* mapname successful */ +#define MPN_INF_TRUNC 1<<8 /* caution - filename truncated */ +#define MPN_INF_SKIP 2<<8 /* info - skipped because nothing to do */ +#define MPN_ERR_SKIP 3<<8 /* error - entry skipped */ +#define MPN_ERR_TOOLONG 4<<8 /* error - path too long */ +#define MPN_NOMEM 10<<8 /* error - out of memory, file skipped */ +#define MPN_CREATED_DIR 16<<8 /* directory created: set time & permissions */ +#define MPN_VOL_LABEL 17<<8 /* volume label, but can't set on hard disk */ +#define MPN_INVALID 99<<8 /* internal logic error, should never reach */ +/* mask for internal mapname&checkdir return codes */ +#define MPN_MASK 0x7F00 +/* error code for extracting/testing extra field blocks */ +#define IZ_EF_TRUNC 79 /* local extra field truncated (PKZIP'd) */ + +/* choice of activities for do_string() */ +#define SKIP 0 /* skip header block */ +#define DISPLAY 1 /* display archive comment (ASCII) */ +#define DISPL_8 5 /* display file comment (ext. ASCII) */ +#define DS_FN 2 /* read filename (ext. ASCII, chead) */ +#define DS_FN_C 2 /* read filename from central header */ +#define DS_FN_L 6 /* read filename from local header */ +#define EXTRA_FIELD 3 /* copy extra field into buffer */ +#define DS_EF 3 +#ifdef AMIGA +# define FILENOTE 4 /* convert file comment to filenote */ +#endif +#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) +# define CHECK_AUTORUN 7 /* copy command, display remainder */ +# define CHECK_AUTORUN_Q 8 /* copy command, skip remainder */ +#endif + +#define DOES_NOT_EXIST -1 /* return values for check_for_newer() */ +#define EXISTS_AND_OLDER 0 +#define EXISTS_AND_NEWER 1 + +#define OVERWRT_QUERY 0 /* status values for G.overwrite_mode */ +#define OVERWRT_ALWAYS 1 +#define OVERWRT_NEVER 2 + +#define IS_OVERWRT_ALL (G.overwrite_mode == OVERWRT_ALWAYS) +#define IS_OVERWRT_NONE (G.overwrite_mode == OVERWRT_NEVER) + +#define ROOT 0 /* checkdir() extract-to path: called once */ +#define INIT 1 /* allocate buildpath: called once per member */ +#define APPEND_DIR 2 /* append a dir comp.: many times per member */ +#define APPEND_NAME 3 /* append actual filename: once per member */ +#define GETPATH 4 /* retrieve the complete path and free it */ +#define END 5 /* free root path prior to exiting program */ + +/* version_made_by codes (central dir): make sure these */ +/* are not defined on their respective systems!! */ +#define FS_FAT_ 0 /* filesystem used by MS-DOS, OS/2, Win32 */ +#define AMIGA_ 1 +#define VMS_ 2 +#define UNIX_ 3 +#define VM_CMS_ 4 +#define ATARI_ 5 /* what if it's a minix filesystem? [cjh] */ +#define FS_HPFS_ 6 /* filesystem used by OS/2 (and NT 3.x) */ +#define MAC_ 7 /* HFS filesystem used by MacOS */ +#define Z_SYSTEM_ 8 +#define CPM_ 9 +#define TOPS20_ 10 +#define FS_NTFS_ 11 /* filesystem used by Windows NT */ +#define QDOS_ 12 +#define ACORN_ 13 /* Archimedes Acorn RISC OS */ +#define FS_VFAT_ 14 /* filesystem used by Windows 95, NT */ +#define MVS_ 15 +#define BEOS_ 16 /* hybrid POSIX/database filesystem */ +#define TANDEM_ 17 /* Tandem NSK */ +#define THEOS_ 18 /* THEOS */ +#define NUM_HOSTS 19 /* index of last system + 1 */ + +#define STORED 0 /* compression methods */ +#define SHRUNK 1 +#define REDUCED1 2 +#define REDUCED2 3 +#define REDUCED3 4 +#define REDUCED4 5 +#define IMPLODED 6 +#define TOKENIZED 7 +#define DEFLATED 8 +#define ENHDEFLATED 9 +#define DCLIMPLODED 10 +#define NUM_METHODS 11 /* index of last method + 1 */ +/* don't forget to update list_files(), extract.c and zipinfo.c appropriately + * if NUM_METHODS changes */ + +/* (the PK-class error codes are public and have been moved into unzip.h) */ + +#define DF_MDY 0 /* date format 10/26/91 (USA only) */ +#define DF_DMY 1 /* date format 26/10/91 (most of the world) */ +#define DF_YMD 2 /* date format 91/10/26 (a few countries) */ + +/*--------------------------------------------------------------------------- + Extra-field block ID values and offset info. + ---------------------------------------------------------------------------*/ +/* extra-field ID values, all little-endian: */ +#define EF_PKSZ64 0x0001 /* PKWARE's 64-bit filesize extensions */ +#define EF_AV 0x0007 /* PKWARE's authenticity verification */ +#define EF_OS2 0x0009 /* OS/2 extended attributes */ +#define EF_PKW32 0x000a /* PKWARE's Win95/98/WinNT filetimes */ +#define EF_PKVMS 0x000c /* PKWARE's VMS */ +#define EF_PKUNIX 0x000d /* PKWARE's Unix */ +#define EF_IZVMS 0x4d49 /* Info-ZIP's VMS ("IM") */ +#define EF_IZUNIX 0x5855 /* Info-ZIP's old Unix[1] ("UX") */ +#define EF_IZUNIX2 0x7855 /* Info-ZIP's new Unix[2] ("Ux") */ +#define EF_TIME 0x5455 /* universal timestamp ("UT") */ +#define EF_MAC3 0x334d /* Info-ZIP's new Macintosh (= "M3") */ +#define EF_JLMAC 0x07c8 /* Johnny Lee's old Macintosh (= 1992) */ +#define EF_ZIPIT 0x2605 /* Thomas Brown's Macintosh (ZipIt) */ +#define EF_ZIPIT2 0x2705 /* T. Brown's Mac (ZipIt) v 1.3.8 and newer ? */ +#define EF_SMARTZIP 0x4d63 /* Mac SmartZip by Marco Bambini */ +#define EF_VMCMS 0x4704 /* Info-ZIP's VM/CMS ("\004G") */ +#define EF_MVS 0x470f /* Info-ZIP's MVS ("\017G") */ +#define EF_ACL 0x4c41 /* (OS/2) access control list ("AL") */ +#define EF_NTSD 0x4453 /* NT security descriptor ("SD") */ +#define EF_BEOS 0x6542 /* BeOS ("Be") */ +#define EF_QDOS 0xfb4a /* SMS/QDOS ("J\373") */ +#define EF_AOSVS 0x5356 /* AOS/VS ("VS") */ +#define EF_SPARK 0x4341 /* David Pilling's Acorn/SparkFS ("AC") */ +#define EF_TANDEM 0x4154 /* Tandem NSK ("TA") */ +#define EF_THEOS 0x6854 /* Jean-Michel Dubois' Theos "Th" */ +#define EF_THEOSO 0x4854 /* old Theos port */ +#define EF_MD5 0x4b46 /* Fred Kantor's MD5 ("FK") */ +#define EF_ASIUNIX 0x756e /* ASi's Unix ("nu") */ + +#define EB_HEADSIZE 4 /* length of extra field block header */ +#define EB_ID 0 /* offset of block ID in header */ +#define EB_LEN 2 /* offset of data length field in header */ +#define EB_UCSIZE_P 0 /* offset of ucsize field in compr. data */ +#define EB_CMPRHEADLEN 6 /* lenght of compression header */ + +#define EB_UX_MINLEN 8 /* minimal "UX" field contains atime, mtime */ +#define EB_UX_FULLSIZE 12 /* full "UX" field (atime, mtime, uid, gid) */ +#define EB_UX_ATIME 0 /* offset of atime in "UX" extra field data */ +#define EB_UX_MTIME 4 /* offset of mtime in "UX" extra field data */ +#define EB_UX_UID 8 /* byte offset of UID in "UX" field data */ +#define EB_UX_GID 10 /* byte offset of GID in "UX" field data */ + +#define EB_UX2_MINLEN 4 /* minimal "Ux" field contains UID/GID */ +#define EB_UX2_UID 0 /* byte offset of UID in "Ux" field data */ +#define EB_UX2_GID 2 /* byte offset of GID in "Ux" field data */ +#define EB_UX2_VALID (1 << 8) /* UID/GID present */ + +#define EB_UT_MINLEN 1 /* minimal UT field contains Flags byte */ +#define EB_UT_FLAGS 0 /* byte offset of Flags field */ +#define EB_UT_TIME1 1 /* byte offset of 1st time value */ +#define EB_UT_FL_MTIME (1 << 0) /* mtime present */ +#define EB_UT_FL_ATIME (1 << 1) /* atime present */ +#define EB_UT_FL_CTIME (1 << 2) /* ctime present */ + +#define EB_FLGS_OFFS 4 /* offset of flags area in generic compressed + extra field blocks (BEOS, MAC, and others) */ +#define EB_OS2_HLEN 4 /* size of OS2/ACL compressed data header */ +#define EB_BEOS_HLEN 5 /* length of BeOS e.f attribute header */ +#define EB_BE_FL_UNCMPR 0x01 /* "BeOS attributes uncompressed" bit flag */ +#define EB_MAC3_HLEN 14 /* length of Mac3 attribute block header */ +#define EB_SMARTZIP_HLEN 64 /* fixed length of the SmartZip extra field */ +#define EB_M3_FL_DATFRK 0x01 /* "this entry is data fork" flag */ +#define EB_M3_FL_UNCMPR 0x04 /* "Mac3 attributes uncompressed" bit flag */ +#define EB_M3_FL_TIME64 0x08 /* "Mac3 time fields are 64 bit wide" flag */ +#define EB_M3_FL_NOUTC 0x10 /* "Mac3 timezone offset fields missing" flag */ + +#define EB_NTSD_C_LEN 4 /* length of central NT security data */ +#define EB_NTSD_L_LEN 5 /* length of minimal local NT security data */ +#define EB_NTSD_VERSION 4 /* offset of NTSD version byte */ +#define EB_NTSD_MAX_VER (0) /* maximum version # we know how to handle */ + +#define EB_ASI_CRC32 0 /* offset of ASI Unix field's crc32 checksum */ +#define EB_ASI_MODE 4 /* offset of ASI Unix permission mode field */ + +#define EB_IZVMS_HLEN 12 /* length of IZVMS attribute block header */ +#define EB_IZVMS_FLGS 4 /* offset of compression type flag */ +#define EB_IZVMS_UCSIZ 6 /* offset of ucsize field in IZVMS header */ +#define EB_IZVMS_BCMASK 07 /* 3 bits for compression type */ +#define EB_IZVMS_BCSTOR 0 /* Stored */ +#define EB_IZVMS_BC00 1 /* 0byte -> 0bit compression */ +#define EB_IZVMS_BCDEFL 2 /* Deflated */ + + +/*--------------------------------------------------------------------------- + True sizes of the various headers, as defined by PKWARE--so it is not + likely that these will ever change. But if they do, make sure both these + defines AND the typedefs below get updated accordingly. + ---------------------------------------------------------------------------*/ +#define LREC_SIZE 26 /* lengths of local file headers, central */ +#define CREC_SIZE 42 /* directory headers, and the end-of- */ +#define ECREC_SIZE 18 /* central-dir record, respectively */ + +#define MAX_BITS 13 /* used in unshrink() */ +#define HSIZE (1 << MAX_BITS) /* size of global work area */ + +#define LF 10 /* '\n' on ASCII machines; must be 10 due to EBCDIC */ +#define CR 13 /* '\r' on ASCII machines; must be 13 due to EBCDIC */ +#define CTRLZ 26 /* DOS & OS/2 EOF marker (used in fileio.c, vms.c) */ + +#ifdef EBCDIC +# define foreign(c) ascii[(uch)(c)] +# define native(c) ebcdic[(uch)(c)] +# define NATIVE "EBCDIC" +# define NOANSIFILT +#endif + +#ifdef VMS +# define ENV_UNZIP "UNZIP_OPTS" /* names of environment variables */ +# define ENV_ZIPINFO "ZIPINFO_OPTS" +#endif /* VMS */ +#ifdef RISCOS +# define ENV_UNZIP "Unzip$Options" +# define ENV_ZIPINFO "Zipinfo$Options" +# define ENV_UNZIPEXTS "Unzip$Exts" +#endif /* RISCOS */ +#ifndef ENV_UNZIP +# define ENV_UNZIP "UNZIP" /* the standard names */ +# define ENV_ZIPINFO "ZIPINFO" +#endif +#define ENV_UNZIP2 "UNZIPOPT" /* alternate names, for zip compat. */ +#define ENV_ZIPINFO2 "ZIPINFOOPT" + +#if (!defined(QQ) && !defined(NOQQ)) +# define QQ +#endif + +#ifdef QQ /* Newtware version: no file */ +# define QCOND (!uO.qflag) /* comments with -vq or -vqq */ +#else /* Bill Davidsen version: no way to */ +# define QCOND (longhdr) /* kill file comments when listing */ +#endif + +#ifdef OLD_QQ +# define QCOND2 (uO.qflag < 2) +#else +# define QCOND2 (!uO.qflag) +#endif + + + + + +/**************/ +/* Typedefs */ +/**************/ + +#ifdef NO_UID_GID +# ifdef UID_USHORT + typedef unsigned short uid_t; /* TI SysV.3 */ + typedef unsigned short gid_t; +# else + typedef unsigned int uid_t; /* SCO Xenix */ + typedef unsigned int gid_t; +# endif +#endif + +#if (defined(GOT_UTIMBUF) || defined(sgi) || defined(ATARI)) + typedef struct utimbuf ztimbuf; +#else + typedef struct ztimbuf { + time_t actime; /* new access time */ + time_t modtime; /* new modification time */ + } ztimbuf; +#endif + +typedef struct iztimes { + time_t atime; /* new access time */ + time_t mtime; /* new modification time */ + time_t ctime; /* used for creation time; NOT same as st_ctime */ +} iztimes; + +#ifdef SET_DIR_ATTRIB + typedef struct dirtime { /* temporary struct for holding directory info */ + struct dirtime *next; /* until can be sorted and set at end */ + char *fn; /* filename of directory */ + union { + iztimes t3; /* mtime, atime, ctime */ + ztimbuf t2; /* modtime, actime */ + } u; + unsigned perms; /* same as min_info.file_attr */ + int have_uidgid; /* flag */ + ush uidgid[2]; + } dirtime; +#endif /* SET_DIR_ATTRIB */ + +typedef struct min_info { + long offset; + ulg crc; /* crc (needed if extended header) */ + ulg compr_size; /* compressed size (needed if extended header) */ + ulg uncompr_size; /* uncompressed size (needed if extended header) */ + ush diskstart; /* no of volume where this entry starts */ + uch hostver; + uch hostnum; + unsigned file_attr; /* local flavor, as used by creat(), chmod()... */ + unsigned encrypted : 1; /* file encrypted: decrypt before uncompressing */ + unsigned ExtLocHdr : 1; /* use time instead of CRC for decrypt check */ + unsigned textfile : 1; /* file is text (according to zip) */ + unsigned textmode : 1; /* file is to be extracted as text */ + unsigned lcflag : 1; /* convert filename to lowercase */ + unsigned vollabel : 1; /* "file" is an MS-DOS volume (disk) label */ + unsigned HasUxAtt : 1; /* crec ext_file_attr has Unix style mode bits */ +} min_info; + +typedef struct VMStimbuf { + char *revdate; /* (both roughly correspond to Unix modtime/st_mtime) */ + char *credate; +} VMStimbuf; + +/*--------------------------------------------------------------------------- + Zipfile work area declarations. + ---------------------------------------------------------------------------*/ + +#ifdef MALLOC_WORK + union work { + struct { /* unshrink(): */ + shrint *Parent; /* pointer to (8192 * sizeof(shrint)) */ + uch *value; /* pointer to 8KB char buffer */ + uch *Stack; /* pointer to another 8KB char buffer */ + } shrink; + uch *Slide; /* explode(), inflate(), unreduce() */ + }; +#else /* !MALLOC_WORK */ + union work { + struct { /* unshrink(): */ + shrint Parent[HSIZE]; /* (8192 * sizeof(shrint)) == 16KB minimum */ + uch value[HSIZE]; /* 8KB */ + uch Stack[HSIZE]; /* 8KB */ + } shrink; /* total = 32KB minimum; 80KB on Cray/Alpha */ + uch Slide[WSIZE]; /* explode(), inflate(), unreduce() */ + }; +#endif /* ?MALLOC_WORK */ + +#define slide G.area.Slide + +#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) +# define redirSlide G.redirect_sldptr +#else +# define redirSlide G.area.Slide +#endif + +/*--------------------------------------------------------------------------- + Zipfile layout declarations. If these headers ever change, make sure the + xxREC_SIZE defines (above) change with them! + ---------------------------------------------------------------------------*/ + + typedef uch local_byte_hdr[ LREC_SIZE ]; +# define L_VERSION_NEEDED_TO_EXTRACT_0 0 +# define L_VERSION_NEEDED_TO_EXTRACT_1 1 +# define L_GENERAL_PURPOSE_BIT_FLAG 2 +# define L_COMPRESSION_METHOD 4 +# define L_LAST_MOD_DOS_DATETIME 6 +# define L_CRC32 10 +# define L_COMPRESSED_SIZE 14 +# define L_UNCOMPRESSED_SIZE 18 +# define L_FILENAME_LENGTH 22 +# define L_EXTRA_FIELD_LENGTH 24 + + typedef uch cdir_byte_hdr[ CREC_SIZE ]; +# define C_VERSION_MADE_BY_0 0 +# define C_VERSION_MADE_BY_1 1 +# define C_VERSION_NEEDED_TO_EXTRACT_0 2 +# define C_VERSION_NEEDED_TO_EXTRACT_1 3 +# define C_GENERAL_PURPOSE_BIT_FLAG 4 +# define C_COMPRESSION_METHOD 6 +# define C_LAST_MOD_DOS_DATETIME 8 +# define C_CRC32 12 +# define C_COMPRESSED_SIZE 16 +# define C_UNCOMPRESSED_SIZE 20 +# define C_FILENAME_LENGTH 24 +# define C_EXTRA_FIELD_LENGTH 26 +# define C_FILE_COMMENT_LENGTH 28 +# define C_DISK_NUMBER_START 30 +# define C_INTERNAL_FILE_ATTRIBUTES 32 +# define C_EXTERNAL_FILE_ATTRIBUTES 34 +# define C_RELATIVE_OFFSET_LOCAL_HEADER 38 + + typedef uch ec_byte_rec[ ECREC_SIZE+4 ]; +/* define SIGNATURE 0 space-holder only */ +# define NUMBER_THIS_DISK 4 +# define NUM_DISK_WITH_START_CENTRAL_DIR 6 +# define NUM_ENTRIES_CENTRL_DIR_THS_DISK 8 +# define TOTAL_ENTRIES_CENTRAL_DIR 10 +# define SIZE_CENTRAL_DIRECTORY 12 +# define OFFSET_START_CENTRAL_DIRECTORY 16 +# define ZIPFILE_COMMENT_LENGTH 20 + + + typedef struct local_file_header { /* LOCAL */ + uch version_needed_to_extract[2]; + ush general_purpose_bit_flag; + ush compression_method; + ulg last_mod_dos_datetime; + ulg crc32; + ulg csize; + ulg ucsize; + ush filename_length; + ush extra_field_length; + } local_file_hdr; + +#if 0 + typedef struct central_directory_file_header { /* CENTRAL */ + uch version_made_by[2]; + uch version_needed_to_extract[2]; + ush general_purpose_bit_flag; + ush compression_method; + ulg last_mod_dos_datetime; + ulg crc32; + ulg csize; + ulg ucsize; + ush filename_length; + ush extra_field_length; + ush file_comment_length; + ush disk_number_start; + ush internal_file_attributes; + ulg external_file_attributes; + ulg relative_offset_local_header; + } cdir_file_hdr; +#endif /* 0 */ + + typedef struct end_central_dir_record { /* END CENTRAL */ + ush number_this_disk; + ush num_disk_start_cdir; + ush num_entries_centrl_dir_ths_disk; + ush total_entries_central_dir; + ulg size_central_directory; + ulg offset_start_central_directory; + ush zipfile_comment_length; + } ecdir_rec; + + +/* Huffman code lookup table entry--this entry is four bytes for machines + that have 16-bit pointers (e.g. PC's in the small or medium model). + Valid extra bits are 0..16. e == 31 is EOB (end of block), e == 32 + means that v is a literal, 32 < e < 64 means that v is a pointer to + the next table, which codes (e & 31) bits, and lastly e == 99 indicates + an unused code. If a code with e == 99 is looked up, this implies an + error in the data. */ + +struct huft { + uch e; /* number of extra bits or operation */ + uch b; /* number of bits in this code or subcode */ + union { + ush n; /* literal, length base, or distance base */ + struct huft *t; /* pointer to next level of table */ + } v; +}; + + +typedef struct _APIDocStruct { + char *compare; + char *function; + char *syntax; + char *purpose; +} APIDocStruct; + + + + +/*************/ +/* Globals */ +/*************/ + +#if (defined(OS2) && !defined(FUNZIP)) +# include "os2/os2data.h" +#endif + +#include "globals.h" + + + +/*************************/ +/* Function Prototypes */ +/*************************/ + +/*--------------------------------------------------------------------------- + Functions in unzip.c (initialization routines): + ---------------------------------------------------------------------------*/ + +#ifndef WINDLL + int MAIN OF((int argc, char **argv)); + int unzip OF((__GPRO__ int argc, char **argv)); + int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); + int usage OF((__GPRO__ int error)); +#endif /* !WINDLL */ + +/*--------------------------------------------------------------------------- + Functions in process.c (main driver routines): + ---------------------------------------------------------------------------*/ + +int process_zipfiles OF((__GPRO)); +void free_G_buffers OF((__GPRO)); +/* static int do_seekable OF((__GPRO__ int lastchance)); */ +/* static int find_ecrec OF((__GPRO__ long searchlen)); */ +int uz_end_central OF((__GPRO)); +int process_cdir_file_hdr OF((__GPRO)); +int get_cdir_ent OF((__GPRO)); +int process_local_file_hdr OF((__GPRO)); +unsigned ef_scan_for_izux OF((ZCONST uch *ef_buf, unsigned ef_len, + int ef_is_c, ulg dos_mdatetime, + iztimes *z_utim, ush *z_uidgid)); +#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) + zvoid *getRISCOSexfield OF((ZCONST uch *ef_buf, unsigned ef_len)); +#endif + +#ifndef SFX + +/*--------------------------------------------------------------------------- + Functions in zipinfo.c (`zipinfo-style' listing routines): + ---------------------------------------------------------------------------*/ + +#ifndef NO_ZIPINFO +#ifndef WINDLL + int zi_opts OF((__GPRO__ int *pargc, char ***pargv)); +#endif +int zi_end_central OF((__GPRO)); +int zipinfo OF((__GPRO)); +/* static int zi_long OF((__GPRO__ ulg *pEndprev)); */ +/* static int zi_short OF((__GPRO)); */ +/* static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, + ZCONST time_t *modtimez, char *d_t_str));*/ +#endif /* !NO_ZIPINFO */ + +/*--------------------------------------------------------------------------- + Functions in list.c (generic zipfile-listing routines): + ---------------------------------------------------------------------------*/ + +int list_files OF((__GPRO)); +#ifdef TIMESTAMP + int get_time_stamp OF((__GPRO__ time_t *last_modtime, + ulg *nmember)); +#endif +int ratio OF((ulg uc, ulg c)); +void fnprint OF((__GPRO)); + +#endif /* !SFX */ + +/*--------------------------------------------------------------------------- + Functions in fileio.c: + ---------------------------------------------------------------------------*/ + +int open_input_file OF((__GPRO)); +int open_outfile OF((__GPRO)); /* also vms.c */ +void undefer_input OF((__GPRO)); +void defer_leftover_input OF((__GPRO)); +unsigned readbuf OF((__GPRO__ char *buf, register unsigned len)); +int readbyte OF((__GPRO)); +int fillinbuf OF((__GPRO)); +int seek_zipf OF((__GPRO__ LONGINT abs_offset)); +#ifdef FUNZIP + int flush OF((__GPRO__ ulg size)); /* actually funzip.c */ +#else + int flush OF((__GPRO__ uch *buf, ulg size, int unshrink)); +#endif +/* static int disk_error OF((__GPRO)); */ +void handler OF((int signal)); +time_t dos_to_unix_time OF((ulg dos_datetime)); +int check_for_newer OF((__GPRO__ char *filename)); /* os2,vmcms,vms */ +int do_string OF((__GPRO__ unsigned int length, int option)); +ush makeword OF((ZCONST uch *b)); +ulg makelong OF((ZCONST uch *sig)); +#if (!defined(STR_TO_ISO) || defined(NEED_STR2ISO)) + char *str2iso OF((char *dst, ZCONST char *src)); +#endif +#if (!defined(STR_TO_OEM) || defined(NEED_STR2OEM)) + char *str2oem OF((char *dst, ZCONST char *src)); +#endif +#ifdef NO_STRNICMP + int zstrnicmp OF((register ZCONST char *s1, + register ZCONST char *s2, + register unsigned n)); +#endif +#ifdef REGULUS + int zstat OF((ZCONST char *p, struct stat *s)); +#endif +#ifdef ZMEM /* MUST be ifdef'd because of conflicts with the standard def. */ + zvoid *memset OF((register zvoid *, register int, register unsigned int)); + int memcmp OF((register ZCONST zvoid*, register ZCONST zvoid *, + register unsigned int)); + zvoid *memcpy OF((register zvoid *, register ZCONST zvoid *, + register unsigned int)); +#endif +#ifdef NEED_UZMBSCHR + unsigned char *uzmbschr OF((ZCONST unsigned char *str, unsigned int c)); +#endif +#ifdef NEED_UZMBSRCHR + unsigned char *uzmbsrchr OF((ZCONST unsigned char *str, unsigned int c)); +#endif +#ifdef SMALL_MEM + char *fLoadFarString OF((__GPRO__ const char Far *sz)); + char *fLoadFarStringSmall OF((__GPRO__ const char Far *sz)); + char *fLoadFarStringSmall2 OF((__GPRO__ const char Far *sz)); + #ifndef zfstrcpy + char Far * Far zfstrcpy OF((char Far *s1, const char Far *s2)); + #endif +#endif + + +/*--------------------------------------------------------------------------- + Functions in extract.c: + ---------------------------------------------------------------------------*/ + +int extract_or_test_files OF((__GPRO)); +/* static int store_info OF((void)); */ +/* static int extract_or_test_member OF((__GPRO)); */ +/* static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); */ +/* static int test_OS2 OF((__GPRO__ uch *eb, unsigned eb_size)); */ +/* static int test_NT OF((__GPRO__ uch *eb, unsigned eb_size)); */ +int memextract OF((__GPRO__ uch *tgt, ulg tgtsize, + ZCONST uch *src, ulg srcsize)); +int memflush OF((__GPRO__ ZCONST uch *rawbuf, ulg size)); +#if (defined(VMS) || defined(VMS_TEXT_CONV)) + uch *extract_izvms_block OF((__GPRO__ ZCONST uch *ebdata, + unsigned size, unsigned *retlen, + ZCONST uch *init, unsigned needlen)); +#endif +char *fnfilter OF((ZCONST char *raw, uch *space)); + +/*--------------------------------------------------------------------------- + Decompression functions: + ---------------------------------------------------------------------------*/ + +#if (!defined(SFX) && !defined(FUNZIP)) +int explode OF((__GPRO)); /* explode.c */ +#endif +int huft_free OF((struct huft *t)); /* inflate.c */ +int huft_build OF((__GPRO__ ZCONST unsigned *b, unsigned n, + unsigned s, ZCONST ush *d, ZCONST uch *e, + struct huft **t, int *m)); +#ifdef USE_ZLIB + int UZinflate OF((__GPRO__ int is_defl64)); /* inflate.c */ +# define inflate_free(x) inflateEnd(&((Uz_Globs *)(&G))->dstrm) +#else + int inflate OF((__GPRO__ int is_defl64)); /* inflate.c */ + int inflate_free OF((__GPRO)); /* inflate.c */ +#endif /* ?USE_ZLIB */ +#if (!defined(SFX) && !defined(FUNZIP)) +#ifndef COPYRIGHT_CLEAN + int unreduce OF((__GPRO)); /* unreduce.c */ +/* static void LoadFollowers OF((__GPRO__ f_array *follower, uch *Slen)); + * unreduce.c */ +#endif /* !COPYRIGHT_CLEAN */ +#ifndef LZW_CLEAN + int unshrink OF((__GPRO)); /* unshrink.c */ +/* static void partial_clear OF((__GPRO)); * unshrink.c */ +#endif /* !LZW_CLEAN */ +#endif /* !SFX && !FUNZIP */ + +/*--------------------------------------------------------------------------- + Internal API functions (only included in DLL versions): + ---------------------------------------------------------------------------*/ + +#ifdef DLL + void setFileNotFound OF((__GPRO)); /* api.c */ + int unzipToMemory OF((__GPRO__ char *zip, char *file, + UzpBuffer *retstr)); /* api.c */ + int redirect_outfile OF((__GPRO)); /* api.c */ + int writeToMemory OF((__GPRO__ ZCONST uch *rawbuf, + extent size)); /* api.c */ + int close_redirect OF((__GPRO)); /* api.c */ + /* this obsolescent entry point kept for compatibility: */ + int UzpUnzip OF((int argc, char **argv));/* use UzpMain */ +#ifdef OS2DLL + int varmessage OF((__GPRO__ ZCONST uch *buf, ulg size)); + int varputchar OF((__GPRO__ int c)); /* rexxapi.c */ + int finish_REXX_redirect OF((__GPRO)); /* rexxapi.c */ +#endif +#ifdef API_DOC + void APIhelp OF((__GPRO__ int argc, char **argv)); +#endif /* apihelp.c */ +#endif /* DLL */ + +/*--------------------------------------------------------------------------- + MSDOS-only functions: + ---------------------------------------------------------------------------*/ + +#if (defined(MSDOS) && (defined(__GO32__) || defined(__EMX__))) + unsigned _dos_getcountryinfo(void *); /* msdos.c */ +#if (!defined(__DJGPP__) || (__DJGPP__ < 2)) + unsigned _dos_setftime(int, unsigned, unsigned); /* msdos.c */ + unsigned _dos_setfileattr(const char *, unsigned); /* msdos.c */ + unsigned _dos_creat(const char *, unsigned, int *); /* msdos.c */ + void _dos_getdrive(unsigned *); /* msdos.c */ + unsigned _dos_close(int); /* msdos.c */ +#endif /* !__DJGPP__ || (__DJGPP__ < 2) */ +#endif + +/*--------------------------------------------------------------------------- + OS/2-only functions: + ---------------------------------------------------------------------------*/ + +#ifdef OS2 /* GetFileTime conflicts with something in Win32 header files */ +#if (defined(REENTRANT) && defined(USETHREADID)) + ulg GetThreadId OF((void)); +#endif + int GetCountryInfo OF((void)); /* os2.c */ + long GetFileTime OF((ZCONST char *name)); /* os2.c */ +/* static void SetPathAttrTimes OF((__GPRO__ int flags, int dir)); os2.c */ +/* static int SetEAs OF((__GPRO__ const char *path, + void *eablock)); os2.c */ +/* static int SetACL OF((__GPRO__ const char *path, + void *eablock)); os2.c */ +/* static int IsFileNameValid OF((const char *name)); os2.c */ +/* static void map2fat OF((char *pathcomp, char **pEndFAT)); os2.c */ +/* static int SetLongNameEA OF((char *name, char *longname)); os2.c */ +/* static void InitNLS OF((void)); os2.c */ + int IsUpperNLS OF((int nChr)); /* os2.c */ + int ToLowerNLS OF((int nChr)); /* os2.c */ + void DebugMalloc OF((void)); /* os2.c */ +#endif + +/*--------------------------------------------------------------------------- + QDOS-only functions: + ---------------------------------------------------------------------------*/ + +#ifdef QDOS + int QMatch (uch, uch); + void QFilename (__GPRO__ char *); + char *Qstrfix (char *); + int QReturn (int zip_error); +#endif + +/*--------------------------------------------------------------------------- + TOPS20-only functions: + ---------------------------------------------------------------------------*/ + +#ifdef TOPS20 + int upper OF((char *s)); /* tops20.c */ + int enquote OF((char *s)); /* tops20.c */ + int dequote OF((char *s)); /* tops20.c */ + int fnlegal OF(()); /* error if prototyped? */ /* tops20.c */ +#endif + +/*--------------------------------------------------------------------------- + VM/CMS- and MVS-only functions: + ---------------------------------------------------------------------------*/ + +#ifdef CMS_MVS + extent getVMMVSexfield OF((char *type, uch *ef_block, unsigned datalen)); + FILE *vmmvs_open_infile OF((__GPRO)); /* vmmvs.c */ + void close_infile OF((__GPRO)); /* vmmvs.c */ +#endif + +/*--------------------------------------------------------------------------- + VMS-only functions: + ---------------------------------------------------------------------------*/ + +#ifdef VMS + int check_format OF((__GPRO)); /* vms.c */ +/* int open_outfile OF((__GPRO)); * (see fileio.c) vms.c */ +/* int flush OF((__GPRO__ uch *rawbuf, unsigned size, + int final_flag)); * (see fileio.c) vms.c */ +#ifdef RETURN_CODES + void return_VMS OF((__GPRO__ int zip_error)); /* vms.c */ +#else + void return_VMS OF((int zip_error)); /* vms.c */ +#endif +#ifdef VMSCLI + ulg vms_unzip_cmdline OF((int *, char ***)); /* cmdline.c */ + int VMSCLI_usage OF((__GPRO__ int error)); /* cmdline.c */ +#endif +#endif + +/*--------------------------------------------------------------------------- + WIN32-only functions: + ---------------------------------------------------------------------------*/ + +#ifdef WIN32 + int IsWinNT OF((void)); /* win32.c */ +#ifdef NTSD_EAS + void process_defer_NT OF((__GPRO)); /* win32.c */ + int test_NTSD OF((__GPRO__ uch *eb, unsigned eb_size, + uch *eb_ucptr, ulg eb_ucsize)); /* win32.c */ +# define TEST_NTSD test_NTSD +#endif +#ifdef W32_STAT_BANDAID + int zstat_win32 OF((__W32STAT_GLOBALS__ + const char *path, struct stat *buf)); /* win32.c */ +#endif +#endif + +/*--------------------------------------------------------------------------- + Miscellaneous/shared functions: + ---------------------------------------------------------------------------*/ + +Uz_Globs *globalsCtor OF((void)); /* globals.c */ + +int envargs OF((int *Pargc, char ***Pargv, + ZCONST char *envstr, ZCONST char *envstr2)); + /* envargs.c */ +void mksargs OF((int *argcp, char ***argvp)); /* envargs.c */ + +int match OF((ZCONST char *s, ZCONST char *p, + int ic)); /* match.c */ +int iswild OF((ZCONST char *p)); /* match.c */ + +#ifdef DYNALLOC_CRCTAB + void free_crc_table OF((void)); /* crctab.c */ +#endif +#ifndef USE_ZLIB + ZCONST ulg near *get_crc_table_boinc OF((void)); /* funzip.c, crctab.c */ + ulg crc32 OF((ulg crc, ZCONST uch *buf, extent len)); +#endif /* !USE_ZLIB */ /* assembler source or crc32.c */ + +int dateformat OF((void)); /* currently, only msdos.c */ +#ifndef WINDLL + void version OF((__GPRO)); /* local */ +#endif +int mapattr OF((__GPRO)); /* local */ +int mapname OF((__GPRO__ int renamed)); /* local */ +int checkdir OF((__GPRO__ char *pathcomp, int flag)); /* local */ +char *do_wild OF((__GPRO__ ZCONST char *wildzipfn)); /* local */ +char *GetLoadPath OF((__GPRO)); /* local */ +#if (defined(MORE) && (defined(BEO_UNX) || defined(QDOS) || defined(VMS))) + int screensize OF((int *tt_rows, int *tt_cols)); /* local */ +# if defined(VMS) + int screenlinewrap OF((void)); /* local */ +# endif +#endif /* MORE && (BEO_UNX || QDOS || VMS) */ +#ifdef OS2_W32 + int SetFileSize OF((FILE *file, ulg filesize)); /* local */ +#endif +#ifndef MTS /* macro in MTS */ + void close_outfile OF((__GPRO)); /* local */ +#endif +#ifdef SET_DIR_ATTRIB + int set_direc_attribs OF((__GPRO__ dirtime *d)); /* local */ +#endif +#ifdef TIMESTAMP +# ifdef WIN32 + int stamp_file OF((__GPRO__ + ZCONST char *fname, time_t modtime)); /* local */ +# else + int stamp_file OF((ZCONST char *fname, time_t modtime)); /* local */ +# endif +#endif +#if (defined(MALLOC_WORK) && defined(MY_ZCALLOC)) + zvoid far *zcalloc OF((unsigned int, unsigned int)); + zvoid zcfree OF((zvoid far *)); +#endif /* MALLOC_WORK && MY_ZCALLOC */ +#ifdef SYSTEM_SPECIFIC_CTOR + void SYSTEM_SPECIFIC_CTOR OF((__GPRO)); /* local */ +#endif + + + + + +/************/ +/* Macros */ +/************/ + +#ifndef MAX +# define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#ifdef DEBUG +# if (defined(THEOS) && defined(NO_BOGUS_SPC)) +# define NO_DEBUG_IN_MACROS +# define Trace(x) _fprintf x +# else +# define Trace(x) fprintf x +# endif +#else +# define Trace(x) +#endif + +#ifdef DEBUG_TIME +# define TTrace(x) fprintf x +#else +# define TTrace(x) +#endif + +#ifdef NO_DEBUG_IN_MACROS +# define MTrace(x) +#else +# define MTrace(x) Trace(x) +#endif + +#if (defined(UNIX) || defined(T20_VMS)) /* generally old systems */ +# define ToLower(x) ((char)(isupper((int)x)? tolower((int)x) : x)) +#else +# define ToLower tolower /* assumed "smart"; used in match() */ +#endif + +#ifdef USE_STRM_INPUT + /* ``Replace'' the unbuffered UNIX style I/O function with similar + * standard C functions from . + */ +# define read(fd,buf,n) fread((buf),1,(n),(FILE *)(fd)) +# define lseek(fd,o,w) fseek((FILE *)(fd),(o),(w)) +# define close(fd) fclose((FILE *)(fd)) +#endif /* USE_STRM_INPUT */ + +/* The return value of the Info() "macro function" is never checked in + * UnZip. Otherwise, to get the same behaviour as for (*G.message)(), the + * Info() definition for "FUNZIP" would have to be corrected: + * #define Info(buf,flag,sprf_arg) \ + * (fprintf((flag)&1? stderr : stdout, \ + * (char *)(sprintf sprf_arg, (buf))) == EOF) + */ +#ifndef Info /* may already have been defined for redirection */ +# ifdef FUNZIP +# define Info(buf,flag,sprf_arg) \ + fprintf((flag)&1? stderr : stdout, (char *)(sprintf sprf_arg, (buf))) +# else +# ifdef INT_SPRINTF /* optimized version for "int sprintf()" flavour */ +# define Info(buf,flag,sprf_arg) \ + (*G.message)((zvoid *)&G, (uch *)(buf), (ulg)sprintf sprf_arg, (flag)) +# else /* generic version, does not use sprintf() return value */ +# define Info(buf,flag,sprf_arg) \ + (*G.message)((zvoid *)&G, (uch *)(buf), \ + (ulg)(sprintf sprf_arg, strlen((char *)(buf))), (flag)) +# endif +# endif +#endif /* !Info */ + +/* The following macros wrappers around the fnfilter function are used many + * times to prepare archive entry names or name components for displaying + * listings and (warning/error) messages. They use sections in the upper half + * of 'slide' as buffer, since their output is normally fed through the + * Info() macro with 'slide' (the start of this area) as message buffer. + */ +#define FnFilter1(fname) fnfilter((fname), slide + (WSIZE>>1)) +#define FnFilter2(fname) fnfilter((fname), slide + ((WSIZE>>1) + (WSIZE>>2))) + +#ifndef FUNZIP /* used only in inflate.c */ +# define MESSAGE(str,len,flag) (*G.message)((zvoid *)&G,(str),(len),(flag)) +#endif + +#if 0 /* Optimization: use the (const) result of crc32(0L,NULL,0) */ +# define CRCVAL_INITIAL crc32(0L, NULL, 0) +#else +# define CRCVAL_INITIAL 0L +#endif + +#ifndef TEST_NTSD /* "NTSD valid?" checking function */ +# define TEST_NTSD NULL /* ... is not available */ +#endif + +#define SKIP_(length) if(length&&((error=do_string(__G__ length,SKIP))!=0))\ + {error_in_archive=error; if(error>1) return error;} + +/* + * Skip a variable-length field, and report any errors. Used in zipinfo.c + * and unzip.c in several functions. + * + * macro SKIP_(length) + * ush length; + * { + * if (length && ((error = do_string(length, SKIP)) != 0)) { + * error_in_archive = error; /-* might be warning *-/ + * if (error > 1) /-* fatal *-/ + * return (error); + * } + * } + * + */ + + +#ifdef FUNZIP +# define FLUSH(w) flush(__G__ (ulg)(w)) +# define NEXTBYTE getc(G.in) /* redefined in crypt.h if full version */ +#else +# define FLUSH(w) ((G.mem_mode) ? memflush(__G__ redirSlide,(ulg)(w)) \ + : flush(__G__ redirSlide,(ulg)(w),0)) +# define NEXTBYTE (--G.incnt >= 0 ? (int)(*G.inptr++) : readbyte(__G)) +#endif + + +#define READBITS(nbits,zdest) {if(nbits>G.bits_left) {int temp; G.zipeof=1;\ + while (G.bits_left<=8*(int)(sizeof(G.bitbuf)-1) && (temp=NEXTBYTE)!=EOF) {\ + G.bitbuf|=(ulg)temp<>=nbits;\ + G.bits_left-=nbits;} + +/* + * macro READBITS(nbits,zdest) * only used by unreduce and unshrink * + * { + * if (nbits > G.bits_left) { * fill G.bitbuf, 8*sizeof(ulg) bits * + * int temp; + * + * G.zipeof = 1; + * while (G.bits_left <= 8*(int)(sizeof(G.bitbuf)-1) && + * (temp = NEXTBYTE) != EOF) { + * G.bitbuf |= (ulg)temp << G.bits_left; + * G.bits_left += 8; + * G.zipeof = 0; + * } + * } + * zdest = (shrint)((ush)G.bitbuf & mask_bits[nbits]); + * G.bitbuf >>= nbits; + * G.bits_left -= nbits; + * } + * + */ + + +/* GRR: should use StringLower for STRLOWER macro if possible */ + +/* + * Copy the zero-terminated string in str1 into str2, converting any + * uppercase letters to lowercase as we go. str2 gets zero-terminated + * as well, of course. str1 and str2 may be the same character array. + */ +#ifdef _MBCS +# define STRLOWER(str1, str2) \ + { \ + char *p, *q, c; unsigned i; \ + p = (char *)(str1); \ + q = (char *)(str2); \ + while ((c = *p) != '\0') { \ + if ((i = CLEN(p)) > 1) { \ + while (i--) *q++ = *p++; \ + } else { \ + *q++ = (char)(isupper((int)(c))? tolower((int)(c)) : c); \ + p++; \ + } \ + } \ + *q = '\0'; \ + } +#else +# define STRLOWER(str1, str2) \ + { \ + char *p, *q; \ + p = (char *)(str1) - 1; \ + q = (char *)(str2); \ + while (*++p) \ + *q++ = (char)(isupper((int)(*p))? tolower((int)(*p)) : *p); \ + *q = '\0'; \ + } +#endif +/* + * NOTES: This macro makes no assumptions about the characteristics of + * the tolower() function or macro (beyond its existence), nor does it + * make assumptions about the structure of the character set (i.e., it + * should work on EBCDIC machines, too). The fact that either or both + * of isupper() and tolower() may be macros has been taken into account; + * watch out for "side effects" (in the C sense) when modifying this + * macro. + */ + +#ifndef foreign +# define foreign(c) (c) +#endif + +#ifndef native +# define native(c) (c) +# define A_TO_N(str1) +#else +# ifndef NATIVE +# define NATIVE "native chars" +# endif +# define A_TO_N(str1) {register uch *p;\ + for (p=(uch *)(str1); *p; p++) *p=native(*p);} +#endif +/* + * Translate the zero-terminated string in str1 from ASCII to the native + * character set. The translation is performed in-place and uses the + * "native" macro to translate each character. + * + * NOTE: Using the "native" macro means that is it the only part of unzip + * which knows which translation table (if any) is actually in use to + * produce the native character set. This makes adding new character set + * translation tables easy, insofar as all that is needed is an appropriate + * "native" macro definition and the translation table itself. Currently, + * the only non-ASCII native character set implemented is EBCDIC, but this + * may not always be so. + */ + + +/* default setup for internal codepage: assume ISO 8859-1 compatibility!! */ +#if (!defined(NATIVE) && !defined(CRTL_CP_IS_ISO) && !defined(CRTL_CP_IS_OEM)) +# define CRTL_CP_IS_ISO +#endif + + +/* Translate "extended ASCII" chars (OEM coding for DOS and OS/2; else + * ISO-8859-1 [ISO Latin 1, Win Ansi,...]) into the internal "native" + * code page. As with A_TO_N(), conversion is done in place. + */ +#ifndef _ISO_INTERN +# ifdef CRTL_CP_IS_OEM +# ifndef IZ_ISO2OEM_ARRAY +# define IZ_ISO2OEM_ARRAY +# endif +# define _ISO_INTERN(str1) {register uch *p;\ + for (p=(uch *)(str1); *p; p++)\ + *p = native((*p & 0x80) ? iso2oem[*p & 0x7f] : *p);} +# else +# define _ISO_INTERN(str1) A_TO_N(str1) +# endif +#endif + +#ifndef _OEM_INTERN +# ifdef CRTL_CP_IS_OEM +# define _OEM_INTERN(str1) A_TO_N(str1) +# else +# ifndef IZ_OEM2ISO_ARRAY +# define IZ_OEM2ISO_ARRAY +# endif +# define _OEM_INTERN(str1) {register uch *p;\ + for (p=(uch *)(str1); *p; p++)\ + *p = native((*p & 0x80) ? oem2iso[*p & 0x7f] : *p);} +# endif +#endif + +#ifndef STR_TO_ISO +# ifdef CRTL_CP_IS_ISO +# define STR_TO_ISO strcpy +# else +# define STR_TO_ISO str2iso +# define NEED_STR2ISO +# endif +#endif + +#ifndef STR_TO_OEM +# ifdef CRTL_CP_IS_OEM +# define STR_TO_OEM strcpy +# else +# define STR_TO_OEM str2oem +# define NEED_STR2OEM +# endif +#endif + +#if (!defined(INTERN_TO_ISO) && !defined(ASCII2ISO)) +# ifdef CRTL_CP_IS_OEM + /* know: "ASCII" is "OEM" */ +# define ASCII2ISO(c) (((c) & 0x80) ? oem2iso[(c) & 0x7f] : (c)) +# if (defined(NEED_STR2ISO) && !defined(CRYP_USES_OEM2ISO)) +# define CRYP_USES_OEM2ISO +# endif +# else + /* assume: "ASCII" is "ISO-ANSI" */ +# define ASCII2ISO(c) (c) +# endif +#endif + +#if (!defined(INTERN_TO_OEM) && !defined(ASCII2OEM)) +# ifdef CRTL_CP_IS_OEM + /* know: "ASCII" is "OEM" */ +# define ASCII2OEM(c) (c) +# else + /* assume: "ASCII" is "ISO-ANSI" */ +# define ASCII2OEM(c) (((c) & 0x80) ? iso2oem[(c) & 0x7f] : (c)) +# if (defined(NEED_STR2OEM) && !defined(CRYP_USES_ISO2OEM)) +# define CRYP_USES_ISO2OEM +# endif +# endif +#endif + +/* codepage conversion setup for testp() in crypt.c */ +#ifdef CRTL_CP_IS_ISO +# ifndef STR_TO_CP2 +# define STR_TO_CP2 STR_TO_OEM +# endif +#else +# ifdef CRTL_CP_IS_OEM +# ifndef STR_TO_CP2 +# define STR_TO_CP2 STR_TO_ISO +# endif +# else /* native internal CP is neither ISO nor OEM */ +# ifndef STR_TO_CP1 +# define STR_TO_CP1 STR_TO_ISO +# endif +# ifndef STR_TO_CP2 +# define STR_TO_CP2 STR_TO_OEM +# endif +# endif +#endif + + +/* Convert filename (and file comment string) into "internal" charset. + * This macro assumes that Zip entry filenames are coded in OEM (IBM DOS) + * codepage when made on + * -> DOS (this includes 16-bit Windows 3.1) (FS_FAT_) + * -> OS/2 (FS_HPFS_) + * -> Win95/WinNT with Nico Mak's WinZip (FS_NTFS_ && hostver == "5.0") + * EXCEPTIONS: + * PKZIP for Windows 2.5, 2.6, and 4.0 flag their entries as "FS_FAT_", but + * the filename stored in the local header is coded in Windows ANSI (CP 1252 + * resp. ISO 8859-1 on US and western Europe locale settings). + * Likewise, PKZIP for UNIX 2.51 flags its entries as "FS_FAT_", but the + * filenames stored in BOTH the local and the central header are coded + * in the local system's codepage (usually ANSI codings like ISO 8859-1). + * + * All other ports are assumed to code zip entry filenames in ISO 8859-1. + */ +#ifndef Ext_ASCII_TO_Native +# define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr) \ + if (((hostnum) == FS_FAT_ && \ + !(((islochdr) || (isuxatt)) && \ + ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \ + (hostnum) == FS_HPFS_ || \ + ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \ + _OEM_INTERN((string)); \ + } else { \ + _ISO_INTERN((string)); \ + } +#endif + + + +/**********************/ +/* Global constants */ +/**********************/ + + extern ZCONST ush near mask_bits[]; + extern ZCONST char *fnames[2]; + +#ifdef EBCDIC + extern ZCONST uch ebcdic[]; +#endif +#ifdef IZ_ISO2OEM_ARRAY + extern ZCONST uch Far iso2oem[]; +#endif +#ifdef IZ_OEM2ISO_ARRAY + extern ZCONST uch Far oem2iso[]; +#endif + + extern ZCONST char Far VersionDate[]; + extern ZCONST char Far CentSigMsg[]; +#ifndef SFX + extern ZCONST char Far EndSigMsg[]; +#endif + extern ZCONST char Far SeekMsg[]; + extern ZCONST char Far FilenameNotMatched[]; + extern ZCONST char Far ExclFilenameNotMatched[]; + extern ZCONST char Far ReportMsg[]; + +#ifndef SFX + extern ZCONST char Far Zipnfo[]; + extern ZCONST char Far CompiledWith[]; +#endif /* !SFX */ + + + +/***********************************/ +/* Global (shared?) RTL variables */ +/***********************************/ + +#ifdef DECLARE_ERRNO + extern int errno; +#endif + + +#endif /* !__unzpriv_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/unzvers.h boinc-7.0.14+dfsg/zip/unzip/unzvers.h --- boinc-7.0.7+dfsg/zip/unzip/unzvers.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/unzvers.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,58 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + unzvers.h (for UnZip) by Info-ZIP. + */ + +#ifndef __unzvers_h /* don't include more than once */ +#define __unzvers_h + +#ifdef BETA +# undef BETA /* undefine BETA for public releases */ +#endif + +#ifdef BETA +# define UZ_BETALEVEL "k BETA" +# define UZ_VERSION_DATE "17 Feb 02" /* internal beta version */ +#else +# define UZ_BETALEVEL "" +# define UZ_VERSION_DATE "17 February 2002" /* official release version */ +# define RELEASE +#endif + +#define UZ_MAJORVER 5 /* UnZip */ +#define UZ_MINORVER 5 + +#define ZI_MAJORVER 2 /* ZipInfo */ +#define ZI_MINORVER 4 + +#define UZ_PATCHLEVEL 0 + +#define UZ_VER_STRING "5.5" /* keep in sync with Version numbers! */ + +#ifndef IZ_COMPANY_NAME /* might be already defined... */ +# define IZ_COMPANY_NAME "Info-ZIP" +#endif + +/* these are obsolete but remain for backward compatibility: */ +#if (defined(OS2) || defined(__OS2__)) +# define D2_MAJORVER UZ_MAJORVER /* DLL for OS/2 */ +# define D2_MINORVER UZ_MINORVER +# define D2_PATCHLEVEL UZ_PATCHLEVEL +#endif + +#define DW_MAJORVER UZ_MAJORVER /* DLL for MS Windows */ +#define DW_MINORVER UZ_MINORVER +#define DW_PATCHLEVEL UZ_PATCHLEVEL + +#define WIN_VERSION_DATE UZ_VERSION_DATE + +#define UNZ_DLL_VERSION UZ_VER_STRING + +#endif /* !__unzvers_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/WHERE boinc-7.0.14+dfsg/zip/unzip/WHERE --- boinc-7.0.7+dfsg/zip/unzip/WHERE 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/WHERE 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,367 @@ +__________________________________________________________________________ + + This is the Info-ZIP file ``WHERE,'' last updated on 26 November 2001. +__________________________________________________________________________ + + The latest version of this file can be found online at: + + ftp://ftp.info-zip.org/pub/infozip/doc/WHERE + + Note that some ftp sites may not yet have the latest versions of Zip + and UnZip when you read this. The latest versions always appear in + ftp://ftp.info-zip.org/pub/infozip/ (and subdirectories thereof) first, + except for encryption binaries, which always appear in + ftp://ftp.icce.rug.nl/infozip/ (and subdirectories) first. + + IF YOU FIND AN ERROR: please let us know! We don't have time to + check each and every site personally (or even collectively), so any + number of the sites listed below may have moved or disappeared en- + tirely. E-mail to Zip-Bugs@lists.wku.edu and we'll update this file. +__________________________________________________________________________ + + +Info-ZIP's home WWW site is listed on Yahoo and is at: + + ftp://ftp.info-zip.org/pub/infozip/Info-ZIP.html (master version) + http://www.info-zip.org/pub/infozip/ + +Note that the old sites at http://www.cdrom.com/pub/infozip/ and +http://www.freesoftware.com/pub/infozip are PERMANENTLY BROKEN. They +cannot be updated or removed, apparently. + +The Zip and UnZip pages have links to most known mirror sites carrying our +source and/or binary distributions, and they generally are more up-to-date +and have better information than what you are reading: + + ftp://ftp.info-zip.org/pub/infozip/Zip.html + ftp://ftp.info-zip.org/pub/infozip/UnZip.html + +The related zlib package by Info-ZIP's Jean-loup Gailly and Mark Adler is at: + + http://www.zlib.org/ + +Source-code archives for Info-ZIP's portable Zip, UnZip, and related +utilities: + + zip24.zip Zip 2.4 (deflation; includes zipnote, zipsplit, zipcloak) + zip24.tar.Z ditto, compress'd tar format + + zip11.zip Zip 1.1 (shrinking, implosion; compatible w. PKUNZIP 1.1) + zip11.tar.Z ditto, compress'd tar format + + unzip550.zip UnZip 5.5 (all methods[*]; unzip/funzip/unzipsfx/zipgrep) + unzip550.tar.gz ditto, gzip'd tar format + unzip550.tar.Z ditto, compress'd tar format + + unred550.zip UnZip 5.5 add-on, contains copyrighted unreduce support + + zcrypt29.zip encryption support for Zip 2.4[**] + zcrypt10.zip encryption support for Zip 1.1 + + MacZip106src.zip contains all the GUI stuff and the project files to build + the MacZip main-app. To build MacZip successfully, both + the Zip 2.4 and UnZip 5.5 sources are required, too. + + wiz502.zip WiZ 5.02, Windows 9x/NT GUI front-end for Info-ZIP DLLs + wiz502+dlls.zip WiZ 5.02, Windows 9x/NT GUI front-end plus DLL sources + +[*] Unreducing and unshrinking are not turned on by default but are included + in source form. See UnZip's INSTALL file for details. + +[**] As of January 2000, US export regulations were amended to allow export + of free encryption source code from the US. The UnZip 5.5 and WiZ 5.02 + archives now include full crypto source code, as will the next release + of Zip. In the meantime, zcrypt29.zip is available as an add-on for + Zip 2.4. Note that encryption *binaries* are still restricted, while + decryption-only binaries have never been restricted. Other restrictions + may apply in other countries. + +Executables archives (and related files) for Info-ZIP's software; not all +of these will be immediately available due to lack of access to appropriate +systems on the part of Info-ZIP members. See the BBS section below for +special CompuServe (6.3) filenames: + + zip24x.zip MSDOS executables and docs (no encryption) + zcr24x.zip MSDOS executables and docs (with encryption) + zip24x1.zip OS/2 1.x (16-bit) executables and docs (no encryption) + zcr24x1.zip OS/2 1.x (16-bit) executables and docs (with encryption) + zip24x2.zip OS/2 2/3/4.x (32-bit) executables and docs (no encryption) + zcr24x2.zip OS/2 2/3/4.x (32-bit) executables and docs (w/encryption) + zip24xA.zip Amiga executables and docs (no encryption) + zcr24xA.zip Amiga executables and docs (with encryption) + zip24xB.zip BeOS executables and docs (no encryption) + zcr24xB.zip BeOS executables and docs (with encryption) + zip24xC.zip VM/CMS executable and docs (no encryption) + zcr24xC.zip VM/CMS executable and docs (with encryption) + zip24xK.zip Tandem NSK executables and docs (no encryption) + zcr24xK.zip Tandem NSK executables and docs (with encryption) + zip24xM.xmit MVS classic executable (no encryption) + zcr24xM.xmit MVS classic executable (with encryption) + zip24xM-docs.zip MVS classic port, docs only + zip24dN.zip WinNT/Win95 (Intel) DLL, header files, docs (no encryption) + zcr24dN.zip WinNT/Win95 (Intel) DLL, header files, docs (w/encryption) + zip24xN.zip WinNT/Win95 (Intel) executables and docs (no encryption) + zcr24xN.zip WinNT/Win95 (Intel) executables and docs (with encryption) + zip24xN-axp.zip WinNT (Alpha AXP) executables and docs (no encryption) + zcr24xN-axp.zip WinNT (Alpha AXP) executables and docs (with encryption) + zip24xN-mip.zip WinNT (MIPS R4000) executables and docs (no encryption) + zcr24xN-mip.zip WinNT (MIPS R4000) executables and docs (with encryption) + zip24xN-ppc.zip WinNT (PowerPC) executables and docs (no encryption) + zcr24xN-ppc.zip WinNT (PowerPC) executables and docs (with encryption) + zip24xO.zip IBM OS/390 Open Edition binaries and docs (no encryption) + zcr24xO.zip IBM OS/390 Open Edition binaries and docs (w/ encryption) + zip24xQ.zip SMS/QDOS executables and docs (no encryption) + zcr24xQ.zip SMS/QDOS executables and docs (with encryption) + zip24xR.zip Acorn RISC OS executables and docs (no encryption) + zcr24xR.zip Acorn RISC OS executables and docs (with encryption) + zip24xT.zip Atari TOS executables and docs (no encryption) + zcr24xT.zip Atari TOS executables and docs (with encryption) + zip24-vms-axp-obj.zip (no encryption) + VMS (Alpha AXP) object libs, link procedure and docs + zip24-vms-axp-exe.zip (no encryption) + VMS (Alpha AXP) executables for VMS 6.1 or later and docs + zip24-vms-vax-decc-obj.zip (no encryption) + VMS (VAX) object libs (new DEC C), link procedure and docs + zip24-vms-vax-decc-exe.zip (no encryption) + VMS (VAX) executables (DEC C) for VMS 6.1 or later; docs + zip24-vms-vax-vaxc-obj.zip (no encryption) + VMS (VAX) object libs (old VAX C), link procedure and docs + zcr24-vms-axp-obj.zip (with encryption) + VMS (Alpha AXP) object libs, link procedure and docs + zcr24-vms-axp-exe.zip (with encryption) + VMS (Alpha AXP) executables for VMS 6.1 or later and docs + zcr24-vms-vax-decc-obj.zip (with encryption) + VMS (VAX) object libs (new DEC C), link procedure and docs + zcr24-vms-vax-decc-exe.zip (with encryption) + VMS (VAX) executables (DEC C) for VMS 6.1 or later; docs + zcr24-vms-vax-vaxc-obj.zip (with encryption) + VMS (VAX) object libs (old VAX C), link procedure and docs + zip24x.hqx Macintosh BinHex'd executables and docs (no encryption) + + unz550x.exe MSDOS self-extracting executable (16-bit unzip, ..., docs) + unz550x3.exe MSDOS self-extracting executable (16-, 32-bit unzip, docs) + unz550x1.exe OS/2 1.x (16-bit) self-extracting executables and docs + unz550x2.exe OS/2 2/3/4.x (32-bit) self-extracting executables and docs + unz550d2.zip OS/2 2/3/4.x (32-bit) DLL, header file, demo exe and docs + unz550xA.ami Amiga self-extracting executables and docs + unz550xA.lha Amiga executables and docs, LHa archive + unz550xB.sfx BeOS self-extracting executables and docs + unz550xB.tar.gz BeOS executables and docs, gzip'd tar archive + unz550xC.mod VM/CMS executable module in "packed" format + unz550xC-docs.zip VM/CMS docs, only + unz550xF.zip FlexOS executable and docs + unz550xK.zip Tandem NSK executable and docs + unz550xM.xmit MVS classic executable + unz550xM-docs.zip MVS classic port, docs only + unz550dN.zip WinNT/Win95 (32-bit Intel) DLL, header files, docs + unz550xN.exe WinNT/Win95 self-extracting Intel executables and docs + unz550xN-axp.exe WinNT (Alpha AXP) self-extracting executables and docs + unz550xN-mip.exe WinNT (MIPS R4000) self-extracting executables and docs + unz550xN-ppc.exe WinNT (PowerPC) self-extracting executables and docs + unz550xQ.sfx SMS/QDOS self-extracting executables and docs + unz550xO.tar.Z IBM OS/390 Open edition (Unix-like), exes and docs + unz550xR.exe Acorn RISC OS self-extracting executables and docs + unz550xR.spk Acorn RISC OS Spark'd executables and docs + unz550xT.tos Atari TOS self-extracting executables and docs + unz550x-vms-axp-obj.bck VMS backup saveset, + contains UnZip (Alpha) obj libs, link procedure, docs + unz550x-vms-axp-obj.exe VMS (Alpha AXP) SFX archive (statically linked), + contains UnZip (Alpha) obj libs, link procedure, docs + unz550x-vms-axp-exe.exe VMS (Alpha AXP) SFX archive (dynamically linked), + contains UnZip (Alpha AXP, DEC C) executables and docs, + smaller than object archive, but requires VMS 6.1 + unz550x-vms-vax-decc-obj.bck VMS backup saveset, + contains UnZip (new DEC C) obj libs, link procedure, docs + unz550x-vms-vax-decc-obj.exe VMS (VAX) SFX archive (statically linked), + contains UnZip (new DEC C) obj libs, link procedure, docs + unz550x-vms-vax-decc-exe.exe VMS (VAX) SFX archive (dynamically linked), + contains UnZip (new DEC C) executables and docs, + smaller than object archive, but requires VMS 6.1 + unz550x-vms-vax-vaxc-obj.bck VMS backup saveset, + contains UnZip (old VAX C) obj libs, link procedure, docs + unz550x-vms-vax-vaxc-obj.exe VMS (VAX) SFX archive (statically linked), + contains UnZip (old VAX C) obj libs, link procedure, docs + unz550x.hqx Macintosh BinHex'd executables and docs for unzip + (unz550x.tar.{Z,gz} Unix exes/docs for Solaris 2.x, SCO Unix, Linux, etc., + depending on directory/location; generally only provided + in cases where the OS does *not* ship with a bundled C + compiler) + + MacZip106nc.hqx Macintosh combined Zip&UnZip application with GUI, + executables and docs (no encryption) + MacZip106c.hqx Macintosh combined Zip&UnZip application with GUI, + executables and docs (with encryption) + + wiz502xN.exe WiZ 5.02 32-bit (Windows 9x/NT/2000) app+docs (self-extr.) + + UnzpHist.zip complete changes-history of UnZip and its precursors + ZipHist.zip complete changes-history of Zip + +The latest from PKWARE (the guys who started it all): + + pk250dos.exe MS-DOS PKZIP/PKUNZIP 2.50 (self-extracting archive) + pkz110eu.exe MS-DOS PKZIP/PKUNZIP 1.1 (self-extracting) + pkos2250.exe OS/2 PKZIP/PKUNZIP 2.50 (self-extracting) + pkz102-2.exe OS/2 PKZIP/PKUNZIP 1.02 (self-extracting) + pk263w16.exe Windows 16-bit PKZIP/PKUNZIP 2.60.03 (self-extracting) + pkzw400s.exe Windows 32-bit PKZIP/PKUNZIP 4.00 (self-extracting) + pk260w_a.exe Windows NT/Alpha PKZIP/PKUNZIP 2.60 (self-extracting) + pk260w_p.exe Windows NT/PowerPC PKZIP/PKUNZIP 2.60 (self-extracting) + pkzc400s.exe Win9x/NT command line PKZIP/PKUNZIP 4.00 (self-extracting) + pk250c_a.exe Windows NT/Alpha command line PKZIP 2.50 (self-extracting) + pk250c_p.exe Windows NT/PPC command line PKZIP 2.50 (self-extracting) + pk???251.exe Unix PKZIP 2.51, ???=sun,dig,aix,sco,hpx,lin (self-extr.) + +Third-party software that incorporates Info-ZIP code: + + OS/2: Warp 3.0 BonusPak, FileJet, The UnZip Shell, zipmeister (PMZip), + ZipFly(?) + Windows (NT, 95 and/or 3.x): Nico Mak WinZip, InnerMedia DynaZIP DLL, + NewVision Zip[Shell] Pro, FlashPoint ZIP Navigator and Unzip95, + Z (port of ZipInfo; z101.zip), PowerArchiver (free WinZip clone) + MS-DOS: FileJet + Macintosh: ZipIt + generic Unix: lzpip103.zip + +Third-party software that uses (or can use) Info-ZIP software: + + OS/2: Zip Control, ZiPMe, Workplace Shell UnZip (WUZ), Drop and Zip, + Archive Front End, Archive Manager, Archive Viewer, File Manager/2, + FileStar/2, ZTreeBold, PMZipper, simple zipshell, HyperView, XBBS-OS/2, + LiveWire + Windows: WinCMD + MS-DOS: SHEZ archiver shell + NeXTStep 3.x: Opener + +ftp/web sites for the US-exportable sources and executables: + + NOTE: Look for the Info-ZIP file names given above (not PKWARE or third- + party stuff) in the following locations. Some sites like to use slightly + different names, such as zip-2.4.tar.gz instead of zip24.tar.Z. + + ftp://ftp.info-zip.org/pub/infozip/ [THE INFO-ZIP HOME SITE] + ftp://ftp.uu.net/pub/archiving/zip/ [MIRRORS THE INFO-ZIP HOME SITE] + ftp://ftp.simtel.net/pub/simtelnet/infozip/ [MIRRORS THE INFO-ZIP HOME SITE] + ftp://sunsite.doc.ic.ac.uk/packages/zip/ [MIRRORS THE INFO-ZIP HOME SITE] + ftp://unix.hensa.ac.uk/mirrors/uunet/pub/archiving/zip/ + + ftp://ftp.cmdl.noaa.gov/aerosol/doc/archiver/{all,dos,os2,mac,vax_alpha}/ + ftp://garbo.uwasa.fi/pc/arcers/ [AND OTHER GARBO MIRRORS] + ftp://garbo.uwasa.fi/unix/arcers/ [AND OTHER GARBO MIRRORS] + ftp://ftp.elf.stuba.sk/pub/pc/pack/ [AND OTHER STUBA MIRRORS] + ftp://ftp-os2.cdrom.com/pub/os2/archiver/ + ftp://ftp-os2.nmsu.edu/os2/archiver/ + ftp://ftp.informatik.tu-muenchen.de/pub/comp/os/os2/archiver/ + ftp://sumex-aim.stanford.edu/info-mac/cmp/ + ftp://ftp.wustl.edu/pub/aminet/util/arc/ [AND OTHER AMINET MIRRORS] + ftp://atari.archive.umich.edu/pub/Archivers/ [AND OTHER UMICH MIRRORS] + http://www.umich.edu/~archive/atari/Archivers/ + ftp://jake.educom.com.au/pub/infozip/acorn/ [Acorn RISC OS] + http://www.sitec.net/maczip/ [MacZip port] + +ftp/web sites for the encryption and decryption sources and/or executables: + + NOTE: Non-US users, please do NOT ftp from the US sites (US regulations + and all that). Likewise, US users, please do not ftp from the European + sites if it can be avoided (it's not illegal, but it is a waste of + expensive trans-Atlantic bandwidth). + + From the US: + ftp://ftp.wustl.edu/mirrors/garbo.uwasa.fi/arcers/ + + Outside the US: + ftp://ftp.icce.rug.nl/infozip/ [THE INFO-ZIP ENCRYPTION HOME SITE] + ftp://ftp.elf.stuba.sk/pub/pc/pack/ + ftp://garbo.uwasa.fi/pc/arcers/ + ftp://ftp.inria.fr/system/arch-compr/ + ftp://ftp.leo.org/pub/comp/os/os2/leo/archiver/ + (mail server at ftp-mailer@ftp.leo.org) + + ftp://ftp.win.tue.nl/pub/compression/zip/ + ftp://ftp.uni-erlangen.de/pub/pc/msdos/arc-utils/zip/ + + +The primary distribution site for the MacZip port can be found at: + + http://www.sitec.net/maczip/ + +ftp sites for VMS-format Zip and UnZip packages (sources, object files and +executables, no encryption/decryption--see also "Mail servers" section below): + + ftp.spc.edu [192.107.46.27] and ftp.wku.edu: + + [.MACRO32]AAAREADME.TXT + [.MACRO32.SAVESETS]UNZIP.BCK or UNZIP.ZIP (if already have older version) + [.MACRO32.SAVESETS]ZIP.ZIP + +To find other ftp/web sites: + + The "archie" ftp database utility can be used to find an ftp site near + you (although the command-line versions always seem to find old ver- + sions...the `FTPsearch' server at http://ftpsearch.ntnu.no/ftpsearch + --formerly `Archie 95'--is quite up-to-date, however). Or check a stan- + dard WWW search engine like AltaVista (http://www.altavista.digital.com/) + or Yahoo (http://www.yahoo.com/). If you don't know how to use these, + DON'T ASK US--read the web sites' help pages or check the Usenet groups + news.announce.newusers or news.answers or some such, or ask your system + administrator. + +UUCP sites: + + uunet!~/pub/archiving/zip/ ... + +Bulletin boards (commercial and otherwise): + + Sources, MS-DOS executables: + CompuServe IBMPRO forum, Library 10, Data Compression (unz550.zip, + sources; unz550.exe, self-extracting executables and docs) + CompuServe (ZiffNet) PBSUTIL forum and Public Brand Software BBS + [US, membership required; V.32 line, (317) 856-1490] + (unz550.zip, sources; unz550.exe, self-extracting exes and docs) + America Online OS/2 Forum, Free Uploading area; also Top Picks lib- + rary, File/Disk Utilities library, and OS/2 1.x library (do key- + word search via ctrl-K: FILE SEARCH on "INFOZIP") + FidoNet node 1:124/2113, Lunatic Fringe [Richardson, Texas; BBS + (214) 235-5288; sysop john.stewart@lunatic.com; complete mirror + of Info-ZIP home site] + FidoNet node 1:246/74, Metal Shoppe BBS [Windsor, Ontario; CLink + node 911:6510/0; BBS (519) 256-0278; sysop rakey@cyberspace.net + (Ray Akey); micro-based files but no Unix/VMS/NT stuff] + Drealm Conference System [London, UK; V.22bis, subscriber lines + to V.32bis, etc.; (+44) 81 568 2204] + Compulink Information eXchange (CIX) [London, UK; BBS 14.4 and 28.8 + lines, (+44) 181 390-1244, -1255 and -9787; executables in "the + filepool," sources in free_software/sources] + + Windows sources and executables (filenames, locations not yet final): + CompuServe CRAFTS forum (wiz502.zip, WiZ 32-bit version) + + OS/2 executables: + CompuServe OS2USER forum (zip24.zip and unz550.exe, OS/2 16- and + 32-bit exes and docs) + + Amiga executables: + BIX in AMIGA files section (perform keyword search on "info-zip") + [requires account; telnet bix.com, or "C BIX" via local Sprint + X.25 PAD, or dial direct in US at (617) 491-5410] + + +Mail servers: + + To get the encryption sources by e-mail, send the following commands + to ftp-mailer@informatik.tu-muenchen.de: + + get /pub/comp/os/os2/archiver/zcrypt29.zip + quit + + To get the VMS Zip/UnZip package by e-mail, send the following + commands in the body of a mail message to fileserv@wku.edu (the + "HELP" command is also accepted): + + SEND FILESERV_TOOLS + SEND UNZIP + SEND ZIP + + To get Atari executables by e-mail, send a message to + atari@atari.archive.umich.edu for information about the mail server. +__________________________________________________________________________ diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Contents boinc-7.0.14+dfsg/zip/unzip/win32/Contents --- boinc-7.0.7+dfsg/zip/unzip/win32/Contents 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Contents 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,24 @@ +Contents of the "win32" sub-archive for UnZip 5.4 and later: + + Contents this file + Makefile makefile for UnZip using MS Visual C++ + Makefile.bc makefile for UnZip using Borland C++ + Makefile.dj makefile for UnZip using djgpp v2.x with rsxntdj 1.31 + Makefile.emx makefile for UnZip using emx+gcc 0.9c with RSXNT 1.4 (+) + Makefile.gcc makefile for UnZip using native Win32 gcc ports (Cygwin, MinGW) + Makefile.lcc makefile for UnZip using free LCC-Win32 compiler + Makefile.wat makefile for UnZip using Watcom C/C++ + crc_i386.asm 32-bit Intel-assembler version of CRC routine + crc_i386.c ditto, for MS[V]C with no MASM only + crc_lcc.asm ditto, adapted for LCC-Win32 assembler syntax + nt.c WinNT-specific support routines (ACLs/security descriptors) + nt.h WinNT-specific support header + rsxntwin.h supplement header for RSXNT, fills holes in their + w32cfg.h Win32-specific configuration, included by unzpriv.h + win32.c Win32-specific support routines + +crc_i386.c has been tested with MSVC but not integrated into any makefile +yet. It is provided for those who may have MSVC but no assembler. Note +that some C compilers on Pentium-class machines have been reported to emit +faster code from the plain C sources (crc32.c) than the assembler routines +provide. This has not been tested lately, however. diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/crc_i386.asm boinc-7.0.14+dfsg/zip/unzip/win32/crc_i386.asm --- boinc-7.0.7+dfsg/zip/unzip/win32/crc_i386.asm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/crc_i386.asm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,231 @@ +;=========================================================================== +; Copyright (c) 1990-2000 Info-ZIP. All rights reserved. +; +; See the accompanying file LICENSE, version 2000-Apr-09 or later +; (the contents of which are also included in zip.h) for terms of use. +; If, for some reason, all these files are missing, the Info-ZIP license +; also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +;=========================================================================== +; crc_i386.asm, optimized CRC calculation function for Zip and UnZip, +; created by Paul Kienitz and Christian Spieler. Last revised 24 Dec 98. +; +; Revised 06-Oct-96, Scott Field (sfield@microsoft.com) +; fixed to assemble with masm by not using .model directive which makes +; assumptions about segment alignment. Also, +; avoid using loop, and j[e]cxz where possible. Use mov + inc, rather +; than lodsb, and other misc. changes resulting in the following performance +; increases: +; +; unrolled loops NO_UNROLLED_LOOPS +; *8 >8 <8 *8 >8 <8 +; +; +54% +42% +35% +82% +52% +25% +; +; first item in each table is input buffer length, even multiple of 8 +; second item in each table is input buffer length, > 8 +; third item in each table is input buffer length, < 8 +; +; Revised 02-Apr-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) +; Incorporated Rodney Brown's 32-bit-reads optimization as found in the +; UNIX AS source crc_i386.S. This new code can be disabled by defining +; the macro symbol NO_32_BIT_LOADS. +; +; Revised 12-Oct-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) +; Incorporated Rodney Brown's additional tweaks for 32-bit-optimized CPUs +; (like the Pentium Pro, Pentium II, and probably some Pentium clones). +; This optimization is controlled by the macro symbol __686 and is disabled +; by default. (This default is based on the assumption that most users +; do not yet work on a Pentium Pro or Pentium II machine ...) +; +; FLAT memory model assumed. +; +; The loop unrolling can be disabled by defining the macro NO_UNROLLED_LOOPS. +; This results in shorter code at the expense of reduced performance. +; +; Revised 25-Mar-98, Cosmin Truta (cosmint@cs.ubbcluj.ro) +; Working without .model directive caused tasm32 version 5.0 to produce +; bad object code. The optimized alignments can be optionally disabled +; by defining NO_ALIGN, thus allowing to use .model flat. There is no need +; to define this macro if using other versions of tasm. +; +;============================================================================== +; +; Do NOT assemble this source if external crc32 routine from zlib gets used. +; + IFNDEF USE_ZLIB +; + .386p + name crc_i386 + + IFDEF NO_ALIGN + .model flat + ENDIF + +extrn _get_crc_table:near ; ZCONST ulg near *get_crc_table(void); + +; + IFNDEF NO_STD_STACKFRAME + ; Use a `standard' stack frame setup on routine entry and exit. + ; Actually, this option is set as default, because it results + ; in smaller code !! +STD_ENTRY MACRO + push ebp + mov ebp,esp + ENDM + + Arg1 EQU 08H[ebp] + Arg2 EQU 0CH[ebp] + Arg3 EQU 10H[ebp] + +STD_LEAVE MACRO + pop ebp + ENDM + + ELSE ; NO_STD_STACKFRAME + +STD_ENTRY MACRO + ENDM + + Arg1 EQU 18H[esp] + Arg2 EQU 1CH[esp] + Arg3 EQU 20H[esp] + +STD_LEAVE MACRO + ENDM + + ENDIF ; ?NO_STD_STACKFRAME + +; These two (three) macros make up the loop body of the CRC32 cruncher. +; registers modified: +; eax : crc value "c" +; esi : pointer to next data byte (or dword) "buf++" +; registers read: +; edi : pointer to base of crc_table array +; scratch registers: +; ebx : index into crc_table array +; (requires upper three bytes = 0 when __686 is undefined) + IFNDEF __686 ; optimize for 386, 486, Pentium +Do_CRC MACRO + mov bl,al ; tmp = c & 0xFF + shr eax,8 ; c = (c >> 8) + xor eax,[edi+ebx*4] ; ^ table[tmp] + ENDM + ELSE ; __686 : optimize for Pentium Pro, Pentium II and compatible CPUs +Do_CRC MACRO + movzx ebx,al ; tmp = c & 0xFF + shr eax,8 ; c = (c >> 8) + xor eax,[edi+ebx*4] ; ^ table[tmp] + ENDM + ENDIF ; ?__686 +Do_CRC_byte MACRO + xor al, byte ptr [esi] ; c ^= *buf + inc esi ; buf++ + Do_CRC ; c = (c >> 8) ^ table[c & 0xFF] + ENDM + IFNDEF NO_32_BIT_LOADS +Do_CRC_dword MACRO + xor eax, dword ptr [esi] ; c ^= *(ulg *)buf + add esi, 4 ; ((ulg *)buf)++ + Do_CRC + Do_CRC + Do_CRC + Do_CRC + ENDM + ENDIF ; !NO_32_BIT_LOADS + + IFNDEF NO_ALIGN +_TEXT segment use32 para public 'CODE' + ELSE +_TEXT segment use32 + ENDIF + assume CS: _TEXT + + public _crc32 +_crc32 proc near ; ulg crc32(ulg crc, ZCONST uch *buf, extent len) + STD_ENTRY + push edi + push esi + push ebx + push edx + push ecx + + mov esi,Arg2 ; 2nd arg: uch *buf + sub eax,eax ;> if (!buf) + test esi,esi ;> return 0; + jz fine ;> else { + + call _get_crc_table + mov edi,eax + mov eax,Arg1 ; 1st arg: ulg crc + IFNDEF __686 + sub ebx,ebx ; ebx=0; make bl usable as a dword + ENDIF + mov ecx,Arg3 ; 3rd arg: extent len + not eax ;> c = ~crc; + + test ecx,ecx + IFNDEF NO_UNROLLED_LOOPS + jz bail + IFNDEF NO_32_BIT_LOADS +align_loop: + test esi,3 ; align buf pointer on next + jz SHORT aligned_now ; dword boundary + Do_CRC_byte + dec ecx + jnz align_loop +aligned_now: + ENDIF ; !NO_32_BIT_LOADS + mov edx,ecx ; save len in edx + shr ecx,3 ; ecx = len / 8 + jz SHORT No_Eights + IFNDEF NO_ALIGN +; align loop head at start of 486 internal cache line !! + align 16 + ENDIF +Next_Eight: + IFNDEF NO_32_BIT_LOADS + Do_CRC_dword + Do_CRC_dword + ELSE ; NO_32_BIT_LOADS + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + ENDIF ; ?NO_32_BIT_LOADS + dec ecx + jnz Next_Eight +No_Eights: + mov ecx,edx + and ecx,000000007H ; ecx = len % 8 + ENDIF ; !NO_UNROLLED_LOOPS + jz SHORT bail ;> if (len) + IFNDEF NO_ALIGN +; align loop head at start of 486 internal cache line !! + align 16 + ENDIF +loupe: ;> do { + Do_CRC_byte ; c = CRC32(c, *buf++); + dec ecx ;> } while (--len); + jnz loupe + +bail: ;> } + not eax ;> return ~c; +fine: + pop ecx + pop edx + pop ebx + pop esi + pop edi + STD_LEAVE + ret +_crc32 endp + +_TEXT ends +; + ENDIF ; !USE_ZLIB +; +end diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/crc_i386.c boinc-7.0.14+dfsg/zip/unzip/win32/crc_i386.c --- boinc-7.0.7+dfsg/zip/unzip/win32/crc_i386.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/crc_i386.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,222 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* crc_i386.c -- Microsoft 32-bit C/C++ adaptation of crc_i386.asm + * Created by Rodney Brown from crc_i386.asm, modified by Chr. Spieler. + * Last revised: 24-Dec-1998 + * + * Original coded (in crc_i386.asm) and put into the public domain + * by Paul Kienitz and Christian Spieler. + * + * Revised 06-Oct-96, Scott Field (sfield@microsoft.com) + * fixed to assemble with masm by not using .model directive which makes + * assumptions about segment alignment. Also, + * avoid using loop, and j[e]cxz where possible. Use mov + inc, rather + * than lodsb, and other misc. changes resulting in the following performance + * increases: + * + * unrolled loops NO_UNROLLED_LOOPS + * *8 >8 <8 *8 >8 <8 + * + * +54% +42% +35% +82% +52% +25% + * + * first item in each table is input buffer length, even multiple of 8 + * second item in each table is input buffer length, > 8 + * third item in each table is input buffer length, < 8 + * + * Revised 02-Apr-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) + * Incorporated Rodney Brown's 32-bit-reads optimization as found in the + * UNIX AS source crc_i386.S. This new code can be disabled by defining + * the macro symbol NO_32_BIT_LOADS. + * + * Revised 12-Oct-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) + * Incorporated Rodney Brown's additional tweaks for 32-bit-optimized CPUs + * (like the Pentium Pro, Pentium II, and probably some Pentium clones). + * This optimization is controlled by the macro symbol __686 and is disabled + * by default. (This default is based on the assumption that most users + * do not yet work on a Pentium Pro or Pentium II machine ...) + * + * Revised 16-Nov-97, Chr. Spieler: Made code compatible with Borland C++ + * 32-bit, removed unneeded kludge for potentially unknown movzx mnemonic, + * confirmed correct working with MS VC++ (32-bit). + * + * Revised 22-May-98, Peter Kunath, Chr. Spieler: The 16-Nov-97 revision broke + * MSVC 5.0. Inside preprocessor macros, each instruction is enclosed in its + * own __asm {...} construct. For MSVC, a "#pragma warning" was added to + * shut up the "no return value" warning message. + * + * Revised 13-Dec-98, Chr. Spieler: Modified path to "zip.h" header file. + * + * FLAT memory model assumed. + * + * The loop unrolling can be disabled by defining the macro NO_UNROLLED_LOOPS. + * This results in shorter code at the expense of reduced performance. + * + */ + +#include "../zip.h" + +#ifndef USE_ZLIB + +#ifndef ZCONST +# define ZCONST const +#endif + +/* Select wether the following inline-assember code is supported. */ +#if (defined(_MSC_VER) && _MSC_VER >= 700) +#if (defined(_M_IX86) && _M_IX86 >= 300) +# define MSC_INLINE_ASM_32BIT_SUPPORT + /* Disable warning for no return value, typical of asm functions */ +# pragma warning( disable : 4035 ) +#endif +#endif + +#if (defined(__BORLANDC__) && __BORLANDC__ >= 452) +# define MSC_INLINE_ASM_32BIT_SUPPORT +#endif + +#ifdef MSC_INLINE_ASM_32BIT_SUPPORT +/* This code is intended for Microsoft C/C++ (32-bit) compatible compilers. */ + +/* + * These two (three) macros make up the loop body of the CRC32 cruncher. + * registers modified: + * eax : crc value "c" + * esi : pointer to next data byte (or dword) "buf++" + * registers read: + * edi : pointer to base of crc_table array + * scratch registers: + * ebx : index into crc_table array + * (requires upper three bytes = 0 when __686 is undefined) + */ +#ifndef __686 +#define Do_CRC { \ + __asm { mov bl, al }; \ + __asm { shr eax, 8 }; \ + __asm { xor eax, [edi+ebx*4] }; } +#else /* __686 */ +#define Do_CRC { \ + __asm { movzx ebx, al }; \ + __asm { shr eax, 8 }; \ + __asm { xor eax, [edi+ebx*4] }; } +#endif /* ?__686 */ + +#define Do_CRC_byte { \ + __asm { xor al, byte ptr [esi] }; \ + __asm { inc esi }; \ + Do_CRC; } + +#ifndef NO_32_BIT_LOADS +#define Do_CRC_dword { \ + __asm { xor eax, dword ptr [esi] }; \ + __asm { add esi, 4 }; \ + Do_CRC; \ + Do_CRC; \ + Do_CRC; \ + Do_CRC; } +#endif /* !NO_32_BIT_LOADS */ + +/* ========================================================================= */ +ulg crc32(crc, buf, len) + ulg crc; /* crc shift register */ + ZCONST uch *buf; /* pointer to bytes to pump through */ + extent len; /* number of bytes in buf[] */ +/* Run a set of bytes through the crc shift register. If buf is a NULL + pointer, then initialize the crc shift register contents instead. + Return the current crc in either case. */ +{ + __asm { + push edx + push ecx + + mov esi,buf ;/* 2nd arg: uch *buf */ + sub eax,eax ;/*> if (!buf) */ + test esi,esi ;/*> return 0; */ + jz fine ;/*> else { */ + + call get_crc_table + mov edi,eax + mov eax,crc ;/* 1st arg: ulg crc */ +#ifndef __686 + sub ebx,ebx ;/* ebx=0; => bl usable as a dword */ +#endif + mov ecx,len ;/* 3rd arg: extent len */ + not eax ;/*> c = ~crc; */ + + test ecx,ecx +#ifndef NO_UNROLLED_LOOPS + jz bail +# ifndef NO_32_BIT_LOADS +align_loop: + test esi,3 ;/* align buf pointer on next */ + jz aligned_now ;/* dword boundary */ + } + Do_CRC_byte ; + __asm { + dec ecx + jnz align_loop +aligned_now: +# endif /* !NO_32_BIT_LOADS */ + mov edx,ecx ;/* save len in edx */ + shr ecx,3 ;/* ecx = len / 8 */ + jz No_Eights +; align loop head at start of 486 internal cache line !! + align 16 +Next_Eight: + } +# ifndef NO_32_BIT_LOADS + Do_CRC_dword ; + Do_CRC_dword ; +# else /* NO_32_BIT_LOADS */ + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; +# endif /* ?NO_32_BIT_LOADS */ + __asm { + dec ecx + jnz Next_Eight +No_Eights: + mov ecx,edx + and ecx,000000007H ;/* ecx = len % 8 */ + +#endif /* !NO_UNROLLED_LOOPS */ + jz bail ;/*> if (len) */ +; align loop head at start of 486 internal cache line !! + align 16 +loupe: ;/*> do { */ + } + Do_CRC_byte ;/* c = CRC32(c, *buf++); */ + __asm { + dec ecx ;/*> } while (--len); */ + jnz loupe + +bail: ;/*> } */ + not eax ;/*> return ~c; */ +fine: + pop ecx + pop edx + } +#ifdef NEED_RETURN + return _EAX; +#endif +} +#endif /* MSC_INLINE_ASM_32BIT_SUPPORT */ +#if (defined(_MSC_VER) && _MSC_VER >= 700) +#if (defined(_M_IX86) && _M_IX86 >= 300) + /* Reenable missing return value warning */ +# pragma warning( default : 4035 ) +#endif +#endif +#endif /* !USE_ZLIB */ + +const char *BOINC_RCSID_395f9d2297 = "$Id: crc_i386.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/crc_lcc.asm boinc-7.0.14+dfsg/zip/unzip/win32/crc_lcc.asm --- boinc-7.0.7+dfsg/zip/unzip/win32/crc_lcc.asm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/crc_lcc.asm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,119 @@ +;=========================================================================== +; Copyright (c) 1990-2000 Info-ZIP. All rights reserved. +; +; See the accompanying file LICENSE, version 2000-Apr-09 or later +; (the contents of which are also included in zip.h) for terms of use. +; If, for some reason, all these files are missing, the Info-ZIP license +; also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +;=========================================================================== +; crc_lcc.asm, optimized CRC calculation function for Zip and UnZip, +; created by Paul Kienitz and Christian Spieler. Last revised 24 Dec 98. +; +; The code in this file has been copied verbatim from crc_i386.{asm|S}; +; only the assembler syntax and metacommands have been adapted to +; the habits of the free LCC-Win32 C compiler package. +; This version of the code uses the "optimized for i686" variant of +; crc_i386.{asm|S}. +; IMPORTANT NOTE to the Info-ZIP editors: +; The TAB characters in this source file are required by the parser of +; the LCC-Win32 assembler program and MUST NOT be removed!! +; +; For more information (and a revision log), look into the original +; source files. +; + .text + .file "crc32.c" + .text + .type _crc32,function +_crc32: + pushl %ebp + movl %esp,%ebp + pushl %ecx + pushl %ebx + pushl %esi + pushl %edi + .line 34 + .line 37 + movl 12(%ebp),%esi + subl %eax,%eax + testl %esi,%esi + jz _$3 + .line 39 + call _get_crc_table + movl %eax,%edi + .line 41 + movl 8(%ebp),%eax + movl 16(%ebp),%ecx + notl %eax + testl %ecx,%ecx + jz _$4 +_$5: + testl $3,%esi + jz _$6 + xorb (%esi),%al + incl %esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + decl %ecx + jnz _$5 +_$6: + movl %ecx,%edx + shrl $3,%ecx + jz _$8 +_$7: + xorl (%esi),%eax + addl $4,%esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + xorl (%esi),%eax + addl $4,%esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + decl %ecx + jnz _$7 +_$8: + movl %edx,%ecx + andl $7,%ecx + jz _$4 +_$9: + xorb (%esi),%al + incl %esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + decl %ecx + jnz _$9 +_$4: + xorl $0xffffffff,%eax +_$3: + .line 52 + popl %edi + popl %esi + popl %ebx + leave + ret +_$34: + .size _crc32,_$34-_crc32 + .globl _crc32 + .extern _get_crc_table diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile boinc-7.0.14+dfsg/zip/unzip/win32/Makefile --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,499 @@ +# NMAKE Makefile for Windows NT/Windows 95 +# D. Feinleib 7/92 +# H. Gessau 9/93 +# J. Lee 8/95 (johnnyl@microsoft.com) +# C. Spieler 03/99 +# +# Last revised: 10 Feb 2001 +# +# Tested with VC++ 2.0 for NT for MIPS and Alpha, Visual C++ 2.2 for Intel CPUs +# Revision tested with VC++ 5.0 and 6.0 for Intel CPUs +# + +# Nmake macros for building Windows NT applications +# To build with debug info use 'nmake debug=1' +!IFNDEF debug +NODEBUG=1 +!ENDIF + +!ifdef NOASM +APPLY_ASMCRC=0 +!else +!ifdef USEASM +APPLY_ASMCRC=1 +!endif +!endif + +!ifndef APPLY_ASMCRC +#default to generic C code for now... +APPLY_ASMCRC=0 +!endif + +!ifndef USE_IZTIMEZONE +#default: do not use the IZ timezone replacement +USE_IZTIMEZONE=0 +!endif + +!IF "$(CPU)" == "" && "$(PROCESSOR_ARCHITECTURE)" == "x86" +CPU = i386 +!ENDIF +!IF "$(CPU)" == "" && "$(PROCESSOR_ARCHITECTURE)" == "MIPS" +CPU = $(PROCESSOR_ARCHITECTURE) +!ENDIF +!IF "$(CPU)" == "" && "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" +CPU = $(PROCESSOR_ARCHITECTURE) +!ENDIF +!IF "$(CPU)" == "" && "$(PROCESSOR_ARCHITECTURE)" == "PPC" +CPU = $(PROCESSOR_ARCHITECTURE) +!ENDIF +!IF "$(CPU)" == "" +CPU = i386 +!ENDIF + +!include + +# special subdirectory for the static library binaries, to separate them +# from other binaries (including dll import library file) +OBDIR = ow32lib +OB = $(OBDIR)/ + +# object files +OBJU1 = unzip.obj $(CRC32).obj crctab.obj crypt.obj envargs.obj explode.obj +OBJU2 = extract.obj fileio.obj globals.obj inflate.obj list.obj match.obj +OBJU3 = process.obj ttyio.obj unreduce.obj unshrink.obj zipinfo.obj +OBJUS = win32.obj nt.obj $(TIMEZONE_OBJU) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJUS) +OBJX1 = unzipsfx.obj $(CRC32X).obj crctab_.obj crypt_.obj +OBJX2 = extract_.obj fileio_.obj globals_.obj inflate_.obj +OBJX3 = match_.obj process_.obj ttyio_.obj +OBJXS = win32_.obj nt_.obj $(TIMEZONE_OBJX) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS) +OBJF1 = funzip.obj $(CRC32F).obj cryptf.obj globalsf.obj +OBJF2 = inflatef.obj ttyiof.obj +OBJFS = win32f.obj +OBJF = $(OBJF1) $(OBJF2) $(OBJFS) +OBJD1 = api.obj $(CRC32L).obj crctabl.obj cryptl.obj explodel.obj +OBJD2 = extractl.obj fileiol.obj globalsl.obj inflatel.obj +OBJD3 = listl.obj matchl.obj processl.obj +OBJD4 = unreducl.obj unshrnkl.obj zipinfol.obj +OBJDS = win32l.obj ntl.obj windll.obj $(TIMEZONE_OBJD) +OBJD = $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS) +OBLX1 = apig.obj $(CRC32G).obj crctabg.obj cryptg.obj +OBLX2 = extractg.obj fileiog.obj globalsg.obj inflateg.obj +OBLX3 = matchg.obj processg.obj +OBLXS = win32g.obj ntg.obj windllg.obj $(TIMEZONE_OBLX) +OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBLXS) +OBGX = sfxwiz.obj +OBJB1 = $(OB)apib.obj $(OB)$(CRC32B).obj $(OB)crctabb.obj $(OB)cryptb.obj +OBJB2 = $(OB)explodeb.obj $(OB)extractb.obj $(OB)fileiob.obj $(OB)globalsb.obj +OBJB3 = $(OB)inflateb.obj $(OB)listb.obj $(OB)matchb.obj $(OB)processb.obj +OBJB4 = $(OB)unreducb.obj $(OB)unshrnkb.obj $(OB)zipinfob.obj +OBJBS = $(OB)win32b.obj $(OB)ntb.obj $(OB)windllb.obj $(TIMEZONE_OBJB) +OBJB = $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJBS) + +UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h +WINDLL_H = windll/windll.h windll/decs.h windll/structs.h +WINDLL_DEF = windll/windll32.def +WINDLL_IMP_H = windll/decs.h windll/structs.h + +!if $(APPLY_ASMCRC) != 0 +CFVARS_ASM = -DASM_CRC +!else +CFVARS_ASM = -DNO_ASM +!endif + +!if $(USE_IZTIMEZONE) != 0 +LOCAL_UNZIP = -DW32_USE_IZ_TIMEZONE $(LOCAL_UNZIP) +!endif + +#CF_LOC = -nologo -J -D_MBCS $(CFVARS_ASM) -DREENTRANT +CF_LOC = -nologo -J -D_MBCS $(CFVARS_ASM) $(LOCAL_UNZIP) + +cvars = $(cvars) $(CF_LOC) + +!if $(APPLY_ASMCRC) != 0 +CRC32 = crc_i386 +CRC32X = $(CRC32) +CRC32F = $(CRC32) +CRC32L = crci386l +CRC32G = crci386g +CRC32B = crci386b +!else +CRC32 = crc32 +CRC32X = crc32_ +CRC32F = $(CRC32) +CRC32L = crc32l +CRC32G = crc32g +CRC32B = crc32b +!endif + +!if $(USE_IZTIMEZONE) != 0 +TIMEZONE_OBJU = timezone.obj +TIMEZONE_OBJX = timezon_.obj +TIMEZONE_OBJD = timezonl.obj +TIMEZONE_OBLX = timezolx.obj +TIMEZONE_OBJB = $(OB)timezonb.obj +!else +TIMEZONE_OBJU = +TIMEZONE_OBJX = +TIMEZONE_OBJD = +TIMEZONE_OBLX = +TIMEZONE_OBJB = +!endif + +# USER32.LIB is needed for OemToChar and related routines +conlibs=$(conlibs) user32.lib +conlibsmt=$(conlibsmt) user32.lib +conlibsdll=$(conlibsdll) user32.lib + +# Some optimization (if not debugging) +!IFDEF NODEBUG +cdebug = -O2 +cdbgsz = -O1 +!ELSE +cdbgsz = $(cdebug) +!ENDIF + +!IFDEF PROFILEINFO +ldebug = $(ldebug) /PROFILE +!endif + +!IFDEF DLLSTANDALONE +# the standalone variant of unzip32.dll is linked against the +# multithread-safe static C runtime library +cvars_izdll = $(cvarsmt) +conlibs_izdll = $(conlibsmt) +!ELSE +# the (normal) variant of unzip32.dll is linked against the import library +# of multithread-safe C runtime dll +# -> smaller dll size; efficient use of shared resources, +# but requires the C RTL DLL msvcrt.dll to be installed at runtime +cvars_izdll = $(cvarsdll) +conlibs_izdll = $(conlibsdll) +!ENDIF + +CFLAGS_UN = $(cdebug) $(cflags) $(cvars) +CFLAGS_SX = $(cdbgsz) $(cflags) $(cvars) -DSFX +CFLAGS_FU = $(cdebug) $(cflags) $(cvars) -DFUNZIP +CFLAGS_DL = $(cdebug) $(cflags) $(cvars_izdll) -DWINDLL -DDLL +CFLAGS_SL = $(cdbgsz) $(cflags) $(cvars) -DWINDLL -DDLL -DUNZIPLIB -DSFX +CFLAGS_GX = $(cdbgsz) $(cflags) $(cvars) -DSFX +CFLAGS_LB = $(cdebug) $(cflags) $(cvars) -DWINDLL -DDLL -DUNZIPLIB + +# How to compile sources +.c.obj: + $(cc) $(CFLAGS_UN) -o $@ $< + +# How to link +.obj.exe: + $(link) $(ldebug) $(conflags) $(conlibs) $** -out:$@ +.obj.dll: + $(link) $(ldebug) $(dlllflags) $(conlibs_izdll) $** -out:$@ +.obj.lib: + $(link) -lib $** -out:$@ + + +# Default target is all the executables +unzips : unzip.exe funzip.exe unzipsfx.exe +guisfx: SFXWiz32.exe +dll : unzip32.dll +dllsample : uzexampl.exe +lib : $(OBDIR) $(OB)unzip32.lib +all : unzips guisfx dll dllsample lib + + +unzip.exe: $(OBJU) +unzipsfx.exe: $(OBJX) +funzip.exe: $(OBJF) +unzip32.dll: $(OBJD) windll.res $(WINDLL_DEF) + $(link) $(ldebug) $(dlllflags) $(conlibs_izdll) -def:$(WINDLL_DEF) \ + $(OBJD) windll.res -out:$@ +unzsfx32.lib: $(OBLX) + $(link) -lib $(OBLX) -out:$@ +SFXWiz32.exe: $(OBGX) sfxwiz.res unzsfx32.lib + $(link) $(ldebug) $(guilflags) $(guilibs) \ + $(OBGX) sfxwiz.res unzsfx32.lib -out:$@ +uzexampl.exe: uzexampl.obj + $(link) $(ldebug) $(conflags) $(conlibs) version.lib $** -out:$@ +$(OB)unzip32.lib: $(OBJB) + $(link) -lib $(OBJB) -out:$@ + +crc32.obj: crc32.c $(UNZIP_H) zip.h +crctab.obj: crctab.c $(UNZIP_H) zip.h +crypt.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h +envargs.obj: envargs.c $(UNZIP_H) +explode.obj: explode.c $(UNZIP_H) +extract.obj: extract.c $(UNZIP_H) crypt.h +fileio.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +funzip.obj: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h +globals.obj: globals.c $(UNZIP_H) +inflate.obj: inflate.c inflate.h $(UNZIP_H) +list.obj: list.c $(UNZIP_H) +match.obj: match.c $(UNZIP_H) +process.obj: process.c $(UNZIP_H) +timezone.obj: timezone.c $(UNZIP_H) zip.h timezone.h +ttyio.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce.obj: unreduce.c $(UNZIP_H) +unshrink.obj: unshrink.c $(UNZIP_H) +unzip.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo.obj: zipinfo.c $(UNZIP_H) + +win32.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_UN) -I. win32/win32.c -Fo$@ + +nt.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_UN) -I. win32/nt.c -Fo$@ + +!ifdef USEMASM +crc_i386.obj: win32/crc_i386.asm + masm -ml win32/crc_i386.asm,$@; +!else +!ifdef USEML +crc_i386.obj: win32/crc_i386.asm + ml -c -Cp -coff -Fo$@ win32/crc_i386.asm +!else +crc_i386.obj: win32/crc_i386.c + $(cc) $(CFLAGS_UN) -I. win32/crc_i386.c -Fo$@ +!endif +!endif + +win32_.obj: win32/win32.c $(UNZIP_H) win32/nt.h # unzipsfx only + $(cc) $(CFLAGS_SX) -I. win32/win32.c -Fo$@ + +win32f.obj: win32/win32.c $(UNZIP_H) win32/nt.h # funzip only + $(cc) $(CFLAGS_FU) -I. win32/win32.c -Fo$@ + +nt_.obj: win32/nt.c $(UNZIP_H) win32/nt.h # unzipsfx only + $(cc) $(CFLAGS_SX) -I. win32/nt.c -Fo$@ + +crc32_.obj: crc32.c $(UNZIP_H) zip.h # unzipsfx only + $(cc) $(CFLAGS_SX) crc32.c -Fo$@ + +crc32f.obj: crc32.c $(UNZIP_H) zip.h # funzip only + $(cc) $(CFLAGS_FU) crc32.c -Fo$@ + +crctab_.obj: crctab.c $(UNZIP_H) zip.h # unzipsfx only + $(cc) $(CFLAGS_SX) crctab.c -Fo$@ + +crypt_.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + $(cc) $(CFLAGS_SX) crypt.c -Fo$@ + +cryptf.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + $(cc) $(CFLAGS_FU) crypt.c -Fo$@ + +extract_.obj: extract.c $(UNZIP_H) crypt.h # unzipsfx only + $(cc) $(CFLAGS_SX) extract.c -Fo$@ + +fileio_.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only + $(cc) $(CFLAGS_SX) fileio.c -Fo$@ + +globals_.obj: globals.c $(UNZIP_H) # unzipsfx only + $(cc) $(CFLAGS_SX) globals.c -Fo$@ + +globalsf.obj: globals.c $(UNZIP_H) # funzip only + $(cc) $(CFLAGS_FU) globals.c -Fo$@ + +inflate_.obj: inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only + $(cc) $(CFLAGS_SX) inflate.c -Fo$@ + +inflatef.obj: inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only + $(cc) $(CFLAGS_FU) inflate.c -Fo$@ + +match_.obj: match.c $(UNZIP_H) # unzipsfx only + $(cc) $(CFLAGS_SX) match.c -Fo$@ + +process_.obj: process.c $(UNZIP_H) # unzipsfx only + $(cc) $(CFLAGS_SX) process.c -Fo$@ + +timezon_.obj: timezone.c $(UNZIP_H) zip.h timezone.h # unzipsfx only + $(cc) $(CFLAGS_SX) timezone.c -Fo$@ + +ttyio_.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + $(cc) $(CFLAGS_SX) ttyio.c -Fo$@ + +ttyiof.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + $(cc) $(CFLAGS_FU) ttyio.c -Fo$@ + +unzipsfx.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only + $(cc) $(CFLAGS_SX) unzip.c -Fo$@ + +# DLL compilation section +api.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(cc) $(CFLAGS_DL) api.c -Fo$@ +crc32l.obj: crc32.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_DL) crc32.c -Fo$@ +crctabl.obj: crctab.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_DL) crctab.c -Fo$@ +cryptl.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(cc) $(CFLAGS_DL) crypt.c -Fo$@ +explodel.obj: explode.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) explode.c -Fo$@ +extractl.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(cc) $(CFLAGS_DL) extract.c -Fo$@ +fileiol.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(cc) $(CFLAGS_DL) fileio.c -Fo$@ +globalsl.obj: globals.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) globals.c -Fo$@ +inflatel.obj: inflate.c inflate.h $(UNZIP_H) + $(cc) $(CFLAGS_DL) inflate.c -Fo$@ +listl.obj: list.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_DL) list.c -Fo$@ +matchl.obj: match.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) match.c -Fo$@ +processl.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_DL) process.c -Fo$@ +timezonl.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(cc) $(CFLAGS_DL) timezone.c -Fo$@ +unreducl.obj: unreduce.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) unreduce.c -Fo$@ +unshrnkl.obj: unshrink.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) unshrink.c -Fo$@ +zipinfol.obj: zipinfo.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) zipinfo.c -Fo$@ + +win32l.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_DL) -I. win32/win32.c -Fo$@ + +ntl.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_DL) -I. win32/nt.c -Fo$@ + +windll.obj: windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(cc) $(CFLAGS_DL) -I. windll/windll.c -Fo$@ + +!ifdef USEMASM +crci386l.obj: win32/crc_i386.asm + masm -ml win32/crc_i386.asm,$@; +!else +!ifdef USEML +crci386l.obj: win32/crc_i386.asm + ml -c -Cp -coff -Fo$@ win32/crc_i386.asm +!else +crci386l.obj: win32/crc_i386.c + $(cc) $(CFLAGS_DL) -I. win32/crc_i386.c -Fo$@ +!endif +!endif + +windll.res: windll/windll.rc unzvers.h + $(rc) /l 0x409 /fo$@ /i windll /d WIN32 windll/windll.rc + +uzexampl.obj: windll/uzexampl.c windll/uzexampl.h + $(cc) $(CFLAGS_UN) -I. windll/uzexampl.c -Fo$@ + +# SFX Lib compilation section +apig.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(cc) $(CFLAGS_SL) api.c -Fo$@ +crc32g.obj: crc32.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_SL) crc32.c -Fo$@ +crctabg.obj: crctab.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_SL) crctab.c -Fo$@ +cryptg.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(cc) $(CFLAGS_SL) crypt.c -Fo$@ +extractg.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(cc) $(CFLAGS_SL) extract.c -Fo$@ +fileiog.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(cc) $(CFLAGS_SL) fileio.c -Fo$@ +globalsg.obj: globals.c $(UNZIP_H) + $(cc) $(CFLAGS_SL) globals.c -Fo$@ +inflateg.obj: inflate.c inflate.h $(UNZIP_H) + $(cc) $(CFLAGS_SL) inflate.c -Fo$@ +matchg.obj: match.c $(UNZIP_H) + $(cc) $(CFLAGS_SL) match.c -Fo$@ +processg.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_SL) process.c -Fo$@ +timezong.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(cc) $(CFLAGS_SL) timezone.c -Fo$@ + +win32g.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_SL) -I. win32/win32.c -Fo$@ + +ntg.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_SL) -I. win32/nt.c -Fo$@ + +windllg.obj: windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(cc) $(CFLAGS_SL) -I. windll/windll.c -Fo$@ + +!ifdef USEMASM +crci386g.obj: win32/crc_i386.asm + masm -ml win32/crc_i386.asm,$@; +!else +!ifdef USEML +crci386g.obj: win32/crc_i386.asm + ml -c -Cp -coff -Fo$@ win32/crc_i386.asm +!else +crci386g.obj: win32/crc_i386.c + $(cc) $(CFLAGS_SL) -I. win32/crc_i386.c -Fo$@ +!endif +!endif + +sfxwiz.obj: windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H) + $(cc) $(CFLAGS_GX) windll/guisfx/sfxwiz.c -Fo$@ + +sfxwiz.res: windll/guisfx/sfxwiz.rc + $(rc) /l 0x409 /fo$@ /i windll/guisfx /d WIN32 windll/guisfx/sfxwiz.rc + +# static LIB compilation section +$(OB)apib.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(cc) $(CFLAGS_LB) api.c -Fo$@ +$(OB)crc32b.obj: crc32.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_LB) crc32.c -Fo$@ +$(OB)crctabb.obj: crctab.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_LB) crctab.c -Fo$@ +$(OB)cryptb.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(cc) $(CFLAGS_LB) crypt.c -Fo$@ +$(OB)explodeb.obj: explode.c $(UNZIP_H) + $(cc) $(CFLAGS_LB) explode.c -Fo$@ +$(OB)extractb.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(cc) $(CFLAGS_LB) extract.c -Fo$@ +$(OB)fileiob.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(cc) $(CFLAGS_LB) fileio.c -Fo$@ +$(OB)globalsb.obj: globals.c $(UNZIP_H) + $(cc) $(CFLAGS_LB) globals.c -Fo$@ +$(OB)inflateb.obj: inflate.c inflate.h $(UNZIP_H) + $(cc) $(CFLAGS_LB) inflate.c -Fo$@ +$(OB)listb.obj: list.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_LB) list.c -Fo$@ +$(OB)matchb.obj: match.c $(UNZIP_H) + $(cc) $(CFLAGS_LB) match.c -Fo$@ +$(OB)processb.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_LB) process.c -Fo$@ +$(OB)timezonb.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(cc) $(CFLAGS_LB) timezone.c -Fo$@ +$(OB)unreducb.obj: unreduce.c $(UNZIP_H) + $(cc) $(CFLAGS_LB) unreduce.c -Fo$@ +$(OB)unshrnkb.obj: unshrink.c $(UNZIP_H) + $(cc) $(CFLAGS_LB) unshrink.c -Fo$@ +$(OB)zipinfob.obj: zipinfo.c $(UNZIP_H) + $(cc) $(CFLAGS_LB) zipinfo.c -Fo$@ + +$(OB)win32b.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_LB) -I. win32/win32.c -Fo$@ + +$(OB)ntb.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(cc) $(CFLAGS_LB) -I. win32/nt.c -Fo$@ + +$(OB)windllb.obj: windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(cc) $(CFLAGS_LB) -I. windll/windll.c -Fo$@ + +!ifdef USEMASM +$(OB)crci386b.obj: win32/crc_i386.asm + masm -ml win32/crc_i386.asm,$@; +!else +!ifdef USEML +$(OB)crci386b.obj: win32/crc_i386.asm + ml -c -Cp -coff -Fo$@ win32/crc_i386.asm +!else +$(OB)crci386b.obj: win32/crc_i386.c + $(cc) $(CFLAGS_LB) -I. win32/crc_i386.c -Fo$@ +!endif +!endif + +$(OBDIR): + -mkdir $@ + +clean: + del $(OBJU) unzip.exe + del $(OBJF) funzip.exe + del $(OBJX) unzipsfx.exe + del $(OBJD) windll.res unzip32.dll unzip32.lib unzip32.exp + del $(OBJB) $(OB)unzip32.lib + del $(OBLX) unzsfx32.lib diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.bc boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.bc --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.bc 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.bc 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,521 @@ +# Makefile for UnZip(SFX) and fUnZip for Borland C++ for Windows 95/NT +# Version: 5.5 and later +# Alvin Koh, Jim Knoble, Christian Spieler, E-Yen Tan, Cosmin Truta, etc. +# +# Tested with Borland C++ 5.5 (may work with older C++Builder 3.0, too) +# +# Last revised: 11 Nov 2001 (CS) +# +# + +# Optional nonstandard preprocessor flags (as -DCHECK_EOF or -DDOS_WILD) +# should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added +# to the declaration of LOC here: +LOC = $(LOCAL_UNZIP) + +# Type for CPU required: 3: 80386, 4: 80486, 5: Pentium, +# 6: Pentium Pro, Pentium II, etc. +!ifndef CPU_TYP +CPU_TYP = 6 +!endif + +# (De)Select inclusion of optimized assembler CRC32 routine: +!ifdef NOASM +USE_ASMCRC=0 +!else +!ifdef USEASM +USE_ASMCRC=1 +!endif +!endif + +!ifndef USE_ASMCRC +# default to generic C code for now... +USE_ASMCRC = 0 +!endif + +!ifndef USE_IZTIMEZONE +#default: do not use the IZ timezone replacement +USE_IZTIMEZONE=0 +!endif + +!if $(USE_IZTIMEZONE) != 0 +LOC = -DW32_USE_IZ_TIMEZONE $(LOC) +!endif + +# If you have bcc32i, you should define: +# CC = bcc32i +# This compiler generates a faster code. +CC = bcc32 +!ifdef USETASM16 +AS = tasm +!else +AS = tasm32 +!endif +AR = tlib +LD = ilink32 + +!if $(USE_ASMCRC) != 0 +ASMFLG = -DASM_CRC +CRC32 = crc_i386 +CRC32X = $(CRC32) +CRC32F = $(CRC32) +CRC32L = $(CRC32) +CRC32G = $(CRC32) +CRC32B = $(CRC32) +!else +ASMFLG = +CRC32 = crc32 +CRC32X = crc32x +CRC32F = crc32f +CRC32L = crc32l +CRC32G = crc32g +CRC32B = $(OB)crc32b +!endif + +!if $(USE_IZTIMEZONE) != 0 +TIMEZONE_OBJU = timezone.obj +TIMEZONE_OBJX = timezonx.obj +TIMEZONE_OBJD = timezonl.obj +TIMEZONE_OBLX = timezolx.obj +TIMEZONE_OBJB = $(OB)timezonb.obj +!else +TIMEZONE_OBJU = +TIMEZONE_OBJX = +TIMEZONE_OBJD = +TIMEZONE_OBLX = +TIMEZONE_OBJB = +!endif + +!if $(UNCLEAN) +DIRT = -DUSE_SMITH_CODE -DUSE_UNSHRINK +!else +DIRT = +!endif + +!if $(DEBUG) +CC_SIZE_OPT = -Od +CC_SPEED_OPT = -Od +!else +# Smallest code +CC_SIZE_OPT = -O1 -OS +# Fastest code +CC_SPEED_OPT = -O2 -OS -Oc +!endif +!if $(WARNINGS) +CC_WARN = -w -w-aus -w-par -w-sig -w-use +!else +CC_WARN = -w- +!endif + +# compiler flags + +ASCPUFLAG = __$(CPU_TYP)86 +!if $(CPU_TYP) != 0 +CC_CPUFLG = -$(CPU_TYP) +!endif +ASFLAGS = -ml -m2 -w0 -D$(ASCPUFLAG) $(LOC) +CFLAGS = $(CC_WARN) $(CC_CPUFLG) -d -ff- -k- -P-.C -I. $(ASMFLG) $(LOC) $(DIRT) +LDFLAGS = # -lxncd -l-P # for bcc +LDFLAGS_DLL = $(LDFLAGS) -tWD +LDFLAGS_GUI = $(LDFLAGS) -tW +UNFLAGS = $(CFLAGS) $(CC_SPEED_OPT) +FUFLAGS = $(CFLAGS) $(CC_SPEED_OPT) -K -DFUNZIP +SXFLAGS = $(CFLAGS) $(CC_SIZE_OPT) -DSFX +DLFLAGS = $(CFLAGS) $(CC_SPEED_OPT) -tWD -DWINDLL -DDLL +SLFLAGS = $(CFLAGS) $(CC_SIZE_OPT) -DWINDLL -DDLL -DUNZIPLIB -DSFX +GXFLAGS = $(CFLAGS) $(CC_SIZE_OPT) -tW -DSFX +LBFLAGS = $(CFLAGS) $(CC_SPEED_OPT) -DWINDLL -DDLL -DUNZIPLIB + +# list macros + +# special subdirectory for the static library binaries, to separate them +# from other binaries (including dll import library file) +OBDIR = ow32lib +OB = $(OBDIR)/ + +# object files +OBJU1 = unzip.obj $(CRC32).obj crctab.obj crypt.obj envargs.obj explode.obj +OBJU2 = extract.obj fileio.obj globals.obj inflate.obj list.obj match.obj +OBJU3 = process.obj ttyio.obj unreduce.obj unshrink.obj zipinfo.obj +OBJUS = win32.obj nt.obj $(TIMEZONE_OBJU) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJUS) +OBJF = funzip.obj $(CRC32F).obj cryptf.obj globalsf.obj inflatef.obj \ + ttyiof.obj win32f.obj +OBJX1 = unzipsfx.obj $(CRC32X).obj crctabx.obj cryptx.obj +OBJX2 = extractx.obj fileiox.obj globalsx.obj inflatex.obj matchx.obj +OBJX3 = processx.obj ttyiox.obj +OBJXS = win32x.obj ntx.obj $(TIMEZONE_OBJX) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS) +OBJD1 = api.obj $(CRC32L).obj crctabl.obj cryptl.obj explodel.obj +OBJD2 = extractl.obj fileiol.obj globalsl.obj inflatel.obj listl.obj matchl.obj +OBJD3 = processl.obj unreducl.obj unshrnkl.obj zipinfol.obj +OBJDS = win32l.obj ntl.obj windll.obj $(ASMOBJS) $(TIMEZONE_OBJD) +OBJD = $(OBJD1) $(OBJD2) $(OBJD3) $(OBJDS) +OBLX1 = apig.obj $(CRC32G).obj crctabg.obj cryptg.obj +OBLX2 = extractg.obj fileiog.obj globalsg.obj inflateg.obj +OBLX3 = matchg.obj processg.obj +OBLXS = win32g.obj ntg.obj windllg.obj $(TIMEZONE_OBLX) +OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBLXS) +OBGX = sfxwiz.obj +OBJLIB = $(OB)windllb.obj $(OB)apib.obj +OBJB1 = $(CRC32B).obj $(OB)crctabb.obj $(OB)cryptb.obj +OBJB2 = $(OB)explodeb.obj $(OB)extractb.obj $(OB)fileiob.obj $(OB)globalsb.obj +OBJB3 = $(OB)inflateb.obj $(OB)listb.obj $(OB)matchb.obj $(OB)processb.obj +OBJB4 = $(OB)unreducb.obj $(OB)unshrnkb.obj $(OB)zipinfob.obj +OBJBS = $(OB)win32b.obj $(OB)ntb.obj $(TIMEZONE_OBJB) +OBJB = $(OBJLIB) $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJBS) + +UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h +WINDLL_H = windll/windll.h windll/structs.h windll/decs.h +WINDLL_DEF = windll/windll32.def +WINDLL_IMP_H = windll/decs.h windll/structs.h + +# implicit rules + +.asm.obj: + $(AS) $(ASFLAGS) $< + +.c.obj: + $(CC) -c $(UNFLAGS) {$< } + +# explicit rules + +# Default target is all the command line executables +unzips: unzip.exe funzip.exe unzipsfx.exe +dll: unzip32.dll +dllsample: uzexampl.exe +guisfx: SFXWiz32.exe +lib: $(OBDIR) $(OB)unzip32.lib +all: unzips dll dllsample guisfx lib + +unzip.exe: $(OBJU) + $(CC) $(LDFLAGS) -e$@ @&&| +$(OBJU) +| + +funzip.exe: $(OBJF) + $(CC) $(LDFLAGS) -e$@ @&&| +$(OBJF) +| + +unzipsfx.exe: $(OBJX) + $(CC) $(LDFLAGS) -e$@ @&&| +$(OBJX) +| + +unzip32.dll: $(OBJD) windll.res $(WINDLL_DEF) + $(LD) -Gn -x -c -aa -Tpd @&&| +c0d32.obj $(OBJD),$@,,import32.lib cw32.lib,$(WINDLL_DEF:/=\),windll.res +| +# $(CC) $(LDFLAGS_DLL) -e$@ @&&| +#$(OBJD) +##, windll.res +#| +# brc32 windll.res $@ + +unzsfx32.lib: $(OBLX) + $(AR) /C $(@:/=\) @&&| +/u $(OBLX:/=\) +| + +SFXWiz32.exe: $(OBGX) sfxwiz.res unzsfx32.lib + $(LD) -Gn -x -c -aa -Tpe @&&| +c0w32.obj $(OBGX),$@,,unzsfx32.lib import32.lib cw32.lib,,sfxwiz.res +| +# $(CC) $(LDFLAGS_GUI) -e$@ $(OBGX) unzsfx32.lib $(LDLIBS) +# brc32 sfxwiz.res $@ + +uzexampl.exe: uzexampl.obj + $(CC) $(LDFLAGS) -e$@ uzexampl.obj #version.lib + +$(OB)unzip32.lib: $(OBJB) + $(AR) /C $(@:/=\) @&&| +/u $(OBJB:/=\) +| + +clean: + rem Ignore any errors in the following... + -del *.obj + -del unzip.exe + -del funzip.exe + -del unzipsfx.exe + +# individual file dependencies + +crc32.obj: crc32.c $(UNZIP_H) zip.h +crctab.obj: crctab.c $(UNZIP_H) zip.h +crypt.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h +envargs.obj: envargs.c $(UNZIP_H) +explode.obj: explode.c $(UNZIP_H) +extract.obj: extract.c $(UNZIP_H) crypt.h +fileio.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +globals.obj: globals.c $(UNZIP_H) +inflate.obj: inflate.c inflate.h $(UNZIP_H) +list.obj: list.c $(UNZIP_H) +match.obj: match.c $(UNZIP_H) +process.obj: process.c $(UNZIP_H) +timezone.obj: timezone.c $(UNZIP_H) zip.h timezone.h +ttyio.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce.obj: unreduce.c $(UNZIP_H) +unshrink.obj: unshrink.c $(UNZIP_H) +unzip.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo.obj: zipinfo.c $(UNZIP_H) + +!ifdef USEMASM +crc_i386.obj: win32/crc_i386.asm + masm -ml win32/crc_i386.asm,$@; +!else +!ifndef ASMOVERBCC32 +crc_i386.obj: win32/crc_i386.asm + $(AS) $(ASFLAGS) win32\crc_i386.asm, $@ ; +!else +crc_i386.obj: win32/crc_i386.c + $(CC) -c $(UNFLAGS) -o$@ win32/crc_i386.c +!endif +!endif + +win32.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(UNFLAGS) win32/win32.c + +nt.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(UNFLAGS) win32/nt.c + +funzip.obj: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h + $(CC) -c $(FUFLAGS) -o$@ funzip.c + +crc32f.obj: crc32.c $(UNZIP_H) zip.h + $(CC) -c $(FUFLAGS) -o$@ crc32.c + +cryptf.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(FUFLAGS) -o$@ crypt.c + +globalsf.obj: globals.c $(UNZIP_H) + $(CC) -c $(FUFLAGS) -o$@ globals.c + +inflatef.obj: inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(FUFLAGS) -o$@ inflate.c + +ttyiof.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(FUFLAGS) -o$@ ttyio.c + +win32f.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(FUFLAGS) -o$@ win32/win32.c + +unzipsfx.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h + $(CC) -c $(SXFLAGS) -o$@ unzip.c + +crc32x.obj: crc32.c $(UNZIP_H) zip.h + $(CC) -c $(SXFLAGS) -o$@ crc32.c + +crctabx.obj: crctab.c $(UNZIP_H) zip.h + $(CC) -c $(SXFLAGS) -o$@ crctab.c + +cryptx.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(SXFLAGS) -o$@ crypt.c + +extractx.obj: extract.c $(UNZIP_H) crypt.h + $(CC) -c $(SXFLAGS) -o$@ extract.c + +fileiox.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(SXFLAGS) -o$@ fileio.c + +globalsx.obj: globals.c $(UNZIP_H) + $(CC) -c $(SXFLAGS) -o$@ globals.c + +inflatex.obj: inflate.c inflate.h $(UNZIP_H) + $(CC) -c $(SXFLAGS) -o$@ inflate.c + +matchx.obj: match.c $(UNZIP_H) + $(CC) -c $(SXFLAGS) -o$@ match.c + +processx.obj: process.c $(UNZIP_H) + $(CC) -c $(SXFLAGS) -o$@ process.c + +timezonx.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(CC) -c $(SXFLAGS) -o$@ timezone.c + +ttyiox.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(SXFLAGS) -o$@ ttyio.c + +win32x.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(SXFLAGS) -o$@ win32/win32.c + +ntx.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(SXFLAGS) -o$@ win32/nt.c + +uzexampl.obj: windll/uzexampl.c windll/uzexampl.h + $(CC) -c $(UNFLAGS) -I./windll -o$@ windll/uzexampl.c + +# DLL compilation section +api.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) -c $(DLFLAGS) -o$@ api.c + +crc32l.obj: crc32.c $(UNZIP_H) zip.h + $(CC) -c $(DLFLAGS) -o$@ crc32.c + +crctabl.obj: crctab.c $(UNZIP_H) zip.h + $(CC) -c $(DLFLAGS) -o$@ crctab.c + +cryptl.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(DLFLAGS) -o$@ crypt.c + +explodel.obj: explode.c $(UNZIP_H) + $(CC) -c $(DLFLAGS) -o$@ explode.c + +extractl.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(CC) -c $(DLFLAGS) -o$@ extract.c + +fileiol.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(DLFLAGS) -o$@ fileio.c + +globalsl.obj: globals.c $(UNZIP_H) + $(CC) -c $(DLFLAGS) -o$@ globals.c + +inflatel.obj: inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(DLFLAGS) -o$@ inflate.c + +listl.obj: list.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(DLFLAGS) -o$@ list.c + +matchl.obj: match.c $(UNZIP_H) + $(CC) -c $(DLFLAGS) -o$@ match.c + +processl.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(DLFLAGS) -o$@ process.c + +timezonl.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(CC) -c $(DLFLAGS) -o$@ timezone.c + +unreducl.obj: unreduce.c $(UNZIP_H) + $(CC) -c $(DLFLAGS) -o$@ unreduce.c + +unshrnkl.obj: unshrink.c $(UNZIP_H) + $(CC) -c $(DLFLAGS) -o$@ unshrink.c + +zipinfol.obj: zipinfo.c $(UNZIP_H) + $(CC) -c $(DLFLAGS) -o$@ zipinfo.c + +win32l.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(DLFLAGS) -o$@ win32/win32.c + +ntl.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(DLFLAGS) -o$@ win32/nt.c + +windll.obj: windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) -c $(DLFLAGS) -o$@ windll/windll.c + +windll.res: windll/windll.rc unzvers.h + $(RC) /l 0x409 /fo$@ /i windll /d WIN32 windll/windll.rc + +# SFX Lib compilation section +apig.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) -c $(SLFLAGS) -o$@ api.c + +crc32g.obj: crc32.c $(UNZIP_H) zip.h + $(CC) -c $(SLFLAGS) -o$@ crc32.c + +crctabg.obj: crctab.c $(UNZIP_H) zip.h + $(CC) -c $(SLFLAGS) -o$@ crctab.c + +cryptg.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(SLFLAGS) -o$@ crypt.c + +explodeg.obj: explode.c $(UNZIP_H) + $(CC) -c $(SLFLAGS) -o$@ explode.c + +extractg.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(CC) -c $(SLFLAGS) -o$@ extract.c + +fileiog.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(SLFLAGS) -o$@ fileio.c + +globalsg.obj: globals.c $(UNZIP_H) + $(CC) -c $(SLFLAGS) -o$@ globals.c + +inflateg.obj: inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(SLFLAGS) -o$@ inflate.c + +matchg.obj: match.c $(UNZIP_H) + $(CC) -c $(SLFLAGS) -o$@ match.c + +processg.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(SLFLAGS) -o$@ process.c + +timezong.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(CC) -c $(SLFLAGS) -o$@ timezone.c + +win32g.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(SLFLAGS) -o$@ win32/win32.c + +ntg.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(SLFLAGS) -o$@ win32/nt.c + +windllg.obj: windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) -c $(SLFLAGS) -o$@ windll/windll.c + +sfxwiz.obj: windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H) + $(CC) -c $(GXFLAGS) -o$@ windll/guisfx/sfxwiz.c + +sfxwiz.res: windll/guisfx/sfxwiz.rc + $(RC) /l 0x409 /fo$@ /i windll/guisfx /d WIN32 windll/guisfx/sfxwiz.rc + +# Static LIB compilation section +$(OB)apib.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) -c $(LBFLAGS) -o$@ api.c + +$(OB)crc32b.obj: crc32.c $(UNZIP_H) zip.h + $(CC) -c $(LBFLAGS) -o$@ crc32.c + +$(OB)crctabb.obj: crctab.c $(UNZIP_H) zip.h + $(CC) -c $(LBFLAGS) -o$@ crctab.c + +$(OB)cryptb.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(LBFLAGS) -o$@ crypt.c + +$(OB)explodeb.obj: explode.c $(UNZIP_H) + $(CC) -c $(LBFLAGS) -o$@ explode.c + +$(OB)extractb.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(CC) -c $(LBFLAGS) -o$@ extract.c + +$(OB)fileiob.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(LBFLAGS) -o$@ fileio.c + +$(OB)globalsb.obj: globals.c $(UNZIP_H) + $(CC) -c $(LBFLAGS) -o$@ globals.c + +$(OB)inflateb.obj: inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(LBFLAGS) -o$@ inflate.c + +$(OB)listb.obj: list.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(LBFLAGS) -o$@ list.c + +$(OB)matchb.obj: match.c $(UNZIP_H) + $(CC) -c $(LBFLAGS) -o$@ match.c + +$(OB)processb.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(LBFLAGS) -o$@ process.c + +$(OB)timezonb.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(CC) -c $(LBFLAGS) -o$@ timezone.c + +$(OB)unreducb.obj: unreduce.c $(UNZIP_H) + $(CC) -c $(LBFLAGS) -o$@ unreduce.c + +$(OB)unshrnkb.obj: unshrink.c $(UNZIP_H) + $(CC) -c $(LBFLAGS) -o$@ unshrink.c + +$(OB)zipinfob.obj: zipinfo.c $(UNZIP_H) + $(CC) -c $(LBFLAGS) -o$@ zipinfo.c + +$(OB)win32b.obj: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(LBFLAGS) -o$@ win32/win32.c + +$(OB)ntb.obj: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(LBFLAGS) -o$@ win32/nt.c + +$(OB)windllb.obj: windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) -c $(LBFLAGS) -o$@ windll/windll.c + +$(OBDIR): + -mkdir $@ diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.dj boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.dj --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.dj 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.dj 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,141 @@ +# Makefile for UnZip, fUnZip and UnZipSFX +# for rsxntdj 1.6beta2 (with djgpp v2.3) under Windows 95 and Windows NT. +# By E-Yen Tan. Last updated 20th January 2002. + +CC = gcc -Zwin32 +CFLAGS = -O2 -Wall -I. -DWIN32 -DASM_CRC $(LOCAL_UNZIP) +AS = gcc +ASFLAGS = -Di386 +LDFLAGS = -o ./ +LDFLAGS2 = -lalias -L. $(L_ADVAPI32) +IMPLIBS = $(ADVAPI32LIB) + +ADVAPI32 = advapi32 +ADVAPI32LIB = lib$(ADVAPI32).a +L_ADVAPI32 = -l$(ADVAPI32) + +OBJU1 = unzip.o crc_gcc.o crctab.o crypt.o envargs.o explode.o extract.o +OBJU2 = fileio.o globals.o inflate.o list.o match.o process.o ttyio.o +OBJU3 = unreduce.o unshrink.o zipinfo.o win32.o nt.o +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) +OBJX1 = unzipsf_.o crc_gcc.o crctab_.o crypt_.o extract_.o fileio_.o +OBJX2 = globals_.o inflate_.o match_.o process_.o ttyio_.o win32_.o nt_.o +OBJX = $(OBJX1) $(OBJX2) +OBJF = funzip.o crc_gcc.o cryptf.o inflatef.o globalsf.o ttyiof.o win32f.o + +UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h + +# rules + +.SUFFIXES: .c .o + +.c.o: + $(CC) -c $(CFLAGS) -o$@ $< + +.asm.o: + $(AS) $(ASFLAGS) $< + +all: unzip.exe funzip.exe unzipsfx.exe + +unzip.exe: $(OBJU) $(IMPLIBS) + $(CC) $(LDFLAGS)$@ $(OBJU) $(LDFLAGS2) + +funzip.exe: $(OBJF) $(IMPLIBS) + $(CC) $(LDFLAGS)$@ $(OBJF) $(LDFLAGS2) + +unzipsfx.exe: $(OBJX) $(IMPLIBS) + $(CC) $(LDFLAGS)$@ $(OBJX) $(LDFLAGS2) + +uzexampl.exe: uzexampl$(OBJ) + $(CC) $(LDFLAGS)$@ uzexampl$(OBJ) -lversion $(LDFLAGS2) + +$(ADVAPI32LIB): + makelib "$(windir)/system/advapi32.dll" -o ./$@ + +crctab.o: crctab.c $(UNZIP_H) zip.h +envargs.o: envargs.c $(UNZIP_H) +explode.o: explode.c $(UNZIP_H) +extract.o: extract.c $(UNZIP_H) crypt.h +fileio.o: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +globals.o: globals.c $(UNZIP_H) +inflate.o: inflate.c $(UNZIP_H) +list.o: list.c $(UNZIP_H) +match.o: match.c $(UNZIP_H) +process.o: process.c $(UNZIP_H) +ttyio.o: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce.o: unreduce.c $(UNZIP_H) +unshrink.o: unshrink.c $(UNZIP_H) +unzip.o: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo.o: zipinfo.c $(UNZIP_H) + +funzip.o: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h + $(CC) -c $(CFLAGS) -o$@ funzip.c + +uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h + $(CC) -c $(CFLAGS) -o$@ windll/uzexampl.c + +win32.o: win32/win32.c $(UNZIP_H) win32/nt.h unzvers.h + $(CC) -c $(CFLAGS) -o$@ win32/win32.c + +win32f.o: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) -DFUNZIP -o$@ win32/win32.c + +win32_.o: win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) -DSFX -o$@ win32/win32.c + +nt.o: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) -o$@ win32/nt.c + +nt_.o: win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) -DSFX -o$@ win32/nt.c + +crc_gcc.o: crc_i386.S + $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S + +crypt.o: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) -o$@ crypt.c + +cryptf.o: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) -DFUNZIP -o$@ crypt.c + +crc32f.o: crc32.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS) -DFUNZIP -o$@ crc32.c + +globalsf.o: globals.c $(UNZIP_H) + $(CC) -c $(CFLAGS) -DFUNZIP -o$@ globals.c + +inflatef.o: inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS) -DFUNZIP -o$@ inflate.c + +ttyiof.o: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) -DFUNZIP -o$@ ttyio.c + +crctab_.o: crctab.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS) -DSFX -o$@ crctab.c + +crypt_.o: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) -DSFX -o$@ crypt.c + +extract_.o: extract.c $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS) -DSFX -o$@ extract.c + +fileio_.o: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(CFLAGS) -DSFX -o$@ fileio.c + +globals_.o: globals.c $(UNZIP_H) + $(CC) -c $(CFLAGS) -DSFX -o$@ globals.c + +inflate_.o: inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS) -DSFX -o$@ inflate.c + +match_.o: match.c $(UNZIP_H) + $(CC) -c $(CFLAGS) -DSFX -o$@ match.c + +process_.o: process.c $(UNZIP_H) + $(CC) -c $(CFLAGS) -DSFX -o$@ process.c + +ttyio_.o: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) -DSFX -o$@ ttyio.c + +unzipsf_.o: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h + $(CC) -c $(CFLAGS) -DSFX -o$@ unzip.c diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.emx boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.emx --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.emx 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.emx 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,231 @@ +# Makefile for UnZip, fUnZip and UnZipSFX +# for emx 0.9d + rsxnt 1.42 / gcc under WIN32. Derived from makefile.os2 +# By E-Yen Tan and Christian Spieler. Last updated 10 February 2001. +# +# This makefile should work fine with GNU make and hopefully some others. +# Tested with Spieler's special GNU make 3.74 gnuish 16-bit version. +# +# If make does not support long command-line passing to gcc, the link step +# will fail. In this case, you have to edit the link commands to use the +# commented-out alternative that creates a link response file "by hand". + +#ifdef NOASM +#AS_FLAGS = +#else +AS_FLAGS = -DASM_CRC +#endif + +CP=copy +RM=del + +CC=gcc -Zwin32 -I. +CC_OSIZ=-O1 +CC_OTIM=-O2 -mpentium +CC_OPTS=-Wall -DWIN32 $(AS_FLAGS) $(LOCAL_UNZIP) +CFLAGS=$(CC_OTIM) $(CC_OPTS) +CFLAGSX=$(CC_OSIZ) $(CC_OPTS) -DSFX +CFLAGSF=$(CC_OTIM) $(CC_OPTS) -DFUNZIP +DLLFLAG= +AS=gcc +ASFLAGS=-Di386 +LDFLAGS=-Zsys -o ./ +LDFLAGS2=-ladvapi32 -Zsmall-conv -s +OUT=-o +OBJ=.o + +#ifdef NOASM +#CRC32=crc32 +#CRC32F=crc32f +#CRC32X=crc32_ +#else +CRC32=crc_gcc +CRC32F=crc_gcc +CRC32X=crc_gcc +#endif +OBJUS=win32$(OBJ) nt$(OBJ) +OBJXS=win32_$(OBJ) nt_$(OBJ) +OBJFS=win32f$(OBJ) +OSDEP_H=win32/w32cfg.h + + +# default settings for target dependent macros: +DIRSEP = / +AS_DIRSEP = / + +OBJU1 = unzip$(OBJ) $(CRC32)$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ) +OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) +OBJU3 = inflate$(OBJ) list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) +OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS) +OBJX1 = unzipsf_$(OBJ) $(CRC32X)$(OBJ) crctab_$(OBJ) crypt_$(OBJ) +OBJX2 = extract_$(OBJ) fileio_$(OBJ) globals_$(OBJ) inflate_$(OBJ) +OBJX3 = match_$(OBJ) process_$(OBJ) ttyio_$(OBJ) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS) +OBJF = funzip$(OBJ) $(CRC32F)$(OBJ) cryptf$(OBJ) inflatef$(OBJ) \ + globalsf$(OBJ) ttyiof$(OBJ) $(OBJFS) + +UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H) + +# rules + +.SUFFIXES: .c $(OBJ) + +.c$(OBJ): + $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ $< + +# targets + +all: unzip.exe funzip.exe unzipsfx.exe + +# This next bit is nasty, but is needed to overcome the MS-DOS command +# line limit as response files for emx's gcc seem to only work if each +# file is on a different line. DJGPP doesn't do this (if you are at all +# interested). + +unzip.exe: $(OBJU) +# @ echo off +# -@ $(RM) unzip.rsp +# @ for %f in ($(OBJU1)) do echo %f >> unzip.rsp +# @ for %f in ($(OBJU2)) do echo %f >> unzip.rsp +# @ for %f in ($(OBJU3)) do echo %f >> unzip.rsp +# @ for %f in ($(OBJU4) $(OBJUS)) do echo %f >> unzip.rsp +# $(CC) $(LDFLAGS)$@ $(DEF) @unzip.rsp $(LDFLAGS2) + $(CC) $(LDFLAGS)$@ $(DEF) $(OBJU) $(LDFLAGS2) +# @ $(RM) unzip.rsp + +funzip.exe: $(OBJF) + $(CC) $(LDFLAGS)$@ $(DEF) $(OBJF) $(LDFLAGS2) + +unzipsfx.exe: $(OBJX) +# @ echo off +# -@ $(RM) unzipsfx.rsp +# @ for %f in ($(OBJX1)) do echo %f >> unzipsfx.rsp +# @ for %f in ($(OBJX2)) do echo %f >> unzipsfx.rsp +# @ for %f in ($(OBJX3)) do echo %f >> unzipsfx.rsp +# @ for %f in ($(OBJXS)) do echo %f >> unzipsfx.rsp +# $(CC) $(LDFLAGS)$@ $(DEF) @unzipsfx.rsp $(LDFLAGS2) + $(CC) $(LDFLAGS)$@ $(DEF) $(OBJX) $(LDFLAGS2) +# @ $(RM) unzipsfx.rsp + +uzexampl.exe: uzexampl$(OBJ) + $(CC) $(LDFLAGS)$@ $(DEF) uzexampl$(OBJ) -lversion $(LDFLAGS2) + +# dependencies + +apihelp$(OBJ): apihelp.c $(UNZIP_H) unzvers.h +crc32$(OBJ): crc32.c $(UNZIP_H) zip.h +crctab$(OBJ): crctab.c $(UNZIP_H) zip.h +envargs$(OBJ): envargs.c $(UNZIP_H) +explode$(OBJ): explode.c $(UNZIP_H) +extract$(OBJ): extract.c $(UNZIP_H) crypt.h +fileio$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +globals$(OBJ): globals.c $(UNZIP_H) +inflate$(OBJ): inflate.c $(UNZIP_H) +list$(OBJ): list.c $(UNZIP_H) +match$(OBJ): match.c $(UNZIP_H) +process$(OBJ): process.c $(UNZIP_H) +ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce$(OBJ): unreduce.c $(UNZIP_H) +unshrink$(OBJ): unshrink.c $(UNZIP_H) +unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +api$(OBJ): api.c $(UNZIP_H) unzvers.h +zipinfo$(OBJ): zipinfo.c $(UNZIP_H) + +funzip$(OBJ): funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h # funzip only + $(CC) -c $(CFLAGS) $(OUT)$@ funzip.c + +unzipstb$(OBJ): unzipstb.c # DLL version + $(CC) -c $(CFLAGS) $(OUT)$@ unzipstb.c + +uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h # WINDLL example + $(CC) -c $(CFLAGS) $(OUT)$@ windll/uzexampl.c + +win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h unzvers.h # win32 only + $(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)win32.c + +win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # win32 funzip + $(CC) -c $(CFLAGSF) $(OUT)$@ win32$(DIRSEP)win32.c + +win32_$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # win32 unzipsfx + $(CC) -c $(CFLAGSX) $(OUT)$@ win32$(DIRSEP)win32.c + +nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # win32 only + $(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)nt.c + +nt_$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # win32 only + $(CC) -c $(CFLAGSX) $(OUT)$@ win32$(DIRSEP)nt.c + +os2$(OBJ): os2/os2.c $(UNZIP_H) unzvers.h # OS/2 only + $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2.c + +os2_$(OBJ): os2/os2.c $(UNZIP_H) # OS/2 unzipsfx + $(CC) -c $(CFLAGSX) $(OUT)$@ os2$(DIRSEP)os2.c + +os2acl$(OBJ): os2/os2acl.c $(UNZIP_H) unzvers.h # OS/2 only + $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2acl.c + +rexxhelp$(OBJ): os2/rexxhelp.c # OS/2 DLL only + $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxhelp.c + +rexxapi$(OBJ): os2/rexxapi.c # OS/2 DLL only + $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxapi.c + +crc_i86$(OBJ): msdos/crc_i86.asm # 16bit only + $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL) + +crc_i386$(OBJ): win32/crc_i386.asm # 32bit, MASM + $(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL) + +crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS + $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S + +crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ crypt.c + +cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + $(CC) -c $(CFLAGSF) $(OUT)$@ crypt.c + +crc32f$(OBJ): crc32.c $(UNZIP_H) zip.h # funzip only + $(CC) -c $(CFLAGSF) $(OUT)$@ crc32.c + +globalsf$(OBJ): globals.c $(UNZIP_H) # funzip only + $(CC) -c $(CFLAGSF) $(OUT)$@ globals.c + +inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only + $(CC) -c $(CFLAGSF) $(OUT)$@ inflate.c + +ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + $(CC) -c $(CFLAGSF) $(OUT)$@ ttyio.c + +crc32_$(OBJ): crc32.c $(UNZIP_H) zip.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ crc32.c + +crctab_$(OBJ): crctab.c $(UNZIP_H) zip.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ crctab.c + +crypt_$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ crypt.c + +extract_$(OBJ): extract.c $(UNZIP_H) crypt.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ extract.c + +fileio_$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ fileio.c + +globals_$(OBJ): globals.c $(UNZIP_H) # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ globals.c + +inflate_$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ inflate.c + +match_$(OBJ): match.c $(UNZIP_H) # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ match.c + +process_$(OBJ): process.c $(UNZIP_H) # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ process.c + +ttyio_$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ ttyio.c + +unzipsf_$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only + $(CC) -c $(CFLAGSX) $(OUT)$@ unzip.c diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.gcc boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.gcc --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.gcc 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.gcc 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,454 @@ +# Makefile for UnZip, fUnZip and UnZipSFX for native Win32-Intel ports of gcc. +# Currently supported implementations: Cygnus/Win32 and MinGW32. +# +# First version: Cosmin Truta , Dec 1997. +# Last revision: Christian Spieler, 10-Nov-2001 +# +# To use, do "make -f win32/makefile.gcc". + + +### Optional section + +# Optional nonstandard preprocessor flags (as -DUSE_ZLIB or -DUSE_SMITH_CODE) +# should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added +# to the declaration of LOCFLAGS here: +LOCFLAGS = $(LOCAL_UNZIP) + + +### Compiler-specific section + +# ------------ GNU C ------------ +CC = gcc + +#AS = as +AS = $(CC) + +#LD = ld +LD = $(CC) + +AR = ar + +RC = windres + +# Quiet +CC_QUIET_OPT = +AS_QUIET_OPT = $(CC_QUIET_OPT) +LD_QUIET_OPT = $(CC_QUIET_OPT) + +# Warnings +CC_WARN_OPT = -Wall +AS_WARN_OPT = $(CC_WARN_OPT) +LD_WARN_OPT = + +# Debug version +CC_DEBUG_OPT = -g +AS_DEBUG_OPT = $(CC_DEBUG_OPT) +LD_DEBUG_OPT = $(CC_DEBUG_OPT) + +# Release version +CC_RELEASE_OPT = +AS_RELEASE_OPT = +LD_RELEASE_OPT = -s + +# Prefered target CPU (instruction scheduling optimized for...) +#ifndef CC_CPU_OPT +CC_CPU_OPT = -mcpu=pentium +#endif + +# Smallest code (-Os is new since EGC 1.1, use -O1 for 2.8.1 and earlier) +CC_SIZE_OPT = -Os $(CC_CPU_OPT) + +# Fastest code +CC_SPEED_OPT = -O2 $(CC_CPU_OPT) + +# Output object file name +CC_OUT_OPT = -o + +# Other specific options +CC_SPECIFIC_OPT = -c -DASM_CRC -DWIN32 +AS_SPECIFIC_OPT = -c +LD_SPECIFIC_OPT = -o $@ + +# Libraries for the debug & release version +# (GCC 2.95 and newer does not require the following library specifications) +LD_RELEASE_LIBS = -luser32 -ladvapi32 +LD_DEBUG_LIBS = $(LD_RELEASE_LIBS) + + +### System-specific section + +# Suffixes +OBJ = .o +EXE = .exe + +.SUFFIXES: .c .S $(OBJ) $(EXE) + +# Commands +RM = rm -f + + +### General section + +CFLAGS = $(CC_SPECIFIC_OPT) $(CC_QUIET_OPT) $(CC_WARN_OPT) $(LOCFLAGS) \ + $(CC_OUT_OPT) $@ +ASFLAGS = $(AS_SPECIFIC_OPT) $(AS_QUIET_OPT) $(AS_WARN_OPT) $(LOCFLAGS) +LDFLAGS = $(LD_SPECIFIC_OPT) $(LD_QUIET_OPT) $(LD_WARN_OPT) + +# To build with debug info, use 'make DEBUG=1'. +ifdef DEBUG +CVER = $(CC_DEBUG_OPT) +ASVER = $(AS_DEBUG_OPT) +LDVER = $(LD_DEBUG_OPT) +GENFLAGS = +FFLAGS = -DFUNZIP +SFXFLAGS = -DSFX +GENDLLFL = -DDLL -DWINDLL +GENGUILB = -DSFX -DDLL -DWINDLL -DUNZIPLIB +GENGUISX = -DSFX +GENLIBFL = -DDLL -DWINDLL -DUNZIPLIB +LDLIBS = $(LD_DEBUG_LIBS) +else +CVER = $(CC_RELEASE_OPT) +ASVER = $(AS_RELEASE_OPT) +LDVER = $(LD_RELEASE_OPT) +GENFLAGS = $(CC_SPEED_OPT) +FFLAGS = $(CC_SPEED_OPT) -DFUNZIP +SFXFLAGS = $(CC_SIZE_OPT) -DSFX +GENDLLFL = $(CC_SPEED_OPT) -DDLL -DWINDLL +GENGUILB = $(CC_SIZE_OPT) -DSFX -DDLL -DWINDLL -DUNZIPLIB +GENGUISX = $(CC_SIZE_OPT) -DSFX +GENLIBFL = $(CC_SPEED_OPT) -DDLL -DWINDLL -DUNZIPLIB +LDLIBS = $(LD_RELEASE_LIBS) +endif +GUILDFLAG=-mwindows + +# Object files +OBJA = crc_i386$(OBJ) +OBJU1 = unzip$(OBJ) crc32$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ) +OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) inflate$(OBJ) +OBJU3 = list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) unreduce$(OBJ) +OBJU4 = unshrink$(OBJ) zipinfo$(OBJ) +OBJUS = win32$(OBJ) nt$(OBJ) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJA) $(OBJUS) +OBJX1 = unzipsfx$(OBJ) crc32x$(OBJ) crctabx$(OBJ) cryptx$(OBJ) extractx$(OBJ) +OBJX2 = fileiox$(OBJ) globalsx$(OBJ) inflatex$(OBJ) matchx$(OBJ) processx$(OBJ) +OBJX3 = ttyiox$(OBJ) +OBJXS = win32x$(OBJ) ntx$(OBJ) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJA) $(OBJXS) +OBJF1 = funzip$(OBJ) crc32$(OBJ) cryptf$(OBJ) globalsf$(OBJ) inflatef$(OBJ) +OBJF2 = ttyiof$(OBJ) +OBJFS = win32f$(OBJ) +OBJF = $(OBJF1) $(OBJF2) $(OBJA) $(OBJFS) +OBJDLL = windll$(OBJ) windllrc$(OBJ) api$(OBJ) +OBJD1 = crc32l$(OBJ) crctabl$(OBJ) cryptl$(OBJ) +OBJD2 = explodel$(OBJ) extractl$(OBJ) fileiol$(OBJ) globalsl$(OBJ) +OBJD3 = inflatel$(OBJ) listl$(OBJ) matchl$(OBJ) processl$(OBJ) +OBJD4 = unreducl$(OBJ) unshrnkl$(OBJ) zipinfol$(OBJ) +OBJDS = win32l$(OBJ) ntl$(OBJ) +OBJD = $(OBJDLL) $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJA) $(OBJDS) +OBLX1 = apig$(OBJ) crc32g$(OBJ) crctabg$(OBJ) cryptg$(OBJ) +OBLX2 = extractg$(OBJ) fileiog$(OBJ) globalsg$(OBJ) inflateg$(OBJ) +OBLX3 = matchg$(OBJ) processg$(OBJ) +OBLXS = win32g$(OBJ) ntg$(OBJ) windllg$(OBJ) +OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBJA) $(OBLXS) +OBGX = sfxwiz$(OBJ) sfxwizrc$(OBJ) +OBJLIB = windllb$(OBJ) apib$(OBJ) +OBJB1 = crc32b$(OBJ) crctabb$(OBJ) cryptb$(OBJ) +OBJB2 = explodeb$(OBJ) extractb$(OBJ) fileiob$(OBJ) globalsb$(OBJ) +OBJB3 = inflateb$(OBJ) listb$(OBJ) matchb$(OBJ) processb$(OBJ) +OBJB4 = unreducb$(OBJ) unshrnkb$(OBJ) zipinfob$(OBJ) +OBJBS = win32b$(OBJ) ntb$(OBJ) +OBJB = $(OBJLIB) $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJA) $(OBJBS) + +UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h +WINDLL_H = windll/windll.h windll/structs.h windll/decs.h +DLLDEF = windll/windllgcc.def +WINDLL_IMP_H = windll/decs.h windll/structs.h + + +# Default target is all the executables +unzips: unzip$(EXE) funzip$(EXE) unzipsfx$(EXE) +dll: unzip32.dll +dllsample: uzexampl.exe +guisfx: SFXWiz32.exe +lib: libunzip32.a +all: unzips dll dllsample guisfx lib + +unzip$(EXE): $(OBJU) + $(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LDLIBS) + +unzipsfx$(EXE): $(OBJX) + $(LD) $(LDFLAGS) $(LDVER) $(OBJX) $(LDLIBS) + +funzip$(EXE): $(OBJF) + $(LD) $(LDFLAGS) $(LDVER) $(OBJF) $(LDLIBS) + +unzip32.dll: $(DLLDEF) $(OBJD) + dllwrap --driver-name $(CC) --def $(DLLDEF) $(LDFLAGS) $(LDVER) $(OBJD) $(LDLIBS) + +libunzsfx32.a: $(OBLX) + $(AR) -rus $@ $(OBLX) + +SFXWiz32$(EXE): $(OBGX) libunzsfx32.a + $(LD) $(GUILDFLAG) $(LDFLAGS) $(LDVER) $(OBGX) -L. -lunzsfx32 $(LDLIBS) + +uzexampl$(EXE): uzexampl$(OBJ) + $(CC) $(LDFLAGS) $(LDVER) uzexampl$(OBJ) -lversion $(LDLIBS) + +libunzip32.a: $(OBJB) + $(AR) -rus $@ $(OBJB) + + +# How to compile sources +.c$(OBJ): + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $< +.S$(OBJ): + $(AS) $(ASFLAGS) $(ASVER) $(GENFLAGS) $< + +# Dependencies +crc32$(OBJ): crc32.c $(UNZIP_H) zip.h +crctab$(OBJ): crctab.c $(UNZIP_H) zip.h +crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h +envargs$(OBJ): envargs.c $(UNZIP_H) +explode$(OBJ): explode.c $(UNZIP_H) +extract$(OBJ): extract.c $(UNZIP_H) crypt.h +fileio$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +funzip$(OBJ): funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h +globals$(OBJ): globals.c $(UNZIP_H) +inflate$(OBJ): inflate.c inflate.h $(UNZIP_H) +list$(OBJ): list.c $(UNZIP_H) +match$(OBJ): match.c $(UNZIP_H) +process$(OBJ): process.c $(UNZIP_H) +ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce$(OBJ): unreduce.c $(UNZIP_H) +unshrink$(OBJ): unshrink.c $(UNZIP_H) +unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo$(OBJ): zipinfo.c $(UNZIP_H) +crc_i386$(OBJ): crc_i386.S + +win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. win32/win32.c + +nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. win32/nt.c + +win32x$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. win32/win32.c + +ntx$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. win32/nt.c + +win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # funzip only + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. win32/win32.c + +crc32x$(OBJ): crc32.c $(UNZIP_H) zip.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) crc32.c + +crctabx$(OBJ): crctab.c $(UNZIP_H) zip.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) crctab.c + +cryptx$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) crypt.c + +cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) crypt.c + +extractx$(OBJ): extract.c $(UNZIP_H) crypt.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) extract.c + +fileiox$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) fileio.c + +globalsx$(OBJ): globals.c $(UNZIP_H) # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) globals.c + +globalsf$(OBJ): globals.c $(UNZIP_H) # funzip only + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) globals.c + +inflatex$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) inflate.c + +inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) inflate.c + +matchx$(OBJ): match.c $(UNZIP_H) # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) match.c + +processx$(OBJ): process.c $(UNZIP_H) # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) process.c + +ttyiox$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) ttyio.c + +ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only + $(CC) $(CFLAGS) $(CVER) $(FFLAGS) ttyio.c + +unzipsfx$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only + $(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) unzip.c + +uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h # WINDLL sample + $(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. windll/uzexampl.c + +# DLL compilation section +api$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) api.c + +crc32l$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) crc32.c + +crctabl$(OBJ): crctab.c $(UNZIP_H) zip.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) crctab.c + +cryptl$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) crypt.c + +explodel$(OBJ): explode.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) explode.c + +extractl$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) extract.c + +fileiol$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) fileio.c + +globalsl$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) globals.c + +inflatel$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) inflate.c + +listl$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) list.c + +matchl$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) match.c + +processl$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) process.c + +unreducl$(OBJ): unreduce.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) unreduce.c + +unshrnkl$(OBJ): unshrink.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) unshrink.c + +zipinfol$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) zipinfo.c + +win32l$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. win32/win32.c + +ntl$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. win32/nt.c + +windll$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. windll/windll.c + +windllrc$(OBJ): windll/windll.rc unzvers.h + - $(RC) -o $@ windll/windll.rc + +# SFX Lib compilation section +apig$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) api.c + +crc32g$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) crc32.c + +crctabg$(OBJ): crctab.c $(UNZIP_H) zip.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) crctab.c + +cryptg$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) crypt.c + +extractg$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) extract.c + +fileiog$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) fileio.c + +globalsg$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) globals.c + +inflateg$(OBJ): inflate.c inflate.h $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) inflate.c + +matchg$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) match.c + +processg$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) process.c + +win32g$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. win32/win32.c + +ntg$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. win32/nt.c + +windllg$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENGUILB) windll/windll.c + +sfxwiz$(OBJ): windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H) + $(CC) $(CFLAGS) $(CVER) $(GENGUISX) -I. windll/guisfx/sfxwiz.c + +sfxwizrc$(OBJ): windll/guisfx/sfxwiz.rc + - $(RC) --include-dir windll/guisfx --define WIN32 -o$@ \ + windll/guisfx/sfxwiz.rc + +# Static LIB compilation section +apib$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) api.c + +crc32b$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) crc32.c + +crctabb$(OBJ): crctab.c $(UNZIP_H) zip.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) crctab.c + +cryptb$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) crypt.c + +explodeb$(OBJ): explode.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) explode.c + +extractb$(OBJ): extract.c $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) extract.c + +fileiob$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) fileio.c + +globalsb$(OBJ): globals.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) globals.c + +inflateb$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) inflate.c + +listb$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) list.c + +matchb$(OBJ): match.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) match.c + +processb$(OBJ): process.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) process.c + +unreducb$(OBJ): unreduce.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) unreduce.c + +unshrnkb$(OBJ): unshrink.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) unshrink.c + +zipinfob$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) zipinfo.c + +win32b$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. win32/win32.c + +ntb$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. win32/nt.c + +windllb$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. windll/windll.c + +clean: + $(RM) *$(OBJ) + $(RM) *$(EXE) diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.lcc boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.lcc --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.lcc 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.lcc 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,335 @@ +# Makefile for UnZip, fUnZip and UnZipSFX using LCC-Win32. +# By E-Yen Tan (3 June 1998). +# Last updated 27 December 2001 (Christian Spieler). +# +# This version includes rules to build the 32-bit windll DLL. + +# This compiler evaluates #include locations relative to current working dir, +# not relative to the location of the file containing the #include directive. +# As a consequence, a "-Iwin32" option is required to allow compilation of +# the WIN32 specific sources. + +CC=lcc +CCFLAGS=-Zp8 -O -DWIN32 $(AS_FLAGS) +#DLLFLAG= +DLLFLAG=-DWINDLL -DDLL -I./windll +AS=lcc +ASFLAGS= +LD = lcclnk +#DLLLDFLAG= +DLLLDFLAG=-dll -entry DllMain +LDFLAGS=-s -o ./ +LDFLAGS2= +OUT=-Fo +OBJ=.obj + +CP=copy +RM=del + +# Optional macros should be declared below. +# (LCC's Make is unable to read the LOCAL_UNZIP environment variable.) +LOC = $(ASMFLG) + +# Options to select optimized assembler code for CRC32 calculation. +#ifdef NOASM +#ASMFLG= +#CRC32=crc32 +#CRC32F=crc32f +#CRC32L=crc32l +#CRC32G=crc32g +#CRC32X=crc32_ +#else +ASMFLG=-DASM_CRC +CRC32=crc_lcc +CRC32F=crc_lcc +CRC32L=crc_lcc +CRC32G=crc_lcc +CRC32X=crc_lcc +#endif + +CFLAGS = $(CCFLAGS) $(LOC) + +CFLAGS_UN = $(CFLAGS) +CFLAGS_SX = $(CFLAGS) -DSFX +CFLAGS_FU = $(CFLAGS) -DFUNZIP +CFLAGS_DL = $(CFLAGS) $(DLLFLAG) +CFLAGS_SL = $(CFLAGS) $(DLLFLAG) -DUNZIPLIB -DSFX +CFLAGS_GX = $(CFLAGS) -I./windll -I./windll/guisfx -DSFX + + +# The system specific files are defined here: +OBJUS=win32$(OBJ) nt$(OBJ) +OBJXS=win32_$(OBJ) nt_$(OBJ) +OBJFS=win32f$(OBJ) +OBJDS=win32l$(OBJ) ntl$(OBJ) +OBLXS=win32g$(OBJ) ntg$(OBJ) windllg$(OBJ) +OSDEP_H=win32/w32cfg.h +WINDLL_H=windll/windll.h windll/structs.h windll/decs.h +DLLDEF=.\windll\windll_lc.def # lcclink requires backslashes as dir-sep!! +WINDLL_IMP_H = windll/decs.h windll/structs.h + + +OBJU1 = unzip$(OBJ) $(CRC32)$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ) +OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) +OBJU3 = inflate$(OBJ) list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) +OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS) +OBJX1 = unzipsf_$(OBJ) $(CRC32X)$(OBJ) crctab_$(OBJ) crypt_$(OBJ) +OBJX2 = extract_$(OBJ) fileio_$(OBJ) globals_$(OBJ) inflate_$(OBJ) +OBJX3 = match_$(OBJ) process_$(OBJ) ttyio_$(OBJ) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS) +OBJF = funzip$(OBJ) $(CRC32F)$(OBJ) cryptf$(OBJ) inflatef$(OBJ) \ + globalsf$(OBJ) ttyiof$(OBJ) $(OBJFS) +OBJDLL = windll$(OBJ) windll32.res api$(OBJ) +OBJD1 = $(CRC32L)$(OBJ) crctabl$(OBJ) cryptl$(OBJ) +OBJD2 = explodel$(OBJ) extractl$(OBJ) fileiol$(OBJ) globalsl$(OBJ) +OBJD3 = inflatel$(OBJ) listl$(OBJ) matchl$(OBJ) processl$(OBJ) +OBJD4 = unreducl$(OBJ) unshrnkl$(OBJ) zipinfol$(OBJ) +OBJD = $(OBJDLL) $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS) +OBLX1 = apig$(OBJ) $(CRC32G)$(OBJ) crctabg$(OBJ) cryptg$(OBJ) +OBLX2 = extractg$(OBJ) fileiog$(OBJ) globalsg$(OBJ) inflateg$(OBJ) +OBLX3 = matchg$(OBJ) processg$(OBJ) +OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBLXS) +OBGX = sfxwiz$(OBJ) + +UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H) + +# rules + +.SUFFIXES: .c $(OBJ) + +.c$(OBJ): + $(CC) -c $(CFLAGS_UN) $(OUT)$@ $< + +.asm$(OBJ): + $(AS) $(ASFLAGS) $(OUT)$@ $< + +# targets + +unzips: unzip.exe funzip.exe unzipsfx.exe +dll: unzip32.dll +dllsample: uzexampl.exe +guisfx: SFXWiz32.exe +all: unzips dll dllsample guisfx + +unzip.exe: $(OBJU) + $(LD) $(LDFLAGS)$@ $(DEF) $(OBJU) $(LDFLAGS2) + +funzip.exe: $(OBJF) + $(LD) $(LDFLAGS)$@ $(DEF) $(OBJF) $(LDFLAGS2) + +unzipsfx.exe: $(OBJX) + $(LD) $(LDFLAGS)$@ $(DEF) $(OBJX) $(LDFLAGS2) + +unzip32.dll: $(DLLDEF) $(OBJD) + $(LD) $(DLLLDFLAG) $(LDFLAGS)$@ $(DLLDEF) $(OBJD) $(LDFLAGS2) + +unzsfx32.lib: $(OBLX) + lcclib $@ $(OBLX) + +SFXWiz32.exe: $(OBGX) sfxwiz.res unzsfx32.lib + $(LD) -subsystem windows $(LDFLAGS)$@ \ + $(OBGX) sfxwiz.res unzsfx32.lib + +uzexampl.exe: uzexampl$(OBJ) + $(LD) $(LDFLAGS)$@ $(DEF) uzexampl$(OBJ) version.lib $(LDFLAGS2) + +# dependencies + +api$(OBJ): api.c $(UNZIP_H) unzvers.h +apihelp$(OBJ): apihelp.c $(UNZIP_H) unzvers.h +crc32$(OBJ): crc32.c $(UNZIP_H) zip.h +crctab$(OBJ): crctab.c $(UNZIP_H) zip.h +envargs$(OBJ): envargs.c $(UNZIP_H) +explode$(OBJ): explode.c $(UNZIP_H) +extract$(OBJ): extract.c $(UNZIP_H) crypt.h +fileio$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +globals$(OBJ): globals.c $(UNZIP_H) +inflate$(OBJ): inflate.c $(UNZIP_H) +list$(OBJ): list.c $(UNZIP_H) +match$(OBJ): match.c $(UNZIP_H) +process$(OBJ): process.c $(UNZIP_H) +ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +unreduce$(OBJ): unreduce.c $(UNZIP_H) +unshrink$(OBJ): unshrink.c $(UNZIP_H) +unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +zipinfo$(OBJ): zipinfo.c $(UNZIP_H) + +funzip$(OBJ): funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h + $(CC) -c $(CFLAGS) $(OUT)$@ funzip.c + +uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h + $(CC) -c $(CFLAGS_UN) -I./windll $(OUT)$@ windll/uzexampl.c + +win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h unzvers.h + $(CC) -c $(CFLAGS_UN) -Iwin32 $(OUT)$@ win32/win32.c + +nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_UN) -Iwin32 $(OUT)$@ win32/nt.c + +crc_lcc$(OBJ): win32/crc_lcc.asm + $(AS) $(ASFLAGS) $(OUT)$@ win32/crc_lcc.asm + +crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_UN) $(OUT)$@ crypt.c + +crc32f$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_FU) $(OUT)$@ crc32.c + +cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_FU) $(OUT)$@ crypt.c + +globalsf$(OBJ): globals.c $(UNZIP_H) + $(CC) -c $(CFLAGS_FU) $(OUT)$@ globals.c + +inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS_FU) $(OUT)$@ inflate.c + +ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_FU) $(OUT)$@ ttyio.c + +win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_FU) -Iwin32 $(OUT)$@ win32/win32.c + +crc32_$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ crc32.c + +crctab_$(OBJ): crctab.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ crctab.c + +crypt_$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ crypt.c + +extract_$(OBJ): extract.c $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ extract.c + +fileio_$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ fileio.c + +globals_$(OBJ): globals.c $(UNZIP_H) + $(CC) -c $(CFLAGS_SX) $(OUT)$@ globals.c + +inflate_$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ inflate.c + +match_$(OBJ): match.c $(UNZIP_H) + $(CC) -c $(CFLAGS_SX) $(OUT)$@ match.c + +process_$(OBJ): process.c $(UNZIP_H) + $(CC) -c $(CFLAGS_SX) $(OUT)$@ process.c + +ttyio_$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ ttyio.c + +unzipsf_$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h + $(CC) -c $(CFLAGS_SX) $(OUT)$@ unzip.c + +win32_$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_SX) -Iwin32 $(OUT)$@ win32/win32.c + +nt_$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_SX) -Iwin32 $(OUT)$@ win32/nt.c + +# DLL compilation section +api$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ api.c + +crc32l$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ crc32.c + +crctabl$(OBJ): crctab.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ crctab.c + +cryptl$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ crypt.c + +explodel$(OBJ): explode.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ explode.c + +extractl$(OBJ): extract.c $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ extract.c + +fileiol$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ fileio.c + +globalsl$(OBJ): globals.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ globals.c + +inflatel$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ inflate.c + +listl$(OBJ): list.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ list.c + +matchl$(OBJ): match.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ match.c + +processl$(OBJ): process.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ process.c + +unreducl$(OBJ): unreduce.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ unreduce.c + +unshrnkl$(OBJ): unshrink.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ unshrink.c + +zipinfol$(OBJ): zipinfo.c $(UNZIP_H) + $(CC) -c $(CFLAGS_DL) $(OUT)$@ zipinfo.c + +win32l$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_DL) -Iwin32 $(OUT)$@ win32/win32.c + +ntl$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_DL) -Iwin32 $(OUT)$@ win32/nt.c + +windll$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) -c $(CFLAGS_DL) $(OUT)$@ windll/windll.c + +windll32.res: windll/windll.rc unzvers.h + - lrc -v -m -r $(DLLFLAG) -DWIN32 -o$@ windll/windll.rc + +# SFX Lib compilation section +apig$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ api.c + +crc32g$(OBJ): crc32.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ crc32.c + +crctabg$(OBJ): crctab.c $(UNZIP_H) zip.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ crctab.c + +cryptg$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ crypt.c + +extractg$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ extract.c + +fileiog$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ fileio.c + +globalsg$(OBJ): globals.c $(UNZIP_H) + $(CC) -c $(CFLAGS_SL) $(OUT)$@ globals.c + +inflateg$(OBJ): inflate.c inflate.h $(UNZIP_H) + $(CC) -c $(CFLAGS_SL) $(OUT)$@ inflate.c + +matchg$(OBJ): match.c $(UNZIP_H) + $(CC) -c $(CFLAGS_SL) $(OUT)$@ match.c + +processg$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) + $(CC) -c $(CFLAGS_SL) $(OUT)$@ process.c + +win32g$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_SL) -Iwin32 $(OUT)$@ win32/win32.c + +ntg$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h + $(CC) -c $(CFLAGS_SL) -Iwin32 $(OUT)$@ win32/nt.c + +windllg$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h + $(CC) -c $(CFLAGS_SL) $(OUT)$@ windll/windll.c + +sfxwiz$(OBJ): windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H) + $(CC) -c $(CFLAGS_GX) $(OUT)$@ windll/guisfx/sfxwiz.c + +sfxwiz.res: windll/guisfx/sfxwiz.rc + - lrc -v -m -r -Iwindll/guisfx -DWIN32 -o$@ windll/guisfx/sfxwiz.rc diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.wat boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.wat --- boinc-7.0.7+dfsg/zip/unzip/win32/Makefile.wat 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/Makefile.wat 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,307 @@ +# WMAKE makefile for Windows 95 and Windows NT (Intel only) +# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 17 Feb 02. +# Makes UnZip.exe, fUnZip.exe, and UnZipSFX.exe. +# +# Invoke from UnZip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]" +# To build with debug info use "WMAKE DEBUG=1 ..." +# To build with no assembly modules use "WMAKE NOASM=1 ..." +# To support unshrinking use "WMAKE LAWSUIT=1 ..." +# To support unreducing, get the real unreduce.c and go "WMAKE OFFEND_RMS=1 ..." +# To use Info-Zip's generic timezone functions use "WMAKE USE_IZTIMEZONE=1 ..." +# +# Other options to be fed to the compiler can be specified in an environment +# variable called LOCAL_UNZIP. + +variation = $(%LOCAL_UNZIP) + +# Stifle annoying "Delete this file?" questions when errors occur: +.ERASE + +.EXTENSIONS: +.EXTENSIONS: .exe .obj .obx .c .h .asm + +# We maintain multiple sets of object files in different directories so that +# we can compile msdos, dos/4gw or pmode/w, and win32 versions of UnZip without +# their object files interacting. The following var must be a directory name +# ending with a backslash. All object file names must include this macro +# at the beginning, for example "$(O)foo.obj". + +!ifdef DEBUG +OBDIR = od32w +!else +OBDIR = ob32w +!endif +O = $(OBDIR)\ # comment here so backslash won't continue the line + +!ifdef LAWSUIT +cvars = $+$(cvars)$- -DUSE_UNSHRINK +avars = $+$(avars)$- -DUSE_UNSHRINK +# "$+$(foo)$-" means expand foo as it has been defined up to now; normally, +# this Make defers inner expansion until the outer macro is expanded. +!endif +!ifdef OFFEND_RMS +cvars = $+$(cvars)$- -DUSE_SMITH_CODE +avars = $+$(avars)$- -DUSE_SMITH_CODE +!endif + +!ifndef USE_IZTIMEZONE +#default: do not use the IZ timezone replacement +USE_IZTIMEZONE=0 +!endif + +# The assembly hot-spot code in crc_i386.asm is optional. This section +# controls its usage. + +!ifdef NOASM +crcob = $(O)crc32.obj +!else # !NOASM +cvars = $+$(cvars)$- -DASM_CRC +crcob = $(O)crc_i386.obj +!endif + +!if $(USE_IZTIMEZONE) != 0 +cvars = $+$(cvars)$- -DW32_USE_IZ_TIMEZONE +TIMEZONE_OBJU = $(O)timezone.obj +TIMEZONE_OBJX = $(O)timezone.obx +TIMEZONE_OBJD = $(O)timezonl.obj +TIMEZONE_OBLX = $(O)timezolx.obj +TIMEZONE_OBJB = $(O)timezonb.obj +!else +TIMEZONE_OBJU = +TIMEZONE_OBJX = +TIMEZONE_OBJD = +TIMEZONE_OBLX = +TIMEZONE_OBJB = +!endif + +# Our object files. OBJU is for UnZip, OBJX for UnZipSFX, OBJF for fUnZip: + +OBJU1 = $(O)unzip.obj $(crcob) $(O)crctab.obj $(O)crypt.obj $(O)envargs.obj +OBJU2 = $(O)explode.obj $(O)extract.obj $(O)fileio.obj $(O)globals.obj +OBJU3 = $(O)inflate.obj $(O)list.obj $(O)match.obj $(O)process.obj +OBJU4 = $(O)ttyio.obj $(O)unreduce.obj $(O)unshrink.obj $(O)zipinfo.obj +OBJUS = $(O)win32.obj $(O)nt.obj $(TIMEZONE_OBJU) +OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS) + +OBJX1 = $(O)unzip.obx $(crcob) $(O)crctab.obx $(O)crypt.obx $(O)extract.obx +OBJX2 = $(O)fileio.obx $(O)globals.obx $(O)inflate.obx $(O)match.obx +OBJX3 = $(O)process.obx $(O)ttyio.obx +OBJXS = $(O)win32.obx $(O)nt.obx $(TIMEZONE_OBJX) +OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS) + +OBJF1 = $(O)funzip.obj $(crcob) $(O)cryptf.obj $(O)globalsf.obj +OBJF2 = $(O)inflatef.obj $(O)ttyiof.obj +OBJFS = $(O)win32f.obj +OBJF = $(OBJF1) $(OBJF2) $(OBJFS) + +OBJD1 = $(O)api.obj $(crcob) $(O)crctabl.obj $(O)cryptl.obj $(O)explodel.obj +OBJD2 = $(O)extractl.obj $(O)fileiol.obj $(O)globalsl.obj $(O)inflatel.obj +OBJD3 = $(O)listl.obj $(O)matchl.obj $(O)processl.obj +OBJD4 = $(O)unreducl.obj $(O)unshrnkl.obj $(O)zipinfol.obj +OBJDS = $(O)win32l.obj $(O)ntl.obj $(O)windll.obj $(TIMEZONE_OBJD) +OBJD = $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS) + +UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h +WINDLL_H = windll/windll.h windll/decs.h windll/structs.h +WINDLL_DEF = windll/windll32.def +WINDLL_IMP_H = windll/decs.h windll/structs.h + +# Now we have to pick out the proper compiler and options for it. + +cc = wcc386 +link = wlink +asm = wasm +# Use Pentium Pro timings, register args, static strings in code, high strictness: +cflags = -bt=NT -6r -zt -zq -wx +aflags = -bt=NT -mf -3 -zq +lflags = sys NT +lflags_dll = sys NT_DLL +cvars = $+$(cvars)$- -DWIN32 $(variation) +avars = $+$(avars)$- $(variation) + +# Specify optimizations, or a nonoptimized debugging version: + +!ifdef DEBUG +cdebug = -od -d2 +cdebux = -od -d2 +ldebug = d w all op symf +!else +cdebug = -s -obhikl+rt -oe=100 -zp8 +cdebux = -s -obhiklrs +# -oa helps slightly but might be dangerous. +ldebug = op el +!endif + +CFLAGS_FU = $(cdebug) $(cflags) $(cvars) -DFUNZIP +CFLAGS_DL = $(cdebug) $(cflags) $(cvars) -bd -bm -DWINDLL -DDLL + +# How to compile sources: +.c.obx: + $(cc) $(cdebux) $(cflags) $(cvars) -DSFX $[@ -fo=$@ + +.c.obj: + $(cc) $(cdebug) $(cflags) $(cvars) $[@ -fo=$@ + +# Here we go! By default, make all targets: +all: UnZip.exe fUnZip.exe UnZipSFX.exe + +# Convenient shorthand options for single targets: +u: UnZip.exe .SYMBOLIC +f: fUnZip.exe .SYMBOLIC +x: UnZipSFX.exe .SYMBOLIC +d: UnZip32.dll .SYMBOLIC + +UnZip.exe: $(OBDIR) $(OBJU) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJU)} + +UnZipSFX.exe: $(OBDIR) $(OBJX) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJX)} + +fUnZip.exe: $(OBDIR) $(OBJF) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJF)} + +UnZip32.dll: $(OBDIR) $(OBJD) + $(link) $(lflags_dll) $(ldebug) name $@ file {$(OBJD)} + +uzexampl.exe: $(OBDIR) $(O)uzexampl.obj + $(link) $(lflags) $(ldebug) name $@ file {$(O)uzexampl.obj} + +# Source dependencies: + +# generic (UnZip, fUnZip): + +$(O)crc32.obj: crc32.c $(UNZIP_H) zip.h +$(O)crctab.obj: crctab.c $(UNZIP_H) zip.h +$(O)crypt.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h +$(O)envargs.obj: envargs.c $(UNZIP_H) +$(O)explode.obj: explode.c $(UNZIP_H) +$(O)extract.obj: extract.c $(UNZIP_H) crypt.h +$(O)fileio.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +$(O)funzip.obj: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h +$(O)globals.obj: globals.c $(UNZIP_H) +$(O)inflate.obj: inflate.c inflate.h $(UNZIP_H) +$(O)list.obj: list.c $(UNZIP_H) +$(O)match.obj: match.c $(UNZIP_H) +$(O)process.obj: process.c $(UNZIP_H) +$(O)timezone.obj: timezone.c $(UNZIP_H) zip.h timezone.h +$(O)ttyio.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +$(O)unreduce.obj: unreduce.c $(UNZIP_H) +$(O)unshrink.obj: unshrink.c $(UNZIP_H) +$(O)unzip.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h +$(O)zipinfo.obj: zipinfo.c $(UNZIP_H) + +# UnZipSFX variants: + +$(O)crc32.obx: crc32.c $(UNZIP_H) zip.h +$(O)crctab.obx: crctab.c $(UNZIP_H) zip.h +$(O)crypt.obx: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h +$(O)extract.obx: extract.c $(UNZIP_H) crypt.h +$(O)fileio.obx: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h +$(O)globals.obx: globals.c $(UNZIP_H) +$(O)inflate.obx: inflate.c inflate.h $(UNZIP_H) +$(O)match.obx: match.c $(UNZIP_H) +$(O)process.obx: process.c $(UNZIP_H) +$(O)timezone.obx: timezone.c $(UNZIP_H) zip.h timezone.h +$(O)ttyio.obx: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h +$(O)unzip.obx: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h + +# Special case object files: + +$(O)win32.obj: win32\win32.c $(UNZIP_H) win32\nt.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@ + +$(O)win32.obx: win32\win32.c $(UNZIP_H) win32\nt.h + $(cc) $(cdebux) $(cflags) $(cvars) -DSFX win32\win32.c -fo=$@ + +$(O)nt.obj: win32\nt.c $(UNZIP_H) win32\nt.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@ + +$(O)nt.obx: win32\nt.c $(UNZIP_H) win32\nt.h + $(cc) $(cdebux) $(cflags) $(cvars) -DSFX win32\nt.c -fo=$@ + +$(O)crc_i386.obj: win32\crc_i386.asm + $(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@ + +# Variant object files for fUnZip: + +$(O)cryptf.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(cc) $(CFLAGS_FU) crypt.c -fo=$@ + +$(O)globalsf.obj: globals.c $(UNZIP_H) + $(cc) $(CFLAGS_FU) globals.c -fo=$@ + +$(O)inflatef.obj: inflate.c inflate.h $(UNZIP_H) crypt.h + $(cc) $(CFLAGS_FU) inflate.c -fo=$@ + +$(O)ttyiof.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(cc) $(CFLAGS_FU) ttyio.c -fo=$@ + +$(O)win32f.obj: win32\win32.c $(UNZIP_H) + $(cc) $(CFLAGS_FU) win32\win32.c -fo=$@ + +# DLL compilation section +$(O)api.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h + $(cc) $(CFLAGS_DL) api.c -fo=$@ +$(O)crc32l.obj: crc32.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_DL) crc32.c -fo=$@ +$(O)crctabl.obj: crctab.c $(UNZIP_H) zip.h + $(cc) $(CFLAGS_DL) crctab.c -fo=$@ +$(O)cryptl.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h + $(cc) $(CFLAGS_DL) crypt.c -fo=$@ +$(O)explodel.obj: explode.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) explode.c -fo=$@ +$(O)extractl.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h + $(cc) $(CFLAGS_DL) extract.c -fo=$@ +$(O)fileiol.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h + $(cc) $(CFLAGS_DL) fileio.c -fo=$@ +$(O)globalsl.obj: globals.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) globals.c -fo=$@ +$(O)inflatel.obj: inflate.c inflate.h $(UNZIP_H) + $(cc) $(CFLAGS_DL) inflate.c -fo=$@ +$(O)listl.obj: list.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_DL) list.c -fo=$@ +$(O)matchl.obj: match.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) match.c -fo=$@ +$(O)processl.obj: process.c $(UNZIP_H) $(WINDLL_H) + $(cc) $(CFLAGS_DL) process.c -fo=$@ +$(O)timezonl.obj: timezone.c $(UNZIP_H) zip.h timezone.h + $(cc) $(CFLAGS_DL) timezone.c -fo=$@ +$(O)unreducl.obj: unreduce.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) unreduce.c -fo=$@ +$(O)unshrnkl.obj: unshrink.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) unshrink.c -fo=$@ +$(O)zipinfol.obj: zipinfo.c $(UNZIP_H) + $(cc) $(CFLAGS_DL) zipinfo.c -fo=$@ + +$(O)win32l.obj: win32\win32.c $(UNZIP_H) win32\nt.h + $(cc) $(CFLAGS_DL) -I. win32\win32.c -fo=$@ + +$(O)ntl.obj: win32\nt.c $(UNZIP_H) win32\nt.h + $(cc) $(CFLAGS_DL) -I. win32\nt.c -fo=$@ + +$(O)windll.obj: windll\windll.c $(UNZIP_H) $(WINDLL_H) +$(O)windll.obj: crypt.h unzvers.h consts.h + $(cc) $(CFLAGS_DL) -I. windll\windll.c -fo=$@ + +windll.res: windll\windll.rc unzvers.h + $(rc) /l 0x409 /fo$@ /i windll /d WIN32 windll\windll.rc + +# Windll command line example: + +$(O)uzexampl.obj: windll/uzexampl.c windll/uzexampl.h + $(cc) $(cdebug) $(cflags) $(cvars) windll\uzexampl.c -fo=$@ + +# Creation of subdirectory for intermediate files +$(OBDIR): + -mkdir $@ + +# Unwanted file removal: + +clean: .SYMBOLIC + del $(O)*.ob? + +cleaner: clean .SYMBOLIC + del UnZip.exe + del fUnZip.exe + del UnZipSFX.exe + del UnZip32.dll diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/nt.c boinc-7.0.14+dfsg/zip/unzip/win32/nt.c --- boinc-7.0.7+dfsg/zip/unzip/win32/nt.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/nt.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,669 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + + Copyright (c) 1996 Scott Field (dedicated to Info-Zip group) + + Module Name: + + nt.c + + Abstract: + + This module implements WinNT security descriptor operations for the + Win32 Info-ZIP project. Operation such as setting file security, + using/querying local and remote privileges, and queuing of operations + is performed here. The contents of this module are only relevant + when the code is running on Windows NT, and the target volume supports + persistent Acl storage. + + User privileges that allow accessing certain privileged aspects of the + security descriptor (such as the Sacl) are only used if the user specified + to do so. + + Author: + + Scott Field (sfield@microsoft.com) + + Last revised: 18 Jan 97 + + */ + +#define WIN32_LEAN_AND_MEAN +#define UNZIP_INTERNAL +#include "../unzip.h" +#include +#ifdef __RSXNT__ +# include "../win32/rsxntwin.h" +#endif +#include "../win32/nt.h" + + +#ifdef NTSD_EAS /* This file is only needed for NTSD handling */ + +/* Borland C++ does not define FILE_SHARE_DELETE. Others also? */ +#ifndef FILE_SHARE_DELETE +# define FILE_SHARE_DELETE 0x00000004 +#endif + + +/* private prototypes */ + +static BOOL Initialize(VOID); +#if 0 /* currently unused */ +static BOOL Shutdown(VOID); +#endif +static BOOL DeferSet(char *resource, PVOLUMECAPS VolumeCaps, uch *buffer); +static VOID GetRemotePrivilegesSet(CHAR *FileName, PDWORD dwRemotePrivileges); +static VOID InitLocalPrivileges(VOID); + + +BOOL bInitialized = FALSE; /* module level stuff initialized? */ +HANDLE hInitMutex = NULL; /* prevent multiple initialization */ + +BOOL g_bRestorePrivilege = FALSE; /* for local set file security override */ +BOOL g_bSaclPrivilege = FALSE; /* for local set sacl operations, only when + restore privilege not present */ + +/* our single cached volume capabilities structure that describes the last + volume root we encountered. A single entry like this works well in the + zip/unzip scenario for a number of reasons: + 1. typically one extraction path during unzip. + 2. typically process one volume at a time during zip, and then move + on to the next. + 3. no cleanup code required and no memory leaks. + 4. simple code. + + This approach should be reworked to a linked list approach if we expect to + be called by many threads which are processing a variety of input/output + volumes, since lock contention and stale data may become a bottleneck. */ + +VOLUMECAPS g_VolumeCaps; +CRITICAL_SECTION VolumeCapsLock; + + +/* our deferred set structure linked list element, used for making a copy + of input data which is used at a later time to process the original input + at a time when it makes more sense. eg, applying security to newly created + directories, after all files have been placed in such directories. */ + +CRITICAL_SECTION SetDeferLock; + +typedef struct _DEFERRED_SET { + struct _DEFERRED_SET *Next; + uch *buffer; /* must point to DWORD aligned block */ + PVOLUMECAPS VolumeCaps; + char *resource; +} DEFERRED_SET, *PDEFERRED_SET, *LPDEFERRED_SET; + +PDEFERRED_SET pSetHead = NULL; +PDEFERRED_SET pSetTail; + +static BOOL Initialize(VOID) +{ + HANDLE hMutex; + HANDLE hOldMutex; + + if(bInitialized) return TRUE; + + hMutex = CreateMutex(NULL, TRUE, NULL); + if(hMutex == NULL) return FALSE; + + hOldMutex = (HANDLE)InterlockedExchange((LPLONG)&hInitMutex, (LONG)hMutex); + + if(hOldMutex != NULL) { + /* somebody setup the mutex already */ + InterlockedExchange((LPLONG)&hInitMutex, (LONG)hOldMutex); + + CloseHandle(hMutex); /* close new, un-needed mutex */ + + /* wait for initialization to complete and return status */ + WaitForSingleObject(hOldMutex, INFINITE); + ReleaseMutex(hOldMutex); + + return bInitialized; + } + + /* initialize module level resources */ + + InitializeCriticalSection( &SetDeferLock ); + + InitializeCriticalSection( &VolumeCapsLock ); + memset(&g_VolumeCaps, 0, sizeof(VOLUMECAPS)); + + InitLocalPrivileges(); + + bInitialized = TRUE; + + ReleaseMutex(hMutex); /* release correct mutex */ + + return TRUE; +} + +#if 0 /* currently not used ! */ +static BOOL Shutdown(VOID) +{ + /* really need to free critical sections, disable enabled privilges, etc, + but doing so brings up possibility of race conditions if those resources + are about to be used. The easiest way to handle this is let these + resources be freed when the process terminates... */ + + return TRUE; +} +#endif /* never */ + + +static BOOL DeferSet(char *resource, PVOLUMECAPS VolumeCaps, uch *buffer) +{ + PDEFERRED_SET psd; + DWORD cbDeferSet; + DWORD cbResource; + DWORD cbBuffer; + + if(!bInitialized) if(!Initialize()) return FALSE; + + cbResource = lstrlenA(resource) + 1; + cbBuffer = GetSecurityDescriptorLength((PSECURITY_DESCRIPTOR)buffer); + cbDeferSet = sizeof(DEFERRED_SET) + cbBuffer + sizeof(VOLUMECAPS) + + cbResource; + + psd = (PDEFERRED_SET)HeapAlloc(GetProcessHeap(), 0, cbDeferSet); + if(psd == NULL) return FALSE; + + psd->Next = NULL; + psd->buffer = (uch *)(psd+1); + psd->VolumeCaps = (PVOLUMECAPS)((char *)psd->buffer + cbBuffer); + psd->resource = (char *)((char *)psd->VolumeCaps + sizeof(VOLUMECAPS)); + + memcpy(psd->buffer, buffer, cbBuffer); + memcpy(psd->VolumeCaps, VolumeCaps, sizeof(VOLUMECAPS)); + psd->VolumeCaps->bProcessDefer = TRUE; + memcpy(psd->resource, resource, cbResource); + + /* take defer lock */ + EnterCriticalSection( &SetDeferLock ); + + /* add element at tail of list */ + + if(pSetHead == NULL) { + pSetHead = psd; + } else { + pSetTail->Next = psd; + } + + pSetTail = psd; + + /* release defer lock */ + LeaveCriticalSection( &SetDeferLock ); + + return TRUE; +} + +BOOL ProcessDefer(PDWORD dwDirectoryCount, PDWORD dwBytesProcessed, + PDWORD dwDirectoryFail, PDWORD dwBytesFail) +{ + PDEFERRED_SET This; + PDEFERRED_SET Next; + + *dwDirectoryCount = 0; + *dwBytesProcessed = 0; + + *dwDirectoryFail = 0; + *dwBytesFail = 0; + + if(!bInitialized) return TRUE; /* nothing to do */ + + EnterCriticalSection( &SetDeferLock ); + + This = pSetHead; + + while(This) { + + if(SecuritySet(This->resource, This->VolumeCaps, This->buffer)) { + (*dwDirectoryCount)++; + *dwBytesProcessed += + GetSecurityDescriptorLength((PSECURITY_DESCRIPTOR)This->buffer); + } else { + (*dwDirectoryFail)++; + *dwBytesFail += + GetSecurityDescriptorLength((PSECURITY_DESCRIPTOR)This->buffer); + } + + Next = This->Next; + HeapFree(GetProcessHeap(), 0, This); + This = Next; + } + + pSetHead = NULL; + + LeaveCriticalSection( &SetDeferLock ); + + return TRUE; +} + +BOOL ValidateSecurity(uch *securitydata) +{ + PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)securitydata; + PACL pAcl; + PSID pSid; + BOOL bAclPresent; + BOOL bDefaulted; + + if(!IsWinNT()) return TRUE; /* don't do anything if not on WinNT */ + + if(!IsValidSecurityDescriptor(sd)) return FALSE; + + /* verify Dacl integrity */ + + if(!GetSecurityDescriptorDacl(sd, &bAclPresent, &pAcl, &bDefaulted)) + return FALSE; + + if(bAclPresent) { + if(!IsValidAcl(pAcl)) return FALSE; + } + + /* verify Sacl integrity */ + + if(!GetSecurityDescriptorSacl(sd, &bAclPresent, &pAcl, &bDefaulted)) + return FALSE; + + if(bAclPresent) { + if(!IsValidAcl(pAcl)) return FALSE; + } + + /* verify owner integrity */ + + if(!GetSecurityDescriptorOwner(sd, &pSid, &bDefaulted)) + return FALSE; + + if(pSid != NULL) { + if(!IsValidSid(pSid)) return FALSE; + } + + /* verify group integrity */ + + if(!GetSecurityDescriptorGroup(sd, &pSid, &bDefaulted)) + return FALSE; + + if(pSid != NULL) { + if(!IsValidSid(pSid)) return FALSE; + } + + return TRUE; +} + +static VOID GetRemotePrivilegesSet(char *FileName, PDWORD dwRemotePrivileges) +{ + HANDLE hFile; + + *dwRemotePrivileges = 0; + + /* see if we have the SeRestorePrivilege */ + + hFile = CreateFileA( + FileName, + ACCESS_SYSTEM_SECURITY | WRITE_DAC | WRITE_OWNER | READ_CONTROL, + FILE_SHARE_READ | FILE_SHARE_DELETE, /* no sd updating allowed here */ + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL + ); + + if(hFile != INVALID_HANDLE_VALUE) { + /* no remote way to determine SeRestorePrivilege -- just try a + read/write to simulate it */ + SECURITY_INFORMATION si = DACL_SECURITY_INFORMATION | + SACL_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION; + PSECURITY_DESCRIPTOR sd; + DWORD cbBuf = 0; + + GetKernelObjectSecurity(hFile, si, NULL, cbBuf, &cbBuf); + + if(ERROR_INSUFFICIENT_BUFFER == GetLastError()) { + if((sd = HeapAlloc(GetProcessHeap(), 0, cbBuf)) != NULL) { + if(GetKernelObjectSecurity(hFile, si, sd, cbBuf, &cbBuf)) { + if(SetKernelObjectSecurity(hFile, si, sd)) + *dwRemotePrivileges |= OVERRIDE_RESTORE; + } + HeapFree(GetProcessHeap(), 0, sd); + } + } + + CloseHandle(hFile); + } else { + + /* see if we have the SeSecurityPrivilege */ + /* note we don't need this if we have SeRestorePrivilege */ + + hFile = CreateFileA( + FileName, + ACCESS_SYSTEM_SECURITY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, /* max */ + NULL, + OPEN_EXISTING, + 0, + NULL + ); + + if(hFile != INVALID_HANDLE_VALUE) { + CloseHandle(hFile); + *dwRemotePrivileges |= OVERRIDE_SACL; + } + } +} + + +BOOL GetVolumeCaps( + char *rootpath, /* filepath, or NULL */ + char *name, /* filename associated with rootpath */ + PVOLUMECAPS VolumeCaps /* result structure describing capabilities */ + ) +{ + char TempRootPath[MAX_PATH + 1]; + DWORD cchTempRootPath = 0; + BOOL bSuccess = TRUE; /* assume success until told otherwise */ + + if(!bInitialized) if(!Initialize()) return FALSE; + + /* process the input path to produce a consistent path suitable for + compare operations and also suitable for certain picky Win32 API + that don't like forward slashes */ + + if(rootpath != NULL && rootpath[0] != '\0') { + DWORD i; + + cchTempRootPath = lstrlen(rootpath); + if(cchTempRootPath > MAX_PATH) return FALSE; + + /* copy input, converting forward slashes to back slashes as we go */ + + for(i = 0 ; i <= cchTempRootPath ; i++) { + if(rootpath[i] == '/') TempRootPath[i] = '\\'; + else TempRootPath[i] = rootpath[i]; + } + + /* check for UNC and Null terminate or append trailing \ as + appropriate */ + + /* possible valid UNCs we are passed follow: + \\machine\foo\bar (path is \\machine\foo\) + \\machine\foo (path is \\machine\foo\) + \\machine\foo\ + \\.\c$\ (FIXFIX: Win32API doesn't like this - GetComputerName()) + LATERLATER: handling mounted DFS drives in the future will require + slightly different logic which isn't available today. + This is required because directories can point at + different servers which have differing capabilities. + */ + + if(TempRootPath[0] == '\\' && TempRootPath[1] == '\\') { + DWORD slash = 0; + + for(i = 2 ; i < cchTempRootPath ; i++) { + if(TempRootPath[i] == '\\') { + slash++; + + if(slash == 2) { + i++; + TempRootPath[i] = '\0'; + cchTempRootPath = i; + break; + } + } + } + + /* if there was only one slash found, just tack another onto the + end */ + + if(slash == 1 && TempRootPath[cchTempRootPath] != '\\') { + TempRootPath[cchTempRootPath] = TempRootPath[0]; /* '\' */ + TempRootPath[cchTempRootPath+1] = '\0'; + cchTempRootPath++; + } + + } else { + + if(TempRootPath[1] == ':') { + + /* drive letter specified, truncate to root */ + TempRootPath[2] = '\\'; + TempRootPath[3] = '\0'; + cchTempRootPath = 3; + } else { + + /* must be file on current drive */ + TempRootPath[0] = '\0'; + cchTempRootPath = 0; + } + + } + + } /* if path != NULL */ + + /* grab lock protecting cached entry */ + EnterCriticalSection( &VolumeCapsLock ); + + if(!g_VolumeCaps.bValid || + lstrcmpi(g_VolumeCaps.RootPath, TempRootPath) != 0) + { + + /* no match found, build up new entry */ + + DWORD dwFileSystemFlags; + DWORD dwRemotePrivileges = 0; + BOOL bRemote = FALSE; + + /* release lock during expensive operations */ + LeaveCriticalSection( &VolumeCapsLock ); + + bSuccess = GetVolumeInformation( + (TempRootPath[0] == '\0') ? NULL : TempRootPath, + NULL, 0, + NULL, NULL, + &dwFileSystemFlags, + NULL, 0); + + + /* only if target volume supports Acls, and we were told to use + privileges do we need to go out and test for the remote case */ + + if(bSuccess && (dwFileSystemFlags & FS_PERSISTENT_ACLS) && + VolumeCaps->bUsePrivileges) + { + if(GetDriveType( (TempRootPath[0] == '\0') ? NULL : TempRootPath ) + == DRIVE_REMOTE) + { + bRemote = TRUE; + + /* make a determination about our remote capabilities */ + + GetRemotePrivilegesSet(name, &dwRemotePrivileges); + } + } + + /* always take the lock again, since we release it below */ + EnterCriticalSection( &VolumeCapsLock ); + + /* replace the existing data if successful */ + if(bSuccess) { + + lstrcpynA(g_VolumeCaps.RootPath, TempRootPath, cchTempRootPath+1); + g_VolumeCaps.bProcessDefer = FALSE; + g_VolumeCaps.dwFileSystemFlags = dwFileSystemFlags; + g_VolumeCaps.bRemote = bRemote; + g_VolumeCaps.dwRemotePrivileges = dwRemotePrivileges; + g_VolumeCaps.bValid = TRUE; + } + } + + if(bSuccess) { + /* copy input elements */ + g_VolumeCaps.bUsePrivileges = VolumeCaps->bUsePrivileges; + g_VolumeCaps.dwFileAttributes = VolumeCaps->dwFileAttributes; + + /* give caller results */ + memcpy(VolumeCaps, &g_VolumeCaps, sizeof(VOLUMECAPS)); + } else { + g_VolumeCaps.bValid = FALSE; + } + + LeaveCriticalSection( &VolumeCapsLock ); /* release lock */ + + return bSuccess; +} + + +BOOL SecuritySet(char *resource, PVOLUMECAPS VolumeCaps, uch *securitydata) +{ + HANDLE hFile; + DWORD dwDesiredAccess = 0; + DWORD dwFlags = 0; + PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)securitydata; + SECURITY_DESCRIPTOR_CONTROL sdc; + SECURITY_INFORMATION RequestedInfo = 0; + DWORD dwRev; + BOOL bRestorePrivilege = FALSE; + BOOL bSaclPrivilege = FALSE; + BOOL bSuccess; + + if(!bInitialized) if(!Initialize()) return FALSE; + + /* defer directory processing */ + + if(VolumeCaps->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + if(!VolumeCaps->bProcessDefer) { + return DeferSet(resource, VolumeCaps, securitydata); + } else { + /* opening a directory requires FILE_FLAG_BACKUP_SEMANTICS */ + dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; + } + } + + /* evaluate the input security desriptor and act accordingly */ + + if(!IsValidSecurityDescriptor(sd)) + return FALSE; + + if(!GetSecurityDescriptorControl(sd, &sdc, &dwRev)) + return FALSE; + + /* setup privilege usage based on if told we can use privileges, and if so, + what privileges we have */ + + if(VolumeCaps->bUsePrivileges) { + if(VolumeCaps->bRemote) { + /* use remotely determined privileges */ + if(VolumeCaps->dwRemotePrivileges & OVERRIDE_RESTORE) + bRestorePrivilege = TRUE; + + if(VolumeCaps->dwRemotePrivileges & OVERRIDE_SACL) + bSaclPrivilege = TRUE; + + } else { + /* use local privileges */ + bRestorePrivilege = g_bRestorePrivilege; + bSaclPrivilege = g_bSaclPrivilege; + } + } + + + /* if a Dacl is present write Dacl out */ + /* if we have SeRestorePrivilege, write owner and group info out */ + + if(sdc & SE_DACL_PRESENT) { + dwDesiredAccess |= WRITE_DAC; + RequestedInfo |= DACL_SECURITY_INFORMATION; + + if(bRestorePrivilege) { + dwDesiredAccess |= WRITE_OWNER; + RequestedInfo |= (OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION); + } + } + + /* if a Sacl is present and we have either SeRestorePrivilege or + SeSystemSecurityPrivilege try to write Sacl out */ + + if((sdc & SE_SACL_PRESENT) && (bRestorePrivilege || bSaclPrivilege)) { + dwDesiredAccess |= ACCESS_SYSTEM_SECURITY; + RequestedInfo |= SACL_SECURITY_INFORMATION; + } + + if(RequestedInfo == 0) /* nothing to do */ + return FALSE; + + if(bRestorePrivilege) + dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; + + hFile = CreateFileA( + resource, + dwDesiredAccess, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,/* max sharing */ + NULL, + OPEN_EXISTING, + dwFlags, + NULL + ); + + if(hFile == INVALID_HANDLE_VALUE) + return FALSE; + + bSuccess = SetKernelObjectSecurity(hFile, RequestedInfo, sd); + + CloseHandle(hFile); + + return bSuccess; +} + +static VOID InitLocalPrivileges(VOID) +{ + HANDLE hToken; + TOKEN_PRIVILEGES tp; + + /* try to enable some interesting privileges that give us the ability + to get some security information that we normally cannot. + + note that enabling privileges is only relevant on the local machine; + when accessing files that are on a remote machine, any privileges + that are present on the remote machine get enabled by default. */ + + if(!OpenProcessToken(GetCurrentProcess(), + TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken)) + return; + + tp.PrivilegeCount = 1; + tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + if(LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &tp.Privileges[0].Luid)) { + + /* try to enable SeRestorePrivilege; if this succeeds, we can write + all aspects of the security descriptor */ + + if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && + GetLastError() == ERROR_SUCCESS) g_bRestorePrivilege = TRUE; + + } + + /* try to enable SeSystemSecurityPrivilege, if SeRestorePrivilege not + present; if this succeeds, we can write the Sacl */ + + if(!g_bRestorePrivilege && + LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid)) { + + if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && + GetLastError() == ERROR_SUCCESS) g_bSaclPrivilege = TRUE; + } + + CloseHandle(hToken); +} +#endif /* NTSD_EAS */ + +const char *BOINC_RCSID_247c3e8fbe = "$Id: nt.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/nt.h boinc-7.0.14+dfsg/zip/unzip/win32/nt.h --- boinc-7.0.7+dfsg/zip/unzip/win32/nt.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/nt.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,36 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* nt.h: central header for EF_NTSD "SD" extra field */ + +#ifndef _NT_H +#define _NT_H + +#define NTSD_BUFFERSIZE (1024) /* threshold to cause malloc() */ +#define OVERRIDE_BACKUP 1 /* we have SeBackupPrivilege on remote */ +#define OVERRIDE_RESTORE 2 /* we have SeRestorePrivilege on remote */ +#define OVERRIDE_SACL 4 /* we have SeSystemSecurityPrivilege on remote */ + +typedef struct { + BOOL bValid; /* are our contents valid? */ + BOOL bProcessDefer; /* process deferred entry yet? */ + BOOL bUsePrivileges; /* use privilege overrides? */ + DWORD dwFileSystemFlags; /* describes target file system */ + BOOL bRemote; /* is volume remote? */ + DWORD dwRemotePrivileges; /* relevant only on remote volumes */ + DWORD dwFileAttributes; + char RootPath[MAX_PATH+1]; /* path to network / filesystem */ +} VOLUMECAPS, *PVOLUMECAPS, *LPVOLUMECAPS; + +BOOL SecuritySet(char *resource, PVOLUMECAPS VolumeCaps, uch *securitydata); +BOOL GetVolumeCaps(char *rootpath, char *name, PVOLUMECAPS VolumeCaps); +BOOL ValidateSecurity(uch *securitydata); +BOOL ProcessDefer(PDWORD dwDirectoryCount, PDWORD dwBytesProcessed, + PDWORD dwDirectoryFail, PDWORD dwBytesFail); + +#endif /* _NT_H */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/rsxntwin.h boinc-7.0.14+dfsg/zip/unzip/win32/rsxntwin.h --- boinc-7.0.7+dfsg/zip/unzip/win32/rsxntwin.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/rsxntwin.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,166 @@ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* rsxntwin.h + * + * fills some gaps in the rsxnt 1.3 win32 header files () that are + * required for compiling Info-ZIP sources for Win NT / Win 95 + */ + +#ifdef __RSXNT__ +#if !defined (_RSXNTWIN_H) +#define _RSXNTWIN_H + +#ifdef TFUNCT /* TFUNCT is undefined when MSSDK headers are used */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define PASCAL __stdcall + +#define ANYSIZE_ARRAY 1 + +#ifndef TIME_ZONE_ID_UNKNOWN +# define TIME_ZONE_ID_UNKNOWN 0 +#endif +#ifndef TIME_ZONE_ID_INVALID +# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL +#endif + +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 + +#define FILE_SHARE_DELETE 0x00000004 + +#define FILE_PERSISTENT_ACLS 0x00000008 + +#define HFILE_ERROR ((HFILE)-1) + +#define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS + + +BOOL WINAPI DosDateTimeToFileTime(WORD, WORD, LPFILETIME); + + +#ifndef SetVolumeLabel +#define SetVolumeLabel TFUNCT(SetVolumeLabel) +#endif +BOOL WINAPI SetVolumeLabel(LPCTSTR, LPCTSTR); + + +#ifndef GetDriveType +#define GetDriveType TFUNCT(GetDriveType) +#endif +DWORD GetDriveType(LPCTSTR); + +#define DRIVE_UNKNOWN 0 +#define DRIVE_REMOVABLE 2 +#define DRIVE_FIXED 3 +#define DRIVE_REMOTE 4 +#define DRIVE_CDROM 5 +#define DRIVE_RAMDISK 6 + +#ifndef SearchPath +#define SearchPath TFUNCT(SearchPath) +#endif +BOOL WINAPI SearchPath(LPCTSTR, LPCTSTR, LPCTSTR, UINT, LPTSTR, LPTSTR *); + +#define ERROR_SUCCESS 0 +#define ERROR_INSUFFICIENT_BUFFER 122 + +LONG WINAPI InterlockedExchange(LPLONG, LONG); + +#define ACCESS_SYSTEM_SECURITY 0x01000000L + +typedef PVOID PSECURITY_DESCRIPTOR; +typedef PVOID PSID; +typedef struct _ACL { + BYTE AclRevision; + BYTE Sbz1; + WORD AclSize; + WORD AceCount; + WORD Sbz2; +} ACL; +typedef ACL *PACL; + +typedef struct _LUID { + DWORD LowPart; + LONG HighPart; +} LUID, *PLUID; + +typedef struct _LUID_AND_ATTRIBUTES { + LUID Luid; + DWORD Attributes; + } LUID_AND_ATTRIBUTES, * PLUID_AND_ATTRIBUTES; + +typedef struct _TOKEN_PRIVILEGES { + DWORD PrivilegeCount; + LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; +} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; + +#define TOKEN_QUERY 0x0008 +#define TOKEN_ADJUST_PRIVILEGES 0x0020 + +BOOL WINAPI OpenProcessToken(HANDLE, DWORD, PHANDLE); +BOOL WINAPI AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, + PTOKEN_PRIVILEGES, PDWORD); + +#ifndef LookupPrivilegeValue +#define LookupPrivilegeValue TFUNCT(LookupPrivilegeValue) +#endif +BOOL WINAPI LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); + +typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION; +#define OWNER_SECURITY_INFORMATION 0x00000001L +#define GROUP_SECURITY_INFORMATION 0x00000002L +#define DACL_SECURITY_INFORMATION 0x00000004L +#define SACL_SECURITY_INFORMATION 0x00000008L + +typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; +#define SE_DACL_PRESENT 0x0004 +#define SE_SACL_PRESENT 0x0010 + +#define SE_PRIVILEGE_ENABLED 0x00000002L + +#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege") +#define SE_BACKUP_NAME TEXT("SeBackupPrivilege") +#define SE_RESTORE_NAME TEXT("SeRestorePrivilege") + +BOOL WINAPI GetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION, + PSECURITY_DESCRIPTOR, DWORD, LPDWORD); +BOOL WINAPI SetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION, + PSECURITY_DESCRIPTOR); +BOOL WINAPI IsValidSid(PSID); +BOOL WINAPI IsValidAcl(PACL); +BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR); +BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR); +DWORD WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR); +BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR, + PSECURITY_DESCRIPTOR_CONTROL, LPDWORD); +BOOL WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR, + SECURITY_DESCRIPTOR_CONTROL, SECURITY_DESCRIPTOR_CONTROL); +BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, + LPBOOL, PACL *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL); +BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, + LPBOOL, PACL *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL); +BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID, BOOL); +BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID, BOOL); +VOID WINAPI InitializeCriticalSection(); + +#ifdef __cplusplus +} +#endif + +#endif /* TFUNCT */ +#endif /* !defined (_RSXNTWIN_H) */ +#endif /* __RSXNT__ */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/w32cfg.h boinc-7.0.14+dfsg/zip/unzip/win32/w32cfg.h --- boinc-7.0.7+dfsg/zip/unzip/win32/w32cfg.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/w32cfg.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,367 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + Win32 specific configuration section: + ---------------------------------------------------------------------------*/ + +#ifndef __w32cfg_h +#define __w32cfg_h + +#if (defined(__CYGWIN32__) && !defined(__CYGWIN__)) +# define __CYGWIN__ /* compatibility for CygWin B19 and older */ +#endif + +#ifdef __CYGWIN__ +/* Those Idiots at Cygnus have started to set "Unix" identifiers + * for a Win32 compiler ... + */ +# ifdef UNIX +# undef UNIX +# endif +#endif + +#if (defined(_MSC_VER) && !defined(MSC)) +# define MSC +#endif + +/* enable multibyte character set support by default */ +#ifndef _MBCS +# define _MBCS +#endif +#if (defined(__CYGWIN__) && defined(_MBCS)) +# undef _MBCS /* CygWin RTL lacks support for __mb_cur_max */ +#endif +#if (defined(__DJGPP__) && !defined(__EMX__) && defined(_MBCS)) +# undef _MBCS /* __mb_cur_max missing for RSXNTdj 1.6 beta */ +#endif + +#include /* off_t, time_t, dev_t, ... */ +#include +#include /* read(), open(), etc. */ +#include +#if ((defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset)) +# define tzset _tzset +#endif +#if (defined(__LCC__) && !defined(tzset)) +# define tzset _tzset +#endif +#ifdef __MINGW32__ + extern void _tzset(void); /* this is missing in */ +# ifndef tzset +# define tzset _tzset +# endif +#endif +#ifdef W32_USE_IZ_TIMEZONE +# ifdef __BORLANDC__ +# define tzname tzname +# define IZTZ_DEFINESTDGLOBALS +# endif +# ifdef __WATCOMC__ +# define IZTZ_DEFINESTDGLOBALS +# endif +# ifndef tzset +# define tzset _tzset +# endif +# ifndef timezone +# define timezone _timezone +# endif +# ifndef daylight +# define daylight _daylight +# endif +# ifndef tzname +# define tzname _tzname +# endif +# if (!defined(NEED__ISINDST) && !defined(__BORLANDC__)) +# define NEED__ISINDST +# endif +# ifdef IZTZ_GETLOCALETZINFO +# undef IZTZ_GETLOCALETZINFO +# endif +# define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone +#endif /* W32_USE_IZ_TIMEZONE */ +#include +#if (!defined(__RSXNT__) && !defined(__CYGWIN__)) +# include /* mkdir() */ +#endif +#include +#ifdef __CYGWIN__ +# include + extern int setmode(int, int); /* this is missing in */ +#endif +#if (defined(MSC) || defined(__WATCOMC__) || defined(__MINGW32__)) +# include +#else +# include +#endif +#define GOT_UTIMBUF + +#ifdef _MBCS +# if (!defined(__EMX__) && !defined(__MINGW32__) && !defined(__CYGWIN__)) +# if (!defined(__DJGPP__)) +# include +# include + /* for MSC (and compatible compilers), use routines supplied by RTL */ +# define PREINCSTR(ptr) (ptr = (char *)_mbsinc((const uch *)(ptr))) +# define MBSCHR(str, c) (char *)_mbschr((const uch *)(str), (c)) +# define MBSRCHR(str, c) (char *)_mbsrchr((const uch *)(str), (c)) +# endif +# endif +# if (defined(__MINGW32__) && !defined(MB_CUR_MAX)) +# ifdef __MSVCRT__ + extern int *__p___mb_cur_max(void); +# define MB_CUR_MAX (*__p___mb_cur_max()) +# else + extern int *_imp____mb_cur_max_dll; +# define MB_CUR_MAX (*_imp____mb_cur_max_dll) +# endif +# endif +# if (defined(__LCC__) && !defined(MB_CUR_MAX)) + extern int *_imp____mb_cur_max; +# define MB_CUR_MAX (*_imp____mb_cur_max) +# endif +# if (defined(__DJGPP__) && !defined(__EMX__) && !defined(MB_CUR_MAX)) + extern int *_imp____mb_cur_max; +# define MB_CUR_MAX (*_imp____mb_cur_max) +# endif +#endif + +/* for UnZip, the "basic" part of the win32 api is sufficient */ +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif + +#if defined(__FILEIO_C) +# ifndef __CYGWIN__ +# include +# endif +# include +# ifdef __RSXNT__ +# include "../win32/rsxntwin.h" +# endif +# ifndef TIME_ZONE_ID_INVALID +# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL +# endif +#endif +#if (defined(__ENVARGS_C) || defined(__EXTRACT_C) || defined(__UNZIP_C) || \ + defined(ZCRYPT_INTERNAL)) +# include +# ifdef __RSXNT__ +# include "../win32/rsxntwin.h" +# endif +# ifndef TIME_ZONE_ID_INVALID +# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL +# endif +#endif + +/* the following definitions are considered as "obsolete" by Microsoft and + * might be missing in some versions of + */ +#ifndef AnsiToOem +# define AnsiToOem CharToOemA +#endif +#ifndef OemToAnsi +# define OemToAnsi OemToCharA +#endif + +#define DIR_END '\\' /* OS uses '\\' as directory separator */ +#define DIR_END2 '/' /* also check for '/' (RTL may convert) */ +#ifdef DATE_FORMAT +# undef DATE_FORMAT +#endif +#define DATE_FORMAT dateformat() +#define lenEOL 2 +#define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} + +#if (defined(__RSXNT__) && !defined(HAVE_MKTIME)) +# define HAVE_MKTIME /* use mktime() in time conversion routines */ +#endif +#if (defined(MSC) && !defined(HAVE_MKTIME)) +# define HAVE_MKTIME /* use mktime() in time conversion routines */ +#endif +#if (defined(__CYGWIN__) && defined(HAVE_MKTIME)) +# undef HAVE_MKTIME /* Cygnus' mktime() implementation is buggy */ +#endif +#if (defined(W32_USE_IZ_TIMEZONE) && !defined(HAVE_MKTIME)) +# define HAVE_MKTIME /* use mktime() in time conversion routines */ +#endif +#if (!defined(NT_TZBUG_WORKAROUND) && !defined(NO_NT_TZBUG_WORKAROUND)) +# define NT_TZBUG_WORKAROUND +#endif +#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) +# define USE_EF_UT_TIME +#endif +#if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) +# define TIMESTAMP +#endif +#if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS)) +# define NTSD_EAS /* enable NTSD support unless explicitly suppressed */ +#endif +#if (defined(NTSD_EAS) && !defined(RESTORE_ACL)) +# define RESTORE_ACL /* "restore ACLs" only needed when NTSD_EAS active */ +#endif + +/* handlers for OEM <--> ANSI string conversions */ +#ifdef __RSXNT__ + /* RSXNT uses OEM coded strings in functions supplied by C RTL */ +# ifdef CRTL_CP_IS_ISO +# undef CRTL_CP_IS_ISO +# endif +# ifndef CRTL_CP_IS_OEM +# define CRTL_CP_IS_OEM +# endif +#else + /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */ +# ifndef CRTL_CP_IS_ISO +# define CRTL_CP_IS_ISO +# endif +# ifdef CRTL_CP_IS_OEM +# undef CRTL_CP_IS_OEM +# endif +#endif + +#ifdef CRTL_CP_IS_ISO + /* C RTL's file system support assumes ANSI coded strings */ +# define ISO_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} +# define OEM_TO_INTERN(src, dst) OemToAnsi(src, dst) +# define INTERN_TO_ISO(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} +# define INTERN_TO_OEM(src, dst) AnsiToOem(src, dst) +#endif /* CRTL_CP_IS_ISO */ +#ifdef CRTL_CP_IS_OEM + /* C RTL's file system support assumes OEM coded strings */ +# define ISO_TO_INTERN(src, dst) AnsiToOem(src, dst) +# define OEM_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} +# define INTERN_TO_ISO(src, dst) OemToAnsi(src, dst) +# define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} +#endif /* CRTL_CP_IS_OEM */ +#define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1) +#define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1) +#ifndef WINDLL + /* Despite best intentions, for the command-line version UzpPassword() + * could return either character set, depending on whether running under + * Win95 (DOS-session) or WinNT (native WinNT command interpreter)! */ +# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst) +# define STR_TO_CP3(dst, src) (OemToAnsi(src, dst), dst) +#else + /* The WINDLL front end is known to supply ISO/ANSI-coded passwords! */ +# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst) +#endif +/* dummy defines to disable these functions, they are not needed */ +#define STR_TO_OEM +#define STR_TO_ISO + +/* Static variables that we have to add to Uz_Globs: */ +#define SYSTEM_SPECIFIC_GLOBALS \ + int created_dir, renamed_fullpath, fnlen;\ + unsigned nLabelDrive;\ + char lastRootPath[4];\ + int lastVolOldFAT, lastVolLocTim;\ + char *rootpath, *buildpathHPFS, *buildpathFAT, *endHPFS, *endFAT;\ + ZCONST char *wildname;\ + char *dirname, matchname[FILNAMSIZ];\ + int rootlen, have_dirname, dirnamelen, notfirstcall;\ + zvoid *wild_dir; + +/* created_dir, renamed_fullpath, fnlen, and nLabelDrive are used by */ +/* both mapname() and checkdir(). */ +/* lastRootPath, lastVolOldFAT and lastVolLocTim are used by */ +/* IsVolumeOldFAT() and NTQueryVolInfo(). */ +/* rootlen, rootpath, buildpathHPFS, buildpathFAT, endHPFS, and endFAT */ +/* are used by checkdir(). */ +/* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ +/* and notfirstcall are used by do_wild(). */ + +/* This replacement for C-RTL-supplied getch() (or similar) functionality + * avoids leaving unabsorbed LFs in the keyboard buffer under Windows95, + * and supports the +[0] feature. + */ +int getch_win32 OF((void)); + +/* Up to now, all versions of Microsoft C runtime libraries lack the support + * for customized (non-US) switching rules between daylight saving time and + * standard time in the TZ environment variable string. + * But non-US timezone rules are correctly supported when timezone information + * is read from the OS system settings in the Win32 registry. + * The following work-around deletes any TZ environment setting from + * the process environment. This results in a fallback of the RTL time + * handling code to the (correctly interpretable) OS system settings, read + * from the registry. + */ +#ifdef USE_EF_UT_TIME +# if (defined(__WATCOMC__) || defined(W32_USE_IZ_TIMEZONE)) +# define iz_w32_prepareTZenv() +# else +# define iz_w32_prepareTZenv() putenv("TZ=") +# endif +#endif + +/* This patch of stat() is useful for at least two compilers. It is */ +/* difficult to take a stat() of a root directory under Windows95, so */ +/* zstat_win32() detects that case and fills in suitable values. */ +#ifndef __RSXNT__ +# ifndef W32_STATROOT_FIX +# define W32_STATROOT_FIX +# endif +#endif /* !__RSXNT__ */ + +#if (defined(NT_TZBUG_WORKAROUND) || defined(W32_STATROOT_FIX)) +# define W32_STAT_BANDAID +# if (defined(NT_TZBUG_WORKAROUND) && defined(REENTRANT)) +# define __W32STAT_GLOBALS__ Uz_Globs *pG, +# define __W32STAT_G__ pG, +# else +# define __W32STAT_GLOBALS__ +# define __W32STAT_G__ +# endif +# ifdef SSTAT +# undef SSTAT +# endif +# ifdef WILD_STAT_BUG +# define SSTAT(path, pbuf) (iswild(path) || zstat_win32(__W32STAT_G__ path, pbuf)) +# else +# define SSTAT(path, pbuf) zstat_win32(__W32STAT_G__ path, pbuf) +# endif +#endif + +#ifdef __WATCOMC__ +# ifdef __386__ +# ifndef WATCOMC_386 +# define WATCOMC_386 +# endif +# define __32BIT__ +# undef far +# define far +# undef near +# define near + +/* gaah -- Watcom's docs claim that _get_osfhandle exists, but it doesn't. */ +# define _get_osfhandle _os_handle + +/* Get asm routines to link properly without using "__cdecl": */ +# ifndef USE_ZLIB +# pragma aux crc32 "_*" parm caller [] value [eax] modify [eax] +# pragma aux get_crc_table "_*" parm caller [] value [eax] \ + modify [eax ecx edx] +# endif /* !USE_ZLIB */ +# endif /* __386__ */ + +# ifndef EPIPE +# define EPIPE -1 +# endif +# define PIPE_ERROR (errno == EPIPE) +#endif /* __WATCOMC__ */ + +#define SCREENWIDTH 80 +#define SCREENSIZE(scrrows, scrcols) screensize(scrrows, scrcols) +int screensize(int *tt_rows, int *tt_cols); + +/* on the DOS or NT console screen, line-wraps are always enabled */ +#define SCREENLWRAP 1 +#define TABSIZE 8 + +#endif /* !__w32cfg_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/win32/win32.c boinc-7.0.14+dfsg/zip/unzip/win32/win32.c --- boinc-7.0.7+dfsg/zip/unzip/win32/win32.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/win32/win32.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,2758 @@ +/* + Copyright (c) 1990-2002 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + win32.c + + 32-bit Windows-specific (NT/95) routines for use with Info-ZIP's UnZip 5.3 + and later. + + Contains: GetLoadPath() + Opendir() + Readdir() + Closedir() + process_defer_NT() process any deferred items + SetSD() set security descriptor on file + EvalExtraFields() evaluate and process and extra field NOW + IsWinNT() indicate type of WIN32 platform + test_NTSD() test integrity of NT security data + utime2FileTime() + FStampIsLocTime() + FileTime2utime() + VFatFileTime2utime() + UTCtime2Localtime() + NTtzbugWorkaround() + getNTfiletime() + SetFileSize() + close_outfile() + stamp_file() + isfloppy() + NTQueryVolInfo() + IsVolumeOldFAT() + do_wild() + mapattr() + mapname() + maskDOSdevice() + map2fat() + checkdir() + dateformat() + version() + screensize() + zstat_win32() + conv_to_rule() + GetPlatformLocalTimezone() + getch_win32() + + ---------------------------------------------------------------------------*/ + + +#define UNZIP_INTERNAL +#include "../unzip.h" +#include /* must be AFTER unzip.h to avoid struct G problems */ +#ifdef __RSXNT__ +# include "../win32/rsxntwin.h" +#endif +#include "../win32/nt.h" + +#ifndef FUNZIP /* most of this file is not used with fUnZip */ + +#if (defined(__EMX__) || defined(__CYGWIN__)) +# define MKDIR(path,mode) mkdir(path,mode) +#else +# define MKDIR(path,mode) mkdir(path) +#endif + +#ifdef HAVE_WORKING_DIRENT_H +# undef HAVE_WORKING_DIRENT_H +#endif +/* The emxrtl dirent support of (__GO32__ || __EMX__) converts to lowercase! */ +#if defined(__CYGWIN__) +# define HAVE_WORKING_DIRENT_H +#endif + +#undef NTSD_EAS + +#ifndef SFX +# ifdef HAVE_WORKING_DIRENT_H +# include /* use readdir() */ +# define zdirent dirent +# define zDIR DIR +# define Opendir opendir +# define Readdir readdir +# define Closedir closedir +# else /* !HAVE_WORKING_DIRENT_H */ + typedef struct zdirent { + char reserved [21]; + char ff_attrib; + short ff_ftime; + short ff_fdate; + long size; + char d_name[MAX_PATH]; + int d_first; + HANDLE d_hFindFile; + } zDIR; + + static zDIR *Opendir (const char *n); + static struct zdirent *Readdir (zDIR *d); + static void Closedir (zDIR *d); +# endif /* ?HAVE_WORKING_DIRENT_H */ +#endif /* !SFX */ + +#undef NTSD_EAS + +/* Function prototypes */ +#ifdef NTSD_EAS + static int SetSD(__GPRO__ char *path, PVOLUMECAPS VolumeCaps, + uch *eb_ptr, unsigned eb_len); + static int EvalExtraFields(__GPRO__ char *path, uch *ef_ptr, + unsigned ef_len); +#endif + +#if (defined(USE_EF_UT_TIME) || defined(NT_TZBUG_WORKAROUND) || \ + defined(TIMESTAMP)) + static void utime2FileTime(time_t ut, FILETIME *pft); + static int FStampIsLocTime(__GPRO__ const char *path); +#endif /* USE_EF_UT_TIME || NT_TZBUG_WORKAROUND || TIMESTAMP */ +#ifdef NT_TZBUG_WORKAROUND + static int FileTime2utime(const FILETIME *pft, time_t *ut); +#ifdef W32_STAT_BANDAID + static int VFatFileTime2utime(const FILETIME *pft, time_t *ut); +#endif + static time_t UTCtime2Localtime(time_t utctime); + static void NTtzbugWorkaround(time_t ut, FILETIME *pft); +#endif /* NT_TZBUG_WORKAROUND */ + + +static int getNTfiletime (__GPRO__ FILETIME *pModFT, FILETIME *pAccFT, + FILETIME *pCreFT); +static int isfloppy (int nDrive); +static int NTQueryVolInfo (__GPRO__ const char *name); +static int IsVolumeOldFAT (__GPRO__ const char *name); +static void maskDOSdevice (__GPRO__ char *pathcomp); +static void map2fat (char *pathcomp, char **pEndFAT); + + +#ifdef __MINGW32__ + int _CRT_glob = 0; /* suppress command line globbing by C RTL */ +#endif + +#ifdef ACORN_FTYPE_NFS +/* Acorn bits for NFS filetyping */ +typedef struct { + uch ID[2]; + uch size[2]; + uch ID_2[4]; + uch loadaddr[4]; + uch execaddr[4]; + uch attr[4]; +} RO_extra_block; + +#endif /* ACORN_FTYPE_NFS */ + +/* static int created_dir; */ /* used by mapname(), checkdir() */ +/* static int renamed_fullpath; */ /* ditto */ +/* static int fnlen; */ /* ditto */ +/* static unsigned nLabelDrive; */ /* ditto */ + +extern char Far TruncNTSD[]; /* in extract.c */ + + + +#ifdef SFX + +/**************************/ +/* Function GetLoadPath() */ +/**************************/ + +char *GetLoadPath(__GPRO) +{ +#ifdef MSC + extern char *_pgmptr; + return _pgmptr; + +#else /* use generic API call */ + + GetModuleFileName(NULL, G.filename, FILNAMSIZ-1); + _ISO_INTERN(G.filename); /* translate to codepage of C rtl's stdio */ + return G.filename; +#endif + +} /* end function GetLoadPath() */ + + + + + +#else /* !SFX */ + +#ifndef HAVE_WORKING_DIRENT_H + +/**********************/ /* Borrowed from ZIP 2.0 sources */ +/* Function Opendir() */ /* Difference: no special handling for */ +/**********************/ /* hidden or system files. */ + +static zDIR *Opendir(n) + const char *n; /* directory to open */ +{ + zDIR *d; /* malloc'd return value */ + char *p; /* malloc'd temporary string */ + WIN32_FIND_DATA fd; + extent len = strlen(n); + + /* Start searching for files in directory n */ + + if ((d = (zDIR *)malloc(sizeof(zDIR))) == NULL || + (p = malloc(strlen(n) + 5)) == NULL) + { + if (d != (zDIR *)NULL) + free((void *)d); + return (zDIR *)NULL; + } + INTERN_TO_ISO(n, p); + if (len > 0) { + if (p[len-1] == ':') + p[len++] = '.'; /* x: => x:. */ + else if (p[len-1] == '/' || p[len-1] == '\\') + --len; /* foo/ => foo */ + } + strcpy(p+len, "/*"); + + if (INVALID_HANDLE_VALUE == (d->d_hFindFile = FindFirstFile(p, &fd))) { + free((zvoid *)d); + free((zvoid *)p); + return NULL; + } + strcpy(d->d_name, fd.cFileName); + + free((zvoid *)p); + d->d_first = 1; + return d; + +} /* end of function Opendir() */ + + + + +/**********************/ /* Borrowed from ZIP 2.0 sources */ +/* Function Readdir() */ /* Difference: no special handling for */ +/**********************/ /* hidden or system files. */ + +static struct zdirent *Readdir(d) + zDIR *d; /* directory stream from which to read */ +{ + /* Return pointer to first or next directory entry, or NULL if end. */ + + if ( d->d_first ) + d->d_first = 0; + else + { + WIN32_FIND_DATA fd; + + if ( !FindNextFile(d->d_hFindFile, &fd) ) + return NULL; + + ISO_TO_INTERN(fd.cFileName, d->d_name); + } + return (struct zdirent *)d; + +} /* end of function Readdir() */ + + + + +/***********************/ +/* Function Closedir() */ /* Borrowed from ZIP 2.0 sources */ +/***********************/ + +static void Closedir(d) + zDIR *d; /* directory stream to close */ +{ + FindClose(d->d_hFindFile); + free(d); +} + +#endif /* !HAVE_WORKING_DIRENT_H */ +#endif /* ?SFX */ + + + + +#ifdef NTSD_EAS + +/*********************************/ +/* Function process_defer_NT() */ +/*********************************/ + +void process_defer_NT(__G) + __GDEF +{ + /* process deferred items */ + + DWORD dir, bytes; + DWORD dirfail, bytesfail; + + ProcessDefer(&dir, &bytes, &dirfail, &bytesfail); + + if (!uO.tflag && (uO.qflag < 2)) { + if (dir) + Info(slide, 0, ((char *)slide, + " updated: %lu directory entries with %lu bytes security", + (ulg)dir, (ulg)bytes)); + if (dirfail) + Info(slide, 0, ((char *)slide, + " failed: %lu directory entries with %lu bytes security", + (ulg)dirfail, (ulg)bytesfail)); + } +} + + + +/**********************/ +/* Function SetSD() */ /* return almost-PK errors */ +/**********************/ + +static int SetSD(__G__ path, VolumeCaps, eb_ptr, eb_len) + __GDEF + char *path; + PVOLUMECAPS VolumeCaps; + uch *eb_ptr; + unsigned eb_len; +{ + ulg ntsd_ucSize; + uch *security_data; + int error; + + if (eb_ptr == NULL || eb_len < EB_NTSD_L_LEN) + return PK_OK; /* not a valid NTSD extra field: assume OK */ + + /* check if we know how to handle this version */ + if (*(eb_ptr + (EB_HEADSIZE+EB_NTSD_VERSION)) > (uch)EB_NTSD_MAX_VER) + return PK_OK; + + ntsd_ucSize = makelong(eb_ptr + (EB_HEADSIZE+EB_UCSIZE_P)); + if (ntsd_ucSize > 0L && eb_len <= (EB_NTSD_L_LEN + EB_CMPRHEADLEN)) + return IZ_EF_TRUNC; /* no compressed data! */ + + /* allocate storage for uncompressed data */ + security_data = (uch *)malloc((extent)ntsd_ucSize); + if (security_data == (uch *)NULL) + return PK_MEM4; + + error = memextract(__G__ security_data, ntsd_ucSize, + (eb_ptr + (EB_HEADSIZE+EB_NTSD_L_LEN)), (ulg)(eb_len - EB_NTSD_L_LEN)); + + if (error == PK_OK) { + if (SecuritySet(path, VolumeCaps, security_data)) { + error = PK_COOL; + if (!uO.tflag && (uO.qflag < 2) && + (!(VolumeCaps->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))) + Info(slide, 0, ((char *)slide, " (%ld bytes security)", + ntsd_ucSize)); + } + } + + free(security_data); + return error; +} + + + + +/********************************/ /* scan extra fields for something */ +/* Function EvalExtraFields() */ /* we happen to know */ +/********************************/ + +static int EvalExtraFields(__G__ path, ef_ptr, ef_len) + __GDEF + char *path; + uch *ef_ptr; + unsigned ef_len; +{ + int rc = PK_OK; + + if (!uO.X_flag) + return PK_OK; /* user said don't process ACLs; for now, no other + extra block types are handled here */ + + while (ef_len >= EB_HEADSIZE) + { + unsigned eb_id = makeword(EB_ID + ef_ptr); + unsigned eb_len = makeword(EB_LEN + ef_ptr); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + /* discovered some extra field inconsistency! */ + Trace((stderr, + "EvalExtraFields: block length %u > rest ef_size %u\n", eb_len, + ef_len - EB_HEADSIZE)); + break; + } + + switch (eb_id) + { + /* process security descriptor extra data if: + Caller is WinNT AND + Target local/remote drive supports acls AND + Target file is not a directory (else we defer processing + until later) + */ + case EF_NTSD: + if (IsWinNT()) { + VOLUMECAPS VolumeCaps; + + /* provide useful input */ + VolumeCaps.dwFileAttributes = G.pInfo->file_attr; + VolumeCaps.bUsePrivileges = (uO.X_flag > 1); + + /* check target volume capabilities - just fall through + * and try if fail */ + if (GetVolumeCaps(G.rootpath, path, &VolumeCaps) && + !(VolumeCaps.dwFileSystemFlags & FS_PERSISTENT_ACLS)) + { + rc = PK_OK; + break; + } + rc = SetSD(__G__ path, &VolumeCaps, ef_ptr, eb_len); + } else + rc = PK_OK; + break; + +#if 0 + /* perhaps later we can add support for unzipping OS/2 EAs to NT */ + case EF_OS2: + rc = SetEAs(__G__ path, ef_ptr); + break; + +#else /* ! 0 */ +#ifdef DEBUG + case EF_OS2: +#endif /* DEBUG */ +#endif /* ? 0 */ +#ifdef DEBUG + case EF_AV: + case EF_PKVMS: + case EF_PKW32: + case EF_PKUNIX: + case EF_IZVMS: + case EF_IZUNIX: + case EF_IZUNIX2: + case EF_TIME: + case EF_MAC3: + case EF_JLMAC: + case EF_ZIPIT: + case EF_VMCMS: + case EF_MVS: + case EF_ACL: + case EF_BEOS: + case EF_QDOS: + case EF_AOSVS: + case EF_SPARK: + case EF_MD5: + case EF_ASIUNIX: + break; /* shut up for other known e.f. blocks */ +#endif /* DEBUG */ + + default: + Trace((stderr, + "EvalExtraFields: unknown extra field block, ID=%u\n", + eb_id)); + break; + } + + ef_ptr += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + + if (rc != PK_OK) + break; + } + + return rc; +} + + + + +#ifndef SFX + +/**************************/ +/* Function test_NTSD() */ /* returns PK_WARN when NTSD data is invalid */ +/**************************/ + +#ifdef __BORLANDC__ +/* Turn off warning about not using all parameters for this function only */ +#pragma argsused +#endif +int test_NTSD(__G__ eb, eb_size, eb_ucptr, eb_ucsize) + __GDEF + uch *eb; + unsigned eb_size; + uch *eb_ucptr; + ulg eb_ucsize; +{ + int r = PK_OK; + + if (!ValidateSecurity(eb_ucptr)) + r = PK_WARN; + return r; + +} /* end function test_NTSD() */ + +#endif /* !SFX */ +#endif /* NTSD_EAS */ + + + + +/**********************/ +/* Function IsWinNT() */ +/**********************/ + +int IsWinNT(void) /* returns TRUE if real NT, FALSE if Win95 or Win32s */ +{ + static DWORD g_PlatformId = 0xFFFFFFFF; /* saved platform indicator */ + + if (g_PlatformId == 0xFFFFFFFF) { + /* note: GetVersionEx() doesn't exist on WinNT 3.1 */ + if (GetVersion() < 0x80000000) + g_PlatformId = TRUE; + else + g_PlatformId = FALSE; + } + return (int)g_PlatformId; +} + + +/* DEBUG_TIME insertion: */ +#ifdef DEBUG_TIME +static int show_NTFileTime(FILE *hdo, char *TTmsg, int isloc, FILETIME *pft); + +static int show_NTFileTime(FILE *hdo, char *TTmsg, int isloc, FILETIME *pft) +{ + SYSTEMTIME w32tm; + int rval; + + rval = FileTimeToSystemTime(pft, &w32tm); + if (!rval) { + fprintf(hdo, "%s\n %08lX,%08lX (%s) -> Conversion failed !!!\n", + TTmsg, (ulg)(pft->dwHighDateTime), (ulg)(pft->dwLowDateTime), + (isloc ? "local" : "UTC")); + } else { + fprintf(hdo, "%s\n %08lx,%08lx -> %04u-%02u-%02u, %02u:%02u:%02u %s\n", + TTmsg, (ulg)(pft->dwHighDateTime), (ulg)(pft->dwLowDateTime), + w32tm.wYear, w32tm.wMonth, w32tm.wDay, w32tm.wHour, + w32tm.wMinute, w32tm.wSecond, (isloc ? "local" : "UTC")); + } + return rval; +} +#define FTTrace(x) show_NTFileTime x +#else +#define FTTrace(x) +#endif /* DEBUG_TIME */ +/* end of TIME_DEBUG insertion */ + +#if (defined(USE_EF_UT_TIME) || defined(NT_TZBUG_WORKAROUND) || \ + defined(TIMESTAMP)) + +#ifndef IZ_USE_INT64 +# if (defined(__GNUC__) || defined(ULONG_LONG_MAX)) + typedef long long LLONG64; + typedef unsigned long long ULLNG64; +# define IZ_USE_INT64 +# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +# define IZ_USE_INT64 +# elif (defined(_MSC_VER) && (_MSC_VER >= 1100)) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +# define IZ_USE_INT64 +# elif (defined(__IBMC__) && (__IBMC__ >= 350)) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +# define IZ_USE_INT64 +# elif defined(HAVE_INT64) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +# define IZ_USE_INT64 +# endif +#endif + +/*****************************/ +/* Function utime2FileTime() */ /* convert Unix time_t format into the */ +/*****************************/ /* form used by SetFileTime() in NT/95 */ + +#define UNIX_TIME_ZERO_HI 0x019DB1DEUL +#define UNIX_TIME_ZERO_LO 0xD53E8000UL +#define NT_QUANTA_PER_UNIX 10000000L + +static void utime2FileTime(time_t ut, FILETIME *pft) +{ +#ifdef IZ_USE_INT64 + ULLNG64 NTtime; + + /* NT_QUANTA_PER_UNIX is small enough so that "ut * NT_QUANTA_PER_UNIX" + * cannot overflow in 64-bit signed calculation, regardless wether "ut" + * is signed or unsigned. */ + NTtime = ((LLONG64)ut * NT_QUANTA_PER_UNIX) + + ((ULLNG64)UNIX_TIME_ZERO_LO + ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); + pft->dwLowDateTime = (DWORD)NTtime; + pft->dwHighDateTime = (DWORD)(NTtime >> 32); + +#else /* !IZ_USE_INT64 (64-bit integer arithmetics may not be supported) */ + unsigned int b1, b2, carry = 0; + unsigned long r0, r1, r2, r3; + long r4; /* signed, to catch environments with signed time_t */ + + b1 = ut & 0xFFFF; + b2 = (ut >> 16) & 0xFFFF; /* if ut is over 32 bits, too bad */ + r1 = b1 * (NT_QUANTA_PER_UNIX & 0xFFFF); + r2 = b1 * (NT_QUANTA_PER_UNIX >> 16); + r3 = b2 * (NT_QUANTA_PER_UNIX & 0xFFFF); + r4 = b2 * (NT_QUANTA_PER_UNIX >> 16); + r0 = (r1 + (r2 << 16)) & 0xFFFFFFFFL; + if (r0 < r1) + carry++; + r1 = r0; + r0 = (r0 + (r3 << 16)) & 0xFFFFFFFFL; + if (r0 < r1) + carry++; + pft->dwLowDateTime = r0 + UNIX_TIME_ZERO_LO; + if (pft->dwLowDateTime < r0) + carry++; + pft->dwHighDateTime = r4 + (r2 >> 16) + (r3 >> 16) + + UNIX_TIME_ZERO_HI + carry; +#endif /* ?IZ_USE_INT64 */ + +} /* end function utime2FileTime() */ + + + +/******************************/ +/* Function FStampIsLocTime() */ +/******************************/ + +static int FStampIsLocTime(__GPRO__ const char *path) +{ + return (NTQueryVolInfo(__G__ path) ? G.lastVolLocTim : FALSE); +} + +#endif /* USE_EF_UT_TIME || NT_TZBUG_WORKAROUND || TIMESTAMP */ + + + +#ifndef NT_TZBUG_WORKAROUND +# define UTIME_BOUNDCHECK_1(utimval) \ + if (fs_uses_loctime) { \ + utime_dosmin = dos_to_unix_time(DOSTIME_MINIMUM); \ + if ((ulg)utimval < (ulg)utime_dosmin) \ + utimval = utime_dosmin; \ + } +# define UTIME_BOUNDCHECK_N(utimval) \ + if (fs_uses_loctime && ((ulg)utimval < (ulg)utime_dosmin)) \ + utimval = utime_dosmin; +# define NT_TZBUG_PRECOMPENSATE(ut, pft) + +#else /* NT_TZBUG_WORKAROUND */ +# define UNIX_TIME_UMAX_HI 0x0236485EUL +# define UNIX_TIME_UMAX_LO 0xD4A5E980UL +# define UNIX_TIME_SMIN_HI 0x0151669EUL +# define UNIX_TIME_SMIN_LO 0xD53E8000UL +# define UNIX_TIME_SMAX_HI 0x01E9FD1EUL +# define UNIX_TIME_SMAX_LO 0xD4A5E980UL +# define UTIME_1980_JAN_01_00_00 315532800L +# define UTIME_BOUNDCHECK_1(utimval) +# define UTIME_BOUNDCHECK_N(utimval) +# define NT_TZBUG_PRECOMPENSATE(ut, pft) \ + if (fs_uses_loctime) NTtzbugWorkaround(ut, pft); + + /* nonzero if `y' is a leap year, else zero */ +# define leap(y) (((y)%4 == 0 && (y)%100 != 0) || (y)%400 == 0) + /* number of leap years from 1970 to `y' (not including `y' itself) */ +# define nleap(y) (((y)-1969)/4 - ((y)-1901)/100 + ((y)-1601)/400) + +extern ZCONST ush ydays[]; /* defined in fileio.c */ + +/*****************************/ +/* Function FileTime2utime() */ +/*****************************/ + +static int FileTime2utime(const FILETIME *pft, time_t *ut) +{ +#ifdef IZ_USE_INT64 + ULLNG64 NTtime; + + NTtime = ((ULLNG64)pft->dwLowDateTime + + ((ULLNG64)pft->dwHighDateTime << 32)); + +#ifndef TIME_T_TYPE_DOUBLE + /* underflow and overflow handling */ +#ifdef CHECK_UTIME_SIGNED_UNSIGNED + if ((time_t)0x80000000L < (time_t)0L) + { + if (NTtime < ((ULLNG64)UNIX_TIME_SMIN_LO + + ((ULLNG64)UNIX_TIME_SMIN_HI << 32))) { + *ut = (time_t)LONG_MIN; + return FALSE; + } + if (NTtime > ((ULLNG64)UNIX_TIME_SMAX_LO + + ((ULLNG64)UNIX_TIME_SMAX_HI << 32))) { + *ut = (time_t)LONG_MAX; + return FALSE; + } + } + else +#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ + { + if (NTtime < ((ULLNG64)UNIX_TIME_ZERO_LO + + ((ULLNG64)UNIX_TIME_ZERO_HI << 32))) { + *ut = (time_t)0; + return FALSE; + } + if (NTtime > ((ULLNG64)UNIX_TIME_UMAX_LO + + ((ULLNG64)UNIX_TIME_UMAX_HI << 32))) { + *ut = (time_t)ULONG_MAX; + return FALSE; + } + } +#endif /* !TIME_T_TYPE_DOUBLE */ + + NTtime -= ((ULLNG64)UNIX_TIME_ZERO_LO + + ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); + *ut = (time_t)(NTtime / (unsigned long)NT_QUANTA_PER_UNIX); + return TRUE; +#else /* !IZ_USE_INT64 (64-bit integer arithmetics may not be supported) */ + time_t days; + SYSTEMTIME w32tm; + +#ifndef TIME_T_TYPE_DOUBLE + /* underflow and overflow handling */ +#ifdef CHECK_UTIME_SIGNED_UNSIGNED + if ((time_t)0x80000000L < (time_t)0L) + { + if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && + (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { + *ut = (time_t)LONG_MIN; + return FALSE; + if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { + *ut = (time_t)LONG_MAX; + return FALSE; + } + } + else +#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ + { + if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || + ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && + (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { + *ut = (time_t)0; + return FALSE; + } + if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { + *ut = (time_t)ULONG_MAX; + return FALSE; + } + } +#endif /* !TIME_T_TYPE_DOUBLE */ + + FileTimeToSystemTime(pft, &w32tm); + + /* set `days' to the number of days into the year */ + days = w32tm.wDay - 1 + ydays[w32tm.wMonth-1] + + (w32tm.wMonth > 2 && leap (w32tm.wYear)); + + /* now set `days' to the number of days since 1 Jan 1970 */ + days += 365 * (time_t)(w32tm.wYear - 1970) + + (time_t)(nleap(w32tm.wYear)); + + *ut = (time_t)(86400L * days + 3600L * (time_t)w32tm.wHour + + (time_t)(60 * w32tm.wMinute + w32tm.wSecond)); + return TRUE; +#endif /* ?IZ_USE_INT64 */ +} /* end function FileTime2utime() */ + + + +#ifdef W32_STAT_BANDAID +/*********************************/ +/* Function VFatFileTime2utime() */ +/*********************************/ + +static int VFatFileTime2utime(const FILETIME *pft, time_t *ut) +{ + FILETIME lft; +#ifndef HAVE_MKTIME + WORD wDOSDate, wDOSTime; +#else + SYSTEMTIME w32tm; + struct tm ltm; +#endif + + FileTimeToLocalFileTime(pft, &lft); + FTTrace((stdout, "VFatFT2utime, feed for mktime()", 1, &lft)); +#ifndef HAVE_MKTIME + /* This version of the FILETIME-to-UNIXTIME conversion function + * uses DOS-DATE-TIME format as intermediate stage. For modification + * and access times, this is no problem. But, the extra fine resolution + * of the VFAT-stored creation time gets lost. + */ + FileTimeToDosDateTime(&lft, &wDOSDate, &wDOSTime); + TTrace((stdout,"DosDateTime is %04u-%02u-%02u %02u:%02u:%02u\n", + (unsigned)((wDOSDate>>9)&0x7f)+1980,(unsigned)((wDOSDate>>5)&0x0f), + (unsigned)(wDOSDate&0x1f),(unsigned)((wDOSTime>>11)&0x1f), + (unsigned)((wDOSTime>>5)&0x3f),(unsigned)((wDOSTime<<1)&0x3e))); + *ut = dos_to_unix_time(((ulg)wDOSDate << 16) | (ulg)wDOSTime); + + /* a cheap error check: dos_to_unix_time() only returns an odd time + * when clipping at maximum time_t value. DOS_DATE_TIME values have + * a resolution of 2 seconds and are therefore even numbers. + */ + return (((*ut)&1) == (time_t)0); +#else /* HAVE_MKTIME */ + FileTimeToSystemTime(&lft, &w32tm); +#ifndef TIME_T_TYPE_DOUBLE + /* underflow and overflow handling */ + /* TODO: The range checks are not accurate, the actual limits may + * be off by one daylight-saving-time shift (typically 1 hour), + * depending on the current state of "is_dst". + */ +#ifdef CHECK_UTIME_SIGNED_UNSIGNED + if ((time_t)0x80000000L < (time_t)0L) + { + if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && + (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { + *ut = (time_t)LONG_MIN; + return FALSE; + if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { + *ut = (time_t)LONG_MAX; + return FALSE; + } + } + else +#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ + { + if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || + ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && + (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { + *ut = (time_t)0; + return FALSE; + } + if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { + *ut = (time_t)ULONG_MAX; + return FALSE; + } + } +#endif /* !TIME_T_TYPE_DOUBLE */ + ltm.tm_year = w32tm.wYear - 1900; + ltm.tm_mon = w32tm.wMonth - 1; + ltm.tm_mday = w32tm.wDay; + ltm.tm_hour = w32tm.wHour; + ltm.tm_min = w32tm.wMinute; + ltm.tm_sec = w32tm.wSecond; + ltm.tm_isdst = -1; /* let mktime determine if DST is in effect */ + *ut = mktime(<m); + + /* a cheap error check: mktime returns "(time_t)-1L" on conversion errors. + * Normally, we would have to apply a consistency check because "-1" + * could also be a valid time. But, it is quite unlikely to read back odd + * time numbers from file systems that store time stamps in DOS format. + * (The only known exception is creation time on VFAT partitions.) + */ + return (*ut != (time_t)-1L); +#endif /* ?HAVE_MKTIME */ + +} /* end function VFatFileTime2utime() */ +#endif /* W32_STAT_BANDAID */ + + + +/********************************/ +/* Function UTCtime2Localtime() */ /* borrowed from Zip's mkgmtime() */ +/********************************/ + +static time_t UTCtime2Localtime(time_t utctime) +{ + time_t utc = utctime; + struct tm *tm; + int years, months, days, hours, minutes, seconds; + + +#ifdef __BORLANDC__ /* Borland C++ 5.x crashes when trying to reference tm */ + if (utc < UTIME_1980_JAN_01_00_00) + utc = UTIME_1980_JAN_01_00_00; +#endif + tm = localtime(&utc); + if (tm == (struct tm *)NULL) + /* localtime() did not accept given utc time value; as an emergency + exit, the unconverted utctime value is returned */ + return utctime; + + years = tm->tm_year + 1900; /* year - 1900 -> year */ + months = tm->tm_mon; /* 0..11 */ + days = tm->tm_mday - 1; /* 1..31 -> 0..30 */ + hours = tm->tm_hour; /* 0..23 */ + minutes = tm->tm_min; /* 0..59 */ + seconds = tm->tm_sec; /* 0..61 in ANSI C */ + + /* set `days' to the number of days into the year */ + days += ydays[months] + (months > 1 && leap(years)); + + /* now set `days' to the number of days since 1 Jan 1970 */ + days += 365 * (years - 1970) + nleap(years); + + return (time_t)(86400L * (time_t)days + + (time_t)(3600L * hours + (60 * minutes + seconds))); + +} /* end function UTCtime2Localtime() */ + + + +/********************************/ +/* Function NTtzbugWorkaround() */ +/********************************/ + +static void NTtzbugWorkaround(time_t ut, FILETIME *pft) +{ + FILETIME C_RTL_locft, NTAPI_locft; + time_t ux_loctime = UTCtime2Localtime(ut); + + /* This routine is only used when the target file system stores time- + * stamps as local time in MSDOS format. Thus we make sure that the + * resulting timestamp is within the range of MSDOS date-time values. */ + if (ux_loctime < UTIME_1980_JAN_01_00_00) + ux_loctime = UTIME_1980_JAN_01_00_00; + + utime2FileTime(ux_loctime, &C_RTL_locft); + if (!FileTimeToLocalFileTime(pft, &NTAPI_locft)) + return; + else { + long time_shift_l, time_shift_h; + int carry = 0; + + time_shift_l = C_RTL_locft.dwLowDateTime - NTAPI_locft.dwLowDateTime; + if (C_RTL_locft.dwLowDateTime < NTAPI_locft.dwLowDateTime) + carry--; + time_shift_h = C_RTL_locft.dwHighDateTime - NTAPI_locft.dwHighDateTime; + pft->dwLowDateTime += time_shift_l; + if (pft->dwLowDateTime < (ulg)time_shift_l) + carry++; + pft->dwHighDateTime += time_shift_h + carry; + TTrace((stdout, "FileTime shift: %08lx:%08lx\n", + time_shift_h+carry,time_shift_l)); + } +} /* end function NTtzbugWorkaround() */ + +#endif /* ?NT_TZBUG_WORKAROUND */ + + + +/****************************/ /* Get the file time in a format that */ +/* Function getNTfiletime() */ /* can be used by SetFileTime() in NT */ +/****************************/ + +static int getNTfiletime(__G__ pModFT, pAccFT, pCreFT) + __GDEF + FILETIME *pModFT; + FILETIME *pAccFT; + FILETIME *pCreFT; +{ +#ifdef NT_TZBUG_WORKAROUND + time_t ux_modtime; +#else /* !NT_TZBUG_WORKAROUND */ + FILETIME locft; /* 64-bit value made up of two 32-bit [low & high] */ + WORD wDOSDate; /* for converting from DOS date to Windows NT */ + WORD wDOSTime; +#endif /* ?NT_TZBUG_WORKAROUND */ +#ifdef USE_EF_UT_TIME + unsigned eb_izux_flg; + iztimes z_utime; /* struct for Unix-style actime & modtime, + creatime */ +#endif +#if (defined(USE_EF_UT_TIME) && !defined(NT_TZBUG_WORKAROUND)) + time_t utime_dosmin; +# endif +#if (defined(USE_EF_UT_TIME) || defined(NT_TZBUG_WORKAROUND)) + int fs_uses_loctime = FStampIsLocTime(__G__ G.filename); +#endif + + /* Copy and/or convert time and date variables, if necessary; + * return a flag indicating which time stamps are available. */ +#ifdef USE_EF_UT_TIME + if (G.extra_field && +#ifdef IZ_CHECK_TZ + G.tz_is_valid && +#endif + ((eb_izux_flg = ef_scan_for_izux(G.extra_field, + G.lrec.extra_field_length, 0, G.lrec.last_mod_dos_datetime, + &z_utime, NULL)) & EB_UT_FL_MTIME)) + { + TTrace((stderr, "getNTfiletime: Unix e.f. modif. time = %lu\n", + z_utime.mtime)); + UTIME_BOUNDCHECK_1(z_utime.mtime) + utime2FileTime(z_utime.mtime, pModFT); + NT_TZBUG_PRECOMPENSATE(z_utime.mtime, pModFT) + if (eb_izux_flg & EB_UT_FL_ATIME) { + UTIME_BOUNDCHECK_N(z_utime.atime) + utime2FileTime(z_utime.atime, pAccFT); + NT_TZBUG_PRECOMPENSATE(z_utime.atime, pAccFT) + } + if (eb_izux_flg & EB_UT_FL_CTIME) { + UTIME_BOUNDCHECK_N(z_utime.ctime) + utime2FileTime(z_utime.ctime, pCreFT); + NT_TZBUG_PRECOMPENSATE(z_utime.ctime, pCreFT) + } + return (int)eb_izux_flg; + } +#endif /* USE_EF_UT_TIME */ +#ifdef NT_TZBUG_WORKAROUND + ux_modtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime); + utime2FileTime(ux_modtime, pModFT); + NT_TZBUG_PRECOMPENSATE(ux_modtime, pModFT) +#else /* !NT_TZBUG_WORKAROUND */ + + wDOSTime = (WORD)(G.lrec.last_mod_dos_datetime); + wDOSDate = (WORD)(G.lrec.last_mod_dos_datetime >> 16); + + /* The DosDateTimeToFileTime() function converts a DOS date/time + * into a 64-bit Windows NT file time */ + if (!DosDateTimeToFileTime(wDOSDate, wDOSTime, &locft)) + { + Info(slide, 0, ((char *)slide, "DosDateTime failed: %d\n", + (int)GetLastError())); + return 0; + } + if (!LocalFileTimeToFileTime(&locft, pModFT)) + { + Info(slide, 0, ((char *)slide, "LocalFileTime failed: %d\n", + (int)GetLastError())); + *pModFT = locft; + } +#endif /* ?NT_TZBUG_WORKAROUND */ + *pAccFT = *pModFT; + return (EB_UT_FL_MTIME | EB_UT_FL_ATIME); + +} /* end function getNTfiletime() */ + + + + +/**************************/ +/* Function SetFileSize() */ +/**************************/ + +int SetFileSize(FILE *file, ulg filesize) +{ +#ifdef __RSXNT__ + /* RSXNT environment lacks a translation function from C file pointer + to Win32-API file handle. So, simply do nothing. */ + return 0; +#else /* !__RSXNT__ */ + /* not yet verified, if that really creates an unfragmented file + rommel@ars.de + */ + HANDLE os_fh; + + /* Win9x supports FAT file system, only; presetting file size does + not help to prevent fragmentation. */ + if (!IsWinNT()) return 0; + + /* Win32-API calls require access to the Win32 file handle. + The interface function used to retrieve the Win32 handle for + a file opened by the C rtl is non-standard and may not be + available for every Win32 compiler environment. + (see also win32/win32.c of the Zip distribution) + */ + os_fh = (HANDLE)_get_osfhandle(fileno(file)); + /* move file pointer behind the last byte of the expected file size */ + if (SetFilePointer(os_fh, filesize, 0, FILE_BEGIN) == 0xFFFFFFFF) + return -1; + /* extend/truncate file to the current position */ + if (SetEndOfFile(os_fh) == 0) + return -1; + /* move file position pointer back to the start of the file! */ + return (SetFilePointer(os_fh, 0, 0, FILE_BEGIN) == 0xFFFFFFFF) ? -1 : 0; +#endif /* ?__RSXNT__ */ +} /* end function SetFileSize() */ + + + + +/****************************/ +/* Function close_outfile() */ +/****************************/ + +void close_outfile(__G) + __GDEF +{ + FILETIME Modft; /* File time type defined in NT, `last modified' time */ + FILETIME Accft; /* NT file time type, `last access' time */ + FILETIME Creft; /* NT file time type, `file creation' time */ + HANDLE hFile; /* File handle defined in NT */ + int gotTime; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(G.filename) + 1); + + INTERN_TO_ISO(G.filename, ansi_name); +# define Ansi_Fname ansi_name +#else +# define Ansi_Fname G.filename +#endif + + /* Close the file and then re-open it using the Win32 + * CreateFile call, so that the file can be created + * with GENERIC_WRITE access, otherwise the SetFileTime + * call will fail. */ + fclose(G.outfile); + + /* don't set the time stamp and attributes on standard output */ + if (uO.cflag) + return; + + gotTime = getNTfiletime(__G__ &Modft, &Accft, &Creft); + + /* open a handle to the file before processing extra fields; + we do this in case new security on file prevents us from updating + time stamps */ + hFile = CreateFile(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + + /* sfield@microsoft.com: set attributes before time in case we decide to + support other filetime members later. This also allows us to apply + attributes before the security is changed, which may prevent this + from succeeding otherwise. Also, since most files don't have + any interesting attributes, only change them if something other than + FILE_ATTRIBUTE_ARCHIVE appears in the attributes. This works well + as an optimization because FILE_ATTRIBUTE_ARCHIVE gets applied to the + file anyway, when it's created new. */ + if((G.pInfo->file_attr & 0x7F) & ~FILE_ATTRIBUTE_ARCHIVE) { + if (!SetFileAttributes(Ansi_Fname, G.pInfo->file_attr & 0x7F)) + Info(slide, 1, ((char *)slide, + "\nwarning (%d): could not set file attributes\n", + (int)GetLastError())); + } + +#ifdef NTSD_EAS + /* set extra fields, both stored-in-zipfile and .LONGNAME flavors */ + if (G.extra_field) { /* zipfile extra field may have extended attribs */ + int err = EvalExtraFields(__G__ G.filename, G.extra_field, + G.lrec.extra_field_length); + + if (err == IZ_EF_TRUNC) { + if (uO.qflag) + Info(slide, 1, ((char *)slide, "%-22s ", + FnFilter1(G.filename))); + Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD), + makeword(G.extra_field+2)-10, uO.qflag? "\n":"")); + } + } +#endif /* NTSD_EAS */ + + if ( hFile == INVALID_HANDLE_VALUE ) + Info(slide, 1, ((char *)slide, + "\nCreateFile error %d when trying set file time\n", + (int)GetLastError())); + else { + if (gotTime) { + FILETIME *pModft = (gotTime & EB_UT_FL_MTIME) ? &Modft : NULL; + FILETIME *pAccft = (gotTime & EB_UT_FL_ATIME) ? &Accft : NULL; + FILETIME *pCreft = (gotTime & EB_UT_FL_CTIME) ? &Creft : NULL; + + if (!SetFileTime(hFile, pCreft, pAccft, pModft)) + Info(slide, 0, ((char *)slide, "\nSetFileTime failed: %d\n", + (int)GetLastError())); + } + CloseHandle(hFile); + } + + return; + +#undef Ansi_Fname + +} /* end function close_outfile() */ + + + + +#ifdef TIMESTAMP + +/*************************/ +/* Function stamp_file() */ +/*************************/ + +int stamp_file(__GPRO__ ZCONST char *fname, time_t modtime) +{ + FILETIME Modft; /* File time type defined in NT, `last modified' time */ + HANDLE hFile; /* File handle defined in NT */ + int errstat = 0; /* return status: 0 == "OK", -1 == "Failure" */ +#ifndef NT_TZBUG_WORKAROUND + time_t utime_dosmin; /* internal variable for UTIME_BOUNDCHECK_1 */ +#endif + int fs_uses_loctime = FStampIsLocTime(__G__ fname); +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(fname) + 1); + + INTERN_TO_ISO(fname, ansi_name); +# define Ansi_Fname ansi_name +#else +# define Ansi_Fname fname +#endif + + /* open a handle to the file to prepare setting the mod-time stamp */ + hFile = CreateFile(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if ( hFile == INVALID_HANDLE_VALUE ) { + errstat = -1; + } else { + /* convert time_t modtime into WIN32 native 64bit format */ + UTIME_BOUNDCHECK_1(modtime) + utime2FileTime(modtime, &Modft); + NT_TZBUG_PRECOMPENSATE(modtime, &Modft) + /* set Access and Modification times of the file to modtime */ + if (!SetFileTime(hFile, NULL, &Modft, &Modft)) { + errstat = -1; + } + CloseHandle(hFile); + } + + return errstat; + +#undef Ansi_Fname +} /* end function stamp_file() */ + +#endif /* TIMESTAMP */ + + + + +/***********************/ +/* Function isfloppy() */ /* more precisely, is it removable? */ +/***********************/ + +static int isfloppy(int nDrive) /* 1 == A:, 2 == B:, etc. */ +{ + char rootPathName[4]; + + rootPathName[0] = (char)('A' + nDrive - 1); /* build the root path */ + rootPathName[1] = ':'; /* name, e.g. "A:/" */ + rootPathName[2] = '/'; + rootPathName[3] = '\0'; + + return (GetDriveType(rootPathName) == DRIVE_REMOVABLE); + +} /* end function isfloppy() */ + + + + +/*****************************/ +/* Function NTQueryVolInfo() */ +/*****************************/ + +/* + * Note: 8.3 limits on filenames apply only to old-style FAT filesystems. + * More recent versions of Windows (Windows NT 3.5 / Windows 4.0) + * can support long filenames (LFN) on FAT filesystems. Check the + * filesystem maximum component length field to detect LFN support. + */ + +static int NTQueryVolInfo(__GPRO__ const char *name) +{ + /* static char lastRootPath[4] = ""; */ + /* static int lastVolOldFAT; */ + /* static int lastVolLocTim; */ + char *tmp0; + char tmp1[MAX_PATH], tmp2[MAX_PATH]; + unsigned volSerNo, maxCompLen, fileSysFlags; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(name) + 1); + + INTERN_TO_ISO(name, ansi_name); + name = ansi_name; +#endif + + if ((!strncmp(name, "//", 2) || !strncmp(name,"\\\\", 2)) && + (name[2] != '\0' && name[2] != '/' && name[2] != '\\')) { + /* GetFullPathname() and GetVolumeInformation() do not work + * on UNC names. For now, we return "error". + * **FIXME**: check if UNC name is mapped to a drive letter + * and use mapped drive for volume info query. + */ + return FALSE; + } + if (isalpha((uch)name[0]) && (name[1] == ':')) + tmp0 = (char *)name; + else + { + if (!GetFullPathName(name, MAX_PATH, tmp1, &tmp0)) + return FALSE; + tmp0 = &tmp1[0]; + } + if (strncmp(G.lastRootPath, tmp0, 2) != 0) { + /* For speed, we skip repeated queries for the same device */ + strncpy(G.lastRootPath, tmp0, 2); /* Build the root path name, */ + G.lastRootPath[2] = '/'; /* e.g. "A:/" */ + G.lastRootPath[3] = '\0'; + + if (!GetVolumeInformation((LPCTSTR)G.lastRootPath, + (LPTSTR)tmp1, (DWORD)MAX_PATH, + (LPDWORD)&volSerNo, (LPDWORD)&maxCompLen, + (LPDWORD)&fileSysFlags, (LPTSTR)tmp2, (DWORD)MAX_PATH)) { + G.lastRootPath[0] = '\0'; + return FALSE; + } + + /* LFNs are available if the component length is > 12 */ + G.lastVolOldFAT = (maxCompLen <= 12); +/* G.lastVolOldFAT = !strncmp(strupr(tmp2), "FAT", 3); old version */ + + /* Volumes in (V)FAT and (OS/2) HPFS format store file timestamps in + * local time! + */ + G.lastVolLocTim = !strncmp(strupr(tmp2), "VFAT", 4) || + !strncmp(tmp2, "HPFS", 4) || + !strncmp(tmp2, "FAT", 3); + } + + return TRUE; + +} /* end function NTQueryVolInfo() */ + + + + +/*****************************/ +/* Function IsVolumeOldFAT() */ +/*****************************/ + +static int IsVolumeOldFAT(__GPRO__ const char *name) +{ + return (NTQueryVolInfo(__G__ name) ? G.lastVolOldFAT : FALSE); +} + + + + +#ifndef SFX + +/************************/ +/* Function do_wild() */ /* identical to OS/2 version */ +/************************/ + +char *do_wild(__G__ wildspec) + __GDEF + ZCONST char *wildspec; /* only used first time on a given dir */ +{ +/* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in w32cfg.h: + static zDIR *wild_dir = NULL; + static ZCONST char *wildname; + static char *dirname, matchname[FILNAMSIZ]; + static int notfirstcall=FALSE, have_dirname, dirnamelen; +*/ + char *fnamestart; + struct zdirent *file; + + /* Even when we're just returning wildspec, we *always* do so in + * matchname[]--calling routine is allowed to append four characters + * to the returned string, and wildspec may be a pointer to argv[]. + */ + if (!G.notfirstcall) { /* first call: must initialize everything */ + G.notfirstcall = TRUE; + + if (!iswild(wildspec)) { + strcpy(G.matchname, wildspec); + G.have_dirname = FALSE; + G.wild_dir = NULL; + return G.matchname; + } + + /* break the wildspec into a directory part and a wildcard filename */ + if ((G.wildname = MBSRCHR(wildspec, '/')) == (ZCONST char *)NULL && + (G.wildname = MBSRCHR(wildspec, ':')) == (ZCONST char *)NULL) { + G.dirname = "."; + G.dirnamelen = 1; + G.have_dirname = FALSE; + G.wildname = wildspec; + } else { + ++G.wildname; /* point at character after '/' or ':' */ + G.dirnamelen = G.wildname - wildspec; + if ((G.dirname = (char *)malloc(G.dirnamelen+1)) == NULL) { + Info(slide, 1, ((char *)slide, + "warning: cannot allocate wildcard buffers\n")); + strcpy(G.matchname, wildspec); + return G.matchname; /* but maybe filespec was not a wildcard */ + } + strncpy(G.dirname, wildspec, G.dirnamelen); + G.dirname[G.dirnamelen] = '\0'; /* terminate for strcpy below */ + G.have_dirname = TRUE; + } + Trace((stderr, "do_wild: dirname = [%s]\n", FnFilter1(G.dirname))); + + if ((G.wild_dir = (zvoid *)Opendir(G.dirname)) != NULL) { + if (G.have_dirname) { + strcpy(G.matchname, G.dirname); + fnamestart = G.matchname + G.dirnamelen; + } else + fnamestart = G.matchname; + while ((file = Readdir((zDIR *)G.wild_dir)) != NULL) { + Trace((stderr, "do_wild: Readdir returns %s\n", + FnFilter1(file->d_name))); + strcpy(fnamestart, file->d_name); + if (MBSRCHR(fnamestart, '.') == (char *)NULL) + strcat(fnamestart, "."); + if (match(fnamestart, G.wildname, 1) && /* 1 == ignore case */ + /* skip "." and ".." directory entries */ + strcmp(fnamestart, ".") && strcmp(fnamestart, "..")) { + Trace((stderr, "do_wild: match() succeeds\n")); + /* remove trailing dot */ + fnamestart = plastchar(fnamestart, strlen(fnamestart)); + if (*fnamestart == '.') + *fnamestart = '\0'; + return G.matchname; + } + } + /* if we get to here directory is exhausted, so close it */ + Closedir((zDIR *)G.wild_dir); + G.wild_dir = NULL; + } + Trace((stderr, "do_wild: Opendir(%s) returns NULL\n", + FnFilter1(G.dirname))); + + /* return the raw wildspec in case that works (e.g., directory not + * searchable, but filespec was not wild and file is readable) */ + strcpy(G.matchname, wildspec); + return G.matchname; + } + + /* last time through, might have failed opendir but returned raw wildspec */ + if (G.wild_dir == NULL) { + G.notfirstcall = FALSE; /* reset for new wildspec */ + if (G.have_dirname) + free(G.dirname); + return (char *)NULL; + } + + /* If we've gotten this far, we've read and matched at least one entry + * successfully (in a previous call), so dirname has been copied into + * matchname already. + */ + if (G.have_dirname) { + /* strcpy(G.matchname, G.dirname); */ + fnamestart = G.matchname + G.dirnamelen; + } else + fnamestart = G.matchname; + while ((file = Readdir((zDIR *)G.wild_dir)) != NULL) { + Trace((stderr, "do_wild: readdir returns %s\n", + FnFilter1(file->d_name))); + strcpy(fnamestart, file->d_name); + if (MBSRCHR(fnamestart, '.') == (char *)NULL) + strcat(fnamestart, "."); + if (match(fnamestart, G.wildname, 1)) { /* 1 == ignore case */ + Trace((stderr, "do_wild: match() succeeds\n")); + /* remove trailing dot */ + fnamestart = plastchar(fnamestart, strlen(fnamestart)); + if (*fnamestart == '.') + *fnamestart = '\0'; + return G.matchname; + } + } + + Closedir((zDIR *)G.wild_dir); /* at least one entry read; nothing left */ + G.wild_dir = NULL; + G.notfirstcall = FALSE; /* reset for new wildspec */ + if (G.have_dirname) + free(G.dirname); + return (char *)NULL; + +} /* end function do_wild() */ + +#endif /* !SFX */ + + + +/**********************/ +/* Function mapattr() */ +/**********************/ + +/* Identical to MS-DOS, OS/2 versions. However, NT has a lot of extra + * permission stuff, so this function should probably be extended in the + * future. */ + +int mapattr(__G) + __GDEF +{ + /* set archive bit for file entries (file is not backed up): */ + G.pInfo->file_attr = ((unsigned)G.crec.external_file_attributes | + (G.crec.external_file_attributes & FILE_ATTRIBUTE_DIRECTORY ? + 0 : FILE_ATTRIBUTE_ARCHIVE)) & 0xff; + return 0; + +} /* end function mapattr() */ + + + + +/************************/ +/* Function mapname() */ +/************************/ + +int mapname(__G__ renamed) + __GDEF + int renamed; +/* + * returns: + * MPN_OK - no problem detected + * MPN_INF_TRUNC - caution (truncated filename) + * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) + * MPN_ERR_SKIP - error -> skip entry + * MPN_ERR_TOOLONG - error -> path is too long + * MPN_NOMEM - error (memory allocation failed) -> skip entry + * [also MPN_VOL_LABEL, MPN_CREATED_DIR] + */ +{ + char pathcomp[FILNAMSIZ]; /* path-component buffer */ + char *pp, *cp=NULL; /* character pointers */ + char *lastsemi = NULL; /* pointer to last semi-colon in pathcomp */ +#ifdef ACORN_FTYPE_NFS + char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ + RO_extra_block *ef_spark; /* pointer Acorn FTYPE ef block */ +#endif + int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ + int error; + register unsigned workch; /* hold the character being tested */ + + +/*--------------------------------------------------------------------------- + Initialize various pointers and counters and stuff. + ---------------------------------------------------------------------------*/ + + /* can create path as long as not just freshening, or if user told us */ + G.create_dirs = (!uO.fflag || renamed); + + G.created_dir = FALSE; /* not yet */ + G.renamed_fullpath = FALSE; + G.fnlen = strlen(G.filename); + + if (renamed) { + cp = G.filename; /* point to beginning of renamed name... */ + if (*cp) do { + if (*cp == '\\') /* convert backslashes to forward */ + *cp = '/'; + } while (*PREINCSTR(cp)); + cp = G.filename; + /* use temporary rootpath if user gave full pathname */ + if (G.filename[0] == '/') { + G.renamed_fullpath = TRUE; + pathcomp[0] = '/'; /* copy the '/' and terminate */ + pathcomp[1] = '\0'; + ++cp; + } else if (isalpha((uch)G.filename[0]) && G.filename[1] == ':') { + G.renamed_fullpath = TRUE; + pp = pathcomp; + *pp++ = *cp++; /* copy the "d:" (+ '/', possibly) */ + *pp++ = *cp++; + if (*cp == '/') + *pp++ = *cp++; /* otherwise add "./"? */ + *pp = '\0'; + } + } + + /* pathcomp is ignored unless renamed_fullpath is TRUE: */ + if ((error = checkdir(__G__ pathcomp, INIT)) != 0) /* init path buffer */ + return error; /* ...unless no mem or vol label on hard disk */ + + *pathcomp = '\0'; /* initialize translation buffer */ + pp = pathcomp; /* point to translation buffer */ + if (!renamed) { /* cp already set if renamed */ + if (uO.jflag) /* junking directories */ + cp = (char *)MBSRCHR(G.filename, '/'); + if (cp == NULL) /* no '/' or not junking dirs */ + cp = G.filename; /* point to internal zipfile-member pathname */ + else + ++cp; /* point to start of last component of path */ + } + +/*--------------------------------------------------------------------------- + Begin main loop through characters in filename. + ---------------------------------------------------------------------------*/ + + for (; (workch = (uch)*cp) != 0; INCSTR(cp)) { + + switch (workch) { + case '/': /* can assume -j flag not given */ + *pp = '\0'; + maskDOSdevice(__G__ pathcomp); + if (((error = checkdir(__G__ pathcomp, APPEND_DIR)) & MPN_MASK) + > MPN_INF_TRUNC) + return error; + pp = pathcomp; /* reset conversion buffer for next piece */ + lastsemi = NULL; /* leave directory semi-colons alone */ + break; + + case '.': + if (pp == pathcomp) { /* nothing appended yet... */ + if (cp[1] == '/') { /* don't bother appending "./" to */ + ++cp; /* the path: skip behind the '/' */ + break; + } else if (!uO.ddotflag && cp[1] == '.' && cp[2] == '/') { + /* "../" dir traversal detected */ + cp += 2; /* skip over behind the '/' */ + killed_ddot = TRUE; /* set "show message" flag */ + break; + } + } + *pp++ = '.'; + break; + + case ':': /* drive names not stored in zipfile, */ + case '<': /* so no colons allowed */ + case '>': /* no redirection symbols allowed either */ + case '|': /* no pipe signs allowed */ + case '"': /* no double quotes allowed */ + case '?': /* no wildcards allowed */ + case '*': + *pp++ = '_'; /* these rules apply equally to FAT and NTFS */ + break; + case ';': /* start of VMS version? */ + lastsemi = pp; /* remove VMS version later... */ + *pp++ = ';'; /* but keep semicolon for now */ + break; + +#ifdef ACORN_FTYPE_NFS + case ',': /* NFS filetype extension */ + lastcomma = pp; + *pp++ = ','; /* keep for now; may need to remove */ + break; /* later, if requested */ +#endif + + case ' ': /* keep spaces unless specifically */ + /* NT cannot create filenames with spaces on FAT volumes */ + if (uO.sflag || IsVolumeOldFAT(__G__ G.filename)) + *pp++ = '_'; + else + *pp++ = ' '; + break; + + default: + /* allow European characters in filenames: */ + if (isprint(workch) || workch >= 127) +#ifdef _MBCS + { + memcpy(pp, cp, CLEN(cp)); + INCSTR(pp); + } +#else + *pp++ = (char)workch; +#endif + } /* end switch */ + } /* end while loop */ + + /* Show warning when stripping insecure "parent dir" path components */ + if (killed_ddot && QCOND2) { + Info(slide, 0, ((char *)slide, + "warning: skipped \"../\" path component(s) in %s\n", + FnFilter1(G.filename))); + if (!(error & ~MPN_MASK)) + error = (error & MPN_MASK) | PK_WARN; + } + +/*--------------------------------------------------------------------------- + Report if directory was created (and no file to create: filename ended + in '/'), check name to be sure it exists, and combine path and name be- + fore exiting. + ---------------------------------------------------------------------------*/ + + if (lastchar(G.filename, G.fnlen) == '/') { + checkdir(__G__ G.filename, GETPATH); + if (G.created_dir) { +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(G.filename) + 1); + + INTERN_TO_ISO(G.filename, ansi_name); +# define Ansi_Fname ansi_name +#else +# define Ansi_Fname G.filename +#endif + if (QCOND2) { + Info(slide, 0, ((char *)slide, " creating: %-22s\n", + FnFilter1(G.filename))); + } + + /* set file attributes: + The default for newly created directories is "DIR attribute + flags set", so there is no need to change attributes unless + one of the DOS style attribute flags is set. The readonly + attribute need not be masked, since it does not prevent + modifications in the new directory. */ + if(G.pInfo->file_attr & (0x7F & ~FILE_ATTRIBUTE_DIRECTORY)) { + if (!SetFileAttributes(Ansi_Fname, G.pInfo->file_attr & 0x7F)) + Info(slide, 1, ((char *)slide, + "\nwarning (%d): could not set file attributes for %s\n", + (int)GetLastError(), FnFilter1(G.filename))); + } + +#ifdef NTSD_EAS + /* set extra fields, both stored-in-zipfile and .LONGNAME flavors */ + if (G.extra_field) { /* zipfile e.f. may have extended attribs */ + int err = EvalExtraFields(__G__ G.filename, G.extra_field, + G.lrec.extra_field_length); + + if (err == IZ_EF_TRUNC) { + if (uO.qflag) + Info(slide, 1, ((char *)slide, "%-22s ", + FnFilter1(G.filename))); + Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD), + makeword(G.extra_field+2)-10, uO.qflag? "\n":"")); + } + } +#endif /* NTSD_EAS */ + /* set dir time (note trailing '/') */ + return (error & ~MPN_MASK) | MPN_CREATED_DIR; + } + /* dir existed already; don't look for data to extract */ + return (error & ~MPN_MASK) | MPN_INF_SKIP; + } + + *pp = '\0'; /* done with pathcomp: terminate it */ + + /* if not saving them, remove VMS version numbers (appended "###") */ + if (!uO.V_flag && lastsemi) { + pp = lastsemi + 1; /* semi-colon was kept: expect #'s after */ + while (isdigit((uch)(*pp))) + ++pp; + if (*pp == '\0') /* only digits between ';' and end: nuke */ + *lastsemi = '\0'; + } + +#ifdef ACORN_FTYPE_NFS + /* translate Acorn filetype information if asked to do so */ + if (uO.acorn_nfs_ext && + (ef_spark = (RO_extra_block *) + getRISCOSexfield(G.extra_field, G.lrec.extra_field_length)) + != (RO_extra_block *)NULL) + { + /* file *must* have a RISC OS extra field */ + long ft = (long)makelong((ef_spark->loadaddr); + /*32-bit*/ + if (lastcomma) { + pp = lastcomma + 1; + while (isxdigit((uch)(*pp))) ++pp; + if (pp == lastcomma+4 && *pp == '\0') *lastcomma='\0'; /* nuke */ + } + if ((ft & 1<<31)==0) ft=0x000FFD00; + sprintf(pathcomp+strlen(pathcomp), ",%03x", (int)(ft>>8) & 0xFFF); + } +#endif /* ACORN_FTYPE_NFS */ + + maskDOSdevice(__G__ pathcomp); + + if (*pathcomp == '\0') { + Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n", + FnFilter1(G.filename))); + return (error & ~MPN_MASK) | MPN_ERR_SKIP; + } + + checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ + checkdir(__G__ G.filename, GETPATH); + + if (G.pInfo->vollabel) { /* set the volume label now */ + char drive[4]; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(G.filename) + 1); + INTERN_TO_ISO(G.filename, ansi_name); +# define Ansi_Fname ansi_name +#else +# define Ansi_Fname G.filename +#endif + + /* Build a drive string, e.g. "b:" */ + drive[0] = (char)('a' + G.nLabelDrive - 1); + strcpy(drive + 1, ":\\"); + if (QCOND2) + Info(slide, 0, ((char *)slide, "labelling %s %-22s\n", drive, + FnFilter1(G.filename))); + if (!SetVolumeLabel(drive, Ansi_Fname)) { + Info(slide, 1, ((char *)slide, + "mapname: error setting volume label\n")); + return (error & ~MPN_MASK) | MPN_ERR_SKIP; + } + /* success: skip the "extraction" quietly */ + return (error & ~MPN_MASK) | MPN_INF_SKIP; +#undef Ansi_Fname + } + + Trace((stderr, "mapname returns with filename = [%s] (error = %d)\n\n", + FnFilter1(G.filename), error)); + return error; + +} /* end function mapname() */ + + + + +/****************************/ +/* Function maskDOSdevice() */ +/****************************/ + +static void maskDOSdevice(__G__ pathcomp) + __GDEF + char *pathcomp; +{ +/*--------------------------------------------------------------------------- + Put an underscore in front of the file name if the file name is a + DOS/WINDOWS device name like CON.*, AUX.*, PRN.*, etc. Trying to + extract such a file would fail at best and wedge us at worst. + ---------------------------------------------------------------------------*/ +#if !defined(S_IFCHR) && defined(_S_IFCHR) +# define S_IFCHR _S_IFCHR +#endif +#if !defined(S_ISCHR) +# if defined(_S_ISCHR) +# define S_ISCHR(m) _S_ISCHR(m) +# elif defined(S_IFCHR) +# define S_ISCHR(m) ((m) & S_IFCHR) +# endif +#endif + +#ifdef DEBUG + if (stat(pathcomp, &G.statbuf) == 0) { + Trace((stderr, + "maskDOSdevice() stat(\"%s\", buf) st_mode result: %X, %o\n", + FnFilter1(pathcomp), G.statbuf.st_mode, G.statbuf.st_mode)); + } else { + Trace((stderr, "maskDOSdevice() stat(\"%s\", buf) failed\n", + FnFilter1(pathcomp))); + } +#endif + if (stat(pathcomp, &G.statbuf) == 0 && S_ISCHR(G.statbuf.st_mode)) { + extent i; + + /* pathcomp contains a name of a DOS character device (builtin or + * installed device driver). + * Prepend a '_' to allow creation of the item in the file system. + */ + for (i = strlen(pathcomp) + 1; i > 0; --i) + pathcomp[i] = pathcomp[i - 1]; + pathcomp[0] = '_'; + } +} /* end function maskDOSdevice() */ + + + + + +/**********************/ +/* Function map2fat() */ /* Not quite identical to OS/2 version */ +/**********************/ + +static void map2fat(pathcomp, pEndFAT) + char *pathcomp, **pEndFAT; +{ + char *ppc = pathcomp; /* variable pointer to pathcomp */ + char *pEnd = *pEndFAT; /* variable pointer to buildpathFAT */ + char *pBegin = *pEndFAT; /* constant pointer to start of this comp. */ + char *last_dot = NULL; /* last dot not converted to underscore */ + register unsigned workch; /* hold the character being tested */ + + + /* Only need check those characters which are legal in NTFS but not + * in FAT: to get here, must already have passed through mapname. + * Also must truncate path component to ensure 8.3 compliance. + */ + while ((workch = (uch)*ppc++) != 0) { + switch (workch) { + case '[': + case ']': + case '+': + case ',': + case ';': + case '=': + *pEnd++ = '_'; /* convert brackets to underscores */ + break; + + case '.': + if (pEnd == *pEndFAT) { /* nothing appended yet... */ + if (*ppc == '\0') /* don't bother appending a */ + break; /* "./" component to the path */ + else if (*ppc == '.' && ppc[1] == '\0') { /* "../" */ + *pEnd++ = '.'; /* add first dot, */ + *pEnd++ = '.'; /* add second dot, and */ + ++ppc; /* skip over to pathcomp's end */ + } else { /* FAT doesn't allow null filename */ + *pEnd++ = '_'; /* bodies, so map .exrc -> _exrc */ + } /* (_.exr would keep max 3 chars) */ + } else { /* found dot within path component */ + last_dot = pEnd; /* point at last dot so far... */ + *pEnd++ = '_'; /* convert to underscore for now */ + } + break; + + default: + *pEnd++ = (char)workch; + + } /* end switch */ + } /* end while loop */ + + *pEnd = '\0'; /* terminate buildpathFAT */ + + /* NOTE: keep in mind that pEnd points to the end of the path + * component, and *pEndFAT still points to the *beginning* of it... + * Also note that the algorithm does not try to get too fancy: + * if there are no dots already, the name either gets truncated + * at 8 characters or the last underscore is converted to a dot + * (only if more characters are saved that way). In no case is + * a dot inserted between existing characters. + */ + if (last_dot == NULL) { /* no dots: check for underscores... */ + char *plu = MBSRCHR(pBegin, '_'); /* pointer to last underscore */ + + if ((plu != NULL) && /* found underscore: convert to dot? */ + (MIN(plu - pBegin, 8) + MIN(pEnd - plu - 1, 3) > 8)) { + last_dot = plu; /* be lazy: drop through to next if-blk */ + } else if ((pEnd - *pEndFAT) > 8) { + /* no underscore; or converting underscore to dot would save less + chars than leaving everything in the basename */ + *pEndFAT += 8; /* truncate at 8 chars */ + **pEndFAT = '\0'; + } else + *pEndFAT = pEnd; /* whole thing fits into 8 chars or less */ + } + + if (last_dot != NULL) { /* one dot is OK: */ + *last_dot = '.'; /* put it back in */ + + if ((last_dot - pBegin) > 8) { + char *p, *q; + int i; + + p = last_dot; + q = last_dot = pBegin + 8; + for (i = 0; (i < 4) && *p; ++i) /* too many chars in basename: */ + *q++ = *p++; /* shift .ext left and trun- */ + *q = '\0'; /* cate/terminate it */ + *pEndFAT = q; + } else if ((pEnd - last_dot) > 4) { /* too many chars in extension */ + *pEndFAT = last_dot + 4; + **pEndFAT = '\0'; + } else + *pEndFAT = pEnd; /* filename is fine; point at terminating zero */ + + if ((last_dot - pBegin) > 0 && last_dot[-1] == ' ') + last_dot[-1] = '_'; /* NO blank in front of '.'! */ + } +} /* end function map2fat() */ + + + + +/***********************/ /* Borrowed from os2.c for UnZip 5.1. */ +/* Function checkdir() */ /* Difference: no EA stuff */ +/***********************/ /* HPFS stuff works on NTFS too */ + +int checkdir(__G__ pathcomp, flag) + __GDEF + char *pathcomp; + int flag; +/* + * returns: + * MPN_OK - no problem detected + * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename + * MPN_INF_SKIP - path doesn't exist, not allowed to create + * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path + * exists and is not a directory, but is supposed to be + * MPN_ERR_TOOLONG - path is too long + * MPN_NOMEM - can't allocate memory for filename buffers + */ +{ + /* static int rootlen = 0; */ /* length of rootpath */ + /* static char *rootpath; */ /* user's "extract-to" directory */ + /* static char *buildpathHPFS; */ /* full path (so far) to extracted file, */ + /* static char *buildpathFAT; */ /* both HPFS/EA (main) and FAT versions */ + /* static char *endHPFS; */ /* corresponding pointers to end of */ + /* static char *endFAT; */ /* buildpath ('\0') */ + +# define FN_MASK 7 +# define FUNCTION (flag & FN_MASK) + + + +/*--------------------------------------------------------------------------- + APPEND_DIR: append the path component to the path being built and check + for its existence. If doesn't exist and we are creating directories, do + so for this one; else signal success or error as appropriate. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == APPEND_DIR) { + char *p = pathcomp; + int too_long = FALSE; + + Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); + while ((*G.endHPFS = *p++) != '\0') /* copy to HPFS filename */ + ++G.endHPFS; + if (!IsVolumeOldFAT(__G__ G.buildpathHPFS)) { + p = pathcomp; + while ((*G.endFAT = *p++) != '\0') /* copy to FAT filename, too */ + ++G.endFAT; + } else + map2fat(pathcomp, &G.endFAT); /* map into FAT fn, update endFAT */ + + /* GRR: could do better check, see if overrunning buffer as we go: + * check endHPFS-buildpathHPFS after each append, set warning variable + * if within 20 of FILNAMSIZ; then if var set, do careful check when + * appending. Clear variable when begin new path. */ + + /* next check: need to append '/', at least one-char name, '\0' */ + if ((G.endHPFS-G.buildpathHPFS) > FILNAMSIZ-3) + too_long = TRUE; /* check if extracting dir? */ +#ifdef FIX_STAT_BUG + /* Borland C++ 5.0 does not handle a call to stat() well if the + * directory does not exist (it tends to crash in strange places.) + * This is apparently a problem only when compiling for GUI rather + * than console. The code below attempts to work around this problem. + */ + if (access(G.buildpathFAT, 0) != 0) { + if (!G.create_dirs) { /* told not to create (freshening) */ + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* path doesn't exist: nothing to do */ + return MPN_INF_SKIP; + } + if (too_long) { /* GRR: should allow FAT extraction w/o EAs */ + Info(slide, 1, ((char *)slide, + "checkdir error: path too long: %s\n", + FnFilter1(G.buildpathHPFS))); + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + if (MKDIR(G.buildpathFAT, 0777) == -1) { /* create the directory */ + Info(slide, 1, ((char *)slide, + "checkdir error: cannot create %s\n\ + unable to process %s.\n", + FnFilter2(G.buildpathFAT), FnFilter1(G.filename))); + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* path didn't exist, tried to create, failed */ + return MPN_ERR_SKIP; + } + G.created_dir = TRUE; + } +#endif /* FIX_STAT_BUG */ + if (SSTAT(G.buildpathFAT, &G.statbuf)) /* path doesn't exist */ + { + if (!G.create_dirs) { /* told not to create (freshening) */ + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* path doesn't exist: nothing to do */ + return MPN_INF_SKIP; + } + if (too_long) { /* GRR: should allow FAT extraction w/o EAs */ + Info(slide, 1, ((char *)slide, + "checkdir error: path too long: %s\n", + FnFilter1(G.buildpathHPFS))); + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + if (MKDIR(G.buildpathFAT, 0777) == -1) { /* create the directory */ + Info(slide, 1, ((char *)slide, + "checkdir error: cannot create %s\n\ + unable to process %s.\n", + FnFilter2(G.buildpathFAT), FnFilter1(G.filename))); + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* path didn't exist, tried to create, failed */ + return MPN_ERR_SKIP; + } + G.created_dir = TRUE; + } else if (!S_ISDIR(G.statbuf.st_mode)) { + Info(slide, 1, ((char *)slide, + "checkdir error: %s exists but is not directory\n \ + unable to process %s.\n", + FnFilter2(G.buildpathFAT), FnFilter1(G.filename))); + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* path existed but wasn't dir */ + return MPN_ERR_SKIP; + } + if (too_long) { + Info(slide, 1, ((char *)slide, + "checkdir error: path too long: %s\n", + FnFilter1(G.buildpathHPFS))); + free(G.buildpathHPFS); + free(G.buildpathFAT); + /* no room for filenames: fatal */ + return MPN_ERR_TOOLONG; + } + *G.endHPFS++ = '/'; + *G.endFAT++ = '/'; + *G.endHPFS = *G.endFAT = '\0'; + Trace((stderr, "buildpathHPFS now = [%s]\nbuildpathFAT now = [%s]\n", + FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT))); + return MPN_OK; + + } /* end if (FUNCTION == APPEND_DIR) */ + +/*--------------------------------------------------------------------------- + GETPATH: copy full FAT path to the string pointed at by pathcomp (want + filename to reflect name used on disk, not EAs; if full path is HPFS, + buildpathFAT and buildpathHPFS will be identical). Also free both paths. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == GETPATH) { + Trace((stderr, "getting and freeing FAT path [%s]\n", + FnFilter1(G.buildpathFAT))); + Trace((stderr, "freeing HPFS path [%s]\n", + FnFilter1(G.buildpathHPFS))); + strcpy(pathcomp, G.buildpathFAT); + free(G.buildpathFAT); + free(G.buildpathHPFS); + G.buildpathHPFS = G.buildpathFAT = G.endHPFS = G.endFAT = NULL; + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + APPEND_NAME: assume the path component is the filename; append it and + return without checking for existence. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == APPEND_NAME) { + char *p = pathcomp; + int error = MPN_OK; + + Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); + while ((*G.endHPFS = *p++) != '\0') { /* copy to HPFS filename */ + ++G.endHPFS; + if ((G.endHPFS-G.buildpathHPFS) >= FILNAMSIZ) { + *--G.endHPFS = '\0'; + Info(slide, 1, ((char *)slide, + "checkdir warning: path too long; truncating\n \ + %s\n -> %s\n", + FnFilter1(G.filename), FnFilter2(G.buildpathHPFS))); + error = MPN_INF_TRUNC; /* filename truncated */ + } + } + + if ( G.pInfo->vollabel || !IsVolumeOldFAT(__G__ G.buildpathHPFS)) { + p = pathcomp; + while ((*G.endFAT = *p++) != '\0') /* copy to FAT filename, too */ + ++G.endFAT; + } else + map2fat(pathcomp, &G.endFAT); /* map into FAT fn, update endFAT */ + Trace((stderr, "buildpathHPFS: %s\nbuildpathFAT: %s\n", + FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT))); + + return error; /* could check for existence, prompt for new name... */ + + } /* end if (FUNCTION == APPEND_NAME) */ + +/*--------------------------------------------------------------------------- + INIT: allocate and initialize buffer space for the file currently being + extracted. If file was renamed with an absolute path, don't prepend the + extract-to path. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == INIT) { + Trace((stderr, "initializing buildpathHPFS and buildpathFAT to ")); +#ifdef ACORN_FTYPE_NFS + if ((G.buildpathHPFS = (char *)malloc(G.fnlen+G.rootlen+ + (uO.acorn_nfs_ext ? 5 : 1))) +#else + if ((G.buildpathHPFS = (char *)malloc(G.fnlen+G.rootlen+1)) +#endif + == NULL) + return MPN_NOMEM; +#ifdef ACORN_FTYPE_NFS + if ((G.buildpathFAT = (char *)malloc(G.fnlen+G.rootlen+ + (uO.acorn_nfs_ext ? 5 : 1))) +#else + if ((G.buildpathFAT = (char *)malloc(G.fnlen+G.rootlen+1)) +#endif + == NULL) { + free(G.buildpathHPFS); + return MPN_NOMEM; + } + if (G.pInfo->vollabel) { /* use root or renamed path, but don't store */ +/* GRR: for network drives, do strchr() and return IZ_VOL_LABEL if not [1] */ + if (G.renamed_fullpath && pathcomp[1] == ':') + *G.buildpathHPFS = (char)ToLower(*pathcomp); + else if (!G.renamed_fullpath && G.rootlen > 1 && + G.rootpath[1] == ':') + *G.buildpathHPFS = (char)ToLower(*G.rootpath); + else { + char tmpN[MAX_PATH], *tmpP; + if (GetFullPathName(".", MAX_PATH, tmpN, &tmpP) > MAX_PATH) + { /* by definition of MAX_PATH we should never get here */ + Info(slide, 1, ((char *)slide, + "checkdir warning: current dir path too long\n")); + return MPN_INF_TRUNC; /* can't get drive letter */ + } + G.nLabelDrive = *tmpN - 'a' + 1; + *G.buildpathHPFS = (char)(G.nLabelDrive - 1 + 'a'); + } + G.nLabelDrive = *G.buildpathHPFS - 'a' + 1; /* save for mapname() */ + if (uO.volflag == 0 || *G.buildpathHPFS < 'a' /* no labels/bogus? */ + || (uO.volflag == 1 && !isfloppy(G.nLabelDrive))) { /* !fixed */ + free(G.buildpathHPFS); + free(G.buildpathFAT); + return MPN_VOL_LABEL; /* skipping with message */ + } + *G.buildpathHPFS = '\0'; + } else if (G.renamed_fullpath) /* pathcomp = valid data */ + strcpy(G.buildpathHPFS, pathcomp); + else if (G.rootlen > 0) + strcpy(G.buildpathHPFS, G.rootpath); + else + *G.buildpathHPFS = '\0'; + G.endHPFS = G.buildpathHPFS; + G.endFAT = G.buildpathFAT; + while ((*G.endFAT = *G.endHPFS) != '\0') { + ++G.endFAT; + ++G.endHPFS; + } + Trace((stderr, "[%s]\n", FnFilter1(G.buildpathHPFS))); + return MPN_OK; + } + +/*--------------------------------------------------------------------------- + ROOT: if appropriate, store the path in rootpath and create it if neces- + sary; else assume it's a zipfile member and return. This path segment + gets used in extracting all members from every zipfile specified on the + command line. Note that under OS/2 and MS-DOS, if a candidate extract-to + directory specification includes a drive letter (leading "x:"), it is + treated just as if it had a trailing '/'--that is, one directory level + will be created if the path doesn't exist, unless this is otherwise pro- + hibited (e.g., freshening). + ---------------------------------------------------------------------------*/ + +#if (!defined(SFX) || defined(SFX_EXDIR)) + if (FUNCTION == ROOT) { + Trace((stderr, "initializing root path to [%s]\n", + FnFilter1(pathcomp))); + if (pathcomp == NULL) { + G.rootlen = 0; + return MPN_OK; + } + if (G.rootlen > 0) /* rootpath was already set, nothing to do */ + return MPN_OK; + if ((G.rootlen = strlen(pathcomp)) > 0) { + int had_trailing_pathsep=FALSE, has_drive=FALSE, add_dot=FALSE; + char *tmproot; + + if ((tmproot = (char *)malloc(G.rootlen+3)) == (char *)NULL) { + G.rootlen = 0; + return MPN_NOMEM; + } + strcpy(tmproot, pathcomp); + if (isalpha((uch)tmproot[0]) && tmproot[1] == ':') + has_drive = TRUE; /* drive designator */ + if (tmproot[G.rootlen-1] == '/' || tmproot[G.rootlen-1] == '\\') { + tmproot[--G.rootlen] = '\0'; + had_trailing_pathsep = TRUE; + } + if (has_drive && (G.rootlen == 2)) { + if (!had_trailing_pathsep) /* i.e., original wasn't "x:/" */ + add_dot = TRUE; /* relative path: add '.' before '/' */ + } else if (G.rootlen > 0) { /* need not check "x:." and "x:/" */ + if (SSTAT(tmproot, &G.statbuf) || !S_ISDIR(G.statbuf.st_mode)) + { + /* path does not exist */ + if (!G.create_dirs /* || iswild(tmproot) */ ) { + free(tmproot); + G.rootlen = 0; + /* treat as stored file */ + return MPN_INF_SKIP; + } + /* create directory (could add loop here scanning tmproot + * to create more than one level, but really necessary?) */ + if (MKDIR(tmproot, 0777) == -1) { + Info(slide, 1, ((char *)slide, + "checkdir: cannot create extraction directory: %s\n", + FnFilter1(tmproot))); + free(tmproot); + G.rootlen = 0; + /* path didn't exist, tried to create, failed: */ + /* file exists, or need 2+ subdir levels */ + return MPN_ERR_SKIP; + } + } + } + if (add_dot) /* had just "x:", make "x:." */ + tmproot[G.rootlen++] = '.'; + tmproot[G.rootlen++] = '/'; + tmproot[G.rootlen] = '\0'; + if ((G.rootpath = (char *)realloc(tmproot, G.rootlen+1)) == NULL) { + free(tmproot); + G.rootlen = 0; + return MPN_NOMEM; + } + Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath))); + } + return MPN_OK; + } +#endif /* !SFX || SFX_EXDIR */ + +/*--------------------------------------------------------------------------- + END: free rootpath, immediately prior to program exit. + ---------------------------------------------------------------------------*/ + + if (FUNCTION == END) { + Trace((stderr, "freeing rootpath\n")); + if (G.rootlen > 0) { + free(G.rootpath); + G.rootlen = 0; + } + return MPN_OK; + } + + return MPN_INVALID; /* should never reach */ + +} /* end function checkdir() */ + + + + + +#ifndef SFX + +/*************************/ +/* Function dateformat() */ +/*************************/ + +int dateformat() +{ + TCHAR df[2]; /* LOCALE_IDATE has a maximum value of 2 */ + + if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDATE, df, 2) != 0) { + switch (df[0]) + { + case '0': + return DF_MDY; + case '1': + return DF_DMY; + case '2': + return DF_YMD; + } + } + return DF_MDY; +} + + +#ifndef WINDLL + +/************************/ +/* Function version() */ +/************************/ + +void version(__G) + __GDEF +{ + int len; +#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__DJGPP__)) + char buf[80]; +#if (defined(_MSC_VER) && (_MSC_VER > 900)) + char buf2[80]; +#endif +#endif + + len = sprintf((char *)slide, CompiledWith, + +#if defined(_MSC_VER) /* MSC == VC++, but what about SDK compiler? */ + (sprintf(buf, "Microsoft C %d.%02d ", _MSC_VER/100, _MSC_VER%100), buf), +# if (_MSC_VER == 800) + "(Visual C++ v1.1)", +# elif (_MSC_VER == 850) + "(Windows NT v3.5 SDK)", +# elif (_MSC_VER == 900) + "(Visual C++ v2.x)", +# elif (_MSC_VER > 900) + (sprintf(buf2, "(Visual C++ %d.%d)", _MSC_VER/100 - 6, _MSC_VER%100/10), + buf2), +# else + "(bad version)", +# endif +#elif defined(__WATCOMC__) +# if (__WATCOMC__ % 10 > 0) + (sprintf(buf, "Watcom C/C++ %d.%02d", __WATCOMC__ / 100, + __WATCOMC__ % 100), buf), "", +# else + (sprintf(buf, "Watcom C/C++ %d.%d", __WATCOMC__ / 100, + (__WATCOMC__ % 100) / 10), buf), "", +# endif +#elif defined(__BORLANDC__) + "Borland C++", +# if (__BORLANDC__ < 0x0200) + " 1.0", +# elif (__BORLANDC__ == 0x0200) + " 2.0", +# elif (__BORLANDC__ == 0x0400) + " 3.0", +# elif (__BORLANDC__ == 0x0410) /* __BCPLUSPLUS__ = 0x0310 */ + " 3.1", +# elif (__BORLANDC__ == 0x0452) /* __BCPLUSPLUS__ = 0x0320 */ + " 4.0 or 4.02", +# elif (__BORLANDC__ == 0x0460) /* __BCPLUSPLUS__ = 0x0340 */ + " 4.5", +# elif (__BORLANDC__ == 0x0500) /* __BCPLUSPLUS__ = 0x0340 */ + " 5.0", +# elif (__BORLANDC__ == 0x0520) /* __BCPLUSPLUS__ = 0x0520 */ + " 5.2 (C++ Builder 1.0)", +# elif (__BORLANDC__ == 0x0530) /* __BCPLUSPLUS__ = 0x0530 */ + " 5.3 (C++ Builder 3.0)", +# elif (__BORLANDC__ == 0x0540) /* __BCPLUSPLUS__ = 0x0540 */ + " 5.4 (C++ Builder 4.0)", +# elif (__BORLANDC__ == 0x0550) /* __TURBOC__ = 0x0550 */ + " 5.5 (C++ Builder 5.0)", +# elif (__BORLANDC__ == 0x0551) /* __TURBOC__ = 0x0551 */ + " 5.5.1 (C++ Builder 5.0.1)", +# else + " later than 5.5.1", +# endif +#elif defined(__LCC__) + "LCC-Win32", "", +#elif defined(__GNUC__) +# if defined(__RSXNT__) +# if (defined(__DJGPP__) && !defined(__EMX__)) + (sprintf(buf, "rsxnt(djgpp v%d.%02d) / gcc ", + __DJGPP__, __DJGPP_MINOR__), buf), +# elif defined(__DJGPP__) + (sprintf(buf, "rsxnt(emx+djgpp v%d.%02d) / gcc ", + __DJGPP__, __DJGPP_MINOR__), buf), +# elif (defined(__GO32__) && !defined(__EMX__)) + "rsxnt(djgpp v1.x) / gcc ", +# elif defined(__GO32__) + "rsxnt(emx + djgpp v1.x) / gcc ", +# elif defined(__EMX__) + "rsxnt(emx)+gcc ", +# else + "rsxnt(unknown) / gcc ", +# endif +# elif defined(__CYGWIN__) + "cygnus win32 / gcc ", +# elif defined(__MINGW32__) + "mingw32 / gcc ", +# else + "gcc ", +# endif + __VERSION__, +#else /* !_MSC_VER, !__WATCOMC__, !__BORLANDC__, !__LCC__, !__GNUC__ */ + "unknown compiler (SDK?)", "", +#endif /* ?compilers */ + + "\nWindows 95 / Windows NT", " (32-bit)", + +#ifdef __DATE__ + " on ", __DATE__ +#else + "", "" +#endif + ); + + (*G.message)((zvoid *)&G, slide, (ulg)len, 0); + + return; + +} /* end function version() */ + +#endif /* !WINDLL */ +#endif /* !SFX */ + + + +#ifdef MORE + +int screensize(int *tt_rows, int *tt_cols) +{ + HANDLE hstdout; + CONSOLE_SCREEN_BUFFER_INFO scr; + + hstdout = GetStdHandle(STD_OUTPUT_HANDLE); + GetConsoleScreenBufferInfo(hstdout, &scr); + if (tt_rows != NULL) *tt_rows = scr.srWindow.Bottom - scr.srWindow.Top + 1; + if (tt_cols != NULL) *tt_cols = scr.srWindow.Right - scr.srWindow.Left + 1; + return 0; /* signal success */ +} + +#endif /* MORE */ + + + +#ifdef W32_STAT_BANDAID + +/* All currently known variants of WIN32 operating systems (Windows 95/98, + * WinNT 3.x, 4.0, 5.0) have a nasty bug in the OS kernel concerning + * conversions between UTC and local time: In the time conversion functions + * of the Win32 API, the timezone offset (including seasonal daylight saving + * shift) between UTC and local time evaluation is erratically based on the + * current system time. The correct evaluation must determine the offset + * value as it {was/is/will be} for the actual time to be converted. + * + * Some versions of MS C runtime lib's stat() returns utc time-stamps so + * that localtime(timestamp) corresponds to the (potentially false) local + * time shown by the OS' system programs (Explorer, command shell dir, etc.) + * The RSXNT port follows the same strategy, but fails to recognize the + * access-time attribute. + * + * For the NTFS file system (and other filesystems that store time-stamps + * as UTC values), this results in st_mtime (, st_{c|a}time) fields which + * are not stable but vary according to the seasonal change of "daylight + * saving time in effect / not in effect". + * + * Other C runtime libs (CygWin, or the CRT DLLs supplied with Win95/NT + * return the unix-time equivalent of the UTC FILETIME values as got back + * from the Win32 API call. This time, return values from NTFS are correct + * whereas utimes from files on (V)FAT volumes vary according to the DST + * switches. + * + * To achieve timestamp consistency of UTC (UT extra field) values in + * Zip archives, the Info-ZIP programs require work-around code for + * proper time handling in stat() (and other time handling routines). + */ +/* stat() functions under Windows95 tend to fail for root directories. * + * Watcom and Borland, at least, are affected by this bug. Watcom made * + * a partial fix for 11.0 but still missed some cases. This substitute * + * detects the case and fills in reasonable values. Otherwise we get * + * effects like failure to extract to a root dir because it's not found. */ + +int zstat_win32(__W32STAT_GLOBALS__ const char *path, struct stat *buf) +{ + if (!stat(path, buf)) + { +#ifdef NT_TZBUG_WORKAROUND + /* stat was successful, now redo the time-stamp fetches */ + int fs_uses_loctime = FStampIsLocTime(__G__ path); + HANDLE h; + FILETIME Modft, Accft, Creft; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_path = (char *)alloca(strlen(path) + 1); + + INTERN_TO_ISO(path, ansi_path); +# define Ansi_Path ansi_path +#else +# define Ansi_Path path +#endif + + TTrace((stdout, "stat(%s) finds modtime %08lx\n", path, buf->st_mtime)); + h = CreateFile(Ansi_Path, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (h != INVALID_HANDLE_VALUE) { + BOOL ftOK = GetFileTime(h, &Creft, &Accft, &Modft); + CloseHandle(h); + + if (ftOK) { + FTTrace((stdout, "GetFileTime returned Modft", 0, &Modft)); + FTTrace((stdout, "GetFileTime returned Creft", 0, &Creft)); + if (!fs_uses_loctime) { + /* On a filesystem that stores UTC timestamps, we refill + * the time fields of the struct stat buffer by directly + * using the UTC values as returned by the Win32 + * GetFileTime() API call. + */ + FileTime2utime(&Modft, &(buf->st_mtime)); + if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) + FileTime2utime(&Accft, &(buf->st_atime)); + else + buf->st_atime = buf->st_mtime; + if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) + FileTime2utime(&Creft, &(buf->st_ctime)); + else + buf->st_ctime = buf->st_mtime; + TTrace((stdout,"NTFS, recalculated modtime %08lx\n", + buf->st_mtime)); + } else { + /* On VFAT and FAT-like filesystems, the FILETIME values + * are converted back to the stable local time before + * converting them to UTC unix time-stamps. + */ + VFatFileTime2utime(&Modft, &(buf->st_mtime)); + if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) + VFatFileTime2utime(&Accft, &(buf->st_atime)); + else + buf->st_atime = buf->st_mtime; + if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) + VFatFileTime2utime(&Creft, &(buf->st_ctime)); + else + buf->st_ctime = buf->st_mtime; + TTrace((stdout, "VFAT, recalculated modtime %08lx\n", + buf->st_mtime)); + } + } + } +# undef Ansi_Path +#endif /* NT_TZBUG_WORKAROUND */ + return 0; + } +#ifdef W32_STATROOT_FIX + else + { + DWORD flags; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_path = (char *)alloca(strlen(path) + 1); + + INTERN_TO_ISO(path, ansi_path); +# define Ansi_Path ansi_path +#else +# define Ansi_Path path +#endif + + flags = GetFileAttributes(Ansi_Path); + if (flags != 0xFFFFFFFF && flags & FILE_ATTRIBUTE_DIRECTORY) { + Trace((stderr, "\nstat(\"%s\",...) failed on existing directory\n", + FnFilter1(path))); + memset(buf, 0, sizeof(struct stat)); + buf->st_atime = buf->st_ctime = buf->st_mtime = + dos_to_unix_time(DOSTIME_MINIMUM); /* 1-1-80 */ + buf->st_mode = S_IFDIR | S_IREAD | + ((flags & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE); + return 0; + } /* assumes: stat() won't fail on non-dirs without good reason */ +# undef Ansi_Path + } +#endif /* W32_STATROOT_FIX */ + return -1; +} + +#endif /* W32_STAT_BANDAID */ + + + +#ifdef W32_USE_IZ_TIMEZONE +#include "timezone.h" +#define SECSPERMIN 60 +#define MINSPERHOUR 60 +#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) +static void conv_to_rule(LPSYSTEMTIME lpw32tm, struct rule * ZCONST ptrule); + +static void conv_to_rule(LPSYSTEMTIME lpw32tm, struct rule * ZCONST ptrule) +{ + if (lpw32tm->wYear != 0) { + ptrule->r_type = JULIAN_DAY; + ptrule->r_day = ydays[lpw32tm->wMonth - 1] + lpw32tm->wDay; + } else { + ptrule->r_type = MONTH_NTH_DAY_OF_WEEK; + ptrule->r_mon = lpw32tm->wMonth; + ptrule->r_day = lpw32tm->wDayOfWeek; + ptrule->r_week = lpw32tm->wDay; + } + ptrule->r_time = (long)lpw32tm->wHour * SECSPERHOUR + + (long)(lpw32tm->wMinute * SECSPERMIN) + + (long)lpw32tm->wSecond; +} + +int GetPlatformLocalTimezone(register struct state * ZCONST sp, + void (*fill_tzstate_from_rules)(struct state * ZCONST sp_res, + ZCONST struct rule * ZCONST start, + ZCONST struct rule * ZCONST end)) +{ + TIME_ZONE_INFORMATION tzinfo; + DWORD res; + + /* read current timezone settings from registry if TZ envvar missing */ + res = GetTimeZoneInformation(&tzinfo); + if (res != TIME_ZONE_ID_INVALID) + { + struct rule startrule, stoprule; + + conv_to_rule(&(tzinfo.StandardDate), &stoprule); + conv_to_rule(&(tzinfo.DaylightDate), &startrule); + sp->timecnt = 0; + sp->ttis[0].tt_abbrind = 0; + if ((sp->charcnt = + WideCharToMultiByte(CP_ACP, 0, tzinfo.StandardName, -1, + sp->chars, sizeof(sp->chars), NULL, NULL)) + == 0) + sp->chars[sp->charcnt++] = '\0'; + sp->ttis[1].tt_abbrind = sp->charcnt; + sp->charcnt += + WideCharToMultiByte(CP_ACP, 0, tzinfo.DaylightName, -1, + sp->chars + sp->charcnt, + sizeof(sp->chars) - sp->charcnt, NULL, NULL); + if ((sp->charcnt - sp->ttis[1].tt_abbrind) == 0) + sp->chars[sp->charcnt++] = '\0'; + sp->ttis[0].tt_gmtoff = - (tzinfo.Bias + tzinfo.StandardBias) + * MINSPERHOUR; + sp->ttis[1].tt_gmtoff = - (tzinfo.Bias + tzinfo.DaylightBias) + * MINSPERHOUR; + sp->ttis[0].tt_isdst = 0; + sp->ttis[1].tt_isdst = 1; + sp->typecnt = (startrule.r_mon == 0 && stoprule.r_mon == 0) ? 1 : 2; + + if (sp->typecnt > 1) + (*fill_tzstate_from_rules)(sp, &startrule, &stoprule); + return TRUE; + } + return FALSE; +} +#endif /* W32_USE_IZ_TIMEZONE */ + +#endif /* !FUNZIP */ + + + +#ifndef WINDLL +/* This replacement getch() function was originally created for Watcom C + * and then additionally used with CYGWIN. Since UnZip 5.4, all other Win32 + * ports apply this replacement rather that their supplied getch() (or + * alike) function. There are problems with unabsorbed LF characters left + * over in the keyboard buffer under Win95 (and 98) when ENTER was pressed. + * (Under Win95, ENTER returns two(!!) characters: CR-LF.) This problem + * does not appear when run on a WinNT console prompt! + */ + +/* Watcom 10.6's getch() does not handle Alt+. */ +/* Note that if PASSWD_FROM_STDIN is defined, the file containing */ +/* the password must have a carriage return after the word, not a */ +/* Unix-style newline (linefeed only). This discards linefeeds. */ + +int getch_win32(void) +{ + HANDLE stin; + DWORD rc; + unsigned char buf[2]; + int ret = -1; + DWORD odemode = ~(DWORD)0; + +# ifdef PASSWD_FROM_STDIN + stin = GetStdHandle(STD_INPUT_HANDLE); +# else + stin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + if (stin == INVALID_HANDLE_VALUE) + return -1; +# endif + if (GetConsoleMode(stin, &odemode)) + SetConsoleMode(stin, ENABLE_PROCESSED_INPUT); /* raw except ^C noticed */ + if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1) + ret = buf[0]; + /* when the user hits return we get CR LF. We discard the LF, not the CR, + * because when we call this for the first time after a previous input + * such as the one for "replace foo? [y]es, ..." the LF may still be in + * the input stream before whatever the user types at our prompt. */ + if (ret == '\n') + if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1) + ret = buf[0]; + if (odemode != ~(DWORD)0) + SetConsoleMode(stin, odemode); +# ifndef PASSWD_FROM_STDIN + CloseHandle(stin); +# endif + return ret; +} +#endif /* !WINDLL */ + +const char *BOINC_RCSID_3ee56ad838 = "$Id: win32.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/zipgrep.txt boinc-7.0.14+dfsg/zip/unzip/zipgrep.txt --- boinc-7.0.7+dfsg/zip/unzip/zipgrep.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/zipgrep.txt 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,89 @@ + +ZIPGREP(1L) ZIPGREP(1L) + +NAME + zipgrep - search files in a ZIP archive for lines matching + a pattern + +SYNOPSIS + zipgrep [egrep_options] pattern file[.zip] [file(s) ...] + [-x xfile(s) ...] + +DESCRIPTION + zipgrep will search files within a ZIP archive for lines + matching the given string or pattern. zipgrep is a shell + script and requires egrep(1) and unzip(1L) to function. + Its output is identical to that of egrep(1). + +ARGUMENTS + pattern + The pattern to be located within a ZIP archive. + Any string or regular expression accepted by + egrep(1) may be used. file[.zip] Path of the ZIP + archive. (Wildcard expressions for the ZIP archive + name are not supported.) If the literal filename + is not found, the suffix .zip is appended. Note + that self-extracting ZIP files are supported, as + with any other ZIP archive; just specify the .exe + suffix (if any) explicitly. + + [file(s)] + An optional list of archive members to be pro- + cessed, separated by spaces. If no member files + are specified, all members of the ZIP archive are + searched. Regular expressions (wildcards) may be + used to match multiple members: + + * matches a sequence of 0 or more characters + + ? matches exactly 1 character + + [...] matches any single character found inside + the brackets; ranges are specified by a + beginning character, a hyphen, and an ending + character. If an exclamation point or a + caret (`!' or `^') follows the left bracket, + then the range of characters within the + brackets is complemented (that is, anything + except the characters inside the brackets is + considered a match). + + (Be sure to quote any character that might other- + wise be interpreted or modified by the operating + system.) + + [-x xfile(s)] + An optional list of archive members to be excluded + from processing. Since wildcard characters match + +Info-ZIP 17 February 2002 1 + +ZIPGREP(1L) ZIPGREP(1L) + + directory separators (`/'), this option may be used + to exclude any files that are in subdirectories. + For example, ``zipgrep grumpy foo *.[ch] -x */*'' + would search for the string ``grumpy'' in all C + source files in the main directory of the ``foo'' + archive, but none in any subdirectories. Without + the -x option, all C source files in all directo- + ries within the zipfile would be searched. + +OPTIONS + All options prior to the ZIP archive filename are passed + to egrep(1). + +SEE ALSO + egrep(1), unzip(1L), zip(1L), funzip(1L), zipcloak(1L), + zipinfo(1L), zipnote(1L), zipsplit(1L) + +URL + The Info-ZIP home page is currently at http://www.info- + zip.org/pub/infozip/ or ftp://ftp.info- + zip.org/pub/infozip/ . + +AUTHORS + zipgrep was written by Jean-loup Gailly. + +Info-ZIP 17 February 2002 2 + diff -Nru boinc-7.0.7+dfsg/zip/unzip/zip.h boinc-7.0.14+dfsg/zip/unzip/zip.h --- boinc-7.0.7+dfsg/zip/unzip/zip.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/zip.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,24 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* This is a dummy zip.h to allow the source files shared with Zip (crypt.c, + crc32.c, crctab.c, ttyio.c) to compile for UnZip. (In case you are looking + for the Info-ZIP license, please follow the pointers above.) */ + +#ifndef __zip_h /* don't include more than once */ +#define __zip_h + +#define UNZIP_INTERNAL +#include "unzip.h" + +#define local static + +#define ZE_MEM PK_MEM +#define ziperr(c, h) return + +#endif /* !__zip_h */ diff -Nru boinc-7.0.7+dfsg/zip/unzip/zipinfo.c boinc-7.0.14+dfsg/zip/unzip/zipinfo.c --- boinc-7.0.7+dfsg/zip/unzip/zipinfo.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/zipinfo.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,2195 @@ +/* + Copyright (c) 1990-2001 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in unzip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + zipinfo.c Greg Roelofs et al. + + This file contains all of the ZipInfo-specific listing routines for UnZip. + + Contains: zi_opts() + zi_end_central() + zipinfo() + zi_long() + zi_short() + zi_time() + + ---------------------------------------------------------------------------*/ + + +#define UNZIP_INTERNAL +#include "unzip.h" + + +#ifndef NO_ZIPINFO /* strings use up too much space in small-memory systems */ + +/* Define OS-specific attributes for use on ALL platforms--the S_xxxx + * versions of these are defined differently (or not defined) by different + * compilers and operating systems. */ + +#define UNX_IFMT 0170000 /* Unix file type mask */ +#define UNX_IFREG 0100000 /* Unix regular file */ +#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ +#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ +#define UNX_IFBLK 0060000 /* Unix block special (not Amiga) */ +#define UNX_IFDIR 0040000 /* Unix directory */ +#define UNX_IFCHR 0020000 /* Unix character special (not Amiga) */ +#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ +#define UNX_ISUID 04000 /* Unix set user id on execution */ +#define UNX_ISGID 02000 /* Unix set group id on execution */ +#define UNX_ISVTX 01000 /* Unix directory permissions control */ +#define UNX_ENFMT UNX_ISGID /* Unix record locking enforcement flag */ +#define UNX_IRWXU 00700 /* Unix read, write, execute: owner */ +#define UNX_IRUSR 00400 /* Unix read permission: owner */ +#define UNX_IWUSR 00200 /* Unix write permission: owner */ +#define UNX_IXUSR 00100 /* Unix execute permission: owner */ +#define UNX_IRWXG 00070 /* Unix read, write, execute: group */ +#define UNX_IRGRP 00040 /* Unix read permission: group */ +#define UNX_IWGRP 00020 /* Unix write permission: group */ +#define UNX_IXGRP 00010 /* Unix execute permission: group */ +#define UNX_IRWXO 00007 /* Unix read, write, execute: other */ +#define UNX_IROTH 00004 /* Unix read permission: other */ +#define UNX_IWOTH 00002 /* Unix write permission: other */ +#define UNX_IXOTH 00001 /* Unix execute permission: other */ + +#define VMS_IRUSR UNX_IRUSR /* VMS read/owner */ +#define VMS_IWUSR UNX_IWUSR /* VMS write/owner */ +#define VMS_IXUSR UNX_IXUSR /* VMS execute/owner */ +#define VMS_IRGRP UNX_IRGRP /* VMS read/group */ +#define VMS_IWGRP UNX_IWGRP /* VMS write/group */ +#define VMS_IXGRP UNX_IXGRP /* VMS execute/group */ +#define VMS_IROTH UNX_IROTH /* VMS read/other */ +#define VMS_IWOTH UNX_IWOTH /* VMS write/other */ +#define VMS_IXOTH UNX_IXOTH /* VMS execute/other */ + +#define AMI_IFMT 06000 /* Amiga file type mask */ +#define AMI_IFDIR 04000 /* Amiga directory */ +#define AMI_IFREG 02000 /* Amiga regular file */ +#define AMI_IHIDDEN 00200 /* to be supported in AmigaDOS 3.x */ +#define AMI_ISCRIPT 00100 /* executable script (text command file) */ +#define AMI_IPURE 00040 /* allow loading into resident memory */ +#define AMI_IARCHIVE 00020 /* not modified since bit was last set */ +#define AMI_IREAD 00010 /* can be opened for reading */ +#define AMI_IWRITE 00004 /* can be opened for writing */ +#define AMI_IEXECUTE 00002 /* executable image, a loadable runfile */ +#define AMI_IDELETE 00001 /* can be deleted */ + +#define THS_IFMT 0xF000 /* Theos file type mask */ +#define THS_IFIFO 0x1000 /* pipe */ +#define THS_IFCHR 0x2000 /* char device */ +#define THS_IFSOCK 0x3000 /* socket */ +#define THS_IFDIR 0x4000 /* directory */ +#define THS_IFLIB 0x5000 /* library */ +#define THS_IFBLK 0x6000 /* block device */ +#define THS_IFREG 0x8000 /* regular file */ +#define THS_IFREL 0x9000 /* relative (direct) */ +#define THS_IFKEY 0xA000 /* keyed */ +#define THS_IFIND 0xB000 /* indexed */ +#define THS_IFRND 0xC000 /* ???? */ +#define THS_IFR16 0xD000 /* 16 bit real mode program */ +#define THS_IFP16 0xE000 /* 16 bit protected mode prog */ +#define THS_IFP32 0xF000 /* 32 bit protected mode prog */ +#define THS_IMODF 0x0800 /* modified */ +#define THS_INHID 0x0400 /* not hidden */ +#define THS_IEUSR 0x0200 /* erase permission: owner */ +#define THS_IRUSR 0x0100 /* read permission: owner */ +#define THS_IWUSR 0x0080 /* write permission: owner */ +#define THS_IXUSR 0x0040 /* execute permission: owner */ +#define THS_IROTH 0x0004 /* read permission: other */ +#define THS_IWOTH 0x0002 /* write permission: other */ +#define THS_IXOTH 0x0001 /* execute permission: other */ + +#ifdef OLD_THEOS_EXTRA +# include "theos/oldstat.h" +#endif + +#ifndef NSK_UNSTRUCTURED +# define NSK_UNSTRUCTURED 0 +#endif +#ifndef NSK_OBJECTFILECODE +# define NSK_OBJECTFILECODE 100 +#endif +#ifndef NSK_EDITFILECODE +# define NSK_EDITFILECODE 101 +#endif + +#define LFLAG 3 /* short "ls -l" type listing */ + +static int zi_long OF((__GPRO__ ulg *pEndprev)); +static int zi_short OF((__GPRO)); +static void zi_showMacTypeCreator + OF((__GPRO__ uch *ebfield)); +static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, + ZCONST time_t *modtimez, char *d_t_str)); + + +/**********************************************/ +/* Strings used in zipinfo.c (ZipInfo half) */ +/**********************************************/ + +static ZCONST char nullStr[] = ""; +static ZCONST char PlurSufx[] = "s"; + +static ZCONST char Far LongHeader[] = "Archive: %s %ld bytes %u file%s\n"; +static ZCONST char Far ShortHeader[] = "Archive: %s %ld %u\n"; +static ZCONST char Far EndCentDirRec[] = "\nEnd-of-central-directory record:\n"; +static ZCONST char Far LineSeparators[] = "-------------------------------\n\n"; +static ZCONST char Far ActOffsetCentDir[] = "\ + Actual offset of end-of-central-dir record: %9ld (%.8lXh)\n\ + Expected offset of end-of-central-dir record: %9ld (%.8lXh)\n\ + (based on the length of the central directory and its expected offset)\n\n"; +static ZCONST char Far SinglePartArchive1[] = "\ + This zipfile constitutes the sole disk of a single-part archive; its\n\ + central directory contains %u %s. The central directory is %lu\n\ + (%.8lXh) bytes long, and its (expected) offset in bytes from the\n"; +static ZCONST char Far SinglePartArchive2[] = "\ + beginning of the zipfile is %lu (%.8lXh).\n\n"; +static ZCONST char Far MultiPartArchive1[] = "\ + This zipfile constitutes disk %u of a multi-part archive. The central\n\ + directory starts on disk %u; %u of its entries %s contained within\n"; +static ZCONST char Far MultiPartArchive2[] = "\ + this zipfile, out of a total of %u %s. The entire central\n\ + directory is %lu (%.8lXh) bytes long, and its offset in bytes from\n"; +static ZCONST char Far MultiPartArchive3[] = "\ + the beginning of the zipfile in which it begins is %lu (%.8lXh).\n\n"; +static ZCONST char Far NoZipfileComment[] = " There is no zipfile comment.\n"; +static ZCONST char Far ZipfileCommentDesc[] = + " The zipfile comment is %u bytes long and contains the following text:\n\n"; +static ZCONST char Far ZipfileCommBegin[] = + "======================== zipfile comment begins ==========================\n"; +static ZCONST char Far ZipfileCommEnd[] = + "========================= zipfile comment ends ===========================\n"; +static ZCONST char Far ZipfileCommTrunc2[] = + "\n The zipfile comment is truncated.\n"; +static ZCONST char Far ZipfileCommTruncMsg[] = + "\ncaution: zipfile comment truncated\n"; + +static ZCONST char Far CentralDirEntry[] = + "\nCentral directory entry #%lu:\n---------------------------\n\n"; +static ZCONST char Far ZipfileStats[] = + "%lu file%s, %lu bytes uncompressed, %lu bytes compressed: %s%d.%d%%\n"; + +/* zi_long() strings */ +static ZCONST char Far OS_FAT[] = "MS-DOS, OS/2 or NT FAT"; +static ZCONST char Far OS_Amiga[] = "Amiga"; +static ZCONST char Far OS_VMS[] = "VMS"; +static ZCONST char Far OS_Unix[] = "Unix"; +static ZCONST char Far OS_VMCMS[] = "VM/CMS"; +static ZCONST char Far OS_AtariST[] = "Atari ST"; +static ZCONST char Far OS_HPFS[] = "OS/2 or NT HPFS"; +static ZCONST char Far OS_Macintosh[] = "Macintosh HFS"; +static ZCONST char Far OS_ZSystem[] = "Z-System"; +static ZCONST char Far OS_CPM[] = "CP/M"; +static ZCONST char Far OS_TOPS20[] = "TOPS-20"; +static ZCONST char Far OS_NTFS[] = "NTFS"; +static ZCONST char Far OS_QDOS[] = "SMS/QDOS"; +static ZCONST char Far OS_Acorn[] = "Acorn RISC OS"; +static ZCONST char Far OS_MVS[] = "MVS"; +static ZCONST char Far OS_VFAT[] = "Win32 VFAT"; +static ZCONST char Far OS_BeOS[] = "BeOS"; +static ZCONST char Far OS_Tandem[] = "Tandem NSK"; +static ZCONST char Far OS_Theos[] = "Theos"; +#ifdef OLD_THEOS_EXTRA + static ZCONST char Far OS_TheosOld[] = "Theos (Old)"; +#endif /* OLD_THEOS_EXTRA */ + +static ZCONST char Far MthdNone[] = "none (stored)"; +static ZCONST char Far MthdShrunk[] = "shrunk"; +static ZCONST char Far MthdRedF1[] = "reduced (factor 1)"; +static ZCONST char Far MthdRedF2[] = "reduced (factor 2)"; +static ZCONST char Far MthdRedF3[] = "reduced (factor 3)"; +static ZCONST char Far MthdRedF4[] = "reduced (factor 4)"; +static ZCONST char Far MthdImplode[] = "imploded"; +static ZCONST char Far MthdToken[] = "tokenized"; +static ZCONST char Far MthdDeflate[] = "deflated"; +static ZCONST char Far MthdDeflat64[] = "deflated (enhanced-64k)"; +static ZCONST char Far MthdDCLImplode[] = "imploded (PK DCL)"; + +static ZCONST char Far DeflNorm[] = "normal"; +static ZCONST char Far DeflMax[] = "maximum"; +static ZCONST char Far DeflFast[] = "fast"; +static ZCONST char Far DeflSFast[] = "superfast"; + +static ZCONST char Far ExtraBytesPreceding[] = + " There are an extra %ld bytes preceding this file.\n\n"; + +static ZCONST char Far UnknownNo[] = "unknown (%d)"; + +static ZCONST char Far LocalHeaderOffset[] = + "\n offset of local header from start of archive: %lu (%.8lXh) bytes\n"; +static ZCONST char Far HostOS[] = + " file system or operating system of origin: %s\n"; +static ZCONST char Far EncodeSWVer[] = + " version of encoding software: %u.%u\n"; +static ZCONST char Far MinOSCompReq[] = + " minimum file system compatibility required: %s\n"; +static ZCONST char Far MinSWVerReq[] = + " minimum software version required to extract: %u.%u\n"; +static ZCONST char Far CompressMethod[] = + " compression method: %s\n"; +static ZCONST char Far SlideWindowSizeImplode[] = + " size of sliding dictionary (implosion): %cK\n"; +static ZCONST char Far ShannonFanoTrees[] = + " number of Shannon-Fano trees (implosion): %c\n"; +static ZCONST char Far CompressSubtype[] = + " compression sub-type (deflation): %s\n"; +static ZCONST char Far FileSecurity[] = + " file security status: %sencrypted\n"; +static ZCONST char Far ExtendedLocalHdr[] = + " extended local header: %s\n"; +static ZCONST char Far FileModDate[] = + " file last modified on (DOS date/time): %s\n"; +#ifdef USE_EF_UT_TIME + static ZCONST char Far UT_FileModDate[] = + " file last modified on (UT extra field modtime): %s %s\n"; + static ZCONST char Far LocalTime[] = "local"; +#ifndef NO_GMTIME + static ZCONST char Far GMTime[] = "UTC"; +#endif +#endif /* USE_EF_UT_TIME */ +static ZCONST char Far CRC32Value[] = + " 32-bit CRC value (hex): %.8lx\n"; +static ZCONST char Far CompressedFileSize[] = + " compressed size: %lu bytes\n"; +static ZCONST char Far UncompressedFileSize[] = + " uncompressed size: %lu bytes\n"; +static ZCONST char Far FilenameLength[] = + " length of filename: %u characters\n"; +static ZCONST char Far ExtraFieldLength[] = + " length of extra field: %u bytes\n"; +static ZCONST char Far FileCommentLength[] = + " length of file comment: %u characters\n"; +static ZCONST char Far FileDiskNum[] = + " disk number on which file begins: disk %u\n"; +static ZCONST char Far ApparentFileType[] = + " apparent file type: %s\n"; +static ZCONST char Far VMSFileAttributes[] = + " VMS file attributes (%06o octal): %s\n"; +static ZCONST char Far AmigaFileAttributes[] = + " Amiga file attributes (%06o octal): %s\n"; +static ZCONST char Far UnixFileAttributes[] = + " Unix file attributes (%06o octal): %s\n"; +static ZCONST char Far NonMSDOSFileAttributes[] = + " non-MSDOS external file attributes: %06lX hex\n"; +static ZCONST char Far MSDOSFileAttributes[] = + " MS-DOS file attributes (%02X hex): none\n"; +static ZCONST char Far MSDOSFileAttributesRO[] = + " MS-DOS file attributes (%02X hex): read-only\n"; +static ZCONST char Far MSDOSFileAttributesAlpha[] = + " MS-DOS file attributes (%02X hex): %s%s%s%s%s%s%s%s\n"; +static ZCONST char Far TheosFileAttributes[] = + " Theos file attributes (%04X hex): %s\n"; + +static ZCONST char Far TheosFTypLib[] = "Library "; +static ZCONST char Far TheosFTypDir[] = "Directory "; +static ZCONST char Far TheosFTypReg[] = "Sequential "; +static ZCONST char Far TheosFTypRel[] = "Direct "; +static ZCONST char Far TheosFTypKey[] = "Keyed "; +static ZCONST char Far TheosFTypInd[] = "Indexed "; +static ZCONST char Far TheosFTypR16[] = " 86 program "; +static ZCONST char Far TheosFTypP16[] = "286 program "; +static ZCONST char Far TheosFTypP32[] = "386 program "; +static ZCONST char Far TheosFTypUkn[] = "??? "; + +static ZCONST char Far ExtraFieldTrunc[] = "\n\ + error: EF data block (type 0x%04x) size %u exceeds remaining extra field\n\ + space %u; block length has been truncated.\n"; +static ZCONST char Far ExtraFields[] = "\n\ + The central-directory extra field contains:"; +static ZCONST char Far ExtraFieldType[] = "\n\ + - A subfield with ID 0x%04x (%s) and %u data bytes"; +static ZCONST char Far efPKSZ64[] = "PKWARE 64-bit sizes"; +static ZCONST char Far efAV[] = "PKWARE AV"; +static ZCONST char Far efOS2[] = "OS/2"; +static ZCONST char Far efPKVMS[] = "PKWARE VMS"; +static ZCONST char Far efPKWin32[] = "PKWARE Win32"; +static ZCONST char Far efPKUnix[] = "PKWARE Unix"; +static ZCONST char Far efIZVMS[] = "Info-ZIP VMS"; +static ZCONST char Far efIZUnix[] = "old Info-ZIP Unix/OS2/NT"; +static ZCONST char Far efIZUnix2[] = "Unix UID/GID"; +static ZCONST char Far efTime[] = "universal time"; +static ZCONST char Far efJLMac[] = "old Info-ZIP Macintosh"; +static ZCONST char Far efMac3[] = "new Info-ZIP Macintosh"; +static ZCONST char Far efZipIt[] = "ZipIt Macintosh"; +static ZCONST char Far efSmartZip[] = "SmartZip Macintosh"; +static ZCONST char Far efZipIt2[] = "ZipIt Macintosh (short)"; +static ZCONST char Far efVMCMS[] = "VM/CMS"; +static ZCONST char Far efMVS[] = "MVS"; +static ZCONST char Far efACL[] = "OS/2 ACL"; +static ZCONST char Far efNTSD[] = "Security Descriptor"; +static ZCONST char Far efBeOS[] = "BeOS"; +static ZCONST char Far efQDOS[] = "SMS/QDOS"; +static ZCONST char Far efAOSVS[] = "AOS/VS"; +static ZCONST char Far efSpark[] = "Acorn SparkFS"; +static ZCONST char Far efMD5[] = "Fred Kantor MD5"; +static ZCONST char Far efASiUnix[] = "ASi Unix"; +static ZCONST char Far efTandem[] = "Tandem NSK"; +static ZCONST char Far efTheos[] = "Theos"; +static ZCONST char Far efUnknown[] = "unknown"; + +static ZCONST char Far OS2EAs[] = ".\n\ + The local extra field has %lu bytes of OS/2 extended attributes.\n\ + (May not match OS/2 \"dir\" amount due to storage method)"; +static ZCONST char Far izVMSdata[] = ". The extra\n\ + field is %s and has %u bytes of VMS %s information%s"; +static ZCONST char Far izVMSstored[] = "stored"; +static ZCONST char Far izVMSrleenc[] = "run-length encoded"; +static ZCONST char Far izVMSdeflat[] = "deflated"; +static ZCONST char Far izVMScunknw[] = "compressed(?)"; +static ZCONST char Far *izVMScomp[4] = + {izVMSstored, izVMSrleenc, izVMSdeflat, izVMScunknw}; +static ZCONST char Far ACLdata[] = ".\n\ + The local extra field has %lu bytes of access control list information"; +static ZCONST char Far NTSDData[] = ".\n\ + The local extra field has %lu bytes of NT security descriptor data"; +static ZCONST char Far UTdata[] = ".\n\ + The local extra field has UTC/GMT %s time%s"; +static ZCONST char Far UTmodification[] = "modification"; +static ZCONST char Far UTaccess[] = "access"; +static ZCONST char Far UTcreation[] = "creation"; +static ZCONST char Far ZipItFname[] = ".\n\ + The Mac long filename is %s"; +static ZCONST char Far Mac3data[] = ".\n\ + The local extra field has %lu bytes of %scompressed Macintosh\n\ + finder attributes"; + /* MacOSdata[] is used by EF_MAC3, EF_ZIPIT, EF_ZIPIT2 and EF_JLEE e. f. */ +static ZCONST char Far MacOSdata[] = ".\n\ + The associated file has type code `%c%c%c%c' and creator code `%c%c%c%c'"; +static ZCONST char Far MacOSdata1[] = ".\n\ + The associated file has type code `0x%lx' and creator code `0x%lx'"; +static ZCONST char Far MacOSJLEEflags[] = ".\n File is marked as %s"; +static ZCONST char Far MacOS_RF[] = "Resource-fork"; +static ZCONST char Far MacOS_DF[] = "Data-fork"; +static ZCONST char Far MacOSMAC3flags[] = ".\n\ + File is marked as %s, File Dates are in %d Bit"; +static ZCONST char Far BeOSdata[] = ".\n\ + The local extra field has %lu bytes of %scompressed BeOS file attributes"; + /* The associated file has type code `%c%c%c%c' and creator code `%c%c%c%c'" */ +static ZCONST char Far QDOSdata[] = ".\n\ + The QDOS extra field subtype is `%c%c%c%c'"; +static ZCONST char Far AOSVSdata[] = ".\n\ + The AOS/VS extra field revision is %d.%d"; +static ZCONST char Far TandemUnstr[] = "Unstructured"; +static ZCONST char Far TandemRel[] = "Relative"; +static ZCONST char Far TandemEntry[] = "Entry Sequenced"; +static ZCONST char Far TandemKey[] = "Key Sequenced"; +static ZCONST char Far TandemEdit[] = "Edit"; +static ZCONST char Far TandemObj[] = "Object"; +static ZCONST char Far *TandemFileformat[6] = + {TandemUnstr, TandemRel, TandemEntry, TandemKey, TandemEdit, TandemObj}; +static ZCONST char Far Tandemdata[] = ".\n\ + The file was originally a Tandem %s file, with file code %u"; +static ZCONST char Far MD5data[] = ".\n\ + The 128-bit MD5 signature is %s"; +#ifdef CMS_MVS + static ZCONST char Far VmMvsExtraField[] = ".\n\ + The stored file open mode (FLDATA TYPE) is \"%s\""; + static ZCONST char Far VmMvsInvalid[] = "[invalid]"; +#endif /* CMS_MVS */ + +static ZCONST char Far First20[] = ". The first\n 20 are: "; +static ZCONST char Far ColonIndent[] = ":\n "; +static ZCONST char Far efFormat[] = " %02x"; + +static ZCONST char Far lExtraFieldType[] = "\n\ + There %s a local extra field with ID 0x%04x (%s) and\n\ + %u data bytes (%s).\n"; +static ZCONST char Far efIZuid[] = + "GMT modification/access times and Unix UID/GID"; +static ZCONST char Far efIZnouid[] = "GMT modification/access times only"; + + +static ZCONST char Far NoFileComment[] = "\n There is no file comment.\n"; +static ZCONST char Far FileCommBegin[] = "\n\ +------------------------- file comment begins ----------------------------\n"; +static ZCONST char Far FileCommEnd[] = "\ +-------------------------- file comment ends -----------------------------\n"; + +/* zi_time() strings */ +static ZCONST char Far BogusFmt[] = "%03d"; +static ZCONST char Far DMYHMTime[] = "%2u-%s-%02u %02u:%02u"; +static ZCONST char Far YMDHMSTime[] = "%u %s %u %02u:%02u:%02u"; +static ZCONST char Far DecimalTime[] = "%04u%02u%02u.%02u%02u%02u"; +#ifdef USE_EF_UT_TIME + static ZCONST char Far YMDHMSTimeError[] = "???? ??? ?? ??:??:??"; +#endif + + + + + +#ifndef WINDLL + +/************************/ +/* Function zi_opts() */ +/************************/ + +int zi_opts(__G__ pargc, pargv) + int *pargc; + char ***pargv; + __GDEF +{ + char **argv, *s; + int argc, c, error=FALSE, negative=0; + int hflag_slmv=TRUE, hflag_2=FALSE; /* diff options => diff defaults */ + int tflag_slm=TRUE, tflag_2v=FALSE; + int explicit_h=FALSE, explicit_t=FALSE; + + +#ifdef MACOS + uO.lflag = LFLAG; /* reset default on each call */ +#endif + G.extract_flag = FALSE; /* zipinfo does not extract to disk */ + argc = *pargc; + argv = *pargv; + + while (--argc > 0 && (*++argv)[0] == '-') { + s = argv[0] + 1; + while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ + switch (c) { + case '-': + ++negative; + break; + case '1': /* shortest listing: JUST filenames */ + if (negative) + uO.lflag = -2, negative = 0; + else + uO.lflag = 1; + break; + case '2': /* just filenames, plus headers if specified */ + if (negative) + uO.lflag = -2, negative = 0; + else + uO.lflag = 2; + break; +#ifndef CMS_MVS + case ('C'): /* -C: match filenames case-insensitively */ + if (negative) + uO.C_flag = FALSE, negative = 0; + else + uO.C_flag = TRUE; + break; +#endif /* !CMS_MVS */ + case 'h': /* header line */ + if (negative) + hflag_2 = hflag_slmv = FALSE, negative = 0; + else { + hflag_2 = hflag_slmv = explicit_h = TRUE; + if (uO.lflag == -1) + uO.lflag = 0; + } + break; + case 'l': /* longer form of "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; + else + uO.lflag = 5; + break; + case 'm': /* medium form of "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; + else + uO.lflag = 4; + break; +#ifdef MORE + case 'M': /* send output through built-in "more" */ + if (negative) + G.M_flag = FALSE, negative = 0; + else + G.M_flag = TRUE; + break; +#endif + case 's': /* default: shorter "ls -l" type listing */ + if (negative) + uO.lflag = -2, negative = 0; + else + uO.lflag = 3; + break; + case 't': /* totals line */ + if (negative) + tflag_2v = tflag_slm = FALSE, negative = 0; + else { + tflag_2v = tflag_slm = explicit_t = TRUE; + if (uO.lflag == -1) + uO.lflag = 0; + } + break; + case ('T'): /* use (sortable) decimal time format */ + if (negative) + uO.T_flag = FALSE, negative = 0; + else + uO.T_flag = TRUE; + break; + case 'v': /* turbo-verbose listing */ + if (negative) + uO.lflag = -2, negative = 0; + else + uO.lflag = 10; + break; + case 'z': /* print zipfile comment */ + if (negative) + uO.zflag = negative = 0; + else + uO.zflag = 1; + break; + case 'Z': /* ZipInfo mode: ignore */ + break; + default: + error = TRUE; + break; + } + } + } + if ((argc-- == 0) || error) { + *pargc = argc; + *pargv = argv; + return USAGE(error); + } + +#ifdef MORE + if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func useless */ + G.M_flag = 0; +#endif + + /* if no listing options given (or all negated), or if only -h/-t given + * with individual files specified, use default listing format */ + if ((uO.lflag < 0) || ((argc > 0) && (uO.lflag == 0))) + uO.lflag = LFLAG; + + /* set header and totals flags to default or specified values */ + switch (uO.lflag) { + case 0: /* 0: can only occur if either -t or -h explicitly given; */ + case 2: /* therefore set both flags equal to normally false value */ + uO.hflag = hflag_2; + uO.tflag = tflag_2v; + break; + case 1: /* only filenames, *always* */ + uO.hflag = FALSE; + uO.tflag = FALSE; + uO.zflag = FALSE; + break; + case 3: + case 4: + case 5: + uO.hflag = ((argc > 0) && !explicit_h)? FALSE : hflag_slmv; + uO.tflag = ((argc > 0) && !explicit_t)? FALSE : tflag_slm; + break; + case 10: + uO.hflag = hflag_slmv; + uO.tflag = tflag_2v; + break; + } + + *pargc = argc; + *pargv = argv; + return 0; + +} /* end function zi_opts() */ + +#endif /* !WINDLL */ + + + + + +/*******************************/ +/* Function zi_end_central() */ +/*******************************/ + +int zi_end_central(__G) /* return PK-type error code */ + __GDEF +{ + int error = PK_COOL; + + +/*--------------------------------------------------------------------------- + Print out various interesting things about the zipfile. + ---------------------------------------------------------------------------*/ + + /* header fits on one line, for anything up to 10GB and 10000 files: */ + if (uO.hflag) + Info(slide, 0, ((char *)slide, ((int)strlen(G.zipfn) < 39)? + LoadFarString(LongHeader) : LoadFarString(ShortHeader), G.zipfn, + (long)G.ziplen, G.ecrec.total_entries_central_dir, + (G.ecrec.total_entries_central_dir==1)? + nullStr : PlurSufx)); + + /* verbose format */ + if (uO.lflag > 9) { + Info(slide, 0, ((char *)slide, LoadFarString(EndCentDirRec))); + Info(slide, 0, ((char *)slide, LoadFarString(LineSeparators))); + + Info(slide, 0, ((char *)slide, LoadFarString(ActOffsetCentDir), + (long)G.real_ecrec_offset, (long)G.real_ecrec_offset, + (long)G.expect_ecrec_offset, (long)G.expect_ecrec_offset)); + + if (G.ecrec.number_this_disk == 0) { + Info(slide, 0, ((char *)slide, LoadFarString(SinglePartArchive1), + G.ecrec.total_entries_central_dir, + (G.ecrec.total_entries_central_dir == 1)? "entry" : "entries", + G.ecrec.size_central_directory, + G.ecrec.size_central_directory)); + Info(slide, 0, ((char *)slide, LoadFarString(SinglePartArchive2), + G.ecrec.offset_start_central_directory, + G.ecrec.offset_start_central_directory)); + } else { + Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive1), + G.ecrec.number_this_disk + 1, + G.ecrec.num_disk_start_cdir + 1, + G.ecrec.num_entries_centrl_dir_ths_disk, + (G.ecrec.num_entries_centrl_dir_ths_disk == 1)? "is" : "are")); + Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive2), + G.ecrec.total_entries_central_dir, + (G.ecrec.total_entries_central_dir == 1) ? "entry" : "entries", + G.ecrec.size_central_directory, + G.ecrec.size_central_directory)); + Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive3), + G.ecrec.offset_start_central_directory, + G.ecrec.offset_start_central_directory)); + } + + /*----------------------------------------------------------------------- + Get the zipfile comment, if any, and print it out. (Comment may be + up to 64KB long. May the fleas of a thousand camels infest the arm- + pits of anyone who actually takes advantage of this fact.) + -----------------------------------------------------------------------*/ + + if (!G.ecrec.zipfile_comment_length) + Info(slide, 0, ((char *)slide, LoadFarString(NoZipfileComment))); + else { + Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommentDesc), + G.ecrec.zipfile_comment_length)); + Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommBegin))); + if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) + error = PK_WARN; + Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommEnd))); + if (error) + Info(slide, 0, ((char *)slide, + LoadFarString(ZipfileCommTrunc2))); + } /* endif (comment exists) */ + + /* non-verbose mode: print zipfile comment only if requested */ + } else if (uO.zflag && G.ecrec.zipfile_comment_length) { + if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) { + Info(slide, 0x401, ((char *)slide, + LoadFarString(ZipfileCommTruncMsg))); + error = PK_WARN; + } + } /* endif (verbose) */ + + return error; + +} /* end function zi_end_central() */ + + + + + +/************************/ +/* Function zipinfo() */ +/************************/ + +int zipinfo(__G) /* return PK-type error code */ + __GDEF +{ + int do_this_file=FALSE, error, error_in_archive=PK_COOL; + int *fn_matched=NULL, *xn_matched=NULL; + ulg j, members=0L; + ulg tot_csize=0L, tot_ucsize=0L; + ulg endprev; /* buffers end of previous entry for zi_long()'s check + * of extra bytes */ + + +/*--------------------------------------------------------------------------- + Malloc space for check on unmatched filespecs (no big deal if one or both + are NULL). + ---------------------------------------------------------------------------*/ + + if (G.filespecs > 0 && + (fn_matched=(int *)malloc(G.filespecs*sizeof(int))) != NULL) + for (j = 0; j < G.filespecs; ++j) + fn_matched[j] = FALSE; + + if (G.xfilespecs > 0 && + (xn_matched=(int *)malloc(G.xfilespecs*sizeof(int))) != NULL) + for (j = 0; j < G.xfilespecs; ++j) + xn_matched[j] = FALSE; + +/*--------------------------------------------------------------------------- + Set file pointer to start of central directory, then loop through cen- + tral directory entries. Check that directory-entry signature bytes are + actually there (just a precaution), then process the entry. We know + the entire central directory is on this disk: we wouldn't have any of + this information unless the end-of-central-directory record was on this + disk, and we wouldn't have gotten to this routine unless this is also + the disk on which the central directory starts. In practice, this had + better be the *only* disk in the archive, but maybe someday we'll add + multi-disk support. + ---------------------------------------------------------------------------*/ + + uO.L_flag = FALSE; /* zipinfo mode: never convert name to lowercase */ + G.pInfo = G.info; /* (re-)initialize, (just to make sure) */ + G.pInfo->textmode = 0; /* so one can read on screen (is this ever used?) */ + + /* reset endprev for new zipfile; account for multi-part archives (?) */ + endprev = (G.crec.relative_offset_local_header == 4L)? 4L : 0L; + + + for (j = 1L;; j++) { + if (readbuf(__G__ G.sig, 4) == 0) + return PK_EOF; + if (strncmp(G.sig, central_hdr_sig, 4)) { /* is it a CentDir entry? */ + if (((unsigned)(j - 1) & (unsigned)0xFFFF) == + (unsigned)G.ecrec.total_entries_central_dir) { + /* "j modulus 64k" matches the reported 16-bit-unsigned + * number of directory entries -> probably, the regular + * end of the central directory has been reached + */ + break; + } else { + Info(slide, 0x401, + ((char *)slide, LoadFarString(CentSigMsg), j)); + Info(slide, 0x401, + ((char *)slide, LoadFarString(ReportMsg))); + return PK_BADERR; /* sig not found */ + } + } + /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag, ...: */ + if ((error = process_cdir_file_hdr(__G)) != PK_COOL) + return error; /* only PK_EOF defined */ + + if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != + PK_COOL) + { + error_in_archive = error; /* might be warning */ + if (error > PK_WARN) /* fatal */ + return error; + } + + if (!G.process_all_files) { /* check if specified on command line */ + unsigned i; + + do_this_file = FALSE; + for (i = 0; i < G.filespecs; i++) + if (match(G.filename, G.pfnames[i], uO.C_flag)) { + do_this_file = TRUE; + if (fn_matched) + fn_matched[i] = TRUE; + break; /* found match, so stop looping */ + } + if (do_this_file) { /* check if this is an excluded file */ + for (i = 0; i < G.xfilespecs; i++) + if (match(G.filename, G.pxnames[i], uO.C_flag)) { + do_this_file = FALSE; /* ^-- ignore case in match */ + if (xn_matched) + xn_matched[i] = TRUE; + break; + } + } + } + + /*----------------------------------------------------------------------- + If current file was specified on command line, or if no names were + specified, do the listing for this file. Otherwise, get rid of the + file comment and go back for the next file. + -----------------------------------------------------------------------*/ + + if (G.process_all_files || do_this_file) { + + switch (uO.lflag) { + case 1: + case 2: + fnprint(__G); + SKIP_(G.crec.extra_field_length) + SKIP_(G.crec.file_comment_length) + break; + + case 3: + case 4: + case 5: + if ((error = zi_short(__G)) != PK_COOL) { + error_in_archive = error; /* might be warning */ + if (error > PK_WARN) /* fatal */ + return error; + } + break; + + case 10: + Info(slide, 0, ((char *)slide, + LoadFarString(CentralDirEntry), j)); + if ((error = zi_long(__G__ &endprev)) != PK_COOL) { + error_in_archive = error; /* might be warning */ + if (error > PK_WARN) /* fatal */ + return error; + } + break; + + default: + SKIP_(G.crec.extra_field_length) + SKIP_(G.crec.file_comment_length) + break; + + } /* end switch (lflag) */ + + tot_csize += G.crec.csize; + tot_ucsize += G.crec.ucsize; + if (G.crec.general_purpose_bit_flag & 1) + tot_csize -= 12; /* don't count encryption header */ + ++members; + +#ifdef DLL + if ((G.statreportcb != NULL) && + (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn, + G.filename, (zvoid *)&G.crec.ucsize)) { + if (fn_matched) + free((zvoid *)fn_matched); + if (xn_matched) + free((zvoid *)xn_matched); + return IZ_CTRLC; /* cancel operation by user request */ + } +#endif +#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ + UserStop(); +#endif + + } else { /* not listing this file */ + SKIP_(G.crec.extra_field_length) + SKIP_(G.crec.file_comment_length) + + } /* end if (list member?) */ + + } /* end for-loop (j: member files) */ + +/*--------------------------------------------------------------------------- + Check that we actually found requested files; if so, print totals. + ---------------------------------------------------------------------------*/ + + if (uO.tflag) { + char *sgn = ""; + int cfactor = ratio(tot_ucsize, tot_csize); + + if (cfactor < 0) { + sgn = "-"; + cfactor = -cfactor; + } + Info(slide, 0, ((char *)slide, LoadFarString(ZipfileStats), + members, (members==1L)? nullStr:PlurSufx, tot_ucsize, + tot_csize, sgn, cfactor/10, cfactor%10)); + } + +/*--------------------------------------------------------------------------- + Check for unmatched filespecs on command line and print warning if any + found. + ---------------------------------------------------------------------------*/ + + if (fn_matched) { + for (j = 0; j < G.filespecs; ++j) + if (!fn_matched[j]) + Info(slide, 0x401, ((char *)slide, + LoadFarString(FilenameNotMatched), G.pfnames[j])); + free((zvoid *)fn_matched); + } + if (xn_matched) { + for (j = 0; j < G.xfilespecs; ++j) + if (!xn_matched[j]) + Info(slide, 0x401, ((char *)slide, + LoadFarString(ExclFilenameNotMatched), G.pxnames[j])); + free((zvoid *)xn_matched); + } + +/*--------------------------------------------------------------------------- + Double check that we're back at the end-of-central-directory record. + ---------------------------------------------------------------------------*/ + + if (strncmp(G.sig, end_central_sig, 4)) { /* just to make sure again */ + Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); + error_in_archive = PK_WARN; /* didn't find sig */ + } + if (members == 0 && error_in_archive <= PK_WARN) + error_in_archive = PK_FIND; + + if (uO.lflag >= 10) + (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); + + return error_in_archive; + +} /* end function zipinfo() */ + + + + + +/************************/ +/* Function zi_long() */ +/************************/ + +static int zi_long(__G__ pEndprev) /* return PK-type error code */ + __GDEF + ulg *pEndprev; /* for zi_long() check of extra bytes */ +{ +#ifdef USE_EF_UT_TIME + iztimes z_utime; +#endif + int error, error_in_archive=PK_COOL; + unsigned hostnum, hostver, extnum, extver, methnum, xattr; + char workspace[12], attribs[22]; + ZCONST char *varmsg_str; + char unkn[16]; + static ZCONST char Far *os[NUM_HOSTS] = { + OS_FAT, OS_Amiga, OS_VMS, OS_Unix, OS_VMCMS, OS_AtariST, OS_HPFS, + OS_Macintosh, OS_ZSystem, OS_CPM, OS_TOPS20, OS_NTFS, OS_QDOS, + OS_Acorn, OS_VFAT, OS_MVS, OS_BeOS, OS_Tandem, OS_Theos + }; + static ZCONST char Far *method[NUM_METHODS] = { + MthdNone, MthdShrunk, MthdRedF1, MthdRedF2, MthdRedF3, MthdRedF4, + MthdImplode, MthdToken, MthdDeflate, MthdDeflat64, MthdDCLImplode + }; + static ZCONST char Far *dtypelng[4] = { + DeflNorm, DeflMax, DeflFast, DeflSFast + }; + + +/*--------------------------------------------------------------------------- + Check whether there's any extra space inside the zipfile. If *pEndprev is + zero, it's probably a signal that OS/2 extra fields are involved (with + unknown compressed size). We won't worry about prepended junk here... + ---------------------------------------------------------------------------*/ + + if (G.crec.relative_offset_local_header != *pEndprev && *pEndprev > 0L) { + /* GRR DEBUG + Info(slide, 0, ((char *)slide, + " [crec.relative_offset_local_header = %lu, endprev = %lu]\n", + G.crec.relative_offset_local_header, *pEndprev)); + */ + Info(slide, 0, ((char *)slide, LoadFarString(ExtraBytesPreceding), + (long)G.crec.relative_offset_local_header - (long)(*pEndprev))); + } + + /* calculate endprev for next time around (problem: extra fields may + * differ in length between local and central-directory records) */ + *pEndprev = G.crec.relative_offset_local_header + (4L + LREC_SIZE) + + G.crec.filename_length + G.crec.extra_field_length + G.crec.csize; + +/*--------------------------------------------------------------------------- + Read the extra field, if any. It may be used to get UNIX style modtime. + ---------------------------------------------------------------------------*/ + + if ((error = do_string(__G__ G.crec.extra_field_length, EXTRA_FIELD)) != 0) + { + if (G.extra_field != NULL) { + free(G.extra_field); + G.extra_field = NULL; + } + error_in_archive = error; + /* The premature return in case of a "fatal" error (PK_EOF) is + * delayed until we analyze the extra field contents. + * This allows us to display all the other info that has been + * successfully read in. + */ + } + +/*--------------------------------------------------------------------------- + Print out various interesting things about the compressed file. + ---------------------------------------------------------------------------*/ + + hostnum = (unsigned)(G.pInfo->hostnum); + hostver = (unsigned)(G.pInfo->hostver); + extnum = (unsigned)MIN(G.crec.version_needed_to_extract[1], NUM_HOSTS); + extver = (unsigned)G.crec.version_needed_to_extract[0]; + methnum = (unsigned)MIN(G.crec.compression_method, NUM_METHODS); + + (*G.message)((zvoid *)&G, (uch *)" ", 2L, 0); fnprint(__G); + + Info(slide, 0, ((char *)slide, LoadFarString(LocalHeaderOffset), + G.crec.relative_offset_local_header, + G.crec.relative_offset_local_header)); + + if (hostnum >= NUM_HOSTS) { + sprintf(unkn, LoadFarString(UnknownNo), + (int)G.crec.version_made_by[1]); + varmsg_str = unkn; + } else { + varmsg_str = LoadFarStringSmall(os[hostnum]); +#ifdef OLD_THEOS_EXTRA + if (hostnum == FS_VFAT_ && hostver == 20) { + /* entry made by old non-official THEOS port zip archive */ + varmsg_str = LoadFarStringSmall(OS_TheosOld); + } +#endif /* OLD_THEOS_EXTRA */ + } + Info(slide, 0, ((char *)slide, LoadFarString(HostOS), varmsg_str)); + Info(slide, 0, ((char *)slide, LoadFarString(EncodeSWVer), hostver/10, + hostver%10)); + + if (extnum >= NUM_HOSTS) { + sprintf(unkn, LoadFarString(UnknownNo), + (int)G.crec.version_needed_to_extract[1]); + varmsg_str = unkn; + } else { + varmsg_str = LoadFarStringSmall(os[extnum]); + } + Info(slide, 0, ((char *)slide, LoadFarString(MinOSCompReq), varmsg_str)); + Info(slide, 0, ((char *)slide, LoadFarString(MinSWVerReq), extver/10, + extver%10)); + + if (methnum >= NUM_METHODS) { + sprintf(unkn, LoadFarString(UnknownNo), G.crec.compression_method); + varmsg_str = unkn; + } else { + varmsg_str = LoadFarStringSmall(method[methnum]); + } + Info(slide, 0, ((char *)slide, LoadFarString(CompressMethod), varmsg_str)); + if (methnum == IMPLODED) { + Info(slide, 0, ((char *)slide, LoadFarString(SlideWindowSizeImplode), + (G.crec.general_purpose_bit_flag & 2)? '8' : '4')); + Info(slide, 0, ((char *)slide, LoadFarString(ShannonFanoTrees), + (G.crec.general_purpose_bit_flag & 4)? '3' : '2')); + } else if (methnum == DEFLATED || methnum == ENHDEFLATED) { + ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); + + Info(slide, 0, ((char *)slide, LoadFarString(CompressSubtype), + LoadFarStringSmall(dtypelng[dnum]))); + } + + Info(slide, 0, ((char *)slide, LoadFarString(FileSecurity), + (G.crec.general_purpose_bit_flag & 1) ? nullStr : "not ")); + Info(slide, 0, ((char *)slide, LoadFarString(ExtendedLocalHdr), + (G.crec.general_purpose_bit_flag & 8) ? "yes" : "no")); + /* print upper 3 bits for amusement? */ + + /* For printing of date & time, a "char d_t_buf[21]" is required. + * To save stack space, we reuse the "char attribs[22]" buffer which + * is not used yet. + */ +# define d_t_buf attribs + + zi_time(__G__ &G.crec.last_mod_dos_datetime, NULL, d_t_buf); + Info(slide, 0, ((char *)slide, LoadFarString(FileModDate), d_t_buf)); +#ifdef USE_EF_UT_TIME + if (G.extra_field && +#ifdef IZ_CHECK_TZ + G.tz_is_valid && +#endif + (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, + G.crec.last_mod_dos_datetime, &z_utime, NULL) + & EB_UT_FL_MTIME)) + { + TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0 or Macintosh */ + d_t_buf[0] = (char)0; /* signal "show local time" */ + zi_time(__G__ &G.crec.last_mod_dos_datetime, &(z_utime.mtime), d_t_buf); + Info(slide, 0, ((char *)slide, LoadFarString(UT_FileModDate), + d_t_buf, LoadFarStringSmall(LocalTime))); +#ifndef NO_GMTIME + d_t_buf[0] = (char)1; /* signal "show UTC (GMT) time" */ + zi_time(__G__ &G.crec.last_mod_dos_datetime, &(z_utime.mtime), d_t_buf); + Info(slide, 0, ((char *)slide, LoadFarString(UT_FileModDate), + d_t_buf, LoadFarStringSmall(GMTime))); +#endif /* !NO_GMTIME */ + } +#endif /* USE_EF_UT_TIME */ + + Info(slide, 0, ((char *)slide, LoadFarString(CRC32Value), G.crec.crc32)); + Info(slide, 0, ((char *)slide, LoadFarString(CompressedFileSize), + G.crec.csize)); + Info(slide, 0, ((char *)slide, LoadFarString(UncompressedFileSize), + G.crec.ucsize)); + Info(slide, 0, ((char *)slide, LoadFarString(FilenameLength), + G.crec.filename_length)); + Info(slide, 0, ((char *)slide, LoadFarString(ExtraFieldLength), + G.crec.extra_field_length)); + Info(slide, 0, ((char *)slide, LoadFarString(FileCommentLength), + G.crec.file_comment_length)); + Info(slide, 0, ((char *)slide, LoadFarString(FileDiskNum), + G.crec.disk_number_start + 1)); + Info(slide, 0, ((char *)slide, LoadFarString(ApparentFileType), + (G.crec.internal_file_attributes & 1)? "text" + : (G.crec.internal_file_attributes & 2)? "ebcdic" + : "binary")); /* changed to accept EBCDIC */ +#ifdef ATARI + printf(" external file attributes (hex): %.8lx\n", + G.crec.external_file_attributes); +#endif + xattr = (unsigned)((G.crec.external_file_attributes >> 16) & 0xFFFF); + if (hostnum == VMS_) { + char *p=attribs, *q=attribs+1; + int i, j, k; + + for (k = 0; k < 12; ++k) + workspace[k] = 0; + if (xattr & VMS_IRUSR) + workspace[0] = 'R'; + if (xattr & VMS_IWUSR) { + workspace[1] = 'W'; + workspace[3] = 'D'; + } + if (xattr & VMS_IXUSR) + workspace[2] = 'E'; + if (xattr & VMS_IRGRP) + workspace[4] = 'R'; + if (xattr & VMS_IWGRP) { + workspace[5] = 'W'; + workspace[7] = 'D'; + } + if (xattr & VMS_IXGRP) + workspace[6] = 'E'; + if (xattr & VMS_IROTH) + workspace[8] = 'R'; + if (xattr & VMS_IWOTH) { + workspace[9] = 'W'; + workspace[11] = 'D'; + } + if (xattr & VMS_IXOTH) + workspace[10] = 'E'; + + *p++ = '('; + for (k = j = 0; j < 3; ++j) { /* loop over groups of permissions */ + for (i = 0; i < 4; ++i, ++k) /* loop over perms within a group */ + if (workspace[k]) + *p++ = workspace[k]; + *p++ = ','; /* group separator */ + if (j == 0) + while ((*p++ = *q++) != ',') + ; /* system, owner perms are same */ + } + *p-- = '\0'; + *p = ')'; /* overwrite last comma */ + Info(slide, 0, ((char *)slide, LoadFarString(VMSFileAttributes), xattr, + attribs)); + + } else if (hostnum == AMIGA_) { + switch (xattr & AMI_IFMT) { + case AMI_IFDIR: attribs[0] = 'd'; break; + case AMI_IFREG: attribs[0] = '-'; break; + default: attribs[0] = '?'; break; + } + attribs[1] = (xattr & AMI_IHIDDEN)? 'h' : '-'; + attribs[2] = (xattr & AMI_ISCRIPT)? 's' : '-'; + attribs[3] = (xattr & AMI_IPURE)? 'p' : '-'; + attribs[4] = (xattr & AMI_IARCHIVE)? 'a' : '-'; + attribs[5] = (xattr & AMI_IREAD)? 'r' : '-'; + attribs[6] = (xattr & AMI_IWRITE)? 'w' : '-'; + attribs[7] = (xattr & AMI_IEXECUTE)? 'e' : '-'; + attribs[8] = (xattr & AMI_IDELETE)? 'd' : '-'; + attribs[9] = 0; /* better dlm the string */ + Info(slide, 0, ((char *)slide, LoadFarString(AmigaFileAttributes), + xattr, attribs)); + + } else if (hostnum == THEOS_) { + ZCONST char Far *fpFtyp; + + switch (xattr & THS_IFMT) { + case THS_IFLIB: fpFtyp = TheosFTypLib; break; + case THS_IFDIR: fpFtyp = TheosFTypDir; break; + case THS_IFREG: fpFtyp = TheosFTypReg; break; + case THS_IFREL: fpFtyp = TheosFTypRel; break; + case THS_IFKEY: fpFtyp = TheosFTypKey; break; + case THS_IFIND: fpFtyp = TheosFTypInd; break; + case THS_IFR16: fpFtyp = TheosFTypR16; break; + case THS_IFP16: fpFtyp = TheosFTypP16; break; + case THS_IFP32: fpFtyp = TheosFTypP32; break; + default: fpFtyp = TheosFTypUkn; break; + } + strcpy(attribs, LoadFarStringSmall(fpFtyp)); + attribs[12] = (xattr & THS_INHID) ? '.' : 'H'; + attribs[13] = (xattr & THS_IMODF) ? '.' : 'M'; + attribs[14] = (xattr & THS_IWOTH) ? '.' : 'W'; + attribs[15] = (xattr & THS_IROTH) ? '.' : 'R'; + attribs[16] = (xattr & THS_IEUSR) ? '.' : 'E'; + attribs[17] = (xattr & THS_IXUSR) ? '.' : 'X'; + attribs[18] = (xattr & THS_IWUSR) ? '.' : 'W'; + attribs[19] = (xattr & THS_IRUSR) ? '.' : 'R'; + attribs[20] = 0; + Info(slide, 0, ((char *)slide, LoadFarString(TheosFileAttributes), + xattr, attribs)); + +#ifdef OLD_THEOS_EXTRA + } else if (hostnum == FS_VFAT_ && hostver == 20) { + /* process old non-official THEOS port zip archive */ + ZCONST char Far *fpFtyp; + + switch (xattr & _THS_IFMT) { + case _THS_IFLIB: fpFtyp = TheosFTypLib; break; + case _THS_IFDIR: fpFtyp = TheosFTypDir; break; + case _THS_IFREG: fpFtyp = TheosFTypReg; break; + case _THS_IODRC: fpFtyp = TheosFTypRel; break; + case _THS_IOKEY: fpFtyp = TheosFTypKey; break; + case _THS_IOIND: fpFtyp = TheosFTypInd; break; + case _THS_IOPRG: fpFtyp = TheosFTypR16; break; + case _THS_IO286: fpFtyp = TheosFTypP16; break; + case _THS_IO386: fpFtyp = TheosFTypP32; break; + default: fpFtyp = TheosFTypUkn; break; + } + strcpy(attribs, LoadFarStringSmall(fpFtyp)); + attribs[12] = (xattr & _THS_HIDDN) ? 'H' : '.'; + attribs[13] = (xattr & _THS_IXOTH) ? '.' : 'X'; + attribs[14] = (xattr & _THS_IWOTH) ? '.' : 'W'; + attribs[15] = (xattr & _THS_IROTH) ? '.' : 'R'; + attribs[16] = (xattr & _THS_IEUSR) ? '.' : 'E'; + attribs[17] = (xattr & _THS_IXUSR) ? '.' : 'X'; + attribs[18] = (xattr & _THS_IWUSR) ? '.' : 'W'; + attribs[19] = (xattr & _THS_IRUSR) ? '.' : 'R'; + attribs[20] = 0; + Info(slide, 0, ((char *)slide, LoadFarString(TheosFileAttributes), + xattr, attribs)); +#endif /* OLD_THEOS_EXTRA */ + + } else if ((hostnum != FS_FAT_) && (hostnum != FS_HPFS_) && + (hostnum != FS_NTFS_) && (hostnum != FS_VFAT_) && + (hostnum != ACORN_) && + (hostnum != VM_CMS_) && (hostnum != MVS_)) + { /* assume Unix-like */ + switch ((unsigned)(xattr & UNX_IFMT)) { + case (unsigned)UNX_IFDIR: attribs[0] = 'd'; break; + case (unsigned)UNX_IFREG: attribs[0] = '-'; break; + case (unsigned)UNX_IFLNK: attribs[0] = 'l'; break; + case (unsigned)UNX_IFBLK: attribs[0] = 'b'; break; + case (unsigned)UNX_IFCHR: attribs[0] = 'c'; break; + case (unsigned)UNX_IFIFO: attribs[0] = 'p'; break; + case (unsigned)UNX_IFSOCK: attribs[0] = 's'; break; + default: attribs[0] = '?'; break; + } + attribs[1] = (xattr & UNX_IRUSR)? 'r' : '-'; + attribs[4] = (xattr & UNX_IRGRP)? 'r' : '-'; + attribs[7] = (xattr & UNX_IROTH)? 'r' : '-'; + + attribs[2] = (xattr & UNX_IWUSR)? 'w' : '-'; + attribs[5] = (xattr & UNX_IWGRP)? 'w' : '-'; + attribs[8] = (xattr & UNX_IWOTH)? 'w' : '-'; + + if (xattr & UNX_IXUSR) + attribs[3] = (xattr & UNX_ISUID)? 's' : 'x'; + else + attribs[3] = (xattr & UNX_ISUID)? 'S' : '-'; /* S = undefined */ + if (xattr & UNX_IXGRP) + attribs[6] = (xattr & UNX_ISGID)? 's' : 'x'; /* == UNX_ENFMT */ + else + attribs[6] = (xattr & UNX_ISGID)? 'l' : '-'; + if (xattr & UNX_IXOTH) + attribs[9] = (xattr & UNX_ISVTX)? 't' : 'x'; /* "sticky bit" */ + else + attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T = undefined */ + attribs[10] = 0; + + Info(slide, 0, ((char *)slide, LoadFarString(UnixFileAttributes), xattr, + attribs)); + + } else { + Info(slide, 0, ((char *)slide, LoadFarString(NonMSDOSFileAttributes), + G.crec.external_file_attributes >> 8)); + + } /* endif (hostnum: external attributes format) */ + + if ((xattr=(unsigned)(G.crec.external_file_attributes & 0xFF)) == 0) + Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributes), + xattr)); + else if (xattr == 1) + Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributesRO), + xattr)); + else + Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributesAlpha), + xattr, (xattr&1)? "rdo " : nullStr, + (xattr&2)? "hid " : nullStr, + (xattr&4)? "sys " : nullStr, + (xattr&8)? "lab " : nullStr, + (xattr&16)? "dir " : nullStr, + (xattr&32)? "arc " : nullStr, + (xattr&64)? "lnk " : nullStr, + (xattr&128)? "exe" : nullStr)); + +/*--------------------------------------------------------------------------- + Analyze the extra field, if any, and print the file comment, if any (the + filename has already been printed, above). That finishes up this file + entry... + ---------------------------------------------------------------------------*/ + + if (G.crec.extra_field_length > 0) { + uch *ef_ptr = G.extra_field; + ush ef_len = G.crec.extra_field_length; + ush eb_id, eb_datalen; + ZCONST char Far *ef_fieldname; + + if (error_in_archive > PK_WARN) /* fatal: can't continue */ + /* delayed "fatal error" return from extra field reading */ + return error; + if (G.extra_field == (uch *)NULL) + return PK_ERR; /* not consistent with crec length */ + + Info(slide, 0, ((char *)slide, LoadFarString(ExtraFields))); + + while (ef_len >= EB_HEADSIZE) { + eb_id = makeword(&ef_ptr[EB_ID]); + eb_datalen = makeword(&ef_ptr[EB_LEN]); + ef_ptr += EB_HEADSIZE; + ef_len -= EB_HEADSIZE; + + if (eb_datalen > (ush)ef_len) { + Info(slide, 0x421, ((char *)slide, + LoadFarString(ExtraFieldTrunc), eb_id, eb_datalen, ef_len)); + eb_datalen = ef_len; + } + + switch (eb_id) { + case EF_PKSZ64: + ef_fieldname = efPKSZ64; + break; + case EF_AV: + ef_fieldname = efAV; + break; + case EF_OS2: + ef_fieldname = efOS2; + break; + case EF_ACL: + ef_fieldname = efACL; + break; + case EF_NTSD: + ef_fieldname = efNTSD; + break; + case EF_PKVMS: + ef_fieldname = efPKVMS; + break; + case EF_IZVMS: + ef_fieldname = efIZVMS; + break; + case EF_PKW32: + ef_fieldname = efPKWin32; + break; + case EF_PKUNIX: + ef_fieldname = efPKUnix; + break; + case EF_IZUNIX: + ef_fieldname = efIZUnix; + if (hostnum == UNIX_ && *pEndprev > 0L) + *pEndprev += 4L; /* also have UID/GID in local copy */ + break; + case EF_IZUNIX2: + ef_fieldname = efIZUnix2; + if (*pEndprev > 0L) + *pEndprev += 4L; /* 4 byte UID/GID in local copy */ + break; + case EF_TIME: + ef_fieldname = efTime; + break; + case EF_MAC3: + ef_fieldname = efMac3; + break; + case EF_JLMAC: + ef_fieldname = efJLMac; + break; + case EF_ZIPIT: + ef_fieldname = efZipIt; + break; + case EF_ZIPIT2: + ef_fieldname = efZipIt2; + break; + case EF_VMCMS: + ef_fieldname = efVMCMS; + break; + case EF_MVS: + ef_fieldname = efMVS; + break; + case EF_BEOS: + ef_fieldname = efBeOS; + break; + case EF_QDOS: + ef_fieldname = efQDOS; + break; + case EF_AOSVS: + ef_fieldname = efAOSVS; + break; + case EF_SPARK: /* from RISC OS */ + ef_fieldname = efSpark; + break; + case EF_MD5: + ef_fieldname = efMD5; + break; + case EF_ASIUNIX: + ef_fieldname = efASiUnix; + break; + case EF_TANDEM: + ef_fieldname = efTandem; + break; + case EF_SMARTZIP: + ef_fieldname = efSmartZip; + break; + case EF_THEOS: +#ifdef OLD_THEOS_EXTRA + case EF_THEOSO: +#endif + ef_fieldname = efTheos; + break; + default: + ef_fieldname = efUnknown; + break; + } + Info(slide, 0, ((char *)slide, LoadFarString(ExtraFieldType), + eb_id, LoadFarStringSmall(ef_fieldname), eb_datalen)); + + /* additional, field-specific information: */ + switch (eb_id) { + case EF_OS2: + case EF_ACL: + if (eb_datalen >= EB_OS2_HLEN) { + if (eb_id == EF_OS2) + ef_fieldname = OS2EAs; + else + ef_fieldname = ACLdata; + Info(slide, 0, ((char *)slide, + LoadFarString(ef_fieldname), makelong(ef_ptr))); + *pEndprev = 0L; /* no clue about csize of local */ + } + break; + case EF_NTSD: + if (eb_datalen >= EB_NTSD_C_LEN) { + Info(slide, 0, ((char *)slide, LoadFarString(NTSDData), + makelong(ef_ptr))); + *pEndprev = 0L; /* no clue about csize of local */ + } + break; + case EF_IZVMS: + if (eb_datalen >= 8) { + char *p, q[8]; + unsigned compr = makeword(ef_ptr+EB_IZVMS_FLGS) + & EB_IZVMS_BCMASK; + + *q = '\0'; + if (compr > 3) + compr = 3; + if (strncmp((char *)ef_ptr, "VFAB", 4) == 0) + p = "FAB"; + else if (strncmp((char *)ef_ptr, "VALL", 4) == 0) + p = "XABALL"; + else if (strncmp((char *)ef_ptr, "VFHC", 4) == 0) + p = "XABFHC"; + else if (strncmp((char *)ef_ptr, "VDAT", 4) == 0) + p = "XABDAT"; + else if (strncmp((char *)ef_ptr, "VRDT", 4) == 0) + p = "XABRDT"; + else if (strncmp((char *)ef_ptr, "VPRO", 4) == 0) + p = "XABPRO"; + else if (strncmp((char *)ef_ptr, "VKEY", 4) == 0) + p = "XABKEY"; + else if (strncmp((char *)ef_ptr, "VMSV", 4) == 0) { + p = "version"; + if (eb_datalen >= 16) { + q[0] = ' '; + q[1] = '('; + strncpy(q+2, (char *)ef_ptr+EB_IZVMS_HLEN, 4); + q[6] = ')'; + q[7] = '\0'; + } + } else + p = "unknown"; + Info(slide, 0, ((char *)slide, + LoadFarString(izVMSdata), + LoadFarStringSmall(izVMScomp[compr]), + makeword(ef_ptr+EB_IZVMS_UCSIZ), p, q)); + } + break; + case EF_TIME: + if (eb_datalen >= 1) { + char types[80]; + int num = 0, len; + + *types = '\0'; + if (*ef_ptr & 1) { + strcpy(types, LoadFarString(UTmodification)); + ++num; + } + if (*ef_ptr & 2) { + len = strlen(types); + if (num) + types[len++] = '/'; + strcpy(types+len, LoadFarString(UTaccess)); + ++num; + if (*pEndprev > 0L) + *pEndprev += 4L; + } + if (*ef_ptr & 4) { + len = strlen(types); + if (num) + types[len++] = '/'; + strcpy(types+len, LoadFarString(UTcreation)); + ++num; + if (*pEndprev > 0L) + *pEndprev += 4L; + } + if (num > 0) + Info(slide, 0, ((char *)slide, + LoadFarString(UTdata), types, + num == 1? nullStr : PlurSufx)); + } + break; + case EF_MAC3: + if (eb_datalen >= EB_MAC3_HLEN) { + ulg eb_uc = makelong(ef_ptr); + unsigned mac3_flgs = makeword(ef_ptr+EB_FLGS_OFFS); + unsigned eb_is_uc = mac3_flgs & EB_M3_FL_UNCMPR; + + Info(slide, 0, ((char *)slide, LoadFarString(Mac3data), + eb_uc, eb_is_uc ? "un" : nullStr)); + if (eb_is_uc) { + if (*pEndprev > 0L) + *pEndprev += makelong(ef_ptr); + } else { + *pEndprev = 0L; /* no clue about csize of local */ + } + + Info(slide, 0, ((char *)slide, + LoadFarString(MacOSMAC3flags), + LoadFarStringSmall(mac3_flgs & EB_M3_FL_DATFRK ? + MacOS_DF : MacOS_RF), + (mac3_flgs & EB_M3_FL_TIME64 ? 64 : 32))); + zi_showMacTypeCreator(__G__ &ef_ptr[6]); + } + break; + case EF_ZIPIT2: + if (eb_datalen >= 5 && + strncmp((char *)ef_ptr, "ZPIT", 4) == 0) { + + if (eb_datalen >= 12) { + zi_showMacTypeCreator(__G__ &ef_ptr[4]); + } + } + break; + case EF_ZIPIT: + if (eb_datalen >= 5 && + strncmp((char *)ef_ptr, "ZPIT", 4) == 0) { + unsigned fnlen = ef_ptr[4]; + + if ((unsigned)eb_datalen >= fnlen + (5 + 8)) { + uch nullchar = ef_ptr[fnlen+5]; + + ef_ptr[fnlen+5] = '\0'; /* terminate filename */ + Info(slide, 0, ((char *)slide, + LoadFarString(ZipItFname), (char *)ef_ptr+5)); + ef_ptr[fnlen+5] = nullchar; + zi_showMacTypeCreator(__G__ &ef_ptr[fnlen+5]); + } + } + break; + case EF_JLMAC: + if (eb_datalen >= 40 && + strncmp((char *)ef_ptr, "JLEE", 4) == 0) + { + zi_showMacTypeCreator(__G__ &ef_ptr[4]); + + Info(slide, 0, ((char *)slide, + LoadFarString(MacOSJLEEflags), + LoadFarStringSmall(ef_ptr[31] & 1 ? + MacOS_DF : MacOS_RF))); + } + break; + case EF_SMARTZIP: + if ((eb_datalen == EB_SMARTZIP_HLEN) && + strncmp((char *)ef_ptr, "dZip", 4) == 0) { + char filenameBuf[32]; + zi_showMacTypeCreator(__G__ &ef_ptr[4]); + memcpy(filenameBuf, &ef_ptr[33], 31); + filenameBuf[ef_ptr[32]] = '\0'; + Info(slide, 0, ((char *)slide, + LoadFarString(ZipItFname), filenameBuf)); + } + break; +#ifdef CMS_MVS + case EF_VMCMS: + case EF_MVS: + { + char type[100]; + + Info(slide, 0, ((char *)slide, + LoadFarString(VmMvsExtraField), + (getVMMVSexfield(type, ef_ptr-EB_HEADSIZE, + (unsigned)eb_datalen) > 0)? + type : LoadFarStringSmall(VmMvsInvalid))); + } + break; +#endif /* CMS_MVS */ + case EF_BEOS: + if (eb_datalen >= EB_BEOS_HLEN) { + ulg eb_uc = makelong(ef_ptr); + unsigned eb_is_uc = + *(ef_ptr+EB_FLGS_OFFS) & EB_BE_FL_UNCMPR; + + Info(slide, 0, ((char *)slide, LoadFarString(BeOSdata), + eb_uc, eb_is_uc ? "un" : nullStr)); + if (eb_is_uc) { + if (*pEndprev > 0L) + *pEndprev += makelong(ef_ptr); + } else { + *pEndprev = 0L; /* no clue about csize of local */ + } + } + break; + case EF_QDOS: + if (eb_datalen >= 4) { + Info(slide, 0, ((char *)slide, LoadFarString(QDOSdata), + ef_ptr[0], ef_ptr[1], ef_ptr[2], ef_ptr[3])); + } + break; + case EF_AOSVS: + if (eb_datalen >= 5) { + Info(slide, 0, ((char *)slide, LoadFarString(AOSVSdata), + ((int)(uch)ef_ptr[4])/10, ((int)(uch)ef_ptr[4])%10)); + } + break; + case EF_TANDEM: + if (eb_datalen == 20) { + unsigned type, code; + + type = (ef_ptr[18] & 0x60) >> 5; + code = makeword(ef_ptr); + /* Arrg..., Tandem e.f. uses BigEndian byte-order */ + code = ((code << 8) & 0xff00) | ((code >> 8) & 0x00ff); + if (type == NSK_UNSTRUCTURED) { + if (code == NSK_EDITFILECODE) + type = 4; + else if (code == NSK_OBJECTFILECODE) + type = 5; + } + Info(slide, 0, ((char *)slide, + LoadFarString(Tandemdata), + LoadFarStringSmall(TandemFileformat[type]), + code)); + } + break; + case EF_MD5: + if (eb_datalen >= 19) { + char md5[33]; + int i; + + for (i = 0; i < 16; ++i) + sprintf(&md5[i<<1], "%02x", ef_ptr[15-i]); + md5[32] = '\0'; + Info(slide, 0, ((char *)slide, LoadFarString(MD5data), + md5)); + break; + } /* else: fall through !! */ + default: + if (eb_datalen > 0) { + ush i, n; + + if (eb_datalen <= 24) { + Info(slide, 0, ((char *)slide, + LoadFarString(ColonIndent))); + n = eb_datalen; + } else { + Info(slide, 0, ((char *)slide, + LoadFarString(First20))); + n = 20; + } + for (i = 0; i < n; ++i) + Info(slide, 0, ((char *)slide, + LoadFarString(efFormat), ef_ptr[i])); + } + break; + } + (*G.message)((zvoid *)&G, (uch *)".", 1L, 0); + + ef_ptr += eb_datalen; + ef_len -= eb_datalen; + } + (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); + } + + /* high bit == Unix/OS2/NT GMT times (mtime, atime); next bit == UID/GID */ + if ((xattr = (unsigned)((G.crec.external_file_attributes & 0xC000) >> 12)) + & 8) + { + if (hostnum == UNIX_ || hostnum == FS_HPFS_ || hostnum == FS_NTFS_) + { + Info(slide, 0, ((char *)slide, LoadFarString(lExtraFieldType), + "is", EF_IZUNIX, LoadFarStringSmall(efIZUnix), + (unsigned)(xattr&12), (xattr&4)? efIZuid : efIZnouid)); + if (*pEndprev > 0L) + *pEndprev += (ulg)(xattr&12); + } + else if (hostnum == FS_FAT_ && !(xattr&4)) + Info(slide, 0, ((char *)slide, LoadFarString(lExtraFieldType), + "may be", EF_IZUNIX, LoadFarStringSmall(efIZUnix), 8, + efIZnouid)); + } + + if (!G.crec.file_comment_length) + Info(slide, 0, ((char *)slide, LoadFarString(NoFileComment))); + else { + Info(slide, 0, ((char *)slide, LoadFarString(FileCommBegin))); + if ((error = do_string(__G__ G.crec.file_comment_length, DISPL_8)) != + PK_COOL) + { + error_in_archive = error; /* might be warning */ + if (error > PK_WARN) /* fatal */ + return error; + } + Info(slide, 0, ((char *)slide, LoadFarString(FileCommEnd))); + } + + return error_in_archive; + +} /* end function zi_long() */ + + + + + +/*************************/ +/* Function zi_short() */ +/*************************/ + +static int zi_short(__G) /* return PK-type error code */ + __GDEF +{ +#ifdef USE_EF_UT_TIME + iztimes z_utime; + time_t *z_modtim; +#endif + int k, error, error_in_archive=PK_COOL; + unsigned hostnum, hostver, methnum, xattr; + char *p, workspace[12], attribs[16]; + char methbuf[5]; + static ZCONST char dtype[5]="NXFS"; /* normal, maximum, fast, superfast */ + static ZCONST char Far os[NUM_HOSTS+1][4] = { + "fat", "ami", "vms", "unx", "cms", "atr", "hpf", "mac", "zzz", + "cpm", "t20", "ntf", "qds", "aco", "vft", "mvs", "be ", "nsk", + "ths", "???" + }; +#ifdef OLD_THEOS_EXTRA + static ZCONST char Far os_TheosOld[] = "tho"; +#endif + static ZCONST char Far method[NUM_METHODS+1][5] = { + "stor", "shrk", "re:1", "re:2", "re:3", "re:4", "i#:#", "tokn", + "def#", "d64#", "dcli", "u###" + }; + + +/*--------------------------------------------------------------------------- + Print out various interesting things about the compressed file. + ---------------------------------------------------------------------------*/ + + methnum = (unsigned)MIN(G.crec.compression_method, NUM_METHODS); + hostnum = (unsigned)(G.pInfo->hostnum); + hostver = (unsigned)(G.pInfo->hostver); +/* + extnum = (unsigned)MIN(G.crec.version_needed_to_extract[1], NUM_HOSTS); + extver = (unsigned)G.crec.version_needed_to_extract[0]; + */ + + zfstrcpy(methbuf, method[methnum]); + if (methnum == IMPLODED) { + methbuf[1] = (char)((G.crec.general_purpose_bit_flag & 2)? '8' : '4'); + methbuf[3] = (char)((G.crec.general_purpose_bit_flag & 4)? '3' : '2'); + } else if (methnum == DEFLATED || methnum == ENHDEFLATED) { + ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); + methbuf[3] = dtype[dnum]; + } else if (methnum >= NUM_METHODS) { /* unknown */ + sprintf(&methbuf[1], "%03u", G.crec.compression_method); + } + + for (k = 0; k < 15; ++k) + attribs[k] = ' '; + attribs[15] = 0; + + xattr = (unsigned)((G.crec.external_file_attributes >> 16) & 0xFFFF); + switch (hostnum) { + case VMS_: + { int i, j; + + for (k = 0; k < 12; ++k) + workspace[k] = 0; + if (xattr & VMS_IRUSR) + workspace[0] = 'R'; + if (xattr & VMS_IWUSR) { + workspace[1] = 'W'; + workspace[3] = 'D'; + } + if (xattr & VMS_IXUSR) + workspace[2] = 'E'; + if (xattr & VMS_IRGRP) + workspace[4] = 'R'; + if (xattr & VMS_IWGRP) { + workspace[5] = 'W'; + workspace[7] = 'D'; + } + if (xattr & VMS_IXGRP) + workspace[6] = 'E'; + if (xattr & VMS_IROTH) + workspace[8] = 'R'; + if (xattr & VMS_IWOTH) { + workspace[9] = 'W'; + workspace[11] = 'D'; + } + if (xattr & VMS_IXOTH) + workspace[10] = 'E'; + + p = attribs; + for (k = j = 0; j < 3; ++j) { /* groups of permissions */ + for (i = 0; i < 4; ++i, ++k) /* perms within a group */ + if (workspace[k]) + *p++ = workspace[k]; + *p++ = ','; /* group separator */ + } + *--p = ' '; /* overwrite last comma */ + if ((p - attribs) < 12) + sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); + } + break; + + case AMIGA_: + switch (xattr & AMI_IFMT) { + case AMI_IFDIR: attribs[0] = 'd'; break; + case AMI_IFREG: attribs[0] = '-'; break; + default: attribs[0] = '?'; break; + } + attribs[1] = (xattr & AMI_IHIDDEN)? 'h' : '-'; + attribs[2] = (xattr & AMI_ISCRIPT)? 's' : '-'; + attribs[3] = (xattr & AMI_IPURE)? 'p' : '-'; + attribs[4] = (xattr & AMI_IARCHIVE)? 'a' : '-'; + attribs[5] = (xattr & AMI_IREAD)? 'r' : '-'; + attribs[6] = (xattr & AMI_IWRITE)? 'w' : '-'; + attribs[7] = (xattr & AMI_IEXECUTE)? 'e' : '-'; + attribs[8] = (xattr & AMI_IDELETE)? 'd' : '-'; + sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); + break; + + case THEOS_: + switch (xattr & THS_IFMT) { + case THS_IFLIB: *attribs = 'L'; break; + case THS_IFDIR: *attribs = 'D'; break; + case THS_IFCHR: *attribs = 'C'; break; + case THS_IFREG: *attribs = 'S'; break; + case THS_IFREL: *attribs = 'R'; break; + case THS_IFKEY: *attribs = 'K'; break; + case THS_IFIND: *attribs = 'I'; break; + case THS_IFR16: *attribs = 'P'; break; + case THS_IFP16: *attribs = '2'; break; + case THS_IFP32: *attribs = '3'; break; + default: *attribs = '?'; break; + } + attribs[1] = (xattr & THS_INHID) ? '.' : 'H'; + attribs[2] = (xattr & THS_IMODF) ? '.' : 'M'; + attribs[3] = (xattr & THS_IWOTH) ? '.' : 'W'; + attribs[4] = (xattr & THS_IROTH) ? '.' : 'R'; + attribs[5] = (xattr & THS_IEUSR) ? '.' : 'E'; + attribs[6] = (xattr & THS_IXUSR) ? '.' : 'X'; + attribs[7] = (xattr & THS_IWUSR) ? '.' : 'W'; + attribs[8] = (xattr & THS_IRUSR) ? '.' : 'R'; + sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); + break; + + case FS_VFAT_: +#ifdef OLD_THEOS_EXTRA + if (hostver == 20) { + switch (xattr & _THS_IFMT) { + case _THS_IFLIB: *attribs = 'L'; break; + case _THS_IFDIR: *attribs = 'd'; break; + case _THS_IFCHR: *attribs = 'c'; break; + case _THS_IFREG: *attribs = 'S'; break; + case _THS_IODRC: *attribs = 'D'; break; + case _THS_IOKEY: *attribs = 'K'; break; + case _THS_IOIND: *attribs = 'I'; break; + case _THS_IOPRG: *attribs = 'P'; break; + case _THS_IO286: *attribs = '2'; break; + case _THS_IO386: *attribs = '3'; break; + default: *attribs = '?'; break; + } + attribs[1] = (xattr & _THS_HIDDN) ? 'H' : '.'; + attribs[2] = (xattr & _THS_IXOTH) ? '.' : 'X'; + attribs[3] = (xattr & _THS_IWOTH) ? '.' : 'W'; + attribs[4] = (xattr & _THS_IROTH) ? '.' : 'R'; + attribs[5] = (xattr & _THS_IEUSR) ? '.' : 'E'; + attribs[6] = (xattr & _THS_IXUSR) ? '.' : 'X'; + attribs[7] = (xattr & _THS_IWUSR) ? '.' : 'W'; + attribs[8] = (xattr & _THS_IRUSR) ? '.' : 'R'; + sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); + break; + } /* else: fall through! */ +#endif /* OLD_THEOS_EXTRA */ + + case FS_FAT_: + case FS_HPFS_: + case FS_NTFS_: + case VM_CMS_: + case MVS_: + case ACORN_: + if (hostnum != FS_FAT_ || + (unsigned)(xattr & 0700) != + ((unsigned)0400 | + ((unsigned)!(G.crec.external_file_attributes & 1) << 7) | + ((unsigned)(G.crec.external_file_attributes & 0x10) << 2)) + ) + { + xattr = (unsigned)(G.crec.external_file_attributes & 0xFF); + sprintf(attribs, ".r.-... %u.%u", hostver/10, hostver%10); + attribs[2] = (xattr & 0x01)? '-' : 'w'; + attribs[5] = (xattr & 0x02)? 'h' : '-'; + attribs[6] = (xattr & 0x04)? 's' : '-'; + attribs[4] = (xattr & 0x20)? 'a' : '-'; + if (xattr & 0x10) { + attribs[0] = 'd'; + attribs[3] = 'x'; + } else + attribs[0] = '-'; + if (IS_VOLID(xattr)) + attribs[0] = 'V'; + else if ((p = MBSRCHR(G.filename, '.')) != (char *)NULL) { + ++p; + if (STRNICMP(p, "com", 3) == 0 || + STRNICMP(p, "exe", 3) == 0 || + STRNICMP(p, "btm", 3) == 0 || + STRNICMP(p, "cmd", 3) == 0 || + STRNICMP(p, "bat", 3) == 0) + attribs[3] = 'x'; + } + break; + } /* else: fall through! */ + + default: /* assume Unix-like */ + switch ((unsigned)(xattr & UNX_IFMT)) { + case (unsigned)UNX_IFDIR: attribs[0] = 'd'; break; + case (unsigned)UNX_IFREG: attribs[0] = '-'; break; + case (unsigned)UNX_IFLNK: attribs[0] = 'l'; break; + case (unsigned)UNX_IFBLK: attribs[0] = 'b'; break; + case (unsigned)UNX_IFCHR: attribs[0] = 'c'; break; + case (unsigned)UNX_IFIFO: attribs[0] = 'p'; break; + case (unsigned)UNX_IFSOCK: attribs[0] = 's'; break; + default: attribs[0] = '?'; break; + } + attribs[1] = (xattr & UNX_IRUSR)? 'r' : '-'; + attribs[4] = (xattr & UNX_IRGRP)? 'r' : '-'; + attribs[7] = (xattr & UNX_IROTH)? 'r' : '-'; + attribs[2] = (xattr & UNX_IWUSR)? 'w' : '-'; + attribs[5] = (xattr & UNX_IWGRP)? 'w' : '-'; + attribs[8] = (xattr & UNX_IWOTH)? 'w' : '-'; + + if (xattr & UNX_IXUSR) + attribs[3] = (xattr & UNX_ISUID)? 's' : 'x'; + else + attribs[3] = (xattr & UNX_ISUID)? 'S' : '-'; /* S==undefined */ + if (xattr & UNX_IXGRP) + attribs[6] = (xattr & UNX_ISGID)? 's' : 'x'; /* == UNX_ENFMT */ + else + /* attribs[6] = (xattr & UNX_ISGID)? 'l' : '-'; real 4.3BSD */ + attribs[6] = (xattr & UNX_ISGID)? 'S' : '-'; /* SunOS 4.1.x */ + if (xattr & UNX_IXOTH) + attribs[9] = (xattr & UNX_ISVTX)? 't' : 'x'; /* "sticky bit" */ + else + attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T==undefined */ + + sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); + break; + + } /* end switch (hostnum: external attributes format) */ + +#ifdef OLD_THEOS_EXTRA + Info(slide, 0, ((char *)slide, "%s %s %8lu ", attribs, + LoadFarStringSmall(((hostnum == FS_VFAT_ && hostver == 20) ? + os_TheosOld : + os[hostnum])), + G.crec.ucsize)); +#else + Info(slide, 0, ((char *)slide, "%s %s %8lu ", attribs, + LoadFarStringSmall(os[hostnum]), + G.crec.ucsize)); +#endif + Info(slide, 0, ((char *)slide, "%c", + (G.crec.general_purpose_bit_flag & 1)? + ((G.crec.internal_file_attributes & 1)? 'T' : 'B') : /* encrypted */ + ((G.crec.internal_file_attributes & 1)? 't' : 'b'))); /* plaintext */ + k = (G.crec.extra_field_length || + /* a local-only "UX" (old Unix/OS2/NT GMT times "IZUNIX") e.f.? */ + ((G.crec.external_file_attributes & 0x8000) && + (hostnum == UNIX_ || hostnum == FS_HPFS_ || hostnum == FS_NTFS_))); + Info(slide, 0, ((char *)slide, "%c", k? + ((G.crec.general_purpose_bit_flag & 8)? 'X' : 'x') : /* extra field */ + ((G.crec.general_purpose_bit_flag & 8)? 'l' : '-'))); /* no extra field */ + /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ extended local header or not */ + + if (uO.lflag == 4) { + ulg csiz = G.crec.csize; + + if (G.crec.general_purpose_bit_flag & 1) + csiz -= 12; /* if encrypted, don't count encryption header */ + Info(slide, 0, ((char *)slide, "%3d%%", + (ratio(G.crec.ucsize,csiz)+5)/10)); + } else if (uO.lflag == 5) + Info(slide, 0, ((char *)slide, " %8lu", G.crec.csize)); + + /* Read the extra field, if any. The extra field info may be used + * in the file modification time section, below. + */ + if ((error = do_string(__G__ G.crec.extra_field_length, EXTRA_FIELD)) != 0) + { + if (G.extra_field != NULL) { + free(G.extra_field); + G.extra_field = NULL; + } + error_in_archive = error; + /* We do not return prematurely in case of a "fatal" error (PK_EOF). + * This does not hurt here, because we do not need to read from the + * zipfile again before the end of this function. + */ + } + + /* For printing of date & time, a "char d_t_buf[16]" is required. + * To save stack space, we reuse the "char attribs[16]" buffer whose + * content is no longer needed. + */ +# define d_t_buf attribs +#ifdef USE_EF_UT_TIME + z_modtim = G.extra_field && +#ifdef IZ_CHECK_TZ + G.tz_is_valid && +#endif + (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, + G.crec.last_mod_dos_datetime, &z_utime, NULL) + & EB_UT_FL_MTIME) + ? &z_utime.mtime : NULL; + TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0 or Macintosh */ + d_t_buf[0] = (char)0; /* signal "show local time" */ +#else +# define z_modtim NULL +#endif + Info(slide, 0, ((char *)slide, " %s %s ", methbuf, + zi_time(__G__ &G.crec.last_mod_dos_datetime, z_modtim, d_t_buf))); + fnprint(__G); + +/*--------------------------------------------------------------------------- + Skip the file comment, if any (the filename has already been printed, + above). That finishes up this file entry... + ---------------------------------------------------------------------------*/ + + SKIP_(G.crec.file_comment_length) + + return error_in_archive; + +} /* end function zi_short() */ + + + + + +/**************************************/ +/* Function zi_showMacTypeCreator() */ +/**************************************/ + +static void zi_showMacTypeCreator(__G__ ebfield) + __GDEF + uch *ebfield; +{ + /* not every Type / Creator character is printable */ + if (isprint(ebfield[0]) && isprint(ebfield[1]) && + isprint(ebfield[2]) && isprint(ebfield[3]) && + isprint(ebfield[4]) && isprint(ebfield[5]) && + isprint(ebfield[6]) && isprint(ebfield[7])) { + Info(slide, 0, ((char *)slide, LoadFarString(MacOSdata), + ebfield[0], ebfield[1], ebfield[2], ebfield[3], + ebfield[4], ebfield[5], ebfield[6], ebfield[7])); + } else { + Info(slide, 0, ((char *)slide, LoadFarString(MacOSdata1), + (((ulg)ebfield[0]) << 24) + + (((ulg)ebfield[1]) << 16) + + (((ulg)ebfield[2]) << 8) + + ((ulg)ebfield[3]), + (((ulg)ebfield[4]) << 24) + + (((ulg)ebfield[5]) << 16) + + (((ulg)ebfield[6]) << 8) + + ((ulg)ebfield[7]))); + } +} /* end function zi_showMacTypeCreator() */ + + + + + +/************************/ +/* Function zi_time() */ +/************************/ + +static char *zi_time(__G__ datetimez, modtimez, d_t_str) + __GDEF + ZCONST ulg *datetimez; + ZCONST time_t *modtimez; + char *d_t_str; +{ + unsigned yr, mo, dy, hh, mm, ss; + char monthbuf[4]; + ZCONST char *monthstr; + static ZCONST char Far month[12][4] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; +#ifdef USE_EF_UT_TIME + struct tm *t; +#endif + + + +/*--------------------------------------------------------------------------- + Convert the file-modification date and time info to a string of the form + "1991 Feb 23 17:15:00", "23-Feb-91 17:15" or "19910223.171500", depending + on values of lflag and T_flag. If using Unix-time extra fields, convert + to local time or not, depending on value of first character in d_t_str[]. + ---------------------------------------------------------------------------*/ + +#ifdef USE_EF_UT_TIME + if (modtimez != NULL) { +#ifndef NO_GMTIME + /* check for our secret message from above... */ + t = (d_t_str[0] == (char)1)? gmtime(modtimez) : localtime(modtimez); +#else + t = localtime(modtimez); +#endif + if (uO.lflag > 9 && t == (struct tm *)NULL) + /* time conversion error in verbose listing format, + * return string with '?' instead of data + */ + return (strcpy(d_t_str, LoadFarString(YMDHMSTimeError))); + } else + t = (struct tm *)NULL; + if (t != (struct tm *)NULL) { + mo = (unsigned)(t->tm_mon + 1); + dy = (unsigned)(t->tm_mday); + yr = (unsigned)(t->tm_year); + + hh = (unsigned)(t->tm_hour); + mm = (unsigned)(t->tm_min); + ss = (unsigned)(t->tm_sec); + } else +#endif /* USE_EF_UT_TIME */ + { + yr = ((unsigned)(*datetimez >> 25) & 0x7f) + 80; + mo = ((unsigned)(*datetimez >> 21) & 0x0f); + dy = ((unsigned)(*datetimez >> 16) & 0x1f); + + hh = (((unsigned)*datetimez >> 11) & 0x1f); + mm = (((unsigned)*datetimez >> 5) & 0x3f); + ss = (((unsigned)*datetimez << 1) & 0x3e); + } + + if (mo == 0 || mo > 12) { + sprintf(monthbuf, LoadFarString(BogusFmt), mo); + monthstr = monthbuf; + } else + monthstr = LoadFarStringSmall(month[mo-1]); + + if (uO.lflag > 9) /* verbose listing format */ + sprintf(d_t_str, LoadFarString(YMDHMSTime), yr+1900, monthstr, dy, hh, + mm, ss); + else if (uO.T_flag) + sprintf(d_t_str, LoadFarString(DecimalTime), yr+1900, mo, dy, hh, mm, + ss); + else /* was: if ((uO.lflag >= 3) && (uO.lflag <= 5)) */ + sprintf(d_t_str, LoadFarString(DMYHMTime), dy, monthstr, yr%100, hh, + mm); + + return d_t_str; + +} /* end function zi_time() */ + +#endif /* !NO_ZIPINFO */ + +const char *BOINC_RCSID_a83f669bdc = "$Id: zipinfo.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/unzip/zipinfo.txt boinc-7.0.14+dfsg/zip/unzip/zipinfo.txt --- boinc-7.0.7+dfsg/zip/unzip/zipinfo.txt 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/unzip/zipinfo.txt 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,513 @@ + +ZIPINFO(1L) ZIPINFO(1L) + +NAME + zipinfo - list detailed information about a ZIP archive + +SYNOPSIS + zipinfo [-12smlvhMtTz] file[.zip] [file(s) ...] + [-x xfile(s) ...] + + unzip -Z [-12smlvhMtTz] file[.zip] [file(s) ...] + [-x xfile(s) ...] + +DESCRIPTION + zipinfo lists technical information about files in a ZIP + archive, most commonly found on MS-DOS systems. Such + information includes file access permissions, encryption + status, type of compression, version and operating system + or file system of compressing program, and the like. The + default behavior (with no options) is to list single-line + entries for each file in the archive, with header and + trailer lines providing summary information for the entire + archive. The format is a cross between Unix ``ls -l'' and + ``unzip -v'' output. See DETAILED DESCRIPTION below. + Note that zipinfo is the same program as unzip (under + Unix, a link to it); on some systems, however, zipinfo + support may have been omitted when unzip was compiled. + +ARGUMENTS + file[.zip] + Path of the ZIP archive(s). If the file specifica- + tion is a wildcard, each matching file is processed + in an order determined by the operating system (or + file system). Only the filename can be a wildcard; + the path itself cannot. Wildcard expressions are + similar to Unix egrep(1) (regular) expressions and + may contain: + + * matches a sequence of 0 or more characters + + ? matches exactly 1 character + + [...] matches any single character found inside + the brackets; ranges are specified by a + beginning character, a hyphen, and an ending + character. If an exclamation point or a + caret (`!' or `^') follows the left bracket, + then the range of characters within the + brackets is complemented (that is, anything + except the characters inside the brackets is + considered a match). + + (Be sure to quote any character that might other- + wise be interpreted or modified by the operating + system, particularly under Unix and VMS.) If no + matches are found, the specification is assumed to + be a literal filename; and if that also fails, the + +Info-ZIP 17 February 2002 (v2.4) 1 + +ZIPINFO(1L) ZIPINFO(1L) + + suffix .zip is appended. Note that self-extracting + ZIP files are supported; just specify the .exe suf- + fix (if any) explicitly. + + [file(s)] + An optional list of archive members to be pro- + cessed. Regular expressions (wildcards) may be + used to match multiple members; see above. Again, + be sure to quote expressions that would otherwise + be expanded or modified by the operating system. + + [-x xfile(s)] + An optional list of archive members to be excluded + from processing. + +OPTIONS + -1 list filenames only, one per line. This option + excludes all others; headers, trailers and zipfile + comments are never printed. It is intended for use + in Unix shell scripts. + + -2 list filenames only, one per line, but allow head- + ers (-h), trailers (-t) and zipfile comments (-z), + as well. This option may be useful in cases where + the stored filenames are particularly long. + + -s list zipfile info in short Unix ``ls -l'' format. + This is the default behavior; see below. + + -m list zipfile info in medium Unix ``ls -l'' format. + Identical to the -s output, except that the com- + pression factor, expressed as a percentage, is also + listed. + + -l list zipfile info in long Unix ``ls -l'' format. + As with -m except that the compressed size (in + bytes) is printed instead of the compression ratio. + + -v list zipfile information in verbose, multi-page + format. + + -h list header line. The archive name, actual size + (in bytes) and total number of files is printed. + + -M pipe all output through an internal pager similar + to the Unix more(1) command. At the end of a + screenful of output, zipinfo pauses with a + ``--More--'' prompt; the next screenful may be + viewed by pressing the Enter (Return) key or the + space bar. zipinfo can be terminated by pressing + the ``q'' key and, on some systems, the + Enter/Return key. Unlike Unix more(1), there is no + forward-searching or editing capability. Also, + zipinfo doesn't notice if long lines wrap at the + +Info-ZIP 17 February 2002 (v2.4) 2 + +ZIPINFO(1L) ZIPINFO(1L) + + edge of the screen, effectively resulting in the + printing of two or more lines and the likelihood + that some text will scroll off the top of the + screen before being viewed. On some systems the + number of available lines on the screen is not + detected, in which case zipinfo assumes the height + is 24 lines. + + -t list totals for files listed or for all files. The + number of files listed, their uncompressed and com- + pressed total sizes, and their overall compression + factor is printed; or, if only the totals line is + being printed, the values for the entire archive + are given. Note that the total compressed (data) + size will never match the actual zipfile size, + since the latter includes all of the internal zip- + file headers in addition to the compressed data. + + -T print the file dates and times in a sortable deci- + mal format (yymmdd.hhmmss). The default date for- + mat is a more standard, human-readable version with + abbreviated month names (see examples below). + + -z include the archive comment (if any) in the list- + ing. + +DETAILED DESCRIPTION + zipinfo has a number of modes, and its behavior can be + rather difficult to fathom if one isn't familiar with Unix + ls(1) (or even if one is). The default behavior is to + list files in the following format: + + -rw-rws--- 1.9 unx 2802 t- defX 11-Aug-91 13:48 perms.2660 + + The last three fields are the modification date and time + of the file, and its name. The case of the filename is + respected; thus files that come from MS-DOS PKZIP are + always capitalized. If the file was zipped with a stored + directory name, that is also displayed as part of the + filename. + + The second and third fields indicate that the file was + zipped under Unix with version 1.9 of zip. Since it comes + from Unix, the file permissions at the beginning of the + line are printed in Unix format. The uncompressed file- + size (2802 in this example) is the fourth field. + + The fifth field consists of two characters, either of + which may take on several values. The first character may + be either `t' or `b', indicating that zip believes the + file to be text or binary, respectively; but if the file + is encrypted, zipinfo notes this fact by capitalizing the + character (`T' or `B'). The second character may also + take on four values, depending on whether there is an + +Info-ZIP 17 February 2002 (v2.4) 3 + +ZIPINFO(1L) ZIPINFO(1L) + + extended local header and/or an ``extra field'' associated + with the file (fully explained in PKWare's APPNOTE.TXT, + but basically analogous to pragmas in ANSI C--i.e., they + provide a standard way to include non-standard information + in the archive). If neither exists, the character will be + a hyphen (`-'); if there is an extended local header but + no extra field, `l'; if the reverse, `x'; and if both + exist, `X'. Thus the file in this example is (probably) a + text file, is not encrypted, and has neither an extra + field nor an extended local header associated with it. + The example below, on the other hand, is an encrypted + binary file with an extra field: + + RWD,R,R 0.9 vms 168 Bx shrk 9-Aug-91 19:15 perms.0644 + + Extra fields are used for various purposes (see discussion + of the -v option below) including the storage of VMS file + attributes, which is presumably the case here. Note that + the file attributes are listed in VMS format. Some other + possibilities for the host operating system (which is + actually a misnomer--host file system is more correct) + include OS/2 or NT with High Performance File System + (HPFS), MS-DOS, OS/2 or NT with File Allocation Table + (FAT) file system, and Macintosh. These are denoted as + follows: + + -rw-a-- 1.0 hpf 5358 Tl i4:3 4-Dec-91 11:33 longfilename.hpfs + -r--ahs 1.1 fat 4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF + --w------- 1.0 mac 17357 bx i8:2 4-May-92 04:02 unzip.macr + + File attributes in the first two cases are indicated in a + Unix-like format, where the seven subfields indicate + whether the file: (1) is a directory, (2) is readable + (always true), (3) is writable, (4) is executable (guessed + on the basis of the extension--.exe, .com, .bat, .cmd and + .btm files are assumed to be so), (5) has its archive bit + set, (6) is hidden, and (7) is a system file. Interpreta- + tion of Macintosh file attributes is unreliable because + some Macintosh archivers don't store any attributes in the + archive. + + Finally, the sixth field indicates the compression method + and possible sub-method used. There are six methods known + at present: storing (no compression), reducing, shrink- + ing, imploding, tokenizing (never publicly released), and + deflating. In addition, there are four levels of reducing + (1 through 4); four types of imploding (4K or 8K sliding + dictionary, and 2 or 3 Shannon-Fano trees); and four lev- + els of deflating (superfast, fast, normal, maximum com- + pression). zipinfo represents these methods and their + sub-methods as follows: stor; re:1, re:2, etc.; shrk; + i4:2, i8:3, etc.; tokn; and defS, defF, defN, and defX. + + The medium and long listings are almost identical to the + +Info-ZIP 17 February 2002 (v2.4) 4 + +ZIPINFO(1L) ZIPINFO(1L) + + short format except that they add information on the + file's compression. The medium format lists the file's + compression factor as a percentage indicating the amount + of space that has been ``removed'': + + -rw-rws--- 1.5 unx 2802 t- 81% defX 11-Aug-91 13:48 perms.2660 + + In this example, the file has been compressed by more than + a factor of five; the compressed data are only 19% of the + original size. The long format gives the compressed + file's size in bytes, instead: + + -rw-rws--- 1.5 unx 2802 t- 538 defX 11-Aug-91 13:48 perms.2660 + + Adding the -T option changes the file date and time to + decimal format: + + -rw-rws--- 1.5 unx 2802 t- 538 defX 910811.134804 perms.2660 + + Note that because of limitations in the MS-DOS format used + to store file times, the seconds field is always rounded + to the nearest even second. For Unix files this is + expected to change in the next major releases of zip(1L) + and unzip. + + In addition to individual file information, a default zip- + file listing also includes header and trailer lines: + + Archive: OS2.zip 5453 bytes 5 files + ,,rw, 1.0 hpf 730 b- i4:3 26-Jun-92 23:40 Contents + ,,rw, 1.0 hpf 3710 b- i4:3 26-Jun-92 23:33 makefile.os2 + ,,rw, 1.0 hpf 8753 b- i8:3 26-Jun-92 15:29 os2unzip.c + ,,rw, 1.0 hpf 98 b- stor 21-Aug-91 15:34 unzip.def + ,,rw, 1.0 hpf 95 b- stor 21-Aug-91 17:51 zipinfo.def + 5 files, 13386 bytes uncompressed, 4951 bytes compressed: 63.0% + + The header line gives the name of the archive, its total + size, and the total number of files; the trailer gives the + number of files listed, their total uncompressed size, and + their total compressed size (not including any of zip's + internal overhead). If, however, one or more file(s) are + provided, the header and trailer lines are not listed. + This behavior is also similar to that of Unix's ``ls -l''; + it may be overridden by specifying the -h and -t options + explicitly. In such a case the listing format must also + be specified explicitly, since -h or -t (or both) in the + absence of other options implies that ONLY the header or + trailer line (or both) is listed. See the EXAMPLES sec- + tion below for a semi-intelligible translation of this + nonsense. + + The verbose listing is mostly self-explanatory. It also + lists file comments and the zipfile comment, if any, and + the type and number of bytes in any stored extra fields. + +Info-ZIP 17 February 2002 (v2.4) 5 + +ZIPINFO(1L) ZIPINFO(1L) + + Currently known types of extra fields include PKWARE's + authentication (``AV'') info; OS/2 extended attributes; + VMS filesystem info, both PKWARE and Info-ZIP versions; + Macintosh resource forks; Acorn/Archimedes SparkFS info; + and so on. (Note that in the case of OS/2 extended + attributes--perhaps the most common use of zipfile extra + fields--the size of the stored EAs as reported by zipinfo + may not match the number given by OS/2's dir command: OS/2 + always reports the number of bytes required in 16-bit for- + mat, whereas zipinfo always reports the 32-bit storage.) + +ENVIRONMENT OPTIONS + Modifying zipinfo's default behavior via options placed in + an environment variable can be a bit complicated to + explain, due to zipinfo's attempts to handle various + defaults in an intuitive, yet Unix-like, manner. (Try not + to laugh.) Nevertheless, there is some underlying logic. + In brief, there are three ``priority levels'' of options: + the default options; environment options, which can over- + ride or add to the defaults; and explicit options given by + the user, which can override or add to either of the + above. + + The default listing format, as noted above, corresponds + roughly to the "zipinfo -hst" command (except when indi- + vidual zipfile members are specified). A user who prefers + the long-listing format (-l) can make use of the zipinfo's + environment variable to change this default: + + Unix Bourne shell: + ZIPINFO=-l; export ZIPINFO + + Unix C shell: + setenv ZIPINFO -l + + OS/2 or MS-DOS: + set ZIPINFO=-l + + VMS (quotes for lowercase): + define ZIPINFO_OPTS "-l" + + If, in addition, the user dislikes the trailer line, zip- + info's concept of ``negative options'' may be used to + override the default inclusion of the line. This is + accomplished by preceding the undesired option with one or + more minuses: e.g., ``-l-t'' or ``--tl'', in this exam- + ple. The first hyphen is the regular switch character, + but the one before the `t' is a minus sign. The dual use + of hyphens may seem a little awkward, but it's reasonably + intuitive nonetheless: simply ignore the first hyphen and + go from there. It is also consistent with the behavior of + the Unix command nice(1). + + As suggested above, the default variable names are + +Info-ZIP 17 February 2002 (v2.4) 6 + +ZIPINFO(1L) ZIPINFO(1L) + + ZIPINFO_OPTS for VMS (where the symbol used to install + zipinfo as a foreign command would otherwise be confused + with the environment variable), and ZIPINFO for all other + operating systems. For compatibility with zip(1L), ZIPIN- + FOOPT is also accepted (don't ask). If both ZIPINFO and + ZIPINFOOPT are defined, however, ZIPINFO takes precedence. + unzip's diagnostic option (-v with no zipfile name) can be + used to check the values of all four possible unzip and + zipinfo environment variables. + +EXAMPLES + To get a basic, short-format listing of the complete con- + tents of a ZIP archive storage.zip, with both header and + totals lines, use only the archive name as an argument to + zipinfo: + + zipinfo storage + + To produce a basic, long-format listing (not verbose), + including header and totals lines, use -l: + + zipinfo -l storage + + To list the complete contents of the archive without + header and totals lines, either negate the -h and -t + options or else specify the contents explicitly: + + zipinfo --h-t storage + zipinfo storage \* + + (where the backslash is required only if the shell would + otherwise expand the `*' wildcard, as in Unix when glob- + bing is turned on--double quotes around the asterisk would + have worked as well). To turn off the totals line by + default, use the environment variable (C shell is assumed + here): + + setenv ZIPINFO --t + zipinfo storage + + To get the full, short-format listing of the first example + again, given that the environment variable is set as in + the previous example, it is necessary to specify the -s + option explicitly, since the -t option by itself implies + that ONLY the footer line is to be printed: + + setenv ZIPINFO --t + zipinfo -t storage [only totals line] + zipinfo -st storage [full listing] + + The -s option, like -m and -l, includes headers and foot- + ers by default, unless otherwise specified. Since the + environment variable specified no footers and that has a + higher precedence than the default behavior of -s, an + +Info-ZIP 17 February 2002 (v2.4) 7 + +ZIPINFO(1L) ZIPINFO(1L) + + explicit -t option was necessary to produce the full list- + ing. Nothing was indicated about the header, however, so + the -s option was sufficient. Note that both the -h and + -t options, when used by themselves or with each other, + override any default listing of member files; only the + header and/or footer are printed. This behavior is useful + when zipinfo is used with a wildcard zipfile specifica- + tion; the contents of all zipfiles are then summarized + with a single command. + + To list information on a single file within the archive, + in medium format, specify the filename explicitly: + + zipinfo -m storage unshrink.c + + The specification of any member file, as in this example, + will override the default header and totals lines; only + the single line of information about the requested file + will be printed. This is intuitively what one would + expect when requesting information about a single file. + For multiple files, it is often useful to know the total + compressed and uncompressed size; in such cases -t may be + specified explicitly: + + zipinfo -mt storage "*.[ch]" Mak\* + + To get maximal information about the ZIP archive, use the + verbose option. It is usually wise to pipe the output + into a filter such as Unix more(1) if the operating system + allows it: + + zipinfo -v storage | more + + Finally, to see the most recently modified files in the + archive, use the -T option in conjunction with an external + sorting utility such as Unix sort(1) (and tail(1) as well, + in this example): + + zipinfo -T storage | sort -n +6 | tail -15 + + The -n option to sort(1) tells it to sort numerically + rather than in ASCII order, and the +6 option tells it to + sort on the sixth field after the first one (i.e., the + seventh field). This assumes the default short-listing + format; if -m or -l is used, the proper sort(1) option + would be +7. The tail(1) command filters out all but the + last 15 lines of the listing. Future releases of zipinfo + may incorporate date/time and filename sorting as built-in + options. + +TIPS + The author finds it convenient to define an alias ii for + zipinfo on systems that allow aliases (or, on other sys- + tems, copy/rename the executable, create a link or create + +Info-ZIP 17 February 2002 (v2.4) 8 + +ZIPINFO(1L) ZIPINFO(1L) + + a command file with the name ii). The ii usage parallels + the common ll alias for long listings in Unix, and the + similarity between the outputs of the two commands was + intentional. + +BUGS + As with unzip, zipinfo's -M (``more'') option is overly + simplistic in its handling of screen output; as noted + above, it fails to detect the wrapping of long lines and + may thereby cause lines at the top of the screen to be + scrolled off before being read. zipinfo should detect and + treat each occurrence of line-wrap as one additional line + printed. This requires knowledge of the screen's width as + well as its height. In addition, zipinfo should detect + the true screen geometry on all systems. + + zipinfo's listing-format behavior is unnecessarily complex + and should be simplified. (This is not to say that it + will be.) + +SEE ALSO + ls(1), funzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zip- + cloak(1L), zipnote(1L), zipsplit(1L) + +URL + The Info-ZIP home page is currently at + http://www.info-zip.org/pub/infozip/ + or + ftp://ftp.info-zip.org/pub/infozip/ . + +AUTHOR + Greg ``Cave Newt'' Roelofs. ZipInfo contains pattern- + matching code by Mark Adler and fixes/improvements by many + others. Please refer to the CONTRIBS file in the UnZip + source distribution for a more complete list. + +Info-ZIP 17 February 2002 (v2.4) 9 + diff -Nru boinc-7.0.7+dfsg/zip/zip/BUGS boinc-7.0.14+dfsg/zip/zip/BUGS --- boinc-7.0.7+dfsg/zip/zip/BUGS 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/BUGS 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,6 @@ +- zip sometimes crashes on some versions of NetBSD (0.8, 0.9 and early + 0.9-current), FreeBSD (<= 1.1) and BSDI (< 1.1) . This is due to a + bug in stdio. + Upgrading the stdio package in /usr/src/lib/libc/stdio should + fix the problem. See *BSD mirrors in src/lib/libc/stdio + You must at least replace setvbuf.o in all the libc's with a newer version. diff -Nru boinc-7.0.7+dfsg/zip/zip/CHANGES boinc-7.0.14+dfsg/zip/zip/CHANGES --- boinc-7.0.7+dfsg/zip/zip/CHANGES 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/CHANGES 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,771 @@ +------------------------- August 7th 1996 version 2.2a ------------------ + 1. QDOS port (Jonathan Hudson) + 2. win32 volumelabel handling (Paul) + 3. VM/CMS clean up (Greg Hartwig) + 4. leading "../" in internal filenames are allowed (Paul) + 5. System V packages support (John Bush) + 6. Fix handling of atx in zipup() (Onno, Greg) + 7. Fixed typo that caused zip -R to dump core (Onno) + 8. msdos/makefile.dj2: fix for command line too long when linking zip.exe + 9. win95 long filename support with djgpp v2 (Onno, Kimio Itoh) +------------------------- August 9th 1996 version 2.2b ------------------ + 1. windll: use wiz instead of wizip (Mike) + 2. use z->name NOT z->zname to open files (Onno, Mike) +------------------------ September 1st 1996 version 2.2c ------------------ + 1. windll: use fprintf instead of putc to send data to std{out,err} (Mike) + 2. os2: make borlandc version detection equal to unzip 5.30d (Kai Uwe) + 3. use #elif constructions for msdos,os2 and win32 compiler detection (Onno) + 4. fix for incorrect free in zip.c (Onno, Mike, Steve) + 5. BeBox port from Chris + 6. unix/{configure,Makefile} fixes for SCO Xenix 286 (Tom Schmidt) + 7. remove zilog entry from unix/Makefile (Onno) + 8. man page fixes (Tom Schmidt) + 9. SCO ODT {3,5} fixes (Bill Davidsen) +------------------------ October 8th 1996 version 2.2d ------------------ + 1. Fix bug in QDOS patch that broke zipsplit.c (Onno, Paul) + 2. Fix a couple of warnings from BorlandC (Mike) + 3. msdos/makefile.wat: Delete some more files when cleaning up (Paul) + 4. store msdos volumelabels without a dot in them (Paul) + 5. clean up of unix/{Makefile,configure,packaging} (Tom Schmidt) + 6. make QDOS port case independent (Jonathan Hudson) + 7. new amiga SASC makefile (Walter Haidinger) + 8. don't truncate filenames in win32's in2ex() (Paul) + 9. os2/makefile.os2 update for emx 0.9c (Kai Uwe) +10. password() function for QDOS (Jonathan) +11. fix the last(?) free() related bug (Mike) +12. win32: security descriptors operations (Scott Field) +13. win32: FILE_SHARE_DELETE is not defined in some win32 compilers (Onno) +14. win32: fix makefile.wat to include nt.c (Onno) +------------------------ January 17th 1997 version 2.2e ------------------ + 1. define USE_CASE_MAP in osdep.h for those ports that need it (Onno) + 2. define PROCNAME in osdep.h for those ports that need it (Onno) + 3. wild() prototype decl only if PROCNAME defined => delete MSVMS define (Onno) + 4. add DOS EMX makefile (E-Yen Tan) + 5. include a little earlier in qdos/qdos.c (Jonathan) + 6. add ttyio.o to OBJZ in qdos/Makefile.qdos (Jonathan) + 7. remove unused fprintebc define from zip.c (Onno) + 8. use the right password routine in ttyio.c for unzip (Mike) + 9. BeOS update from Chris +10. Fix for 'zip -r foo x:' (Paul) +11. Fix library bug on beos (Chris) +12. Fix calculating version number (kitoh_@mix.or.jp, Walter Haidinger) +13. IsWinNT always returned TRUE (Mike) +14. Windll update from Mike +15. Improved crc routines for x86 from Scott Field +16. Detect in unix/configure if we can use crc_i386.S (Onno) +17. Fix spurious internal logic error (Paul) +18. Fix to include directory names on the Acorn when needed (Sergio) +19. include zip.h in mvs.h (Onno, George Carr) +20. add workaround for AZTEC C compiler bug to revision.h (Paul, Walter) +21. MVS doesn't have rmdir (George Carr) +22. define and use USE_ZIPMAIN for WINDLL en VM_CMS (Onno) +23. Fixes from Greg Hartwig to make CMS standalone versions possible. +24. Move OS specific encryption stuff to the os specific directories (Christian) +25. Change password fetching interface in ttyio and crypt (Christian) +26. Update emx support for 0.9c (Christian) +27. Define WINDLL instead of MSWIN (Christian) +28. Extended time stamp extra field format support (Christian) +29. Support for rsxnt-emx 0.9c win32 compiler (Christian) +30. Use izshr017b (Christian) +------------------------ March 11th 1997 version 2.2f ------------------ + 1. Move makefile.emx, rsxwinnt.h and zip.def to win32 subdir (Kai Uwe) + 2. Add win32 target to makefile.os2 to allow cross compilation (Kai Uwe) + 3. Fix NTSD_EAS link time failures with win32 (Paul) + 4. Fix buffer freed too early in password verification code (Mike) + 5. Remove unix/zipgrep and man/zipgrep.1 (sanvila@ctv.es) + 6. Only use crc_i386.o when we're using an x86 (Onno, Mark) + 7. Remove carriage returns from amiga/crc_68.a (Paul) + 8. New windll from Mike + 9. Fix typo in os2/os2zip.c (Kai Uwe) +10. Don't use ctime (last file status change) for unix and qdos cross compile + (Greg) +11. added gccwin32 crosscompilation target (RSXNT) to os2/makefile.os2 (Kai Uwe) +12. fixed the OS/2 file attribute and time stamp generation for zipping + stdin ("-") (Kai Uwe) +13. fixed the atime and ctime stat fields for the OS/2 Watcom C library + (Kai Uwe) +14. added atime and ctime support for the UT extra field when generated under + OS/2, the atime and ctime values are only stored when zipping (Kai Uwe) +15. qdos patches from Jonathan Hudson mainly for extended time flag handling +16. amiga aztec compiler bug workaround (Paul) +17. fix -v output of zipcloak, zipnote and zipsplit (Paul) +18. new amiga/makefile.azt with targets for debug versions (Paul) +------------------------ March 31st 1997 version 2.2g ------------------ + 1. remove -I/usr/local/include from unix/Makefile (Chris) + 2. Update versinfolines in revision.h (Greg) + 3. change 1U to 0x1 to accomodate non ANSI compilers (Onno, Rodney Brown) + 4. win32zip.c: cast buffer parameter in memcompress() to char * (Mike) + 5. remove beos/zipgrep (Chris) + 6. correct the -e password verification check in zip.c (Christian) + 7. use ZCONST instead of const in the generic code. (Christian) + 8. fix mktime timezone correction when time is near to daylight/nodaylight + switch points. (Christian) + 9. correct dependencies in makefile.os2 (Christian) +10. use a more sensible default for iztime.ctime than "0" when system does not + not support creation time stamps. (Christian) +11. fix VMS_PK_EXTRA function interface declarations. (Christian) +12. implement atime/ctime support in win32. (Christian) +13. win32/win32.c: replacement getch() for Watcom. (Paul) +14. win32/makefile.wat: debug object files kept separate. (Paul) +15. msdos/makefile.wat: debug object files kept separate. (Paul) +16. Fix extended time defines for the acorn. (Sergio) +17. Define PROCNAME() in acorn/osdep.h (Sergio) +18. Ignore exit status of ${INSTALL_D} in unix/Makefile (Chris) +19. Add Metroworks and BEOS info to version() in several files (Chris) +20. Move defines for the password fetch to zip.h (Christian) +21. Support the obsolete version rsxnt 1.1 / emx 0.9b (Christian) +22. Remove obsolete "#define PROCNAME ..." from cmsmvs/cmsmvs.h (Christian) +23. Fix extended time defines for qdos (Jonathan Hudson) +24. Use watcom getch() from unz530q in win32/win32.c (Onno) +25. Don't install zipgrep via the unix package tools (John Bush) +26. use izshr021 (Onno) +27. Fix zipnote: use iname not zname in zipnote.c (Onno) +28. Create proginfo directory (Christian) +------------------------ May 5th 1997 version 2.2h -------------------- + 1. Fix vms/zipup.h: iztime --> iztimes (Onno, Mike Freeman) + 2. Remove windll/wizdll.def (Mike) + 3. Add a couple of external variable declaration to windll.h (Mike) + 4. Remove zipgrep from install in unix/Makefile (Onno) + 5. Make updating .zip files with extended time fields possible (Kai Uwe) + 6. Delete beos/Makefile.gcc, beos/Makefiles handles both compilers (Chris) + 7. Fixes for unused variables (Chris) + 8. Added very simplistic example how to load and call the windll (Mike) + 9. Updated windll documentation to note this example (Mike) +10. Removed an unused memeber of a structure in windll (Mike) +11. Add BUGS instead of infozip.who and algorith.doc with the packaging + tools (John Bush) +12. tailor.h: increment NUM_HOSTS to keep in sync with UnZip (Christian) +13. win32/osdep.h: remove NO_SECURE_TESTS define (Christian) +14. zip.h: add declaration for free_crc_table() (Christian) +15. windll: move everything that's not windows specific into api.* (Mike) +16. use iname when checking for directory names in zipfile.c (Sergio) +17. improved mktime.c with better error checking (Christian) +18. improved crc routines (Christian, Rodney Brown) +19. get the -z option working again (Onno, Brad Clarke) +20. define BROKEN_FSEEK and seekable() for those systems where fseek() + always returns 0 (== OK) (Onno, Jeffrey Altman) +------------------------ May 10th 1997 version 2.2i -------------------- + 1. win32's seekable should only check for FILE_TYPE_DISK (Onno, Jeffrey Altman) + 2. add (ulg) cast to zipbeg = ~0 in zipfile.c (Steve) + 3. seekable() *really* belongs in flush_block, keep it there (Onno) + 4. seekable() calls fseekable(FILE *) (Onno) + 5. define HAVE_FSEEKABLE if a port has their own fseekable (Onno) + 6. WatCom doesn't have _get_osfhandle, use _os_handle instead (Paul) + 7. upgrade to Mike's latest windll sources (Mike) + 8. add -P option so you can specify a password on the commandline (Onno) + 9. Get -@ working again (Onno) +10. emx+RSXNT doesn't know about _get_osfhandle() (Kai Uwe) +11. fix a couple of typos in the OS/2 makefiles (Kai Uwe) +12. fix initialization bug in windll code (Mike) +13. tweak deletedir for RISC OS (Sergio) +14. RISCOS doesn't know about fstat() (Sergio) +15. Remove acorn/acorn (Sergio) +16. Delete debugging statements from version_local() in msdos.c (Greg) +17. Fix huge bug in readzipfile() (Onno) +------------------------ May 18th 1997 version 2.2j -------------------- + 1. Add missing ';' after return ZE_PARMS in zip.c (Mike) + 2. Remove obsolete 'struct stat st' in zipfile.c (Onno) + 3. Get Amiga SFX handling working again (Paul) + 4. Get zip -A working again (Onno) + 5. Change an && to & in zipfile.c (Johnny) + 6. Fix handling of empty sfx archives (Onno, Mike) + 7. Remove experimental entries from the makefiles (Jean-loup) + 8. Add exit codes to the manual page (Onno) + 9. Remove lines from the help screen that contain lesser used options (Onno) +------------------------ June 8th 1997 version 2.2k -------------------- + 1. use zip -t ddmmyyyy for year 2000 stuff (Greg) + 2. zip -@ only handles ONE filename per line (Jean-loup) + 3. beos support for DR9 filesystem and symlinks (Chris) + 4. VB support for windll (Mike) +------------------------ June 10th 1997 version 2.2l ------------------- + 1. beos filetype support (Chris) + 2. fill the buffer in getnam() to get it working again (Onno) + 3. implement -x@filename and -i@filename (Onno) +------------------------ June 22nd 1997 version 2.2m ------------------- + 1. Add a ; after de nextarg label in main() (Onno, Erik Baatz) + 2. Initialize p to NULL in get_filters() (Onno, Frank Donahoe) + 3. Fix typo in first if statement in filetypes() (Johnny Lee) + 4. zip -A works again (Onno, Greg) + 5. don't free zipbuf for VMS and CMS_MVS in main() (Onno, Mike Freeman) + 6. fix make_zip.com, link_zip.com and vmsdefs.h for gcc 2.6.3 on VMS (Onno) + 7. clarify -g option in the man page (Jean-loup) +------------------------ July 6th 1997 version 2.2n ------------------- + 1. use local in readzipfile2() declaration (Onno, Mike Freeman) + 2. return values with windll in get_filters() (Mike) + 3. a couple of minor patches for BEOS (Chris) + 4. zip -g works again (Onno, Chris) + 5. Some more Visual Basic dll support (Mike) + 6. Fix stack overflow in readzipfile() for DOS (Onno, Michael Mauch) +------------------------ August 19th 1997 version 2.2o ------------------- + 1. beos README and Makefile tweaks from Chris. + 2. Syntax corrections for README and man/zip.1 (Frank Donahoe) + 3. Use name not iname when deleting directories in trash() (Christian) + 4. change several wkuvx1 to lists in e-mail addresses (Christian) + 5. default to PK style extra fields for VMS (Christian) + 6. use izshr023 (Christian) + 7. replace buggy time library functions (Walter Haidinger, Paul, Christian) + 8. in2ex() and stat() are needed also when UTIL isn't defined (Greg Hartwig) + 9. don't use type=record in fopen() for MVS and CMS (Greg Hartwig) +10. Change P and K literals to hex for EBCDIC systems (Greg Hartwig) +11. Add output path support for CMS and MVS (Greg Hartwig) +12. Add memtoasc and memtoebc for EBCDIC systems (Greg Hartwig) +13. Handle comments correctly to fix zipnote for CMS and MVS (Greg Hartwig) +14. Add -tt option (do not operate on files after date mmddyy) (Christian) +15. move alloc routines for DOS into the !UTIL block (Christian) +16. move UTIL blocks and version_local() functions to a more logical place + (Christian) +17. Handle -P, -R, -x@, -i@ and -tt for the VMS CLI (Christian) +18. Update VMS help file with the new options (Christian) +19. Use iname in MATCH, not zname (Jonathan Hudson) +20. windll: more Visual Basic support (Mike) +21. windll: more project makefiles (Mike) +22. windll: insert Zip in front of global variable names (Mike) +------------------------ August 25th 1997 version 2.2p ------------------- + 1. Remove unused flags from LFLAGS2 in unix/Makefile (Onno) + 2. SunOS make bug: change unix_.o rule in unix/Makefile (Onno, Mike Freeman) + 3. ZipIsWinNT() instead of IsWinNT() in zip.h (Mike) + 4. Fix -t and -tt behaviour for windll (Mike) + 5. Remove windll makefiles that are now elsewhere (Mike) + 6. BEOS: preserve file attributes associated with symbolic links (Chris) + 7. No need to use in2ex() for ziputils (Christian) + 8. Fix comment handling for EBCDIC systems (Christian) + 9. EBCDIC conversion for entry names read from zipfile in UTIL mode (Christian) +10. Fix "fatal" error messages on EBCDIC systems (Christian) +11. zipnote.c: Fix handling of entry name changes for EBCDIC systems (Christian) +12. removed a large part of "dead" code from ziputils version (Christian) +13. use z->iname in comparison functions for sorting (Christian) +14. new installation utils for the acorn (Sergio) +15. use LSSTAT in set_extra_field for unix and beos (Onno) +16. perror(z->zname) instead of perror("zip warning") (Onno, Geoff Pennington) +17. Amiga SFX should work again (Paul) +18. refer to zip22 in install.doc (Frank Donahoe) +------------------------ September 10th 1997 version 2.2q ------------------- + 1. Change .doc to .txt, these aren't MS-Word documents (John D. Mitchell) + 2. Change msdos$_(OBJ) to msdos_$(OBJ) (Kai Uwe) + 3. Fix a couple of amiga related glitches (Paul) + 4. Support for DOS packed .exe files in makefile.dj2 (Frank Donahoe) + 5. Change warning message for zip -A (Greg) +------------------------ September 29th 1997 version 2.2r ------------------- + 1. Fix make svr4package (Eric Baatz) + 2. Fix VMS warning (Mike Freeman, Christian) + 3. Clean up beos gcc port and beos README (Chris) +-------------------------- October 6th 1997 version 2.2s -------------------- + 1. Change lpPrint to lpZipPrint for windll (Mike) + 2. Change lpPassword to lpZipPassword for windll (Mike) + 3. Amiga timezone fixes (Paul) + 4. WatCom C 11.0 makefile fixes (Paul) + 5. Tandem port from Dave Smith + 6. Corrections and updates for install.txt (Christian) + 7. Minor VMS README update (Christian) +-------------------------- October 12th 1997 version 2.2t -------------------- + 1. qdos compiler bug workaround (Jonathan) + 2. prevent storing qdos specific filenames that exceed filesystem limits + (Jonathan) + 3. fix undelimited comment in fileio.c (Frank Donahoe) + 4. disable storing of symlinks in BEOS until OS support is available (Chris) + 5. Init hash_head to 0 in amiga/deflate.a (Paul) + 6. Upgrade to izshr025 (Christian) + 7. don't add ".zip" to ZIP name for TANDEM (Dave Smith) + 8. use zipup.h not tandem.h in zipup.c (Dave Smith) + 9. rename history to CHANGES (Onno) +10. rename install.txt to INSTALL (Onno) +11. rename zip.txt to ZIPMAN (Onno) +12. create WHATSNEW (Onno) +-------------------------- October 15th 1997 version 2.2u -------------------- + 1. Use Info-ZIP instead of Info-Zip (Christian) + 2. Note recent filename changes in several files (Christian) + 3. Remove a couple of items from the TODO list (Christian, Onno) + 4. Add windll port, zip -t yyyymmdd and zip -R to WHATSNEW (Christian) + 5. VMS documentation cleanups and clarifications (Christian) + 6. dist entry in unix/Makefile (Onno) + 7. remove duplicate amiga/timezone.txt (Christian) + 8. rename ZIPMAN to MANUAL and update a couple of files regarding this (Onno) +-------------------------- October 24th 1997 version 2.2v -------------------- + 1. izshr026: in WHERE wiz40 instead of wiz30 (Christian) + 2. izshr026: another couple of Info-ZIP spelling fixes (Christian) + 3. Remove zipgrep from the makefiles that still had it (Christian) + 4. Update makefiles to handle the MANUAL renaming change (Christian) + 5. Fix the last daylight savings bug on the Amiga (Paul) + 6. Fix the SCO Unix specialty detection in unix/configure (Onno, + bug reported by Bo Kullmar for Solaris 2.6 and with uname -X output + for SCO Unix from ken@apisys.com and dgsmith@vnet.ibm.com) + 7. Update WHERE and amiga/time_lib.c from unzip 5.32g (Greg) +-------------------------- October 26th 1997 version 2.2w -------------------- + 1. Additional +Onolimit check in unix/configure (Onno, Peter Jones) + 2. Use ZIPERR macro instead of ziperr (Christian) + 3. initialize z->lflg for zip entries without extra field (Christian) + 4. "local (+ locextend)" vs. "central" header consistency check (Christian) + 5. Override local header values with central header values with -A + and differences between these headers (Christain) + 6. made "deltaoff" signed long; offset adjustment may be negative (Christian) + 7. fix a number of "wild" deallocation bugs (Christian) + 8. When zipping from a FAT drive (only 8.3 DOS names) under OS/2 or + WIN32, set z->vem to "OS_DOS | ". + Mark as "made by DOS PKZIP 2.0" only when dosify was requested. (Christian) + 9. DOS port should not store fake unix style external attributes. (Christian) +10. amiga/time_lib.c from izshr028 (Christian) +-------------------------- October 31st 1997 version 2.2y -------------------- + 1. amiga/time_lib.c from izshr029 (Christian) + 2. Turbo C++ version code clarification (E-Yen Tan) + 3. Fix spelling in cmsvms/zipname.conven (Rodney Brown) + 4. Fix memset check in unix/configure for Unixware 2.1.1 (Rodney Brown) + 5. Forward declaration fixes for HP-UX bundled compiler (Rodney Brown) +-------------------------- November 3rd 1997 version 2.2 -------------------- + 1. Update WHERE (Greg). +-------------------------- January 4th 1998 version 2.21a ------------------- + 1. BSD friendly version of version_local() in unix/unix.c (Onno) + 2. No NT versions in DOS version_local() (Steve Salisbury) + 3. -t mmddyyyy instead of -t ddmmyyyy in WHATSNEW (Walter Haidinger) + 4. use generic fseekable() for rsxnt (Christian) + 5. Fix MSC 8.x warnings (Christian, Steve Salisbury) + 6. win32 Borland C++ makefile (E-Yen Tan) + 7. Tandem doesn't know about extensions like .zip,.arj, ... (Dave Smith) + 8. Use dosmatch for EMX and DJGPP too (Christian) + 9. dummy djgpp startup functions to remove command line globbing and + recognition of environment variables from djgpp.env (Christian) +10. include DJGPP_MINOR in DOS version_local() (Christian) +11. TC 2.0 doesn't have mktime() (Christian, mmp@earthling.net) +12. VMS: rename opendir() to zopendir() so avoiding name clash with + VMS 7.x POSIX libraries (Christian, Martin Zinser) +13. Add support for VMS DEC C V 5.6 features (Christian) +14. Use iname for comparison in check_dup (Christian Spieler, Christian Michel) +15. Fix access to uninitialized ioctx records in vms_get_attributes() + Christian, Robert Nielsen) +16. Parenthesis around MAX_MATCH>>1 in match.S (Greg) +17. Use strchr() not strrchr() for -i and -x to get -i@ and -x@ really + working (Onno, Kai Uwe) +18. add chmod statements to unix/Makefile (Quentin Barnes) +19. Windll: handle both -r and -R (Mike) +20. Windll: general error handler in main() via setjmp/longjmp (Mike) +21. Don't allow zip -i@x.lst foo.zip (Onno) +22. vms/link_zip.com: use .eqs. not .nes. when checking with f$search + for the zip AXP object library (David Dachtera) +23. rsxnt 1.3.1 fixes (E-Yen Tan) +-------------------------- January 20th 1998 version 2.21b ------------------- + 1. Bigger PATH_MAX for win32's windll (Mike) + 2. Update windll.txt w.r.t. PATH_MAX (Mike) + 3. Amiga SAS/C fixes (Walter, Paul) + 4. zip -i@ and -x@ should *really* work now ...... (Onno) +-------------------------- February 20th 1998 version 2.21c ------------------- + 1. make -f unix/Makefile qnx needs LN=ln in its options (Chris) + 2. Support Metroworks Codewarrior/x86 on BEOS (Chris) + 3. Add Norbert Pueschel to proginfo/infozip.who (Walter) + 4. Use big endian for Be types (Chris) + 5. zip -i and -x were broken by the -i@ fix last time around (Christian) + 6. win32 stat bandaid (Paul) + 7. acorn filetype and timestamp fixes (Sergio, D. Krumbholz) + 8. update to izshr30 (Christian) + 9. Support for NTSD in the RSXNT environment (Christian) +10. restructure readzipfile() (Christian) +11. Where needed define MATCH in osdep.h (Christian) +12. version_local() fixes for RSXNT (Christian) +13. New vmsmunch.c (Christian) +-------------------------- March 15th 1998 version 2.3a ------------------- + 1. Fixes for the windll API (Mike) + 2. Use CPUTYPE in BorlandC Makefile for DOS (E-Yen Tan) + 3. BEOS: -rostr not available for the x86 compiler (Chris) + 4. preserve file attributes of a symlink on BEOS (Chris) + 5. New VM/CMS README.CMS and version_local() (Ian Gorman) + 6. INSTALL fixes from Takahiro Watanabe + 7. OS/390 port from Paul von Behren + 8. new api.h from Mike +-------------------------- April 19th 1998 version 2.3b ------------------- + 1. Improve Tandem file I/O performance (Dave Smith) + 2. New VM/CMS README.CMS and version_local() (Ian Gorman) + 3. cygwin32 port from Cosmin Truta + 4. Workaround for tasm32 5.0 bug in win32/crc_i386.asm (Cosmin Truta) + 5. win32/match32.asm fixes for tasm 5.0 (Cosmin Truta) + 6. simplify OS/390 port (Christian) + 7. win32 timezone handling fixes (Christian) + 8. fix 40-bit time conversion on the acorn (Sergio and Christian) + 9. strip network part from UNC type filenames (Christian) +10. Makefile for OpenMVS (Ian Gorman) +11. Use the Watcom getch() for cygwin32 (Christian) +12. Borland C++ 5.x added to win32's version_local() (Cosmin Truta) +13. Borland C++ needs tzset() in win32 (Christian, Cosmin Truta) +-------------------------- May 21st 1998 version 2.3c ------------------- + 1. Better error messages for -i and -x (Christian) + 2. Win32 stat() wrapper needs dos2unixtime (Christian,Paul,Mike) + 3. DJGPP: use _chmod to handle LFN attributes correctly (Michael Mauch) + 4. Fix Borlandc warnings (Mike) + 5. win32/makefile.bor fixes from Michael Mauch + 6. win32/makefile.{dj,emx} fixes from E-Yen Tan + 7. Use izshr031 (Christian) + 8. CMS: use RECFM=V LRECL=32760 by adding "byteseek" (Greg Hartwig) + 9. Check external name for trailing "/" (Greg Hartwig) +10. More specific info in CMS version_local() (Greg Hartwig) +11. Changed usage info to refer to "fm" rather than "path" on CMS (Greg Hartwig) +12. No more "extra data" messages when using the same OS (Greg Hartwig) +13. Rewritten README.CMS, one version for ZIP and UNZIP (Greg Hartwig) +14. DOS/OS2/WIN32/UNIX: ex2in() strips off "//host/share/" from UNC names (SPC) +-------------------------- June 23rd 1998 version 2.3d ------------------- + 1. Fixed Win32's stat() bandaid handling of time stamps (SPC) + 2. General fix of file selections for DELETE and FRESHEN action (SPC) + 3. CMS_MVS: Use ASCII coding for TIME extra field ID (SPC) + 4. EBCDIC: Repaired bogus CMS_MVS fix in zipup.c; check the internal + name for trailing (ASCII) '/' to detect directory entries (SPC) + 5. Use explicit ASCII coding when comparing or setting chars in iname (SPC) + 6. Fixed win32/makefile.bor, win32/makefile.dj (support NTSD), + win32/makefile.emx (SPC) + 7. Replaced win32/makefile.cyg by win32/makefile.gcc, containing new + support for mingw32 GCC environment (SPC) + 8. Use izshr032 (SPC) + 9. Modified zipup.c to hold (un)compressed lengths in "ulg" variables, in + an attempt to support handling of huge (>2GByte) files. (SPC) +10. Removed some duplicate #defines from api.h, they are now in crypt.h (SPC) +11. Reenabled "extra data size" info messages in noisy mode for all systems + except RISCOS and CMS_MVS (SPC) +12. For EMX 0.9c, the runtime lib contains a working mktime(), use it (SPC) +13. Miscellanous cosmetic changes (SPC) +14. Move win32/makefile.emx to msdos (E-Yen Tan) +15. make api.h work with zcrypt2.8 (Mike) +16. define ydays differently in api.h to avoid linking problems (Mike) +17. New windll.txt (Mike) +18. win32 lcc patches (E-Yen Tan) +19. win32 lcc makefile (E-Yen Tan) +20. Multiple inclusion bug: no malloc.h when using lcc-win32 (E-Yen Tan) +21. New VB support files for windll (Mike Le Voi, Raymond King) +22. MacOS port by Dirk Haase +-------------------------- August 1st 1998 version 2.3e ------------------- + 1. Generalized check for validy of TZ timezone setup info, similar to + UnZip; use it on AMIGA and MSDOS, as before. (SPC) + 2. Apply TZ validy check on OS/2 and enable creation of UT e.f. (SPC) + 3. BEOS: New Makefile, updates for README and Contents (Chris Herborth) + 4. beos/beos.c: declare some private functions as "local" (SPC) + 5. Include memcompress() code only for ports that make use of it, controlled + by preprocessor symbol ZP_NEED_MEMCOMPR (SPC) + 6. cmsmvs/README.CMS fix: Zip archive entries to be extracted into var-length + records CMS files should >>NOT<< contain binary data ... (SPC) + 7. crc32.c, crctab.c: the crc polynom table is ZCONST (SPC) + 8. trees.c: fixed a bug in the deflate algorithm that limited the compressed + size of an archive member to 512 MByte (SPC) + 9. deflate.c: Integrated the changes found in zlib that are neccessary to make + the deflate algorithm deterministic; modified msdos/match.asm to take + care of the "nice_match" global no longer being constant. (SPC) +10. deflate.c, trees.c, zipup.c: Reorganized and simplified deflate's + compressed output buffer handling. I/O and compression code are now + separated more cleanly. (SPC) +11. Killed bits.c by moving its contents into trees.c resp. zipup.c; + synchronized all Makefiles and Make procedures with this change. (SPC) +12. Integrated support for optionally replacement of deflate and crc32 by + public domain zlib code. (SPC) +13. Synchronize the different variants (UNIX/GNU C, OS/2, WIN32) of i386 + assembler replacement for deflate's longest_match() (SPC) +14. Moved the EMX+rsxnt Makefile.emx from msdos/ back into win32/ (SPC) +15. Restored a separate Makefile.emx for DOS; on DOS, some make programs may + have difficulties with recursive invokation (SPC) +16. Fixed the "include header mess" of the new MACOS port and removed the + "work-around hacks" caused by these bad MACOS .h-file includes (SPC) +17. Integrated Dirk Haase's beta4 (27-Jun-98) release of MacZIP (Dirk Haase) +18. Added support for MS Quick C in the MSDOS version_local() report (SPC) +19. Added WIN32 rsxnt targets linking against the emx crtl DLL to Makefile.emx + in os2/ and win32/ (SPC) +20. Fixed typo in os2/os2.c wild() function. (Kai Uwe Rommel) +21. Removed ChangeNameForFAT() from os2/os2.c in2ex() to fix problem with + long filename support. (Kai Uwe Rommel) +22. os2/os2zip.[ch]: correct type of DOS-style timestamp data is "ulg" (SPC) +23. vms/cmdline.c: Removed wrong ';' behind if condition (Johnny Lee) +24. VMS: Preliminary preparations in C code for supporting GNU C on OpenVMS + Alpha (Onno van der Linden, Christian Spieler) +25. VMS: Fixed check against adding zipfile to itself in fileio.c (SPC) +26. WIN32: Added lcc-Win32 variants of i386 assembler code for crc32() and + longest_match(). (SPC) +27. WIN32: Removed bogus type-cast in assignment to statb st_mode member (SPC) +28. zip.c: Fixed MACOS-related typo that broke "-@" command option (SPC) +29. zipup.c: Fixed messed-up expression for assignment to z->ver (SPC) +30. MACOS extra fields: check realloc return values (Onno, Johnny Lee) +31. Fix the PUTBYTE macro in trees.c: >= instead of < (Onno) +-------------------------- September 6th 1998 version 2.3f ------------------- + 1. Add zp_tz_is_valid to globals.c (Onno, Frank Donahoe) + 2. Updated tandem files from Dave Smith + 3. Windll: allow comments to zip archive with VB (Mike) + 4. Windll: add support for -b and update the documentation (Mike) + 5. win32: use wbS for FOPW to handle large zip files better (Steve Miller) + 6. MVS fix: use fseek();clearerr() instead of rewind() (Onno, Lee Burton) + 7. Updated VB examples for windll (Mike) + 8. Tandem: use UTC timestamps and GID/UID in extra field (Dave Smith) + 9. Tandem: handle -o option (Dave Smith) +10. default for ZCONST is const in tailor.h, override in osdep.h (Onno) +11. additional Macintosh options in zip.c (Dirk Haase) +12. additional Macintosh options in zip.1 and MANUAL (Onno, Dirk Haase) +13. Integrate Beta 5 of the Macintosh Port (Dirk Haase) +-------------------------- October 27th 1998 version 2.3g ------------------- + 1. zip_tz_is_valid should be zp_tz_is_valid (Kai Uwe) + 2. MVS native (not OE) beta fixes (Keith Owens) + 3. LynxOS support from Giuseppe Guerrini + 4. MVS already has stat() and fstat() so use 'em (Keith Owens) + 5. MVS fix in readzipfile() for new, unopened dataset without EOF marker + (Keith Owens) + 6. Remove 16-bit stuff from windll/windll.rc (Mike) + 7. Windll: Use hCurrentInst not hInst (Mike) + 8. In util.c compare strchr() return value with NULL (Onno, Frank Donahoe) + 9. unix/unix.c: initialize variable t in ex2in() (Onno, Frank Danahoe) +10. Remove windll/borland subdirectory (Mike) +11. Really fix extra field realloc() for BeOS and MacOS (Christian) +12. Fix the dj2 LFN related access violation bug (Christian, Joe Forster) +13. proginfo/3rdparty.bug: Added more info about other Zip clone's bugs. +14. The global copyright definitions in revision.h now depend on DEFCPYRT + (Christian). +15. tandem/macros: removed obsolete object file references (Christian) +16. fix memory leak with the "filter" patterns (Christian, Leah Kramer) +17. zip.c: completed the support for MacOS specific -N (Christian) +18. reorganized the Mac specific help screen code (Christian) +19. zipup.c: corrected the USE_ZLIB code to emit "stored" entries under + the same conditions as the "native deflate" code (Christian) +20. A couple of vars that will never be negative should be unsigned (Christian) +-------------------------- November 18th 1998 version 2.3h ------------------- + 1. DJGPP: When compressing from stdin don't set binary mode if stdin is + a terminal (E-Yen Tan) + 2. Fix signed/unsigned comparisons in fileio.c, util.c and zipcloak.c + (Frank Donahoe) + 3. Move macgetch() prototype from macos/source/macos.c to macos/osdep.h + (Christian) + 4. _doserrno should have type int, not unsigned int (Christian) + 5. In zipfile.c init a file pointer with NULL to fix gcc warning (Christian) + 6. Upgrade to MacOS beta 7 (Dirk Haase) + 7. Move the #pragma statements from generic sources to cmsmvs.h (Christian) + 8. Support for QNX/Neutrino 2.0 (Chris) + 9. Default to -r in help screen add -R at the bottom (Chris) +10. Clean up Makefile for BeOS R4 on x86 (Chris) +11. Beos: If not storing symlinks store attributes of symlink target (Chris) +12. Use izshr037 (Christian) +13. Remove ZIPERR() macro from in {msdos,win32}/osdep.h (Christian) +14. win32/win32.c: Fix 1-day offset in non-64bit FileTime2utime() (Christian) +15. win32: enable 64-bit FileTime2utime() for MS VC++ >= 5.0 (Christian) +16. cygwin32 only has _P_WAIT (Thomas Klausner) +17. msname() should *really* ignore illegal characters (Thomas Klausner) +18. Fix a missing ')' in Opendir() from win32zip.c (Thomas Klausner) +-------------------------- December 5th 1998 version 2.3i ------------------- + 1. Remove the #pragma statements that were forgotten the first time (Ian) + 2. Remove obsolete macos/source/CharMap.h (Steve Salisbury) + 3. isatty(fileno(zstdin)) in zipup.c should be isatty(zstdin) + (Onno, E-Yen Tan) + 4. several "shut up warnings from compiler" fixes (Christian) + 5. several cosmetic source changes (Christian) + 6. win32: make NTSD handling to be robust against alignment and structure + padding problems (Christian) + 7. Apply don't set binary mode when stdin is a terminal in zipup.c for + MSDOS and human68k (Christian) + 8. Upgrade to MacOS beta 8 (Dirk Haase) + 9. Add callback for WINDLL to handle user termination (Mike) +10. Fix typo in acornzip.c (Darren Salt) +11. acorn/sendbits.s: pass correct parameters to flush_outbuf() (Darren Salt) +12. Fixes for IBM C/C++ 3.6 where time_t is a double (Kai Uwe) +13. Fixes for IBM Visual Age C++ for win32 (Douglas Hendrix) +14. man/zip.1: some version numbers in the text were still "2.2" (Christian) +15. win32/makefile.emx: added a compilation variant that generates + standalone executables (Christian) +16. change __CYGWIN32__ into __CYGWIN__ and add compatiblity definition for + B19 and older (Cosmin Truta) +17. create uniform win32 getch() replacement (Christian) +18. put back in define of USE_EF_UT_TIME in tandem.h (Dave Smith) +19. put back in define of USE_CASE_MAP in tandem.h (Dave Smith) +20. updates to make/macros to allow the object to be licensed (Dave Smith) +21. updates to macros/doit to remove mktime.c (Dave Smith) +22. updates to tandem.c for in2ex/mapname/chmod amendments to match Unzip + (Dave Smith) +23. Use izshr039.zip (Christian) +24. Init filenotes to 0 for the amiga too (Onno) +25. get_filters(): remove one flag=0 statement to make -R work again (Onno) +-------------------------- December 17th 1998 version 2.3j ------------------ + 1. FOPWT defines opening a temp file for writing (Ian) + 2. Remove handling of bits.c from a couple of tandem files (Christian) + 3. A couple of "shut up warnings from compiler" fixes (Christian) + 4. win32/osdep.h: removed duplicate "IZ_PACKED" definition (Christian) + 5. win32/zipup.h: remove invalid "elseif" preprocessor token (Christian) + 6. sync MacOS help screen with other ports (Christian) + 7. get_filters(): set flag to 0 when -R isn't used (Christian) + 8. "local extra != central extra" now has "info" status (Christian) + 9. use windll directory as "home" directory for builds (Mike) +10. CMS/MVS: define FOPWT (Ian) +11. Upgrade to MacOS beta 9 (Dirk Haase) +-------------------------- January 17th 1999 version 2.3k ------------------ + 1. Change FOPW into FOPW_TMP (Christian) + 2. win32: #include uses paths relative to the parent directory (Christian) + 3. Use forward slashes as path separator in #include statements (Christian) + 4. windll: fix descriptions of f{In,Ex}cludeDate (Christian) + 5. win32/makefile.lcc: add some -I options to find files in the + right places (Christian) + 6. Supply default empty IZ_PACKED define (Christian) + 7. windll: Fix some typos, descriptions (Christian) + 8. windll project files: use relative paths, no specific root directory + (Christian) + 9. windll project files: remove link references to import libraries that + are not used by the zip library (Christian) +10. windll: fix potential infinite loop in a VB sample (Mike) +11. windll/windll.txt: remove "may not work with VB" statement (Mike) +12. Multibyte character set support from Yoshioka Tsuneo +13. Theos port from Jean-Michel Dubois +14. Tandem: added simple handling of Enscribe files by converting them into + text type files (Dave Smith) +15. Tandem Extra Field ("TA") containing Tandem File Attributes (Dave Smith) +16. Tandem history file showing background info to (UN)ZIP ports (Dave Smith) +17. create ZIP file on tandem with special file code (1001) (Dave Smith) +18. made tandem.c & tandem.h code completely the same as UNZIP (Dave Smith) +19. unix/configure: move +Onolimit and -Olimit into the machine specific + section (Onno, John Wiersba) +-------------------------- February 21st 1999 version 2.3l ------------------ + 1. Fix qdos Makefile (Jonathan Hudson) + 2. fgets instead of gets in zipnote to fix linker warnings (Jonathan Hudson) + 3. Theos: remove _setargv.c and a reference in zip.c (Jean-Michel Dubois) + 4. Theos README (Jean-Michel Dubois) + 5. interchanged the fRecurse flag values for "-R" and "-r" (Christian) + 6. add "z" pr prefix to MBCS functions to avoid name clashes (Christian) + 7. Whenever the position of the increment operator does not matter, the + INCSTR variant is used, which has been mapped to the {PRE|POS}INCSTR + variant that is more efficient. (Christian) + 8. fixed the "-R" handling in fileio.c, filter() function (Christian) + 9. simplified some THEOS specific code additions (Christian) +10. changed the line break of the compiler version message in version_local() + for MSDOS and Win32 to take into account some verbose compilers (Christian) +11. removed the THEOS changes from ttyio.c. Instead, a THEOS specific + setup was added to ttyio.h (Christian) +12. sync vms/link_zip.com with the corresponding make_zip.com (Christian) +13. added compatibility settings for support of MBCS on Win32 with all tested + compilers to win32/osdep.h +14. added type-casts to isalpha() macro calls (Christian) +15. fixed win32's wild_match which was clobbered by the MBCS addition + (Christian) +16. finished up the "potential infinite loop" problems in the VB sample + that Mike started to repair (Christian) +17. in ziperr.h, AZTEK C might require the false comma that was removed + to satisfy THEOS C (Christian) +18. removed the bogus THEOS specific isdir check in zipup.c (Christian) +19. modified the code for line ending translation to be independent + of the local system's convention for '\n' and '\r'; this allowed + the removal of the THEOS specialities (Christian) +20. Tandem: -B option to zip Enscribe files with no record delimiters + (Dave Smith) +21. Tandem: attempt to catch Large Transfer mode failure (Dave Smith) +22. Theos: Fixed keyboard entry functions. (Jean-Michel Dubois) +23. Theos: workaround for the argument wild card expansion that is bugged + in the standard library. Managed by MAINWA_BUG flag. (Jean-Michel Dubois) +24. Theos: support for filenames and notes with accented characters. + (Jean-Michel Dubois) +25. Upgrade to MacOS final (Dirk Haase) +-------------------------- March 31st 1999 version 2.3m ------------------- + 1. Theos: for relative paths to root directory cause open, fopen and stat + failure, workaround this. (Jean-Michel Dubois) + 2. Theos: when no path is indicated in a file or directory name and the + file or directory doesn't exist in the current directory it looks for + the file or directory in the root directory, workaround this. + (Jean-Michel Dubois) + 3. Corrected some typos and spelling error in macos/HISTORY.TXT; skipped + off invisible trailing whitespace (Christian) + 4. proginfo/extra.fld: added documentation for Tandem and Theos extra + field layout (Christian with Dave D Smith resp. Jean-Michel Dubois) + 5. qdos/Makefile.qdos: The build of ZipCloak requires inclusion of + the crctab object module; qfileio_.o compilation requires the -DUTIL + flag (Christian) + 6. win32: fix incorrect MB_CUR_MAX macro for mingw32 and lcc (Christian) + 7. theos/_fprintf.c, theos/_rename.c, theos/osdep.h: Some function + parameters require the "const" attribute to achieve compatibility + with ANSI C requirements (Christian) + 8. theos/theos.c: map Theos' (No)Hidden file attribute to MSDOS Hidden + bit in the MSDOS part of zipentry header's external attribute field; + 9. theos/stat.h: prevent multiple inclusions +10. Theos: Fixed wild card management for options other than adding + (Jean-Michel Dubois) +11. Theos: Removed modifications of const strings (Jean-Michel Dubois) +12. Split tandem.c up into separate zip/unzip parts (Dave Smith, Christian) +13. Move inclusion of OS specific zipup.h files to tailor.h (Onno) +-------------------------- August 14th 1999 version 2.3n ------------------- + 1. Move inclusion of OS specific zipup.h files back to zipup.c (Onno) + 2. Remove getline() from zipnote.c and use gets() again (Onno) + 3. BeOS PowerPC R4.1 support (Chris) + 4. New DOIT and MACROS files for the tandem port (Dave Smith) + 5. Don't switch the console to binary mode (Michel de Ruiter) + 6. In some circumstances undosm could be freed twice (Mike) + 7. Also define const in tailor.h for ultrix (Onno, Foppa Uberti Massimo) + 8. Tandem: Change zopen in TANZIPC to allow opening of files with missing + alt keys (err 4) (Dave Smith) + 9. Tandem: Assume not DST if can't resolve time (no DST table available) + (Dave Smith) +10. WIN32: skip trailing dots and spaces in getnam (Onno, Dan Kegel) +11. Use ZE_NONE when nothing to freshen or update (Onno, Yuri Sidorenko) +12. Remove tabs from files that don't need them (Onno) +13. Remove tabs and spaces from the end of a text line (Onno) +14. Upgrade macos to 1.04b2 (Dirk) +15. Add -Q documentation to manual page (Jonathan Hudson) +16. Copy hiperspace files instead of renaming them (Keith Owens) +17. Disallow some more characters to appear in DOS filenames when using -k + (Onno, Thomas Klausner) +18. Document missing options and environment variables in the manual (Onno) +19. New acorn/GMakefile to compile with gcc on RISCOS (Darren Salt) +20. ISO 8601 date format support for -t and -tt (Rodney Brown) +-------------------------- September 21st 1999 version 2.3o ------------------- + 1. Sync zip.h license with LICENSE (Onno) + 2. Add copyright notice to README, os2zip.c and os2.zip.h (Onno, Greg) + 3. Fix the ASM variable in acorn/GMakefile (Darren Salt) + 4. Add another requirement to acorn/ReadMe.GMakefile (Darren Salt) + 5. Fix unbalanced parenthesis in vms_get_attributes declaration in zip.h + and move it to vms/zipup.h (Onno, Mike Freeman) + 6. Make a couple of os2 files public domain (Kai Uwe) + 7. Change and rename disclaimer array in revision.h (Onno) + 8. Change copyright array in revision.h (Onno) + 9. macstuff.c copyright is the same as macstuff.h (Christian) +10. WHATSNEW: add ISO 8601 dates supported (Christian) +11. fileio.c - msname(): strip off leading dots, these are illegal for + MSDOS compatible names (Christian) +13. fileio.c - replace(): deactivate "dead" code for CMS_MVS (Christian) +14. man/zip.1: "-$" option is also used for WIN32 ports +15. msdos/msdos.c - version_local(): break the version line for + GNU compilers too (Christian) +16. tailor.h: added typecasts to MBCS macros, to suppress "type mismatch" + warnings (Christian) +17. util.c, zip.h, zipfile.c: ZCONSTify several pointers (Christian) +18. util.c - recmatch(), zip.c - version_info(): add compile time option + WILD_STOP_AT_DIR (Christian, Darren Salt) +19. util.c - envargs(): MBCS related fixes (Christian) +20. win32/lm32_lcc.asm: add TAB characters that are required by the lcc + assembler source parser (Christian) +21. zip.c: fix the "is a console" check (Christian) +22. zipnote.c: use getline() (Christian) +23. zipup.c: use zclose() in case of I/O errors (Christian) +24. zipup.c: use ZE_WRITE when a write error occurs (Christian) +25. win32/win32.c: HAVE_INT64 is used by mingw32 (Cosmin Truta) +26. update shared sources to match izshr041 (Christian) +-------------------------- November 29th 1999 version 2.3 ------------------ + 1. Missing parenthesis in win32/win32.c (Steve Salisbury) + 2. Add Cosmin Truta to proginfo/infozip.who (Onno) + 3. Remove one parenthesis pair too many from vms_get_attributes() declaration + in vms/zipup.h (Mike Freeman) + 4. qdos .s are expected to start with a #, work around it (Jonathan Hudson) + 5. tandem: -B0 should be deflating not storing (Dave Smith) + 6. human68k updates from Shimazaki Ryo + 7. beos Makefile cleanup (Chris) + 8. workaround for fseek to negativate offset behaviour of the RISC OS + SharedCLibrary (Darren Salt) + 9. set file type for RISC OS in zipcloak.c (Darren Salt) +10. change tandem zgetch() to allow crypt version to work (Dave Smith) +11. fix a comment typo in acorn/riscos.c (Christian) +12. fileio.c: two type-cast to shut up noisy compilers (Christian) +13. human68k: fix missing case_flag argmument (Christian) +14. win32/win32.c: remove HAVE_INT64 completely (Christian) +15. zip.c: raise "cannot zip to console" error when stdout IS a tty (Christian) +16. zip.h: don't use dummy argument names in declarations (Christian) +17. Add missing semicolon in fileio.c (Shimazaki Ryo) +18. win32.c: IBMC compiler >= 3.50 have int64 (Kai Uwe) +19. Handle initialization error return value from MVS stat() in procname() + (Keith Owens) +20. Use RISC OS instead of RiscOS in the manual (Darren Salt) +21. Use # instead of ? as single character wildcard on RISC OS (Darren Salt) +22. New windll example.c (Mike) +23. Correct storage of 8-bit char filenames with RSXNT (Burkhard Hirzinger) +24. fix install in unix/Makefile (Santiago Vila, Onno) +25. Fix zip -L output (Santiago Vila, Onno) +26. Ignore unix special files (Jonathan O'Brien) +27. Upgrade to izshr042 (Onno) +28. Make copyright notice the same as in izshr042 (Onno) +29. Make copyright notice in zip.h the same as LICENSE (Christian) +30. Set tempzf to NULL _after_ it has been closed (Chris Kacher) +31. Change email address for Jonathan Hudson (Jonathan Hudson) +32. Remove win32/winzip.c.orig (Steve Salisbury) +33. Use 'Steve Salisbury' throughout the documentation (Steve Salisbury) +34. Change email address for Steve Salisbury (Steve Salisbury) +35. Change email address for Chris Herborth (Chris Herborth) +36. Use zip23 in INSTALL (Roger Cornelius) +37. Use zcrypt28 in INSTALL (Onno) +38. New acorn/srcrename (Darren Salt) +39. amiga/makefile.azt: make clean should remove some more items (Paul) +40. Change email address for Cosmin Truta (Cosmin Truta) diff -Nru boinc-7.0.7+dfsg/zip/zip/crc_i386.S boinc-7.0.14+dfsg/zip/zip/crc_i386.S --- boinc-7.0.7+dfsg/zip/zip/crc_i386.S 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/crc_i386.S 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,232 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * crc_i386.S, optimized CRC calculation function for Zip and UnZip, + * created by Paul Kienitz and Christian Spieler. Last revised 24 Dec 98. + * + * GRR 961110: incorporated Scott Field optimizations from win32/crc_i386.asm + * => overall 6% speedup in "unzip -tq" on 9MB zipfile (486-66) + * + * SPC 970402: revised for Rodney Brown's optimizations (32-bit-wide + * aligned reads for most of the data from buffer), can be + * disabled by defining the macro NO_32_BIT_LOADS + * + * SPC 971012: added Rodney Brown's additional tweaks for 32-bit-optimized + * CPUs (like the Pentium Pro, Pentium II, and probably some + * Pentium clones). This optimization is controlled by the + * preprocessor switch "__686" and is disabled by default. + * (This default is based on the assumption that most users + * do not yet work on a Pentium Pro or Pentium II machine ...) + * + * FLAT memory model assumed. Calling interface: + * - args are pushed onto the stack from right to left, + * - return value is given in the EAX register, + * - all other registers (with exception of EFLAGS) are preserved. (With + * GNU C 2.7.x, %edx and %ecx are `scratch' registers, but preserving + * them nevertheless adds only 4 single byte instructions.) + * + * This source generates the function + * ulg crc32(ulg crc, ZCONST uch *buf, ulg len). + * + * The loop unrolling can be disabled by defining the macro NO_UNROLLED_LOOPS. + * This results in shorter code at the expense of reduced performance. + */ + +/* This file is NOT used in conjunction with zlib. */ +#ifndef USE_ZLIB + +/* Preprocess with -DNO_UNDERLINE if your C compiler does not prefix + * external symbols with an underline character '_'. + */ +#if defined(NO_UNDERLINE) || defined(__ELF__) +# define _crc32 crc32 +# define _get_crc_table get_crc_table_boinc +#endif +/* Use 16-byte alignment if your assembler supports it. Warning: gas + * uses a log(x) parameter (.align 4 means 16-byte alignment). On SVR4 + * the parameter is a number of bytes. + */ +#ifndef ALIGNMENT +# define ALIGNMENT .align 4,0x90 +#endif + +#if defined(i386) || defined(_i386) || defined(_I386) || defined(__i386) + +/* This version is for 386 Unix, OS/2, MSDOS in 32 bit mode (gcc & gas). + * Warning: it uses the AT&T syntax: mov source,dest + * This file is only optional. If you want to use the C version, + * remove -DASM_CRC from CFLAGS in Makefile and set OBJA to an empty string. + */ + + .file "crc_i386.S" + +#if defined(NO_STD_STACKFRAME) && defined(USE_STD_STACKFRAME) +# undef USE_STACKFRAME +#else + /* The default is to use standard stack frame entry, because it + * results in smaller code! + */ +# ifndef USE_STD_STACKFRAME +# define USE_STD_STACKFRAME +# endif +#endif + +#ifdef USE_STD_STACKFRAME +# define _STD_ENTRY pushl %ebp ; movl %esp,%ebp +# define arg1 8(%ebp) +# define arg2 12(%ebp) +# define arg3 16(%ebp) +# define _STD_LEAVE popl %ebp +#else /* !USE_STD_STACKFRAME */ +# define _STD_ENTRY +# define arg1 24(%esp) +# define arg2 28(%esp) +# define arg3 32(%esp) +# define _STD_LEAVE +#endif /* ?USE_STD_STACKFRAME */ + +/* + * These two (three) macros make up the loop body of the CRC32 cruncher. + * registers modified: + * eax : crc value "c" + * esi : pointer to next data byte (or lword) "buf++" + * registers read: + * edi : pointer to base of crc_table array + * scratch registers: + * ebx : index into crc_table array + * (requires upper three bytes = 0 when __686 is undefined) + */ +#ifndef __686 /* optimize for 386, 486, Pentium */ +#define Do_CRC /* c = (c >> 8) ^ table[c & 0xFF] */\ + movb %al, %bl ;/* tmp = c & 0xFF */\ + shrl $8, %eax ;/* c = (c >> 8) */\ + xorl (%edi, %ebx, 4), %eax ;/* c ^= table[tmp] */ +#else /* __686 : optimize for Pentium Pro and compatible CPUs */ +#define Do_CRC /* c = (c >> 8) ^ table[c & 0xFF] */\ + movzbl %al, %ebx ;/* tmp = c & 0xFF */\ + shrl $8, %eax ;/* c = (c >> 8) */\ + xorl (%edi, %ebx, 4), %eax ;/* c ^=table[tmp] */ +#endif /* ?__686 */ + +#define Do_CRC_byte /* c = (c >> 8) ^ table[(c^*buf++)&0xFF] */\ + xorb (%esi), %al ;/* c ^= *buf */\ + incl %esi ;/* buf++ */\ + Do_CRC + +#ifndef NO_32_BIT_LOADS +#define Do_CRC_lword \ + xorl (%esi), %eax ;/* c ^= *(ulg *)buf */\ + addl $4, %esi ;/* ((ulg *)buf)++ */\ + Do_CRC \ + Do_CRC \ + Do_CRC \ + Do_CRC +#endif /* !NO_32_BIT_LOADS */ + + + .text + + .globl _crc32 + +_crc32: /* ulg crc32(ulg crc, uch *buf, extent len) */ + _STD_ENTRY + pushl %edi + pushl %esi + pushl %ebx + pushl %edx + pushl %ecx + + movl arg2, %esi /* 2nd arg: uch *buf */ + subl %eax, %eax /* > if (!buf) */ + testl %esi, %esi /* > return 0; */ + jz .L_fine /* > else { */ + call _get_crc_table + movl %eax, %edi + movl arg1, %eax /* 1st arg: ulg crc */ +#ifndef __686 + subl %ebx, %ebx /* ebx=0; bl usable as dword */ +#endif + movl arg3, %ecx /* 3rd arg: extent len */ + notl %eax /* > c = ~crc; */ + + testl %ecx, %ecx +#ifndef NO_UNROLLED_LOOPS + jz .L_bail +# ifndef NO_32_BIT_LOADS + /* Assert now have positive length */ +.L_align_loop: + testl $3, %esi /* Align buf on lword boundary */ + jz .L_aligned_now + Do_CRC_byte + decl %ecx + jnz .L_align_loop +.L_aligned_now: +# endif /* !NO_32_BIT_LOADS */ + movl %ecx, %edx /* save len in edx */ + shrl $3, %ecx /* ecx = len / 8 */ + jz .L_No_Eights +/* align loop head at start of 486 internal cache line !! */ + ALIGNMENT +.L_Next_Eight: +# ifndef NO_32_BIT_LOADS + /* Do_CRC_lword */ + xorl (%esi), %eax ;/* c ^= *(ulg *)buf */ + addl $4, %esi ;/* ((ulg *)buf)++ */ + Do_CRC + Do_CRC + Do_CRC + Do_CRC + /* Do_CRC_lword */ + xorl (%esi), %eax ;/* c ^= *(ulg *)buf */ + addl $4, %esi ;/* ((ulg *)buf)++ */ + Do_CRC + Do_CRC + Do_CRC + Do_CRC +# else /* NO_32_BIT_LOADS */ + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte +# endif /* ?NO_32_BIT_LOADS */ + decl %ecx + jnz .L_Next_Eight + +.L_No_Eights: + movl %edx, %ecx + andl $7, %ecx /* ecx = len % 8 */ +#endif /* !NO_UNROLLED_LOOPS */ + jz .L_bail /* > if (len) */ +/* align loop head at start of 486 internal cache line !! */ + ALIGNMENT +.L_loupe: /* > do { */ + Do_CRC_byte /* c = CRC32(c, *buf++); */ + decl %ecx /* > } while (--len); */ + jnz .L_loupe + +.L_bail: /* > } */ + notl %eax /* > return ~c; */ +.L_fine: + popl %ecx + popl %edx + popl %ebx + popl %esi + popl %edi + _STD_LEAVE + ret + +#else + error: this asm version is for 386 only +#endif /* i386 || _i386 || _I386 || __i386 */ + +#endif /* !USE_ZLIB */ diff -Nru boinc-7.0.7+dfsg/zip/zip/deflate.c boinc-7.0.14+dfsg/zip/zip/deflate.c --- boinc-7.0.7+dfsg/zip/zip/deflate.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/deflate.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,904 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * deflate.c by Jean-loup Gailly. + * + * PURPOSE + * + * Identify new text as repetitions of old text within a fixed- + * length sliding window trailing behind the new text. + * + * DISCUSSION + * + * The "deflation" process depends on being able to identify portions + * of the input text which are identical to earlier input (within a + * sliding window trailing behind the input currently being processed). + * + * The most straightforward technique turns out to be the fastest for + * most input files: try all possible matches and select the longest. + * The key feature of this algorithm is that insertions into the string + * dictionary are very simple and thus fast, and deletions are avoided + * completely. Insertions are performed at each input character, whereas + * string matches are performed only when the previous match ends. So it + * is preferable to spend more time in matches to allow very fast string + * insertions and avoid deletions. The matching algorithm for small + * strings is inspired from that of Rabin & Karp. A brute force approach + * is used to find longer strings when a small match has been found. + * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze + * (by Leonid Broukhis). + * A previous version of this file used a more sophisticated algorithm + * (by Fiala and Greene) which is guaranteed to run in linear amortized + * time, but has a larger average cost, uses more memory and is patented. + * However the F&G algorithm may be faster for some highly redundant + * files if the parameter max_chain_length (described below) is too large. + * + * ACKNOWLEDGEMENTS + * + * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and + * I found it in 'freeze' written by Leonid Broukhis. + * Thanks to many info-zippers for bug reports and testing. + * + * REFERENCES + * + * APPNOTE.TXT documentation file in PKZIP 1.93a distribution. + * + * A description of the Rabin and Karp algorithm is given in the book + * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. + * + * Fiala,E.R., and Greene,D.H. + * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 + * + * INTERFACE + * + * void lm_init (int pack_level, ush *flags) + * Initialize the "longest match" routines for a new file + * + * ulg deflate_boinc (void) + * Processes a new input file and return its compressed length. Sets + * the compressed length, crc, deflate flags and internal file + * attributes. + */ + +#define __DEFLATE_C + +#include "zip.h" + +#ifndef USE_ZLIB + +/* =========================================================================== + * Configuration parameters + */ + +/* Compile with MEDIUM_MEM to reduce the memory requirements or + * with SMALL_MEM to use as little memory as possible. Use BIG_MEM if the + * entire input file can be held in memory (not possible on 16 bit systems). + * Warning: defining these symbols affects HASH_BITS (see below) and thus + * affects the compression ratio. The compressed output + * is still correct, and might even be smaller in some cases. + */ + +#ifdef SMALL_MEM +# define HASH_BITS 13 /* Number of bits used to hash strings */ +#endif +#ifdef MEDIUM_MEM +# define HASH_BITS 14 +#endif +#ifndef HASH_BITS +# define HASH_BITS 15 + /* For portability to 16 bit machines, do not use values above 15. */ +#endif + +#define HASH_SIZE (unsigned)(1<= HASH_BITS + */ + +unsigned int near prev_length; +/* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + unsigned near strstart; /* start of string to insert */ + unsigned near match_start; /* start of matching string */ +local int eofile; /* flag set at end of input file */ +local unsigned lookahead; /* number of valid bytes ahead in window */ + +unsigned near max_chain_length; +/* To speed up deflation, hash chains are never searched beyond this length. + * A higher limit improves compression ratio but degrades the speed. + */ + +local unsigned int max_lazy_match; +/* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +#define max_insert_length max_lazy_match +/* Insert new strings in the hash table only if the match length + * is not greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + +unsigned near good_match; +/* Use a faster search when the previous match is longer than this */ + +#ifdef FULL_SEARCH +# define nice_match MAX_MATCH +#else + int near nice_match; /* Stop searching when current match exceeds this */ +#endif + + +/* Values for max_lazy_match, good_match, nice_match and max_chain_length, + * depending on the desired pack level (0..9). The values given below have + * been tuned to exclude worst case performance for pathological files. + * Better values may be found for specific files. + */ + +typedef struct config { + ush good_length; /* reduce lazy search above this match length */ + ush max_lazy; /* do not perform lazy search above this match length */ + ush nice_length; /* quit search above this match length */ + ush max_chain; +} config; + +local config configuration_table[10] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0}, /* store only */ +/* 1 */ {4, 4, 8, 4}, /* maximum speed, no lazy matches */ +/* 2 */ {4, 5, 16, 8}, +/* 3 */ {4, 6, 32, 32}, + +/* 4 */ {4, 4, 16, 16}, /* lazy matches */ +/* 5 */ {8, 16, 32, 32}, +/* 6 */ {8, 16, 128, 128}, +/* 7 */ {8, 32, 128, 256}, +/* 8 */ {32, 128, 258, 1024}, +/* 9 */ {32, 258, 258, 4096}}; /* maximum compression */ + +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different + * meaning. + */ + +#define EQUAL 0 +/* result of memcmp for equal strings */ + +/* =========================================================================== + * Prototypes for local functions. + */ + +local void fill_window OF((void)); +local ulg deflate_fast OF((void)); + + int longest_match_batch OF((IPos cur_match)); +//#if defined(ASMV) && !defined(RISCOS) +// void match_init OF((void)); /* asm code initialization */ +//#endif + +#ifdef DEBUG +local void check_match OF((IPos start, IPos match, int length)); +#endif + +/* =========================================================================== + * Update a hash value with the given input byte + * IN assertion: all calls to to UPDATE_HASH are made with consecutive + * input characters, so that a running hash key can be computed from the + * previous key instead of complete recalculation each time. + */ +#define UPDATE_HASH(h,c) (h = (((h)< 0 if the input file is already read or + * mmap'ed in the window[] array, 0 otherwise. In the first case, + * window_size is sufficient to contain the whole input file plus + * MIN_LOOKAHEAD bytes (to avoid referencing memory beyond the end + * of window[] when looking for matches towards the end). + */ +void lm_init (pack_level, flags) + int pack_level; /* 0: store, 1: best speed, 9: best compression */ + ush *flags; /* general purpose bit flag */ +{ + register unsigned j; + + if (pack_level < 1 || pack_level > 9) error("bad pack level"); + + /* Do not slide the window if the whole input is already in memory + * (window_size > 0) + */ + sliding = 0; + if (window_size == 0L) { + sliding = 1; + window_size = (ulg)2L*WSIZE; + } + + /* Use dynamic allocation if compiler does not like big static arrays: */ +#ifdef DYN_ALLOC + if (window == NULL) { + window = (uch far *) zcalloc(WSIZE, 2*sizeof(uch)); + if (window == NULL) ziperr(ZE_MEM, "window allocation"); + } + if (prev == NULL) { + prev = (Pos far *) zcalloc(WSIZE, sizeof(Pos)); + head = (Pos far *) zcalloc(HASH_SIZE, sizeof(Pos)); + if (prev == NULL || head == NULL) { + ziperr(ZE_MEM, "hash table allocation"); + } + } +#endif /* DYN_ALLOC */ + + /* Initialize the hash table (avoiding 64K overflow for 16 bit systems). + * prev[] will be initialized on the fly. + */ + head[HASH_SIZE-1] = NIL; + memset((char*)head, NIL, (unsigned)(HASH_SIZE-1)*sizeof(*head)); + + /* Set the default configuration parameters: + */ + max_lazy_match = configuration_table[pack_level].max_lazy; + good_match = configuration_table[pack_level].good_length; +#ifndef FULL_SEARCH + nice_match = configuration_table[pack_level].nice_length; +#endif + max_chain_length = configuration_table[pack_level].max_chain; + if (pack_level <= 2) { + *flags |= FAST; + } else if (pack_level >= 8) { + *flags |= SLOW; + } + /* ??? reduce max_chain_length for binary files */ + + strstart = 0; + block_start = 0L; +//#if defined(ASMV) && !defined(RISCOS) +// match_init(); /* initialize the asm code */ +//#endif + + j = WSIZE; +#ifndef MAXSEG_64K + if (sizeof(int) > 2) j <<= 1; /* Can read 64K in one step */ +#endif + lookahead = (*read_buf)((char*)window, j); + + if (lookahead == 0 || lookahead == (unsigned)EOF) { + eofile = 1, lookahead = 0; + return; + } + eofile = 0; + /* Make sure that we always have enough lookahead. This is important + * if input comes from a device such as a tty. + */ + if (lookahead < MIN_LOOKAHEAD) fill_window(); + + ins_h = 0; + for (j=0; j= 1 + */ +//#ifndef ASMV +/* For 80x86 and 680x0 and ARM, an optimized version is in match.asm or + * match.S. The code is functionally equivalent, so you can use the C version + * if desired. + */ +int longest_match_boinc(cur_match) + IPos cur_match; /* current match */ +{ + unsigned chain_length = max_chain_length; /* max hash chain length */ + register uch far *scan = window + strstart; /* current string */ + register uch far *match; /* matched string */ + register int len; /* length of current match */ + int best_len = prev_length; /* best match length so far */ + IPos limit = strstart > (IPos)MAX_DIST ? strstart - (IPos)MAX_DIST : NIL; + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + +/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ +#if HASH_BITS < 8 || MAX_MATCH != 258 + error: Code too clever +#endif + +#ifdef UNALIGNED_OK + /* Compare two bytes at a time. Note: this is not always beneficial. + * Try with and without -DUNALIGNED_OK to check. + */ + register uch far *strend = window + strstart + MAX_MATCH - 1; + register ush scan_start = *(ush far *)scan; + register ush scan_end = *(ush far *)(scan+best_len-1); +#else + register uch far *strend = window + strstart + MAX_MATCH; + register uch scan_end1 = scan[best_len-1]; + register uch scan_end = scan[best_len]; +#endif + + /* Do not waste too much time if we already have a good match: */ + if (prev_length >= good_match) { + chain_length >>= 2; + } + + Assert(strstart <= window_size-MIN_LOOKAHEAD, "insufficient lookahead"); + + do { + Assert(cur_match < strstart, "no future"); + match = window + cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2: + */ +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) + /* This code assumes sizeof(unsigned short) == 2. Do not use + * UNALIGNED_OK if your compiler uses a different size. + */ + if (*(ush far *)(match+best_len-1) != scan_end || + *(ush far *)match != scan_start) continue; + + /* It is not necessary to compare scan[2] and match[2] since they are + * always equal when the other bytes match, given that the hash keys + * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at + * strstart+3, +5, ... up to strstart+257. We check for insufficient + * lookahead only every 4th comparison; the 128th check will be made + * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * necessary to put more guard bytes at the end of the window, or + * to check more often for insufficient lookahead. + */ + scan++, match++; + do { + } while (*(ush far *)(scan+=2) == *(ush far *)(match+=2) && + *(ush far *)(scan+=2) == *(ush far *)(match+=2) && + *(ush far *)(scan+=2) == *(ush far *)(match+=2) && + *(ush far *)(scan+=2) == *(ush far *)(match+=2) && + scan < strend); + /* The funny "do {}" generates better code on most compilers */ + + /* Here, scan <= window+strstart+257 */ + Assert(scan <= window+(unsigned)(window_size-1), "wild scan"); + if (*scan == *match) scan++; + + len = (MAX_MATCH - 1) - (int)(strend-scan); + scan = strend - (MAX_MATCH-1); + +#else /* UNALIGNED_OK */ + + if (match[best_len] != scan_end || + match[best_len-1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match++; + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= window+(unsigned)(window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + +#endif /* UNALIGNED_OK */ + + if (len > best_len) { + match_start = cur_match; + best_len = len; + if (len >= nice_match) break; +#ifdef UNALIGNED_OK + scan_end = *(ush far *)(scan+best_len-1); +#else + scan_end1 = scan[best_len-1]; + scan_end = scan[best_len]; +#endif + } + } while ((cur_match = prev[cur_match & WMASK]) > limit + && --chain_length != 0); + + return best_len; +} +//#endif /* ASMV */ + +#ifdef DEBUG +/* =========================================================================== + * Check that the match at match_start is indeed a match. + */ +local void check_match(start, match, length) + IPos start, match; + int length; +{ + /* check that the match is indeed a match */ + if (memcmp((char*)window + match, + (char*)window + start, length) != EQUAL) { + fprintf(stderr, + " start %d, match %d, length %d\n", + start, match, length); + error("invalid match"); + } + if (verbose > 1) { + fprintf(stderr,"\\[%d,%d]", start-match, length); +#ifndef WINDLL + do { putc(window[start++], stderr); } while (--length != 0); +#else + do { fprintf(stdout,"%c",window[start++]); } while (--length != 0); +#endif + } +} +#else +# define check_match(start, match, length) +#endif + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead, and sets eofile if end of input file. + * + * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0 + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or eofile is set; file reads are + * performed for at least two bytes (required for the translate_eol option). + */ +local void fill_window() +{ + register unsigned n, m; + unsigned more; /* Amount of free space at the end of the window. */ + + do { + more = (unsigned)(window_size - (ulg)lookahead - (ulg)strstart); + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (more == (unsigned)EOF) { + /* Very unlikely, but possible on 16 bit machine if strstart == 0 + * and lookahead == 1 (input done one byte at time) + */ + more--; + + /* For MMAP or BIG_MEM, the whole input file is already in memory so + * we must not perform sliding. We must however call (*read_buf)() in + * order to compute the crc, update lookahead and possibly set eofile. + */ + } else if (strstart >= WSIZE+MAX_DIST && sliding) { + + /* By the IN assertion, the window is not empty so we can't confuse + * more == 0 with more == 64K on a 16 bit machine. + */ + memcpy((char*)window, (char*)window+WSIZE, (unsigned)WSIZE); + match_start -= WSIZE; + strstart -= WSIZE; /* we now have strstart >= MAX_DIST: */ + + block_start -= (long) WSIZE; + + for (n = 0; n < HASH_SIZE; n++) { + m = head[n]; + head[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL); + } + for (n = 0; n < WSIZE; n++) { + m = prev[n]; + prev[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } + more += WSIZE; +#ifndef WINDLL + if (verbose) putc('.', stderr); +#else + if (verbose) fprintf(stdout,"%c",'.'); +#endif + } + if (eofile) return; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the MMAP or BIG_MEM case (not yet supported in gzip), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = (*read_buf)((char*)window+strstart+lookahead, more); + if (n == 0 || n == (unsigned)EOF) { + eofile = 1; + } else { + lookahead += n; + } + } while (lookahead < MIN_LOOKAHEAD && !eofile); +} + +/* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ +#define FLUSH_BLOCK(eof) \ + flush_block(block_start >= 0L ? (char*)&window[(unsigned)block_start] : \ + (char*)NULL, (long)strstart - block_start, (eof)) + +/* =========================================================================== + * Processes a new input file and return its compressed length. This + * function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +local ulg deflate_fast() +{ + IPos hash_head = NIL; /* head of the hash chain */ + int flush; /* set if current block must be flushed */ + unsigned match_length = 0; /* length of best match */ + + prev_length = MIN_MATCH-1; + while (lookahead != 0) { + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ +#ifndef DEFL_UNDETERM + if (lookahead >= MIN_MATCH) +#endif + INSERT_STRING(strstart, hash_head); + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head != NIL && strstart - hash_head <= MAX_DIST) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ +#ifndef HUFFMAN_ONLY +# ifndef DEFL_UNDETERM + /* Do not look for matches beyond the end of the input. + * This is necessary to make deflate deterministic. + */ + if ((unsigned)nice_match > lookahead) nice_match = (int)lookahead; +# endif + match_length = longest_match_boinc (hash_head); + /* longest_match_boinc() sets match_start */ + if (match_length > lookahead) match_length = lookahead; +#endif + } + if (match_length >= MIN_MATCH) { + check_match(strstart, match_start, match_length); + + flush = ct_tally(strstart-match_start, match_length - MIN_MATCH); + + lookahead -= match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (match_length <= max_insert_length +#ifndef DEFL_UNDETERM + && lookahead >= MIN_MATCH +#endif + ) { + match_length--; /* string at strstart already in hash table */ + do { + strstart++; + INSERT_STRING(strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ +#ifdef DEFL_UNDETERM + /* If lookahead < MIN_MATCH these bytes are garbage, + * but it does not matter since the next lookahead bytes + * will be emitted as literals. + */ +#endif + } while (--match_length != 0); + strstart++; + } else { + strstart += match_length; + match_length = 0; + ins_h = window[strstart]; + UPDATE_HASH(ins_h, window[strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + } + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c",window[strstart])); + flush = ct_tally (0, window[strstart]); + lookahead--; + strstart++; + } + if (flush) FLUSH_BLOCK(0), block_start = strstart; + + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (lookahead < MIN_LOOKAHEAD) fill_window(); + } + return FLUSH_BLOCK(1); /* eof */ +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +ulg deflate_boinc() +{ + IPos hash_head = NIL; /* head of hash chain */ + IPos prev_match; /* previous match */ + int flush; /* set if current block must be flushed */ + int match_available = 0; /* set if previous match exists */ + register unsigned match_length = MIN_MATCH-1; /* length of best match */ +#ifdef DEBUG + extern ulg isize; /* byte length of input file, for debug only */ +#endif + + if (level <= 3) return deflate_fast(); /* optimized for speed */ + + /* Process the input block. */ + while (lookahead != 0) { + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ +#ifndef DEFL_UNDETERM + if (lookahead >= MIN_MATCH) +#endif + INSERT_STRING(strstart, hash_head); + + /* Find the longest match, discarding those <= prev_length. + */ + prev_length = match_length, prev_match = match_start; + match_length = MIN_MATCH-1; + + if (hash_head != NIL && prev_length < max_lazy_match && + strstart - hash_head <= MAX_DIST) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ +#ifndef HUFFMAN_ONLY +# ifndef DEFL_UNDETERM + /* Do not look for matches beyond the end of the input. + * This is necessary to make deflate deterministic. + */ + if ((unsigned)nice_match > lookahead) nice_match = (int)lookahead; +# endif + match_length = longest_match_boinc (hash_head); + /* longest_match_boinc() sets match_start */ + if (match_length > lookahead) match_length = lookahead; +#endif + +#ifdef FILTERED + /* Ignore matches of length <= 5 */ + if (match_length <= 5) { +#else + /* Ignore a length 3 match if it is too distant: */ + if (match_length == MIN_MATCH && strstart-match_start > TOO_FAR){ +#endif + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (prev_length >= MIN_MATCH && match_length <= prev_length) { +#ifndef DEFL_UNDETERM + unsigned max_insert = strstart + lookahead - MIN_MATCH; + +#endif + check_match(strstart-1, prev_match, prev_length); + + flush = ct_tally(strstart-1-prev_match, prev_length - MIN_MATCH); + + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. + */ + lookahead -= prev_length-1; + prev_length -= 2; +#ifndef DEFL_UNDETERM + do { + if (++strstart <= max_insert) { + INSERT_STRING(strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } + } while (--prev_length != 0); + strstart++; +#else /* DEFL_UNDETERM */ + do { + strstart++; + INSERT_STRING(strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH + * these bytes are garbage, but it does not matter since the + * next lookahead bytes will always be emitted as literals. + */ + } while (--prev_length != 0); + strstart++; +#endif /* ?DEFL_UNDETERM */ + match_available = 0; + match_length = MIN_MATCH-1; + + if (flush) FLUSH_BLOCK(0), block_start = strstart; + + } else if (match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c",window[strstart-1])); + if (ct_tally (0, window[strstart-1])) { + FLUSH_BLOCK(0), block_start = strstart; + } + strstart++; + lookahead--; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + match_available = 1; + strstart++; + lookahead--; + } + Assert(strstart <= isize && lookahead <= isize, "a bit too far"); + + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (lookahead < MIN_LOOKAHEAD) fill_window(); + } + if (match_available) ct_tally (0, window[strstart-1]); + + return FLUSH_BLOCK(1); /* eof */ +} +#endif /* !USE_ZLIB */ + +const char *BOINC_RCSID_809a8c1dab = "$Id: deflate.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/ebcdic.h boinc-7.0.14+dfsg/zip/zip/ebcdic.h --- boinc-7.0.7+dfsg/zip/zip/ebcdic.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/ebcdic.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,284 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + ebcdic.h + + The CECP 1047 (Extended de-facto EBCDIC) <-> ISO 8859-1 conversion tables, + from ftp://aix1.segi.ulg.ac.be/pub/docs/iso8859/iso8859.networking + + NOTES: + (OS/390 port 12/97) + These table no longer represent the standard mappings (for example in the + OS/390 iconv utility). In order to follow current standards I remapped + ebcdic x0a to ascii x15 and + ebcdic x85 to ascii x25 (and vice-versa) + Without these changes, newlines in auto-convert text files appeared + as literal \045. + I'm not sure what effect this remap would have on the MVS and CMS ports, so + I ifdef'd these changes. Hopefully these ifdef's can be removed when the + MVS/CMS folks test the new mappings. + + Christian Spieler , 27-Apr-1998 + The problem mentioned by Paul von Behren was already observed previously + on VM/CMS, during the preparation of the CMS&MVS port of UnZip 5.20 in + 1996. At that point, the ebcdic tables were not changed since they seemed + to be an adopted standard (to my knowledge, these tables are still used + as presented in mainfraime KERMIT). Instead, the "end-of-line" conversion + feature of Zip's and UnZip's "text-translation" mode was used to force + correct mappings between ASCII and EBCDIC newline markers. + Before interchanging the ASCII mappings of the EBCDIC control characters + "NL" 0x25 and "LF" 0x15 according to the OS/390 setting, we have to + make sure that EBCDIC 0x15 is never used as line termination. + + ---------------------------------------------------------------------------*/ + +#ifndef __ebcdic_h /* prevent multiple inclusions */ +#define __ebcdic_h + + +#ifndef ZCONST +# define ZCONST const +#endif + +#ifdef EBCDIC +#ifndef MTS /* MTS uses a slightly "special" EBCDIC code page */ + +ZCONST uch ebcdic[] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ +#ifdef OS390 + 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ +#else + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ +#endif + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ + 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, /* 58 - 5F */ + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ + 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ + 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ +#ifdef OS390 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, /* 80 - 87 */ +#else + 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ +#endif + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ + 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ + 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ + 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ + 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, /* A8 - AF */ + 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ + 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ + 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ + 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ + 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ + 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, /* D8 - DF */ + 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ + 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ + 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ + 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ +}; + +#if (defined(ZIP) || CRYPT) +ZCONST uch ascii[] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ + 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ +#ifdef OS390 + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, /* 10 - 17 */ +#else + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ +#endif + 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ +#ifdef OS390 + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, /* 20 - 27 */ +#else + 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ +#endif + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ + 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ + 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ + 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ + 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ + 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E, /* 58 - 5F */ + 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ + 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ + 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ + 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ + 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ + 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ + 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ + 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ + 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ + 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0x5B, 0xDE, 0xAE, /* A8 - AF */ + 0xAC, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ + 0xBD, 0xBE, 0xDD, 0xA8, 0xAF, 0x5D, 0xB4, 0xD7, /* B8 - BF */ + 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ + 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ + 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ + 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ + 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ + 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ + 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ +}; +#endif /* ZIP || CRYPT */ + +#else /* MTS */ + +/* + * This is the MTS ASCII->EBCDIC translation table. It provides a 1-1 + * translation from ISO 8859/1 8-bit ASCII to IBM Code Page 37 EBCDIC. + */ + +ZCONST uch ebcdic[] = { + 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ + 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ + 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ + 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ + 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ + 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ + 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ + 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ + 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ + 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ + 0xE7, 0xE8, 0xE9, 0xBA, 0xE0, 0xBB, 0xB0, 0x6D, /* 58 - 5F */ + 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ + 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ + 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ + 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ + 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ + 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ + 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ + 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ + 0xBD, 0xB4, 0x9A, 0x8A, 0x5F, 0xCA, 0xAF, 0xBC, /* A8 - AF */ + 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ + 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ + 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ + 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ + 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ + 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xAD, 0xAE, 0x59, /* D8 - DF */ + 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ + 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ + 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ + 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ +}; + +#if (defined(ZIP) || CRYPT) +ZCONST uch ascii[] = { + 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ + 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ + 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ + 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ + 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ + 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ + 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ + 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ + 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAC, /* 58 - 5F */ + 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ + 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ + 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ + 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ + 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ + 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ + 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ + 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ + 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ + 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0xDD, 0xDE, 0xAE, /* A8 - AF */ + 0x5E, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ + 0xBD, 0xBE, 0x5B, 0x5D, 0xAF, 0xA8, 0xB4, 0xD7, /* B8 - BF */ + 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ + 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ + 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ + 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ + 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ + 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ + 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ +}; +#endif /* ZIP || CRYPT */ + +#endif /* ?MTS */ +#endif /* EBCDIC */ + +/*--------------------------------------------------------------------------- + + The following conversion tables translate between IBM PC CP 850 + (OEM codepage) and the "Western Europe & America" Windows codepage 1252. + The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage, + with some additional printable characters in the range (0x80 - 0x9F), + that is reserved to control codes in the ISO 8859-1 character table. + + The ISO <--> OEM conversion tables were constructed with the help + of the WIN32 (Win16?) API's OemToAnsi() and AnsiToOem() conversion + functions and have been checked against the CP850 and LATIN1 tables + provided in the MS-Kermit 3.14 distribution. + + ---------------------------------------------------------------------------*/ + +#ifdef IZ_ISO2OEM_ARRAY +ZCONST uch Far iso2oem[] = { + 0x3F, 0x3F, 0x27, 0x9F, 0x22, 0x2E, 0xC5, 0xCE, /* 80 - 87 */ + 0x5E, 0x25, 0x53, 0x3C, 0x4F, 0x3F, 0x3F, 0x3F, /* 88 - 8F */ + 0x3F, 0x27, 0x27, 0x22, 0x22, 0x07, 0x2D, 0x2D, /* 90 - 97 */ + 0x7E, 0x54, 0x73, 0x3E, 0x6F, 0x3F, 0x3F, 0x59, /* 98 - 9F */ + 0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* A0 - A7 */ + 0xF9, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE, /* A8 - AF */ + 0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* B0 - B7 */ + 0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8, /* B8 - BF */ + 0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* C0 - C7 */ + 0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* C8 - CF */ + 0xD1, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* D0 - D7 */ + 0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* D8 - DF */ + 0x85, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* E0 - E7 */ + 0x8A, 0x82, 0x88, 0x89, 0x8D, 0xA1, 0x8C, 0x8B, /* E8 - EF */ + 0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* F0 - F7 */ + 0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98 /* F8 - FF */ +}; +#endif /* IZ_ISO2OEM_ARRAY */ + +#ifdef IZ_OEM2ISO_ARRAY +ZCONST uch Far oem2iso[] = { + 0xC7, 0xFC, 0xE9, 0xE2, 0xE4, 0xE0, 0xE5, 0xE7, /* 80 - 87 */ + 0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5, /* 88 - 8F */ + 0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9, /* 90 - 97 */ + 0xFF, 0xD6, 0xDC, 0xF8, 0xA3, 0xD8, 0xD7, 0x83, /* 98 - 9F */ + 0xE1, 0xED, 0xF3, 0xFA, 0xF1, 0xD1, 0xAA, 0xBA, /* A0 - A7 */ + 0xBF, 0xAE, 0xAC, 0xBD, 0xBC, 0xA1, 0xAB, 0xBB, /* A8 - AF */ + 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xC1, 0xC2, 0xC0, /* B0 - B7 */ + 0xA9, 0xA6, 0xA6, 0x2B, 0x2B, 0xA2, 0xA5, 0x2B, /* B8 - BF */ + 0x2B, 0x2D, 0x2D, 0x2B, 0x2D, 0x2B, 0xE3, 0xC3, /* C0 - C7 */ + 0x2B, 0x2B, 0x2D, 0x2D, 0xA6, 0x2D, 0x2B, 0xA4, /* C8 - CF */ + 0xF0, 0xD0, 0xCA, 0xCB, 0xC8, 0x69, 0xCD, 0xCE, /* D0 - D7 */ + 0xCF, 0x2B, 0x2B, 0xA6, 0x5F, 0xA6, 0xCC, 0xAF, /* D8 - DF */ + 0xD3, 0xDF, 0xD4, 0xD2, 0xF5, 0xD5, 0xB5, 0xFE, /* E0 - E7 */ + 0xDE, 0xDA, 0xDB, 0xD9, 0xFD, 0xDD, 0xAF, 0xB4, /* E8 - EF */ + 0xAD, 0xB1, 0x3D, 0xBE, 0xB6, 0xA7, 0xF7, 0xB8, /* F0 - F7 */ + 0xB0, 0xA8, 0xB7, 0xB9, 0xB3, 0xB2, 0xA6, 0xA0 /* F8 - FF */ +}; +#endif /* IZ_OEM2ISO_ARRAY */ + +#if defined(THEOS) || defined(THEOS_SUPPORT) +# include "theos/charconv.h" +#endif + +#endif /* __ebcdic_h */ diff -Nru boinc-7.0.7+dfsg/zip/zip/INSTALL boinc-7.0.14+dfsg/zip/zip/INSTALL --- boinc-7.0.7+dfsg/zip/zip/INSTALL 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/INSTALL 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,181 @@ +HOW TO INSTALL ZIP + + Zip is distributed as C source code that can be compiled on a + wide range of systems: Unix, VMS, MSDOS, OS/2, NT, Amiga, Atari, + BeOS, VM/CMS, ... You will need Unzip 5.0p1 (under any system) or + PKUNZIP 2.04g or later (under MSDOS) to unpack the distribution + file, zip23.zip. But since you read this, you have unpacked it + already, or you cheated and got a tar.Z file... + +Installation on Unix + + Let's assume that you start from scratch and have not yet + unpacked the sources. First, unpack the source as follows, + assuming that you have zip23.zip in the current directory. + + mkdir zipsrc + cd zipsrc + unzip ../zip23 + + This extracts all source files and documentation in the + directory called "zipsrc". If you wish to build a version + of zip with encryption capabilities, you must also get the + separate package zcrypt28.zip and overwrite the dummy files + crypt.c and crypt.h. + + You then do: + + make -f unix/Makefile system + + where "system" is one of: generic, generic_gcc, + att6300, coherent, cray_v3, minix, sco_x286, xenix, zilog. + + Try "make -f unix/Makefile generic" first, this works on many systems. + If this fails, then use one of the special targets given above. + + Among other special systems are Cray Unicos, Zilog Zeus and MINIX. + + If you get error messages "constant expected" in deflate.c, add + -DDYN_ALLOC to CFLAGS in your makefile entry. + + If you have lots of memory, try compiling with -DBIG_MEM. If your + system supports mmap(), try compiling with -DMMAP. This generally + gives faster compression but uses more memory. See the unix/Makefile + entry mmap_gcc for an example. + + If none of these compiles, links, and functions properly on + your Unix system, see the file README for how to get help. + + If the appropriate system was selected, then the executables + zip, zipnote and zipsplit will be created. You can copy them + to an appropriate directory in the search path using: + + make -f unix/Makefile install + + The defaults are /usr/local/bin for the executables and + /usr/local/man/man1 for the manual page. Change the macros + BINDIR and MANDIR in makefile if appropriate. + + You can use the command "set" to see the current search + path. If you are using the C-Shell (csh), enter the com- + mand: + + rehash + + so csh can find the new command in the path. You are now + ready to use Zip. + + You can get rid of the now unnecessary source and object + files with: + + cd .. + rm -r zipsrc + + This will remove the directory zip and its contents created + by unzip. You should keep the zip20.zip file around though, + in case you need to build it again or want to give it to a + colleague. + + You can add the following lines to the file /etc/magic for + usage by the 'file' command: + +0 string PK Zip archive +>4 byte 011 (at least v0.9 to extract) +>4 byte 012 (at least v1.0 to extract) +>4 byte 013 (at least v1.1 to extract) +>4 byte 024 (at least v2.0 to extract) +>4 byte 025 (at least v2.1 to extract) + + +Installation on other systems + + The steps for installation under VMS, MSDOS, OS/2, NT, Amiga and + Atari are similar to the above: first unzip the distribution + files into their own directory. The system dependant files are + stored in special subdirectories. + + For all the non-unix ports which support the creation of "UT" extra + fields (these ports contain USE_EF_UT_TIME in the list of optional + features displayed with "zip -v"), the timezone environment variable TZ + should be set according to the local timezone in order for the -f, + -u and -o options to work correctly. + + MSDOS: + + Do one of: + + make msdos\makefile.msc (Microsoft C 5.1) + nmake -f msdos\makefile.msc (Microsoft C 6.0 and newer) + make -fmsdos\makefile.bor -DCC_REV=1 (Borland Turbo C++ 1.0) + make -fmsdos\makefile.bor (Borland C++ 2.0 and newer) + make -fmsdos\makefile.tc (Borland Turbo C 2.0) + make -f msdos/makefile.dj1 (DJGPP v1.12m4) + make -f msdos/makefile.dj2 (DJGPP v2.01 and newer) + make -f msdos/makefile.emx (gcc/emx 0.9b and newer) + make -f os2/makefile.os2 gccdos (gcc/emx 0.9b and newer) + wmake -f msdos\makefile.wat (Watcom C 11.x 16-bit) + wmake -f msdos\makefile.wat PM=1 (Watcom C 11.x 32-bit, PMODE/W) + + + for Microsoft, Borland C++ and Turbo C, Watcom C/C++ and the various + free GNU C implementations, respectively. More detailed instructions + can be found in the respective makefiles. + + + WIN32 (Windows NT and Windows 95): + + Supported compilers are Microsoft Visual C++, Watcom C/C++ and + the free GNU C implementation gcc/emx+rsxnt. The makefiles supplied + in the win32/ subdirectory contain further information. + + + Windows DLL (Windows 3.1 16-bit and WIN32): + + Supported environments are Visual C++ 5.x (32-bit only) and + Borland C++ (4.52, and newer). For instructions how to build + the DLLs and where find the makefiles, look into windll/contents. + + + OS/2: + + Type + + {make} -f os2/makefile.os2 + + to get a list of supported targets/compiling environments. + (replace "{make}" with the name of your OS/2 make utility.) + + To initiate the actual compiling process, you have to specify + a system target: + + {make} -f os2/makefile.os2 {system} + + An example: type + + nmake -f os2/makefile.os2 msc + + for Microsoft C 6.00. + + + VMS (OpenVMS): + + Apply + + @[.vms]make_zip + + or use DEC's MMS make utility (or the MMK clone) if available: + + mms /descr=[.vms]descrip.mms /macro=(__ALPHA__=1) for Alpha AXP + mms /descr=[.vms]descrip.mms /macro=(__DECC__=1) for DEC C on VAX + mms /descr=[.vms]descrip.mms /macro=(__VAXC__=1) for VAX C + mms /descr=[.vms]descrip.mms /macro=(__GNUC__=1) for GNU C on VAX + + (If you have installed both DEC C and VAX C on your VAX and want to use + the latter compiler, you should define the macro "__FORCE_VAXC__" + instead of "__VAXC__".) + + For further information please consult 00readme.txt in the vms/ + subdirectory. + +For command help on any of the zip* utilities, simply enter +the name with no arguments. diff -Nru boinc-7.0.7+dfsg/zip/zip/LICENSE boinc-7.0.14+dfsg/zip/zip/LICENSE --- boinc-7.0.7+dfsg/zip/zip/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/LICENSE 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,49 @@ +This is version 1999-Oct-05 of the Info-ZIP copyright and license. +The definitive version of this document should be available at +ftp://ftp.cdrom.com/pub/infozip/license.html indefinitely. + + +Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + +For the purposes of this copyright and license, "Info-ZIP" is defined as +the following set of individuals: + + Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, + Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, + Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, + Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, + Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, + Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, + Paul von Behren, Rich Wales, Mike White + +This software is provided "as is," without warranty of any kind, express +or implied. In no event shall Info-ZIP or its contributors be held liable +for any direct, indirect, incidental, special or consequential damages +arising out of the use of or inability to use this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. Redistributions of source code must retain the above copyright notice, + definition, disclaimer, and this list of conditions. + + 2. Redistributions in binary form must reproduce the above copyright + notice, definition, disclaimer, and this list of conditions in + documentation and/or other materials provided with the distribution. + + 3. Altered versions--including, but not limited to, ports to new operating + systems, existing ports with new graphical interfaces, and dynamic, + shared, or static library versions--must be plainly marked as such + and must not be misrepresented as being the original source. Such + altered versions also must not be misrepresented as being Info-ZIP + releases--including, but not limited to, labeling of the altered + versions with the names "Info-ZIP" (or any variation thereof, including, + but not limited to, different capitalizations), "Pocket UnZip," "WiZ" + or "MacZip" without the explicit permission of Info-ZIP. Such altered + versions are further prohibited from misrepresentative use of the + Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). + + 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," + "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and + binary releases. diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/Contents boinc-7.0.14+dfsg/zip/zip/macos/Contents --- boinc-7.0.7+dfsg/zip/zip/macos/Contents 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/Contents 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,63 @@ +Contents of the "macos" sub-archive for Zip 2.3 and later: + + +MacOS: + + Contents this file + readme.1st Instruction to unpack mac specific files + README.TXT Dirk Haase's infos on updated MacIntosh ports of Zip/UnZip + HISTORY.TXT Dirk Haase's MacOS specific ChangeLog + + zipup.h MacOS + osdep.h MacOS specific configuration and declarations + + ZipLib.h used to build a static library, global to the project + ZipSx.h used to build a standalone App with MW Sioux, global + to the project + ZpPrj.hqx Metrowerks CodeWarrior pro3 project file (BinHex) + + + source/ subdirectory containing all sources: + a) Zip specific code + extrafld.c contains all code related to the mac extra field + extrafld.h + macglob.h + macopen.c replaces fopen() and open() + macopen.h + macos.c Macintosh-specific routines for use with Info-ZIP's Zip + MatWild.c Pattern matching function + recurse.c Functions to go through the directories + recurse.h + unixlike.c This file provides a unix like file-stat routine + unixlike.h + VolWarn.h contains the warning message, about volumes with the + same name + zip_rc.hqx resource file for Macintosh unzip (BinHex) + + + b) general utilities shared between Zip and UnZip + charmap.h character mapping tables ISO 8859-1 <--> MacRoman + helpers.c some helper functions + helpers.h + macstuff.c Mac filemanager routines copied from MoreFiles 1.4.8 + macstuff.h + mactime.c replacement for broken Metrowerks RTL time functions + pathname.c functions for handling MacOS HFS path- /filenames + pathname.h + +The new ZpPrj.hqx project file should be "un-BinHex'ed" into ZpPrj, +which builds the following targets: + - Zip Lib (68K) -> static library 68k + - Zip Lib (PPC) -> static library PPC + - Zip Sioux (68K) -> MW Sioux standalone App, good for debugging + - Zip Sioux (PPC) -> MW Sioux standalone App, good for debugging + + +The resource files and the compiler project files are in BinHex form because +they contain Macintosh resource forks. The resource info cannot be +maintained when handling (e.g. repacking) the master source collection on +non-Macintosh systems. The BinHex form is the traditional way for +transferring such files via non-Macintosh systems. +It's also the safest since it uses only printable characters. The ".hqx" +files must be converted with StuffitExpander or BinHex 4.0 (or equivalent) +on a Macintosh system before using them. diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/HISTORY.TXT boinc-7.0.14+dfsg/zip/zip/macos/HISTORY.TXT --- boinc-7.0.7+dfsg/zip/zip/macos/HISTORY.TXT 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/HISTORY.TXT 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,489 @@ +Macintosh Port of Info-ZIP's Zip +By Dirk Haase, d_haase@sitec.net +Home page: www.sitec.net/maczip +Mirror page: +www.haase-online.de/dirk/maczip +================================ + + + + +Release MacZip ver1.04 beta 2 +02. June 1999 +-------------- + +1) FIX: {unzip} added one more criteria to make the recognition + of macbinary more save. + +2) FIX: {unzip} sometimes, archive entries without any extra field + caused problems; the default setting of the extra field + was not set back to 'unknown' properly. + +3) FIX: {zip} Archive filename with invalid characters like '/' gets + renamed. However, I do not check the complete path - needs + some more work here. + +4) FIX: {zip} Filename match was case sensitive. + +6) CHG: {zip) switch to latest source level + unzip 2.30m beta release + +7) CHG: {unzip) switch to latest source level + unzip 5.41b beta release + +8) FIX: {zip/unzip 68k only) I have found a wrong compiler setting + for the 68k version. Because of this wrong setting the 68k + version crashed. + + + + +Release MacZip ver1.04 beta 1 +30. March 1999 +-------------- + +1) CHG: {unzip) switch to latest source level + unzip 5.41a beta release + +2) ADD: {all} Added message logging support for Syslogd + by Brian Bergstrand. Syslogd can be found at + http://www.classicalguitar.net/brian/apps/syslogd/ + This feature is 'under construction'. + +3) FIX: {all} many small fixes and code cleanups + + + + +Release MacZip ver1.03 +27. March 1999 +-------------- + +1) CHG: {console} Like Stuffit Expander MacZip quits automatically when + used with drag'n drop or as Helper App (Web-Browser). + +2) CHG: {console} Since Macintosh users are used to be guided by their + software in order not to do something stupid, I added a check + to post an extra warning if the options -m and data fork only + are both checked. + This behavior can be disabled: See Applescript example and + "maczip.env". + +3) CHG: {zip} switch from immediate deletion to moving to the + trash. Immediate deletion is now an option in "maczip.env". + +4) CHG: {zip} enhanced progress display. + +5) CHG: {zip) switch to latest source level + zip 2.3l beta release + +6) CHG: {unzip} The zip archive contains file names greater than + 31 characters. When MacZip tries to unzip the file, the + FSpCreate command fails because the filename length is to + long. MacZip correct this problem by trying to truncate + the file names to the 31 character limit. + +7) FIX: {zip/console} A couple of minor fixes + +8) CHG: {zip} Switched file-globbing to the Info-ZIP version. + + + + +Release MacZip ver1.02 +14. February 1999 +----------------- + +1) CHG: {zip} Changed the rule of file inclusion if switch '-X' + is set. Following conditions are checked: + a) if length of resource-fork is equal zero *and* the + length of data-fork is equal zero include the file. + b) if length of resource-fork greater zero *and* the + length of data-fork is equal zero don't include the file. + c) if length of data-fork greater zero include the file. + +2) CHG: {Console} Some users are very confused by the buttons "START PATH" + and "ZIP ARCHIVE". Somehow, it wasn't clear what the intended + meaning was. I changed the buttons to more clear labels on + them like: "file or folder to compress" and "location of + compressed file" + +3) CHG: {Console} I changed the menu structure to be more intuitive. + +4) FIX: {Console} Found a nasty bug which sometimes caused crashes + when the Zip / Unzip Dialogbox was used. + +5) CHG: {Console} Handling of file dialog is now a bit more restricted: + e.g: it's not possible to select a file if you have to select + a folder. + + + + +Release MacZip ver1.01 +30. January 1999 +---------------------- + +1) CHG: {console} The use of the "Current App" mechanism was clumsy + and forces the user into the Zip or Unzip modes. This kind + of modality is not so good for the command line. It's now + neccessary to enter zip or unzip to choose the action. + +2) FIX: {console} When Applescript sends quit to MacZip the script + that is running shows a spinning cursor and MacZip + does not quit. + +3) FIX: {console} MacZip gots accidentally the wrong creator code + (from BBedit) + + + + +Final Release MacZip ver1.0 +--------------------------- + +Released 21. January 1999 + + + + +9. Beta release 06.December.1998 +--------------------------------- + +1) CHG: {console} The checkbox of Filedialog (for extract path and file path) + "Show all files" is now selected by default. + +2) CHG: {unzip/standalone} changed prototypes of mac[f]printf() to return + an int number (better ANSI conformance); + +3) FIX: {unzip} repaired "stdout/stderr" mode of macwrite(). So func + MacMessagePrnt() is now obsolete and removed. + +4) ADD: {zip/unzip} Compressed Mac3 extra-fields are now supported + (Thanks to Christian Spieler) + +5) ADD: {unzip} Extraction of ZipIt archive are now supported. This support + is not complete: Filenames are correct but folder names are only + restored with the public directory names. + +6) ADD: {zip/unzip} Improved documentation. + +7) FIX: {unzip} Function isZipfile() is completely rewritten. + +8) CHG: {zip/unzip) switch to latest source level + zip 2.3i beta and unzip 5.4 final release + +9) ADD: Applescript event "do_cmd". + +Unless there are big bugs found, this release will be the last +beta release. The final release will come out in January 1999. + + + + +8. Beta release 20.November.1998 +--------------------------------- + +1) CHG: {zip/unzip) switch to latest source level + zip 2.3h beta and unzip 5.4 final release + +2) ADD: {zip} Zip finds "namelocked" files also, if switch "-S" + is set. + +3) FIX: {unzip} Function isZipfile() fails if the zip archive + has a comment. + +4) CHG: {zip} added some small speed improvements to pattern matching and + isZipFile() function. + +5) FIX: {unzip} Display of comments is fixed. + UzpMessagePrnt() is replaced by MacMessagePrnt(). I do not care + about ansi-bombs. I'm not sure, so this fix may be changed later. + +6) RMV: {unzip} Buildin More capability is removed since it's already built + into the GUI-App. + + + +7. Beta release 09.November.1998 +--------------------------------- + +1) CHG: {all} switched to Metrowerks Codewarrior Pro 4 + +2) FIX: {unzip} Display of comments stored in the zip-file is + now fixed + +3) FIX: {zip} Fixed display of the zip help-screen. + +4) CHG: {zip/unzip} Changed special dir 'Re$0urce.Fk' to 'XtraStuf.mac' + (see entry at 13.June.1998 item 3). I found it more descriptive for + users outside the mac-community. + +5) CHG: {all} switched to MoreFiles 1.4.9. + +6) CHG: {console} changed behaivor of the file open dialog: The select + button is now always enabled. + +7) ADD: {all} Environment variables are now supported. + Basically, it is possible to add timezone (= TZ environment variable) + support here, but it's not yet implemented. + See "MacZip.Env" for further info. + +8) RMV: {console} Targets "zip only" and "unzip only" are removed. + + + +6. Beta release 09.September.1998 +--------------------------------- + + +1) CHG: {Zip/Unzip} Metrowerks Standardlibrary time funktions are + rather broken and incomplete so I was forced to rewrite the + funktions: mktime(), localtime(), gmtime() and time(). + +2) ADD: {Console} Added Pause Funktion for screen output. + The Pause-Function is selfadjusting: Count of lines is depending + on the window size. + +3) CHG: Extra-Field layout is changed: All datas are now in little-endian + format (see appnote) + +4) ADD: {Console} Added an option to test the archive automatically + after zipping. This option is only via Zip-Dialogbox available + because it needs the unzip-module also. + +5) CHG: {Zip} code is now up to date with the latest beta 2.3f. + +6) ADD: {Console} Added (drag'n) drop support. Drop on the MacZip icon. + The following situations are supported: + 1. drop of one or more zipfiles (action = unzip) + each archive will be extracted in a separate folder + 2. drop of a folder (action = zip -r ) + The complete folder (inclusive sub-folders) + will be zipped + Not (yet) supported is currently: dropping more than one file + to compress. Workaround: Put all your files in one folder and + drop that folder on MacZip. + MacZip recognize zip-archives automatically. + + +5. Beta release 21.Aug.1998 +---------------------------- + + +1) ADD: {Console} Userinterface has now a Statusbar to show the + Progress. + +2) ADD: {Console} It's now possible to stop the run of Zip/Unzip + with the well known shortcut [Command] + [.] + +3) CHG: {Console} Improved user-entry routine. + +4) ADD: {Zip/Unzip} Crypt-code added. It's now possible to + encrypt/decrypt archives. + +5) RMV: {Unzip} Removed the warning of PKZip/Mac archive. + Unzip gets confused with the extra field of PKZip/Mac. So I assume + the extra field isn't compatible with Info-ZIP's definition. + +6) CHG: switched to Metrowerks Codewarrior Pro 3 + this includes: + - new Universal Interfaces 3.1 Headers + - improved codegeneration + +7) CHG: {Zip} code is now up to date with the latest beta 2.3e. + +8) CHG: {Unzip} changed function names wprintf, wgets .. to macprintf, macgets .. + to avoid naming conflict standart library. + +9) ADD: {Zip/Unzip} FXinfo, Mac-Pathname, file-dates and Finder-Comments + are now stored in the extra-field. Extra-field layout is + changed accordingly. Unzip uses now the filename stored in the + extra-field when unzipping. + +10) CHG: {Unzip} code is now up to date with the latest beta 5.33g. + +11) CHG: {Unzip} code is (again) up to date with the latest beta 5.33h. + +12) ADD: {Unzip} following switches were added: + -J [MacOS only] ignore mac extra info. All macintosh + info are not restored. Datafork and resource-fork + are restored separatly. + + -i [MacOS only] ignore filenames stored in mac extra + field. Use the most compatible filename stored in + the public field. + + -E [MacOS only] show mac extra field during restoring + +13) ADD: {Zip/Unzip} Charset MacRoman to ISO8859 Latin and vice versa + +14) RMV: {Zip} -N option removed. This MacZip crashes using this option. + I will fix it later. + + +I think I'm very close for a final release of "MacZip 1.0" :-) + + + +4. Beta release 27.June.1998 +---------------------------- + +26.June.1998 +------------ + +1) FIX: {Zip} extra field size value was wrong. + + + +25.June.1998 +------------ + +1) CHG: {Zip} code is now up to date with the latest beta 2.3d. + So both modules, zip & unzip, uses now latest beta. + +2) ADD: {Zip} added a UT extra-field for better compatibility. + +3) CHG: {Unzip} changed the code to find the mac extra-field. + Unzip has to look for a mac extra-field because + mac-archives has now two extra-fields (UT + M3). + +4) CHG: {Unzip} changed the method to move extra-field data to + the internal extra-structure. + Old method was just BlockMove of the ef_structptr to ef_memptr. + This method was dangerous because not all members of the + structure seamless aligned. There are may be some fill + bytes in the structure depending on the compiler setting. + +5) ADD: {Unzip} added a warning if unzipping a ZipIt/PKZip archive. + ZipIt/PKZip archives are usually additionally coded somehow. + InfoZip's Unzip will *not* decode the files. So extracted + files are may be not decoded. (see also 6. and 7.) + +6) ADD: ZipIt (the Shareware Tool) has now a new extra-field signature: + 0x2705. Found in "ZipIt 1.3.8". I added a new macro: EF_ZIPIT2 + +7) ADD: Added PKWare's extra-field signature: 0xCF77. + Found in "PKZIP v2.03". I added a new macro: EF_PKMAC + +8) ADD: {console} It's now possible to save all screen outputs + to the disk. + +9) RMV: {console} this is the first beta without expire-date. + + +16.June.1998 +------------ + +1) FIX: {Unzip/console} Extract path now defaults to current-dir if + no path is given. + +2> CHG: {Unzip} creates now a extract-folder by default. This behavior + differs to the commandline tool of Unzip on other platforms. + However, for a mac-user is this behavior more convenient. + + +3. Beta release 15.June.1998 +---------------------------- + +15.June.1998 +------------ + +1) CHG: {unzip/zip} I changed the layout of the extra field + to support more data. + + +14.June.1998 +------------ + +1) FIX: {Unzip} adjusted time_t value with an correct offset value. + +2) FIX: {Unzip} removed all unused code based on unfinished ideas by + former porter(s). + +3) CHG: use of shared code izshr 032. + +13.June.1998 +------------ + +1) FIX: {Unzip} Filenames are only converted when needed. When zipping + with the switch 'datafork only' the filenames are shorted which + was wrong. + +2) CHG: {Unzip} code is now up to date with the latest beta 5.33f. + +3) CHG: {Zip} Changed the naming rule of filenames from old Johnny Lee's + to my implementation. Johnny Lee's idea is based on change of the + filenames which cases several problems when unziping on a non mac + plattform. My idea is to add a special directory: 'Re$0urce.Fk'. + For the future: Zip will create archives according the new nameing + rule. However unzip will be compatible with old nameing rule. + See also 4. + +4} ADD: {Unzip} Added a new nameing rule for resource forks filename. + Resource forks are now stored in a special directory: 'Re$0urce.Fk'. + This naming rule make it easier to for other platforms to use + mac zip-files. + + + +11.June.1998 +------------ +1) FIX: {Zip} Internal file attribute is set to BINARY by default + when zipping resource forks otherwise Unzip will create + sometimes wrong resource-forks. + +2) CHG: {Unzip} code is now up to date with the latest beta 5.33e. + + + + +2. Beta release 10.June.1998 +-------------------------- + +1) FIX: {Unzip} Long pathname fix solved. Unzip is now able to extract + archives with path longer than 256 chars. + +2) CHG: {Unzip} removed all conversion from c-style string to + pascal-string (see fix 1) + +3) ADD: {Unzip} Finderinfo of folders are also restored. + +4) ADD: {Console} Added info about current path in the command-line box. + +5) FIX: {Console} Construction of the command-line of the unzip-dialog + box fixed. + + + +First beta release 06.June.1998 +----------------------------- + +no history. +Just to many code was neccessary to build the first mac-port. + + +Start of the port MacZip +February 1998 + + +-------------------------------------------------------------------------------- +Legende: + +FIX: fixes a bug +CHG: inform about changed items. +ADD: added feature +RMV: removed Item + +{Unzip} -> only related to the Unzip-module +{Zip} -> only related to the Zip-module + These are just libraries and are linked into the console-app. + +{Console} -> only related to the Userinterface (not SIOUX) + MacOS has no tool like a command-line. So it's neccessary + to write wrapper around the command-line tools. + + + + +Dirk Haase diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/osdep.h boinc-7.0.14+dfsg/zip/zip/macos/osdep.h --- boinc-7.0.7+dfsg/zip/zip/macos/osdep.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/osdep.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,118 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef __MACOS_OSDEP_H +#define __MACOS_OSDEP_H 1 + +#ifndef MACOS +# define MACOS +#endif + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "unixlike.h" +#include "macglob.h" + +#define NO_MKTEMP 1 +#define PASSWD_FROM_STDIN 1 +#define NO_SYMLINK 1 + +#define USE_ZIPMAIN 1 + +#define USE_CASE_MAP 1 /* case_map is used to ignore case in comparisons */ + + + + +/* +#define DEBUG_TIME + */ + +#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) +# define USE_EF_UT_TIME +#endif + +#undef IZ_CHECK_TZ + +#ifndef ZP_NEED_MEMCOMPR +# define ZP_NEED_MEMCOMPR +#endif + + +#define EXDEV 18 + +#define PATHCUT ':' + + +/* file operations use "b" for binary */ +#define FOPR "rb" +#define FOPM "r+b" +#define FOPW "wb" + +/* +#define DEBUG +*/ + +/* These functions are defined as a macro instead of a function. +so we have to undefine them for replacing (see printf.c) */ +#undef getc +#undef getchar +#undef putchar + + + +void setfiletype(char *file, unsigned long Creator, unsigned long Type); + +char *GetZipVersionsInfo(void); +char *GetZipVersionLocal(void); +char *GetZipCopyright(void); + +void InitAllVars(void); + +void PrintFileInfo(void); + + + +int fprintf(FILE *file, const char *format, ...); +int printf(const char *format, ...); +void perror(const char *parm1); +int macgetch(void); + + +int MacOpen(const char *path,int oflag,...); +FILE *MacFopen(const char *path,const char *mode); +#define fopen(path, mode) MacFopen(path, mode) +#define open(path, oflag) MacOpen(path, oflag) + + +char *GetComment(char *filename); +int readlink(char *path, char *buf, int size); + +void PrintStatProgress(char *msg); +void InformProgress(const long progressMax, const long progressSoFar ); +void ShowCounter(Boolean reset); +void leftStatusString(char *status); + + + + +#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ + procname(n, 1)) + +#endif /* __MACOS_OSDEP_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/readme.1st boinc-7.0.14+dfsg/zip/zip/macos/readme.1st --- boinc-7.0.7+dfsg/zip/zip/macos/readme.1st 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/readme.1st 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,12 @@ +Before you start: + +Extract "*.hqx" and "source:*.hqx" first and read the Readme.txt. + +The resource file and the compiler project files are in BinHex form because +they contain Macintosh resource forks and as such can not be simply +stored a normal file on a non-Macintosh system. BinHex form is the +traditional way for transferring such files via non-Macintosh systems. +It's also the safest since it uses only printable characters. The ".hqx" +files must be converted with StuffitExpander or BinHex 4.0 (or equivalent) +on a Macintosh system before using them. + diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/README.TXT boinc-7.0.14+dfsg/zip/zip/macos/README.TXT --- boinc-7.0.7+dfsg/zip/zip/macos/README.TXT 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/README.TXT 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,560 @@ +Macintosh Port of Info-ZIP's Zip +and UnZip +By Dirk Haase, d_haase@sitec.net +Home page: www.sitec.net/maczip +Mirror page: +www.haase-online.de/dirk/maczip +================================ + + + +Abstract: +--------- +MacZip is a cross-platform compatible tool that +includes both Zip (for compression) and UnZip (for extraction). + +Zip is a compression and file packaging utility for Unix, +VMS, MSDOS, OS/2, Windows 9x, Windows NT, Atari, Macintosh, +Amiga, Acorn RISC OS, and other systems. + +UnZip unpacks zip archives. +The Zip and UnZip programs can process archives pro- +duced by PKZIP, and PKZIP and PKUNZIP can work with +archives produced by zip. Zip version 2.2 is compatible +with PKZIP 2.04. + + + +Requirements +------------ +MacZip requires at least System 7 and a Macintosh with a minimum of a +Motorola 68020 or PowerPC 601 processor. Other configurations may work +but it is not tested at all. + +The application is distributed as a fat binary with both regular 68K +and native PowerPC versions included. + + + +Installation +------------ +Move the executable(s) somewhere--for example, drag it (or them) to your +Applications folder. For easy access, make an alias in the Launcher Control +Panel or directly on your desktop. +The GUI is very simple. It was not my intention to make a full-blown GUI, +however I think it is comfortable enough to use it as regular tool. + +This port supports also Apple-event. So you can install it in your +WWW-Browser as a helper app. + +For more Info about the contents of this package, take a look into +the "macos/Contents" (or :macos:Contents) file. Some notes on how to +rebuild the Macintosh applications can be found in INSTALL. + + + +Usage: +------ + +Basically there are four ways to start MacZip: + +a) Drag'n Drop + To extract an archive, drop an archive on MacZip. + To compress files drop a file, folder or volume on MacZip. + Note: You cannot drop more than one item at the same time. + + + +b) using the Dialog box (Menu: File -> Zip/Unzip): + * Compression (Zip): + - Go to "File -> Zip"and the "Zip Options" Dialog Box appears. + - Click on "Location of the compressed File" + - The "Select an archive" dialog box appears + a) select a existing zip archive + -> Your files will be added to that zip archive. + b) select a folder and name your new zip archive + -> a new zip archive will be created with your files. + - Select one or more check boxes if you want. + see Zip.txt for more information. + - Click on "File or Folder to Compress" + - The "Select a File or Folder" dialog box appears + a) select a file + -> This file will be compressed. + b) select a folder + -> the contents of the folder will be compressed. + - Click on "Start Zip" to start the task. + + * Extraction (Unzip): + - Go to "File -> Unzip"and the "Unzip Options" Dialog Box appears. + - Click on "Location of the compressed File" + - The "Select an archive" dialog box appears + - select a existing zip archive + - Select one or more check boxes if you want. + see Unzip.txt for more information. + - Click on "Location of the extracted Files" + - The "Select a Folder" dialog box appears + a) select a file + -> This file will be compressed. + b) select a folder + -> the contents of the archive will be extracted + into this folder. + - Click on "Start Unzip" to start the task. + + + +c) Using the Command line (Menu: File->Command Line): + The Zip & UnZip tools are command line tools. So the behavior is exactly + the same like the Zip & UnZip tools on Unix or Windows/DOS. This means, + if you want to zip some files, you have to write a command line like this: + "zip [switches] path_to_zip_archive path_to_files_folders" + + - Go to "File" and select "Command Line" and the "MacZip Entry box" + Dialog Box appears. + + An example: + + a: your zip may be created at + Macintosh HD:applications:archive.zip + + b: your files may be found at + Macintosh HD:somewhere:my_folder_to_archive:* + + Note: At the end of the path there must be a filename or a wild card ! + (see Footnote: 1 wild card, 2 Mac path names) + + So the command line should look like (one line!): + + zip "Macintosh HD:applications:archive.zip" "Macintosh HD:somewhere:my_folder_to_archive:*" + + - Click on "Enter" to start the task. + + Since you can not set a default folder you have to enter always a + full qualified path names. Full-qualified path names are path names + including the Volume name ! (see Footnote: 2 Mac path names) + + + +d) Using Applescript: + +There is only one additional event defined: "do_cmd". You can enter +every valid command line. The first word must be "zip" or "unzip" to +select the action (compress or extraction). + +See sample Applescript: + + tell application "MacZip (PPC)" + activate + with timeout of 90000 seconds + do_cmd "zip -rjjN Volume:archive \"My Volume:*\" " + end timeout + end tell + +This script opens MacZip, brings it to the foreground on the Mac, starts the +zip action with the command line: zip -rjjN Volume:archive "My Volume:*" . + + + + +A short introduction is also available online: +http://www.sitec.net/maczip/How-To-Do/ + +It's possible to stop the run of Zip/Unzip with the well +known shortcut [Command] + [.]. + + +--------------------------------------------------------------------------- + +There are some Mac-specific switches available. +Zip Module: + -df [MacOS] Include only data-fork of files zipped into + the archive. Good for exporting files to foreign + operating-systems. Resource-forks will be ignored + at all. + + -jj [MacOS] record Fullpath (+ Volname). The complete + path including volume will be stored. By default + the relative path will be stored. + + -S [MSDOS, OS/2, WIN32 and ATARI] Include system and + hidden files. + [MacOS] Includes finder invisible files, which are + ignored otherwise. + +Unzip Module: + -E [MacOS only] display contents of MacOS extra field + during restore operation. + + -i [MacOS only] ignore filenames stored in MacOS extra + fields. Instead, the most compatible filename + stored in the generic part of the entry's header is + used. + + -J [MacOS only] ignore MacOS extra fields. All Macin- + tosh specific info is skipped. Data-fork and + resource-fork are restored as separate files. + + +Select [File]->[Get Help on Zip/Unzip] for a complete list +of switches. + + + +Limitations / Problems: +----------------------- + + - Aliases are not supported. I tried, but I got broken aliases + This port will silently ignore all aliases. + It's on my to-do list for future releases. + + - Zip needs much memory to compress many files: + You may need to increase the 'Preferred Size' in 'Get Info'. + Values of 12 Megabytes or more are possible + + - Unzip needs about 500 Kbytes of memory to unzip no matter + how many files were compressed and expanded. + + - and finally one big macintosh-related problem: + This port has one weak point: It's based on path names. + As you may be already know: Path names are not unique on a Mac ! + The main reason is that an attempt to implement support exact saving of + the MacOS specific internal file structures would require a throughout + rewrite of major parts of shared code, probably sacrifying compatibility + with other systems. + I have no solution at the moment. The port will just warn you if you try + zip from / to a volume which has a duplicate name. + MacZip has problems to find the archive or the files. + My (Big) recommendation: Name all your volumes with a unique name and + MacZip will run without any problem. + + +Known Bugs: + + - crypted files in a zip archive are sometimes corrupt: + I get an error message: invalid compressed data to inflate. + Appearance of this error is purely be chance: + I did a small test: Unzipping an archive containing 3589 files + 56 files fails to unzip, so about 1.5%. + Root cause is completely unclear to me :( + +I strongly recommend to test your archive (e.g. unzip -t archive). + + + + + +Zip Programs / Macintosh Extra-Data: +----------------------------------------- +A brief overview: +Currently, as far as I know, there are 4 Zip programs available +for the Macintosh platform. +These programs build (of course) different variants of Zip files: + + - Info-ZIP's first Port of Zip. Ported by Johnny Lee + This Port is rather outdated and no longer supported (since 1992). + 68K only. Only minimal Mac-info is stored (Creator/Type, + Finder attributes). Creator/Type: '????' / '????' + Until year 1998, only UnZip 5.32 survived. + + - ZipIt by Tom Brown. This is Shareware and still supported I think. + ZipIt has a nice GUI, but I found it can't handle large Zip files + quite well. ZipIt compresses Macintosh files using the Mac Binary + format. So, transferring files to other platforms is not so easy. + Only minimal Mac-info is stored (Creator/Type, Finder attributes). + Mac filenames are changed to a most compatible filename. + Creator/Type: 'ZIP ' / 'ZIP ' + + - PKZIP/mac v2.03/210d. This is Shareware. + This Zip implementation for the Mac can be found on ASI's web site + (http://www.asizip.com/products/products.htm). The name of this + program is misleading, it is NOT a product from PKWARE. ASI's last + release version is v2.03, and they also offer a newer beta version + PKZIP/mac 210d. But even the Beta version is rather outdated (1995). + Only minimal Mac-info is stored (Creator/Type, Finder attributes). + The Zipfile format looks like incompatible to other platforms. + (More details about the compatibility issue can be found in + proginfo/3rdparty.bug!). Type: 'PKz1' + Mac filenames are restored without any change. + +and finally: + - Info-ZIP's latest Port of Zip. MacZip 1.0. Ported by me :-) + It is supported (of course) and up to date. Full set of macintosh + info is stored: Creator/Type, Finder attributes, Finder comments, + MacOS 8.0 Folder settings, Icon/Folder Positions ... + Mac filenames are restored without any change. + Creator/Type: 'IZip' / 'ZIP ' + + +Compatibility of my port; Extraction: + - Archives from Info-ZIP's first port (by Johnny Lee) are still compatible. + - Extraction of ZipIt archives is supported. This support is not + complete: Filenames are correct but Directory names are sometimes mangled + to a DOS compatible form. Segmented archives are not supported. + - PKZiP/mac archive files are extracted without resource-forks + and without any Finder info. I have no information about that zip format. + +Compatibility of my port; Compression: + - My port supports only the new Info-ZIP format + (introduced with this port). Therefore archives created by MacZip 1.0 + (March 1999) must be extracted with this version or later releases + of Info-ZIP's UnZip to restore the complete set of Macintosh attributes. + +Note: This port is complete unrelated to the shareware ZipIt. Even more, +handling of special Macintosh attributes is incompatible with ZipIt. +This port (MacZip) may be used to extract archives created by ZipIt, +but make sure that you get the result as you expected. + + + +Macintosh Files; File Forks: +---------------------------- + +All Macintosh files comprise two forks, known as the data fork and the +resource fork. Unlike the bytes stored in the resource fork, the bytes in +the data fork do not have to exhibit any particular internal structure. +The application is responsible for interpreting the bytes in the data fork +in whatever manner is appropriate. The bytes in the resource fork usually +have a defined internal structure and contain data object like menus, +dialog boxes, icons and pictures. +Although all Macintosh files contain both a data fork and a resource fork, +one or both of these forks may be empty. + +MacZip stores data-forks and resource-forks separately. The Zipfile format +does not allow to store two archive entries using exactly the same name. +My solution is to modify the Path name of the resource-fork. All resource-fork +names are prepended with a leading special directory named "XtraStuf.mac". +So, when extracting on a Mac, you should never see this directory +"XtraStuf.mac" on your *disk*. + +On all foreign systems that support directories in filenames (e.g.: OS/2, Unix, +DOS/Windows, VMS) you will get a directory "XtraStuf.mac" when extracting +MacZip archives. +You can delete the complete directory "XtraStuf.mac" since Mac resources +do not make much sense outside the MacOS world. + + + +Text encoding; Charsets of the Filenames: +----------------------------------------- + +The following information is only important if you plan to transfer +archives across different platforms/language systems: + +A typical Zip archive does not support different charsets. All filenames +stored in the public area (= accessible by foreign systems other +than MacOS) must be coded in the charset ISO-8859-1 (CP1252 in the Microsoft +Windows world) or CP850 (DOSLatin1). The latter should only be used by +Zip programs that mark the archive entries as "created under DOS". +Apart from Macs, the commonly used platforms either support ISO-8859-1 +directly, or are compatible with it. +To achieve maximum compatibility, MacZip convert filenames from the +Mac OS Roman character set to ISO-8859-1 and vice versa. +But not every char of the charset MacRoman has their equivalent +in ISO-8859-1. To make the mapping in most cases possible, I chose +most similar chars or at least the MIDDLE DOT. + +Mac OS Roman character set is used for at least the following Mac OS +localizations: +U.S., British, Canadian French, French, Swiss French, +German, Swiss German, Italian, Swiss Italian, Dutch, +Swedish, Norwegian, Danish, Finnish, Spanish, Catalan, +Portuguese, Brazilian, and the default International system. + +In all Mac OS encodings, character codes 0x00-0x7F are identical to +ASCII, except that + - in Mac OS Japanese, yen sign replaces reverse solidus + - in Mac OS Arabic, Farsi, and Hebrew, some of the punctuation in this + range is treated as having strong left-right directionality, + although the corresponding Unicode characters have neutral + directionality +So, for best compatibility, confine filenames to the standard +7-bit ASCII character set. + +If you generate a filename list of your archive (unzip -l), you will +see the converted filenames. Your can also extract the archive with +the switch '-i' (= ignore mac filenames), and test your result. + +This MacZip port uses its own filename stored in the archive. +At the moment, the filename will be not converted. However, +I'm planning to add support for Unicode. + +Currently, the following Mac OS encodings are NOT supported: +Japanese, ChineseTrad, Korean, Arabic, Hebrew, Greek, Cyrillic, +Devanagari, Gurmukhi, Gujarati, Oriya, Bengali, Tamil, Telugu +Kannada, Malayalam, Sinhalese, Burmese, Khmer, Thai, Laotian, +Georgian, Armenian, ChineseSimp, Tibetan, Mongolian, Ethiopic, +Vietnamese, ExtArabic and finally: +Symbol - this is the encoding for the font named "Symbol". +Dingbats - this is the encoding for the font named "Zapf Dingbats". +If you extract an archive coded with one of these charsets +you will probably get filenames with funny characters. + +These problems apply only to filenames and NOT to the file +content. +of course: The content of the files will NEVER be converted !! + + + +File-/Creator Type: +------------- + +This port uses the creator type 'IZip' and it is registered at Apple +(since 08. March 1998). File types can not be registered any more. +This port uses 'ZIP ' for Zip archive files. +The creator 'IZip' type should be used for all future versions of +MacZip. + + + +Hints for proper restoration of file-time stamps: +------------------------------------------------- + +UnZip requires the host computer to have proper time zone information in +order to handle certain tasks correctly (see unzip.doc). To set the +time zone on the Macintosh, go to the Map Control Panel and enter the +correct number of hours (and, in a few locales, minutes) offset from +Universal Time/Greenwich Mean Time. For example, the US Pacific time zone +is -8 hours from UTC/GMT during standard (winter) time and -7 hours from +UTC/GMT during Daylight Savings Time. The US Eastern time zone is -5 hours +during the winter and -4 hours during the summer. + +Discussion of Daylight Savings Time +----------------------------------- +The setting in the Date & Time control panel for Daylight Savings time +is a universal setting. That is, it assumes everybody in the world is +observing Daylight Savings time when its check box is selected. + +If other areas of the world are not observing Daylight Savings time when +the check box is selected in the Date & Time control panel, then the Map +control panel will be off by an hour for all areas that are not recognizing +Daylight Savings time. + +Conversely, if you set the Map control panel to an area that does not observe +Daylight Savings time and deselect/uncheck the check box for Daylight Savings +time in the Date & Time control panel, then time in all areas celebrating +Daylight Savings time will be off by an hour in the Map control panel. + +Example: + In the case of Hawaiians, sometimes they are three hours + behind Pacific Standard Time (PST) and sometimes two hours + behind Pacific Daylight Time (PDT). The Map control panel + can only calculate differences between time zones relative + to Greenwich Mean Time (GMT). Hawaii will always show up as + three hours past the Pacific time zone and five hours past + the Central time zone. + + When Hawaiians are not observing Daylight Savings time, but + the rest of the country is, there is no combination of + settings in Map and Date & Time control panels which will + enable you to display Hawaiian local time correctly AND + concurrently display the correct time in other places that + do observe Daylight Savings time. + + The knowledge about which countries observe Daylight Savings + time and which do not is not built into the Map control + panel, so it does not allow for such a complex calculation. + + This same situation also occurs in other parts of the world + besides Hawaii. Phoenix, Arizona is an example of an area of + the U.S. which also does not observe Daylight Savings time. + +Conclusion: +MacZip only knows the GMT and DST offsets of the current time, not +for the time in question. + + +Projects & Packages: +-------------------- + +A Note to version numbers: Version of MacZip is currently 1.03 and +is based on the zip code version 2.3 and unzip code version 5.4. +See About Box for current version and compiler build date. + +Because of the amount of sources I splitted this port into +several projects. See http://www.sitec.net/maczip for updates. + +- core source parts: + unzxxx.zip + zipxxx.zip + These archives contains the main parts of the port. You can build + libraries and a standalone App with Metrowerks standard console SIOUX. + They contain only sources, no executables. + These archives are exact copies of the standard Info-ZIP source + distributions; they were only repackaged under MacOS using MacZip, + with one minor addition: For those files that are stored in BinHex'ed + format in the Info-ZIP reference source archives, unpacked version + that are ready for use have been added. + +- additional source part: + MacZipxxx.zip: contains all the GUI stuff and the project files to + build the main-app. Only sources of the GUI, no zip or unzip code. + To build MacZip successfully you will need to also download the zip + and unzip packages. + +- executables: + MacZipxxxnc.hqx: contains only executables and 'README.TXT', + This version is without en-/decryption support ! + MacZipxxxc.hqx: contains only executables and 'README.TXT', + This version supports en-/decryption ! + +- encryption sources: + zcryptxx.zip: To build crypt versions of MacZip. + download from ftp://ftp.icce.rug.nl/infozip/ (and subdirectories) + +- documentation: + MacZipDocu.zip: contains some further docus about the algorithm, + limits, Info-ZIP's appnote and a How-to-do Webpage. + + +Credits: +-------- + +Macstuff.c and recurse.c: All the functions are from More Files. +More Files fixes many of the broken or underfunctional +parts of the file system. Thanks to Jim Luther. +(see morefiles.doc) + + + + + + + +--------------------------------------------------------------------------- +Footnotes: + +1. wild card: + The '*' is a wild card and means 'all files' + Just in case you don't know wild cards: + '*' is a place holder for any character. + e.g.: + "this*" matches with "this_file" or "this_textfile" but it + doesn't match with "only_this_file" or "first_this_textfile" + "*this*" matches with "this_file" or "this_textfile" AND + matches with "only_this_file" or "first_this_textfile" + + +2. Mac pathnames: +The following characteristics of Macintosh pathnames should be noted: + + A full pathname never begins with a colon, but must contain at + least one colon. + A partial pathname always begins with a colon separator except in + the case where the file partial pathname is a simple file or + directory name. + Single trailing separator colons in full or partial pathnames are + ignored except in the case of full pathnames to volumes. + In full pathnames to volumes, the trailing separator colon is required. + Consecutive separator colons can be used to ascend a level from a + directory to its parent directory. Two consecutive separator colons + will ascend one level, three consecutive separator colons will ascend + two levels, and so on. Ascending can only occur from a directory; + not a file. + + + + + +--------------------------------------------------------------------------- + +Dirk Haase +========== diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/charmap.h boinc-7.0.14+dfsg/zip/zip/macos/source/charmap.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/charmap.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/charmap.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,380 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef __macos_charmap_h +#define __macos_charmap_h + +/* + +Conversion table from MacOS Roman to +"Western Europe & America" Windows codepage 1252 + + Notes on Mac OS Roman: + ---------------------- + + Mac OS Roman character set is used for at least the following Mac OS + localizations: U.S., British, Canadian French, French, Swiss + French, German, Swiss German, Italian, Swiss Italian, Dutch, + Swedish, Norwegian, Danish, Finnish, Spanish, Catalan, + Portuguese, Brazilian, and the default International system. + + Not every char of the charset MacRoman has their equivalent + in Windows CodePage1252. + To make the mapping in most cases possible, I choosed + most similar chars or at least the BULLET. Chars that + do not have a direct match are marked with '***' + + The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage, + with some additional printable characters in the range (0x80 - 0x9F), + that is reserved to control codes in the ISO 8859-1 character table. + +In all Mac OS encodings, character codes 0x00-0x7F are identical to ASCII + +*/ + + + +ZCONST unsigned char MacRoman_to_WinCP1252[128] = { +/* Win CP1252 UniCode UniCode Names */ + 0xC4 , /* 0x00C4 #LATIN CAPITAL LETTER A WITH DIAERESIS */ + 0xC5 , /* 0x00C5 #LATIN CAPITAL LETTER A WITH RING ABOVE */ + 0xC7 , /* 0x00C7 #LATIN CAPITAL LETTER C WITH CEDILLA */ + 0xC9 , /* 0x00C9 #LATIN CAPITAL LETTER E WITH ACUTE */ + 0xD1 , /* 0x00D1 #LATIN CAPITAL LETTER N WITH TILDE */ + 0xD6 , /* 0x00D6 #LATIN CAPITAL LETTER O WITH DIAERESIS */ + 0xDC , /* 0x00DC #LATIN CAPITAL LETTER U WITH DIAERESIS */ + 0xE1 , /* 0x00E1 #LATIN SMALL LETTER A WITH ACUTE */ + 0xE0 , /* 0x00E0 #LATIN SMALL LETTER A WITH GRAVE */ + 0xE2 , /* 0x00E2 #LATIN SMALL LETTER A WITH CIRCUMFLEX */ + 0xE4 , /* 0x00E4 #LATIN SMALL LETTER A WITH DIAERESIS */ + 0xE3 , /* 0x00E3 #LATIN SMALL LETTER A WITH TILDE */ + 0xE5 , /* 0x00E5 #LATIN SMALL LETTER A WITH RING ABOVE */ + 0xE7 , /* 0x00E7 #LATIN SMALL LETTER C WITH CEDILLA */ + 0xE9 , /* 0x00E9 #LATIN SMALL LETTER E WITH ACUTE */ + 0xE8 , /* 0x00E8 #LATIN SMALL LETTER E WITH GRAVE */ + 0xEA , /* 0x00EA #LATIN SMALL LETTER E WITH CIRCUMFLEX */ + 0xEB , /* 0x00EB #LATIN SMALL LETTER E WITH DIAERESIS */ + 0xED , /* 0x00ED #LATIN SMALL LETTER I WITH ACUTE */ + 0xEC , /* 0x00EC #LATIN SMALL LETTER I WITH GRAVE */ + 0xEE , /* 0x00EE #LATIN SMALL LETTER I WITH CIRCUMFLEX */ + 0xEF , /* 0x00EF #LATIN SMALL LETTER I WITH DIAERESIS */ + 0xF1 , /* 0x00F1 #LATIN SMALL LETTER N WITH TILDE */ + 0xF3 , /* 0x00F3 #LATIN SMALL LETTER O WITH ACUTE */ + 0xF2 , /* 0x00F2 #LATIN SMALL LETTER O WITH GRAVE */ + 0xF4 , /* 0x00F4 #LATIN SMALL LETTER O WITH CIRCUMFLEX */ + 0xF6 , /* 0x00F6 #LATIN SMALL LETTER O WITH DIAERESIS */ + 0xF5 , /* 0x00F5 #LATIN SMALL LETTER O WITH TILDE */ + 0xFA , /* 0x00FA #LATIN SMALL LETTER U WITH ACUTE */ + 0xF9 , /* 0x00F9 #LATIN SMALL LETTER U WITH GRAVE */ + 0xFB , /* 0x00FB #LATIN SMALL LETTER U WITH CIRCUMFLEX */ + 0xFC , /* 0x00FC #LATIN SMALL LETTER U WITH DIAERESIS */ + 0x86 , /* 0x2020 #DAGGER */ + 0xB0 , /* 0x00B0 #DEGREE SIGN */ + 0xA2 , /* 0x00A2 #CENT SIGN */ + 0xA3 , /* 0x00A3 #POUND SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 #BULLET */ + 0xB6 , /* 0x00B6 #PILCROW SIGN */ + 0xDF , /* 0x00DF #LATIN SMALL LETTER SHARP S */ + 0xAE , /* 0x00AE #REGISTERED SIGN */ + 0xA9 , /* 0x00A9 #COPYRIGHT SIGN */ + 0x99 , /* 0x2122 #TRADE MARK SIGN */ + 0xB4 , /* 0x00B4 #ACUTE ACCENT */ + 0xA8 , /* 0x00A8 #DIAERESIS */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xC6 , /* 0x00C6 #LATIN CAPITAL LETTER AE */ + 0xD8 , /* 0x00D8 #LATIN CAPITAL LETTER O WITH STROKE */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xB1 , /* 0x00B1 #PLUS-MINUS SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x00A5 #YEN SIGN */ + 0xB5 , /* 0x00B5 #MICRO SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xAA , /* 0x00AA #FEMININE ORDINAL INDICATOR */ + 0xBA , /* 0x00BA #MASCULINE ORDINAL INDICATOR */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xE6 , /* 0x00E6 #LATIN SMALL LETTER AE */ + 0xF8 , /* 0x00F8 #LATIN SMALL LETTER O WITH STROKE */ + 0xBF , /* 0x00BF #INVERTED QUESTION MARK */ + 0xA1 , /* 0x00A1 #INVERTED EXCLAMATION MARK */ + 0xAC , /* 0x00AC #NOT SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x83 , /* 0x0192 #LATIN SMALL LETTER F WITH HOOK */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xAB , /* 0x00AB #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0xBB , /* 0x00BB #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0x85 , /* 0x2026 #HORIZONTAL ELLIPSIS */ + 0xA0 , /* 0x00A0 #NO-BREAK SPACE */ + 0xC0 , /* 0x00C0 #LATIN CAPITAL LETTER A WITH GRAVE */ + 0xC3 , /* 0x00C3 #LATIN CAPITAL LETTER A WITH TILDE */ + 0xD5 , /* 0x00D5 #LATIN CAPITAL LETTER O WITH TILDE */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x96 , /* 0x2013 #EN DASH */ + 0x97 , /* 0x2014 #EM DASH */ + 0x93 , /* 0x201C #LEFT DOUBLE QUOTATION MARK */ + 0x94 , /* 0x201D #RIGHT DOUBLE QUOTATION MARK */ + 0x91 , /* 0x2018 #LEFT SINGLE QUOTATION MARK */ + 0x92 , /* 0x2019 #RIGHT SINGLE QUOTATION MARK */ + 0xF7 , /* 0x00F7 #DIVISION SIGN */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xFF , /* 0x00FF #LATIN SMALL LETTER Y WITH DIAERESIS */ + 0x9F , /* 0x0178 #LATIN CAPITAL LETTER Y WITH DIAERESIS */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xA4 , /* 0x00A4 #CURRENCY SIGN */ + 0x8B , /* 0x2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ + 0x9B , /* 0x203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x87 , /* 0x2021 #DOUBLE DAGGER */ + 0xB7 , /* 0x00B7 #MIDDLE DOT */ + 0x82 , /* 0x201A #SINGLE LOW-9 QUOTATION MARK */ + 0x84 , /* 0x201E #DOUBLE LOW-9 QUOTATION MARK */ + 0x89 , /* 0x2030 #PER MILLE SIGN */ + 0xC2 , /* 0x00C2 #LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ + 0xCA , /* 0x00CA #LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ + 0xC1 , /* 0x00C1 #LATIN CAPITAL LETTER A WITH ACUTE */ + 0xCB , /* 0x00CB #LATIN CAPITAL LETTER E WITH DIAERESIS */ + 0xC8 , /* 0x00C8 #LATIN CAPITAL LETTER E WITH GRAVE */ + 0xCD , /* 0x00CD #LATIN CAPITAL LETTER I WITH ACUTE */ + 0xCE , /* 0x00CE #LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ + 0xCF , /* 0x00CF #LATIN CAPITAL LETTER I WITH DIAERESIS */ + 0xCC , /* 0x00CC #LATIN CAPITAL LETTER I WITH GRAVE */ + 0xD3 , /* 0x00D3 #LATIN CAPITAL LETTER O WITH ACUTE */ + 0xD4 , /* 0x00D4 #LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xD2 , /* 0x00D2 #LATIN CAPITAL LETTER O WITH GRAVE */ + 0xDA , /* 0x00DA #LATIN CAPITAL LETTER U WITH ACUTE */ + 0xDB , /* 0x00DB #LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ + 0xD9 , /* 0x00D9 #LATIN CAPITAL LETTER U WITH GRAVE */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x88 , /* 0x02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT */ + 0x98 , /* 0x02DC #SMALL TILDE */ + 0xAF , /* 0x00AF #MACRON */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0xB8 , /* 0x00B8 #CEDILLA */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 , /* 0x2022 # *** BULLET */ + 0x95 /* 0x2022 # *** BULLET */ + }; + + + +ZCONST unsigned char WinCP1252_to_MacRoman[128] = { +/* Mac Roman UniCode UniCode Names */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xE2 , /* 0x201A # SINGLE LOW-9 QUOTATION MARK */ + 0xC4 , /* 0x0192 # LATIN SMALL LETTER F WITH HOOK */ + 0xE3 , /* 0x201E # DOUBLE LOW-9 QUOTATION MARK */ + 0xC9 , /* 0x2026 # HORIZONTAL ELLIPSIS */ + 0xA0 , /* 0x2020 # DAGGER */ + 0xE0 , /* 0x2021 # DOUBLE DAGGER */ + 0xF6 , /* 0x02C6 # MODIFIER LETTER CIRCUMFLEX ACCENT */ + 0xE4 , /* 0x2030 # PER MILLE SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xDC , /* 0x2039 # SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xD4 , /* 0x2018 # LEFT SINGLE QUOTATION MARK */ + 0xD5 , /* 0x2019 # RIGHT SINGLE QUOTATION MARK */ + 0xD2 , /* 0x201C # LEFT DOUBLE QUOTATION MARK */ + 0xD3 , /* 0x201D # RIGHT DOUBLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # BULLET */ + 0xD0 , /* 0x2013 # EN DASH */ + 0xD1 , /* 0x2014 # EM DASH */ + 0xF7 , /* 0x02DC # SMALL TILDE */ + 0xAA , /* 0x2122 # TRADE MARK SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xDD , /* 0x203A # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xD9 , /* 0x0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS */ + 0xCA , /* 0x00A0 # NO-BREAK SPACE */ + 0xC1 , /* 0x00A1 # INVERTED EXCLAMATION MARK */ + 0xA2 , /* 0x00A2 # CENT SIGN */ + 0xA3 , /* 0x00A3 # POUND SIGN */ + 0xDB , /* 0x00A4 # CURRENCY SIGN */ + 0xB4 , /* 0x00A5 # YEN SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xAC , /* 0x00A8 # DIAERESIS */ + 0xA9 , /* 0x00A9 # COPYRIGHT SIGN */ + 0xBB , /* 0x00AA # FEMININE ORDINAL INDICATOR */ + 0xC7 , /* 0x00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0xC2 , /* 0x00AC # NOT SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA8 , /* 0x00AE # REGISTERED SIGN */ + 0xF8 , /* 0x00AF # MACRON */ + 0xA1 , /* 0x00B0 # DEGREE SIGN */ + 0xB1 , /* 0x00B1 # PLUS-MINUS SIGN */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xAB , /* 0x00B4 # ACUTE ACCENT */ + 0xB5 , /* 0x00B5 # MICRO SIGN */ + 0xA6 , /* 0x00B6 # PILCROW SIGN */ + 0xE1 , /* 0x00B7 # MIDDLE DOT */ + 0xFC , /* 0x00B8 # CEDILLA */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xBC , /* 0x00BA # MASCULINE ORDINAL INDICATOR */ + 0xC8 , /* 0x00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xC0 , /* 0x00BF # INVERTED QUESTION MARK */ + 0xCB , /* 0x00C0 # LATIN CAPITAL LETTER A WITH GRAVE */ + 0xE7 , /* 0x00C1 # LATIN CAPITAL LETTER A WITH ACUTE */ + 0xE5 , /* 0x00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ + 0xCC , /* 0x00C3 # LATIN CAPITAL LETTER A WITH TILDE */ + 0x80 , /* 0x00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS */ + 0x81 , /* 0x00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE */ + 0xAE , /* 0x00C6 # LATIN CAPITAL LETTER AE */ + 0x82 , /* 0x00C7 # LATIN CAPITAL LETTER C WITH CEDILLA */ + 0xE9 , /* 0x00C8 # LATIN CAPITAL LETTER E WITH GRAVE */ + 0x83 , /* 0x00C9 # LATIN CAPITAL LETTER E WITH ACUTE */ + 0xE6 , /* 0x00CA # LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ + 0xE8 , /* 0x00CB # LATIN CAPITAL LETTER E WITH DIAERESIS */ + 0xED , /* 0x00CC # LATIN CAPITAL LETTER I WITH GRAVE */ + 0xEA , /* 0x00CD # LATIN CAPITAL LETTER I WITH ACUTE */ + 0xEB , /* 0x00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ + 0xEC , /* 0x00CF # LATIN CAPITAL LETTER I WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0x84 , /* 0x00D1 # LATIN CAPITAL LETTER N WITH TILDE */ + 0xF1 , /* 0x00D2 # LATIN CAPITAL LETTER O WITH GRAVE */ + 0xEE , /* 0x00D3 # LATIN CAPITAL LETTER O WITH ACUTE */ + 0xEF , /* 0x00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ + 0xCD , /* 0x00D5 # LATIN CAPITAL LETTER O WITH TILDE */ + 0x85 , /* 0x00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xAF , /* 0x00D8 # LATIN CAPITAL LETTER O WITH STROKE */ + 0xF4 , /* 0x00D9 # LATIN CAPITAL LETTER U WITH GRAVE */ + 0xF2 , /* 0x00DA # LATIN CAPITAL LETTER U WITH ACUTE */ + 0xF3 , /* 0x00DB # LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ + 0x86 , /* 0x00DC # LATIN CAPITAL LETTER U WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA7 , /* 0x00DF # LATIN SMALL LETTER SHARP S */ + 0x88 , /* 0x00E0 # LATIN SMALL LETTER A WITH GRAVE */ + 0x87 , /* 0x00E1 # LATIN SMALL LETTER A WITH ACUTE */ + 0x89 , /* 0x00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX */ + 0x8B , /* 0x00E3 # LATIN SMALL LETTER A WITH TILDE */ + 0x8A , /* 0x00E4 # LATIN SMALL LETTER A WITH DIAERESIS */ + 0x8C , /* 0x00E5 # LATIN SMALL LETTER A WITH RING ABOVE */ + 0xBE , /* 0x00E6 # LATIN SMALL LETTER AE */ + 0x8D , /* 0x00E7 # LATIN SMALL LETTER C WITH CEDILLA */ + 0x8F , /* 0x00E8 # LATIN SMALL LETTER E WITH GRAVE */ + 0x8E , /* 0x00E9 # LATIN SMALL LETTER E WITH ACUTE */ + 0x90 , /* 0x00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX */ + 0x91 , /* 0x00EB # LATIN SMALL LETTER E WITH DIAERESIS */ + 0x93 , /* 0x00EC # LATIN SMALL LETTER I WITH GRAVE */ + 0x92 , /* 0x00ED # LATIN SMALL LETTER I WITH ACUTE */ + 0x94 , /* 0x00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX */ + 0x95 , /* 0x00EF # LATIN SMALL LETTER I WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0x96 , /* 0x00F1 # LATIN SMALL LETTER N WITH TILDE */ + 0x98 , /* 0x00F2 # LATIN SMALL LETTER O WITH GRAVE */ + 0x97 , /* 0x00F3 # LATIN SMALL LETTER O WITH ACUTE */ + 0x99 , /* 0x00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX */ + 0x9B , /* 0x00F5 # LATIN SMALL LETTER O WITH TILDE */ + 0x9A , /* 0x00F6 # LATIN SMALL LETTER O WITH DIAERESIS */ + 0xD6 , /* 0x00F7 # DIVISION SIGN */ + 0xBF , /* 0x00F8 # LATIN SMALL LETTER O WITH STROKE */ + 0x9D , /* 0x00F9 # LATIN SMALL LETTER U WITH GRAVE */ + 0x9C , /* 0x00FA # LATIN SMALL LETTER U WITH ACUTE */ + 0x9E , /* 0x00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX */ + 0x9F , /* 0x00FC # LATIN SMALL LETTER U WITH DIAERESIS */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xA5 , /* 0x2022 # *** BULLET */ + 0xD8 /* 0x00FF # LATIN SMALL LETTER Y WITH DIAERESIS */ + }; + + +/* + +The following characters has no equivalent +to each other: + +MacCodes +164 0xA4 0x00A7 # SECTION SIGN +253 0xFD 0x02DD # DOUBLE ACUTE ACCENT +189 0xBD 0x03A9 # GREEK CAPITAL LETTER OMEGA +185 0xB9 0x03C0 # GREEK SMALL LETTER PI +255 0xFF 0x02C7 # CARON +249 0xF9 0x02D8 # BREVE +250 0xFA 0x02D9 # DOT ABOVE +251 0xFB 0x02DA # RING ABOVE +254 0xFE 0x02DB # OGONEK +218 0xDA 0x2044 # FRACTION SLASH +182 0xB6 0x2202 # PARTIAL DIFFERENTIAL +198 0xC6 0x2206 # INCREMENT +184 0xB8 0x220F # N-ARY PRODUCT +183 0xB7 0x2211 # N-ARY SUMMATION +195 0xC3 0x221A # SQUARE ROOT +176 0xB0 0x221E # INFINITY +186 0xBA 0x222B # INTEGRAL +197 0xC5 0x2248 # ALMOST EQUAL TO +173 0xAD 0x2260 # NOT EQUAL TO +178 0xB2 0x2264 # LESS-THAN OR EQUAL TO +179 0xB3 0x2265 # GREATER-THAN OR EQUAL TO +215 0xD7 0x25CA # LOZENGE +240 0xF0 0xF8FF # Apple logo +222 0xDE 0xFB01 # LATIN SMALL LIGATURE FI +223 0xDF 0xFB02 # LATIN SMALL LIGATURE FL +245 0xF5 0x0131 # LATIN SMALL LETTER DOTLESS I +206 0xCE 0x0152 # LATIN CAPITAL LIGATURE OE +207 0xCF 0x0153 # LATIN SMALL LIGATURE OE + +WinCodes +129 0x81 #UNDEFINED +141 0x8D #UNDEFINED +143 0x8F #UNDEFINED +144 0x90 #UNDEFINED +157 0x9D #UNDEFINED +167 0xA7 0x00A7 #SECTION SIGN +173 0xAD 0x00AD #SOFT HYPHEN +178 0xB2 0x00B2 #SUPERSCRIPT TWO +179 0xB3 0x00B3 #SUPERSCRIPT THREE +185 0xB9 0x00B9 #SUPERSCRIPT ONE +188 0xBC 0x00BC #VULGAR FRACTION ONE QUARTER +189 0xBD 0x00BD #VULGAR FRACTION ONE HALF +190 0xBE 0x00BE #VULGAR FRACTION THREE QUARTERS +208 0xD0 0x00D0 #LATIN CAPITAL LETTER ETH +215 0xD7 0x00D7 #MULTIPLICATION SIGN +221 0xDD 0x00DD #LATIN CAPITAL LETTER Y WITH ACUTE +222 0xDE 0x00DE #LATIN CAPITAL LETTER THORN +240 0xF0 0x00F0 #LATIN SMALL LETTER ETH +253 0xFD 0x00FD #LATIN SMALL LETTER Y WITH ACUTE +254 0xFE 0x00FE #LATIN SMALL LETTER THORN +140 0x8C 0x0152 #LATIN CAPITAL LIGATURE OE +156 0x9C 0x0153 #LATIN SMALL LIGATURE OE +138 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON +154 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON +142 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON +158 0x9E 0x017E #LATIN SMALL LETTER Z WITH CARON +128 0x80 0x20AC #EURO SIGN +166 0xA6 0x00A6 #BROKEN BAR + + +*/ + + + + +#endif /* !__macos_charmap_h */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/extrafld.c boinc-7.0.14+dfsg/zip/zip/macos/source/extrafld.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/extrafld.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/extrafld.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,922 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + extrafld.c + + contains functions to build extra-fields. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include "zip.h" +#include "unixlike.h" +#include "helpers.h" +#include "pathname.h" + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +/* ---------------------------------------------------------------------- */ +/* Add a 'MAC3' extra field to the zlist data pointed to by z. */ +/* This is the (new) Info-zip extra block for Macintosh */ +#define EB_MAC3_HLEN 14 /* fixed length part of MAC3's header */ +#define EB_L_MAC3_FINFO_LEN 52 /* fixed part of MAC3 compressible data */ + +#define EB_MAX_OF_VARDATA 1300 /* max possible datasize */ + +#define EB_L_MAC3_SIZE (EB_HEADSIZE + EB_MAC3_HLEN) +#define EB_C_MAC3_SIZE (EB_HEADSIZE + EB_MAC3_HLEN) + +#define MEMCOMPRESS_HEADER 6 /* ush compression type, ulg CRC */ +#define DEFLAT_WORSTCASE_ADD 5 /* byte blocktype, 2 * ush blocklength */ +#define MEMCOMPRESS_OVERHEAD (MEMCOMPRESS_HEADER + DEFLAT_WORSTCASE_ADD) + +#define EXTRAFLD_MAX (unsigned)0xFFFF + +#define EB_M3_FL_COMPRESS 0x00 +#define EB_M3_FL_DATFRK 0x01 /* data is data-fork */ +#define EB_M3_FL_NOCHANGE 0x02 /* filename will be not changed */ +#define EB_M3_FL_UNCMPR 0x04 /* data is 'natural' (not compressed) */ +#define EB_M3_FL_TIME64 0x08 /* time is coded in 64 bit */ +#define EB_M3_FL_NOUTC 0x10 /* only 'local' time-stamps are stored */ + + +#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(2)) +#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1)) + +/* disable compressing of extra field +#define MAC_EXTRAFLD_UNCMPR */ + +/* ---------------------------------------------------------------------- */ +/* Add a 'JLEE' extra field to the zlist data pointed to by z. */ +/* This is the (old) Info-zip resource-fork extra block for Macintosh +(last Revision 1996-09-22) Layout made by Johnny Lee, Code made by me :-) */ +#define EB_L_JLEE_LEN 40 /* fixed length of JLEE's header */ +#define EB_C_JLEE_LEN 40 /* fixed length of JLEE's header */ + +#define EB_L_JLEE_SIZE (EB_HEADSIZE + EB_L_JLEE_LEN) +#define EB_C_JLEE_SIZE (EB_HEADSIZE + EB_C_JLEE_LEN) + + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +extern MacZipGlobals MacZip; +extern unsigned long count_of_Zippedfiles; + + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +static int add_UT_ef(struct zlist far *z, iztimes *z_utim); +static int add_JLEE_ef(struct zlist far *z); /* old mac extra field */ +static int add_MAC3_ef(struct zlist far *z); /* new mac extra field */ + +static void make_extrafield_JLEE(char *l_ef); +static unsigned make_extrafield_MAC3(char *ef); +static char *make_EF_Head_MAC3(char *ef, unsigned compsize, ulg attrsize, + unsigned flag); + +static void print_extra_info(void); +void UserStop(void); + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +/* +* Set the extra-field's for each compressed file +*/ +int set_extra_field(struct zlist far *z, iztimes *z_utim) + /* store full data in local header but just modification time stamp info + in central header */ +{ + int retval; + + Assert_it(z, "set_extra_field","") + Assert_it(z_utim, "set_extra_field","") + + z_utim = z_utim; + + /* Check to make sure z is valid. */ + if( z == NULL ) { + return ZE_LOGIC; + } + + /* Resource forks are always binary */ + if (MacZip.CurrentFork == ResourceFork) z->att = BINARY; + + if (noisy) + { + count_of_Zippedfiles++; + InformProgress(MacZip.RawCountOfItems, count_of_Zippedfiles ); + } + + /* + PrintFileInfo(); + */ + switch (MacZip.MacZipMode) + { + case JohnnyLee_EF: + { + retval = add_JLEE_ef( z ); + if (retval != ZE_OK) return retval; + break; + } + case NewZipMode_EF: + { /* */ +#ifdef USE_EF_UT_TIME + retval = add_UT_ef(z, z_utim); + if (retval != ZE_OK) return retval; +#endif + + retval = add_MAC3_ef( z ); + if (retval != ZE_OK) return retval; + break; + } + default: + { + printerr("Unknown Extrafieldmode", -1, -1, __LINE__, __FILE__, ""); + return ZE_LOGIC; /* function should never reach this point */ + } + } + + /* MacStat information is now outdated and + must be refreshed for the next file */ + MacZip.isMacStatValid = false; + + return ZE_OK; +} + + + + +#ifdef USE_EF_UT_TIME +/* +* Build and add the Unix time extra-field. This extra field +* will be included be default. Johnny Lee's implementation does +* not use this kind of extra-field. +* All datas are in Intel (=little-endian) format + + Extra field info: + - 'UT' - UNIX time extra field + + This is done the same way ../unix/unix.c stores the 'UT'/'Ux' fields + (full data in local header, only modification time in central header), + with the 'M3' field added to the end and the size of the 'M3' field + in the central header. + */ + +static int add_UT_ef(struct zlist far *z, iztimes *z_utim) +{ + char *l_ef = NULL; + char *c_ef = NULL; + + Assert_it(z, "add_UT_ef","") + +#ifdef IZ_CHECK_TZ + if (!zp_tz_is_valid) + return ZE_OK; /* skip silently if no valid TZ info */ +#endif + + /* We can't work if there's no entry to work on. */ + if( z == NULL ) { + return ZE_LOGIC; + } + + /* Check to make sure we've got enough room in the extra fields. */ + if( z->ext + EB_L_UT_SIZE > EXTRAFLD_MAX || + z->cext + EB_C_UT_SIZE > EXTRAFLD_MAX ) { + return ZE_MEM; + } + + /* Allocate memory for the local and central extra fields. */ + if( z->extra && z->ext != 0 ) { + l_ef = (char *)realloc( z->extra, z->ext + EB_L_UT_SIZE ); + } else { + l_ef = (char *)malloc( EB_L_UT_SIZE ); + z->ext = 0; + } + if( l_ef == NULL ) { + return ZE_MEM; + } + z->extra = l_ef; + l_ef += z->ext; + + if( z->cextra && z->cext != 0 ) { + c_ef = (char *)realloc( z->cextra, z->cext + EB_C_UT_SIZE ); + } else { + c_ef = (char *)malloc( EB_C_UT_SIZE ); + z->cext = 0; + } + if( c_ef == NULL ) { + return ZE_MEM; + } + z->cextra = c_ef; + c_ef += z->cext; + + /* Now add the local version of the field. */ + *l_ef++ = 'U'; + *l_ef++ = 'T'; + *l_ef++ = (char)(EB_UT_LEN(2)); /* length of data in local EF */ + *l_ef++ = (char)0; + *l_ef++ = (char)(EB_UT_FL_MTIME | EB_UT_FL_CTIME); + *l_ef++ = (char)(z_utim->mtime); + *l_ef++ = (char)(z_utim->mtime >> 8); + *l_ef++ = (char)(z_utim->mtime >> 16); + *l_ef++ = (char)(z_utim->mtime >> 24); + *l_ef++ = (char)(z_utim->ctime); + *l_ef++ = (char)(z_utim->ctime >> 8); + *l_ef++ = (char)(z_utim->ctime >> 16); + *l_ef++ = (char)(z_utim->ctime >> 24); + + z->ext += EB_L_UT_SIZE; + + /* Now add the central version. */ + memcpy(c_ef, l_ef-EB_L_UT_SIZE, EB_C_UT_SIZE); + c_ef[EB_LEN] = (char)(EB_UT_LEN(1)); /* length of data in central EF */ + + z->cext += EB_C_UT_SIZE; + + return ZE_OK; +} +#endif /* USE_EF_UT_TIME */ + + +/* +* Build and add the old 'Johnny Lee' Mac extra field +* All native datas are in Motorola (=big-endian) format +*/ + +static int add_JLEE_ef( struct zlist far *z ) +{ + char *l_ef = NULL; + char *c_ef = NULL; + + Assert_it(z, "add_JLEE_ef","") + + /* Check to make sure we've got enough room in the extra fields. */ + if ( z->ext + EB_L_JLEE_SIZE > EXTRAFLD_MAX || + z->cext + EB_C_JLEE_SIZE > EXTRAFLD_MAX ) { + return ZE_MEM; + } + + + /* Allocate memory for the local extra fields. */ + if ( z->extra && z->ext != 0 ) { + l_ef = (char *)realloc( z->extra, z->ext + EB_L_JLEE_SIZE ); + } else { + l_ef = (char *)malloc( EB_L_JLEE_SIZE ); + z->ext = 0; + } + if ( l_ef == NULL ) { + return ZE_MEM; + } + z->extra = l_ef; + l_ef += z->ext; + + /* Allocate memory for the central extra fields. */ + if ( z->cextra && z->cext != 0 ) { + c_ef = (char *)realloc( z->cextra, z->cext + EB_C_JLEE_SIZE ); + } else { + c_ef = (char *)malloc( EB_C_JLEE_SIZE ); + z->cext = 0; + } + if ( c_ef == NULL ) { + return ZE_MEM; + } + z->cextra = c_ef; + c_ef += z->cext; + + + if ( verbose ) { + print_extra_info(); + } + + + /** + ** + ** Now add the local version of the field. + **/ + make_extrafield_JLEE(l_ef); + z->ext += EB_L_JLEE_SIZE; + + + /** + ** + ** Now add the central version of the field. + ** It's identical to the local header. I wonder why ?? + * the first two fields are in Intel little-endian format */ + make_extrafield_JLEE(c_ef); + z->cext += EB_C_JLEE_SIZE; + + return ZE_OK; +} + + + +/* +* This is an implementation of Johnny Lee's extra field. +* I never saw Johnny Lee's code. My code is based on the extra-field +* definition mac (see latest appnote 1997-03-11) +* and on some experiments with Johnny Lee's Zip-app version 1.0, 1992 +* +* Unfortunately I cannot agree with his extra-field layout. +* - it wasted space +* - and holds not all mac-specific information +* +* I coded this extra-field only for testing purposes. +* I don't want support this extra-field. Please use my implementation. +* +* This is old implementation of Johnny Lee's extra field. +* All native datas are in Motorola (=big-endian) format +*/ + +static void make_extrafield_JLEE(char *ef) +{ + + Assert_it(ef, "make_extrafield_JLEE","") + + if (MacZip.isMacStatValid == false) + { + fprintf(stderr,"Internal Logic Error: [%d/%s] MacStat is out of sync !", + __LINE__,__FILE__); + exit(-1); + } + + + /* the first two fields are in Intel little-endian format */ + *ef++ = 0xC8; /* tag for this extra block */ + *ef++ = 0x07; + + *ef++ = (char)(EB_L_JLEE_LEN); /* total data size this block */ + *ef++ = (char)((EB_L_JLEE_LEN) >> 8); + + /* the following fields are in motorola big-endian format */ + *ef++ = 'J'; /* extra field signature: 4 Bytes */ + *ef++ = 'L'; /* the old style extra field */ + *ef++ = 'E'; + *ef++ = 'E'; + + /* Start Macintosh Finder FInfo structure 16 Bytes overall */ + /* Type: 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType); + + /* Creator: 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); + + /* file Finder Flags: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags); + + /* Finders Icon position of a file*/ + /* V/Y-Position: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v); + /* H/X-Position: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h); + + /* fdFldr Folder containing file 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr); + /* End Macintosh Finder FInfo structure */ + + + /* Creation-time 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat); + + /* Modification-time 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat); + + /* info Bits 4 Bytes */ + *ef++ = 0x00; + *ef++ = 0x00; + *ef++ = 0x00; + if (MacZip.DataForkOnly) + { /* don't convert filename for unzipping */ + /* 0x01 = data-fork; 0x00 = resource-fork */ + *ef++ = (char) (MacZip.CurrentFork == DataFork) | 2; + } + else + { + *ef++ = (char) (MacZip.CurrentFork == DataFork); + } + + /* file's location folder ID 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID); + /* ============ */ + /* 40 Bytes */ +} + + + +/* +* Build and add the new mac extra field +* All native data are stored in Intel (=little-endian) format +*/ + +static int add_MAC3_ef( struct zlist far *z ) +{ + char *l_ef = NULL; + char *c_ef = NULL; + char *attrbuff = NULL; + off_t attrsize = (EB_L_MAC3_FINFO_LEN + EB_MAX_OF_VARDATA); + char *compbuff = NULL; + unsigned compsize = 0; + unsigned m3_compr; + Boolean compress_data = true; + + Assert_it(z, "add_MAC3_ef","") + + UserStop(); /* do event handling and let the user stop */ + + if( verbose ) { + print_extra_info(); + } + + /* allocate temporary buffer to collect the Mac extra field info */ + attrbuff = (char *)malloc( (size_t)attrsize ); + if( attrbuff == NULL ) { + return ZE_MEM; + } + + /* fill the attribute buffer, to get its (uncompressed) size */ + attrsize = make_extrafield_MAC3(attrbuff); + + if (compress_data && + ((compbuff = (char *)malloc((size_t)attrsize + MEMCOMPRESS_OVERHEAD)) + != NULL)) + { + /* Try compressing the data */ + compsize = memcompress( compbuff, + (size_t)attrsize + MEMCOMPRESS_OVERHEAD, + attrbuff, + (size_t)attrsize ); +#ifdef MAC_EXTRAFLD_UNCMPR + compsize = attrsize; +#endif + } + else + { + compsize = attrsize; + } + + if ((compsize) < attrsize) { + /* compression gained some space ... */ + free(attrbuff); /* no longer needed ... */ + m3_compr = EB_M3_FL_COMPRESS; + } else { + /* compression does not help, store data in uncompressed mode */ + if (compbuff != NULL) free(compbuff); + compbuff = attrbuff; + compsize = attrsize; + m3_compr = EB_M3_FL_UNCMPR; + } + + /* Check to make sure we've got enough room in the extra fields. */ + if( z->ext + (EB_L_MAC3_SIZE + compsize) > EXTRAFLD_MAX || + z->cext + EB_C_MAC3_SIZE > EXTRAFLD_MAX ) { + if (compbuff != NULL) free(compbuff); + return ZE_MEM; + } + + /* Allocate memory for the local extra fields. */ + if( z->extra && z->ext != 0 ) { + l_ef = (char *)realloc( z->extra, z->ext + + EB_L_MAC3_SIZE + compsize); + } else { + l_ef = (char *)malloc( EB_L_MAC3_SIZE + compsize); + z->ext = 0; + } + if( l_ef == NULL ) { + return ZE_MEM; + } + z->extra = l_ef; + l_ef += z->ext; + + /* Allocate memory for the central extra fields. */ + if( z->cextra && z->cext != 0 ) { + c_ef = (char *)realloc( z->cextra, z->cext + EB_C_MAC3_SIZE); + } else { + c_ef = (char *)malloc( EB_C_MAC3_SIZE ); + z->cext = 0; + } + if( c_ef == NULL ) { + return ZE_MEM; + } + z->cextra = c_ef; + c_ef += z->cext; + + /** + ** Now add the local version of the field. + **/ + l_ef = make_EF_Head_MAC3(l_ef, compsize, (ulg)attrsize, m3_compr); + memcpy(l_ef, compbuff, (size_t)compsize); + l_ef += compsize; + z->ext += EB_L_MAC3_SIZE + compsize; + free(compbuff); + /* And the central version. */ + c_ef = make_EF_Head_MAC3(c_ef, 0, (ulg)attrsize, m3_compr); + z->cext += EB_C_MAC3_SIZE; + + return ZE_OK; +} + + + + +/* +* Build the new mac local extra field header. +* It's identical with the central extra field. +* All native data are in Intel (=little-endian) format +*/ +static char *make_EF_Head_MAC3(char *ef, unsigned compsize, ulg attrsize, + unsigned flag) +{ + unsigned info_flag = flag; + + Assert_it(ef, "make_EF_Head_MAC3","") + + /* the first four fields are in Intel little-endian format */ + *ef++ = 'M'; /* tag for this extra block 2 Bytes */ + *ef++ = '3'; + + /* total data size this block 2 Bytes */ + *ef++ = (char) (EB_MAC3_HLEN + compsize); + *ef++ = (char)((EB_MAC3_HLEN + compsize) >> 8); + + *ef++ = (char)(attrsize); + *ef++ = (char)(attrsize >> 8); + *ef++ = (char)(attrsize >> 16); + *ef++ = (char)(attrsize >> 24); + + /* info Bits (flags) 2 Bytes */ + + if (MacZip.DataForkOnly) info_flag |= (EB_M3_FL_DATFRK | + EB_M3_FL_NOCHANGE); + if (MacZip.CurrentFork == DataFork) info_flag |= EB_M3_FL_DATFRK; + if (!MacZip.HaveGMToffset) info_flag |= EB_M3_FL_NOUTC; + + *ef++ = (char)info_flag; + *ef++ = (char)0x00; /* reserved at the moment */ + + /* Note: Apple defined File-Type/-Creator as OSType ( =unsigned long, + see Universal Headers 3.1). However, File-Type/-Creator are a + unique four-character sequence. Therefore the byteorder of the + File-Type/-Creator are NOT changed. The native format is used. */ + + /* Type: 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType); + + /* Creator: 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); + + return ef; +} + + + + + +/* +* Build the new mac local extra field header. +* All native data are in Intel (=little-endian) format +*/ +unsigned make_extrafield_MAC3(char *ef) +{ + char *ef_m3_begin = ef; + char *temp_Pathname; + char tmp_buffer[NAME_MAX]; + unsigned char comment[257]; + unsigned short FLength = 0; + unsigned short CLength = 0; + short tempFork; + OSErr err; + + Assert_it(ef, "make_extrafield_MAC3","") + + if (MacZip.isMacStatValid == false) + { + fprintf(stderr, + "Internal Logic Error: [%d/%s] MacStat is out of sync !", + __LINE__, __FILE__); + exit(-1); + } + + /* Start Macintosh Finder FInfo structure except Type/Creator + (see make_EF_Head_MAC3()) 8 Bytes overall */ + + /* file Finder Flags: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags >> 8); + + /* Finders Icon position of a file*/ + /* V/Y-Position: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v >> 8); + + /* H/X-Position: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h >> 8); + + /* fdFldr Folder containing file 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr >> 8); + + /* End Macintosh Finder FInfo structure */ + + /* 8 Bytes so far ... */ + + /* Start Macintosh Finder FXInfo structure 16 Bytes overall */ + /* Icon ID: 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdIconID); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdIconID >> 8); + + /* unused: 6 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[0]); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[0] >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[1]); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[1] >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[2]); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[2] >> 8); + /* Script flag: 1 Byte */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdScript); + /* More flag bits: 1 Byte */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdXFlags); + /* Comment ID 2 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdComment); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdComment >> 8); + + /* Home Dir ID: 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway >> 24); + /* End Macintosh Finder FXInfo structure */ + + /* 24 Bytes so far ... */ + + /* file version number 1 Byte */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFVersNum); + + /* directory access rights 1 Byte */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioACUser); + + /* Creation-time 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 24); + /* Modification-time 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 24); + /* Backup-time 4 Bytes */ + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat >> 8); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat >> 16); + *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat >> 24); + + /* 38 Bytes so far ... */ +#ifdef USE_EF_UT_TIME + if (MacZip.HaveGMToffset) { + /* GMT-Offset times 12 Bytes */ + *ef++ = (char)(MacZip.Cr_UTCoffs); + *ef++ = (char)(MacZip.Cr_UTCoffs >> 8); + *ef++ = (char)(MacZip.Cr_UTCoffs >> 16); + *ef++ = (char)(MacZip.Cr_UTCoffs >> 24); + *ef++ = (char)(MacZip.Md_UTCoffs); + *ef++ = (char)(MacZip.Md_UTCoffs >> 8); + *ef++ = (char)(MacZip.Md_UTCoffs >> 16); + *ef++ = (char)(MacZip.Md_UTCoffs >> 24); + *ef++ = (char)(MacZip.Bk_UTCoffs); + *ef++ = (char)(MacZip.Bk_UTCoffs >> 8); + *ef++ = (char)(MacZip.Bk_UTCoffs >> 16); + *ef++ = (char)(MacZip.Bk_UTCoffs >> 24); + } + /* 50 Bytes so far ... */ +#endif + + /* Text Encoding Base (charset) 2 Bytes */ + *ef++ = (char)(MacZip.CurrTextEncodingBase); + *ef++ = (char)(MacZip.CurrTextEncodingBase >> 8); + /* 52 Bytes so far ... */ + + /* MacZip.CurrentFork will be changed, so we have to save it */ + tempFork = MacZip.CurrentFork; + if (!MacZip.StoreFullPath) { + temp_Pathname = StripPartialDir(tmp_buffer, MacZip.SearchDir, + MacZip.FullPath); + } else { + temp_Pathname = MacZip.FullPath; + } + MacZip.CurrentFork = tempFork; + + FLength = strlen(temp_Pathname) + 1; + memcpy( ef, temp_Pathname, (size_t)FLength ); + ef += FLength; /* make room for the string - variable length */ + + err = FSpLocationFromFullPath(strlen(MacZip.FullPath), MacZip.FullPath, + &MacZip.fileSpec); + printerr("FSpLocationFromFullPath:", err, err, + __LINE__, __FILE__, tmp_buffer); + + err = FSpDTGetComment(&MacZip.fileSpec, comment); + printerr("FSpDTGetComment:", (err != -5012) && (err != 0), err, + __LINE__, __FILE__, ""); + PToCCpy(comment,tmp_buffer); + + CLength = strlen(tmp_buffer) + 1; + memcpy( ef, tmp_buffer, (size_t)CLength ); + ef += CLength; /* make room for the string - variable length */ + + if (verbose) printf("\n comment: [%s]", tmp_buffer); + + return (unsigned)(ef - ef_m3_begin); +} + + + + + + +/* +* Print all native data of the new mac local extra field. +* It's for debugging purposes and disabled by default. +*/ + +static void PrintFileInfo(void) +{ +DateTimeRec MacTime; + +printf("\n\n---------------------------------------------"\ + "----------------------------------"); +printf("\n FullPath Name = [%s]", MacZip.FullPath); +printf("\n File Attributes = %s 0x%x %d", + sBit2Str(MacZip.fpb.hFileInfo.ioFlAttrib), + MacZip.fpb.hFileInfo.ioFlAttrib, + MacZip.fpb.hFileInfo.ioFlAttrib); +printf("\n Enclosing Folder ID# = 0x%x %d", + MacZip.fpb.hFileInfo.ioFlParID, + MacZip.fpb.hFileInfo.ioFlParID); + +if (!MacZip.isDirectory) +{ +printf("\n File Type = [%c%c%c%c] 0x%lx", + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType); + +printf("\n File Creator = [%c%c%c%c] 0x%lx", + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); + +printf("\n Data Fork :" ); +printf("\n Actual (Logical) Length = %d 0x%x ", + MacZip.fpb.hFileInfo.ioFlLgLen, + MacZip.fpb.hFileInfo.ioFlLgLen); +printf("\n Allocated (Physical) Length = %d 0x%x", + MacZip.fpb.hFileInfo.ioFlPyLen, + MacZip.fpb.hFileInfo.ioFlPyLen); +printf("\n Resource Fork :" ); +printf("\n Actual (Logical) Length = %d 0x%x", + MacZip.fpb.hFileInfo.ioFlRLgLen, + MacZip.fpb.hFileInfo.ioFlRLgLen ); +printf("\n Allocated (Physical) Length = %d 0x%x", + MacZip.fpb.hFileInfo.ioFlRPyLen, + MacZip.fpb.hFileInfo.ioFlRPyLen ); +} + +printf("\n Dates : "); + +SecondsToDate (MacZip.CreatDate, &MacTime); +printf("\n Created = %4d/%2d/%2d %2d:%2d:%2d ", + MacTime.year, + MacTime.month, + MacTime.day, + MacTime.hour, + MacTime.minute, + MacTime.second); + +SecondsToDate (MacZip.BackDate, &MacTime); +printf("\n Backup = %4d/%2d/%2d %2d:%2d:%2d ", + MacTime.year, + MacTime.month, + MacTime.day, + MacTime.hour, + MacTime.minute, + MacTime.second); + +SecondsToDate (MacZip.ModDate, &MacTime); +printf("\n Modified = %4d/%2d/%2d %2d:%2d:%2d ", + MacTime.year, + MacTime.month, + MacTime.day, + MacTime.hour, + MacTime.minute, + MacTime.second); + +if (!MacZip.isDirectory) +{ +printf("\n Finder Flags : %s 0x%x %d", + sBit2Str(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags), + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags); +printf("\n Finder Icon Position = X: %d 0x%x ", + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h); +printf("\n Y: %d 0x%x ", + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v); +} +else +{ +printf("\n Finder Flags : %s 0x%x %d", + sBit2Str(MacZip.fpb.dirInfo.ioDrUsrWds.frFlags), + MacZip.fpb.dirInfo.ioDrUsrWds.frFlags, + MacZip.fpb.dirInfo.ioDrUsrWds.frFlags); +printf("\n Finder Icon Position = X: %d 0x%x ", + MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.h, + MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.h); +printf("\n Y: %d 0x%x ", + MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.v, + MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.v); +} + +printf("\n----------------------------------------------------"\ + "---------------------------\n"); +} + + + +/* +* If the switch '-v' is used, print some more info. +*/ + +static void print_extra_info(void) +{ +char Fork[20]; + +if (MacZip.CurrentFork == DataFork) sstrcpy(Fork,""); +else sstrcpy(Fork,""); + +printf("\n%16s [%c%c%c%c] [%c%c%c%c]",Fork, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType, + + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8, + MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); +} + +const char *BOINC_RCSID_f3974ac6e4 = "$Id: extrafld.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/getenv.c boinc-7.0.14+dfsg/zip/zip/macos/source/getenv.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/getenv.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/getenv.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,400 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + +This file implements the getenv() function. + +# Background: +# Under Unix: Each Process (= running Program) has a set of +# associated variables. The variables are called enviroment +# variables and, together, constitute the process environment. +# These variables include the search path, the terminal type, +# and the user's login name. + +# Unfortunatelly the MacOS has no equivalent. So we need +# a file to define the environment variables. +# Name of this file is "MacZip.Env". It can be placed +# in the current folder of MacZip or in the +# preference folder of the system disk. +# If MacZip founds the "MacZip.Env" file in the current +# the folder of MacZip the "MacZip.Env" file in the +# preference folder will be ignored. + +# An environment variable has a name and a value: +# Name=Value +# Note: Spaces are significant: +# ZIPOPT=-r and +# ZIPOPT = -r are different !!! + + + */ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "pathname.h" +#include "helpers.h" + +/*****************************************************************************/ +/* Module level Vars */ +/*****************************************************************************/ + +static char ListAllKeyValues = 0; +static unsigned LineNumber = 0; +static char CompletePath[NAME_MAX]; +Boolean IgnoreEnvironment = false; /* used by dialog.c and initfunc.c + of the Mainapp */ + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +typedef struct _EnviromentPair { + char *key; + char *value; +} EnviromentPair; + + +#define MAX_COMMAND 1024 + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + + +int get_char(FILE *file); +void unget_char(int ch,FILE *file); +int get_string(char *string,int size, FILE *file, char *terms); +void skip_comments(FILE *file); +char *load_entry(FILE *file); +char *getenv(const char *name); +EnviromentPair *ParseLine(char *line); +OSErr FSpFindFolder_Name(short vRefNum, OSType folderType, + Boolean createFolder,FSSpec *spec, unsigned char *name); +FILE * FSp_fopen(ConstFSSpecPtr spec, const char * open_mode); +void ShowAllKeyValues(void); +void Set_LineNum(unsigned ln); + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +/* get_string(str, max, file, termstr) : like fgets() but + * (1) has terminator string which should include \n + * (2) will always leave room for the null + * (3) uses get_char() so LineNumber will be accurate + * (4) returns EOF or terminating character, whichever + */ +int get_string(char *string, int size, FILE *file, char *terms) +{ + int ch; + + while (EOF != (ch = get_char(file)) && !strchr(terms, ch)) { + if (size > 1) { + *string++ = (char) ch; + size--; + } + } + + if (size > 0) + { + *string = '\0'; + } + + return ch; +} + + + + +void Set_LineNum(unsigned ln) +{ + LineNumber = ln; +} + + + +/* get_char(file) : like getc() but increment LineNumber on newlines + */ +int get_char(FILE *file) +{ + int ch; + + ch = getc(file); + if (ch == '\n') + { + Set_LineNum(LineNumber + 1); + } + + return ch; +} + + + + +/* skip_comments(file) : read past comment (if any) + */ +void skip_comments(FILE *file) +{ + int ch; + + while (EOF != (ch = get_char(file))) + { + /* ch is now the first character of a line. + */ + + while (ch == ' ' || ch == '\t') + { + ch = get_char(file); + } + + if (ch == EOF) + { + break; + } + + /* ch is now the first non-blank character of a line. + */ + + if (ch != '\n' && ch != '#') + { + break; + } + + /* ch must be a newline or comment as first non-blank + * character on a line. + */ + + while (ch != '\n' && ch != EOF) + { + ch = get_char(file); + } + + /* ch is now the newline of a line which we're going to + * ignore. + */ + } + + if (ch != EOF) + { + unget_char(ch, file); + } +} + + + + +/* unget_char(ch, file) : like ungetc but do LineNumber processing + */ +void unget_char(int ch, FILE *file) +{ + ungetc(ch, file); + if (ch == '\n') + { + Set_LineNum(LineNumber - 1); + } +} + + +/* this function reads one file entry -- the next -- from a file. +* it skips any leading blank lines, ignores comments, and returns +* NULL if for any reason the entry can't be read and parsed. +*/ + +char *load_entry(FILE *file) +{ + int ch; + static char cmd[MAX_COMMAND]; + + skip_comments(file); + + ch = get_string(cmd, MAX_COMMAND, file, "\n"); + + if (ch == EOF) + { + return NULL; + } + + return cmd; +} + + + + + +EnviromentPair *ParseLine(char *line) +{ +char *tmpPtr; +static EnviromentPair *Env; +unsigned short length = strlen(line); + +Env->key = ""; +Env->value = ""; + +for (tmpPtr = line; *tmpPtr; tmpPtr++) + { + if (*tmpPtr == '=') + { + *tmpPtr = 0; + Env->key = line; + if (strlen(Env->key) < length) + { + Env->value = ++tmpPtr; + } + return Env; + } + } +return Env; +} + + + + + +char *getenv(const char *name) +{ +FILE *fp; +char *LineStr = NULL; +EnviromentPair *Env1; +FSSpec spec; +OSErr err; + +if (IgnoreEnvironment) + return NULL; /* user wants to ignore the environment vars */ + +if (name == NULL) + return NULL; + +GetCompletePath(CompletePath,"MacZip.Env",&spec,&err); + +/* try open the file in the current folder */ +fp = FSp_fopen(&spec,"r"); +if (fp == NULL) + { /* Okey, lets try open the file in the preference folder */ + FSpFindFolder_Name( + kOnSystemDisk, + kPreferencesFolderType, + kDontCreateFolder, + &spec, + "\pMacZip.Env"); + fp = FSp_fopen(&spec,"r"); + if (fp == NULL) + { + return NULL; /* there is no enviroment-file */ + } + } + +LineStr = load_entry(fp); +while (LineStr != NULL) + { /* parse the file line by line */ + Env1 = ParseLine(LineStr); + if (strlen(Env1->value) > 0) + { /* we found a key/value pair */ + if (ListAllKeyValues) + printf("\n Line:%3d [%s] = [%s]",LineNumber,Env1->key,Env1->value); + if (stricmp(name,Env1->key) == 0) + { /* we found the value of a given key */ + return Env1->value; + } + } + LineStr = load_entry(fp); /* read next line */ + } +fclose(fp); + +return NULL; +} + + + + + +OSErr FSpFindFolder_Name( + short vRefNum, /* Volume reference number. */ + OSType folderType, /* Folder type taken by FindFolder. */ + Boolean createFolder, /* Should we create it if non-existant. */ + FSSpec *spec, /* Pointer to resulting directory. */ + unsigned char *name) /* Name of the file in the folder */ +{ + short foundVRefNum; + long foundDirID; + OSErr err; + + err = FindFolder(vRefNum, folderType, createFolder, + &foundVRefNum, &foundDirID); + if (err != noErr) + { + return err; + } + + err = FSMakeFSSpec(foundVRefNum, foundDirID, name, spec); + return err; +} + + + + +void ShowAllKeyValues(void) +{ +OSErr err; +FSSpec spec; +Boolean tmpIgnoreEnvironment = IgnoreEnvironment; + +ListAllKeyValues = 1; +IgnoreEnvironment = false; + +GetCompletePath(CompletePath,"MacZip.Env",&spec,&err); +if (err != 0) + { /* Okey, lets try open the file in the preference folder */ + FSpFindFolder_Name( + kOnSystemDisk, + kPreferencesFolderType, + kDontCreateFolder, + &spec, + "\pMacZip.Env"); + GetFullPathFromSpec(CompletePath,&spec, &err); + if (err != 0) + { + return; /* there is no enviroment-file */ + } + } + +printf("\nLocation of the current \"MacZip.Env\" file:\n [%s]",CompletePath); + +printf("\n\nList of all environment variables\n"); +getenv(" "); +printf("\n\nEnd\n\n"); + +/* restore used variables */ +ListAllKeyValues = 0; +LineNumber = 0; +IgnoreEnvironment = tmpIgnoreEnvironment; +} + + + + + + + + + + + +const char *BOINC_RCSID_ff8ca61fc4 = "$Id: getenv.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/helpers.c boinc-7.0.14+dfsg/zip/zip/macos/source/helpers.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/helpers.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/helpers.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,479 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + helpers.c + + Some useful functions Used by unzip and zip. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include "zip.h" +#include +#include +#include + +#include "macstuff.h" +#include "helpers.h" +#include "pathname.h" + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + + +extern int noisy; +extern char MacPathEnd; +extern char *zipfile; /* filename of the Zipfile */ +extern char *tempzip; /* Temporary zip file name */ +extern ZCONST unsigned char MacRoman_to_WinCP1252[128]; + + +static char argStr[1024]; +static char *argv[MAX_ARGS + 1]; + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + +/* +** Copy a C string to a Pascal string +** +*/ +unsigned char *CToPCpy(unsigned char *pstr, char *cstr) +{ + register char *dptr; + register unsigned len; + + len=0; + dptr=(char *)pstr+1; + while (len<255 && (*dptr++ = *cstr++)!='\0') ++len; + *pstr= (unsigned char)len; + return pstr; +} + + + +/* +** Copy a Pascal string to a C string +** +*/ + +char *PToCCpy(unsigned char *pstr, char *cstr) +{ +strncpy(cstr, (char *) &pstr[1], *pstr); + cstr[pstr[0]] = '\0'; /* set endmarker for c-string */ +return cstr; +} + + +/* +** strcpy() and strcat() work-alikes which allow overlapping buffers. +*/ + +char *sstrcpy(char *to,const char *from) +{ + memmove(to, from, 1+strlen(from)); + return to; +} + +char *sstrcat(char *to,const char *from) +{ + sstrcpy(to + strlen(to), from); + return to; +} + + + +/* +** Alloc memory and init it +** +*/ +char *StrCalloc(unsigned short size) +{ +char *strPtr = NULL; + +if ((strPtr = calloc(size, sizeof(char))) == NULL) + printerr("StrCalloc failed:", -1, size, __LINE__, __FILE__, ""); + +Assert_it(strPtr,"strPtr == NULL","") +return strPtr; +} + + + +/* +** Release only non NULL pointers +** +*/ +char *StrFree(char *strPtr) +{ + +if (strPtr != NULL) + { + free(strPtr); + } + +return NULL; +} + + + + +/* +** Return a value in a binary string +** +*/ + +char *sBit2Str(unsigned short value) +{ + static char str[sizeof(value)*8]; + int biz = 16; + int strwid = 16; + int i, j; + char *tempPtr = str; + + j = strwid - (biz + (biz >> 2)- (biz % 4 ? 0 : 1)); + + for (i = 0; i < j; i++) { + *tempPtr++ = ' '; + } + while (--biz >= 0) + { + *tempPtr++ = ((value >> biz) & 1) + '0'; + if (!(biz % 4) && biz) { + *tempPtr++ = ' '; + } + } + *tempPtr = '\0'; + + return str; +} + + + + +/* +** Parse commandline style arguments +** +*/ + +int ParseArguments(char *s, char ***arg) +{ + int n = 1, Quote = 0; + char *p = s, *p1, c; + + argv[0] = GetAppName(); + + *arg = argv; + + p1 = (char *) argStr; + while ((c = *p++) != 0) { + if (c==' ') continue; + argv[n++] = p1; + if (n > MAX_ARGS) + return (n-1); + do { + if (c=='\\' && *p++) + c = *p++; + else + if ((c=='"') || (c == '\'')) { + if (!Quote) { + Quote = c; + continue; + } + if (c == Quote) { + Quote = 0; + continue; + } + } + *p1++ = c; + } while (*p && ((c = *p++) != ' ' || Quote)); + *p1++ = '\0'; + } + return n; +} + + + +/* +** Print commandline style arguments +** +*/ + +void PrintArguments(int argc, char **argv) +{ + +printf("\n Arguments:"); +printf("\n --------------------------"); + +while(--argc >= 0) + printf("\n argc: %d argv: [%s]", argc, &*argv[argc]); + +printf("\n --------------------------\n\n"); +return; +} + + + +/* +** return some error-msg on file-system +** +*/ + +int PrintUserHFSerr(int cond, int err, char *msg2) +{ +char *msg; + +if (cond != 0) + { + switch (err) + { + case -35: + msg = "No such Volume"; + break; + + case -56: + msg = "No such Drive"; + break; + + case -37: + msg = "Bad Volume Name"; + break; + + case -49: + msg = "File is already open for writing"; + break; + + case -43: + msg = "Directory/File not found"; + break; + + case -120: + msg = "Directory/File not found or incomplete pathname"; + break; + + default: return err; + } + fprintf(stderr, "\n\n Error: %s ->%s", msg, msg2); + exit(err); + } + +return 0; +} + + + +/* +** Check mounted volumes and return number of volumes +** with the same name. +*/ + +short CheckMountedVolumes(char *FullPath) +{ +FSSpec volumes[50]; /* 50 Volumes should be enough */ +char VolumeName[257], volume[257]; +short actVolCount, volIndex = 1, VolCount = 0; +OSErr err; +int i; + +GetVolumeFromPath(FullPath, VolumeName); + +err = OnLine(volumes, 50, &actVolCount, &volIndex); +printerr("OnLine:", (err != -35) && (err != 0), err, __LINE__, __FILE__, ""); + +for (i=0; i < actVolCount; i++) + { + PToCCpy(volumes[i].name,volume); + if (stricmp(volume, VolumeName) == 0) VolCount++; + } +printerr("OnLine: ", (VolCount == 0), VolCount, __LINE__, __FILE__, FullPath); + +return VolCount; +} + + + + + + + + +/* +** compares strings, ignoring differences in case +** +*/ + +int stricmp(const char *p1, const char *p2) +{ +int diff; + +while (*p1 && *p2) + { + if (*p1 != *p2) + { + if (isalpha(*p1) && isalpha(*p2)) + { + diff = toupper(*p1) - toupper(*p2); + if (diff) return diff; + } + else break; + } + p1++; + p2++; + } +return *p1 - *p2; +} + + + +/* +** Convert the MacOS-Strings (Filenames/Findercomments) to a most compatible. +** These strings will be stored in the public area of the zip-archive. +** Every foreign platform (outside macos) will access these strings +** for extraction. +*/ + +void MakeCompatibleString(char *MacOS_Str, + const char SpcChar1, const char SpcChar2, + const char SpcChar3, const char SpcChar4, + short CurrTextEncodingBase) +{ + char *tmpPtr; + register uch curch; + + Assert_it(MacOS_Str,"MakeCompatibleString MacOS_Str == NULL","") + for (tmpPtr = MacOS_Str; (curch = *tmpPtr) != '\0'; tmpPtr++) + { + if (curch == SpcChar1) + *tmpPtr = SpcChar2; + else + if (curch == SpcChar3) + *tmpPtr = SpcChar4; + else /* default */ + /* now convert from MacRoman to ISO-8859-1 */ + /* but convert only if MacRoman is activ */ + if ((CurrTextEncodingBase == kTextEncodingMacRoman) && + (curch > 127)) + { + *tmpPtr = (char)MacRoman_to_WinCP1252[curch - 128]; + } + } /* end for */ +} + + + + +Boolean CheckForSwitch(char *Switch, int argc, char **argv) +{ + char *p; /* steps through option arguments */ + int i; /* arg counter, root directory flag */ + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + if (argv[i][1]) + { + for (p = argv[i]+1; *p; p++) + { + if (*p == Switch[0]) + { + return true; + } + if ((Switch[1] != NULL) && + ((*p == Switch[0]) && (*p == Switch[1]))) + { + return true; + } + } + } + } + } + +return false; +} + + + + + + + +#if (defined(USE_SIOUX) || defined(MACUNZIP_STANDALONE)) + +/* +** checks the condition and returns an error-msg +** this function is for internal use only +*/ + +OSErr printerr(const char *msg, int cond, int err, int line, char *file, + const char *msg2) +{ + +if (cond != 0) + { + fprintf(stderr, "\nint err: %d: %s %d [%d/%s] {%s}\n", clock(), msg, err, + line, file, msg2); + } + +return cond; +} + + +/* +fake-functions: +Not Implemented for metrowerks SIOUX +*/ + +void leftStatusString(char *status) +{ +status = status; +} + + +void rightStatusString(char *status) +{ +status = status; +} + + + +void DoWarnUserDupVol( char *FullPath ) +{ + char VolName[257]; + GetVolumeFromPath(FullPath, VolName); + + printf("\n There are more than one volume that has the same name !!\n"); + + printf("\n Volume: %s\n",VolName); + + printf("\n This port has one weak point:"); + printf("\n It is based on pathnames. As you may be already know:"); + printf("\n Pathnames are not unique on a Mac !"); + printf("\n MacZip has problems to find the correct location of"); + printf("\n the archive or the files.\n"); + + printf("\n My (Big) recommendation: Name all your volumes with an"); + printf("\n unique name and MacZip will run without any problem."); +} + + + +#endif + +const char *BOINC_RCSID_ca3ad280be = "$Id: helpers.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/helpers.h boinc-7.0.14+dfsg/zip/zip/macos/source/helpers.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/helpers.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/helpers.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,57 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef HELPERS_H +#define HELPERS_H 1 + + /* Convert a C string to a Pascal string */ +unsigned char *CToPCpy(unsigned char *pstr, char *cstr); + + /* Convert a Pascal string to a C string */ +char *PToCCpy(unsigned char *pstr, char *cstr); + +char *sstrcpy(char *to,const char *from); +char *sstrcat(char *to,const char *from); + +char *StrCalloc(unsigned short size); +char *StrFree(char *strPtr); + +char *sBit2Str(unsigned short value); + +void print_extra_info(void); + +int ParseArguments(char *s, char ***arg); +void PrintArguments(int argc, char **argv); + +Boolean IsZipFile(char *name); +OSErr printerr(const char *msg, int cond, int err, int line, char *file, + const char *msg2); +int PrintUserHFSerr(int cond, int err, char *msg2); + +short CheckMountedVolumes(char *FullPath); +void DoWarnUserDupVol(char *path); + +void PrintFileInfo(void); + +int stricmp(const char *p1, const char *p2); +void leftStatusString(char *status); +void rightStatusString(char *status); + +Boolean isZipFile(FSSpec *fileToOpen); + +unsigned long MacFileDate_to_UTime(unsigned long mactime); +Boolean CheckForSwitch(char *Switch, int argc, char **argv); + +void MakeCompatibleString(char *MacOS_Str, + const char SpcChar1, const char SpcChar2, + const char SpcChar3, const char SpcChar4, + short CurrTextEncodingBase); + +#define MAX_ARGS 25 + +#endif /* HELPERS_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/macglob.h boinc-7.0.14+dfsg/zip/zip/macos/source/macglob.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/macglob.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/macglob.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,86 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef _MACGLOBAL_ +#define _MACGLOBAL_ + +#include + +/* +all my Global vars are defined here. +*/ + +#define ResourceFork -1 +#define DataFork 1 +#define NoFork 0 + +/* +all my Global vars are defined here. +*/ +typedef struct { + short CurrentFork; + short MacZipMode; + + Boolean isMacStatValid; + Boolean HaveGMToffset; + + short CurrTextEncodingBase; + + /* info about the current file */ + Boolean isDirectory; + char FullPath[NAME_MAX]; + char FileName[NAME_MAX]; + FSSpec fileSpec; + + long dirID; + CInfoPBRec fpb; + + /* time infos about the current file */ + time_t CreatDate; + time_t ModDate; + time_t BackDate; + long Cr_UTCoffs; /* offset "local time - UTC" for CreatDate */ + long Md_UTCoffs; /* offset "local time - UTC" for ModDate */ + long Bk_UTCoffs; /* offset "local time - UTC" for BackDate */ + + /* some statistics over all*/ + unsigned long FoundFiles; + unsigned long FoundDirectories; + unsigned long RawCountOfItems; + unsigned long BytesOfData; + + unsigned long attrsize; + + /* some switches and user parameters */ + Boolean DataForkOnly; + Boolean StoreFullPath; + Boolean StoreFoldersAlso; /* internal switch is true if '-r' is set */ + unsigned short SearchLevels; + char Pattern[NAME_MAX]; + Boolean IncludeInvisible; + Boolean StatingProgress; + + char SearchDir[NAME_MAX]; + char CurrentPath[NAME_MAX]; + + /* current zip / tempzip file info */ + char ZipFullPath[NAME_MAX]; + + FSSpec ZipFileSpec; + unsigned long ZipFileType; + char TempZipFullPath[NAME_MAX]; + FSSpec TempZipFileSpec; + +} MacZipGlobals; + + + +void UserStop(void); + + +#endif diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/macopen.c boinc-7.0.14+dfsg/zip/zip/macos/source/macopen.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/macopen.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/macopen.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,365 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*** macopen.c; stuff only required for the Mac port ***/ + +#include "zip.h" + +#include +#include +#include +#include + +#include "helpers.h" +#include "pathname.h" +#include "macopen.h" +#include "macstuff.h" + +#ifdef MACZIP +#include "macglob.h" + +extern char *zipfile; /* filename of the Zipfile */ +extern char *tempzip; /* Temporary zip file name */ + +extern MacZipGlobals MacZip; + + +/* don't include "osdep.h" otherwise we will trap into endless loop */ +#undef open +#undef fopen + + + +FILE *MacFopen(const char *path, const char *mode) +{ +static char TruncPath[NAME_MAX]; +OSErr err = 0; + +AssertStr(path,path) + + /* open zipfile or tempzip */ +if (strcmp(zipfile,path) == 0) + { + GetCompletePath(MacZip.ZipFullPath,path,&MacZip.ZipFileSpec,&err); + err = PrintUserHFSerr((err != -43) && (err != 0), err, path); + printerr("GetCompletePath:",err,err,__LINE__,__FILE__,path); + if (CheckMountedVolumes(MacZip.ZipFullPath) > 1) + DoWarnUserDupVol(MacZip.ZipFullPath); + + /* tempfile should appear in the same directory of the zipfile + -> save path of zipfile */ + TruncFilename(TruncPath, MacZip.ZipFullPath); + return fopen(MacZip.ZipFullPath, mode); + } + +if (strcmp(tempzip,path) == 0) + { /* add path of zipfile */ + sstrcat(TruncPath,tempzip); + GetCompletePath(MacZip.TempZipFullPath,TruncPath,&MacZip.TempZipFileSpec,&err); + err = PrintUserHFSerr((err != -43) && (err != 0), err, path); + printerr("GetCompletePath:",err,err,__LINE__,__FILE__,path); + + return fopen(MacZip.TempZipFullPath, mode); + } + +printerr("MacFopen:",err,err,__LINE__,__FILE__,path); +return NULL; +} + + + + +int MacOpen(const char *path,int oflag, ...) +{ +char RealFname[NAME_MAX]; + +AssertStr(path,path) + +RfDfFilen2Real(RealFname,path, MacZip.MacZipMode, MacZip.DataForkOnly, &MacZip.CurrentFork); +/* convert to real fname and init global var MacZip.CurrentFork !! */ + +switch (MacZip.CurrentFork) + { + case DataFork: + { + return my_open(RealFname, oflag); + break; + } + case ResourceFork: + { + return my_open( RealFname, oflag | O_RSRC); + break; + } + default: /* for now (Zip ver 2.3b) MacOpen should never reach this point */ + { /* however, this may change in the future ... */ + printerr("open: no resource / datafork ",-1,-1,__LINE__,__FILE__,path); + return -1; + } + } +} + + +#ifdef muell + /* file to delete */ +int destroy(char *path) +{ +static char lastpath[NAME_MAX]; +char currpath[NAME_MAX]; +static Boolean FirstCall = true; +long rc; + +AssertStr(path,path) + +RfDfFilen2Real(currpath, path, MacZip.MacZipMode, MacZip.DataForkOnly, &MacZip.CurrentFork); + +if (FirstCall == true) + { + FirstCall = false; + rc = remove(currpath); + } +else if (strcmp(currpath,lastpath) == 0) return 0; /* ignore, file is already deleted */ + else rc = remove(currpath); /* we are removeing all the files only by their + pathname this is dangerous on a mac but there is no other way without + a complete rewrite of the port */ + +strcpy(lastpath,currpath); + +return rc; +} +#endif + + + + +/* this function replaces the function "replace()" defined in fileio.c */ +int replace(char *new_f, char *temp_f) /* destination and source file names */ +{ +OSErr err = 0; +char newfname[NAME_MAX]; + +AssertStr(new_f,new_f) +AssertStr(temp_f,temp_f) + +UserStop(); + +GetFilename(newfname, new_f); + +/* check zipfile name and tempfile name */ +/* we are using this function only for replacing the tempfile with the zipfile */ +if ((strcmp(zipfile,new_f) == 0) || (strcmp(tempzip,temp_f) == 0)) + { + remove(MacZip.ZipFullPath); + + /* rename the temp file to the zip file */ + err = rename(MacZip.TempZipFullPath,MacZip.ZipFullPath); + printerr("rename:",err,err,__LINE__,__FILE__,MacZip.TempZipFullPath); +if (err != 0) return ZE_CREAT; + else return ZE_OK; + } +else return ZE_CREAT; +} + + + + /* file to delete */ + /* we are removeing all the files only by their + pathname this is dangerous on a mac but there is no + other way without a complete rewrite of the port */ + +int destroy(char *path) +{ +static char lastpath[NAME_MAX]; +static FSSpec trashfolder; +static Boolean FirstCall = true; +static char Num = 0; +static Boolean Immediate_File_Deletion = false; +char currpath[NAME_MAX], *envptr; +FSSpec fileToDelete; +OSErr err; + +/* init this function */ +if ((path == NULL) || + (strlen(path) == 0)) + { + FirstCall = true; + Num = 0; + return -1; + } + +UserStop(); + +RfDfFilen2Real(currpath, path, MacZip.MacZipMode, + MacZip.DataForkOnly, &MacZip.CurrentFork); +GetCompletePath(currpath,currpath,&fileToDelete, &err); + +if (FirstCall == true) + { + FirstCall = false; + sstrcpy(lastpath,currpath); + err = FSpFindFolder(fileToDelete.vRefNum, kTrashFolderType, + kDontCreateFolder,&trashfolder); + printerr("FSpFindFolder:",err,err,__LINE__,__FILE__,path); + + envptr = getenv("Immediate_File_Deletion"); + if (!(envptr == (char *)NULL || *envptr == '\0')) + { + if (stricmp(envptr,"yes") == 0) + Immediate_File_Deletion = true; + else + Immediate_File_Deletion = false; + } + + if (Immediate_File_Deletion) + { + err = FSpDelete(&fileToDelete); + return err; + } + + err = CatMove (fileToDelete.vRefNum, fileToDelete.parID, + fileToDelete.name, trashfolder.parID, trashfolder.name); + return err; + } + +if (strcmp(currpath,lastpath) == 0) + { + return 0; /* ignore, file is already deleted */ + } +else + { + + if (Immediate_File_Deletion) + { + err = FSpDelete(&fileToDelete); + sstrcpy(lastpath,path); + return err; + } + + err = CatMove (fileToDelete.vRefNum, fileToDelete.parID, + fileToDelete.name, trashfolder.parID, trashfolder.name); + + /* -48 = file is already existing so we have to rename it before + moving the file */ + if (err == -48) + { + Num++; + if (fileToDelete.name[0] >= 28) /* cut filename if to long */ + fileToDelete.name[0] = 28; + P2CStr(fileToDelete.name); + sprintf(currpath,"%s~%d",(char *)fileToDelete.name,Num); + C2PStr(currpath); + C2PStr((char *)fileToDelete.name); + err = HRename (fileToDelete.vRefNum, fileToDelete.parID, + fileToDelete.name, (unsigned char *) currpath); + err = CatMove (fileToDelete.vRefNum, fileToDelete.parID, + (unsigned char *) currpath, trashfolder.parID, + trashfolder.name); + } + } + +sstrcpy(lastpath,currpath); +return err; +} + + + +#endif /* #ifdef MACZIP */ + + + + +/* + * int open(const char *path, int oflag) + * + * Opens a file stream. + */ +int my_open(char *path, int oflag) +{ + FSSpec spec; + char permission; + HParamBlockRec hpb; + OSErr err, errno; + Boolean targetIsFolder, wasAliased; + + AssertStr(path,path) + + /* Setup permission */ + if ((oflag & 0x03) == O_RDWR) + permission = fsRdWrPerm; + else + permission = (oflag & O_RDONLY) ? fsRdPerm : 0 + (oflag & O_WRONLY) ? fsWrPerm : 0; + + FSpLocationFromFullPath(strlen(path),path, &spec); + if ((oflag & (O_ALIAS | O_NRESOLVE)) == 0) + ResolveAliasFile(&spec, true, &targetIsFolder, &wasAliased); + hpb.fileParam.ioNamePtr = spec.name; + hpb.fileParam.ioVRefNum = spec.vRefNum; + hpb.fileParam.ioDirID = spec.parID; + hpb.ioParam.ioPermssn = permission; + + if (oflag & O_RSRC) /* open the resource fork of the file */ + err = PBHOpenRFSync(&hpb); + else /* open the data fork of the file */ + err = PBHOpenDFSync(&hpb); + + if ((err == fnfErr) && (oflag & O_CREAT)) { + hpb.fileParam.ioFlVersNum = 0; + err = PBHCreateSync(&hpb); + if (err == noErr) { + /* Set the finder info */ + unsigned long secs; + unsigned long isbinary = oflag & O_BINARY; + + hpb.fileParam.ioFlFndrInfo.fdType = '\?\?\?\?'; + hpb.fileParam.ioFlFndrInfo.fdCreator = '\?\?\?\?'; + hpb.fileParam.ioFlFndrInfo.fdFlags = 0; + if (oflag & O_ALIAS) /* set the alias bit */ + hpb.fileParam.ioFlFndrInfo.fdFlags = kIsAlias; + else /* clear all flags */ + hpb.fileParam.ioFlFndrInfo.fdFlags = 0; + + GetDateTime(&secs); + hpb.fileParam.ioFlCrDat = hpb.fileParam.ioFlMdDat = secs; + PBHSetFInfoSync(&hpb); + } + + if (err && (err != dupFNErr)) { + errno = err; return -1; + } + + if (oflag & O_RSRC) /* open the resource fork of the file */ + err = PBHOpenRFSync(&hpb); + else /* open the data fork of the file */ + err = PBHOpenDFSync(&hpb); + } + + if (err && (err != dupFNErr) && (err != opWrErr)) { + errno = err; return -1; + } + + if (oflag & O_TRUNC) { + IOParam pb; + + pb.ioRefNum = hpb.ioParam.ioRefNum; + pb.ioMisc = 0L; + err = PBSetEOFSync((ParmBlkPtr)&pb); + if (err != noErr) { + errno = err; return -1; + } + } + + if (oflag & O_APPEND) lseek(hpb.ioParam.ioRefNum,0,SEEK_END); + + return (hpb.ioParam.ioRefNum); +} + + + + + + +const char *BOINC_RCSID_9a1fb79b04 = "$Id: macopen.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/macopen.h boinc-7.0.14+dfsg/zip/zip/macos/source/macopen.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/macopen.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/macopen.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,21 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef __MACOPEN_H__ +#define __MACOPEN_H__ + +#include +#include + + +FILE *MacFopen(const char *path, const char *mode); +int MacOpen(const char *path, int oflag, ...); + +int my_open(char *path, int oflag); + +#endif /* __MACOPEN_H__ */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/macos.c boinc-7.0.14+dfsg/zip/zip/macos/source/macos.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/macos.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/macos.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1086 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + macos.c + + Macintosh-specific routines for use with Info-ZIP's Zip 2.3 and later. + + ---------------------------------------------------------------------------*/ + + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include "zip.h" + +#include "revision.h" +#include "z_crypt.h" + +#include +#include +#include +#include + +#include + +#include +#include + +/* #include "charmap.h" */ +#include "helpers.h" +#include "macstuff.h" +#include "pathname.h" +#include "recurse.h" + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define PATH_END MacPathEnd + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +int error_level; /* used only in ziperr() */ + + +/* Note: sizeof() returns the size of this allusion + 13 is current length of "XtraStuf.mac:" */ +extern const char ResourceMark[13]; /* var is initialized in file pathname.c */ + + +extern jmp_buf EnvForExit; +MacZipGlobals MacZip; + +unsigned long count_of_Zippedfiles = 0; + + +/*****************************************************************************/ +/* Module level Vars */ +/*****************************************************************************/ + +static const char MacPathEnd = ':'; /* the Macintosh dir separator */ + +/* Inform Progress vars */ +long estTicksToFinish; +long createTime; +long updateTicks; + +static char *Time_Est_strings[] = { + "Zipping Files; Items done:", + "More than 24 hours", + "More than %s hours", + "About %s hours, %s minutes", + "About an hour", + "Less than an hour", + "About %s minutes, %s seconds", + "About a minute", + "Less than a minute", + "About %s seconds", + "About a second", + "About 1 minute, %s seconds"}; + + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +int DoCurrentDir(void); + +void DoAboutBox(void); +void DoQuit(void); +void DoEventLoop(void); + +void ZipInitAllVars(void); +void UserStop(void); +Boolean IsZipFile(char *name); + +static long EstimateCompletionTime(const long progressMax, + const long progressSoFar, unsigned char percent); +static void UpdateTimeToComplete(void); + + + + +#ifdef USE_SIOUX +#include +void DoWarnUserDupVol( char *FullPath ); + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +/* +** Standalone Unzip with Metrowerks SIOUX starts here +** +*/ +int main(int argc, char **argv) +{ + int return_code; + + SIOUXSettings.asktosaveonclose = FALSE; + SIOUXSettings.showstatusline = TRUE; + + SIOUXSettings.columns = 100; + SIOUXSettings.rows = 40; + + /* 30 = MacZip Johnny Lee's; 40 = new (my) MacZip */ + MacZip.MacZipMode = NewZipMode_EF; + + argc = ccommand(&argv); + if (verbose) PrintArguments(argc, argv); + + ZipInitAllVars(); + + return_code = zipmain(argc, argv); + + if (verbose) printf("\n\n Finish"); + return return_code; +} + + + +/* +** SIOUX needs no extra event handling +** +*/ + +void UserStop(void) +{ +}; + + + + +/* +** Password enter function '*' printed for each char +** +*/ + +int macgetch(void) +{ + WindowPtr whichWindow; + EventRecord theEvent; + char c; /* one-byte buffer for read() to use */ + + do { + SystemTask(); + if (!GetNextEvent(everyEvent, &theEvent)) + theEvent.what = nullEvent; + else { + switch (theEvent.what) { + case keyDown: + c = theEvent.message & charCodeMask; + break; + case mouseDown: + if (FindWindow(theEvent.where, &whichWindow) == + inSysWindow) + SystemClick(&theEvent, whichWindow); + break; + case updateEvt: + break; + } + } + } while (theEvent.what != keyDown); + + printf("*"); + fflush(stdout); + + return (int)c; +} + +#endif + + + + +/******************************/ +/* Function version_local() */ +/******************************/ + +/* +** Print Compilers version and compile time/date +** +*/ + +void version_local() +{ +/* prints e.g: +Compiled with Metrowerks CodeWarrior version 2000 for PowerPC Processor + compile time: Feb 4 1998 17:49:49. +*/ + +static ZCONST char CompiledWith[] = + "\n\nCompiled with %s %x for %s \n %s %s %s.\n\n"; + + printf(CompiledWith, + + +#ifdef __MWERKS__ + " Metrowerks CodeWarrior version", __MWERKS__, +#endif + + +#ifdef __MC68K__ + " MC68K Processor", +#else + " PowerPC Processor", +#endif + +#ifdef __DATE__ + "compile time: ", __DATE__, __TIME__ +#else + "", "", "" +#endif + ); +} /* end function version_local() */ + + + + + +/* +** Deletes a dir if the switch '-m' is used +** +*/ + +int deletedir(char *path) +{ +static char Num = 0; +static FSSpec trashfolder; +static Boolean FirstCall = true; +static Boolean Immediate_File_Deletion = false; +OSErr err; +FSSpec dirToDelete; +char currpath[NAME_MAX], *envptr; +CInfoPBRec fpb; + +/* init this function */ +if ((path == NULL) || + (strlen(path) == 0)) + { + Num = 0; + FirstCall = true; + return -1; + } + +UserStop(); + +GetCompletePath(currpath,path,&dirToDelete, &err); + +if (FirstCall == true) + { + FirstCall = false; + envptr = getenv("Immediate_File_Deletion"); + if (!(envptr == (char *)NULL || *envptr == '\0')) + { + if (stricmp(envptr,"yes") == 0) + Immediate_File_Deletion = true; + else + Immediate_File_Deletion = false; + } + err = FSpFindFolder(dirToDelete.vRefNum, kTrashFolderType, + kDontCreateFolder,&trashfolder); + printerr("FSpFindFolder:",err,err,__LINE__,__FILE__,path); + } + + fpb.dirInfo.ioNamePtr = dirToDelete.name; + fpb.dirInfo.ioVRefNum = dirToDelete.vRefNum; + fpb.dirInfo.ioDrDirID = dirToDelete.parID; + fpb.dirInfo.ioFDirIndex = 0; + + err = PBGetCatInfoSync(&fpb); + printerr("PBGetCatInfo deletedir ", err, err, + __LINE__, __FILE__, ""); + +if (fpb.dirInfo.ioDrNmFls > 0) + { + return 0; /* do not move / delete folders which are not empty */ + } + +if (Immediate_File_Deletion) + { + err = FSpDelete(&dirToDelete); + return err; + } + +err = CatMove (dirToDelete.vRefNum, dirToDelete.parID, + dirToDelete.name, trashfolder.parID, trashfolder.name); + +/* -48 = file is already existing so we have to rename it before + moving the file */ +if (err == -48) + { + Num++; + if (dirToDelete.name[0] >= 28) /* cut foldername if to long */ + dirToDelete.name[0] = 28; + P2CStr(dirToDelete.name); + sprintf(currpath,"%s~%d",(char *)dirToDelete.name,Num); + C2PStr(currpath); + C2PStr((char *)dirToDelete.name); + err = HRename (dirToDelete.vRefNum, dirToDelete.parID, + dirToDelete.name, (unsigned char *) currpath); + + err = CatMove (dirToDelete.vRefNum, dirToDelete.parID, + (unsigned char *) currpath, trashfolder.parID, + trashfolder.name); + } + +return err; +} + + + + +/* +** Set the file-type so the archive will get the correct icon, type +** and creator code. +*/ + +void setfiletype(char *new_f, unsigned long Creator, unsigned long Type) +{ +OSErr err; + +if (strcmp(zipfile, new_f) == 0) + err = FSpChangeCreatorType(&MacZip.ZipFileSpec, Creator, Type); +printerr("FSpChangeCreatorType:", err, err, __LINE__, __FILE__, new_f); + +return; +} + + + + + +/* +** Convert the external (native) filename into Zip's internal Unix compatible +** name space. +*/ + +char *ex2in(char *externalFilen, int isdir, int *pdosflag) +/* char *externalFilen external file name */ +/* int isdir input: externalFilen is a directory */ +/* int *pdosflag output: force MSDOS file attributes? */ +/* Convert the external file name to a zip file name, returning the malloc'ed + string or NULL if not enough memory. */ +{ + char *internalFilen; /* internal file name (malloc'ed) */ + char *t; /* shortened name */ + char *Pathname; + char buffer[NAME_MAX]; + int dosflag; + + AssertStr(externalFilen, externalFilen) + AssertBool(isdir,"") + + dosflag = dosify; /* default for non-DOS and non-OS/2 */ + + /* Find starting point in name before doing malloc */ + for (t = externalFilen; *t == PATH_END; t++) + ; + + if (!MacZip.StoreFullPath) + { + Pathname = StripPartialDir(buffer, MacZip.SearchDir,t); + } + else + { + Pathname = t; + } + + /* Make changes, if any, to the copied name (leave original intact) */ + if (!pathput) + { + t = last(Pathname, PATH_END); + } + else t = Pathname; + + /* Malloc space for internal name and copy it */ + if ((internalFilen = malloc(strlen(t) + 10 + strlen(ResourceMark) )) == NULL) + return NULL; + + sstrcpy(internalFilen, t); + + /* we have to eliminate illegal chars: + * The name space for Mac filenames and Zip filenames (unix style names) + * do both include all printable extended-ASCII characters. The only + * difference we have to take care of is the single special character + * used as path delimiter: + * ':' on MacOS and '/' on Unix and '\' on Dos. + * So, to convert between Mac filenames and Unix filenames without any + * loss of information, we simply interchange ':' and '/'. Additionally, + * we try to convert the coding of the extended-ASCII characters into + * InfoZip's standard ISO 8859-1 codepage table. + */ + MakeCompatibleString(internalFilen, ':', '/', '/', ':', + MacZip.CurrTextEncodingBase); + + /* Returned malloc'ed name */ + if (pdosflag) + *pdosflag = dosflag; + + if (isdir) + { + return internalFilen; /* avoid warning on unused variable */ + } + + if (dosify) + { + msname(internalFilen); + printf("\n ex2in: %s",internalFilen); + } + + return internalFilen; +} + + + +/* +** Collect all filenames. Go through all directories +** +*/ + +int wild(char *Pathpat) + /* path/pattern to match */ +/* If not in exclude mode, expand the pattern based on the contents of the + file system. Return an error code in the ZE_ class. */ +{ +FSSpec Spec; +char fullpath[NAME_MAX]; +OSErr err; + +AssertStr(Pathpat, Pathpat); + +if (noisy) printf("%s \n\n",GetZipVersionsInfo()); + +if (extra_fields == 0) + { + MacZip.DataForkOnly = true; + } + +/* for switch '-R' -> '.' means current dir */ +if (strcmp(Pathpat,".") == 0) sstrcpy(Pathpat,"*"); + +sstrcpy(MacZip.Pattern,Pathpat); + +if (recurse) + { + MacZip.StoreFoldersAlso = true; + MacZip.SearchLevels = 0; /* if 0 we aren't checking levels */ + } +else + { + MacZip.StoreFoldersAlso = false; + MacZip.SearchLevels = 1; + } + +/* make complete path */ +GetCompletePath(fullpath, MacZip.Pattern, &Spec,&err); +err = PrintUserHFSerr((err != -43) && (err != 0), err, MacZip.Pattern); +printerr("GetCompletePath:", err, err, __LINE__, __FILE__, fullpath); + +/* extract the filepattern */ +GetFilename(MacZip.Pattern, fullpath); + +/* extract Path and get FSSpec of search-path */ +/* get FSSpec of search-path ; we need a dir to start + searching for filenames */ +TruncFilename(MacZip.SearchDir, fullpath); +GetCompletePath(MacZip.SearchDir, MacZip.SearchDir, &Spec,&err); + +if (noisy) { + if (MacZip.SearchLevels == 0) + { + printf("\nSearch Pattern: [%s] Levels: all", MacZip.Pattern); + } + else + { + printf("\nSearch Pattern: [%s] Levels: %d", MacZip.Pattern, + MacZip.SearchLevels); + } + printf("\nSearch Path: [%s]", MacZip.SearchDir); + printf("\nZip-File: [%s] \n",MacZip.ZipFullPath); + +} + +/* we are working only with pathnames; + * this can cause big problems on a mac ... + */ +if (CheckMountedVolumes(MacZip.SearchDir) > 1) + DoWarnUserDupVol(MacZip.SearchDir); + +/* start getting all filenames */ +err = FSpRecurseDirectory(&Spec, MacZip.SearchLevels); +printerr("FSpRecurseDirectory:", err, err, __LINE__, __FILE__, ""); + +return ZE_OK; +} + + + +/* +** Convert the internal filename into a external (native). +** The user will see this modified filename. +** For more performance: +** I do not completly switch back to the native macos filename. +** The user will still see directory separator '/' and the converted +** charset. +*/ + +char *in2ex(char *n) /* internal file name */ +/* Convert the zip file name to an external file name, returning the malloc'ed + string or NULL if not enough memory. */ +{ + char *x; /* external file name */ + + AssertStr(n,n) + + if ((x = malloc(strlen(n) + 1)) == NULL) + return NULL; + + RfDfFilen2Real(x, n, MacZip.MacZipMode, MacZip.DataForkOnly, + &MacZip.CurrentFork); + + return x; +} + + + + +/* +** Process on filenames. This function will be called to collect +** the filenames. +*/ + +int procname(char *filename, /* name to process */ + int caseflag) /* true to force case-sensitive match + (always false on a Mac) */ +/* Process a name . Return + an error code in the ZE_ class. */ +{ + int rc; /* matched flag */ + +AssertBool(caseflag,"caseflag") +AssertStr(filename,filename) + + /* add or remove name of file */ +rc = newname(filename, MacZip.isDirectory, caseflag); + +return rc; +} + + + + +ulg filetime( +char *f, /* name of file to get info on */ +ulg *a, /* return value: file attributes */ +long *n, /* return value: file size */ +iztimes *t) /* return value: access, modific. and creation times */ +/* If file *f does not exist, return 0. Else, return the file's last + modified date and time as an MSDOS date and time. The date and + time is returned in a long with the date most significant to allow + unsigned integer comparison of absolute times. Also, if a is not + a NULL pointer, store the file attributes there, with the high two + bytes being the Unix attributes, and the low byte being a mapping + of that to DOS attributes. If n is not NULL, store the file size + there. If t is not NULL, the file's access, modification and creation + times are stored there as UNIX time_t values. + If f is "-", use standard input as the file. If f is a device, return + a file size of -1 */ +{ + struct stat s; /* results of stat() */ + char name[NAME_MAX]; + int len; + + AssertStr(f,f) + + len = strlen(f); + sstrcpy(name, f); + + if (len == 0) return 0; + + if (SSTAT(name, &s) != 0) + /* Accept about any file kind including directories + * (stored with trailing : with -r option) + */ + return 0; + + if (a != NULL) { + *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); + if (MacZip.isDirectory) { + *a |= MSDOS_DIR_ATTR; + } + } + if (n != NULL) + *n = (s.st_mode & UNX_IFMT) == UNX_IFREG ? s.st_size : -1L; + if (t != NULL) { + t->atime = s.st_atime; + t->mtime = s.st_mtime; + t->ctime = s.st_ctime; /* on Mac, st_ctime contains creation time! */ + } + + return unix2dostime(&s.st_mtime); +} + + + +void stamp(char *f, ulg d) +/* char *f; name of file to change */ +/* ulg d; dos-style time to change it to */ +/* Set last updated and accessed time of file f to the DOS time d. */ +{ + time_t u[2]; /* argument for utime() */ + +f = f; + + /* Convert DOS time to time_t format in u */ + + u[0] = u[1] = dos2unixtime(d); +/* utime(f, u); */ +} + + + + +/* +** return only the longest part of the path: +** second parameter: Volume:test folder:second folder: +** third parameter: Volume:test folder:second folder:third folder:file +** result will be: third folder:file +** first parameter: contains string buffer that will be used to prepend +** the "resource mark" part in front of the result when +** a resource fork is processed in "M3" mode. +** +*/ + +char *StripPartialDir(char *CompletePath, + const char *PartialPath, const char *FullPath) +{ +const char *tmpPtr1 = PartialPath; +const char *tmpPtr2 = FullPath; +int result; + +Assert_it(CompletePath,"StripPartialDir","") +AssertStrNoOverlap(FullPath,PartialPath,PartialPath) + +if (MacZip.DataForkOnly) + { + tmpPtr2 += strlen(tmpPtr1); + return (char *)tmpPtr2; + } + +switch (MacZip.MacZipMode) + { + case JohnnyLee_EF: + { + tmpPtr2 += strlen(tmpPtr1); + return (char *)tmpPtr2; + break; + } + + case NewZipMode_EF: + { /* determine Fork type */ + result = strncmp(FullPath, ResourceMark, sizeof(ResourceMark)-2); + if (result != 0) + { /* data fork */ + MacZip.CurrentFork = DataFork; + tmpPtr2 += strlen(tmpPtr1); + return (char *)tmpPtr2; + } + else + { /* resource fork */ + MacZip.CurrentFork = ResourceFork; + sstrcpy(CompletePath, ResourceMark); + tmpPtr2 += strlen(tmpPtr1); + tmpPtr2 += sizeof(ResourceMark); + sstrcat(CompletePath, tmpPtr2); + return (char *)CompletePath; + } + break; + } + } + + return NULL; /* function should never reach this point */ +} + + + + +/* +** Init all global variables +** Must be called for each zip-run +*/ + +void ZipInitAllVars(void) +{ +getcwd(MacZip.CurrentPath, sizeof(MacZip.CurrentPath)); +/* MacZip.MacZipMode = JohnnyLee_EF; */ +MacZip.MacZipMode = NewZipMode_EF; + +MacZip.DataForkOnly = false; +MacZip.CurrentFork = NoFork; + +MacZip.StoreFoldersAlso = false; + +MacZip.FoundFiles = 0; +MacZip.FoundDirectories = 0; +MacZip.RawCountOfItems = 0; +MacZip.BytesOfData = 0; + +MacZip.StoreFullPath = false; +MacZip.StatingProgress = false; +MacZip.IncludeInvisible = false; + +MacZip.isMacStatValid = false; + +MacZip.CurrTextEncodingBase = FontScript(); + +MacZip.HaveGMToffset = false; + +createTime = TickCount(); +estTicksToFinish = -1; +updateTicks = 0; + +/* init some functions */ +IsZipFile(NULL); + +destroy(NULL); +deletedir(NULL); +ShowCounter(true); + +extra_fields = 1; +error_level = 0; +count_of_Zippedfiles = 0; +} + + + + +/* +** Get the findercomment and store it as file-comment in the Zip-file +** +*/ +char *GetComment(char *filename) +{ +OSErr err; +static char buffer[NAME_MAX]; +char buffer2[NAME_MAX]; +char *tmpPtr; + +if (filename == NULL) return NULL; + + /* now we can convert Unix-Path in HFS-Path */ +for (tmpPtr = filename; *tmpPtr; tmpPtr++) + if (*tmpPtr == '/') + *tmpPtr = ':'; + +if (MacZip.StoreFullPath) + { /* filename is already a fullpath */ + sstrcpy(buffer,filename); + } +else + { /* make a fullpath */ + sstrcpy(buffer,MacZip.SearchDir); + sstrcat(buffer,filename); + } + +/* make fullpath and get FSSpec */ +/* Unfortunately: I get only the converted filename here */ +/* so filenames with extended characters can not be found */ +GetCompletePath(buffer2,buffer, &MacZip.fileSpec, &err); +printerr("GetCompletePath:",(err != -43) && (err != -120) && (err != 0) , + err,__LINE__,__FILE__,buffer); + +err = FSpDTGetComment(&MacZip.fileSpec, (unsigned char *) buffer); +printerr("FSpDTGetComment:", (err != -5012) && (err != 0), err, + __LINE__, __FILE__, filename); +P2CStr((unsigned char *) buffer); +if (err == -5012) return NULL; /* no finder-comments found */ + +if (noisy) printf("\n%32s -> %s",filename, buffer); +/* +Beside the script change we need only to change 0x0d in 0x0a +so the last two arguments are not needed and does nothing. +*/ +MakeCompatibleString(buffer, 0x0d, 0x0a, ' ', ' ', + MacZip.CurrTextEncodingBase); + +return buffer; +} + + + + +/* +** Print a progress indicator for stating the files +** +*/ + +void PrintStatProgress(char *msg) +{ + +if (!noisy) return; /* do no output if noisy is false */ + +MacZip.StatingProgress = true; + +if (strcmp(msg,"done") == 0) + { + MacZip.StatingProgress = false; + printf("\n ... done \n\n"); + } +else printf("\n %s",msg); + +} + + + + +void InformProgress(const long progressMax, const long progressSoFar ) +{ +int curr_percent; +char no_time[5] = "..."; + +curr_percent = percent(progressMax, progressSoFar); + +if (curr_percent < 95) + { + estTicksToFinish = EstimateCompletionTime(progressMax, + progressSoFar, curr_percent); + } +else + { + rightStatusString(no_time); + leftStatusString(no_time); + } + +updateTicks = TickCount() + 60; +return; +} + + +void ShowCounter(Boolean reset) +{ +static char statusline[100]; +static unsigned long filecount = 0; + +if (reset) + { + filecount = 0; + return; + } + +if (noisy) + { + sprintf(statusline, "%6d", filecount++); + rightStatusString(statusline); + } +} + + +static long EstimateCompletionTime(const long progressMax, + const long progressSoFar, + unsigned char curr_percent) +{ + long max = progressMax, value = progressSoFar; + static char buf[100]; + unsigned long ticksTakenSoFar = TickCount() - createTime; + float currentRate = (float) ticksTakenSoFar / (float) value; + long newEst = (long)( currentRate * (float)( max - value )); + + sprintf(buf, "%d [%d%%]",progressSoFar, curr_percent); + rightStatusString(buf); + + estTicksToFinish = newEst; + + UpdateTimeToComplete(); + +return estTicksToFinish; +} + + + + + +static void UpdateTimeToComplete(void) +{ + short days, hours, minutes, seconds; + char estStr[255]; + Str15 xx, yy; + short idx = 0; + + if ( estTicksToFinish == -1 ) + return; + + days = estTicksToFinish / 5184000L; + hours = ( estTicksToFinish - ( days * 5184000L )) / 216000L; + minutes = ( estTicksToFinish - ( days * 5184000L ) - + ( hours * 216000L )) / 3600L; + seconds = ( estTicksToFinish - ( days * 5184000L ) - + ( hours * 216000L ) - ( minutes * 3600L )) / 60L; + + xx[0] = 0; + yy[0] = 0; + + if ( days ) + { + /* "more than 24 hours" */ + + idx = 1; + goto setEstTimeStr; + } + + if ( hours >= 8 ) + { + /* "more than x hours" */ + + NumToString( hours, xx ); + idx = 2; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 252000L ) /* > 1hr, 10 minutes */ + { + /* "about x hours, y minutes" */ + + NumToString( hours, xx ); + NumToString( minutes, yy ); + idx = 3; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 198000L ) /* > 55 minutes */ + { + /* "about an hour" */ + idx = 4; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 144000L ) /* > 40 minutes */ + { + /* "less than an hour" */ + + idx = 5; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 4200L ) /* > 1 minute, 10 sec */ + { + /* "about x minutes, y seconds */ + + NumToString( minutes, xx ); + NumToString( seconds, yy ); + + if ( minutes == 1 ) + idx = 11; + else + idx = 6; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 3000L ) /* > 50 seconds */ + { + /* "about a minute" */ + + idx = 7; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 1500L ) /* > 25 seconds */ + { + /* "less than a minute" */ + + idx = 8; + goto setEstTimeStr; + } + + if ( estTicksToFinish > 120L ) /* > 2 seconds */ + { + NumToString( seconds, xx ); + idx = 9; + goto setEstTimeStr; + } + + idx = 10; + + setEstTimeStr: + sprintf(estStr,Time_Est_strings[idx],P2CStr(xx),P2CStr(yy)); + leftStatusString((char *)estStr); +} + + + + + +/* +** Just return the zip version +** +*/ + +char *GetZipVersionsInfo(void) +{ +static char ZipVersion[100]; + +sprintf(ZipVersion, "Zip Module\n%d.%d%d%s of %s", Z_MAJORVER, Z_MINORVER, + Z_PATCHLEVEL, Z_BETALEVEL, REVDATE); + +return ZipVersion; +} + + + + +#ifndef USE_SIOUX + +/* +** Just return the copyright message +** +*/ + +char *GetZipCopyright(void) +{ +static char CopyR[300]; + +sstrcpy(CopyR, copyright[0]); +sstrcat(CopyR, copyright[1]); +sstrcat(CopyR, "\r\rPlease send bug reports to the authors at\r"\ + "Zip-Bugs@lists.wku.edu"); + +return CopyR; +} + + + + +/* +** Just return the compilers date/time +** +*/ + +char *GetZipVersionLocal(void) +{ +static char ZipVersionLocal[50]; + +sprintf(ZipVersionLocal, "[%s %s]", __DATE__, __TIME__); + +return ZipVersionLocal; +} + +#endif /* #ifndef USE_SIOUX */ + + + + + +const char *BOINC_RCSID_6f264625be = "$Id: macos.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/macstuff.c boinc-7.0.14+dfsg/zip/zip/macos/source/macstuff.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/macstuff.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/macstuff.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1726 @@ +/* +These Functions were originally part of More Files version 1.4.8 + +More Files fixes many of the broken or underfunctional +parts of the file system. + +More Files + +A collection of File Manager and related routines + +by Jim Luther (Apple Macintosh Developer Technical Support Emeritus) +with significant code contributions by Nitin Ganatra +(Apple Macintosh Developer Technical Support Emeritus) +Copyright 1992-1998 Apple Computer, Inc. +Portions copyright 1995 Jim Luther +All rights reserved. + +The Package "More Files" is distributed under the following +license terms: + + "You may incorporate this sample code into your + applications without restriction, though the + sample code has been provided "AS IS" and the + responsibility for its operation is 100% yours. + However, what you are not permitted to do is to + redistribute the source as "DSC Sample Code" after + having made changes. If you're going to + redistribute the source, we require that you make + it clear in the source that the code was descended + from Apple Sample Code, but that you've made + changes." + + +The following changes are made by Info-ZIP: + +- The only changes are made by pasting the functions + (mostly found in MoreFilesExtras.c / MoreFiles.c) + directly into macstuff.c / macstuff.h and slightly + reformatting the text (replacement of TABs by spaces, + removal/replacement of non-ASCII characters). + The code itself is NOT changed. + +This file has been modified by Info-ZIP for use in MacZip. +This file is NOT part of the original package More Files. + +More Files can be found on the MetroWerks CD and Developer CD from +Apple. You can also download the latest version from: + + http://members.aol.com/JumpLong/#MoreFiles + +Jim Luther's Home-page: + http://members.aol.com/JumpLong/ + + +*/ + +#include + + +#include "macstuff.h" + + + +extern int errno; + +static OSErr GetCommentFromDesktopFile(short vRefNum, + long dirID, + ConstStr255Param name, + Str255 comment); + +static OSErr GetCommentID(short vRefNum, + long dirID, + ConstStr255Param name, + short *commentID); + +static OSErr GetDesktopFileName(short vRefNum, + Str255 desktopName); + + +enum +{ + kBNDLResType = 'BNDL', + kFREFResType = 'FREF', + kIconFamResType = 'ICN#', + kFCMTResType = 'FCMT', + kAPPLResType = 'APPL' +}; + + +/*****************************************************************************/ + +/* +** File Manager FSp calls +*/ + +/*****************************************************************************/ + +pascal OSErr FSMakeFSSpecCompat(short vRefNum, + long dirID, + ConstStr255Param fileName, + FSSpec *spec) +{ + OSErr result; + +#if !__MACOSSEVENORLATER + if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) + { + Boolean isDirectory; + + result = GetObjectLocation(vRefNum, dirID, fileName, + &(spec->vRefNum), &(spec->parID), spec->name, + &isDirectory); + } + else +#endif /* !__MACOSSEVENORLATER */ + { + /* Let the file system create the FSSpec if it can since it does the job */ + /* much more efficiently than I can. */ + result = FSMakeFSSpec(vRefNum, dirID, fileName, spec); + + /* Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is */ + /* returned in the parID field when making an FSSpec to the volume's */ + /* root directory by passing a full pathname in MakeFSSpec's */ + /* fileName parameter. Fixed in Mac OS 8.1 */ + if ( (result == noErr) && (spec->parID == 0) ) + spec->parID = fsRtParID; + } + return ( result ); +} + + +/*****************************************************************************/ +/* FSHasFSSpecCalls returns true if the file system provides FSSpec calls. */ + +#if !__MACOSSEVENORLATER +static Boolean FSHasFSSpecCalls(void) +{ + long response; +#if !GENERATENODATA + static Boolean tested = false; + static Boolean result = false; +#else + Boolean result = false; +#endif + +#if !GENERATENODATA + if ( !tested ) + { + tested = true; +#endif + if ( Gestalt(gestaltFSAttr, &response) == noErr ) + { + result = ((response & (1L << gestaltHasFSSpecCalls)) != 0); + } +#if !GENERATENODATA + } +#endif + return ( result ); +} +#endif /* !__MACOSSEVENORLATER */ + + + +/*****************************************************************************/ +/* QTHasFSSpecCalls returns true if QuickTime provides FSSpec calls */ +/* except for FSpExchangeFiles. */ + +#if !__MACOSSEVENORLATER +static Boolean QTHasFSSpecCalls(void) +{ + long response; +#if !GENERATENODATA + static Boolean tested = false; + static Boolean result = false; +#else + Boolean result = false; +#endif + +#if !GENERATENODATA + if ( !tested ) + { + tested = true; +#endif + result = (Gestalt(gestaltQuickTimeVersion, &response) == noErr); +#if !GENERATENODATA + } +#endif + return ( result ); +} +#endif /* !__MACOSSEVENORLATER */ + + + + +/* + *---------------------------------------------------------------------- + * + * FSpGetDefaultDir -- + * + * This function gets the current default directory. + * + * Results: + * The provided FSSpec is changed to point to the "default" + * directory. The function returns what ever errors + * FSMakeFSSpecCompat may encounter. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int FSpGetDefaultDir(FSSpecPtr dirSpec) /* On return the default directory. */ +{ + OSErr err; + short vRefNum = 0; + long int dirID = 0; + + err = HGetVol(NULL, &vRefNum, &dirID); + + if (err == noErr) { + err = FSMakeFSSpecCompat(vRefNum, dirID, (ConstStr255Param) NULL, + dirSpec); + } + + return err; +} + +/* + *---------------------------------------------------------------------- + * + * FSpSetDefaultDir -- + * + * This function sets the default directory to the directory + * pointed to by the provided FSSpec. + * + * Results: + * The function returns what ever errors HSetVol may encounter. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int FSpSetDefaultDir(FSSpecPtr dirSpec) /* The new default directory. */ +{ + OSErr err; + + /* + * The following special case is needed to work around a bug + * in the Macintosh OS. (Acutally PC Exchange.) + */ + + if (dirSpec->parID == fsRtParID) { + err = HSetVol(NULL, dirSpec->vRefNum, fsRtDirID); + } else { + err = HSetVol(dirSpec->name, dirSpec->vRefNum, dirSpec->parID); + } + + return err; +} + +/* + *---------------------------------------------------------------------- + * + * FSpFindFolder -- + * + * This function is a version of the FindFolder function that + * returns the result as a FSSpec rather than a vRefNum and dirID. + * + * Results: + * Results will be simaler to that of the FindFolder function. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +OSErr +FSpFindFolder( + short vRefNum, /* Volume reference number. */ + OSType folderType, /* Folder type taken by FindFolder. */ + Boolean createFolder, /* Should we create it if non-existant. */ + FSSpec *spec) /* Pointer to resulting directory. */ +{ + short foundVRefNum; + long foundDirID; + OSErr err; + + err = FindFolder(vRefNum, folderType, createFolder, + &foundVRefNum, &foundDirID); + if (err != noErr) { + return err; + } + + err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", spec); + return err; +} + + + +/* + *---------------------------------------------------------------------- + * + * FSpPathFromLocation -- + * + * This function obtains a full path name for a given macintosh + * FSSpec. Unlike the More Files function FSpGetFullPath, this + * function will return a C string in the Handle. It also will + * create paths for FSSpec that do not yet exist. + * + * Results: + * OSErr code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +OSErr +FSpPathFromLocation( + FSSpec *spec, /* The location we want a path for. */ + int *length, /* Length of the resulting path. */ + Handle *fullPath) /* Handle to path. */ +{ + OSErr err; + FSSpec tempSpec; + CInfoPBRec pb; + + *fullPath = NULL; + + /* + * Make a copy of the input FSSpec that can be modified. + */ + BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); + + if (tempSpec.parID == fsRtParID) { + /* + * The object is a volume. Add a colon to make it a full + * pathname. Allocate a handle for it and we are done. + */ + tempSpec.name[0] += 2; + tempSpec.name[tempSpec.name[0] - 1] = ':'; + tempSpec.name[tempSpec.name[0]] = '\0'; + + err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); + } else { + /* + * The object isn't a volume. Is the object a file or a directory? + */ + pb.dirInfo.ioNamePtr = tempSpec.name; + pb.dirInfo.ioVRefNum = tempSpec.vRefNum; + pb.dirInfo.ioDrDirID = tempSpec.parID; + pb.dirInfo.ioFDirIndex = 0; + err = PBGetCatInfoSync(&pb); + + if ((err == noErr) || (err == fnfErr)) { + /* + * If the file doesn't currently exist we start over. If the + * directory exists everything will work just fine. Otherwise we + * will just fail later. If the object is a directory, append a + * colon so full pathname ends with colon. + */ + if (err == fnfErr) { + BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); + } else if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) { + tempSpec.name[0] += 1; + tempSpec.name[tempSpec.name[0]] = ':'; + } + + /* + * Create a new Handle for the object - make it a C string. + */ + tempSpec.name[0] += 1; + tempSpec.name[tempSpec.name[0]] = '\0'; + err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); + if (err == noErr) { + /* + * Get the ancestor directory names - loop until we have an + * error or find the root directory. + */ + pb.dirInfo.ioNamePtr = tempSpec.name; + pb.dirInfo.ioVRefNum = tempSpec.vRefNum; + pb.dirInfo.ioDrParID = tempSpec.parID; + do { + pb.dirInfo.ioFDirIndex = -1; + pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; + err = PBGetCatInfoSync(&pb); + if (err == noErr) { + /* + * Append colon to directory name and add + * directory name to beginning of fullPath. + */ + ++tempSpec.name[0]; + tempSpec.name[tempSpec.name[0]] = ':'; + + (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], + tempSpec.name[0]); + err = MemError(); + } + } while ( (err == noErr) && + (pb.dirInfo.ioDrDirID != fsRtDirID) ); + } + } + } + + /* + * On error Dispose the handle, set it to NULL & return the err. + * Otherwise, set the length & return. + */ + if (err == noErr) { + *length = GetHandleSize(*fullPath) - 1; + } else { + if ( *fullPath != NULL ) { + DisposeHandle(*fullPath); + } + *fullPath = NULL; + *length = 0; + } + + return err; +} + + + +/*****************************************************************************/ + +pascal OSErr FSpGetDirectoryID(const FSSpec *spec, + long *theDirID, + Boolean *isDirectory) +{ + return ( GetDirectoryID(spec->vRefNum, spec->parID, spec->name, + theDirID, isDirectory) ); +} + + +/*****************************************************************************/ + +pascal OSErr GetDirectoryID(short vRefNum, + long dirID, + ConstStr255Param name, + long *theDirID, + Boolean *isDirectory) +{ + CInfoPBRec pb; + OSErr error; + + error = GetCatInfoNoName(vRefNum, dirID, name, &pb); + if ( error == noErr ) + { + *isDirectory = (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0; + if ( *isDirectory ) + { + *theDirID = pb.dirInfo.ioDrDirID; + } + else + { + *theDirID = pb.hFileInfo.ioFlParID; + } + } + + return ( error ); +} + + +/*****************************************************************************/ + +pascal OSErr GetCatInfoNoName(short vRefNum, + long dirID, + ConstStr255Param name, + CInfoPBPtr pb) +{ + Str31 tempName; + OSErr error; + + /* Protection against File Sharing problem */ + if ( (name == NULL) || (name[0] == 0) ) + { + tempName[0] = 0; + pb->dirInfo.ioNamePtr = tempName; + pb->dirInfo.ioFDirIndex = -1; /* use ioDirID */ + } + else + { + pb->dirInfo.ioNamePtr = (StringPtr)name; + pb->dirInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ + } + pb->dirInfo.ioVRefNum = vRefNum; + pb->dirInfo.ioDrDirID = dirID; + error = PBGetCatInfoSync(pb); + pb->dirInfo.ioNamePtr = NULL; + return ( error ); +} + + + +/*****************************************************************************/ + +pascal OSErr GetObjectLocation(short vRefNum, + long dirID, + ConstStr255Param pathname, + short *realVRefNum, + long *realParID, + Str255 realName, + Boolean *isDirectory) +{ + OSErr error; + CInfoPBRec pb; + Str255 tempPathname; + + /* clear results */ + *realVRefNum = 0; + *realParID = 0; + realName[0] = 0; + + /* + ** Get the real vRefNum + */ + error = DetermineVRefNum(pathname, vRefNum, realVRefNum); + if ( error == noErr ) + { + /* + ** Determine if the object already exists and if so, + ** get the real parent directory ID if it's a file + */ + + /* Protection against File Sharing problem */ + if ( (pathname == NULL) || (pathname[0] == 0) ) + { + tempPathname[0] = 0; + pb.hFileInfo.ioNamePtr = tempPathname; + pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ + } + else + { + pb.hFileInfo.ioNamePtr = (StringPtr)pathname; + pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ + } + pb.hFileInfo.ioVRefNum = vRefNum; + pb.hFileInfo.ioDirID = dirID; + error = PBGetCatInfoSync(&pb); + if ( error == noErr ) + { + /* + ** The file system object is present and we have the file's + ** real parID + */ + + /* Is it a directory or a file? */ + *isDirectory = (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0; + if ( *isDirectory ) + { + /* + ** It's a directory, get its name and parent dirID, and then + ** we're done + */ + + pb.dirInfo.ioNamePtr = realName; + pb.dirInfo.ioVRefNum = *realVRefNum; + /* pb.dirInfo.ioDrDirID already contains the dirID of the + directory object */ + pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ + error = PBGetCatInfoSync(&pb); + + /* get the parent ID here, because the file system can return the */ + /* wrong parent ID from the last call. */ + *realParID = pb.dirInfo.ioDrParID; + } + else + { + /* + ** It's a file - use the parent directory ID from the last call + ** to GetCatInfoparse, get the file name, and then we're done + */ + *realParID = pb.hFileInfo.ioFlParID; + error = GetFilenameFromPathname(pathname, realName); + } + } + else if ( error == fnfErr ) + { + /* + ** The file system object is not present - see if its parent is present + */ + + /* + ** Parse to get the object name from end of pathname + */ + error = GetFilenameFromPathname(pathname, realName); + + /* if we can't get the object name from the end, we can't continue */ + if ( error == noErr ) + { + /* + ** What we want now is the pathname minus the object name + ** for example: + ** if pathname is 'vol:dir:file' tempPathname becomes 'vol:dir:' + ** if pathname is 'vol:dir:file:' tempPathname becomes 'vol:dir:' + ** if pathname is ':dir:file' tempPathname becomes ':dir:' + ** if pathname is ':dir:file:' tempPathname becomes ':dir:' + ** if pathname is ':file' tempPathname becomes ':' + ** if pathname is 'file or file:' tempPathname becomes '' + */ + + /* get a copy of the pathname */ + BlockMoveData(pathname, tempPathname, pathname[0] + 1); + + /* remove the object name */ + tempPathname[0] -= realName[0]; + /* and the trailing colon (if any) */ + if ( pathname[pathname[0]] == ':' ) + { + --tempPathname[0]; + } + + /* OK, now get the parent's directory ID */ + + /* Protection against File Sharing problem */ + pb.hFileInfo.ioNamePtr = (StringPtr)tempPathname; + if ( tempPathname[0] != 0 ) + { + pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ + } + else + { + pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ + } + pb.hFileInfo.ioVRefNum = vRefNum; + pb.hFileInfo.ioDirID = dirID; + error = PBGetCatInfoSync(&pb); + *realParID = pb.dirInfo.ioDrDirID; + + *isDirectory = false; /* we don't know what the object is + really going to be */ + } + + if ( error != noErr ) + { + error = dirNFErr; /* couldn't find parent directory */ + } + else + { + error = fnfErr; /* we found the parent, but not the file */ + } + } + } + + return ( error ); +} + + + +/*****************************************************************************/ + +pascal OSErr DetermineVRefNum(ConstStr255Param pathname, + short vRefNum, + short *realVRefNum) +{ + HParamBlockRec pb; + OSErr error; + + error = GetVolumeInfoNoName(pathname,vRefNum, &pb); + if ( error == noErr ) + { + *realVRefNum = pb.volumeParam.ioVRefNum; + } + return ( error ); +} + + +/*****************************************************************************/ + +pascal OSErr GetFilenameFromPathname(ConstStr255Param pathname, + Str255 filename) +{ + short index; + short nameEnd; + OSErr error; + + /* default to no filename */ + filename[0] = 0; + + /* check for no pathname */ + if ( pathname != NULL ) + { + /* get string length */ + index = pathname[0]; + + /* check for empty string */ + if ( index != 0 ) + { + /* skip over last trailing colon (if any) */ + if ( pathname[index] == ':' ) + { + --index; + } + + /* save the end of the string */ + nameEnd = index; + + /* if pathname ends with multiple colons, then this pathname refers */ + /* to a directory, not a file */ + if ( pathname[index] != ':' ) + { + /* parse backwards until we find a colon or hit the beginning + of the pathname */ + while ( (index != 0) && (pathname[index] != ':') ) + { + --index; + } + + /* if we parsed to the beginning of the pathname and the + pathname ended */ + /* with a colon, then pathname is a full pathname to a volume, + not a file */ + if ( (index != 0) || (pathname[pathname[0]] != ':') ) + { + /* get the filename and return noErr */ + filename[0] = (char)(nameEnd - index); + BlockMoveData(&pathname[index+1], &filename[1], nameEnd - index); + error = noErr; + } + else + { + /* pathname to a volume, not a file */ + error = notAFileErr; + } + } + else + { + /* directory, not a file */ + error = notAFileErr; + } + } + else + { + /* empty string isn't a file */ + error = notAFileErr; + } + } + else + { + /* NULL pathname isn't a file */ + error = notAFileErr; + } + + return ( error ); +} + + + +/*****************************************************************************/ + +/* +** GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync +** in cases where the returned volume name is not needed by the caller. +** The pathname and vRefNum parameters are not touched, and the pb +** parameter is initialized by PBHGetVInfoSync except that ioNamePtr in +** the parameter block is always returned as NULL (since it might point +** to the local tempPathname). +** +** I noticed using this code in several places, so here it is once. +** This reduces the code size of MoreFiles. +*/ +pascal OSErr GetVolumeInfoNoName(ConstStr255Param pathname, + short vRefNum, + HParmBlkPtr pb) +{ + Str255 tempPathname; + OSErr error; + + /* Make sure pb parameter is not NULL */ + if ( pb != NULL ) + { + pb->volumeParam.ioVRefNum = vRefNum; + if ( pathname == NULL ) + { + pb->volumeParam.ioNamePtr = NULL; + pb->volumeParam.ioVolIndex = 0; /* use ioVRefNum only */ + } + else + { /* make a copy of the string and */ + BlockMoveData(pathname, tempPathname, pathname[0] + 1); + /* use the copy so original isn't trashed */ + pb->volumeParam.ioNamePtr = (StringPtr)tempPathname; + /* use ioNamePtr/ioVRefNum combination */ + pb->volumeParam.ioVolIndex = -1; + } + error = PBHGetVInfoSync(pb); + pb->volumeParam.ioNamePtr = NULL; /* ioNamePtr may point to local + tempPathname, so don't return it */ + } + else + { + error = paramErr; + } + return ( error ); +} + + + + +/*****************************************************************************/ + +pascal OSErr FSpGetFullPath(const FSSpec *spec, + short *fullPathLength, + Handle *fullPath) +{ + OSErr result; + OSErr realResult; + FSSpec tempSpec; + CInfoPBRec pb; + + *fullPathLength = 0; + *fullPath = NULL; + + /* Default to noErr */ + realResult = noErr; + + /* Make a copy of the input FSSpec that can be modified */ + BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); + + if ( tempSpec.parID == fsRtParID ) + { + /* The object is a volume */ + + /* Add a colon to make it a full pathname */ + ++tempSpec.name[0]; + tempSpec.name[tempSpec.name[0]] = ':'; + + /* We're done */ + result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); + } + else + { + /* The object isn't a volume */ + + /* Is the object a file or a directory? */ + pb.dirInfo.ioNamePtr = tempSpec.name; + pb.dirInfo.ioVRefNum = tempSpec.vRefNum; + pb.dirInfo.ioDrDirID = tempSpec.parID; + pb.dirInfo.ioFDirIndex = 0; + result = PBGetCatInfoSync(&pb); + /* Allow file/directory name at end of path to not exist. */ + realResult = result; + if ( (result == noErr) || (result == fnfErr) ) + { + /* if the object is a directory, append a colon so full pathname + ends with colon */ + if ( (result == noErr) && (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) + { + ++tempSpec.name[0]; + tempSpec.name[tempSpec.name[0]] = ':'; + } + + /* Put the object name in first */ + result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); + if ( result == noErr ) + { + /* Get the ancestor directory names */ + pb.dirInfo.ioNamePtr = tempSpec.name; + pb.dirInfo.ioVRefNum = tempSpec.vRefNum; + pb.dirInfo.ioDrParID = tempSpec.parID; + do /* loop until we have an error or find the root directory */ + { + pb.dirInfo.ioFDirIndex = -1; + pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; + result = PBGetCatInfoSync(&pb); + if ( result == noErr ) + { + /* Append colon to directory name */ + ++tempSpec.name[0]; + tempSpec.name[tempSpec.name[0]] = ':'; + + /* Add directory name to beginning of fullPath */ + (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], + tempSpec.name[0]); + result = MemError(); + } + } while ( (result == noErr) && (pb.dirInfo.ioDrDirID != fsRtDirID) ); + } + } + } + if ( result == noErr ) + { + /* Return the length */ + *fullPathLength = InlineGetHandleSize(*fullPath); + result = realResult; /* return realResult in case it was fnfErr */ + } + else + { + /* Dispose of the handle and return NULL and zero length */ + if ( *fullPath != NULL ) + { + DisposeHandle(*fullPath); + } + *fullPath = NULL; + *fullPathLength = 0; + } + + return ( result ); +} + + + +/*****************************************************************************/ + +pascal OSErr FSpLocationFromFullPath(short fullPathLength, + const void *fullPath, + FSSpec *spec) +{ + AliasHandle alias; + OSErr result; + Boolean wasChanged; + Str32 nullString; + + /* Create a minimal alias from the full pathname */ + nullString[0] = 0; /* null string to indicate no zone or server name */ + result = NewAliasMinimalFromFullPath(fullPathLength, fullPath, nullString, + nullString, &alias); + + if ( result == noErr ) + { + /* Let the Alias Manager resolve the alias. */ + result = ResolveAlias(NULL, alias, spec, &wasChanged); + + DisposeHandle((Handle)alias); /* Free up memory used */ + } + + return ( result ); +} + + + +/*****************************************************************************/ + +pascal OSErr GetFullPath(short vRefNum, + long dirID, + ConstStr255Param name, + short *fullPathLength, + Handle *fullPath) +{ + OSErr result; + FSSpec spec; + + *fullPathLength = 0; + *fullPath = NULL; + + result = FSMakeFSSpecCompat(vRefNum, dirID, name, &spec); + if ( (result == noErr) || (result == fnfErr) ) + { + result = FSpGetFullPath(&spec, fullPathLength, fullPath); + } + + return ( result ); +} + + + +/*****************************************************************************/ + +pascal OSErr ChangeCreatorType(short vRefNum, + long dirID, + ConstStr255Param name, + OSType creator, + OSType fileType) +{ + CInfoPBRec pb; + OSErr error; + short realVRefNum; + long parID; + + pb.hFileInfo.ioNamePtr = (StringPtr)name; + pb.hFileInfo.ioVRefNum = vRefNum; + pb.hFileInfo.ioDirID = dirID; + pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ + error = PBGetCatInfoSync(&pb); + if ( error == noErr ) + { + if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) == 0 ) /* if file */ + { /* save parent dirID for BumpDate call */ + parID = pb.hFileInfo.ioFlParID; + + /* If creator not 0x00000000, change creator */ + if ( creator != (OSType)0x00000000 ) + { + pb.hFileInfo.ioFlFndrInfo.fdCreator = creator; + } + + /* If fileType not 0x00000000, change fileType */ + if ( fileType != (OSType)0x00000000 ) + { + pb.hFileInfo.ioFlFndrInfo.fdType = fileType; + } + + pb.hFileInfo.ioDirID = dirID; + error = PBSetCatInfoSync(&pb); /* now, save the new information + back to disk */ + + if ( (error == noErr) && (parID != fsRtParID) ) /* can't + bump fsRtParID */ + { + /* get the real vRefNum in case a full pathname was passed */ + error = DetermineVRefNum(name, vRefNum, &realVRefNum); + if ( error == noErr ) + { + error = BumpDate(realVRefNum, parID, NULL); + /* and bump the parent directory's mod date to wake + up the Finder */ + /* to the change we just made */ + } + } + } + else + { + /* it was a directory, not a file */ + error = notAFileErr; + } + } + + return ( error ); +} + +/*****************************************************************************/ + +pascal OSErr FSpChangeCreatorType(const FSSpec *spec, + OSType creator, + OSType fileType) +{ + return ( ChangeCreatorType(spec->vRefNum, spec->parID, spec->name, + creator, fileType) ); +} + +/*****************************************************************************/ + +pascal OSErr BumpDate(short vRefNum, + long dirID, + ConstStr255Param name) +/* Given a file or directory, change its modification date to the + current date/time. */ +{ + CInfoPBRec pb; + Str31 tempName; + OSErr error; + unsigned long secs; + + /* Protection against File Sharing problem */ + if ( (name == NULL) || (name[0] == 0) ) + { + tempName[0] = 0; + pb.hFileInfo.ioNamePtr = tempName; + pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ + } + else + { + pb.hFileInfo.ioNamePtr = (StringPtr)name; + pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ + } + pb.hFileInfo.ioVRefNum = vRefNum; + pb.hFileInfo.ioDirID = dirID; + error = PBGetCatInfoSync(&pb); + if ( error == noErr ) + { + GetDateTime(&secs); + /* set mod date to current date, or one second into the future + if mod date = current date */ + pb.hFileInfo.ioFlMdDat = + (secs == pb.hFileInfo.ioFlMdDat) ? (++secs) : (secs); + if ( pb.dirInfo.ioNamePtr == tempName ) + { + pb.hFileInfo.ioDirID = pb.hFileInfo.ioFlParID; + } + else + { + pb.hFileInfo.ioDirID = dirID; + } + error = PBSetCatInfoSync(&pb); + } + + return ( error ); +} + +/*****************************************************************************/ + +pascal OSErr FSpBumpDate(const FSSpec *spec) +{ + return ( BumpDate(spec->vRefNum, spec->parID, spec->name) ); +} + + +/*****************************************************************************/ + +pascal OSErr OnLine(FSSpecPtr volumes, + short reqVolCount, + short *actVolCount, + short *volIndex) +{ + HParamBlockRec pb; + OSErr error = noErr; + FSSpec *endVolArray; + + if ( *volIndex > 0 ) + { + *actVolCount = 0; + for ( endVolArray = volumes + reqVolCount; + (volumes < endVolArray) && (error == noErr); ++volumes ) + { + pb.volumeParam.ioNamePtr = (StringPtr) & volumes->name; + pb.volumeParam.ioVolIndex = *volIndex; + error = PBHGetVInfoSync(&pb); + if ( error == noErr ) + { + volumes->parID = fsRtParID; /* the root directory's + parent is 1 */ + volumes->vRefNum = pb.volumeParam.ioVRefNum; + ++*volIndex; + ++*actVolCount; + } + } + } + else + { + error = paramErr; + } + + return ( error ); +} + + +/*****************************************************************************/ + +pascal OSErr DTGetComment(short vRefNum, + long dirID, + ConstStr255Param name, + Str255 comment) +{ + DTPBRec pb; + OSErr error; + short dtRefNum; + Boolean newDTDatabase; + + if (comment != NULL) + { + comment[0] = 0; /* return nothing by default */ + + /* attempt to open the desktop database */ + error = DTOpen(name, vRefNum, &dtRefNum, &newDTDatabase); + if ( error == noErr ) + { + /* There was a desktop database and it's now open */ + + if ( !newDTDatabase ) + { + pb.ioDTRefNum = dtRefNum; + pb.ioNamePtr = (StringPtr)name; + pb.ioDirID = dirID; + pb.ioDTBuffer = (Ptr)&comment[1]; + /* + ** IMPORTANT NOTE #1: Inside Macintosh says that comments + ** are up to 200 characters. While that may be correct for + ** the HFS file system's Desktop Manager, other file + ** systems (such as Apple Photo Access) return up to + ** 255 characters. Make sure the comment buffer is a Str255 + ** or you'll regret it. + ** + ** IMPORTANT NOTE #2: Although Inside Macintosh doesn't + ** mention it, ioDTReqCount is a input field to + ** PBDTGetCommentSync. Some file systems (like HFS) ignore + ** ioDTReqCount and always return the full comment -- + ** others (like AppleShare) respect ioDTReqCount and only + ** return up to ioDTReqCount characters of the comment. + */ + pb.ioDTReqCount = sizeof(Str255) - 1; + error = PBDTGetCommentSync(&pb); + if (error == noErr) + { + comment[0] = (unsigned char)pb.ioDTActCount; + } + } + } + else + { + /* There is no desktop database - try the Desktop file */ + error = GetCommentFromDesktopFile(vRefNum, dirID, name, comment); + if ( error != noErr ) + { + error = afpItemNotFound; /* return an expected error */ + } + } + } + else + { + error = paramErr; + } + + return (error); +} + +/*****************************************************************************/ + +pascal OSErr FSpDTGetComment(const FSSpec *spec, + Str255 comment) +{ + return (DTGetComment(spec->vRefNum, spec->parID, spec->name, comment)); +} + + +/*****************************************************************************/ + +pascal OSErr DTSetComment(short vRefNum, + long dirID, + ConstStr255Param name, + ConstStr255Param comment) +{ + DTPBRec pb; + OSErr error; + short dtRefNum; + Boolean newDTDatabase; + + error = DTOpen(name, vRefNum, &dtRefNum, &newDTDatabase); + if ( error == noErr ) + { + pb.ioDTRefNum = dtRefNum; + pb.ioNamePtr = (StringPtr)name; + pb.ioDirID = dirID; + pb.ioDTBuffer = (Ptr)&comment[1]; + /* Truncate the comment to 200 characters just in case */ + /* some file system doesn't range check */ + if ( comment[0] <= 200 ) + { + pb.ioDTReqCount = comment[0]; + } + else + { + pb.ioDTReqCount = 200; + } + error = PBDTSetCommentSync(&pb); + } + return (error); +} + +/*****************************************************************************/ + +pascal OSErr FSpDTSetComment(const FSSpec *spec, + ConstStr255Param comment) +{ + return (DTSetComment(spec->vRefNum, spec->parID, spec->name, comment)); +} + + +/*****************************************************************************/ + +pascal OSErr DTOpen(ConstStr255Param volName, + short vRefNum, + short *dtRefNum, + Boolean *newDTDatabase) +{ + OSErr error; + GetVolParmsInfoBuffer volParmsInfo; + long infoSize; + DTPBRec pb; + + /* Check for volume Desktop Manager support before calling */ + infoSize = sizeof(GetVolParmsInfoBuffer); + error = HGetVolParms(volName, vRefNum, &volParmsInfo, &infoSize); + if ( error == noErr ) + { + if ( hasDesktopMgr(volParmsInfo) ) + { + pb.ioNamePtr = (StringPtr)volName; + pb.ioVRefNum = vRefNum; + error = PBDTOpenInform(&pb); + /* PBDTOpenInform informs us if the desktop was just created */ + /* by leaving the low bit of ioTagInfo clear (0) */ + *newDTDatabase = ((pb.ioTagInfo & 1L) == 0); + if ( error == paramErr ) + { + error = PBDTGetPath(&pb); + /* PBDTGetPath doesn't tell us if the database is new */ + /* so assume it is not new */ + *newDTDatabase = false; + } + *dtRefNum = pb.ioDTRefNum; + } + else + { + error = paramErr; + } + } + return ( error ); +} + +/*****************************************************************************/ + +/* +** GetCommentFromDesktopFile +** +** Get a file or directory's Finder comment field (if any) from the +** Desktop file's 'FCMT' resources. +*/ +static OSErr GetCommentFromDesktopFile(short vRefNum, + long dirID, + ConstStr255Param name, + Str255 comment) +{ + OSErr error; + short commentID; + short realVRefNum; + Str255 desktopName; + short savedResFile; + short dfRefNum; + StringHandle commentHandle; + + /* Get the comment ID number */ + error = GetCommentID(vRefNum, dirID, name, &commentID); + if ( error == noErr ) + { + if ( commentID != 0 ) /* commentID == 0 means there's no comment */ + { + error = DetermineVRefNum(name, vRefNum, &realVRefNum); + if ( error == noErr ) + { + error = GetDesktopFileName(realVRefNum, desktopName); + if ( error == noErr ) + { + savedResFile = CurResFile(); + /* + ** Open the 'Desktop' file in the root directory. (because + ** opening the resource file could preload unwanted resources, + ** bracket the call with SetResLoad(s)) + */ + SetResLoad(false); + dfRefNum = HOpenResFile(realVRefNum, fsRtDirID, desktopName, + fsRdPerm); + SetResLoad(true); + + if ( dfRefNum != -1) + { + /* Get the comment resource */ + commentHandle = (StringHandle)Get1Resource(kFCMTResType, + commentID); + if ( commentHandle != NULL ) + { + if ( InlineGetHandleSize((Handle)commentHandle) > 0 ) + { + BlockMoveData(*commentHandle, comment, + *commentHandle[0] + 1); + } + else + { /* no comment available */ + error = afpItemNotFound; + } + } + else + { /* no comment available */ + error = afpItemNotFound; + } + + /* restore the resource chain and close + the Desktop file */ + UseResFile(savedResFile); + CloseResFile(dfRefNum); + } + else + { + error = afpItemNotFound; + } + } + else + { + error = afpItemNotFound; + } + } + } + else + { + error = afpItemNotFound; /* no comment available */ + } + } + + return ( error ); +} + +/*****************************************************************************/ + +pascal OSErr HGetVolParms(ConstStr255Param volName, + short vRefNum, + GetVolParmsInfoBuffer *volParmsInfo, + long *infoSize) +{ + HParamBlockRec pb; + OSErr error; + + pb.ioParam.ioNamePtr = (StringPtr)volName; + pb.ioParam.ioVRefNum = vRefNum; + pb.ioParam.ioBuffer = (Ptr)volParmsInfo; + pb.ioParam.ioReqCount = *infoSize; + error = PBHGetVolParmsSync(&pb); + if ( error == noErr ) + { + *infoSize = pb.ioParam.ioActCount; + } + return ( error ); +} + +/*****************************************************************************/ +/* +** GetCommentID +** +** Get the comment ID number for the Desktop file's 'FCMT' resource ID from +** the file or folders fdComment (frComment) field. +*/ +static OSErr GetCommentID(short vRefNum, + long dirID, + ConstStr255Param name, + short *commentID) +{ + CInfoPBRec pb; + OSErr error; + + error = GetCatInfoNoName(vRefNum, dirID, name, &pb); + *commentID = pb.hFileInfo.ioFlXFndrInfo.fdComment; + return ( error ); +} + +/*****************************************************************************/ + +/* +** GetDesktopFileName +** +** Get the name of the Desktop file. +*/ +static OSErr GetDesktopFileName(short vRefNum, + Str255 desktopName) +{ + OSErr error; + HParamBlockRec pb; + short index; + Boolean found; + + pb.fileParam.ioNamePtr = desktopName; + pb.fileParam.ioVRefNum = vRefNum; + pb.fileParam.ioFVersNum = 0; + index = 1; + found = false; + do + { + pb.fileParam.ioDirID = fsRtDirID; + pb.fileParam.ioFDirIndex = index; + error = PBHGetFInfoSync(&pb); + if ( error == noErr ) + { + if ( (pb.fileParam.ioFlFndrInfo.fdType == 'FNDR') && + (pb.fileParam.ioFlFndrInfo.fdCreator == 'ERIK') ) + { + found = true; + } + } + ++index; + } while ( (error == noErr) && !found ); + + return ( error ); +} + + +/*****************************************************************************/ + +pascal OSErr XGetVInfo(short volReference, + StringPtr volName, + short *vRefNum, + UnsignedWide *freeBytes, + UnsignedWide *totalBytes) +{ + OSErr result; + long response; + XVolumeParam pb; + + /* See if large volume support is available */ + if ( ( Gestalt(gestaltFSAttr, &response) == noErr ) && ((response & (1L << gestaltFSSupports2TBVols)) != 0) ) + { + /* Large volume support is available */ + pb.ioVRefNum = volReference; + pb.ioNamePtr = volName; + pb.ioXVersion = 0; /* this XVolumeParam version (0) */ + pb.ioVolIndex = 0; /* use ioVRefNum only, return volume name */ + result = PBXGetVolInfoSync(&pb); + if ( result == noErr ) + { + /* The volume name was returned in volName (if not NULL) and */ + /* we have the volume's vRefNum and allocation block size */ + *vRefNum = pb.ioVRefNum; + + /* return the freeBytes and totalBytes */ + *totalBytes = pb.ioVTotalBytes; + *freeBytes = pb.ioVFreeBytes; + } + } + else + { + /* No large volume support */ + + /* Use HGetVInfo to get the results */ + result = HGetVInfo(volReference, volName, vRefNum, &freeBytes->lo, &totalBytes->lo); + if ( result == noErr ) + { + /* zero the high longs of totalBytes and freeBytes */ + totalBytes->hi = 0; + freeBytes->hi = 0; + } + } + return ( result ); +} + + + +/*****************************************************************************/ + +pascal OSErr HGetVInfo(short volReference, + StringPtr volName, + short *vRefNum, + unsigned long *freeBytes, + unsigned long *totalBytes) +{ + HParamBlockRec pb; + unsigned long allocationBlockSize; + unsigned short numAllocationBlocks; + unsigned short numFreeBlocks; + VCB *theVCB; + Boolean vcbFound; + OSErr result; + + /* Use the File Manager to get the real vRefNum */ + pb.volumeParam.ioVRefNum = volReference; + pb.volumeParam.ioNamePtr = volName; + pb.volumeParam.ioVolIndex = 0; /* use ioVRefNum only, return volume name */ + result = PBHGetVInfoSync(&pb); + + if ( result == noErr ) + { + /* The volume name was returned in volName (if not NULL) and */ + /* we have the volume's vRefNum and allocation block size */ + *vRefNum = pb.volumeParam.ioVRefNum; + allocationBlockSize = (unsigned long)pb.volumeParam.ioVAlBlkSiz; + + /* System 7.5 (and beyond) pins the number of allocation blocks and */ + /* the number of free allocation blocks returned by PBHGetVInfo to */ + /* a value so that when multiplied by the allocation block size, */ + /* the volume will look like it has $7fffffff bytes or less. This */ + /* was done so older applications that use signed math or that use */ + /* the GetVInfo function (which uses signed math) will continue to work. */ + /* However, the unpinned numbers (which we want) are always available */ + /* in the volume's VCB so we'll get those values from the VCB if possible. */ + + /* Find the volume's VCB */ + vcbFound = false; + theVCB = (VCB *)(GetVCBQHdr()->qHead); + while ( (theVCB != NULL) && !vcbFound ) + { + /* Check VCB signature before using VCB. Don't have to check for */ + /* MFS (0xd2d7) because they can't get big enough to be pinned */ + if ( theVCB->vcbSigWord == 0x4244 ) + { + if ( theVCB->vcbVRefNum == *vRefNum ) + { + vcbFound = true; + } + } + + if ( !vcbFound ) + { + theVCB = (VCB *)(theVCB->qLink); + } + } + + if ( theVCB != NULL ) + { + /* Found a VCB we can use. Get the un-pinned number of allocation blocks */ + /* and the number of free blocks from the VCB. */ + numAllocationBlocks = (unsigned short)theVCB->vcbNmAlBlks; + numFreeBlocks = (unsigned short)theVCB->vcbFreeBks; + } + else + { + /* Didn't find a VCB we can use. Return the number of allocation blocks */ + /* and the number of free blocks returned by PBHGetVInfoSync. */ + numAllocationBlocks = (unsigned short)pb.volumeParam.ioVNmAlBlks; + numFreeBlocks = (unsigned short)pb.volumeParam.ioVFrBlk; + } + + /* Now, calculate freeBytes and totalBytes using unsigned values */ + *freeBytes = numFreeBlocks * allocationBlockSize; + *totalBytes = numAllocationBlocks * allocationBlockSize; + } + + return ( result ); +} + + +/* +** PBXGetVolInfoSync is the glue code needed to make PBXGetVolInfoSync +** File Manager requests from CFM-based programs. At some point, Apple +** will get around to adding this to the standard libraries you link with +** and you'll get a duplicate symbol link error. At that time, just delete +** this code (or comment it out). +** +** Non-CFM 68K programs don't needs this glue (and won't get it) because +** they instead use the inline assembly glue found in the Files.h interface +** file. +*/ + +#if __WANTPASCALELIMINATION +#undef pascal +#endif + +#if GENERATINGCFM +pascal OSErr PBXGetVolInfoSync(XVolumeParamPtr paramBlock) +{ + enum + { + kXGetVolInfoSelector = 0x0012, /* Selector for XGetVolInfo */ + + uppFSDispatchProcInfo = kRegisterBased + | REGISTER_RESULT_LOCATION(kRegisterD0) + | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) + | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long))) /* trap word */ + | REGISTER_ROUTINE_PARAMETER(2, kRegisterD0, SIZE_CODE(sizeof(long))) /* selector */ + | REGISTER_ROUTINE_PARAMETER(3, kRegisterA0, SIZE_CODE(sizeof(XVolumeParamPtr))) + }; + + return ( CallOSTrapUniversalProc(NGetTrapAddress(_FSDispatch, OSTrap), + uppFSDispatchProcInfo, + _FSDispatch, + kXGetVolInfoSelector, + paramBlock) ); +} +#endif + +#if __WANTPASCALELIMINATION +#define pascal +#endif + +/*****************************************************************************/ + +pascal OSErr GetDirName(short vRefNum, + long dirID, + Str31 name) +{ + CInfoPBRec pb; + OSErr error; + + if ( name != NULL ) + { + pb.dirInfo.ioNamePtr = name; + pb.dirInfo.ioVRefNum = vRefNum; + pb.dirInfo.ioDrDirID = dirID; + pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ + error = PBGetCatInfoSync(&pb); + } + else + { + error = paramErr; + } + + return ( error ); +} + + +/*****************************************************************************/ + +pascal OSErr GetVolFileSystemID(ConstStr255Param pathname, + short vRefNum, + short *fileSystemID) +{ + HParamBlockRec pb; + OSErr error; + + error = GetVolumeInfoNoName(pathname,vRefNum, &pb); + if ( error == noErr ) + { + *fileSystemID = pb.volumeParam.ioVFSID; + } + + return ( error ); +} + +/*****************************************************************************/ + +pascal OSErr GetDInfo(short vRefNum, + long dirID, + ConstStr255Param name, + DInfo *fndrInfo) +{ + CInfoPBRec pb; + OSErr error; + + error = GetCatInfoNoName(vRefNum, dirID, name, &pb); + if ( error == noErr ) + { + if ( (pb.dirInfo.ioFlAttrib & ioDirMask) != 0 ) + { + /* it's a directory, return the DInfo */ + *fndrInfo = pb.dirInfo.ioDrUsrWds; + } + else + { + /* oops, a file was passed */ + error = dirNFErr; + } + } + + return ( error ); +} + +/*****************************************************************************/ + +pascal OSErr FSpGetDInfo(const FSSpec *spec, + DInfo *fndrInfo) +{ + return ( GetDInfo(spec->vRefNum, spec->parID, spec->name, fndrInfo) ); +} + + + +const char *BOINC_RCSID_fc2d06db64 = "$Id: macstuff.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/macstuff.h boinc-7.0.14+dfsg/zip/zip/macos/source/macstuff.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/macstuff.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/macstuff.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1108 @@ +#ifndef _MACSTUFF_H +#define _MACSTUFF_H 1 + +/* +These Functions were originally part of More Files version 1.4.8 + +More Files fixes many of the broken or underfunctional +parts of the file system. + +More Files + +A collection of File Manager and related routines + +by Jim Luther (Apple Macintosh Developer Technical Support Emeritus) +with significant code contributions by Nitin Ganatra +(Apple Macintosh Developer Technical Support Emeritus) +Copyright 1992-1998 Apple Computer, Inc. +Portions copyright 1995 Jim Luther +All rights reserved. + +The Package "More Files" is distributed under the following +license terms: + + "You may incorporate this sample code into your + applications without restriction, though the + sample code has been provided "AS IS" and the + responsibility for its operation is 100% yours. + However, what you are not permitted to do is to + redistribute the source as "DSC Sample Code" after + having made changes. If you're going to + redistribute the source, we require that you make + it clear in the source that the code was descended + from Apple Sample Code, but that you've made + changes." + + +The following changes are made by Info-ZIP: + +- The only changes are made by pasting the functions + (mostly found in MoreFilesExtras.c / MoreFiles.c) + directly into macstuff.c / macstuff.h and slightly + reformatting the text (replacement of TABs by spaces, + removal/replacement of non-ASCII characters). + The code itself is NOT changed. + +This file has been modified by Info-ZIP for use in MacZip. +This file is NOT part of the original package More Files. + +More Files can be found on the MetroWerks CD and Developer CD from +Apple. You can also download the latest version from: + + http://members.aol.com/JumpLong/#MoreFiles + +Jim Luther's Home-page: + http://members.aol.com/JumpLong/ + + +*/ + + +#define __MACOSSEVENFIVEONEORLATER 1 +#define __MACOSSEVENFIVEORLATER 1 +#define __MACOSSEVENORLATER 1 + +#include +#include + + +/* + * Like the MoreFiles routines these fix problems in the standard + * Mac calls. + */ + +int FSpLocationFromPath (int length,const char *path, FSSpecPtr theSpec); +OSErr FSpPathFromLocation (FSSpecPtr theSpec,int *length, Handle *fullPath); + +#define hasDesktopMgr(volParms) (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0) + +/* + * The following routines are utility functions. They are exported + * here because they are needed and they are not officially supported, + * however. The first set are from the MoreFiles package. + */ +int FSpGetDefaultDir (FSSpecPtr theSpec); +int FSpSetDefaultDir (FSSpecPtr dirSpec); +pascal OSErr FSpGetDirectoryID(const FSSpec *spec,long *theDirID, + Boolean *isDirectory); +pascal short FSpOpenResFileCompat(const FSSpec *spec, SignedByte permission); +pascal void FSpCreateResFileCompat(const FSSpec *spec,OSType creator, + OSType fileType, + ScriptCode scriptTag); +OSErr FSpFindFolder (short vRefNum, OSType folderType, + Boolean createFolder, + FSSpec *spec); + +/*****************************************************************************/ + +pascal OSErr GetVolumeInfoNoName(ConstStr255Param pathname, + short vRefNum, + HParmBlkPtr pb); +/* Call PBHGetVInfoSync ignoring returned name. + GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync + in cases where the returned volume name is not needed by the caller. + The pathname and vRefNum parameters are not touched, and the pb + parameter is initialized by PBHGetVInfoSync except that ioNamePtr in + the parameter block is always returned as NULL (since it might point + to GetVolumeInfoNoName's local variable tempPathname). + + I noticed using this code in several places, so here it is once. + This reduces the code size of MoreFiles. + + pathName input: Pointer to a full pathname or nil. If you pass in a + partial pathname, it is ignored. A full pathname to a + volume must end with a colon character (:). + vRefNum input: Volume specification (volume reference number, working + directory number, drive number, or 0). + pb input: A pointer to HParamBlockRec. + output: The parameter block as filled in by PBHGetVInfoSync + except that ioNamePtr will always be NULL. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + paramErr -50 No default volume, or pb was NULL +*/ + + +/*****************************************************************************/ + +pascal OSErr GetFilenameFromPathname(ConstStr255Param pathname, + Str255 filename); +/* Get the object name from the end of a full or partial pathname. + The GetFilenameFromPathname function gets the file (or directory) name + from the end of a full or partial pathname. Returns notAFileErr if the + pathname is nil, the pathname is empty, or the pathname cannot refer to + a filename (with a noErr result, the pathname could still refer to a + directory). + + pathname input: A full or partial pathname. + filename output: The file (or directory) name. + + Result Codes + noErr 0 No error + notAFileErr -1302 The pathname is nil, the pathname + is empty, or the pathname cannot refer + to a filename + + __________ + + See also: GetObjectLocation. +*/ + + + +/*****************************************************************************/ + +pascal OSErr FSMakeFSSpecCompat(short vRefNum, long dirID, + ConstStr255Param fileName, + FSSpec *spec); +/* Initialize a FSSpec record. + The FSMakeFSSpecCompat function fills in the fields of an FSSpec record. + If the file system can't create the FSSpec, then the compatibility code + creates a FSSpec that is exactly like an FSSpec except that spec.name + for a file may not have the same capitalization as the file's catalog + entry on the disk volume. That is because fileName is parsed to get the + name instead of getting the name back from the file system. This works + fine with System 6 where FSMakeSpec isn't available. + + vRefNum input: Volume specification. + dirID input: Directory ID. + fileName input: Pointer to object name, or nil when dirID specifies + a directory that's the object. + spec output: A file system specification to be filled in by + FSMakeFSSpecCompat. + + Result Codes + noErr 0 No error + nsvErr -35 Volume doesnt exist + fnfErr -43 File or directory does not exist + (FSSpec is still valid) +*/ + + +#if !SystemSevenOrLater +static Boolean FSHasFSSpecCalls(void); + +static Boolean QTHasFSSpecCalls(void); +#endif /* !SystemSevenOrLater */ + + + +/*****************************************************************************/ + +pascal OSErr GetObjectLocation(short vRefNum, + long dirID, + ConstStr255Param pathname, + short *realVRefNum, + long *realParID, + Str255 realName, + Boolean *isDirectory); +/* Get a file system object's location. + The GetObjectLocation function gets a file system object's location - + that is, its real volume reference number, real parent directory ID, + and name. While we're at it, determine if the object is a file or directory. + If GetObjectLocation returns fnfErr, then the location information + returned is valid, but it describes an object that doesn't exist. + You can use the location information for another operation, such as + creating a file or directory. + + vRefNum input: Volume specification. + dirID input: Directory ID. + pathname input: Pointer to object name, or nil when dirID specifies + a directory that's the object. + realVRefNum output: The real volume reference number. + realParID output: The parent directory ID of the specified object. + realName output: The name of the specified object (the case of the + object name may not be the same as the object's + catalog entry on disk - since the Macintosh file + system is not case sensitive, it shouldn't matter). + isDirectory output: True if object is a directory; false if object + is a file. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + notAFileErr -1302 The pathname is nil, the pathname + is empty, or the pathname cannot refer + to a filename + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: FSMakeFSSpecCompat +*/ + +pascal OSErr FSpGetDirectoryID(const FSSpec *spec, long *theDirID, + Boolean *isDirectory); + +pascal OSErr GetDirectoryID(short vRefNum,long dirID,ConstStr255Param name, + long *theDirID,Boolean *isDirectory); + + + +/*****************************************************************************/ + +pascal OSErr GetCatInfoNoName(short vRefNum, + long dirID, + ConstStr255Param name, + CInfoPBPtr pb); +/* Call PBGetCatInfoSync ignoring returned name. + GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync + in cases where the returned object is not needed by the caller. + The vRefNum, dirID and name parameters are not touched, and the pb + parameter is initialized by PBGetCatInfoSync except that ioNamePtr in + the parameter block is always returned as NULL (since it might point + to GetCatInfoNoName's local variable tempName). + + I noticed using this code in several places, so here it is once. + This reduces the code size of MoreFiles. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID + specifies a directory that's the object. + pb input: A pointer to CInfoPBRec. + output: The parameter block as filled in by + PBGetCatInfoSync except that ioNamePtr will + always be NULL. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + +*/ + + +/*****************************************************************************/ + + +pascal OSErr DetermineVRefNum(ConstStr255Param pathname, + short vRefNum, + short *realVRefNum); +/* Determine the real volume reference number. + The DetermineVRefNum function determines the volume reference number of + a volume from a pathname, a volume specification, or a combination + of the two. + WARNING: Volume names on the Macintosh are *not* unique -- Multiple + mounted volumes can have the same name. For this reason, the use of a + volume name or full pathname to identify a specific volume may not + produce the results you expect. If more than one volume has the same + name and a volume name or full pathname is used, the File Manager + currently uses the first volume it finds with a matching name in the + volume queue. + + pathName input: Pointer to a full pathname or nil. If you pass in a + partial pathname, it is ignored. A full pathname to a + volume must end with a colon character (:). + vRefNum input: Volume specification (volume reference number, working + directory number, drive number, or 0). + realVRefNum output: The real volume reference number. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + paramErr -50 No default volume +*/ + + +/*****************************************************************************/ + +pascal OSErr FSpGetFullPath(const FSSpec *spec, + short *fullPathLength, + Handle *fullPath); +/* Get a full pathname to a volume, directory or file. + The GetFullPath function builds a full pathname to the specified + object. The full pathname is returned in the newly created handle + fullPath and the length of the full pathname is returned in + fullPathLength. Your program is responsible for disposing of the + fullPath handle. + + spec input: An FSSpec record specifying the object. + fullPathLength output: The number of characters in the full pathname. + If the function fails to create a full pathname, + it sets fullPathLength to 0. + fullPath output: A handle to the newly created full pathname + buffer. If the function fails to create a + full pathname, it sets fullPath to NULL. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File or directory does not exist + paramErr -50 No default volume + memFullErr -108 Not enough memory + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: GetFullPath +*/ + +/*****************************************************************************/ + +pascal OSErr FSpLocationFromFullPath(short fullPathLength, + const void *fullPath, + FSSpec *spec); +/* Get a FSSpec from a full pathname. + The FSpLocationFromFullPath function returns a FSSpec to the object + specified by full pathname. This function requires the Alias Manager. + + fullPathLength input: The number of characters in the full pathname + of the target. + fullPath input: A pointer to a buffer that contains the full + pathname of the target. The full pathname + starts with the name of the volume, includes + all of the directory names in the path to the + target, and ends with the target name. + spec output: An FSSpec record specifying the object. + + Result Codes + noErr 0 No error + nsvErr -35 The volume is not mounted + fnfErr -43 Target not found, but volume and parent + directory found + paramErr -50 Parameter error + usrCanceledErr -128 The user canceled the operation + + __________ + + See also: LocationFromFullPath +*/ + + +/*****************************************************************************/ + +pascal OSErr GetFullPath(short vRefNum, + long dirID, + ConstStr255Param name, + short *fullPathLength, + Handle *fullPath); +/* Get a full pathname to a volume, directory or file. + The GetFullPath function builds a full pathname to the specified + object. The full pathname is returned in the newly created handle + fullPath and the length of the full pathname is returned in + fullPathLength. Your program is responsible for disposing of the + fullPath handle. + + Note that a full pathname can be made to a file/directory that does not + yet exist if all directories up to that file/directory exist. In this case, + GetFullPath will return a fnfErr. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID + specifies a directory that's the object. + fullPathLength output: The number of characters in the full pathname. + If the function fails to create a full + pathname, it sets fullPathLength to 0. + fullPath output: A handle to the newly created full pathname + buffer. If the function fails to create a + full pathname, it sets fullPath to NULL. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File or directory does not exist (fullPath + and fullPathLength are still valid) + paramErr -50 No default volume + memFullErr -108 Not enough memory + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: FSpGetFullPath +*/ + + + +/*****************************************************************************/ + +pascal OSErr ChangeCreatorType(short vRefNum, + long dirID, + ConstStr255Param name, + OSType creator, + OSType fileType); +/* Change the creator or file type of a file. + The ChangeCreatorType function changes the creator or file type of a file. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: The name of the file. + creator input: The new creator type or 0x00000000 to leave + the creator type alone. + fileType input: The new file type or 0x00000000 to leave the + file type alone. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + fLckdErr -45 File is locked + vLckdErr -46 Volume is locked or read-only + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + notAFileErr -1302 Name was not a file + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: FSpChangeCreatorType +*/ + +/*****************************************************************************/ + +pascal OSErr FSpChangeCreatorType(const FSSpec *spec, + OSType creator, + OSType fileType); +/* Change the creator or file type of a file. + The FSpChangeCreatorType function changes the creator or file type of a file. + + spec input: An FSSpec record specifying the file. + creator input: The new creator type or 0x00000000 to leave + the creator type alone. + fileType input: The new file type or 0x00000000 to leave the + file type alone. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + fLckdErr -45 File is locked + vLckdErr -46 Volume is locked or read-only + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + notAFileErr -1302 Name was not a file + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: ChangeCreatorType +*/ + + +/*****************************************************************************/ + +pascal OSErr BumpDate(short vRefNum, + long dirID, + ConstStr255Param name); +/* Update the modification date of a file or directory. + The BumpDate function changes the modification date of a file or + directory to the current date/time. If the modification date is already + equal to the current date/time, then add one second to the + modification date. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID specifies + a directory that's the object. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + fLckdErr -45 File is locked + vLckdErr -46 Volume is locked or read-only + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: FSpBumpDate +*/ + +/*****************************************************************************/ + +pascal OSErr FSpBumpDate(const FSSpec *spec); +/* Update the modification date of a file or directory. + The FSpBumpDate function changes the modification date of a file or + directory to the current date/time. If the modification date is already + equal to the current date/time, then add one second to the + modification date. + + spec input: An FSSpec record specifying the object. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + fLckdErr -45 File is locked + vLckdErr -46 Volume is locked or read-only + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: BumpDate +*/ + +/*****************************************************************************/ + +pascal OSErr OnLine(FSSpecPtr volumes, + short reqVolCount, + short *actVolCount, + short *volIndex); +/* Return the list of volumes currently mounted. + The OnLine function returns the list of volumes currently mounted in + an array of FSSpec records. + + A noErr result indicates that the volumes array was filled + (actVolCount == reqVolCount) and there may be additional volumes + mounted. A nsvErr result indicates that the end of the volume list + was found and actVolCount volumes were actually found this time. + + volumes input: Pointer to array of FSSpec where the volume list + is returned. + reqVolCount input: Maximum number of volumes to return (the number of + elements in the volumes array). + actVolCount output: The number of volumes actually returned. + volIndex input: The current volume index position. Set to 1 to + start with the first volume. + output: The volume index position to get the next volume. + Pass this value the next time you call OnLine to + start where you left off. + + Result Codes + noErr 0 No error, but there are more volumes + to list + nsvErr -35 No more volumes to be listed + paramErr -50 volIndex was <= 0 +*/ + +/*****************************************************************************/ + +pascal OSErr DTGetComment(short vRefNum, + long dirID, + ConstStr255Param name, + Str255 comment); +/* Get a file or directory's Finder comment field (if any). + The DTGetComment function gets a file or directory's Finder comment + field (if any) from the Desktop Manager or if the Desktop Manager is + not available, from the Finder's Desktop file. + + IMPORTANT NOTE: Inside Macintosh says that comments are up to + 200 characters. While that may be correct for the HFS file system's + Desktop Manager, other file systems (such as Apple Photo Access) return + up to 255 characters. Make sure the comment buffer is a Str255 or you'll + regret it. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID + specifies a directory that's the object. + comment output: A Str255 where the comment is to be returned. + + Result Codes + noErr 0 No error + nsvErr -35 Volume not found + ioErr -36 I/O error + fnfErr -43 File not found + paramErr -50 Volume doesn't support this function + rfNumErr -51 Reference number invalid + extFSErr -58 External file system error - no file + system claimed this call. + desktopDamagedErr -1305 The desktop database has become corrupted - + the Finder will fix this, but if your + application is not running with the + Finder, use PBDTReset or PBDTDelete + afpItemNotFound -5012 Information not found + + __________ + + Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, FSpDTSetComment, + FSpDTGetComment +*/ + +/*****************************************************************************/ + +pascal OSErr FSpDTGetComment(const FSSpec *spec, + Str255 comment); +/* Get a file or directory's Finder comment field (if any). + The FSpDTGetComment function gets a file or directory's Finder comment + field (if any) from the Desktop Manager or if the Desktop Manager is + not available, from the Finder's Desktop file. + + IMPORTANT NOTE: Inside Macintosh says that comments are up to + 200 characters. While that may be correct for the HFS file system's + Desktop Manager, other file systems (such as Apple Photo Access) return + up to 255 characters. Make sure the comment buffer is a Str255 or you'll + regret it. + + spec input: An FSSpec record specifying the file or directory. + comment output: A Str255 where the comment is to be returned. + + Result Codes + noErr 0 No error + nsvErr -35 Volume not found + ioErr -36 I/O error + fnfErr -43 File not found + paramErr -50 Volume doesn't support this function + rfNumErr -51 Reference number invalid + extFSErr -58 External file system error - no file + system claimed this call. + desktopDamagedErr -1305 The desktop database has become corrupted - + the Finder will fix this, but if your + application is not running with the + Finder, use PBDTReset or PBDTDelete + afpItemNotFound -5012 Information not found + + __________ + + Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, FSpDTSetComment, + DTGetComment +*/ + +/*****************************************************************************/ + +pascal OSErr DTOpen(ConstStr255Param volName, + short vRefNum, + short *dtRefNum, + Boolean *newDTDatabase); +/* Open a volume's desktop database and return the desktop database refNum. + The DTOpen function opens a volume's desktop database. It returns + the reference number of the desktop database and indicates if the + desktop database was created as a result of this call (if it was created, + then it is empty). + + volName input: A pointer to the name of a mounted volume + or nil. + vRefNum input: Volume specification. + dtRefNum output: The reference number of Desktop Manager's + desktop database on the specified volume. + newDTDatabase output: true if the desktop database was created as a + result of this call and thus empty. + false if the desktop database was already created, + or if it could not be determined if it was already + created. + + Result Codes + noErr 0 No error + nsvErr -35 Volume not found + ioErr -36 I/O error + paramErr -50 Volume doesn't support this function + extFSErr -58 External file system error - no file + system claimed this call. + desktopDamagedErr -1305 The desktop database has become corrupted - + the Finder will fix this, but if your + application is not running with the + Finder, use PBDTReset or PBDTDelete +*/ + +/*****************************************************************************/ + +pascal OSErr HGetVolParms(ConstStr255Param volName, + short vRefNum, + GetVolParmsInfoBuffer *volParmsInfo, + long *infoSize); +/* Determine the characteristics of a volume. + The HGetVolParms function returns information about the characteristics + of a volume. A result of paramErr usually just means the volume doesn't + support PBHGetVolParms and the feature you were going to check + for isn't available. + + volName input: A pointer to the name of a mounted volume + or nil. + vRefNum input: Volume specification. + volParmsInfo input: Pointer to GetVolParmsInfoBuffer where the + volume attributes information is returned. + output: Atributes information. + infoSize input: Size of buffer pointed to by volParmsInfo. + output: Size of data actually returned. + + Result Codes + noErr 0 No error + nsvErr -35 Volume not found + paramErr -50 Volume doesn't support this function + + __________ + + Also see the macros for checking attribute bits in MoreFilesExtras.h +*/ + +/*****************************************************************************/ + +pascal OSErr DeleteDirectoryContents(short vRefNum, + long dirID, + ConstStr255Param name); +/* Delete the contents of a directory. + The DeleteDirectoryContents function deletes the contents of a directory. + All files and subdirectories in the specified directory are deleted. + If a locked file or directory is encountered, it is unlocked and then + deleted. If any unexpected errors are encountered, + DeleteDirectoryContents quits and returns to the caller. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to directory name, or nil when dirID specifies + a directory that's the object. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + wPrErr -44 Hardware volume lock + fLckdErr -45 File is locked + vLckdErr -46 Software volume lock + fBsyErr -47 File busy, directory not empty, or working + directory control block open + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + Also see: DeleteDirectory +*/ + +/*****************************************************************************/ + +pascal OSErr DeleteDirectory(short vRefNum, + long dirID, + ConstStr255Param name); +/* Delete a directory and its contents. + The DeleteDirectory function deletes a directory and its contents. + All files and subdirectories in the specified directory are deleted. + If a locked file or directory is encountered, it is unlocked and then + deleted. After deleting the directories contents, the directory is + deleted. If any unexpected errors are encountered, DeleteDirectory + quits and returns to the caller. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to directory name, or nil when dirID specifies + a directory that's the object. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + wPrErr -44 Hardware volume lock + fLckdErr -45 File is locked + vLckdErr -46 Software volume lock + fBsyErr -47 File busy, directory not empty, or working + directory control block open + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + Also see: DeleteDirectoryContents +*/ + +/*****************************************************************************/ + +pascal OSErr DTSetComment(short vRefNum, + long dirID, + ConstStr255Param name, + ConstStr255Param comment); +/* Set a file or directory's Finder comment field. + The DTSetComment function sets a file or directory's Finder comment + field. The volume must support the Desktop Manager because you only + have read access to the Desktop file. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID + specifies a directory that's the object. + comment input: The comment to add. Comments are limited to 200 characters; + longer comments are truncated. + + Result Codes + noErr 0 No error + nsvErr -35 Volume not found + ioErr -36 I/O error + fnfErr -43 File or directory doesnt exist + paramErr -50 Volume doesn't support this function + wPrErr -44 Volume is locked through hardware + vLckdErr -46 Volume is locked through software + rfNumErr -51 Reference number invalid + extFSErr -58 External file system error - no file + system claimed this call. + desktopDamagedErr -1305 The desktop database has become corrupted - + the Finder will fix this, but if your + application is not running with the + Finder, use PBDTReset or PBDTDelete + + __________ + + Also see: DTCopyComment, FSpDTCopyComment, FSpDTSetComment, DTGetComment, + FSpDTGetComment +*/ + +/*****************************************************************************/ + +pascal OSErr FSpDTSetComment(const FSSpec *spec, + ConstStr255Param comment); +/* Set a file or directory's Finder comment field. + The FSpDTSetComment function sets a file or directory's Finder comment + field. The volume must support the Desktop Manager because you only + have read access to the Desktop file. + + spec input: An FSSpec record specifying the file or directory. + comment input: The comment to add. Comments are limited to 200 characters; + longer comments are truncated. + + Result Codes + noErr 0 No error + nsvErr -35 Volume not found + ioErr -36 I/O error + fnfErr -43 File or directory doesnt exist + wPrErr -44 Volume is locked through hardware + vLckdErr -46 Volume is locked through software + rfNumErr -51 Reference number invalid + paramErr -50 Volume doesn't support this function + extFSErr -58 External file system error - no file + system claimed this call. + desktopDamagedErr -1305 The desktop database has become corrupted - + the Finder will fix this, but if your + application is not running with the + Finder, use PBDTReset or PBDTDelete + + __________ + + Also see: DTCopyComment, FSpDTCopyComment, DTSetComment, DTGetComment, + FSpDTGetComment +*/ + +/*****************************************************************************/ + +pascal OSErr XGetVInfo(short volReference, + StringPtr volName, + short *vRefNum, + UnsignedWide *freeBytes, + UnsignedWide *totalBytes); +/* Get extended information about a mounted volume. + The XGetVInfo function returns the name, volume reference number, + available space (in bytes), and total space (in bytes) for the + specified volume. You can specify the volume by providing its drive + number, volume reference number, or 0 for the default volume. + This routine is compatible with volumes up to 2 terabytes. + + volReference input: The drive number, volume reference number, + or 0 for the default volume. + volName input: A pointer to a buffer (minimum Str27) where + the volume name is to be returned or must + be nil. + output: The volume name. + vRefNum output: The volume reference number. + freeBytes output: The number of free bytes on the volume. + freeBytes is an UnsignedWide value. + totalBytes output: The total number of bytes on the volume. + totalBytes is an UnsignedWide value. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + paramErr -50 No default volume + + __________ + + Also see: HGetVInfo +*/ + +/*****************************************************************************/ + +pascal OSErr HGetVInfo(short volReference, + StringPtr volName, + short *vRefNum, + unsigned long *freeBytes, + unsigned long *totalBytes); +/* Get information about a mounted volume. + The HGetVInfo function returns the name, volume reference number, + available space (in bytes), and total space (in bytes) for the + specified volume. You can specify the volume by providing its drive + number, volume reference number, or 0 for the default volume. + This routine is compatible with volumes up to 4 gigabytes. + + volReference input: The drive number, volume reference number, + or 0 for the default volume. + volName input: A pointer to a buffer (minimum Str27) where + the volume name is to be returned or must + be nil. + output: The volume name. + vRefNum output: The volume reference number. + freeBytes output: The number of free bytes on the volume. + freeBytes is an unsigned long value. + totalBytes output: The total number of bytes on the volume. + totalBytes is an unsigned long value. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + paramErr -50 No default volume + + __________ + + Also see: XGetVInfo +*/ + +/*****************************************************************************/ + +pascal OSErr GetDirName(short vRefNum, + long dirID, + Str31 name); +/* Get the name of a directory from its directory ID. + The GetDirName function gets the name of a directory from its + directory ID. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name output: Points to a Str31 where the directory name is to be + returned. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume or + name parameter was NULL + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname +*/ + + +/*****************************************************************************/ + +pascal OSErr GetVolFileSystemID(ConstStr255Param pathname, + short vRefNum, + short *fileSystemID); +/* Get a volume's file system ID. + The GetVolFileSystemID function returned the file system ID of + a mounted volume. The file system ID identifies the file system + that handles requests to a particular volume. Here's a partial list + of file system ID numbers (only Apple's file systems are listed): + FSID File System + ----- ----------------------------------------------------- + $0000 Macintosh HFS or MFS + $0100 ProDOS File System + $0101 PowerTalk Mail Enclosures + $4147 ISO 9660 File Access (through Foreign File Access) + $4242 High Sierra File Access (through Foreign File Access) + $464D QuickTake File System (through Foreign File Access) + $4953 Macintosh PC Exchange (MS-DOS) + $4A48 Audio CD Access (through Foreign File Access) + $4D4B Apple Photo Access (through Foreign File Access) + + See the Technical Note "FL 35 - Determining Which File System + Is Active" and the "Guide to the File System Manager" for more + information. + + pathName input: Pointer to a full pathname or nil. If you pass + in a partial pathname, it is ignored. A full + pathname to a volume must contain at least + one colon character (:) and must not start with + a colon character. + vRefNum input: Volume specification (volume reference number, + working directory number, drive number, or 0). + fileSystemID output: The volume's file system ID. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + paramErr -50 No default volume, or pb was NULL +*/ + +/*****************************************************************************/ + +pascal OSErr GetDInfo(short vRefNum, + long dirID, + ConstStr255Param name, + DInfo *fndrInfo); +/* Get the finder information for a directory. + The GetDInfo function gets the finder information for a directory. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID + specifies a directory that's the object. + fndrInfo output: If the object is a directory, then its DInfo. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + Also see: FSpGetDInfo, FSpGetFInfoCompat +*/ + +/*****************************************************************************/ + +pascal OSErr FSpGetDInfo(const FSSpec *spec, + DInfo *fndrInfo); +/* Get the finder information for a directory. + The FSpGetDInfo function gets the finder information for a directory. + + spec input: An FSSpec record specifying the directory. + fndrInfo output: If the object is a directory, then its DInfo. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + Also see: FSpGetFInfoCompat, GetDInfo +*/ + + +#endif /* _MACSTUFF_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/mactime.c boinc-7.0.14+dfsg/zip/zip/macos/source/mactime.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/mactime.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/mactime.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,453 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* ----------------------------------------------------------------------------- + +The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime, +mktime and time do not work correctly. The supplied link library mactime.c +contains replacement functions for them. + + * Caveat: On a Mac, we only know the GMT and DST offsets for + * the current time, not for the time in question. + * Mac has no support for DST handling. + * DST changeover is all manually set by the user. + + +------------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "mactime.h" + + +/* +The MacOS function GetDateTime returns the +number of seconds elapsed since midnight, January 1, 1904. +*/ +const unsigned long MacOS_2_Unix = 2082844800L; + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + + +#ifndef TEST_TIME_LIB +#define my_gmtime gmtime +#define my_localtime localtime +#define my_mktime mktime +#define my_time time +#endif + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ +/* internal prototypes */ +static void clear_tm(struct tm * tm); +static long GMTDelta(void); +static Boolean DaylightSaving(void); +static time_t GetTimeMac(void); +static time_t Mactime(time_t *timer); +static void normalize(int *i,int *j,int norm); +static struct tm *time2tm(const time_t *timer); +static time_t tm2time(struct tm *tp); + +/* Because serial port and SLIP conflict with ReadXPram calls, + we cache the call here so we don't hang on calling ReadLocation() */ +static void myReadLocation(MachineLocation * loc); + + +/* prototypes for STD lib replacement functions */ +struct tm *my_gmtime(const time_t *t); +struct tm *my_localtime(const time_t *t); +time_t my_mktime(struct tm *tp); +time_t my_time(time_t *t); + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + /* + * Mac file times are based on 1904 Jan 1 00:00 local time, + * not 1970 Jan 1 00:00 UTC. + * So we have to convert the time stamps into UNIX UTC + * compatible values. + */ +time_t MacFtime2UnixFtime(unsigned long macftime) +{ + long UTCoffset; + + GetGMToffsetMac(macftime, &UTCoffset); + MACOS_TO_UNIX(macftime); + macftime -= UTCoffset; + + return macftime; +} + + + /* + * Mac file times are based on 1904 Jan 1 00:00 local time, + * not 1970 Jan 1 00:00 UTC. + * So we have to convert the time stamps into MacOS local + * compatible values. + */ +unsigned long UnixFtime2MacFtime(time_t unxftime) +{ + long UTCoffset; + unsigned long macftime = unxftime; + + UNIX_TO_MACOS(macftime); + GetGMToffsetMac(macftime, &UTCoffset); + macftime += UTCoffset; + + return macftime; +} + + + + + +/* +* This function convert a file-localtime to an another +* file-localtime. +*/ +time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs) +{ + time_t MacGMTTime; + long UTCoffset; + + /* convert macloctim into corresponding UTC value */ + MacGMTTime = macloctim - s_gmtoffs; + GetGMToffsetMac(macloctim, &UTCoffset); + + return (MacGMTTime + UTCoffset); +} /* AdjustForTZmove() */ + + + + +/* + * This function calculates the difference between the supplied Mac + * ftime value (local time) and the corresponding UTC time in seconds. + */ +Boolean GetGMToffsetMac(unsigned long mactime, long *UTCoffset) +{ + +mactime = mactime; +/* + * Caveat: On a Mac, we only know the GMT and DST offsets for + * the current time, not for the time in question. + * Mac has no support for DST handling. + * DST changeover is all manually set by the user. + + May be later I can include a support of GMT offset calculation for the + time in question here. +*/ + *UTCoffset = GMTDelta(); + + return true; +} + + + + + + + +/***************************************************************************** + * Standard Library Replacement Functions + * gmtime(), mktime(), localtime(), time() + * + * The unix epoch is used here. + * These functions gmtime(), mktime(), localtime() and time() + * expects and returns unix times. + * + * At midnight Jan. 1, 1970 GMT, the local time was + * midnight Jan. 1, 1970 + GMTDelta(). + * + * + *****************************************************************************/ + + +struct tm *my_gmtime(const time_t *timer) +{ + return time2tm(timer); +} + + + + +struct tm *my_localtime(const time_t *timer) +{ + time_t maclocal; + + maclocal = *timer; + maclocal += GMTDelta(); + + return time2tm(&maclocal); +} + + + + +time_t my_mktime(struct tm *tp) +{ + time_t maclocal; + + maclocal = tm2time(tp); + maclocal -= GMTDelta(); + + return maclocal; +} + + + + + + +time_t my_time(time_t *time) +{ +time_t tmp_time; + +GetDateTime(&tmp_time); + +MACOS_TO_UNIX(tmp_time); + +if (time) + { + *time = tmp_time; + } + +return tmp_time; +} + + + +/*****************************************************************************/ +/* static module level functions +/*****************************************************************************/ + + +/* + * The geographic location and time zone information of a Mac + * are stored in extended parameter RAM. The ReadLocation + * produdure uses the geographic location record, MachineLocation, + * to read the geographic location and time zone information in + * extended parameter RAM. + * + * Because serial port and SLIP conflict with ReadXPram calls, + * we cache the call here. + * + * Caveat: this caching will give the wrong result if a session + * extend across the DST changeover time, but + * this function resets itself every 2 hours. + */ +static void myReadLocation(MachineLocation * loc) +{ + static MachineLocation storedLoc; /* InsideMac, OSUtilities, page 4-20 */ + static time_t first_call = 0, last_call = 86400; + + if ((last_call - first_call) > 7200) + { + GetDateTime(&first_call); + ReadLocation(&storedLoc); + } + + GetDateTime(&last_call); + *loc = storedLoc; +} + + + + +static Boolean DaylightSaving(void) +{ + MachineLocation loc; + unsigned char dlsDelta; + + myReadLocation(&loc); + dlsDelta = loc.u.dlsDelta; + + return (dlsDelta != 0); +} + + + + +/* current local time = GMTDelta() + GMT + GMT = local time - GMTDelta() */ +static long GMTDelta(void) +{ + MachineLocation loc; + long gmtDelta; + + myReadLocation(&loc); + + /* + * On a Mac, the GMT value is in seconds east of GMT. For example, + * San Francisco is at -28,800 seconds (8 hours * 3600 seconds per hour) + * east of GMT. The gmtDelta field is a 3-byte value contained in a + * long word, so you must take care to get it properly. + */ + gmtDelta = loc.u.gmtDelta & 0x00FFFFFF; + if ((gmtDelta & 0x00800000) != 0) + { + gmtDelta |= 0xFF000000; + } + + return gmtDelta; +} + + + +/* This routine simulates stdclib time(), time in seconds since 1.1.1970 + The time is in GMT */ +static time_t GetTimeMac(void) +{ + unsigned long maclocal; + + + /* + * Get the current time expressed as the number of seconds + * elapsed since the Mac epoch, midnight, Jan. 1, 1904 (local time). + * On a Mac, current time accuracy is up to a second. + */ + + GetDateTime(&maclocal); /* Get Mac local time */ + maclocal -= GMTDelta(); /* Get Mac GMT */ + MACOS_TO_UNIX(maclocal); + + return maclocal; /* return unix GMT */ +} + + + + +/* + * clear_tm - sets a broken-down time to the equivalent of 1970/1/1 00:00:00 + */ + +static void clear_tm(struct tm * tm) +{ + tm->tm_sec = 0; + tm->tm_min = 0; + tm->tm_hour = 0; + tm->tm_mday = 1; + tm->tm_mon = 0; + tm->tm_year = 0; + tm->tm_wday = 1; + tm->tm_yday = 0; + tm->tm_isdst = -1; +} + + +static void normalize(int *i,int *j,int norm) +{ + while(*i < 0) + { + *i += norm; + (*j)--; + } + + while(*i >= norm) + { + *i -= norm; + (*j)++; + } +} + + + +/* Returns the GMT times */ +static time_t Mactime(time_t *timer) +{ + time_t t = GetTimeMac(); + + if (timer != NULL) + *timer = t; + + return t; +} + + + + +static struct tm *time2tm(const time_t *timer) +{ + DateTimeRec dtr; + MachineLocation loc; + time_t macLocal = *timer; + + static struct tm statictime; + static const short monthday[12] = + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; + + UNIX_TO_MACOS(macLocal); + SecondsToDate(macLocal, &dtr); + + statictime.tm_sec = dtr.second; /* second, from 0 to 59 */ + statictime.tm_min = dtr.minute; /* minute, from 0 to 59 */ + statictime.tm_hour = dtr.hour; /* hour, from 0 to 23 */ + statictime.tm_mday = dtr.day; /* day of the month, from 1 to 31 */ + statictime.tm_mon = dtr.month - 1; /* month, 1= January and 12 = December */ + statictime.tm_year = dtr.year - 1900; /* year, ranging from 1904 to 2040 */ + statictime.tm_wday = dtr.dayOfWeek - 1; /* day of the week, 1 = Sun, 7 = Sat */ + + statictime.tm_yday = monthday[statictime.tm_mon] + + statictime.tm_mday - 1; + + if (2 < statictime.tm_mon && !(statictime.tm_year & 3)) + { + ++statictime.tm_yday; + } + + myReadLocation(&loc); + statictime.tm_isdst = DaylightSaving(); + + return(&statictime); +} + + + + + +static time_t tm2time(struct tm *tp) +{ +time_t intMacTime; +DateTimeRec dtr; + + normalize(&tp->tm_sec, &tp->tm_min, 60); + normalize(&tp->tm_min, &tp->tm_hour,60); + normalize(&tp->tm_hour,&tp->tm_mday,24); + normalize(&tp->tm_mon, &tp->tm_year,12); + + dtr.year = tp->tm_year + 1900; /* years since 1900 */ + dtr.month = tp->tm_mon + 1; /* month, 0 = January and 11 = December */ + dtr.day = tp->tm_mday; /* day of the month, from 1 to 31 */ + dtr.hour = tp->tm_hour; /* hour, from 0 to 23 */ + dtr.minute = tp->tm_min; /* minute, from 0 to 59 */ + dtr.second = tp->tm_sec; /* second, from 0 to 59 */ + + DateToSeconds(&dtr, &intMacTime); + + MACOS_TO_UNIX(intMacTime); + + return intMacTime; +} + +const char *BOINC_RCSID_506f517e35 = "$Id: mactime.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/mactime.h boinc-7.0.14+dfsg/zip/zip/macos/source/mactime.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/mactime.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/mactime.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,61 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef _MACTIME_H_ +#define _MACTIME_H_ +/* ----------------------------------------------------------------------------- + +The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime, +mktime and time do not work correctly. The supplied link library mactime.c +contains replacement functions for them. + + * Caveat: On a Mac, we only know the GMT and DST offsets for + * the current time, not for the time in question. + * Mac has no support for DST handling. + * DST changeover is all manually set by the user. + + +------------------------------------------------------------------------------*/ + +#include +#include + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + + + /* + * ARGH. Mac times are based on 1904 Jan 1 00:00, not 1970 Jan 1 00:00. + * So we have to diddle time_t's appropriately: add or subtract 66 years' + * worth of seconds == number of days times 86400 == (66*365 regular days + + * 17 leap days ) * 86400 == (24090 + 17) * 86400 == 2082844800L seconds. + * We hope time_t is an unsigned long (ulg) on the Macintosh... + */ +/* +This Offset is only used by MacFileDate_to_UTime() +*/ + +#define MACOS_TO_UNIX(x) (x) -= (unsigned long)MacOS_2_Unix +#define UNIX_TO_MACOS(x) (x) += (unsigned long)MacOS_2_Unix + +/* +The MacOS function GetDateTime returns the +number of seconds elapsed since midnight, January 1, 1904. +*/ +extern const unsigned long MacOS_2_Unix; + + +/* prototypes for public utility functions */ +time_t MacFtime2UnixFtime(unsigned long macftime); +unsigned long UnixFtime2MacFtime(time_t unxftime); +time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs); +Boolean GetGMToffsetMac(unsigned long macftime, long *UTCoffset); + + +#endif diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/pathname.c boinc-7.0.14+dfsg/zip/zip/macos/source/pathname.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/pathname.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/pathname.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,667 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + pathname.c + + Function dealing with the pathname. Mostly C-string work. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include + +#include "pathname.h" +#include "helpers.h" +#include "macstuff.h" + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +const char ResourceMark[] = "XtraStuf.mac:"; /* see also macos.c */ + + +#include "zip.h" + + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + + + +/* +** return volumename from pathname +** +*/ + +unsigned short GetVolumeFromPath(const char *FullPath, char *VolumeName) +{ +const char *VolEnd, *tmpPtr1; +char *tmpPtr2 = VolumeName; + +AssertStr(FullPath,"GetVolumeFromPath") + +for (VolEnd = FullPath; *VolEnd != '\0' && *VolEnd != ':'; VolEnd++) + ; +if (*VolEnd == '\0') return 0; + +for (tmpPtr1 = FullPath; tmpPtr1 != VolEnd;) + { + *tmpPtr2++ = *tmpPtr1++; + } + +*tmpPtr2 = '\0'; + +return (unsigned short) strlen(VolumeName); +} + + + +/***********************************/ +/* Function FindNewExtractFolder() */ +/***********************************/ + +char *FindNewExtractFolder(char *ExtractPath) +{ +char buffer[NAME_MAX], *tmpPtr, *namePtr; +short count = 0, folderCount = 0; +OSErr err; +FSSpec Spec; +long theDirID; +Boolean isDirectory; +unsigned short namelen, pathlen = strlen(ExtractPath); + +AssertStr(ExtractPath,"FindNewExtractFolder ExtractPath == NULL") + +for (tmpPtr = ExtractPath; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') + { + folderCount++; + namePtr = tmpPtr; + } + +if (folderCount > 1) + namelen = strlen(namePtr); +else + namelen = strlen(ExtractPath); + +for (count = 0; count < 99; count++) + { + memset(buffer,0,sizeof(buffer)); + + if (namelen >= 28) + ExtractPath[pathlen-2] = 0x0; + else + ExtractPath[pathlen-1] = 0x0; + + sprintf(buffer,"%s%d",ExtractPath,count); + GetCompletePath(ExtractPath, buffer, &Spec,&err); + err = FSpGetDirectoryID(&Spec, &theDirID, &isDirectory); + if (err == -43) break; + } + +/* Foldernames must always end with a colon */ +sstrcat(ExtractPath,":"); +return ExtractPath; +} + + + +/* +** creates an archive file name +** +*/ + +void createArchiveName(char *thePath) +{ +char *tmpPtr, *namePtr; +short folderCount = 0; +unsigned short namelen, pathlen = strlen(thePath); + +if (thePath[pathlen-1] == ':') thePath[pathlen-1] = 0x0; + +for (tmpPtr = thePath; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') + { + folderCount++; + namePtr = tmpPtr; + } + +namelen = strlen(namePtr); + + /* we have to eliminate illegal chars: + * The name space for Mac filenames and Zip filenames (unix style names) + * do both include all printable extended-ASCII characters. The only + * difference we have to take care of is the single special character + * used as path delimiter: + * ':' on MacOS and '/' on Unix and '\' on Dos. + * So, to convert between Mac filenames and Unix filenames without any + * loss of information, we simply interchange ':' and '/'. Additionally, + * we try to convert the coding of the extended-ASCII characters into + * InfoZip's standard ISO 8859-1 codepage table. + */ + MakeCompatibleString(namePtr, '/', '_', '.', '-', -1); + + /* Avoid filenames like: "Archive..zip" */ +if (thePath[pathlen-1] == '.') + { + thePath[pathlen-1] = 0; + } + +if (folderCount >= 1) + { /* path contains at least one folder */ + + if (namelen >= 28) + { + pathlen = pathlen-4; + } + + thePath[pathlen] = '.'; + thePath[pathlen+1] = 'z'; + thePath[pathlen+2] = 'i'; + thePath[pathlen+3] = 'p'; + thePath[pathlen+4] = 0x0; + return; + } +else + { /* path contains no folder */ + FindDesktopFolder(thePath); + createArchiveName(thePath); + } +} + + + +/* +** finds the desktop-folder on a volume with +** largest amount of free-space. +*/ + +void FindDesktopFolder(char *Path) +{ +char buffer[255]; +FSSpec volumes[50]; /* 50 Volumes should be enough */ +short actVolCount, volIndex = 1, VolCount = 0; +OSErr err; +short i, foundVRefNum; +FSSpec spec; +UnsignedWide freeBytes; +UnsignedWide totalBytes; +UnsignedWide MaxFreeBytes; + +err = OnLine(volumes, 50, &actVolCount, &volIndex); +printerr("OnLine:", (err != -35) && (err != 0), err, __LINE__, __FILE__, ""); + +MaxFreeBytes.hi = 0; +MaxFreeBytes.lo = 0; + +for (i=0; i < actVolCount; i++) + { + XGetVInfo(volumes[i].vRefNum, + volumes[i].name, + &volumes[i].vRefNum, + &freeBytes, + &totalBytes); + + if (MaxFreeBytes.hi < freeBytes.hi) { + MaxFreeBytes.hi = freeBytes.hi; + MaxFreeBytes.lo = freeBytes.lo; + foundVRefNum = volumes[i].vRefNum; + } + + if ((freeBytes.hi == 0) && (MaxFreeBytes.lo < freeBytes.lo)) { + MaxFreeBytes.hi = freeBytes.hi; + MaxFreeBytes.lo = freeBytes.lo; + foundVRefNum = volumes[i].vRefNum; + } + +} + + FSpFindFolder(foundVRefNum, kDesktopFolderType, + kDontCreateFolder,&spec); + + GetFullPathFromSpec(buffer, &spec , &err); + sstrcat(buffer,Path); + sstrcpy(Path,buffer); +} + + +/* +** return the path without the filename +** +*/ + +char *TruncFilename(char *DirPath, const char *FilePath) +{ +char *tmpPtr; +char *dirPtr = NULL; + +AssertStr(DirPath,"TruncFilename") +Assert_it(Spec,"TruncFilename","") + +sstrcpy(DirPath, FilePath); + +for (tmpPtr = DirPath; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') + dirPtr = tmpPtr; + +if (dirPtr) + *++dirPtr = '\0'; +else + printerr("TruncFilename: FilePath has no Folders", -1, + -1, __LINE__, __FILE__, FilePath); + +return DirPath; +} + + + +/* +** return only filename +** +*/ + +char *GetFilename(char *FileName, const char *FilePath) +{ +const char *tmpPtr; +const char *dirPtr = NULL; + +Assert_it(FileName,"GetFilename","") +Assert_it(FilePath,"GetFilename","") + +for (tmpPtr = FilePath; *tmpPtr; tmpPtr++) + { + if (*tmpPtr == ':') + { + dirPtr = tmpPtr; + } + } + +if (dirPtr) + { + ++dirPtr; /* jump over the ':' */ + } +else + { + return strcpy(FileName, FilePath); /* FilePath has no Folders */ + } + +return strcpy(FileName, dirPtr); +} + + + +/* +** return fullpathname from folder/dir-id +** +*/ + +char *GetFullPathFromID(char *CompletePath, short vRefNum, long dirID, + ConstStr255Param name, OSErr *err) +{ +FSSpec spec; + + *err = FSMakeFSSpecCompat(vRefNum, dirID, name, &spec); + printerr("FSMakeFSSpecCompat:", (*err != -43) && (*err != 0), *err, + __LINE__, __FILE__, ""); + if ( (*err == noErr) || (*err == fnfErr) ) + { + return GetFullPathFromSpec(CompletePath, &spec, err); + } + +return NULL; +} + + + +/* +** convert real-filename to archive-filename +** +*/ + +char *Real2RfDfFilen(char *RfDfFilen, const char *RealPath, + short CurrentFork, short MacZipMode, Boolean DataForkOnly) +{ + +AssertStr(RealPath,"Real2RfDfFilen") +AssertStr(RfDfFilen,"Real2RfDfFilen") + +if (DataForkOnly) /* make no changes */ + { + return sstrcpy(RfDfFilen, RealPath); + } + +switch (MacZipMode) + { + case JohnnyLee_EF: + { + sstrcpy(RfDfFilen, RealPath); + if (CurrentFork == DataFork) /* data-fork */ + return sstrcat(RfDfFilen, "d"); + if (CurrentFork == ResourceFork) /* resource-fork */ + return sstrcat(RfDfFilen, "r"); + break; + } + + case NewZipMode_EF: + { + switch (CurrentFork) + { + case DataFork: + { + sstrcpy(RfDfFilen, RealPath); + return RfDfFilen; /* data-fork */ + break; + } + case ResourceFork: + { + sstrcpy(RfDfFilen, ResourceMark); + sstrcat(RfDfFilen, RealPath); /* resource-fork */ + return RfDfFilen; + break; + } + default: + { + printerr("Real2RfDfFilen:", -1, -1, + __LINE__, __FILE__, RealPath); + return NULL; /* function should never reach this point */ + } + } + break; + } + default: + { + printerr("Real2RfDfFilen:", -1, -1, __LINE__, __FILE__, RealPath); + return NULL; /* function should never reach this point */ + } + } + +printerr("Real2RfDfFilen:", -1, -1, __LINE__, __FILE__, RealPath); +return NULL; /* function should never come reach this point */ +} + + + +/* +** convert archive-filename into a real filename +** +*/ + +char *RfDfFilen2Real(char *RealFn, const char *RfDfFilen, short MacZipMode, + Boolean DataForkOnly, short *CurrentFork) +{ +short length; +int result; + +AssertStr(RfDfFilen,"RfDfFilen2Real") + +if (DataForkOnly || + (MacZipMode == UnKnown_EF) || + (MacZipMode < JohnnyLee_EF)) + { + *CurrentFork = DataFork; + return sstrcpy(RealFn,RfDfFilen); + } + +result = strncmp(RfDfFilen, ResourceMark, sizeof(ResourceMark)-2); +if (result == 0) + { + MacZipMode = NewZipMode_EF; + } + +switch (MacZipMode) + { + case JohnnyLee_EF: + { + sstrcpy(RealFn, RfDfFilen); + length = strlen(RealFn); /* determine Fork type */ + if (RealFn[length-1] == 'd') *CurrentFork = DataFork; + else *CurrentFork = ResourceFork; + RealFn[length-1] = '\0'; /* simply cut one char */ + return RealFn; + break; + } + + case NewZipMode_EF: + { /* determine Fork type */ + result = strncmp(RfDfFilen, ResourceMark, sizeof(ResourceMark)-2); + if (result != 0) + { + *CurrentFork = DataFork; + sstrcpy(RealFn, RfDfFilen); + return RealFn; /* data-fork */ + } + else + { + *CurrentFork = ResourceFork; + if (strlen(RfDfFilen) > (sizeof(ResourceMark) - 1)) + { + sstrcpy(RealFn, &RfDfFilen[sizeof(ResourceMark)-1]); + } + else RealFn[0] = '\0'; + return RealFn; /* resource-fork */ + } + break; + } + default: + { + *CurrentFork = NoFork; + printerr("RfDfFilen2Real():", -1, MacZipMode, + __LINE__, __FILE__, RfDfFilen); + return NULL; /* function should never reach this point */ + } + } + +printerr("RfDfFilen2Real():", -1, MacZipMode, __LINE__, __FILE__, RfDfFilen); +return NULL; /* function should never reach this point */ +} + + + +/* +** return the applications name (argv[0]) +** +*/ + +char *GetAppName(void) +{ +ProcessSerialNumber psn; +static Str255 AppName; +ProcessInfoRec pinfo; +OSErr err; + +GetCurrentProcess(&psn); +pinfo.processName = AppName; +pinfo.processInfoLength = sizeof(pinfo); +pinfo.processAppSpec = NULL; + +err = GetProcessInformation(&psn,&pinfo); +AppName[AppName[0]+1] = 0x00; + +return (char *)&AppName[1]; +} + + + +/* +** return fullpathname from FSSpec +** +*/ + +char *GetFullPathFromSpec(char *FullPath, FSSpec *Spec, OSErr *err) +{ +Handle hFullPath; +short len; + +Assert_it(Spec,"GetFullPathFromSpec","") + +*err = FSpGetFullPath(Spec, &len, &hFullPath); +printerr("FSpGetFullPath:", (*err != -43) && (*err != 0), *err, + __LINE__, __FILE__, ""); + +memmove(FullPath, (Handle) *hFullPath, len); +FullPath[len] = '\0'; /* make c-string */ + +DisposeHandle((Handle)hFullPath); /* we don't need it any more */ + +printerr("Warning path length exceeds limit: ", len >= NAME_MAX, len, + __LINE__, __FILE__, " chars "); + +return FullPath; +} + + + + +/* +* This function expands a given partial path to a complete path. +* Path expansions are relative to the running app. +* This function follows the notation: +* 1. relative path: +* a: ":subfolder:filename" -> ":current folder:subfolder:filename" +* b: "::folder2:filename" -> folder2 is beside the current +* folder on the same level +* c: "filename" -> in current folder +* +* An absolute path will be returned. + +The following characteristics of Macintosh pathnames should be noted: + + A full pathname never begins with a colon, but must contain at + least one colon. + A partial pathname always begins with a colon separator except in + the case where the file partial pathname is a simple file or + directory name. + Single trailing separator colons in full or partial pathnames are + ignored except in the case of full pathnames to volumes. + In full pathnames to volumes, the trailing separator colon is required. + Consecutive separator colons can be used to ascend a level from a + directory to its parent directory. Two consecutive separator colons + will ascend one level, three consecutive separator colons will ascend + two levels, and so on. Ascending can only occur from a directory; + not a file. +*/ + +char *GetCompletePath(char *CompletePath, const char *name, FSSpec *Spec, + OSErr *err) +{ +Boolean hasDirName = false; +char currentdir[NAME_MAX]; +char *tmpPtr; +unsigned short pathlen; + +AssertStr(name,"GetCompletePath") +Assert_it(Spec,"GetCompletePath","") +Assert_it((CompletePath != name),"GetCompletePath","") + +for (tmpPtr = name; *tmpPtr; tmpPtr++) + if (*tmpPtr == ':') hasDirName = true; + +if (name[0] != ':') /* case c: path including volume name or only filename */ + { + if (hasDirName) + { /* okey, starts with volume name, so it must be a complete path */ + sstrcpy(CompletePath, name); + } + else + { /* only filename: add cwd and return */ + getcwd(currentdir, NAME_MAX); + sstrcat(currentdir, name); + sstrcpy(CompletePath, currentdir); + } + } +else if (name[1] == ':') /* it's case b: "::folder2:filename" */ + { + printerr("GetCompletePath ", -1, *err, __LINE__, __FILE__, "not implemented"); + /* it's not yet implemented; do we really need this case ?*/ + return NULL; + } +else /* it's case a: ":subfolder:filename" */ + { + getcwd(CompletePath, NAME_MAX); /* we don't need a second colon */ + CompletePath[strlen(CompletePath)-1] = '\0'; + sstrcat(CompletePath, name); + } + +pathlen = strlen(CompletePath); +*err = FSpLocationFromFullPath(pathlen, CompletePath, Spec); + +return CompletePath; +} + + + +char *MakeFilenameShorter(const char *LongFilename) +{ +static char filename[35]; /* contents should be never longer than 32 chars */ +static unsigned char Num = 0; /* change the number for every call */ + /* this var will rollover without a problem */ +char tempLongFilename[1024], charnum[5]; +char *last_dotpos = tempLongFilename; +unsigned long full_length = strlen(LongFilename); +unsigned long ext_length = 0; +unsigned long num_to_cut = 0; +long firstpart_length; +char *tmpPtr; +short MaxLength = 31; + +if (full_length <= MaxLength) /* filename is not long */ + { + return strcpy(filename,LongFilename); + } + +Num++; +strcpy(tempLongFilename,LongFilename); + +/* Look for the last extension pos */ +for (tmpPtr = tempLongFilename; *tmpPtr; tmpPtr++) + if (*tmpPtr == '.') last_dotpos = tmpPtr; + +ext_length = strlen(last_dotpos); +firstpart_length = last_dotpos - tempLongFilename; + +if (ext_length > 6) /* up to 5 chars are treated as a */ + { /* normal extension like ".html" or ".class" */ + firstpart_length = 0; + } + +num_to_cut = full_length - MaxLength; + +/* number the files to make the names unique */ +sprintf(charnum,"~%x", Num); +num_to_cut += strlen(charnum); + +if (firstpart_length == 0) + { + firstpart_length = full_length; + tempLongFilename[firstpart_length - num_to_cut] = 0; + sprintf(filename,"%s%s", tempLongFilename, charnum); + } +else + { + tempLongFilename[firstpart_length - num_to_cut] = 0; + sprintf(filename,"%s%s%s", tempLongFilename, charnum, last_dotpos); + } + +return filename; +} + +const char *BOINC_RCSID_510cc2090d = "$Id: pathname.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/pathname.h boinc-7.0.14+dfsg/zip/zip/macos/source/pathname.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/pathname.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/pathname.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,59 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef PATHNAME_H +#define PATHNAME_H 1 + + +char *StripPartialDir(char *CompletePath, + const char *PartialPath, const char *FullPath); + +char *Real2RfDfFilen(char *RfDfFilen, const char *RealPath, short CurrentFork, + short MacZipMode, Boolean DataForkOnly); +char *RfDfFilen2Real(char *RealFn, const char *RfDfFilen, short MacZipMode, + Boolean DataForkOnly, short *CurrentFork); + +unsigned short GetVolumeFromPath(const char *FullPath, char *VolumeName); +char *GetCompletePath(char *CompletePath, const char *name, FSSpec *Spec, + OSErr *err); +char *TruncFilename(char *DirPath, const char *FilePath); +char *GetFilename(char *CompletePath, const char *name); +char *GetFullPathFromSpec(char *CompletePath, FSSpec *Spec, OSErr *err); +char *GetFullPathFromID(char *CompletePath, short vRefNum, long dirID, + ConstStr255Param name, OSErr *err); + +char *GetAppName(void); +void createArchiveName(char *Path); +void FindDesktopFolder(char *Path); +char *FindNewExtractFolder(char *ExtractPath); + +char *MakeFilenameShorter(const char *LongFilename); + +/* +Rule: UnKnown_EF should always be zero. + JohnnyLee_EF, NewZipMode_EF should always greater than all + other definitions +*/ +#define UnKnown_EF 0 +#define TomBrownZipIt1_EF 10 +#define TomBrownZipIt2_EF 20 +#define JohnnyLee_EF 30 +#define NewZipMode_EF 40 + + + +#define ResourceFork -1 +#define DataFork 1 +#define NoFork 0 + + +#ifndef NAME_MAX +#define NAME_MAX 1024 +#endif + +#endif /* PATHNAME_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/recurse.c boinc-7.0.14+dfsg/zip/zip/macos/source/recurse.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/recurse.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/recurse.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,444 @@ +/* +These functions are based on Jim Luther's IterateDirectory() found in MoreFiles +However, it's heavily modified by Dirk Haase +*/ + +/* +** IterateDirectory: File Manager directory iterator routines. +** +** by Jim Luther +** +** File: IterateDirectory.c +** +** Copyright (c) 1995-1998 Jim Luther and Apple Computer, Inc. +** All rights reserved. +** +** You may incorporate this sample code into your applications without +** restriction, though the sample code has been provided "AS IS" and the +** responsibility for its operation is 100% yours. +** +** IterateDirectory is designed to drop into the MoreFiles sample code +** library I wrote while in Apple Developer Technical Support +*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include +#include +#include +#include +#include + + +#include "zip.h" +#include "macstuff.h" +#include "helpers.h" +#include "recurse.h" +#include "macglob.h" +#include "pathname.h" + + + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +/* The RecurseGlobals structure is used to minimize the amount of +** stack space used when recursively calling RecurseDirectoryLevel +** and to hold global information that might be needed at any time. +*/ +struct RecurseGlobals +{ + short vRefNum; + CInfoPBRec cPB; /* the parameter block used for + PBGetCatInfo calls */ + unsigned char *itemName; /* the name of the current item */ + char *FullPath; + short FullPathLen; + OSErr result; /* temporary holder of results - + saves 2 bytes of stack each level */ + Boolean quitFlag; /* set to true if filter wants to + kill interation */ + unsigned short maxLevels; /* Maximum levels to + iterate through */ + unsigned short currentLevel; /* The current level + IterateLevel is on */ +}; + +typedef struct RecurseGlobals RecurseGlobals; +typedef RecurseGlobals *RecurseGlobalsPtr; + + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +extern MacZipGlobals MacZip; +extern const char ResourceMark[13]; /* "XtraStuf.mac:" var is initialized in file pathname.c */ +extern int extra_fields; /* do not create extra fields if false */ + +static RecurseGlobals theGlobals; + +static unsigned long DirLevels = 0; +static char *buffer; +extern int verbose; /* 1=report oddities in zip file structure */ + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + +int procname(char *filename, int caseflag); +int MatchWild( char *pPat, char *pStr, int case_sens); +Boolean IsZipFile(char *name); + +static void RecurseDirectoryLevel(long DirID, RecurseGlobals *Globals); +static Boolean isRegularItem( RecurseGlobals *Globals); +static void ProcessFiles(RecurseGlobals *Globals, + Boolean hasDataFork, Boolean hasResourceFork); +static void ProcessDirectory(RecurseGlobals *Globals, + Boolean IncludeItem, long DirID); +static void ProcessItem(RecurseGlobals *Globals, long DirID); + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + +static void RecurseDirectoryLevel(long DirID, RecurseGlobals *Globals) +{ +char buffer2[23]; + + /* if maxLevels is zero, we aren't checking levels */ + if ( (Globals->maxLevels == 0) || + /* if currentLevel < maxLevels, look at this level */ + (Globals->currentLevel < Globals->maxLevels) ) + { + short index = 1; + + ++Globals->currentLevel; /* go to next level */ + if (DirLevels < Globals->currentLevel) DirLevels = Globals->currentLevel; + sprintf(buffer2,"Globals->currentLevel: %d",Globals->currentLevel); + + do + { /* Isn't C great... What I'd give for a "WITH + theGlobals DO" about now... */ + + /* Get next source item at the current directory level */ + Globals->cPB.dirInfo.ioFDirIndex = index; + Globals->cPB.dirInfo.ioDrDirID = DirID; + Globals->result = PBGetCatInfoSync((CInfoPBPtr)&Globals->cPB); + + ShowCounter(false); + + if ( Globals->result == noErr ) + { + ProcessItem(Globals, DirID); + } /* if ( Globals->result == noErr ) */ + + ++index; /* prepare to get next item */ + /* time to fall back a level? */ + } while ( (Globals->result == noErr) && (!Globals->quitFlag) ); + + if ( (Globals->result == fnfErr) || /* fnfErr is OK - + it only means we hit + the end of this level */ + (Globals->result == afpAccessDenied) ) /* afpAccessDenied is OK, + too - it only means we cannot see inside a directory */ + { + Globals->result = noErr; + } + + --Globals->currentLevel; /* return to previous level as we leave */ + } +} + + + +/*****************************************************************************/ + +pascal OSErr RecurseDirectory(short vRefNum, + long thedirID, + ConstStr255Param name, + unsigned short maxLevels) +{ + OSErr result; + short theVRefNum; + Boolean isDirectory; + long DirID; + + /* Get the real directory ID and make sure it is a directory */ + result = GetDirectoryID(vRefNum, thedirID, name, &DirID, &isDirectory); + if ( result == noErr ) + { + if ( isDirectory == true ) + { + /* Get the real vRefNum */ + result = DetermineVRefNum(name, vRefNum, &theVRefNum); + if ( result == noErr ) + { + /* Set up the globals we need to access from + the recursive routine. */ + theGlobals.cPB.hFileInfo.ioNamePtr = theGlobals.itemName; + theGlobals.cPB.hFileInfo.ioVRefNum = theVRefNum; + theGlobals.itemName[0] = 0; + theGlobals.result = noErr; + theGlobals.quitFlag = false; + theGlobals.maxLevels = maxLevels; + theGlobals.currentLevel = 0; /* start at level 0 */ + + /* Here we go into recursion land... */ + RecurseDirectoryLevel(DirID, &theGlobals); + + result = theGlobals.result; /* set the result */ + } + } + else + { + result = dirNFErr; /* a file was passed instead + of a directory */ + } + } + + return ( result ); +} + + + +/*****************************************************************************/ + +pascal OSErr FSpRecurseDirectory(const FSSpec *spec, + unsigned short maxLevels) +{ + OSErr rc; + + theGlobals.vRefNum = spec->vRefNum; + + /* make room for pathnames */ + theGlobals.itemName = (unsigned char *) StrCalloc(NAME_MAX); + theGlobals.FullPath = StrCalloc(NAME_MAX); + buffer = StrCalloc(NAME_MAX); + + + if ((noisy) && (MacZip.DataForkOnly)) + printf("\n Warning: Datafork only \n"); + + /* reset the count to zero */ + ShowCounter(true); + + if (noisy) leftStatusString("Build File List; Items done:"); + if (noisy) printf("\n Collecting Filenames ..."); + rc = RecurseDirectory(spec->vRefNum, spec->parID, spec->name,maxLevels); + printerr("RecurseDirectory:",rc,rc,__LINE__,__FILE__,""); + + if (noisy) printf("\n... done \n\n %6d matched files found \n", + MacZip.FoundFiles); + if (noisy) printf(" %6d folders found in %d Levels \n", + MacZip.FoundDirectories,DirLevels); + + if (MacZip.BytesOfData > (1024*1024)) + if (noisy) printf(" %4.3f MBytes unzipped size\n\n", + (float) MacZip.BytesOfData/(1024*1024)); + else + if (noisy) printf(" %4.3f KBytes unzipped size\n\n", + (float) MacZip.BytesOfData/1024); + + /* free all memory of pathnames */ + theGlobals.itemName = (unsigned char *) StrFree((char *)theGlobals.itemName); + theGlobals.FullPath = StrFree(theGlobals.FullPath); + buffer = StrFree(buffer); + + return rc; +} + + + + +/* +* Return true if filename == zipfile +* After the first match no further check will be done ! +* +*/ +Boolean IsZipFile(char *filen) +{ +static firstMatch = false; + +if (filen == NULL) + firstMatch = false; + +if (!firstMatch) + { + if (stricmp(filen, MacZip.ZipFullPath) == 0) + { + firstMatch = true; + return true; + } + } + +return false; +} + + + +static Boolean isRegularItem( RecurseGlobals *Globals) +{ +Boolean isInvisible = false, + isAlias = false, + isSystem = false; + +isSystem = !((Globals->cPB.hFileInfo.ioFlFndrInfo.fdFlags & + (1 << 12)) == 0 ); +isInvisible = !((Globals->cPB.hFileInfo.ioFlFndrInfo.fdFlags & + (1 << 14)) == 0 ); +isAlias = !((Globals->cPB.hFileInfo.ioFlFndrInfo.fdFlags & + (1 << 15)) == 0); + +if (isAlias == true) + { + return false; + } + +if (MacZip.IncludeInvisible == true) + { + return true; + } + +if ((isSystem == true) || + (isInvisible == true)) + { + return false; + } + +return true; +} + + + + +static void ProcessFiles(RecurseGlobals *Globals, + Boolean hasDataFork, Boolean hasResourceFork) +{ + /* some file statistics */ +MacZip.FoundFiles++; + +if (hasDataFork == true) + { + MacZip.BytesOfData = + Globals->cPB.hFileInfo.ioFlLgLen + + MacZip.BytesOfData; + MacZip.CurrentFork = DataFork; + MacZip.RawCountOfItems++; + + if (MacZip.DataForkOnly == true) + { + procname(Globals->FullPath, false); + hasResourceFork = false; + } + else + { + procname(Real2RfDfFilen(buffer,Globals->FullPath, + DataFork, MacZip.MacZipMode, + MacZip.DataForkOnly), false); + } + } + +if (hasResourceFork == true) + { + MacZip.BytesOfData = + Globals->cPB.hFileInfo.ioFlRLgLen + + MacZip.BytesOfData; + MacZip.CurrentFork = ResourceFork; + MacZip.RawCountOfItems++; + + procname(Real2RfDfFilen(buffer, Globals->FullPath, + ResourceFork, MacZip.MacZipMode, + MacZip.DataForkOnly), false); + } +} + + + + +static void ProcessDirectory(RecurseGlobals *Globals, + Boolean IncludeItem, long DirID) +{ +OSErr rc; + +MacZip.isDirectory = true; + +GetFullPathFromID(Globals->FullPath,Globals->vRefNum, DirID, + Globals->itemName, &rc); + +MacZip.RawCountOfItems++; +MacZip.FoundDirectories++; + +if (MacZip.StoreFoldersAlso) + { + procname(Globals->FullPath, false); + } + + /* We have a directory */ + if ( !Globals->quitFlag && IncludeItem) + { + /* Dive again if the IterateFilterProc didn't say "quit" and dir is + not an alias */ + RecurseDirectoryLevel(Globals->cPB.dirInfo.ioDrDirID, + Globals); + } +} + + + +static void ProcessItem(RecurseGlobals *Globals, long DirID) +{ +OSErr rc; +Boolean IncludeItem = false, hasDataFork = false; +Boolean hasResourceFork = false; + +IncludeItem = isRegularItem(Globals); + +/* Is it a File? */ +if ( (Globals->cPB.hFileInfo.ioFlAttrib & ioDirMask) == 0 ) + { + PToCCpy(Globals->itemName,MacZip.FileName); + MacZip.isDirectory = false; + + hasDataFork = (Globals->cPB.hFileInfo.ioFlLgLen != 0); + hasResourceFork = (Globals->cPB.hFileInfo.ioFlRLgLen != 0); + + /* include also files with zero recource- and data-fork */ + if ((hasDataFork == 0) && (hasResourceFork == 0)) + hasDataFork = true; + + if ((hasDataFork == 0) && + (hasResourceFork != 0) && + (extra_fields == false)) + { + IncludeItem = false; + } + + GetFullPathFromID(Globals->FullPath,Globals->vRefNum, + DirID, Globals->itemName, &rc); + printerr("GetFullPathFromID:",rc,rc,__LINE__, + __FILE__,MacZip.FileName); + + if (IncludeItem && /* don't include the zipfile itself */ + (!IsZipFile(Globals->FullPath)) ) + { + if (MATCH(MacZip.Pattern, MacZip.FileName, false) == true) + { + ProcessFiles(Globals, hasDataFork, hasResourceFork); + } /* if (MatchWild( MacZip.FileName,MacZip.Pattern ) == + true) */ + } /* if (!IsZipFile(Globals->FullPath)) */ + } /* Is it a File? */ + +/* Is it a directory? */ +if ( (Globals->cPB.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) + { + ProcessDirectory(Globals,IncludeItem, DirID); + } /* Is it a directory? */ +} + +const char *BOINC_RCSID_efad9ca2ed = "$Id: recurse.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/recurse.h boinc-7.0.14+dfsg/zip/zip/macos/source/recurse.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/recurse.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/recurse.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,129 @@ +/* +** IterateDirectory: File Manager directory iterator routines. +** +** by Jim Luther +** +** File: IterateDirectory.h +** +** Copyright (c) 1995-1998 Jim Luther and Apple Computer, Inc. +** All rights reserved. +** +** You may incorporate this sample code into your applications without +** restriction, though the sample code has been provided "AS IS" and the +** responsibility for its operation is 100% yours. +** +** IterateDirectory is designed to drop into the MoreFiles sample code +** library I wrote while in Apple Developer Technical Support +*/ + +#ifndef __RECURSEDIRECTORY__ +#define __RECURSEDIRECTORY__ + +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*****************************************************************************/ + +pascal OSErr RecurseDirectory(short vRefNum, + long dirID, + ConstStr255Param name, + unsigned short maxLevels ); +/* Iterate (scan) through a directory's content. + The IterateDirectory function performs a recursive iteration (scan) of + the specified directory and calls your IterateFilterProc function once + for each file and directory found. + + The maxLevels parameter lets you control how deep the recursion goes. + If maxLevels is 1, IterateDirectory only scans the specified directory; + if maxLevels is 2, IterateDirectory scans the specified directory and + one subdirectory below the specified directory; etc. Set maxLevels to + zero to scan all levels. + + The yourDataPtr parameter can point to whatever data structure you might + want to access from within the IterateFilterProc. + + vRefNum input: Volume specification. + dirID input: Directory ID. + name input: Pointer to object name, or nil when dirID + specifies a directory that's the object. + maxLevels input: Maximum number of directory levels to scan or + zero to scan all directory levels. + iterateFilter input: A pointer to the routine you want called once + for each file and directory found by + IterateDirectory. + yourDataPtr input: A pointer to whatever data structure you might + want to access from within the IterateFilterProc. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume or iterateFilter was NULL + dirNFErr -120 Directory not found or incomplete pathname + or a file was passed instead of a directory + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: RecurseFilterProcPtr, FSpRecurseDirectory +*/ + +/*****************************************************************************/ + +pascal OSErr FSpRecurseDirectory(const FSSpec *spec, + unsigned short maxLevels); +/* Iterate (scan) through a directory's content. + The FSpIterateDirectory function performs a recursive iteration (scan) + of the specified directory and calls your IterateFilterProc function once + for each file and directory found. + + The maxLevels parameter lets you control how deep the recursion goes. + If maxLevels is 1, FSpIterateDirectory only scans the specified directory; + if maxLevels is 2, FSpIterateDirectory scans the specified directory and + one subdirectory below the specified directory; etc. Set maxLevels to + zero to scan all levels. + + The yourDataPtr parameter can point to whatever data structure you might + want to access from within the IterateFilterProc. + + spec input: An FSSpec record specifying the directory to scan. + maxLevels input: Maximum number of directory levels to scan or + zero to scan all directory levels. + iterateFilter input: A pointer to the routine you want called once + for each file and directory found by + FSpIterateDirectory. + yourDataPtr input: A pointer to whatever data structure you might + want to access from within the IterateFilterProc. + + Result Codes + noErr 0 No error + nsvErr -35 No such volume + ioErr -36 I/O error + bdNamErr -37 Bad filename + fnfErr -43 File not found + paramErr -50 No default volume or iterateFilter was NULL + dirNFErr -120 Directory not found or incomplete pathname + afpAccessDenied -5000 User does not have the correct access + afpObjectTypeErr -5025 Directory not found or incomplete pathname + + __________ + + See also: RecurseFilterProcPtr, RecurseDirectory +*/ + + + +/*****************************************************************************/ + + + +#endif /* __RECURSEDIRECTORY__ */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/unixlike.c boinc-7.0.14+dfsg/zip/zip/macos/source/unixlike.c --- boinc-7.0.7+dfsg/zip/zip/macos/source/unixlike.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/unixlike.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,315 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + unixlike.c + + Macintosh-specific routines to emulate unixfunctions. + + ---------------------------------------------------------------------------*/ + +/*****************************************************************************/ +/* Includes */ +/*****************************************************************************/ + +#include "zip.h" + +#include +#include +#include + +#include "unixlike.h" +#include "helpers.h" +#include "pathname.h" +#include "macstuff.h" +#include "macglob.h" +#include "mactime.h" + +/*****************************************************************************/ +/* Global Vars */ +/*****************************************************************************/ + +extern MacZipGlobals MacZip; +extern int errno; + + +/*****************************************************************************/ +/* Prototypes */ +/*****************************************************************************/ + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + + + +/* + *---------------------------------------------------------------------- + * + * MacStat -- + * + * This function replaces the library version of stat. The stat + * function provided by most Mac compiliers is rather broken and + * incomplete. + * + * Results: + * See stat documentation. + * + * Side effects: + * See stat documentation. + * + *---------------------------------------------------------------------- + */ + +int Zmacstat(const char *Fname, struct stat *buf) +{ + OSErr err, rc; + short fullPathLength; + Handle hFullPath; + char path[NAME_MAX], path2[NAME_MAX]; + HVolumeParam vpb; + static unsigned long count_of_files = 0; + + AssertStr(Fname,Fname) + Assert_it(buf,"","") + + UserStop(); + + memset(buf, 0, sizeof(buf)); /* zero out all fields */ + + RfDfFilen2Real(path2, Fname, MacZip.MacZipMode, MacZip.DataForkOnly, + &MacZip.CurrentFork); + GetCompletePath(path, path2, &MacZip.fileSpec, &err); + err = PrintUserHFSerr((err != -43) && (err != 0), err, path); + printerr("GetCompletePath:", err, err, __LINE__, __FILE__, path); + + if (err != noErr) { + errno = err; + return -1; + } + + /* Collect here some more information, it's not related to Macstat. + (note: filespec gets changed later in this function) */ + /* clear string-buffer */ + memset(MacZip.FullPath, 0x00, sizeof(MacZip.FullPath)); + rc = FSpGetFullPath(&MacZip.fileSpec, &fullPathLength, &hFullPath); + strncpy(MacZip.FullPath, *hFullPath, fullPathLength); + DisposeHandle(hFullPath); /* we don't need it any more */ + /* Collect some more information not related to Macstat */ + + + /* + * Fill the fpb & vpb struct up with info about file or directory. + */ + + FSpGetDirectoryID(&MacZip.fileSpec, &MacZip.dirID, &MacZip.isDirectory); + vpb.ioVRefNum = MacZip.fpb.hFileInfo.ioVRefNum = MacZip.fileSpec.vRefNum; + vpb.ioNamePtr = MacZip.fpb.hFileInfo.ioNamePtr = MacZip.fileSpec.name; + + if (MacZip.isDirectory) { + MacZip.fpb.hFileInfo.ioDirID = MacZip.fileSpec.parID; + /* + * Directories are executable by everyone. + */ + buf->st_mode |= UNX_IXUSR | UNX_IXGRP | UNX_IXOTH | UNX_IFDIR; + } else { + MacZip.fpb.hFileInfo.ioDirID = MacZip.dirID; + } + + MacZip.fpb.hFileInfo.ioFDirIndex = 0; + err = PBGetCatInfoSync((CInfoPBPtr)&MacZip.fpb); + + if (err == noErr) { + vpb.ioVolIndex = 0; + err = PBHGetVInfoSync((HParmBlkPtr)&vpb); + if (err == noErr && buf != NULL) { + /* + * Files are always readable by everyone. + */ + buf->st_mode |= UNX_IRUSR | UNX_IRGRP | UNX_IROTH; + + /* + * Use the Volume Info & File Info to fill out stat buf. + */ + if (MacZip.fpb.hFileInfo.ioFlAttrib & 0x10) { + buf->st_mode |= UNX_IFDIR; + buf->st_nlink = 2; + } else { + buf->st_nlink = 1; + if (MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000) { + buf->st_mode |= UNX_IFLNK; + } else { + buf->st_mode |= UNX_IFREG; + } + } + + if (MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType == 'APPL') { + /* + * Applications are executable by everyone. + */ + buf->st_mode |= UNX_IXUSR | UNX_IXGRP | UNX_IXOTH; + } + if ((MacZip.fpb.hFileInfo.ioFlAttrib & 0x01) == 0){ + /* + * If not locked, then everyone has write acces. + */ + buf->st_mode |= UNX_IWUSR | UNX_IWGRP | UNX_IWOTH; + } + + buf->st_ino = MacZip.fpb.hFileInfo.ioDirID; + buf->st_dev = MacZip.fpb.hFileInfo.ioVRefNum; + buf->st_uid = -1; + buf->st_gid = -1; + buf->st_rdev = 0; + + if (MacZip.CurrentFork == ResourceFork) + buf->st_size = MacZip.fpb.hFileInfo.ioFlRLgLen; + else + buf->st_size = MacZip.fpb.hFileInfo.ioFlLgLen; + + buf->st_blksize = vpb.ioVAlBlkSiz; + buf->st_blocks = (buf->st_size + buf->st_blksize - 1) + / buf->st_blksize; + + /* + * The times returned by the Mac file system are in the + * local time zone. We convert them to GMT so that the + * epoch starts from GMT. This is also consistent with + * what is returned from "clock seconds". + */ + if (!MacZip.isDirectory) { + MacZip.CreatDate = MacZip.fpb.hFileInfo.ioFlCrDat; + MacZip.ModDate = MacZip.fpb.hFileInfo.ioFlMdDat; + MacZip.BackDate = MacZip.fpb.hFileInfo.ioFlBkDat; + } else { + MacZip.CreatDate = MacZip.fpb.dirInfo.ioDrCrDat; + MacZip.ModDate = MacZip.fpb.dirInfo.ioDrMdDat; + MacZip.BackDate = MacZip.fpb.dirInfo.ioDrBkDat; + } + +#ifdef IZ_CHECK_TZ + if (!zp_tz_is_valid) + { + MacZip.HaveGMToffset = false; + MacZip.Md_UTCoffs = 0L; + MacZip.Cr_UTCoffs = 0L; + MacZip.Bk_UTCoffs = 0L; + } + else +#endif + { + /* Do not use GMT offsets when Md_UTCoffs calculation + * fails, since this time stamp is used for time + * comparisons in Zip and UnZip operations. + * We do not bother when GMT offset calculation fails for + * any other time stamp value. Instead we simply assume + * a default value of 0. + */ + MacZip.HaveGMToffset = + GetGMToffsetMac(MacZip.ModDate, &MacZip.Md_UTCoffs); + if (MacZip.HaveGMToffset) { + GetGMToffsetMac(MacZip.CreatDate, &MacZip.Cr_UTCoffs); + GetGMToffsetMac(MacZip.BackDate, &MacZip.Bk_UTCoffs); + } else { + MacZip.Cr_UTCoffs = 0L; + MacZip.Bk_UTCoffs = 0L; + } + } +#ifdef DEBUG_TIME + { + printf("\nZmacstat: MacZip.HaveGMToffset: %d", + MacZip.HaveGMToffset); + printf("\nZmacstat: Mac modif: %lu local -> UTOffset: %d", + MacZip.ModDate, MacZip.Md_UTCoffs); + printf("\nZmacstat: Mac creat: %lu local -> UTOffset: %d", + MacZip.CreatDate, MacZip.Cr_UTCoffs); + printf("\nZmacstat: Mac back: %lu local -> UTOffset: %d", + MacZip.BackDate, MacZip.Bk_UTCoffs); + } +#endif /* DEBUG_TIME */ + + + buf->st_mtime = MacFtime2UnixFtime(MacZip.ModDate); + buf->st_ctime = MacFtime2UnixFtime(MacZip.CreatDate); + buf->st_atime = buf->st_mtime; + +#ifdef DEBUG_TIME + { + printf("\nZmacstat: Unix modif: %lu UTC; Mac: %lu local", + buf->st_mtime, MacZip.ModDate); + printf("\nZmacstat: Unix creat: %lu UTC; Mac: %lu local\n", + buf->st_ctime, MacZip.CreatDate); + } +#endif /* DEBUG_TIME */ + + if (noisy) + { + if (MacZip.StatingProgress) + { + count_of_files++; + InformProgress(MacZip.RawCountOfItems, count_of_files ); + } + else + count_of_files = 0; + } + } + } + + if (err != noErr) { + errno = err; + } + + MacZip.isMacStatValid = true; + return (err == noErr ? 0 : -1); +} + + + + + +/* + *---------------------------------------------------------------------- + * + * chmod -- + * + * Results: + * See chmod documentation. + * + * Side effects: + * See chmod documentation. + * + *---------------------------------------------------------------------- + */ + +int chmod(char *path, int mode) +{ + HParamBlockRec hpb; + OSErr err; + + hpb.fileParam.ioNamePtr = C2PStr(path); + hpb.fileParam.ioVRefNum = 0; + hpb.fileParam.ioDirID = 0; + + if (mode & 0200) { + err = PBHRstFLockSync(&hpb); + } else { + err = PBHSetFLockSync(&hpb); + } + + if (err != noErr) { + errno = err; + return -1; + } + + return 0; +} + +const char *BOINC_RCSID_542e20ba5b = "$Id: unixlike.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/unixlike.h boinc-7.0.14+dfsg/zip/zip/macos/source/unixlike.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/unixlike.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/unixlike.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,86 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * Directory Operations for Mac based on BSD 4.3 + * By Jason Linhart, January 1997 + */ + +#ifndef _UNIXLIKE_H +#define _UNIXLIKE_H 1 + +#include + +#ifndef NAME_MAX +#define NAME_MAX 2048 +#endif + +#define UNX_IFMT 0170000 /* Unix file type mask */ +#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ +#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ +#define UNX_IFREG 0100000 /* Unix regular file */ +#define UNX_IFBLK 0060000 /* Unix block special (not Amiga) */ +#define UNX_IFDIR 0040000 /* Unix directory */ +#define UNX_IFCHR 0020000 /* Unix character special (not Amiga) */ +#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ + +#define UNX_ISUID 04000 /* Unix set user id on execution */ +#define UNX_ISGID 02000 /* Unix set group id on execution */ +#define UNX_ISVTX 01000 /* Unix directory permissions control */ +#define UNX_ENFMT UNX_ISGID /* Unix record locking enforcement flag */ + +#define UNX_IRWXU 00700 /* Unix read, write, execute: owner */ +#define UNX_IRUSR 00400 /* Unix read permission: owner */ +#define UNX_IWUSR 00200 /* Unix write permission: owner */ +#define UNX_IXUSR 00100 /* Unix execute permission: owner */ + +#define UNX_IRWXG 00070 /* Unix read, write, execute: group */ +#define UNX_IRGRP 00040 /* Unix read permission: group */ +#define UNX_IWGRP 00020 /* Unix write permission: group */ +#define UNX_IXGRP 00010 /* Unix execute permission: group */ + +#define UNX_IRWXO 00007 /* Unix read, write, execute: other */ +#define UNX_IROTH 00004 /* Unix read permission: other */ +#define UNX_IWOTH 00002 /* Unix write permission: other */ +#define UNX_IXOTH 00001 /* Unix execute permission: other */ + +/* historical file modes */ +#define S_IREAD 0x100 +#define S_IWRITE 0x80 +#define S_IEXEC 0x40 + + +#define isatty(arg) 1 + + +#define EINVAL 22 /* Invalid argument */ +#define ENAMETOOLONG 63 /* File name too long */ + + +struct dirent { + char d_name[NAME_MAX]; +}; + +/* + * The following definitions are usually found in fcntl.h. + * However, MetroWerks has screwed that file up a couple of times + * and all we need are the defines. + */ +#define O_APPEND 0x0100 /* open the file in append mode */ +#define O_CREAT 0x0200 /* create the file if it doesn't exist */ +#define O_EXCL 0x0400 /* if the file exists don't create it again */ +#define O_TRUNC 0x0800 /* truncate the file after opening it */ + + +int Zmacstat (const char *path, struct stat *buf); +int chmod(char *path, int mode); + + +#include "macstuff.h" + +#endif /* _UNIXLIKE_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/VolWarn.h boinc-7.0.14+dfsg/zip/zip/macos/source/VolWarn.h --- boinc-7.0.7+dfsg/zip/zip/macos/source/VolWarn.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/VolWarn.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,69 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + +This is an Important note about pathnames + +*/ + +static char DuplicVolumeNote[] = { + "\rIMPORTANT NOTE:" \ + "\r" \ + "\r This port has one weak point: It is based on pathnames !! " \ + "\r Because it's a port !! Unlike MacOS: As far as I know all other "\ + "\r Operatingsystems (eg.: Unix, DOS, OS/2, ...) are based on pathnames" \ + "\r " \ + /* a short quote from "Inside Macintintosh, Files"; slightly modified by me */ + "\r On a Mac: Files and directories located in the same directory " \ + "\r must all have unique names. However, there is no requirement " \ + "\r that volumes have unique names. It is perfectly acceptable for two mounted" \ + "\r volumes to have the same name. This is one reason why a application should " \ + "\r use volume reference numbers rather than volume names to specify volumes," \ + "\r but for this Zip-Port I can't use reference numbers. " \ + "\r " \ + /* end quote */ + "\r" \ + "\r From the developers point of view:"\ + "\r The use of pathnames, however, is highly discouraged. If the user changes"\ + "\r names or moves things around, they are worthless." \ + "\r Full pathnames are particularly unreliable as a means of identifying files," \ + "\r directories or volumes within your application," \ + "\r for two primary reasons:" \ + "\r" \ + "\r* The user can change the name of any element in the path at" \ + "\r virtually any time." \ + "\r* Volume names on the Macintosh are *not* unique. Multiple" \ + "\r mounted volumes can have the same name. For this reason, the use of" \ + "\r a full pathname to identify a specific volume may not produce the" \ + "\r results you expect. If more than one volume has the same name and" \ + "\r a full pathname is used, the File Manager currently uses the first" \ + "\r mounted volume it finds with a matching name in the volume queue." \ + "\r" \ + "\r" \ + "\r The main reason is that an attempt to implement support exact saving of" \ + "\r the MacOS specific internal file-structures would require a throughout" \ + "\r rewrite of major parts of shared code, probably sacrifying compatibility" \ + "\r with other systems." \ + "\r I have no solution at the moment. The port will just warn you if you try" \ + "\r zip from / to a volume which has a duplicate name." \ + "\r MacZip has problems to find the archives and files." \ + "\r" \ + "\r" \ + "\r ... and the moral of this story:" \ + "\r" \ + "\r Don't mount multiple volumes with the same " \ + "\r name while zip/unzip is running" \ + "\r and "\ + "\r My (Big) recommendation: Name all your volumes with a unique name "\ + "\r (e.g: add a space character to the name) and" \ + "\r MacZip will run without any problem." \ + "\r" \ + "\r" \ + "\r Dirk Haase" \ + }; diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/source/zip_rc.hqx boinc-7.0.14+dfsg/zip/zip/macos/source/zip_rc.hqx --- boinc-7.0.7+dfsg/zip/zip/macos/source/zip_rc.hqx 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/source/zip_rc.hqx 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,43 @@ +(This file must be converted with BinHex 4.0) +:#RTTF#jbBbjcDA3!8dP84&0*9#%!N!3([`#3"&(E8dP8)3!"!!!([h*-BA8#Q3# +3!aDCQ3d!"RTTF#jbB`!!&[Bi"2[rG!"-5QS!N!1!!*!%"32,j+m2!*!Drj!%8P0 +53e*6483"",#mXHDaqlGG!!!GmJ#3"JFj!*!%6Mi!N!MGc!`!P@6pq1R*k4&+Z,d +p"5$(b(-Upcc#j%EiHCfjPTq%8h+X8d)MR$`rF[b9Vh`pTLc2jqZ9r'RNq9VN1'& +'MMmj6Sk6#5HFc0J4lN8iHFU2--,*K%Z1NIR+#1XNR("#bE-)2I+FF$*G@H6BL+` +*!&6IV1ml1d+22#-$4UEm*#01"T`m*4`Ji(03ThM'$-EBilf-V8-e6Q8bXEVD@Xi +2bilcmGEY"lV6QGjZrK)I1CKZ$BfR4pSbLD'f`F'qVPKb+*(-*V2CPLfaGj1CE+a +Z+-$kpr4hpHrCf@d%f66E!A2P-rA6phmUj)QrdYP4r[6)H+cZF"hRV``NHSG5`b! +F6-0YBZ$!JH&%#frIb,2TmH4`LVGN4c1(%U1Q8#cf)P44dU"#-`D)I($H4I5qc[j +NJLI5)qpN5)Ic[S(-`-&1H(U2L*U'-H`1Y1p&qc#*YVk4(RNUbp(ae(#'R,B[d%B +(Nd40$id1C`FhmUlKNBmbkAf$Sra8qpDYcm0,H%GIhbiej(!EESbmC+a*'3dqdlC +j)%*H#+!,D!K4#J#3!$9H-J)mB*6L!50R"%"&hi6DD*61[-qq22%f1hkXPq@r)'` +(1hjQJ19cKP'bY0#60RQ3!&kd,r))mj-X,LBCCa&CeiX#f`ibZ$9##+[1HUJ34G5 +584+#&@p9i[UDj-&PD2rAi0qYdMpMQ""M8FLBT`#FUMje-i6rVXl2qI`jK@XY#eH ++%JH[5(`6,qEcH@K,(FfA4rZDNG,4mp60fALH@TT,SC!!5Sf0$HHP31&mP"AfKN) +K-!N[&XjM@##`1I,(a"V"#L%@#U9'*'lT-5CaU8GqpLTFkUP"%klmfMLJ1QpH5r2 +djNdfhIXJFIqqN!!&1QHe$jUlHF`jZ2I41X8k$@ZbKF1C2"Cq6YZaF(Z+5Yra&63 +"alCh62Vm6N(RqR90&)#m`cE3mILqV`@qBmcQkf0"9Ei%#**RRRpcS0DmV!N6DB- +&#R112Ym4-1d)GJ(R0,i,0!TEJ!%$#Mj$SFqp80)XU4&"+j!!DmFJk)S2*[(KNMR +mHApd)4Im@I2aqEBrpd,EVi3ehd@qETI[eprhmmlp0UGjqhe`q#[[Ljk#GDclAll +[P91j$d[[ir`4X1LcbmVcI$8cCd49rY*`E2l+F1l-Uk0CV,edY8%d('d@pD*qVRk +L@64FE9KlU9Q%E`3$i@+cD"BSp)'26f,8K%[iL[#3!$-h&aDPY5L2CJBBpF5Kh5k ++ASJVqckQ9kG`*C95rEka+29B5U+f"eYIqF&ZC()P-%GbHXQ44)a!l[Z9q3[c5Z! +aN!!pGHT"X#q,IJ$8lG#i224dkNXMhd,#3I"ap4JkEk@YlrKEp1r14erRqIYVJY@ +RbX4G0GVTc4A5A20`[E`GcX60GGI#0@$KHMqfFB9BIV4&%kr6+kH*J`(FR3lKcJj +pNqpN!JiZ-`'&1jQ!a*e-31RCQB$%R8c!dY1CJ19(C`+@AjGIa[qCCq8qH,K8FA% +LH$LpGbZiFpp0ehUR[lZTL-[HU3T8q*FVkd5&AaDBjrX##ha2S$UImK6,r-Z9MDM +#PaVqNfUH+VqmXplAGpG!G`k,I&I!i[ZC`J,Iba3@rEQC`J,Iba5@rFQGIhNq5h` +r-lM2ArAJIYjp(jEjYX!5he+i`cIhZRrjYq)%rjNh@"K4Ej!!V8&p!,8@0C*$l3L +bk#`f"%i9DMaRk,i*YC&aj0dFH6G(hXf4Gh2Nh4ajYp5aY(5[I@a#hBBDeh9E'*X +Kq3q,)QS*99$0SCj&R68Va[9Ie6lJ9444KDk%dDE9%CrPQhJ,hbD#)RJ8936RJK1 +bjb%HMTILXr&#r&Um++SIZ#*1fAP1hM-c'CG*VekG*BkGApkj'DZA13GkPA1JPcN +(iC4c%*m@1&[2l0@LLCK%pFUBG%kj4M@2,@pY&UjA+*Y2#Zil5%pF&GI[LBAVh-2 +$3I"aCG,5ekC[qL[MlZ1QRP32Ga5YQFY`Cf-[rZ!JX+GrCir-1R)J6J!jdY[ekRU +IXFT6',*jNmH[B69Hq&&6$N-NlS3K8Xm03mM2+VTKb253!iSqNDRHIKqNq$hqV6$ +%pVF8KPMc@68N$0Q#[KXH1UJL$1P'',*PpB``C"5M'eXG)JbTfDal(BB!AfdN$-' +cjq2P-%6bli8Kq,pej"NCErJr%NGk[[Pkpa44M+pBl4Mq$SC![ij'pZ[3j20d)N[ +i$qR%J5hSI`01r3hJcl+!m54`kMY9f'+N1PrYaRqe4SCq@E8Hr)$%dK,,5@`LdR2 +b$cBKPr+"5-q*AH`)BBm-4AUqlG-DHk"a9QQ`Yi"0+Beefb-pTlj6'Z(2`,ZS0"j ++!KY9'SpQ-0f,5U2Q'(Lr+Sd(h`3fV65DpX2VT0+)[!EHKdUMS4ABTdVMX4IJG8T +T'*pJ6K'P8IXk0+iTMFB8I'L[i9r!Qp6c`!dlH9,2idGJTp9PD'b(MjH9AZ0cQ02 +TqYdI$#8c2*2-$Kr+**,r!`#3!dm4!!!: diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/ZipLib.h boinc-7.0.14+dfsg/zip/zip/macos/ZipLib.h --- boinc-7.0.7+dfsg/zip/zip/macos/ZipLib.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/ZipLib.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,166 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + ZipLib.h + + This header-files is global to the project ZipLib. + + ---------------------------------------------------------------------------*/ + + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define MACOS +#define MACZIP + +#define OLDROUTINENAMES 0 /* use new function names only */ +#define OLDROUTINELOCATIONS 0 /* use new headerlocations only */ +#define SystemSevenOrLater 1 /* Runs only on System 7.0 or later */ + +/* These functions are defined as a macro instead of a function. +so we have to undefine them for replacing (see printf.c) */ +#undef getc +#undef getchar +#undef putchar +#undef putc + +#ifndef ZCONST +# define ZCONST const +#endif + +#define NAME_MAX 1024 + + +/*****************************************************************************/ +/* Includes standard headers */ +/*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* Many things are different for mac-users, so we need + special mac functions :-) */ +int Zmacstat (const char *path, struct stat *buf); +#define stat(path, bufPtr) Zmacstat(path, bufPtr) +#define lstat(path, bufPtr) Zmacstat(path, bufPtr) + +int fprintf(FILE *file, const char *format, ...); +int printf(const char *format, ...); +void perror(const char *parm1); + + + +/* +#define MAC_DEBUG 1 +#define DEBUG 1 + */ + + +#ifdef MAC_DEBUG +#define LOG_DEBUG 7 /* debug-level messages */ +int Print2Syslog(UInt8 priority, const char *format, ...); +#include + + +#define Notify(msg) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ + msg, __FILE__, __LINE__); \ + } + + + + +#define Assert_it(cond,msg,kind) \ + { \ + if (!(cond)) \ + { \ + (void)Print2Syslog(LOG_DEBUG,"%s failed: [%s] cond: [%s] (file: %s line: %d)", \ + kind, msg, #cond, __FILE__, __LINE__); \ + } \ + } + + + + + +#define AssertBool(b,msg) Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) + + + +#define AssertStr(s,msg) \ + { \ + int s_i = 0; \ + Assert_it ((s),(msg),("1. AssertStr ")); \ + while ((s)[s_i]) { \ + Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ + ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ + s_i++; \ + } \ + } + + + +#define AssertTime(t,msg) Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ + ((t).tm_min >= 0) && ((t).tm_min < 60) && \ + ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ + ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ + ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ + ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ + ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) + + + +#define AssertIntRange(myvalue,minimum,maximum, msg) Assert_it ( \ + ((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), msg,("AssertIntRange ")) + + + + +#define AssertStrNoOverlap(str1,str2,msg) \ + { \ + long s_i = 0; \ + AssertStr((str1),(msg)) \ + AssertStr((str2),(msg)) \ + if ((str1) < (str2)) \ + { \ + s_i = strlen((str2)); \ + Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ + } \ + else \ + { \ + s_i = strlen((str1)); \ + Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ + } \ + } \ + + + + +#else +#define Assert_it(cond,msg,kind) +#define AssertBool(b,msg) +#define AssertStr(s,msg) +#define AssertTime(t,msg) +#define AssertIntRange(myvalue,minimum,maximum,msg) +#define AssertStrNoOverlap(str1,str2,msg) +#endif + diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/ZipSx.h boinc-7.0.14+dfsg/zip/zip/macos/ZipSx.h --- boinc-7.0.7+dfsg/zip/zip/macos/ZipSx.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/ZipSx.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,167 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + ZipSx.h + + This header-files is global to the project ZipSioux. + + ---------------------------------------------------------------------------*/ + + +/*****************************************************************************/ +/* Macros, typedefs */ +/*****************************************************************************/ + +#define MACOS +#define USE_SIOUX +#define MACZIP + +#define OLDROUTINENAMES 0 /* use new function names only */ +#define OLDROUTINELOCATIONS 0 /* use new headerlocations only */ +#define SystemSevenOrLater 1 /* Runs only on System 7.0 or later */ + +/* These functions are defined as a macro instead of a function. +so we have to undefine them for replacing (see printf.c) */ +#undef getc +#undef getchar +#undef putchar + +#ifndef ZCONST +# define ZCONST const +#endif + +#define NAME_MAX 1024 + + +/*****************************************************************************/ +/* Includes standard headers */ +/*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* Many things are different for mac-users, so we need + special mac functions :-) */ +int Zmacstat (const char *path, struct stat *buf); +#define stat(path, bufPtr) Zmacstat(path, bufPtr) +#define lstat(path, bufPtr) Zmacstat(path, bufPtr) + +int fprintf(FILE *file, const char *format, ...); +int printf(const char *format, ...); +void perror(const char *parm1); + + + +/* +#define MAC_DEBUG 1 + */ + + + + + + +#ifdef MAC_DEBUG +#define LOG_DEBUG 7 /* debug-level messages */ +int Print2Syslog(UInt8 priority, const char *format, ...); +#include + + +#define Notify(msg) \ + { \ + (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ + msg, __FILE__, __LINE__); \ + } + + + + +#define Assert_it(cond,msg,kind) \ + { \ + if (!(cond)) \ + { \ + (void)Print2Syslog(LOG_DEBUG,"%s failed: [%s] cond: [%s] (file: %s line: %d)", \ + kind, msg, #cond, __FILE__, __LINE__); \ + } \ + } + + + + +#define AssertBool(b,msg) Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) + + + +#define AssertStr(s,msg) \ + { \ + int s_i = 0; \ + Assert_it ((s),(msg),("1. AssertStr ")); \ + while ((s)[s_i]) { \ + Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ + ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ + s_i++; \ + } \ + } + + + +#define AssertTime(t,msg) Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ + ((t).tm_min >= 0) && ((t).tm_min < 60) && \ + ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ + ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ + ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ + ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ + ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) + + + +#define AssertIntRange(myvalue,minimum,maximum, msg) Assert_it ( \ + ((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), msg,("AssertIntRange ")) + + + + +#define AssertStrNoOverlap(str1,str2,msg) \ + { \ + long s_i = 0; \ + AssertStr((str1),(msg)) \ + AssertStr((str2),(msg)) \ + if ((str1) < (str2)) \ + { \ + s_i = strlen((str2)); \ + Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ + } \ + else \ + { \ + s_i = strlen((str1)); \ + Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ + } \ + } \ + + + + +#else +#define Assert_it(cond,msg,kind) +#define AssertBool(b,msg) +#define AssertStr(s,msg) +#define AssertTime(t,msg) +#define AssertIntRange(myvalue,minimum,maximum,msg) +#define AssertStrNoOverlap(str1,str2,msg) +#endif + diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/zipup.h boinc-7.0.14+dfsg/zip/zip/macos/zipup.h --- boinc-7.0.7+dfsg/zip/zip/macos/zipup.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/zipup.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,25 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef O_RDONLY +# include +#endif + +#define fhow (O_RDONLY|O_BINARY) +#define fbad (-1) + +typedef int ftype; + + +#define zopen(n,p) MacOpen(n,p) +#define zread(f,b,n) read(f,b,n) +#define zclose(f) close(f) +#define zerr(f) (k == (extent)(-1L)) +#define zstdin 0 + + diff -Nru boinc-7.0.7+dfsg/zip/zip/macos/ZpPrj.hqx boinc-7.0.14+dfsg/zip/zip/macos/ZpPrj.hqx --- boinc-7.0.7+dfsg/zip/zip/macos/ZpPrj.hqx 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/macos/ZpPrj.hqx 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,455 @@ +(This file must be converted with BinHex 4.0) +:#9T`8(*U,R0TG!"6594%8dP8)3#3"&66!*!%Ip96593K!!%!!&66FNaKG3)!N!3 +@!*!$$39DF&"bDJ#3!aEf1!,VX93!6&MU!*!$J!#3"!,cIF3NA3#3'[q3"%e08(* +$9dP&!3b[H&ZZXklEb3#3"3,E[3#3"P40!!$hQ!#3"L8D"RMDS*NlIS6ISVG-[(8 +R+hBY21RaEd$i`XJbN!"bQK8YHRN,mmTE("$HbP6f+lXeRq'lH*3I@AbbH%Ef3E+ +Yif3KHp54hE%@hq8Fj,%GAml1RLpN-E,i(GQARdH@0q0,K(GffT%p5)X[RVFF@D4 +BKrHBaXd@6VD,AXpZB5d!C#'6K@abQi`@mJ[Cj$MPC!8iDT2X[EaXE0rjRCHM[$` +Ej#4Rp[RPjG6VcFj"ITHAR9DQepPe(-SAiAji1arZ(-5ApPP[lbMciLAdmP)if0m +4Z#m[-q'q["cNPGI1p`,!!JLip@eQPi2X'farqH4p"**I)T!!,ckH3A`!+i#AjfI +6V9BMbl,P@GDh0P[fhKZcCArkf5`lka2F0rFYkb28qpDfD[R@DP(8@d9PSQMYcUH +l#l&K+CqqV@b6b'8EXQaE[)pm16Za$2kVE&Ajrhr50p-icq)mQh-k-9rKr#ThirR +rPjaIiecK!m`jJh-@jcQFFcJAF-lMl1)dliLFcVQ"F`IR*Xk0R"GcEZCFalQ0mbl +1fcR[i$c+q@,1jh$HcAQBm`MR4C`2FElF9MERGNj6amLPR&XjIj*c$@F2jmXiAm$ +j*XlAFlk"mi@FrjhcMcNrbIN*cSpcISVc6cMr,HHpR$r0q3#eRXTrcYrLI$mR'2- +,R+rKI"hRIH3Bb9R2#IC-iM3GT%lK(-,CcQPUVdlJ(-lCbMQ1Xi(6p)BkME10Xj% +c+PDCdr561TN6d2S-jjpa'Lb,I*!!mcpbrKVR@cNIiIaPcSFjIjhc9cKrNI2GR'r +Mr#$RKcMIc[R[1Aq9mbfFlq6m*Fi,1*Ga,Z@mKI0IFGl*#5!Dh)bmK[09R,GaAX, +j"jarb2RI1(q(FaIR4cJrb[Nqc[Gb(Z#mQA-Ijhl1Jp4a$2rr-qGri@idr`pa2Tr +c#j`c1@GcRXXjPh-Kjha1dcX4X#IbK!KDTSmLi&#%2SXmRI-QcLq9Z!9QHAK&RJp +`lZ(FbhNGjrfFi0ZA1@rJr$6RRh*qP[1jR(r"H68Rb4GarLERAh1H6mK%r[mHjqp +bAXYTHM*b(ZI2F2iXj`61[`QF)`)'4&l"HCccMCcrM[2R16r(qAR1Rq!dI4jj2HF +pR$r&qmEbrbAmTmDmG5@R`BL)@2XZiLEchf"#j+Fj$@j%`)h)-cJ0YN6%B*!!fZ" +0"!b*Q-YJ5Z6l13f@4"l,H6RRrq,m"ZHMR,r0#FVclQpbISXh8X0[Fcl'q6MRDNj +kp$ZFEqEm1FlAFVk)df"Bj'l1*Cc,1EXjRmhj4Fi(1@rN[*lcMcMr0HFV1DrKT2p +IcEQEmcpaIScc2h$Zj2`0c[G`AX&j+HFl*#EQK*KF5AfSiiFjrbYhe2BUcZFYQ8# +8`"SqHK"mJ1I3kr3C28Brd%[d&(J&2Y#Ep#9p$1pa'!D(S)I"!2UBIUI2k&ekQ$k +NTkNhA)PD1m`$$m!AqJL1"DHLhq&FB#FB#Zm#3m%Rq0Hr%%46EGlDqbRHVF#K%H! +jCH(Hi#JG!5E6*4lH8SZ90Sij`3pl6lJjll@6MSXbZAq0&J$qBllBSmf01Ffr4[l +C`lkV[XcL4ASG'Uq6pdGP+lLTLlHfZ[CGhY-)T@1p"c3qUpkHR1ZA["4,,hRFkea +YBX@*hcX-dG"#+9Im%9i"mj8`IdC`pR"ZifcRl1$Xj"c&1CTc$1GBcR'FNcQl1'G +`VZ*FcEQ@Fb2R*XiYR$GclZHmKI0@cJ1F"cN2F4lQ[)hc+1IYR(G`2Src(Xjl19r +!q41F@f-(QGk,(-FjM(-iCbXRM$VH@aj#JTLJCcJ!8S+3!+!HU!JLJMDJ)qJ*@MT +N"$e"8C!!&83&)8&+Kk"K"%KC3E!i)0$PJemF2ha%-$h8ZV&k4A@S8HedmNlrlUV +k4r+lI'5L-VEe@@SUj"`H)5q"0Af[ML&D&MAMJ*Q(BUqXb8H5K0BVJkB$kF&FTK+ +E1,G`MZBF`cQ@Fa,R+-j1cKXiEq5mQA-NjdE1rCbhF0l+HC!!Xiec'fF2Cc[R#-j +9R$GacZ$FblQDFbhR2Xl*R)FjEq-mbRNAjpfFcq0m2ZFpR&XjQcLE1BG`YR!1j4` +QQE%pEq+fM@mD("[Z(pkQ6*ArB1m@(2NMrbrTZlE[a'9UA)NZ-1G*h2#q2MlNie# +FlAKr`'(q0ph`MVp(96SX3dYqJ(B)h'F3ShNX,hEQPI(CraA+,q4E26%a@U*4G2h +S*GZQpp4VDZqA6Ni-IBGlai[LEVbSIX8L6)&*mGBRF[Cp'P`'R8-#ZKG'%!T3Na# +3!-m)-8N-L68ZIi`Zd6(CV9@'cMfh-Y4UGPU0[2,dLj`Tq,X[KR+QI5p6KIl4ahY +LPcQ1D'%LG1"lQRGkkX`5C4jc2[L!DZG,#8B,5U,`Fq[1G#3r8(Mci'9Ud,jSF#T +ciQZmAjrirRI0jCeZYIacC+Q'iD#62CM9E%`2YX+JZLEVVGQjbYU*LD&c+[cadf` +LhS-SY$AS24*%1!"B$AaU%FbHEZBiI&Le*&2dm*m[h!(MBQeX&DQ`Q-m4dY!$bD8 +kHP%6%rda"hqX)Y,(1*GLV%NarU3BRe1-mLR'G"6MGiV4*m@3!)"LY%a"B48MHSS +40SAJU"bI-b0DLV%IaELIFKb+X6Xc5U8Bhe115CP42-9iN@)m66&kT4ME8S`!+ND +`&'1!bP%MmhBlHQAHENIq6!ilBQEHEJF8c*[YH+'TL4e&-HqfSf(QcBaJ-HTRalI +-QaR0XZ0rjXefp0#0fM&5apJFihD-d6&kamJGih@-",S41aQYXQ09M1SaQXGB%f0 +hCUc,MZFamX5i(102M-iaYZG'X%`IfUkLVScJ-8E&'"jMCi`p-N,'Q#)M9BcX-BV +'Q"BMLBaU-CE)q"NMMibJ-IE)5"TMN!#-G$%qb@JJif#-"c++a@JM)f+-p6(ZaTJ +KSh#-26)#akJG)cf-J$+'b"JAii#-CXPS(b0DGM63M36#+mfiD'a8e)cUfE&(4Kd +CKh5MMSa1-LV*b#0MNk!-Sj!!M&'kN8P'*"Q9G118M&bD)4$'`aJTC265MR%bcZP +'1aP9C066MABbqXIS'D10M!$+f+!Gph0MPS`&-QVTa[BB(@4-N4%h4J8CE@2Ncih +9-3l(i)SE-Q%iaBfmqX-Q$+-`f-)J#i-SE[L%N8I'C"PjC'5@m8FcHQK(%4PcC%5 +6F6X'BaM6C151N8h'laK*C-54N6Y'(XfiR"fhBr5488I'm4LVBlb4F8Q898Bc'FY +Nh*049XBecBLQ(FQ%Kc2UL6M+q#hFJh%l0j,,+#lMSCR"(KP@53lhm0'6rT!!Ma[ +UBD#(34i'HKMHBCL(34i'HK"a'44#hN"HmSGk'1Y&cf"FQ2N+aL@4LKMrCE5BN@, +'N4QbB-5Bd@)h&X`i-#2'M!XMmM*kc2JK)kb-*6,HbYJK+J9ML)`I-YTS4LJ91+[ +!9`@q+["9JFF+r&AJV!*R&6LV`'N&,L[`9S(h#Xa9B+i#Fa@iVm"G"8G3F!F&eLZ +iJS*$+,L&JPXSZ)@#@bK`AX%V&,a#`5Z8I)+4BS-IGPcBi!!MbBb1-Tl+q'Cb60[ +d$q2CGJcCi*%Ge6-iT-!K"3iTm%H"2`Vm8H#2!Rm8q+2!(`Aq+2$(MLFcrQS`5)& +"#Ja5i)S#Ea4iSm!E4@mSX%%jSQQ`4i%j#Xa4p)d#Fa5BSm!I"HiSF%H"1`VF8H# +1!RF8Z+-F$6DiSm!G"HiSF%H"1mUH-pLM`"d&lLK`4p'AM"`UqPf"!`SX925k!JF +9Q+$!"!8Q+,"5JBm+E&$JJJ)A&,LJ`!-&(LM`3)%(#Ma3i)%#$a4iS-!$"4iSm%# +"X3T-8'##!K-8H+$J&!T1SH!5#LkKY"8`A%2"+44F3X%I&0a!`8%82%,")a3m3X% +M&$a#`5-82%,")a3m3X'R&(a+`DH8)r@')bNiNS+[+(Q5i5E+N@E$663pT1NK63p +THNM6EjVHd[55TTFd[D6T58hrDAT+de1DRY,dP+DR0$fPk5G02fRk5G02'KcAm'% +06dC@e["L63pVkUDTQkCZQVTTq,1'2f[iS)C$DlLcKQYV1,D'3fXiY)C$DlLfT[i +D,00`F!fHDALeKMYUZ,@'-fViYBCIDrLeKPpVq,@'[fTiVBD6DMLPKXYUH+@'9fT +iTBE[DRL`"PmeZ+[Kq"UFe'#N"L-eA&1$NaUFe25LTKFe[DMT3Dd8ErTF`fXe[Dl +TG3d@D$"!dr1DRYId[!BM0&a4Jp%DM0$JY!B(0"aCJ`-DRUc"!Jd@D,"!Jh%Dr02 +JP!EV0"LSiG%D204`D3f(eR"S$3CUF&1$QaVFe'#3!!Er0IL[`Am09pC`!#d(-"U +!JQmVH,L#0bXd!S8fS1$IL[STDU%F#6HDJD)HL[FUhUTiUq+YL[j8p*ULca4pT1J +K43mTHNJjGXriY(Q[3RG3p)b#RbZiX,,Z"XXdZ+2",JfQDEL!KJYSY!X0(p"`!3e +Id2!%$5I3F!)0*p$`#-dl0*a&`b-dr%H$[aVqSm&RMHDK`9)0(QY`@S2A'Pc@B,N +'bc9BVZ&''McAe&C6Fdep0(LZ`A-0RQX`A-060(a,`m-d2%a66`dAdh!a$5jVF&Q +$baTFe[")$Br8p)Q'#fPiNSCVDMLQKYGSZ*''-fNiU+Eq'JkRiD!D(UIK8jUHdh! +R66pU1*H'FfNiPiCcDAL@KQGTH*D'@fRk9F1[0$fVk9P0VfUiPSCVDEL@KQYT1+k +'(fTiSBB6D[T3``Ze[*!!mAZM%5Pd(iAZSp!8&0U43[qaNaMS)%CV8'J-QJ!0RpE +`E!hre["[$Ir@m'm0lpE`EJh[e["Y$Gr@m'd0hpEU*ZJ8B3GIH-fNB'1B3JRj'%8 +aRe@'`bJ'fdl93qCGKdIr(k0G&iF0[#%M-bGm-JqU9h[+JqSeiaYjr%&'P,'fP!I +eE&M+JlTf@5p2X8P-&!VFXe-H9,V,8aj8[#Y6(T5qUe)He-#V8ai8`fY5(P6&De- +H9-IV8Ki8h4Y6(Y6JQe)HP12l8Kl8cGHP2#LMVdTj8&6IP2+JVViQj8&jI8A+Jc, +l`T3(pIDG[6c*-6!Ipe"iVdM[339qIXU$8[lbP!FerD'8"mApH-U$+[r6+3r+rBG +5(Y6p$kBm6!$X6AQB%VJKj@'5i2U8KdQ$25N28`L[6hQB9(K$bX-Nd'G5(UDD4U8 +m6$f05hQBL*U8mM#jp2k8KmNUjfrAPiGTUkRIb12M+00CAFIbK"Kqp3Y@*5%[Rr2 +%D'*LHfYpqd1Q'%8rU[TPTCU9!ZrB&'H)J%d0cjQiHAcFqDRB&leNmjEJSQ'UecM +CQLfQFbPHr@*FabPMeHRc*Y[jG(e(hFQek)D4d@'j&[q0Q2c#a@3MMkmhTaZc05I +D'Q*m6rbr,IjI&Iq[MIpAarm[@Ra(jh'GXKM83X+ha2rhaIpharmEirp0LqRE9p+ ++ebL#f'+Ck)liId6m2b2qEer-fV*LI2YZEIKFj6VMre(arqMiIdcm2cEq(lIiL+% +q!PP&aq$*mArABT+aChCf9BZm9TR'hl5,@R8pUE+P'BEVKm9m,ieYpS,irfL-Zcr +H(iVr$mIr0mIrpmErqq2r@q,r@q2r!r(r`F9kk-F-ETSFU3"H4kT&[B5!ZXA`qZA +"AU-ZTQk0riI(rif,Z4U@"am$Q`X(*[RI&2rEmX+B%cR9+L!QqAUp'"dpr(VhhhD +Tq6pX-9IMiGF2MIq(a2mYLlQ'R,!jAd!C&4qcGAjq[ZpAGXmfpecHfH(mT08%'lH +MKZq)!"i#`hK'VKNDAcqmTV*QrH$8)(phM!a0+BL'U(aQTLGV3*0flr!0CV`6RKD +ki0la6eC+49ZBd)TjNY!!CKar%am6&-kZK6RZZZ9Mch%qRrR`k,*p'r84B-kl2PX +jV[V,2,2PlqCM2YNce[6Q[CXDkY+HUZXC0R[cfUi,m$j`mpI-q60rcBFRJ*P)DG) +I!4m#TNliQ1e[rGV0jF`imqpYfhGlCEd)4Q3ri%JrmrTf@S3lTLJk-KL00dmF1D0 +9*Q3fedk!N!#$'@ZQ2,KM*Ye-FYKm+19MXTHeR"p'(4lE,LHDm)H`8aIFiA(!c$G +hq"G-D&3P8ma'-`1q`RPL2"-Q26Bl9DN)$i2*`IQ,qGY)KBHD'M&V5kpCc`J6BQI +[D82QckGP0kiQMPR!b1Vjq6ZG'fAqRKPqFY"rdaR5CDD1qINC38KKKYEdE11ERB2 +%0i,CIZBBm@%i9e6dCP-Mj`C2'qC1lD`rZI%LB1DI1fScKrFaPiL2`0b!&(91$-d +,MKpeeSZDF-Im2pi!h$(PJ%F!GbJRH!9`"kpF&0K"R6i@LhAm-(Gi3P`3H%5G1,0 +Nf6lEUNlI"r`%$"1Ydb-"A`(Lm(GBPYei0VQLBYCbqX2d@p4T('EVJ5`m$&C52p0 +,8AR"KF("*5T@@A`dG`K@6+"`"c)bZmmGRKV#DU*k5c$,cahH$!+j8AZ#(J35`8& +QqlPMAKm"KMY`%NQ%1l`pQ2AR$Qm-XHfUelH$k4(Z!$*kKcZm+*J#!@EaD3#[Z+- +(K-Nhk!H#4`"hH(2`GZl`bU$1h1&p)GTAJpL$K`"hH%hJ*F!GrK(i#A$(Zr%9i)i +DibrJi"f0L$X`(FcKMNNZm*-lqJm["ZlJ%(JkF!F'iIR!(4J"4q#1hXBEJM[k$Bm +)lZJ0F)-lkQM"hYcaCN3,lSM"1i)lH!EH%G`a@5&#C+2H+Ki6L4b[M`VBcKfq+8b +kF)GR#Ah+(6iN6+a`KhF+lq)1la3Q6lM$"d@mS"VY-cJ#GhL,#-YXe,X$0BFlq)V +-4$EU6m+%#(IiH9!Vl["6`EF#kX58UUHr4%k3!*2K"m-GrK,iaA#(PiF`Z5Ca6Ub +QQm4FDXiGrK[icA!(IZ%l`adi!VrLMMk(Lh&(2m&aZ+2ZBTMEC)h!,ZjiJaK`0ZN +PJcm0Gr3(rF8GILc`$ZlS$haVZ-0r"EcL$Jm8m*ml2%c`Xq%1(aCmEEM$Xi3q09q +c&"C-jJjZK*m-Gr!aZ"Khm#+i*(IiPH!h`aeiL4m0Gr3"IMAFd3IieR!(VZ&I`af +B!LC`4fq$eGc49rMCF%HYi92Fm@CmEEMM2A!ClZ$1q0a`"jE!EER$CiGBlP"&)$V +F`A("(ql`Im%2KcY`'PmFl["h`4q(1caKm-RK$Zj)2jT[L2L"p`phm'&i!AId"pi +rh)'le)3lZ!FFK$Y`'3mKlX![[)5iSmrKM0c4*h!dlRJRhN,Fi4-%$R"(Vq-*`Kf +H0IJ,FBFR$I8hAiXF!VmKlZKMq$jhm!EmKlL$@q*$a"eiKKm4Gr!LhXXGh!1Zc4f +B$Mjc"fk#4Gb"4hJ(F3F@L"V9BKhKGp`4!aIQ$Tk(pa"hq1R!hlQMcq#NjKZUPJ' +qFBH4-jj%h+%hi%h%(AS*(NAF`62TFHlJBrJ6F3F[`UH)1hS1[b,Z`'@i'hIJ(6h +&(4J%eq!1,)!cFNFIiQ[%(If![a&h["1I)ql`(!*EZ--R#El2(9J,0c6I-2%$rX) +G@![[jJj0"GcQMKVMBF3G(MqmLc[k%NmMlUJVRNEF`CI!-HlJ'23AGr3L(NIFJBP +J"AGJ%lb*1rS5[b2ZU#1q4pca(VJ$GhJNiB0N[Z&b"IJXGfJpk"MFJArJ*hG`82U +D1cJr[)`lH$9p`4dm&Tf"1cJKh)3lF!@[+1lJ-r"PlZ!9V(R!(CK16EJ$Bm"UlX! +JH"phB!Gib"hp$0IQM[i4,i6KeS,Hj!kY#mmZml@+2AKhFBH'KBFAGiM4j1'1'X- +VZB-$@IFdFiIIM(F9q6jpC15bPAVMFfA[m,U4dHe@*rGNR,99rb"C0k"9Mb$4reV +eqa$pVe92$h&DD0@$4[5r9[eM42r$q"SI,AZ(4jESIfek"(Q,A841eGG(p,mfrA' +B,1F1hae`L6[mHG!IZ'1b8I5r0MhAi-lFi@&KhQM[m$J5rDp0,a,4rpVd(8'li!j +[($(TEG-M"pcM$KmFdIrDp-!3r@m%pEAV+A#(Ra%H80cK833[i!lr(bDaZF26KfP +Vl[!KNY8K4ZJj*2VI#,hMd(bi`fF1[XmG[NkLrih3I`N[,qlS[j!!P8'%N!#!ch5 +Zld9UKQh3UIlaLhZ90LfCB+HE04Mpm4GQjPMU'f(#A*C+bmcjdR*"KRLhZmQ08,H +[Ch*Nq,54CMF[QRQh-McAEV5+r0pRT[Ur6AP)1bHILaTp'0X(QAcISH&iEi$ZScF +mlc8)0G[Md%K)frGH9Emd,R`-A'LIRcm3"c&#fVlId9NjM3XIZD(i+B6ERML)&Y, +frD(ZffPFq+-ELX(2N!0r1!irK,&p''UB[j[90TPU,PNEQM`-RQb*HFS@L#B23bP +EBakcfP!j$`-V25N2`bcE8Ki'AEDRqM$XXMrQDAM31X[NB4$QPT5()CPE8ak'CJk +Q2!c8(%Tj',BjR2)`L(0EbX13!-k4P)F"RU-T$m-kGkBm$2,FPI)`N!"cImT$ql2 +pLMH9AXQ$UAKGbS24H%[+Jq&i8mU$+IQ3!*3(dr,QP!GMmk'p2%@V4*1(3IJ$k6d +-(Gk6mQ!!-5cP`FKKH-U$FAaVbS-C4&[+J`(pL*3(NrVfP)GKpcX5rM!dqjb8Kb( +jBbN2`q1hTc`-'ADN1Q+k2c,P`C5r)H9KkBXa+3p,B)a2H9JJBh,+``$j"hTmVj` +(+mI1p"i'(UI&2%1qPBGP0kBFHdq)i4H'X#E+2fr"9&SEjIYlr)6!I@'"`h2@5$@ +XVIAp,b53!%`d$*`dZh&N+M[`fHJ8C,BRr2`AhD$'h(AM3,CdGYQ"6pqFII`(Vqi +krM+"V@0DaSBhE8%[[(kU@ZLPGYrNe1BRF[r3a)4HL*&hEklAp)TkY*Th4C82%iq +2bFIE4DjReZFf0+VQrIV8Q(iBNDpGN4FG&*8KkiZ@8Zr8dQe2[QLp((qaRR$4hHA +)KqGhG@rTUfMpEp565cp'kX-@1$-VjIicGLXF['%mMl&l5cA9mjfk9hqpPZKCC6h +[6NY#rZjHS44HRrA9rYB4iH`*Vmmc#!5CUV+8f6pZ!a"Ep$)@PCJ$HhV$[hmbHml +YhaU[c1RhKTR3a&4,B%(QHX@DbarGGB)p"0dhPY!2ZK)B9TMe*`h@Y!r&JV*KSYl +8KKClZmEU4%[l9@chQXC'P!fX09ac&`0kX5`E-TBhAD%+Qpb@,UELh[T9N91i-[9 +NrEE)UPBRjrfXU49j6,h4m!j,aYE*A5hAVX)HX1fCGCF[X$E+)mCD9h$('N4Qci% +EZZ4MIDE)k9bCfV#H915-Ur)K9j!!`TkdXe'h0U`&&APXc)GYiZMZd"6eBmfSb&R +GaQ9BeGCTIcHfhKbL0R9DXBdEkMDB$+l6&RKmBcCRkVK1'@4#im4*hP5RGHE%UEa +M2Q`m*kd[P%RUY*HF2&98XEQYdj+aka3#c4f@J&K#QqQZU"1i8jZeR0k+ZQVCY,V +2L+a3fMKVfEihB+-B&H[%%XlD&SXPA&3l5,'%LfSTLBdhGr3L0QG'ZUNAJE"bT)A +j2f[C[YFbE9b[*H,Xl,JDr91[*DKB3YFl`5Dlb0CVIcShi%'ppTlc!Kl8Db-j2q" +"[6,1JS!($8lK,Jaid1$+D1F(2'M3i@&4`)-'LlXii%'$0V!A"$aSd,Cd5F#$"Ud +eP`BmD,![Z`-H0'T&Z#cJ3D1iY6cJ3D0fDLX#(M4U&ESbp,He"Vi`i%'MY9`9m+" +4kd`QE8hr0@TaZ5EQ`iCaEF#$*LHCe`8mD0,fqU+!"dhfjIU!"deDafi)H0#N4Hh +'J!G0pZ@QJ!G0@S0Z$RM3T(hPPS!(eZjfDm#$CLd"QB3e&U$0@U!bl@TUhDbe-KD +fc&GKb`XZQhkfYV2)C)DR0@Z&#KBE'd9V)iZ9XTN5EpBpJ9SCI"NLaQ!*E55i)GU +YBJR08$a[`a,D@"X1dIlbXN[c+qR4)IDPXB51JK0$l-[,4fEDp-d3mIk+LDd9F(b +)eTeAATTG62eDV199MEBeE,'@9iHG&PVN%pFd@&r6h#%[AVZK-X)l@qJl,+(T[aD +YG+m2q0HLGHDHJ(mYpZAH)&1fL$&Q1I)ZV(f(1K&qif6H*FP3qr+Q#TIQMYlBPdp +@i5e$R8k&NaJq0&3,BV'%(UT0VPK#$p8'9LbKKfSh+TE3`m5BJjplRQX3$"0E$l( +&P*%kKr(f52YMChH`A"dQ0lTYjlS+9Uc@k[3)2U1Q"iD*-8GG0X,FB@plM0+Ep`l +6J[9fHX[JeM"Y3ZmBBE-#dl,djA2fV"X%$iEEPhIZkSK,`m@#Zpbl`0a4ZqHLjCL +q(QjIhKhH0e`Hmlc`2QXYq[afZdlGKfY9HSpl'aMUK&[!mBYRkp5j94jhEdCbF`F +ZL#9dUpa#,+&Ea6#aK'l9fPFXS9[P,Q)*MF@RXi4Zdkj6,+(EY(mA5qJf-88XSGZ +dXaC,k$CYPX85ZNhF%N[S0RYG,+(Ej%CL#6e#e`'aK"iK0a*,k"&LQ9K#Mp"'@bb +K4fMT,*E3f'8k5qJ4@YH+*I3)E96&LDKG'9SXSG[P%')*hDiYV&K#YfZl,CE3l9S +pLb9dZdD3!')*hDjPVPK#Yf[I+TE3(ES)L#9dKha,,+%lP0A%%VV$(K0,k!kYPX8 +5ZN1X&8[S$Zeca4,DZTb+*I4)TAQaK"iTpaG,k*(DUSXPp%Ml@5bK4jTA,+&(DQ8 +XPY!Mj59L#GdTrSQmhLPI&%[S6ZhZa4+k8qiVPY#GpVPB3RIk0V'%lY4#@5bK1m9 +AXB3H*4m95qK4FNkaK"iPISXPp#KYf-85HT6p,*E3Shbc@%+2dNjC,+&(DI-VPY# +MGI!35qM4fUD,*I4ShbIQRD2&2,'%(QhrLbAdD0mTPY#Ma3baK"kYhDjB3Sq4GiS +Pp"MjM9K#Me%E%8[S-H+J@%+2XFI%%RU-m@)*28D1,TE3Bm9TXB3H+fm@5qLa1UQ +**I4BF8J'2FD+&f)*2GEDL5Ad@2QI@%*E&eZaK"iR*a0,k((b','%(LG(%N[SFH+ +b@%+2Xmr&%RUFla&,k((D'SXPp(MjX9K#MpFH@LbKamZra4*k[2aE,+((LhGL#6h +HAK*,k2(q&d[S#GUML#Ad",&(,+%Rb&2&%RU#j&!XS5H)k@)*28&F%%[S#GC),+% +Rb"h&%RULqS4B3Nq8CiXPp%6aALbK*fUR,jE3%m9VXB5H+,k)*I4%DbD@d1`$l5b +K*pPRBJNp5@`35qK*BS0B3Nq51iNPp#5aALbK*iNMBJNpb6U+*I4NY65aK*kXTL1 +Z5*2&Bl'%RU`++jE3Nm9lXB5H,'F35qM*B*Q6r#E6Efk5QT@pR59dPfXDLN90&qp +cFQfA&XaL#GhP'K0L#GhP@SJbG0)&6MK,k#jUjbbKTp"ccK*kLZX-LLAd&0Fb&%[ +S+DlP+CE38l3r&N[S+DkI*jE38qKcC`NpPEc1%RUUkb++*I48ebB85qLTV[JTPY" +6A@94,+'RZK+M@%*2"3HG*I48HXpC3Npcl85aK*lQqSCL#6h0e42&%RSDIHBXSDI +4Cmi5HTUVm)NPp$4`bPP#RdAr1%[SXeb285bKch)94,'%2N[A$l'%2X[e3m85qLc +AmK2plbcAk"2plba`c9P#RdeIX9kM[@1e4V%j2PXR&Y(rcYCp"%l%(DZ-bNSBCp[ +(S[qGE8q)rRFf1-9DMRc6U6[V1GSlqPK@`TMZ@SUb%XCd9f58P6#QZjUNV)3ahA8 +"iHrFXDSL()FlJf@Xp-Jh`jj$cq'1pl'q!(IJK+b%-81A#h#E1pDDK(G`a`U#XK, +'$([1p#cI6(#+G4hY(6dR+f(-G$e(@3PMTUY!bNSB-qdj@3PMTUY4bNSB-eeM8&E +#Q+R&ZDb%F3kiaPU2pSkHNj8`cY%P4eE#1-F9)f8PM(0F+e9@`MM(05YP*BacA)G +39X)iajk6P6$1"DIX#L2FQEUc(U5p`ajG9X)iejk6P6$1eETG9X)i9aYd@3RMA&H +%P*8`cVARC#@-@IDdV)3abji6*ljC[Np@`TLP8iQXK$(,062&hA1@Db$+5KLcA#p +59X+BEFr*5KLcj41b%XCXHdj@`TLYKLmVBFc@qPa@`TKYcmP+',1eETH9-'DlSU5 +-)ThR#UDb%XCji"TVAGSlHNkQ8Fl6CPe@`MM2e9e&rcY21h[4rmjc*8A4rmjcc8R +4rqEBFl)5aKa`LV8`lCfT1qYKfMZXff8PM$RfR-bLc(&e@&N*BiiV@-UXaKbjKDb +%-GHHNj8`jYV6XK,'A(Y19X+BkrYN*BbjmL&C#@1Z+cR+*-GFEHYP*BajFJYC#@1 +H25FVBFac$3"C#@1H25%VBFbcjd6rQqIkRk,rcG2@Ar5rHDk"+IVII,Q&k(rcAGP +6p,rjFJ[4rqE,%8ArQbq1L[ihhe9#4IqE,dF8r@qqp[ULrbe`E9E4raCSSbrkh`* +l6[5r"Fk!L2kh3'iKqYm#ZBASI`YF@92d[`@ZXbMkhd*A%aApEk%p*rVI3YmRqYp +#ZBASI`YGT96d[iAbCY(r&XSY42mlhp9K4Imlhp9'4Imlhji3rHpmHdld[r1T1bZ +DfMZ`Ar5rmee,325rmm8jdIm@ZA+Xk(q,A*&8p,p&VJSUqYmLZB[SIi[NjD,r,A+ +PAG(r&SRpS[mY%SG%re[XbUDLrbffjd6r@qbk!U,r,CC$LrkhQ(jJ(94laqU@S[m +YGK94dIm@ZckNk(mAf(1LrehJqd6rZd!q*rVI"ESELIjh!E9QV8alaaUCS[pGi&U +MS[pGJ)E#fTPm5q`2dIq@Z&+#k(p,A,Y8p,mPpU,SId[N(+,r,E'ZS[mYN4q)rVG +%6LRkha*V,2VI%VQ)k(p,A,Y8p,mPVN8UqKqqkkbrDHrS,G(rPMV',2VI8PFm&Ie +[UBjKS[mY&AY%re[U@JZLrbf9pi[qYe6X&re[+6'Xd@R[i!'Lrbfe[dArklBr42r +VGL9AdIqkl3r4rlVP6+,rGDYYL2lA,GD+rYGYIiMqeff2L[lAEAq)rYGY286rklB +HS[peLm'Lrbf6YiRqYmaq&Ie[QEa6p,pPVViUqYmb9h`9r@qCXf1Lrbd64dAr@bB +I&Ie[QCJRqYmbqEVSIm[%E0(rPVRDTZKrbq9jS[mYPdH+rVIFZ624rjDVEBMqYe` +R10(rPX[242pElMV)S[mYYcp%re[ZZJkLrbfh2d6r@klf*[VIFVQqk(mVe"*%reX +K4a6pEi9VdBVqYm+C*G(r9UKeLIkh`M@'42pEBHq+rVI#PCC&re[KfUVH9H3RAIY +8p,m9VKNUJ5[!-PElY(F'#eMadpkCrQ(96hYRDX(+Rh`VAI06p,q9VLJUqYp+-)p +931dGUkD+rVI5Y94&re[TUV#LrkedY9I4reDkJU[SIbYGV96d[j@ZmbVkhdVA(4A +pEb@pa9UPpXld-'Z1mPe),9LRe0ka)URSIaHkiURSIaGD$p(r,U4[@028hY%VS[p +Gk)U[S[pGk1UaS[pG#+k`[LRI+RU'P8hYRAN$Dj[D1eC@&Ie[P5ZrL[khbRP$dIp +@ZFUXk(qVA-e8p,p9VJSVqYmUed)5r@m9[Fh+ThbVID[SIkYGJeAd[p@Z&#[khfT +`La93l4hVd)VqYpS99NAr@qekV+,rVAD09Y(r9S0pV02+YiEqC1e@HfIHCYG8iSl +e@%Ar@q1DXD,rVA%0@p(reYK2S[qYF9eDdIr@Z&kYk(pVa"M4rpD!@DcYbVH@hQ0 +e9hYRmV,#UlfMaU,rVAApA0(reVVUVHKrDm8jdIr@LQfLrkeeV9c4rpEk9Y(reY' +hV2aUlqJRdIr@ZEUYk(rVA)&Ap,peiTESIq[%+Y(reVNqV1KrkebY9[5rGI!+9Vl +PBpNeeX+eG`B,@!rAhTQkXb+Z[@20@p(r,K)[4Iqlb09h4Iqlb(9K4Iqlb&9M4Iq +lb,9e4Iqlb29j4IpE$qkc2Ukp-aM('VRfc[3`kq6D1r0qeXUeGkce+rVIHYIV&Ie +[[D[$L[khAJiKqYpkelF9r@mpI)QeFrNfZ#kXk(mE`%h@d,9hF!A4rcEiEY(r0[K +ZdImfZ0U[k(mEd%&B1GMHXHDXk(mEA,p@p,m0m#T@&1EEk,UeS[pY"0GB9GMHQ9j +PC@&lCpl'kX,fMTi@r@qMDrk+rVI4eAj&rpYSEiRqYa(1b@V$I*[N!D,rEE+R4Ir +E"0D`mV#p-rh!kX2f$S`8r@q6EaApEj0i,2VI*[Q0k(qEa#h4rcD*@k,rE4BM4Ir +EE$q*rVFCM'"0BAYRHS"eL1dGka+,rVGCr"$pEl1i*IVICYI$&Ie[XlJPqYm@9li +9r@q,DqU+rVI&GAY&rpX#"YQCDqlJ(k,rED%@V&jXleM49r5r,Dj2,2VI&YFd&[e +[Laa,p,qYiSISIeYGK9Id[kfZmb[kheE`MV@0lChT6eBfYRIJPZKr@ehE9r5rVDi +9,2VI9VQ)k(pEIEISIcfq@r5r(R&,p,mHF9Vd[alV,ITI$lh01X$fcY51YAlY(9a +%p,mHZBMSIcfZ#LckA`pmRY9mqEDj2V$SIpYmUqKrfjaY&re[QaJTqYmfDbckhcE +HcfV(pSkH&[e[QcdYqYmf0![@2HEElYUqS[pY&lG%rp[ZQX5LrffhaU,rE3FI@AR +ChS%PS[pYTaDX[fc[i1LLrfehY@24rlDl3V$SIc[N(k,rlA!eBp(rGXJM4IrE)@D +)rVH$AQ+GBR[(UX1Lrqe`c@E4rbjf2@(4rbjf4@,4rbjfY@E4rbjfK@R4rbkfEd6 +rZjMqBG9QH`IA&rh[B[Q6k(mlAA9Bp,qGVPJXqYp1hbIkhdljK1Kr1m&69SqfGh! +QdIpfbZp&rpYTr86rfb@(%2e[PkXHLrkh5b0ddIpff4qLrqebr@R4rhEj2Y(rGP% +[9Q+fGq#Ck(qla@r4rhEE(k,rlCDML2khfrH*rVGEc8$d[peb"G(rGSXVS[rYMUX +[fc[d#G(r,T&2LrjhLAaDp,p,A&GDp,p,A2YDp,p,`&r@TEChk#kLree#h9N&fpl +"+8ArHjDV*B[qpbaAB4Ep,r6Q-`KQ0P,F2ZP@IfB[aB0l[QX3&!Eka6G#-KJB+AG +F$&YT!11#*+*UL0YR"d$-'%Km(8V-im,H--&Bk"cVYYF0$1c'Dfe1ClEC2pfD'@J +AVGVXG,FcX,ZfCq##rJX'DUhTcN#eABqc)5%MAh&&Mj!!PXqbJ[!DZfUfq3L&@E- +K$'(eJhT(&G1pPQimQGZcBF`b-KX)MM1rb0`LmiV-+9TI3R-bMmM-),1)c!XbHmJ +X)[1#GJPkFc*hb'`JXi,-!M)rb"bJc2q&+Rb0#j`NJcFRh62rH@q'TpdjRmU6UQS +)h"F@D&CX#&efAfA2Ir,[2RqIjE#%$3rr$f1UIBdPaIZAa9rX2S2K$NX0"N5h8Y" +-T-NGqZ,XE0FFGa$B-p[SeYF0cADkVCQ+hU1(LKVZSVN8UkGCLreSCD,DeAdd&im +(+rkMaR,ejZE1"e+XVhYeR3kNa34iN!$ZKH%G+kS2a"Zm0K&lmd[bjS2KkqSGVEm +2E'p!%AYcb$"EEc5+NR'4,E6*h-!H$V5TC1%"ASC,UdAc`4U[h6!QlFK(EYTF'@p +hkc2eUrlME4LE)jmG"J*+iGALfIKRMAdpe*[cmr5j(G9Qh[KkNKh9cR5eFD6kNU+ +[r!`69PZBm-%@6X`MpNE['0l`8'LP38cikXl-0aYJChl9NHTILVXeaDeNZ21LThq +lq)4A#NZdUjlmlbS4GDY@b-Q%aZkh(p**8!&dSQY`6S)UQ"0HJA+Lbd$ZJLXBi$) +%MH*L#deZQk)+i2(i)RlCq$ai%eH"EU,,`"d,,KHX!0S%$N!f+@U!R8K3+AFCV&e +`IjZ@J0V&CQ%k&PKUK`T%%ed"D+,li*Ri-MLli&)TI@"1"TYUpF-`#5S`6(30KNP +3K@(#+c"-G"Q'AA#P[ef'S#PFE+8TUM!FMbrLNSh2`c"a&4JQZJc$XH"b`3S`61! +!$*1L"X1*"*9bPf(B"IHhD3Q'A@`@KQ1"TADS`$$4&4JQZJq'L5r$X!XZPE)-`qX +(Til#-!NU-%ad$BC*8)9K`LX`6(3CKPe`TEpGKU!TA'bP+DS`()m[iT+0cm-`F48 +B*VS-`l(JFX%+-%cJ!!b6SJE$L359FTGKf!AhYfN*KPeX&SCMJD9fU-!`d48B*VS +2KSN[`l!,,T8b"m1RC+P"BHU80(9#R"U8T`B%UY-59Ep)05"6R45U6NT9&E&U8+l +kVVKd5Pik*6!05%bR4DCqQDNU0!e)6B0Ldk$FG%Vk'44r6XNr*`5J33PS3!3k,32 +e#d%$8Y"*-HLN(&34K!BPSHm+1+FNR&-LcS#-FeV)kCGbUQ,1J*`c+1J-5MURj*9 +"JH@8a(*#C"Q8@3D%PY055lrB-L#hR"4F6NSZ&G&P8(EjVNKb5LBj*C3-5#@RaC* +qZD3UQ!a)*S1LbD"XNT`B,8NBk54jZ%YR+!*H1NN!HHN8HG",CmM"AMj"[Krc@C) +GQBp209kQF3,i+q4)BdXQK`q"kGJm#+BcP'!`RDB)K-8NrHA+J@%q`FRfb`*L2Mi +1L8&`AfrQB6'GS4mB+i*(1NNr-&C%Mh55!@$X&6l5'@V!@"8rmPP+R9N83$+0-`# +-C4%NNk-A'(Z&N!"dKP2!@"&$LNRkbe8$aUSNNXr5ehjPB#`+)lN%9@$X&8I5d*N +EH3J5e2!j0IU3!!iZL2RT($P"2jqJMerNK2ed(p5Uh$YM&@3)UPbH(%VRU&@j-%' +8MkqU"lND$ik[9!GB6JjN$)aNp!pP$)aP*!TINI$55IV*@dA'5bFC)'qp8Pik3if +m9H@mI*B5)"3P[8cM$*!!Yl+XPmR45pjkTEedKP2NV5,[&C2dPkY'hUSLAcj,ArZ +9b9Y4kXXPU*+hV0bApiI*iQ+3!#-*Ld'#$#S'19+J''4)BQ)K`FfG9M0@Zr$%@h1 +XE-[K2U+@iT-GA8SL$9d+GbeED,F8QPC5a0#TN!$#`p)J0!QP33+IiTAMqdVS5&i +3Qi2T)%X'TDXjDQhJBh3TrN4$*a#k&!j!Pf1VRC+%jb$"#A41XqBJK8qE5r(9q[V +%14-IL*j"MKSr##62)%Fr2mJ+RS8%9AjJReMK"aQjY"4IJj1d@&S+Vl9E2cr)+k@ +&&%9qN!$95B-%II`JUh+9%q6j39'$$E)-mS0!J5hNU2+$J[jD5P*Yk")rb)L[[I% +9IT!!P9k$"!2m)#-CPZ+VpHhM"i'Z&Z5SmB0!93Ybp21$V+C@5&$P"rD*&Ak3!&( +N5[%e1%RVFDA`@V[emi1m'&G)8H3(@5NZ50$($l)DF6P"RKm8CEiJbb!r#%5q3Si +U2bK)I+8NeBBZmB1-[YFEAq%(*p5p[1SHT1MM"fRG[46ZDJKiTA0Nq8'3!#2*$i) +%'Ai3j%MaJb"$NKm%#Ab!,m8RmD#842UP&&lVPa6!9e,%N!#YN!$#!rJJ0!R`33) +Ii-[aI59d!"r%jJ!qb*)"q'U1@K[i!&q+2p(3#B![K32`jGKUTb3"2NL3!!6i)%% +Di)-82X#AiU[e6IVbQAS1!Rb3!#-*m%'#$-!(19)!(f4)!Rb3!-!(q&*m%Jp+5D4 +I5Z'eINN"I#9&$0N++6b!$d+6!"mNm!'q(0pA3JI`3@`1i)-X'B#[jULeJ3r`TIJ +6$Cd!q&)i!&q1VAC+%Z#$"%Q!$a+N!6j)i30m+EjDhd%'ElYpDl@jFlDk-rmQ(X3 +bP0k`VMAp-+Vi1GK1*CK!F(&*8Z'#-N6#aDA)JiY+%JBAj*-%2bD*)hkJp*BINUe +K#[46B6'%Li9ji1kZNi$ZJP)pPi`5D%r'C!T5DVBFI,[)$'5Ril*&p+(CMbQd83+ +#r4"J0hQIVPB5APe3%P*G8"T'ACJ2RAj-ZKBq4")6f'5iZ#`X"@BB,Li(5eR,#aH +8JD@#XB8IQ+KKaViL9X-F,190+Q*KF9M+@P'iS"`XC3E%Nc'CJJ5`9$5eF*%",!A +@&E'i0#`9$#Vm`(3EqE#8FCj)a+4J+HX[iB,bX*3CC[GMdV9)`e)!59Ni#U!S"d0 +C#-V!6`&kdV#6JC`mh15K*J%c@BM*`8X'@V+`%N"+%8i#+!PJ*!-K"IK)3iF2'aR +)b-*&$LTL5aS9@%Fm1XXpiU%"!iP(jhK)2$E,4Z+K'8k5LXa#DLSm!@DT3"p1%jA +2FC9-F",X%m&ahK)2bV+AH'L1`k4M%d`Q(9NXAF"UiY&&EK12$aK10VUhp"QfNiU +X0QLDqD3#(Ip*4a@UQq9#mG"HQ#Z4khKd,mb9L(BmZJ4c"G)G$bh#A*Q!Tm+cA45 +3!2&%j8X`ed[-%m%CQ#Z3!24iD!RQ!X+HMLb@VJ*c&3SIMkr!A)R1*k),-&HQpUR +`3S2QB#iJqmR)!1B+a(pVIIY$A-l&CL(1"3B!jf*cm1BLXq$Q!M23jXGPqmB26R5 +0(qCh4kc118K,K5Dl1KBDKc-ANJ8c&jL$XQ4N!XL5F8'a!K"cX88)Fp%"J+9M#iA +1J*FI9fl"0($jB3kfNM(jDQBKb`9Q!@[Gk'KP,C(R2!"CmHJXD-9$!pL+4qH!+ak +EKDjiD!Dm8T(ChNQ&*lSR&HMh5U,b14$,"#Hl1a%F"l*i8"E+iU%j-%[(*Z!X(9N +XA3"TmHJLU-AM!eM,4[H@2J0YUFKUJkEK,4AS!#iG9DKZ&Z6LS39H9K)IA'b"Pj@ +%"aGEj'8&dF%&"VbX,$Mi`@P5%)J0X6SAH9Q[d"!,6I'bJXMJ!SZm,"!BNR&"X8U +mV#)YZ1J5,b[*#V(B2#mV5`TqF,i&-l`X%"-5F6PH9K!5iKV$ZRcll-kGH9%*-*5 +1AMmemB!bNCmqL!GRCK"5N4I06HHd["RG+V`X2Db3!!SX#S@9%K)GP,"hVLFHA#b +KLkb@-$m'P!S-q(433"HE+Tq,bKI2K@C+jmF9#ZFRb!X$3G&+`"'M,GQLpB+'#`f ++9J--2d%H0BYJi5M0KNCV1pKGNcG0Q3j8Qc8I9j!!1$hQd+X@!p!$Mb5&HF1qmmD +rT6p+JV,1+2%&h"XSG%c+kLed,,jFD+F3$6bb9ZKdJ[,F3+l3[R4BU%"5VmX@14Q +G,l%[JG@Hee[HI(L[k&BXE3fUNT5h80SqQ2*CC1ejeG*@!#SIA@#@)23!FT46q05 +N9X'"4bCTc-lC*KNb%&J)cr+f62$!``LI[k"ZP%M%JV,VZQLl'iUUr#FG[r$"QBE +c+i1e@Yf-8RG$RG*PlAmp'ITH6hcKp35@AqqkT[4f&epmZBY1[pZ&e9lGefmZ[[, +UI+qjX-+V`lbqh'j4N3heSU-fHp0-hZaQkm+DBE6rTTPfUqL@Ll,e6'bpjhT0YG& +Si4Df-@qdXl'YPD#)fN5ASQ"BfC!!@b2+49$fr05C$BV-CYAQ,CHfLNDYIjTellC +@K[TPKHZVDjpD[rbLfMRpP-,'#FN``9k)8CR0reLZZIIN-Z8)AJ&6R01)1AD0M'r +CCKBEQeNT*l,Z[SK-Aj!!*&ClZC6DFqXTPC&Y3q-E&KV!aXAl`5D9D[(!@29LYhE +c[4ZVdrPLaIeQm,0kpA34UI+C4V2PbfcX%PRA@m`aPG%%jc)@RZ&D)p13!,'fNiF +PZciINNP$Gq4$-QQSBMl%KjA$"j1QA-d,9ZIj92&#T)0bUH,&5!GYU-lN*IXb3AI +N"9eYeLE(81p)cZUNM%dF+V*S`HH(G(ppEEdJ*TZ)!J8af858*iM*@jAi26lc`[V +pH*X+5SANE8dLk`Jm8LhUH@GG4$6hhh2-cF&q)U-Rr-5FG5f`'a[$JfAD&,Th(iD +$iL0FE40AA@[(k0TE+j[bDZ%i8+lmX4GRHb!H@BT,i(iL@5`N8b9dX%20GBG)35Q +*)`[9$V06HcNZN@kKFM91p-ck`bf6CJ@C[LQ&ji2&HL5blZ#&Q$ji!F$KFq[YrU* +66*FAqrah3e&`FDaDCa9)Fh'S8mYMT1'GjYq0+2EHcHe'F(ecLi[EZr8'IfmU0ED +Mh1`TVQahqAqXHf@CB%marC3,`rpMeHeFl-eh0+TG(h1Xb(06APr[qVGlS5VfCPr +jekY,pd*KZJp@aZE`8NPYZ,,&k9kS6RFX6hH[2Yd(#p4pX%)Q`LX4&ek0ZRY&kMj +BTHjBTKZVHmSiqHmpfUZ([6K3RHjdChIX)0CFlDfA98X%FHG&QBY$jFYL&h%3-E- +,92&)8)RPdS(0NIb+HJHTLCFPlVc+QKKhBGj&!ab0&A"h8S"i+@bP[2ViY6*iF+M +9f0kD+pXJGV82@H1'SUaAr-VGQ2caUpZEpEP'2E4,iLjfCC)PlZblVbX,',mbL'A ++[@Hfk*5[L&qj'pX#lST'1TbcFkrA8pk9Zr(H*9IQ"Nb3!##j1Pc8Qpfb4q-hZeU +c"@`cNGS2L6@0LdQ8aBAijABaLAC*[-C9a)A%X-i&a-!Q8j98S@*3NkP+)X6[c8a +9dQ8R`'*c)NlZ$AqjP$&%2f-m*,8MYL8ImHZNBZd(`dr@6lB[hh'`X0!F`kRNJGh +ha1i*4(N1"Eqq,&Xk9bEq-(6V)&U$Akp%61`Ud@'*Q)6Fl"A-A@l)ZaYDphC"2)3 +E#)VI2BQBj'#TpkciYHQbJke!3e*A4pZ0ZL3QF4@V51)PANI0T+95!6C$3XG1*,H +j2'S%lh)APY6k!1%&q"#BM["ca&Sj'4$,kEGP1Q*IPM[KZQF([54hA#9kbBp2"AQ +*BPG"q,kib(YLr$@lfAYfr3YrMMFcZjZDedh1k'EQj6+@X9NhdB5cTKYP5mrGTQG +YCEif2RbAmR2-'#HQ"eLcIS+q-@$@#6(K#ZJF$K-1II%Te$flUX9-p4"T@8Z)DC& +i5*iLq5hU3V,FbQpc&j*P*$Rb%qIEQHFR8k6BQ'-mlMV,i(,X+8r&mTc4alTXL%P +mY&Fc3G&dK%NV%I&H-h#qDblm0kK1#KI"K4GLmL0XT9iN%BA*Xm+mQ%'b'jTA,$i +L&R"J@X3i8K*kpm"ib!'(*2CFAK-824DH[!qQGA)61SQTR0#a5Cc3KUq*A@,VbSf +RSb`-fl*dh*Ehhq'c#q5#"k&[J*!!`)1'J!IGpDXkZiUJ+R4RJHQ'XH'"q9[(AXZ ++QF&M4H[jHE'R`d#A'FbrVR!fRm'1ZdTpfNb`l3Nbfej'4+qVjF85BfL4i!Ierid +(4X)00k-,#6aJ(ra6H""f4Ki6H+!#(RJ1,EHhRAS2Ba1A%RMJk3FKE!K3a!0lUE- +60l@`GHVlkXE'*ST(ASfk[AYife4rifLHR#e$kV[hi$[Z1[U1[*P$pKfH"D3hCeE +i4Je16)`q8[PV19HhfrpCpbIHXAEmQMh(mKJI&!TEbl'fdAPiH1Rd1cE[,REdFcj +6elEbV@[A,`h3(cXR0`mY$I!1Lc$AlcU+-,i,6qpRhh(6p*&hj,e*NPm-1IGeCai +"%IZ1r8HlqR6IK``JqB([`8Hm(J-F"6HNlliM&)"CA$ib86RfeX%qSqr0,1Ak4pl +"YlFe2IY)Mi',eMdM&1!GI(1Q'`aVrV#ZpKhlUppMThEZLRHB!G`IpePff$[cG5d +p`5KlaNB[2TBRl8C@V2b1dBH4kV[[#!eJJYX[h[KI#*bb95Ym1dCEfjF'U%G)"6- +G`2+NY9cY(E21A5VJ(Id&qIYhe)$mIlpMN!!422'1'qD1&Z68&cDJ*2b`le&X3JB +8J)(Z5,ND9[[M-#iB)3([f(1N3`El)elA2EZqMBarril$4pMlB&eMl`J28%L1jMZ +A#-#c8!#P*Aa#f6LkUr%`AdalFKBq()A#!Gl"0iFQHDDZ1`kqidG0B[@'q$i%a54 +$PTj35%*101A`!!BA+U'pKLXJqHN[krH8q5BYqD%*QY,f9[jT6E$bMR#6kC!!Tc5 +iFRGm6i-lmBiR0EJ6lhK5Jc[jMLFdZ-&hK&*SF29lEpR2"&iNHrc@ekeF1hBUpar +)([r'IGRM2RA0SET1ZR9p0VlbcK9hR2abiq[hhPCEU%F)J`CADE5R0EM"GcbT`I8 +qi`FDh)Ph2+A"&4m54U$"pHF3rr16l`J&B0bBV!r@,'[%R[p#2l5m-U"p6mZV-TQ +`!#f[jb%T3VlfSG%YNipd%%`RI'+k+$aJ+LMXC(VQeU--cKKh-VNApr*-I6'Q%ci +aK@-mYhq-DGilISM!XHQCJ5QF[kY(q-hdc,'P!(`kc@)j#bqX,+k#NrP'ISF4Q)I +81[ST4R$L(8mbJK2[H",*6llM#53II%Gi!*+(,mc6pGBec''HVY*S6c1#`AFmb3K +kRr%$4R$L(8pTHF@(a0ia)$1CGpL0P%lJd*(m5*raL"Xk8C6SHdFSJ*E(&b)`,mC ++'08[SGK8%Gqmip$fhGpqarEYZapqKdc[XkCANF)0r4p[&I1+5Sjrm&DT[H2dY-U +J@Ka#-+hb)`q5'00j`S1NeKrK!@Vk2hKeP1[a2Dq1@Pe2UpHRqjl[5Bq0@MhX1jl +`aULp3hCeUJc#G5cj-3IR&6LSr02UGH8Gi44cF%pTAP5eGl,K(c@[%qpi8[-kmBi +R0Dq6lhK#maTm4hM!r0T6@P9[2@)-lLP0TrFG2p"d"YpaNJP@J&@qN!!+Pk4`!#d +QYAA!d%H")&X(0#DRj0$6,l@HR,H1BmM+&`ShJf5r-lL,$65L0chhr0,pHY+CFbZ +ZZI[*h+r+6RrarZa(VQXFUZ[%keGRQfjrdiTRAhfAmG'EUTpCU-FCIm8''Xr80Fc +"YIS-h@8$M4#iVfGbC2LdN5BDpX'm@aQHDcGDaAGpIcI"38KVZ%MSLPeUD-cA-($ +5l-D4UHc!THH(!'-frrR*Di1rG$IFDHRXXJ22I%Efm4qmZ[0f3LEdEFa1(K[HY!@ +RSHZRUS@Z-IG06Qeq)[F268b8cPV[f&b[UISm@XflSXU(L8H2qhLl++Fm2VHK86A +[ekH3!&(-rmHCa$LDpI@GY,jS`BM9MkjBj+(4HVD+[pH8GrZc-rRlKM,`hZb(q2H +0XQDcpF&@*j9hFl+ePDc[CmUlml+RmHr&-4p@qQq2GjZcl14ha#IZjY6Bjr,C!*! +!0A`-k,lrlHYffqX'"P5ejh4QQrhXiM'A)BZpXp2GcX$ZfTk"#rS[')$*(afSYZX +$5j)dJ%CS-+"SIk%[hmJe3q2VKpG8eU`IR"VNlik4SDNe5kXd3#-l*hKI$![-mN- +)KrZP60k1-d@B-(P'm2H@P+HG[lHQ2#2jHc$PkH6[SC4R&(m2Tca`cpY5RM(m2C, +bM1A[dC4R%Rr[6(NQmrHZP!ISZMrPJ5rAaccQUTaR0F&e+Fp'JTY5RNebq90jc)b +`1M(PkH([JC4R'hr[5AQB+AX6JS'(Kj8mGa2HN!$HFar"Be1HPa!m-Z9jJ1#1P1H +Pr,dqeI&"`M[6Hhk+i#NTcrd%Mcq@j``)i8[YF0EbD"*NKl2UAJ'KTamlR1'D9E2 +,$MIj3Z0QN!$1j#jf1(ZQVQ%11bHFD96XF&DrpjEpj4k9NlHqEZADX91jrd$fq$I +ZbalhU@X1eAA5VHZcmC9hVVMMj*FEAlrhYYT#2Fk-AhBiLpiA&3kd#FXePhHkeBI +dZ*!!K)qp3N*N2SYTCb!)fmVpMiq'!,D9q`UEbrREbRhQCVH91qBfF'(UfmU&ebJ +-pGRb93GYp@FLe*jcIiS,iaI#8"Zeq1T`Z@hckS'!8"JT[2NHk$E6p(RS([c#"k! +pqCC,qUlY1h%C5mkj,k5JCbZ2!L8F8X6%N!"5eH`3'cQLkdF[f6DpTekE+&UlYdi +bZK*G%U"`q[jKM[pAm1+kK6fFQcLhFDlLA-fjNA-,jpfFScR(F)lPR-3jQA-8CbG +R1fFEj`M1NC`c1'rK[)rc*C`2F,k8md&i01XDARCX,6b6Kh80RjhbG2$hmT5(G3f +[6(PBer#UP!IalHU8Kh80VdPj@0I`fT4R((q[5hPBer$'P!FamUD8"ijiAmV$91c +V8KkceQ(NG5N2`emReL%dHFckKj%hT$aQrF2)De)Hl%9HQ2+`rZ%9+3rV(cirjB( +aI#EPH5(KSe1H&r(h$5Q2@4-aFPh+BpBV2,R@SFPMeMp8I5N2DbGf(FYcjSh`SA2 +!$H&pjQcRl1$Xj"c&1CTcM*`I2JpAKiI$XH(2F'0i,j`@[JSAK4I#qH"cF$9iQ19 +BU686KckD"&NcXES19HMTjiEU&erdX,0`@-NA#MH$C,m`932+-&V$Y-B!KXm`2XY +d3L(S6ZScQaX0f65qDA"XZ(pifcG`hNlH@[CVrXMrV*d4,hRb`C%$R(rqD1jLEG2 +S6Fmp[p3"*jdjYq+DZjr-rDVXp"I[chlNZXDKZNkmIR@fkIBhVAMfeAFC(lfTqTQ +&HTca9kaYqNaG`aa@[6XMGeREp!`%BCR0,5b`bFFbQlZZ[AHCcBh2F*R0SfmR*,a +NQFd`Qp8G)kG2GQYZmm,-c0&@)lp[QM@ffCieRq+NdbllNb83DK0HYlTM+!`'K-4 +mBET,iRA'T461l"1B8qN,SpMX08aJ1BNcq35qH(+YNc2["8BCEX)+``MH-j(c#h& +$V5r'kGqrF#mpmhdTX[-[Pa[c4V)[aXlkDScrbh#[IMM'I5h'ICeYfIRqUTaBMQ4 +ha[ar(E[UEf+qEf52+IrrEAcR0m0rY6UqkqciIhVm2b2Qr9CmclGMh-3BpeKmrq1 +aMYm*HEb1#G9P8Q&RAi`(0@qmZ$AEV'%T9NaNA38`46*XLSdP[c1rG@66qZCXB`N +!"l,3d!r"+DA6%f#$E(4LU6FAP2P#!0Ce-kqUVrDhC[r[%H"mcf$T31-@KJSGk*2 +HZc1lK1q-*81&5Ba0Kq'S-'Gf#9p)mIa,b)ZbmVekrYqlm,E[c(3"!cc"4B`(*55 +FaVR90SPDJ3fI$!,92Y4HqDVf`#@a+a`#&d*PqMl4UfG5%MJCl`SDZCd6Kfq'mh( +%EZ$%+4ZAl$'FZ(@c-eJ(j`M1PSJ&Z(HhFJlPC0q`8C`iGSrN(-[Cb6PZ+BIb[Qf +1lESL-jhZi9hIM[eUPUdf,MdK1KERmk('(6cF*M2j-j1iQqm0Dq"p)q2lkQlV"AD +r`VE`hZI(+4E5Uir[mq0QdLI0qfHkjHD1#D4U)&rN,Z,BBM)4erK-rR60G$Z(mc@ +k$CV8bArIX"qMc@I2Y$Z(ihEF4)[[RHRZ2&bR4VCDLjc+ZkPhiRe0lqI2Vmed'ke +liaEZ*IqULG&10e[q"AGIQacL1Rq$2h2+AGEU2[3HlXi,F3HI$p4X#R([(65(&cI +bAm8J,qjAAX$Gh""hP(k0V!jahcR("T2hI8aFmZ)qi@k$bf+q4rRc8"NAIHSRZ9X +Hqjlpe6D(I!ql41D+%0IbjX9q5K#ECc1('1[,4&bcZ9eI*Z)Dpbhf65+ZjAf,IC1 +)fr2V[IlirFZiNeeqphbdeam(a9AC$(1IQ#Vpm4XIjUiRa"e`efhTM`FrapeP-Hj +RH[eal58@91*H[G!IGDqmNl[,Ber5Rejr4+IXb5Y#A)Fpj08TqT+riNj`m"G@,p3 +THVUB)CZUYPqd8+IS#phD8RC,I35mP$T&Alk&ZcXLlKVmN!!k45rl-qi-2YKm2pI +Vil2&0[+$kp4'k[4+0d58h9mll$q[6[T*Rq)12+&pIRDK6VV2A[pfL"[bSB8kkCF +kFrTBL*Yaad+Gp-@rc0hMXBrT6kp1H[LVh*PGk[L@[R1K6ZV2k5d(MGeLQeFRYCq +P&Kh$(Q+0Qd,rIH9hL9XCFAU5A-UVklV2%bFlZcA*2b6IPrqCZ+YM(*[SHIRUAJY +h8qAZGbD1hHfmI0'9p*EbAB5mTjI[VKF6*cMG4"p,(far#RdJHq"&6KBc[,KYY3Z +)Hh1Xhk[i-cA8pHh'I65q!kiRrG&XAF&R)2'qKIl3,`*Ve0q%Z+%Z-1ReKci$6U6 +q0[)!qY*lRck0RPIr&2[l&EhhcB5R+V',IUAZdRm["`m82@*j#FZmbIZ@`@r99b* +1rc*raT9aNAH!P9VqDm,(mGDfDd2FErdLFI"Gmld+rY%3qLEb02L`PYqDI,2Jah0 +[$A&AITBiq+lj4T!!3adIiUk&HfKj-Hrq2B[VaGh`am5"lF4pDU'ZN5IF5KbFQcJ +ifA$MMXrrfpR%JIrJUhQ61LlNqp3r%LFFZdQHXc,%(3*lY([rm3lUEYpKS28"iLC +%r[3R[%0f$A`aNp[DA4piKmNK1"(jrp4'4r`B$BG6TiDii@ka*rJa",i5Z6$%IC' +HeR'Rf(fmThiLe1qVD!Mk#5(ZY@q&,lD(I!rF6Gc8%0FU"lSqa+hm#q+Q44b#-bd +*F4I6NeUmSNlS&F0Lhm`Qc[5)M3-RT-q@fdr6Babm6ITXrkZ*NfA[4UTcr(D)H`p +[dq+YqFj'$e"RKEK4p,D@Hj)2h(mia!eP0d)0[lCi4RpErR&mrN[`84ehqecm,Zk +NRbDq4#iZIB-Z)6Md+*a@"hkXR[A&(Jlp+9a,"hkXpVb`Kd26fDT9"hkXpY+[$SI +Qd%-kEUJi(plTF1J&Vb,1B,AY*lLAp-HGRb"Z3Dc(bhVpd3'2e%q*G@9h4-'26R" +D2cA%E8,RF$Kd%Ea(Xd1LlH0hpA$SCA"F(IF5(UDZ*1qiiUA%A4$L0X06(3jp4*b +!2e)RH+h8qe*Lp)q(Z0Ir83q(ERdpFD)(Y)Q$JN-cl$p2$e$Ai4cLiC!!@9'$r[$ +d!(8pQaFk(2ShD"XkkJ&M`"k(3epq*A(#cpVNiB*$M@#"M[bXaIF,$Mh(ZSTr3E[ +i+(dfrAELi)1d'$a-qZc2i-BkEPSl(ClUF1Kcm%XGYdImHIL3!-1KYlfE10Q%GXQ +024cDLGDLikSI(El(im'4#ATBK`eXe9XqeX1Kc3HiJpp42rLcdcqmc6PX[VGm'Fc +m303riR'40kZ2I6VU(iQi$KeDR2i4Mp1VA(GiAp3r%[R'LSq#IbhL)VU@HIH[`9m +GrVd@(Up(3Yb(U+Z(ImIRri%lc@k5a2hqTKlqADA@*6V+'cl6`lpAQdpdP!jjTr6 +P#ML%MMV+-(QGlF[MmhI"QcA[XR@LVi5(I84H*AZd[J9mF[MhN!$i,FXr,j!![`V +qAB9fSXXG+mdlf#YIm1qem'1p1G6[@q#T`lqAL+qbIhi,f1EKhr(j[r`)FHKA*Y9 +MD+`1rqTrMMM`h(a,h5&6m'mY'S'@6jP8Mm2I(!rl@lL3!0iDqV*1(9,`le+iVik +kdI9I1SKraqFr)$m6h@L2pE,iGhcqGM"H4peS*(c&iGp9k-3kkNB,ZA0pGJ303$m +RpJ&i)(hfQ(Km9BKlUhJLq(H*20[61I4ap+Z(ImIRhb0HHMU(2PiG3["[S4a,&SF +p+Mm8([B&qEfhEV-q!9cfm1rir#I4)(6Fd,VeAaEa,llITPi&$fLk,H*I)Zj4GCc +24[b,ad9'hD$@i9mLhbKU%m1r4,iMERlTi9rG(iKcKYq4Ec3mAr![qMbd62fL%$I +M,3[mVqjkZ)F15f[VTi'TJRpe0mK6Aa$LKS"hJRr4Xq`ESrPBR(MP3Pp'XlmMcQ# +[VCr*iI6#0m+9pG8acR!D`DhSFm3RlXhI&R"+m#pk$KLKeAQS+hUKKhr4&k$&k*G +&r%"AN!"hX$QT$MU62NqYb-1rZLqK9HMr&h%DMG29qeH*)cqdefJcJRr4R`!l0$c +8pMhij1&Ip!`d"5fI0Arh`Q@&rp@pPEN'$DFMEYk[,H"Ih4[T-Id,i4e[**r`[qK +b0!r0HrRHl2XprKGYJR&DcC0hdbFHrNA24[[3kUl`*(L&p0RH$a,h81`$F%[dc[2 +3ZE@m$lS06RMi&jeKGe-0CbGZ2ca@q&rGAm1400S&FEI)%ccmLfk&BfYe$qU%rLf +kmLr"bEAp6MkMK`VrUrX!ZE9e-(m2fK1HAKKj#4LQj4hQlf&Q1qSLRhL1ld!,jAe +SXCiq&aN&Fl9kX[NHNFm,hSpr'h(SYm6"ai6RAI%QiPi6hMId$rRRkAD4[@J6@Th +Ir$hI2[0dZmLBZSlT8q+1bVfN6S[S#DhHDrlH$MpdGET'r[(kq!jd5DR6@,LG9Qq +(ek+h5CfDj8RHRUakcXehT%j[KPYVDQAMk$HTdb'iR9C$0Rr[kZQ,NBYqM`"2(p9 +AbKfP6K2JkYSj#22hERLfUe1RrIe`L,Z(A[(UC2LCd@)d1'rj4a`r)Um'1c5kQFh +h"ldkGGe-!2Q*-jcHeHQ2k@hY,!Ed!Aj[kh4mrJjjfb-alS1p1Vd0E8@(29reci0 +9VNl23S28kY[d2Ea3k[40Z,j@4b81RLae@Lm2"XISEhLMe1R6B)%11mAUUpACT8k +[&+F0YK2h)R&@qZNAdBVdlm3q0K`dFXS-HjV(Z40apkR(I@QQHYr'fir)JcfFDhi +E'V5'Aj!!lhki8AfSGr-Pe%kMT4$h-R6+ZX!2QRm*,926bm3pf01IQYk2VUc9YBL +MRlak0rmQ'V4fYS8iH-A9)@kRZLNk$h(`L6H'Z!I%!h!2qN#pjAh[rJ)"4YHbF3C +2ACeZG6NKG"jJhf#'e+RTYp'U0"SbFDp5(jGk2b`rH(q-3kH81Xf#NqL`DDaq[EU +fe1P+HPZr0mBaKq(9UHNVmM0i",#2VLh[Hm"h'pb`F8E2P6SeI36Xdmie!0HQ,ed +rrD5D%r-[`#pp)rAq1*U)GTk)12LN9kHQVm)9p3GL($c%Ue26qq3I[a[MQ,f3!$T +p5pd4[3iHKQiZGCU#4U$9Bi(hH$mel9HI0[K'h-1pIQVq@IX!hBCh`0qN6Tm8bm& +Em!bq,rh8U2i02`9qk6qTdjqM9@Zd'Z,HUZiMIIm+Z)K@*`GqdF'ppcAHBTfBU5% +1r9IH[3*ZS1NG'iIZ+A'2q1k24(k*VL&a9cPRi-eKk0qbYlbjMBEIK`2V-)HKhiP +1*('0Tk(Yk6#(SGmPGjGmAd-ld'%13pmJYjDicm*&0&SaFEr1ZpAji4hhUQ-C$B' +iGpJhZd2F,(NB1J"aCMBLmUS3plKkkLG#h$["!q(aM4H+LfBHMEKh`IrGqckYR[( +*%2GZF9EHph*a&ai(c$+(+1qE3UpUjKTXR1'"lRdcl32$PBKl,rc%[HpCkVl-#J' +rr*IhVD8(p+G$h2[8YH9pCm%4p5dacZ#1Hpm'iicH50a[dJrZIBqTVe0ri*Fj5RR +I+p&H0E-*0Jlp5plh#E"!bq1)-h0)lRd2b*rXM0lr"`#3!edP!!!: diff -Nru boinc-7.0.7+dfsg/zip/zip/Makefile.am boinc-7.0.14+dfsg/zip/zip/Makefile.am --- boinc-7.0.7+dfsg/zip/zip/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/Makefile.am 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,10 @@ +## -*- mode: makefile; tab-width: 4 -*- +## $Id: Makefile.am 15375 2008-06-08 22:18:52Z davea $ + +EXTRA_DIST = deflate.c tailor.h z_api.h z_crypt.h z_ttyio.h ziperr.h zipup.c \ +ebcdic.h trees.c z_crc32.c z_fileio.c zip.c zipfile.c \ +mktime.c util.c z_crctab.c z_globals.c zip.h zipnote.c \ +revision.h z_api.c z_crypt.c z_ttyio.c zipcloak.c zipsplit.c \ +BUGS CHANGES README macos TODO match.S unix win32 \ +INSTALL WHATSNEW LICENSE WHERE MANUAL crc_i386.S + diff -Nru boinc-7.0.7+dfsg/zip/zip/MANUAL boinc-7.0.14+dfsg/zip/zip/MANUAL --- boinc-7.0.7+dfsg/zip/zip/MANUAL 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/MANUAL 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1122 @@ + + + +ZIP(1L) ZIP(1L) + + +NAME + zip, zipcloak, zipnote, zipsplit - package and compress + (archive) files + +SYNOPSIS + zip [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [-b path] + [-n suffixes] [-t mmddyyyy] [-tt mmddyyyy] [ zipfile [ + file1 file2 ...]] [-xi list] + + zipcloak [-dhL] [-b path] zipfile + + zipnote [-hwL] [-b path] zipfile + + zipsplit [-hiLpst] [-n size] [-b path] zipfile + +DESCRIPTION + zip is a compression and file packaging utility for Unix, + VMS, MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh, + Amiga and Acorn RISC OS. + + It is analogous to a combination of the UNIX commands + tar(1) and compress(1) and is compatible with PKZIP (Phil + Katz's ZIP for MSDOS systems). + + A companion program (unzip(1L)), unpacks zip archives. + The zip and unzip(1L) programs can work with archives pro- + duced by PKZIP, and PKZIP and PKUNZIP can work with + archives produced by zip. zip version 2.3 is compatible + with PKZIP 2.04. Note that PKUNZIP 1.10 cannot extract + files produced by PKZIP 2.04 or zip 2.3. You must use + PKUNZIP 2.04g or unzip 5.0p1 (or later versions) to + extract them. + + For a brief help on zip and unzip, run each without speci- + fying any parameters on the command line. + + The program is useful for packaging a set of files for + distribution; for archiving files; and for saving disk + space by temporarily compressing unused files or directo- + ries. + + The zip program puts one or more compressed files into a + single zip archive, along with information about the files + (name, path, date, time of last modification, protection, + and check information to verify file integrity). An + entire directory structure can be packed into a zip + archive with a single command. Compression ratios of 2:1 + to 3:1 are common for text files. zip has one compression + method (deflation) and can also store files without com- + pression. zip automatically chooses the better of the two + for each file to be compressed. + + When given the name of an existing zip archive, zip will + replace identically named entries in the zip archive or + + + +Info-ZIP 14 August 1999 (v2.3) 1 + + + + + +ZIP(1L) ZIP(1L) + + + add entries for new names. For example, if foo.zip exists + and contains foo/file1 and foo/file2, and the directory + foo contains the files foo/file1 and foo/file3, then: + + zip -r foo foo + + will replace foo/file1 in foo.zip and add foo/file3 to + foo.zip. After this, foo.zip contains foo/file1, + foo/file2, and foo/file3, with foo/file2 unchanged from + before. + + If the file list is specified as -@, [Not on MacOS] zip + takes the list of input files from standard input. Under + UNIX, this option can be used to powerful effect in con- + junction with the find(1) command. For example, to + archive all the C source files in the current directory + and its subdirectories: + + find . -name "*.[ch]" -print | zip source -@ + + (note that the pattern must be quoted to keep the shell + from expanding it). zip will also accept a single dash + ("-") as the zip file name, in which case it will write + the zip file to standard output, allowing the output to be + piped to another program. For example: + + zip -r - . | dd of=/dev/nrst0 obs=16k + + would write the zip output directly to a tape with the + specified block size for the purpose of backing up the + current directory. + + zip also accepts a single dash ("-") as the name of a file + to be compressed, in which case it will read the file from + standard input, allowing zip to take input from another + program. For example: + + tar cf - . | zip backup - + + would compress the output of the tar command for the pur- + pose of backing up the current directory. This generally + produces better compression than the previous example + using the -r option, because zip can take advantage of + redundancy between files. The backup can be restored using + the command + + unzip -p backup | tar xf - + + When no zip file name is given and stdout is not a termi- + nal, zip acts as a filter, compressing standard input to + standard output. For example, + + tar cf - . | zip | dd of=/dev/nrst0 obs=16k + + + + +Info-ZIP 14 August 1999 (v2.3) 2 + + + + + +ZIP(1L) ZIP(1L) + + + is equivalent to + + tar cf - . | zip - - | dd of=/dev/nrst0 obs=16k + + zip archives created in this manner can be extracted with + the program funzip which is provided in the unzip package, + or by gunzip which is provided in the gzip package. For + example: + + dd if=/dev/nrst0 ibs=16k | funzip | tar xvf - + + When changing an existing zip archive, zip will write a + temporary file with the new contents, and only replace the + old one when the process of creating the new version has + been completed without error. + + If the name of the zip archive does not contain an exten- + sion, the extension .zip is added. If the name already + contains an extension other than .zip the existing exten- + sion is kept unchanged. + +OPTIONS + -a [Systems using EBCDIC] Translate file to ASCII for- + mat. + + -A Adjust self-extracting executable archive. A self- + extracting executable archive is created by + prepending the SFX stub to an existing archive. The + -A option tells zip to adjust the entry offsets + stored in the archive to take into account this + "preamble" data. + + Note: self-extracting archives for the Amiga are a special + case. At present, only the Amiga port of Zip is capable + of adjusting or updating these without corrupting them. -J + can be used to remove the SFX stub if other updates need + to be made. + + -B [VM/CMS and MVS] force file to be read binary + (default is text). + + -Bn [TANDEM] set Edit/Enscribe formatting options with + n defined as + bit 0: Don't add delimiter (Edit/Enscribe) + bit 1: Use LF rather than CR/LF as delimiter + (Edit/Enscribe) + bit 2: Space fill record to maximum record length + (Enscribe) + bit 3: Trim trailing space (Enscribe) + bit 8: Force 30K (Expand) large read for unstruc- + tured files + + -b path + Use the specified path for the temporary zip + + + +Info-ZIP 14 August 1999 (v2.3) 3 + + + + + +ZIP(1L) ZIP(1L) + + + archive. For example: + + zip -b /tmp stuff * + + will put the temporary zip archive in the directory + /tmp, copying over stuff.zip to the current direc- + tory when done. This option is only useful when + updating an existing archive, and the file system + containing this old archive does not have enough + space to hold both old and new archives at the same + time. + + -c Add one-line comments for each file. File opera- + tions (adding, updating) are done first, and the + user is then prompted for a one-line comment for + each file. Enter the comment followed by return, + or just return for no comment. + + -d Remove (delete) entries from a zip archive. For + example: + + zip -d foo foo/tom/junk foo/harry/\* \*.o + + will remove the entry foo/tom/junk, all of the + files that start with foo/harry/, and all of the + files that end with .o (in any path). Note that + shell pathname expansion has been inhibited with + backslashes, so that zip can see the asterisks, + enabling zip to match on the contents of the zip + archive instead of the contents of the current + directory. + + Under MSDOS, -d is case sensitive when it matches + names in the zip archive. This requires that file + names be entered in upper case if they were zipped + by PKZIP on an MSDOS system. + + -df [MacOS] Include only data-fork of files zipped into + the archive. Good for exporting files to foreign + operating-systems. Resource-forks will be ignored + at all. + + -D Do not create entries in the zip archive for direc- + tories. Directory entries are created by default + so that their attributes can be saved in the zip + archive. The environment variable ZIPOPT can be + used to change the default options. For example + under Unix with sh: + + ZIPOPT="-D"; export ZIPOPT + + (The variable ZIPOPT can be used for any option + except -i and -x and can include several options.) + The option -D is a shorthand for -x "*/" but the + + + +Info-ZIP 14 August 1999 (v2.3) 4 + + + + + +ZIP(1L) ZIP(1L) + + + latter cannot be set as default in the ZIPOPT envi- + ronment variable. + + -e Encrypt the contents of the zip archive using a + password which is entered on the terminal in + response to a prompt (this will not be echoed; if + standard error is not a tty, zip will exit with an + error). The password prompt is repeated to save + the user from typing errors. + + -E [OS/2] Use the .LONGNAME Extended Attribute (if + found) as filename. + + -f Replace (freshen) an existing entry in the zip + archive only if it has been modified more recently + than the version already in the zip archive; unlike + the update option (-u) this will not add files that + are not already in the zip archive. For example: + + zip -f foo + + This command should be run from the same directory + from which the original zip command was run, since + paths stored in zip archives are always relative. + + Note that the timezone environment variable TZ + should be set according to the local timezone in + order for the -f , -u and -o options to work cor- + rectly. + + The reasons behind this are somewhat subtle but + have to do with the differences between the Unix- + format file times (always in GMT) and most of the + other operating systems (always local time) and the + necessity to compare the two. A typical TZ value + is ``MET-1MEST'' (Middle European time with auto- + matic adjustment for ``summertime'' or Daylight + Savings Time). + + -F Fix the zip archive. This option can be used if + some portions of the archive are missing. It is not + guaranteed to work, so you MUST make a backup of + the original archive first. + + When doubled as in -FF the compressed sizes given + inside the damaged archive are not trusted and zip + scans for special signatures to identify the limits + between the archive members. The single -F is more + reliable if the archive is not too much damaged, + for example if it has only been truncated, so try + this option first. + + Neither option will recover archives that have been + incorrectly transferred in ascii mode instead of + + + +Info-ZIP 14 August 1999 (v2.3) 5 + + + + + +ZIP(1L) ZIP(1L) + + + binary. After the repair, the -t option of unzip + may show that some files have a bad CRC. Such files + cannot be recovered; you can remove them from the + archive using the -d option of zip. + + -g Grow (append to) the specified zip archive, instead + of creating a new one. If this operation fails, zip + attempts to restore the archive to its original + state. If the restoration fails, the archive might + become corrupted. This option is ignored when + there's no existing archive or when at least one + archive member must be updated or deleted. + + -h Display the zip help information (this also appears + if zip is run with no arguments). + + -i files + Include only the specified files, as in: + + zip -r foo . -i \*.c + + which will include only the files that end in .c in + the current directory and its subdirectories. (Note + for PKZIP users: the equivalent command is + + pkzip -rP foo *.c + + PKZIP does not allow recursion in directories other + than the current one.) The backslash avoids the + shell filename substitution, so that the name + matching is performed by zip at all directory lev- + els. + + Also possible: + + zip -r foo . -i@include.lst + + which will only include the files in the current + directory and its subdirectories that match the + patterns in the file include.lst. + + -I [Acorn RISC OS] Don't scan through Image files. + When used, zip will not consider Image files (eg. + DOS partitions or Spark archives when SparkFS is + loaded) as directories but will store them as sin- + gle files. + + For example, if you have SparkFS loaded, zipping a + Spark archive will result in a zipfile containing a + directory (and its content) while using the 'I' + option will result in a zipfile containing a Spark + archive. Obviously this second case will also be + obtained (without the 'I' option) if SparkFS isn't + loaded. + + + +Info-ZIP 14 August 1999 (v2.3) 6 + + + + + +ZIP(1L) ZIP(1L) + + + -j Store just the name of a saved file (junk the + path), and do not store directory names. By + default, zip will store the full path (relative to + the current path). + + -jj [MacOS] record Fullpath (+ Volname). The complete + path including volume will be stored. By default + the relative path will be stored. + + -J Strip any prepended data (e.g. a SFX stub) from the + archive. + + -k Attempt to convert the names and paths to conform + to MSDOS, store only the MSDOS attribute (just the + user write attribute from UNIX), and mark the entry + as made under MSDOS (even though it was not); for + compatibility with PKUNZIP under MSDOS which cannot + handle certain names such as those with two dots. + + -l Translate the Unix end-of-line character LF into + the MSDOS convention CR LF. This option should not + be used on binary files. This option can be used + on Unix if the zip file is intended for PKUNZIP + under MSDOS. If the input files already contain CR + LF, this option adds an extra CR. This ensure that + unzip -a on Unix will get back an exact copy of the + original file, to undo the effect of zip -l. + + -ll Translate the MSDOS end-of-line CR LF into Unix LF. + This option should not be used on binary files. + This option can be used on MSDOS if the zip file is + intended for unzip under Unix. + + -L Display the zip license. + + -m Move the specified files into the zip archive; + actually, this deletes the target directories/files + after making the specified zip archive. If a direc- + tory becomes empty after removal of the files, the + directory is also removed. No deletions are done + until zip has created the archive without error. + This is useful for conserving disk space, but is + potentially dangerous so it is recommended to use + it in combination with -T to test the archive + before removing all input files. + + -n suffixes + Do not attempt to compress files named with the + given suffixes. Such files are simply stored (0% + compression) in the output zip file, so that zip + doesn't waste its time trying to compress them. + The suffixes are separated by either colons or + semicolons. For example: + + + + +Info-ZIP 14 August 1999 (v2.3) 7 + + + + + +ZIP(1L) ZIP(1L) + + + zip -rn .Z:.zip:.tiff:.gif:.snd foo foo + + will copy everything from foo into foo.zip, but + will store any files that end in .Z, .zip, .tiff, + .gif, or .snd without trying to compress them + (image and sound files often have their own spe- + cialized compression methods). By default, zip + does not compress files with extensions in the list + .Z:.zip:.zoo:.arc:.lzh:.arj. Such files are stored + directly in the output archive. The environment + variable ZIPOPT can be used to change the default + options. For example under Unix with csh: + + setenv ZIPOPT "-n .gif:.zip" + + To attempt compression on all files, use: + + zip -n : foo + + The maximum compression option -9 also attempts + compression on all files regardless of extension. + + On Acorn RISC OS systems the suffixes are actually + filetypes (3 hex digit format). By default, zip + does not compress files with filetypes in the list + DDC:D96:68E (i.e. Archives, CFS files and PackDir + files). + + -N [Amiga, MacOS] Save Amiga or MacOS filenotes as + zipfile comments. They can be restored by using the + -N option of unzip. If -c is used also, you are + prompted for comments only for those files that do + not have filenotes. + + -o Set the "last modified" time of the zip archive to + the latest (oldest) "last modified" time found + among the entries in the zip archive. This can be + used without any other operations, if desired. For + example: + + zip -o foo + + will change the last modified time of foo.zip to + the latest time of the entries in foo.zip. + + + -P password + use password to encrypt zipfile entries (if any). + THIS IS INSECURE! Many multi-user operating sys- + tems provide ways for any user to see the current + command line of any other user; even on stand-alone + systems there is always the threat of over-the- + shoulder peeking. Storing the plaintext password + as part of a command line in an automated script is + + + +Info-ZIP 14 August 1999 (v2.3) 8 + + + + + +ZIP(1L) ZIP(1L) + + + even worse. Whenever possible, use the non-echo- + ing, interactive prompt to enter passwords. (And + where security is truly important, use strong + encryption such as Pretty Good Privacy instead of + the relatively weak encryption provided by standard + zipfile utilities.) + + -q Quiet mode; eliminate informational messages and + comment prompts. (Useful, for example, in shell + scripts and background tasks). + + -Qn [QDOS] store information about the file in the file + header with n defined as + bit 0: Don't add headers for any file + bit 1: Add headers for all files + bit 2: Don't wait for interactive key press on + exit + + -r Travel the directory structure recursively; for + example: + + zip -r foo foo + + In this case, all the files and directories in foo + are saved in a zip archive named foo.zip, including + files with names starting with ".", since the + recursion does not use the shell's file-name sub- + stitution mechanism. If you wish to include only a + specific subset of the files in directory foo and + its subdirectories, use the -i option to specify + the pattern of files to be included. You should + not use -r with the name ".*", since that matches + ".." which will attempt to zip up the parent + directory (probably not what was intended). + + -R Travel the directory structure recursively starting + at the current directory; for example: + + zip -R foo '*.c' + + In this case, all the files matching *.c in the + tree starting at the current directory are stored + into a zip archive named foo.zip. Note for PKZIP + users: the equivalent command is + + pkzip -rP foo *.c + + -S [MSDOS, OS/2, WIN32 and ATARI] Include system and + hidden files. + [MacOS] Includes finder invisible files, which are + ignored otherwise. + + -t mmddyyyy + Do not operate on files modified prior to the + + + +Info-ZIP 14 August 1999 (v2.3) 9 + + + + + +ZIP(1L) ZIP(1L) + + + specified date, where mm is the month (0-12), dd is + the day of the month (1-31), and yyyy is the year. + The ISO 8601 date format yyyy-mm-dd is also + accepted. For example: + + zip -rt 12071991 infamy foo + + zip -rt 1991-12-07 infamy foo + + will add all the files in foo and its subdirecto- + ries that were last modified on or after 7 December + 1991, to the zip archive infamy.zip. + + -tt mmddyyyy + Do not operate on files modified after or at the + specified date, where mm is the month (0-12), dd is + the day of the month (1-31), and yyyy is the year. + The ISO 8601 date format yyyy-mm-dd is also + accepted. For example: + + zip -rtt 11301995 infamy foo + + zip -rtt 1995-11-30 infamy foo + + will add all the files in foo and its subdirecto- + ries that were last modified before the 30 November + 1995, to the zip archive infamy.zip. + + -T Test the integrity of the new zip file. If the + check fails, the old zip file is unchanged and + (with the -m option) no input files are removed. + + -u Replace (update) an existing entry in the zip + archive only if it has been modified more recently + than the version already in the zip archive. For + example: + + zip -u stuff * + + will add any new files in the current directory, + and update any files which have been modified since + the zip archive stuff.zip was last created/modified + (note that zip will not try to pack stuff.zip into + itself when you do this). + + Note that the -u option with no arguments acts like + the -f (freshen) option. + + -v Verbose mode or print diagnostic version info. + + Normally, when applied to real operations, this + option enables the display of a progress indicator + during compression and requests verbose diagnostic + info about zipfile structure oddities. + + + +Info-ZIP 14 August 1999 (v2.3) 10 + + + + + +ZIP(1L) ZIP(1L) + + + When -v is the only command line argument, and std- + out is not redirected to a file, a diagnostic + screen is printed. In addition to the help screen + header with program name, version, and release + date, some pointers to the Info-ZIP home and dis- + tribution sites are given. Then, it shows informa- + tion about the target environment (compiler type + and version, OS version, compilation date and the + enabled optional features used to create the zip + executable. + + -V [VMS] Save VMS file attributes. zip archives cre- + ated with this option will generally not be usable + on other systems. + + -w [VMS] Append the version number of the files to the + name, including multiple versions of files. + (default: use only the most recent version of a + specified file). + + -x files + Explicitly exclude the specified files, as in: + + zip -r foo foo -x \*.o + + which will include the contents of foo in foo.zip + while excluding all the files that end in .o. The + backslash avoids the shell filename substitution, + so that the name matching is performed by zip at + all directory levels. + + Also possible: + + zip -r foo foo -x@exclude.lst + + which will include the contents of foo in foo.zip + while excluding all the files that match the pat- + terns in the file exclude.lst. + + -X Do not save extra file attributes (Extended + Attributes on OS/2, uid/gid and file times on + Unix). + + -y Store symbolic links as such in the zip archive, + instead of compressing and storing the file + referred to by the link (UNIX only). + + -z Prompt for a multi-line comment for the entire zip + archive. The comment is ended by a line containing + just a period, or an end of file condition (^D on + UNIX, ^Z on MSDOS, OS/2, and VAX/VMS). The comment + can be taken from a file: + + zip -z foo < foowhat + + + +Info-ZIP 14 August 1999 (v2.3) 11 + + + + + +ZIP(1L) ZIP(1L) + + + -# Regulate the speed of compression using the speci- + fied digit #, where -0 indicates no compression + (store all files), -1 indicates the fastest com- + pression method (less compression) and -9 indicates + the slowest compression method (optimal compres- + sion, ignores the suffix list). The default com- + pression level is -6. + + -! [WIN32] Use priviliges (if granted) to obtain all + aspects of WinNT security. + + -@ Take the list of input files from standard input. + Only one filename per line. + + -$ [MSDOS, OS/2, WIN32] Include the volume label for + the the drive holding the first file to be com- + pressed. If you want to include only the volume + label or to force a specific drive, use the drive + name as first file name, as in: + + zip -$ foo a: c:bar + + +EXAMPLES + The simplest example: + + zip stuff * + + creates the archive stuff.zip (assuming it does not exist) + and puts all the files in the current directory in it, in + compressed form (the .zip suffix is added automatically, + unless that archive name given contains a dot already; + this allows the explicit specification of other suffixes). + + Because of the way the shell does filename substitution, + files starting with "." are not included; to include these + as well: + + zip stuff .* * + + Even this will not include any subdirectories from the + current directory. + + To zip up an entire directory, the command: + + zip -r foo foo + + creates the archive foo.zip, containing all the files and + directories in the directory foo that is contained within + the current directory. + + You may want to make a zip archive that contains the files + in foo, without recording the directory name, foo. You + can use the -j option to leave off the paths, as in: + + + +Info-ZIP 14 August 1999 (v2.3) 12 + + + + + +ZIP(1L) ZIP(1L) + + + zip -j foo foo/* + + If you are short on disk space, you might not have enough + room to hold both the original directory and the corre- + sponding compressed zip archive. In this case, you can + create the archive in steps using the -m option. If foo + contains the subdirectories tom, dick, and harry, you can: + + zip -rm foo foo/tom + zip -rm foo foo/dick + zip -rm foo foo/harry + + where the first command creates foo.zip, and the next two + add to it. At the completion of each zip command, the + last created archive is deleted, making room for the next + zip command to function. + +PATTERN MATCHING + This section applies only to UNIX. Watch this space for + details on MSDOS and VMS operation. + + The UNIX shells (sh(1) and csh(1)) do filename substitu- + tion on command arguments. The special characters are: + + ? match any single character + + * match any number of characters (including none) + + [] match any character in the range indicated within + the brackets (example: [a-f], [0-9]). + + When these characters are encountered (without being + escaped with a backslash or quotes), the shell will look + for files relative to the current path that match the pat- + tern, and replace the argument with a list of the names + that matched. + + The zip program can do the same matching on names that are + in the zip archive being modified or, in the case of the + -x (exclude) or -i (include) options, on the list of files + to be operated on, by using backslashes or quotes to tell + the shell not to do the name expansion. In general, when + zip encounters a name in the list of files to do, it first + looks for the name in the file system. If it finds it, it + then adds it to the list of files to do. If it does not + find it, it looks for the name in the zip archive being + modified (if it exists), using the pattern matching char- + acters described above, if present. For each match, it + will add that name to the list of files to be processed, + unless this name matches one given with the -x option, or + does not match any name given with the -i option. + + The pattern matching includes the path, and so patterns + like \*.o match names that end in ".o", no matter what the + + + +Info-ZIP 14 August 1999 (v2.3) 13 + + + + + +ZIP(1L) ZIP(1L) + + + path prefix is. Note that the backslash must precede + every special character (i.e. ?*[]), or the entire argu- + ment must be enclosed in double quotes (""). + + In general, use backslash to make zip do the pattern + matching with the -f (freshen) and -d (delete) options, + and sometimes after the -x (exclude) option when used with + an appropriate operation (add, -u, -f, or -d). + +ENVIRONMENT + ZIPOPT contains default options that will be used when + running zip + + ZIP [Not on RISC OS and VMS] see ZIPOPT + + Zip$Options + [RISC OS] see ZIPOPT + + Zip$Exts + [RISC OS] contains extensions separated by a : that + will cause native filenames with one of the speci- + fied extensions to be added to the zip file with + basename and extension swapped. zip + + ZIP_OPTS + [VMS] see ZIPOPT + +SEE ALSO + compress(1), shar(1L), tar(1), unzip(1L), gzip(1L) + +DIAGNOSTICS + The exit status (or error level) approximates the exit + codes defined by PKWARE and takes on the following values, + except under VMS: + + 0 normal; no errors or warnings detected. + + 2 unexpected end of zip file. + + 3 a generic error in the zipfile format was + detected. Processing may have completed + successfully anyway; some broken zipfiles + created by other archivers have simple work- + arounds. + + 4 zip was unable to allocate memory for one or + more buffers during program initialization. + + 5 a severe error in the zipfile format was + detected. Processing probably failed imme- + diately. + + 6 entry too large to be split with zipsplit + + + + +Info-ZIP 14 August 1999 (v2.3) 14 + + + + + +ZIP(1L) ZIP(1L) + + + 7 invalid comment format + + 8 zip -T failed or out of memory + + 9 the user aborted zip prematurely with con- + trol-C (or similar) + + 10 zip encountered an error while using a temp + file + + 11 read or seek error + + 12 zip has nothing to do + + 13 missing or empty zip file + + 14 error writing to a file + + 15 zip was unable to create a file to write to + + 16 bad command line parameters + + 18 zip could not open a specified file to read + + VMS interprets standard Unix (or PC) return values as + other, scarier-looking things, so zip instead maps them + into VMS-style status codes. The current mapping is as + follows: 1 (success) for normal exit, + and (0x7fff000? + 16*normal_zip_exit_status) for all + errors, where the `?' is 0 (warning) for zip value 12, 2 + (error) for the zip values 3, 6, 7, 9, 13, 16, 18, and 4 + (fatal error) for the remaining ones. + +BUGS + zip 2.3 is not compatible with PKUNZIP 1.10. Use zip 1.1 + to produce zip files which can be extracted by PKUNZIP + 1.10. + + zip files produced by zip 2.3 must not be updated by zip + 1.1 or PKZIP 1.10, if they contain encrypted members or if + they have been produced in a pipe or on a non-seekable + device. The old versions of zip or PKZIP would create an + archive with an incorrect format. The old versions can + list the contents of the zip file but cannot extract it + anyway (because of the new compression algorithm). If you + do not use encryption and use regular disk files, you do + not have to care about this problem. + + Under VMS, not all of the odd file formats are treated + properly. Only stream-LF format zip files are expected to + work with zip. Others can be converted using Rahul + Dhesi's BILF program. This version of zip handles some of + the conversion internally. When using Kermit to transfer + zip files from Vax to MSDOS, type "set file type block" on + + + +Info-ZIP 14 August 1999 (v2.3) 15 + + + + + +ZIP(1L) ZIP(1L) + + + the Vax. When transfering from MSDOS to Vax, type "set + file type fixed" on the Vax. In both cases, type "set + file type binary" on MSDOS. + + Under VMS, zip hangs for file specification that uses DEC- + net syntax foo::*.*. + + On OS/2, zip cannot match some names, such as those + including an exclamation mark or a hash sign. This is a + bug in OS/2 itself: the 32-bit DosFindFirst/Next don't + find such names. Other programs such as GNU tar are also + affected by this bug. + + Under OS/2, the amount of Extended Attributes displayed by + DIR is (for compatibility) the amount returned by the + 16-bit version of DosQueryPathInfo(). Otherwise OS/2 1.3 + and 2.0 would report different EA sizes when DIRing a + file. However, the structure layout returned by the + 32-bit DosQueryPathInfo() is a bit different, it uses + extra padding bytes and link pointers (it's a linked list) + to have all fields on 4-byte boundaries for portability to + future RISC OS/2 versions. Therefore the value reported by + zip (which uses this 32-bit-mode size) differs from that + reported by DIR. zip stores the 32-bit format for porta- + bility, even the 16-bit MS-C-compiled version running on + OS/2 1.3, so even this one shows the 32-bit-mode size. + +AUTHORS + Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, + Jean-loup Gailly, Onno van der Linden, Kai Uwe Rommel, + Igor Mandrichenko, John Bush and Paul Kienitz. Permission + is granted to any individual or institution to use, copy, + or redistribute this software so long as all of the origi- + nal files are included, that it is not sold for profit, + and that this copyright notice is retained. + + LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED + UTILITIES ARE PROVIDED AS IS AND COME WITH NO WARRANTY OF + ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT WILL + THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES RESULTING + FROM THE USE OF THIS SOFTWARE. + + Please send bug reports and comments by email to: + zip-bugs@lists.wku.edu. For bug reports, please include + the version of zip (see zip-h ), the make options used to + compile it see zip-v ), the machine and operating system + in use, and as much additional information as possible. + +ACKNOWLEDGEMENTS + Thanks to R. P. Byrne for his Shrink.Pas program, which + inspired this project, and from which the shrink algorithm + was stolen; to Phil Katz for placing in the public domain + the zip file format, compression format, and .ZIP filename + extension, and for accepting minor changes to the file + + + +Info-ZIP 14 August 1999 (v2.3) 16 + + + + + +ZIP(1L) ZIP(1L) + + + format; to Steve Burg for clarifications on the deflate + format; to Haruhiko Okumura and Leonid Broukhis for pro- + viding some useful ideas for the compression algorithm; to + Keith Petersen, Rich Wales, Hunter Goatley and Mark Adler + for providing a mailing list and ftp site for the Info-ZIP + group to use; and most importantly, to the Info-ZIP group + itself (listed in the file infozip.who) without whose + tireless testing and bug-fixing efforts a portable zip + would not have been possible. Finally we should thank + (blame) the first Info-ZIP moderator, David Kirschbaum, + for getting us into this mess in the first place. The + manual page was rewritten for UNIX by R. P. C. Rodgers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Info-ZIP 14 August 1999 (v2.3) 17 + + diff -Nru boinc-7.0.7+dfsg/zip/zip/match.S boinc-7.0.14+dfsg/zip/zip/match.S --- boinc-7.0.7+dfsg/zip/zip/match.S 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/match.S 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,407 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE (the contents of which are also + included in unzip.h, zip.h and wiz.h) for terms of use. If, for + some reason, all of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ + +/* + * match.s by Jean-loup Gailly. Translated to 32 bit code by Kai Uwe Rommel. + * The 68020 version has been written by Francesco Potorti` + * with adaptations by Carsten Steger , + * Andreas Schwab and + * Kristoffer Eriksson + */ + +/* This file is NOT used in conjunction with zlib. */ +#ifndef USE_ZLIB + +/* Preprocess with -DNO_UNDERLINE if your C compiler does not prefix + * external symbols with an underline character '_'. + */ +#if defined(NO_UNDERLINE) || defined(__ELF__) +# define _prev prev +# define _window window +# define _match_start match_start +# define _prev_length prev_length +# define _good_match good_match +# define _nice_match nice_match +# define _strstart strstart +# define _max_chain_length max_chain_length + +# define _match_init match_init +# define _longest_match longest_match +#endif + +#ifdef DYN_ALLOC + error: DYN_ALLOC not yet supported in match.s +#endif + +/* Use 16-bytes alignment if your assembler supports it. Warning: gas + * uses a log(x) parameter (.align 4 means 16-bytes alignment). On SVR4 + * the parameter is a number of bytes. + */ +#ifndef ALIGNMENT +# define ALIGNMENT 4 +#endif + + +#ifndef WSIZE +# define WSIZE 32768 +#endif +#define MIN_MATCH 3 +#define MAX_MATCH 258 +#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) +#define MAX_DIST (WSIZE - MIN_LOOKAHEAD) + +#if defined(i386) || defined(_I386) || defined(_i386) || defined(__i386) + +/* This version is for 386 Unix or OS/2 in 32 bit mode. + * Warning: it uses the AT&T syntax: mov source,dest + * This file is only optional. If you want to force the C version, + * add -DNO_ASM to CFLAGS in Makefile and set OBJA to an empty string. + * If you have reduced WSIZE in (g)zip.h, then make sure this is + * assembled with an equivalent -DWSIZE=. + * This version assumes static allocation of the arrays (-DDYN_ALLOC not used). + */ + + .file "match.S" + + .globl _match_init + .globl _longest_match + + .text + +_match_init: + ret + +/*----------------------------------------------------------------------- + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + */ + + .align ALIGNMENT + +_longest_match: /* int longest_match(cur_match) */ + +#define cur_match 20(%esp) + /* return address */ /* esp+16 */ + push %ebp /* esp+12 */ + push %edi /* esp+8 */ + push %esi /* esp+4 */ + push %ebx /* esp */ + +/* + * match equ esi + * scan equ edi + * chain_length equ ebp + * best_len equ ebx + * limit equ edx + */ + mov cur_match,%esi + mov _strstart,%edx + mov _max_chain_length,%ebp /* chain_length = max_chain_length */ + mov %edx,%edi + sub $(MAX_DIST),%edx /* limit = strstart-MAX_DIST */ + cld /* string ops increment si and di */ + jae limit_ok + sub %edx,%edx /* limit = NIL */ +limit_ok: + add $2+_window,%edi /* edi = offset(window+strstart+2) */ + mov _prev_length,%ebx /* best_len = prev_length */ + movw -2(%edi),%cx /* cx = scan[0..1] */ + movw -3(%ebx,%edi),%ax /* ax = scan[best_len-1..best_len] */ + cmp _good_match,%ebx /* do we have a good match already? */ + jb do_scan + shr $2,%ebp /* chain_length >>= 2 */ + jmp do_scan + + .align ALIGNMENT +long_loop: +/* at this point, edi == scan+2, esi == cur_match */ + movw -3(%ebx,%edi),%ax /* ax = scan[best_len-1..best_len] */ + movw -2(%edi),%cx /* cx = scan[0..1] */ +short_loop: +/* + * at this point, di == scan+2, si == cur_match, + * ax = scan[best_len-1..best_len] and cx = scan[0..1] + */ + and $(WSIZE-1), %esi + dec %ebp /* --chain_length */ + movw _prev(,%esi,2),%si /* cur_match = prev[cur_match] */ + /* top word of esi is still 0 */ + jz the_end + cmp %edx,%esi /* cur_match <= limit ? */ + jbe the_end +do_scan: + cmpw _window-1(%ebx,%esi),%ax/* check match at best_len-1 */ + jne short_loop + cmpw _window(%esi),%cx /* check min_match_length match */ + jne short_loop + + add $2+_window,%esi /* si = match */ + mov $((MAX_MATCH>>1)-1),%ecx/* scan for at most MAX_MATCH bytes */ + mov %edi,%eax /* ax = scan+2 */ + repe; cmpsw /* loop until mismatch */ + je maxmatch /* match of length MAX_MATCH? */ +mismatch: + movb -2(%edi),%cl /* mismatch on first or second byte? */ + xchg %edi,%eax /* edi = scan+2, eax = end of scan */ + subb -2(%esi),%cl /* cl = 0 if first bytes equal */ + sub %edi,%eax /* eax = len */ + sub $2+_window,%esi /* esi = cur_match + len */ + sub %eax,%esi /* esi = cur_match */ + subb $1,%cl /* set carry if cl == 0 (cannot use DEC) */ + adc $0,%eax /* eax = carry ? len+1 : len */ + cmp %ebx,%eax /* len > best_len ? */ + jle long_loop + mov %esi,_match_start /* match_start = cur_match */ + mov %eax,%ebx /* ebx = best_len = len */ +#ifdef FULL_SEARCH + cmp $(MAX_MATCH),%eax /* len >= MAX_MATCH ? */ +#else + cmp _nice_match,%eax /* len >= nice_match ? */ +#endif + jl long_loop +the_end: + mov %ebx,%eax /* result = eax = best_len */ + pop %ebx + pop %esi + pop %edi + pop %ebp + ret + .align ALIGNMENT +maxmatch: + cmpsb + jmp mismatch + +#else /* !(i386 || _I386 || _i386 || __i386) */ + +/* ======================== 680x0 version ================================= */ + +#if defined(m68k)||defined(mc68k)||defined(__mc68000__)||defined(__MC68000__) +# ifndef mc68000 +# define mc68000 +# endif +#endif + +#if defined(__mc68020__) || defined(__MC68020__) || defined(sysV68) +# ifndef mc68020 +# define mc68020 +# endif +#endif + +#if defined(mc68020) || defined(mc68000) + +#if (defined(mc68020) || defined(NeXT)) && !defined(UNALIGNED_OK) +# define UNALIGNED_OK +#endif + +#ifdef sysV68 /* Try Motorola Delta style */ + +# define GLOBAL(symbol) global symbol +# define TEXT text +# define FILE(filename) file filename +# define invert_maybe(src,dst) dst,src +# define imm(data) &data +# define reg(register) %register + +# define addl add.l +# define addql addq.l +# define blos blo.b +# define bhis bhi.b +# define bras bra.b +# define clrl clr.l +# define cmpmb cmpm.b +# define cmpw cmp.w +# define cmpl cmp.l +# define lslw lsl.w +# define lsrl lsr.l +# define movel move.l +# define movew move.w +# define moveb move.b +# define moveml movem.l +# define subl sub.l +# define subw sub.w +# define subql subq.l + +# define IndBase(bd,An) (bd,An) +# define IndBaseNdxl(bd,An,Xn) (bd,An,Xn.l) +# define IndBaseNdxw(bd,An,Xn) (bd,An,Xn.w) +# define predec(An) -(An) +# define postinc(An) (An)+ + +#else /* default style (Sun 3, NeXT, Amiga, Atari) */ + +# define GLOBAL(symbol) .globl symbol +# define TEXT .text +# define FILE(filename) .even +# define invert_maybe(src,dst) src,dst +# if defined(sun) || defined(mc68k) +# define imm(data) #data +# else +# define imm(data) \#data +# endif +# define reg(register) register + +# define blos bcss +# if defined(sun) || defined(mc68k) +# define movel movl +# define movew movw +# define moveb movb +# endif +# define IndBase(bd,An) An@(bd) +# define IndBaseNdxl(bd,An,Xn) An@(bd,Xn:l) +# define IndBaseNdxw(bd,An,Xn) An@(bd,Xn:w) +# define predec(An) An@- +# define postinc(An) An@+ + +#endif /* styles */ + +#define Best_Len reg(d0) /* unsigned */ +#define Cur_Match reg(d1) /* Ipos */ +#define Loop_Counter reg(d2) /* int */ +#define Scan_Start reg(d3) /* unsigned short */ +#define Scan_End reg(d4) /* unsigned short */ +#define Limit reg(d5) /* IPos */ +#define Chain_Length reg(d6) /* unsigned */ +#define Scan_Test reg(d7) +#define Scan reg(a0) /* *uch */ +#define Match reg(a1) /* *uch */ +#define Prev_Address reg(a2) /* *Pos */ +#define Scan_Ini reg(a3) /* *uch */ +#define Match_Ini reg(a4) /* *uch */ +#define Stack_Pointer reg(sp) + + GLOBAL (_match_init) + GLOBAL (_longest_match) + + TEXT + + FILE ("match.S") + +_match_init: + rts + +/*----------------------------------------------------------------------- + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + */ + +/* int longest_match (cur_match) */ + +#ifdef UNALIGNED_OK +# define pushreg 15928 /* d2-d6/a2-a4 */ +# define popreg 7292 +#else +# define pushreg 16184 /* d2-d7/a2-a4 */ +# define popreg 7420 +#endif + +_longest_match: + movel IndBase(4,Stack_Pointer),Cur_Match + moveml imm(pushreg),predec(Stack_Pointer) + movel _max_chain_length,Chain_Length + movel _prev_length,Best_Len + movel imm(_prev),Prev_Address + movel imm(_window+MIN_MATCH),Match_Ini + movel _strstart,Limit + movel Match_Ini,Scan_Ini + addl Limit,Scan_Ini + subw imm(MAX_DIST),Limit + bhis L__limit_ok + clrl Limit +L__limit_ok: + cmpl invert_maybe(_good_match,Best_Len) + blos L__length_ok + lsrl imm(2),Chain_Length +L__length_ok: + subql imm(1),Chain_Length +#ifdef UNALIGNED_OK + movew IndBase(-MIN_MATCH,Scan_Ini),Scan_Start + movew IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End +#else + moveb IndBase(-MIN_MATCH,Scan_Ini),Scan_Start + lslw imm(8),Scan_Start + moveb IndBase(-MIN_MATCH+1,Scan_Ini),Scan_Start + moveb IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End + lslw imm(8),Scan_End + moveb IndBaseNdxw(-MIN_MATCH,Scan_Ini,Best_Len),Scan_End +#endif + bras L__do_scan + +L__long_loop: +#ifdef UNALIGNED_OK + movew IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End +#else + moveb IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End + lslw imm(8),Scan_End + moveb IndBaseNdxw(-MIN_MATCH,Scan_Ini,Best_Len),Scan_End +#endif + +L__short_loop: + lslw imm(1),Cur_Match + movew IndBaseNdxl(0,Prev_Address,Cur_Match),Cur_Match + cmpw invert_maybe(Limit,Cur_Match) + dbls Chain_Length,L__do_scan + bras L__return + +L__do_scan: + movel Match_Ini,Match + addl Cur_Match,Match +#ifdef UNALIGNED_OK + cmpw invert_maybe(IndBaseNdxw(-MIN_MATCH-1,Match,Best_Len),Scan_End) + bne L__short_loop + cmpw invert_maybe(IndBase(-MIN_MATCH,Match),Scan_Start) + bne L__short_loop +#else + moveb IndBaseNdxw(-MIN_MATCH-1,Match,Best_Len),Scan_Test + lslw imm(8),Scan_Test + moveb IndBaseNdxw(-MIN_MATCH,Match,Best_Len),Scan_Test + cmpw invert_maybe(Scan_Test,Scan_End) + bne L__short_loop + moveb IndBase(-MIN_MATCH,Match),Scan_Test + lslw imm(8),Scan_Test + moveb IndBase(-MIN_MATCH+1,Match),Scan_Test + cmpw invert_maybe(Scan_Test,Scan_Start) + bne L__short_loop +#endif + + movew imm((MAX_MATCH-MIN_MATCH+1)-1),Loop_Counter + movel Scan_Ini,Scan +L__scan_loop: + cmpmb postinc(Match),postinc(Scan) + dbne Loop_Counter,L__scan_loop + + subl Scan_Ini,Scan + addql imm(MIN_MATCH-1),Scan + cmpl invert_maybe(Best_Len,Scan) + bls L__short_loop + movel Scan,Best_Len + movel Cur_Match,_match_start +#ifdef FULL_SEARCH + cmpl invert_maybe(imm(MAX_MATCH),Best_Len) +#else + cmpl invert_maybe(_nice_match,Best_Len) +#endif + blos L__long_loop +L__return: + moveml postinc(Stack_Pointer),imm(popreg) + rts + +#else + error: this asm version is for 386 or 680x0 only +#endif /* mc68000 || mc68020 */ +#endif /* i386 || _I386 || _i386 || __i386 */ + +#endif /* !USE_ZLIB */ diff -Nru boinc-7.0.7+dfsg/zip/zip/mktime.c boinc-7.0.14+dfsg/zip/zip/mktime.c --- boinc-7.0.7+dfsg/zip/zip/mktime.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/mktime.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,259 @@ +/* free mktime function + Copyright 1988, 1989 by David MacKenzie + and Michael Haertel + Unlimited distribution permitted provided this copyright notice is + retained and any functional modifications are prominently identified. */ + +/* Revised 1997 by Christian Spieler: + The code was changed to get more conformance with ANSI's (resp. modern + UNIX releases) definition for mktime(): + - Added adjustment for out-of-range values in the fields of struct tm. + - Added iterations to get the correct UTC result for input values at + the gaps when daylight saving time is switched on or off. + - Allow forcing of DST "on" or DST "off" by setting `tm_isdst' field in + the tm struct to positive number resp. zero. The `tm_isdst' field must + be negative on entrance of mktime() to enable automatic determination + if DST is in effect for the requested local time. + - Added optional check for overflowing the time_t range. */ + +/* Note: This version of mktime is ignorant of the tzfile. + When the tm structure passed to mktime represents a local time that + is valid both as DST time and as standard time (= time value in the + gap when switching from DST back to standard time), the behaviour + for `tm_isdst < 0' depends on the current timezone: TZ east of GMT + assumes winter time, TZ west of GMT assumes summer time. + Although mktime() (resp. mkgmtime()) tries to adjust for invalid values + of struct tm members, this may fail for input values that are far away + from the valid ranges. The adjustment process does not check for overflows + or wrap arounds in the struct tm components. */ + +#ifndef OF +# ifdef __STDC__ +# define OF(a) a +# else +# define OF(a) () +# endif +#endif + +#ifndef ZCONST +# define ZCONST const +#endif + +#include + +time_t mkgmtime OF((struct tm *)); +time_t mktime OF((struct tm *)); + +/* Return the equivalent in seconds past 12:00:00 a.m. Jan 1, 1970 GMT + of the local time and date in the exploded time structure `tm', + adjust out of range fields in `tm' and set `tm->tm_yday', `tm->tm_wday'. + If `tm->tm_isdst < 0' was passed to mktime(), the correct setting of + tm_isdst is determined and returned. Otherwise, mktime() assumes this + field as valid; its information is used when converting local time + to UTC. + Return -1 if time in `tm' cannot be represented as time_t value. */ + +time_t +mktime(tm) + struct tm *tm; +{ + struct tm *ltm; /* Local time. */ + time_t loctime; /* The time_t value of local time. */ + time_t then; /* The time to return. */ + long tzoffset_adj; /* timezone-adjustment `remainder' */ + int bailout_cnt; /* counter of tries for tz correction */ + int save_isdst; /* Copy of the tm->isdst input value */ + + save_isdst = tm->tm_isdst; + loctime = mkgmtime(tm); + if (loctime == -1) { + tm->tm_isdst = save_isdst; + return (time_t)-1; + } + + /* Correct for the timezone and any daylight savings time. + The correction is verified and repeated when not correct, to + take into account the rare case that a change to or from daylight + savings time occurs between when it is the time in `tm' locally + and when it is that time in Greenwich. After the second correction, + the "timezone & daylight" offset should be correct in all cases. To + be sure, we allow a third try, but then the loop is stopped. */ + bailout_cnt = 3; + then = loctime; + do { + ltm = localtime(&then); + if (ltm == (struct tm *)NULL || + (tzoffset_adj = loctime - mkgmtime(ltm)) == 0L) + break; + then += tzoffset_adj; + } while (--bailout_cnt > 0); + + if (ltm == (struct tm *)NULL || tzoffset_adj != 0L) { + /* Signal failure if timezone adjustment did not converge. */ + tm->tm_isdst = save_isdst; + return (time_t)-1; + } + + if (save_isdst >= 0) { + if (ltm->tm_isdst && !save_isdst) + { + if (then + 3600 < then) + then = (time_t)-1; + else + then += 3600; + } + else if (!ltm->tm_isdst && save_isdst) + { + if (then - 3600 > then) + then = (time_t)-1; + else + then -= 3600; + } + ltm->tm_isdst = save_isdst; + } + + if (tm != ltm) /* `tm' may already point to localtime's internal storage */ + *tm = *ltm; + + return then; +} + + +#ifndef NO_TIME_T_MAX + /* Provide default values for the upper limit of the time_t range. + These are the result of the decomposition into a `struct tm' for + the time value 0xFFFFFFFEL ( = (time_t)-2 ). + Note: `(time_t)-1' is reserved for "invalid time"! */ +# ifndef TM_YEAR_MAX +# define TM_YEAR_MAX 2106 +# endif +# ifndef TM_MON_MAX +# define TM_MON_MAX 1 /* February */ +# endif +# ifndef TM_MDAY_MAX +# define TM_MDAY_MAX 7 +# endif +# ifndef TM_HOUR_MAX +# define TM_HOUR_MAX 6 +# endif +# ifndef TM_MIN_MAX +# define TM_MIN_MAX 28 +# endif +# ifndef TM_SEC_MAX +# define TM_SEC_MAX 14 +# endif +#endif /* NO_TIME_T_MAX */ + +/* Adjusts out-of-range values for `tm' field `tm_member'. */ +#define ADJUST_TM(tm_member, tm_carry, modulus) \ + if ((tm_member) < 0) { \ + tm_carry -= (1 - ((tm_member)+1) / (modulus)); \ + tm_member = (modulus-1) + (((tm_member)+1) % (modulus)); \ + } else if ((tm_member) >= (modulus)) { \ + tm_carry += (tm_member) / (modulus); \ + tm_member = (tm_member) % (modulus); \ + } + +/* Nonzero if `y' is a leap year, else zero. */ +#define leap(y) (((y) % 4 == 0 && (y) % 100 != 0) || (y) % 400 == 0) + +/* Number of leap years from 1970 to `y' (not including `y' itself). */ +#define nleap(y) (((y) - 1969) / 4 - ((y) - 1901) / 100 + ((y) - 1601) / 400) + +/* Additional leapday in February of leap years. */ +#define leapday(m, y) ((m) == 1 && leap (y)) + +/* Length of month `m' (0 .. 11) */ +#define monthlen(m, y) (ydays[(m)+1] - ydays[m] + leapday (m, y)) + +/* Accumulated number of days from 01-Jan up to start of current month. */ +static ZCONST short ydays[] = +{ + 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 +}; + +/* Return the equivalent in seconds past 12:00:00 a.m. Jan 1, 1970 GMT + of the Greenwich Mean time and date in the exploded time structure `tm'. + This function does always put back normalized values into the `tm' struct, + parameter, including the calculated numbers for `tm->tm_yday', + `tm->tm_wday', and `tm->tm_isdst'. + Returns -1 if the time in the `tm' parameter cannot be represented + as valid `time_t' number. */ + +time_t +mkgmtime(tm) + struct tm *tm; +{ + int years, months, days, hours, minutes, seconds; + + years = tm->tm_year + 1900; /* year - 1900 -> year */ + months = tm->tm_mon; /* 0..11 */ + days = tm->tm_mday - 1; /* 1..31 -> 0..30 */ + hours = tm->tm_hour; /* 0..23 */ + minutes = tm->tm_min; /* 0..59 */ + seconds = tm->tm_sec; /* 0..61 in ANSI C. */ + + ADJUST_TM(seconds, minutes, 60) + ADJUST_TM(minutes, hours, 60) + ADJUST_TM(hours, days, 24) + ADJUST_TM(months, years, 12) + if (days < 0) + do { + if (--months < 0) { + --years; + months = 11; + } + days += monthlen(months, years); + } while (days < 0); + else + while (days >= monthlen(months, years)) { + days -= monthlen(months, years); + if (++months >= 12) { + ++years; + months = 0; + } + } + + /* Restore adjusted values in tm structure */ + tm->tm_year = years - 1900; + tm->tm_mon = months; + tm->tm_mday = days + 1; + tm->tm_hour = hours; + tm->tm_min = minutes; + tm->tm_sec = seconds; + + /* Set `days' to the number of days into the year. */ + days += ydays[months] + (months > 1 && leap (years)); + tm->tm_yday = days; + + /* Now calculate `days' to the number of days since Jan 1, 1970. */ + days = (unsigned)days + 365 * (unsigned)(years - 1970) + + (unsigned)(nleap (years)); + tm->tm_wday = ((unsigned)days + 4) % 7; /* Jan 1, 1970 was Thursday. */ + tm->tm_isdst = 0; + + if (years < 1970) + return (time_t)-1; + +#if (defined(TM_YEAR_MAX) && defined(TM_MON_MAX) && defined(TM_MDAY_MAX)) +#if (defined(TM_HOUR_MAX) && defined(TM_MIN_MAX) && defined(TM_SEC_MAX)) + if (years > TM_YEAR_MAX || + (years == TM_YEAR_MAX && + (tm->tm_yday > ydays[TM_MON_MAX] + (TM_MDAY_MAX - 1) + + (TM_MON_MAX > 1 && leap (TM_YEAR_MAX)) || + (tm->tm_yday == ydays[TM_MON_MAX] + (TM_MDAY_MAX - 1) + + (TM_MON_MAX > 1 && leap (TM_YEAR_MAX)) && + (hours > TM_HOUR_MAX || + (hours == TM_HOUR_MAX && + (minutes > TM_MIN_MAX || + (minutes == TM_MIN_MAX && seconds > TM_SEC_MAX) ))))))) + return (time_t)-1; +#endif +#endif + + return (time_t)(86400L * (unsigned long)(unsigned)days + + 3600L * (unsigned long)hours + + (unsigned long)(60 * minutes + seconds)); +} + +const char *BOINC_RCSID_945276575a = "$Id: mktime.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/README boinc-7.0.14+dfsg/zip/zip/README --- boinc-7.0.7+dfsg/zip/zip/README 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/README 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,137 @@ +Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + +See the accompanying file LICENSE (the contents of which are also +included in unzip.h, zip.h and wiz.h) for terms of use. If, for +some reason, all of these files are missing, the Info-ZIP license +also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html + + +Zip 2.3 is a compression and file packaging utility. It is compatible with +PKZIP 2.04g (Phil Katz ZIP) for MSDOS systems. There is a companion to zip +called unzip (of course) which you should be able to find the same place +you got zip. See the file 'WHERE' for details on ftp sites and mail +servers. + +This version of zip has been ported to a wide array of Unix and other +mainframes, minis, and micros including VMS, OS/2, Minix, MSDOS, Windows NT, +Atari, Amiga, BeOS and VM/CMS. Although highly compatible with PKware's +PKZIP and PKUNZIP utilities of MSDOS fame, our primary objective has been +one of portability and other-than-MSDOS functionality. Features not found +in the PKWare version include creation of zip files in a pipe or on a +device, VMS, BeOS and OS/2 extended file attributes, conversion from Unix to +MSDOS text file format; and, of course, the ability to run on most of your +favorite operating systems. And it's free. + +See the file 'CHANGES' for a detailed list of all changes. + +This version does not support multi-volume archives as in pkzip 2.04g. +This may be provided in a future version if time permits. + +Please read the file INSTALL for information on how to compile and +install zip, zipsplit and zipnote. Please read the file MANUAL for +information on how to use them. The file "contents" is a complete +list of the files you should have in this distribution. Also, if you +are using MSDOS, you should read the note on file formats at the end +of the contents file. + +This version supports encryption, but the encryption code is distributed +separately because of the US export regulations. See the file 'WHERE' +for access to the encryption code. Decryption can be made with unzip 5.0p1 +or later, or with zipcloak. + +All bug reports or patches should go to zip-bugs@lists.wku.edu, and +suggestions for new features can be sent to info-zip@lists.wku.edu +(although we don't promise to use all suggestions). Patches should be +sent as context diffs only (diff -c). + +If you're considering a port, please check in with zip-bugs FIRST, +since the code is constantly being updated behind the scenes. We'll +arrange to give you access to the latest source. + +If you'd like to keep up to date with our Zip (and companion UnZip utility) +development, join the ranks of BETA testers, add your own thoughts and con- +tributions, etc., send a two-line mail message containing the commands HELP +and LIST (on separate lines in the body of the message, not on the subject +line) to mxserver@lists.wku.edu. You'll receive two messages listing the +various Info-ZIP mailing-list formats which are available (and also various +unrelated lists) and instructions on how to subscribe to one or more of them +(courtesy of Hunter Goatley). + +Frequently asked questions on zip and unzip: + +Q. When unzipping I get an error message about "compression method 8". + +A. Please get the latest version of unzip. See the file 'WHERE' for details. + + +Q. I can't extract this zip file that I just downloaded. I get + "zipfile is part of multi-disk archive" or some other message. + +A. Please make sure that you made the transfer in binary mode. Check + in particular that your copy has exactly the same size as the original. + + +Q. When running unzip, I get a message about "End-of-central-directory + signature not found". + +A. This usually means that your zip archive is damaged, or that you + have an uncompressed file with the same name in the same directory. + In the first case, it makes more sense to contact the person you + obtained the zip file from rather than the Info-ZIP software + developers, and to make sure that your copy is strictly identical to + the original. In the second case, use "unzip zipfile.zip" instead + of "unzip zipfile", to let unzip know which file is the zip archive + you want to extract. + + +Q. Why doesn't zip do just like PKZIP does? + +A. Zip is not a PKZIP clone and is not intended to be one. In some + cases we feel PKZIP does not do the right thing (e.g., not + including pathnames by default); in some cases the operating system + itself is responsible (e.g., under Unix it is the shell which + expands wildcards, not zip). Info-ZIP's and PKWARE's zipfiles + are interchangeable, not the programs. + + For example, if you are used to the following PKZIP command: + pkzip -rP foo *.c + you must use instead on Unix: + zip -R foo '*.c' + (the singled quotes are needed to let the shell know that it should + not expand the *.c argument but instead pass it on to the program) + + +Q. Can I distribute zip and unzip sources and/or executables? + +A. You may redistribute the latest official distributions without any + modification, without even asking us for permission. You can charge + for the cost of the media (CDROM, diskettes, etc...) and a small copying + fee. If you want to distribute modified versions please contact us at + zip-bugs@lists.wku.edu first. You must not distribute beta versions. + The latest official distributions are always on ftp.uu.net in directory + /pub/archiving/zip and subdirectories. + + +Q. Can I use the executables of zip and unzip to distribute my software? + +A. Yes, so long as it is made clear in the product documentation that + zip or unzip are not being sold, that the source code is freely + available, and that there are no extra or hidden charges resulting + from its use by or inclusion with the commercial product. Here is + an example of a suitable notice: + + NOTE: is packaged on this CD using Info-ZIP's compression + utility. The installation program uses UnZip to read zip files from + the CD. Info-ZIP's software (Zip, UnZip and related utilities) is + free and can be obtained as source code or executables from various + anonymous-ftp sites, including ftp.uu.net:/pub/archiving/zip/*. + + +Q. Can I use the source code of zip and unzip in my commercial application? + +A. Yes, so long as you include in your product an acknowledgment and an + offer of the original compression sources for free or for a small + copying fee, and make clear that there are no extra or hidden charges + resulting from the use of the compression code by your product. In other + words, you are allowed to sell only your own work, not ours. If you have + special requirements contact us at zip-bugs@lists.wku.edu. diff -Nru boinc-7.0.7+dfsg/zip/zip/revision.h boinc-7.0.14+dfsg/zip/zip/revision.h --- boinc-7.0.7+dfsg/zip/zip/revision.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/revision.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,105 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * revision.h by Mark Adler. + */ + +#ifndef __revision_h +#define __revision_h 1 + +/* For api version checking */ +#define Z_MAJORVER 2 +#define Z_MINORVER 3 +#define Z_PATCHLEVEL 0 +#define Z_BETALEVEL "" + +#define VERSION "2.3" +#define REVDATE "November 29th 1999" + +#define DW_MAJORVER Z_MAJORVER +#define DW_MINORVER Z_MINORVER +#define DW_PATCHLEVEL Z_PATCHLEVEL + +#ifndef WINDLL +/* Copyright notice for binary executables--this notice only applies to + * those (zip, zipcloak, zipsplit, and zipnote), not to this file + * (revision.h). + */ + +#ifndef DEFCPYRT /* copyright[] gets defined only once ! */ +extern ZCONST char *copyright[2]; /* keep array sizes in sync with number */ +extern ZCONST char *swlicense[40]; /* of text line in definition below !! */ +extern ZCONST char *versinfolines[7]; + +#else /* DEFCPYRT */ + +ZCONST char *copyright[] = { +"Copyright (C) 1990-1999 Info-ZIP", +"Type '%s \"-L\"' for software license." +/* XXX still necessary ???? */ +#ifdef AZTEC_C +, /* extremely lame compiler bug workaround */ +#endif +}; + +ZCONST char *versinfolines[] = { +"This is %s %s (%s), by Info-ZIP.", +"Currently maintained by Onno van der Linden. Please send bug reports to", +"the authors at Zip-Bugs@lists.wku.edu; see README for details.", +"", +"Latest sources and executables are at ftp://ftp.cdrom.com/pub/infozip, as of", +"above date; see http://www.cdrom.com/pub/infozip/Zip.html for other sites.", +"" +}; + +ZCONST char *swlicense[] = { +"Copyright (c) 1990-1999 Info-ZIP. All rights reserved.", +"", +"For the purposes of this copyright and license, \"Info-ZIP\" is defined as", +"the following set of individuals:", +"", +" Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,", +" Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase,", +" Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum,", +" Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller,", +" Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel,", +" Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen,", +" Paul von Behren, Rich Wales, Mike White", +"", +"This software is provided \"as is,\" without warranty of any kind, express", +"or implied. In no event shall Info-ZIP or its contributors be held liable", +"for any direct, indirect, incidental, special or consequential damages", +"arising out of the use of or inability to use this software.", +"", +"Permission is granted to anyone to use this software for any purpose,", +"including commercial applications, and to alter it and redistribute it", +"freely, subject to the following restrictions:", +"", +" 1. Redistributions of source code must retain the above copyright notice,", +" definition, disclaimer, and this list of conditions.", +"", +" 2. Redistributions in binary form must reproduce the above copyright", +" notice, definition, disclaimer, and this list of conditions in", +" documentation and/or other materials provided with the distribution.", +"", +" 3. Altered versions--including, but not limited to, ports to new operating", +" systems, existing ports with new graphical interfaces, and dynamic,", +" shared, or static library versions--must be plainly marked as such", +" and must not be misrepresented as being the original source. Such", +" altered versions also must not be misrepresented as being Info-ZIP", +" releases--including, but not limited to, labeling of the altered", +" versions with the names \"Info-ZIP\" (or any variation thereof, including,", +" but not limited to, different capitalizations), \"Pocket UnZip,\" \"WiZ\"", +" or \"MacZip\" without the explicit permission of Info-ZIP. Such altered", +" versions are further prohibited from misrepresentative use of the", +" Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s).", +}; +#endif /* DEFCPYRT */ +#endif /* !WINDLL */ +#endif /* !__revision_h */ diff -Nru boinc-7.0.7+dfsg/zip/zip/tailor.h boinc-7.0.14+dfsg/zip/zip/tailor.h --- boinc-7.0.7+dfsg/zip/zip/tailor.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/tailor.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,466 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifdef AMIGA +#include "amiga/osdep.h" +#endif + +#ifdef AOSVS +#include "aosvs/osdep.h" +#endif + +#ifdef ATARI +#include "atari/osdep.h" +#endif + +#ifdef __BEOS__ +#include "beos/osdep.h" +#endif + +#ifdef DOS +#include "msdos/osdep.h" +#endif + +#ifdef __human68k__ +#include "human68k/osdep.h" +#endif + +#if ((defined(__MWERKS__) && defined(macintosh)) || defined(MACOS)) +#include "macos/osdep.h" +#endif + +#ifdef OS2 +#include "os2/osdep.h" +#endif + +#ifdef __riscos +#include "acorn/osdep.h" +#endif + +#ifdef QDOS +#include "qdos/osdep.h" +#endif + +#ifdef __TANDEM +#include "tandem.h" +#include "tanzip.h" +#endif + +#ifdef UNIX +#include "unix/osdep.h" +#endif + +#if defined(__COMPILER_KCC__) || defined(TOPS20) +#include "tops20/osdep.h" +#endif + +#if defined(VMS) || defined(__VMS) +#include "vms/osdep.h" +#endif + +#if defined(__VM__) || defined(VM_CMS) || defined(MVS) +#include "cmsmvs.h" +#endif + +#ifdef WIN32 +#include "win32/osdep.h" +#endif + +#ifdef THEOS +#include "theos/osdep.h" +#endif + +#if (defined(USE_ZLIB) && defined(ASM_CRC)) +# undef ASM_CRC +#endif + +#if (defined(USE_ZLIB) && defined(ASMV)) +# undef ASMV +#endif + +/* When "void" is an alias for "int", prototypes cannot be used. */ +#if (defined(NO_VOID) && !defined(NO_PROTO)) +# define NO_PROTO +#endif + +/* Used to remove arguments in function prototypes for non-ANSI C */ +#ifndef NO_PROTO +# define OF(a) a +#else /* NO_PROTO */ +# define OF(a) () +#endif /* ?NO_PROTO */ + +/* If the compiler can't handle const define ZCONST in osdep.h */ +/* Define const itself in case the system include files are bonkers */ +#ifndef ZCONST +# ifdef NO_CONST +# define ZCONST +# define const +# else +# define ZCONST const +# endif +#endif + +/* + * case mapping functions. case_map is used to ignore case in comparisons, + * to_up is used to force upper case even on Unix (for dosify option). + */ +#ifdef USE_CASE_MAP +# define case_map(c) upper[(c) & 0xff] +# define to_up(c) upper[(c) & 0xff] +#else +# define case_map(c) (c) +# define to_up(c) ((c) >= 'a' && (c) <= 'z' ? (c)-'a'+'A' : (c)) +#endif /* USE_CASE_MAP */ + +/* Define void, zvoid, and extent (size_t) */ +#include + +#ifndef NO_STDDEF_H +# include +#endif /* !NO_STDDEF_H */ + +#ifndef NO_STDLIB_H +# include +#endif /* !NO_STDLIB_H */ + +#ifndef NO_UNISTD_H +# include /* usually defines _POSIX_VERSION */ +#endif /* !NO_UNISTD_H */ + +#ifndef NO_FCNTL_H +# include +#endif /* !NO_FNCTL_H */ + +#ifndef NO_STRING_H +# include +#else +# include +#endif /* NO_STRING_H */ + +#ifdef NO_VOID +# define void int + typedef char zvoid; +#else /* !NO_VOID */ +# ifdef NO_TYPEDEF_VOID +# define zvoid void +# endif +#endif /* ?NO_VOID */ + +#ifdef NO_STRRCHR +# define strrchr rindex +#endif + +#ifdef NO_STRCHR +# define strchr index +#endif + +/* + * A couple of forward declarations that are needed on systems that do + * not supply C runtime library prototypes. + */ +#ifdef NO_PROTO +char *strcpy(); +char *strcat(); +char *strrchr(); +/* XXX use !defined(ZMEM) && !defined(__hpux__) ? */ +#if !defined(ZMEM) && defined(NO_STRING_H) +char *memset(); +char *memcpy(); +#endif /* !ZMEM && NO_STRING_H */ + +/* XXX use !defined(__hpux__) ? */ +#ifdef NO_STDLIB_H +char *calloc(); +char *malloc(); +char *getenv(); +long atol(); +#endif /* NO_STDLIB_H */ + +#endif /* NO_PROTO */ + +#ifndef NO_MKTEMP +char *mktemp(); +#endif /* !NO_MKTEMP */ + +/* + * SEEK_* macros, should be defined in stdio.h + */ +/* Define fseek() commands */ +#ifndef SEEK_SET +# define SEEK_SET 0 +#endif /* !SEEK_SET */ + +#ifndef SEEK_CUR +# define SEEK_CUR 1 +#endif /* !SEEK_CUR */ + +#ifndef FALSE +# define FALSE 0 +#endif + +#ifndef TRUE +# define TRUE 1 +#endif + +#ifdef NO_SIZE_T + typedef unsigned int extent; +#else + typedef size_t extent; +#endif + +#ifdef NO_TIME_T + typedef long time_t; +#endif + +/* DBCS support for Info-ZIP's zip (mainly for japanese (-: ) + * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) + * This code is public domain! Date: 1998/12/20 + */ +#ifdef _MBCS +# include + + /* Multi Byte Character Set */ + extern char *___tmp_ptr; + unsigned char *zmbschr OF((ZCONST unsigned char *, unsigned int)); + unsigned char *zmbsrchr OF((ZCONST unsigned char *, unsigned int)); +# define CLEN(ptr) mblen(ptr, MB_CUR_MAX) +# define PREINCSTR(ptr) (ptr += CLEN(ptr)) +# define POSTINCSTR(ptr) (___tmp_ptr=(char *)ptr,ptr += CLEN(ptr),___tmp_ptr) + int lastchar OF((ZCONST char *ptr)); +# define MBSCHR(str,c) (char *)zmbschr((ZCONST unsigned char *)(str), c) +# define MBSRCHR(str,c) (char *)zmbsrchr((ZCONST unsigned char *)(str), (c)) +# define SETLOCALE(category, locale) setlocale(category, locale) +#else /* !_MBCS */ +# define CLEN(ptr) 1 +# define PREINCSTR(ptr) (++(ptr)) +# define POSTINCSTR(ptr) ((ptr)++) +# define lastchar(ptr) ((*(ptr)=='\0') ? '\0' : ptr[strlen(ptr)-1]) +# define MBSCHR(str, c) strchr(str, c) +# define MBSRCHR(str, c) strrchr(str, c) +# define SETLOCALE(category, locale) +#endif /* ?_MBCS */ +#define INCSTR(ptr) PREINCSTR(ptr) + + +/* System independent replacement for "struct utimbuf", which is missing + * in many older OS environments. + */ +typedef struct ztimbuf { + time_t actime; /* new access time */ + time_t modtime; /* new modification time */ +} ztimbuf; + +/* This macro round a time_t value to the OS specific resolution */ +#ifndef ROUNDED_TIME +# define ROUNDED_TIME(time) (time) +#endif + +/* Some systems define S_IFLNK but do not support symbolic links */ +#if defined (S_IFLNK) && defined(NO_SYMLINK) +# undef S_IFLNK +#endif + +#ifndef FOPR /* fallback default definitions for FOPR, FOPM, FOPW: */ +# define FOPR "r" +# define FOPM "r+" +# define FOPW "w" +#endif /* fallback definition */ + +#ifndef FOPW_TMP /* fallback default for opening writable temp files */ +# define FOPW_TMP FOPW +#endif + +/* Open the old zip file in exclusive mode if possible (to avoid adding + * zip file to itself). + */ +#ifdef OS2 +# define FOPR_EX FOPM +#else +# define FOPR_EX FOPR +#endif + + +/* MSDOS file or directory attributes */ +#define MSDOS_HIDDEN_ATTR 0x02 +#define MSDOS_DIR_ATTR 0x10 + + +/* Define this symbol if your target allows access to unaligned data. + * This is not mandatory, just a speed optimization. The compressed + * output is strictly identical. + */ +#if (defined(MSDOS) && !defined(WIN32)) || defined(i386) +# define UNALIGNED_OK +#endif +#if defined(mc68020) || defined(vax) +# define UNALIGNED_OK +#endif + +#if (defined(SMALL_MEM) && !defined(CBSZ)) +# define CBSZ 2048 /* buffer size for copying files */ +# define ZBSZ 2048 /* buffer size for temporary zip file */ +#endif + +#if (defined(MEDIUM_MEM) && !defined(CBSZ)) +# define CBSZ 8192 +# define ZBSZ 8192 +#endif + +#ifndef CBSZ +# define CBSZ 16384 +# define ZBSZ 16384 +#endif + +#ifndef SBSZ +# define SBSZ CBSZ /* copy buf size for STORED entries, see zipup() */ +#endif + +#ifndef MEMORY16 +# ifdef __WATCOMC__ +# undef huge +# undef far +# undef near +# endif +# ifdef THEOS +# undef far +# undef near +# endif +# if (!defined(__IBMC__) || !defined(OS2)) +# ifndef huge +# define huge +# endif +# ifndef far +# define far +# endif +# ifndef near +# define near +# endif +# endif +# define nearmalloc malloc +# define nearfree free +# define farmalloc malloc +# define farfree free +#endif /* !MEMORY16 */ + +#ifndef Far +# define Far far +#endif + +#if (defined(BIG_MEM) || defined(MMAP)) && !defined(DYN_ALLOC) +# define DYN_ALLOC +#endif + +#ifndef SSTAT +# define SSTAT stat +#endif +#ifdef S_IFLNK +# define LSTAT lstat +# define LSSTAT(n, s) (linkput ? lstat((n), (s)) : SSTAT((n), (s))) +#else +# define LSTAT SSTAT +# define LSSTAT SSTAT +#endif + +/* The following default definition of the second input for the crypthead() + * random seed computation can be used on most systems (all those that + * supply a UNIX compatible getpid() function). + */ +#ifdef ZCRYPT_INTERNAL +# ifndef ZCR_SEED2 +# define ZCR_SEED2 (unsigned) getpid() /* use PID as seed pattern */ +# endif +#endif /* ZCRYPT_INTERNAL */ + +/* The following OS codes are defined in pkzip appnote.txt */ +#ifdef AMIGA +# define OS_CODE 0x100 +#endif +#ifdef VMS +# define OS_CODE 0x200 +#endif +/* unix 3 */ +#ifdef VM_CMS +# define OS_CODE 0x400 +#endif +#ifdef ATARI +# define OS_CODE 0x500 +#endif +#ifdef OS2 +# define OS_CODE 0x600 +#endif +#ifdef MACOS +# define OS_CODE 0x700 +#endif +/* z system 8 */ +/* cp/m 9 */ +#ifdef TOPS20 +# define OS_CODE 0xa00 +#endif +#ifdef WIN32 +# define OS_CODE 0xb00 +#endif +#ifdef QDOS +# define OS_CODE 0xc00 +#endif +#ifdef RISCOS +# define OS_CODE 0xd00 +#endif +#ifdef VFAT +# define OS_CODE 0xe00 +#endif +#ifdef MVS +# define OS_CODE 0xf00 +#endif +#ifdef __BEOS__ +# define OS_CODE 0x1000 +#endif +#ifdef TANDEM +# define OS_CODE 0x1100 +#endif +#ifdef THEOS +# define OS_CODE 0x1200 +#endif + +#define NUM_HOSTS 19 +/* Number of operating systems. Should be updated when new ports are made */ + +#if defined(DOS) && !defined(OS_CODE) +# define OS_CODE 0x000 +#endif + +#ifndef OS_CODE +# define OS_CODE 0x300 /* assume Unix */ +#endif + +/* can't use "return 0" from main() on VMS */ +#ifndef EXIT +//# define EXIT exit +# define EXIT ziperr +#endif +#ifndef RETURN +# define RETURN return +#endif + +#ifndef ZIPERR +# define ZIPERR ziperr +#endif + +#if (defined(USE_ZLIB) && defined(MY_ZCALLOC)) + /* special zcalloc function is not needed when linked against zlib */ +# undef MY_ZCALLOC +#endif + +#if (!defined(USE_ZLIB) && !defined(MY_ZCALLOC)) + /* Any system without a special calloc function */ +# define zcalloc(items,size) \ + (zvoid far *)calloc((unsigned)(items), (unsigned)(size)) +# define zcfree free +#endif /* !USE_ZLIB && !MY_ZCALLOC */ + +/* end of tailor.h */ diff -Nru boinc-7.0.7+dfsg/zip/zip/TODO boinc-7.0.14+dfsg/zip/zip/TODO --- boinc-7.0.7+dfsg/zip/zip/TODO 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/TODO 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,69 @@ + +Main features still missing for next official version: + +- use install in unix/Makefile instead of mkdir -p, look at install sh script. +- #elif for those ports that can handle it. +- what about zopen vs. fopen ? +- Add zcreate or zfcreate for win32. +- Assembler stuff in match.S (subexpressions) +- zipping huge files (> 2G, unsigned 32bit) +- Testsuite for zip and unzip (John D. Mitchell) +- make a version.c or version.h that includes all the compiler names +- run utils with dmalloc(). +- what to do with zip -F and zip -FF (readzipfile2()) ? +- profiling of the code +- multi disk zip files +- zipfile modification tool (Greg) +- Implement -- option (Thomas Klauser, wiz@danbala.tuwien.ac.at) +- don't add files with "Archive bit " + or add files with "Archive bit " (uwe.becher@metronet.de) +- 32 bit file attributes +- generate output without having to seek at all +- remove contractions from zip error messages, make them clearer (Steve) +- display "[text]" for ascii files when not quiet (no -q) (Timo Salmi) +- does zipnote accept names with version number? +- for a WORM, zip should create temp file only when updating; new archives + should be created directly. +- APPNOTE.TXT specifies "4) The entries in the central directory may + not necessarily be in the same order that files appear in the zipfile" + but readzipfile() relies on same order. +- on Mac, MPW C 3.3.1 requires #if (a || b) ["#if a || b" taken as "#if a"] +- on Unix, let -S be "include non-regular files without reading from them" + (as pkzip on Unix). This requires unzip support. +- zip -l should do ebcdic->ascii translation on CMS and MVS +- zip as subroutine (zdig/241) +- accept k and M in zipsplit +- store / (part of file name) as ! in OS/2 (problem only with -E ?) + +Known bugs: + +- On VMS, zip fails reading some files with "byte record too large for + user's buffer". You must use the "-V" option for such files. + +- on MSDOS, zip386.exe does not like "zip -bc: foo ..." + +- on MSDOS, zip386.exe is sometimes much slower than zip.exe. This is + probably a problem with DJGPP (to be investigated). + +- on NT with C shell, zip should not do file name expansion again. + +- zip zipfile ... ignores existing zipfile if name does not have an extension + (except for the -A option, generally used on self-extracting files). + +- For an sfx file without extension, "zip -A sfx" works but "zip sfx -A" + doesn't. + +- When storing files in a zipfile (-0), zip marks all of them as binary. + +- On VMS, some indexed files are not restored correctly after zip -V and unzip. + (This is now known to be a problem of UnZip. The workaround for Zip 2.2 + and newer is to use PK-style VMS extra fields; this is now the default. + NOTE that UnZip 5.32 has been fixed [971019]!) + +- zip and unzip should use the same pattern matching rules, particularly + on MSDOS and OS/2. On OS/2, "zip foo *.*" should also match files + without extension. + Partially DONE (OS/2 "*.*" matches "*".) + +- there should be a way to avoid updating archive members (only addition + of new files allowed) diff -Nru boinc-7.0.7+dfsg/zip/zip/trees.c boinc-7.0.14+dfsg/zip/zip/trees.c --- boinc-7.0.7+dfsg/zip/zip/trees.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/trees.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1366 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * trees.c by Jean-loup Gailly + * + * This is a new version of im_ctree.c originally written by Richard B. Wales + * for the defunct implosion method. + * The low level bit string handling routines from bits.c (originally + * im_bits.c written by Richard B. Wales) have been merged into this version + * of trees.c. + * + * PURPOSE + * + * Encode various sets of source values using variable-length + * binary code trees. + * Output the resulting variable-length bit strings. + * Compression can be done to a file or to memory. + * + * DISCUSSION + * + * The PKZIP "deflation" process uses several Huffman trees. The more + * common source values are represented by shorter bit sequences. + * + * Each code tree is stored in the ZIP file in a compressed form + * which is itself a Huffman encoding of the lengths of + * all the code strings (in ascending order by source values). + * The actual code strings are reconstructed from the lengths in + * the UNZIP process, as described in the "application note" + * (APPNOTE.TXT) distributed as part of PKWARE's PKZIP program. + * + * The PKZIP "deflate" file format interprets compressed file data + * as a sequence of bits. Multi-bit strings in the file may cross + * byte boundaries without restriction. + * The first bit of each byte is the low-order bit. + * + * The routines in this file allow a variable-length bit value to + * be output right-to-left (useful for literal values). For + * left-to-right output (useful for code strings from the tree routines), + * the bits must have been reversed first with bi_reverse(). + * + * For in-memory compression, the compressed bit stream goes directly + * into the requested output buffer. The buffer is limited to 64K on + * 16 bit machines; flushing of the output buffer during compression + * process is not supported. + * The input data is read in blocks by the (*read_buf)() function. + * + * For more details about input to and output from the deflation routines, + * see the actual input functions for (*read_buf)(), flush_outbuf(), and + * the filecompress() resp. memcompress() wrapper functions which handle + * the I/O setup. + * + * REFERENCES + * + * Lynch, Thomas J. + * Data Compression: Techniques and Applications, pp. 53-55. + * Lifetime Learning Publications, 1985. ISBN 0-534-03418-7. + * + * Storer, James A. + * Data Compression: Methods and Theory, pp. 49-50. + * Computer Science Press, 1988. ISBN 0-7167-8156-5. + * + * Sedgewick, R. + * Algorithms, p290. + * Addison-Wesley, 1983. ISBN 0-201-06672-6. + * + * INTERFACE + * + * void ct_init (ush *attr, int *method) + * Allocate the match buffer, initialize the various tables and save + * the location of the internal file attribute (ascii/binary) and + * method (DEFLATE/STORE) + * + * void ct_tally (int dist, int lc); + * Save the match info and tally the frequency counts. + * + * ulg flush_block (char *buf, ulg stored_len, int eof) + * Determine the best encoding for the current block: dynamic trees, + * static trees or store, and output the encoded block to the zip + * file. Returns the total compressed length for the file so far. + * + * void bi_init (char *tgt_buf, unsigned tgt_size, int flsh_allowed) + * Initialize the bit string routines. + * + * Most of the bit string output functions are only used internally + * in this source file, they are normally declared as "local" routines: + * + * local void send_bits (int value, int length) + * Write out a bit string, taking the source bits right to + * left. + * + * local unsigned bi_reverse (unsigned code, int len) + * Reverse the bits of a bit string, taking the source bits left to + * right and emitting them right to left. + * + * local void bi_windup (void) + * Write out any remaining bits in an incomplete byte. + * + * local void copy_block(char *buf, unsigned len, int header) + * Copy a stored block to the zip file, storing first the length and + * its one's complement if requested. + * + * All output that exceeds the bitstring output buffer size (as initialized + * by bi_init() is fed through an externally provided transfer routine + * which flushes the bitstring output buffer on request and resets the + * buffer fill counter: + * + * extern void flush_outbuf(char *o_buf, unsigned *o_idx); + * + */ +#define __TREES_C + +#include +#include "zip.h" + +#ifndef USE_ZLIB + +/* =========================================================================== + * Constants + */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define END_BLOCK 256 +/* end of block literal code */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + + +local int near extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +local int near extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +local int near extra_blbits[BL_CODES]/* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#ifndef LIT_BUFSIZE +# ifdef SMALL_MEM +# define LIT_BUFSIZE 0x2000 +# else +# ifdef MEDIUM_MEM +# define LIT_BUFSIZE 0x4000 +# else +# define LIT_BUFSIZE 0x8000 +# endif +# endif +#endif +#define DIST_BUFSIZE LIT_BUFSIZE +/* Sizes of match buffers for literals/lengths and distances. There are + * 4 reasons for limiting LIT_BUFSIZE to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input data is + * still in the window so we can still emit a stored block even when input + * comes from standard input. (This can also be done for all blocks if + * LIT_BUFSIZE is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting trees + * more frequently. + * - I can't count above 4 + * The current code is general and allows DIST_BUFSIZE < LIT_BUFSIZE (to save + * memory at the expense of compression). Some optimizations would be possible + * if we rely on DIST_BUFSIZE == LIT_BUFSIZE. + */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_10 17 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* =========================================================================== + * Local data + */ + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +local ct_data near dyn_ltree[HEAP_SIZE]; /* literal and length tree */ +local ct_data near dyn_dtree[2*D_CODES+1]; /* distance tree */ + +local ct_data near static_ltree[L_CODES+2]; +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see ct_init + * below). + */ + +local ct_data near static_dtree[D_CODES]; +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +local ct_data near bl_tree[2*BL_CODES+1]; +/* Huffman tree for the bit lengths */ + +typedef struct tree_desc { + ct_data near *dyn_tree; /* the dynamic tree */ + ct_data near *static_tree; /* corresponding static tree or NULL */ + int near *extra_bits; /* extra bits for each code or NULL */ + int extra_base; /* base index for extra_bits */ + int elems; /* max number of elements in the tree */ + int max_length; /* max bit length for the codes */ + int max_code; /* largest code with non zero frequency */ +} tree_desc; + +local tree_desc near l_desc = +{dyn_ltree, static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS, 0}; + +local tree_desc near d_desc = +{dyn_dtree, static_dtree, extra_dbits, 0, D_CODES, MAX_BITS, 0}; + +local tree_desc near bl_desc = +{bl_tree, NULL, extra_blbits, 0, BL_CODES, MAX_BL_BITS, 0}; + + +local ush near bl_count[MAX_BITS+1]; +/* number of codes at each bit length for an optimal tree */ + +local uch near bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +local int near heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ +local int heap_len; /* number of elements in the heap */ +local int heap_max; /* element of largest frequency */ +/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + +local uch near depth[2*L_CODES+1]; +/* Depth of each subtree used as tie breaker for trees of equal frequency */ + +local uch length_code[MAX_MATCH-MIN_MATCH+1]; +/* length code for each normalized match length (0 == MIN_MATCH) */ + +local uch dist_code[512]; +/* distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +local int near base_length[LENGTH_CODES]; +/* First normalized length for each code (0 = MIN_MATCH) */ + +local int near base_dist[D_CODES]; +/* First normalized distance for each code (0 = distance of 1) */ + +#ifndef DYN_ALLOC + local uch far l_buf[LIT_BUFSIZE]; /* buffer for literals/lengths */ + local ush far d_buf[DIST_BUFSIZE]; /* buffer for distances */ +#else + local uch far *l_buf; + local ush far *d_buf; +#endif + +local uch near flag_buf[(LIT_BUFSIZE/8)]; +/* flag_buf is a bit array distinguishing literals from lengths in + * l_buf, and thus indicating the presence or absence of a distance. + */ + +local unsigned last_lit; /* running index in l_buf */ +local unsigned last_dist; /* running index in d_buf */ +local unsigned last_flags; /* running index in flag_buf */ +local uch flags; /* current flags not yet saved in flag_buf */ +local uch flag_bit; /* current bit used in flags */ +/* bits are filled in flags starting at bit 0 (least significant). + * Note: these flags are overkill in the current code since we don't + * take advantage of DIST_BUFSIZE == LIT_BUFSIZE. + */ + +local ulg opt_len; /* bit length of current block with optimal trees */ +local ulg static_len; /* bit length of current block with static trees */ + +local ulg cmpr_bytelen; /* total byte length of compressed file */ +local ulg cmpr_len_bits; /* number of bits past 'cmpr_bytelen' */ + +#ifdef DEBUG +local ulg input_len; /* total byte length of input file */ +/* input_len is for debugging only since we can get it by other means. */ +#endif + +local ush *file_type; /* pointer to UNKNOWN, BINARY or ASCII */ +local int *file_method; /* pointer to DEFLATE or STORE */ + +/* =========================================================================== + * Local data used by the "bit string" routines. + */ + +local int flush_flg; + +#if (!defined(ASMV) || !defined(RISCOS)) +local unsigned bi_buf; +#else +unsigned bi_buf; +#endif +/* Output buffer. bits are inserted starting at the bottom (least significant + * bits). The width of bi_buf must be at least 16 bits. + */ + +#define Buf_size (8 * 2*sizeof(char)) +/* Number of bits used within bi_buf. (bi_buf may be implemented on + * more than 16 bits on some systems.) + */ + +#if (!defined(ASMV) || !defined(RISCOS)) +local int bi_valid; +#else +int bi_valid; +#endif +/* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + +#if (!defined(ASMV) || !defined(RISCOS)) +local char *out_buf; +#else +char *out_buf; +#endif +/* Current output buffer. */ + +#if (!defined(ASMV) || !defined(RISCOS)) +local unsigned out_offset; +#else +unsigned out_offset; +#endif +/* Current offset in output buffer. + * On 16 bit machines, the buffer is limited to 64K. + */ + +#if !defined(ASMV) || !defined(RISCOS) +local unsigned out_size; +#else +unsigned out_size; +#endif +/* Size of current output buffer */ + +/* Output a 16 bit value to the bit stream, lower (oldest) byte first */ +#define PUTSHORT(w) \ +{ if (out_offset >= out_size-1) \ + flush_outbuf(out_buf, &out_offset); \ + out_buf[out_offset++] = (char) ((w) & 0xff); \ + out_buf[out_offset++] = (char) ((ush)(w) >> 8); \ +} + +#define PUTBYTE(b) \ +{ if (out_offset >= out_size) \ + flush_outbuf(out_buf, &out_offset); \ + out_buf[out_offset++] = (char) (b); \ +} + +#ifdef DEBUG +local ulg bits_sent; /* bit length of the compressed data */ +extern ulg isize; /* byte length of input file */ +#endif + +extern long block_start; /* window offset of current block */ +extern unsigned near strstart; /* window offset of current string */ + + +/* =========================================================================== + * Local (static) routines in this file. + */ + +local void init_block OF((void)); +local void pqdownheap OF((ct_data near *tree, int k)); +local void gen_bitlen OF((tree_desc near *desc)); +local void gen_codes OF((ct_data near *tree, int max_code)); +local void build_tree OF((tree_desc near *desc)); +local void scan_tree OF((ct_data near *tree, int max_code)); +local void send_tree OF((ct_data near *tree, int max_code)); +local int build_bl_tree OF((void)); +local void send_all_trees OF((int lcodes, int dcodes, int blcodes)); +local void compress_block OF((ct_data near *ltree, ct_data near *dtree)); +local void set_file_type OF((void)); +#if (!defined(ASMV) || !defined(RISCOS)) +local void send_bits OF((int value, int length)); +local unsigned bi_reverse OF((unsigned code, int len)); +#endif +local void bi_windup OF((void)); +local void copy_block OF((char *buf, unsigned len, int header)); + + +#ifndef DEBUG +# define send_code(c, tree) send_bits(tree[c].Code, tree[c].Len) + /* Send a code of the given tree. c and tree must not have side effects */ + +#else /* DEBUG */ +# define send_code(c, tree) \ + { if (verbose>1) fprintf(stderr,"\ncd %3d ",(c)); \ + send_bits(tree[c].Code, tree[c].Len); } +#endif + +#define d_code(dist) \ + ((dist) < 256 ? dist_code[dist] : dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. dist_code[256] and dist_code[257] are never + * used. + */ + +#define Max(a,b) (a >= b ? a : b) +/* the arguments must not have side effects */ + +/* =========================================================================== + * Allocate the match buffer, initialize the various tables and save the + * location of the internal file attribute (ascii/binary) and method + * (DEFLATE/STORE). + */ +void ct_init(attr, method) + ush *attr; /* pointer to internal file attribute */ + int *method; /* pointer to compression method */ +{ + int n; /* iterates over tree elements */ + int bits; /* bit counter */ + int length; /* length value */ + int code; /* code value */ + int dist; /* distance index */ + + file_type = attr; + file_method = method; + cmpr_bytelen = cmpr_len_bits = 0L; +#ifdef DEBUG + input_len = 0L; +#endif + + if (static_dtree[0].Len != 0) return; /* ct_init already called */ + +#ifdef DYN_ALLOC + d_buf = (ush far *) zcalloc(DIST_BUFSIZE, sizeof(ush)); + l_buf = (uch far *) zcalloc(LIT_BUFSIZE/2, 2); + /* Avoid using the value 64K on 16 bit machines */ + if (l_buf == NULL || d_buf == NULL) + ziperr(ZE_MEM, "ct_init: out of memory"); +#endif + + /* Initialize the mapping length (0..255) -> length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES-1; code++) { + base_length[code] = length; + for (n = 0; n < (1< dist code (0..29) */ + dist = 0; + for (code = 0 ; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ + for ( ; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + dist_code[256 + dist++] = (uch)code; + } + } + Assert(dist == 256, "ct_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; + n = 0; + while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; + while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; + while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; + while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes((ct_data near *)static_ltree, L_CODES+1); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n].Len = 5; + static_dtree[n].Code = (ush)bi_reverse(n, 5); + } + + /* Initialize the first block of the first file: */ + init_block(); +} + +/* =========================================================================== + * Initialize a new block. + */ +local void init_block() +{ + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) bl_tree[n].Freq = 0; + + dyn_ltree[END_BLOCK].Freq = 1; + opt_len = static_len = 0L; + last_lit = last_dist = last_flags = 0; + flags = 0; flag_bit = 1; +} + +#define SMALLEST 1 +/* Index within the heap array of least frequent node in the Huffman tree */ + + +/* =========================================================================== + * Remove the smallest element from the heap and recreate the heap with + * one less element. Updates heap and heap_len. + */ +#define pqremove(tree, top) \ +{\ + top = heap[SMALLEST]; \ + heap[SMALLEST] = heap[heap_len--]; \ + pqdownheap(tree, SMALLEST); \ +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +#define smaller(tree, n, m) \ + (tree[n].Freq < tree[m].Freq || \ + (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +local void pqdownheap(tree, k) + ct_data near *tree; /* the tree to restore */ + int k; /* node to move down */ +{ + int v = heap[k]; + int j = k << 1; /* left son of k */ + int htemp; /* required because of bug in SASC compiler */ + + while (j <= heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < heap_len && smaller(tree, heap[j+1], heap[j])) j++; + + /* Exit if v is smaller than both sons */ + htemp = heap[j]; + if (smaller(tree, v, htemp)) break; + + /* Exchange v with the smallest son */ + heap[k] = htemp; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + heap[k] = v; +} + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +local void gen_bitlen(desc) + tree_desc near *desc; /* the tree descriptor */ +{ + ct_data near *tree = desc->dyn_tree; + int near *extra = desc->extra_bits; + int base = desc->extra_base; + int max_code = desc->max_code; + int max_length = desc->max_length; + ct_data near *stree = desc->static_tree; + int h; /* heap index */ + int n, m; /* iterate over the tree elements */ + int bits; /* bit length */ + int xbits; /* extra bits */ + ush f; /* frequency */ + int overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[heap[heap_max]].Len = 0; /* root of the heap */ + + for (h = heap_max+1; h < HEAP_SIZE; h++) { + n = heap[h]; + bits = tree[tree[n].Dad].Len + 1; + if (bits > max_length) bits = max_length, overflow++; + tree[n].Len = (ush)bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) continue; /* not a leaf node */ + + bl_count[bits]++; + xbits = 0; + if (n >= base) xbits = extra[n-base]; + f = tree[n].Freq; + opt_len += (ulg)f * (bits + xbits); + if (stree) static_len += (ulg)f * (stree[n].Len + xbits); + } + if (overflow == 0) return; + + Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length-1; + while (bl_count[bits] == 0) bits--; + bl_count[bits]--; /* move one leaf down the tree */ + bl_count[bits+1] += (ush)2; /* move one overflow item as its brother */ + bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits != 0; bits--) { + n = bl_count[bits]; + while (n != 0) { + m = heap[--h]; + if (m > max_code) continue; + if (tree[m].Len != (ush)bits) { + Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + opt_len += ((long)bits-(long)tree[m].Len)*(long)tree[m].Freq; + tree[m].Len = (ush)bits; + } + n--; + } + } +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +local void gen_codes (tree, max_code) + ct_data near *tree; /* the tree to decorate */ + int max_code; /* largest code with non zero frequency */ +{ + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + ush code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (ush)((code + bl_count[bits-1]) << 1); + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert(code + bl_count[MAX_BITS]-1 == (1<< ((ush) MAX_BITS)) - 1, + "inconsistent bit counts"); + Tracev((stderr,"\ngen_codes: max_code %d ", max_code)); + + for (n = 0; n <= max_code; n++) { + int len = tree[n].Len; + if (len == 0) continue; + /* Now reverse the bits */ + tree[n].Code = (ush)bi_reverse(next_code[len]++, len); + + Tracec(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", + n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); + } +} + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +local void build_tree(desc) + tree_desc near *desc; /* the tree descriptor */ +{ + ct_data near *tree = desc->dyn_tree; + ct_data near *stree = desc->static_tree; + int elems = desc->elems; + int n, m; /* iterate over heap elements */ + int max_code = -1; /* largest code with non zero frequency */ + int node = elems; /* next internal node of the tree */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + heap_len = 0, heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n].Freq != 0) { + heap[++heap_len] = max_code = n; + depth[n] = 0; + } else { + tree[n].Len = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (heap_len < 2) { + int new = heap[++heap_len] = (max_code < 2 ? ++max_code : 0); + tree[new].Freq = 1; + depth[new] = 0; + opt_len--; if (stree) static_len -= stree[new].Len; + /* new is 0 or 1 so it does not have extra bits */ + } + desc->max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = heap_len/2; n >= 1; n--) pqdownheap(tree, n); + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + do { + pqremove(tree, n); /* n = node of least frequency */ + m = heap[SMALLEST]; /* m = node of next least frequency */ + + heap[--heap_max] = n; /* keep the nodes sorted by frequency */ + heap[--heap_max] = m; + + /* Create a new node father of n and m */ + tree[node].Freq = (ush)(tree[n].Freq + tree[m].Freq); + depth[node] = (uch) (Max(depth[n], depth[m]) + 1); + tree[n].Dad = tree[m].Dad = (ush)node; +#ifdef DUMP_BL_TREE + if (tree == bl_tree) { + fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", + node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); + } +#endif + /* and insert the new node in the heap */ + heap[SMALLEST] = node++; + pqdownheap(tree, SMALLEST); + + } while (heap_len >= 2); + + heap[--heap_max] = heap[SMALLEST]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen((tree_desc near *)desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes ((ct_data near *)tree, max_code); +} + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. Updates opt_len to take into account the repeat + * counts. (The contribution of the bit length codes will be added later + * during the construction of bl_tree.) + */ +local void scan_tree (tree, max_code) + ct_data near *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + if (nextlen == 0) max_count = 138, min_count = 3; + tree[max_code+1].Len = (ush)-1; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + bl_tree[curlen].Freq += (ush)count; + } else if (curlen != 0) { + if (curlen != prevlen) bl_tree[curlen].Freq++; + bl_tree[REP_3_6].Freq++; + } else if (count <= 10) { + bl_tree[REPZ_3_10].Freq++; + } else { + bl_tree[REPZ_11_138].Freq++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +local void send_tree (tree, max_code) + ct_data near *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen == 0) max_count = 138, min_count = 3; + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + do { send_code(curlen, bl_tree); } while (--count != 0); + + } else if (curlen != 0) { + if (curlen != prevlen) { + send_code(curlen, bl_tree); count--; + } + Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(REP_3_6, bl_tree); send_bits(count-3, 2); + + } else if (count <= 10) { + send_code(REPZ_3_10, bl_tree); send_bits(count-3, 3); + + } else { + send_code(REPZ_11_138, bl_tree); send_bits(count-11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +local int build_bl_tree() +{ + int max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree((ct_data near *)dyn_ltree, l_desc.max_code); + scan_tree((ct_data near *)dyn_dtree, d_desc.max_code); + + /* Build the bit length tree: */ + build_tree((tree_desc near *)(&bl_desc)); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { + if (bl_tree[bl_order[max_blindex]].Len != 0) break; + } + /* Update opt_len to include the bit length tree and counts */ + opt_len += 3*(max_blindex+1) + 5+5+4; + Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", opt_len, static_len)); + + return max_blindex; +} + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +local void send_all_trees(lcodes, dcodes, blcodes) + int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + int rank; /* index in bl_order */ + + Assert(lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + Assert(lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + "too many codes"); + Tracev((stderr, "\nbl counts: ")); + send_bits(lcodes-257, 5); + /* not +255 as stated in appnote.txt 1.93a or -256 in 2.04c */ + send_bits(dcodes-1, 5); + send_bits(blcodes-4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(bl_tree[bl_order[rank]].Len, 3); + } + Tracev((stderr, "\nbl tree: sent %ld", bits_sent)); + + send_tree((ct_data near *)dyn_ltree, lcodes-1); /* send the literal tree */ + Tracev((stderr, "\nlit tree: sent %ld", bits_sent)); + + send_tree((ct_data near *)dyn_dtree, dcodes-1); /* send the distance tree */ + Tracev((stderr, "\ndist tree: sent %ld", bits_sent)); +} + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. This function + * returns the total compressed length (in bytes) for the file so far. + */ +ulg flush_block(buf, stored_len, eof) + char *buf; /* input block, or NULL if too old */ + ulg stored_len; /* length of input block */ + int eof; /* true if this is the last block for a file */ +{ + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + int max_blindex; /* index of last bit length code of non zero freq */ + + flag_buf[last_flags] = flags; /* Save the flags for the last 8 items */ + + /* Check if the file is ascii or binary */ + if (*file_type == (ush)UNKNOWN) set_file_type(); + + /* Construct the literal and distance trees */ + build_tree((tree_desc near *)(&l_desc)); + Tracev((stderr, "\nlit data: dyn %ld, stat %ld", opt_len, static_len)); + + build_tree((tree_desc near *)(&d_desc)); + Tracev((stderr, "\ndist data: dyn %ld, stat %ld", opt_len, static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(); + + /* Determine the best encoding. Compute first the block length in bytes */ + opt_lenb = (opt_len+3+7)>>3; + static_lenb = (static_len+3+7)>>3; +#ifdef DEBUG + input_len += stored_len; /* for debugging only */ +#endif + + Trace((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ", + opt_lenb, opt_len, static_lenb, static_len, stored_len, + last_lit, last_dist)); + + if (static_lenb <= opt_lenb) opt_lenb = static_lenb; + +#ifndef PGP /* PGP can't handle stored blocks */ + /* If compression failed and this is the first and last block, + * the whole file is transformed into a stored file: + */ +#ifdef FORCE_METHOD + if (level == 1 && eof && file_method != NULL && + cmpr_bytelen == 0L && cmpr_len_bits == 0L) { /* force stored file */ +#else + if (stored_len <= opt_lenb && eof && file_method != NULL && + cmpr_bytelen == 0L && cmpr_len_bits == 0L && seekable()) { +#endif + /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ + if (buf == NULL) error ("block vanished"); + + copy_block(buf, (unsigned)stored_len, 0); /* without header */ + cmpr_bytelen = stored_len; + *file_method = STORE; + } else +#endif /* PGP */ + +#ifdef FORCE_METHOD + if (level == 2 && buf != (char*)NULL) { /* force stored block */ +#else + if (stored_len+4 <= opt_lenb && buf != (char*)NULL) { + /* 4: two words for the lengths */ +#endif + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + send_bits((STORED_BLOCK<<1)+eof, 3); /* send block type */ + cmpr_bytelen += ((cmpr_len_bits + 3 + 7) >> 3) + stored_len + 4; + cmpr_len_bits = 0L; + + copy_block(buf, (unsigned)stored_len, 1); /* with header */ + +#ifdef FORCE_METHOD + } else if (level == 3) { /* force static trees */ +#else + } else if (static_lenb == opt_lenb) { +#endif + send_bits((STATIC_TREES<<1)+eof, 3); + compress_block((ct_data near *)static_ltree, (ct_data near *)static_dtree); + cmpr_len_bits += 3 + static_len; + cmpr_bytelen += cmpr_len_bits >> 3; + cmpr_len_bits &= 7L; + } else { + send_bits((DYN_TREES<<1)+eof, 3); + send_all_trees(l_desc.max_code+1, d_desc.max_code+1, max_blindex+1); + compress_block((ct_data near *)dyn_ltree, (ct_data near *)dyn_dtree); + cmpr_len_bits += 3 + opt_len; + cmpr_bytelen += cmpr_len_bits >> 3; + cmpr_len_bits &= 7L; + } + Assert(((cmpr_bytelen << 3) + cmpr_len_bits) == bits_sent, + "bad compressed size"); + init_block(); + + if (eof) { +#if defined(PGP) && !defined(MMAP) + /* Wipe out sensitive data for pgp */ +# ifdef DYN_ALLOC + extern uch *window; +# else + extern uch window[]; +# endif + memset(window, 0, (unsigned)(2*WSIZE-1)); /* -1 needed if WSIZE=32K */ +#else /* !PGP */ + Assert(input_len == isize, "bad input size"); +#endif + bi_windup(); + cmpr_len_bits += 7; /* align on byte boundary */ + } + Tracev((stderr,"\ncomprlen %lu(%lu) ", cmpr_bytelen + (cmpr_len_bits>>3), + (cmpr_bytelen << 3) + cmpr_len_bits - 7*eof)); + Trace((stderr, "\n")); + + return cmpr_bytelen + (cmpr_len_bits >> 3); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +int ct_tally (dist, lc) + int dist; /* distance of matched string */ + int lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + l_buf[last_lit++] = (uch)lc; + if (dist == 0) { + /* lc is the unmatched char */ + dyn_ltree[lc].Freq++; + } else { + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + Assert((ush)dist < (ush)MAX_DIST && + (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + (ush)d_code(dist) < (ush)D_CODES, "ct_tally: bad match"); + + dyn_ltree[length_code[lc]+LITERALS+1].Freq++; + dyn_dtree[d_code(dist)].Freq++; + + d_buf[last_dist++] = (ush)dist; + flags |= flag_bit; + } + flag_bit <<= 1; + + /* Output the flags if they fill a byte: */ + if ((last_lit & 7) == 0) { + flag_buf[last_flags++] = flags; + flags = 0, flag_bit = 1; + } + /* Try to guess if it is profitable to stop the current block here */ + if (level > 2 && (last_lit & 0xfff) == 0) { + /* Compute an upper bound for the compressed length */ + ulg out_length = (ulg)last_lit*8L; + ulg in_length = (ulg)strstart-block_start; + int dcode; + for (dcode = 0; dcode < D_CODES; dcode++) { + out_length += (ulg)dyn_dtree[dcode].Freq*(5L+extra_dbits[dcode]); + } + out_length >>= 3; + Trace((stderr,"\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ", + last_lit, last_dist, in_length, out_length, + 100L - out_length*100L/in_length)); + if (last_dist < last_lit/2 && out_length < in_length/2) return 1; + } + return (last_lit == LIT_BUFSIZE-1 || last_dist == DIST_BUFSIZE); + /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +local void compress_block(ltree, dtree) + ct_data near *ltree; /* literal tree */ + ct_data near *dtree; /* distance tree */ +{ + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned lx = 0; /* running index in l_buf */ + unsigned dx = 0; /* running index in d_buf */ + unsigned fx = 0; /* running index in flag_buf */ + uch flag = 0; /* current flags */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (last_lit != 0) do { + if ((lx & 7) == 0) flag = flag_buf[fx++]; + lc = l_buf[lx++]; + if ((flag & 1) == 0) { + send_code(lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = length_code[lc]; + send_code(code+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(lc, extra); /* send the extra length bits */ + } + dist = d_buf[dx++]; + /* Here, dist is the match distance - 1 */ + code = d_code(dist); + Assert(code < D_CODES, "bad d_code"); + + send_code(code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= base_dist[code]; + send_bits(dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + flag >>= 1; + } while (lx < last_lit); + + send_code(END_BLOCK, ltree); +} + +/* =========================================================================== + * Set the file type to ASCII or BINARY, using a crude approximation: + * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. + * IN assertion: the fields freq of dyn_ltree are set and the total of all + * frequencies does not exceed 64K (to fit in an int on 16 bit machines). + */ +local void set_file_type() +{ + int n = 0; + unsigned ascii_freq = 0; + unsigned bin_freq = 0; + while (n < 7) bin_freq += dyn_ltree[n++].Freq; + while (n < 128) ascii_freq += dyn_ltree[n++].Freq; + while (n < LITERALS) bin_freq += dyn_ltree[n++].Freq; + *file_type = (ush)(bin_freq > (ascii_freq >> 2) ? BINARY : ASCII); +} + + +/* =========================================================================== + * Initialize the bit string routines. + */ +void bi_init (tgt_buf, tgt_size, flsh_allowed) + char *tgt_buf; + unsigned tgt_size; + int flsh_allowed; +{ + out_buf = tgt_buf; + out_size = tgt_size; + out_offset = 0; + flush_flg = flsh_allowed; + + bi_buf = 0; + bi_valid = 0; +#ifdef DEBUG + bits_sent = 0L; +#endif +} + +#if (!defined(ASMV) || !defined(RISCOS)) +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +local void send_bits(value, length) + int value; /* value to send */ + int length; /* number of bits */ +{ +#ifdef DEBUG + Tracevv((stderr," l %2d v %4x ", length, value)); + Assert(length > 0 && length <= 15, "invalid length"); + bits_sent += (ulg)length; +#endif + /* If not enough room in bi_buf, use (bi_valid) bits from bi_buf and + * (Buf_size - bi_valid) bits from value to flush the filled bi_buf, + * then fill in the rest of (value), leaving (length - (Buf_size-bi_valid)) + * unused bits in bi_buf. + */ + bi_buf |= (value << bi_valid); + bi_valid += length; + if (bi_valid > (int)Buf_size) { + PUTSHORT(bi_buf); + bi_valid -= Buf_size; + bi_buf = (unsigned)value >> (length - bi_valid); + } +} + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +local unsigned bi_reverse(code, len) + unsigned code; /* the value to invert */ + int len; /* its bit length */ +{ + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} +#endif /* !ASMV || !RISCOS */ + +/* =========================================================================== + * Write out any remaining bits in an incomplete byte. + */ +local void bi_windup() +{ + if (bi_valid > 8) { + PUTSHORT(bi_buf); + } else if (bi_valid > 0) { + PUTBYTE(bi_buf); + } + if (flush_flg) { + flush_outbuf(out_buf, &out_offset); + } + bi_buf = 0; + bi_valid = 0; +#ifdef DEBUG + bits_sent = (bits_sent+7) & ~7; +#endif +} + +/* =========================================================================== + * Copy a stored block to the zip file, storing first the length and its + * one's complement if requested. + */ +local void copy_block(block, len, header) + char *block; /* the input data */ + unsigned len; /* its length */ + int header; /* true if block header must be written */ +{ + bi_windup(); /* align on byte boundary */ + + if (header) { + PUTSHORT((ush)len); + PUTSHORT((ush)~len); +#ifdef DEBUG + bits_sent += 2*16; +#endif + } + if (flush_flg) { + flush_outbuf(out_buf, &out_offset); + out_offset = len; + flush_outbuf(block, &out_offset); + } else if (out_offset + len > out_size) { + error("output buffer too small for in-memory compression"); + } else { + memcpy(out_buf + out_offset, block, len); + out_offset += len; + } +#ifdef DEBUG + bits_sent += (ulg)len<<3; +#endif +} + +#endif /* !USE_ZLIB */ + +const char *BOINC_RCSID_45621bfe77 = "$Id: trees.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/configure boinc-7.0.14+dfsg/zip/zip/unix/configure --- boinc-7.0.7+dfsg/zip/zip/unix/configure 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/configure 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,268 @@ +: +#!/bin/sh +# The above : is necessary on some buggy systems. + +# configure: Guess values for system-dependent variables +# Output the flag definitions to the file "flags". +# Parameters: $1 = $CC, $2 = $CFLAGS +# To construct zip automatically using this file, type +# "make -f unix/Makefile generic". +# If this fails, then type "make list" to get a list of special targets. + +trap "rm -f conftest* core a.out; exit 1" 1 2 3 15 + +CC=${1-cc} +CFLAGS=${2-"-O2 -I. -DUNIX"} +LFLAGS1="-s" +LN="ln -s" + +echo Check for the C preprocessor +# on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp. +CPP="${CC} -E" +# solaris as(1) needs -P, maybe others as well ? +[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P" +[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp +[ -f /lib/cpp ] && CPP=/lib/cpp +[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp +[ -f /xenix ] && CPP="${CC} -E" +[ -f /lynx.os ] && CPP="${CC} -E" + +echo Check if we can use asm code +OBJA="" +if eval "$CPP match.S > _match.s 2>/dev/null"; then + if test ! -s _match.s || grep error < _match.s > /dev/null; then + : + elif eval "$CC -c _match.s >/dev/null 2>/dev/null" && [ -f _match.o ]; then + CFLAGS="${CFLAGS} -DASMV" + OBJA="match.o" + echo "int foo() { return 0;}" > conftest.c + $CC -c conftest.c >/dev/null 2>/dev/null + echo Check if compiler generates underlines + nm conftest.o | grep "(^|[^_])foo" >/dev/null 2>/dev/null + [ $? -eq 0 ] && CPP="${CPP} -DNO_UNDERLINE" + if eval "$CPP crc_i386.S > _crc_i386.s 2>/dev/null"; then + if eval "$CC -c _crc_i386.s >/dev/null 2>/dev/null" && [ -f _crc_i386.o ] + then + OBJA="$OBJA crc_i386.o" + CFLAGS="${CFLAGS} -DASM_CRC" + fi + fi + fi +fi +rm -f _match.s _match.o _crc_i386.s _crc_i386.o + +# ANSI options for compilers that don't have __STDC__ defined by default +# Currently HPUX, pyramid, Dynix, AIX, OSF/1 and ultrix + +echo Check for ANSI options +cat > conftest.c << _EOF_ +int main() +{ +#ifndef __STDC__ + forget it +#endif + return 0; +} +_EOF_ +$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null +if [ $? -ne 0 ]; then + for OPT in "-Aa -D_HPUX_SOURCE" -Xa -qlanglvl=ansi -std1 -std + do + $CC $CFLAGS $OPT -c conftest.c > /dev/null 2>/dev/null + [ $? -eq 0 ] && CFLAGS="${CFLAGS} ${OPT}" && break + done +fi + +echo Check for prototypes +echo "int main(int argc, char *argv[]) { return 0; }" > conftest.c +$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_PROTO" + +# const check currently handles mips cc and non ANSI compilers. +# does it need more ? +echo Check the handling of const +cat > conftest.c << _EOF_ +typedef int charset[2]; +int main() +{ + const charset x; + const char *foo; + return 0; +} +_EOF_ +$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_CONST" + +echo Check for time_t +cat > conftest.c << _EOF_ +#include +#include +int main() +{ + time_t t; + return 0; +} +_EOF_ +$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_TIME_T" + +echo Check for size_t +cat > conftest.c << _EOF_ +#include +int main() +{ + size_t s; + return 0; +} +_EOF_ +$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_SIZE_T" + +# Check for missing functions +# add NO_'function_name' to flags if missing +for func in rmdir strchr strrchr rename mktemp mktime +do + echo Check for $func + echo "int main(){ $func(); return 0; }" > conftest.c + $CC -o conftest conftest.c >/dev/null 2>/dev/null + [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`" +done + +echo Check for memset +echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c +$CC -o conftest conftest.c >/dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM" + +echo Check for errno declaration +cat > conftest.c << _EOF_ +#include +main() +{ + errno = 0; + return 0; +} +_EOF_ +$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO" + +echo Check for directory libraries +cat > conftest.c << _EOF_ +int main() { return closedir(opendir(".")); } +_EOF_ + +$CC -o conftest conftest.c >/dev/null 2>/dev/null +if [ $? -ne 0 ]; then + OPT="" + for lib in ndir dir ucb bsd BSD PW x dirent + do + $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null + [ $? -eq 0 ] && OPT=-l$lib && break + done + if [ ${OPT} ]; then + LFLAGS2="${LFLAGS2} ${OPT}" + else + CFLAGS="${CFLAGS} -DNO_DIR" + fi +fi + +# Dynix/ptx 1.3 needed this +echo Check for readlink +echo "int main(){ return readlink(); }" > conftest.c +$CC -o conftest conftest.c >/dev/null 2>/dev/null +if [ $? -ne 0 ]; then + $CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null + [ $? -eq 0 ] && LFLAGS2="${LFLAGS2} -lseq" +fi + +echo Check for directory include file +OPT="" +for inc in dirent.h sys/ndir.h ndir.h sys/dir.h +do + echo "#include <$inc>" > conftest.c + $CPP conftest.c > /dev/null 2>/dev/null + [ $? -eq 0 ] && OPT="-DHAVE_`echo $inc | tr '[a-z]./' '[A-Z]__'`" && break +done +CFLAGS="${CFLAGS} ${OPT}" + +echo Check for non existent include files +for inc in stdlib.h stddef.h unistd.h fcntl.h string.h +do + echo "#include <$inc>" > conftest.c + $CPP conftest.c >/dev/null 2>/dev/null + [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $inc | tr '[a-z]./' '[A-Z]__'`" +done + +echo Check for term I/O include file +OPT="" +for inc in termios.h termio.h sgtty.h +do + echo "#include <$inc>" > conftest.c + $CPP conftest.c > /dev/null 2>/dev/null + [ $? -eq 0 ] && OPT="-DHAVE_`echo $inc | tr '[a-z]./' '[A-Z]__'`" && break +done +CFLAGS="${CFLAGS} ${OPT}" + +# needed for AIX (and others ?) when mmap is used +echo Check for valloc +cat > conftest.c << _EOF_ +main() +{ +#ifdef MMAP + valloc(); +#endif +} +_EOF_ +$CC ${CFLAGS} conftest.c > /dev/null 2>/dev/null +[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_VALLOC" + +echo Check for /usr/local/bin and /usr/local/man +BINDIR=$HOME/bin +[ -d /usr/local/bin ] && BINDIR=/usr/local/bin + +MANDIR=manl +[ -d /usr/man/manl ] && MANDIR=/usr/man/manl +[ -d /usr/local/man/manl ] && MANDIR=/usr/local/man/manl +[ -d /usr/local/man/man1 ] && MANDIR=/usr/local/man/man1 + +echo Checking for OS specialties +if [ -f /usr/bin/hostinfo ]; then + if /usr/bin/hostinfo | grep NeXT > /dev/null; then + CFLAGS="${CFLAGS} -posix" + LFLAGS1="${LFLAGS1} -posix -object" + fi +# XXX ATT6300, Cray +elif [ -f /xenix ]; then + if uname -p | grep 286 > /dev/null; then + CFLAGS="${CFLAGS} -LARGE -Mel2 -DMEDIUM_MEM -DWSIZE=16384 -DNO_VOID" + LFLAGS1="${LFLAGS1} -LARGE -Mel2" + fi +elif uname -X >/dev/null 2>/dev/null; then +# SCO shared library check + echo "int main() { return 0;}" > conftest.c + $CC -o conftest conftest.c -lc_s -nointl >/dev/null 2> /dev/null + [ $? -eq 0 ] && LFLAGS2="-lc_s -nointl" +else + SYSTEM=`uname -s 2>/dev/null` || SYSTEM="unknown" + echo "int main() { return 0;}" > conftest.c + case $SYSTEM in + OSF1|ULTRIX) + echo Check for -Olimit option + $CC ${CFLAGS} -Olimit 1000 -o conftest conftest.c >/dev/null 2>/dev/null + [ $? -eq 0 ] && CFLAGS="${CFLAGS} -Olimit 1000" + ;; + HP-UX) + echo Check for +Onolimit option + $CC ${CFLAGS} +Onolimit -o conftest conftest.c >/dev/null 2>/dev/null + [ $? -eq 0 ] && CFLAGS="${CFLAGS} +Onolimit" + ;; + esac +fi + +echo Check for symbolic links +ln -s /dev/null null > /dev/null 2>/dev/null || LN=ln + +rm -f a.out conftest.c conftest.o conftest null + +echo CC=\"${CC}\" CFLAGS=\"${CFLAGS}\" CPP=\"${CPP}\" OBJA=\"${OBJA}\" \ + BINDIR=${BINDIR} MANDIR=${MANDIR} LFLAGS1=\"${LFLAGS1}\" \ + LFLAGS2=\"${LFLAGS2}\" LN=\"${LN}\" > flags diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/Makefile boinc-7.0.14+dfsg/zip/zip/unix/Makefile --- boinc-7.0.7+dfsg/zip/zip/unix/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/Makefile 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,263 @@ +# Makefile for Zip, ZipNote, ZipCloak and ZipSplit + +# what you can make ... +all: + @echo '' + @echo 'Make what? You must say what system to make Zip for--e.g.' + @echo '"make generic". Choices: generic, generic_gcc,' + @echo 'att6300nodir, coherent, cray_v3, lynx, minix, os390, qnx,' + @echo 'qnxnto, solaris, solaris_gcc' + @echo 'See the files INSTALL and zip.txt for more information.' + @echo '' + +list: all + +MAKE = make -f unix/Makefile +SHELL = /bin/sh +LN = ln -s + +# (to use the Gnu compiler, change cc to gcc in CC) +CC = cc +BIND = $(CC) +AS = $(CC) -c +E = +CPP = /lib/cpp + +# probably can change this to 'install' if you have it +INSTALL = cp +# probably can change this to 'install -d' if you have it +# XXX NextStep 3.3 and Openstep 4.x don't know about -p ! +INSTALL_D = mkdir -p +CHMOD = chmod +BINFLAGS = 555 +MANFLAGS = 444 + +# target directories - where to install executables and man pages to +prefix = /usr/local +BINDIR = $(prefix)/bin +manext=1 +MANDIR = $(prefix)/man/man$(manext) +ZIPMANUAL = MANUAL +PKGDIR = IZzip +VERSION = Version 2.3 + +# flags +# CFLAGS flags for C compile +# LFLAGS1 flags after output file spec, before obj file list +# LFLAGS2 flags after obj file list (libraries, etc) +CFLAGS = -O2 -I. -DOS2 $(LOCAL_ZIP) +LFLAGS1 = +LFLAGS2 = -s + +# object file lists +OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \ + unix.o crc32.o crctab.o +OBJI = deflate.o trees.o +OBJA = +OBJU = zipfile_.o fileio_.o util_.o globals.o unix_.o +OBJN = zipnote.o $(OBJU) +OBJC = zipcloak.o $(OBJU) crctab.o crypt_.o ttyio.o +OBJS = zipsplit.o $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h unix/osdep.h + +# suffix rules +.SUFFIXES: +.SUFFIXES: _.o .o .c .doc .1 +.c_.o: + rm -f $*_.c; $(LN) $< $*_.c + $(CC) -c $(CFLAGS) -DUTIL $*_.c + rm -f $*_.c +.c.o: + $(CC) -c $(CFLAGS) $< + +.1.doc: + nroff -man $< | col -b | uniq > $@ + +# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL. +$(OBJZ): $(ZIP_H) +$(OBJI): $(ZIP_H) +$(OBJN): $(ZIP_H) +$(OBJS): $(ZIP_H) +$(OBJC): $(ZIP_H) +zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h +zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h +zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h +zipup.o: unix/zipup.h + +match.o: match.S + $(CPP) match.S > _match.s + $(AS) _match.s + mv _match.o match.o + rm -f _match.s + +crc_i386.o: crc_i386.S + $(CPP) crc_i386.S > crc_i386.s + $(AS) crc_i386.s + rm -f crc_i386.s + +unix.o: unix/unix.c + $(CC) -c $(CFLAGS) unix/unix.c + +unix_.o: unix/unix.c + rm -f unix_.c; $(LN) unix/unix.c unix_.c + $(CC) -c $(CFLAGS) -DUTIL unix_.c + rm -f unix_.c + +ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E + +zips: $(ZIPS) +zipsman: $(ZIPS) $(ZIPMANUAL) + +zip$E: $(OBJZ) $(OBJI) $(OBJA) + $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) +zipnote$E: $(OBJN) + $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2) +zipcloak$E: $(OBJC) + $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2) +zipsplit$E: $(OBJS) + $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2) + +$(ZIPMANUAL): man/zip.1 + nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL) + + +# install +install: $(ZIPS) + -$(INSTALL_D) $(BINDIR) + $(INSTALL) $(ZIPS) $(BINDIR) + -cd $(BINDIR); $(CHMOD) $(BINFLAGS) $(ZIPS) + -$(INSTALL_D) $(MANDIR) + $(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext) + $(CHMOD) $(MANFLAGS) $(MANDIR)/zip.$(manext) + +uninstall: + -cd $(BINDIR); rm -f $(ZIPS) + -cd $(MANDIR); rm -f zip.$(manext) + +flags: unix/configure + sh unix/configure "${CC}" "${CFLAGS}" + +# These symbols, when #defined using -D have these effects on compilation: +# ZMEM - includes C language versions of memset(), memcpy(), +# and memcmp() (util.c). +# HAVE_DIRENT_H - use instead of +# NODIR - for 3B1, which has neither getdents() nor opendir(). +# HAVE_NDIR_H - use (unix/unix.c). +# HAVE_SYS_DIR_H - use +# HAVE_SYS_NDIR_H - use +# UTIL - select routines for utilities (note, cloak, split) +# NO_RMDIR - remove directories using a system("rmdir ...") call. +# NO_PROTO - cannot handle ANSI prototypes +# NO_CONST - cannot handle ANSI const + +# Generic targets: + +generic: flags + eval $(MAKE) zips `cat flags` + +generic_gcc: + $(MAKE) generic CC=gcc CPP="gcc -E" + +# AT&T 6300 PLUS (don't know yet how to allocate 64K bytes): +att6300nodir: + $(MAKE) zips LFLAGS1="-Ml -s" \ + CFLAGS="-DUNIX -I. -O -Ml -DNO_RMDIR -DDYN_ALLOC -DMEDIUM_MEM \ +-DWSIZE=16384 -DNO_STDLIB_H -DNO_STDDEF_H -DNO_RENAME \ +-DNO_MKTIME -DNO_SIZE_T -DNO_VOID -DNO_PROTO -DNO_DIR \ +-DNO_CONST -DHAVE_TERMIO_H" \ + "LFLAGS2=" + +# Coherent (AS definition not needed for gcc) +coherent: + $(MAKE) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DASMV" AS="as -gx" \ + OBJA=match.o + +# Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c +# may be compiled with vector3; internal compiler bug in 3.0.2.3 and +# earlier requires vector2 for trees.c) +cray_v3: + $(MAKE) zips CC="scc" \ + CFLAGS="-DUNIX -I. -O -h vector2 -h scalar3 -DHAVE_DIRENT_H" + +# LynxOS +lynx: + $(MAKE) generic CC=gcc CPP="gcc -E" CFLAGS="$(CFLAGS) -DNO_UNDERLINE -DLynx -DLYNX LFLAGS2="$LFLAGS2 -lc_p" + +# MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make +minix: + $(MAKE) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DMINIX" CC=gcc + chmem =262144 zip + +# IBM OS/390 (formerly MVS) compiled under "OpenEdition" shell +# You can make the zip executable with IBM's make, but you will +# get errors dealing with the _.o targets for the other executables +# (zipcloak, etc). GNU make will build all the executables. +# If you have GNU make in your path as gmake, uncomment the following: +#MAKE = gmake -f unix/Makefile +os390: + ${MAKE} zips CFLAGS="$(CF) -I. -DUNIX -DOS390 -DEBCDIC -DSYSV \ +-DSYSV -DNO_PARAM_H" LFLAGS2="" + +# QNX is "special" because out /bin/sh is ksh and it doesn't grok the +# configure script properly, generating a bad flags file. D'oh! [cjh] +# +# QNX/Neutrino is "special" because you don't have any native development +# tools yet. Set ARCH to "x86", "ppcbe", "ppcle", "mipsbe", or "mipsle" +# to produce x86, PowerPC (big- or little-endian) and MIPS (big- +# or little-endian) using gcc. [cjh] +qnx: + $(MAKE) zips LN=ln CC=cc CFLAGS="-DUNIX -I. -O -DHAVE_DIRENT_H \ +-DHAVE_TERMIOS_H -DNO_MKTEMP" + +qnxnto: + @if [ "$(ARCH)" = "" ] ; then \ + echo "You didn't set ARCH; I'll assume you meant ARCH=x86..." ; \ + echo "" ; \ + $(MAKE) zips LN=ln CC="qcc -Vgcc_ntox86" \ + CFLAGS="-g -DUNIX -I. -O -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP" \ + LFLAGS2=-g ; \ + else \ + echo "Making zip for $(ARCH)..." ; \ + echo "" ; \ + $(MAKE) zips LN=ln CC="qcc -Vgcc_nto$(ARCH)" \ + CFLAGS="-g -DUNIX -I. -O -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP" \ + LFLAGS2=-g ; \ + fi + +# Solaris: Generic, plus generation of installable package. +solaris: generic svr4package + +# Solaris with GCC: generic_gcc, plus generation of installable package +solaris_gcc: generic_gcc svr4package + +# Package generation interface (by JBush). Originally tested under Sun Solaris. +# Other SVr4s may be very similar, and could possibly use this. +# Note: Expects version info to be stored in VERSION macro variable. +# See "README" under ./unix/Packaging +svr4package: + @echo "Creating SVR4 package for Unix ..." + -@rm -rf ./$(PKGDIR) ./$(PKGDIR)_`uname -p`.pkg + -@sed -e "s/.VERSION./$(VERSION)/g" \ + -e "s/.PSTAMP./$(LOGNAME)_`date | tr ' ' '_'`/g" \ + -e "s/.ARCH./Solaris_`uname -rp | tr ' ' ','`/g" \ + ./unix/Packaging/pkginfo.in > ./unix/Packaging/pkginfo + -@sed -e "s/.ARCH./`uname -p`/g" \ + ./unix/Packaging/preinstall.in > ./unix/Packaging/preinstall + /usr/bin/pkgmk -d . -b . -r . -f ./unix/Packaging/prototype $(PKGDIR) + /usr/bin/pkgtrans -o -s . $(PKGDIR)_`uname -p`.pkg $(PKGDIR) + @echo " " + @echo "To install, copy $(PKGDIR)_`uname -p`.pkg to the target system, and" + @echo "issue the command (as root): pkgadd -d $(PKGDIR)_`uname -p`.pkg" + @echo " " + +# make a distribution +dist: $(ZIPMANUAL) + eval zip -r9 zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \ + -e 's/[.]//g' -e 's/ .*//g' -e q revision.h` * + +# clean up after making stuff and installing it +clean: + rm -f *.o $(ZIPS) flags + rm -rf $(PKGDIR) + diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/osdep.h boinc-7.0.14+dfsg/zip/zip/unix/osdep.h --- boinc-7.0.7+dfsg/zip/zip/unix/osdep.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/osdep.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,12 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#include +#include + +#define USE_EF_UT_TIME /* Enable use of "UT" extra field time info */ diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/Packaging/pkginfo.in boinc-7.0.14+dfsg/zip/zip/unix/Packaging/pkginfo.in --- boinc-7.0.7+dfsg/zip/zip/unix/Packaging/pkginfo.in 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/Packaging/pkginfo.in 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,13 @@ +PKG=IZzip +NAME=Info-ZIP Zip Utilities +CATEGORY=application +VENDOR=Info-ZIP +EMAIL=Zip-Bugs@lists.wku.edu +HOTLINE=Zip-Bugs@lists.wku.edu +DESC=Copyrighted FREEWARE. See README, WHERE, and docs in pkg's doc dir. +CLASSES=none +BASEDIR=/opt/Info-ZIP +#BASEDIR=/usr/local +VERSION=".VERSION." +PSTAMP=".PSTAMP." +ARCH=".ARCH." diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/Packaging/postinstall boinc-7.0.14+dfsg/zip/zip/unix/Packaging/postinstall --- boinc-7.0.7+dfsg/zip/zip/unix/Packaging/postinstall 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/Packaging/postinstall 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Post installation script (simply inform installer about PATH etc) +# +echo " " +echo " " +echo "Installation is complete. Now, you should add the following" +echo "(or equivalnet) commands to the appropriate initial user shell" +echo "scripts (such as .profile, .login, etc) -- " +echo " " +echo " For korn or bourne shell:" +echo " PATH=\${PATH}:${BASEDIR}/${PKG}/bin" +echo " MANPATH=\${MANPATH}:${BASEDIR}/${PKG}/man" +echo " export PATH MANPATH" +echo " " +echo " For C shell:" +echo " set path=(\$path ${BASEDIR}/${PKG}/bin)" +echo " setenv MANPATH \$MANPATH:${BASEDIR}/${PKG}/man" +echo " " +echo " See the files under ${BASEDIR}/${PKG}/doc for more information." +echo " " +exit 0 diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/Packaging/preinstall.in boinc-7.0.14+dfsg/zip/zip/unix/Packaging/preinstall.in --- boinc-7.0.7+dfsg/zip/zip/unix/Packaging/preinstall.in 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/Packaging/preinstall.in 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/sh +echo " " +echo "REPORT ALL BUGS, PROBLEMS, AND ACCOLADES TO:" +echo " " +echo " Zip-Bugs@lists.wku.edu" +echo " " +echo "Checking architecture platform for .ARCH. ..." +arch=`uname -p` +if [ "arch_${arch}" != "arch_.ARCH." ]; then + echo " " + echo "This product MUST be installed on a Solaris .ARCH. platform." + echo "Your machine looks like it is a ${arch} platform." + echo "Please install the version for the .ARCH. architecture." + echo "Aborting the installation because of this. " + echo " " + returncode=1 + else + echo " " + echo "This product works on .ARCH., which you happen to have!" + echo " " + returncode=0 +fi +echo " " +/usr/bin/sleep 4 +exit ${returncode:-1} +# diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/Packaging/prototype boinc-7.0.14+dfsg/zip/zip/unix/Packaging/prototype --- boinc-7.0.7+dfsg/zip/zip/unix/Packaging/prototype 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/Packaging/prototype 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,24 @@ +d none $BASEDIR 0755 root bin +d none $BASEDIR/$PKG 0755 root bin +d none $PKG/doc 0755 root bin +f none $PKG/doc/BUGS=BUGS 0644 root bin +f none $PKG/doc/README=README 0644 root bin +f none $PKG/doc/TODO=TODO 0644 root bin +f none $PKG/doc/WHERE=WHERE 0644 root bin +f none $PKG/doc/CHANGES=CHANGES 0644 root bin +f none $PKG/doc/WHATSNEW=WHATSNEW 0644 root bin +f none $PKG/doc/INSTALL=INSTALL 0644 root bin +f none $PKG/doc/MANUAL=MANUAL 0644 root bin +d none $PKG/man 0755 root bin +d none $PKG/man/man1 0755 root bin +f none $PKG/man/man1/zip.1=man/zip.1 0644 root bin +d none $PKG/bin 0755 root bin +f none $PKG/bin/zip=zip 0755 root bin +f none $PKG/bin/zipnote=zipnote 0755 root bin +f none $PKG/bin/zipsplit=zipsplit 0755 root bin +f none $PKG/bin/zipcloak=zipcloak 0755 root bin +i README +i pkginfo +i prototype +i preinstall +i postinstall diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/Packaging/README boinc-7.0.14+dfsg/zip/zip/unix/Packaging/README --- boinc-7.0.7+dfsg/zip/zip/unix/Packaging/README 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/Packaging/README 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,44 @@ +Solaris packaging +----------------- + +To generate a Solaris package for Info-ZIP zip utilities, +first see the top level INSTALL and README files. Do a +"make solaris", which will automatically build two Solaris +installable package files for the package, IZzip. + + IZzip -- Solaris installable package in directory format. + IZzip_$(arch).pkg -- Solaris installable package in "stream" format. + + Where: $(arch) := system architecture, currently i386, sparc, or ppc. + (use "uname -p" to determine) + +The ".pkg" file is a single file datastream that can be compressed +and/or ftp'd. This is the recommended form, because all required +files are resident in the archive, and it is easily distributed. + +To install, simply: + + 1) copy the package to the target system's /tmp directory. + 2) login or su to root + 3) pkgadd -d /tmp/IZzip_$(arch).pkg + 4) add /opt/Info-ZIP/IZzip/bin to PATH + 5) add /opt/Info-ZIP/IZzip/man to MANPATH + +This works for both SPARC and x86. + +Ongoing maintenance: + + Keep the files, "prototype" and "pkginfo.in" up to date. + Observe variable substitutions made by "Makefile". + See manpages for pkginfo(1), pkginfo(4), pkgmk(1), pkgproto(1) + +Variations: + + If you wish the base directory to be set to something other than + /opt/Info-ZIP, change the setting BASEDIR in pkginfo.in and + re-run the make. + + +-John Bush (John.Bush@East.Sun.COM) + July 20, 1996 + diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/README.OS390 boinc-7.0.14+dfsg/zip/zip/unix/README.OS390 --- boinc-7.0.7+dfsg/zip/zip/unix/README.OS390 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/README.OS390 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,85 @@ + +OS/390 is IBM's follow-on to MVS and includes a POSIX, XOPEN, +XPG4, build environment, a Unix-style filesystem (called HFS), and +a POSIX (Born) shell. This port uses this environment and is a fairly +straight-forward port of ZIP's Unix port - but uses the existing EBCDIC +code. This port does not work with non-HFS (traditional MVS) +filesystems. + +I believe all my changes are isolated with #ifdef's. + +Here's some text which might be useful for an OS390 README or +the manual. + +ZIP for OS390 HFS datasets +-------------------------- +Allows you to create ZIP archives from the OS/390 OpenEdition +command prompt. This port uses standard Unix-style I/O routines +and only works with HFS files. + +Usage +----- +By default, ZIP does not perform character-set translation, but has +options to make it easy to convert text files to be compatible with +other systems + zip zipfile list # add the files in 'list' to archive 'zipfile' + zip -a zipfile list # same as above, but translate files to ASCII + zip -al zipfile list # same as above, translate linefeeds to DOS style + zip -all zipfile list # same as '-a', translate linefeeds to UNIX style + +Build process +------------- +Assuming GNU make is available in your path and is called "gmake" (See +the notes on Makefile changes below) and a C compiler is available as +"cc", then type + gmake -f unix/Makefile MAKE=gmake os390 + +If GNU make is not available, the existing makefile can create zip, but will +error on the other executable (zipsplit, zipcloak, zipnote) if you type + make -f unix/Makefile os390 + +Overview of Changes +------------------- +The OS/390 port is treated as a variant of the Unix port. EBCDIC support +was already implemented for CMS/MVS-batch ports. The specific changes I +made are summarized below. + +unix/Makefile - zip uses a unusual _.o target which IBM's make can't handle. +Since the Makefile has a macro called MAKE that is used for a recursive +call to make, I changed the MACRO to call "gmake" - GNU's make - which +can handle the _.o target. If you don't have GNU make, you can +workaround by manually applying symlinks from whatever.c to whatever_.c. +Alternatively, the whatever_.o files could be explicitely added for os390. + +I added an os390 target with appropriate defines. + +zipup.c - added code (#ifdef OS390) to convert test to ASCII if -a flag +was set. + +zip.c - changed logic which always used DOS-style newlines when -a was +set to be consistent with other port (DOS newlines if -l option) + +zipfile.c - miscellaneous changes to force storing file names and +descriptions in ASCII in the zip directory. This makes zip files +portable across all platforms. This in turn meant names did not +need to be translated when displaying messages. + +zip.h - strtoasc was missing a closing parenthesis. + +ebcdic.h - changed translation table to be consistent with current IBM +recommendations - exact same changes to ebcdic.h as in my unzip port. + +tailor.h - define huge/far/near to be empty + +unix/unix.c - substantial changes to deal with mode flags. Under +the current XOPEN standards, some of the traditional unix file mode +bits need not be in fixed locations, but standard access macros must be +available to access the values. The old unix.c code just picked up these +values and saved them as-is where unzip interpreted them. Existing +Unix system provided the macros for XOPEN compliance, but left the flags +in their traditional locations. OS/390 has a brand new filesystem which +is XOPEN compliant without revealing the positions of these flags. +To create the bitmask in the same format unzip expects, the macros are +tested one-by-one to set the appropriate bits. This same logic should +work on any XOPEN system, but takes more instructions (I did test this +logic on Linux). diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/zipup.h boinc-7.0.14+dfsg/zip/zip/unix/zipup.h --- boinc-7.0.7+dfsg/zip/zip/unix/zipup.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/zipup.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,21 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef _WIN32 +#ifndef O_RDONLY +# define O_RDONLY 0 +#endif +#define fhow O_RDONLY +#define fbad (-1) +typedef int ftype; +#define zopen(n,p) open(n,p) +#define zread(f,b,n) read(f,b,n) +#define zclose(f) close(f) +#define zerr(f) (k == (extent)(-1L)) +#define zstdin 0 +#endif diff -Nru boinc-7.0.7+dfsg/zip/zip/unix/z_unix.c boinc-7.0.14+dfsg/zip/zip/unix/z_unix.c --- boinc-7.0.7+dfsg/zip/zip/unix/z_unix.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/unix/z_unix.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,735 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#include "zip.h" + +#ifndef UTIL /* the companion #endif is a bit of ways down ... */ + +#include + +#if defined(MINIX) || defined(__mpexl) +# ifdef S_IWRITE +# undef S_IWRITE +# endif /* S_IWRITE */ +# define S_IWRITE S_IWUSR +#endif /* MINIX */ + +#if (!defined(S_IWRITE) && defined(S_IWUSR)) +# define S_IWRITE S_IWUSR +#endif + +#if defined(HAVE_DIRENT_H) || defined(_POSIX_VERSION) +# include +#else /* !HAVE_DIRENT_H */ +# ifdef HAVE_NDIR_H +# include +# endif /* HAVE_NDIR_H */ +# ifdef HAVE_SYS_NDIR_H +# include +# endif /* HAVE_SYS_NDIR_H */ +# ifdef HAVE_SYS_DIR_H +# include +# endif /* HAVE_SYS_DIR_H */ +# ifndef dirent +# define dirent direct +# endif +#endif /* HAVE_DIRENT_H || _POSIX_VERSION */ + +#define PAD 0 +#define PATH_END '/' + +/* Library functions not in (most) header files */ + +#ifdef _POSIX_VERSION +# include +#else + int utime OF((char *, time_t *)); +#endif + +extern char *label; +local ulg label_time = 0; +local ulg label_mode = 0; +local time_t label_utim = 0; + +/* Local functions */ +local char *readd OF((DIR *)); + + +#ifdef NO_DIR /* for AT&T 3B1 */ +#include +#ifndef dirent +# define dirent direct +#endif +typedef FILE DIR; +/* +** Apparently originally by Rich Salz. +** Cleaned up and modified by James W. Birdsall. +*/ + +#define opendir(path) fopen(path, "r") + +struct dirent *readdir(dirp) +DIR *dirp; +{ + static struct dirent entry; + + if (dirp == NULL) + return NULL; + for (;;) + if (fread (&entry, sizeof (struct dirent), 1, dirp) == 0) + return NULL; + else if (entry.d_ino) + return (&entry); +} /* end of readdir() */ + +#define closedir(dirp) fclose(dirp) +#endif /* NO_DIR */ + + +local char *readd(d) +DIR *d; /* directory stream to read from */ +/* Return a pointer to the next name in the directory stream d, or NULL if + no more entries or an error occurs. */ +{ + struct dirent *e; + + e = readdir(d); + return e == NULL ? (char *) NULL : e->d_name; +} + +int procname(n, caseflag) +char *n; /* name to process */ +int caseflag; /* true to force case-sensitive match */ +/* Process a name or sh expression to operate on (or exclude). Return + an error code in the ZE_ class. */ +{ + char *a; /* path and name for recursion */ + DIR *d; /* directory stream from opendir() */ + char *e; /* pointer to name from readd() */ + int m; /* matched flag */ + char *p; /* path for recursion */ + struct stat s; /* result of stat() */ + struct zlist far *z; /* steps through zfiles list */ + + if (strcmp(n, "-") == 0) /* if compressing stdin */ + return newname(n, 0, caseflag); + else if (LSSTAT(n, &s)) + { + /* Not a file or directory--search for shell expression in zip file */ + p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ + m = 1; + for (z = zfiles; z != NULL; z = z->nxt) { + if (MATCH(p, z->iname, caseflag)) + { + z->mark = pcount ? filter(z->zname, caseflag) : 1; + if (verbose) + fprintf(mesg, "zip diagnostic: %scluding %s\n", + z->mark ? "in" : "ex", z->name); + m = 0; + } + } + free((zvoid *)p); + return m ? ZE_MISS : ZE_OK; + } + + /* Live name--use if file, recurse if directory */ +#ifdef OS390 + if (S_ISREG(s.st_mode) || S_ISLNK(s.st_mode)) +#else + if ((s.st_mode & S_IFREG) == S_IFREG || + (s.st_mode & S_IFLNK) == S_IFLNK) +#endif + { + /* add or remove name of file */ + if ((m = newname(n, 0, caseflag)) != ZE_OK) + return m; + } +#ifdef OS390 + else if (S_ISDIR(s.st_mode)) +#else + else if ((s.st_mode & S_IFDIR) == S_IFDIR) +#endif + { + /* Add trailing / to the directory name */ + if ((p = malloc(strlen(n)+2)) == NULL) + return ZE_MEM; + if (strcmp(n, ".") == 0) { + *p = '\0'; /* avoid "./" prefix and do not create zip entry */ + } else { + strcpy(p, n); + a = p + strlen(p); + if (a[-1] != '/') + strcpy(a, "/"); + if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { + free((zvoid *)p); + return m; + } + } + /* recurse into directory */ + if (recurse && (d = opendir(n)) != NULL) + { + while ((e = readd(d)) != NULL) { + if (strcmp(e, ".") && strcmp(e, "..")) + { + if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) + { + closedir(d); + free((zvoid *)p); + return ZE_MEM; + } + strcat(strcpy(a, p), e); + if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ + { + if (m == ZE_MISS) + zipwarn("name not matched: ", a); + else + ziperr(m, a); + } + free((zvoid *)a); + } + } + closedir(d); + } + free((zvoid *)p); + } /* (s.st_mode & S_IFDIR) */ + else + zipwarn("ignoring special file: ", n); + return ZE_OK; +} + +char *ex2in(x, isdir, pdosflag) +char *x; /* external file name */ +int isdir; /* input: x is a directory */ +int *pdosflag; /* output: force MSDOS file attributes? */ +/* Convert the external file name to a zip file name, returning the malloc'ed + string or NULL if not enough memory. */ +{ + char *n; /* internal file name (malloc'ed) */ + char *t = NULL; /* shortened name */ + int dosflag; + + dosflag = dosify; /* default for non-DOS and non-OS/2 */ + + /* Find starting point in name before doing malloc */ + /* Strip "//host/share/" part of a UNC name */ + if (!strncmp(x,"//",2) && (x[2] != '\0' && x[2] != '/')) { + n = x + 2; + while (*n != '\0' && *n != '/') + n++; /* strip host name */ + if (*n != '\0') { + n++; + while (*n != '\0' && *n != '/') + n++; /* strip `share' name */ + } + if (*n != '\0') + t = n + 1; + } else + t = x; + while (*t == '/') + t++; /* strip leading '/' chars to get a relative path */ + while (*t == '.' && t[1] == '/') + t += 2; /* strip redundant leading "./" sections */ + + /* Make changes, if any, to the copied name (leave original intact) */ + if (!pathput) + t = last(t, PATH_END); + + /* Malloc space for internal name and copy it */ + if ((n = malloc(strlen(t) + 1)) == NULL) + return NULL; + strcpy(n, t); + + if (isdir == 42) return n; /* avoid warning on unused variable */ + + if (dosify) + msname(n); + +#ifdef EBCDIC + strtoasc(n, n); /* here because msname() needs native coding */ +#endif + + /* Returned malloc'ed name */ + if (pdosflag) + *pdosflag = dosflag; + return n; +} + +char *in2ex(n) +char *n; /* internal file name */ +/* Convert the zip file name to an external file name, returning the malloc'ed + string or NULL if not enough memory. */ +{ + char *x; /* external file name */ + + if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) + return NULL; +#ifdef EBCDIC + strtoebc(x, n); +#else + strcpy(x, n); +#endif + return x; +} + +/* + * XXX use ztimbuf in both POSIX and non POSIX cases ? + */ +void stamp(f, d) +char *f; /* name of file to change */ +ulg d; /* dos-style time to change it to */ +/* Set last updated and accessed time of file f to the DOS time d. */ +{ +#ifdef _POSIX_VERSION + struct utimbuf u; /* argument for utime() const ?? */ +#else + time_t u[2]; /* argument for utime() */ +#endif + + /* Convert DOS time to time_t format in u */ +#ifdef _POSIX_VERSION + u.actime = u.modtime = dos2unixtime(d); + utime(f, &u); +#else + u[0] = u[1] = dos2unixtime(d); + utime(f, u); +#endif + +} + +ulg filetime(f, a, n, t) +char *f; /* name of file to get info on */ +ulg *a; /* return value: file attributes */ +long *n; /* return value: file size */ +iztimes *t; /* return value: access, modific. and creation times */ +/* If file *f does not exist, return 0. Else, return the file's last + modified date and time as an MSDOS date and time. The date and + time is returned in a long with the date most significant to allow + unsigned integer comparison of absolute times. Also, if a is not + a NULL pointer, store the file attributes there, with the high two + bytes being the Unix attributes, and the low byte being a mapping + of that to DOS attributes. If n is not NULL, store the file size + there. If t is not NULL, the file's access, modification and creation + times are stored there as UNIX time_t values. + If f is "-", use standard input as the file. If f is a device, return + a file size of -1 */ +{ + struct stat s; /* results of stat() */ + char name[FNMAX]; + int len = strlen(f); + + if (f == label) { + if (a != NULL) + *a = label_mode; + if (n != NULL) + *n = -2L; /* convention for a label name */ + if (t != NULL) + t->atime = t->mtime = t->ctime = label_utim; + return label_time; + } + strcpy(name, f); + if (name[len - 1] == '/') + name[len - 1] = '\0'; + /* not all systems allow stat'ing a file with / appended */ + if (strcmp(f, "-") == 0) { + if (fstat(fileno(stdin), &s) != 0) + error("fstat(stdin)"); + } + else if (LSSTAT(name, &s) != 0) + /* Accept about any file kind including directories + * (stored with trailing / with -r option) + */ + return 0; + + if (a != NULL) { +#ifndef OS390 + *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); +#else +/* +** The following defines are copied from the unizip source and represent the +** legacy Unix mode flags. These fixed bit masks are no longer required +** by XOPEN standards - the S_IS### macros being the new recommended method. +** The approach here of setting the legacy flags by testing the macros should +** work under any _XOPEN_SOURCE environment (and will just rebuild the same bit +** mask), but is required if the legacy bit flags differ from legacy Unix. +*/ +#define UNX_IFDIR 0040000 /* Unix directory */ +#define UNX_IFREG 0100000 /* Unix regular file */ +#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ +#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ +#define UNX_IFBLK 0060000 /* Unix block special (not Amiga) */ +#define UNX_IFCHR 0020000 /* Unix character special (not Amiga) */ +#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ + { + mode_t legacy_modes; + + /* Initialize with permission bits - which are not implementation optional */ + legacy_modes = s.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); + if (S_ISDIR(s.st_mode)) + legacy_modes |= UNX_IFDIR; + if (S_ISREG(s.st_mode)) + legacy_modes |= UNX_IFREG; + if (S_ISLNK(s.st_mode)) + legacy_modes |= UNX_IFLNK; + if (S_ISBLK(s.st_mode)) + legacy_modes |= UNX_IFBLK; + if (S_ISCHR(s.st_mode)) + legacy_modes |= UNX_IFCHR; + if (S_ISFIFO(s.st_mode)) + legacy_modes |= UNX_IFIFO; + if (S_ISSOCK(s.st_mode)) + legacy_modes |= UNX_IFSOCK; + *a = ((ulg)legacy_modes << 16) | !(s.st_mode & S_IWRITE); + } +#endif + if ((s.st_mode & S_IFMT) == S_IFDIR) { + *a |= MSDOS_DIR_ATTR; + } + } + if (n != NULL) + *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; + if (t != NULL) { + t->atime = s.st_atime; + t->mtime = s.st_mtime; + t->ctime = t->mtime; /* best guess, (s.st_ctime: last status change!!) */ + } + return unix2dostime(&s.st_mtime); +} + + +#ifndef QLZIP /* QLZIP Unix2QDOS cross-Zip supplies an extended variant */ + +int set_extra_field(z, z_utim) + struct zlist far *z; + iztimes *z_utim; + /* store full data in local header but just modification time stamp info + in central header */ +{ + struct stat s; + + /* For the full sized UT local field including the UID/GID fields, we + * have to stat the file again. */ + if (LSSTAT(z->name, &s)) + return ZE_OPEN; + +#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(2)) +#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1)) +#define EB_L_UX2_SIZE (EB_HEADSIZE + EB_UX2_MINLEN) +#define EB_C_UX2_SIZE EB_HEADSIZE +#define EF_L_UNIX_SIZE (EB_L_UT_SIZE + EB_L_UX2_SIZE) +#define EF_C_UNIX_SIZE (EB_C_UT_SIZE + EB_C_UX2_SIZE) + + if ((z->extra = (char *)malloc(EF_L_UNIX_SIZE)) == NULL) + return ZE_MEM; + if ((z->cextra = (char *)malloc(EF_C_UNIX_SIZE)) == NULL) + return ZE_MEM; + + z->extra[0] = 'U'; + z->extra[1] = 'T'; + z->extra[2] = (char)EB_UT_LEN(2); /* length of data part of local e.f. */ + z->extra[3] = 0; + z->extra[4] = EB_UT_FL_MTIME | EB_UT_FL_ATIME; /* st_ctime != creation */ + z->extra[5] = (char)(s.st_mtime); + z->extra[6] = (char)(s.st_mtime >> 8); + z->extra[7] = (char)(s.st_mtime >> 16); + z->extra[8] = (char)(s.st_mtime >> 24); + z->extra[9] = (char)(s.st_atime); + z->extra[10] = (char)(s.st_atime >> 8); + z->extra[11] = (char)(s.st_atime >> 16); + z->extra[12] = (char)(s.st_atime >> 24); + z->extra[13] = 'U'; + z->extra[14] = 'x'; + z->extra[15] = (char)EB_UX2_MINLEN; /* length of data part of local e.f. */ + z->extra[16] = 0; + z->extra[17] = (char)(s.st_uid); + z->extra[18] = (char)(s.st_uid >> 8); + z->extra[19] = (char)(s.st_gid); + z->extra[20] = (char)(s.st_gid >> 8); + z->ext = EF_L_UNIX_SIZE; + + memcpy(z->cextra, z->extra, EB_C_UT_SIZE); + z->cextra[EB_LEN] = (char)EB_UT_LEN(1); + memcpy(z->cextra+EB_C_UT_SIZE, z->extra+EB_L_UT_SIZE, EB_C_UX2_SIZE); + z->cextra[EB_LEN+EB_C_UT_SIZE] = 0; + z->cext = EF_C_UNIX_SIZE; + +#if 0 /* UID/GID presence is now signaled by central EF_IZUNIX2 field ! */ + /* lower-middle external-attribute byte (unused until now): + * high bit => (have GMT mod/acc times) >>> NO LONGER USED! <<< + * second-high bit => have Unix UID/GID info + * NOTE: The high bit was NEVER used in any official Info-ZIP release, + * but its future use should be avoided (if possible), since it + * was used as "GMT mod/acc times local extra field" flags in Zip beta + * versions 2.0j up to 2.0v, for about 1.5 years. + */ + z->atx |= 0x4000; +#endif /* never */ + return ZE_OK; +} + +#endif /* !QLZIP */ + + +int deletedir(d) +char *d; /* directory to delete */ +/* Delete the directory *d if it is empty, do nothing otherwise. + Return the result of rmdir(), delete(), or system(). + For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). + */ +{ +# ifdef NO_RMDIR + /* code from Greg Roelofs, who horked it from Mark Edwards (unzip) */ + int r, len; + char *s; /* malloc'd string for system command */ + + len = strlen(d); + if ((s = malloc(len + 34)) == NULL) + return 127; + + sprintf(s, "IFS=\" \t\n\" /bin/rmdir %s 2>/dev/null", d); + r = system(s); + free(s); + return r; +# else /* !NO_RMDIR */ + return rmdir(d); +# endif /* ?NO_RMDIR */ +} + +#endif /* !UTIL */ + + +/******************************/ +/* Function version_local() */ +/******************************/ + +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__386BSD__) || \ + defined(__OpenBSD__) || defined(__bsdi__) +#include /* for the BSD define */ +/* if we have something newer than NET/2 we'll use uname(3) */ +#if (BSD > 199103) +#include +#endif /* BSD > 199103 */ +#endif /* __{Net,Free,Open,386}BSD__ || __bsdi__ */ + +void version_local() +{ + static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; +#if defined(CRAY) || defined(NX_CURRENT_COMPILER_RELEASE) + char buf1[40]; + char buf2[40]; +#endif + +#ifdef BSD + char buf1[40]; + +#if (BSD <= 199103) +#ifdef __NetBSD__ + static ZCONST char *netbsd[] = { "_ALPHA", "", "A", "B" }; +#endif /* __NetBSD__ */ +#else /* BSD > 199103 */ + struct utsname u; + + uname(&u); +#endif /* BSD <= 199103) */ +#endif /* BSD */ + + /* Pyramid, NeXT have problems with huge macro expansion, too: no Info() */ + printf(CompiledWith, + +#ifdef __GNUC__ +# ifdef NX_CURRENT_COMPILER_RELEASE + (sprintf(buf1, "NeXT DevKit %d.%02d ", NX_CURRENT_COMPILER_RELEASE/100, + NX_CURRENT_COMPILER_RELEASE%100), buf1), + (strlen(__VERSION__) > 8)? "(gcc)" : + (sprintf(buf2, "(gcc %s)", __VERSION__), buf2), +# else + "gcc ", __VERSION__, +# endif +#else +# if defined(CRAY) && defined(_RELEASE) + "cc ", (sprintf(buf1, "version %d", _RELEASE), buf1), +# else +# ifdef __VERSION__ + "cc ", __VERSION__, +# else + "cc", "", +# endif +# endif +#endif + + "Unix", + +#if defined(sgi) || defined(__sgi) + " (Silicon Graphics IRIX)", +#else +#ifdef sun +# ifdef sparc +# ifdef __SVR4 + " (Sun Sparc/Solaris)", +# else /* may or may not be SunOS */ + " (Sun Sparc)", +# endif +# else +# if defined(sun386) || defined(i386) + " (Sun 386i)", +# else +# if defined(mc68020) || defined(__mc68020__) + " (Sun 3)", +# else /* mc68010 or mc68000: Sun 2 or earlier */ + " (Sun 2)", +# endif +# endif +# endif +#else +#ifdef __hpux + " (HP/UX)", +#else +#ifdef __osf__ + " (DEC OSF/1)", +#else +#ifdef _AIX + " (IBM AIX)", +#else +#ifdef aiws + " (IBM RT/AIX)", +#else +#if defined(CRAY) || defined(cray) +# ifdef _UNICOS + (sprintf(buf2, " (Cray UNICOS release %d)", _UNICOS), buf2), +# else + " (Cray UNICOS)", +# endif +#else +#if defined(uts) || defined(UTS) + " (Amdahl UTS)", +#else +#ifdef NeXT +# ifdef mc68000 + " (NeXTStep/black)", +# else + " (NeXTStep for Intel)", +# endif +#else /* the next dozen or so are somewhat order-dependent */ +#if defined(linux) || defined(__linux__) +# ifdef __ELF__ + " (Linux ELF)", +# else + " (Linux a.out)", +# endif +#else +#ifdef MINIX + " (Minix)", +#else +#ifdef M_UNIX + " (SCO Unix)", +#else +#ifdef M_XENIX + " (SCO Xenix)", +#else +#ifdef BSD +#if (BSD > 199103) + (sprintf(buf1, " (%s %s)", u.sysname, u.release), buf1), +#else +#ifdef __NetBSD__ +# ifdef NetBSD0_8 + (sprintf(buf1, " (NetBSD 0.8%s)", netbsd[NetBSD0_8]), buf1), +# else +# ifdef NetBSD0_9 + (sprintf(buf1, " (NetBSD 0.9%s)", netbsd[NetBSD0_9]), buf1), +# else +# ifdef NetBSD1_0 + (sprintf(buf1, " (NetBSD 1.0%s)", netbsd[NetBSD1_0]), buf1), +# endif /* NetBSD1_0 */ +# endif /* NetBSD0_9 */ +# endif /* NetBSD0_8 */ +#else +#ifdef __FreeBSD__ + " (FreeBSD 1.x)", +#else +#ifdef __bsdi__ + " (BSD/386 1.0)", +#else +#ifdef __386BSD__ + " (386BSD)", +#else + " (Unknown BSD)" +#endif /* __386BSD__ */ +#endif /* __bsdi__ */ +#endif /* FreeBSD */ +#endif /* NetBSD */ +#endif /* BSD > 199103 */ +#else +#if defined(i486) || defined(__i486) || defined(__i486__) + " (Intel 486)", +#else +#if defined(i386) || defined(__i386) || defined(__i386__) + " (Intel 386)", +#else +#ifdef pyr + " (Pyramid)", +#else +#if defined(ultrix) || defined(__ultrix) +# if defined(mips) || defined(__mips) + " (DEC/MIPS)", +# else +# if defined(vax) || defined(__vax) + " (DEC/VAX)", +# else /* __alpha? */ + " (DEC/Alpha)", +# endif +# endif +#else +#ifdef gould + " (Gould)", +#else +#ifdef MTS + " (MTS)", +#else +#ifdef __convexc__ + " (Convex)", +#else +#ifdef __QNX__ + " (QNX 4)", +#else +#ifdef __QNXNTO__ + " (QNX Neutrino)", +#else + "", +#endif /* QNX Neutrino */ +#endif /* QNX 4 */ +#endif /* Convex */ +#endif /* MTS */ +#endif /* Gould */ +#endif /* DEC */ +#endif /* Pyramid */ +#endif /* 386 */ +#endif /* 486 */ +#endif /* BSD */ +#endif /* SCO Xenix */ +#endif /* SCO Unix */ +#endif /* Minix */ +#endif /* Linux */ +#endif /* NeXT */ +#endif /* Amdahl */ +#endif /* Cray */ +#endif /* RT/AIX */ +#endif /* AIX */ +#endif /* OSF/1 */ +#endif /* HP/UX */ +#endif /* Sun */ +#endif /* SGI */ + +#ifdef __DATE__ + " on ", __DATE__ +#else + "", "" +#endif + ); + +} /* end function version_local() */ + +const char *BOINC_RCSID_e162ca2fdb = "$Id: z_unix.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/util.c boinc-7.0.14+dfsg/zip/zip/util.c --- boinc-7.0.7+dfsg/zip/zip/util.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/util.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,690 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * util.c by Mark Adler. + */ +#define __UTIL_C + +#include "zip.h" +#include "ebcdic.h" +#include + +#ifdef MSDOS16 +# include +#endif + +uch upper[256], lower[256]; +/* Country-dependent case map table */ + + +#ifndef UTIL /* UTIL picks out namecmp code (all utils) */ + +/* Local functions */ +local int recmatch OF((ZCONST uch *, ZCONST uch *, int)); +local int count_args OF((char *s)); + +#ifdef MSDOS16 + local unsigned ident OF((unsigned chr)); +#endif + +#ifdef NO_MKTIME +#include "mktime.c" +#endif + +#ifndef HAVE_FSEEKABLE +int fseekable(fp) +FILE *fp; +{ + long x; + + return (fp == NULL || (fseek(fp, -1L, SEEK_CUR) == 0 && + (x = ftell(fp)) >= 0 && + fseek(fp, 1L, SEEK_CUR) == 0 && + ftell(fp) == x + 1)); +} +#endif /* HAVE_FSEEKABLE */ + +char *isshexp(p) +char *p; /* candidate sh expression */ +/* If p is a sh expression, a pointer to the first special character is + returned. Otherwise, NULL is returned. */ +{ + for (; *p; INCSTR(p)) + if (*p == '\\' && *(p+1)) + p++; +#ifdef VMS + else if (*p == '%' || *p == '*') +#else /* !VMS */ +# ifdef RISCOS + /* RISC OS uses # as its single-character wildcard */ + else if (*p == '#' || *p == '*' || *p == '[') +# else /* !RISC OS */ + else if (*p == '?' || *p == '*' || *p == '[') +# endif +#endif /* ?VMS */ + return p; + return NULL; +} + + +local int recmatch(p, s, cs) +ZCONST uch *p; /* sh pattern to match */ +ZCONST uch *s; /* string to match it to */ +int cs; /* flag: force case-sensitive matching */ +/* Recursively compare the sh pattern p with the string s and return 1 if + they match, and 0 or 2 if they don't or if there is a syntax error in the + pattern. This routine recurses on itself no deeper than the number of + characters in the pattern. */ +{ + unsigned int c; /* pattern char or start of range in [-] loop */ + /* Get first character, the pattern for new recmatch calls follows */ + c = *POSTINCSTR(p); + + /* If that was the end of the pattern, match if string empty too */ + if (c == 0) + return *s == 0; + + /* '?' (or '%' or '#') matches any character (but not an empty string) */ +#ifdef VMS + if (c == '%') +#else /* !VMS */ +# ifdef RISCOS + if (c == '#') +# else /* !RISC OS */ + if (c == '?') +# endif +#endif /* ?VMS */ +#ifdef WILD_STOP_AT_DIR + return (*s && *s != '/') ? recmatch(p, s + CLEN(s), cs) : 0; +#else + return *s ? recmatch(p, s + CLEN(s), cs) : 0; +#endif + + /* '*' matches any number of characters, including zero */ +#ifdef AMIGA + if (c == '#' && *p == '?') /* "#?" is Amiga-ese for "*" */ + c = '*', p++; +#endif /* AMIGA */ + if (c == '*') + { + if (*p == 0) + return 1; +#ifdef WILD_STOP_AT_DIR + for (; *s && *s != '/'; INCSTR(s)) + if ((c = recmatch(p, s, cs)) != 0) + return (int)c; + return (*p == '/' || (*p == '\\' && p[1] == '/')) + ? recmatch(p, s, cs) : 2; +#else /* !WILD_STOP_AT_DIR */ + for (; *s; INCSTR(s)) + if ((c = recmatch(p, s, cs)) != 0) + return (int)c; + return 2; /* 2 means give up--shmatch will return false */ +#endif /* ?WILD_STOP_AT_DIR */ + } + +#ifndef VMS /* No bracket matching in VMS */ + /* Parse and process the list of characters and ranges in brackets */ + if (c == '[') + { + int e; /* flag true if next char to be taken literally */ + ZCONST uch *q; /* pointer to end of [-] group */ + int r; /* flag true to match anything but the range */ + + if (*s == 0) /* need a character to match */ + return 0; + p += (r = (*p == '!' || *p == '^')); /* see if reverse */ + for (q = p, e = 0; *q; q++) /* find closing bracket */ + if (e) + e = 0; + else + if (*q == '\\') + e = 1; + else if (*q == ']') + break; + if (*q != ']') /* nothing matches if bad syntax */ + return 0; + for (c = 0, e = *p == '-'; p < q; p++) /* go through the list */ + { + if (e == 0 && *p == '\\') /* set escape flag if \ */ + e = 1; + else if (e == 0 && *p == '-') /* set start of range if - */ + c = *(p-1); + else + { + uch cc = (cs ? *s : case_map(*s)); + if (*(p+1) != '-') + for (c = c ? c : (unsigned)*p; c <= (unsigned)*p; c++) + /* compare range */ + if ((cs ? c : case_map(c)) == cc) + return r ? 0 : recmatch(q + CLEN(q), s + CLEN(s), cs); + c = e = 0; /* clear range, escape flags */ + } + } + return r ? recmatch(q + CLEN(q), s + CLEN(s), cs) : 0; + /* bracket match failed */ + } +#endif /* !VMS */ + + /* If escape ('\'), just compare next character */ + if (c == '\\') + if ((c = *p++) == '\0') /* if \ at end, then syntax error */ + return 0; + + /* Just a character--compare it */ + return (cs ? c == *s : case_map(c) == case_map(*s)) ? + recmatch(p, s + CLEN(s), cs) : 0; +} + + +int shmatch(p, s, cs) +ZCONST char *p; /* sh pattern to match */ +ZCONST char *s; /* string to match it to */ +int cs; /* force case-sensitive match if TRUE */ +/* Compare the sh pattern p with the string s and return true if they match, + false if they don't or if there is a syntax error in the pattern. */ +{ +//printf("Match %s %s %d\n", p, s, cs); + return recmatch((ZCONST uch *) p, (ZCONST uch *) s, cs) == 1; +} + + +#if defined(DOS) || defined(WIN32) || defined(UNIX) +/* XXX also suitable for OS2? Atari? Human68K? TOPS-20?? */ + +int dosmatch(p, s, cs) +ZCONST char *p; /* dos pattern to match */ +ZCONST char *s; /* string to match it to */ +int cs; /* force case-sensitive match if TRUE */ +/* Treat filenames without periods as having an implicit trailing period */ +{ + char *s1; /* revised string to match */ + int r; /* result */ + + if ((s1 = malloc(strlen(s) + 2)) == NULL) + /* will usually be OK */ + return recmatch((ZCONST uch *) p, (ZCONST uch *) s, cs) == 1; + strcpy(s1, s); + if (strchr(p, '.') && !strchr(s1, '.')) + strcat(s1, "."); + r = recmatch((ZCONST uch *)p, (ZCONST uch *)s1, cs); + free((zvoid *)s1); + return r == 1; +} + +#endif /* DOS || WIN32 */ + +zvoid far **search(b, a, n, cmp) +ZCONST zvoid *b; /* pointer to value to search for */ +ZCONST zvoid far **a; /* table of pointers to values, sorted */ +extent n; /* number of pointers in a[] */ +int (*cmp) OF((ZCONST zvoid *, ZCONST zvoid far *)); /* comparison function */ + +/* Search for b in the pointer list a[0..n-1] using the compare function + cmp(b, c) where c is an element of a[i] and cmp() returns negative if + *b < *c, zero if *b == *c, or positive if *b > *c. If *b is found, + search returns a pointer to the entry in a[], else search() returns + NULL. The nature and size of *b and *c (they can be different) are + left up to the cmp() function. A binary search is used, and it is + assumed that the list is sorted in ascending order. */ +{ + ZCONST zvoid far **i; /* pointer to midpoint of current range */ + ZCONST zvoid far **l; /* pointer to lower end of current range */ + int r; /* result of (*cmp)() call */ + ZCONST zvoid far **u; /* pointer to upper end of current range */ + + l = (ZCONST zvoid far **)a; u = l + (n-1); + while (u >= l) { + i = l + ((unsigned)(u - l) >> 1); + if ((r = (*cmp)(b, (ZCONST char far *)*(struct zlist far **)i)) < 0) + u = i - 1; + else if (r > 0) + l = i + 1; + else + return (zvoid far **)i; + } + return NULL; /* If b were in list, it would belong at l */ +} + +#endif /* !UTIL */ + +#ifdef MSDOS16 + +local unsigned ident(unsigned chr) +{ + return chr; /* in al */ +} + +void init_upper() +{ + static struct country { + uch ignore[18]; + int (far *casemap)(int); + uch filler[16]; + } country_info; + + struct country far *info = &country_info; + union REGS regs; + struct SREGS sregs; + unsigned int c; + + regs.x.ax = 0x3800; /* get country info */ + regs.x.dx = FP_OFF(info); + sregs.ds = FP_SEG(info); + intdosx(®s, ®s, &sregs); + for (c = 0; c < 128; c++) { + upper[c] = (uch) toupper(c); + lower[c] = (uch) c; + } + for (; c < sizeof(upper); c++) { + upper[c] = (uch) (*country_info.casemap)(ident(c)); + /* ident() required because casemap takes its parameter in al */ + lower[c] = (uch) c; + } + for (c = 0; c < sizeof(upper); c++ ) { + int u = upper[c]; + if (u != c && lower[u] == (uch) u) { + lower[u] = (uch)c; + } + } + for (c = 'A'; c <= 'Z'; c++) { + lower[c] = (uch) (c - 'A' + 'a'); + } +} +#else /* !MSDOS16 */ +# ifndef OS2 + +void init_upper() +{ + unsigned int c; +#if defined(ATARI) || defined(CMS_MVS) +#include +/* this should be valid for all other platforms too. (HD 11/11/95) */ + for (c = 0; c< sizeof(upper); c++) { + upper[c] = islower(c) ? toupper(c) : c; + lower[c] = isupper(c) ? tolower(c) : c; + } +#else + for (c = 0; c < sizeof(upper); c++) upper[c] = lower[c] = (uch)c; + for (c = 'a'; c <= 'z'; c++) upper[c] = (uch)(c - 'a' + 'A'); + for (c = 'A'; c <= 'Z'; c++) lower[c] = (uch)(c - 'A' + 'a'); +#endif +} +# endif /* !OS2 */ + +#endif /* ?MSDOS16 */ + +int namecmp(string1, string2) + ZCONST char *string1, *string2; +/* Compare the two strings ignoring case, and correctly taking into + * account national language characters. For operating systems with + * case sensitive file names, this function is equivalent to strcmp. + */ +{ + int d; + + for (;;) + { + d = (int) (uch) case_map(*string1) + - (int) (uch) case_map(*string2); + + if (d || *string1 == 0 || *string2 == 0) + return d; + + string1++; + string2++; + } +} + +#ifdef EBCDIC +char *strtoasc(char *str1, ZCONST char *str2) +{ + char *old; + old = str1; + while (*str1++ = (char)ascii[(uch)(*str2++)]); + return old; +} + +char *strtoebc(char *str1, ZCONST char *str2) +{ + char *old; + old = str1; + while (*str1++ = (char)ebcdic[(uch)(*str2++)]); + return old; +} + +char *memtoasc(char *mem1, ZCONST char *mem2, unsigned len) +{ + char *old; + old = mem1; + while (len--) + *mem1++ = (char)ascii[(uch)(*mem2++)]; + return old; +} + +char *memtoebc(char *mem1, ZCONST char *mem2, unsigned len) +{ + char *old; + old = mem1; + while (len--) + *mem1++ = (char)ebcdic[(uch)(*mem2++)]; + return old; +} +#endif /* EBCDIC */ + +#ifdef IZ_ISO2OEM_ARRAY +char *str_iso_to_oem(dst, src) + ZCONST char *src; + char *dst; +{ + char *dest_start = dst; + while (*dst++ = (char)iso2oem[(uch)(*src++)]); + return dest_start; +} +#endif + +#ifdef IZ_OEM2ISO_ARRAY +char *str_oem_to_iso(dst, src) + ZCONST char *src; + char *dst; +{ + char *dest_start = dst; + while (*dst++ = (char)oem2iso[(uch)(*src++)]); + return dest_start; +} +#endif + + + +/* DBCS support for Info-ZIP's zip (mainly for japanese (-: ) + * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) + * This code is public domain! Date: 1998/12/20 + */ +#ifdef _MBCS + +char *___tmp_ptr; + +int lastchar(ptr) + ZCONST char *ptr; +{ + ZCONST char *oldptr = ptr; + while(*ptr != '\0'){ + oldptr = ptr; + INCSTR(ptr); + } + return (int)(unsigned)*oldptr; +} + +unsigned char *zmbschr(str, c) + ZCONST unsigned char *str; + unsigned int c; +{ + while(*str != '\0'){ + if (*str == c) {return (char*)str;} + INCSTR(str); + } + return NULL; +} + +unsigned char *zmbsrchr(str, c) + ZCONST unsigned char *str; + unsigned int c; +{ + unsigned char *match = NULL; + while(*str != '\0'){ + if (*str == c) {match = (char*)str;} + INCSTR(str); + } + return match; +} +#endif /* _MBCS */ + + + +#ifndef UTIL + +extern char *getenv(); + +/* this is in unzip/envargs + + **************************************************************** + | envargs - add default options from environment to command line + |---------------------------------------------------------------- + | Author: Bill Davidsen, original 10/13/91, revised 23 Oct 1991. + | This program is in the public domain. + |---------------------------------------------------------------- + | Minor program notes: + | 1. Yes, the indirection is a tad complex + | 2. Parenthesis were added where not needed in some cases + | to make the action of the code less obscure. + *************************************************************** + +void envargs(Pargc, Pargv, envstr, envstr2) + int *Pargc; + char ***Pargv; + char *envstr; + char *envstr2; +{ + char *envptr; + char *bufptr; + int argc; + register int ch; + char **argv; + char **argvect; + + envptr = getenv(envstr); + if (envptr != NULL) + while (isspace((uch)*envptr)) + envptr++; + if (envptr == NULL || *envptr == '\0') + if ((envptr = getenv(envstr2)) != NULL) + while (isspace((uch)*envptr)) + envptr++; + if (envptr == NULL || *envptr == '\0') + return; + + argc = count_args(envptr); + bufptr = malloc(1 + strlen(envptr)); + if (bufptr == NULL) + ziperr(ZE_MEM, "Can't get memory for arguments"); + strcpy(bufptr, envptr); + + argv = (char **)malloc((argc + *Pargc + 1) * sizeof(char *)); + if (argv == NULL) { + free(bufptr); + ziperr(ZE_MEM, "Can't get memory for arguments"); + } + argvect = argv; + + *(argv++) = *((*Pargv)++); + do { +#if defined(AMIGA) || defined(UNIX) + if (*bufptr == '"') { + char *argstart = ++bufptr; + *(argv++) = argstart; + for (ch = *bufptr; ch != '\0' && ch != '\"'; + ch = *PREINCSTR(bufptr)) + if (ch == '\\' && bufptr[1] != '\0') + ++bufptr; + if (ch != '\0') + *(bufptr++) = '\0'; + + while ((argstart = MBSCHR(argstart, '\\')) != NULL) { + strcpy(argstart, argstart + 1); + if (*argstart) + ++argstart; + } + } else { + *(argv++) = bufptr; + while ((ch = *bufptr) != '\0' && !isspace((uch)ch)) INCSTR(bufptr); + if (ch != '\0') *(bufptr++) = '\0'; + } +#else +# ifdef WIN32 + if (*bufptr == '"') { + *(argv++) = ++bufptr; + while ((ch = *bufptr) != '\0' && ch != '\"') INCSTR(bufptr); + if (ch != '\0') *(bufptr++) = '\0'; + } else { + *(argv++) = bufptr; + while ((ch = *bufptr) != '\0' && !isspace((uch)ch)) INCSTR(bufptr); + if (ch != '\0') *(bufptr++) = '\0'; + } +# else + *(argv++) = bufptr; + while ((ch = *bufptr) != '\0' && !isspace((uch)ch)) INCSTR(bufptr); + if (ch != '\0') *(bufptr++) = '\0'; +# endif +#endif + while ((ch = *bufptr) != '\0' && isspace((uch)ch)) INCSTR(bufptr); + } while (ch); + + argc += *Pargc; + while (--(*Pargc)) *(argv++) = *((*Pargv)++); + + *argv = NULL; + + *Pargv = argvect; + *Pargc = argc; +} + +*/ + +static int count_args(s) +char *s; +{ + int count = 0; + char ch; + + do { + /* count and skip args */ + ++count; +#if defined(AMIGA) || defined(UNIX) + if (*s == '\"') { + for (ch = *PREINCSTR(s); ch != '\0' && ch != '\"'; + ch = *PREINCSTR(s)) + if (ch == '\\' && s[1] != '\0') + INCSTR(s); + if (*s) INCSTR(s); /* trailing quote */ + } else + while ((ch = *s) != '\0' && !isspace((uch)ch)) INCSTR(s); +#else +# ifdef WIN32 + if (*s == '\"') { + ++s; /* leading quote */ + while ((ch = *s) != '\0' && ch != '\"') INCSTR(s); + if (*s) INCSTR(s); /* trailing quote */ + } else + while ((ch = *s) != '\0' && !isspace((uch)ch)) INCSTR(s); +# else + while ((ch = *s) != '\0' && !isspace((uch)ch)) INCSTR(s); +# endif +#endif /* ?(AMIGA || UNIX) */ + while ((ch = *s) != '\0' && isspace((uch)ch)) INCSTR(s); + } while (ch); + + return(count); +} + + + +/* Extended argument processing -- by Rich Wales + * This function currently deals only with the MKS shell, but could be + * extended later to understand other conventions. + * + * void expand_args(int *argcp, char ***argvp) + * + * Substitutes the extended command line argument list produced by + * the MKS Korn Shell in place of the command line info from DOS. + * + * The MKS shell gets around DOS's 128-byte limit on the length of + * a command line by passing the "real" command line in the envi- + * ronment. The "real" arguments are flagged by prepending a tilde + * (~) to each one. + * + * This "expand_args" routine creates a new argument list by scanning + * the environment from the beginning, looking for strings begin- + * ning with a tilde character. The new list replaces the original + * "argv" (pointed to by "argvp"), and the number of arguments + * in the new list replaces the original "argc" (pointed to by + * "argcp"). + */ +void expand_args(argcp, argvp) + int *argcp; + char ***argvp; +{ +#ifdef DOS + +/* Do NEVER include (re)definiton of `environ' variable with any version + of MSC or BORLAND/Turbo C. These compilers supply an incompatible + definition in . */ +#if defined(__GO32__) || defined(__EMX__) + extern char **environ; /* environment */ +#endif /* __GO32__ || __EMX__ */ + char **envp; /* pointer into environment */ + char **newargv; /* new argument list */ + char **argp; /* pointer into new arg list */ + int newargc; /* new argument count */ + + /* sanity check */ + if (environ == NULL + || argcp == NULL + || argvp == NULL || *argvp == NULL) + return; + /* find out how many environment arguments there are */ + for (envp = environ, newargc = 0; + *envp != NULL && (*envp)[0] == '~'; + envp++, newargc++) ; + if (newargc == 0) + return; /* no environment arguments */ + /* set up new argument list */ + newargv = (char **) malloc(sizeof(char **) * (newargc+1)); + if (newargv == NULL) + return; /* malloc failed */ + for (argp = newargv, envp = environ; + *envp != NULL && (*envp)[0] == '~'; + *argp++ = &(*envp++)[1]) ; + *argp = NULL; /* null-terminate the list */ + /* substitute new argument list in place of old one */ + *argcp = newargc; + *argvp = newargv; +#else /* !DOS */ + if (argcp || argvp) return; +#endif /* ?DOS */ +} + +#endif /* UTIL */ + +#ifdef DEBUGNAMES +#undef free +int Free(x) +void *x; +{ + if (x == (void *) 0xdeadbeef) + exit(-1); + free(x); + return 0; +} + +int printnames() +{ + struct zlist far *z; + + for (z = zfiles; z != NULL; z = z->nxt) + fprintf(stderr, "%s %s %s %p %p %p %08x %08x %08x\n", + z->name, z->zname, z->iname, + z->name, z->zname, z->iname, + *((int *) z->name), *((int *) z->zname), + *((int *) z->iname)); + return 0; +} + +#endif /* DEBUGNAMES */ + +const char *BOINC_RCSID_a327698ed4 = "$Id: util.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/WHATSNEW boinc-7.0.14+dfsg/zip/zip/WHATSNEW --- boinc-7.0.7+dfsg/zip/zip/WHATSNEW 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/WHATSNEW 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,24 @@ +New things in Zip 2.3 + +- IBM OS/390 port (Unix like, but EBCDIC) by Paul von Behren +- Apple Macintosh (MACOS) port by Dirk Haase +- Theos port by Jean-Michel Dubois +- Multibyte characterset support by Yoshioka Tsuneo +- Support for ISO 8601 date format with -t and -tt options +- Info-ZIP license + +New things in Zip 2.2 + +- BEOS port by Chris Herborth +- QDOS port by Jonathan Hudson +- TANDEM port by Dave Smith +- WINDLL port (16-bit Win 3.x and 32-bit WinNT/Win95) by Mike White +- SYSV packages support by John Bush +- zip -P SeCrEt encrypts entries in the zip file with password SeCrEt + (WARNING: THIS IS INSECURE, use at your own risk) +- zip -R recurses into subdirectories of current dir like "PKZIP -rP" +- zip -x@exclude.lst excludes files specified in the file exclude.lst +- zip -i@include.lst includes files specified in the file include.lst +- zip -@ only handles one filename per line, but supports whitespace in names +- zip -t mmddyyyy, 4 digit year number for uniqueness of years beyond 2000 +- zip -tt mmddyyyy only includes files before a specified date diff -Nru boinc-7.0.7+dfsg/zip/zip/WHERE boinc-7.0.14+dfsg/zip/zip/WHERE --- boinc-7.0.7+dfsg/zip/zip/WHERE 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/WHERE 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,351 @@ +__________________________________________________________________________ + + This is the Info-ZIP file ``WHERE,'' last updated on 18 November 1998. +__________________________________________________________________________ + + The latest version of this file can be found online at: + + http://www.cdrom.com/pub/infozip/doc/WHERE + + Note that some ftp sites may not yet have the latest versions of Zip + and UnZip when you read this. The latest versions always appear in + http://www.cdrom.com/pub/infozip/ (and subdirectories thereof) first, + except for encryption sources and binaries, which always appear in + ftp://ftp.icce.rug.nl/infozip/ (and subdirectories) first. + + IF YOU FIND AN ERROR: please let us know! We don't have time to + check each and every site personally (or even collectively), so any + number of the sites listed below may have moved or disappeared en- + tirely. E-mail to Zip-Bugs@lists.wku.edu and we'll update this file. +__________________________________________________________________________ + + +Info-ZIP's home WWW site is listed on Yahoo and is at: + + http://www.cdrom.com/pub/infozip/ + +The Zip and UnZip pages have links to most known mirror sites carrying our +source and/or binary distributions, and they generally are more up-to-date +and have better information than what you are reading: + + http://www.cdrom.com/pub/infozip/Zip.html + http://www.cdrom.com/pub/infozip/UnZip.html + +The related zlib package by Info-ZIP's Jean-loup Gailly and Mark Adler is at: + + http://www.cdrom.com/pub/infozip/zlib/ + +Source-code archives for Info-ZIP's portable Zip, UnZip, and related +utilities: + + zip23.zip Zip 2.3 (deflation; includes zipnote, zipsplit, zipcloak) + zip23.tar.Z ditto, compress'd tar format + + zip11.zip Zip 1.1 (shrinking, implosion; compatible w. PKUNZIP 1.1) + zip11.tar.Z ditto, compress'd tar format + + unzip540.zip UnZip 5.4 (all methods[*]; unzip/funzip/unzipsfx/zipgrep) + unzip540.tar.Z ditto, compress'd tar format + + zcrypt28.zip encryption/decryption support for Zip 2.3x and UnZip 5.4x + zcrypt10.zip encryption support for Zip 1.1 + + MacZip100src.zip contains all the GUI stuff and the project files to build + the MacZip main-app. To build MacZip successfully, both + the Zip 2.3 and UnZip 5.4 sources are required, too. + + wiz41.zip WiZ 4.1, Windows 3.x/95/NT GUI front-end for Info-ZIP DLLs + +[*] Unreducing and unshrinking are not turned on by default but are included + in source form. See UnZip's INSTALL file for details. + +Executables archives (and related files) for Info-ZIP's software; not all +of these will be immediately available due to lack of access to appropriate +systems on the part of Info-ZIP members. See the BBS section below for +special CompuServe (6.3) filenames: + + zip23x.zip MSDOS executables and docs (no encryption) + zcr23x.zip MSDOS executables and docs (with encryption) + zip23x1.zip OS/2 1.x (16-bit) executables and docs (no encryption) + zcr23x1.zip OS/2 1.x (16-bit) executables and docs (with encryption) + zip23x2.zip OS/2 2/3/4.x (32-bit) executables and docs (no encryption) + zcr23x2.zip OS/2 2/3/4.x (32-bit) executables and docs (w/encryption) + zip23xA.zip Amiga executables and docs (no encryption) + zcr23xA.zip Amiga executables and docs (with encryption) + zip23xB.zip BeOS executables and docs (no encryption) + zcr23xB.zip BeOS executables and docs (with encryption) + zip23xC.zip VM/CMS executable and docs (no encryption) + zcr23xC.zip VM/CMS executable and docs (with encryption) + zip23xK.zip Tandem NSK executables and docs (no encryption) + zcr23xK.zip Tandem NSK executables and docs (with encryption) + zip23xM.xmit MVS classic executable (no encryption) + zcr23xM.xmit MVS classic executable (with encryption) + zip23xM-docs.zip MVS classic port, docs only + zip23dN.zip WinNT/Win95 (Intel) DLL, header files, docs (no encryption) + zcr23dN.zip WinNT/Win95 (Intel) DLL, header files, docs (w/encryption) + zip23xN.zip WinNT/Win95 (Intel) executables and docs (no encryption) + zcr23xN.zip WinNT/Win95 (Intel) executables and docs (with encryption) + zip23xN-axp.zip WinNT (Alpha AXP) executables and docs (no encryption) + zcr23xN-axp.zip WinNT (Alpha AXP) executables and docs (with encryption) + zip23xN-mip.zip WinNT (MIPS R4000) executables and docs (no encryption) + zcr23xN-mip.zip WinNT (MIPS R4000) executables and docs (with encryption) + zip23xN-ppc.zip WinNT (PowerPC) executables and docs (no encryption) + zcr23xN-ppc.zip WinNT (PowerPC) executables and docs (with encryption) + zip23xO.zip IBM OS/390 Open Edition binaries and docs (no encryption) + zcr23xO.zip IBM OS/390 Open Edition binaries and docs (w/ encryption) + zip23xQ.zip SMS/QDOS executables and docs (no encryption) + zcr23xQ.zip SMS/QDOS executables and docs (with encryption) + zip23xR.zip Acorn RISC OS executables and docs (no encryption) + zcr23xR.zip Acorn RISC OS executables and docs (with encryption) + zip23xT.zip Atari TOS executables and docs (no encryption) + zcr23xT.zip Atari TOS executables and docs (with encryption) + zip23-vms-axp-obj.zip (no encryption) + VMS (Alpha AXP) object libs, link procedure and docs + zip23-vms-axp-exe.zip (no encryption) + VMS (Alpha AXP) executables for VMS 6.1 or later and docs + zip23-vms-vax-decc-obj.zip (no encryption) + VMS (VAX) object libs (new DEC C), link procedure and docs + zip23-vms-vax-decc-exe.zip (no encryption) + VMS (VAX) executables (DEC C) for VMS 6.1 or later; docs + zip23-vms-vax-vaxc-obj.zip (no encryption) + VMS (VAX) object libs (old VAX C), link procedure and docs + zcr23-vms-axp-obj.zip (with encryption) + VMS (Alpha AXP) object libs, link procedure and docs + zcr23-vms-axp-exe.zip (with encryption) + VMS (Alpha AXP) executables for VMS 6.1 or later and docs + zcr23-vms-vax-decc-obj.zip (with encryption) + VMS (VAX) object libs (new DEC C), link procedure and docs + zcr23-vms-vax-decc-exe.zip (with encryption) + VMS (VAX) executables (DEC C) for VMS 6.1 or later; docs + zcr23-vms-vax-vaxc-obj.zip (with encryption) + VMS (VAX) object libs (old VAX C), link procedure and docs + zip23x.hqx Macintosh BinHex'd executables and docs (no encryption) + + unz540x.exe MSDOS self-extracting executable (16-bit unzip, ..., docs) + unz540x3.exe MSDOS self-extracting executable (16-, 32-bit unzip, docs) + unz540x1.exe OS/2 1.x (16-bit) self-extracting executables and docs + unz540x2.exe OS/2 2/3/4.x (32-bit) self-extracting executables and docs + unz540d2.zip OS/2 2/3/4.x (32-bit) DLL, header file, demo exe and docs + unz540xA.ami Amiga self-extracting executables and docs + unz540xA.lha Amiga executables and docs, LHa archive + unz540xB.sfx BeOS self-extracting executables and docs + unz540xB.tar.gz BeOS executables and docs, gzip'd tar archive + unz540xC.mod VM/CMS executable module in "packed" format + unz540xC-docs.zip VM/CMS docs, only + unz540xF.zip FlexOS executable and docs + unz540xK.zip Tandem NSK executable and docs + unz540xM.xmit MVS classic executable + unz540xM-docs.zip MVS classic port, docs only + unz540dN.zip WinNT/Win95 (32-bit Intel) DLL, header files, docs + unz540xN.exe WinNT/Win95 self-extracting Intel executables and docs + unz540xN-axp.exe WinNT (Alpha AXP) self-extracting executables and docs + unz540xN-mip.exe WinNT (MIPS R4000) self-extracting executables and docs + unz540xN-ppc.exe WinNT (PowerPC) self-extracting executables and docs + unz540xQ.sfx SMS/QDOS self-extracting executables and docs + unz540xO.tar.Z IBM OS/390 Open edition (Unix-like), exes and docs + unz540xR.exe Acorn RISC OS self-extracting executables and docs + unz540xR.spk Acorn RISC OS Spark'd executables and docs + unz540xT.tos Atari TOS self-extracting executables and docs + unz540x-vms-axp-obj.bck VMS backup saveset, + contains UnZip (Alpha) obj libs, link procedure, docs + unz540x-vms-axp-obj.exe VMS (Alpha AXP) SFX archive (statically linked), + contains UnZip (Alpha) obj libs, link procedure, docs + unz540x-vms-axp-exe.exe VMS (Alpha AXP) SFX archive (dynamically linked), + contains UnZip (Alpha AXP, DEC C) executables and docs, + smaller than object archive, but requires VMS 6.1 + unz540x-vms-vax-decc-obj.bck VMS backup saveset, + contains UnZip (new DEC C) obj libs, link procedure, docs + unz540x-vms-vax-decc-obj.exe VMS (VAX) SFX archive (statically linked), + contains UnZip (new DEC C) obj libs, link procedure, docs + unz540x-vms-vax-decc-exe.exe VMS (VAX) SFX archive (dynamically linked), + contains UnZip (new DEC C) executables and docs, + smaller than object archive, but requires VMS 6.1 + unz540x-vms-vax-vaxc-obj.bck VMS backup saveset, + contains UnZip (old VAX C) obj libs, link procedure, docs + unz540x-vms-vax-vaxc-obj.exe VMS (VAX) SFX archive (statically linked), + contains UnZip (old VAX C) obj libs, link procedure, docs + unz540x.hqx Macintosh BinHex'd executables and docs for unzip + (unz540x.tar.{Z,gz} Unix exes/docs for Solaris 2.x, SCO Unix, Linux, etc., + depending on directory/location; generally only provided + in cases where the OS does *not* ship with a bundled C + compiler) + + MacZip100nc.hqx Macintosh combined Zip&UnZip application with GUI, + executables and docs (no encryption) + MacZip100c.hqx Macintosh combined Zip&UnZip application with GUI, + executables and docs (with encryption) + + wiz41xN.exe WiZ 4.1 32-bit (WinNT/Win95) app+docs (self-extracting), + includes unz540dN.zip & zcr23dN.zip (WinNT/95 32-bit DLLs) + + UnzpHist.zip complete changes-history of UnZip and its precursors + ZipHist.zip complete changes-history of Zip + +The latest from PKWARE (the guys who started it all): + + pkz204g.exe MS-DOS PKZIP/PKUNZIP 2.04g (self-extracting archive) + pkz110eu.exe MS-DOS PKZIP/PKUNZIP 1.1 (self-extracting) + pkos2250.exe OS/2 PKZIP/PKUNZIP 2.50 (self-extracting) + pkz102-2.exe OS/2 PKZIP/PKUNZIP 1.02 (self-extracting) + pk263w16.exe Windows 16-bit PKZIP/PKUNZIP 2.60.03 (self-extracting) + pk263wsp.exe Windows 32-bit PKZIP/PKUNZIP 2.60.03 (self-extracting) + pk260w_a.exe Windows NT/Alpha PKZIP/PKUNZIP 2.60 (self-extracting) + pk260w_p.exe Windows NT/PowerPC PKZIP/PKUNZIP 2.60 (self-extracting) + pk250c32.exe Win95/NT command line PKZIP/PKUNZIP 2.50 (self-extracting) + pk250c_a.exe Windows NT/Alpha command line PKZIP 2.50 (self-extracting) + pk250c_p.exe Windows NT/PPC command line PKZIP 2.50 (self-extracting) + pk???251.exe Unix PKZIP 2.51, ???=sun,dig,aix,sco,hpx,lin (self-extr.) + +Third-party software that incorporates Info-ZIP code: + + OS/2: Warp 3.0 BonusPak, FileJet, The UnZip Shell, zipmeister (PMZip), + ZipFly(?) + Windows (NT, 95 and/or 3.x): Nico Mak WinZip, InnerMedia DynaZIP DLL, + NewVision Zip[Shell] Pro, FlashPoint ZIP Navigator and Unzip95, + Z (port of ZipInfo; z101.zip) + MS-DOS: FileJet + Macintosh: ZipIt + generic Unix: lzpip103.zip + +Third-party software that uses (or can use) Info-ZIP software: + + OS/2: Zip Control, ZiPMe, Workplace Shell UnZip (WUZ), Drop and Zip, + Archive Front End, Archive Manager, Archive Viewer, File Manager/2, + FileStar/2, ZTreeBold, PMZipper, simple zipshell, HyperView, XBBS-OS/2, + LiveWire + Windows: WinCMD + MS-DOS: SHEZ archiver shell + NeXTStep 3.x: Opener + +ftp/web sites for the US-exportable sources and executables: + + NOTE: Look for the Info-ZIP file names given above (not PKWARE or third- + party stuff) in the following locations. Some sites like to use slightly + different names, such as zip-2.3.tar.gz instead of zip23.tar.Z. + + ftp://ftp.cdrom.com/pub/infozip/ [THE INFO-ZIP HOME SITE] + ftp://ftp.uu.net/pub/archiving/zip/ [MIRRORS THE INFO-ZIP HOME SITE] + ftp://ftp.simtel.net/pub/simtelnet/infozip/ [MIRRORS THE INFO-ZIP HOME SITE] + ftp://sunsite.doc.ic.ac.uk/packages/zip/ [MIRRORS THE INFO-ZIP HOME SITE] + ftp://unix.hensa.ac.uk/mirrors/uunet/pub/archiving/zip/ + + ftp://ftp.cmdl.noaa.gov/aerosol/doc/archiver/{all,dos,os2,mac,vax_alpha}/ + ftp://garbo.uwasa.fi/pc/arcers/ [AND OTHER GARBO MIRRORS] + ftp://garbo.uwasa.fi/unix/arcers/ [AND OTHER GARBO MIRRORS] + ftp://ftp.elf.stuba.sk/pub/pc/pack/ [AND OTHER STUBA MIRRORS] + ftp://ftp-os2.cdrom.com/pub/os2/archiver/ + ftp://ftp-os2.nmsu.edu/os2/archiver/ + ftp://ftp.informatik.tu-muenchen.de/pub/comp/os/os2/archiver/ + ftp://sumex-aim.stanford.edu/info-mac/cmp/ + ftp://ftp.wustl.edu/pub/aminet/util/arc/ [AND OTHER AMINET MIRRORS] + ftp://atari.archive.umich.edu/pub/Archivers/ [AND OTHER UMICH MIRRORS] + http://www.umich.edu/~archive/atari/Archivers/ + ftp://jake.educom.com.au/pub/infozip/acorn/ [Acorn RISC OS] + http://www.sitec.net/maczip/ [MacZip port] + +ftp/web sites for the encryption and decryption sources and/or executables: + + NOTE: Non-US users, please do NOT ftp from the US sites (US regulations + and all that). Likewise, US users, please do not ftp from the European + sites if it can be avoided (it's not illegal, but it is a waste of + expensive trans-Atlantic bandwidth). + + From the US: + ftp://ftp.wustl.edu/mirrors/garbo.uwasa.fi/arcers/ + + Outside the US: + ftp://ftp.icce.rug.nl/infozip/ [THE INFO-ZIP ENCRYPTION HOME SITE] + ftp://ftp.elf.stuba.sk/pub/pc/pack/ + ftp://garbo.uwasa.fi/pc/arcers/ + ftp://ftp.inria.fr/system/arch-compr/ + ftp://ftp.leo.org/pub/comp/os/os2/leo/archiver/ + (mail server at ftp-mailer@ftp.leo.org) + + ftp://ftp.win.tue.nl/pub/compression/zip/ + ftp://ftp.uni-erlangen.de/pub/pc/msdos/arc-utils/zip/ + + +The primary distribution site for the MacZip port can be found at: + + http://www.sitec.net/maczip/ + +ftp sites for VMS-format Zip and UnZip packages (sources, object files and +executables, no encryption/decryption--see also "Mail servers" section below): + + ftp.spc.edu [192.107.46.27] and ftp.wku.edu: + + [.MACRO32]AAAREADME.TXT + [.MACRO32.SAVESETS]UNZIP.BCK or UNZIP.ZIP (if already have older version) + [.MACRO32.SAVESETS]ZIP.ZIP + +To find other ftp/web sites: + + The "archie" ftp database utility can be used to find an ftp site near + you (although the command-line versions always seem to find old ver- + sions...the `FTPsearch' server at http://ftpsearch.ntnu.no/ftpsearch + --formerly `Archie 95'--is quite up-to-date, however). Or check a stan- + dard WWW search engine like AltaVista (http://www.altavista.digital.com/) + or Yahoo (http://www.yahoo.com/). If you don't know how to use these, + DON'T ASK US--read the web sites' help pages or check the Usenet groups + news.announce.newusers or news.answers or some such, or ask your system + administrator. + +UUCP sites: + + uunet!~/pub/archiving/zip/ ... + +Bulletin boards (commercial and otherwise): + + Sources, MS-DOS executables: + CompuServe IBMPRO forum, Library 10, Data Compression (unz540.zip, + sources; unz540.exe, self-extracting executables and docs) + CompuServe (ZiffNet) PBSUTIL forum and Public Brand Software BBS + [US, membership required; V.32 line, (317) 856-1490] + (unz540.zip, sources; unz540.exe, self-extracting exes and docs) + America Online OS/2 Forum, Free Uploading area; also Top Picks lib- + rary, File/Disk Utilities library, and OS/2 1.x library (do key- + word search via ctrl-K: FILE SEARCH on "INFOZIP") + FidoNet node 1:124/2113, Lunatic Fringe [Richardson, Texas; BBS + (214) 235-5288; sysop john.stewart@lunatic.com; complete mirror + of Info-ZIP home site] + FidoNet node 1:246/74, Metal Shoppe BBS [Windsor, Ontario; CLink + node 911:6510/0; BBS (519) 256-0278; sysop rakey@cyberspace.net + (Ray Akey); micro-based files but no Unix/VMS/NT stuff] + Drealm Conference System [London, UK; V.22bis, subscriber lines + to V.32bis, etc.; (+44) 81 568 2204] + Compulink Information eXchange (CIX) [London, UK; BBS 14.4 and 28.8 + lines, (+44) 181 390-1244, -1255 and -9787; executables in "the + filepool," sources in free_software/sources] + + Windows sources and executables (filenames, locations not yet final): + CompuServe CRAFTS forum (wiz41.zip, WiZ 32-bit version) + + OS/2 executables: + CompuServe OS2USER forum (zip23.zip and unz540.exe, OS/2 16- and + 32-bit exes and docs) + + Amiga executables: + BIX in AMIGA files section (perform keyword search on "info-zip") + [requires account; telnet bix.com, or "C BIX" via local Sprint + X.25 PAD, or dial direct in US at (617) 491-5410] + + +Mail servers: + + To get the encryption sources by e-mail, send the following commands + to ftp-mailer@informatik.tu-muenchen.de: + + get /pub/comp/os/os2/archiver/zcrypt28.zip + quit + + To get the VMS Zip/UnZip package by e-mail, send the following + commands in the body of a mail message to fileserv@wku.edu (the + "HELP" command is also accepted): + + SEND FILESERV_TOOLS + SEND UNZIP + SEND ZIP + + To get Atari executables by e-mail, send a message to + atari@atari.archive.umich.edu for information about the mail server. +__________________________________________________________________________ diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/crc_i386.asm boinc-7.0.14+dfsg/zip/zip/win32/crc_i386.asm --- boinc-7.0.7+dfsg/zip/zip/win32/crc_i386.asm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/crc_i386.asm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,231 @@ +;=========================================================================== +; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. +; +; See the accompanying file LICENSE, version 1999-Oct-05 or later +; (the contents of which are also included in zip.h) for terms of use. +; If, for some reason, both of these files are missing, the Info-ZIP license +; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +;=========================================================================== +; crc_i386.asm, optimized CRC calculation function for Zip and UnZip, +; created by Paul Kienitz and Christian Spieler. Last revised 24 Dec 98. +; +; Revised 06-Oct-96, Scott Field (sfield@microsoft.com) +; fixed to assemble with masm by not using .model directive which makes +; assumptions about segment alignment. Also, +; avoid using loop, and j[e]cxz where possible. Use mov + inc, rather +; than lodsb, and other misc. changes resulting in the following performance +; increases: +; +; unrolled loops NO_UNROLLED_LOOPS +; *8 >8 <8 *8 >8 <8 +; +; +54% +42% +35% +82% +52% +25% +; +; first item in each table is input buffer length, even multiple of 8 +; second item in each table is input buffer length, > 8 +; third item in each table is input buffer length, < 8 +; +; Revised 02-Apr-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) +; Incorporated Rodney Brown's 32-bit-reads optimization as found in the +; UNIX AS source crc_i386.S. This new code can be disabled by defining +; the macro symbol NO_32_BIT_LOADS. +; +; Revised 12-Oct-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) +; Incorporated Rodney Brown's additional tweaks for 32-bit-optimized CPUs +; (like the Pentium Pro, Pentium II, and probably some Pentium clones). +; This optimization is controlled by the macro symbol __686 and is disabled +; by default. (This default is based on the assumption that most users +; do not yet work on a Pentium Pro or Pentium II machine ...) +; +; FLAT memory model assumed. +; +; The loop unrolling can be disabled by defining the macro NO_UNROLLED_LOOPS. +; This results in shorter code at the expense of reduced performance. +; +; Revised 25-Mar-98, Cosmin Truta (cosmint@cs.ubbcluj.ro) +; Working without .model directive caused tasm32 version 5.0 to produce +; bad object code. The optimized alignments can be optionally disabled +; by defining NO_ALIGN, thus allowing to use .model flat. There is no need +; to define this macro if using other versions of tasm. +; +;============================================================================== +; +; Do NOT assemble this source if external crc32 routine from zlib gets used. +; + IFNDEF USE_ZLIB +; + .386p + name crc_i386 + + IFDEF NO_ALIGN + .model flat + ENDIF + +extrn _get_crc_table:near ; ZCONST ulg near *get_crc_table(void); + +; + IFNDEF NO_STD_STACKFRAME + ; Use a `standard' stack frame setup on routine entry and exit. + ; Actually, this option is set as default, because it results + ; in smaller code !! +STD_ENTRY MACRO + push ebp + mov ebp,esp + ENDM + + Arg1 EQU 08H[ebp] + Arg2 EQU 0CH[ebp] + Arg3 EQU 10H[ebp] + +STD_LEAVE MACRO + pop ebp + ENDM + + ELSE ; NO_STD_STACKFRAME + +STD_ENTRY MACRO + ENDM + + Arg1 EQU 18H[esp] + Arg2 EQU 1CH[esp] + Arg3 EQU 20H[esp] + +STD_LEAVE MACRO + ENDM + + ENDIF ; ?NO_STD_STACKFRAME + +; These two (three) macros make up the loop body of the CRC32 cruncher. +; registers modified: +; eax : crc value "c" +; esi : pointer to next data byte (or dword) "buf++" +; registers read: +; edi : pointer to base of crc_table array +; scratch registers: +; ebx : index into crc_table array +; (requires upper three bytes = 0 when __686 is undefined) + IFNDEF __686 ; optimize for 386, 486, Pentium +Do_CRC MACRO + mov bl,al ; tmp = c & 0xFF + shr eax,8 ; c = (c >> 8) + xor eax,[edi+ebx*4] ; ^ table[tmp] + ENDM + ELSE ; __686 : optimize for Pentium Pro, Pentium II and compatible CPUs +Do_CRC MACRO + movzx ebx,al ; tmp = c & 0xFF + shr eax,8 ; c = (c >> 8) + xor eax,[edi+ebx*4] ; ^ table[tmp] + ENDM + ENDIF ; ?__686 +Do_CRC_byte MACRO + xor al, byte ptr [esi] ; c ^= *buf + inc esi ; buf++ + Do_CRC ; c = (c >> 8) ^ table[c & 0xFF] + ENDM + IFNDEF NO_32_BIT_LOADS +Do_CRC_dword MACRO + xor eax, dword ptr [esi] ; c ^= *(ulg *)buf + add esi, 4 ; ((ulg *)buf)++ + Do_CRC + Do_CRC + Do_CRC + Do_CRC + ENDM + ENDIF ; !NO_32_BIT_LOADS + + IFNDEF NO_ALIGN +_TEXT segment use32 para public 'CODE' + ELSE +_TEXT segment use32 + ENDIF + assume CS: _TEXT + + public _crc32 +_crc32 proc near ; ulg crc32(ulg crc, ZCONST uch *buf, extent len) + STD_ENTRY + push edi + push esi + push ebx + push edx + push ecx + + mov esi,Arg2 ; 2nd arg: uch *buf + sub eax,eax ;> if (!buf) + test esi,esi ;> return 0; + jz fine ;> else { + + call _get_crc_table + mov edi,eax + mov eax,Arg1 ; 1st arg: ulg crc + IFNDEF __686 + sub ebx,ebx ; ebx=0; make bl usable as a dword + ENDIF + mov ecx,Arg3 ; 3rd arg: extent len + not eax ;> c = ~crc; + + test ecx,ecx + IFNDEF NO_UNROLLED_LOOPS + jz bail + IFNDEF NO_32_BIT_LOADS +align_loop: + test esi,3 ; align buf pointer on next + jz SHORT aligned_now ; dword boundary + Do_CRC_byte + dec ecx + jnz align_loop +aligned_now: + ENDIF ; !NO_32_BIT_LOADS + mov edx,ecx ; save len in edx + shr ecx,3 ; ecx = len / 8 + jz SHORT No_Eights + IFNDEF NO_ALIGN +; align loop head at start of 486 internal cache line !! + align 16 + ENDIF +Next_Eight: + IFNDEF NO_32_BIT_LOADS + Do_CRC_dword + Do_CRC_dword + ELSE ; NO_32_BIT_LOADS + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + Do_CRC_byte + ENDIF ; ?NO_32_BIT_LOADS + dec ecx + jnz Next_Eight +No_Eights: + mov ecx,edx + and ecx,000000007H ; ecx = len % 8 + ENDIF ; !NO_UNROLLED_LOOPS + jz SHORT bail ;> if (len) + IFNDEF NO_ALIGN +; align loop head at start of 486 internal cache line !! + align 16 + ENDIF +loupe: ;> do { + Do_CRC_byte ; c = CRC32(c, *buf++); + dec ecx ;> } while (--len); + jnz loupe + +bail: ;> } + not eax ;> return ~c; +fine: + pop ecx + pop edx + pop ebx + pop esi + pop edi + STD_LEAVE + ret +_crc32 endp + +_TEXT ends +; + ENDIF ; !USE_ZLIB +; +end diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/crc_i386.c boinc-7.0.14+dfsg/zip/zip/win32/crc_i386.c --- boinc-7.0.7+dfsg/zip/zip/win32/crc_i386.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/crc_i386.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,222 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* crc_i386.c -- Microsoft 32-bit C/C++ adaptation of crc_i386.asm + * Created by Rodney Brown from crc_i386.asm, modified by Chr. Spieler. + * Last revised: 24-Dec-1998 + * + * Original coded (in crc_i386.asm) and put into the public domain + * by Paul Kienitz and Christian Spieler. + * + * Revised 06-Oct-96, Scott Field (sfield@microsoft.com) + * fixed to assemble with masm by not using .model directive which makes + * assumptions about segment alignment. Also, + * avoid using loop, and j[e]cxz where possible. Use mov + inc, rather + * than lodsb, and other misc. changes resulting in the following performance + * increases: + * + * unrolled loops NO_UNROLLED_LOOPS + * *8 >8 <8 *8 >8 <8 + * + * +54% +42% +35% +82% +52% +25% + * + * first item in each table is input buffer length, even multiple of 8 + * second item in each table is input buffer length, > 8 + * third item in each table is input buffer length, < 8 + * + * Revised 02-Apr-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) + * Incorporated Rodney Brown's 32-bit-reads optimization as found in the + * UNIX AS source crc_i386.S. This new code can be disabled by defining + * the macro symbol NO_32_BIT_LOADS. + * + * Revised 12-Oct-97, Chr. Spieler, based on Rodney Brown (rdb@cmutual.com.au) + * Incorporated Rodney Brown's additional tweaks for 32-bit-optimized CPUs + * (like the Pentium Pro, Pentium II, and probably some Pentium clones). + * This optimization is controlled by the macro symbol __686 and is disabled + * by default. (This default is based on the assumption that most users + * do not yet work on a Pentium Pro or Pentium II machine ...) + * + * Revised 16-Nov-97, Chr. Spieler: Made code compatible with Borland C++ + * 32-bit, removed unneeded kludge for potentially unknown movzx mnemonic, + * confirmed correct working with MS VC++ (32-bit). + * + * Revised 22-May-98, Peter Kunath, Chr. Spieler: The 16-Nov-97 revision broke + * MSVC 5.0. Inside preprocessor macros, each instruction is enclosed in its + * own __asm {...} construct. For MSVC, a "#pragma warning" was added to + * shut up the "no return value" warning message. + * + * Revised 13-Dec-98, Chr. Spieler: Modified path to "zip.h" header file. + * + * FLAT memory model assumed. + * + * The loop unrolling can be disabled by defining the macro NO_UNROLLED_LOOPS. + * This results in shorter code at the expense of reduced performance. + * + */ + +#include "../zip.h" + +#ifndef USE_ZLIB + +#ifndef ZCONST +# define ZCONST const +#endif + +/* Select wether the following inline-assember code is supported. */ +#if (defined(_MSC_VER) && _MSC_VER >= 700) +#if (defined(_M_IX86) && _M_IX86 >= 300) +# define MSC_INLINE_ASM_32BIT_SUPPORT + /* Disable warning for no return value, typical of asm functions */ +# pragma warning( disable : 4035 ) +#endif +#endif + +#if (defined(__BORLANDC__) && __BORLANDC__ >= 452) +# define MSC_INLINE_ASM_32BIT_SUPPORT +#endif + +#ifdef MSC_INLINE_ASM_32BIT_SUPPORT +/* This code is intended for Microsoft C/C++ (32-bit) compatible compilers. */ + +/* + * These two (three) macros make up the loop body of the CRC32 cruncher. + * registers modified: + * eax : crc value "c" + * esi : pointer to next data byte (or dword) "buf++" + * registers read: + * edi : pointer to base of crc_table array + * scratch registers: + * ebx : index into crc_table array + * (requires upper three bytes = 0 when __686 is undefined) + */ +#ifndef __686 +#define Do_CRC { \ + __asm { mov bl, al }; \ + __asm { shr eax, 8 }; \ + __asm { xor eax, [edi+ebx*4] }; } +#else /* __686 */ +#define Do_CRC { \ + __asm { movzx ebx, al }; \ + __asm { shr eax, 8 }; \ + __asm { xor eax, [edi+ebx*4] }; } +#endif /* ?__686 */ + +#define Do_CRC_byte { \ + __asm { xor al, byte ptr [esi] }; \ + __asm { inc esi }; \ + Do_CRC; } + +#ifndef NO_32_BIT_LOADS +#define Do_CRC_dword { \ + __asm { xor eax, dword ptr [esi] }; \ + __asm { add esi, 4 }; \ + Do_CRC; \ + Do_CRC; \ + Do_CRC; \ + Do_CRC; } +#endif /* !NO_32_BIT_LOADS */ + +/* ========================================================================= */ +ulg crc32(crc, buf, len) + ulg crc; /* crc shift register */ + ZCONST uch *buf; /* pointer to bytes to pump through */ + extent len; /* number of bytes in buf[] */ +/* Run a set of bytes through the crc shift register. If buf is a NULL + pointer, then initialize the crc shift register contents instead. + Return the current crc in either case. */ +{ + __asm { + push edx + push ecx + + mov esi,buf ;/* 2nd arg: uch *buf */ + sub eax,eax ;/*> if (!buf) */ + test esi,esi ;/*> return 0; */ + jz fine ;/*> else { */ + + call get_crc_table + mov edi,eax + mov eax,crc ;/* 1st arg: ulg crc */ +#ifndef __686 + sub ebx,ebx ;/* ebx=0; => bl usable as a dword */ +#endif + mov ecx,len ;/* 3rd arg: extent len */ + not eax ;/*> c = ~crc; */ + + test ecx,ecx +#ifndef NO_UNROLLED_LOOPS + jz bail +# ifndef NO_32_BIT_LOADS +align_loop: + test esi,3 ;/* align buf pointer on next */ + jz aligned_now ;/* dword boundary */ + } + Do_CRC_byte ; + __asm { + dec ecx + jnz align_loop +aligned_now: +# endif /* !NO_32_BIT_LOADS */ + mov edx,ecx ;/* save len in edx */ + shr ecx,3 ;/* ecx = len / 8 */ + jz No_Eights +; align loop head at start of 486 internal cache line !! + align 16 +Next_Eight: + } +# ifndef NO_32_BIT_LOADS + Do_CRC_dword ; + Do_CRC_dword ; +# else /* NO_32_BIT_LOADS */ + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; + Do_CRC_byte ; +# endif /* ?NO_32_BIT_LOADS */ + __asm { + dec ecx + jnz Next_Eight +No_Eights: + mov ecx,edx + and ecx,000000007H ;/* ecx = len % 8 */ + +#endif /* !NO_UNROLLED_LOOPS */ + jz bail ;/*> if (len) */ +; align loop head at start of 486 internal cache line !! + align 16 +loupe: ;/*> do { */ + } + Do_CRC_byte ;/* c = CRC32(c, *buf++); */ + __asm { + dec ecx ;/*> } while (--len); */ + jnz loupe + +bail: ;/*> } */ + not eax ;/*> return ~c; */ +fine: + pop ecx + pop edx + } +#ifdef NEED_RETURN + return _EAX; +#endif +} +#endif /* MSC_INLINE_ASM_32BIT_SUPPORT */ +#if (defined(_MSC_VER) && _MSC_VER >= 700) +#if (defined(_M_IX86) && _M_IX86 >= 300) + /* Reenable missing return value warning */ +# pragma warning( default : 4035 ) +#endif +#endif +#endif /* !USE_ZLIB */ + +const char *BOINC_RCSID_6a68f7b22b = "$Id: crc_i386.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/crc_lcc.asm boinc-7.0.14+dfsg/zip/zip/win32/crc_lcc.asm --- boinc-7.0.7+dfsg/zip/zip/win32/crc_lcc.asm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/crc_lcc.asm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,119 @@ +;=========================================================================== +; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. +; +; See the accompanying file LICENSE, version 1999-Oct-05 or later +; (the contents of which are also included in zip.h) for terms of use. +; If, for some reason, both of these files are missing, the Info-ZIP license +; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +;=========================================================================== +; crc_lcc.asm, optimized CRC calculation function for Zip and UnZip, +; created by Paul Kienitz and Christian Spieler. Last revised 24 Dec 98. +; +; The code in this file has been copied verbatim from crc_i386.{asm|S}; +; only the assembler syntax and metacommands have been adapted to +; the habits of the free LCC-Win32 C compiler package. +; This version of the code uses the "optimized for i686" variant of +; crc_i386.{asm|S}. +; IMPORTANT NOTE to the Info-ZIP editors: +; The TAB characters in this source file are required by the parser of +; the LCC-Win32 assembler program and MUST NOT be removed!! +; +; For more information (and a revision log), look into the original +; source files. +; + .text + .file "crc32.c" + .text + .type _crc32,function +_crc32: + pushl %ebp + movl %esp,%ebp + pushl %ecx + pushl %ebx + pushl %esi + pushl %edi + .line 34 + .line 37 + movl 12(%ebp),%esi + subl %eax,%eax + testl %esi,%esi + jz _$3 + .line 39 + call _get_crc_table + movl %eax,%edi + .line 41 + movl 8(%ebp),%eax + movl 16(%ebp),%ecx + notl %eax + testl %ecx,%ecx + jz _$4 +_$5: + testl $3,%esi + jz _$6 + xorb (%esi),%al + incl %esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + decl %ecx + jnz _$5 +_$6: + movl %ecx,%edx + shrl $3,%ecx + jz _$8 +_$7: + xorl (%esi),%eax + addl $4,%esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + xorl (%esi),%eax + addl $4,%esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + decl %ecx + jnz _$7 +_$8: + movl %edx,%ecx + andl $7,%ecx + jz _$4 +_$9: + xorb (%esi),%al + incl %esi + movzbl %al,%ebx + shrl $8,%eax + xorl (%edi,%ebx,4),%eax + decl %ecx + jnz _$9 +_$4: + xorl $0xffffffff,%eax +_$3: + .line 52 + popl %edi + popl %esi + popl %ebx + leave + ret +_$34: + .size _crc32,_$34-_crc32 + .globl _crc32 + .extern _get_crc_table diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/lm32_lcc.asm boinc-7.0.14+dfsg/zip/zip/win32/lm32_lcc.asm --- boinc-7.0.7+dfsg/zip/zip/win32/lm32_lcc.asm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/lm32_lcc.asm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,174 @@ +;=========================================================================== +; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. +; +; See the accompanying file LICENSE, version 1999-Oct-05 or later +; (the contents of which are also included in zip.h) for terms of use. +; If, for some reason, both of these files are missing, the Info-ZIP license +; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +;=========================================================================== +; match32.asm by Jean-loup Gailly. + +; match32.asm, optimized version of longest_match() in deflate.c +; To be used only with 32 bit flat model. To simplify the code, the option +; -DDYN_ALLOC is not supported. +; This file is only optional. If you don't have an assembler, use the +; C version (add -DNO_ASM to CFLAGS in makefile and remove match.o +; from OBJI). If you have reduced WSIZE in zip.h, then make sure this is +; assembled with an equivalent -DWSIZE=. +; +; Win32 (Windows NT) version - 1994/04/13 by Steve Salisbury +; * works with Microsoft MASM 6.1X and Microsoft Visual C++ / 32-bit edition +; +; The code in this file has been copied verbatim from match32.{asm|S}; +; only the assembler syntax and metacommands have been adapted to +; the habits of the free LCC-Win32 C compiler package. +; IMPORTANT NOTE to the Info-ZIP editors: +; The TAB characters in this source file are required by the parser of +; the LCC-Win32 assembler program and MUST NOT be removed!! +; +;============================================================================== +; +; Do NOT assemble this source if external crc32 routine from zlib gets used. +; + + +;/* This version is for 386 Unix or OS/2 in 32 bit mode. +; * Warning: it uses the AT&T syntax: mov source,dest +; * This file is only optional. If you want to force the C version, +; * add -DNO_ASM to CFLAGS in Makefile and set OBJA to an empty string. +; * If you have reduced WSIZE in (g)zip.h, then make sure this is +; * assembled with an equivalent -DWSIZE=. +; * This version assumes static allocation of the arrays (-DDYN_ALLOC not used). +; */ + + .text + .file "match.S" + + + .text + .type _match_init,function + +_match_init: + ret +_$98: + .size _match_init,_$98-_match_init + .globl _match_init + +;/*----------------------------------------------------------------------- +; * Set match_start to the longest match starting at the given string and +; * return its length. Matches shorter or equal to prev_length are discarded, +; * in which case the result is equal to prev_length and match_start is +; * garbage. +; * IN assertions: cur_match is the head of the hash chain for the current +; * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 +; */ + + .align 4 + .type _longest_match,function + +_longest_match: ;/* int longest_match(cur_match) */ + +; cur_match equ 20(%esp) +; /* return address */ /* esp+16 */ + push %ebp + push %edi +;/* esp+8 */ + push %esi +;/* esp+4 */ + push %ebx +;/* esp */ + +;/* +; * match equ esi +; * scan equ edi +; * chain_length equ ebp +; * best_len equ ebx +; * limit equ edx +; */ + mov 20(%esp),%esi + mov _strstart,%edx + mov _max_chain_length,%ebp + mov %edx,%edi + sub $(32768-262),%edx + cld + jae limit_ok + sub %edx,%edx +limit_ok: + add $2+_window,%edi + mov _prev_length,%ebx + movw -2(%edi),%cx + movw -3(%ebx,%edi),%ax + cmp _good_match,%ebx + jb do_scan + shr $2,%ebp + jmp do_scan + + .align 4 +long_loop: +;/* at this point, edi == scan+2, esi == cur_match */ + movw -3(%ebx,%edi),%ax + movw -2(%edi),%cx +short_loop: +;/* +; * at this point, di == scan+2, si == cur_match, +; * ax = scan[best_len-1..best_len] and cx = scan[0..1] +; */ + and $(32768-1), %esi + dec %ebp + movw _prev(,%esi,2),%si + jz the_end + cmp %edx,%esi + jbe the_end +do_scan: + cmpw _window-1(%ebx,%esi),%ax + jne short_loop + cmpw _window(%esi),%cx + jne short_loop + + add $2+_window,%esi + mov $((258>>1)-1),%ecx + mov %edi,%eax + repe; cmpsw +;/* loop until mismatch */ + je maxmatch +;/* match of length MAX_MATCH? */ +mismatch: + movb -2(%edi),%cl + xchg %edi,%eax + subb -2(%esi),%cl + sub %edi,%eax + sub $2+_window,%esi + sub %eax,%esi + subb $1,%cl + adc $0,%eax + cmp %ebx,%eax + jle long_loop + mov %esi,_match_start + mov %eax,%ebx + cmp _nice_match,%eax +; /* len >= nice_match ? */ + jl long_loop +the_end: + mov %ebx,%eax + pop %ebx + pop %esi + pop %edi + pop %ebp + ret + .align 4 +maxmatch: + cmpsb + jmp mismatch +_$99: + + .size _longest_match,_$99-_longest_match + .globl _longest_match + + .extern _nice_match + .extern _good_match + .extern _max_chain_length + .extern _match_start + .extern _strstart + .extern _prev_length + .extern _prev + .extern _window diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.bor boinc-7.0.14+dfsg/zip/zip/win32/makefile.bor --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.bor 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.bor 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,170 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for +# Borland C++ for Windows 95/NT +# By E-Yen Tan. Last updated on 8 November 1997 +# Includes ideas by Cosmin Truta , Dec 1997. + +# To use, do "make -fwin32\makefile.bor" + +# Add -DNO_ASM to LOC, remove -DASM_CRC from LOC, and comment out +# the ASMOBJS definition if you do not have tasm32. + +# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) +# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added +# to the declaration of LOC here: +LOC = -DASM_CRC $(LOCAL_ZIP) + +# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. +CPU_TYP = 4 + +# Uncomment the following macro to use the optimized assembler +# routines in Zip: +#ASMOBJS = match32.obj crc_i386.obj + +ASCPUFLAG = __$(CPU_TYP)86 + +VPATH=.;win32 +CC = bcc32 +# If you have bcc32i, you should define: +#CC = bcc32i +# This compiler generates a faster code. +# Note: due to an inconsistency in 'malloc.h', bcc32i version 5.0 displays +# a warning "Redefinition of 'alloca' is not identical", +# which you can ignore. +# Although, I did not disable this warning, because, generally speaking, +# it concerns correct C coding. [comment by: Cosmin Truta] + +CFLAGS=-w -w-aus -w-ccc -w-par -w-sig -O2 -I. -DWIN32 -DMSDOS $(LOC) +UTILFLAGS=-DUTIL $(CFLAGS) -o + +AS=tasm32 +ASFLAGS=-ml -t -m2 -D$(ASCPUFLAG) $(LOC) + +LD=$(CC) +LDFLAGS= + +# ------------- Used by install rule +# set BIN to the directory you want to install the executables to +BIN = c:\util + +# variables +OBJZ1 = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ + crc32.obj crctab.obj globals.obj +OBJZ2 = deflate.obj trees.obj $(ASMOBJS) +OBJZS = win32zip.obj win32.obj nt.obj +OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) + +OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj win32_.obj +OBJN = zipnote.obj $(OBJU) +OBJC = zipcloak.obj crctab.obj crypt_.obj ttyio.obj $(OBJU) +OBJS = zipsplit.obj $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h win32/osdep.h + +ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +zips: $(ZIPS) + +zip.obj: zip.c $(ZIP_H) revision.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +zipfile.obj: zipfile.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32/zipup.h + $(CC) -c $(CFLAGS) $*.c + +fileio.obj: fileio.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +util.obj: util.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +globals.obj: globals.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +deflate.obj: deflate.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +trees.obj: trees.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crc32.obj: crc32.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crctab.obj: crctab.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +win32zip.obj: win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) -c $(CFLAGS) win32/$*.c + +win32.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(CFLAGS) win32/$*.c + +nt.obj: win32/nt.c $(ZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) win32/$*.c + +zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +zipnote.obj: zipnote.c $(ZIP_H) revision.h + $(CC) -c $(CFLAGS) $*.c + +zipsplit.obj: zipsplit.c $(ZIP_H) revision.h + $(CC) -c $(CFLAGS) $*.c + +zipfile_.obj: zipfile.c $(ZIP_H) + $(CC) -c $(UTILFLAGS)$* zipfile.c + +fileio_.obj: fileio.c $(ZIP_H) + $(CC) -c $(UTILFLAGS)$* fileio.c + +util_.obj: util.c $(ZIP_H) + $(CC) -c $(UTILFLAGS)$* util.c + +crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(UTILFLAGS)$* crypt.c + +win32_.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(UTILFLAGS)$* win32/win32.c + +crc_i386.obj: win32/crc_i386.asm + $(AS) $(ASFLAGS) win32\crc_i386.asm ; + +match32.obj: win32/match32.asm + $(AS) $(ASFLAGS) win32\match32.asm + +# we must cut the command line to fit in the MS/DOS 128 byte limit: +zip.exe: $(OBJZ) + echo $(OBJZ1) > zip.rsp + echo $(OBJZ2) >> zip.rsp + echo $(OBJZS) >> zip.rsp + $(LD) $(LDFLAGS) @zip.rsp + del zip.rsp + +zipcloak.exe: $(OBJC) + echo $(OBJC) > zipc.rsp + $(LD) $(LDFLAGS) @zipc.rsp + del zipc.rsp + +zipnote.exe: $(OBJN) + echo $(OBJN) > zipn.rsp + $(LD) $(LDFLAGS) @zipn.rsp + del zipn.rsp + +zipsplit.exe: $(OBJS) + echo $(OBJS) > zips.rsp + $(LD) $(LDFLAGS) @zips.rsp + del zips.rsp + +install: $(ZIPS) + copy /b *.exe $(BIN) + +clean: + del *.obj + del *.exe diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.dj boinc-7.0.14+dfsg/zip/zip/win32/makefile.dj --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.dj 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.dj 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,110 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit +# for djgpp 2.01 and RSXNTDJ 1.3.1 under Windows 95 / Windows NT +# Derived from makefile.os2 by E-Yen Tan. Last updated 22 May 1998. + +CC = gcc -O2 -m486 -Wall -Zwin32 +CFLAGS = -DWIN32 -DASM_CRC $(LOCAL_ZIP) +AS = gcc +ASFLAGS = -Di386 +LDFLAGS = -o ./ +LDFLAGS2 = +OBJ=.o + +CRC32=crc_gcc +OBJA = matchgcc.o +OBJZS = win32.o win32zip.o nt.o +OBJUS = win32_.o +OSDEP_H = win32/osdep.h + +ADVAPI32 = adv32 +ADVAPI32LIB = lib$(ADVAPI32).a +L_ADVAPI32 = -l$(ADVAPI32) + +OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \ + $(CRC32)$(OBJ) crctab$(OBJ) +OBJZ2 = globals$(OBJ) deflate$(OBJ) trees$(OBJ) crypt$(OBJ) \ + ttyio$(OBJ) +OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) $(OBJA) + +OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ) +OBJU = $(OBJU1) $(OBJUS) + +OBJN = zipnote$(OBJ) $(OBJU) +OBJS = zipsplit$(OBJ) $(OBJU) +OBJC = zipcloak$(OBJ) crctab$(OBJ) crypt_$(OBJ) ttyio$(OBJ) $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H) + +# rules + +.SUFFIXES: .c $(OBJ) + +.c$(OBJ): + $(CC) -c -I. $(CFLAGS) $< + +.asm$(OBJ): + $(AS) $(ASFLAGS) $< + +all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +zip$(OBJ): zip.c $(ZIP_H) revision.h crypt.h ttyio.h +zipfile$(OBJ): zipfile.c $(ZIP_H) +zipup$(OBJ): zipup.c $(ZIP_H) revision.h crypt.h win32/zipup.h +fileio$(OBJ): fileio.c $(ZIP_H) +util$(OBJ): util.c $(ZIP_H) +globals$(OBJ): globals.c $(ZIP_H) +deflate$(OBJ): deflate.c $(ZIP_H) +trees$(OBJ): trees.c $(ZIP_H) +crc32$(OBJ): crc32.c $(ZIP_H) +crctab$(OBJ): crctab.c $(ZIP_H) +crypt$(OBJ): crypt.c $(ZIP_H) crypt.h ttyio.h +ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h + +win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) -c -I. $(CFLAGS) win32/win32zip.c + +win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c -I. $(CFLAGS) win32/win32.c + +nt$(OBJ): win32/nt.c $(ZIP_H) win32/nt.h + $(CC) -c -I. $(CFLAGS) win32/nt.c + +crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS + $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o$@ crc_i386.S + +matchgcc$(OBJ): match.S + $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o$@ match.S + +zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h +zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h +zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h + +zipfile_$(OBJ): zipfile.c $(ZIP_H) + $(CC) -c -I. $(CFLAGS) -DUTIL -o$@ zipfile.c + +fileio_$(OBJ): fileio.c $(ZIP_H) + $(CC) -c -I. $(CFLAGS) -DUTIL -o$@ fileio.c + +util_$(OBJ): util.c $(ZIP_H) os2/os2zip.h + $(CC) -c -I. $(CFLAGS) -DUTIL -o$@ util.c + +crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c -I. $(CFLAGS) -DUTIL -o$@ crypt.c + +win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c -I. $(CFLAGS) -DUTIL -o$@ win32/win32.c + +$(ADVAPI32LIB): + makelib "$(windir)/system/advapi32.dll" -o ./$@ + +zip.exe: $(OBJZ) $(ADVAPI32LIB) + $(CC) $(LDFLAGS)$@ $(OBJZ) $(L_ADVAPI32) $(LDFLAGS2) + +zipcloak.exe: $(OBJC) + $(CC) $(LDFLAGS)$@ $(OBJC) $(LDFLAGS2) + +zipnote.exe: $(OBJN) + $(CC) $(LDFLAGS)$@ $(OBJN) $(LDFLAGS2) + +zipsplit.exe: $(OBJS) + $(CC) $(LDFLAGS)$@ $(OBJS) $(LDFLAGS2) diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.emx boinc-7.0.14+dfsg/zip/zip/win32/makefile.emx --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.emx 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.emx 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,291 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit +# using emx 0.9c+rsxnt for Windows 95/98 and Windows NT and emx 0.9c for DOS. +# By Kai-Uwe Rommel, Chr. Spieler, E-Yen Tan (and others). +# Last updated 30th June 1998. +# +# Supported Make utilities: +# - Microsoft/IBM nmake (e.g. from MSC 6.0 or newer) +# - dmake 3.8 or higher +# - GNU make, at least version 3.68 (GNUish 16-bit port, RSXNT Make 3.75, +# DJGPP v1.12 Make 3.71, some versions of DJGPP v2.x 32-bit Make; +# current DJGPP v2.01 Make 3.76.1 does NOT work) +# - NOT watcom make +# The "smart" Make utilities mentioned below are Christian Spieler's +# enhanced version of GNUish 16-bit Make (3.74) and his adaption of these +# GNU Make sources to EMX (32-bit). + +# Supported 32-bit C Compilers (created programs run under WinNT/Win95 only): +# - GNU gcc (emx/rsxnt kit 0.9c or newer) + +# Supported Cross-Compilers for MS-DOS: +# - GNU gcc (emx kit 0.9c or newer, 32-bit) + +# Supported Assemblers: +# - GNU as with GNU gcc + + +# To use, enter "make/nmake/dmake -f win32/makefile.emx" +# (this makefile depends on its name being "win32/makefile.emx"). + +# Add -DDYN_ALLOC to ASFLAGS if you have defined it in tailor.h or CFLAGS + +# Note: assembly language modules are really only supported for +# GNU gcc 32-bit compilation. + + +default: + @echo "Enter $(MAKE) -f win32/makefile.emx target" + @echo "where target is one of:" + @echo " gcc gccso gccdyn gccdebug gcczl gccdos gccdoszl" + @echo " -----------------------------------------------" + @echo "Or, specify a specific target for a partial build," + @echo "This uses >gcc< setup (win32 statically linked binary)" + +# emx 0.9c, gcc, PE format, statically linked C runtime and rsxnt.dll +gcc: all + +# emx 0.9c, gcc, PE format, statically linked C runtime, standalone +gccso: + $(MAKE) -f win32/makefile.emx all \ + CC="gcc -Zwin32 -Zsys -O2 -m486 -Wall" \ + CFLAGS="-DWIN32 -DASM_CRC" \ + AS="gcc -Zwin32" \ + ASFLAGS="-Di386" \ + LDFLAGS="-o ./" \ + LDFLAGS2="-ladvapi32 -s" \ + OUT="-o" \ + OBJ=".o" \ + CRC32="crc_gcc" \ + OBJA="matchgcc.o" \ + DEF="win32/zip.def" + +# emx 0.9c, gcc, PE format, dynamically linked C runtime and rsxnt.dll +gccdyn: + $(MAKE) -f win32/makefile.emx all \ + CC="gcc -Zwin32 -Zcrtdll=crtrsxnt -O2 -m486 -Wall" \ + CFLAGS="-DWIN32 -DASM_CRC" \ + AS="gcc -Zwin32" \ + ASFLAGS="-Di386" \ + LDFLAGS="-o ./" \ + LDFLAGS2="-ladvapi32 -s" \ + OUT="-o" \ + OBJ=".o" \ + CRC32="crc_gcc" \ + OBJA="matchgcc.o" \ + DEF="win32/zip.def" + +# emx 0.9c, gcc, PE format, with debug info for gdb +gccdebug: + $(MAKE) -f win32/makefile.emx all \ + CC="gcc -Zwin32 -O2 -g -Wall" \ + CFLAGS="-DWIN32 -DASM_CRC" \ + AS="gcc -Zwin32" \ + ASFLAGS="-Di386" \ + LDFLAGS="-o ./" \ + LDFLAGS2="-ladvapi32 -Zsmall-conv" \ + OUT="-o" \ + OBJ=".o" \ + CRC32="crc_gcc" \ + OBJA="matchgcc.o" \ + DEF="win32/zip.def" + +# emx 0.9c, gcc, PE format,, statically linked zlib, C runtime, and rsxnt.dll +gcczl: + $(MAKE) -f win32/makefile.emx all \ + CC="gcc -Zwin32 -O2 -m486 -Wall" \ + CFLAGS="-DWIN32 -DUSE_ZLIB" \ + AS="gcc -Zwin32" \ + ASFLAGS="-Di386 -DUSE_ZLIB" \ + LDFLAGS="-o ./" \ + LDFLAGS2="-L. -lzlib -ladvapi32 -s" \ + OUT="-o" \ + OBJ=".o" \ + CRC32="crc32" \ + OBJA="" \ + DEF="win32/zip.def" + +# emx 0.9c, gcc, a.out format, for MS-DOS +gccdos: + $(MAKE) -f win32/makefile.emx all \ + CC="gcc -O2 -m486 -Wall" \ + CFLAGS="-DDOS -DMSDOS -DASM_CRC" \ + AS="gcc" \ + ASFLAGS="-Di386" \ + LDFLAGS="-o ./" \ + LDFLAGS2="-s -Zsmall-conv" \ + OUT="-o" \ + OBJ=".o" \ + CRC32="crc_gcc" \ + OBJA="matchgcc.o" \ + OBJZS="msdos.o" \ + OBJUS="msdos_.o" \ + OSDEP_H="msdos/osdep.h" \ + ZIPUP_H="msdos/zipup.h" + +# emx 0.9c, gcc, a.out format, for MS-DOS, using zlib +gccdoszl: + $(MAKE) -f win32/makefile.emx all \ + CC="gcc -O2 -m486 -Wall" \ + CFLAGS="-DDOS -DMSDOS -DUSE_ZLIB" \ + AS="gcc" \ + ASFLAGS="-Di386 -DUSE_ZLIB" \ + LDFLAGS="-o ./" \ + LDFLAGS2="-L. -lzlib -s -Zsmall-conv" \ + OUT="-o" \ + OBJ=".o" \ + CRC32="crc32" \ + OBJA="" \ + OBJZS="msdos.o" \ + OBJUS="msdos_.o" \ + OSDEP_H="msdos/osdep.h" \ + ZIPUP_H="msdos/zipup.h" + +# VPATH = .;win32 + +# variables + +#default settings for target dependent macros: + +# the "gcc" (statically linked Win32 executables) target: +CC=gcc -Zwin32 -O2 -m486 -Wall +CFLAGS=-DWIN32 -DASM_CRC +AS=gcc -Zwin32 +ASFLAGS=-Di386 +LDFLAGS=-o ./ +LDFLAGS2=-ladvapi32 -s -Zsmall-conv +OUT=-o +OBJ=.o +CRC32=crc_gcc +OBJA=matchgcc.o +OSDEP_H=win32/osdep.h +ZIPUP_H=win32/zipup.h +DEF=win32/zip.def + +DIRSEP = / +AS_DIRSEP = / +RM = del +LOCAL_OPTS = $(LOCAL_ZIP) +CCFLAGS = $(CFLAGS) $(LOCAL_OPTS) + + +OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \ + $(CRC32)$(OBJ) crctab$(OBJ) +OBJZ2 = globals$(OBJ) deflate$(OBJ) trees$(OBJ) crypt$(OBJ) \ + ttyio$(OBJ) +OBJZS = win32zip$(OBJ) win32$(OBJ) nt$(OBJ) +OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) $(OBJA) + +OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ) +OBJUS = win32_$(OBJ) +OBJU = $(OBJU1) $(OBJUS) + +OBJN = zipnote$(OBJ) $(OBJU) +OBJS = zipsplit$(OBJ) $(OBJU) +OBJC1 = zipcloak$(OBJ) crctab$(OBJ) crypt_$(OBJ) ttyio$(OBJ) +OBJC = $(OBJC1) $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H) + +# rules + +.SUFFIXES: .c $(OBJ) + +.c$(OBJ): + $(CC) -c -I. $(CCFLAGS) $(OUT)$@ $< + +# targets + +all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +zip$(OBJ): zip.c $(ZIP_H) revision.h crypt.h ttyio.h +zipfile$(OBJ): zipfile.c $(ZIP_H) +zipup$(OBJ): zipup.c $(ZIP_H) revision.h crypt.h $(ZIPUP_H) +fileio$(OBJ): fileio.c $(ZIP_H) +util$(OBJ): util.c $(ZIP_H) +globals$(OBJ): globals.c $(ZIP_H) +deflate$(OBJ): deflate.c $(ZIP_H) +trees$(OBJ): trees.c $(ZIP_H) +crc32$(OBJ): crc32.c $(ZIP_H) +crctab$(OBJ): crctab.c $(ZIP_H) +crypt$(OBJ): crypt.c $(ZIP_H) crypt.h ttyio.h +ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h + +msdos$(OBJ): msdos/msdos.c $(ZIP_H) + $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c + +win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c + +win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c + +nt$(OBJ): win32/nt.c $(ZIP_H) win32/nt.h + $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c + +crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS + $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S + +matchgcc$(OBJ): match.S + $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S + +zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h +zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h +zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h + +zipfile_$(OBJ): zipfile.c $(ZIP_H) + $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c + +fileio_$(OBJ): fileio.c $(ZIP_H) + $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c + +util_$(OBJ): util.c $(ZIP_H) + $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c + +crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c + +msdos_$(OBJ): msdos/msdos.c $(ZIP_H) + $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c + +win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c + +zip.exe: $(OBJZ) +# for DUMB make utilities, uncomment the following commands: + -@$(RM) zip.rsp + @for %%f in ($(OBJZ1)) do echo %%f >> zip.rsp + @for %%f in ($(OBJZ2)) do echo %%f >> zip.rsp + @for %%f in ($(OBJZS) $(OBJA)) do echo %%f >> zip.rsp + $(CC) $(LDFLAGS)$@ @zip.rsp $(LDFLAGS2) + @$(RM) zip.rsp +# smart make utilities (like well done ports of GNU Make) can use this: +# $(CC) $(LDFLAGS)$@ $(OBJZ) $(LDFLAGS2) + +zipcloak.exe: $(OBJC) +# for DUMB make utilities, uncomment the following commands: + -@$(RM) zipcloak.rsp + @for %%f in ($(OBJC1)) do echo %%f >> zipcloak.rsp + @for %%f in ($(OBJU1)) do echo %%f >> zipcloak.rsp + @for %%f in ($(OBJUS)) do echo %%f >> zipcloak.rsp + $(CC) $(LDFLAGS)$@ @zipcloak.rsp $(LDFLAGS2) + @$(RM) zipcloak.rsp +# smart make utilities (like well done ports of GNU Make) can use this: +# $(CC) $(LDFLAGS)$@ $(OBJC) $(LDFLAGS2) + +zipnote.exe: $(OBJN) +# for DUMB make utilities, uncomment the following commands: + -@$(RM) zipnote.rsp + @for %%f in ($(OBJN)) do echo %%f >> zipnote.rsp + $(CC) $(LDFLAGS)$@ @zipnote.rsp $(LDFLAGS2) + @$(RM) zipnote.rsp +# smart make utilities (like well done ports of GNU Make) can use this: +# $(CC) $(LDFLAGS)$@ $(OBJN) $(LDFLAGS2) + +zipsplit.exe: $(OBJS) +# for DUMB make utilities, uncomment the following commands: + -@$(RM) zipsplit.rsp + @for %%f in ($(OBJN)) do echo %%f >> zipsplit.rsp + $(CC) $(LDFLAGS)$@ @zipsplit.rsp $(LDFLAGS2) + @$(RM) zipsplit.rsp +# smart make utilities (like well done ports of GNU Make) can use this: +# $(CC) $(LDFLAGS)$@ $(OBJS) $(LDFLAGS2) diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.gcc boinc-7.0.14+dfsg/zip/zip/win32/makefile.gcc --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.gcc 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.gcc 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,143 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for port of gcc producing +# native Win32-Intel binaries. Derived from makefile.w32. +# Currently supported implementations: Cygnus/Win32 and MinGW32. +# +# First version: Cosmin Truta , Dec 1997. +# Last revision: Christian Spieler, 30-Jun-1998 +# +# To use, do "make -f win32/makefile.gcc". + +# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) +# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added +# to the declaration of LOC here: +LOC = $(LOCAL_ZIP) + +# ------------ GNU C ------------ +CC=gcc +ifndef USEZLIB +CFLAGS=-O2 -Wall -DWIN32 -DASM_CRC +else +CFLAGS=-O2 -Wall -DWIN32 -DUSE_ZLIB +endif +CCFLAGS=$(CFLAGS) $(LOC) +UTILFLAGS=$(CCFLAGS) -DUTIL -o$@ + +#AS=as +AS=$(CC) +ifndef USEZLIB +ASDEFS= +else +ASDEFS=-DUSE_ZLIB +endif +ASFLAGS=-c $(ASDEFS) $(LOC) + +LD=$(CC) +LDFLAGS=-o$@ -s +ifndef USEZLIB +LIBS=-luser32 -ladvapi32 +else +LIBS=-L. -lz -luser32 -ladvapi32 +endif + +OSDEP_H = win32/osdep.h +ZIPUP_H = win32/zipup.h + +# variables +ifndef USEZLIB +OBJA = match.o crc_i386.o +else +OBJA = +endif +#use second definition for linking against libz + +OBJZ1 = zip.o crypt.o ttyio.o zipfile.o zipup.o fileio.o util.o \ + crc32.o crctab.o globals.o +OBJZ2 = deflate.o trees.o $(OBJA) +OBJZS = win32.o win32zip.o nt.o +OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) + +OBJU1 = zipfile_.o fileio_.o util_.o globals.o +OBJUS = win32_.o +OBJU = $(OBJU1) $(OBJUS) + +OBJN = zipnote.o $(OBJU) +OBJS = zipsplit.o $(OBJU) +OBJC1 = zipcloak.o crctab.o crypt_.o ttyio.o +OBJC = $(OBJC1) $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H) + +ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +# rules + +.SUFFIXES: .c .o + +.c.o: + $(CC) -c $(CCFLAGS) -I. -o$@ $< + +# targets + +zips: $(ZIPS) + +zip.o: zip.c $(ZIP_H) revision.h crypt.h ttyio.h +zipfile.o: zipfile.c $(ZIP_H) +zipup.o: zipup.c $(ZIP_H) revision.h crypt.h $(ZIPUP_H) +fileio.o: fileio.c $(ZIP_H) +util.o: util.c $(ZIP_H) +globals.o: globals.c $(ZIP_H) +deflate.o: deflate.c $(ZIP_H) +trees.o: trees.c $(ZIP_H) +crc32.o: crc32.c $(ZIP_H) +crctab.o: crctab.c $(ZIP_H) +crypt.o: crypt.c $(ZIP_H) crypt.h ttyio.h +ttyio.o: ttyio.c $(ZIP_H) crypt.h ttyio.h + +win32zip.o: win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) -c $(CCFLAGS) -I. win32/win32zip.c + +win32.o: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(CCFLAGS) -I. win32/win32.c + +nt.o: win32/nt.c $(ZIP_H) win32/nt.h + $(CC) -c $(CCFLAGS) -I. win32/nt.c + +zipcloak.o: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h +zipnote.o: zipnote.c $(ZIP_H) revision.h +zipsplit.o: zipsplit.c $(ZIP_H) revision.h + +zipfile_.o: zipfile.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) zipfile.c + +fileio_.o: fileio.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) fileio.c + +util_.o: util.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) util.c + +crypt_.o: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(UTILFLAGS) crypt.c + +win32_.o: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(UTILFLAGS) -I. win32/win32.c + +match.o: match.S + $(AS) $(ASFLAGS) match.S + +crc_i386.o: crc_i386.S + $(AS) $(ASFLAGS) crc_i386.S + +zip.exe: $(OBJZ) + $(LD) $(LDFLAGS) $(OBJZ) $(LIBS) + +zipcloak.exe: $(OBJC) + $(LD) $(LDFLAGS) $(OBJC) $(LIBS) + +zipnote.exe: $(OBJN) + $(LD) $(LDFLAGS) $(OBJN) + +zipsplit.exe: $(OBJS) + $(LD) $(LDFLAGS) $(OBJS) + +clean: + rm -f *.o *.exe diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.ibm boinc-7.0.14+dfsg/zip/zip/win32/makefile.ibm --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.ibm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.ibm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,123 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for +# 32-bit IBM Visual Age C++ + +# To use, do "nmake -f win32\makefile.ibm" + +# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) +# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added +# to the declaration of LOC here: +LOC = $(LOCAL_ZIP) + +# Uncomment the following macro to use the optimized assembler +# routines in Zip: +# ASMOBJS = match32.obj + +# ------------- 32-bit IBM Visual Age C++ ------------- +CC=icc -q -O +CFLAGS=-W0 -DWIN32 -Sm -DNO_ASM -DNO_MKTEMP $(LOC) +UTILFLAGS=$(CFLAGS) -DUTIL -Fo$@ +LDFLAGS= +LIBS=advapi32.lib +AS=ml -nologo +ASFLAGS=-c -Cx + +# variables +OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ + crc32.obj crctab.obj globals.obj + +OBJI = deflate.obj trees.obj $(ASMOBJS) win32.obj win32zip.obj nt.obj + +OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj win32_.obj +OBJN = zipnote.obj $(OBJU) +OBJC = zipcloak.obj crctab.obj crypt_.obj ttyio.obj $(OBJU) +OBJS = zipsplit.obj $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h win32/osdep.h + +ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +zips: $(ZIPS) + +zip.obj: zip.c $(ZIP_H) revision.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +zipfile.obj: zipfile.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32/zipup.h + $(CC) -c $(CFLAGS) $*.c + +fileio.obj: fileio.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +util.obj: util.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +globals.obj: globals.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +deflate.obj: deflate.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +trees.obj: trees.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crc32.obj: crc32.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crctab.obj: crctab.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +win32zip.obj: win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) -c $(CFLAGS) -I. win32/win32zip.c + +win32.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(CFLAGS) -I. win32/win32.c + +nt.obj: win32/nt.c $(ZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) -I. win32/nt.c + +zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +zipnote.obj: zipnote.c $(ZIP_H) revision.h + $(CC) -c $(CFLAGS) $*.c + +zipsplit.obj: zipsplit.c $(ZIP_H) revision.h + $(CC) -c $(CFLAGS) $*.c + +zipfile_.obj: zipfile.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) zipfile.c + +fileio_.obj: fileio.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) fileio.c + +util_.obj: util.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) util.c + +crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(UTILFLAGS) crypt.c + +win32_.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(UTILFLAGS) -I. win32/win32.c + +match32.obj: win32/match32.asm + $(AS) $(ASFLAGS) win32\match32.asm + +zip.exe: $(OBJZ) $(OBJI) + $(CC) -Fe $@ $(LDFLAGS) $(OBJZ) $(OBJI) $(LIBS) + +zipcloak.exe: $(OBJC) + $(CC) -Fe $@ $(LDFLAGS) $(OBJC) $(LIBS) + +zipnote.exe: $(OBJN) + $(CC) -Fe $@ $(LDFLAGS) $(OBJN) $(LIBS) + +zipsplit.exe: $(OBJS) + $(CC) -Fe $@ $(LDFLAGS) $(OBJS) $(LIBS) diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.lcc boinc-7.0.14+dfsg/zip/zip/win32/makefile.lcc --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.lcc 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.lcc 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,123 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit using LCC-Win32. +# By E-Yen Tan (3 June 1998). +# Last updated 21 December 1998 (Christian Spieler). + +# This compiler evaluates #include locations relative to current working dir, +# not relative to the location of the file containing the #include directive. +# As a consequence, a "-Iwin32" option is required to allow compilation of +# the WIN32 specific sources. + +CC = lcc +# -O caused a segmentation violation with previous versions of lcc, but +# now the optimizer seems to be fixed. +CCFLAGS = -zp8 -O -DWIN32 +AS = lcc +ASFLAGS = +LD = lcclnk +LDFLAGS = -s + +# Optional macros should be declared below. +# LCC's Make will not read the LOCAL_ZIP environment variable. +LOC = $(ASMFLG) + +# Options to select optimized assembler code for CRC32 calculation. +#ifdef USEASM +CRC32 = crc_lcc +OBJA = lm32_lcc.obj +ASMFLG = -DASM_CRC -DASMV +#else +#CRC32 = crc32 +#OBJA = +#ASMFLG = -DNO_ASM +#endif + +CFLAGS = $(CCFLAGS) $(LOC) + +OBJZS = win32.obj win32zip.obj nt.obj $(OBJA) +OBJUS = win32_.obj + +OBJZ1 = zip.obj zipfile.obj zipup.obj fileio.obj util.obj +OBJZ2 = $(CRC32).obj crctab.obj globals.obj +OBJZ3 = deflate.obj trees.obj crypt.obj ttyio.obj +OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZ3) $(OBJZS) + +OBJU1 = zipfile_.obj fileio_.obj util_.obj globals.obj +OBJU = $(OBJU1) $(OBJUS) + +OBJN = zipnote.obj $(OBJU) +OBJS = zipsplit.obj $(OBJU) +OBJK = zipcloak.obj crctab.obj crypt_.obj ttyio.obj +OBJC = $(OBJK) $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h win32/osdep.h + +# rules + +.SUFFIXES: .c .obj + +.c.obj: + $(CC) $(CFLAGS) $< + +.asm.obj: + $(AS) $(ASFLAGS) $< + +all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +zip.obj: zip.c $(ZIP_H) revision.h crypt.h ttyio.h +zipfile.obj: zipfile.c $(ZIP_H) +zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32/zipup.h +fileio.obj: fileio.c $(ZIP_H) +util.obj: util.c $(ZIP_H) +globals.obj: globals.c $(ZIP_H) +deflate.obj: deflate.c $(ZIP_H) +trees.obj: trees.c $(ZIP_H) +crc32.obj: crc32.c $(ZIP_H) +crctab.obj: crctab.c $(ZIP_H) +crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h +ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h + +win32.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) $(CFLAGS) -Iwin32 -Fo$@ win32/win32.c + +win32zip.obj: win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) $(CFLAGS) -Iwin32 -Fo$@ win32/win32zip.c + +nt.obj: win32/nt.c $(ZIP_H) win32/nt.h + $(CC) $(CFLAGS) -Iwin32 -Fo$@ win32/nt.c + +crc_lcc.obj: win32/crc_lcc.asm + $(AS) $(ASFLAGS) -Fo$@ win32/crc_lcc.asm + +lm32_lcc.obj: win32/lm32_lcc.asm + $(AS) $(ASFLAGS) -Fo$@ win32/lm32_lcc.asm + +zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h +zipnote.obj: zipnote.c $(ZIP_H) revision.h +zipsplit.obj: zipsplit.c $(ZIP_H) revision.h + +zipfile_.obj: zipfile.c $(ZIP_H) + $(CC) $(CFLAGS) -DUTIL -Fo$@ zipfile.c + +fileio_.obj: fileio.c $(ZIP_H) + $(CC) $(CFLAGS) -DUTIL -Fo$@ fileio.c + +util_.obj: util.c $(ZIP_H) + $(CC) $(CFLAGS) -DUTIL -Fo$@ util.c + +crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) $(CFLAGS) -DUTIL -Fo$@ crypt.c + +win32_.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) $(CFLAGS) -DUTIL -Iwin32 -Fo$@ win32/win32.c + +zip.exe: $(OBJZ) + $(LD) $(LDFLAGS) -o $@ $(OBJZ) + +zipcloak.exe: $(OBJC) + $(LD) $(LDFLAGS) -o $@ $(OBJC) + +zipnote.exe: $(OBJN) + $(LD) $(LDFLAGS) -o $@ $(OBJN) + +zipsplit.exe: $(OBJS) + $(LD) $(LDFLAGS) -o $@ $(OBJS) diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.w10 boinc-7.0.14+dfsg/zip/zip/win32/makefile.w10 --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.w10 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.w10 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,176 @@ +# WMAKE makefile for Windows 95 and Windows NT (Intel only) +# using Watcom C/C++ v10.5+, by Paul Kienitz, last revised 16 July 97. +# Makes Zip.exe, ZipNote.exe, ZipCloak.exe, and ZipSplit.exe. +# +# Invoke from Zip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]" +# To build with debug info use "WMAKE DEBUG=1 ..." +# To build without any assembly modules use "WMAKE NOASM=1 ..." +# +# Other options to be fed to the compiler can be specified in an environment +# variable called LOCAL_ZIP. One possibility "-DDYN_ALLOC", but currently +# this is not supported unless NOASM is also used. + +variation = $(%LOCAL_ZIP) + +# Stifle annoying "Delete this file?" questions when errors occur: +.ERASE + +.EXTENSIONS: +.EXTENSIONS: .exe .obj .c .h .asm + +# We maintain multiple sets of object files in different directories so that +# we can compile msdos, dos/4gw, and win32 versions of Zip without their +# object files interacting. The following var must be a directory name +# ending with a backslash. All object file names must include this macro +# at the beginning, for example "$(O)foo.obj". + +!ifdef DEBUG +O = od32w\ # comment here so backslash won't continue the line +!else +O = ob32w\ # likewise +!endif + +# The assembly hot-spot code in crc_i386.asm and match32.asm is optional. +# This section controls its usage. + +!ifdef NOASM +asmob = $(O)crc32.obj # C source +cvars = $+$(cvars)$- -DNO_ASM # otherwise ASM_CRC might default on! +# "$+$(foo)$-" means expand foo as it has been defined up to now; normally, +# this make defers inner expansion until the outer macro is expanded. +!else # !NOASM +asmob = $(O)match32.obj $(O)crc_i386.obj +cvars = $+$(cvars)$- -DASMV -DASM_CRC +!endif + +# Our object files. OBJZ is for Zip, OBJC is for ZipCloak, OBJN is for +# ZipNote, and OBJS is for ZipSplit: + +OBJZ3 = $(O)zip.obj $(O)crypt.obj $(O)ttyio.obj $(O)trees.obj $(O)zipup.obj +OBJZ2 = $(OBJZ3) $(O)util.obj $(O)zipfile.obj $(O)fileio.obj $(O)deflate.obj +OBJZ1 = $(OBJZ2) $(O)globals.obj $(O)crctab.obj $(asmob) +OBJZ = $(OBJZ1) $(O)win32zip.obj $(O)win32.obj $(O)nt.obj + +OBJU2 = $(O)zipfile_.obj $(O)fileio_.obj $(O)util_.obj $(O)globals.obj +OBJ_U = $(OBJU2) $(O)win32_.obj + +OBJC = $(O)zipcloak.obj $(O)crctab.obj $(O)crypt_.obj $(O)ttyio.obj $(OBJ_U) + +OBJN = $(O)zipnote.obj $(OBJ_U) + +OBJS = $(O)zipsplit.obj $(OBJ_U) + +# Common header files included by all C sources: + +ZIP_H = zip.h ziperr.h tailor.h win32\osdep.h + +# Now we have to pick out the proper compiler and options for it. + +cc = wcc386 +link = wlink +asm = wasm +# Use Pentium timings, register args, static strings in code: +cflags = -bt=NT -5r -zt -zq +aflags = -bt=NT -mf -3 -zq +lflags = sys NT +cvars = $+$(cvars)$- -DWIN32 $(variation) +avars = $+$(avars)$- $(variation) + +# Specify optimizations, or a nonoptimized debugging version: + +!ifdef DEBUG +cdebug = -od -d2 +ldebug = d w all op symf +!else +cdebug = -s -oeilrt -zp4 +# note: -ol+ does not help. -oa helps slightly but might be dangerous. +ldebug = op el +!endif + +# How to compile sources: +.c.obj: + $(cc) $(cdebug) $(cflags) $(cvars) $< -fo=$@ + +# Here we go! By default, make all targets: +all: Zip.exe ZipNote.exe ZipCloak.exe ZipSplit.exe + +# Convenient shorthand options for single targets: +z: Zip.exe .SYMBOLIC +n: ZipNote.exe .SYMBOLIC +c: ZipCloak.exe .SYMBOLIC +s: ZipSplit.exe .SYMBOLIC + +Zip.exe: $(OBJZ) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJZ)} + +ZipNote.exe: $(OBJN) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJN)} + +ZipCloak.exe: $(OBJC) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJC)} + +ZipSplit.exe: $(OBJS) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJS)} + +# Source dependencies: + +$(O)crctab.obj: crctab.c $(ZIP_H) +$(O)crc32.obj: crc32.c $(ZIP_H) # only used if NOASM +$(O)crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h +$(O)deflate.obj: deflate.c $(ZIP_H) +$(O)fileio.obj: fileio.c $(ZIP_H) +$(O)globals.obj: globals.c $(ZIP_H) +$(O)trees.obj: trees.c $(ZIP_H) +$(O)ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h +$(O)util.obj: util.c $(ZIP_H) +$(O)zip.obj: zip.c $(ZIP_H) crypt.h revision.h ttyio.h +$(O)zipfile.obj: zipfile.c $(ZIP_H) +$(O)zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32\zipup.h +$(O)zipnote.obj: zipnote.c $(ZIP_H) revision.h +$(O)zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h +$(O)zipsplit.obj: zipsplit.c $(ZIP_H) revision.h + +# Special case object files: + +$(O)win32.obj: win32\win32.c $(ZIP_H) win32\win32zip.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@ + +$(O)win32zip.obj: win32\win32zip.c $(ZIP_H) win32\win32zip.h win32\nt.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\win32zip.c -fo=$@ + +$(O)nt.obj: win32\nt.c $(ZIP_H) win32\nt.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@ + +$(O)match32.obj: win32\match32.asm + $(asm) $(aflags) $(avars) win32\match32.asm -fo=$@ + +$(O)crc_i386.obj: win32\crc_i386.asm + $(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@ + +# Variant object files for ZipNote, ZipCloak, and ZipSplit: + +$(O)zipfile_.obj: zipfile.c $(ZIP_H) + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL zipfile.c -fo=$@ + +$(O)fileio_.obj: fileio.c $(ZIP_H) + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL fileio.c -fo=$@ + +$(O)util_.obj: util.c $(ZIP_H) + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL util.c -fo=$@ + +$(O)crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crypt.c -fo=$@ + +$(O)win32_.obj: win32\win32.c $(ZIP_H) win32\win32zip.h + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL win32\win32.c -fo=$@ + +# Unwanted file removal: + +clean: .SYMBOLIC + del $(O)*.obj + +cleaner: clean .SYMBOLIC + del Zip.exe + del ZipNote.exe + del ZipCloak.exe + del ZipSplit.exe diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.w32 boinc-7.0.14+dfsg/zip/zip/win32/makefile.w32 --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.w32 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.w32 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,134 @@ +# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for +# 32-bit Microsoft Visual C++ + +# To use, do "nmake -f makefile.w32" + +# Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if +# you do not have masm 6.1X. + +# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) +# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added +# to the declaration of LOC here: +LOC = $(LOCAL_ZIP) + +# Uncomment the following macro to use the optimized assembler +# routines in Zip: +ASMOBJS = match32.obj + +# ------------- 32-bit Microsoft Visual C++ ------------- +CC=cl -nologo +CFLAGS=-W3 -O2 -DWIN32 -DMSDOS $(LOC) +UTILFLAGS=$(CFLAGS) -DUTIL -Fo$@ + +# Remove "-coff" from ASFLAGS if you do not have MASM 6.11. + +AS=ml -nologo +ASFLAGS=-c -coff -Cx + +# If you build 16-bit executables with MS Visual C++ v1.0/1.5 and link them +# with the /KNOWEAS switch, you can build dual-mode MS-DOS/Win32 executables +# by passing the -stub switch to the 32-bit linker to specify the 16-bit part. + +LD=link -nologo +LDFLAGS=advapi32.lib + +# variables +OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ + crc32.obj crctab.obj globals.obj + +OBJI = deflate.obj trees.obj $(ASMOBJS) win32.obj win32zip.obj nt.obj + +OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj win32_.obj +OBJN = zipnote.obj $(OBJU) +OBJC = zipcloak.obj crctab.obj crypt_.obj ttyio.obj $(OBJU) +OBJS = zipsplit.obj $(OBJU) + +ZIP_H = zip.h ziperr.h tailor.h win32/osdep.h + +ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe + +zips: $(ZIPS) + +zip.obj: zip.c $(ZIP_H) revision.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +zipfile.obj: zipfile.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32/zipup.h + $(CC) -c $(CFLAGS) $*.c + +fileio.obj: fileio.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +util.obj: util.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +globals.obj: globals.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +deflate.obj: deflate.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +trees.obj: trees.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crc32.obj: crc32.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crctab.obj: crctab.c $(ZIP_H) + $(CC) -c $(CFLAGS) $*.c + +crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +win32zip.obj: win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h + $(CC) -c $(CFLAGS) -I. win32/win32zip.c + +win32.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(CFLAGS) -I. win32/win32.c + +nt.obj: win32/nt.c $(ZIP_H) win32/nt.h + $(CC) -c $(CFLAGS) -I. win32/nt.c + +zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h + $(CC) -c $(CFLAGS) $*.c + +zipnote.obj: zipnote.c $(ZIP_H) revision.h + $(CC) -c $(CFLAGS) $*.c + +zipsplit.obj: zipsplit.c $(ZIP_H) revision.h + $(CC) -c $(CFLAGS) $*.c + +zipfile_.obj: zipfile.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) zipfile.c + +fileio_.obj: fileio.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) fileio.c + +util_.obj: util.c $(ZIP_H) + $(CC) -c $(UTILFLAGS) util.c + +crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(CC) -c $(UTILFLAGS) crypt.c + +win32_.obj: win32/win32.c $(ZIP_H) win32/win32zip.h + $(CC) -c $(UTILFLAGS) -I. win32/win32.c + +match32.obj: win32/match32.asm + $(AS) $(ASFLAGS) win32\match32.asm + +zip.exe: $(OBJZ) $(OBJI) + $(LD) $(LDFLAGS) $(OBJZ) $(OBJI) + +zipcloak.exe: $(OBJC) + $(LD) $(LDFLAGS) $(OBJC) + +zipnote.exe: $(OBJN) + $(LD) $(LDFLAGS) $(OBJN) + +zipsplit.exe: $(OBJS) + $(LD) $(LDFLAGS) $(OBJS) diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/makefile.wat boinc-7.0.14+dfsg/zip/zip/win32/makefile.wat --- boinc-7.0.7+dfsg/zip/zip/win32/makefile.wat 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/makefile.wat 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,176 @@ +# WMAKE makefile for Windows 95 and Windows NT (Intel only) +# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 13 Feb 99. +# Makes Zip.exe, ZipNote.exe, ZipCloak.exe, and ZipSplit.exe. +# +# Invoke from Zip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]" +# To build with debug info use "WMAKE DEBUG=1 ..." +# To build without any assembly modules use "WMAKE NOASM=1 ..." +# +# Other options to be fed to the compiler can be specified in an environment +# variable called LOCAL_ZIP. One possibility "-DDYN_ALLOC", but currently +# this is not supported unless NOASM is also used. + +variation = $(%LOCAL_ZIP) + +# Stifle annoying "Delete this file?" questions when errors occur: +.ERASE + +.EXTENSIONS: +.EXTENSIONS: .exe .obj .c .h .asm + +# We maintain multiple sets of object files in different directories so that +# we can compile msdos, dos/4gw, and win32 versions of Zip without their +# object files interacting. The following var must be a directory name +# ending with a backslash. All object file names must include this macro +# at the beginning, for example "$(O)foo.obj". + +!ifdef DEBUG +O = od32w\ # comment here so backslash won't continue the line +!else +O = ob32w\ # likewise +!endif + +# The assembly hot-spot code in crc_i386.asm and match32.asm is optional. +# This section controls its usage. + +!ifdef NOASM +asmob = $(O)crc32.obj # C source +cvars = $+$(cvars)$- -DNO_ASM # otherwise ASM_CRC might default on! +# "$+$(foo)$-" means expand foo as it has been defined up to now; normally, +# this make defers inner expansion until the outer macro is expanded. +!else # !NOASM +asmob = $(O)match32.obj $(O)crc_i386.obj +cvars = $+$(cvars)$- -DASMV -DASM_CRC +!endif + +# Our object files. OBJZ is for Zip, OBJC is for ZipCloak, OBJN is for +# ZipNote, and OBJS is for ZipSplit: + +OBJZ3 = $(O)zip.obj $(O)crypt.obj $(O)ttyio.obj $(O)trees.obj $(O)zipup.obj +OBJZ2 = $(OBJZ3) $(O)util.obj $(O)zipfile.obj $(O)fileio.obj $(O)deflate.obj +OBJZ1 = $(OBJZ2) $(O)globals.obj $(O)crctab.obj $(asmob) +OBJZ = $(OBJZ1) $(O)win32zip.obj $(O)win32.obj $(O)nt.obj + +OBJU1 = $(O)zipfile_.obj $(O)fileio_.obj $(O)util_.obj $(O)globals.obj +OBJ_U = $(OBJU1) $(O)win32_.obj + +OBJC = $(O)zipcloak.obj $(O)crctab.obj $(O)crypt_.obj $(O)ttyio.obj $(OBJ_U) + +OBJN = $(O)zipnote.obj $(OBJ_U) + +OBJS = $(O)zipsplit.obj $(OBJ_U) + +# Common header files included by all C sources: + +ZIP_H = zip.h ziperr.h tailor.h win32\osdep.h + +# Now we have to pick out the proper compiler and options for it. + +cc = wcc386 +link = wlink +asm = wasm +# Use Pentium Pro timings, register args, static strings in code: +cflags = -bt=NT -6r -zt -zq +aflags = -bt=NT -mf -3 -zq +lflags = sys NT +cvars = $+$(cvars)$- -DWIN32 $(variation) +avars = $+$(avars)$- $(variation) + +# Specify optimizations, or a nonoptimized debugging version: + +!ifdef DEBUG +cdebug = -od -d2 +ldebug = d w all op symf +!else +cdebug = -s -obhikl+rt -oe=100 -zp8 +# -oa helps slightly but might be dangerous. +ldebug = op el +!endif + +# How to compile sources: +.c.obj: + $(cc) $(cdebug) $(cflags) $(cvars) $[@ -fo=$@ + +# Here we go! By default, make all targets: +all: Zip.exe ZipNote.exe ZipCloak.exe ZipSplit.exe + +# Convenient shorthand options for single targets: +z: Zip.exe .SYMBOLIC +n: ZipNote.exe .SYMBOLIC +c: ZipCloak.exe .SYMBOLIC +s: ZipSplit.exe .SYMBOLIC + +Zip.exe: $(OBJZ) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJZ)} + +ZipNote.exe: $(OBJN) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJN)} + +ZipCloak.exe: $(OBJC) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJC)} + +ZipSplit.exe: $(OBJS) + $(link) $(lflags) $(ldebug) name $@ file {$(OBJS)} + +# Source dependencies: + +$(O)crctab.obj: crctab.c $(ZIP_H) +$(O)crc32.obj: crc32.c $(ZIP_H) # only used if NOASM +$(O)crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h +$(O)deflate.obj: deflate.c $(ZIP_H) +$(O)fileio.obj: fileio.c $(ZIP_H) +$(O)globals.obj: globals.c $(ZIP_H) +$(O)trees.obj: trees.c $(ZIP_H) +$(O)ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h +$(O)util.obj: util.c $(ZIP_H) +$(O)zip.obj: zip.c $(ZIP_H) crypt.h revision.h ttyio.h +$(O)zipfile.obj: zipfile.c $(ZIP_H) +$(O)zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32\zipup.h +$(O)zipnote.obj: zipnote.c $(ZIP_H) revision.h +$(O)zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h +$(O)zipsplit.obj: zipsplit.c $(ZIP_H) revision.h + +# Special case object files: + +$(O)win32.obj: win32\win32.c $(ZIP_H) win32\win32zip.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@ + +$(O)win32zip.obj: win32\win32zip.c $(ZIP_H) win32\win32zip.h win32\nt.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\win32zip.c -fo=$@ + +$(O)nt.obj: win32\nt.c $(ZIP_H) win32\nt.h + $(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@ + +$(O)match32.obj: win32\match32.asm + $(asm) $(aflags) $(avars) win32\match32.asm -fo=$@ + +$(O)crc_i386.obj: win32\crc_i386.asm + $(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@ + +# Variant object files for ZipNote, ZipCloak, and ZipSplit: + +$(O)zipfile_.obj: zipfile.c $(ZIP_H) + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL zipfile.c -fo=$@ + +$(O)fileio_.obj: fileio.c $(ZIP_H) + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL fileio.c -fo=$@ + +$(O)util_.obj: util.c $(ZIP_H) + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL util.c -fo=$@ + +$(O)crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crypt.c -fo=$@ + +$(O)win32_.obj: win32\win32.c $(ZIP_H) win32\win32zip.h + $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL win32\win32.c -fo=$@ + +# Unwanted file removal: + +clean: .SYMBOLIC + del $(O)*.obj + +cleaner: clean .SYMBOLIC + del Zip.exe + del ZipNote.exe + del ZipCloak.exe + del ZipSplit.exe diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/match32.asm boinc-7.0.14+dfsg/zip/zip/win32/match32.asm --- boinc-7.0.7+dfsg/zip/zip/win32/match32.asm 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/match32.asm 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,184 @@ +;=========================================================================== +; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. +; +; See the accompanying file LICENSE, version 1999-Oct-05 or later +; (the contents of which are also included in zip.h) for terms of use. +; If, for some reason, both of these files are missing, the Info-ZIP license +; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +;=========================================================================== +; +; match32.asm by Jean-loup Gailly. + +; match32.asm, optimized version of longest_match() in deflate.c +; To be used only with 32 bit flat model. To simplify the code, the option +; -DDYN_ALLOC is not supported. +; This file is only optional. If you don't have an assembler, use the +; C version (add -DNO_ASM to CFLAGS in makefile and remove match.o +; from OBJI). If you have reduced WSIZE in zip.h, then make sure this is +; assembled with an equivalent -DWSIZE=. +; +; Win32 (Windows NT) version - 1994/04/13 by Steve Salisbury +; * works with Microsoft MASM 6.1X and Microsoft Visual C++ / 32-bit edition +; +; Adapted to work with Borland Turbo Assembler 5.0 by Cosmin Truta, 1997 +; +;============================================================================== +; +; Do NOT assemble this source if external crc32 routine from zlib gets used. +; + IFNDEF USE_ZLIB +; + .386p + ifdef ASM_NEW + .MODEL FLAT + endif + + name match + + ifdef ASM_NEW +_BSS segment public use32 + else +_BSS segment public use32 'DATA' + endif + extrn _match_start : dword + extrn _prev_length : dword + extrn _good_match : dword + ifndef FULL_SEARCH + extrn _nice_match : dword + endif + extrn _strstart : dword + extrn _max_chain_length : dword + extrn _prev : word + extrn _window : byte +_BSS ends + + ifdef ASM_NEW +_TEXT segment public use32 + else +_TEXT segment para public use32 'CODE' + endif + assume CS: _TEXT + assume DS: _BSS, ES: _BSS, FS: _BSS + public _match_init + public _longest_match + + ifndef WSIZE + WSIZE equ 32768 ; keep in sync with zip.h ! + endif + MIN_MATCH equ 3 + MAX_MATCH equ 258 + MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) + MAX_DIST equ (WSIZE-MIN_LOOKAHEAD) + +; initialize or check the variables used in match.asm. + +_match_init proc near + ret +_match_init endp + +; ----------------------------------------------------------------------- +; Set match_start to the longest match starting at the given string and +; return its length. Matches shorter or equal to prev_length are discarded, +; in which case the result is equal to prev_length and match_start is +; garbage. +; IN assertions: cur_match is the head of the hash chain for the current +; string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + +; int longest_match(cur_match) + +_longest_match proc near + + cur_match equ dword ptr [esp+20] + ; return address ; esp+16 + push ebp ; esp+12 + push edi ; esp+8 + push esi ; esp+4 + push ebx ; esp + +; match equ esi +; scan equ edi +; chain_length equ ebp +; best_len equ ebx +; limit equ edx + + mov esi,cur_match + mov edx,_strstart + mov ebp,_max_chain_length ; chain_length = max_chain_length + mov edi,edx + sub edx,MAX_DIST ; limit = strstart-MAX_DIST + cld ; string ops increment esi and edi + jae short limit_ok + sub edx,edx ; limit = NIL +limit_ok: + add edi,2+offset _window ; edi = offset(window + strstart + 2) + mov ebx,_prev_length ; best_len = prev_length + mov cx,[edi-2] ; cx = scan[0..1] + mov ax,[ebx+edi-3] ; ax = scan[best_len-1..best_len] + cmp ebx,_good_match ; do we have a good match already? + jb short do_scan + shr ebp,2 ; chain_length >>= 2 + jmp short do_scan + + align 4 ; align destination of branch +long_loop: +; at this point, edi == scan+2, esi == cur_match + mov ax,[ebx+edi-3] ; ax = scan[best_len-1..best_len] + mov cx,[edi-2] ; cx = scan[0..1] +short_loop: +; at this point, edi == scan+2, esi == cur_match, +; ax = scan[best_len-1..best_len] and cx = scan[0..1] + and esi,WSIZE-1 + dec ebp ; --chain_length + mov si,_prev[esi+esi] ; cur_match = prev[cur_match] + ; top word of esi is still 0 + jz short the_end + cmp esi,edx ; cur_match <= limit ? + jbe short the_end +do_scan: + cmp ax,word ptr _window[ebx+esi-1] ; check match at best_len-1 + jne short_loop + cmp cx,word ptr _window[esi] ; check min_match_length match + jne short_loop + + lea esi,_window[esi+2] ; esi = match + mov ecx,(MAX_MATCH-2)/2 ; scan for at most MAX_MATCH bytes + mov eax,edi ; eax = scan+2 + repe cmpsw ; loop until mismatch + je short maxmatch ; match of length MAX_MATCH? +mismatch: + mov cl,[edi-2] ; mismatch on first or second byte? + xchg eax,edi ; edi = scan+2, eax = end of scan + sub cl,[esi-2] ; cl = 0 if first bytes equal + sub eax,edi ; eax = len + sub esi,2+offset _window ; esi = match - (2 + offset(window)) + sub esi,eax ; esi = cur_match (= match - len) + sub cl,1 ; set carry if cl == 0 (can't use DEC) + adc eax,0 ; eax = carry ? len+1 : len + cmp eax,ebx ; len > best_len ? + jle long_loop + mov _match_start,esi ; match_start = cur_match + mov ebx,eax ; ebx = best_len = len + ifdef FULL_SEARCH + cmp eax,MAX_MATCH ; len >= MAX_MATCH ? + else + cmp eax,_nice_match ; len >= nice_match ? + endif + jl long_loop +the_end: + mov eax,ebx ; result = eax = best_len + pop ebx + pop esi + pop edi + pop ebp + ret +maxmatch: ; come here if maximum match + cmpsb ; increment esi and edi + jmp mismatch ; force match_length = MAX_LENGTH + +_longest_match endp + +_TEXT ends +; + ENDIF ; !USE_ZLIB +; +end diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/nt.c boinc-7.0.14+dfsg/zip/zip/win32/nt.c --- boinc-7.0.7+dfsg/zip/zip/win32/nt.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/nt.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,484 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*++ + +Copyright (c) 1996 Scott Field + +Module Name: + + nt.c (formerly nt_zip.c) + +Abstract: + + This module implements WinNT security descriptor operations for the + Win32 Info-ZIP project. Operation such as querying file security, + using/querying local and remote privileges. The contents of this module + are only relevant when the code is running on Windows NT, and the target + volume supports persistent Acl storage. + + User privileges that allow accessing certain privileged aspects of the + security descriptor (such as the Sacl) are only used if the user specified + to do so. + + In the future, this module may be expanded to support storage of + OS/2 EA data, Macintosh resource forks, and hard links, which are all + supported by NTFS. + +Author: + + Scott Field (sfield@microsoft.com) 27-Sep-96 + +--*/ + +#include "../zip.h" + +#define WIN32_LEAN_AND_MEAN +#include +#ifdef __RSXNT__ +# include "../win32/rsxntwin.h" +#endif +#include "../win32/nt.h" + +#ifdef NTSD_EAS /* This file is only needed for NTSD handling */ + +/* Borland C++ does not define FILE_SHARE_DELETE. Others also? */ +#ifndef FILE_SHARE_DELETE +# define FILE_SHARE_DELETE 0x00000004 +#endif + +/* private prototypes */ + +static BOOL Initialize(VOID); +#if 0 /* currently unused */ +static BOOL Shutdown(VOID); +#endif +static VOID GetRemotePrivilegesGet(CHAR *FileName, PDWORD dwRemotePrivileges); +static VOID InitLocalPrivileges(VOID); + + +BOOL bZipInitialized = FALSE; /* module level stuff initialized? */ +HANDLE hZipInitMutex = NULL; /* prevent multiple initialization */ + +BOOL g_bBackupPrivilege = FALSE; /* for local get file security override */ +BOOL g_bZipSaclPrivilege = FALSE; /* for local get sacl operations, only when + backup privilege not present */ + +/* our single cached volume capabilities structure that describes the last + volume root we encountered. A single entry like this works well in the + zip/unzip scenario for a number of reasons: + 1. typically one extraction path during unzip. + 2. typically process one volume at a time during zip, and then move + on to the next. + 3. no cleanup code required and no memory leaks. + 4. simple code. + + This approach should be reworked to a linked list approach if we expect to + be called by many threads which are processing a variety of input/output + volumes, since lock contention and stale data may become a bottleneck. */ + +VOLUMECAPS g_VolumeCaps; +CRITICAL_SECTION VolumeCapsLock; + + +static BOOL Initialize(VOID) +{ + HANDLE hMutex; + HANDLE hOldMutex; + + if(bZipInitialized) return TRUE; + + hMutex = CreateMutex(NULL, TRUE, NULL); + if(hMutex == NULL) return FALSE; + + hOldMutex = (HANDLE)InterlockedExchange((LPLONG)&hZipInitMutex, (LONG)hMutex); + + if(hOldMutex != NULL) { + /* somebody setup the mutex already */ + InterlockedExchange((LPLONG)&hZipInitMutex, (LONG)hOldMutex); + + CloseHandle(hMutex); /* close new, un-needed mutex */ + + /* wait for initialization to complete and return status */ + WaitForSingleObject(hOldMutex, INFINITE); + ReleaseMutex(hOldMutex); + + return bZipInitialized; + } + + /* initialize module level resources */ + + InitializeCriticalSection( &VolumeCapsLock ); + memset(&g_VolumeCaps, 0, sizeof(VOLUMECAPS)); + + InitLocalPrivileges(); + + bZipInitialized = TRUE; + + ReleaseMutex(hMutex); /* release correct mutex */ + + return TRUE; +} + +#if 0 /* currently not used ! */ +static BOOL Shutdown(VOID) +{ + /* really need to free critical sections, disable enabled privilges, etc, + but doing so brings up possibility of race conditions if those resources + are about to be used. The easiest way to handle this is let these + resources be freed when the process terminates... */ + + return TRUE; +} +#endif /* never */ + + +static VOID GetRemotePrivilegesGet(char *FileName, PDWORD dwRemotePrivileges) +{ + HANDLE hFile; + + *dwRemotePrivileges = 0; + + /* see if we have the SeBackupPrivilege */ + + hFile = CreateFileA( + FileName, + ACCESS_SYSTEM_SECURITY | GENERIC_READ | READ_CONTROL, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL + ); + + if(hFile != INVALID_HANDLE_VALUE) { + /* no remote way to determine SeBackupPrivilege -- just try a read + to simulate it */ + SECURITY_INFORMATION si = DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION; + PSECURITY_DESCRIPTOR sd; + DWORD cbBuf = 0; + + GetKernelObjectSecurity(hFile, si, NULL, cbBuf, &cbBuf); + + if(ERROR_INSUFFICIENT_BUFFER == GetLastError()) { + if((sd = HeapAlloc(GetProcessHeap(), 0, cbBuf)) != NULL) { + if(GetKernelObjectSecurity(hFile, si, sd, cbBuf, &cbBuf)) { + *dwRemotePrivileges |= OVERRIDE_BACKUP; + } + HeapFree(GetProcessHeap(), 0, sd); + } + } + + CloseHandle(hFile); + } else { + + /* see if we have the SeSecurityPrivilege */ + /* note we don't need this if we have SeBackupPrivilege */ + + hFile = CreateFileA( + FileName, + ACCESS_SYSTEM_SECURITY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, /* maximum sharing */ + NULL, + OPEN_EXISTING, + 0, + NULL + ); + + if(hFile != INVALID_HANDLE_VALUE) { + CloseHandle(hFile); + *dwRemotePrivileges |= OVERRIDE_SACL; + } + } +} + + +BOOL ZipGetVolumeCaps( + char *rootpath, /* filepath, or NULL */ + char *name, /* filename associated with rootpath */ + PVOLUMECAPS VolumeCaps /* result structure describing capabilities */ + ) +{ + char TempRootPath[MAX_PATH + 1]; + DWORD cchTempRootPath = 0; + BOOL bSuccess = TRUE; /* assume success until told otherwise */ + + if(!bZipInitialized) if(!Initialize()) return FALSE; + + /* process the input path to produce a consistent path suitable for + compare operations and also suitable for certain picky Win32 API + that don't like forward slashes */ + + if(rootpath != NULL && rootpath[0] != '\0') { + DWORD i; + + cchTempRootPath = lstrlen(rootpath); + if(cchTempRootPath > MAX_PATH) return FALSE; + + /* copy input, converting forward slashes to back slashes as we go */ + + for(i = 0 ; i <= cchTempRootPath ; i++) { + if(rootpath[i] == '/') TempRootPath[i] = '\\'; + else TempRootPath[i] = rootpath[i]; + } + + /* check for UNC and Null terminate or append trailing \ as appropriate */ + + /* possible valid UNCs we are passed follow: + \\machine\foo\bar (path is \\machine\foo\) + \\machine\foo (path is \\machine\foo\) + \\machine\foo\ + \\.\c$\ (FIXFIX: Win32API doesn't like this - GetComputerName()) + LATERLATER: handling mounted DFS drives in the future will require + slightly different logic which isn't available today. + This is required because directories can point at + different servers which have differing capabilities. + */ + + if(TempRootPath[0] == '\\' && TempRootPath[1] == '\\') { + DWORD slash = 0; + + for(i = 2 ; i < cchTempRootPath ; i++) { + if(TempRootPath[i] == '\\') { + slash++; + + if(slash == 2) { + i++; + TempRootPath[i] = '\0'; + cchTempRootPath = i; + break; + } + } + } + + /* if there was only one slash found, just tack another onto the end */ + + if(slash == 1 && TempRootPath[cchTempRootPath] != '\\') { + TempRootPath[cchTempRootPath] = TempRootPath[0]; /* '\' */ + TempRootPath[cchTempRootPath+1] = '\0'; + cchTempRootPath++; + } + + } else { + + if(TempRootPath[1] == ':') { + + /* drive letter specified, truncate to root */ + TempRootPath[2] = '\\'; + TempRootPath[3] = '\0'; + cchTempRootPath = 3; + } else { + + /* must be file on current drive */ + TempRootPath[0] = '\0'; + cchTempRootPath = 0; + } + + } + + } /* if path != NULL */ + + /* grab lock protecting cached entry */ + EnterCriticalSection( &VolumeCapsLock ); + + if(!g_VolumeCaps.bValid || lstrcmpi(g_VolumeCaps.RootPath, TempRootPath) != 0) { + + /* no match found, build up new entry */ + + DWORD dwFileSystemFlags; + DWORD dwRemotePrivileges = 0; + BOOL bRemote = FALSE; + + /* release lock during expensive operations */ + LeaveCriticalSection( &VolumeCapsLock ); + + bSuccess = GetVolumeInformation( + (TempRootPath[0] == '\0') ? NULL : TempRootPath, + NULL, 0, + NULL, NULL, + &dwFileSystemFlags, + NULL, 0); + + /* only if target volume supports Acls, and we were told to use + privileges do we need to go out and test for the remote case */ + + if(bSuccess && (dwFileSystemFlags & FS_PERSISTENT_ACLS) && VolumeCaps->bUsePrivileges) { + if(GetDriveType( (TempRootPath[0] == '\0') ? NULL : TempRootPath ) == DRIVE_REMOTE) { + bRemote = TRUE; + + /* make a determination about our remote capabilities */ + + GetRemotePrivilegesGet(name, &dwRemotePrivileges); + } + } + + /* always take the lock again, since we release it below */ + EnterCriticalSection( &VolumeCapsLock ); + + /* replace the existing data if successful */ + if(bSuccess) { + + lstrcpynA(g_VolumeCaps.RootPath, TempRootPath, cchTempRootPath+1); + g_VolumeCaps.bProcessDefer = FALSE; + g_VolumeCaps.dwFileSystemFlags = dwFileSystemFlags; + g_VolumeCaps.bRemote = bRemote; + g_VolumeCaps.dwRemotePrivileges = dwRemotePrivileges; + g_VolumeCaps.bValid = TRUE; + } + } + + if(bSuccess) { + /* copy input elements */ + g_VolumeCaps.bUsePrivileges = VolumeCaps->bUsePrivileges; + g_VolumeCaps.dwFileAttributes = VolumeCaps->dwFileAttributes; + + /* give caller results */ + memcpy(VolumeCaps, &g_VolumeCaps, sizeof(VOLUMECAPS)); + } else { + g_VolumeCaps.bValid = FALSE; + } + + LeaveCriticalSection( &VolumeCapsLock ); /* release lock */ + + return bSuccess; +} + +BOOL SecurityGet( + char *resource, + PVOLUMECAPS VolumeCaps, + unsigned char *buffer, + DWORD *cbBuffer + ) +{ + HANDLE hFile; + DWORD dwDesiredAccess; + DWORD dwFlags; + PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)buffer; + SECURITY_INFORMATION RequestedInfo; + BOOL bBackupPrivilege = FALSE; + BOOL bSaclPrivilege = FALSE; + BOOL bSuccess = FALSE; + + DWORD cchResourceLen; + + if(!bZipInitialized) if(!Initialize()) return FALSE; + + /* see if we are dealing with a directory */ + /* rely on the fact resource has a trailing [back]slash, rather + than calling expensive GetFileAttributes() */ + + cchResourceLen = lstrlenA(resource); + + if(resource[cchResourceLen-1] == '/' || resource[cchResourceLen-1] == '\\') + VolumeCaps->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; + + /* setup privilege usage based on if told we can use privileges, and if so, + what privileges we have */ + + if(VolumeCaps->bUsePrivileges) { + if(VolumeCaps->bRemote) { + /* use remotely determined privileges */ + if(VolumeCaps->dwRemotePrivileges & OVERRIDE_BACKUP) + bBackupPrivilege = TRUE; + + if(VolumeCaps->dwRemotePrivileges & OVERRIDE_SACL) + bSaclPrivilege = TRUE; + } else { + /* use local privileges */ + bBackupPrivilege = g_bBackupPrivilege; + bSaclPrivilege = g_bZipSaclPrivilege; + } + } + + /* always try to read the basic security information: Dacl, Owner, Group */ + + dwDesiredAccess = READ_CONTROL; + + RequestedInfo = OWNER_SECURITY_INFORMATION | + GROUP_SECURITY_INFORMATION | + DACL_SECURITY_INFORMATION; + + /* if we have the SeBackupPrivilege or SeSystemSecurityPrivilege, read + the Sacl, too */ + + if(bBackupPrivilege || bSaclPrivilege) { + dwDesiredAccess |= ACCESS_SYSTEM_SECURITY; + RequestedInfo |= SACL_SECURITY_INFORMATION; + } + + dwFlags = 0; + + /* if we have the backup privilege, specify that */ + /* opening a directory requires FILE_FLAG_BACKUP_SEMANTICS */ + + if(bBackupPrivilege || (VolumeCaps->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; + + hFile = CreateFileA( + resource, + dwDesiredAccess, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, /* maximum sharing */ + NULL, + OPEN_EXISTING, + dwFlags, + NULL + ); + + if(hFile == INVALID_HANDLE_VALUE) return FALSE; + + if(GetKernelObjectSecurity(hFile, RequestedInfo, sd, *cbBuffer, cbBuffer)) { + *cbBuffer = GetSecurityDescriptorLength( sd ); + bSuccess = TRUE; + } + + CloseHandle(hFile); + + return bSuccess; +} + +static VOID InitLocalPrivileges(VOID) +{ + HANDLE hToken; + TOKEN_PRIVILEGES tp; + + /* try to enable some interesting privileges that give us the ability + to get some security information that we normally cannot. + + note that enabling privileges is only relevant on the local machine; + when accessing files that are on a remote machine, any privileges + that are present on the remote machine get enabled by default. */ + + if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) + return; + + tp.PrivilegeCount = 1; + tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + /* try to enable SeBackupPrivilege. + if this succeeds, we can read all aspects of the security descriptor */ + + if(LookupPrivilegeValue(NULL, SE_BACKUP_NAME, &tp.Privileges[0].Luid)) { + if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && + GetLastError() == ERROR_SUCCESS) g_bBackupPrivilege = TRUE; + } + + /* try to enable SeSystemSecurityPrivilege if SeBackupPrivilege not present. + if this succeeds, we can read the Sacl */ + + if(!g_bBackupPrivilege && + LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid)) { + + if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && + GetLastError() == ERROR_SUCCESS) g_bZipSaclPrivilege = TRUE; + } + + CloseHandle(hToken); +} +#endif /* NTSD_EAS */ + +const char *BOINC_RCSID_13ad4e2be9 = "$Id: nt.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/nt.h boinc-7.0.14+dfsg/zip/zip/win32/nt.h --- boinc-7.0.7+dfsg/zip/zip/win32/nt.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/nt.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,73 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef _NT_ZIP_H +#define _NT_ZIP_H + +/* central header for EF_NTSD "SD" extra field */ + +#define EF_NTSD_MAX_VER_SUPPORT (0) + /* describes maximum ver# we know how to handle */ + +typedef struct +{ + USHORT nID; + USHORT nSize; + ULONG lSize; +} +EF_NTSD_C_HEADER, *PEF_NTSD_C_HEADER; + +#define EF_NTSD_C_LEN (sizeof(EF_NTSD_C_HEADER)) + +/* local header for EF_NTSD "SD" extra field */ + +#pragma pack(1) /* bytes following structure immediately follow BYTE Version */ + +typedef struct +{ + USHORT nID; /* tag for this extra block type */ + USHORT nSize; /* total data size for this block */ + ULONG lSize; /* uncompressed security descriptor data size */ + BYTE Version; /* Version of uncompressed security descriptor data format */ +} +IZ_PACKED EF_NTSD_L_HEADER, *PEF_NTSD_L_HEADER; + +#pragma pack() + +/* ...followed by... */ +/* SHORT CType; compression type */ +/* ULONG EACRC; CRC value for uncompressed security descriptor data */ +/* Variable length data */ + + +#define EF_NTSD_L_LEN (EF_NTSD_C_LEN + sizeof(BYTE)) + /* avoid alignment size computation */ + +#define NTSD_BUFFERSIZE (1024) /* threshold to cause malloc() */ + +#define OVERRIDE_BACKUP 1 /* we have SeBackupPrivilege on remote */ +#define OVERRIDE_RESTORE 2 /* we have SeRestorePrivilege on remote */ +#define OVERRIDE_SACL 4 /* we have SeSystemSecurityPrivilege on remote */ + +typedef struct { + BOOL bValid; /* are our contents valid? */ + BOOL bProcessDefer; /* process deferred entry yet? */ + BOOL bUsePrivileges; /* use privilege overrides? */ + DWORD dwFileSystemFlags; /* describes target file system */ + BOOL bRemote; /* is volume remote? */ + DWORD dwRemotePrivileges; /* relevant only on remote volumes */ + DWORD dwFileAttributes; + char RootPath[MAX_PATH+1]; /* path to network / filesystem */ +} VOLUMECAPS, *PVOLUMECAPS, *LPVOLUMECAPS; + +BOOL SecurityGet(char *resource, PVOLUMECAPS VolumeCaps, unsigned char *buffer, + DWORD *cbBuffer); +BOOL ZipGetVolumeCaps(char *rootpath, char *name, PVOLUMECAPS VolumeCaps); + +#endif /* _NT_ZIP_H */ + diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/osdep.h boinc-7.0.14+dfsg/zip/zip/win32/osdep.h --- boinc-7.0.7+dfsg/zip/zip/win32/osdep.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/osdep.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,216 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* Automatic setting of the common Microsoft C idenfifier MSC. + * NOTE: Watcom also defines M_I*86 ! + */ +#if defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__)) +# ifndef MSC +# define MSC /* This should work for older MSC, too! */ +# endif +#endif + +#if defined(__WATCOMC__) && defined(__386__) +# define WATCOMC_386 +#endif + +#if (defined(__CYGWIN32__) && !defined(__CYGWIN__)) +# define __CYGWIN__ /* compatibility for CygWin B19 and older */ +#endif + +/* enable multibyte character set support by default */ +#ifndef _MBCS +# define _MBCS +#endif +#if defined(__CYGWIN__) +# undef _MBCS +#endif + +#ifndef MSDOS +/* + * Windows 95 (and Windows NT) file systems are (to some extend) + * extensions of MSDOS. Common features include for example: + * FAT or (FAT like) file systems, + * '\\' as directory separator in paths, + * "\r\n" as record (line) terminator in text files, ... + */ +# define MSDOS +/* inherit MS-DOS file system etc. stuff */ +#endif + +#define USE_CASE_MAP +#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ + procname(n, 1)) +#define BROKEN_FSEEK +#ifndef __RSXNT__ +# define HAVE_FSEEKABLE +#endif + +/* File operations--use "b" for binary if allowed or fixed length 512 on VMS + * use "S" for sequential access on NT to prevent the NT + * file cache eating up memory with large .zip files + */ +#define FOPR "rb" +#define FOPM "r+b" +#define FOPW "wbS" + +#if (defined(__CYGWIN__) && !defined(NO_MKTIME)) +# define NO_MKTIME /* Cygnus' mktime() implementation is buggy */ +#endif +#if (!defined(NT_TZBUG_WORKAROUND) && !defined(NO_NT_TZBUG_WORKAROUND)) +# define NT_TZBUG_WORKAROUND +#endif +#if (defined(UTIL) && defined(NT_TZBUG_WORKAROUND)) +# undef NT_TZBUG_WORKAROUND /* the Zip utilities do not use time-stamps */ +#endif +#if !defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME) +# define USE_EF_UT_TIME +#endif +#if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS)) +# define NTSD_EAS +#endif + +#if (defined(NTSD_EAS) && !defined(ZP_NEED_MEMCOMPR)) +# define ZP_NEED_MEMCOMPR +#endif + +#ifdef WINDLL +# ifndef NO_ASM +# define NO_ASM +# endif +# ifndef MSWIN +# define MSWIN +# endif +# ifndef REENTRANT +# define REENTRANT +# endif +#endif /* WINDLL */ + +/* Enable use of optimized x86 assembler version of longest_match() for + MSDOS, WIN32 and OS2 per default. */ +#if !defined(NO_ASM) && !defined(ASMV) +# define ASMV +#endif + +#if !defined(__GO32__) && !defined(__EMX__) && !defined(__CYGWIN__) +# define NO_UNISTD_H +#endif + +/* the following definitions are considered as "obsolete" by Microsoft and + * might be missing in some versions of + */ +#ifndef AnsiToOem +# define AnsiToOem CharToOemA +#endif +#ifndef OemToAnsi +# define OemToAnsi OemToCharA +#endif + +#if (defined(__RSXNT__) && defined(__CRTRSXNT__)) +# include +#endif + +/* Get types and stat */ +#include +#include +#include +#ifdef _MBCS +# if (!defined(__EMX__) && !defined(__MINGW32__) && !defined(__CYGWIN__)) +# include +# include +# endif +# if (defined(__MINGW32__) && !defined(MB_CUR_MAX)) +# ifdef __MSVCRT__ + extern int *__p___mb_cur_max(void); +# define MB_CUR_MAX (*__p___mb_cur_max()) +# else + extern int *_imp____mb_cur_max_dll; +# define MB_CUR_MAX (*_imp____mb_cur_max_dll) +# endif +# endif +# if (defined(__LCC__) && !defined(MB_CUR_MAX)) + extern int *_imp____mb_cur_max; +# define MB_CUR_MAX (*_imp____mb_cur_max) +# endif +#endif + +#ifdef __LCC__ +# include +#endif +#if (defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset) +# define tzset _tzset +#endif +#ifdef __MINGW32__ + extern void _tzset(void); /* this is missing in */ +# ifndef tzset +# define tzset _tzset +# endif +#endif + +#ifdef MATCH +# undef MATCH +#endif +#define MATCH dosmatch /* use DOS style wildcard matching */ + +#ifdef ZCRYPT_INTERNAL +# ifdef WINDLL +# define ZCR_SEED2 (unsigned)3141592654L /* use PI as seed pattern */ +# else +# include /* getpid() declaration for srand seed */ +# endif +#endif + +/* This patch of stat() is useful for at least three compilers. It is */ +/* difficult to take a stat() of a root directory under Windows95, so */ +/* zstat_zipwin32() detects that case and fills in suitable values. */ +#ifndef __RSXNT__ +# ifndef W32_STATROOT_FIX +# define W32_STATROOT_FIX +# endif +#endif /* !__RSXNT__ */ + +#if (defined(NT_TZBUG_WORKAROUND) || defined(W32_STATROOT_FIX)) +# define W32_STAT_BANDAID + int zstat_zipwin32(const char *path, struct stat *buf); +# ifdef SSTAT +# undef SSTAT +# endif +# define SSTAT zstat_zipwin32 +#endif /* NT_TZBUG_WORKAROUND || W32_STATROOT_FIX */ + +int getch_win32(void); + +#ifdef __GNUC__ +# define IZ_PACKED __attribute__((packed)) +#else +# define IZ_PACKED +#endif + +/* for some (all ?) versions of IBM C Set/2 and IBM C Set++ */ +#ifndef S_IFMT +# define S_IFMT 0xF000 +#endif /* !S_IFMT */ + +#ifdef __WATCOMC__ +# include /* PATH_MAX is defined here */ +# define NO_MKTEMP + +/* Get asm routines to link properly without using "__cdecl": */ +# ifdef __386__ +# ifdef ASMV +# pragma aux match_init "_*" parm caller [] modify [] +# pragma aux longest_match_boinc "_*" parm caller [] value [eax] \ + modify [eax ecx edx] +# endif +# if defined(ASM_CRC) && !defined(USE_ZLIB) +# pragma aux crc32 "_*" parm caller [] value [eax] modify [eax] +# pragma aux get_crc_table "_*" parm caller [] value [eax] \ + modify [eax ecx edx] +# endif /* ASM_CRC && !USE_ZLIB */ +# endif /* __386__ */ +#endif /* __WATCOMC__ */ diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/README.NT boinc-7.0.14+dfsg/zip/zip/win32/README.NT --- boinc-7.0.7+dfsg/zip/zip/win32/README.NT 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/README.NT 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,17 @@ +From: Michael Tibbott +Subject: Zip on Windows NT problem - here's the answer +Date: Wed, 10 Dec 1997 15:24:29 -0800 + +If you're running NT Server (I am not sure about NT Workstation) then you +should do the following to prevent zip/unzip from page swapping itself to +death. And as an added bonus, the zip was about 6% faster. + +- open the network control panel + +- Click on the services tab + +- double-click on the server item to open its properties + +- Click the "maximize throughput for network applications" radio button + +- save and reboot diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/README.TZ boinc-7.0.14+dfsg/zip/zip/win32/README.TZ --- boinc-7.0.7+dfsg/zip/zip/win32/README.TZ 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/README.TZ 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,7 @@ +From: paul.kienitz@shelter.sf.ca.us (Paul Kienitz) +> It looks like I don't have to create a tzset() kluge for Watcom to check +> the win32 API timezone information after all -- their new 10.6 release has +> corrected this oversight. The TZ variable overrides the API. So the only +> win32-related patch I want to make for Zip is just to use USE_EF_UT_TIME +> unconditionally. With this in place, timezone stuff is working flawlessly +> with or without TZ being set. diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/rsxntwin.h boinc-7.0.14+dfsg/zip/zip/win32/rsxntwin.h --- boinc-7.0.7+dfsg/zip/zip/win32/rsxntwin.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/rsxntwin.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,166 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* rsxntwin.h + * + * fills some gaps in the rsxnt 1.3 win32 header files () that are + * required for compiling Info-ZIP sources for Win NT / Win 95 + */ + +#ifdef __RSXNT__ +#if !defined (_RSXNTWIN_H) +#define _RSXNTWIN_H + +#ifdef TFUNCT /* TFUNCT is undefined when MSSDK headers are used */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define PASCAL __stdcall + +#define ANYSIZE_ARRAY 1 + +#ifndef TIME_ZONE_ID_UNKNOWN +# define TIME_ZONE_ID_UNKNOWN 0 +#endif +#ifndef TIME_ZONE_ID_INVALID +# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL +#endif + +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 + +#define FILE_SHARE_DELETE 0x00000004 + +#define FILE_PERSISTENT_ACLS 0x00000008 + +#define HFILE_ERROR ((HFILE)-1) + +#define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS + + +BOOL WINAPI DosDateTimeToFileTime(WORD, WORD, LPFILETIME); + + +#ifndef SetVolumeLabel +#define SetVolumeLabel TFUNCT(SetVolumeLabel) +#endif +BOOL WINAPI SetVolumeLabel(LPCTSTR, LPCTSTR); + + +#ifndef GetDriveType +#define GetDriveType TFUNCT(GetDriveType) +#endif +DWORD GetDriveType(LPCTSTR); + +#define DRIVE_UNKNOWN 0 +#define DRIVE_REMOVABLE 2 +#define DRIVE_FIXED 3 +#define DRIVE_REMOTE 4 +#define DRIVE_CDROM 5 +#define DRIVE_RAMDISK 6 + +#ifndef SearchPath +#define SearchPath TFUNCT(SearchPath) +#endif +BOOL WINAPI SearchPath(LPCTSTR, LPCTSTR, LPCTSTR, UINT, LPTSTR, LPTSTR *); + +#define ERROR_SUCCESS 0 +#define ERROR_INSUFFICIENT_BUFFER 122 + +LONG WINAPI InterlockedExchange(LPLONG, LONG); + +#define ACCESS_SYSTEM_SECURITY 0x01000000L + +typedef PVOID PSECURITY_DESCRIPTOR; +typedef PVOID PSID; +typedef struct _ACL { + BYTE AclRevision; + BYTE Sbz1; + WORD AclSize; + WORD AceCount; + WORD Sbz2; +} ACL; +typedef ACL *PACL; + +typedef struct _LUID { + DWORD LowPart; + LONG HighPart; +} LUID, *PLUID; + +typedef struct _LUID_AND_ATTRIBUTES { + LUID Luid; + DWORD Attributes; + } LUID_AND_ATTRIBUTES, * PLUID_AND_ATTRIBUTES; + +typedef struct _TOKEN_PRIVILEGES { + DWORD PrivilegeCount; + LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; +} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; + +#define TOKEN_QUERY 0x0008 +#define TOKEN_ADJUST_PRIVILEGES 0x0020 + +BOOL WINAPI OpenProcessToken(HANDLE, DWORD, PHANDLE); +BOOL WINAPI AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, + PTOKEN_PRIVILEGES, PDWORD); + +#ifndef LookupPrivilegeValue +#define LookupPrivilegeValue TFUNCT(LookupPrivilegeValue) +#endif +BOOL WINAPI LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); + +typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION; +#define OWNER_SECURITY_INFORMATION 0x00000001L +#define GROUP_SECURITY_INFORMATION 0x00000002L +#define DACL_SECURITY_INFORMATION 0x00000004L +#define SACL_SECURITY_INFORMATION 0x00000008L + +typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; +#define SE_DACL_PRESENT 0x0004 +#define SE_SACL_PRESENT 0x0010 + +#define SE_PRIVILEGE_ENABLED 0x00000002L + +#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege") +#define SE_BACKUP_NAME TEXT("SeBackupPrivilege") +#define SE_RESTORE_NAME TEXT("SeRestorePrivilege") + +BOOL WINAPI GetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION, + PSECURITY_DESCRIPTOR, DWORD, LPDWORD); +BOOL WINAPI SetKernelObjectSecurity(HANDLE, SECURITY_INFORMATION, + PSECURITY_DESCRIPTOR); +BOOL WINAPI IsValidSid(PSID); +BOOL WINAPI IsValidAcl(PACL); +BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR); +BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR); +DWORD WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR); +BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR, + PSECURITY_DESCRIPTOR_CONTROL, LPDWORD); +BOOL WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR, + SECURITY_DESCRIPTOR_CONTROL, SECURITY_DESCRIPTOR_CONTROL); +BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, + LPBOOL, PACL *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL); +BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, + LPBOOL, PACL *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR, BOOL, PACL, BOOL); +BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR, PSID, BOOL); +BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID *, LPBOOL); +BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR, PSID, BOOL); +VOID WINAPI InitializeCriticalSection(); + +#ifdef __cplusplus +} +#endif + +#endif /* TFUNCT */ +#endif /* !defined (_RSXNTWIN_H) */ +#endif /* __RSXNT__ */ diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/win32zip.c boinc-7.0.14+dfsg/zip/zip/win32/win32zip.c --- boinc-7.0.7+dfsg/zip/zip/win32/win32zip.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/win32zip.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,775 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef UTIL /* this file contains nothing used by UTIL */ + +#include "../zip.h" + +#include +#if !defined(__EMX__) && !defined(__CYGWIN__) +#include /* for rmdir() */ +#endif +#include + +#ifndef __BORLANDC__ +#include +#else +#include +#endif +#include /* for findfirst/findnext stuff */ +#ifdef __RSXNT__ +# include "../win32/rsxntwin.h" +#endif + +#include + +#undef NTSD_EAS + +#define PAD 0 +#define PATH_END '/' +#define HIDD_SYS_BITS (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) + + +typedef struct zdirent { + ush d_date, d_time; + ulg d_size; + char d_attr; + char d_name[MAX_PATH]; + int d_first; + HANDLE d_hFindFile; +} zDIR; + +#include "../win32/win32zip.h" +#include "../win32/nt.h" + +/* Local functions */ +local zDIR *Opendir OF((ZCONST char *n)); +local struct zdirent *Readdir OF((zDIR *d)); +local void Closedir OF((zDIR *d)); + +local char *readd OF((zDIR *)); +local int wild_recurse OF((char *, char *)); +#ifdef NTSD_EAS + local void GetSD OF((char *path, char **bufptr, size_t *size, + char **cbufptr, size_t *csize)); +#endif +#ifdef USE_EF_UT_TIME + local int GetExtraTime OF((struct zlist far *z, iztimes *z_utim)); +#endif + +/* Module level variables */ +extern char *label /* = NULL */ ; /* defined in fileio.c */ +local ulg label_time = 0; +local ulg label_mode = 0; +local time_t label_utim = 0; + +/* Module level constants */ +local ZCONST char wild_match_all[] = "*.*"; + +local zDIR *Opendir(n) +ZCONST char *n; /* directory to open */ +/* Start searching for files in the MSDOS directory n */ +{ + zDIR *d; /* malloc'd return value */ + char *p; /* malloc'd temporary string */ + char *q; + WIN32_FIND_DATA fd; + + if ((d = (zDIR *)malloc(sizeof(zDIR))) == NULL || + (p = malloc(strlen(n) + (2 + sizeof(wild_match_all)))) == NULL) { + if (d != NULL) free((zvoid *)d); + return NULL; + } + strcpy(p, n); + q = p + strlen(p); + if ((q - p) > 0 && MBSRCHR(p, ':') == (q - 1)) + *q++ = '.'; + if ((q - p) > 0 && MBSRCHR(p, '/') != (q - 1)) + *q++ = '/'; + strcpy(q, wild_match_all); + +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + OemToAnsi(p, p); +#endif + d->d_hFindFile = FindFirstFile(p, &fd); + free((zvoid *)p); + + if (d->d_hFindFile == INVALID_HANDLE_VALUE) + { + free((zvoid *)d); + return NULL; + } + + strcpy(d->d_name, fd.cFileName); + d->d_attr = (unsigned char) fd.dwFileAttributes; + d->d_first = 1; + return d; +} + +local struct zdirent *Readdir(d) +zDIR *d; /* directory stream to read from */ +/* Return pointer to first or next directory entry, or NULL if end. */ +{ + if (d->d_first) + d->d_first = 0; + else + { + WIN32_FIND_DATA fd; + + if (!FindNextFile(d->d_hFindFile, &fd)) + return NULL; + strcpy(d->d_name, fd.cFileName); + d->d_attr = (unsigned char) fd.dwFileAttributes; + } +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + AnsiToOem(d->d_name, d->d_name); +#endif + return (struct zdirent *)d; +} + +local void Closedir(d) +zDIR *d; /* directory stream to close */ +{ + FindClose(d->d_hFindFile); + free((zvoid *)d); +} + + +local char *readd(d) +zDIR *d; /* directory stream to read from */ +/* Return a pointer to the next name in the directory stream d, or NULL if + no more entries or an error occurs. */ +{ + struct zdirent *e; + + do + e = Readdir(d); + while (!hidden_files && e && e->d_attr & HIDD_SYS_BITS); + return e == NULL ? (char *) NULL : e->d_name; +} + + +#define ONENAMELEN 255 + +/* whole is a pathname with wildcards, wildtail points somewhere in the */ +/* middle of it. All wildcards to be expanded must come AFTER wildtail. */ + +local int wild_recurse(whole, wildtail) +char *whole; +char *wildtail; +{ + zDIR *dir; + char *subwild, *name, *newwhole = NULL, *glue = NULL, plug = 0, plug2; + extent newlen; + int amatch = 0, e = ZE_MISS; + + if (!isshexp(wildtail)) { + if (GetFileAttributes(whole) != 0xFFFFFFFF) { /* file exists? */ +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + AnsiToOem(whole, whole); +#endif + return procname(whole, 0); + } + else + return ZE_MISS; /* woops, no wildcards! */ + } + + /* back up thru path components till existing dir found */ + do { + name = wildtail + strlen(wildtail) - 1; + for (;;) + if (name-- <= wildtail || *name == PATH_END) { + subwild = name + 1; + plug2 = *subwild; + *subwild = 0; + break; + } + if (glue) + *glue = plug; + glue = subwild; + plug = plug2; + dir = Opendir(whole); + } while (!dir && subwild > wildtail); + wildtail = subwild; /* skip past non-wild components */ + + if ((subwild = MBSCHR(wildtail + 1, PATH_END)) != NULL) { + /* this "+ 1" dodges the ^^^ hole left by *glue == 0 */ + *(subwild++) = 0; /* wildtail = one component pattern */ + newlen = strlen(whole) + strlen(subwild) + (ONENAMELEN + 2); + } else + newlen = strlen(whole) + (ONENAMELEN + 1); + if (!dir || ((newwhole = malloc(newlen)) == NULL)) { + if (glue) + *glue = plug; + e = dir ? ZE_MEM : ZE_MISS; + goto ohforgetit; + } + strcpy(newwhole, whole); + newlen = strlen(newwhole); + if (glue) + *glue = plug; /* repair damage to whole */ + if (!isshexp(wildtail)) { + e = ZE_MISS; /* non-wild name not found */ + goto ohforgetit; + } + + while ((name = readd(dir)) != NULL) { + if (strcmp(name, ".") && strcmp(name, "..") && + MATCH(wildtail, name, 0)) { + strcpy(newwhole + newlen, name); + if (subwild) { + name = newwhole + strlen(newwhole); + *(name++) = PATH_END; + strcpy(name, subwild); + e = wild_recurse(newwhole, name); + } else + e = procname(newwhole, 0); + newwhole[newlen] = 0; + if (e == ZE_OK) + amatch = 1; + else if (e != ZE_MISS) + break; + } + } + + ohforgetit: + if (dir) Closedir(dir); + if (subwild) *--subwild = PATH_END; + if (newwhole) free(newwhole); + if (e == ZE_MISS && amatch) + e = ZE_OK; + return e; +} + +int wild(w) +char *w; /* path/pattern to match */ +/* If not in exclude mode, expand the pattern based on the contents of the + file system. Return an error code in the ZE_ class. */ +{ + char *p; /* path */ + char *q; /* diskless path */ + int e; /* result */ + + if (volume_label == 1) { + volume_label = 2; + label = getVolumeLabel((w != NULL && isascii((uch)w[0]) && w[1] == ':') + ? to_up(w[0]) : '\0', + &label_time, &label_mode, &label_utim); + if (label != NULL) + (void)newname(label, 0, 0); + if (w == NULL || (isascii((uch)w[0]) && w[1] == ':' && w[2] == '\0')) + return ZE_OK; + /* "zip -$ foo a:" can be used to force drive name */ + } + /* special handling of stdin request */ + if (strcmp(w, "-") == 0) /* if compressing stdin */ + return newname(w, 0, 0); + + /* Allocate and copy pattern, leaving room to add "." if needed */ + if ((p = malloc(strlen(w) + 2)) == NULL) + return ZE_MEM; + strcpy(p, w); + + /* Normalize path delimiter as '/' */ + for (q = p; *q; INCSTR(q)) /* use / consistently */ + if (*q == '\\') + *q = '/'; + + /* Separate the disk part of the path */ + if ((q = MBSCHR(p, ':')) != NULL) { + if (MBSCHR(++q, ':')) /* sanity check for safety of wild_recurse */ + return ZE_MISS; + } else + q = p; + + /* Normalize bare disk names */ + if (q > p && !*q) + strcpy(q, "."); + + /* Here we go */ + e = wild_recurse(p, q); + free((zvoid *)p); + return e; +} + +int procname(n, caseflag) +char *n; /* name to process */ +int caseflag; /* true to force case-sensitive match */ +/* Process a name or sh expression to operate on (or exclude). Return + an error code in the ZE_ class. */ +{ + char *a; /* path and name for recursion */ + zDIR *d; /* directory stream from opendir() */ + char *e; /* pointer to name from readd() */ + int m; /* matched flag */ + char *p; /* path for recursion */ + struct stat s; /* result of stat() */ + struct zlist far *z; /* steps through zfiles list */ + + if (strcmp(n, "-") == 0) /* if compressing stdin */ + return newname(n, 0, caseflag); + else if (LSSTAT(n, &s) +#ifdef __TURBOC__ + /* For this compiler, stat() succeeds on wild card names! */ + /* Unfortunately, this causes failure on names containing */ + /* square bracket characters, which are legal in win32. */ + || isshexp(n) +#endif + ) + { + /* Not a file or directory--search for shell expression in zip file */ + p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ + m = 1; + for (z = zfiles; z != NULL; z = z->nxt) { + if (MATCH(p, z->iname, caseflag)) + { + z->mark = pcount ? filter(z->zname, caseflag) : 1; + if (verbose) + fprintf(mesg, "zip diagnostic: %scluding %s\n", + z->mark ? "in" : "ex", z->name); + m = 0; + } + } + free((zvoid *)p); + return m ? ZE_MISS : ZE_OK; + } + + /* Live name--use if file, recurse if directory */ + for (p = n; *p; INCSTR(p)) /* use / consistently */ + if (*p == '\\') + *p = '/'; + if ((s.st_mode & S_IFDIR) == 0) + { + /* add or remove name of file */ + if ((m = newname(n, 0, caseflag)) != ZE_OK) + return m; + } else { + /* Add trailing / to the directory name */ + if ((p = malloc(strlen(n)+2)) == NULL) + return ZE_MEM; + if (strcmp(n, ".") == 0 || strcmp(n, "/.") == 0) { + *p = '\0'; /* avoid "./" prefix and do not create zip entry */ + } else { + strcpy(p, n); + a = p + strlen(p); + if (lastchar(p) != '/') + strcpy(a, "/"); + if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { + free((zvoid *)p); + return m; + } + } + /* recurse into directory */ + if (recurse && (d = Opendir(n)) != NULL) + { + while ((e = readd(d)) != NULL) { + if (strcmp(e, ".") && strcmp(e, "..")) + { + if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) + { + Closedir(d); + free((zvoid *)p); + return ZE_MEM; + } + strcat(strcpy(a, p), e); + if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ + { + if (m == ZE_MISS) + zipwarn("name not matched: ", a); + else + ziperr(m, a); + } + free((zvoid *)a); + } + } + Closedir(d); + } + free((zvoid *)p); + } /* (s.st_mode & S_IFDIR) == 0) */ + return ZE_OK; +} + +char *ex2in(x, isdir, pdosflag) +char *x; /* external file name */ +int isdir; /* input: x is a directory */ +int *pdosflag; /* output: force MSDOS file attributes? */ +/* Convert the external file name to a zip file name, returning the malloc'ed + string or NULL if not enough memory. */ +{ + char *n; /* internal file name (malloc'ed) */ + char *t; /* shortened name */ + int dosflag; + + + dosflag = dosify || IsFileSystemOldFAT(x); + if (!dosify && use_longname_ea && (t = GetLongPathEA(x)) != NULL) + { + x = t; + dosflag = 0; + } + + /* Find starting point in name before doing malloc */ + /* Strip drive specification */ + t = *x && isascii((uch)*x) && *(x + 1) == ':' ? x + 2 : x; + /* Strip "//host/share/" part of a UNC name */ + if ((!strncmp(x,"//",2) || !strncmp(x,"\\\\",2)) && + (x[2] != '\0' && x[2] != '/' && x[2] != '\\')) { + n = x + 2; + while (*n != '\0' && *n != '/' && *n != '\\') + INCSTR(n); /* strip host name */ + if (*n != '\0') { + INCSTR(n); + while (*n != '\0' && *n != '/' && *n != '\\') + INCSTR(n); /* strip `share' name */ + } + if (*n != '\0') + t = n + CLEN(n); + } + /* Strip leading "/" to convert an absolute path into a relative path */ + while (*t == '/' || *t == '\\') + t++; + /* Strip leading "./" as well as drive letter */ + while (*t == '.' && (t[1] == '/' || t[1] == '\\')) + t += 2; + + /* Make changes, if any, to the copied name (leave original intact) */ + for (n = t; *n; INCSTR(n)) + if (*n == '\\') + *n = '/'; + + if (!pathput) + t = last(t, PATH_END); + + /* Malloc space for internal name and copy it */ + if ((n = malloc(strlen(t) + 1)) == NULL) + return NULL; + strcpy(n, t); + + if (dosify) + msname(n); + + /* Returned malloc'ed name */ + if (pdosflag) + *pdosflag = dosflag; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + OemToAnsi(n, n); +#endif + return n; +} + + +char *in2ex(n) +char *n; /* internal file name */ +/* Convert the zip file name to an external file name, returning the malloc'ed + string or NULL if not enough memory. */ +{ + char *x; /* external file name */ + + if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) + return NULL; + strcpy(x, n); +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + AnsiToOem(x, x); +#endif + return x; +} + + +void stamp(f, d) +char *f; /* name of file to change */ +ulg d; /* dos-style time to change it to */ +/* Set last updated and accessed time of file f to the DOS time d. */ +{ +#if defined(__TURBOC__) && !defined(__BORLANDC__) + int h; /* file handle */ + + if ((h = open(f, 0)) != -1) + { + setftime(h, (struct ftime *)&d); + close(h); + } +#else /* !__TURBOC__ */ + + struct utimbuf u; /* argument for utime() */ + + /* Convert DOS time to time_t format in u.actime and u.modtime */ + u.actime = u.modtime = dos2unixtime(d); + + /* Set updated and accessed times of f */ + utime(f, &u); +#endif /* ?__TURBOC__ */ +} + + +ulg filetime(f, a, n, t) +char *f; /* name of file to get info on */ +ulg *a; /* return value: file attributes */ +long *n; /* return value: file size */ +iztimes *t; /* return value: access, modific. and creation times */ +/* If file *f does not exist, return 0. Else, return the file's last + modified date and time as an MSDOS date and time. The date and + time is returned in a long with the date most significant to allow + unsigned integer comparison of absolute times. Also, if a is not + a NULL pointer, store the file attributes there, with the high two + bytes being the Unix attributes, and the low byte being a mapping + of that to DOS attributes. If n is not NULL, store the file size + there. If t is not NULL, the file's access, modification and creation + times are stored there as UNIX time_t values. + If f is "-", use standard input as the file. If f is a device, return + a file size of -1 */ +{ + struct stat s; /* results of stat() */ + char name[FNMAX]; + int len = strlen(f), isstdin = !strcmp(f, "-"); + + if (f == label) { + if (a != NULL) + *a = label_mode; + if (n != NULL) + *n = -2L; /* convention for a label name */ + if (t != NULL) + t->atime = t->mtime = t->ctime = label_utim; + return label_time; + } + strcpy(name, f); + if (MBSRCHR(name, '/') == (name + len - 1)) + name[len - 1] = '\0'; + /* not all systems allow stat'ing a file with / appended */ + + if (isstdin) { + if (fstat(fileno(stdin), &s) != 0) + error("fstat(stdin)"); + time((time_t *)&s.st_mtime); /* some fstat()s return time zero */ + } else if (LSSTAT(name, &s) != 0) + /* Accept about any file kind including directories + * (stored with trailing / with -r option) + */ + return 0; + + if (a != NULL) { + *a = ((ulg)s.st_mode << 16) | (isstdin ? 0L : (ulg)GetFileMode(name)); + } + if (n != NULL) + *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; + if (t != NULL) { + t->atime = s.st_atime; + t->mtime = s.st_mtime; + t->ctime = s.st_ctime; + } + + return unix2dostime((time_t *)&s.st_mtime); +} + + +#ifdef NTSD_EAS + +local void GetSD(char *path, char **bufptr, size_t *size, + char **cbufptr, size_t *csize) +{ + unsigned char stackbuffer[NTSD_BUFFERSIZE]; + unsigned long bytes = NTSD_BUFFERSIZE; + unsigned char *buffer = stackbuffer; + unsigned char *DynBuffer = NULL; + long cbytes; + PEF_NTSD_L_HEADER pLocalHeader; + PEF_NTSD_C_HEADER pCentralHeader; + VOLUMECAPS VolumeCaps; + + /* check target volume capabilities */ + if (!ZipGetVolumeCaps(path, path, &VolumeCaps) || + !(VolumeCaps.dwFileSystemFlags & FS_PERSISTENT_ACLS)) { + return; + } + + VolumeCaps.bUsePrivileges = use_privileges; + VolumeCaps.dwFileAttributes = 0; + /* should set to file attributes, if possible */ + + if (!SecurityGet(path, &VolumeCaps, buffer, (LPDWORD)&bytes)) { + + /* try to malloc the buffer if appropriate */ + if(GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + DynBuffer = malloc(bytes); + if(DynBuffer == NULL) return; + + buffer = DynBuffer; /* switch to the new buffer and try again */ + + if(!SecurityGet(path, &VolumeCaps, buffer, (LPDWORD)&bytes)) { + free(DynBuffer); + return; + } + + } else { + return; /* bail */ + } + } + + /* # bytes to compress: compress type, CRC, data bytes */ + cbytes = sizeof(USHORT) + sizeof(ULONG) + bytes; + + + /* our two possible failure points. don't allow trashing of any data + if either fails - notice that *size and *csize don't get updated. + *bufptr leaks if malloc() was used and *cbufptr alloc fails - this + isn't relevant because it's probably indicative of a bigger problem. */ + + if(*size) + *bufptr = realloc(*bufptr, *size + EF_NTSD_L_LEN + cbytes); + else + *bufptr = malloc(EF_NTSD_L_LEN + cbytes); + + if(*csize) + *cbufptr = realloc(*cbufptr, *csize + EF_NTSD_C_LEN); + else + *cbufptr = malloc(EF_NTSD_C_LEN); + + if(*bufptr == NULL || *cbufptr == NULL) { + if(DynBuffer) free(DynBuffer); + return; + } + + /* local header */ + + pLocalHeader = (PEF_NTSD_L_HEADER) (*bufptr + *size); + + cbytes = memcompress(((char *)pLocalHeader + EF_NTSD_L_LEN), cbytes, + (char *)buffer, bytes); + + *size += EF_NTSD_L_LEN + cbytes; + + pLocalHeader->nID = EF_NTSD; + pLocalHeader->nSize = (USHORT)(EF_NTSD_L_LEN - EB_HEADSIZE + + cbytes); + pLocalHeader->lSize = bytes; /* uncompressed size */ + pLocalHeader->Version = 0; + + /* central header */ + + pCentralHeader = (PEF_NTSD_C_HEADER) (*cbufptr + *csize); + *csize += EF_NTSD_C_LEN; + + pCentralHeader->nID = EF_NTSD; + pCentralHeader->nSize = EF_NTSD_C_LEN - EB_HEADSIZE; /* sbz */ + pCentralHeader->lSize = bytes; + + if (noisy) + printf(" (%ld bytes security)", bytes); + + if(DynBuffer) free(DynBuffer); +} +#endif /* NTSD_EAS */ + + +#ifdef USE_EF_UT_TIME + +#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(3)) +#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1)) + +local int GetExtraTime(struct zlist far *z, iztimes *z_utim) +{ + char *eb_l_ptr; + char *eb_c_ptr; + ulg ultime; + /* brain-dead IBM compiler defines time_t as "double", so we have to convert + * it into unsigned long integer number... + */ + +#ifdef IZ_CHECK_TZ + if (!zp_tz_is_valid) return ZE_OK; /* skip silently if no valid TZ info */ +#endif + + if(z->ext) + eb_l_ptr = realloc(z->extra, (z->ext + EB_L_UT_SIZE)); + else + eb_l_ptr = malloc(EB_L_UT_SIZE); + + if (eb_l_ptr == NULL) + return ZE_MEM; + + if(z->cext) + eb_c_ptr = realloc(z->cextra, (z->cext + EB_C_UT_SIZE)); + else + eb_c_ptr = malloc(EB_C_UT_SIZE); + + if (eb_c_ptr == NULL) + return ZE_MEM; + + z->extra = eb_l_ptr; + eb_l_ptr += z->ext; + z->ext += EB_L_UT_SIZE; + + eb_l_ptr[0] = 'U'; + eb_l_ptr[1] = 'T'; + eb_l_ptr[2] = EB_UT_LEN(3); /* length of data part of e.f. */ + eb_l_ptr[3] = 0; + eb_l_ptr[4] = EB_UT_FL_MTIME | EB_UT_FL_ATIME | EB_UT_FL_CTIME; + ultime = (ulg)z_utim->mtime; + eb_l_ptr[5] = (char)(ultime); + eb_l_ptr[6] = (char)(ultime >> 8); + eb_l_ptr[7] = (char)(ultime >> 16); + eb_l_ptr[8] = (char)(ultime >> 24); + ultime = (ulg)z_utim->atime; + eb_l_ptr[9] = (char)(ultime); + eb_l_ptr[10] = (char)(ultime >> 8); + eb_l_ptr[11] = (char)(ultime >> 16); + eb_l_ptr[12] = (char)(ultime >> 24); + ultime = (ulg)z_utim->ctime; + eb_l_ptr[13] = (char)(ultime); + eb_l_ptr[14] = (char)(ultime >> 8); + eb_l_ptr[15] = (char)(ultime >> 16); + eb_l_ptr[16] = (char)(ultime >> 24); + + z->cextra = eb_c_ptr; + eb_c_ptr += z->cext; + z->cext += EB_C_UT_SIZE; + + memcpy(eb_c_ptr, eb_l_ptr, EB_C_UT_SIZE); + eb_c_ptr[EB_LEN] = EB_UT_LEN(1); + + return ZE_OK; +} + +#endif /* USE_EF_UT_TIME */ + + + +int set_extra_field(z, z_utim) + struct zlist far *z; + iztimes *z_utim; + /* create extra field and change z->att if desired */ +{ + +#ifdef NTSD_EAS + if(ZipIsWinNT()) { + /* store SECURITY_DECRIPTOR data in local header, + and size only in central headers */ + GetSD(z->name, &z->extra, &z->ext, &z->cextra, &z->cext); + } +#endif /* NTSD_EAS */ + +#ifdef USE_EF_UT_TIME + /* store extended time stamps in both headers */ + return GetExtraTime(z, z_utim); +#else /* !USE_EF_UT_TIME */ + return ZE_OK; +#endif /* ?USE_EF_UT_TIME */ +} + +int deletedir(d) +char *d; /* directory to delete */ +/* Delete the directory *d if it is empty, do nothing otherwise. + Return the result of rmdir(), delete(), or system(). + For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). + */ +{ + return rmdir(d); +} + +#endif /* !UTIL */ + +const char *BOINC_RCSID_c4c268a880 = "$Id: win32zip.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/win32zip.h boinc-7.0.14+dfsg/zip/zip/win32/win32zip.h --- boinc-7.0.7+dfsg/zip/zip/win32/win32zip.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/win32zip.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,31 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef _WIN32ZIP_H +#define _WIN32ZIP_H + +/* + * NT specific functions for ZIP. + */ + +int GetFileMode(char *name); +long GetTheFileTime(char *name, iztimes *z_times); + +int IsFileNameValid(char *name); +int IsFileSystemOldFAT(char *dir); +void ChangeNameForFAT(char *name); + +char *getVolumeLabel(int drive, ulg *vtime, ulg *vmode, time_t *vutim); + +#if 0 /* never used ?? */ +char *StringLower(char *); +#endif + +char *GetLongPathEA(char *name); + +#endif /* _WIN32ZIP_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/zip.def boinc-7.0.14+dfsg/zip/zip/win32/zip.def --- boinc-7.0.7+dfsg/zip/zip/win32/zip.def 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/zip.def 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,4 @@ +;module-definition file for Windows Zip DLL -- used by link.exe +DESCRIPTION 'The world-famous zip utilities from Info-ZIP' + + diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/zipup.h boinc-7.0.14+dfsg/zip/zip/win32/zipup.h --- boinc-7.0.7+dfsg/zip/zip/win32/zipup.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/zipup.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,37 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +#ifndef __CYGWIN__ +# include +#endif +#ifndef O_RDONLY +# define O_RDONLY 0 +#endif +#ifndef O_BINARY +# define O_BINARY 0 +#endif +#if (defined(_SH_DENYNO) && !defined(SH_DENYNO)) +# define SH_DENYNO _SH_DENYNO +#endif +#if (defined(SH_DENYNO) && !defined(_SH_DENYNO)) +# define _SH_DENYNO SH_DENYNO +#endif +#define fhow (O_RDONLY|O_BINARY) +#define fbad (-1) +typedef int ftype; +#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__EMX__) +# define zopen(n,p) sopen(n,p,SH_DENYNO) +#elif defined(__CYGWIN__) || defined(__IBMC__) +# define zopen(n,p) open(n,p) +#else +# define zopen(n,p) _sopen(n,p,_SH_DENYNO) +#endif +#define zread(f,b,n) read(f,b,n) +#define zclose(f) close(f) +#define zerr(f) (k == (extent)(-1L)) +#define zstdin 0 diff -Nru boinc-7.0.7+dfsg/zip/zip/win32/z_win32.c boinc-7.0.14+dfsg/zip/zip/win32/z_win32.c --- boinc-7.0.7+dfsg/zip/zip/win32/z_win32.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/win32/z_win32.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,841 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * WIN32 specific functions for ZIP. + * + * The WIN32 version of ZIP heavily relies on the MSDOS and OS2 versions, + * since we have to do similar things to switch between NTFS, HPFS and FAT. + */ + + +#include "../zip.h" + +#include +#include +#include +#include +#include +#include +#ifdef __RSXNT__ +# include +# include "../win32/rsxntwin.h" +#endif +#include "../win32/win32zip.h" + +#define A_RONLY 0x01 +#define A_HIDDEN 0x02 +#define A_SYSTEM 0x04 +#define A_LABEL 0x08 +#define A_DIR 0x10 +#define A_ARCHIVE 0x20 + + +#define EAID 0x0009 + + +#ifndef UTIL + +extern int noisy; + +#ifdef NT_TZBUG_WORKAROUND +local int FSusesLocalTime(const char *path); +#endif +#if (defined(USE_EF_UT_TIME) || defined(NT_TZBUG_WORKAROUND)) +local int FileTime2utime(FILETIME *pft, time_t *ut); +#endif +#if (defined(NT_TZBUG_WORKAROUND) && defined(W32_STAT_BANDAID)) +local int VFatFileTime2utime(const FILETIME *pft, time_t *ut); +#endif + + +/* FAT / HPFS detection */ + +int IsFileSystemOldFAT(char *dir) +{ + char root[4]; + char vname[128]; + DWORD vnamesize = sizeof(vname); + DWORD vserial; + DWORD vfnsize; + DWORD vfsflags; + char vfsname[128]; + DWORD vfsnamesize = sizeof(vfsname); + + /* + * We separate FAT and HPFS+other file systems here. + * I consider other systems to be similar to HPFS/NTFS, i.e. + * support for long file names and being case sensitive to some extent. + */ + + strncpy(root, dir, 3); + if ( isalpha((uch)root[0]) && (root[1] == ':') ) { + root[0] = to_up(dir[0]); + root[2] = '\\'; + root[3] = 0; + } + else { + root[0] = '\\'; + root[1] = 0; + } + + if ( !GetVolumeInformation(root, vname, vnamesize, + &vserial, &vfnsize, &vfsflags, + vfsname, vfsnamesize)) { + fprintf(mesg, "zip diagnostic: GetVolumeInformation failed\n"); + return(FALSE); + } + + return vfnsize <= 12; +} + + +/* access mode bits and time stamp */ + +int GetFileMode(char *name) +{ +DWORD dwAttr; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(name) + 1); + + OemToAnsi(name, ansi_name); + name = ansi_name; +#endif + + dwAttr = GetFileAttributes(name); + if ( dwAttr == 0xFFFFFFFF ) { + fprintf(mesg, "zip diagnostic: GetFileAttributes failed\n"); + return(0x20); /* the most likely, though why the error? security? */ + } + return( + (dwAttr&FILE_ATTRIBUTE_READONLY ? A_RONLY :0) + | (dwAttr&FILE_ATTRIBUTE_HIDDEN ? A_HIDDEN :0) + | (dwAttr&FILE_ATTRIBUTE_SYSTEM ? A_SYSTEM :0) + | (dwAttr&FILE_ATTRIBUTE_DIRECTORY ? A_DIR :0) + | (dwAttr&FILE_ATTRIBUTE_ARCHIVE ? A_ARCHIVE :0)); +} + + +#ifdef NT_TZBUG_WORKAROUND +local int FSusesLocalTime(const char *path) +{ + char *tmp0; + char rootPathName[4]; + char tmp1[MAX_PATH], tmp2[MAX_PATH]; + unsigned volSerNo, maxCompLen, fileSysFlags; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_path = (char *)alloca(strlen(path) + 1); + + OemToAnsi(path, ansi_path); + path = ansi_path; +#endif + + if (isalpha((uch)path[0]) && (path[1] == ':')) + tmp0 = (char *)path; + else + { + GetFullPathName(path, MAX_PATH, tmp1, &tmp0); + tmp0 = &tmp1[0]; + } + strncpy(rootPathName, tmp0, 3); /* Build the root path name, */ + rootPathName[3] = '\0'; /* e.g. "A:/" */ + + GetVolumeInformation((LPCTSTR)rootPathName, (LPTSTR)tmp1, (DWORD)MAX_PATH, + (LPDWORD)&volSerNo, (LPDWORD)&maxCompLen, + (LPDWORD)&fileSysFlags, (LPTSTR)tmp2, (DWORD)MAX_PATH); + + /* Volumes in (V)FAT and (OS/2) HPFS format store file timestamps in + * local time! + */ + return !strncmp(strupr(tmp2), "FAT", 3) || + !strncmp(tmp2, "VFAT", 4) || + !strncmp(tmp2, "HPFS", 4); + +} /* end function FSusesLocalTime() */ +#endif /* NT_TZBUG_WORKAROUND */ + + +#if (defined(USE_EF_UT_TIME) || defined(NT_TZBUG_WORKAROUND)) + +#if (defined(__GNUC__) || defined(ULONG_LONG_MAX)) + typedef long long LLONG64; + typedef unsigned long long ULLNG64; +#elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +#elif (defined(_MSC_VER) && (_MSC_VER >= 1100)) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +#elif (defined(__IBMC__) && (__IBMC__ >= 350)) + typedef __int64 LLONG64; + typedef unsigned __int64 ULLNG64; +#else +# define NO_INT64 +#endif + +# define UNIX_TIME_ZERO_HI 0x019DB1DEUL +# define UNIX_TIME_ZERO_LO 0xD53E8000UL +# define NT_QUANTA_PER_UNIX 10000000L +# define FTQUANTA_PER_UT_L (NT_QUANTA_PER_UNIX & 0xFFFF) +# define FTQUANTA_PER_UT_H (NT_QUANTA_PER_UNIX >> 16) +# define UNIX_TIME_UMAX_HI 0x0236485EUL +# define UNIX_TIME_UMAX_LO 0xD4A5E980UL +# define UNIX_TIME_SMIN_HI 0x0151669EUL +# define UNIX_TIME_SMIN_LO 0xD53E8000UL +# define UNIX_TIME_SMAX_HI 0x01E9FD1EUL +# define UNIX_TIME_SMAX_LO 0xD4A5E980UL + +local int FileTime2utime(FILETIME *pft, time_t *ut) +{ +#ifndef NO_INT64 + ULLNG64 NTtime; + + NTtime = ((ULLNG64)pft->dwLowDateTime + + ((ULLNG64)pft->dwHighDateTime << 32)); + + /* underflow and overflow handling */ +#ifdef CHECK_UTIME_SIGNED_UNSIGNED + if ((time_t)0x80000000L < (time_t)0L) + { + if (NTtime < ((ULLNG64)UNIX_TIME_SMIN_LO + + ((ULLNG64)UNIX_TIME_SMIN_HI << 32))) { + *ut = (time_t)LONG_MIN; + return FALSE; + } + if (NTtime > ((ULLNG64)UNIX_TIME_SMAX_LO + + ((ULLNG64)UNIX_TIME_SMAX_HI << 32))) { + *ut = (time_t)LONG_MAX; + return FALSE; + } + } + else +#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ + { + if (NTtime < ((ULLNG64)UNIX_TIME_ZERO_LO + + ((ULLNG64)UNIX_TIME_ZERO_HI << 32))) { + *ut = (time_t)0; + return FALSE; + } + if (NTtime > ((ULLNG64)UNIX_TIME_UMAX_LO + + ((ULLNG64)UNIX_TIME_UMAX_HI << 32))) { + *ut = (time_t)ULONG_MAX; + return FALSE; + } + } + + NTtime -= ((ULLNG64)UNIX_TIME_ZERO_LO + + ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); + *ut = (time_t)(NTtime / (unsigned long)NT_QUANTA_PER_UNIX); + return TRUE; +#else /* NO_INT64 (64-bit integer arithmetics may not be supported) */ + /* nonzero if `y' is a leap year, else zero */ +# define leap(y) (((y)%4 == 0 && (y)%100 != 0) || (y)%400 == 0) + /* number of leap years from 1970 to `y' (not including `y' itself) */ +# define nleap(y) (((y)-1969)/4 - ((y)-1901)/100 + ((y)-1601)/400) + /* daycount at the end of month[m-1] */ + static ZCONST ush ydays[] = + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; + + time_t days; + SYSTEMTIME w32tm; + + /* underflow and overflow handling */ +#ifdef CHECK_UTIME_SIGNED_UNSIGNED + if ((time_t)0x80000000L < (time_t)0L) + { + if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && + (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { + *ut = (time_t)LONG_MIN; + return FALSE; + if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { + *ut = (time_t)LONG_MAX; + return FALSE; + } + } + else +#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ + { + if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || + ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && + (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { + *ut = (time_t)0; + return FALSE; + } + if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { + *ut = (time_t)ULONG_MAX; + return FALSE; + } + } + + FileTimeToSystemTime(pft, &w32tm); + + /* set `days' to the number of days into the year */ + days = w32tm.wDay - 1 + ydays[w32tm.wMonth-1] + + (w32tm.wMonth > 2 && leap (w32tm.wYear)); + + /* now set `days' to the number of days since 1 Jan 1970 */ + days += 365 * (time_t)(w32tm.wYear - 1970) + + (time_t)(nleap(w32tm.wYear)); + + *ut = (time_t)(86400L * days + 3600L * (time_t)w32tm.wHour + + (time_t)(60 * w32tm.wMinute + w32tm.wSecond)); + return TRUE; +#endif /* ?NO_INT64 */ +} /* end function FileTime2utime() */ +#endif /* USE_EF_UT_TIME || NT_TZBUG_WORKAROUND */ + + +#if (defined(NT_TZBUG_WORKAROUND) && defined(W32_STAT_BANDAID)) + +local int VFatFileTime2utime(const FILETIME *pft, time_t *ut) +{ + FILETIME lft; + SYSTEMTIME w32tm; + struct tm ltm; + + FileTimeToLocalFileTime(pft, &lft); + FileTimeToSystemTime(&lft, &w32tm); + /* underflow and overflow handling */ + /* TODO: The range checks are not accurate, the actual limits may + * be off by one daylight-saving-time shift (typically 1 hour), + * depending on the current state of "is_dst". + */ +#ifdef CHECK_UTIME_SIGNED_UNSIGNED + if ((time_t)0x80000000L < (time_t)0L) + { + if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && + (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { + *ut = (time_t)LONG_MIN; + return FALSE; + if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { + *ut = (time_t)LONG_MAX; + return FALSE; + } + } + else +#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ + { + if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || + ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && + (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { + *ut = (time_t)0; + return FALSE; + } + if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || + ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && + (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { + *ut = (time_t)ULONG_MAX; + return FALSE; + } + } + ltm.tm_year = w32tm.wYear - 1900; + ltm.tm_mon = w32tm.wMonth - 1; + ltm.tm_mday = w32tm.wDay; + ltm.tm_hour = w32tm.wHour; + ltm.tm_min = w32tm.wMinute; + ltm.tm_sec = w32tm.wSecond; + ltm.tm_isdst = -1; /* let mktime determine if DST is in effect */ + *ut = mktime(<m); + + /* a cheap error check: mktime returns "(time_t)-1L" on conversion errors. + * Normally, we would have to apply a consistency check because "-1" + * could also be a valid time. But, it is quite unlikely to read back odd + * time numbers from file systems that store time stamps in DOS format. + * (The only known exception is creation time on VFAT partitions.) + */ + return (*ut != (time_t)-1L); + +} /* end function VFatFileTime2utime() */ +#endif /* NT_TZBUG_WORKAROUND && W32_STAT_BANDAID */ + + +#if 0 /* Currently, this is not used at all */ + +long GetTheFileTime(char *name, iztimes *z_ut) +{ +HANDLE h; +FILETIME Modft, Accft, Creft, lft; +WORD dh, dl; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(name) + 1); + + OemToAnsi(name, ansi_name); + name = ansi_name; +#endif + + h = CreateFile(name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if ( h != INVALID_HANDLE_VALUE ) { + BOOL ftOK = GetFileTime(h, &Creft, &Accft, &Modft); + CloseHandle(h); +#ifdef USE_EF_UT_TIME + if (ftOK && (z_ut != NULL)) { + FileTime2utime(&Modft, &(z_ut->mtime)); + if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) + FileTime2utime(&Accft, &(z_ut->atime)); + else + z_ut->atime = z_ut->mtime; + if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) + FileTime2utime(&Creft, &(z_ut->ctime)); + else + z_ut->ctime = z_ut->mtime; + } +#endif + FileTimeToLocalFileTime(&ft, &lft); + FileTimeToDosDateTime(&lft, &dh, &dl); + return(dh<<16) | dl; + } + else + return 0L; +} + +#endif /* never */ + + +void ChangeNameForFAT(char *name) +{ + char *src, *dst, *next, *ptr, *dot, *start; + static char invalid[] = ":;,=+\"[]<>| \t"; + + if ( isalpha((uch)name[0]) && (name[1] == ':') ) + start = name + 2; + else + start = name; + + src = dst = start; + if ( (*src == '/') || (*src == '\\') ) + src++, dst++; + + while ( *src ) + { + for ( next = src; *next && (*next != '/') && (*next != '\\'); next++ ); + + for ( ptr = src, dot = NULL; ptr < next; ptr++ ) + if ( *ptr == '.' ) + { + dot = ptr; /* remember last dot */ + *ptr = '_'; + } + + if ( dot == NULL ) + for ( ptr = src; ptr < next; ptr++ ) + if ( *ptr == '_' ) + dot = ptr; /* remember last _ as if it were a dot */ + + if ( dot && (dot > src) && + ((next - dot <= 4) || + ((next - src > 8) && (dot - src > 3))) ) + { + if ( dot ) + *dot = '.'; + + for ( ptr = src; (ptr < dot) && ((ptr - src) < 8); ptr++ ) + *dst++ = *ptr; + + for ( ptr = dot; (ptr < next) && ((ptr - dot) < 4); ptr++ ) + *dst++ = *ptr; + } + else + { + if ( dot && (next - src == 1) ) + *dot = '.'; /* special case: "." as a path component */ + + for ( ptr = src; (ptr < next) && ((ptr - src) < 8); ptr++ ) + *dst++ = *ptr; + } + + *dst++ = *next; /* either '/' or 0 */ + + if ( *next ) + { + src = next + 1; + + if ( *src == 0 ) /* handle trailing '/' on dirs ! */ + *dst = 0; + } + else + break; + } + + for ( src = start; *src != 0; ++src ) + if ( (strchr(invalid, *src) != NULL) || (*src == ' ') ) + *src = '_'; +} + +char *GetLongPathEA(char *name) +{ + return(NULL); /* volunteers ? */ +} + +int IsFileNameValid(x) +char *x; +{ + WIN32_FIND_DATA fd; + HANDLE h; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_name = (char *)alloca(strlen(x) + 1); + + OemToAnsi(x, ansi_name); + x = ansi_name; +#endif + + if ((h = FindFirstFile(x, &fd)) == INVALID_HANDLE_VALUE) + return FALSE; + FindClose(h); + return TRUE; +} + +char *getVolumeLabel(drive, vtime, vmode, vutim) + int drive; /* drive name: 'A' .. 'Z' or '\0' for current drive */ + ulg *vtime; /* volume label creation time (DOS format) */ + ulg *vmode; /* volume label file mode */ + time_t *vutim;/* volume label creationtime (UNIX format) */ + +/* If a volume label exists for the given drive, return its name and + pretend to set its time and mode. The returned name is static data. */ +{ + char rootpath[4]; + static char vol[14]; + DWORD fnlen, flags; + + *vmode = A_ARCHIVE | A_LABEL; /* this is what msdos returns */ + *vtime = dostime(1980, 1, 1, 0, 0, 0); /* no true date info available */ + *vutim = dos2unixtime(*vtime); + strcpy(rootpath, "x:\\"); + rootpath[0] = (char)drive; + if (GetVolumeInformation(drive ? rootpath : NULL, vol, 13, NULL, + &fnlen, &flags, NULL, 0)) +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + return (AnsiToOem(vol, vol), vol); +#else + return vol; +#endif + else + return NULL; +} + +#endif /* !UTIL */ + + + +int ZipIsWinNT(void) /* returns TRUE if real NT, FALSE if Win95 or Win32s */ +{ + static DWORD g_PlatformId = 0xFFFFFFFF; /* saved platform indicator */ + + if (g_PlatformId == 0xFFFFFFFF) { + /* note: GetVersionEx() doesn't exist on WinNT 3.1 */ + if (GetVersion() < 0x80000000) + g_PlatformId = TRUE; + else + g_PlatformId = FALSE; + } + return (int)g_PlatformId; +} + + +#ifndef UTIL +#ifdef __WATCOMC__ +# include +# define _get_osfhandle _os_handle +/* gaah -- Watcom's docs claim that _get_osfhandle exists, but it doesn't. */ +#endif + +#ifdef HAVE_FSEEKABLE +/* + * return TRUE if file is seekable + */ +int fseekable(fp) +FILE *fp; +{ + return GetFileType((HANDLE)_get_osfhandle(fileno(fp))) == FILE_TYPE_DISK; +} +#endif /* HAVE_FSEEKABLE */ +#endif /* !UTIL */ + + +#if 0 /* seems to be never used; try it out... */ +char *StringLower(char *szArg) +{ + char *szPtr; +/* unsigned char *szPtr; */ + for ( szPtr = szArg; *szPtr; szPtr++ ) + *szPtr = lower[*szPtr]; + return szArg; +} +#endif /* never */ + + + +#ifdef W32_STAT_BANDAID + +/* All currently known variants of WIN32 operating systems (Windows 95/98, + * WinNT 3.x, 4.0, 5.0) have a nasty bug in the OS kernel concerning + * conversions between UTC and local time: In the time conversion functions + * of the Win32 API, the timezone offset (including seasonal daylight saving + * shift) between UTC and local time evaluation is erratically based on the + * current system time. The correct evaluation must determine the offset + * value as it {was/is/will be} for the actual time to be converted. + * + * The C runtime lib's stat() returns utc time-stamps so that + * localtime(timestamp) corresponds to the (potentially false) local + * time shown by the OS' system programs (Explorer, command shell dir, etc.) + * + * For the NTFS file system (and other filesystems that store time-stamps + * as UTC values), this results in st_mtime (, st_{c|a}time) fields which + * are not stable but vary according to the seasonal change of "daylight + * saving time in effect / not in effect". + * + * To achieve timestamp consistency of UTC (UT extra field) values in + * Zip archives, the Info-ZIP programs require work-around code for + * proper time handling in stat() (and other time handling routines). + */ +/* stat() functions under Windows95 tend to fail for root directories. * + * Watcom and Borland, at least, are affected by this bug. Watcom made * + * a partial fix for 11.0 but still missed some cases. This substitute * + * detects the case and fills in reasonable values. Otherwise we get * + * effects like failure to extract to a root dir because it's not found. */ + +int zstat_zipwin32(const char *path, struct stat *buf) +{ + if (!stat(path, buf)) + { +#ifdef NT_TZBUG_WORKAROUND + /* stat was successful, now redo the time-stamp fetches */ + int fs_uses_loctime = FSusesLocalTime(path); + HANDLE h; + FILETIME Modft, Accft, Creft; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_path = (char *)alloca(strlen(path) + 1); + + OemToAnsi(path, ansi_path); +# define Ansi_Path ansi_path +#else +# define Ansi_Path path +#endif + + Trace((stdout, "stat(%s) finds modtime %08lx\n", path, buf->st_mtime)); + h = CreateFile(Ansi_Path, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (h != INVALID_HANDLE_VALUE) { + BOOL ftOK = GetFileTime(h, &Creft, &Accft, &Modft); + CloseHandle(h); + + if (ftOK) { + if (!fs_uses_loctime) { + /* On a filesystem that stores UTC timestamps, we refill + * the time fields of the struct stat buffer by directly + * using the UTC values as returned by the Win32 + * GetFileTime() API call. + */ + FileTime2utime(&Modft, &(buf->st_mtime)); + if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) + FileTime2utime(&Accft, &(buf->st_atime)); + else + buf->st_atime = buf->st_mtime; + if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) + FileTime2utime(&Creft, &(buf->st_ctime)); + else + buf->st_ctime = buf->st_mtime; + Tracev((stdout,"NTFS, recalculated modtime %08lx\n", + buf->st_mtime)); + } else { + /* On VFAT and FAT-like filesystems, the FILETIME values + * are converted back to the stable local time before + * converting them to UTC unix time-stamps. + */ + VFatFileTime2utime(&Modft, &(buf->st_mtime)); + if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) + VFatFileTime2utime(&Accft, &(buf->st_atime)); + else + buf->st_atime = buf->st_mtime; + if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) + VFatFileTime2utime(&Creft, &(buf->st_ctime)); + else + buf->st_ctime = buf->st_mtime; + Tracev((stdout, "VFAT, recalculated modtime %08lx\n", + buf->st_mtime)); + } + } + } +# undef Ansi_Path +#endif /* NT_TZBUG_WORKAROUND */ + return 0; + } +#ifdef W32_STATROOT_FIX + else + { + DWORD flags; +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + char *ansi_path = (char *)alloca(strlen(path) + 1); + + OemToAnsi(path, ansi_path); +# define Ansi_Path ansi_path +#else +# define Ansi_Path path +#endif + + flags = GetFileAttributes(Ansi_Path); + if (flags != 0xFFFFFFFF && flags & FILE_ATTRIBUTE_DIRECTORY) { + Trace((stderr, "\nstat(\"%s\",...) failed on existing directory\n", + path)); + memset(buf, 0, sizeof(struct stat)); + buf->st_atime = buf->st_ctime = buf->st_mtime = + dos2unixtime(DOSTIME_MINIMUM); + /* !!! you MUST NOT add a cast to the type of "st_mode" here; + * !!! different compilers do not agree on the "st_mode" size! + * !!! (And, some compiler may not declare the "mode_t" type + * !!! identifier, so you cannot use it, either.) + */ + buf->st_mode = S_IFDIR | S_IREAD | + ((flags & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE); + return 0; + } /* assumes: stat() won't fail on non-dirs without good reason */ +# undef Ansi_Path + } +#endif /* W32_STATROOT_FIX */ + return -1; +} + +#endif /* W32_STAT_BANDAID */ + + + +#ifndef WINDLL +/* This replacement getch() function was originally created for Watcom C + * and then additionally used with CYGWIN. Since UnZip 5.4, all other Win32 + * ports apply this replacement rather that their supplied getch() (or + * alike) function. There are problems with unabsorbed LF characters left + * over in the keyboard buffer under Win95 (and 98) when ENTER was pressed. + * (Under Win95, ENTER returns two(!!) characters: CR-LF.) This problem + * does not appear when run on a WinNT console prompt! + */ + +/* Watcom 10.6's getch() does not handle Alt+. */ +/* Note that if PASSWD_FROM_STDIN is defined, the file containing */ +/* the password must have a carriage return after the word, not a */ +/* Unix-style newline (linefeed only). This discards linefeeds. */ + + + +/******************************/ +/* Function version_local() */ +/******************************/ + +void version_local() +{ + static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; +#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__DJGPP__)) + char buf[80]; +#if (defined(_MSC_VER) && (_MSC_VER > 900)) + char buf2[80]; +#endif +#endif + + printf(CompiledWith, + +#if defined(_MSC_VER) /* MSC == MSVC++, including the SDK compiler */ + (sprintf(buf, "Microsoft C %d.%02d ", _MSC_VER/100, _MSC_VER%100), buf), +# if (_MSC_VER == 800) + "(Visual C++ v1.1)", +# elif (_MSC_VER == 850) + "(Windows NT v3.5 SDK)", +# elif (_MSC_VER == 900) + "(Visual C++ v2.x)", +# elif (_MSC_VER > 900) + (sprintf(buf2, "(Visual C++ v%d.%d)", _MSC_VER/100 - 6, + _MSC_VER%100/10), buf2), +# else + "(bad version)", +# endif +#elif defined(__WATCOMC__) +# if (__WATCOMC__ % 10 > 0) +/* We do this silly test because __WATCOMC__ gives two digits for the */ +/* minor version, but Watcom packaging prefers to show only one digit. */ + (sprintf(buf, "Watcom C/C++ %d.%02d", __WATCOMC__ / 100, + __WATCOMC__ % 100), buf), "", +# else + (sprintf(buf, "Watcom C/C++ %d.%d", __WATCOMC__ / 100, + (__WATCOMC__ % 100) / 10), buf), "", +# endif /* __WATCOMC__ % 10 > 0 */ +#elif defined(__TURBOC__) +# ifdef __BORLANDC__ + "Borland C++", +# if (__BORLANDC__ == 0x0452) /* __BCPLUSPLUS__ = 0x0320 */ + " 4.0 or 4.02", +# elif (__BORLANDC__ == 0x0460) /* __BCPLUSPLUS__ = 0x0340 */ + " 4.5", +# elif (__BORLANDC__ == 0x0500) /* __TURBOC__ = 0x0500 */ + " 5.0", +# elif (__BORLANDC__ == 0x0520) /* __TURBOC__ = 0x0520 */ + " 5.2 (C++ Builder)", +# else + " later than 5.2", +# endif +# else /* !__BORLANDC__ */ + "Turbo C", +# if (__TURBOC__ >= 0x0400) /* Kevin: 3.0 -> 0x0401 */ + "++ 3.0 or later", +# elif (__TURBOC__ == 0x0295) /* [661] vfy'd by Kevin */ + "++ 1.0", +# endif +# endif /* __BORLANDC__ */ +#elif defined(__GNUC__) +# ifdef __RSXNT__ +# if (defined(__DJGPP__) && !defined(__EMX__)) + (sprintf(buf, "rsxnt(djgpp v%d.%02d) / gcc ", + __DJGPP__, __DJGPP_MINOR__), buf), +# elif defined(__DJGPP__) + (sprintf(buf, "rsxnt(emx+djgpp v%d.%02d) / gcc ", + __DJGPP__, __DJGPP_MINOR__), buf), +# elif (defined(__GO32__) && !defined(__EMX__)) + "rsxnt(djgpp v1.x) / gcc ", +# elif defined(__GO32__) + "rsxnt(emx + djgpp v1.x) / gcc ", +# elif defined(__EMX__) + "rsxnt(emx)+gcc ", +# else + "rsxnt(unknown) / gcc ", +# endif +# elif defined(__CYGWIN__) + "Cygnus win32 / gcc ", +# elif defined(__MINGW32__) + "mingw32 / gcc ", +# else + "gcc ", +# endif + __VERSION__, +#elif defined(__LCC__) + "LCC-Win32", "", +#else + "unknown compiler (SDK?)", "", +#endif + + "\nWindows 9x / Windows NT", " (32-bit)", + +#ifdef __DATE__ + " on ", __DATE__ +#else + "", "" +#endif + ); + + return; + +} /* end function version_local() */ +#endif /* !WINDLL */ + +const char *BOINC_RCSID_1fddd51a9a = "$Id: z_win32.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_api.c boinc-7.0.14+dfsg/zip/zip/z_api.c --- boinc-7.0.7+dfsg/zip/zip/z_api.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_api.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,456 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + api.c + + This module supplies a Zip dll engine for use directly from C/C++ + programs. + + The entry points are: + + ZpVer *ZpVersion(void); + int EXPENTRY ZpInit(LPZIPUSERFUNCTIONS lpZipUserFunc); + BOOL EXPENTRY ZpSetOptions(LPZPOPT Opts); + ZPOPT EXPENTRY ZpGetOptions(void); + int EXPENTRY ZpArchive(ZCL C); + + This module is currently only used by the Windows dll, and is not used at + all by any of the other platforms, although it should be easy enough to + implement this on most platforms. + + ---------------------------------------------------------------------------*/ +#define __API_C + +#ifdef WINDLL +# include +# include "windll/windll.h" +#endif + +#ifdef OS2 +# define INCL_DOSMEMMGR +# include +#endif + +#ifdef __BORLANDC__ +#include +#endif +#include +#include + +#include "z_api.h" /* this includes zip.h */ +//#include "z_crypt.h" + +#include "revision.h" + +#ifdef USE_ZLIB +# include "zlib.h" +#endif + + +#ifdef _WINDLL +DLLPRNT *lpZipPrint; +DLLPASSWORD *lpZipPassword; +extern DLLCOMMENT *lpComment; +#endif + +ZIPUSERFUNCTIONS ZipUserFunctions, far * lpZipUserFunctions; + +int ZipRet; + +/* Local forward declarations */ +extern int zipmain OF((int, char **)); +int AllocMemory(int, char *, char *); + +ZPOPT Options; +char **argVee; +int argCee; + +/*--------------------------------------------------------------------------- + Local functions + ---------------------------------------------------------------------------*/ + +int AllocMemory(int i, char *cmd, char *str) +{ +int j; +if ((argVee[i] = (char *) malloc( sizeof(char) * strlen(cmd)+1 )) == NULL) + { + for (j = 0; j < i; j++) + { + free (argVee[j]); + argVee[j] = NULL; + } + free(argVee); + fprintf(stdout, "Unable to allocate memory in zip library at %s\n", str); + return ZE_MEM; + } +strcpy( argVee[i], cmd ); +return ZE_OK; +} + +/*--------------------------------------------------------------------------- + Documented API entry points + ---------------------------------------------------------------------------*/ + +int EXPENTRY ZpInit(LPZIPUSERFUNCTIONS lpZipUserFunc) +{ +ZipUserFunctions = *lpZipUserFunc; +lpZipUserFunctions = &ZipUserFunctions; + +if (!lpZipUserFunctions->print || + !lpZipUserFunctions->comment) + return FALSE; + +return TRUE; +} + +BOOL EXPENTRY ZpSetOptions(LPZPOPT Opts) +{ +Options = *Opts; +return TRUE; +} + +ZPOPT EXPENTRY ZpGetOptions(void) +{ +#if CRYPT +Options.fEncryption = TRUE; +#else +Options.fEncryption = FALSE; +#endif +return Options; +} + +int EXPENTRY ZpArchive(ZCL C) +/* Add, update, freshen, or delete zip entries in a zip file. See the + command help in help() zip.c */ +{ +int i, k, j, m; +char szOrigDir[PATH_MAX]; + +argCee = 0; +/* malloc additional 26 to allow for additional command line arguments */ +if ((argVee = (char **)malloc((C.argc+26)*sizeof(char *))) == NULL) + { + fprintf(stdout, "Unable to allocate memory in zip dll\n"); + return ZE_MEM; + } +if ((argVee[argCee] = (char *) malloc( sizeof(char) * strlen("wiz.exe")+1 )) == NULL) + { + free(argVee); + fprintf(stdout, "Unable to allocate memory in zip dll\n"); + return ZE_MEM; + } +strcpy( argVee[argCee], "wiz.exe" ); +argCee++; + +/* Set compression level efficacy -0...-9 */ +if (AllocMemory(argCee, "-0", "Compression") != ZE_OK) + return ZE_MEM; +argVee[argCee][1] = Options.fLevel; +argCee++; + +if (Options.fOffsets) /* Update offsets for SFX prefix */ + { + if (AllocMemory(argCee, "-A", "Offsets") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fDeleteEntries) /* Delete files from zip file -d */ + { + if (AllocMemory(argCee, "-d", "Delete") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fNoDirEntries) /* Do not add directory entries -D */ + { + if (AllocMemory(argCee, "-D", "No Dir Entries") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fFreshen) /* Freshen zip file--overwrite only -f */ + { + if (AllocMemory(argCee, "-f", "Freshen") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fRepair) /* Fix archive -F or -FF */ + { + if (Options.fRepair == 1) + { + if (AllocMemory(argCee, "-F", "Repair") != ZE_OK) + return ZE_MEM; + } + else + { + if (AllocMemory(argCee, "-FF", "Repair") != ZE_OK) + return ZE_MEM; + } + argCee++; + } +if (Options.fGrow) /* Allow appending to a zip file -g */ + { + if (AllocMemory(argCee, "-g", "Appending") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fJunkDir) /* Junk directory names -j */ + { + if (AllocMemory(argCee, "-j", "Junk Dir Names") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fEncrypt) /* encrypt -e */ + { + if (AllocMemory(argCee, "-e", "Encrypt") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fJunkSFX) /* Junk sfx prefix */ + { + if (AllocMemory(argCee, "-J", "Junk SFX") != ZE_OK) + return ZE_MEM; + argCee++; + } + +if (Options.fForce) /* Make entries using DOS names (k for Katz) -k */ + { + if (AllocMemory(argCee, "-k", "Force DOS") != ZE_OK) + return ZE_MEM; + argCee++; + } + +if (Options.fLF_CRLF) /* Translate LF_CRLF -l */ + { + if (AllocMemory(argCee, "-l", "LF-CRLF") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fCRLF_LF) /* Translate CR/LF to LF -ll */ + { + if (AllocMemory(argCee, "-ll", "CRLF-LF") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fMove) /* Delete files added to or updated in zip file -m */ + { + if (AllocMemory(argCee, "-m", "Move") != ZE_OK) + return ZE_MEM; + argCee++; + } + +if (Options.fLatestTime) /* Set zip file time to time of latest file in it -o */ + { + if (AllocMemory(argCee, "-o", "Time") != ZE_OK) + return ZE_MEM; + argCee++; + } + +if (Options.fComment) /* Add archive comment "-z" */ + { + if (AllocMemory(argCee, "-z", "Comment") != ZE_OK) + return ZE_MEM; + argCee++; + } + +if (Options.fQuiet) /* quiet operation -q */ + { + if (AllocMemory(argCee, "-q", "Quiet") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fRecurse == 1) /* recurse into subdirectories -r */ + { + if (AllocMemory(argCee, "-r", "Recurse -r") != ZE_OK) + return ZE_MEM; + argCee++; + } +else if (Options.fRecurse == 2) /* recurse into subdirectories -R */ + { + if (AllocMemory(argCee, "-R", "Recurse -R") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fSystem) /* include system and hidden files -S */ + { + if (AllocMemory(argCee, "-S", "System") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fExcludeDate) /* Exclude files newer than specified date -tt */ + { + if ((Options.Date != NULL) && (Options.Date[0] != '\0')) + { + if (AllocMemory(argCee, "-tt", "Date") != ZE_OK) + return ZE_MEM; + argCee++; + if (AllocMemory(argCee, Options.Date, "Date") != ZE_OK) + return ZE_MEM; + argCee++; + } + } + +if (Options.fIncludeDate) /* include files newer than specified date -t */ + { + if ((Options.Date != NULL) && (Options.Date[0] != '\0')) + { + if (AllocMemory(argCee, "-t", "Date") != ZE_OK) + return ZE_MEM; + argCee++; + if (AllocMemory(argCee, Options.Date, "Date") != ZE_OK) + return ZE_MEM; + argCee++; + } + } + +if (Options.fUpdate) /* Update zip file--overwrite only if newer -u */ + { + if (AllocMemory(argCee, "-u", "Update") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fVerbose) /* Mention oddities in zip file structure -v */ + { + if (AllocMemory(argCee, "-v", "Verbose") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (Options.fVolume) /* Include volume label -$ */ + { + if (AllocMemory(argCee, "-$", "Volume") != ZE_OK) + return ZE_MEM; + argCee++; + } +#ifdef WIN32 +if (Options.fPrivilege) /* Use privileges -! */ + { + if (AllocMemory(argCee, "-!", "Privileges") != ZE_OK) + return ZE_MEM; + argCee++; + } +#endif +if (Options.fExtra) /* Exclude extra attributes -X */ + { + if (AllocMemory(argCee, "-X", "Extra") != ZE_OK) + return ZE_MEM; + argCee++; + } +if ((Options.szTempDir != NULL) && (Options.szTempDir[0] != '\0') + && Options.fTemp) /* Use temporary directory -b */ + { + if (AllocMemory(argCee, "-b", "Temp dir switch command") != ZE_OK) + return ZE_MEM; + argCee++; + if (AllocMemory(argCee, Options.szTempDir, "Temporary directory") != ZE_OK) + return ZE_MEM; + argCee++; + } +if (AllocMemory(argCee, C.lpszZipFN, "Zip file name") != ZE_OK) + return ZE_MEM; +argCee++; + +getcwd(szOrigDir, PATH_MAX); /* Save current drive and directory */ + +if ((Options.szRootDir != NULL) && (Options.szRootDir[0] != '\0')) + { + chdir(Options.szRootDir); +#ifdef __BORLANDC__ + setdisk(toupper(Options.szRootDir[0]) - 'A'); +#endif + lstrcat(Options.szRootDir, "\\"); /* append trailing \\ */ + if (C.FNV != NULL) + { + for (k = 0; k < C.argc; k++) + { + if (AllocMemory(argCee, C.FNV[k], "Making argv") != ZE_OK) + return ZE_MEM; + if ((strncmp(Options.szRootDir, C.FNV[k], lstrlen(Options.szRootDir))) == 0) + { + m = 0; + for (j = lstrlen(Options.szRootDir); j < lstrlen(C.FNV[k]); j++) + argVee[argCee][m++] = C.FNV[k][j]; + argVee[argCee][m] = '\0'; + } + argCee++; + } + } + } +else + if (C.FNV != NULL) + for (k = 0; k < C.argc; k++) + { + if (AllocMemory(argCee, C.FNV[k], "Making argv") != ZE_OK) + return ZE_MEM; + argCee++; + } + +argVee[argCee] = NULL; + +ZipRet = zipmain(argCee, argVee); + +chdir(szOrigDir); +#ifdef __BORLANDC__ +setdisk(toupper(szOrigDir[0]) - 'A'); +#endif + +/* Free the arguments in the array */ +for (i = 0; i < argCee; i++) + { + free (argVee[i]); + argVee[i] = NULL; + } +/* Then free the array itself */ +free(argVee); + +return ZipRet; +} + +#if CRYPT +int encr_passwd(int modeflag, char *pwbuf, int size, const char *zfn) +{ +return (*lpZipUserFunctions->password)(pwbuf, size, ((modeflag == ZP_PW_VERIFY) ? + "Verify password: " : "Enter password: "), + (char *)zfn); +} +#endif /* CRYPT */ + +void EXPENTRY ZpVersion(ZpVer far * p) /* should be pointer to const struct */ +{ + p->structlen = ZPVER_LEN; + +#ifdef BETA + p->flag = 1; +#else + p->flag = 0; +#endif + lstrcpy(p->betalevel, Z_BETALEVEL); + lstrcpy(p->date, REVDATE); + +#ifdef ZLIB_VERSION + lstrcpy(p->zlib_version, ZLIB_VERSION); + p->flag |= 2; +#else + p->zlib_version[0] = '\0'; +#endif + + p->zip.major = Z_MAJORVER; + p->zip.minor = Z_MINORVER; + p->zip.patchlevel = Z_PATCHLEVEL; + + + p->os2dll.major = D2_MAJORVER; + p->os2dll.minor = D2_MINORVER; + p->os2dll.patchlevel = D2_PATCHLEVEL; + + + p->windll.major = DW_MAJORVER; + p->windll.minor = DW_MINORVER; + p->windll.patchlevel = DW_PATCHLEVEL; +} + +const char *BOINC_RCSID_e99e3c832e = "$Id: z_api.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_api.h boinc-7.0.14+dfsg/zip/zip/z_api.h --- boinc-7.0.7+dfsg/zip/zip/z_api.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_api.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,152 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* Only the Windows DLL is currently supported */ +#ifndef _ZIPAPI_H +#define _ZIPAPI_H + +#include "zip.h" + +#ifdef WIN32 +# ifndef PATH_MAX +# define PATH_MAX 260 +# endif +#else +# ifndef PATH_MAX +# define PATH_MAX 128 +# endif +#endif + +#if defined(WINDLL) || defined(API) +#include +/* Porting definations between Win 3.1x and Win32 */ +#ifdef WIN32 +# define far +# define _far +# define __far +# define near +# define _near +# define __near +#endif + +/*--------------------------------------------------------------------------- + Prototypes for public Zip API (DLL) functions. + ---------------------------------------------------------------------------*/ + +#define ZPVER_LEN sizeof(ZpVer) +/* These defines are set to zero for now, until OS/2 comes out + with a dll. + */ +#define D2_MAJORVER 0 +#define D2_MINORVER 0 +#define D2_PATCHLEVEL 0 + +/* intended to be a private struct: */ +typedef struct _zip_ver { + uch major; /* e.g., integer 5 */ + uch minor; /* e.g., 2 */ + uch patchlevel; /* e.g., 0 */ + uch not_used; +} _zip_version_type; + +typedef struct _ZpVer { + ulg structlen; /* length of the struct being passed */ + ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ + char betalevel[10]; /* e.g., "g BETA" or "" */ + char date[20]; /* e.g., "4 Sep 95" (beta) or "4 September 1995" */ + char zlib_version[10]; /* e.g., "0.95" or NULL */ + _zip_version_type zip; + _zip_version_type os2dll; + _zip_version_type windll; +} ZpVer; + +# ifndef EXPENTRY +# define EXPENTRY WINAPI +# endif + +#ifndef DEFINED_ONCE +#define DEFINED_ONCE +typedef int (WINAPI DLLPRNT) (LPSTR, unsigned long); +typedef int (WINAPI DLLPASSWORD) (LPSTR, int, LPCSTR, LPCSTR); +typedef int (WINAPI DLLSERVICE) (LPCSTR, unsigned long); +#endif +typedef int (WINAPI DLLCOMMENT)(LPSTR); + +/* Structures */ + +typedef struct { /* zip options */ +LPSTR Date; /* Date to include after */ +LPSTR szRootDir; /* Directory to use as base for zipping */ +LPSTR szTempDir; /* Temporary directory used during zipping */ +BOOL fTemp; /* Use temporary directory '-b' during zipping */ +BOOL fSuffix; /* include suffixes (not implemented) */ +BOOL fEncrypt; /* encrypt files */ +BOOL fSystem; /* include system and hidden files */ +BOOL fVolume; /* Include volume label */ +BOOL fExtra; /* Exclude extra attributes */ +BOOL fNoDirEntries; /* Do not add directory entries */ +BOOL fExcludeDate; /* Exclude files newer than specified date */ +BOOL fIncludeDate; /* Include only files newer than specified date */ +BOOL fVerbose; /* Mention oddities in zip file structure */ +BOOL fQuiet; /* Quiet operation */ +BOOL fCRLF_LF; /* Translate CR/LF to LF */ +BOOL fLF_CRLF; /* Translate LF to CR/LF */ +BOOL fJunkDir; /* Junk directory names */ +BOOL fGrow; /* Allow appending to a zip file */ +BOOL fForce; /* Make entries using DOS names (k for Katz) */ +BOOL fMove; /* Delete files added or updated in zip file */ +BOOL fDeleteEntries; /* Delete files from zip file */ +BOOL fUpdate; /* Update zip file--overwrite only if newer */ +BOOL fFreshen; /* Freshen zip file--overwrite only */ +BOOL fJunkSFX; /* Junk SFX prefix */ +BOOL fLatestTime; /* Set zip file time to time of latest file in it */ +BOOL fComment; /* Put comment in zip file */ +BOOL fOffsets; /* Update archive offsets for SFX files */ +BOOL fPrivilege; /* Use privileges (WIN32 only) */ +BOOL fEncryption; /* TRUE if encryption supported, else FALSE. + this is a read only flag */ +int fRecurse; /* Recurse into subdirectories. 1 => -r, 2 => -R */ +int fRepair; /* Repair archive. 1 => -F, 2 => -FF */ +char fLevel; /* Compression level (0 - 9) */ +} ZPOPT, _far *LPZPOPT; + +typedef struct { +int argc; /* Count of files to zip */ +LPSTR lpszZipFN; /* name of archive to create/update */ +char **FNV; /* array of file names to zip up */ +} ZCL, _far *LPZCL; + +typedef struct { +DLLPRNT *print; +DLLCOMMENT *comment; +DLLPASSWORD *password; +DLLSERVICE *ServiceApplication; +} ZIPUSERFUNCTIONS, far * LPZIPUSERFUNCTIONS; + +extern LPZIPUSERFUNCTIONS lpZipUserFunctions; + +void EXPENTRY ZpVersion(ZpVer far *); +int EXPENTRY ZpInit(LPZIPUSERFUNCTIONS lpZipUserFunc); +BOOL EXPENTRY ZpSetOptions(LPZPOPT Opts); +ZPOPT EXPENTRY ZpGetOptions(void); +int EXPENTRY ZpArchive(ZCL C); + +#if defined(ZIPLIB) || defined(COM_OBJECT) +# define ydays zp_ydays +#endif + + + +/* Functions not yet supported */ +#if 0 +int EXPENTRY ZpMain (int argc, char **argv); +int EXPENTRY ZpAltMain (int argc, char **argv, ZpInit *init); +#endif +#endif /* WINDLL? || API? */ + +#endif /* _ZIPAPI_H */ diff -Nru boinc-7.0.7+dfsg/zip/zip/z_crc32.c boinc-7.0.14+dfsg/zip/zip/z_crc32.c --- boinc-7.0.7+dfsg/zip/zip/z_crc32.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_crc32.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,66 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* $Id: z_crc32.c 7481 2005-08-25 21:33:28Z davea $ */ + +#define __CRC32_C /* identifies this source module */ + +#include "zip.h" + +#ifndef USE_ZLIB +#ifndef ASM_CRC + +#ifndef ZCONST +# define ZCONST const +#endif + +#ifdef CRC32 +# undef CRC32 +#endif +#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) +#define DO1(buf) crc = CRC32(crc, *buf++) +#define DO2(buf) DO1(buf); DO1(buf) +#define DO4(buf) DO2(buf); DO2(buf) +#define DO8(buf) DO4(buf); DO4(buf) + +/* ========================================================================= */ +ulg crc32(crc, buf, len) + register ulg crc; /* crc shift register */ + register ZCONST uch *buf; /* pointer to bytes to pump through */ + extent len; /* number of bytes in buf[] */ +/* Run a set of bytes through the crc shift register. If buf is a NULL + pointer, then initialize the crc shift register contents instead. + Return the current crc in either case. */ +{ + register ZCONST ulg near *crc_table; + + if (buf == NULL) return 0L; + + crc_table = get_crc_table_boinc(); + + crc = crc ^ 0xffffffffL; +#ifndef NO_UNROLLED_LOOPS + while (len >= 8) { + DO8(buf); + len -= 8; + } +#endif + if (len) do { + DO1(buf); + } while (--len); + return crc ^ 0xffffffffL; /* (instead of ~c for 64-bit machines) */ +} +#endif /* !ASM_CRC */ +#endif /* !USE_ZLIB */ + +const char *BOINC_RCSID_49357bb004 = "$Id: z_crc32.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_crctab.c boinc-7.0.14+dfsg/zip/zip/z_crctab.c --- boinc-7.0.7+dfsg/zip/zip/z_crctab.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_crctab.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,229 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* crctab.c -- supply the CRC table needed for CRC-32 calculations. + * Copyright (C) 1995 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* $Id: z_crctab.c 7481 2005-08-25 21:33:28Z davea $ */ + +/* + Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The table is simply the CRC of all possible eight bit values. This is all + the information needed to generate CRC's on data a byte at a time for all + combinations of CRC register values and incoming bytes. +*/ + +#define __CRCTAB_C /* identifies this source module */ + +#include "zip.h" + +#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) + +#ifndef ZCONST +# define ZCONST const +#endif + +#ifdef DYNAMIC_CRC_TABLE + +/* ========================================================================= + * Make the crc table. This function is needed only if you want to compute + * the table dynamically. + */ + +local void make_crc_table OF((void)); + +#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) + error: Dynamic allocation of CRC table not safe with reentrant code. +#endif /* DYNALLOC_CRCTAB && REENTRANT */ + +#ifdef DYNALLOC_CRCTAB + local ulg near *crc_table = NULL; +# if 0 /* not used, since sizeof("near *") <= sizeof(int) */ + /* Use this section when access to a "local int" is faster than access to + a "local pointer" (e.g.: i86 16bit code with far pointers). */ + local int crc_table_empty = 1; +# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) +# define MARK_CRCTAB_FILLED crc_table_empty = 0 +# define MARK_CRCTAB_EMPTY crc_table_empty = 1 +# else + /* Use this section on systems where the size of pointers and ints is + equal (e.g.: all 32bit systems). */ +# define CRC_TABLE_IS_EMPTY (crc_table == NULL) +# define MARK_CRCTAB_FILLED crc_table = crctab_p +# define MARK_CRCTAB_EMPTY crc_table = NULL +# endif +#else /* !DYNALLOC_CRCTAB */ + local ulg near crc_table[256]; + local int crc_table_empty = 1; +# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) +# define MARK_CRCTAB_FILLED crc_table_empty = 0 +#endif /* ?DYNALLOC_CRCTAB */ + + +local void make_crc_table() +{ + ulg c; /* crc shift register */ + int n; /* counter for all possible eight bit values */ + int k; /* byte being shifted into crc apparatus */ +#ifdef DYNALLOC_CRCTAB + ulg near *crctab_p; /* temporary pointer to allocated crc_table area */ +#else /* !DYNALLOC_CRCTAB */ +# define crctab_p crc_table +#endif /* DYNALLOC_CRCTAB */ + +#ifdef COMPUTE_XOR_PATTERN + /* This piece of code has been left here to explain how the XOR pattern + * used in the creation of the crc_table values can be recomputed. + * For production versions of this function, it is more efficient to + * supply the resultant pattern at compile time. + */ + ulg xor; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static uch p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* make exclusive-or pattern from polynomial (0xedb88320L) */ + xor = 0L; + for (i = 0; i < sizeof(p)/sizeof(uch); i++) + xor |= 1L << (31 - p[i]); +#else +# define xor 0xedb88320L +#endif + +#ifdef DYNALLOC_CRCTAB + crctab_p = (ulg near *) nearmalloc (256*sizeof(ulg)); + if (crctab_p == NULL) { + ziperr(ZE_MEM, "crc_table allocation"); + } +#endif /* DYNALLOC_CRCTAB */ + + for (n = 0; n < 256; n++) { + c = (ulg)n; + for (k = 8; k; k--) + c = c & 1 ? xor ^ (c >> 1) : c >> 1; + crctab_p[n] = c; + } + MARK_CRCTAB_FILLED; +} + +#else /* !DYNAMIC_CRC_TABLE */ + +#ifdef DYNALLOC_CRCTAB + error: Inconsistent flags, DYNALLOC_CRCTAB without DYNAMIC_CRC_TABLE. +#endif + +/* ======================================================================== + * Table of CRC-32's of all single-byte values (made by make_crc_table) + */ +local ZCONST ulg near crc_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; +#endif /* ?DYNAMIC_CRC_TABLE */ + +/* use "OF((void))" here to work around a Borland TC++ 1.0 problem */ +#ifdef USE_ZLIB +ZCONST uLongf *get_crc_table_boinc OF((void)) +#else +ZCONST ulg near *get_crc_table_boinc OF((void)) +#endif +{ +#ifdef DYNAMIC_CRC_TABLE + if (CRC_TABLE_IS_EMPTY) + make_crc_table(); +#endif +#ifdef USE_ZLIB + return (ZCONST uLongf *)crc_table; +#else + return (ZCONST ulg near *)crc_table; +#endif +} + +#ifdef DYNALLOC_CRCTAB +void free_crc_table() +{ + if (!CRC_TABLE_IS_EMPTY) + { + nearfree((ulg near *)crc_table); + MARK_CRCTAB_EMPTY; + } +} +#endif + +#endif /* !USE_ZLIB || USE_OWN_CRCTAB */ + +const char *BOINC_RCSID_7b30f2d851 = "$Id: z_crctab.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_crypt.c boinc-7.0.14+dfsg/zip/zip/z_crypt.c --- boinc-7.0.7+dfsg/zip/zip/z_crypt.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_crypt.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,22 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + crypt.c (dummy version) by Info-ZIP. Last revised: 15 Aug 98 + + This is a non-functional version of Info-ZIP's crypt.c encryption/ + decryption code for Zip, ZipCloak, UnZip and fUnZip. This file is + not copyrighted and may be distributed freely. :-) See the "WHERE" + file for sites from which to obtain the full encryption/decryption + sources (zcrypt28.zip or later). + */ + +/* something "externally visible" to shut up compiler/linker warnings */ +int zcr_dummy; + +const char *BOINC_RCSID_6b6cadb29a = "$Id: z_crypt.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_crypt.h boinc-7.0.14+dfsg/zip/zip/z_crypt.h --- boinc-7.0.7+dfsg/zip/zip/z_crypt.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_crypt.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,32 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + crypt.h (dummy version) by Info-ZIP. Last revised: 15 Aug 98 + + This is a non-functional version of Info-ZIP's crypt.h encryption/ + decryption header file for Zip, ZipCloak, UnZip and fUnZip. This + file is not copyrighted and may be distributed without restriction. + See the "WHERE" file for sites from which to obtain the full crypt + sources (zcrypt28.zip or later). + */ + +#ifndef __crypt_h /* don't include more than once */ +#define __crypt_h + +#ifdef CRYPT +# undef CRYPT +#endif +#define CRYPT 0 /* dummy version */ + +#define zencode +#define zdecode + +#define zfwrite fwrite + +#endif /* !__crypt_h */ diff -Nru boinc-7.0.7+dfsg/zip/zip/z_fileio.c boinc-7.0.14+dfsg/zip/zip/z_fileio.c --- boinc-7.0.7+dfsg/zip/zip/z_fileio.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_fileio.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,996 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * fileio.c by Mark Adler + */ +#define __FILEIO_C +#include "zip.h" + +#ifdef MACOS +# include "helpers.h" +#endif + +#include +#include + +#ifdef NO_MKTIME +time_t mktime OF((struct tm *)); +#endif + +#ifdef OSF +#define EXDEV 18 /* avoid a bug in the DEC OSF/1 header files. */ +#else +#include +#endif + +#ifdef NO_ERRNO +extern int errno; +#endif + +#if defined(VMS) || defined(TOPS20) +# define PAD 5 +#else +# define PAD 0 +#endif + +#ifdef NO_RENAME +int rename OF((ZCONST char *, ZCONST char *)); +#endif + + +#ifndef UTIL /* the companion #endif is a bit of ways down ... */ + +/* Local functions */ +local int fqcmp OF((ZCONST zvoid *, ZCONST zvoid *)); +local int fqcmpz OF((ZCONST zvoid *, ZCONST zvoid *)); + +/* Local module level variables. */ +char *label = NULL; /* global, but only used in `system'.c */ +local struct stat zipstatb; +#if (!defined(MACOS) && !defined(WINDLL)) +local int zipstate = -1; +#else +int zipstate; +#endif +/* -1 unknown, 0 old zip file exists, 1 new zip file */ + +char *getnam(n, fp) +char *n; /* where to put name (must have >=FNMAX+1 bytes) */ +FILE *fp; +/* Read a \n or \r delimited name from stdin into n, and return + n. If EOF, then return NULL. Also, if the name read is too big, return + NULL. */ +{ + int c; /* last character read */ + char *p; /* pointer into name area */ + + p = n; + while ((c = getc(fp)) == '\n' || c == '\r') + ; + if (c == EOF) + return NULL; + do { + if (p - n >= FNMAX) + return NULL; + *p++ = (char) c; + c = getc(fp); + } while (c != EOF && (c != '\n' && c != '\r')); +#ifdef WIN32 +/* + * WIN32 strips off trailing spaces and periods in filenames + * XXX what about a filename that only consists of spaces ? + * Answer: on WIN32, a filename must contain at least one non-space char + */ + while (p > n) { + if ((c = p[-1]) != ' ' && c != '.') + break; + --p; + } +#endif + *p = 0; + return n; +} + +struct flist far *fexpel(f) +struct flist far *f; /* entry to delete */ +/* Delete the entry *f in the doubly-linked found list. Return pointer to + next entry to allow stepping through list. */ +{ + struct flist far *t; /* temporary variable */ + + t = f->nxt; + *(f->lst) = t; /* point last to next, */ + if (t != NULL) + t->lst = f->lst; /* and next to last */ + if (f->name != NULL) /* free memory used */ + free((zvoid *)(f->name)); + if (f->zname != NULL) + free((zvoid *)(f->zname)); + if (f->iname != NULL) + free((zvoid *)(f->iname)); + farfree((zvoid far *)f); + fcount--; /* decrement count */ + return t; /* return pointer to next */ +} + + +local int fqcmp(a, b) +ZCONST zvoid *a, *b; /* pointers to pointers to found entries */ +/* Used by qsort() to compare entries in the found list by name. */ +{ + return strcmp((*(struct flist far **)a)->name, + (*(struct flist far **)b)->name); +} + + +local int fqcmpz(a, b) +ZCONST zvoid *a, *b; /* pointers to pointers to found entries */ +/* Used by qsort() to compare entries in the found list by iname. */ +{ + return strcmp((*(struct flist far **)a)->iname, + (*(struct flist far **)b)->iname); +} + + +char *last(p, c) +char *p; /* sequence of path components */ +int c; /* path components separator character */ +/* Return a pointer to the start of the last path component. For a directory + * name terminated by the character in c, the return value is an empty string. + */ +{ + char *t; /* temporary variable */ + + if ((t = strrchr(p, c)) != NULL) + return t + 1; + else +#ifndef AOS_VS + return p; +#else +/* We want to allow finding of end of path in either AOS/VS-style pathnames + * or Unix-style pathnames. This presents a few little problems ... + */ + { + if (*p == '=' || *p == '^') /* like ./ and ../ respectively */ + return p + 1; + else + return p; + } +#endif +} + + +char *msname(n) +char *n; +/* Reduce all path components to MSDOS upper case 8.3 style names. */ +{ + int c; /* current character */ + int f; /* characters in current component */ + char *p; /* source pointer */ + char *q; /* destination pointer */ + + p = q = n; + f = 0; + while ((c = (unsigned char)*POSTINCSTR(p)) != 0) + if (c == ' ' || c == ':' || c == '"' || c == '*' || c == '+' || + c == ',' || c == ';' || c == '<' || c == '=' || c == '>' || + c == '?' || c == '[' || c == ']' || c == '|') + continue; /* char is discarded */ + else if (c == '/') + { + *POSTINCSTR(q) = (char)c; + f = 0; /* new component */ + } +#ifdef __human68k__ + else if (ismbblead(c) && *p) + { + if (f == 7 || f == 11) + f++; + else if (*p && f < 12 && f != 8) + { + *q++ = c; + *q++ = *p++; + f += 2; + } + } +#endif /* __human68k__ */ + else if (c == '.') + { + if (f == 0) + continue; /* leading dots are discarded */ + else if (f < 9) + { + *POSTINCSTR(q) = (char)c; + f = 9; /* now in file type */ + } + else + f = 12; /* now just excess characters */ + } + else + if (f < 12 && f != 8) + { + f += CLEN(p); /* do until end of name or type */ + *POSTINCSTR(q) = (char)(to_up(c)); + } + *q = 0; + return n; +} + +int check_dup() +/* Sort the found list and remove duplicates. + Return an error code in the ZE_ class. */ +{ + struct flist far *f; /* steps through found linked list */ + extent j, k; /* indices for s */ + struct flist far **s; /* sorted table */ + struct flist far **nodup; /* sorted table without duplicates */ + + /* sort found list, remove duplicates */ + if (fcount) + { + extent fl_size = fcount * sizeof(struct flist far *); + if ((fl_size / sizeof(struct flist far *)) != fcount || + (s = (struct flist far **)malloc(fl_size)) == NULL) + return ZE_MEM; + for (j = 0, f = found; f != NULL; f = f->nxt) + s[j++] = f; + /* Check names as given (f->name) */ + qsort((char *)s, fcount, sizeof(struct flist far *), fqcmp); + for (k = j = fcount - 1; j > 0; j--) + if (strcmp(s[j - 1]->name, s[j]->name) == 0) + /* remove duplicate entry from list */ + fexpel(s[j]); /* fexpel() changes fcount */ + else + /* copy valid entry into destination position */ + s[k--] = s[j]; + s[k] = s[0]; /* First entry is always valid */ + nodup = &s[k]; /* Valid entries are at end of array s */ + + /* sort only valid items and check for unique internal names (f->iname) */ + qsort((char *)nodup, fcount, sizeof(struct flist far *), fqcmpz); + for (j = 1; j < fcount; j++) + if (strcmp(nodup[j - 1]->iname, nodup[j]->iname) == 0) + { + zipwarn(" first full name: ", nodup[j - 1]->name); + zipwarn(" second full name: ", nodup[j]->name); +#ifdef EBCDIC + strtoebc(nodup[j]->iname, nodup[j]->iname); +#endif + zipwarn("name in zip file repeated: ", nodup[j]->iname); +#ifdef EBCDIC + strtoasc(nodup[j]->iname, nodup[j]->iname); +#endif + return ZE_PARMS; + } + free((zvoid *)s); + } + return ZE_OK; +} + +int filter(name, casesensitive) + char *name; + int casesensitive; + /* Scan the -i and -x lists for matches to the given name. + Return true if the name must be included, false otherwise. + Give precedence to -x over -i. + */ +{ + unsigned int n; + int slashes; + int include = icount ? 0 : 1; + char *p, *q; + + if (pcount == 0) return 1; + + for (n = 0; n < pcount; n++) { + if (!patterns[n].zname[0]) /* it can happen... */ + continue; + p = name; + if (patterns[n].select == 'R') { + /* With -R patterns, if the pattern has N path components (that is, */ + /* N-1 slashes), then we test only the last N components of name. */ + slashes = 0; + for (q = patterns[n].zname; (q = MBSCHR(q, '/')) != NULL; INCSTR(q)) + slashes++; + for (q = p; (q = MBSCHR(q, '/')) != NULL; INCSTR(q)) + slashes--; + if (slashes < 0) + for (q = p; (q = MBSCHR(q, '/')) != NULL; INCSTR(q)) + if (slashes++ == 0) { + p = q + CLEN(q); + break; + } + } + if (MATCH(patterns[n].zname, p, casesensitive)) { + if (patterns[n].select == 'x') return 0; + include = 1; + } + } + return include; +} + +int newname(name, isdir, casesensitive) +char *name; /* name to add (or exclude) */ +int isdir; /* true for a directory */ +int casesensitive; /* true for case-sensitive matching */ +/* Add (or exclude) the name of an existing disk file. Return an error + code in the ZE_ class. */ +{ + char *iname, *zname; /* internal name, external version of iname */ + char *undosm; /* zname version with "-j" and "-k" options disabled */ + struct flist far *f; /* where in found, or new found entry */ + struct zlist far *z; /* where in zfiles (if found) */ + int dosflag; + + /* Search for name in zip file. If there, mark it, else add to + list of new names to do (or remove from that list). */ + if ((iname = ex2in(name, isdir, &dosflag)) == NULL) + return ZE_MEM; + + /* Discard directory names with zip -rj */ + if (*iname == '\0') { +#ifndef AMIGA +/* A null string is a legitimate external directory name in AmigaDOS; also, + * a command like "zip -r zipfile FOO:" produces an empty internal name. + */ +# ifndef RISCOS + /* If extensions needs to be swapped, we will have empty directory names + instead of the original directory. For example, zipping 'c.', 'c.main' + should zip only 'main.c' while 'c.' will be converted to '\0' by ex2in. */ + + if (pathput && !recurse) error("empty name without -j or -r"); + +# endif /* !RISCOS */ +#endif /* !AMIGA */ + free((zvoid *)iname); + return ZE_OK; + } + undosm = NULL; + if (dosflag || !pathput) { + int save_dosify = dosify, save_pathput = pathput; + dosify = 0; + pathput = 1; + /* zname is temporarly mis-used as "undosmode" iname pointer */ + if ((zname = ex2in(name, isdir, NULL)) != NULL) { + undosm = in2ex(zname); + free(zname); + } + dosify = save_dosify; + pathput = save_pathput; + } + if ((zname = in2ex(iname)) == NULL) + return ZE_MEM; + if (undosm == NULL) + undosm = zname; + if ((z = zsearch(zname)) != NULL) { + if (pcount && !filter(undosm, casesensitive)) { + /* Do not clear z->mark if "exclude", because, when "dosify || !pathput" + * is in effect, two files with different filter options may hit the + * same z entry. + */ + if (verbose) + fprintf(mesg, "excluding %s\n", zname); + free((zvoid *)iname); + free((zvoid *)zname); + } else { + z->mark = 1; + if ((z->name = malloc(strlen(name) + 1 + PAD)) == NULL) { + if (undosm != zname) + free((zvoid *)undosm); + free((zvoid *)iname); + free((zvoid *)zname); + return ZE_MEM; + } + strcpy(z->name, name); + z->dosflag = dosflag; + +#ifdef FORCE_NEWNAME + free((zvoid *)(z->iname)); + z->iname = iname; +#else + /* Better keep the old name. Useful when updating on MSDOS a zip file + * made on Unix. + */ + free((zvoid *)iname); + free((zvoid *)zname); +#endif /* ? FORCE_NEWNAME */ + } + if (name == label) { + label = z->name; + } + } else if (pcount == 0 || filter(undosm, casesensitive)) { + + /* Check that we are not adding the zip file to itself. This + * catches cases like "zip -m foo ../dir/foo.zip". + */ +#ifndef CMS_MVS +/* Version of stat() for CMS/MVS isn't complete enough to see if */ +/* files match. Just let ZIP.C compare the filenames. That's good */ +/* enough for CMS anyway since there aren't paths to worry about. */ + struct stat statb; + + if (zipstate == -1) + zipstate = strcmp(zipfile, "-") != 0 && + stat(zipfile, &zipstatb) == 0; + + if (zipstate == 1 && (statb = zipstatb, stat(name, &statb) == 0 + && zipstatb.st_mode == statb.st_mode +#ifdef VMS + && memcmp(zipstatb.st_ino, statb.st_ino, sizeof(statb.st_ino)) == 0 + && strcmp(zipstatb.st_dev, statb.st_dev) == 0 + && zipstatb.st_uid == statb.st_uid +#else /* !VMS */ + && zipstatb.st_ino == statb.st_ino + && zipstatb.st_dev == statb.st_dev + && zipstatb.st_uid == statb.st_uid + && zipstatb.st_gid == statb.st_gid +#endif /* ?VMS */ + && zipstatb.st_size == statb.st_size + && zipstatb.st_mtime == statb.st_mtime + && zipstatb.st_ctime == statb.st_ctime)) { + /* Don't compare a_time since we are reading the file */ + if (verbose) + fprintf(mesg, "file matches zip file -- skipping\n"); + if (undosm != zname) + free((zvoid *)zname); + if (undosm != iname) + free((zvoid *)undosm); + free((zvoid *)iname); + return ZE_OK; + } +#endif /* CMS_MVS */ + + /* allocate space and add to list */ + if ((f = (struct flist far *)farmalloc(sizeof(struct flist))) == NULL || + fcount + 1 < fcount || + (f->name = malloc(strlen(name) + 1 + PAD)) == NULL) + { + if (f != NULL) + farfree((zvoid far *)f); + if (undosm != zname) + free((zvoid *)undosm); + free((zvoid *)iname); + free((zvoid *)zname); + return ZE_MEM; + } + strcpy(f->name, name); + f->iname = iname; + f->zname = zname; + f->dosflag = dosflag; + *fnxt = f; + f->lst = fnxt; + f->nxt = NULL; + fnxt = &f->nxt; + fcount++; + if (name == label) { + label = f->name; + } + } + if (undosm != zname) + free((zvoid *)undosm); + return ZE_OK; +} + + +ulg dostime(y, n, d, h, m, s) +int y; /* year */ +int n; /* month */ +int d; /* day */ +int h; /* hour */ +int m; /* minute */ +int s; /* second */ +/* Convert the date y/n/d and time h:m:s to a four byte DOS date and + time (date in high two bytes, time in low two bytes allowing magnitude + comparison). */ +{ + return y < 1980 ? DOSTIME_MINIMUM /* dostime(1980, 1, 1, 0, 0, 0) */ : + (((ulg)y - 1980) << 25) | ((ulg)n << 21) | ((ulg)d << 16) | + ((ulg)h << 11) | ((ulg)m << 5) | ((ulg)s >> 1); +} + + +ulg unix2dostime(t) +time_t *t; /* unix time to convert */ +/* Return the Unix time t in DOS format, rounded up to the next two + second boundary. */ +{ + time_t t_even; + struct tm *s; /* result of localtime() */ + + t_even = (time_t)(((unsigned long)(*t) + 1) & (~1)); + /* Round up to even seconds. */ + s = localtime(&t_even); /* Use local time since MSDOS does. */ + if (s == (struct tm *)NULL) { + /* time conversion error; use current time as emergency value + (assuming that localtime() does at least accept this value!) */ + t_even = (time_t)(((unsigned long)time(NULL) + 1) & (~1)); + s = localtime(&t_even); + } + return dostime(s->tm_year + 1900, s->tm_mon + 1, s->tm_mday, + s->tm_hour, s->tm_min, s->tm_sec); +} + +int issymlnk(a) +ulg a; /* Attributes returned by filetime() */ +/* Return true if the attributes are those of a symbolic link */ +{ +#ifndef QDOS +#ifdef S_IFLNK +#ifdef __human68k__ + int *_dos_importlnenv(void); + + if (_dos_importlnenv() == NULL) + return 0; +#endif + return ((a >> 16) & S_IFMT) == S_IFLNK; +#else /* !S_IFLNK */ + return (int)a & 0; /* avoid warning on unused parameter */ +#endif /* ?S_IFLNK */ +#else + return 0; +#endif +} + +#endif /* !UTIL */ + + +#if (!defined(UTIL) && !defined(ZP_NEED_GEN_D2U_TIME)) + /* There is no need for dos2unixtime() in the ZipUtils' code. */ +# define ZP_NEED_GEN_D2U_TIME +#endif +#if ((defined(OS2) || defined(VMS)) && defined(ZP_NEED_GEN_D2U_TIME)) + /* OS/2 and VMS use a special solution to handle time-stams of files. */ +# undef ZP_NEED_GEN_D2U_TIME +#endif +#if (defined(W32_STATROOT_FIX) && !defined(ZP_NEED_GEN_D2U_TIME)) + /* The Win32 stat()-bandaid to fix stat'ing root directories needs + * dos2unixtime() to calculate the time-stamps. */ +# define ZP_NEED_GEN_D2U_TIME +#endif + +#ifdef ZP_NEED_GEN_D2U_TIME + +time_t dos2unixtime(dostime) +ulg dostime; /* DOS time to convert */ +/* Return the Unix time_t value (GMT/UTC time) for the DOS format (local) + * time dostime, where dostime is a four byte value (date in most significant + * word, time in least significant word), see dostime() function. + */ +{ + struct tm *t; /* argument for mktime() */ + ZCONST time_t clock = time(NULL); + + t = localtime(&clock); + t->tm_isdst = -1; /* let mktime() determine if DST is in effect */ + /* Convert DOS time to UNIX time_t format */ + t->tm_sec = (((int)dostime) << 1) & 0x3e; + t->tm_min = (((int)dostime) >> 5) & 0x3f; + t->tm_hour = (((int)dostime) >> 11) & 0x1f; + t->tm_mday = (int)(dostime >> 16) & 0x1f; + t->tm_mon = ((int)(dostime >> 21) & 0x0f) - 1; + t->tm_year = ((int)(dostime >> 25) & 0x7f) + 80; + + return mktime(t); +} + +#undef ZP_NEED_GEN_D2U_TIME +#endif /* ZP_NEED_GEN_D2U_TIME */ + + +#ifndef MACOS +int destroy(f) +char *f; /* file to delete */ +/* Delete the file *f, returning non-zero on failure. */ +{ + return unlink(f); +} + + +int replace(d, s) +char *d, *s; /* destination and source file names */ +/* Replace file *d by file *s, removing the old *s. Return an error code + in the ZE_ class. This function need not preserve the file attributes, + this will be done by setfileattr() later. + */ +{ + struct stat t; /* results of stat() */ +#if defined(CMS_MVS) + /* cmsmvs.h defines FOPW_TEMP as memory(hiperspace). Since memory is + * lost at end of run, always do copy instead of rename. + */ + int copy = 1; +#else + int copy = 0; +#endif + int d_exists; + +#if defined(VMS) || defined(CMS_MVS) + /* stat() is broken on VMS remote files (accessed through Decnet). + * This patch allows creation of remote zip files, but is not sufficient + * to update them or compress remote files */ + unlink(d); +#else /* !(VMS || CMS_MVS) */ + d_exists = (LSTAT(d, &t) == 0); + if (d_exists) + { + /* + * respect existing soft and hard links! + */ + if (t.st_nlink > 1 +# ifdef S_IFLNK + || (t.st_mode & S_IFMT) == S_IFLNK +# endif + ) + copy = 1; + else if (unlink(d)) + return ZE_CREAT; /* Can't erase zip file--give up */ + } +#endif /* ?(VMS || CMS_MVS) */ +#ifndef CMS_MVS + if (!copy) { + if (rename(s, d)) { /* Just move s on top of d */ + copy = 1; /* failed ? */ +#if !defined(VMS) && !defined(ATARI) && !defined(AZTEC_C) +#if !defined(CMS_MVS) && !defined(RISCOS) && !defined(QDOS) + /* For VMS, ATARI, AMIGA Aztec, VM_CMS, MVS, RISCOS, + always assume that failure is EXDEV */ + if (errno != EXDEV +# ifdef THEOS + && errno != EEXIST +# else +# ifdef ENOTSAM + && errno != ENOTSAM /* Used at least on Turbo C */ +# endif +# endif + ) return ZE_CREAT; +#endif /* !CMS_MVS && !RISCOS */ +#endif /* !VMS && !ATARI && !AZTEC_C */ + } + } +#endif /* !CMS_MVS */ + + if (copy) { + FILE *f, *g; /* source and destination files */ + int r; /* temporary variable */ + +#ifdef RISCOS + if (SWI_OS_FSControl_26(s,d,0xA1)!=NULL) { +#endif + + if ((f = fopen(s, FOPR)) == NULL) { + fprintf(stderr," replace: can't open %s\n", s); + return ZE_TEMP; + } + if ((g = fopen(d, FOPW)) == NULL) + { + fclose(f); + return ZE_CREAT; + } + r = fcopy(f, g, (ulg)-1L); + fclose(f); + if (fclose(g) || r != ZE_OK) + { + unlink(d); + return r ? (r == ZE_TEMP ? ZE_WRITE : r) : ZE_WRITE; + } + unlink(s); +#ifdef RISCOS + } +#endif + } + return ZE_OK; +} +#endif /* !MACOS */ + + +int getfileattr(f) +char *f; /* file path */ +/* Return the file attributes for file f or 0 if failure */ +{ +#ifdef __human68k__ + struct _filbuf buf; + + return _dos_files(&buf, f, 0xff) < 0 ? 0x20 : buf.atr; +#else + struct stat s; + + return SSTAT(f, &s) == 0 ? (int) s.st_mode : 0; +#endif +} + + +int setfileattr(f, a) +char *f; /* file path */ +int a; /* attributes returned by getfileattr() */ +/* Give the file f the attributes a, return non-zero on failure */ +{ +#if defined(TOPS20) || defined (CMS_MVS) + return 0; +#else +#ifdef __human68k__ + return _dos_chmod(f, a) < 0 ? -1 : 0; +#else + return chmod(f, a); +#endif +#endif +} + + +char *tempname(zip) +char *zip; /* path name of zip file to generate temp name for */ + +/* Return a temporary file name in its own malloc'ed space, using tempath. */ +{ + char *t = zip; /* malloc'ed space for name (use zip to avoid warning) */ + +#ifdef CMS_MVS + if ((t = malloc(strlen(tempath)+L_tmpnam+2)) == NULL) + return NULL; +# ifdef VM_CMS + tmpnam(t); + /* Remove filemode and replace with tempath, if any. */ + /* Otherwise A-disk is used by default */ + *(strrchr(t, ' ')+1) = '\0'; + if (tempath!=NULL) + strcat(t, tempath); + return t; +# else /* !VM_CMS */ + /* For MVS */ + tmpnam(t); + if (tempath != NULL) + { + int l1 = strlen(t); + char *dot; + if (*t == '\'' && *(t+l1-1) == '\'' && (dot = strchr(t, '.'))) + { + /* MVS and not OE. tmpnam() returns quoted string of 5 qualifiers. + * First is HLQ, rest are timestamps. User can only replace HLQ. + */ + int l2 = strlen(tempath); + if (strchr(tempath, '.') || l2 < 1 || l2 > 8) + ziperr(ZE_PARMS, "On MVS and not OE, tempath (-b) can only be HLQ"); + memmove(t+1+l2, dot, l1+1-(dot-t)); /* shift dot ready for new hlq */ + memcpy(t+1, tempath, l2); /* insert new hlq */ + } + else + { + /* MVS and probably OE. tmpnam() returns filename based on TMPDIR, + * no point in even attempting to change it. User should modify TMPDIR + * instead. + */ + zipwarn("MVS, assumed to be OE, change TMPDIR instead of option -b: ", + tempath); + } + } + return t; +# endif /* !VM_CMS */ +#else /* !CMS_MVS */ +#ifdef TANDEM + char cur_subvol [FILENAME_MAX]; + char temp_subvol [FILENAME_MAX]; + char *zptr; + char *ptr; + char *cptr = &cur_subvol[0]; + char *tptr = &temp_subvol[0]; + short err; + + t = (char *)malloc(NAMELEN); /* malloc here as you cannot free */ + /* tmpnam allocated storage later */ + + zptr = strrchr(zip, TANDEM_DELIMITER); + + if (zptr != NULL) { + /* ZIP file specifies a Subvol so make temp file there so it can just + be renamed at end */ + + *tptr = *cptr = '\0'; + strcat(cptr, getenv("DEFAULTS")); + + strncat(tptr, zip, _min(FILENAME_MAX, (zptr - zip)) ); /* temp subvol */ + strncat(t,zip, _min(NAMELEN, ((zptr - zip) + 1)) ); /* temp stem */ + + err = chvol(tptr); + ptr = t + strlen(t); /* point to end of stem */ + tmpnam(ptr); /* Add filename part to temp subvol */ + err = chvol(cptr); + } + else + t = tmpnam(t); + + return t; + +#else /* !CMS_MVS && !TANDEM */ +/* + * Do something with TMPDIR, TMP, TEMP ???? + */ + if (tempath != NULL) + { + if ((t = malloc(strlen(tempath)+12)) == NULL) + return NULL; + strcpy(t, tempath); +#if (!defined(VMS) && !defined(TOPS20)) +# ifdef MSDOS + { + char c = (char)lastchar(t); + if (c != '/' && c != ':' && c != '\\') + strcat(t, "/"); + } +# else +# ifdef AMIGA + { + char c = (char)lastchar(t); + if (c != '/' && c != ':') + strcat(t, "/"); + } +# else /* !AMIGA */ +# ifdef RISCOS + if (lastchar(t) != '.') + strcat(t, "."); +# else /* !RISCOS */ +# ifdef QDOS + if (lastchar(t) != '_') + strcat(t, "_"); +# else + if (lastchar(t) != '/') + strcat(t, "/"); +# endif /* ?QDOS */ +# endif /* ?RISCOS */ +# endif /* ?AMIGA */ +# endif /* ?MSDOS */ +#endif /* !VMS && !TOPS20 */ + } + else + { + if ((t = malloc(12)) == NULL) + return NULL; + *t = 0; + } +#ifdef NO_MKTEMP + { + char *p = t + strlen(t); + sprintf(p, "%08lx", (ulg)time(NULL)); + return t; + } +#else + strcat(t, "ziXXXXXX"); /* must use lowercase for Linux dos file system */ +#ifdef _WIN32 + return mktemp(t); +#else + int fd = mkstemp(t); + if (fd) { + close(fd); + return t; + } else { + return NULL; + } +#endif /* MKSTEMP */ +#endif /* NO_MKTEMP */ +#endif /* TANDEM */ +#endif /* CMS_MVS */ +} + + +int fcopy(f, g, n) +FILE *f, *g; /* source and destination files */ +ulg n; /* number of bytes to copy or -1 for all */ +/* Copy n bytes from file *f to file *g, or until EOF if n == -1. Return + an error code in the ZE_ class. */ +{ + char *b; /* malloc'ed buffer for copying */ + extent k; /* result of fread() */ + ulg m; /* bytes copied so far */ + + if ((b = malloc(CBSZ)) == NULL) + return ZE_MEM; + m = 0; + while (n == (ulg)(-1L) || m < n) + { + if ((k = fread(b, 1, n == (ulg)(-1) ? + CBSZ : (n - m < CBSZ ? (extent)(n - m) : CBSZ), f)) == 0) + { + if (ferror(f)) + { + free((zvoid *)b); + return ZE_READ; + } + else + break; + } + if (fwrite(b, 1, k, g) != k) + { + free((zvoid *)b); + fprintf(stderr," fcopy: write error\n"); + return ZE_TEMP; + } + m += k; + } + free((zvoid *)b); + return ZE_OK; +} + +#ifdef NO_RENAME +int rename(from, to) +ZCONST char *from; +ZCONST char *to; +{ + unlink(to); + if (link(from, to) == -1) + return -1; + if (unlink(from) == -1) + return -1; + return 0; +} + +#endif /* NO_RENAME */ + + +#ifdef ZMEM + +/************************/ +/* Function memset() */ +/************************/ + +/* + * memset - for systems without it + * bill davidsen - March 1990 + */ + +char * +memset(buf, init, len) +register char *buf; /* buffer loc */ +register int init; /* initializer */ +register unsigned int len; /* length of the buffer */ +{ + char *start; + + start = buf; + while (len--) *(buf++) = init; + return(start); +} + + +/************************/ +/* Function memcpy() */ +/************************/ + +char * +memcpy(dst,src,len) /* v2.0f */ +register char *dst, *src; +register unsigned int len; +{ + char *start; + + start = dst; + while (len--) + *dst++ = *src++; + return(start); +} + + +/************************/ +/* Function memcmp() */ +/************************/ + +int +memcmp(b1,b2,len) /* jpd@usl.edu -- 11/16/90 */ +register char *b1, *b2; +register unsigned int len; +{ + + if (len) do { /* examine each byte (if any) */ + if (*b1++ != *b2++) + return (*((uch *)b1-1) - *((uch *)b2-1)); /* exit when miscompare */ + } while (--len); + + return(0); /* no miscompares, yield 0 result */ +} + +#endif /* ZMEM */ + +const char *BOINC_RCSID_cd0cef87cc = "$Id: z_fileio.c 14563 2008-01-16 04:43:19Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_globals.c boinc-7.0.14+dfsg/zip/zip/z_globals.c --- boinc-7.0.7+dfsg/zip/zip/z_globals.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_globals.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,98 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * globals.c by Mark Adler + */ +#define __GLOBALS_C + +#define GLOBALS /* include definition of errors[] in zip.h */ +#ifndef UTIL +#define UTIL /* do not declare the read_buf variable */ +#endif + +#include "zip.h" + + +/* Handy place to build error messages */ +char errbuf[FNMAX+81]; + +/* Argument processing globals */ +int recurse = 0; /* 1=recurse into directories encountered */ +int dispose = 0; /* 1=remove files after put in zip file */ +int pathput = 1; /* 1=store path with name */ +#ifdef RISCOS +int scanimage = 1; /* 1=scan through image files */ +#endif +int method = BEST; /* one of BEST, DEFLATE (only), or STORE (only) */ +int dosify = 0; /* 1=make new entries look like MSDOS */ +int verbose = 0; /* 1=report oddities in zip file structure */ +int fix = 0; /* 1=fix the zip file */ +int adjust = 0; /* 1=adjust offsets for sfx'd file (keep preamble) */ +int level = 6; /* 0=fastest compression, 9=best compression */ +int translate_eol = 0; /* Translate end-of-line LF -> CR LF */ +#ifdef VMS + int vmsver = 0; /* 1=append VMS version number to file names */ + int vms_native = 0; /* 1=store in VMS format */ +#endif /* VMS */ +#if defined(OS2) || defined(WIN32) + int use_longname_ea = 0; /* 1=use the .LONGNAME EA as the file's name */ +#endif +int hidden_files = 0; /* process hidden and system files */ +int volume_label = 0; /* add volume label */ +int dirnames = 1; /* include directory entries by default */ +int linkput = 0; /* 1=store symbolic links as such */ +int noisy = 1; /* 0=quiet operation */ +int extra_fields = 1; /* 0=do not create extra fields */ +#ifdef WIN32 + int use_privileges = 0; /* 1=use security privilege overrides */ +#endif +#ifndef RISCOS +#ifndef QDOS +#ifndef TANDEM +char *special = ".Z:.zip:.zoo:.arc:.lzh:.arj"; /* List of special suffixes */ +#else /* TANDEM */ +char *special = " Z: zip: zoo: arc: lzh: arj"; /* List of special suffixes */ +#endif +#else /* QDOS */ +char *special = "_Z:_zip:_zoo:_arc:_lzh:_arj"; /* List of special suffixes */ +#endif +#else /* RISCOS */ +char *special = "DDC:D96:68E"; +#endif /* ?RISCOS */ +char *key = NULL; /* Scramble password if scrambling */ +char *tempath = NULL; /* Path for temporary files */ +FILE *mesg; /* stdout by default, stderr for piping */ + +/* Zip file globals */ +char *zipfile; /* New or existing zip archive (zip file) */ +ulg zipbeg; /* Starting offset of zip structures */ +ulg cenbeg; /* Starting offset of central directory */ +struct zlist far *zfiles = NULL; /* Pointer to list of files in zip file */ +extent zcount; /* Number of files in zip file */ +extent zcomlen; /* Length of zip file comment */ +char *zcomment = NULL; /* Zip file comment (not zero-terminated) */ +struct zlist far **zsort; /* List of files sorted by name */ +ulg tempzn; /* Count of bytes written to output zip file */ + +/* Files to operate on that are not in zip file */ +struct flist far *found = NULL; /* List of names found */ +struct flist far * far *fnxt = &found; + /* Where to put next name in found list */ +extent fcount; /* Count of files in list */ + +/* Patterns to be matched */ +struct plist *patterns = NULL; /* List of patterns to be matched */ +unsigned pcount = 0; /* number of patterns */ +unsigned icount = 0; /* number of include only patterns */ + +#ifdef IZ_CHECK_TZ +int zp_tz_is_valid; /* signals "timezone info is available" */ +#endif + +const char *BOINC_RCSID_056e277f7d = "$Id: z_globals.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/zip.c boinc-7.0.14+dfsg/zip/zip/zip.c --- boinc-7.0.7+dfsg/zip/zip/zip.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zip.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,2292 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * zip.c by Mark Adler. + */ +#define __ZIP_C + +#include "zip.h" +#include /* for tzset() declaration */ + +#include + +#ifdef WINDLL +# include +//# include +# include "windll/windll.h" +#endif +#define DEFCPYRT /* main module: enable copyright string defines! */ +#include "revision.h" +//#include "z_crypt.h" +#include "z_ttyio.h" +#ifdef VMS +# include "vms/vmsmunch.h" +#endif + +#ifdef MACOS +# include "macglob.h" + extern MacZipGlobals MacZip; + extern int error_level; +#endif + +#if (defined(MSDOS) && !defined(__GO32__)) || defined(__human68k__) +# include +# if (!defined(P_WAIT) && defined(_P_WAIT)) +# define P_WAIT _P_WAIT +# endif +#endif + + +#define MAXCOM 256 /* Maximum one-line comment size */ + + +/* Local option flags */ +#ifndef DELETE +#define DELETE 0 +#endif +#define ADD 1 +#define UPDATE 2 +#define FRESHEN 3 +local int action = ADD; /* one of ADD, UPDATE, FRESHEN, or DELETE */ +local int comadd = 0; /* 1=add comments for new files */ +local int zipedit = 0; /* 1=edit zip comment and all file comments */ +local int latest = 0; /* 1=set zip file time to time of latest file */ +local ulg before = 0; /* 0=ignore, else exclude files before this time */ +local ulg after = 0; /* 0=ignore, else exclude files newer than this time */ +local int test = 0; /* 1=test zip file with unzip -t */ +local int tempdir = 0; /* 1=use temp directory (-b) */ +local int junk_sfx = 0; /* 1=junk the sfx prefix */ +#if defined(AMIGA) || defined(MACOS) +local int filenotes = 0; /* 1=take comments from AmigaDOS/MACOS filenotes */ +#endif + +#ifdef EBCDIC +int aflag = __EBCDIC; /* Convert EBCDIC to ASCII or stay EBCDIC ? */ +#endif +#ifdef CMS_MVS +int bflag = 0; /* Use text mode as default */ +#endif + +#ifdef QDOS +char _version[] = VERSION; +#endif + +//#ifdef WINDLL +jmp_buf zipdll_error_return; +//#endif + +/* Temporary zip file name and file pointer */ +#ifndef MACOS +local char *tempzip; +local FILE *tempzf; +#else +char *tempzip; +FILE *tempzf; +#endif + +#if CRYPT +/* Pointer to crc_table, needed in crypt.c */ +# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) +ZCONST ulg near *crc_32_tab; +# else +ZCONST uLongf *crc_32_tab; +# endif +#endif /* CRYPT */ + +/* Local functions */ + +local void freeup OF((void)); +local int finish OF((int)); +#if (!defined(MACOS) && !defined(WINDLL)) +local void handler OF((int)); +local void license OF((void)); +#ifndef VMSCLI +local void help OF((void)); +#endif /* !VMSCLI */ +#endif /* !MACOS && !WINDLL */ +local int get_filters OF((int argc, char **argv)); +#if (!defined(MACOS) && !defined(WINDLL)) +local void check_zipfile OF((char *zipname, char *zippath)); +local void version_info OF((void)); +local void zipstdout OF((void)); +#endif /* !MACOS && !WINDLL */ + +local void freeup() +/* Free all allocations in the 'found' list, the 'zfiles' list and + the 'patterns' list. */ +{ + struct flist far *f; /* steps through found list */ + struct zlist far *z; /* pointer to next entry in zfiles list */ + + for (f = found; f != NULL; f = fexpel(f)) + ; + while (zfiles != NULL) + { + z = zfiles->nxt; + if (zfiles->zname && zfiles->zname != zfiles->name) + free((zvoid *)(zfiles->zname)); + if (zfiles->name) + free((zvoid *)(zfiles->name)); + if (zfiles->iname) + free((zvoid *)(zfiles->iname)); + if (zfiles->cext && zfiles->cextra && zfiles->cextra != zfiles->extra) + free((zvoid *)(zfiles->cextra)); + if (zfiles->ext && zfiles->extra) + free((zvoid *)(zfiles->extra)); + if (zfiles->com && zfiles->comment) + free((zvoid *)(zfiles->comment)); + farfree((zvoid far *)zfiles); + zfiles = z; + zcount--; + } + + if (patterns != NULL) { + while (pcount-- > 0) { + if (patterns[pcount].zname != NULL) + free((zvoid *)(patterns[pcount].zname)); + } + free((zvoid *)patterns); + patterns = NULL; + } +} + +local int finish(e) +int e; /* exit code */ +/* Process -o and -m options (if specified), free up malloc'ed stuff, and + exit with the code e. */ +{ + int r; /* return value from trash() */ + ulg t; /* latest time in zip file */ + struct zlist far *z; /* pointer into zfile list */ + + /* If latest, set time to zip file to latest file in zip file */ + if (latest && zipfile && strcmp(zipfile, "-")) + { + diag("changing time of zip file to time of latest file in it"); + /* find latest time in zip file */ + if (zfiles == NULL) + zipwarn("zip file is empty, can't make it as old as latest entry", ""); + else { + t = 0; + for (z = zfiles; z != NULL; z = z->nxt) + /* Ignore directories in time comparisons */ +#ifdef USE_EF_UT_TIME + if (z->iname[z->nam-1] != (char)0x2f) /* ascii '/' */ + { + iztimes z_utim; + ulg z_tim; + + z_tim = ((get_ef_ut_ztime(z, &z_utim) & EB_UT_FL_MTIME) ? + unix2dostime(&z_utim.mtime) : z->tim); + if (t < z_tim) + t = z_tim; + } +#else /* !USE_EF_UT_TIME */ + if (z->iname[z->nam-1] != (char)0x2f /* ascii '/' */ + && t < z->tim) + t = z->tim; +#endif /* ?USE_EF_UT_TIME */ + /* set modified time of zip file to that time */ + if (t != 0) + stamp(zipfile, t); + else + zipwarn( + "zip file has only directories, can't make it as old as latest entry", + ""); + } + } + if (tempath != NULL) + { + free((zvoid *)tempath); + tempath = NULL; + } + if (zipfile != NULL) + { + free((zvoid *)zipfile); + zipfile = NULL; + } + if (zcomment != NULL) + { + free((zvoid *)zcomment); + zcomment = NULL; + } + + + /* If dispose, delete all files in the zfiles list that are marked */ + if (dispose) + { + diag("deleting files that were added to zip file"); + if ((r = trash()) != ZE_OK) + ZIPERR(r, "was deleting moved files and directories"); + } + + + /* Done! */ + freeup(); + return e; +} + +int ziperr(c, h) +int c; /* error code from the ZE_ class */ +char *h; /* message about how it happened */ +/* Issue a message for the error, clean up files and memory, and exit. */ +{ +#ifndef WINDLL +#ifndef MACOS + static int error_level = 0; +#endif + + if (error_level++ > 0) + return 0; /* avoid recursive ziperr() */ +#endif /* !WINDLL */ + + if (h != NULL) { + if (PERR(c)) + perror("zip I/O error"); + fflush(mesg); + fprintf(stderr, "\nzip error: %s (%s)\n", errors[c-1], h); + } + if (tempzip != NULL) + { + if (tempzip != zipfile) { + if (tempzf != NULL) + fclose(tempzf); +#ifndef DEBUG + destroy(tempzip); +#endif + free((zvoid *)tempzip); + } else { + /* -g option, attempt to restore the old file */ + int k = 0; /* keep count for end header */ + ulg cb = cenbeg; /* get start of central */ + struct zlist far *z; /* steps through zfiles linked list */ + + fprintf(stderr, "attempting to restore %s to its previous state\n", + zipfile); + fseek(tempzf, cenbeg, SEEK_SET); + tempzn = cenbeg; + for (z = zfiles; z != NULL; z = z->nxt) + { + putcentral(z, tempzf); + tempzn += 4 + CENHEAD + z->nam + z->cext + z->com; + k++; + } + putend(k, tempzn - cb, cb, zcomlen, zcomment, tempzf); + fclose(tempzf); + tempzf = NULL; + } + } + if (key != NULL) { + free((zvoid *)key); + key = NULL; + } + if (tempath != NULL) { + free((zvoid *)tempath); + tempath = NULL; + } + if (zipfile != NULL) { + free((zvoid *)zipfile); + zipfile = NULL; + } + if (zcomment != NULL) { + free((zvoid *)zcomment); + zcomment = NULL; + } + freeup(); +//#ifndef WINDLL +// EXIT(c); +//#else + //return c; /* avoid recursive ziperr() */ + longjmp(zipdll_error_return, c); +//#endif +} + + +void error(h) + char *h; +/* Internal error, should never happen */ +{ + ziperr(ZE_LOGIC, h); +} + +#if (!defined(MACOS) && !defined(WINDLL)) +local void handler(s) +int s; /* signal number (ignored) */ +/* Upon getting a user interrupt, turn echo back on for tty and abort + cleanly using ziperr(). */ +{ +#if defined(AMIGA) && defined(__SASC) + _abort(); +#else +#if !defined(MSDOS) && !defined(__human68k__) && !defined(RISCOS) + echon(); + putc('\n', stderr); +#endif /* !MSDOS */ +#endif /* AMIGA && __SASC */ + ziperr(ZE_ABORT, "aborting"); + s++; /* keep some compilers happy */ +} +#endif /* !MACOS && !WINDLL */ + +void zipwarn(a, b) +char *a, *b; /* message strings juxtaposed in output */ +/* Print a warning message to stderr and return. */ +{ + if (noisy) fprintf(stderr, "\tzip warning: %s%s\n", a, b); +} + +#ifndef WINDLL +local void license() +/* Print license information to stdout. */ +{ + extent i; /* counter for copyright array */ + +#if 0 + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) { + printf(copyright[i], "zip"); + putchar('\n'); + } +#endif + for (i = 0; i < sizeof(swlicense)/sizeof(char *); i++) + puts(swlicense[i]); +} + +#ifdef VMSCLI +void help() +#else +local void help() +#endif +/* Print help (along with license info) to stdout. */ +{ + extent i; /* counter for help array */ + + /* help array */ + static ZCONST char *text[] = { +#ifdef VMS +"Zip %s (%s). Usage: zip==\"$disk:[dir]zip.exe\"", +#else +"Zip %s (%s). Usage:", +#endif +#ifdef MACOS +"zip [-options] [-b fm] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]", +" The default action is to add or replace zipfile entries from list.", +" ", +" -f freshen: only changed files -u update: only changed or new files", +" -d delete entries in zipfile -m move into zipfile (delete files)", +" -r recurse into directories -j junk (don't record) directory names", +" -0 store only -l convert LF to CR LF (-ll CR LF to LF)", +" -1 compress faster -9 compress better", +" -q quiet operation -v verbose operation/print version info", +" -c add one-line comments -z add zipfile comment", +" -o make zipfile as old as latest entry", +" -F fix zipfile (-FF try harder) -D do not add directory entries", +" -T test zipfile integrity -X eXclude eXtra file attributes", +# if CRYPT +" -e encrypt -n don't compress these suffixes" +# else +" -h show this help -n don't compress these suffixes" +# endif +," ", +" Macintosh specific:", +" -jj record Fullpath (+ Volname) -N store finder-comments as comments", +" -df zip only datafork of a file -S include finder invisible/system files" +#else /* !MACOS */ +#ifdef VM_CMS +"zip [-options] [-b fm] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]", +#else /* !VM_CMS */ +"zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]", +#endif /* ?VM_CMS */ +" The default action is to add or replace zipfile entries from list, which", +" can include the special name - to compress standard input.", +" If zipfile and list are omitted, zip compresses stdin to stdout.", +" -f freshen: only changed files -u update: only changed or new files", +" -d delete entries in zipfile -m move into zipfile (delete files)", +" -r recurse into directories -j junk (don't record) directory names", +#ifdef THEOS +" -0 store only -l convert CR to CR LF (-ll CR LF to CR)", +#else +" -0 store only -l convert LF to CR LF (-ll CR LF to LF)", +#endif +" -1 compress faster -9 compress better", +" -q quiet operation -v verbose operation/print version info", +" -c add one-line comments -z add zipfile comment", +" -@ read names from stdin -o make zipfile as old as latest entry", +" -x exclude the following names -i include only the following names", +#ifdef EBCDIC +#ifdef CMS_MVS +" -a translate to ASCII -B force binary read (text is default)", +#else /* !CMS_MVS */ +" -a translate to ASCII", +#endif /* ?CMS_MVS */ +#endif /* EBCDIC */ +#ifdef TANDEM +" -Bn set Enscribe formatting options", +#endif +#ifdef VMS +" \"-F\" fix zipfile(\"-FF\" try harder) \"-D\" do not add directory entries", +" \"-A\" adjust self-extracting exe \"-J\" junk zipfile prefix (unzipsfx)", +" \"-T\" test zipfile integrity \"-X\" eXclude eXtra file attributes", +" \"-V\" save VMS file attributes -w append version number to stored name", +#else /* !VMS */ +" -F fix zipfile (-FF try harder) -D do not add directory entries", +" -A adjust self-extracting exe -J junk zipfile prefix (unzipsfx)", +" -T test zipfile integrity -X eXclude eXtra file attributes", +#endif /* ?VMS */ +#ifdef WIN32 +" -! use privileges (if granted) to obtain all aspects of WinNT security", +#endif /* WIN32 */ +#ifdef OS2 +" -E use the .LONGNAME Extended attribute (if found) as filename", +#endif /* OS2 */ +#ifdef S_IFLNK +" -y store symbolic links as the link instead of the referenced file", +#endif /* !S_IFLNK */ +" -R PKZIP recursion (see manual)", +#if defined(MSDOS) || defined(OS2) +" -$ include volume label -S include system and hidden files", +#endif +#ifdef AMIGA +# if CRYPT +" -N store filenotes as comments -e encrypt", +" -h show this help -n don't compress these suffixes" +# else +" -N store filenotes as comments -n don't compress these suffixes" +# endif +#else /* !AMIGA */ +# if CRYPT +" -e encrypt -n don't compress these suffixes" +# else +" -h show this help -n don't compress these suffixes" +# endif +#endif /* ?AMIGA */ +#ifdef RISCOS +," -I don't scan through Image files" +#endif +#endif /* ?MACOS */ + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) + { + printf(copyright[i], "zip"); + putchar('\n'); + } + for (i = 0; i < sizeof(text)/sizeof(char *); i++) + { + printf(text[i], VERSION, REVDATE); + putchar('\n'); + } +} + +/* + * XXX version_info() in a separate file + */ +local void version_info() +/* Print verbose info about program version and compile time options + to stdout. */ +{ + extent i; /* counter in text arrays */ + char *envptr; + + /* Options info array */ + static ZCONST char *comp_opts[] = { +#ifdef ASM_CRC + "ASM_CRC", +#endif +#ifdef ASMV + "ASMV", +#endif +#ifdef DYN_ALLOC + "DYN_ALLOC", +#endif +#ifdef MMAP + "MMAP", +#endif +#ifdef BIG_MEM + "BIG_MEM", +#endif +#ifdef MEDIUM_MEM + "MEDIUM_MEM", +#endif +#ifdef SMALL_MEM + "SMALL_MEM", +#endif +#ifdef DEBUG + "DEBUG", +#endif +#ifdef USE_EF_UT_TIME + "USE_EF_UT_TIME", +#endif +#ifdef NTSD_EAS + "NTSD_EAS", +#endif +#ifdef VMS +#ifdef VMSCLI + "VMSCLI", +#endif +#ifdef VMS_IM_EXTRA + "VMS_IM_EXTRA", +#endif +#ifdef VMS_PK_EXTRA + "VMS_PK_EXTRA", +#endif +#endif /* VMS */ +#ifdef WILD_STOP_AT_DIR + "WILD_STOP_AT_DIR", +#endif +#ifdef USE_ZLIB + "USE_ZLIB", +#endif +#if CRYPT && defined(PASSWD_FROM_STDIN) + "PASSWD_FROM_STDIN", +#endif /* CRYPT & PASSWD_FROM_STDIN */ + NULL + }; + + static ZCONST char *zipenv_names[] = { +#ifndef VMS +# ifndef RISCOS + "ZIP" +# else /* RISCOS */ + "Zip$Options" +# endif /* ?RISCOS */ +#else /* VMS */ + "ZIP_OPTS" +#endif /* ?VMS */ + ,"ZIPOPT" +#ifdef AZTEC_C + , /* extremely lame compiler bug workaround */ +#endif +#ifndef __RSXNT__ +# ifdef __EMX__ + ,"EMX" + ,"EMXOPT" +# endif +# if (defined(__GO32__) && (!defined(__DJGPP__) || __DJGPP__ < 2)) + ,"GO32" + ,"GO32TMP" +# endif +# if (defined(__DJGPP__) && __DJGPP__ >= 2) + ,"TMPDIR" +# endif +#endif /* !__RSXNT__ */ +#ifdef RISCOS + ,"Zip$Exts" +#endif + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) + { + printf(copyright[i], "zip"); + putchar('\n'); + } + + for (i = 0; i < sizeof(versinfolines)/sizeof(char *); i++) + { + printf(versinfolines[i], "Zip", VERSION, REVDATE); + putchar('\n'); + } + + version_local(); + + puts("Zip special compilation options:"); +#if WSIZE != 0x8000 + printf("\tWSIZE=%u\n", WSIZE); +#endif + for (i = 0; (int)i < (int)(sizeof(comp_opts)/sizeof(char *) - 1); i++) + { + printf("\t%s\n",comp_opts[i]); + } +#if CRYPT + printf("\t[encryption, version %d.%d%s of %s]\n", + CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE); + ++i; +#endif /* CRYPT */ + if (i == 0) + puts("\t[none]"); + + puts("\nZip environment options:"); + for (i = 0; i < sizeof(zipenv_names)/sizeof(char *); i++) + { + envptr = getenv(zipenv_names[i]); + printf("%16s: %s\n", zipenv_names[i], + ((envptr == (char *)NULL || *envptr == 0) ? "[none]" : envptr)); + } +} +#endif /* !WINDLL */ + + +#ifndef PROCNAME +# define PROCNAME(n) procname(n, (action == DELETE || action == FRESHEN)) +#endif /* PROCNAME */ + +#ifndef WINDLL +#ifndef MACOS +local void zipstdout() +/* setup for writing zip file on stdout */ +{ + int r; + mesg = stderr; + if (isatty(1)) + ziperr(ZE_PARMS, "cannot write zip file to terminal"); + if ((zipfile = malloc(4)) == NULL) + ziperr(ZE_MEM, "was processing arguments"); + strcpy(zipfile, "-"); + if ((r = readzipfile()) != ZE_OK) + ziperr(r, zipfile); +} +#endif /* !MACOS */ + +local void check_zipfile(zipname, zippath) + char *zipname; + char *zippath; + /* Invoke unzip -t on the given zip file */ +{ +#if (defined(MSDOS) && !defined(__GO32__)) || defined(__human68k__) + int status, len; + char *path, *p; + + status = spawnlp(P_WAIT, "unzip", "unzip", verbose ? "-t" : "-tqq", + zipname, NULL); +#ifdef __human68k__ + if (status == -1) + perror("unzip"); +#else +/* + * unzip isn't in PATH range, assume an absolute path to zip in argv[0] + * and hope that unzip is in the same directory. + */ + if (status == -1) { + p = MBSRCHR(zippath, '\\'); + path = MBSRCHR((p == NULL ? zippath : p), '/'); + if (path != NULL) + p = path; + if (p != NULL) { + len = (int)(p - zippath) + 1; + if ((path = malloc(len + sizeof("unzip.exe"))) == NULL) + ziperr(ZE_MEM, "was creating unzip path"); + memcpy(path, zippath, len); + strcpy(&path[len], "unzip.exe"); + status = spawnlp(P_WAIT, path, "unzip", verbose ? "-t" : "-tqq", + zipname, NULL); + free(path); + } + if (status == -1) + perror("unzip"); + } +#endif /* ?__human68k__ */ + if (status != 0) { +#else /* (MSDOS && !__GO32__) || __human68k__ */ + char cmd[FNMAX+16]; + + /* Tell picky compilers to shut up about unused variables */ + zippath = zippath; + + strcpy(cmd, "unzip -t "); +#ifdef QDOS + strcat(cmd, "-Q4 "); +#endif + if (!verbose) strcat(cmd, "-qq "); + if ((int)strlen(zipname) > FNMAX) { + error("zip filename too long"); + } +# ifdef UNIX + strcat(cmd, "'"); /* accept space or $ in name */ + strcat(cmd, zipname); + strcat(cmd, "'"); +# else + strcat(cmd, zipname); +# endif +# ifdef VMS + if (!system(cmd)) { +# else + if (system(cmd)) { +# endif +#endif /* ?((MSDOS && !__GO32__) || __human68k__) */ + fprintf(mesg, "test of %s FAILED\n", zipfile); + ziperr(ZE_TEST, "original files unmodified"); + } + if (noisy) + fprintf(mesg, "test of %s OK\n", zipfile); +} +#endif /* !WINDLL */ + +local int get_filters(argc, argv) + int argc; /* number of tokens in command line */ + char **argv; /* command line tokens */ +/* Counts number of -i or -x patterns, sets patterns and pcount */ + { + int i; + int flag = 0, archive_seen = 0; + char *iname, *p = NULL; + FILE *fp; + + pcount = 0; + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + p = argv[i]; + while (*(++p) != '\0') { + if (*p == 'i' || *p == 'x') + break; + } + if (*p != '\0') { + flag = *p; + p = p[1] == '@' ? p + 2 : NULL; + if (p != NULL && patterns == NULL) { + fp = fopen(p, "r"); + if (fp == NULL) { + ZIPERR(ZE_OPEN, p); + } + while (fgets(errbuf, FNMAX, fp) != NULL) + pcount++; + fclose(fp); + } + } else if (MBSRCHR(argv[i], 'R') != NULL) { + p = NULL; + flag = 'R'; + } else if (flag != 'R') { + flag = 0; + } + } + if (flag && (archive_seen || p != NULL)) { + if (patterns != NULL) { + if (p != NULL) { + fp = fopen(p, "r"); + if (fp == NULL) { + ZIPERR(ZE_OPEN, p); + } + while ((p = getnam(errbuf, fp)) != NULL) { + iname = ex2in(p, 0, (int *)NULL); + if (iname != NULL) { + patterns[pcount].zname = in2ex(iname); + free(iname); + } else { + patterns[pcount].zname = NULL; + } + patterns[pcount].select = flag; + if (flag != 'x') + icount++; + pcount++; + } + fclose(fp); + flag = 0; + p = NULL; + } + else if (argv[i][0] != '-') { + iname = ex2in(argv[i], 0, (int *)NULL); + patterns[pcount].zname = (iname != NULL ? in2ex(iname) : NULL); + if (iname != NULL) + free(iname); + patterns[pcount].select = flag; + if (flag != 'x') + icount++; + pcount++; + } + } + else if (p == NULL) + pcount++; + else + flag = 0; + } else { + if (flag != 'R') + flag = 0; /* only 'R' is allowed before zipfile arg */ + archive_seen = 1; /* first non-flag arg is archive name */ + } + } + if (pcount == 0 || patterns != NULL) return ZE_OK; + patterns = (struct plist*) malloc(pcount * sizeof(struct plist)); + if (patterns == NULL) { + ZIPERR(ZE_MEM, "was creating pattern list"); + } + return get_filters(argc, argv); +} + +#if CRYPT +#ifndef WINDLL +int encr_passwd(modeflag, pwbuf, size, zfn) +int modeflag; +char *pwbuf; +int size; +ZCONST char *zfn; +{ + char *prompt; + + /* Tell picky compilers to shut up about unused variables */ + zfn = zfn; + + prompt = (modeflag == ZP_PW_VERIFY) ? + "Verify password: " : "Enter password: "; + + if (getp(prompt, pwbuf, size) == NULL) { + ziperr(ZE_PARMS, "stderr is not a tty"); + } + return IZ_PW_ENTERED; +} +#endif /* !WINDLL */ +#else /* !CRYPT */ +int encr_passwd(modeflag, pwbuf, size, zfn) +int modeflag; +char *pwbuf; +int size; +ZCONST char *zfn; +{ + /* Tell picky compilers to shut up about unused variables */ + modeflag = modeflag; pwbuf = pwbuf; size = size; zfn = zfn; + + return ZE_LOGIC; /* This function should never be called! */ +} +#endif /* CRYPT */ + +//#ifndef USE_ZIPMAIN +//int main(argc, argv) +//#else +int zip_main(int argc, char** argv) +/* Add, update, freshen, or delete zip entries in a zip file. See the + command help in help() above. */ +{ + int a; /* attributes of zip file */ + ulg c; /* start of central directory */ + int d; /* true if just adding to a zip file */ + char *e; /* malloc'd comment buffer */ + struct flist far *f; /* steps through found linked list */ + int i; /* arg counter, root directory flag */ + int k; /* next argument type, marked counter, + comment size, entry count */ + ulg n; /* total of entry len's */ + int o; /* true if there were any ZE_OPEN errors */ + char *p; /* steps through option arguments */ + char *pp; /* temporary pointer */ + ulg *cmptime = NULL; /* pointer to 'before' or 'after' */ + int r; /* temporary variable */ + int s; /* flag to read names from stdin */ + ulg t; /* file time, length of central directory */ + int first_listarg = 0;/* index of first arg of "process these files" list */ + struct zlist far *v; /* temporary variable */ + struct zlist far * far *w; /* pointer to last link in zfiles list */ + FILE *x, *y; /* input and output zip files */ + struct zlist far *z; /* steps through zfiles linked list */ +//#ifdef WINDLL + int retcode; /* return code for dll */ +//#endif +#if (!defined(VMS) && !defined(CMS_MVS)) + char *zipbuf; /* stdio buffer for the zip file */ +#endif /* !VMS && !CMS_MVS */ + FILE *comment_stream; /* set to stderr if anything is read from stdin */ + +#ifdef THEOS + /* the argument expansion from the standard library is full of bugs */ + /* use mine instead */ + _setargv(&argc, &argv); + setlocale(LC_CTYPE,"I"); +#else + SETLOCALE(LC_CTYPE,""); +#endif + +#if defined(__IBMC__) && defined(__DEBUG_ALLOC__) + { + extern void DebugMalloc(void); + atexit(DebugMalloc); + } +#endif +#ifdef QDOS + { + extern void QDOSexit(void); + atexit(QDOSexit); + } +#endif + +#ifdef RISCOS + set_prefix(); +#endif + +#ifdef __human68k__ + fflush(stderr); + setbuf(stderr, NULL); +#endif + +/* Re-initialize global variables to make the zip dll re-entrant. It is + * possible that we could get away with not re-initializing all of these + * but better safe than sorry. + */ +//#ifndef MACOS // should work on MACOSX which is all we need + retcode = setjmp(zipdll_error_return); + if (retcode) { + return retcode; + } +//#endif /* !MACOS */ +//#if defined(MACOS) || defined(WINDLL) + action = ADD; /* one of ADD, UPDATE, FRESHEN, or DELETE */ + comadd = 0; /* 1=add comments for new files */ + zipedit = 0; /* 1=edit zip comment and all file comments */ + latest = 0; /* 1=set zip file time to time of latest file */ + before = 0; /* 0=ignore, else exclude files before this time */ + after = 0; /* 0=ignore, else exclude files newer than this time */ + test = 0; /* 1=test zip file with unzip -t */ + tempdir = 0; /* 1=use temp directory (-b) */ + junk_sfx = 0; /* 1=junk the sfx prefix */ +#if defined(AMIGA) || defined(MACOS) + filenotes = 0;/* 1=take comments from AmigaDOS/MACOS filenotes */ +#endif + //zipstate = -1; + tempzip = NULL; + fcount = 0; + recurse = 0; /* 1=recurse into directories; 2=match filenames */ + dispose = 0; /* 1=remove files after put in zip file */ + pathput = 1; /* 1=store path with name */ + method = BEST; /* one of BEST, DEFLATE (only), or STORE (only) */ + dosify = 0; /* 1=make new entries look like MSDOS */ + verbose = 0; /* 1=report oddities in zip file structure */ + fix = 0; /* 1=fix the zip file */ + adjust = 0; /* 1=adjust offsets for sfx'd file (keep preamble) */ + level = 6; /* 0=fastest compression, 9=best compression */ + translate_eol = 0; /* Translate end-of-line LF -> CR LF */ +#ifdef WIN32 + use_longname_ea = 0; /* 1=use the .LONGNAME EA as the file's name */ + use_privileges = 0; /* 1=use security privileges overrides */ +#endif + hidden_files = 0; /* process hidden and system files */ + volume_label = 0; /* add volume label */ + dirnames = 1; /* include directory entries by default */ + linkput = 0; /* 1=store symbolic links as such */ + noisy = 1; /* 0=quiet operation */ + extra_fields = 1; /* 0=do not create extra fields */ + special = ".Z:.zip:.zoo:.arc:.lzh:.arj"; /* List of special suffixes */ + key = NULL; /* Scramble password if scrambling */ + tempath = NULL; /* Path for temporary files */ + found = NULL; /* where in found, or new found entry */ + fnxt = &found; + patterns = NULL; /* List of patterns to be matched */ + pcount = 0; /* number of patterns */ + icount = 0; /* number of include only patterns */ + +//#endif /* MACOS || WINDLL */ + + mesg = (FILE *) stdout; /* cannot be made at link time for VMS */ + comment_stream = (FILE *)stdin; + + init_upper(); /* build case map table */ + +#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) +# ifndef VALID_TIMEZONE +# define VALID_TIMEZONE(tmp) \ + (((tmp = getenv("TZ")) != NULL) && (*tmp != '\0')) +# endif + zp_tz_is_valid = VALID_TIMEZONE(p); +#if (defined(AMIGA) || defined(DOS)) + if (!zp_tz_is_valid) + extra_fields = 0; /* disable storing "UT" time stamps */ +#endif /* AMIGA || DOS */ +#endif /* IZ_CHECK_TZ && USE_EF_UT_TIME */ + +/* For systems that do not have tzset() but supply this function using another + name (_tzset() or something similar), an appropiate "#define tzset ..." + should be added to the system specifc configuration section. */ +#if (!defined(TOPS20) && !defined(VMS)) +#if (!defined(RISCOS) && !defined(MACOS) && !defined(QDOS)) +#if (!defined(BSD) && !defined(MTS) && !defined(CMS_MVS) && !defined(TANDEM)) + tzset(); +#endif +#endif +#endif + +#ifdef VMSCLI + { + ulg status = vms_zip_cmdline(&argc, &argv); + if (!(status & 1)) + return status; + } +#endif /* VMSCLI */ + + /* extract extended argument list from environment */ + expand_args(&argc, &argv); + +//printf("\nArgs = %s %s %s %s\n", argv[0], argv[1], argv[2], argv[3]); + +#ifndef WINDLL + /* Process arguments */ + diag("processing arguments"); + /* First, check if just the help or version screen should be displayed */ + if (isatty(1)) { /* output screen is available */ + if (argc == 1) + { /* show help screen */ +#ifdef VMSCLI + VMSCLI_help(); +#else + help(); +#endif + EXIT(0, ""); + } + else if (argc == 2 && strcmp(argv[1], "-v") == 0) + { /* show diagnostic version info */ + version_info(); + EXIT(0, ""); + } + } +#ifndef VMS +# ifndef RISCOS + envargs(&argc, &argv, "ZIPOPT", "ZIP"); /* get options from environment */ +# else /* RISCOS */ + envargs(&argc, &argv, "ZIPOPT", "Zip$Options"); /* get options from environment */ + getRISCOSexts("Zip$Exts"); /* get the extensions to swap from environment */ +# endif /* ? RISCOS */ +#else /* VMS */ + envargs(&argc, &argv, "ZIPOPT", "ZIP_OPTS"); /* 4th arg for unzip compat. */ +#endif /* ?VMS */ +#endif /* !WINDLL */ + + zipfile = tempzip = NULL; + tempzf = NULL; + d = 0; /* disallow adding to a zip file */ + k = 0; /* Next non-option argument type */ + s = 0; /* set by -@ if -@ is early */ + + r = get_filters(argc, argv); /* scan first the -x and -i patterns */ +#ifdef WINDLL + if (r != ZE_OK) + return r; +#endif + + for (i = 1; i < argc; i++) + { + if (argv[i][0] == '-') + { + if (argv[i][1]) + for (p = argv[i]+1; *p; p++) + switch (*p) + { +#ifdef EBCDIC + case 'a': + aflag = ASCII; + printf("Translating to ASCII...\n"); + break; +#endif /* EBCDIC */ +#ifdef CMS_MVS + case 'B': + bflag = 1; + printf("Using binary mode...\n"); + break; +#endif /* CMS_MVS */ +#ifdef TANDEM + case 'B': + nskformatopt(&p); + break; +#endif + case '0': + method = STORE; level = 0; break; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + /* Set the compression efficacy */ + level = *p - '0'; break; + case 'A': /* Adjust unzipsfx'd zipfile: adjust offsets only */ + adjust = 1; break; + case 'b': /* Specify path for temporary file */ + tempdir = 1; + if (k != 0) { + ZIPERR(ZE_PARMS, "use -b before zip file name"); + } + else + k = 1; /* Next non-option is path */ + break; + case 'c': /* Add comments for new files in zip file */ + comadd = 1; break; + case 'd': /* Delete files from zip file */ +#ifdef MACOS + if (p[1] == 'f') { + ++p; + MacZip.DataForkOnly = true; + } else +#endif /* MACOS */ + { + if (action != ADD) { + ZIPERR(ZE_PARMS, "specify just one action"); + } + action = DELETE; + break; + } + case 'D': /* Do not add directory entries */ + dirnames = 0; break; + case 'e': /* Encrypt */ +#if !CRYPT + ZIPERR(ZE_PARMS, "encryption not supported"); +#else /* CRYPT */ + if (key == NULL) { + if ((key = malloc(IZ_PWLEN+1)) == NULL) { + ZIPERR(ZE_MEM, "was getting encryption password"); + } + r = encr_passwd(ZP_PW_ENTER, key, IZ_PWLEN+1, zipfile); + if (r != IZ_PW_ENTERED) { + if (r < IZ_PW_ENTERED) + r = ZE_PARMS; + ZIPERR(r, "was getting encryption password"); + } + if (*key == '\0') { + ZIPERR(ZE_PARMS, "zero length password not allowed"); + } + if ((e = malloc(IZ_PWLEN+1)) == NULL) { + ZIPERR(ZE_MEM, "was verifying encryption password"); + } + r = encr_passwd(ZP_PW_VERIFY, e, IZ_PWLEN+1, zipfile); + if (r != IZ_PW_ENTERED && r != IZ_PW_SKIPVERIFY) { + free((zvoid *)e); + if (r < ZE_OK) r = ZE_PARMS; + ZIPERR(r, "was verifying encryption password"); + } + r = ((r == IZ_PW_SKIPVERIFY) ? 0 : strcmp(key, e)); + free((zvoid *)e); + if (r) { + ZIPERR(ZE_PARMS, "password verification failed"); + } + } +#endif /* !CRYPT */ + break; + case 'F': /* fix the zip file */ + fix++; break; + case 'f': /* Freshen zip file--overwrite only */ + if (action != ADD) { + ZIPERR(ZE_PARMS, "specify just one action"); + } + action = FRESHEN; + break; + case 'g': /* Allow appending to a zip file */ + d = 1; break; +#ifndef WINDLL + case 'h': case 'H': case '?': /* Help */ +#ifdef VMSCLI + VMSCLI_help(); +#else + help(); +#endif + RETURN(finish(ZE_OK)); +#endif /* !WINDLL */ + +#ifdef RISCOS + case 'I': /* Don't scan through Image files */ + scanimage = 0; + break; +#endif +#ifdef MACOS + case 'j': /* Junk path / Store absolute path */ + if (p[1] == 'j') { /* store absolute path including volname */ + ++p; + MacZip.StoreFullPath = true; + } else { /* junk directory names */ + pathput = 0; break; + } +#else /* !MACOS */ + case 'j': /* Junk directory names */ + pathput = 0; break; +#endif /* ?MACOS */ + case 'J': /* Junk sfx prefix */ + junk_sfx = 1; break; + case 'k': /* Make entries using DOS names (k for Katz) */ + dosify = 1; break; + case 'l': /* Translate end-of-line */ + translate_eol++; break; +#ifndef WINDLL + case 'L': /* Show license */ + license(); + RETURN(finish(ZE_OK)); +#endif + case 'm': /* Delete files added or updated in zip file */ + dispose = 1; break; + case 'n': /* Don't compress files with a special suffix */ + special = NULL; /* will be set at next argument */ + break; +#if defined(AMIGA) || defined(MACOS) + case 'N': /* Get zipfile comments from AmigaDOS/MACOS filenotes */ + filenotes = 1; break; +#endif + case 'o': /* Set zip file time to time of latest file in it */ + latest = 1; break; + case 'p': /* Store path with name */ + break; /* (do nothing as annoyance avoidance) */ + case 'P': /* password for encryption */ + if (k != 0) { + ZIPERR(ZE_PARMS, "use -P before zip file name"); + } + if (key != NULL) { + ZIPERR(ZE_PARMS, "can only have one -P"); + } +#if CRYPT + k = 7; +#else + ZIPERR(ZE_PARMS, "encryption not supported"); +#endif /* CRYPT */ + break; +#if defined(QDOS) || defined(QLZIP) + case 'Q': + qlflag = strtol((p+1), &p, 10); + if (qlflag == 0) qlflag = 4; + p--; + break; +#endif + case 'q': /* Quiet operation */ + noisy = 0; +#ifdef MACOS + MacZip.MacZip_Noisy = false; +#endif /* MACOS */ + if (verbose) verbose--; + break; + case 'r': /* Recurse into subdirectories, match full path */ + if (recurse == 2) { + ZIPERR(ZE_PARMS, "do not specify both -r and -R"); + } + recurse = 1; break; + case 'R': /* Recurse into subdirectories, match filename */ + if (recurse == 1) { + ZIPERR(ZE_PARMS, "do not specify both -r and -R"); + } + recurse = 2; break; +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(ATARI) + case 'S': + hidden_files = 1; break; +#endif /* MSDOS || OS2 || WIN32 || ATARI */ +#ifdef MACOS + case 'S': + MacZip.IncludeInvisible = true; break; +#endif /* MACOS */ + case 't': /* Exclude files earlier than specified date */ + if (p[1] == 't') { + ++p; + cmptime = &after; + } else { + cmptime = &before; + } + if (*cmptime) { + ZIPERR(ZE_PARMS, (cmptime == &after ? + "can only have one -tt" : "can only have one -t")); + } + k = 2; break; + case 'T': /* test zip file */ + test = 1; break; + case 'u': /* Update zip file--overwrite only if newer */ + if (action != ADD) { + ZIPERR(ZE_PARMS, "specify just one action"); + } + action = UPDATE; + break; + case 'v': /* Mention oddities in zip file structure */ + noisy = 1; + verbose++; + break; +#ifdef VMS + case 'V': /* Store in VMS format */ + vms_native = 1; break; + case 'w': /* Append the VMS version number */ + vmsver = 1; break; +#endif /* VMS */ + case 'i': /* Include only the following files */ + case 'x': /* Exclude following files */ + if (p[1] == '@' && p[2] != '\0') { + goto nextarg; + } + if (zipfile == NULL) { + ZIPERR(ZE_PARMS, "use -x or -i after name of zipfile"); + } + k = 5; + break; +#ifdef S_IFLNK + case 'y': /* Store symbolic links as such */ + linkput = 1; break; +#endif /* S_IFLNK */ + case 'z': /* Edit zip file comment */ + zipedit = 1; break; +#if defined(MSDOS) || defined(OS2) + case '$': /* Include volume label */ + volume_label = 1; break; +#endif +#ifndef MACOS + case '@': /* read file names from stdin */ + comment_stream = NULL; + if (k < 3) /* zip file not read yet */ + s = 1; /* defer -@ until after zipfile read */ + else if (strcmp(zipfile, "-") == 0) { + ZIPERR(ZE_PARMS, "can't use - and -@ together"); + } + else /* zip file read--do it now */ + while ((pp = getnam(errbuf, stdin)) != NULL) + { + k = 4; + if ((r = PROCNAME(pp)) != ZE_OK) + { + if (r == ZE_MISS) + zipwarn("name not matched: ", pp); + else { + ZIPERR(r, pp); + } + } + } + break; +#endif /* !MACOS */ + case 'X': + extra_fields = 0; + break; +#ifdef OS2 + case 'E': + /* use the .LONGNAME EA (if any) as the file's name. */ + use_longname_ea = 1; + break; +#endif +#ifdef WIN32 + case '!': + /* use security privilege overrides */ + use_privileges = 1; + break; +#endif + default: + { + sprintf(errbuf, "no such option: %c", *p); + ZIPERR(ZE_PARMS, errbuf); + } + } + else /* just a dash */ + switch (k) + { +#if (!defined(MACOS) && !defined(WINDLL)) + case 0: + zipstdout(); + k = 3; + if (s) { + ZIPERR(ZE_PARMS, "can't use - and -@ together"); + } + break; +#endif /* !MACOS && !WINDLL */ + case 1: + ZIPERR(ZE_PARMS, "invalid path"); + /* not reached */ + case 2: + ZIPERR(ZE_PARMS, "invalid time"); + /* not reached */ + case 3: case 4: + comment_stream = NULL; + if ((r = PROCNAME(argv[i])) != ZE_OK) { + if (r == ZE_MISS) + zipwarn("name not matched: ", argv[i]); + else { + ZIPERR(r, argv[i]); + } + } + if (k == 3) { + first_listarg = i; + k = 4; + } + } + } + else /* not an option */ + { + if (special == NULL) + special = argv[i]; + else if (k == 5) + break; /* -i and -x arguments already scanned */ + else if (k == 6) { +#ifdef AMIGA + if ((r = PROCNAME("")) != ZE_OK) { +#else + if ((r = PROCNAME(".")) != ZE_OK) { +#endif + if (r == ZE_MISS) + zipwarn("name not matched: ", argv[i]); + else { + ZIPERR(r, argv[i]); + } + } + if (first_listarg == 0) + first_listarg = i; + break; + } + else switch (k) + { + case 0: + if ((zipfile = ziptyp(argv[i])) == NULL) { + ZIPERR(ZE_MEM, "was processing arguments"); + } + if ((r = readzipfile()) != ZE_OK) { + ZIPERR(r, zipfile); + } + k = 3; + if (s) + { + while ((pp = getnam(errbuf, stdin)) != NULL) + { + k = 4; + if ((r = PROCNAME(pp)) != ZE_OK) { + if (r == ZE_MISS) + zipwarn("name not matched: ", pp); + else { + ZIPERR(r, pp); + } + } + } + s = 0; + } + if (recurse == 2) + k = 6; + break; + case 1: + if ((tempath = malloc(strlen(argv[i]) + 1)) == NULL) { + ZIPERR(ZE_MEM, "was processing arguments"); + } + strcpy(tempath, argv[i]); + k = (zipfile != NULL ? (first_listarg > 0 ? 4 : 3) : 0); + break; + case 2: + { + int yyyy, mm, dd; /* results of sscanf() */ + + /* Support ISO 8601 & American dates */ + if ((sscanf(argv[i], "%4d-%2d-%2d", &yyyy, &mm, &dd) != 3 && + sscanf(argv[i], "%2d%2d%4d", &mm, &dd, &yyyy) != 3) || + mm < 1 || mm > 12 || dd < 1 || dd > 31) { + ZIPERR(ZE_PARMS, (cmptime == &after ? + "invalid date entered for -tt option" : + "invalid date entered for -t option")); + } + *cmptime = dostime(yyyy, mm, dd, 0, 0, 0); + k = (zipfile != NULL ? (first_listarg > 0 ? 4 : 3) : 0); + break; + } + case 3: case 4: +//CMC +//printf("k=3/4, PROCNAME=%s\n", argv[i]); + if ((r = PROCNAME(argv[i])) != ZE_OK) { + if (r == ZE_MISS) { +//printf("ZE_MISS\n"); + zipwarn("name not matched: ", argv[i]); + } + else { +//printf("ZIPERR\n"); + ZIPERR(r, argv[i]); + } + } + if (k == 3) { + first_listarg = i; + k = 4; + } + break; + case 7: + if ((key = malloc(strlen(argv[i]) + 1)) == NULL) { + ZIPERR(ZE_MEM, "was processing arguments"); + } + strcpy(key, argv[i]); + k = (zipfile != NULL ? (first_listarg > 0 ? 4 : 3) : 0); + } + } +nextarg: ; + } + if (k == 7 || k == 1) { + ZIPERR(ZE_PARMS, "missing argument for -b or -P"); + } + +#if (defined(MSDOS) || defined(OS2)) && !defined(WIN32) + if ((k == 3 || k == 4) && volume_label == 1) { + PROCNAME(NULL); + k = 4; + } +#endif + + if (pcount && first_listarg == 0 && + (k < 3 || (action != UPDATE && action != FRESHEN))) { + ZIPERR(ZE_PARMS, "nothing to select from"); + } + +#if (!defined(MACOS) && !defined(WINDLL)) + if (k < 3) { /* zip used as filter */ + zipstdout(); + comment_stream = NULL; + if ((r = procname("-", 0)) != ZE_OK) { + if (r == ZE_MISS) + zipwarn("name not matched: ", "-"); + else { + ZIPERR(r, "-"); + } + } + k = 4; + if (s) { + ZIPERR(ZE_PARMS, "can't use - and -@ together"); + } + } +#endif /* !MACOS && !WINDLL */ + + /* Clean up selections ("3 <= k <= 5" now) */ + if (k != 4 && first_listarg == 0 && + (action == UPDATE || action == FRESHEN)) { + /* if -u or -f with no args, do all, but, when present, apply filters */ + for (z = zfiles; z != NULL; z = z->nxt) { + z->mark = pcount ? filter(z->zname, 0) : 1; + } + } + if ((r = check_dup()) != ZE_OK) { /* remove duplicates in found list */ + if (r == ZE_PARMS) { + ZIPERR(r, "cannot repeat names in zip file"); + } + else { + ZIPERR(r, "was processing list of files"); + } + } + + if (zcount) + free((zvoid *)zsort); + + /* Check option combinations */ + if (special == NULL) { + ZIPERR(ZE_PARMS, "missing suffix list"); + } + if (level == 9 || !strcmp(special, ";") || !strcmp(special, ":")) + special = NULL; /* compress everything */ + + if (action == DELETE && (method != BEST || dispose || recurse || + key != NULL || comadd || zipedit)) { + zipwarn("invalid option(s) used with -d; ignored.",""); + /* reset flags - needed? */ + method = BEST; + dispose = 0; + recurse = 0; + if (key != NULL) + free((zvoid *)key); + key = NULL; + comadd = 0; + zipedit = 0; + } + if (linkput && dosify) + { + zipwarn("can't use -y with -k, -y ignored", ""); + linkput = 0; + } + if (fix && adjust) + { + zipwarn("can't use -F with -A, -F ignored", ""); + } + if (test && !strcmp(zipfile, "-")) { + test = 0; + zipwarn("can't use -T on stdout, -T ignored", ""); + } + if ((action != ADD || d) && !strcmp(zipfile, "-")) { + ZIPERR(ZE_PARMS, "can't use -d,-f,-u or -g on stdout\n"); + } +#if defined(EBCDIC) && !defined(OS390) + if (aflag==ASCII && !translate_eol) { + /* Translation to ASCII implies EOL translation! + * (on OS390, consistent EOL translation is controlled separately) + * The default translation mode is "UNIX" mode (single LF terminators). + */ + translate_eol = 2; + } +#endif +#ifdef CMS_MVS + if (aflag==ASCII && bflag) + ZIPERR(ZE_PARMS, "can't use -a with -B"); +#endif +#ifdef VMS + if (!extra_fields && vms_native) + { + zipwarn("can't use -V with -X, -V ignored", ""); + vms_native = 0; + } + if (vms_native && translate_eol) + ZIPERR(ZE_PARMS, "can't use -V with -l or -ll"); +#endif + if (zcount == 0 && (action != ADD || d)) { + zipwarn(zipfile, " not found or empty"); + } + +/* + * XXX make some kind of mktemppath() function for each OS. + */ + +#ifndef VM_CMS +/* For CMS, leave tempath NULL. A-disk will be used as default. */ + /* If -b not specified, make temporary path the same as the zip file */ +#if defined(MSDOS) || defined(__human68k__) || defined(AMIGA) + if (tempath == NULL && ((p = MBSRCHR(zipfile, '/')) != NULL || +# ifdef MSDOS + (p = MBSRCHR(zipfile, '\\')) != NULL || +# endif /* MSDOS */ + (p = MBSRCHR(zipfile, ':')) != NULL)) + { + if (*p == ':') + p++; +#else +#ifdef RISCOS + if (tempath == NULL && (p = MBSRCHR(zipfile, '.')) != NULL) + { +#else +#ifdef QDOS + if (tempath == NULL && (p = LastDir(zipfile)) != NULL) + { +#else + if (tempath == NULL && (p = MBSRCHR(zipfile, '/')) != NULL) + { +#endif /* QDOS */ +#endif /* RISCOS */ +#endif /* MSDOS || __human68k__ || AMIGA */ + if ((tempath = malloc((int)(p - zipfile) + 1)) == NULL) { + ZIPERR(ZE_MEM, "was processing arguments"); + } + r = *p; *p = 0; + strcpy(tempath, zipfile); + *p = (char)r; + } +#endif /* VM_CMS */ + +#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) + if (!zp_tz_is_valid && action != DELETE) { + zipwarn("TZ environment variable not found, cannot use UTC times!!",""); + } +#endif /* IZ_CHECK_TZ && USE_EF_UT_TIME */ + + /* For each marked entry, if not deleting, check if it exists, and if + updating or freshening, compare date with entry in old zip file. + Unmark if it doesn't exist or is too old, else update marked count. */ +#ifdef MACOS + PrintStatProgress("Getting file information ..."); +#endif + diag("stating marked entries"); + k = 0; /* Initialize marked count */ + for (z = zfiles; z != NULL; z = z->nxt) + if (z->mark) { +#ifdef USE_EF_UT_TIME + iztimes f_utim, z_utim; +#endif /* USE_EF_UT_TIME */ + Trace((stderr, "zip diagnostics: marked file=%s\n", z->zname)); + + if (action != DELETE && +#ifdef USE_EF_UT_TIME + ((t = filetime(z->name, (ulg *)NULL, (long *)NULL, &f_utim)) +#else /* !USE_EF_UT_TIME */ + ((t = filetime(z->name, (ulg *)NULL, (long *)NULL, (iztimes *)NULL)) +#endif /* ?USE_EF_UT_TIME */ + == 0 || + t < before || (after && t >= after) || + ((action == UPDATE || action == FRESHEN) && +#ifdef USE_EF_UT_TIME + ((get_ef_ut_ztime(z, &z_utim) & EB_UT_FL_MTIME) ? + f_utim.mtime <= ROUNDED_TIME(z_utim.mtime) : t <= z->tim) +#else /* !USE_EF_UT_TIME */ + t <= z->tim +#endif /* ?USE_EF_UT_TIME */ + ))) + { + z->mark = comadd ? 2 : 0; + z->trash = t && t >= before && + (after == 0 || t < after); /* delete if -um or -fm */ + if (verbose) { + fprintf(mesg, "zip diagnostic: %s %s\n", z->zname, + z->trash ? "up to date" : "missing or early"); + } + } + else + k++; + } + + /* Remove entries from found list that do not exist or are too old */ + diag("stating new entries"); + Trace((stderr, "zip diagnostic: fcount=%u\n", (unsigned)fcount)); + for (f = found; f != NULL;) { + Trace((stderr, "zip diagnostic: new file=%s\n", f->zname)); + if (action == DELETE || action == FRESHEN || + (t = filetime(f->name, (ulg *)NULL, (long *)NULL, (iztimes *)NULL)) + == 0 || + t < before || (after && t >= after) || + (namecmp(f->zname, zipfile) == 0 && strcmp(zipfile, "-"))) + f = fexpel(f); + else + f = f->nxt; + } +#ifdef MACOS + PrintStatProgress("done"); +#endif + + /* Make sure there's something left to do */ + if (k == 0 && found == NULL && + !(zfiles != NULL && + (latest || fix || adjust || junk_sfx || comadd || zipedit))) { + if (test && (zfiles != NULL || zipbeg != 0)) { +#ifndef WINDLL + check_zipfile(zipfile, argv[0]); +#endif + RETURN(finish(ZE_OK)); + } + if (action == UPDATE || action == FRESHEN) { + RETURN(finish(ZE_NONE)); + } + else if (zfiles == NULL && (latest || fix || adjust || junk_sfx)) { + ZIPERR(ZE_NAME, zipfile); + } +#ifndef WINDLL + else if (recurse && (pcount == 0) && (first_listarg > 0)) { +#ifdef VMS + strcpy(errbuf, "try: zip \""); + for (i = 1; i < (first_listarg - 1); i++) + strcat(strcat(errbuf, argv[i]), "\" "); + strcat(strcat(errbuf, argv[i]), " *.* -i"); +#else /* !VMS */ + strcpy(errbuf, "try: zip"); + for (i = 1; i < first_listarg; i++) + strcat(strcat(errbuf, " "), argv[i]); +# ifdef AMIGA + strcat(errbuf, " \"\" -i"); +# else + strcat(errbuf, " . -i"); +# endif +#endif /* ?VMS */ + for (i = first_listarg; i < argc; i++) + strcat(strcat(errbuf, " "), argv[i]); + ZIPERR(ZE_NONE, errbuf); + } +#endif /* !WINDLL */ + else { + ZIPERR(ZE_NONE, zipfile); + } + } + d = (d && k == 0 && (zipbeg || zfiles != NULL)); /* d true if appending */ + +#if CRYPT + /* Initialize the crc_32_tab pointer, when encryption was requested. */ + if (key != NULL) + crc_32_tab = get_crc_table_boinc(); +#endif /* CRYPT */ + + /* Before we get carried away, make sure zip file is writeable. This + * has the undesired side effect of leaving one empty junk file on a WORM, + * so when the zipfile does not exist already and when -b is specified, + * the writability check is made in replace(). + */ + if (strcmp(zipfile, "-")) + { + if (tempdir && zfiles == NULL && zipbeg == 0) { + a = 0; + } else { + x = zfiles == NULL && zipbeg == 0 ? fopen(zipfile, FOPW) : + fopen(zipfile, FOPM); + /* Note: FOPW and FOPM expand to several parameters for VMS */ + if (x == NULL) { + ZIPERR(ZE_CREAT, zipfile); + } + fclose(x); + a = getfileattr(zipfile); + if (zfiles == NULL && zipbeg == 0) + destroy(zipfile); + } + } + else + a = 0; + + /* Throw away the garbage in front of the zip file for -J */ + if (junk_sfx) zipbeg = 0; + + /* Open zip file and temporary output file */ + diag("opening zip file and creating temporary zip file"); + x = NULL; + tempzn = 0; + if (strcmp(zipfile, "-") == 0) + { +#ifdef MSDOS + /* It is nonsense to emit the binary data stream of a zipfile to + * the (text mode) console. This case should already have been caught + * in a call to zipstdout() far above. Therefore, if the following + * failsafe check detects a console attached to stdout, zip is stopped + * with an "internal logic error"! */ + if (isatty(fileno(stdout))) + ZIPERR(ZE_LOGIC, "tried to write binary zipfile data to console!"); + /* Set stdout mode to binary for MSDOS systems */ +# ifdef __HIGHC__ + setmode(stdout, _BINARY); +# else + setmode(fileno(stdout), O_BINARY); +# endif + tempzf = y = fdopen(fileno(stdout), FOPW); +#else + tempzf = y = stdout; +#endif + /* tempzip must be malloced so a later free won't barf */ + tempzip = malloc(4); + if (tempzip == NULL) { + ZIPERR(ZE_MEM, "allocating temp filename"); + } + strcpy(tempzip, "-"); + } + else if (d) /* d true if just appending (-g) */ + { + if ((y = fopen(zipfile, FOPM)) == NULL) { + ZIPERR(ZE_NAME, zipfile); + } + tempzip = zipfile; + tempzf = y; + if (fseek(y, cenbeg, SEEK_SET)) { + ZIPERR(ferror(y) ? ZE_READ : ZE_EOF, zipfile); + } + tempzn = cenbeg; + } + else + { + if ((zfiles != NULL || zipbeg) && (x = fopen(zipfile, FOPR_EX)) == NULL) { + ZIPERR(ZE_NAME, zipfile); + } + if ((tempzip = tempname(zipfile)) == NULL) { + ZIPERR(ZE_MEM, "allocating temp filename"); + } + if ((tempzf = y = fopen(tempzip, FOPW_TMP)) == NULL) { + ZIPERR(ZE_TEMP, tempzip); + } + } + +#if (!defined(VMS) && !defined(CMS_MVS)) + /* Use large buffer to speed up stdio: */ +#if (defined(_IOFBF) || !defined(BUFSIZ)) + zipbuf = (char *)malloc(ZBSZ); +#else + zipbuf = (char *)malloc(BUFSIZ); +#endif + if (zipbuf == NULL) { + ZIPERR(ZE_MEM, tempzip); + } +# ifdef _IOFBF + setvbuf(y, zipbuf, _IOFBF, ZBSZ); +# else + setbuf(y, zipbuf); +# endif /* _IOBUF */ +#endif /* !VMS && !CMS_MVS */ + + if (strcmp(zipfile, "-") != 0 && !d) /* this must go *after* set[v]buf */ + { + if (zipbeg && (r = fcopy(x, y, zipbeg)) != ZE_OK) { + ZIPERR(r, r == ZE_TEMP ? tempzip : zipfile); + } + tempzn = zipbeg; + } + + o = 0; /* no ZE_OPEN errors yet */ + + + /* Process zip file, updating marked files */ +#ifdef DEBUG + if (zfiles != NULL) + diag("going through old zip file"); +#endif + w = &zfiles; + while ((z = *w) != NULL) { + if (z->mark == 1) + { + /* if not deleting, zip it up */ + if (action != DELETE) + { + if (noisy) + { + if (action == FRESHEN) + fprintf(mesg, "freshening: %s", z->zname); + else + fprintf(mesg, "updating: %s", z->zname); + fflush(mesg); + } + if ((r = zipup(z, y)) != ZE_OK && r != ZE_OPEN && r != ZE_MISS) + { + if (noisy) + { +#if (!defined(MACOS) && !defined(WINDLL)) + putc('\n', mesg); + fflush(mesg); +#else + fprintf(stdout, "\n"); +#endif + } + sprintf(errbuf, "was zipping %s", z->name); + ZIPERR(r, errbuf); + } + if (r == ZE_OPEN || r == ZE_MISS) + { + o = 1; + if (noisy) + { +#if (!defined(MACOS) && !defined(WINDLL)) + putc('\n', mesg); + fflush(mesg); +#else + fprintf(stdout, "\n"); +#endif + } + if (r == ZE_OPEN) { + perror(z->zname); + zipwarn("could not open for reading: ", z->zname); + } else { + zipwarn("file and directory with the same name: ", z->zname); + } + zipwarn("will just copy entry over: ", z->zname); + if ((r = zipcopy(z, x, y)) != ZE_OK) + { + sprintf(errbuf, "was copying %s", z->zname); + ZIPERR(r, errbuf); + } + z->mark = 0; + } + w = &z->nxt; + } + else + { + if (noisy) + { + fprintf(mesg, "deleting: %s\n", z->zname); + fflush(mesg); + } +#ifdef WINDLL + if (lpZipUserFunctions->ServiceApplication != NULL) { + if ((*lpZipUserFunctions->ServiceApplication)(z->zname, 0)) + ZIPERR(ZE_ABORT, "User terminated operation"); + } +#endif + v = z->nxt; /* delete entry from list */ + free((zvoid *)(z->iname)); + free((zvoid *)(z->zname)); + if (z->ext) + free((zvoid *)(z->extra)); + if (z->cext && z->cextra != z->extra) + free((zvoid *)(z->cextra)); + if (z->com) + free((zvoid *)(z->comment)); + farfree((zvoid far *)z); + *w = v; + zcount--; + } + } + else + { + /* copy the original entry verbatim */ + if (!d && (r = zipcopy(z, x, y)) != ZE_OK) + { + sprintf(errbuf, "was copying %s", z->zname); + ZIPERR(r, errbuf); + } + w = &z->nxt; + } + } + + + /* Process the edited found list, adding them to the zip file */ + diag("zipping up new entries, if any"); + Trace((stderr, "zip diagnostic: fcount=%u\n", (unsigned)fcount)); + for (f = found; f != NULL; f = fexpel(f)) + { + //printf("found = %s\n", f->name); + + /* add a new zfiles entry and set the name */ + if ((z = (struct zlist far *)farmalloc(sizeof(struct zlist))) == NULL) { + ZIPERR(ZE_MEM, "was adding files to zip file"); + } + z->nxt = NULL; + z->name = f->name; + f->name = NULL; + z->iname = f->iname; + f->iname = NULL; + z->zname = f->zname; + f->zname = NULL; + z->ext = z->cext = z->com = 0; + z->extra = z->cextra = NULL; + z->mark = 1; + z->dosflag = f->dosflag; + /* zip it up */ + if (noisy) + { + fprintf(mesg, " adding: %s", z->zname); + fflush(mesg); + } + if ((r = zipup(z, y)) != ZE_OK && r != ZE_OPEN && r != ZE_MISS) + { + if (noisy) + { +#if (!defined(MACOS) && !defined(WINDLL)) + putc('\n', mesg); + fflush(mesg); +#else + fprintf(stdout, "\n"); +#endif + } + sprintf(errbuf, "was zipping %s", z->zname); + ZIPERR(r, errbuf); + } + if (r == ZE_OPEN || r == ZE_MISS) + { + o = 1; + if (noisy) + { +#if (!defined(MACOS) && !defined(WINDLL)) + putc('\n', mesg); + fflush(mesg); +#else + fprintf(stdout, "\n"); +#endif + } + if (r == ZE_OPEN) { + perror("zip warning"); + zipwarn("could not open for reading: ", z->zname); + } else { + zipwarn("file and directory with the same name: ", z->zname); + } + free((zvoid *)(z->name)); + free((zvoid *)(z->iname)); + free((zvoid *)(z->zname)); + farfree((zvoid far *)z); + } + else + { + *w = z; + w = &z->nxt; + zcount++; + } + } + if (key != NULL) + { + free((zvoid *)key); + key = NULL; + } + + + /* Get one line comment for each new entry */ +#if defined(AMIGA) || defined(MACOS) + if (comadd || filenotes) + { + if (comadd) +#else + if (comadd) + { +#endif + { + if (comment_stream == NULL) { +#ifndef RISCOS + comment_stream = (FILE*)fdopen(fileno(stderr), "r"); +#else + comment_stream = stderr; +#endif + } + if ((e = malloc(MAXCOM + 1)) == NULL) { + ZIPERR(ZE_MEM, "was reading comment lines"); + } + } +#ifdef __human68k__ + setmode(fileno(comment_stream), O_TEXT); +#endif +#ifdef MACOS + if (noisy) fprintf(mesg, "\nStart commenting files ...\n"); +#endif + for (z = zfiles; z != NULL; z = z->nxt) + if (z->mark) +#if defined(AMIGA) || defined(MACOS) + if (filenotes && (p = GetComment(z->zname))) + { + if (z->comment = malloc(k = strlen(p)+1)) + { + z->com = k; + strcpy(z->comment, p); + } + else + { + free((zvoid *)e); + ZIPERR(ZE_MEM, "was reading filenotes"); + } + } + else if (comadd) +#endif /* AMIGA || MACOS */ + { + if (noisy) + fprintf(mesg, "Enter comment for %s:\n", z->zname); + if (fgets(e, MAXCOM+1, comment_stream) != NULL) + { + if ((p = malloc((k = strlen(e))+1)) == NULL) + { + free((zvoid *)e); + ZIPERR(ZE_MEM, "was reading comment lines"); + } + strcpy(p, e); + if (p[k-1] == '\n') + p[--k] = 0; + z->comment = p; + z->com = k; + } + } +#ifdef MACOS + if (noisy) fprintf(mesg, "\n...done"); +#endif +#if defined(AMIGA) || defined(MACOS) + if (comadd) + free((zvoid *)e); + GetComment(NULL); /* makes it free its internal storage */ +#else + free((zvoid *)e); +#endif + } + + /* Get multi-line comment for the zip file */ + if (zipedit) + { +#ifndef WINDLL + if (comment_stream == NULL) { +#ifndef RISCOS + comment_stream = (FILE*)fdopen(fileno(stderr), "r"); +#else + comment_stream = stderr; +#endif + } + if ((e = malloc(MAXCOM + 1)) == NULL) { + ZIPERR(ZE_MEM, "was reading comment lines"); + } + if (noisy && zcomlen) + { + fputs("current zip file comment is:\n", mesg); + fwrite(zcomment, 1, zcomlen, mesg); + if (zcomment[zcomlen-1] != '\n') + putc('\n', mesg); + free((zvoid *)zcomment); + } + if ((zcomment = malloc(1)) == NULL) + ZIPERR(ZE_MEM, "was setting comments to null"); + zcomment[0] = '\0'; + if (noisy) + fputs("enter new zip file comment (end with .):\n", mesg); +#if (defined(AMIGA) && (defined(LATTICE)||defined(__SASC))) + flushall(); /* tty input/output is out of sync here */ +#endif +#ifdef __human68k__ + setmode(fileno(comment_stream), O_TEXT); +#endif +#ifdef MACOS + printf("\n enter new zip file comment \n"); + if (fgets(e, MAXCOM+1, comment_stream) != NULL) { + if ((p = malloc((k = strlen(e))+1)) == NULL) { + free((zvoid *)e); + ZIPERR(ZE_MEM, "was reading comment lines"); + } + strcpy(p, e); + if (p[k-1] == '\n') p[--k] = 0; + zcomment = p; + } +#else /* !MACOS */ + while (fgets(e, MAXCOM+1, comment_stream) != NULL && strcmp(e, ".\n")) + { + if (e[(r = strlen(e)) - 1] == '\n') + e[--r] = 0; + if ((p = malloc((*zcomment ? strlen(zcomment) + 3 : 1) + r)) == NULL) + { + free((zvoid *)e); + ZIPERR(ZE_MEM, "was reading comment lines"); + } + if (*zcomment) + strcat(strcat(strcpy(p, zcomment), "\r\n"), e); + else + strcpy(p, *e ? e : "\r\n"); + free((zvoid *)zcomment); + zcomment = p; + } +#endif /* ?MACOS */ + free((zvoid *)e); +#else /* WINDLL */ + comment(zcomlen); + if ((p = malloc(strlen(szCommentBuf)+1)) == NULL) { + ZIPERR(ZE_MEM, "was setting comments to null"); + } + if (szCommentBuf[0] != '\0') + lstrcpy(p, szCommentBuf); + else + p[0] = '\0'; + free((zvoid *)zcomment); + GlobalUnlock(hStr); + GlobalFree(hStr); + zcomment = p; +#endif /* WINDLL */ + zcomlen = strlen(zcomment); + } + + + /* Write central directory and end header to temporary zip */ + diag("writing central directory"); + k = 0; /* keep count for end header */ + c = tempzn; /* get start of central */ + n = t = 0; + for (z = zfiles; z != NULL; z = z->nxt) + { + if ((r = putcentral(z, y)) != ZE_OK) { + ZIPERR(r, tempzip); + } + tempzn += 4 + CENHEAD + z->nam + z->cext + z->com; + n += z->len; + t += z->siz; + k++; + } + if (k == 0) + zipwarn("zip file empty", ""); + if (verbose) + fprintf(mesg, "total bytes=%lu, compressed=%lu -> %d%% savings\n", + n, t, percent(n, t)); + t = tempzn - c; /* compute length of central */ + diag("writing end of central directory"); + if ((r = putend(k, t, c, zcomlen, zcomment, y)) != ZE_OK) { + ZIPERR(r, tempzip); + } + tempzf = NULL; + if (fclose(y)) { + ZIPERR(d ? ZE_WRITE : ZE_TEMP, tempzip); + } + if (x != NULL) + fclose(x); + + /* Free some memory before spawning unzip */ +#ifdef USE_ZLIB + zl_deflate_free(); +#else + lm_free(); +#endif + +#ifndef WINDLL + /* Test new zip file before overwriting old one or removing input files */ + if (test) + check_zipfile(tempzip, argv[0]); +#endif + /* Replace old zip file with new zip file, leaving only the new one */ + if (strcmp(zipfile, "-") && !d) + { + diag("replacing old zip file with new zip file"); + if ((r = replace(zipfile, tempzip)) != ZE_OK) + { + zipwarn("new zip file left as: ", tempzip); + free((zvoid *)tempzip); + tempzip = NULL; + ZIPERR(r, "was replacing the original zip file"); + } + free((zvoid *)tempzip); + } + tempzip = NULL; + if (a && strcmp(zipfile, "-")) { + setfileattr(zipfile, a); +#ifdef VMS + /* If the zip file existed previously, restore its record format: */ + if (x != NULL) + (void)VMSmunch(zipfile, RESTORE_RTYPE, NULL); +#endif + } + +#ifdef __BEOS__ + /* Set the filetype of the zipfile to "application/zip" */ + setfiletype( zipfile, "application/zip" ); +#endif + +#ifdef MACOS + /* Set the Creator/Type of the zipfile to 'IZip' and 'ZIP ' */ + setfiletype(zipfile, 'IZip', 'ZIP '); +#endif + +#ifdef RISCOS + /* Set the filetype of the zipfile to &DDC */ + setfiletype(zipfile, 0xDDC); +#endif + + /* Finish up (process -o, -m, clean up). Exit code depends on o. */ +#if (!defined(VMS) && !defined(CMS_MVS)) + free((zvoid *) zipbuf); +#endif /* !VMS && !CMS_MVS */ + RETURN(finish(o ? ZE_OPEN : ZE_OK)); +} + + +const char *BOINC_RCSID_32cef20f4f = "$Id: zip.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/zipcloak.c boinc-7.0.14+dfsg/zip/zip/zipcloak.c --- boinc-7.0.7+dfsg/zip/zip/zipcloak.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zipcloak.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,421 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + This code was originally written in Europe and can be freely distributed + from any country except the U.S.A. If this code is imported into the U.S.A, + it cannot be re-exported from the U.S.A to another country. (This + restriction might seem curious but this is what US law requires.) + */ +#define __ZIPCLOAK_C + +#ifndef UTIL +#define UTIL +#endif +#include "zip.h" +#define DEFCPYRT /* main module: enable copyright string defines! */ +#include "revision.h" +//#include "z_crypt.h" +#include "z_ttyio.h" +#include +#ifndef NO_STDLIB_H +# include +#endif + +#if CRYPT /* defined (as TRUE or FALSE) in crypt.h */ + +int main OF((int argc, char **argv)); + +local void handler OF((int sig)); +local void license OF((void)); +local void help OF((void)); +local void version_info OF((void)); + +/* Temporary zip file name and file pointer */ +local char *tempzip; +local FILE *tempzf; + +/* Pointer to CRC-32 table (used for decryption/encryption) */ +#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) +ZCONST ulg near *crc_32_tab; +#else +ZCONST uLongf *crc_32_tab; +#endif + +/*********************************************************************** + * Issue a message for the error, clean up files and memory, and exit. + */ +void ziperr(code, msg) + int code; /* error code from the ZE_ class */ + char *msg; /* message about how it happened */ +{ + if (PERR(code)) perror("zipcloak error"); + fprintf(stderr, "zipcloak error: %s (%s)\n", errors[code-1], msg); + if (tempzf != NULL) fclose(tempzf); + if (tempzip != NULL) { + destroy(tempzip); + free((zvoid *)tempzip); + } + if (zipfile != NULL) free((zvoid *)zipfile); + EXIT(code); +} + +/*********************************************************************** + * Print a warning message to stderr and return. + */ +void zipwarn(msg1, msg2) + char *msg1, *msg2; /* message strings juxtaposed in output */ +{ + fprintf(stderr, "zipcloak warning: %s%s\n", msg1, msg2); +} + + +/*********************************************************************** + * Upon getting a user interrupt, turn echo back on for tty and abort + * cleanly using ziperr(). + */ +local void handler(sig) + int sig; /* signal number (ignored) */ +{ +#if (!defined(MSDOS) && !defined(__human68k__) && !defined(RISCOS)) + echon(); + putc('\n', stderr); +#endif + ziperr(ZE_ABORT +sig-sig, "aborting"); + /* dummy usage of sig to avoid compiler warnings */ +} + + +static ZCONST char *public[] = { +"The encryption code of this program is not copyrighted and is put in the", +"public domain. It was originally written in Europe and can be freely", +"distributed from any country except the U.S.A. If this program is imported", +"into the U.S.A, it cannot be re-exported from the U.S.A to another country.", +"The copyright notice of the zip program applies to the rest of the code." +}; + +/*********************************************************************** + * Print license information to stdout. + */ +local void license() +{ + extent i; /* counter for copyright array */ + + for (i = 0; i < sizeof(public)/sizeof(char *); i++) { + puts(public[i]); + } + for (i = 0; i < sizeof(swlicense)/sizeof(char *); i++) { + puts(swlicense[i]); + } +} + + +static ZCONST char *help_info[] = { +"", +"ZipCloak %s (%s)", +#ifdef VM_CMS +"Usage: zipcloak [-d] [-b fm] zipfile", +#else +"Usage: zipcloak [-d] [-b path] zipfile", +#endif +" the default action is to encrypt all unencrypted entries in the zip file", +" -d decrypt--decrypt encrypted entries (copy if given wrong password)", +#ifdef VM_CMS +" -b use \"fm\" as the filemode for the temporary zip file", +#else +" -b use \"path\" for the temporary zip file", +#endif +" -h show this help -v show version info -L show software license" + }; + +/*********************************************************************** + * Print help (along with license info) to stdout. + */ +local void help() +{ + extent i; /* counter for help array */ + + for (i = 0; i < sizeof(public)/sizeof(char *); i++) { + puts(public[i]); + } + for (i = 0; i < sizeof(help_info)/sizeof(char *); i++) { + printf(help_info[i], VERSION, REVDATE); + putchar('\n'); + } +} + + +local void version_info() +/* Print verbose info about program version and compile time options + to stdout. */ +{ + extent i; /* counter in text arrays */ + + /* Options info array */ + static ZCONST char *comp_opts[] = { +#ifdef DEBUG + "DEBUG", +#endif +#if CRYPT && defined(PASSWD_FROM_STDIN) + "PASSWD_FROM_STDIN", +#endif /* CRYPT && PASSWD_FROM_STDIN */ + NULL + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) + { + printf(copyright[i], "zipcloak"); + putchar('\n'); + } + + for (i = 0; i < sizeof(versinfolines)/sizeof(char *); i++) + { + printf(versinfolines[i], "ZipCloak", VERSION, REVDATE); + putchar('\n'); + } + + version_local(); + + puts("ZipCloak special compilation options:"); + for (i = 0; (int)i < (int)(sizeof(comp_opts)/sizeof(char *) - 1); i++) + { + printf("\t%s\n",comp_opts[i]); + } + printf("\t[encryption, version %d.%d%s of %s]\n", + CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE); +} + + +/*********************************************************************** + * Encrypt or decrypt all of the entries in a zip file. See the command + * help in help() above. + */ + +int main(argc, argv) + int argc; /* number of tokens in command line */ + char **argv; /* command line tokens */ +{ + int attr; /* attributes of zip file */ + ulg start_offset; /* start of central directory */ + int decrypt; /* decryption flag */ + int temp_path; /* 1 if next argument is path for temp files */ + char passwd[IZ_PWLEN+1]; /* password for encryption or decryption */ + char verify[IZ_PWLEN+1]; /* password for encryption or decryption */ + char *q; /* steps through option arguments */ + int r; /* arg counter */ + int res; /* result code */ + ulg length; /* length of central directory */ + FILE *inzip, *outzip; /* input and output zip files */ + struct zlist far *z; /* steps through zfiles linked list */ + +#ifdef THEOS + setlocale(LC_CTYPE, "I"); +#endif + + /* If no args, show help */ + if (argc == 1) { + help(); + EXIT(0); + } + + init_upper(); /* build case map table */ + + crc_32_tab = get_crc_table_boinc(); + /* initialize crc table for crypt */ + + /* Go through args */ + zipfile = tempzip = NULL; + tempzf = NULL; + temp_path = decrypt = 0; + for (r = 1; r < argc; r++) { + if (*argv[r] == '-') { + if (!argv[r][1]) ziperr(ZE_PARMS, "zip file cannot be stdin"); + for (q = argv[r]+1; *q; q++) { + switch (*q) { + case 'b': /* Specify path for temporary file */ + if (temp_path) { + ziperr(ZE_PARMS, "use -b before zip file name"); + } + temp_path = 1; /* Next non-option is path */ + break; + case 'd': + decrypt = 1; break; + case 'h': /* Show help */ + help(); + EXIT(0); + case 'l': case 'L': /* Show copyright and disclaimer */ + license(); + EXIT(0); + case 'v': /* Show version info */ + version_info(); + EXIT(0); + default: + ziperr(ZE_PARMS, "unknown option"); + } /* switch */ + } /* for */ + + } else if (temp_path == 0) { + if (zipfile != NULL) { + ziperr(ZE_PARMS, "can only specify one zip file"); + + } else if ((zipfile = ziptyp(argv[r])) == NULL) { + ziperr(ZE_MEM, "was processing arguments"); + } + } else { + tempath = argv[r]; + temp_path = 0; + } /* if */ + } /* for */ + + if (zipfile == NULL) ziperr(ZE_PARMS, "need to specify zip file"); + + /* Read zip file */ + if ((res = readzipfile()) != ZE_OK) ziperr(res, zipfile); + if (zfiles == NULL) ziperr(ZE_NAME, zipfile); + + /* Check for something to do */ + for (z = zfiles; z != NULL; z = z->nxt) { + if (decrypt ? z->flg & 1 : !(z->flg & 1)) break; + } + if (z == NULL) { + ziperr(ZE_NONE, decrypt ? "no encrypted files" + : "all files encrypted already"); + } + + /* Before we get carried away, make sure zip file is writeable */ + if ((inzip = fopen(zipfile, "a")) == NULL) ziperr(ZE_CREAT, zipfile); + fclose(inzip); + attr = getfileattr(zipfile); + + /* Open output zip file for writing */ + if ((tempzf = outzip = fopen(tempzip = tempname(zipfile), FOPW)) == NULL) { + ziperr(ZE_TEMP, tempzip); + } + + /* Get password */ + if (getp("Enter password: ", passwd, IZ_PWLEN+1) == NULL) + ziperr(ZE_PARMS, + "stderr is not a tty (you may never see this message!)"); + + if (decrypt == 0) { + if (getp("Verify password: ", verify, IZ_PWLEN+1) == NULL) + ziperr(ZE_PARMS, + "stderr is not a tty (you may never see this message!)"); + + if (strcmp(passwd, verify)) + ziperr(ZE_PARMS, "password verification failed"); + + if (*passwd == '\0') + ziperr(ZE_PARMS, "zero length password not allowed"); + } + + /* Open input zip file again, copy preamble if any */ + if ((inzip = fopen(zipfile, FOPR)) == NULL) ziperr(ZE_NAME, zipfile); + + if (zipbeg && (res = fcopy(inzip, outzip, zipbeg)) != ZE_OK) { + ziperr(res, res == ZE_TEMP ? tempzip : zipfile); + } + tempzn = zipbeg; + + /* Go through local entries, copying, encrypting, or decrypting */ + for (z = zfiles; z != NULL; z = z->nxt) { + if (decrypt && (z->flg & 1)) { + printf("decrypting: %s", z->zname); + fflush(stdout); + if ((res = zipbare(z, inzip, outzip, passwd)) != ZE_OK) { + if (res != ZE_MISS) ziperr(res, "was decrypting an entry"); + printf(" (wrong password--just copying)"); + } + putchar('\n'); + + } else if ((!decrypt) && !(z->flg & 1)) { + printf("encrypting: %s\n", z->zname); + fflush(stdout); + if ((res = zipcloak(z, inzip, outzip, passwd)) != ZE_OK) { + ziperr(res, "was encrypting an entry"); + } + } else { + printf(" copying: %s\n", z->zname); + fflush(stdout); + if ((res = zipcopy(z, inzip, outzip)) != ZE_OK) { + ziperr(res, "was copying an entry"); + } + } /* if */ + } /* for */ + fclose(inzip); + + /* Write central directory and end of central directory */ + + /* get start of central */ + if ((start_offset = (ulg)ftell(outzip)) == (ulg)-1L) + ziperr(ZE_TEMP, tempzip); + + for (z = zfiles; z != NULL; z = z->nxt) { + if ((res = putcentral(z, outzip)) != ZE_OK) ziperr(res, tempzip); + } + + /* get end of central */ + if ((length = (ulg)ftell(outzip)) == (ulg)-1L) + ziperr(ZE_TEMP, tempzip); + + length -= start_offset; /* compute length of central */ + if ((res = putend((int)zcount, length, start_offset, zcomlen, + zcomment, outzip)) != ZE_OK) { + ziperr(res, tempzip); + } + tempzf = NULL; + if (fclose(outzip)) ziperr(ZE_TEMP, tempzip); + if ((res = replace(zipfile, tempzip)) != ZE_OK) { + zipwarn("new zip file left as: ", tempzip); + free((zvoid *)tempzip); + tempzip = NULL; + ziperr(res, "was replacing the original zip file"); + } + free((zvoid *)tempzip); + tempzip = NULL; + setfileattr(zipfile, attr); +#ifdef RISCOS + /* Set the filetype of the zipfile to &DDC */ + setfiletype(zipfile, 0xDDC); +#endif + free((zvoid *)zipfile); + zipfile = NULL; + + /* Done! */ + RETURN(0); +} +#else /* !CRYPT */ + +int main OF((void)); + +void zipwarn(msg1, msg2) +char *msg1, *msg2; +{ + /* Tell picky compilers to shut up about unused variables */ + msg1 = msg1; msg2 = msg2; +} + +void ziperr(c, h) +int c; +char *h; +{ + /* Tell picky compilers to shut up about unused variables */ + c = c; h = h; +} + +int main() +{ + fprintf(stderr, "\ +This version of ZipCloak does not support encryption. Get zcrypt27.zip (or\n\ +a later version) and recompile. The Info-ZIP file `WHERE' lists sites.\n"); + RETURN(1); +} + +#endif /* ?CRYPT */ + +const char *BOINC_RCSID_20afbe80ed = "$Id: zipcloak.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/ziperr.h boinc-7.0.14+dfsg/zip/zip/ziperr.h --- boinc-7.0.7+dfsg/zip/zip/ziperr.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/ziperr.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,67 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * ziperr.h by Mark Adler + */ + +/* Error return values. The values 0..4 and 12..18 follow the conventions + of PKZIP. The values 4..10 are all assigned to "insufficient memory" + by PKZIP, so the codes 5..10 are used here for other purposes. */ +#define ZE_MISS -1 /* used by procname(), zipbare() */ +#define ZE_OK 0 /* success */ +#define ZE_EOF 2 /* unexpected end of zip file */ +#define ZE_FORM 3 /* zip file structure error */ +#define ZE_MEM 4 /* out of memory */ +#define ZE_LOGIC 5 /* internal logic error */ +#define ZE_BIG 6 /* entry too large to split */ +#define ZE_NOTE 7 /* invalid comment format */ +#define ZE_TEST 8 /* zip test (-T) failed or out of memory */ +#define ZE_ABORT 9 /* user interrupt or termination */ +#define ZE_TEMP 10 /* error using a temp file */ +#define ZE_READ 11 /* read or seek error */ +#define ZE_NONE 12 /* nothing to do */ +#define ZE_NAME 13 /* missing or empty zip file */ +#define ZE_WRITE 14 /* error writing to a file */ +#define ZE_CREAT 15 /* couldn't open to write */ +#define ZE_PARMS 16 /* bad command line */ +#define ZE_OPEN 18 /* could not open a specified file to read */ + +#define ZE_MAXERR 18 /* the highest error number */ + +/* Macro to determine whether to call perror() or not */ +#define PERR(e) (e==ZE_READ||e==ZE_WRITE||e==ZE_CREAT||e==ZE_TEMP||e==ZE_OPEN) + +#ifdef GLOBALS +/* Error messages for the ziperr() function in the zip programs */ +char *errors[ZE_MAXERR] = { +/* 1 */ "", +/* 2 */ "Unexpected end of zip file", +/* 3 */ "Zip file structure invalid", +/* 4 */ "Out of memory", +/* 5 */ "Internal logic error", +/* 6 */ "Entry too big to split", +/* 7 */ "Invalid comment format", +/* 8 */ "Zip file invalid or could not spawn unzip", +/* 9 */ "Interrupted", +/* 10 */ "Temporary file failure", +/* 11 */ "Input file read failure", +/* 12 */ "Nothing to do!", +/* 13 */ "Missing or empty zip file", +/* 14 */ "Output file write failure", +/* 15 */ "Could not create output file", +/* 16 */ "Invalid command arguments", +/* 17 */ "", +/* 18 */ "File not found or no read permission" +# ifdef AZTEC_C + , /* extremely lame compiler bug workaround */ +# endif +}; +#else /* !GLOBALS */ +extern char *errors[ZE_MAXERR]; /* Error messages for ziperr() */ +#endif /* ?GLOBALS */ diff -Nru boinc-7.0.7+dfsg/zip/zip/zipfile.c boinc-7.0.14+dfsg/zip/zip/zipfile.c --- boinc-7.0.7+dfsg/zip/zip/zipfile.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zipfile.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1562 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * zipfile.c by Mark Adler. + */ +#define __ZIPFILE_C + +#include "zip.h" +#include "revision.h" + +#ifdef VMS +# include +# include +# include "vms/vmsmunch.h" +# include "vms/vmsdefs.h" +#endif + +#ifdef __RSXNT__ +# include +#endif + +/* + * XXX start of zipfile.h + */ +#ifdef THEOS +/* Macros cause stack overflow in compiler */ +ush SH(uch* p) { return ((ush)(uch)((p)[0]) | ((ush)(uch)((p)[1]) << 8)); } +ulg LG(uch* p) { return ((ulg)(SH(p)) | ((ulg)(SH((p)+2)) << 16)); } +#else /* !THEOS */ +/* Macros for converting integers in little-endian to machine format */ +#define SH(a) ((ush)(((ush)(uch)(a)[0]) | (((ush)(uch)(a)[1]) << 8))) +#define LG(a) ((ulg)SH(a) | ((ulg)SH((a)+2) << 16)) +#endif /* ?THEOS */ + +/* Macros for writing machine integers to little-endian format */ +#define PUTSH(a,f) {putc((char)((a) & 0xff),(f)); putc((char)((a) >> 8),(f));} +#define PUTLG(a,f) {PUTSH((a) & 0xffff,(f)) PUTSH((a) >> 16,(f))} + + +/* -- Structure of a ZIP file -- */ + +/* Signatures for zip file information headers */ +#define LOCSIG 0x04034b50L +#define CENSIG 0x02014b50L +#define ENDSIG 0x06054b50L +#define EXTLOCSIG 0x08074b50L + +/* Offsets of values in headers */ +#define LOCVER 0 /* version needed to extract */ +#define LOCFLG 2 /* encrypt, deflate flags */ +#define LOCHOW 4 /* compression method */ +#define LOCTIM 6 /* last modified file time, DOS format */ +#define LOCDAT 8 /* last modified file date, DOS format */ +#define LOCCRC 10 /* uncompressed crc-32 for file */ +#define LOCSIZ 14 /* compressed size in zip file */ +#define LOCLEN 18 /* uncompressed size */ +#define LOCNAM 22 /* length of filename */ +#define LOCEXT 24 /* length of extra field */ + +#define EXTCRC 0 /* uncompressed crc-32 for file */ +#define EXTSIZ 4 /* compressed size in zip file */ +#define EXTLEN 8 /* uncompressed size */ + +#define CENVEM 0 /* version made by */ +#define CENVER 2 /* version needed to extract */ +#define CENFLG 4 /* encrypt, deflate flags */ +#define CENHOW 6 /* compression method */ +#define CENTIM 8 /* last modified file time, DOS format */ +#define CENDAT 10 /* last modified file date, DOS format */ +#define CENCRC 12 /* uncompressed crc-32 for file */ +#define CENSIZ 16 /* compressed size in zip file */ +#define CENLEN 20 /* uncompressed size */ +#define CENNAM 24 /* length of filename */ +#define CENEXT 26 /* length of extra field */ +#define CENCOM 28 /* file comment length */ +#define CENDSK 30 /* disk number start */ +#define CENATT 32 /* internal file attributes */ +#define CENATX 34 /* external file attributes */ +#define CENOFF 38 /* relative offset of local header */ + +#define ENDDSK 0 /* number of this disk */ +#define ENDBEG 2 /* number of the starting disk */ +#define ENDSUB 4 /* entries on this disk */ +#define ENDTOT 6 /* total number of entries */ +#define ENDSIZ 8 /* size of entire central directory */ +#define ENDOFF 12 /* offset of central on starting disk */ +#define ENDCOM 16 /* length of zip file comment */ + + + +/* Local functions */ + +local int zqcmp OF((ZCONST zvoid *, ZCONST zvoid *)); +local int scanzipf_reg OF((FILE *f)); +#ifndef UTIL + local int rqcmp OF((ZCONST zvoid *, ZCONST zvoid *)); + local int zbcmp OF((ZCONST zvoid *, ZCONST zvoid far *)); + local void zipoddities OF((struct zlist far *)); + local int scanzipf_fix OF((FILE *f)); +# ifdef USE_EF_UT_TIME + local int ef_scan_ut_time OF((char *ef_buf, extent ef_len, int ef_is_cent, + iztimes *z_utim)); +# endif /* USE_EF_UT_TIME */ + local void cutpath OF((char *p, int delim)); +#endif /* !UTIL */ + +/* + * XXX end of zipfile.h + */ + +/* Local data */ + +#ifdef HANDLE_AMIGA_SFX + ulg amiga_sfx_offset; /* place where size field needs updating */ +#endif + + +local int zqcmp(a, b) +ZCONST zvoid *a, *b; /* pointers to pointers to zip entries */ +/* Used by qsort() to compare entries in the zfile list. + * Compares the internal names z->iname */ +{ + return namecmp((*(struct zlist far **)a)->iname, + (*(struct zlist far **)b)->iname); +} + +#ifndef UTIL + +local int rqcmp(a, b) +ZCONST zvoid *a, *b; /* pointers to pointers to zip entries */ +/* Used by qsort() to compare entries in the zfile list. + * Compare the internal names z->iname, but in reverse order. */ +{ + return namecmp((*(struct zlist far **)b)->iname, + (*(struct zlist far **)a)->iname); +} + + +local int zbcmp(n, z) +ZCONST zvoid *n; /* string to search for */ +ZCONST zvoid far *z; /* pointer to a pointer to a zip entry */ +/* Used by search() to compare a target to an entry in the zfile list. */ +{ + return namecmp((char *)n, ((struct zlist far *)z)->zname); +} + + +struct zlist far *zsearch(n) +ZCONST char *n; /* name to find */ +/* Return a pointer to the entry in zfile with the name n, or NULL if + not found. */ +{ + zvoid far **p; /* result of search() */ + + if (zcount && + (p = search(n, (ZCONST zvoid far **)zsort, zcount, zbcmp)) != NULL) + return *(struct zlist far **)p; + else + return NULL; +} + +#endif /* !UTIL */ + +#ifndef VMS +# ifndef PATHCUT +# define PATHCUT '/' +# endif + +char *ziptyp(s) +char *s; /* file name to force to zip */ +/* If the file name *s has a dot (other than the first char), or if + the -A option is used (adjust self-extracting file) then return + the name, otherwise append .zip to the name. Allocate the space for + the name in either case. Return a pointer to the new name, or NULL + if malloc() fails. */ +{ + char *q; /* temporary pointer */ + char *t; /* pointer to malloc'ed string */ +#ifdef THEOS + char *r; /* temporary pointer */ + char *disk; +#endif + + if ((t = malloc(strlen(s) + 5)) == NULL) + return NULL; + strcpy(t, s); +#ifdef __human68k__ + _toslash(t); +#endif +#ifdef MSDOS + for (q = t; *q; INCSTR(q)) + if (*q == '\\') + *q = '/'; +#endif /* MSDOS */ +#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ + AnsiToOem(t, t); +#endif + if (adjust) return t; +#ifndef RISCOS +# ifndef QDOS +# ifdef AMIGA + if ((q = MBSRCHR(t, '/')) == NULL) + q = MBSRCHR(t, ':'); + if (MBSRCHR((q ? q + 1 : t), '.') == NULL) +# else /* !AMIGA */ +# ifdef THEOS + /* the argument expansion add a dot to the end of file names when + * there is no extension and at least one of a argument has wild cards. + * So check for at least one character in the extension if there is a dot + * in file name */ + if ((q = MBSRCHR((q = MBSRCHR(t, PATHCUT)) == NULL ? t : q + 1, '.')) == NULL + || q[1] == '\0') { +# else /* !THEOS */ +# ifdef TANDEM + if (MBSRCHR((q = MBSRCHR(t, '.')) == NULL ? t : q + 1, ' ') == NULL) +# else /* !TANDEM */ + if (MBSRCHR((q = MBSRCHR(t, PATHCUT)) == NULL ? t : q + 1, '.') == NULL) +# endif /* ?TANDEM */ +# endif /* ?THEOS */ +# endif /* ?AMIGA */ +# ifdef CMS_MVS + if (strncmp(t,"dd:",3) != 0 && strncmp(t,"DD:",3) != 0) +# endif /* CMS_MVS */ +# ifdef THEOS + /* insert .zip extension before disk name */ + if ((r = MBSRCHR(t, ':')) != NULL) { + /* save disk name */ + if ((disk = strdup(r)) == NULL) + return NULL; + strcpy(r[-1] == '.' ? r - 1 : r, ".zip"); + strcat(t, disk); + free(disk); + } else { + if (q != NULL && *q == '.') + strcpy(q, ".zip"); + else + strcat(t, ".zip"); + } + } +# else /* !THEOS */ +# ifdef TANDEM /* Tandem can't cope with extensions */ + strcat(t, " ZIP"); +# else /* !TANDEM */ + strcat(t, ".zip"); +# endif /* ?TANDEM */ +# endif /* ?THEOS */ +# else /* QDOS */ + q = LastDir(t); + if(MBSRCHR(q, '_') == NULL && MBSRCHR(q, '.') == NULL) + { + strcat(t, "_zip"); + } +# endif /* QDOS */ +#endif /* !RISCOS */ + return t; +} + +#else /* VMS */ + +# define PATHCUT ']' + +char *ziptyp(s) +char *s; +{ int status; + struct FAB fab; + struct NAM nam; + static char zero=0; + char result[NAM$C_MAXRSS+1],exp[NAM$C_MAXRSS+1]; + char *p; + + fab = cc$rms_fab; + nam = cc$rms_nam; + + fab.fab$l_fna = s; + fab.fab$b_fns = strlen(fab.fab$l_fna); + + fab.fab$l_dna = "sys$disk:[].zip"; /* Default fspec */ + fab.fab$b_dns = strlen(fab.fab$l_dna); + + fab.fab$l_nam = &nam; + + nam.nam$l_rsa = result; /* Put resultant name of */ + nam.nam$b_rss = sizeof(result)-1; /* existing zipfile here */ + + nam.nam$l_esa = exp; /* For full spec of */ + nam.nam$b_ess = sizeof(exp)-1; /* file to create */ + + status = sys$parse(&fab); + if( (status & 1) == 0 ) + return &zero; + + status = sys$search(&fab); + if( status & 1 ) + { /* Existing ZIP file */ + int l; + if( (p=malloc( (l=nam.nam$b_rsl) + 1 )) != NULL ) + { result[l] = 0; + strcpy(p,result); + } + } + else + { /* New ZIP file */ + int l; + if( (p=malloc( (l=nam.nam$b_esl) + 1 )) != NULL ) + { exp[l] = 0; + strcpy(p,exp); + } + } + return p; +} + +#endif /* VMS */ + +#ifndef UTIL + +local void zipoddities(z) +struct zlist far *z; +{ + if ((z->vem >> 8) >= NUM_HOSTS) + { + sprintf(errbuf, "made by version %d.%d on system type %d: ", + (ush)(z->vem & 0xff) / (ush)10, (ush)(z->vem & 0xff) % (ush)10, + z->vem >> 8); + zipwarn(errbuf, z->zname); + } + if (z->ver != 10 && z->ver != 11 && z->ver != 20) + { + sprintf(errbuf, "needs unzip %d.%d on system type %d: ", + (ush)(z->ver & 0xff) / (ush)10, + (ush)(z->ver & 0xff) % (ush)10, z->ver >> 8); + zipwarn(errbuf, z->zname); + } + if (z->flg != z->lflg) + { + sprintf(errbuf, "local flags = 0x%04x, central = 0x%04x: ", + z->lflg, z->flg); + zipwarn(errbuf, z->zname); + } + else if (z->flg & ~0xf) + { + sprintf(errbuf, "undefined bits used in flags = 0x%04x: ", z->flg); + zipwarn(errbuf, z->zname); + } + if (z->how > DEFLATE) + { + sprintf(errbuf, "unknown compression method %u: ", z->how); + zipwarn(errbuf, z->zname); + } + if (z->dsk) + { + sprintf(errbuf, "starts on disk %u: ", z->dsk); + zipwarn(errbuf, z->zname); + } + if (z->att!=ASCII && z->att!=BINARY && z->att!=__EBCDIC) + { + sprintf(errbuf, "unknown internal attributes = 0x%04x: ", z->att); + zipwarn(errbuf, z->zname); + } +#if 0 +/* This test is ridiculous, it produces an error message for almost every */ +/* platform of origin other than MS-DOS, Unix, VMS, and Acorn! Perhaps */ +/* we could test "if (z->dosflag && z->atx & ~0xffL)", but what for? */ + if (((n = z->vem >> 8) != 3) && n != 2 && n != 13 && z->atx & ~0xffL) + { + sprintf(errbuf, "unknown external attributes = 0x%08lx: ", z->atx); + zipwarn(errbuf, z->zname); + } +#endif + if (z->ext || z->cext) + { + if (z->ext && z->cext && z->extra != z->cextra) + { + sprintf(errbuf, + "local extra (%ld bytes) != central extra (%ld bytes): ", + (ulg)z->ext, (ulg)z->cext); + if (noisy) fprintf(stderr, "\tzip info: %s%s\n", errbuf, z->zname); + } +#if (!defined(RISCOS) && !defined(CMS_MVS)) + /* in noisy mode, extra field sizes are always reported */ + else if (noisy) +#else /* RISCOS || CMS_MVS */ +/* avoid warnings for zipfiles created on the same type of OS system! */ +/* or, was this warning really intended (eg. OS/2)? */ + /* Only give info if extra bytes were added by another system */ + else if (noisy && ((z->vem >> 8) != (OS_CODE >> 8))) +#endif /* ?(RISCOS || CMS_MVS) */ + { + fprintf(stderr, "zip info: %s has %ld bytes of %sextra data\n", + z->zname, z->ext ? (ulg)z->ext : (ulg)z->cext, + z->ext ? (z->cext ? "" : "local ") : "central "); + } + } +} + +/* + * scanzipf_fix is called with zip -F or zip -FF + * read the file from front to back and pick up the pieces + * NOTE: there are still checks missing to see if the header + * that was found is *VALID* + */ +local int scanzipf_fix(f) + FILE *f; /* zip file */ +/* + The name of the zip file is pointed to by the global "zipfile". The globals + zipbeg, cenbeg, zfiles, zcount, zcomlen, zcomment, and zsort are filled in. + Return an error code in the ZE_ class. +*/ +{ + ulg a = 0L; /* attributes returned by filetime() */ + char b[CENHEAD]; /* buffer for central headers */ + ush flg; /* general purpose bit flag */ + int m; /* mismatch flag */ + extent n; /* length of name */ + ulg p; /* current file offset */ + ulg s; /* size of data, start of central */ + struct zlist far * far *x; /* pointer last entry's link */ + struct zlist far *z; /* current zip entry structure */ + + /* Get any file attribute valid for this OS, to set in the central + * directory when fixing the archive: + */ +#ifndef UTIL + filetime(zipfile, &a, (long*)&s, NULL); +#endif + x = &zfiles; /* first link */ + p = 0; /* starting file offset */ +#ifdef HANDLE_AMIGA_SFX + amiga_sfx_offset = 0L; +#endif + + /* Find start of zip structures */ + for (;;) { + while ((m = getc(f)) != EOF && m != 0x50) /* 0x50 == 'P' */ + { +#ifdef HANDLE_AMIGA_SFX + if (p == 0 && m == 0) + amiga_sfx_offset = 1L; + else if (amiga_sfx_offset) { + if ((p == 1 && m != 0) || (p == 2 && m != 3) + || (p == 3 && (uch) m != 0xF3)) + amiga_sfx_offset = 0L; + } +#endif /* HANDLE_AMIGA_SFX */ + p++; + } + b[0] = (char) m; + if (fread(b+1, 3, 1, f) != 1 || (s = LG(b)) == LOCSIG || s == ENDSIG) + break; + if (fseek(f, -3L, SEEK_CUR)) + return ferror(f) ? ZE_READ : ZE_EOF; + p++; + } + zipbeg = p; +#ifdef HANDLE_AMIGA_SFX + if (amiga_sfx_offset && zipbeg >= 12 && (zipbeg & 3) == 0 + && fseek(f, -12L, SEEK_CUR) == 0 && fread(b, 12, 1, f) == 1 + && LG(b + 4) == 0xF1030000 /* 1009 in Motorola byte order */) + amiga_sfx_offset = zipbeg - 4; + else + amiga_sfx_offset = 0L; +#endif /* HANDLE_AMIGA_SFX */ + + /* Read local headers */ + while (LG(b) == LOCSIG) + { + if ((z = (struct zlist far *)farmalloc(sizeof(struct zlist))) == NULL || + zcount + 1 < zcount) + return ZE_MEM; + if (fread(b, LOCHEAD, 1, f) != 1) { + farfree((zvoid far *)z); + break; + } + + z->ver = SH(LOCVER + b); + z->vem = (ush)(dosify ? 20 : OS_CODE + Z_MAJORVER * 10 + Z_MINORVER); + z->dosflag = dosify; + flg = z->flg = z->lflg = SH(LOCFLG + b); + z->how = SH(LOCHOW + b); + z->tim = LG(LOCTIM + b); /* time and date into one long */ + z->crc = LG(LOCCRC + b); + z->siz = LG(LOCSIZ + b); + z->len = LG(LOCLEN + b); + n = z->nam = SH(LOCNAM + b); + z->cext = z->ext = SH(LOCEXT + b); + + z->com = 0; + z->dsk = 0; + z->att = 0; + z->atx = dosify ? a & 0xff : a; /* Attributes from filetime() */ + z->mark = 0; + z->trash = 0; + + s = fix > 1 ? 0L : z->siz; /* discard compressed size with -FF */ + + /* Initialize all fields pointing to malloced data to NULL */ + z->zname = z->name = z->iname = z->extra = z->cextra = z->comment = NULL; + + /* Link into list */ + *x = z; + z->nxt = NULL; + x = &z->nxt; + + /* Read file name and extra field and skip data */ + if (n == 0) + { + sprintf(errbuf, "%lu", (ulg)zcount + 1); + zipwarn("zero-length name for entry #", errbuf); +#ifndef DEBUG + return ZE_FORM; +#endif + } + if ((z->iname = malloc(n+1)) == NULL || + (z->ext && (z->extra = malloc(z->ext)) == NULL)) + return ZE_MEM; + if (fread(z->iname, n, 1, f) != 1 || + (z->ext && fread(z->extra, z->ext, 1, f) != 1) || + (s && fseek(f, (long)s, SEEK_CUR))) + return ferror(f) ? ZE_READ : ZE_EOF; + /* If there is an extended local header, s is either 0 or + * the correct compressed size. + */ + z->iname[n] = '\0'; /* terminate name */ + z->zname = in2ex(z->iname); /* convert to external name */ + if (z->zname == NULL) + return ZE_MEM; + z->name = z->zname; + z->cextra = z->extra; + if (noisy) fprintf(mesg, "zip: reading %s\n", z->zname); + + /* Save offset, update for next header */ + z->off = p; + p += 4 + LOCHEAD + n + z->ext + s; + zcount++; + + /* Skip extended local header if there is one */ + if ((flg & 8) != 0) { + /* Skip the compressed data if compressed size is unknown. + * For safety, we should use the central directory. + */ + if (s == 0) { + for (;;) { + while ((m = getc(f)) != EOF && m != 0x50) ; /* 0x50 == 'P' */ + b[0] = (char) m; + if (fread(b+1, 15, 1, f) != 1 || LG(b) == EXTLOCSIG) + break; + if (fseek(f, -15L, SEEK_CUR)) + return ferror(f) ? ZE_READ : ZE_EOF; + } + s = LG(4 + EXTSIZ + b); + p += s; + if ((ulg) ftell(f) != p+16L) { + zipwarn("bad extended local header for ", z->zname); + return ZE_FORM; + } + } else { + /* compressed size non-zero, assume that it is valid: */ + Assert(p == ftell(f), "bad compressed size with extended header"); + + if (fseek(f, p, SEEK_SET) || fread(b, 16, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + if (LG(b) != EXTLOCSIG) { + zipwarn("extended local header not found for ", z->zname); + return ZE_FORM; + } + } + /* overwrite the unknown values of the local header: */ + + /* already in host format */ + z->crc = LG(4 + EXTCRC + b); + z->siz = s; + z->len = LG(4 + EXTLEN + b); + + p += 16L; + } + else if (fix > 1) { + /* Don't trust the compressed size */ + for (;;) { + while ((m = getc(f)) != EOF && m != 0x50) p++; /* 0x50 == 'P' */ + b[0] = (char) m; + if (fread(b+1, 3, 1, f) != 1 || (s = LG(b)) == LOCSIG || s == CENSIG) + break; + if (fseek(f, -3L, SEEK_CUR)) + return ferror(f) ? ZE_READ : ZE_EOF; + p++; + } + s = p - (z->off + 4 + LOCHEAD + n + z->ext); + if (s != z->siz) { + fprintf(mesg, " compressed size %ld, actual size %ld for %s\n", + z->siz, s, z->zname); + z->siz = s; + } + /* next LOCSIG already read at this point, don't read it again: */ + continue; + } + + /* Read next signature */ + if (fread(b, 4, 1, f) != 1) + break; + } + + s = p; /* save start of central */ + + if (LG(b) != CENSIG && noisy) { + fprintf(mesg, "zip warning: %s %s truncated.\n", zipfile, + fix > 1 ? "has been" : "would be"); + + if (fix == 1) { + fprintf(mesg, + "Retry with option -qF to truncate, with -FF to attempt full recovery\n"); + ZIPERR(ZE_FORM, NULL); + } + } + + cenbeg = s; + + if (zipbeg && noisy) + fprintf(mesg, "%s: adjusting offsets for a preamble of %lu bytes\n", + zipfile, zipbeg); + + return ZE_OK; +} + +#endif /* !UTIL */ + +/* + * scanzipf_reg starts searching for the End Signature at the end of the file + * The End Signature points to the Central Directory Signature which points + * to the Local Directory Signature + * XXX probably some more consistency checks are needed + */ +local int scanzipf_reg(f) + FILE *f; /* zip file */ +/* + The name of the zip file is pointed to by the global "zipfile". The globals + zipbeg, cenbeg, zfiles, zcount, zcomlen, zcomment, and zsort are filled in. + Return an error code in the ZE_ class. +*/ +{ + char b[CENHEAD]; /* buffer for central headers */ + ush flg; /* general purpose bit flag */ + int m; /* mismatch flag */ + extent n; /* length of name */ + struct zlist far * far *x; /* pointer last entry's link */ + struct zlist far *z; /* current zip entry structure */ + char *t; /* temporary pointer */ + char far *u; /* temporary variable */ + int found; + char *buf; /* temp buffer for reading zipfile */ + long deltaoff; + + buf = malloc(4096 + 4); + if (buf == NULL) + return ZE_MEM; + +#ifdef HANDLE_AMIGA_SFX + amiga_sfx_offset = (fread(buf, 1, 4, f) == 4 && LG(buf) == 0xF3030000); + /* == 1 if this file is an Amiga executable (presumably UnZipSFX) */ +#endif + found = 0; + t = &buf[4096]; + t[1] = '\0'; + t[2] = '\0'; + t[3] = '\0'; + if (fseek(f, -4096L, SEEK_END) == 0) { + zipbeg = (ulg) (ftell(f) + 4096L); + while (!found && zipbeg >= 4096) { + zipbeg -= 4096L; + buf[4096] = t[1]; + buf[4097] = t[2]; + buf[4098] = t[3]; +/* + * XXX error check ?? + */ + fread(buf, 1, 4096, f); + fseek(f, -8192L, SEEK_CUR); + t = &buf[4095]; +/* + * XXX far pointer arithmetic in DOS + */ + while (t >= buf) { + /* Check for ENDSIG ("PK\5\6" in ASCII) */ + if (LG(t) == ENDSIG) { + found = 1; +/* + * XXX error check ?? + * XXX far pointer arithmetic in DOS + */ + zipbeg += (ulg) (t - buf); + fseek(f, (long) zipbeg + 4L, SEEK_SET); + break; + } + --t; + } + } + } + else + zipbeg = 4096L; +/* + * XXX warn: garbage at the end of the file ignored + */ + if (!found && zipbeg > 0) { + size_t s; + + fseek(f, 0L, SEEK_SET); + clearerr(f); + s = fread(buf, 1, (size_t) zipbeg, f); + buf[s] = t[1]; + buf[s + 1] = t[2]; + buf[s + 2] = t[3]; + t = &buf[s - 1]; +/* + * XXX far pointer comparison in DOS + */ + while (t >= buf) { + /* Check for ENDSIG ("PK\5\6" in ASCII) */ + if (LG(t) == ENDSIG) { + found = 1; +/* + * XXX far pointer arithmetic in DOS + */ + zipbeg = (ulg) (t - buf); + fseek(f, (long) zipbeg + 4L, SEEK_SET); + break; + } + --t; + } + } + free(buf); + if (!found) { + zipwarn("missing end signature--probably not a zip file (did you", ""); + zipwarn("remember to use binary mode when you transferred it?)", ""); + return ZE_FORM; + } + /* Read end header */ + if (fread(b, ENDHEAD, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + if (SH(ENDDSK + b) || SH(ENDBEG + b) || + SH(ENDSUB + b) != SH(ENDTOT + b)) + zipwarn("multiple disk information ignored", ""); + zcomlen = SH(ENDCOM + b); + if (zcomlen) + { + if ((zcomment = malloc(zcomlen)) == NULL) + return ZE_MEM; + if (fread(zcomment, zcomlen, 1, f) != 1) + { + free((zvoid *)zcomment); + zcomment = NULL; + return ferror(f) ? ZE_READ : ZE_EOF; + } +#ifdef EBCDIC + if (zcomment) + memtoebc(zcomment, zcomment, zcomlen); +#endif /* EBCDIC */ + } +/* + * XXX assumes central header immediately precedes end header + */ + cenbeg = zipbeg - LG(ENDSIZ + b); + deltaoff = adjust ? cenbeg - LG(b + ENDOFF) : 0L; + if (fseek(f, cenbeg, SEEK_SET) != 0) { + perror("fseek"); + return ZE_FORM; /* XXX */ + } + + x = &zfiles; /* first link */ + + if (fread(b, 4, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + + while (LG(b) == CENSIG) { + /* Read central header. The portion of the central header that should + be in common with local header is read raw, for later comparison. + (this requires that the offset of ext in the zlist structure + be greater than or equal to LOCHEAD) */ + if (fread(b, CENHEAD, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + if ((z = (struct zlist far *)farmalloc(sizeof(struct zlist))) == NULL) + return ZE_MEM; + z->vem = SH(CENVEM + b); + for (u = (char far *)(&(z->ver)), n = 0; n < (CENNAM-CENVER); n++) + u[n] = b[CENVER + n]; + z->nam = SH(CENNAM + b); /* used before comparing cen vs. loc */ + z->cext = SH(CENEXT + b); /* may be different from z->ext */ + z->com = SH(CENCOM + b); + z->dsk = SH(CENDSK + b); + z->att = SH(CENATT + b); + z->atx = LG(CENATX + b); + z->off = LG(CENOFF + b) + deltaoff; + z->dosflag = (z->vem & 0xff00) == 0; + + /* Initialize all fields pointing to malloced data to NULL */ + z->zname = z->name = z->iname = z->extra = z->cextra = z->comment = NULL; + + /* Link into list */ + *x = z; + z->nxt = NULL; + x = &z->nxt; + + /* Read file name, extra field and comment field */ + if (z->nam == 0) + { + sprintf(errbuf, "%lu", (ulg)zcount + 1); + zipwarn("zero-length name for entry #", errbuf); +#ifndef DEBUG + farfree((zvoid far *)z); + return ZE_FORM; +#endif + } + if ((z->iname = malloc(z->nam+1)) == NULL || + (z->cext && (z->cextra = malloc(z->cext)) == NULL) || + (z->com && (z->comment = malloc(z->com)) == NULL)) + return ZE_MEM; + if (fread(z->iname, z->nam, 1, f) != 1 || + (z->cext && fread(z->cextra, z->cext, 1, f) != 1) || + (z->com && fread(z->comment, z->com, 1, f) != 1)) + return ferror(f) ? ZE_READ : ZE_EOF; + z->iname[z->nam] = '\0'; /* terminate name */ +#ifdef EBCDIC + if (z->com) + memtoebc(z->comment, z->comment, z->com); +#endif /* EBCDIC */ + /* Update zipbeg offset, prepare for next header */ + if (z->off < zipbeg) + zipbeg = z->off; + zcount++; + /* Read next signature */ + if (fread(b, 4, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + } + + /* Point to start of header list and read local headers */ + z = zfiles; + while (z != NULL) { + /* Read next signature */ + if (fseek(f, z->off, SEEK_SET) != 0 || fread(b, 4, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + if (LG(b) == LOCSIG) { + if (fread(b, LOCHEAD, 1, f) != 1) + return ferror(f) ? ZE_READ : ZE_EOF; + z->lflg = SH(LOCFLG + b); + n = SH(LOCNAM + b); + z->ext = SH(LOCEXT + b); + + /* Compare name and extra fields */ + if (n != z->nam) + { +#ifdef EBCDIC + strtoebc(z->iname, z->iname); +#endif + zipwarn("name lengths in local and central differ for ", z->iname); + return ZE_FORM; + } + if ((t = malloc(z->nam)) == NULL) + return ZE_MEM; + if (fread(t, z->nam, 1, f) != 1) + { + free((zvoid *)t); + return ferror(f) ? ZE_READ : ZE_EOF; + } + if (memcmp(t, z->iname, z->nam)) + { + free((zvoid *)t); +#ifdef EBCDIC + strtoebc(z->iname, z->iname); +#endif + zipwarn("names in local and central differ for ", z->iname); + return ZE_FORM; + } + free((zvoid *)t); + if (z->ext) + { + if ((z->extra = malloc(z->ext)) == NULL) + return ZE_MEM; + if (fread(z->extra, z->ext, 1, f) != 1) + { + free((zvoid *)(z->extra)); + return ferror(f) ? ZE_READ : ZE_EOF; + } + if (z->ext == z->cext && memcmp(z->extra, z->cextra, z->ext) == 0) + { + free((zvoid *)(z->extra)); + z->extra = z->cextra; + } + } + + /* Check extended local header if there is one */ + if ((z->lflg & 8) != 0) + { + char buf2[16]; + ulg s; /* size of compressed data */ + + s = LG(LOCSIZ + b); + if (s == 0) + s = LG((CENSIZ-CENVER) + (char far *)(&(z->ver))); + if (fseek(f, (z->off + (4+LOCHEAD) + z->nam + z->ext + s), SEEK_SET) + || (fread(buf2, 16, 1, f) != 1)) + return ferror(f) ? ZE_READ : ZE_EOF; + if (LG(buf2) != EXTLOCSIG) + { +#ifdef EBCDIC + strtoebc(z->iname, z->iname); +#endif + zipwarn("extended local header not found for ", z->iname); + return ZE_FORM; + } + /* overwrite the unknown values of the local header: */ + for (n = 0; n < 12; n++) + b[LOCCRC+n] = buf2[4+n]; + } + + /* Compare local header with that part of central header (except + for the reserved bits in the general purpose flags and except + for the already checked entry name length */ + u = (char far *)(&(z->ver)); + flg = SH((CENFLG-CENVER) + u); /* Save central flags word */ + u[CENFLG-CENVER+1] &= 0x1f; /* Mask reserved flag bits */ + b[LOCFLG+1] &= 0x1f; + for (m = 0, n = 0; n < LOCNAM; n++) + if (b[n] != u[n]) + { + if (!m) + { + zipwarn("local and central headers differ for ", z->zname); + m = 1; + } + if (noisy) + { + sprintf(errbuf, " offset %u--local = %02x, central = %02x", + (unsigned)n, (uch)b[n], (uch)u[n]); + zipwarn(errbuf, ""); + } + } + if (m && !adjust) + return ZE_FORM; + + /* Complete the setup of the zlist entry by translating the remaining + * central header fields in memory, starting with the fields with + * highest offset. This order of the conversion commands takes into + * account potential buffer overlaps caused by structure padding. + */ + z->len = LG((CENLEN-CENVER) + u); + z->siz = LG((CENSIZ-CENVER) + u); + z->crc = LG((CENCRC-CENVER) + u); + z->tim = LG((CENTIM-CENVER) + u); /* time and date into one long */ + z->how = SH((CENHOW-CENVER) + u); + z->flg = flg; /* may be different from z->lflg */ + z->ver = SH((CENVER-CENVER) + u); + + /* Clear actions */ + z->mark = 0; + z->trash = 0; +#ifdef UTIL +/* We only need z->iname in the utils */ + z->name = z->iname; +#ifdef EBCDIC +/* z->zname is used for printing and must be coded in native charset */ + if ((z->zname = malloc(z->nam+1)) == NULL) + return ZE_MEM; + strtoebc(z->zname, z->iname); +#else + z->zname = z->iname; +#endif +#else /* !UTIL */ + z->zname = in2ex(z->iname); /* convert to external name */ + if (z->zname == NULL) + return ZE_MEM; + z->name = z->zname; +#endif /* ?UTIL */ + } + else { +#ifdef EBCDIC + strtoebc(z->iname, z->iname); +#endif + zipwarn("local header not found for ", z->iname); + return ZE_FORM; + } +#ifndef UTIL + if (verbose) + zipoddities(z); +#endif + z = z->nxt; + } + + if (zipbeg && noisy) + fprintf(mesg, "%s: %s a preamble of %lu bytes\n", + zipfile, adjust ? "adjusting offsets for" : "found", zipbeg); + +#ifdef HANDLE_AMIGA_SFX + if (zipbeg < 12 || (zipbeg & 3) != 0 /* must be longword aligned */) + amiga_sfx_offset = 0; + else if (amiga_sfx_offset) { + char buf2[16]; + if (!fseek(f, zipbeg - 12, SEEK_SET) && fread(buf2, 12, 1, f) == 1) { + if (LG(buf2 + 4) == 0xF1030000 /* 1009 in Motorola byte order */) + /* could also check if LG(buf2) == 0xF2030000... no for now */ + amiga_sfx_offset = zipbeg - 4; + else + amiga_sfx_offset = 0L; + } + } +#endif /* HANDLE_AMIGA_SFX */ + return ZE_OK; +} + + +/* + * readzipfile initializes the global variables that hold the zipfile + * directory info and opens the zipfile. For the actual zipfile scan, + * the subroutine scanzipf_reg() or scanzipf_fix() is called, + * depending on the mode of operation (regular processing, or zipfix mode). + */ +int readzipfile() +/* + The name of the zip file is pointed to by the global "zipfile". + The globals zipbeg, zfiles, zcount, and zcomlen are initialized. + Return an error code in the ZE_ class. +*/ +{ + FILE *f; /* zip file */ + int retval; /* return code */ + int readable; /* 1 if zipfile exists and is readable */ + + /* Initialize zip file info */ + zipbeg = 0; + zfiles = NULL; /* Points to first header */ + zcount = 0; /* number of files */ + zcomlen = 0; /* zip file comment length */ + retval = ZE_OK; + f = NULL; /* shut up some compilers */ + + /* If zip file exists, read headers and check structure */ +#ifdef VMS + if (zipfile == NULL || !(*zipfile) || !strcmp(zipfile, "-")) + return ZE_OK; + { + int rtype; + + if ((VMSmunch(zipfile, GET_RTYPE, (char *)&rtype) == RMS$_NORMAL) && + (rtype == FAT$C_VARIABLE)) { + fprintf(stderr, + "\n Error: zipfile is in variable-length record format. Please\n\ + run \"bilf b %s\" to convert the zipfile to fixed-length\n\ + record format.\n\n", zipfile); + return ZE_FORM; + } + } + readable = ((f = fopen(zipfile, FOPR)) != NULL); +#else /* !VMS */ + readable = (zipfile != NULL && *zipfile && strcmp(zipfile, "-") && + (f = fopen(zipfile, FOPR)) != NULL); +#endif /* ?VMS */ +#ifdef MVS + /* Very nasty special case for MVS. Just because the zipfile has been + * opened for reading does not mean that we can actually read the data. + * Typical JCL to create a zipfile is + * + * //ZIPFILE DD DISP=(NEW,CATLG),DSN=prefix.ZIP, + * // SPACE=(CYL,(10,10)) + * + * That creates a VTOC entry with an end of file marker (DS1LSTAR) of zero. + * Alas the VTOC end of file marker is only used when the file is opened in + * append mode. When a file is opened in read mode, the "other" end of file + * marker is used, a zero length data block signals end of file when reading. + * With a brand new file which has not been written to yet, it is undefined + * what you read off the disk. In fact you read whatever data was in the same + * disk tracks before the zipfile was allocated. You would be amazed at the + * number of application programmers who still do not understand this. Makes + * for interesting and semi-random errors, GIGO. + * + * Newer versions of SMS will automatically write a zero length block when a + * file is allocated. However not all sites run SMS or they run older levels + * so we cannot rely on that. The only safe thing to do is close the file, + * open in append mode (we already know that the file exists), close it again, + * reopen in read mode and try to read a data block. Opening and closing in + * append mode will write a zero length block where DS1LSTAR points, making + * sure that the VTOC and internal end of file markers are in sync. Then it + * is safe to read data. If we cannot read one byte of data after all that, + * it is a brand new zipfile and must not be read. + */ + if (readable) + { + char c; + fclose(f); + /* append mode */ + if ((f = fopen(zipfile, "ab")) == NULL) { + ZIPERR(ZE_OPEN, zipfile); + } + fclose(f); + /* read mode again */ + if ((f = fopen(zipfile, FOPR)) == NULL) { + ZIPERR(ZE_OPEN, zipfile); + } + if (fread(&c, 1, 1, f) != 1) { + /* no actual data */ + readable = 0; + fclose(f); + } + else{ + fseek(f, 0, SEEK_SET); /* at least one byte in zipfile, back to the start */ + } + } +#endif /* MVS */ + if (readable) + { +#ifndef UTIL + retval = (fix && !adjust) ? scanzipf_fix(f) : scanzipf_reg(f); +#else + retval = scanzipf_reg(f); +#endif + + /* Done with zip file for now */ + fclose(f); + + /* If one or more files, sort by name */ + if (zcount) + { + struct zlist far * far *x; /* pointer into zsort array */ + struct zlist far *z; /* pointer into zfiles linked list */ + extent zl_size = zcount * sizeof(struct zlist far *); + + if (zl_size / sizeof(struct zlist far *) != zcount || + (x = zsort = (struct zlist far **)malloc(zl_size)) == NULL) + return ZE_MEM; + for (z = zfiles; z != NULL; z = z->nxt) + *x++ = z; + qsort((char *)zsort, zcount, sizeof(struct zlist far *), zqcmp); + } + } + return retval; +} + + +int putlocal(z, f) +struct zlist far *z; /* zip entry to write local header for */ +FILE *f; /* file to write to */ +/* Write a local header described by *z to file *f. Return an error code + in the ZE_ class. */ +{ + PUTLG(LOCSIG, f); + PUTSH(z->ver, f); + PUTSH(z->lflg, f); + PUTSH(z->how, f); + PUTLG(z->tim, f); + PUTLG(z->crc, f); + PUTLG(z->siz, f); + PUTLG(z->len, f); + PUTSH(z->nam, f); + PUTSH(z->ext, f); + if (fwrite(z->iname, 1, z->nam, f) != z->nam || + (z->ext && fwrite(z->extra, 1, z->ext, f) != z->ext)) + return ZE_TEMP; + return ZE_OK; +} + +int putextended(z, f) +struct zlist far *z; /* zip entry to write local header for */ +FILE *f; /* file to write to */ +/* Write an extended local header described by *z to file *f. + * Return an error code in the ZE_ class. */ +{ + PUTLG(EXTLOCSIG, f); + PUTLG(z->crc, f); + PUTLG(z->siz, f); + PUTLG(z->len, f); + return ZE_OK; +} + +int putcentral(z, f) +struct zlist far *z; /* zip entry to write central header for */ +FILE *f; /* file to write to */ +/* Write a central header described by *z to file *f. Return an error code + in the ZE_ class. */ +{ + PUTLG(CENSIG, f); + PUTSH(z->vem, f); + PUTSH(z->ver, f); + PUTSH(z->flg, f); + PUTSH(z->how, f); + PUTLG(z->tim, f); + PUTLG(z->crc, f); + PUTLG(z->siz, f); + PUTLG(z->len, f); + PUTSH(z->nam, f); + PUTSH(z->cext, f); + PUTSH(z->com, f); + PUTSH(z->dsk, f); + PUTSH(z->att, f); + PUTLG(z->atx, f); + PUTLG(z->off, f); +#ifdef EBCDIC + if (z->com) + memtoasc(z->comment, z->comment, z->com); +#endif /* EBCDIC */ + if (fwrite(z->iname, 1, z->nam, f) != z->nam || + (z->cext && fwrite(z->cextra, 1, z->cext, f) != z->cext) || + (z->com && fwrite(z->comment, 1, z->com, f) != z->com)) + return ZE_TEMP; + return ZE_OK; +} + + +int putend(n, s, c, m, z, f) +int n; /* number of entries in central directory */ +ulg s; /* size of central directory */ +ulg c; /* offset of central directory */ +extent m; /* length of zip file comment (0 if none) */ +char *z; /* zip file comment if m != 0 */ +FILE *f; /* file to write to */ +/* Write the end of central directory data to file *f. Return an error code + in the ZE_ class. */ +{ + PUTLG(ENDSIG, f); + PUTSH(0, f); + PUTSH(0, f); + PUTSH(n, f); + PUTSH(n, f); + PUTLG(s, f); + PUTLG(c, f); + PUTSH(m, f); +/* Write the comment, if any */ +#ifdef EBCDIC + memtoasc(z, z, m); +#endif + if (m && fwrite(z, 1, m, f) != m) + return ZE_TEMP; + +#ifdef HANDLE_AMIGA_SFX + if (amiga_sfx_offset && zipbeg /* -J zeroes this */) { + s = ftell(f); + while (s & 3) s++, putc(0, f); /* final marker must be longword aligned */ + PUTLG(0xF2030000 /* 1010 in Motorola byte order */, f); + c = (s - amiga_sfx_offset - 4) / 4; /* size of archive part in longwords */ + if (fseek(f, amiga_sfx_offset, SEEK_SET) != 0) + return ZE_TEMP; + c = ((c >> 24) & 0xFF) | ((c >> 8) & 0xFF00) + | ((c & 0xFF00) << 8) | ((c & 0xFF) << 24); /* invert byte order */ + PUTLG(c, f); + fseek(f, 0, SEEK_END); /* just in case */ + } +#endif + return ZE_OK; +} + + +/* Note: a zip "entry" includes a local header (which includes the file + name), an encryption header if encrypting, the compressed data + and possibly an extended local header. */ + +int zipcopy(z, x, y) +struct zlist far *z; /* zip entry to copy */ +FILE *x, *y; /* source and destination files */ +/* Copy the zip entry described by *z from file *x to file *y. Return an + error code in the ZE_ class. Also update tempzn by the number of bytes + copied. */ +{ + ulg n; /* holds local header offset */ + + Trace((stderr, "zipcopy %s\n", z->zname)); + n = (ulg)(4 + LOCHEAD) + (ulg)z->nam + (ulg)z->ext; + + if (fix > 1) { + if (fseek(x, z->off + n, SEEK_SET)) /* seek to compressed data */ + return ferror(x) ? ZE_READ : ZE_EOF; + + if (fix > 2) { + /* Update length of entry's name, it may have been changed. This is + needed to support the ZipNote ability to rename archive entries. */ + z->nam = strlen(z->iname); + n = (ulg)(4 + LOCHEAD) + (ulg)z->nam + (ulg)z->ext; + } + + /* do not trust the old compressed size */ + if (putlocal(z, y) != ZE_OK) + return ZE_TEMP; + + z->off = tempzn; + tempzn += n; + n = z->siz; + } else { + if (fseek(x, z->off, SEEK_SET)) /* seek to local header */ + return ferror(x) ? ZE_READ : ZE_EOF; + + z->off = tempzn; + n += z->siz; + } + /* copy the compressed data and the extended local header if there is one */ + if (z->lflg & 8) n += 16; + tempzn += n; + return fcopy(x, y, n); +} + + +#ifndef UTIL + +#ifdef USE_EF_UT_TIME + +local int ef_scan_ut_time(ef_buf, ef_len, ef_is_cent, z_utim) +char *ef_buf; /* buffer containing extra field */ +extent ef_len; /* total length of extra field */ +int ef_is_cent; /* flag indicating "is central extra field" */ +iztimes *z_utim; /* return storage: atime, mtime, ctime */ +/* This function scans the extra field for EF_TIME or EF_IZUNIX blocks + * containing Unix style time_t (GMT) values for the entry's access, creation + * and modification time. + * If a valid block is found, all time stamps are copied to the iztimes + * structure. + * The presence of an EF_TIME or EF_IZUNIX2 block results in ignoring + * all data from probably present obsolete EF_IZUNIX blocks. + * If multiple blocks of the same type are found, only the information from + * the last block is used. + * The return value is the EF_TIME Flags field (simulated in case of an + * EF_IZUNIX block) or 0 in case of failure. + */ +{ + int flags = 0; + unsigned eb_id; + extent eb_len; + int have_new_type_eb = FALSE; + + if (ef_len == 0 || ef_buf == NULL) + return 0; + + Trace((stderr,"\nef_scan_ut_time: scanning extra field of length %u\n", + ef_len)); + while (ef_len >= EB_HEADSIZE) { + eb_id = SH(EB_ID + ef_buf); + eb_len = SH(EB_LEN + ef_buf); + + if (eb_len > (ef_len - EB_HEADSIZE)) { + /* Discovered some extra field inconsistency! */ + Trace((stderr,"ef_scan_ut_time: block length %u > rest ef_size %u\n", + eb_len, ef_len - EB_HEADSIZE)); + break; + } + + switch (eb_id) { + case EF_TIME: + flags &= ~0x00ff; /* ignore previous IZUNIX or EF_TIME fields */ + have_new_type_eb = TRUE; + if ( eb_len >= EB_UT_MINLEN && z_utim != NULL) { + unsigned eb_idx = EB_UT_TIME1; + Trace((stderr,"ef_scan_ut_time: Found TIME extra field\n")); + flags |= (ef_buf[EB_HEADSIZE+EB_UT_FLAGS] & 0x00ff); + if ((flags & EB_UT_FL_MTIME)) { + if ((eb_idx+4) <= eb_len) { + z_utim->mtime = LG((EB_HEADSIZE+eb_idx) + ef_buf); + eb_idx += 4; + Trace((stderr," Unix EF modtime = %ld\n", z_utim->mtime)); + } else { + flags &= ~EB_UT_FL_MTIME; + Trace((stderr," Unix EF truncated, no modtime\n")); + } + } + if (ef_is_cent) { + break; /* central version of TIME field ends here */ + } + if (flags & EB_UT_FL_ATIME) { + if ((eb_idx+4) <= eb_len) { + z_utim->atime = LG((EB_HEADSIZE+eb_idx) + ef_buf); + eb_idx += 4; + Trace((stderr," Unix EF acctime = %ld\n", z_utim->atime)); + } else { + flags &= ~EB_UT_FL_ATIME; + } + } + if (flags & EB_UT_FL_CTIME) { + if ((eb_idx+4) <= eb_len) { + z_utim->ctime = LG((EB_HEADSIZE+eb_idx) + ef_buf); + /* eb_idx += 4; */ /* superfluous for now ... */ + Trace((stderr," Unix EF cretime = %ld\n", z_utim->ctime)); + } else { + flags &= ~EB_UT_FL_CTIME; + } + } + } + break; + + case EF_IZUNIX2: + if (!have_new_type_eb) { + flags &= ~0x00ff; /* ignore any previous IZUNIX field */ + have_new_type_eb = TRUE; + } + break; + + case EF_IZUNIX: + if (eb_len >= EB_UX_MINLEN) { + Trace((stderr,"ef_scan_ut_time: Found IZUNIX extra field\n")); + if (have_new_type_eb) { + break; /* Ignore IZUNIX extra field block ! */ + } + z_utim->atime = LG((EB_HEADSIZE+EB_UX_ATIME) + ef_buf); + z_utim->mtime = LG((EB_HEADSIZE+EB_UX_MTIME) + ef_buf); + Trace((stderr," Unix EF access time = %ld\n",z_utim->atime)); + Trace((stderr," Unix EF modif. time = %ld\n",z_utim->mtime)); + flags |= (EB_UT_FL_MTIME | EB_UT_FL_ATIME); /* signal success */ + } + break; + + case EF_THEOS: +/* printf("Not implemented yet\n"); */ + break; + + default: + break; + } + /* Skip this extra field block */ + ef_buf += (eb_len + EB_HEADSIZE); + ef_len -= (eb_len + EB_HEADSIZE); + } + + return flags; +} + +int get_ef_ut_ztime(z, z_utim) +struct zlist far *z; +iztimes *z_utim; +{ + int r; + +#ifdef IZ_CHECK_TZ + if (!zp_tz_is_valid) return 0; +#endif + + /* First, scan local extra field. */ + r = ef_scan_ut_time(z->extra, z->ext, FALSE, z_utim); + + /* If this was not successful, try central extra field, but only if + it is really different. */ + if (!r && z->cext > 0 && z->cextra != z->extra) + r = ef_scan_ut_time(z->cextra, z->cext, TRUE, z_utim); + + return r; +} + +#endif /* USE_EF_UT_TIME */ + + +local void cutpath(p, delim) +char *p; /* path string */ +int delim; /* path component separator char */ +/* Cut the last path component off the name *p in place. + * This should work on both internal and external names. + */ +{ + char *r; /* pointer to last path delimiter */ + +#ifdef VMS /* change [w.x.y]z to [w.x]y.DIR */ + if ((r = MBSRCHR(p, ']')) != NULL) + { + *r = 0; + if ((r = MBSRCHR(p, '.')) != NULL) + { + *r = ']'; + strcat(r, ".DIR;1"); /* this assumes a little padding--see PAD */ + } else { + *p = 0; + } + } else { + if ((r = MBSRCHR(p, delim)) != NULL) + *r = 0; + else + *p = 0; + } +#else /* !VMS */ + if ((r = MBSRCHR(p, delim)) != NULL) + *r = 0; + else + *p = 0; +#endif /* ?VMS */ +} + +int trash() +/* Delete the compressed files and the directories that contained the deleted + files, if empty. Return an error code in the ZE_ class. Failure of + destroy() or deletedir() is ignored. */ +{ + extent i; /* counter on deleted names */ + extent n; /* number of directories to delete */ + struct zlist far **s; /* table of zip entries to handle, sorted */ + struct zlist far *z; /* current zip entry */ + + /* Delete marked names and count directories */ + n = 0; + for (z = zfiles; z != NULL; z = z->nxt) + if (z->mark == 1 || z->trash) + { + z->mark = 1; + if (z->iname[z->nam - 1] != (char)0x2f) { /* don't unlink directory */ + if (verbose) + fprintf(mesg, "zip diagnostic: deleting file %s\n", z->name); + if (destroy(z->name)) { + zipwarn("error deleting ", z->name); + } + /* Try to delete all paths that lead up to marked names. This is + * necessary only with the -D option. + */ + if (!dirnames) { + cutpath(z->name, '/'); /* XXX wrong ??? */ + cutpath(z->iname, 0x2f); /* 0x2f = ascii['/'] */ + z->nam = strlen(z->iname); + if (z->nam > 0) { + z->iname[z->nam - 1] = (char)0x2f; + z->iname[z->nam++] = '\0'; + } + if (z->nam > 0) n++; + } + } else { + n++; + } + } + + /* Construct the list of all marked directories. Some may be duplicated + * if -D was used. + */ + if (n) + { + if ((s = (struct zlist far **)malloc(n*sizeof(struct zlist far *))) == + NULL) + return ZE_MEM; + n = 0; + for (z = zfiles; z != NULL; z = z->nxt) { + if (z->mark && z->nam > 0 && z->iname[z->nam - 1] == (char)0x2f /* '/' */ + && (n == 0 || strcmp(z->name, s[n-1]->name) != 0)) { + s[n++] = z; + } + } + /* Sort the files in reverse order to get subdirectories first. + * To avoid problems with strange naming conventions as in VMS, + * we sort on the internal names, so x/y/z will always be removed + * before x/y. On VMS, x/y/z > x/y but [x.y.z] < [x.y] + */ + qsort((char *)s, n, sizeof(struct zlist far *), rqcmp); + + for (i = 0; i < n; i++) { + char *p = s[i]->name; + if (*p == '\0') continue; + if (p[strlen(p) - 1] == '/') { /* keep VMS [x.y]z.dir;1 intact */ + p[strlen(p) - 1] = '\0'; + } + if (i == 0 || strcmp(s[i]->name, s[i-1]->name) != 0) { + if (verbose) { + fprintf(mesg, "deleting directory %s (if empty) \n", + s[i]->name); + } + deletedir(s[i]->name); + } + } + free((zvoid *)s); + } + return ZE_OK; +} + +#endif /* !UTIL */ + +const char *BOINC_RCSID_c79991acf7 = "$Id: zipfile.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/zip.h boinc-7.0.14+dfsg/zip/zip/zip.h --- boinc-7.0.7+dfsg/zip/zip/zip.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zip.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,566 @@ +/* +This is version 1999-Oct-05 of the Info-ZIP copyright and license. +The definitive version of this document should be available at +ftp://ftp.cdrom.com/pub/infozip/license.html indefinitely. + + +Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + +For the purposes of this copyright and license, "Info-ZIP" is defined as +the following set of individuals: + + Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, + Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase, + Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum, + Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller, + Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel, + Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen, + Paul von Behren, Rich Wales, Mike White + +This software is provided "as is," without warranty of any kind, express +or implied. In no event shall Info-ZIP or its contributors be held liable +for any direct, indirect, incidental, special or consequential damages +arising out of the use of or inability to use this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. Redistributions of source code must retain the above copyright notice, + definition, disclaimer, and this list of conditions. + + 2. Redistributions in binary form must reproduce the above copyright + notice, definition, disclaimer, and this list of conditions in + documentation and/or other materials provided with the distribution. + + 3. Altered versions--including, but not limited to, ports to new operating + systems, existing ports with new graphical interfaces, and dynamic, + shared, or static library versions--must be plainly marked as such + and must not be misrepresented as being the original source. Such + altered versions also must not be misrepresented as being Info-ZIP + releases--including, but not limited to, labeling of the altered + versions with the names "Info-ZIP" (or any variation thereof, including, + but not limited to, different capitalizations), "Pocket UnZip," "WiZ" + or "MacZip" without the explicit permission of Info-ZIP. Such altered + versions are further prohibited from misrepresentative use of the + Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s). + + 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," + "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and + binary releases. +*/ + +/* + * zip.h by Mark Adler + */ +#ifndef __zip_h +#define __zip_h 1 + +#define ZIP /* for crypt.c: include zip password functions, not unzip */ + +/* Set up portability */ +#include "tailor.h" + +#ifdef USE_ZLIB +# include "zlib.h" +#endif + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#ifndef WSIZE +# define WSIZE (0x8000) +#endif +/* Maximum window size = 32K. If you are really short of memory, compile + * with a smaller WSIZE but this reduces the compression ratio for files + * of size > WSIZE. WSIZE must be a power of two in the current implementation. + */ + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST (WSIZE-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + +/* Forget FILENAME_MAX (incorrectly = 14 on some System V) */ +#ifdef DOS +# define FNMAX 256 +#else +# define FNMAX 1024 +#endif + +#ifndef MATCH +# define MATCH dosmatch /* Default for pattern matching: UNIX style */ +#endif + +/* Types centralized here for easy modification */ +#define local static /* More meaningful outside functions */ +#ifndef UCH_TYPE +#define UCH_TYPE +typedef unsigned char uch; /* unsigned 8-bit value */ +typedef unsigned short ush; /* unsigned 16-bit value */ +typedef unsigned long ulg; /* unsigned 32-bit value */ +#endif + +/* Structure carrying extended timestamp information */ +typedef struct iztimes { + time_t atime; /* new access time */ + time_t mtime; /* new modification time */ + time_t ctime; /* new creation time (!= Unix st.ctime) */ +} iztimes; + +/* Lengths of headers after signatures in bytes */ +#define LOCHEAD 26 +#define CENHEAD 42 +#define ENDHEAD 18 + +/* Structures for in-memory file information */ +struct zlist { + /* See central header in zipfile.c for what vem..off are */ + ush vem, ver, flg, how; + ulg tim, crc, siz, len; + extent nam, ext, cext, com; /* offset of ext must be >= LOCHEAD */ + ush dsk, att, lflg; /* offset of lflg must be >= LOCHEAD */ + ulg atx, off; + char *name; /* File name in zip file */ + char *extra; /* Extra field (set only if ext != 0) */ + char *cextra; /* Extra in central (set only if cext != 0) */ + char *comment; /* Comment (set only if com != 0) */ + char *iname; /* Internal file name after cleanup */ + char *zname; /* External version of internal name */ + int mark; /* Marker for files to operate on */ + int trash; /* Marker for files to delete */ + int dosflag; /* Set to force MSDOS file attributes */ + struct zlist far *nxt; /* Pointer to next header in list */ +}; +struct flist { + char *name; /* Raw internal file name */ + char *iname; /* Internal file name after cleanup */ + char *zname; /* External version of internal name */ + int dosflag; /* Set to force MSDOS file attributes */ + struct flist far *far *lst; /* Pointer to link pointing here */ + struct flist far *nxt; /* Link to next name */ +}; +struct plist { + char *zname; /* External version of internal name */ + int select; /* Selection flag ('i' or 'x') */ +}; + +/* internal file attribute */ +#define UNKNOWN (-1) +#define BINARY 0 +#define ASCII 1 +#define __EBCDIC 2 + +/* extra field definitions */ +#define EF_VMCMS 0x4704 /* VM/CMS Extra Field ID ("G")*/ +#define EF_MVS 0x470f /* MVS Extra Field ID ("G") */ +#define EF_IZUNIX 0x5855 /* UNIX Extra Field ID ("UX") */ +#define EF_IZUNIX2 0x7855 /* Info-ZIP's new Unix ("Ux") */ +#define EF_TIME 0x5455 /* universal timestamp ("UT") */ +#define EF_OS2EA 0x0009 /* OS/2 Extra Field ID (extended attributes) */ +#define EF_ACL 0x4C41 /* ACL Extra Field ID (access control list, "AL") */ +#define EF_NTSD 0x4453 /* NT Security Descriptor Extra Field ID, ("SD") */ +#define EF_BEOS 0x6542 /* BeOS Extra Field ID ("Be") */ +#define EF_QDOS 0xfb4a /* SMS/QDOS ("J\373") */ +#define EF_AOSVS 0x5356 /* AOS/VS ("VS") */ +#define EF_SPARK 0x4341 /* David Pilling's Acorn/SparkFS ("AC") */ +#define EF_THEOS 0x6854 /* THEOS ("Th") */ +#define EF_TANDEM 0x4154 /* Tandem NSK ("TA") */ + +/* Definitions for extra field handling: */ +#define EF_SIZE_MAX ((unsigned)0xFFFF) /* hard limit of total e.f. length */ +#define EB_HEADSIZE 4 /* length of a extra field block header */ +#define EB_ID 0 /* offset of block ID in header */ +#define EB_LEN 2 /* offset of data length field in header */ + +#define EB_UX_MINLEN 8 /* minimal "UX" field contains atime, mtime */ +#define EB_UX_ATIME 0 /* offset of atime in "UX" extra field data */ +#define EB_UX_MTIME 4 /* offset of mtime in "UX" extra field data */ + +#define EB_UX_FULLSIZE 12 /* full "UX" field (atime, mtime, uid, gid) */ +#define EB_UX_UID 8 /* byte offset of UID in "UX" field data */ +#define EB_UX_GID 10 /* byte offset of GID in "UX" field data */ + +#define EB_UT_MINLEN 1 /* minimal UT field contains Flags byte */ +#define EB_UT_FLAGS 0 /* byte offset of Flags field */ +#define EB_UT_TIME1 1 /* byte offset of 1st time value */ +#define EB_UT_FL_MTIME (1 << 0) /* mtime present */ +#define EB_UT_FL_ATIME (1 << 1) /* atime present */ +#define EB_UT_FL_CTIME (1 << 2) /* ctime present */ +#define EB_UT_LEN(n) (EB_UT_MINLEN + 4 * (n)) + +#define EB_UX2_MINLEN 4 /* minimal Ux field contains UID/GID */ +#define EB_UX2_UID 0 /* byte offset of UID in "Ux" field data */ +#define EB_UX2_GID 2 /* byte offset of GID in "Ux" field data */ +#define EB_UX2_VALID (1 << 8) /* UID/GID present */ + +/* ASCII definitions for line terminators in text files: */ +#define LF 10 /* '\n' on ASCII machines; must be 10 due to EBCDIC */ +#define CR 13 /* '\r' on ASCII machines; must be 13 due to EBCDIC */ +#define CTRLZ 26 /* DOS & OS/2 EOF marker (used in fileio.c, vms.c) */ + +/* return codes of password fetches (negative: user abort; positive: error) */ +#define IZ_PW_ENTERED 0 /* got some PWD string, use/try it */ +#define IZ_PW_CANCEL -1 /* no password available (for this entry) */ +#define IZ_PW_CANCELALL -2 /* no password, skip any further PWD request */ +#define IZ_PW_ERROR 5 /* = PK_MEM2 : failure (no mem, no tty, ...) */ +#define IZ_PW_SKIPVERIFY IZ_PW_CANCEL /* skip encrypt. passwd verification */ + +/* mode flag values of password prompting function */ +#define ZP_PW_ENTER 0 /* request for encryption password */ +#define ZP_PW_VERIFY 1 /* request for reentering password */ + +/* Error return codes and PERR macro */ +#include "ziperr.h" + +#if 0 /* Optimization: use the (const) result of crc32(0L,NULL,0) */ +# define CRCVAL_INITIAL crc32(0L, (uch *)NULL, 0) +#else +# define CRCVAL_INITIAL 0L +#endif + +#define DOSTIME_MINIMUM ((ulg)0x00210000L) +#define DOSTIME_2038_01_18 ((ulg)0x74320000L) + + +/* Public globals */ +extern uch upper[256]; /* Country dependent case map table */ +extern uch lower[256]; +#ifdef EBCDIC +extern ZCONST uch ascii[256]; /* EBCDIC <--> ASCII translation tables */ +extern ZCONST uch ebcdic[256]; +#endif /* EBCDIC */ +#ifdef IZ_ISO2OEM_ARRAY /* ISO 8859-1 (Win CP 1252) --> OEM CP 850 */ +extern ZCONST uch Far iso2oem[128]; +#endif +#ifdef IZ_OEM2ISO_ARRAY /* OEM CP 850 --> ISO 8859-1 (Win CP 1252) */ +extern ZCONST uch Far oem2iso[128]; +#endif +extern char errbuf[FNMAX+81]; /* Handy place to build error messages */ +extern int recurse; /* Recurse into directories encountered */ +extern int dispose; /* Remove files after put in zip file */ +extern int pathput; /* Store path with name */ + +#ifdef RISCOS +extern int scanimage; /* Scan through image files */ +#endif + +#define BEST -1 /* Use best method (deflation or store) */ +#define STORE 0 /* Store method */ +#define DEFLATE 8 /* Deflation method*/ +extern int method; /* Restriction on compression method */ + +extern int dosify; /* Make new entries look like MSDOS */ +extern char *special; /* Don't compress special suffixes */ +extern int verbose; /* Report oddities in zip file structure */ +extern int fix; /* Fix the zip file */ +extern int adjust; /* Adjust the unzipsfx'd zip file */ +extern int level; /* Compression level */ +extern int translate_eol; /* Translate end-of-line LF -> CR LF */ +#ifdef VMS + extern int vmsver; /* Append VMS version number to file names */ + extern int vms_native; /* Store in VMS format */ +#endif /* VMS */ +#if defined(OS2) || defined(WIN32) + extern int use_longname_ea; /* use the .LONGNAME EA as the file's name */ +#endif +#if defined (QDOS) || defined(QLZIP) +extern short qlflag; +#endif +extern int hidden_files; /* process hidden and system files */ +extern int volume_label; /* add volume label */ +extern int dirnames; /* include directory names */ +extern int linkput; /* Store symbolic links as such */ +extern int noisy; /* False for quiet operation */ +extern int extra_fields; /* do not create extra fields */ +#ifdef WIN32 + extern int use_privileges; /* use security privilege overrides */ +#endif +extern char *key; /* Scramble password or NULL */ +extern char *tempath; /* Path for temporary files */ +extern FILE *mesg; /* Where informational output goes */ +extern char *zipfile; /* New or existing zip archive (zip file) */ +extern ulg zipbeg; /* Starting offset of zip structures */ +extern ulg cenbeg; /* Starting offset of central directory */ +extern struct zlist far *zfiles;/* Pointer to list of files in zip file */ +extern extent zcount; /* Number of files in zip file */ +extern extent zcomlen; /* Length of zip file comment */ +extern char *zcomment; /* Zip file comment (not zero-terminated) */ +extern struct zlist far **zsort;/* List of files sorted by name */ +extern ulg tempzn; /* Count of bytes written to output zip file */ +extern struct flist far *found; /* List of names found */ +extern struct flist far *far *fnxt; /* Where to put next in found list */ +extern extent fcount; /* Count of names in found list */ + +extern struct plist *patterns; /* List of patterns to be matched */ +extern unsigned pcount; /* number of patterns */ +extern unsigned icount; /* number of include only patterns */ + +#ifdef IZ_CHECK_TZ +extern int zp_tz_is_valid; /* signals "timezone info is available" */ +#endif +#if (defined(MACOS) || defined(WINDLL)) +extern int zipstate; /* flag "zipfile has been stat()'ed */ +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# ifdef MSDOS +# undef stderr +# define stderr stdout +# endif +# define diag(where) fprintf(stderr, "zip diagnostic: %s\n", where) +# define Assert(cond,msg) {if(!(cond)) error(msg);} +# ifdef THEOS +# define Trace(x) _fprintf x +# define Tracev(x) {if (verbose) _fprintf x ;} +# define Tracevv(x) {if (verbose>1) _fprintf x ;} +# define Tracec(c,x) {if (verbose && (c)) _fprintf x ;} +# define Tracecv(c,x) {if (verbose>1 && (c)) _fprintf x ;} +# else +# define Trace(x) fprintf x +# define Tracev(x) {if (verbose) fprintf x ;} +# define Tracevv(x) {if (verbose>1) fprintf x ;} +# define Tracec(c,x) {if (verbose && (c)) fprintf x ;} +# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;} +# endif +#else +# define diag(where) +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + +#ifdef DEBUGNAMES +# define free(x) { int *v;Free(x); v=x;*v=0xdeadbeef;x=(void *)0xdeadbeef; } +#endif + +/* Public function prototypes */ + +//#ifndef UTIL +//#ifdef USE_ZIPMAIN +//int zip_main OF((int, char **)); +int zip_main(int argc, char** argv); +//#else +//int main OF((int, char **)); +//#endif /* USE_ZIPMAIN */ +//#endif + +#ifdef EBCDIC +extern int aflag; +#endif /* EBCDIC */ +#ifdef CMS_MVS +extern int bflag; +#endif /* CMS_MVS */ +void zipwarn OF((char *, char *)); +int ziperr OF((int, char *)); +#ifdef UTIL +# define error(msg) ziperr(ZE_LOGIC, msg) +#else + void error OF((char *)); +# ifdef VMSCLI + void help OF((void)); +# endif + int encr_passwd OF((int, char *, int, ZCONST char *)); +#endif + + /* in zipup.c */ +#ifndef UTIL + int percent OF((ulg, ulg)); + int zipup OF((struct zlist far *, FILE *)); +# ifdef USE_ZLIB + void zl_deflate_free OF((void)); +# else + void flush_outbuf OF((char *, unsigned *)); + int seekable OF((void)); + extern unsigned (*read_buf) OF((char *, unsigned int)); +# endif /* !USE_ZLIB */ +# ifdef ZP_NEED_MEMCOMPR + ulg memcompress OF((char *, ulg, char *, ulg)); +# endif +#endif /* !UTIL */ + + /* in zipfile.c */ +#ifndef UTIL + struct zlist far *zsearch OF((ZCONST char *)); +# ifdef USE_EF_UT_TIME + int get_ef_ut_ztime OF((struct zlist far *, iztimes *)); +# endif /* USE_EF_UT_TIME */ + int trash OF((void)); +#endif /* !UTIL */ +char *ziptyp OF((char *)); +int readzipfile OF((void)); +int putlocal OF((struct zlist far *, FILE *)); +int putextended OF((struct zlist far *, FILE *)); +int putcentral OF((struct zlist far *, FILE *)); +int putend OF((int, ulg, ulg, extent, char *, FILE *)); +int zipcopy OF((struct zlist far *, FILE *, FILE *)); + + /* in fileio.c */ +#ifndef UTIL + char *getnam OF((char *, FILE *)); + struct flist far *fexpel OF((struct flist far *)); + char *last OF((char *, int)); + char *msname OF((char *)); + int check_dup OF((void)); + int filter OF((char *, int)); + int newname OF((char *, int, int)); +#endif /* !UTIL */ +#if (!defined(UTIL) || defined(W32_STATROOT_FIX)) + time_t dos2unixtime OF((ulg)); +#endif +#ifndef UTIL + ulg dostime OF((int, int, int, int, int, int)); + ulg unix2dostime OF((time_t *)); + int issymlnk OF((ulg a)); +# ifdef S_IFLNK +# define rdsymlnk(p,b,n) readlink(p,b,n) +/* extern int readlink OF((char *, char *, int)); */ +# else /* !S_IFLNK */ +# define rdsymlnk(p,b,n) (0) +# endif /* !S_IFLNK */ +#endif /* !UTIL */ + +int destroy OF((char *)); +int replace OF((char *, char *)); +int getfileattr OF((char *)); +int setfileattr OF((char *, int)); +char *tempname OF((char *)); +int fcopy OF((FILE *, FILE *, ulg)); + +#ifndef ZVOID_DEC +#define ZVOID_DEC + typedef void zvoid; +#endif + +#ifdef ZMEM + char *memset OF((char *, int, unsigned int)); + char *memcpy OF((char *, char *, unsigned int)); + int memcmp OF((char *, char *, unsigned int)); +#endif /* ZMEM */ + + /* in system dependent fileio code (.c) */ +#ifndef UTIL +# ifdef PROCNAME + int wild OF((char *)); +# endif + char *in2ex OF((char *)); + char *ex2in OF((char *, int, int *)); + int procname OF((char *, int)); + void stamp OF((char *, ulg)); + ulg filetime OF((char *, ulg *, long *, iztimes *)); +#if !(defined(VMS) && defined(VMS_PK_EXTRA)) + int set_extra_field OF((struct zlist far *, iztimes *)); +#endif /* ?(VMS && VMS_PK_EXTRA) */ + int deletedir OF((char *)); +#ifdef MY_ZCALLOC + zvoid far *zcalloc OF((unsigned int, unsigned int)); + zvoid zcfree OF((zvoid far *)); +#endif /* MY_ZCALLOC */ +#endif /* !UTIL */ +void version_local OF((void)); + + /* in util.c */ +#ifndef UTIL +int fseekable OF((FILE *)); +char *isshexp OF((char *)); +int shmatch OF((ZCONST char *, ZCONST char *, int)); +#if defined(DOS) || defined(WIN32) + int dosmatch OF((ZCONST char *, ZCONST char *, int)); +#endif /* DOS || WIN32 */ +#endif /* !UTIL */ +void init_upper OF((void)); +int namecmp OF((ZCONST char *string1, ZCONST char *string2)); + +#ifdef EBCDIC +char *strtoasc OF((char *str1, ZCONST char *str2)); +char *strtoebc OF((char *str1, ZCONST char *str2)); +char *memtoasc OF((char *mem1, ZCONST char *mem2, unsigned len)); +char *memtoebc OF((char *mem1, ZCONST char *mem2, unsigned len)); +#endif /* EBCDIC */ +#ifdef IZ_ISO2OEM_ARRAY +char *str_iso_to_oem OF((char *dst, ZCONST char *src)); +#endif +#ifdef IZ_OEM2ISO_ARRAY +char *str_oem_to_iso OF((char *dst, ZCONST char *src)); +#endif + +zvoid far **search OF((ZCONST zvoid *, ZCONST zvoid far **, extent, + int (*)(ZCONST zvoid *, ZCONST zvoid far *))); +void envargs OF((int *, char ***, char *, char *)); +void expand_args OF((int *, char ***)); + +#ifndef USE_ZLIB +#ifndef UTIL + /* in crc32.c */ +ulg crc32 OF((ulg, ZCONST uch *, extent)); +#endif /* !UTIL */ + + /* in crctab.c */ +ZCONST ulg near *get_crc_table_boinc OF((void)); +#ifdef DYNALLOC_CRCTAB +void free_crc_table OF((void)); +#endif +#endif /* !USE_ZLIB */ + +#ifndef UTIL +#ifndef USE_ZLIB + /* in deflate.c */ +void lm_init OF((int, ush *)); +void lm_free OF((void)); +ulg deflate_boinc OF((void)); + + /* in trees.c */ +void ct_init OF((ush *, int *)); +int ct_tally OF((int, int)); +ulg flush_block OF((char far *, ulg, int)); +void bi_init OF((char *, unsigned int, int)); +#endif /* !USE_ZLIB */ +#endif /* !UTIL */ + + /* in system specific assembler code, replacing C code in trees.c */ +#if defined(ASMV) && defined(RISCOS) + void send_bits OF((int, int)); + unsigned bi_reverse OF((unsigned int, int)); +#endif /* ASMV && RISCOS */ + +/*--------------------------------------------------------------------------- + VMS-only functions: + ---------------------------------------------------------------------------*/ +#ifdef VMS + int vms_stat OF((char *, stat_t *)); /* vms.c */ + void vms_exit OF((int)); /* vms.c */ +#ifndef UTIL +#ifdef VMSCLI + ulg vms_zip_cmdline OF((int *, char ***)); /* cmdline.c */ + void VMSCLI_help OF((void)); /* cmdline.c */ +#endif /* VMSCLI */ +#endif /* !UTIL */ +#endif /* VMS */ + + +/*--------------------------------------------------------------------------- + WIN32-only functions: + ---------------------------------------------------------------------------*/ +#ifdef WIN32 + int ZipIsWinNT OF((void)); /* win32.c */ +#endif /* WIN32 */ + +#if (defined(WINDLL) || defined(DLL_ZIPAPI)) +/*--------------------------------------------------------------------------- + Prototypes for public Zip API (DLL) functions. + ---------------------------------------------------------------------------*/ +#include "z_api.h" +#endif /* WINDLL || DLL_ZIPAPI */ + +#endif /* !__zip_h */ +/* end of zip.h */ diff -Nru boinc-7.0.7+dfsg/zip/zip/zipnote.c boinc-7.0.14+dfsg/zip/zip/zipnote.c --- boinc-7.0.7+dfsg/zip/zip/zipnote.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zipnote.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,498 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * zipnote.c by Mark Adler. + */ +#define __ZIPNOTE_C + +#ifndef UTIL +#define UTIL +#endif +#include "zip.h" +#define DEFCPYRT /* main module: enable copyright string defines! */ +#include "revision.h" +#include + + +/* Character to mark zip entry names in the comment file */ +#define MARK '@' +#define MARKE " (comment above this line)" +#define MARKZ " (zip file comment below this line)" + +/* Temporary zip file name and file pointer */ +local char *tempzip; +local FILE *tempzf; + + +/* Local functions */ +local void handler OF((int)); +local void license OF((void)); +local void help OF((void)); +local void version_info OF((void)); +local void putclean OF((char *, extent)); +local char *getline OF((char *, extent)); +local int catalloc OF((char * far *, char *)); +int main OF((int, char **)); + +#ifdef MACOS +#define ziperr(c, h) zipnoteerr(c, h) +#define zipwarn(a, b) zipnotewarn(a, b) + +void zipnoteerr(int c,char *h); +void zipnotewarn(char *a,char *b); +#endif + +#ifdef QDOS +#define exit(p1) QDOSexit() +#endif + +void ziperr(c, h) +int c; /* error code from the ZE_ class */ +char *h; /* message about how it happened */ +/* Issue a message for the error, clean up files and memory, and exit. */ +{ + if (PERR(c)) + perror("zipnote error"); + fprintf(stderr, "zipnote error: %s (%s)\n", errors[c-1], h); + if (tempzf != NULL) + fclose(tempzf); + if (tempzip != NULL) + { + destroy(tempzip); + free((zvoid *)tempzip); + } + if (zipfile != NULL) + free((zvoid *)zipfile); + EXIT(c); +} + + +local void handler(s) +int s; /* signal number (ignored) */ +/* Upon getting a user interrupt, abort cleanly using ziperr(). */ +{ +#ifndef MSDOS + putc('\n', stderr); +#endif /* !MSDOS */ + ziperr(ZE_ABORT, "aborting"); + s++; /* keep some compilers happy */ +} + + +void zipwarn(a, b) +char *a, *b; /* message strings juxtaposed in output */ +/* Print a warning message to stderr and return. */ +{ + fprintf(stderr, "zipnote warning: %s%s\n", a, b); +} + + +local void license() +/* Print license information to stdout. */ +{ + extent i; /* counter for copyright array */ + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) { + printf(copyright[i], "zipnote"); + putchar('\n'); + } + for (i = 0; i < sizeof(swlicense)/sizeof(char *); i++) + puts(swlicense[i]); +} + + +local void help() +/* Print help (along with license info) to stdout. */ +{ + extent i; /* counter for help array */ + + /* help array */ + static ZCONST char *text[] = { +"", +"ZipNote %s (%s)", +#ifdef VM_CMS +"Usage: zipnote [-w] [-b fm] zipfile", +#else +"Usage: zipnote [-w] [-b path] zipfile", +#endif +" the default action is to write the comments in zipfile to stdout", +" -w write the zipfile comments from stdin", +#ifdef VM_CMS +" -b use \"fm\" as the filemode for the temporary zip file", +#else +" -b use \"path\" for the temporary zip file", +#endif +" -h show this help -v show version info -L show software license", +"", +"Example:", +#ifdef VMS +" define/user sys$output foo.tmp", +" zipnote foo.zip", +" edit foo.tmp", +" ... then you edit the comments, save, and exit ...", +" define/user sys$input foo.tmp", +" zipnote -w foo.zip", +#else +#ifdef RISCOS +" zipnote foo/zip > foo/tmp", +" foo/tmp", +" ... then you edit the comments, save, and exit ...", +" zipnote -w foo/zip < foo/tmp", +#else +#ifdef VM_CMS +" zipnote foo.zip > foo.tmp", +" xedit foo tmp", +" ... then you edit the comments, save, and exit ...", +" zipnote -w foo.zip < foo.tmp", +#else +" zipnote foo.zip > foo.tmp", +" ed foo.tmp", +" ... then you edit the comments, save, and exit ...", +" zipnote -w foo.zip < foo.tmp", +#endif /* VM_CMS */ +#endif /* RISCOS */ +#endif /* VMS */ +"", +" \"@ name\" can be followed by an \"@=newname\" line to change the name" + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) { + printf(copyright[i], "zipnote"); + putchar('\n'); + } + for (i = 0; i < sizeof(text)/sizeof(char *); i++) + { + printf(text[i], VERSION, REVDATE); + putchar('\n'); + } +} + +/* + * XXX put this in version.c + */ + +local void version_info() +/* Print verbose info about program version and compile time options + to stdout. */ +{ + extent i; /* counter in text arrays */ + + /* Options info array */ + static ZCONST char *comp_opts[] = { +#ifdef DEBUG + "DEBUG", +#endif + NULL + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) + { + printf(copyright[i], "zipnote"); + putchar('\n'); + } + + for (i = 0; i < sizeof(versinfolines)/sizeof(char *); i++) + { + printf(versinfolines[i], "ZipNote", VERSION, REVDATE); + putchar('\n'); + } + + version_local(); + + puts("ZipNote special compilation options:"); + for (i = 0; (int)i < (int)(sizeof(comp_opts)/sizeof(char *) - 1); i++) + { + printf("\t%s\n",comp_opts[i]); + } + if (i == 0) + puts("\t[none]"); +} + + +local void putclean(s, n) +char *s; /* string to write to stdout */ +extent n; /* length of string */ +/* Write the string s to stdout, filtering out control characters that are + not tab or newline (mainly to remove carriage returns), and prefix MARK's + and backslashes with a backslash. Also, terminate with a newline if + needed. */ +{ + int c; /* next character in string */ + int e; /* last character written */ + + e = '\n'; /* if empty, write nothing */ + while (n--) + { + c = *(uch *)s++; + if (c == MARK || c == '\\') + putchar('\\'); + if (c >= ' ' || c == '\t' || c == '\n') + { e=c; putchar(e); } + } + if (e != '\n') + putchar('\n'); +} + + +local char *getline(buf, size) +char *buf; +extent size; +/* Read a line of text from stdin into string buffer 'buf' of size 'size'. + In case of buffer overflow or EOF, a NULL pointer is returned. */ +{ + char *line; + unsigned len; + + line = fgets(buf, size, stdin); + if (line != NULL && (len = strlen(line)) > 0) { + if (len == size-1 && line[len-1] != '\n') { + /* buffer is full and record delimiter not seen -> overflow */ + line = NULL; + } else { + /* delete trailing record delimiter */ + if (line[len-1] == '\n') line[len-1] = '\0'; + } + } + return line; +} + + +local int catalloc(a, s) +char * far *a; /* pointer to a pointer to a malloc'ed string */ +char *s; /* string to concatenate on a */ +/* Concatentate the string s to the malloc'ed string pointed to by a. + Preprocess s by removing backslash escape characters. */ +{ + char *p; /* temporary pointer */ + char *q; /* temporary pointer */ + + for (p = q = s; *q; *p++ = *q++) + if (*q == '\\' && *(q+1)) + q++; + *p = 0; + if ((p = malloc(strlen(*a) + strlen(s) + 3)) == NULL) + return ZE_MEM; + strcat(strcat(strcpy(p, *a), **a ? "\r\n" : ""), s); + free((zvoid *)*a); + *a = p; + return ZE_OK; +} + + +#ifndef USE_ZIPNOTEMAIN +int main(argc, argv) +#else +int zipnotemain(argc, argv) +#endif +int argc; /* number of tokens in command line */ +char **argv; /* command line tokens */ +/* Write the comments in the zipfile to stdout, or read them from stdin. */ +{ + char a[FNMAX+1]; /* input line buffer */ + ulg c; /* start of central directory */ + int k; /* next argument type */ + char *q; /* steps through option arguments */ + int r; /* arg counter, temporary variable */ + ulg s; /* length of central directory */ + int t; /* attributes of zip file */ + int w; /* true if updating zip file from stdin */ + FILE *x, *y; /* input and output zip files */ + struct zlist far *z; /* steps through zfiles linked list */ + +#ifdef THEOS + setlocale(LC_CTYPE, "I"); +#endif + + /* If no args, show help */ + if (argc == 1) + { + help(); + EXIT(0); + } + + init_upper(); /* build case map table */ + + /* Go through args */ + zipfile = tempzip = NULL; + tempzf = NULL; + k = w = 0; + for (r = 1; r < argc; r++) + if (*argv[r] == '-') { + if (argv[r][1]) + for (q = argv[r]+1; *q; q++) + switch (*q) + { + case 'b': /* Specify path for temporary file */ + if (k) + ziperr(ZE_PARMS, "use -b before zip file name"); + else + k = 1; /* Next non-option is path */ + break; + case 'h': /* Show help */ + help(); EXIT(0); + case 'l': case 'L': /* Show copyright and disclaimer */ + license(); EXIT(0); + case 'v': /* Show version info */ + version_info(); EXIT(0); + case 'w': + w = 1; break; + default: + ziperr(ZE_PARMS, "unknown option"); + } + else + ziperr(ZE_PARMS, "zip file cannot be stdin"); + } else + if (k == 0) + { + if (zipfile == NULL) + { + if ((zipfile = ziptyp(argv[r])) == NULL) + ziperr(ZE_MEM, "was processing arguments"); + } + else + ziperr(ZE_PARMS, "can only specify one zip file"); + } + else + { + tempath = argv[r]; + k = 0; + } + if (zipfile == NULL) + ziperr(ZE_PARMS, "need to specify zip file"); + + /* Read zip file */ + if ((r = readzipfile()) != ZE_OK) + ziperr(r, zipfile); + if (zfiles == NULL) + ziperr(ZE_NAME, zipfile); + + /* Put comments to stdout, if not -w */ + if (!w) + { + for (z = zfiles; z != NULL; z = z->nxt) + { + printf("%c %s\n", MARK, z->zname); + putclean(z->comment, z->com); + printf("%c%s\n", MARK, MARKE); + } + printf("%c%s\n", MARK, MARKZ); + putclean(zcomment, zcomlen); + EXIT(ZE_OK); + } + + /* If updating comments, make sure zip file is writeable */ + if ((x = fopen(zipfile, "a")) == NULL) + ziperr(ZE_CREAT, zipfile); + fclose(x); + t = getfileattr(zipfile); + + /* Process stdin, replacing comments */ + z = zfiles; + while (getline(a, FNMAX+1) != NULL && (a[0] != MARK || strcmp(a + 1, MARKZ))) + { /* while input and not file comment */ + if (a[0] != MARK || a[1] != ' ') /* better be "@ name" */ + ziperr(ZE_NOTE, "unexpected input"); + while (z != NULL && strcmp(a + 2, z->zname)) + z = z->nxt; /* allow missing entries in order */ + if (z == NULL) + ziperr(ZE_NOTE, "unknown entry name"); + if (getline(a, FNMAX+1) != NULL && a[0] == MARK && a[1] == '=') + { + if (z->name != z->iname) + free((zvoid *)z->iname); + if ((z->iname = malloc(strlen(a+1))) == NULL) + ziperr(ZE_MEM, "was changing name"); +#ifdef EBCDIC + strtoasc(z->iname, a+2); +#else + strcpy(z->iname, a+2); +#endif + +/* + * Don't update z->nam here, we need the old value a little later..... + * The update is handled in zipcopy(). + */ + getline(a, FNMAX+1); + } + if (z->com) /* change zip entry comment */ + free((zvoid *)z->comment); + z->comment = malloc(1); *(z->comment) = 0; + while (a != NULL && *a != MARK) + { + if ((r = catalloc(&(z->comment), a)) != ZE_OK) + ziperr(r, "was building new comments"); + getline(a, FNMAX+1); + } + z->com = strlen(z->comment); + z = z->nxt; /* point to next entry */ + } + if (a != NULL) /* change zip file comment */ + { + zcomment = malloc(1); *zcomment = 0; + while (getline(a, FNMAX+1) != NULL) + if ((r = catalloc(&zcomment, a)) != ZE_OK) + ziperr(r, "was building new comments"); + zcomlen = strlen(zcomment); + } + + /* Open output zip file for writing */ + if ((tempzf = y = fopen(tempzip = tempname(zipfile), FOPW)) == NULL) + ziperr(ZE_TEMP, tempzip); + + /* Open input zip file again, copy preamble if any */ + if ((x = fopen(zipfile, FOPR)) == NULL) + ziperr(ZE_NAME, zipfile); + if (zipbeg && (r = fcopy(x, y, zipbeg)) != ZE_OK) + ziperr(r, r == ZE_TEMP ? tempzip : zipfile); + tempzn = zipbeg; + + /* Go through local entries, copying them over as is */ + fix = 3; /* needed for zipcopy if name changed */ + for (z = zfiles; z != NULL; z = z->nxt) { + if ((r = zipcopy(z, x, y)) != ZE_OK) + ziperr(r, "was copying an entry"); + } + fclose(x); + + /* Write central directory and end of central directory with new comments */ + if ((c = ftell(y)) == (ulg)(-1L)) /* get start of central */ + ziperr(ZE_TEMP, tempzip); + for (z = zfiles; z != NULL; z = z->nxt) + if ((r = putcentral(z, y)) != ZE_OK) + ziperr(r, tempzip); + if ((s = ftell(y)) == (ulg)-1L) /* get end of central */ + ziperr(ZE_TEMP, tempzip); + s -= c; /* compute length of central */ + if ((r = putend((int)zcount, s, c, zcomlen, zcomment, y)) != ZE_OK) + ziperr(r, tempzip); + tempzf = NULL; + if (fclose(y)) + ziperr(ZE_TEMP, tempzip); + if ((r = replace(zipfile, tempzip)) != ZE_OK) + { + zipwarn("new zip file left as: ", tempzip); + free((zvoid *)tempzip); + tempzip = NULL; + ziperr(r, "was replacing the original zip file"); + } + free((zvoid *)tempzip); + tempzip = NULL; + setfileattr(zipfile, t); +#ifdef RISCOS + /* Set the filetype of the zipfile to &DDC */ + setfiletype(zipfile,0xDDC); +#endif + free((zvoid *)zipfile); + zipfile = NULL; + + /* Done! */ + RETURN(0); +} + +const char *BOINC_RCSID_74827256e1 = "$Id: zipnote.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/zipsplit.c boinc-7.0.14+dfsg/zip/zip/zipsplit.c --- boinc-7.0.7+dfsg/zip/zip/zipsplit.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zipsplit.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,808 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * zipsplit.c by Mark Adler. + */ +#define __ZIPSPLIT_C + +#ifndef UTIL +#define UTIL +#endif +#include "zip.h" +#define DEFCPYRT /* main module: enable copyright string defines! */ +#include "revision.h" +#include + +#define DEFSIZ 36000L /* Default split size (change in help() too) */ +#ifdef MSDOS +# define NL 2 /* Number of bytes written for a \n */ +#else /* !MSDOS */ +# define NL 1 /* Number of bytes written for a \n */ +#endif /* ?MSDOS */ +#ifdef RISCOS +# define INDEX "zipspl/idx" /* Name of index file */ +# define TEMPL_FMT "%%0%dld" +# define TEMPL_SIZ 13 +# define ZPATH_SEP '.' +#else +#ifdef QDOS +# define ZPATH_SEP '_' +# define INDEX "zipsplit_idx" /* Name of index file */ +# define TEMPL_FMT "%%0%dld_zip" +# define TEMPL_SIZ 17 +# define exit(p1) QDOSexit() +#else +#ifdef VM_CMS +# define INDEX "zipsplit.idx" /* Name of index file */ +# define TEMPL_FMT "%%0%dld.zip" +# define TEMPL_SIZ 21 +# define ZPATH_SEP '.' +#else +# define INDEX "zipsplit.idx" /* Name of index file */ +# define TEMPL_FMT "%%0%dld.zip" +# define TEMPL_SIZ 17 +# define ZPATH_SEP '.' +#endif /* VM_CMS */ +#endif /* QDOS */ +#endif /* RISCOS */ + +#ifdef MACOS +#define ziperr(c, h) zipspliterr(c, h) +#define zipwarn(a, b) zipsplitwarn(a, b) +void zipsplitwarn(char *c,char *h); +void zipspliterr(int c,char *h); +#endif /* MACOS */ + +/* Local functions */ +local zvoid *talloc OF((extent)); +local void tfree OF((zvoid *)); +local void tfreeall OF((void)); +local void handler OF((int)); +local void license OF((void)); +local void help OF((void)); +local void version_info OF((void)); +local extent simple OF((ulg *, extent, ulg, ulg)); +local int descmp OF((ZCONST zvoid *, ZCONST zvoid *)); +local extent greedy OF((ulg *, extent, ulg, ulg)); +local int retry OF((void)); +int main OF((int, char **)); + + +/* Output zip files */ +local char template[TEMPL_SIZ]; /* name template for output files */ +local int zipsmade = 0; /* number of zip files made */ +local int indexmade = 0; /* true if index file made */ +local char *path = NULL; /* space for full name */ +local char *name; /* where name goes in path[] */ + + +/* The talloc() and tree() routines extend malloc() and free() to keep + track of all allocated memory. Then the tfreeall() routine uses this + information to free all allocated memory before exiting. */ + +#define TMAX 6 /* set intelligently by examining the code */ +zvoid *talls[TMAX]; /* malloc'ed pointers to track */ +int talln = 0; /* number of entries in talls[] */ + + +local zvoid *talloc(s) +extent s; +/* does a malloc() and saves the pointer to free later (does not check + for an overflow of the talls[] list) */ +{ + zvoid *p; + + if ((p = (zvoid *)malloc(s)) != NULL) + talls[talln++] = p; + return p; +} + + +local void tfree(p) +zvoid *p; +/* does a free() and also removes the pointer from the talloc() list */ +{ + int i; + + free(p); + i = talln; + while (i--) + if (talls[i] == p) + break; + if (i >= 0) + { + while (++i < talln) + talls[i - 1] = talls[i]; + talln--; + } +} + + +local void tfreeall() +/* free everything talloc'ed and not tfree'd */ +{ + while (talln) + free(talls[--talln]); +} + + +void ziperr(c, h) +int c; /* error code from the ZE_ class */ +char *h; /* message about how it happened */ +/* Issue a message for the error, clean up files and memory, and exit. */ +{ + if (PERR(c)) + perror("zipsplit error"); + fprintf(stderr, "zipsplit error: %s (%s)\n", errors[c-1], h); + if (indexmade) + { + strcpy(name, INDEX); + destroy(path); + } + for (; zipsmade; zipsmade--) + { + sprintf(name, template, zipsmade); + destroy(path); + } + tfreeall(); + if (zipfile != NULL) + free((zvoid *)zipfile); + EXIT(c); +} + + +local void handler(s) +int s; /* signal number (ignored) */ +/* Upon getting a user interrupt, abort cleanly using ziperr(). */ +{ +#ifndef MSDOS + putc('\n', stderr); +#endif /* !MSDOS */ + ziperr(ZE_ABORT, "aborting"); + s++; /* keep some compilers happy */ +} + + +void zipwarn(a, b) +char *a, *b; /* message strings juxtaposed in output */ +/* Print a warning message to stderr and return. */ +{ + fprintf(stderr, "zipsplit warning: %s%s\n", a, b); +} + + +local void license() +/* Print license information to stdout. */ +{ + extent i; /* counter for copyright array */ + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) { + printf(copyright[i], "zipsplit"); + putchar('\n'); + } + for (i = 0; i < sizeof(swlicense)/sizeof(char *); i++) + puts(swlicense[i]); +} + + +local void help() +/* Print help (along with license info) to stdout. */ +{ + extent i; /* counter for help array */ + + /* help array */ + static ZCONST char *text[] = { +"", +"ZipSplit %s (%s)", +#ifdef VM_CMS +"Usage: zipsplit [-tips] [-n size] [-r room] [-b fm] zipfile", +#else +"Usage: zipsplit [-tips] [-n size] [-r room] [-b path] zipfile", +#endif +" -t report how many files it will take, but don't make them", +#ifdef RISCOS +" -i make index (" INDEX ") and count its size against first zip file", +#else +" -i make index (zipsplit.idx) and count its size against first zip file", +#endif +" -n make zip files no larger than \"size\" (default = 36000)", +" -r leave room for \"room\" bytes on the first disk (default = 0)", +#ifdef VM_CMS +" -b use \"fm\" as the filemode for the output zip files", +#else +" -b use \"path\" for the output zip files", +#endif +" -p pause between output zip files", +" -s do a sequential split even if it takes more zip files", +" -h show this help -v show version info -L show software license" + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) { + printf(copyright[i], "zipsplit"); + putchar('\n'); + } + for (i = 0; i < sizeof(text)/sizeof(char *); i++) + { + printf(text[i], VERSION, REVDATE); + putchar('\n'); + } +} + + +local void version_info() +/* Print verbose info about program version and compile time options + to stdout. */ +{ + extent i; /* counter in text arrays */ + + /* Options info array */ + static ZCONST char *comp_opts[] = { +#ifdef DEBUG + "DEBUG", +#endif + NULL + }; + + for (i = 0; i < sizeof(copyright)/sizeof(char *); i++) + { + printf(copyright[i], "zipsplit"); + putchar('\n'); + } + + for (i = 0; i < sizeof(versinfolines)/sizeof(char *); i++) + { + printf(versinfolines[i], "ZipSplit", VERSION, REVDATE); + putchar('\n'); + } + + version_local(); + + puts("ZipSplit special compilation options:"); + for (i = 0; (int)i < (int)(sizeof(comp_opts)/sizeof(char *) - 1); i++) + { + printf("\t%s\n",comp_opts[i]); + } + if (i == 0) + puts("\t[none]"); +} + + +local extent simple(a, n, c, d) +ulg *a; /* items to put in bins, return value: destination bins */ +extent n; /* number of items */ +ulg c; /* capacity of each bin */ +ulg d; /* amount to deduct from first bin */ +/* Return the number of bins of capacity c that are needed to contain the + integers in a[0..n-1] placed sequentially into the bins. The value d + is deducted initially from the first bin (space for index). The entries + in a[] are replaced by the destination bins. */ +{ + extent k; /* current bin number */ + ulg t; /* space used in current bin */ + + t = k = 0; + while (n--) + { + if (*a + t > c - (k == 0 ? d : 0)) + { + k++; + t = 0; + } + t += *a; + *(ulg huge *)a++ = k; + } + return k + 1; +} + + +local int descmp(a, b) +ZCONST zvoid *a, *b; /* pointers to pointers to ulg's to compare */ +/* Used by qsort() in greedy() to do a descending sort. */ +{ + return **(ulg **)a < **(ulg **)b ? 1 : (**(ulg **)a > **(ulg **)b ? -1 : 0); +} + + +local extent greedy(a, n, c, d) +ulg *a; /* items to put in bins, return value: destination bins */ +extent n; /* number of items */ +ulg c; /* capacity of each bin */ +ulg d; /* amount to deduct from first bin */ +/* Return the number of bins of capacity c that are needed to contain the + items with sizes a[0..n-1] placed non-sequentially into the bins. The + value d is deducted initially from the first bin (space for index). + The entries in a[] are replaced by the destination bins. */ +{ + ulg *b; /* space left in each bin (malloc'ed for each m) */ + ulg *e; /* copy of argument a[] (malloc'ed) */ + extent i; /* steps through items */ + extent j; /* steps through bins */ + extent k; /* best bin to put current item in */ + extent m; /* current number of bins */ + ulg **s; /* pointers to e[], sorted descending (malloc'ed) */ + ulg t; /* space left in best bin (index k) */ + + /* Algorithm: + 1. Copy a[] to e[] and sort pointers to e[0..n-1] (in s[]), in + descending order. + 2. Compute total of s[] and set m to the smallest number of bins of + capacity c that can hold the total. + 3. Allocate m bins. + 4. For each item in s[], starting with the largest, put it in the + bin with the smallest current capacity greater than or equal to the + item's size. If no bin has enough room, increment m and go to step 4. + 5. Else, all items ended up in a bin--return m. + */ + + /* Copy a[] to e[], put pointers to e[] in s[], and sort s[]. Also compute + the initial number of bins (minus 1). */ + if ((e = (ulg *)malloc(n * sizeof(ulg))) == NULL || + (s = (ulg **)malloc(n * sizeof(ulg *))) == NULL) + { + if (e != NULL) + free((zvoid *)e); + ziperr(ZE_MEM, "was trying a smart split"); + return 0; /* only to make compiler happy */ + } + memcpy((char *)e, (char *)a, n * sizeof(ulg)); + for (t = i = 0; i < n; i++) + t += *(s[i] = e + i); + m = (extent)((t + c - 1) / c) - 1; /* pre-decrement for loop */ + qsort((char *)s, n, sizeof(ulg *), descmp); + + /* Stuff bins until successful */ + do { + /* Increment the number of bins, allocate and initialize bins */ + if ((b = (ulg *)malloc(++m * sizeof(ulg))) == NULL) + { + free((zvoid *)s); + free((zvoid *)e); + ziperr(ZE_MEM, "was trying a smart split"); + } + b[0] = c - d; /* leave space in first bin */ + for (j = 1; j < m; j++) + b[j] = c; + + /* Fill the bins greedily */ + for (i = 0; i < n; i++) + { + /* Find smallest bin that will hold item i (size s[i]) */ + t = c + 1; + for (k = j = 0; j < m; j++) + if (*s[i] <= b[j] && b[j] < t) + t = b[k = j]; + + /* If no bins big enough for *s[i], try next m */ + if (t == c + 1) + break; + + /* Diminish that bin and save where it goes */ + b[k] -= *s[i]; + a[(int)((ulg huge *)(s[i]) - (ulg huge *)e)] = k; + } + + /* Clean up */ + free((zvoid *)b); + + /* Do until all items put in a bin */ + } while (i < n); + + /* Done--clean up and return the number of bins needed */ + free((zvoid *)s); + free((zvoid *)e); + return m; +} + + +local int retry() +{ + char m[10]; + fputs("Error writing to disk--redo entire disk? ", stderr); + fgets(m, 10, stdin); + return *m == 'y' || *m == 'Y'; +} + + +#ifndef USE_ZIPSPLITMAIN +int main(argc, argv) +#else +int zipsplitmain(argc, argv) +#endif + +int argc; /* number of tokens in command line */ +char **argv; /* command line tokens */ +/* Split a zip file into several zip files less than a specified size. See + the command help in help() above. */ +{ + ulg *a; /* malloc'ed list of sizes, dest bins */ + extent *b; /* heads of bin linked lists (malloc'ed) */ + ulg c; /* bin capacity, start of central directory */ + int d; /* if true, just report the number of disks */ + FILE *e; /* input zip file */ + FILE *f; /* output index and zip files */ + extent g; /* number of bins from greedy(), entry to write */ + int h; /* how to split--true means simple split, counter */ + ulg i = 0; /* size of index file plus room to leave */ + extent j; /* steps through zip entries, bins */ + int k; /* next argument type */ + extent *n = NULL; /* next item in bin list (heads in b) */ + ulg *p; /* malloc'ed list of sizes, dest bins for greedy() */ + char *q; /* steps through option characters */ + int r; /* temporary variable, counter */ + extent s; /* number of bins needed */ + ulg t; /* total of sizes, end of central directory */ + int u; /* flag to wait for user on output files */ + struct zlist far **w; /* malloc'ed table for zfiles linked list */ + int x; /* if true, make an index file */ + struct zlist far *z; /* steps through zfiles linked list */ +#ifdef AMIGA + char tailchar; /* temporary variable used in name generation below */ +#endif + +#ifdef THEOS + setlocale(LC_CTYPE, "I"); +#endif + + /* If no args, show help */ + if (argc == 1) + { + help(); + EXIT(0); + } + + init_upper(); /* build case map table */ + + /* Go through args */ + k = h = x = d = u = 0; + c = DEFSIZ; + for (r = 1; r < argc; r++) + if (*argv[r] == '-') + { + if (argv[r][1]) + for (q = argv[r]+1; *q; q++) + switch (*q) + { + case 'b': /* Specify path for output files */ + if (k) + ziperr(ZE_PARMS, "options are separate and precede zip file"); + else + k = 1; /* Next non-option is path */ + break; + case 'h': /* Show help */ + help(); EXIT(0); + case 'i': /* Make an index file */ + x = 1; + break; + case 'l': case 'L': /* Show copyright and disclaimer */ + license(); EXIT(0); + case 'n': /* Specify maximum size of resulting zip files */ + if (k) + ziperr(ZE_PARMS, "options are separate and precede zip file"); + else + k = 2; /* Next non-option is size */ + break; + case 'p': + u = 1; + break; + case 'r': + if (k) + ziperr(ZE_PARMS, "options are separate and precede zip file"); + else + k = 3; /* Next non-option is room to leave */ + break; + case 's': + h = 1; /* Only try simple */ + break; + case 't': /* Just report number of disks */ + d = 1; + break; + case 'v': /* Show version info */ + version_info(); EXIT(0); + default: + ziperr(ZE_PARMS, "Use option -h for help."); + } + else + ziperr(ZE_PARMS, "zip file cannot be stdin"); + } + else + switch (k) + { + case 0: + if (zipfile == NULL) + { + if ((zipfile = ziptyp(argv[r])) == NULL) + ziperr(ZE_MEM, "was processing arguments"); + } + else + ziperr(ZE_PARMS, "can only specify one zip file"); + break; + case 1: + tempath = argv[r]; + k = 0; + break; + case 2: + if ((c = (ulg)atol(argv[r])) < 100) /* 100 is smallest zip file */ + ziperr(ZE_PARMS, "invalid size given. Use option -h for help."); + k = 0; + break; + default: /* k must be 3 */ + i = (ulg)atol(argv[r]); + k = 0; + break; + } + if (zipfile == NULL) + ziperr(ZE_PARMS, "need to specify zip file"); + + + /* Read zip file */ + if ((r = readzipfile()) != ZE_OK) + ziperr(r, zipfile); + if (zfiles == NULL) + ziperr(ZE_NAME, zipfile); + + /* Make a list of sizes and check against capacity. Also compute the + size of the index file. */ + c -= ENDHEAD + 4; /* subtract overhead/zipfile */ + if ((a = (ulg *)talloc(zcount * sizeof(ulg))) == NULL || + (w = (struct zlist far **)talloc(zcount * sizeof(struct zlist far *))) == + NULL) + { + ziperr(ZE_MEM, "was computing split"); + return 1; + } + t = 0; + for (j = 0, z = zfiles; j < zcount; j++, z = z->nxt) + { + w[j] = z; + if (x) + i += z->nam + 6 + NL; + t += a[j] = 8 + LOCHEAD + CENHEAD + + 2 * (ulg)z->nam + 2 * (ulg)z->ext + z->com + z->siz; + if (a[j] > c) + ziperr(ZE_BIG, z->zname); + } + + /* Decide on split to use, report number of files */ + if (h) + s = simple(a, zcount, c, i); + else + { + if ((p = (ulg *)talloc(zcount * sizeof(ulg))) == NULL) + ziperr(ZE_MEM, "was computing split"); + memcpy((char *)p, (char *)a, zcount * sizeof(ulg)); + s = simple(a, zcount, c, i); + g = greedy(p, zcount, c, i); + if (s <= g) + tfree((zvoid *)p); + else + { + tfree((zvoid *)a); + a = p; + s = g; + } + } + printf("%ld zip files w%s be made (%ld%% efficiency)\n", + (ulg)s, d ? "ould" : "ill", ((200 * ((t + c - 1)/c)) / s + 1) >> 1); + if (d) + { + tfreeall(); + free((zvoid *)zipfile); + zipfile = NULL; + EXIT(0); + } + + /* Set up path for output files */ + /* Point "name" past the path, where the filename should go */ + if ((path = (char *)talloc(tempath == NULL ? 13 : strlen(tempath) + 14)) == + NULL) + ziperr(ZE_MEM, "was making output file names"); + if (tempath == NULL) + name = path; + else + { +#ifndef VM_CMS + /* Copy the output path to the target */ + strcpy(path, tempath); +#endif +#ifdef AMIGA + tailchar = path[strlen(path) - 1]; /* last character */ + if (path[0] && (tailchar != '/') && (tailchar != ':')) + strcat(path, "/"); + name = path + strlen(path); +#else +# ifdef RISCOS + if (path[0] && path[strlen(path) - 1] != '.') + strcat(path, "."); + name = path + strlen(path); +# else /* !RISCOS */ +# ifndef QDOS + if (path[0] && path[strlen(path) - 1] != '/') + strcat(path, "/"); +# else + if (path[0] && path[strlen(path) - 1] != '_') + strcat(path, "_"); +# endif + name = path + strlen(path); +# endif +#endif /* ?AMIGA */ + } + + /* Make linked lists of results */ + if ((b = (extent *)talloc(s * sizeof(extent))) == NULL || + (n = (extent *)talloc(zcount * sizeof(extent))) == NULL) + ziperr(ZE_MEM, "was computing split"); + for (j = 0; j < s; j++) + b[j] = (extent)-1; + j = zcount; + while (j--) + { + g = (extent)a[j]; + n[j] = b[g]; + b[g] = j; + } + + /* Make a name template for the zip files that is eight or less characters + before the .zip, and that will not overwrite the original zip file. */ + for (k = 1, j = s; j >= 10; j /= 10) + k++; + if (k > 7) + ziperr(ZE_PARMS, "way too many zip files must be made"); +/* + * XXX, ugly .... + */ +/* Find the final "path" separator character */ +#ifdef QDOS + q = LastDir(zipfile); +#else +#ifdef VMS + if ((q = strrchr(zipfile, ']')) != NULL) +#else +#ifdef AMIGA + if (((q = strrchr(zipfile, '/')) != NULL) + || ((q = strrchr(zipfile, ':'))) != NULL) +#else +#ifdef RISCOS + if ((q = strrchr(zipfile, '.')) != NULL) +#else +#ifdef MVS + if ((q = strrchr(zipfile, '.')) != NULL) +#else + if ((q = strrchr(zipfile, '/')) != NULL) +#endif /* MVS */ +#endif /* RISCOS */ +#endif /* AMIGA */ +#endif /* VMS */ + q++; + else + q = zipfile; +#endif /* QDOS */ + + r = 0; + while ((g = *q++) != '\0' && g != ZPATH_SEP && r < 8 - k) + template[r++] = (char)g; + if (r == 0) + template[r++] = '_'; + else if (g >= '0' && g <= '9') + template[r - 1] = (char)(template[r - 1] == '_' ? '-' : '_'); + sprintf(template + r, TEMPL_FMT, k); +#ifdef VM_CMS + /* For CMS, add the "path" as the filemode at the end */ + if (tempath) + { + strcat(template,"."); + strcat(template,tempath); + } +#endif + + /* Make the zip files from the linked lists of entry numbers */ + if ((e = fopen(zipfile, FOPR)) == NULL) + ziperr(ZE_NAME, zipfile); + free((zvoid *)zipfile); + zipfile = NULL; + for (j = 0; j < s; j++) + { + /* jump here on a disk retry */ + redobin: + + /* prompt if requested */ + if (u) + { + char m[10]; + fprintf(stderr, "Insert disk #%ld of %ld and hit return: ", + (ulg)j + 1, (ulg)s); + fgets(m, 10, stdin); + } + + /* write index file on first disk if requested */ + if (j == 0 && x) + { + strcpy(name, INDEX); + printf("creating: %s\n", path); + indexmade = 1; + if ((f = fopen(path, "w")) == NULL) + { + if (u && retry()) goto redobin; + ziperr(ZE_CREAT, path); + } + for (j = 0; j < zcount; j++) + fprintf(f, "%5ld %s\n", a[j] + 1, w[j]->zname); + if ((j = ferror(f)) != 0 || fclose(f)) + { + if (j) + fclose(f); + if (u && retry()) goto redobin; + ziperr(ZE_WRITE, path); + } + } + + /* create output zip file j */ + sprintf(name, template, j + 1L); + printf("creating: %s\n", path); + zipsmade = j + 1; + if ((f = fopen(path, FOPW)) == NULL) + { + if (u && retry()) goto redobin; + ziperr(ZE_CREAT, path); + } + tempzn = 0; + + /* write local headers and copy compressed data */ + for (g = b[j]; g != (extent)-1; g = (extent)n[g]) + { + if (fseek(e, w[g]->off, SEEK_SET)) + ziperr(ferror(e) ? ZE_READ : ZE_EOF, zipfile); + if ((r = zipcopy(w[g], e, f)) != ZE_OK) + { + if (r == ZE_TEMP) + { + if (u && retry()) goto redobin; + ziperr(ZE_WRITE, path); + } + else + ziperr(r, zipfile); + } + } + + /* write central headers */ + if ((c = ftell(f)) == (ulg)(-1L)) + { + if (u && retry()) goto redobin; + ziperr(ZE_WRITE, path); + } + for (g = b[j], k = 0; g != (extent)-1; g = n[g], k++) + if ((r = putcentral(w[g], f)) != ZE_OK) + { + if (u && retry()) goto redobin; + ziperr(ZE_WRITE, path); + } + + /* write end-of-central header */ + if ((t = ftell(f)) == (ulg)(-1L) || + (r = putend(k, t - c, c, (extent)0, (char *)NULL, f)) != ZE_OK || + ferror(f) || fclose(f)) + { + if (u && retry()) goto redobin; + ziperr(ZE_WRITE, path); + } +#ifdef RISCOS + /* Set the filetype to &DDC */ + setfiletype(path,0xDDC); +#endif + } + fclose(e); + + /* Done! */ + if (u) + fputs("Done.\n", stderr); + tfreeall(); + + RETURN(0); +} + +const char *BOINC_RCSID_1cee49541a = "$Id: zipsplit.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/zipup.c boinc-7.0.14+dfsg/zip/zip/zipup.c --- boinc-7.0.7+dfsg/zip/zip/zipup.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/zipup.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,1179 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + * zipup.c by Mark Adler and Jean-loup Gailly. + */ +#define __ZIPUP_C + +#include +#include "zip.h" + +#ifndef UTIL /* This module contains no code for Zip Utilities */ + +#include "revision.h" +//#include "z_crypt.h" +#define zfwrite fwrite +#ifdef USE_ZLIB +# include "zlib.h" +#endif + +#ifdef OS2 +# include "os2/os2zip.h" +#endif + +#if defined(MMAP) +# include +# ifndef PAGESIZE /* used to be SYSV, what about pagesize on SVR3 ? */ +# define PAGESIZE getpagesize() +# endif +# if defined(NO_VALLOC) && !defined(valloc) +# define valloc malloc +# endif +#endif + +/* Use the raw functions for MSDOS and Unix to save on buffer space. + They're not used for VMS since it doesn't work (raw is weird on VMS). + */ + +#ifdef AMIGA +# include "amiga/zipup.h" +#endif /* AMIGA */ + +#ifdef AOSVS +# include "aosvs/zipup.h" +#endif /* AOSVS */ + +#ifdef ATARI +# include "atari/zipup.h" +#endif + +#ifdef __BEOS__ +# include "beos/zipup.h" +#endif + +#ifdef __human68k__ +# include "human68k/zipup.h" +#endif /* __human68k__ */ + +#ifdef MACOS +# include "macos/zipup.h" +#endif + +#ifdef DOS +# include "msdos/zipup.h" +#endif /* DOS */ + +#ifdef OS2 +# include "os2/zipup.h" +#endif /* OS2 */ + +#ifdef RISCOS +# include "acorn/zipup.h" +#endif + +#ifdef TOPS20 +# include "tops20/zipup.h" +#endif + +#ifdef UNIX +# include "unix/zipup.h" +#endif + +#ifdef CMS_MVS +# include "zipup.h" +#endif /* CMS_MVS */ + +#ifdef TANDEM +# include "zipup.h" +#endif /* TANDEM */ + +#ifdef VMS +# include "vms/zipup.h" +#endif /* VMS */ + +#ifdef QDOS +# include "qdos/zipup.h" +#endif /* QDOS */ + +#ifdef WIN32 +# include "win32/zipup.h" +#endif + +#ifdef THEOS +# include "theos/zipup.h" +#endif + +/* Local functions */ +#ifndef RISCOS + local int suffixes OF((char *, char *)); +#else + local int filetypes OF((char *, char *)); +#endif +local unsigned file_read OF((char *buf, unsigned size)); +#ifdef USE_ZLIB + local int zl_deflate_init OF((int pack_level)); +#else /* !USE_ZLIB */ +# ifdef ZP_NEED_MEMCOMPR + local unsigned mem_read OF((char *buf, unsigned size)); +# endif +#endif /* ?USE_ZLIB */ +local ulg filecompress OF((struct zlist far *z_entry, FILE *zipfile, + int *cmpr_method)); + +/* Deflate "internal" global data (currently not in zip.h) */ +#if defined(MMAP) || defined(BIG_MEM) +# ifdef USE_ZLIB + local uch *window = NULL; /* Used to read all input file at once */ + local ulg window_size; /* size of said window */ +# else /* !USE_ZLIB */ + extern uch *window; /* Used to read all input file at once */ +#endif /* ?USE_ZLIB */ +#endif /* MMAP || BIG_MEM */ +#ifndef USE_ZLIB + extern ulg window_size; /* size of said window */ + + unsigned (*read_buf) OF((char *buf, unsigned size)) = file_read; + /* Current input function. Set to mem_read for in-memory compression */ +#endif /* !USE_ZLIB */ + + +/* Local data */ +local ulg crc; /* crc on uncompressed file data */ +local ftype ifile; /* file to compress */ +#if defined(MMAP) || defined(BIG_MEM) + local ulg remain; + /* window bytes not yet processed. + * special value "(ulg)-1L" reserved to signal normal reads. + */ +#endif /* MMAP || BIG_MEM */ +#ifdef USE_ZLIB + local int deflInit; /* flag: zlib deflate is initialized */ + local z_stream zstrm; /* zlib's data interface structure */ + local char *f_ibuf = NULL; + local char *f_obuf = NULL; +#else /* !USE_ZLIB */ + local FILE *zfile; /* output zip file */ + local char file_outbuf[1024]; /* output buffer for compression to file */ + +# ifdef ZP_NEED_MEMCOMPR + local char *in_buf; + /* Current input buffer, in_buf is used only for in-memory compression. */ + local unsigned in_offset; + /* Current offset in input buffer. in_offset is used only for in-memory + * compression. On 16 bit machines, the buffer is limited to 64K. + */ + local unsigned in_size; + /* size of current input buffer */ +# endif /* ZP_NEED_MEMCOMPR */ +#endif /* ?USE_ZLIB */ + +#ifdef DEBUG + ulg isize; /* input file size. global only for debugging */ +#else /* !DEBUG */ + local ulg isize; /* input file size. */ +#endif /* ?DEBUG */ + + +int percent(n, m) +ulg n; +ulg m; /* n is the original size, m is the new size */ +/* Return the percentage compression from n to m using only integer + operations */ +{ + if (n > 0xffffffL) /* If n >= 16M */ + { /* then divide n and m by 256 */ + n += 0x80; n >>= 8; + m += 0x80; m >>= 8; + } + return n > m ? (int)(1 + (200 * (n - m)/n)) / 2 : 0; +} + +#ifndef RISCOS + +local int suffixes(a, s) +char *a; /* name to check suffix of */ +char *s; /* list of suffixes separated by : or ; */ +/* Return true if a ends in any of the suffixes in the list s. */ +{ + int m; /* true if suffix matches so far */ + char *p; /* pointer into special */ + char *q; /* pointer into name a */ + +#ifdef QDOS + short dlen = devlen(a); + a = a + dlen; +#endif + + m = 1; +#ifdef VMS + if( (q = strrchr(a,';')) != NULL ) /* Cut out VMS file version */ + --q; + else + q = a + strlen(a) - 1; +#else /* !VMS */ + q = a + strlen(a) - 1; +#endif /* ?VMS */ + for (p = s + strlen(s) - 1; p >= s; p--) + if (*p == ':' || *p == ';') + { + if (m) + return 1; + else + { + m = 1; +#ifdef VMS + if( (q = strrchr(a,';')) != NULL ) /* Cut out VMS file version */ + --q; + else + q = a + strlen(a) - 1; +#else /* !VMS */ + q = a + strlen(a) - 1; +#endif /* ?VMS */ + } + } + else + { + m = m && q >= a && case_map(*p) == case_map(*q); + q--; + } + return m; +} + +#else /* RISCOS */ + +local int filetypes(a, s) +char *a; /* extra field of file to check filetype of */ +char *s; /* list of filetypes separated by : or ; */ +/* Return true if a is any of the filetypes in the list s. */ +{ + char *p; /* pointer into special */ + char typestr[4]; /* filetype hex string taken from a */ + + if ((((unsigned*)a)[2] & 0xFFF00000) != 0xFFF00000) { + /* The file is not filestamped, always try to compress it */ + return 0; + } + + sprintf(typestr,"%.3X",(((unsigned*)a)[2] & 0x000FFF00) >> 8); + + for (p=s;p<=s+strlen(s)-3;p+=3) { /* p+=3 to skip 3 hex type */ + while (*p==':' || *p==';') + p++; + + if (typestr[0]==toupper(p[0]) && typestr[1]==toupper(p[1]) && typestr[2]==toupper(p[2])) + return 1; + } + return 0; +} +#endif /* ?RISCOS */ + + + +/* Note: a zip "entry" includes a local header (which includes the file + name), an encryption header if encrypting, the compressed data + and possibly an extended local header. */ + +int zipup(z, y) +struct zlist far *z; /* zip entry to compress */ +FILE *y; /* output file */ +/* Compress the file z->name into the zip entry described by *z and write + it to the file *y. Encrypt if requested. Return an error code in the + ZE_ class. Also, update tempzn by the number of bytes written. */ +{ + iztimes f_utim; /* UNIX GMT timestamps, filled by filetime() */ + ulg tim; /* time returned by filetime() */ + ulg a = 0L; /* attributes returned by filetime() */ + char *b; /* malloc'ed file buffer */ + extent k = 0; /* result of zread */ + int l = 0; /* true if this file is a symbolic link */ + int m; /* method for this entry */ + ulg o, p; /* offsets in zip file */ + long q = -3L; /* size returned by filetime */ + int r; /* temporary variable */ + ulg s = 0L; /* size of compressed data */ + int isdir; /* set for a directory name */ + int set_type = 0; /* set if file type (ascii/binary) unknown */ + + z->nam = strlen(z->iname); + isdir = z->iname[z->nam-1] == (char)0x2f; /* ascii[(unsigned)('/')] */ + + if ((tim = filetime(z->name, &a, &q, &f_utim)) == 0 || q == -3L) + return ZE_OPEN; + + /* q is set to -1 if the input file is a device, -2 for a volume label */ + if (q == -2L) { + isdir = 1; + q = 0; + } else if (isdir != ((a & MSDOS_DIR_ATTR) != 0)) { + /* don't overwrite a directory with a file and vice-versa */ + return ZE_MISS; + } + z->att = (ush)UNKNOWN; /* will be changed later */ + z->atx = 0; /* may be changed by set_extra_field() */ + + /* Free the old extra fields which are probably obsolete */ + if (z->ext) { + free((zvoid *)(z->extra)); + } + if (z->cext && z->extra != z->cextra) { + free((zvoid *)(z->cextra)); + } + z->extra = z->cextra = NULL; + z->ext = z->cext = 0; + +#if defined(MMAP) || defined(BIG_MEM) + remain = (ulg)-1L; /* changed only for MMAP or BIG_MEM */ +#endif /* MMAP || BIG_MEM */ +#if (!defined(USE_ZLIB) || defined(MMAP) || defined(BIG_MEM)) + window_size = 0L; +#endif /* !USE_ZLIB || MMAP || BIG_MEM */ + + /* Select method based on the suffix and the global method */ +#ifndef RISCOS + m = special != NULL && suffixes(z->name, special) ? STORE : method; +#else /* RISCOS must set m after setting extra field */ + m = method; +#endif /* ?RISCOS */ + + /* Open file to zip up unless it is stdin */ + if (strcmp(z->name, "-") == 0) + { + ifile = (ftype)zstdin; +#if defined(MSDOS) || defined(__human68k__) + if (isatty(zstdin) == 0) /* keep default mode if stdin is a terminal */ + setmode(zstdin, O_BINARY); +#endif + z->tim = tim; + } + else + { +#if !(defined(VMS) && defined(VMS_PK_EXTRA)) + if (extra_fields) { + /* create extra field and change z->att and z->atx if desired */ + set_extra_field(z, &f_utim); +#ifdef QLZIP + if(qlflag) + a |= (S_IXUSR) << 16; /* Cross compilers don't set this */ +#endif +#ifdef RISCOS + m = special != NULL && filetypes(z->extra, special) ? STORE : method; +#endif /* RISCOS */ + } +#endif /* !(VMS && VMS_PK_EXTRA) */ + l = issymlnk(a); + if (l) + ifile = fbad; + else if (isdir) { /* directory */ + ifile = fbad; + m = STORE; + q = 0; + } +#ifdef THEOS + else if (((a >> 16) & S_IFMT) == S_IFLIB) { /* library */ + ifile = fbad; + m = STORE; + q = 0; + } +#endif + else { +#ifdef CMS_MVS + if (bflag) { + if ((ifile = zopen(z->name, fhowb)) == fbad) + return ZE_OPEN; + } + else +#endif /* CMS_MVS */ + if ((ifile = zopen(z->name, fhow)) == fbad) + return ZE_OPEN; + } + + z->tim = tim; + +#if defined(VMS) && defined(VMS_PK_EXTRA) + /* vms_get_attributes must be called after vms_open() */ + if (extra_fields) { + /* create extra field and change z->att and z->atx if desired */ + vms_get_attributes(ifile, z, &f_utim); + } +#endif /* VMS && VMS_PK_EXTRA */ + +#ifdef MMAP + /* Map ordinary files but not devices. This code should go in fileio.c */ + if (!translate_eol && q != -1L && (ulg)q > 0 && + (ulg)q + MIN_LOOKAHEAD > (ulg)q) { + if (window != NULL) + free(window); /* window can't be a mapped file here */ + window_size = (ulg)q + MIN_LOOKAHEAD; + remain = window_size & (PAGESIZE-1); + /* If we can't touch the page beyond the end of file, we must + * allocate an extra page. + */ + if (remain > MIN_LOOKAHEAD) { + window = (uch*)mmap(0, window_size, PROT_READ, MAP_PRIVATE, ifile, 0); + } else { + window = (uch*)valloc(window_size - remain + PAGESIZE); + if (window != NULL) { + window = (uch*)mmap((char*)window, window_size - remain, PROT_READ, + MAP_PRIVATE | MAP_FIXED, ifile, 0); + } else { + window = (uch*)(-1); + } + } + if (window == (uch*)(-1)) { + Trace((mesg, " mmap failure on %s\n", z->name)); + window = NULL; + window_size = 0L; + remain = (ulg)-1L; + } else { + remain = (ulg)q; + } + } +#else /* !MMAP */ +# ifdef BIG_MEM + /* Read the whole input file at once */ + if (!translate_eol && q != -1L && (ulg)q > 0 && + (ulg)q + MIN_LOOKAHEAD > (ulg)q) { + window_size = (ulg)q + MIN_LOOKAHEAD; + window = window ? (uch*) realloc(window, (unsigned)window_size) + : (uch*) malloc((unsigned)window_size); + /* Just use normal code if big malloc or realloc fails: */ + if (window != NULL) { + remain = (ulg)zread(ifile, (char*)window, q+1); + if (remain != (ulg)q) { + fprintf(mesg, " q=%lu, remain=%lu ", (ulg)q, remain); + error("can't read whole file at once"); + } + } else { + window_size = 0L; + } + } +# endif /* BIG_MEM */ +#endif /* ?MMAP */ + + } /* strcmp(z->name, "-") == 0 */ + + if (l || q == 0) + m = STORE; + if (m == BEST) + m = DEFLATE; + + /* Do not create STORED files with extended local headers if the + * input size is not known, because such files could not be extracted. + * So if the zip file is not seekable and the input file is not + * on disk, obey the -0 option by forcing deflation with stored block. + * Note however that using "zip -0" as filter is not very useful... + * ??? to be done. + */ + + /* Fill in header information and write local header to zip file. + * This header will later be re-written since compressed length and + * crc are not yet known. + */ + + /* (Assume ext, cext, com, and zname already filled in.) */ +#if defined(OS2) || defined(WIN32) + z->vem = (ush)(z->dosflag ? (dosify ? 20 : /* Made under MSDOS by PKZIP 2.0 */ + (0 + Z_MAJORVER * 10 + Z_MINORVER)) + : OS_CODE + Z_MAJORVER * 10 + Z_MINORVER); + /* For a FAT file system, we cheat and pretend that the file + * was not made on OS2/WIN32 but under DOS. unzip is confused otherwise. + */ +#else /* !(OS2 || WIN32) */ + z->vem = (ush)(dosify ? 20 : OS_CODE + Z_MAJORVER * 10 + Z_MINORVER); +#endif /* ?(OS2 || WIN32) */ + + z->ver = (ush)(m == STORE ? 10 : 20); /* Need PKUNZIP 2.0 except for store */ + z->crc = 0; /* to be updated later */ + /* Assume first that we will need an extended local header: */ + z->flg = 8; /* to be updated later */ +#if CRYPT + if (key != NULL) { + z->flg |= 1; + /* Since we do not yet know the crc here, we pretend that the crc + * is the modification time: + */ + z->crc = z->tim << 16; + } +#endif /* CRYPT */ + z->lflg = z->flg; + z->how = (ush)m; /* may be changed later */ + z->siz = (ulg)(m == STORE && q >= 0 ? q : 0); /* will be changed later */ + z->len = (ulg)(q != -1L ? q : 0); /* may be changed later */ + z->dsk = 0; + if (z->att == (ush)UNKNOWN) { + z->att = BINARY; /* set sensible value in header */ + set_type = 1; + } + /* Attributes from filetime(), flag bits from set_extra_field(): */ +#if defined(DOS) || defined(OS2) || defined(WIN32) + z->atx = z->dosflag ? a & 0xff : a | (z->atx & 0x0000ff00); +#else + z->atx = dosify ? a & 0xff : a | (z->atx & 0x0000ff00); +#endif /* DOS || OS2 || WIN32 */ + z->off = tempzn; + if ((r = putlocal(z, y)) != ZE_OK) { + if (ifile != fbad) + zclose(ifile); + return r; + } + tempzn += 4 + LOCHEAD + z->nam + z->ext; + +#if CRYPT + if (key != NULL) { + crypthead(key, z->crc, y); + z->siz += RAND_HEAD_LEN; /* to be updated later */ + tempzn += RAND_HEAD_LEN; + } +#endif /* CRYPT */ + if (ferror(y)) { + if (ifile != fbad) + zclose(ifile); + ZIPERR(ZE_WRITE, "unexpected error on zip file"); + } + + o = ftell(y); /* for debugging only, ftell can fail on pipes */ + if (ferror(y)) + clearerr(y); + + /* Write stored or deflated file to zip file */ + isize = 0L; + crc = CRCVAL_INITIAL; + + if (m == DEFLATE) { + if (set_type) z->att = (ush)UNKNOWN; /* is finally set in filecompress() */ + s = filecompress(z, y, &m); +#ifndef PGP + if (z->att == (ush)BINARY && translate_eol) { + zipwarn("-l used on binary file", ""); + } +#endif + } + else if (!isdir) + { + if ((b = malloc(SBSZ)) == NULL) + return ZE_MEM; + + if (l) { + k = rdsymlnk(z->name, b, SBSZ); +/* + * compute crc first because zfwrite will alter the buffer b points to !! + */ + crc = crc32(crc, (uch *) b, k); + if (zfwrite(b, 1, k, y) != k) + { + free((zvoid *)b); + return ZE_TEMP; + } + isize = k; + +#ifdef MINIX + q = k; +#endif /* MINIX */ + } + else + { + while ((k = file_read(b, SBSZ)) > 0 && k != (extent) EOF) + { + if (zfwrite(b, 1, k, y) != k) + { + if (ifile != fbad) + zclose(ifile); + free((zvoid *)b); + return ZE_TEMP; + } +#ifndef WINDLL + if (verbose) putc('.', stderr); +#else + if (verbose) fprintf(stdout,"%c",'.'); +#endif + } + } + free((zvoid *)b); + s = isize; + } + if (ifile != fbad && zerr(ifile)) { + perror("\nzip warning"); + zipwarn("could not read input file: ", z->zname); + } + if (ifile != fbad) + zclose(ifile); +#ifdef MMAP + if (remain != (ulg)-1L) { + munmap((caddr_t) window, window_size); + window = NULL; + } +#endif /*MMAP */ + + tempzn += s; + p = tempzn; /* save for future fseek() */ + +#if (!defined(MSDOS) || defined(OS2)) +#if !defined(VMS) && !defined(CMS_MVS) && !defined(__mpexl) + /* Check input size (but not in VMS -- variable record lengths mess it up) + * and not on MSDOS -- diet in TSR mode reports an incorrect file size) + */ +#ifndef TANDEM /* Tandem EOF does not match byte count unless Unstructured */ + if (!translate_eol && q != -1L && isize != (ulg)q) + { + Trace((mesg, " i=%lu, q=%lu ", isize, q)); + zipwarn(" file size changed while zipping ", z->name); + } +#endif /* !TANDEM */ +#endif /* !VMS && !CMS_MVS && !__mpexl */ +#endif /* (!MSDOS || OS2) */ + + /* Try to rewrite the local header with correct information */ + z->crc = crc; + z->siz = s; +#if CRYPT + if (key != NULL) + z->siz += RAND_HEAD_LEN; +#endif /* CRYPT */ + z->len = isize; +#ifdef BROKEN_FSEEK + if (!fseekable(y) || fseek(y, z->off, SEEK_SET)) +#else + if (fseek(y, z->off, SEEK_SET)) +#endif + { + if (z->how != (ush) m) + error("can't rewrite method"); + if (m == STORE && q < 0) + ZIPERR(ZE_PARMS, "zip -0 not supported for I/O on pipes or devices"); + if ((r = putextended(z, y)) != ZE_OK) + return r; + tempzn += 16L; + z->flg = z->lflg; /* if flg modified by inflate */ + } else { + /* seek ok, ftell() should work, check compressed size */ +#if !defined(VMS) && !defined(CMS_MVS) + if (p - o != s) { + fprintf(mesg, " s=%ld, actual=%ld ", s, p-o); + error("incorrect compressed size"); + } +#endif /* !VMS && !CMS_MVS */ + z->how = (ush)m; + z->ver = (ush)(m == STORE ? 10 : 20); /* Need PKUNZIP 2.0 unless STORED */ + if ((z->flg & 1) == 0) + z->flg &= ~8; /* clear the extended local header flag */ + z->lflg = z->flg; + /* rewrite the local header: */ + if ((r = putlocal(z, y)) != ZE_OK) + return r; + if (fseek(y, p, SEEK_SET)) + return ZE_READ; + if ((z->flg & 1) != 0) { + /* encrypted file, extended header still required */ + if ((r = putextended(z, y)) != ZE_OK) + return r; + tempzn += 16L; + } + } + /* Free the local extra field which is no longer needed */ + if (z->ext) { + if (z->extra != z->cextra) { + free((zvoid *)(z->extra)); + z->extra = NULL; + } + z->ext = 0; + } + + /* Display statistics */ + if (noisy) + { + if (verbose) + fprintf(mesg, "\t(in=%lu) (out=%lu)", isize, s); + if (m == DEFLATE) + fprintf(mesg, " (deflated %d%%)\n", percent(isize, s)); + else + fprintf(mesg, " (stored 0%%)\n"); + fflush(mesg); + } +#ifdef WINDLL + if (lpZipUserFunctions->ServiceApplication != NULL) + { + if ((*lpZipUserFunctions->ServiceApplication)(z->zname, isize)) + { + ZIPERR(ZE_ABORT, "User terminated operation"); + } + } +#endif + return ZE_OK; +} + + +local unsigned file_read(buf, size) + char *buf; + unsigned size; +/* Read a new buffer from the current input file, perform end-of-line + * translation, and update the crc and input file size. + * IN assertion: size >= 2 (for end-of-line translation) + */ +{ + unsigned len; + char *b; + +#if defined(MMAP) || defined(BIG_MEM) + if (remain == 0L) { + return 0; + } else if (remain != (ulg)-1L) { + /* The window data is already in place. We still compute the crc + * by 32K blocks instead of once on whole file to keep a certain + * locality of reference. + */ + Assert(buf == (char*)window + isize, "are you lost?"); + if ((ulg)size > remain) size = (unsigned)remain; + if (size > WSIZE) size = WSIZE; /* don't touch all pages at once */ + remain -= (ulg)size; + len = size; + } else +#endif /* MMAP || BIG_MEM */ + if (translate_eol == 0) { + len = zread(ifile, buf, size); + if (len == (unsigned)EOF || len == 0) return len; +#ifdef OS390 + b = buf; + if (aflag == ASCII) { + while (*b != '\0') { + *b = (char)ascii[(uch)*b]; + b++; + } + } +#endif + } else if (translate_eol == 1) { + /* Transform LF to CR LF */ + size >>= 1; + b = buf+size; + size = len = zread(ifile, b, size); + if (len == (unsigned)EOF || len == 0) return len; +#ifdef EBCDIC + if (aflag == ASCII) + { + do { + char c; + + if ((c = *b++) == '\n') { + *buf++ = CR; *buf++ = LF; len++; + } else { + *buf++ = (char)ascii[(uch)c]; + } + } while (--size != 0); + } + else +#endif /* EBCDIC */ + { + do { + if ((*buf++ = *b++) == '\n') *(buf-1) = CR, *buf++ = LF, len++; + } while (--size != 0); + } + buf -= len; + + } else { + /* Transform CR LF to LF and suppress final ^Z */ + b = buf; + size = len = zread(ifile, buf, size-1); + if (len == (unsigned)EOF || len == 0) return len; + buf[len] = '\n'; /* I should check if next char is really a \n */ +#ifdef EBCDIC + if (aflag == ASCII) + { + do { + char c; + + if ((c = *b++) == '\r' && *b == '\n') { + len--; + } else { + *buf++ = (char)(c == '\n' ? LF : ascii[(uch)c]); + } + } while (--size != 0); + } + else +#endif /* EBCDIC */ + { + do { + if (( *buf++ = *b++) == CR && *b == LF) buf--, len--; + } while (--size != 0); + } + if (len == 0) { + zread(ifile, buf, 1); len = 1; /* keep single \r if EOF */ +#ifdef EBCDIC + if (aflag == ASCII) { + *buf = (char)(*buf == '\n' ? LF : ascii[(uch)(*buf)]); + } +#endif + } else { + buf -= len; + if (buf[len-1] == CTRLZ) len--; /* suppress final ^Z */ + } + } + crc = crc32(crc, (uch *) buf, len); + isize += (ulg)len; + return len; +} + + +#ifdef USE_ZLIB + +local int zl_deflate_init(pack_level) + int pack_level; +{ + unsigned i; + int windowBits; + int err = Z_OK; + int zp_err = ZE_OK; + + if (zlib_version[0] != ZLIB_VERSION[0]) { + sprintf(errbuf, "incompatible zlib version (expected %s, found %s)", + ZLIB_VERSION, zlib_version); + zp_err = ZE_LOGIC; + } else if (strcmp(zlib_version, ZLIB_VERSION) != 0) { + fprintf(stderr, + "\twarning: different zlib version (expected %s, using %s)\n", + ZLIB_VERSION, zlib_version); + } + + /* windowBits = log2(WSIZE) */ + for (i = ((unsigned)WSIZE), windowBits = 0; i != 1; i >>= 1, ++windowBits); + + zstrm.zalloc = (alloc_func)Z_NULL; + zstrm.zfree = (free_func)Z_NULL; + + Trace((stderr, "initializing deflate_boinc()\n")); + err = deflateInit2(&zstrm, pack_level, Z_DEFLATED, -windowBits, 8, 0); + + if (err == Z_MEM_ERROR) { + sprintf(errbuf, "cannot initialize zlib deflate"); + zp_err = ZE_MEM; + } else if (err != Z_OK) { + sprintf(errbuf, "zlib deflateInit failure (%d)", err); + zp_err = ZE_LOGIC; + } + + deflInit = TRUE; + return zp_err; +} + + +void zl_deflate_free() +{ + int err; + + if (f_obuf != NULL) { + free(f_obuf); + f_obuf = NULL; + } + if (f_ibuf != NULL) { + free(f_ibuf); + f_ibuf = NULL; + } + if (deflInit) { + err = deflateEnd(&zstrm); + if (err != Z_OK && err !=Z_DATA_ERROR) { + ziperr(ZE_LOGIC, "zlib deflateEnd failed"); + } + } +} + +#else /* !USE_ZLIB */ + +#ifdef ZP_NEED_MEMCOMPR +/* =========================================================================== + * In-memory read function. As opposed to file_read(), this function + * does not perform end-of-line translation, and does not update the + * crc and input size. + * Note that the size of the entire input buffer is an unsigned long, + * but the size used in mem_read() is only an unsigned int. This makes a + * difference on 16 bit machines. mem_read() may be called several + * times for an in-memory compression. + */ +local unsigned mem_read(b, bsize) + char *b; + unsigned bsize; +{ + if (in_offset < in_size) { + ulg block_size = in_size - in_offset; + if (block_size > (ulg)bsize) block_size = (ulg)bsize; + memcpy(b, in_buf + in_offset, (unsigned)block_size); + in_offset += (unsigned)block_size; + return (unsigned)block_size; + } else { + return 0; /* end of input */ + } +} +#endif /* ZP_NEED_MEMCOMPR */ + + +/* =========================================================================== + * Flush the current output buffer. + */ +void flush_outbuf(o_buf, o_idx) + char *o_buf; + unsigned *o_idx; +{ + if (zfile == NULL) { + error("output buffer too small for in-memory compression"); + } + /* Encrypt and write the output buffer: */ + if (*o_idx != 0) { + zfwrite(o_buf, 1, (extent)*o_idx, zfile); + if (ferror(zfile)) ziperr(ZE_WRITE, "write error on zip file"); + } + *o_idx = 0; +} + +/* =========================================================================== + * Return true if the zip file can be seeked. This is used to check if + * the local header can be re-rewritten. This function always returns + * true for in-memory compression. + * IN assertion: the local header has already been written (ftell() > 0). + */ +int seekable() +{ + return fseekable(zfile); +} +#endif /* ?USE_ZLIB */ + + +/* =========================================================================== + * Compression to archive file. + */ + +local ulg filecompress(z_entry, zipfile, cmpr_method) + struct zlist far *z_entry; + FILE *zipfile; + int *cmpr_method; +{ +#ifdef USE_ZLIB + int err = Z_OK; + unsigned mrk_cnt = 1; + int maybe_stored = FALSE; + ulg cmpr_size; +#if defined(MMAP) || defined(BIG_MEM) + unsigned ibuf_sz = (unsigned)SBSZ; +#else +# define ibuf_sz ((unsigned)SBSZ) +#endif +#ifndef OBUF_SZ +# define OBUF_SZ ZBSZ +#endif + +#if defined(MMAP) || defined(BIG_MEM) + if (remain == (ulg)-1L && f_ibuf == NULL) +#else /* !(MMAP || BIG_MEM */ + if (f_ibuf == NULL) +#endif /* MMAP || BIG_MEM */ + f_ibuf = (char *)malloc(SBSZ); + if (f_obuf == NULL) + f_obuf = (char *)malloc(OBUF_SZ); +#if defined(MMAP) || defined(BIG_MEM) + if ((remain == (ulg)-1L && f_ibuf == NULL) || f_obuf == NULL) +#else /* !(MMAP || BIG_MEM */ + if (f_ibuf == NULL || f_obuf == NULL) +#endif /* MMAP || BIG_MEM */ + ziperr(ZE_MEM, "allocating zlib file-I/O buffers"); + + if (!deflInit) { + err = zl_deflate_init(level); + if (err != ZE_OK) + ziperr(err, errbuf); + } + + if (level <= 2) { + z_entry->flg |= 4; + } else if (level >= 8) { + z_entry->flg |= 2; + } +#if defined(MMAP) || defined(BIG_MEM) + if (remain != (ulg)-1L) { + zstrm.next_in = (Bytef *)window; + ibuf_sz = (unsigned)WSIZE; + } else +#endif /* MMAP || BIG_MEM */ + { + zstrm.next_in = (Bytef *)f_ibuf; + } + zstrm.avail_in = file_read(zstrm.next_in, ibuf_sz); + if (zstrm.avail_in < ibuf_sz) { + unsigned more = file_read(zstrm.next_in + zstrm.avail_in, + (ibuf_sz - zstrm.avail_in)); + if (more == EOF || more == 0) { + maybe_stored = TRUE; + } else { + zstrm.avail_in += more; + } + } + zstrm.next_out = (Bytef *)f_obuf; + zstrm.avail_out = OBUF_SZ; + + if (!maybe_stored) while (zstrm.avail_in != 0 && zstrm.avail_in != EOF) { + err = deflate_boinc(&zstrm, Z_NO_FLUSH); + if (err != Z_OK && err != Z_STREAM_END) { + sprintf(errbuf, "unexpected zlib deflate error %d", err); + ziperr(ZE_LOGIC, errbuf); + } + if (zstrm.avail_out == 0) { + if (zfwrite(f_obuf, 1, OBUF_SZ, zipfile) != OBUF_SZ) { + ziperr(ZE_TEMP, "error writing to zipfile"); + } + zstrm.next_out = (Bytef *)f_obuf; + zstrm.avail_out = OBUF_SZ; + } + if (zstrm.avail_in == 0) { + if (verbose) + while((unsigned)(zstrm.total_in / (uLong)WSIZE) > mrk_cnt) { + mrk_cnt++; +#ifndef WINDLL + putc('.', stderr); +#else + fprintf(stdout,"%c",'.'); +#endif + } +#if defined(MMAP) || defined(BIG_MEM) + if (remain == (ulg)-1L) + zstrm.next_in = (Bytef *)f_ibuf; +#else + zstrm.next_in = (Bytef *)f_ibuf; +#endif + zstrm.avail_in = file_read(zstrm.next_in, ibuf_sz); + } + } + + do { + err = deflate_boinc(&zstrm, Z_FINISH); + if (maybe_stored) { + if (err == Z_STREAM_END && zstrm.total_out >= zstrm.total_in && + fseekable(zipfile)) { + /* deflation does not reduce size, switch to STORE method */ + unsigned len_out = (unsigned)zstrm.total_in; + if (zfwrite(f_ibuf, 1, len_out, zipfile) != len_out) { + ziperr(ZE_TEMP, "error writing to zipfile"); + } + zstrm.total_out = (uLong)len_out; + *cmpr_method = STORE; + break; + } else { + maybe_stored = FALSE; + } + } + if (zstrm.avail_out < OBUF_SZ) { + unsigned len_out = OBUF_SZ - zstrm.avail_out; + if (zfwrite(f_obuf, 1, len_out, zipfile) != len_out) { + ziperr(ZE_TEMP, "error writing to zipfile"); + } + zstrm.next_out = (Bytef *)f_obuf; + zstrm.avail_out = OBUF_SZ; + } + } while (err == Z_OK); + + if (err != Z_STREAM_END) { + sprintf(errbuf, "unexpected zlib deflate error %d", err); + ziperr(ZE_LOGIC, errbuf); + } + + if (z_entry->att == (ush)UNKNOWN) + z_entry->att = (ush)(zstrm.data_type == Z_ASCII ? ASCII : BINARY); + cmpr_size = (ulg)zstrm.total_out; + + if ((err = deflateReset(&zstrm)) != Z_OK) + ziperr(ZE_LOGIC, "zlib deflateReset failed"); + return cmpr_size; +#else /* !USE_ZLIB */ + + /* Set the defaults for file compression. */ + zfile = zipfile; + read_buf = file_read; + + /* Initialize deflate's internals and execute file compression. */ + bi_init(file_outbuf, sizeof(file_outbuf), TRUE); + ct_init(&z_entry->att, cmpr_method); + lm_init(level, &z_entry->flg); + return deflate_boinc(); +#endif /* ?USE_ZLIB */ +} + +#ifdef ZP_NEED_MEMCOMPR +/* =========================================================================== + * In-memory compression. This version can be used only if the entire input + * fits in one memory buffer. The compression is then done in a single + * call of memcompress(). (An extension to allow repeated calls would be + * possible but is not needed here.) + * The first two bytes of the compressed output are set to a short with the + * method used (DEFLATE or STORE). The following four bytes contain the CRC. + * The values are stored in little-endian order on all machines. + * This function returns the byte size of the compressed output, including + * the first six bytes (method and crc). + */ + +ulg memcompress(tgt, tgtsize, src, srcsize) + char *tgt, *src; /* target and source buffers */ + ulg tgtsize, srcsize; /* target and source sizes */ +{ + ulg crc; + unsigned out_total; +#ifdef USE_ZLIB + int err = Z_OK; +#else + ush att = (ush)UNKNOWN; + ush flags = 0; +#endif + + if (tgtsize <= (ulg)6L) error("target buffer too small"); + out_total = 2 + 4; + +#ifdef USE_ZLIB + if (!deflInit) { + err = zl_deflate_init(level); + if (err != ZE_OK) + ziperr(err, errbuf); + } + + zstrm.next_in = (Bytef *)src; + zstrm.avail_in = (uInt)srcsize; + zstrm.next_out = (Bytef *)(tgt + out_total); + zstrm.avail_out = (uInt)tgtsize - (uInt)out_total; + + err = deflate_boinc(&zstrm, Z_FINISH); + if (err != Z_STREAM_END) + error("output buffer too small for in-memory compression"); + out_total += (unsigned)zstrm.total_out; + + if ((err = deflateReset(&zstrm)) != Z_OK) + error("zlib deflateReset failed"); +#else /* !USE_ZLIB */ + zfile = NULL; + read_buf = mem_read; + in_buf = src; + in_size = (unsigned)srcsize; + in_offset = 0; + window_size = 0L; + + bi_init(tgt + (2 + 4), (unsigned)(tgtsize - (2 + 4)), FALSE); + ct_init(&att, NULL); + lm_init((level != 0 ? level : 1), &flags); + out_total += (unsigned)deflate_boinc(); + window_size = 0L; /* was updated by lm_init() */ +#endif /* ?USE_ZLIB */ + + crc = CRCVAL_INITIAL; + crc = crc32(crc, (uch *)src, (extent)srcsize); + + /* For portability, force little-endian order on all machines: */ + tgt[0] = (char)(DEFLATE & 0xff); + tgt[1] = (char)((DEFLATE >> 8) & 0xff); + tgt[2] = (char)(crc & 0xff); + tgt[3] = (char)((crc >> 8) & 0xff); + tgt[4] = (char)((crc >> 16) & 0xff); + tgt[5] = (char)((crc >> 24) & 0xff); + + return (ulg)out_total; +} +#endif /* ZP_NEED_MEMCOMPR */ +#endif /* !UTIL */ + +const char *BOINC_RCSID_4f9eafb9f3 = "$Id: zipup.c 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_ttyio.c boinc-7.0.14+dfsg/zip/zip/z_ttyio.c --- boinc-7.0.7+dfsg/zip/zip/z_ttyio.c 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_ttyio.c 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,635 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/*--------------------------------------------------------------------------- + + ttyio.c + + This file contains routines for doing console input/output, including code + for non-echoing input. It is used by the encryption/decryption code but + does not contain any restricted code itself. This file is shared between + Info-ZIP's Zip and UnZip. + + Contains: echo() (VMS only) + Echon() (Unix only) + Echoff() (Unix only) + screenlines() (Unix only) + zgetch() (Unix and non-Unix versions) + getp() ("PC," Unix/Atari/Be, VMS/VMCMS/MVS) + + ---------------------------------------------------------------------------*/ + +#define __TTYIO_C /* identifies this source module */ + +#include "zip.h" +//#include "z_crypt.h" + +#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) +/* Non-echo console/keyboard input is needed for (en/de)cryption's password + * entry, and for UnZip(SFX)'s MORE and Pause features. + * (The corresponding #endif is found at the end of this module.) + */ + +#include "ttyio.h" + +#ifndef PUTC +# define PUTC putc +#endif + +#ifdef ZIP +# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ +# undef GLOBAL +# endif +# define GLOBAL(g) g +#else +# define GLOBAL(g) G.g +#endif + +#ifdef __BEOS__ /* why yes, we do */ +# define HAVE_TERMIOS_H +#endif + +#ifdef _POSIX_VERSION +# ifndef USE_POSIX_TERMIOS +# define USE_POSIX_TERMIOS /* use POSIX style termio (termios) */ +# endif +# ifndef HAVE_TERMIOS_H +# define HAVE_TERMIOS_H /* POSIX termios.h */ +# endif +#endif /* _POSIX_VERSION */ + +#ifdef UNZIP /* Zip handles this with the unix/configure script */ +# ifndef _POSIX_VERSION +# if (defined(SYSV) || defined(CRAY)) && !defined(__MINT__) +# ifndef USE_SYSV_TERMIO +# define USE_SYSV_TERMIO +# endif +# ifdef COHERENT +# ifndef HAVE_TERMIO_H +# define HAVE_TERMIO_H +# endif +# ifdef HAVE_SYS_TERMIO_H +# undef HAVE_SYS_TERMIO_H +# endif +# else /* !COHERENT */ +# ifdef HAVE_TERMIO_H +# undef HAVE_TERMIO_H +# endif +# ifndef HAVE_SYS_TERMIO_H +# define HAVE_SYS_TERMIO_H +# endif +# endif /* ?COHERENT */ +# endif /* (SYSV || CRAY) && !__MINT__ */ +# endif /* !_POSIX_VERSION */ +# if !(defined(BSD4_4) || defined(SYSV) || defined(__convexc__)) +# ifndef NO_FCNTL_H +# define NO_FCNTL_H +# endif +# endif /* !(BSD4_4 || SYSV || __convexc__) */ +#endif /* UNZIP */ + +#ifdef HAVE_TERMIOS_H +# ifndef USE_POSIX_TERMIOS +# define USE_POSIX_TERMIOS +# endif +#endif + +#if (defined(HAVE_TERMIO_H) || defined(HAVE_SYS_TERMIO_H)) +# ifndef USE_SYSV_TERMIO +# define USE_SYSV_TERMIO +# endif +#endif + +#if (defined(UNZIP) && !defined(FUNZIP) && defined(UNIX) && defined(MORE)) +# include +# define GOT_IOCTL_H + /* int ioctl OF((int, int, zvoid *)); GRR: may need for some systems */ +#endif + +#ifndef HAVE_WORKING_GETCH + /* include system support for switching of console echo */ +# ifdef VMS +# include +# include +# include +# include +# include +# else /* !VMS */ +# ifdef HAVE_TERMIOS_H +# include +# define sgttyb termios +# define sg_flags c_lflag +# define GTTY(f, s) tcgetattr(f, (zvoid *) s) +# define STTY(f, s) tcsetattr(f, TCSAFLUSH, (zvoid *) s) +# else /* !HAVE_TERMIOS_H */ +# ifdef USE_SYSV_TERMIO /* Amdahl, Cray, all SysV? */ +# ifdef HAVE_TERMIO_H +# include +# endif +# ifdef HAVE_SYS_TERMIO_H +# include +# endif +# ifdef NEED_PTEM +# include +# include +# endif +# define sgttyb termio +# define sg_flags c_lflag +# define GTTY(f,s) ioctl(f,TCGETA,(zvoid *)s) +# define STTY(f,s) ioctl(f,TCSETAW,(zvoid *)s) +# else /* !USE_SYSV_TERMIO */ +# ifndef CMS_MVS +# if (!defined(MINIX) && !defined(GOT_IOCTL_H)) +# include +# endif +# include +# define GTTY gtty +# define STTY stty +# ifdef UNZIP + /* + * XXX : Are these declarations needed at all ???? + */ + /* + * GRR: let's find out... Hmmm, appears not... + int gtty OF((int, struct sgttyb *)); + int stty OF((int, struct sgttyb *)); + */ +# endif +# endif /* !CMS_MVS */ +# endif /* ?USE_SYSV_TERMIO */ +# endif /* ?HAVE_TERMIOS_H */ +# ifndef NO_FCNTL_H +# ifndef UNZIP +# include +# endif +# else + char *ttyname OF((int)); +# endif +# endif /* ?VMS */ +#endif /* !HAVE_WORKING_GETCH */ + + + +#ifndef HAVE_WORKING_GETCH +#ifdef VMS + +/* + * Turn keyboard echoing on or off (VMS). Loosely based on VMSmunch.c + * and hence on Joe Meadows' file.c code. + */ +int echo(opt) + int opt; +{ + /* + * For VMS v5.x: + * IO$_SENSEMODE/SETMODE info: Programming, Vol. 7A, System Programming, + * I/O User's: Part I, sec. 8.4.1.1, 8.4.3, 8.4.5, 8.6 + * sys$assign(), sys$qio() info: Programming, Vol. 4B, System Services, + * System Services Reference Manual, pp. sys-23, sys-379 + * fixed-length descriptor info: Programming, Vol. 3, System Services, + * Intro to System Routines, sec. 2.9.2 + * Greg Roelofs, 15 Aug 91 + */ + + /* SKM: make global? */ + static struct dsc$descriptor_s DevDesc = + {11, DSC$K_DTYPE_T, DSC$K_CLASS_S, "SYS$COMMAND"}; + /* {dsc$w_length, dsc$b_dtype, dsc$b_class, dsc$a_pointer}; */ + static short DevChan, iosb[4]; + static long status; + static unsigned long oldmode[2], newmode[2]; /* each = 8 bytes */ + + + /* assign a channel to standard input */ + status = sys$assign(&DevDesc, &DevChan, 0, 0); + if (!(status & 1)) + return status; + + /* use sys$qio and the IO$_SENSEMODE function to determine the current + * tty status (for password reading, could use IO$_READVBLK function + * instead, but echo on/off will be more general) + */ + status = sys$qiow(0, DevChan, IO$_SENSEMODE, &iosb, 0, 0, + oldmode, 8, 0, 0, 0, 0); + if (!(status & 1)) + return status; + status = iosb[0]; + if (!(status & 1)) + return status; + + /* copy old mode into new-mode buffer, then modify to be either NOECHO or + * ECHO (depending on function argument opt) + */ + newmode[0] = oldmode[0]; + newmode[1] = oldmode[1]; + if (opt == 0) /* off */ + newmode[1] |= TT$M_NOECHO; /* set NOECHO bit */ + else + newmode[1] &= ~((unsigned long) TT$M_NOECHO); /* clear NOECHO bit */ + + /* use the IO$_SETMODE function to change the tty status */ + status = sys$qiow(0, DevChan, IO$_SETMODE, &iosb, 0, 0, + newmode, 8, 0, 0, 0, 0); + if (!(status & 1)) + return status; + status = iosb[0]; + if (!(status & 1)) + return status; + + /* deassign the sys$input channel by way of clean-up */ + status = sys$dassgn(DevChan); + if (!(status & 1)) + return status; + + return SS$_NORMAL; /* we be happy */ + +} /* end function echo() */ + + +#else /* !VMS: basically Unix */ + + +/* For VM/CMS and MVS, non-echo terminal input is not (yet?) supported. */ +#ifndef CMS_MVS + +#ifdef ZIP /* moved to globals.h for UnZip */ + static int echofd=(-1); /* file descriptor whose echo is off */ +#endif + +/* + * Turn echo off for file descriptor f. Assumes that f is a tty device. + */ +void Echoff(__G__ f) + __GDEF + int f; /* file descriptor for which to turn echo off */ +{ + struct sgttyb sg; /* tty device structure */ + + GLOBAL(echofd) = f; + GTTY(f, &sg); /* get settings */ + sg.sg_flags &= ~ECHO; /* turn echo off */ + STTY(f, &sg); +} + +/* + * Turn echo back on for file descriptor echofd. + */ +void Echon(__G) + __GDEF +{ + struct sgttyb sg; /* tty device structure */ + + if (GLOBAL(echofd) != -1) { + GTTY(GLOBAL(echofd), &sg); /* get settings */ + sg.sg_flags |= ECHO; /* turn echo on */ + STTY(GLOBAL(echofd), &sg); + GLOBAL(echofd) = -1; + } +} + +#endif /* !CMS_MVS */ +#endif /* ?VMS */ + + +#if (defined(UNZIP) && !defined(FUNZIP)) + +#if (defined(UNIX) || defined(__BEOS__)) +#ifdef MORE + +/* + * Get the number of lines on the output terminal. SCO Unix apparently + * defines TIOCGWINSZ but doesn't support it (!M_UNIX). + * + * GRR: will need to know width of terminal someday, too, to account for + * line-wrapping. + */ + +#if (defined(TIOCGWINSZ) && !defined(M_UNIX)) + +int screenlines() +{ + struct winsize wsz; +#ifdef DEBUG_WINSZ + static int firsttime = TRUE; +#endif + + /* see termio(4) under, e.g., SunOS */ + if (ioctl(1, TIOCGWINSZ, &wsz) == 0) { +#ifdef DEBUG_WINSZ + if (firsttime) { + firsttime = FALSE; + fprintf(stderr, "ttyio.c screenlines(): ws_row = %d\n", + wsz.ws_row); + } +#endif + /* number of columns = ws_col */ + return (wsz.ws_row > 0)? wsz.ws_row : 24; /* number of rows */ + + } else { /* this happens when piping to more(1), for example */ +#ifdef DEBUG_WINSZ + if (firsttime) { + firsttime = FALSE; + fprintf(stderr, + "ttyio.c screenlines(): ioctl(TIOCGWINSZ) failed\n")); + } +#endif + return 24; /* VT-100 assumed to be minimal hardware */ + } +} + +#else /* !TIOCGWINSZ: service not available, fall back to semi-bogus method */ + +int screenlines() +{ + char *envptr, *getenv(); + int n; + + /* GRR: this is overly simplistic, but don't have access to stty/gtty + * system anymore + */ + envptr = getenv("LINES"); + if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) + return 24; /* VT-100 assumed to be minimal hardware */ + else + return n; +} + +#endif /* ?(TIOCGWINSZ && !M_UNIX) */ +#endif /* MORE */ + + +/* + * Get a character from the given file descriptor without echo or newline. + */ +int zgetch(__G__ f) + __GDEF + int f; /* file descriptor from which to read */ +{ +#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) + char oldmin, oldtim; +#endif + char c; + struct sgttyb sg; /* tty device structure */ + + GTTY(f, &sg); /* get settings */ +#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) + oldmin = sg.c_cc[VMIN]; /* save old values */ + oldtim = sg.c_cc[VTIME]; + sg.c_cc[VMIN] = 1; /* need only one char to return read() */ + sg.c_cc[VTIME] = 0; /* no timeout */ + sg.sg_flags &= ~ICANON; /* canonical mode off */ +#else + sg.sg_flags |= CBREAK; /* cbreak mode on */ +#endif + sg.sg_flags &= ~ECHO; /* turn echo off, too */ + STTY(f, &sg); /* set cbreak mode */ + GLOBAL(echofd) = f; /* in case ^C hit (not perfect: still CBREAK) */ + + read(f, &c, 1); /* read our character */ + +#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) + sg.c_cc[VMIN] = oldmin; /* restore old values */ + sg.c_cc[VTIME] = oldtim; + sg.sg_flags |= ICANON; /* canonical mode on */ +#else + sg.sg_flags &= ~CBREAK; /* cbreak mode off */ +#endif + sg.sg_flags |= ECHO; /* turn echo on */ + STTY(f, &sg); /* restore canonical mode */ + GLOBAL(echofd) = -1; + + return (int)c; +} + + +#else /* !UNIX && !__BEOS__ */ + + +int zgetch(__G__ f) + __GDEF + int f; /* file descriptor from which to read (must be open already) */ +{ + char c, c2; + +/*--------------------------------------------------------------------------- + Get a character from the given file descriptor without echo; can't fake + CBREAK mode (i.e., newline required), but can get rid of all chars up to + and including newline. + ---------------------------------------------------------------------------*/ + + echoff(f); + read(f, &c, 1); + if (c != '\n') + do { + read(f, &c2, 1); /* throw away all other chars up thru newline */ + } while (c2 != '\n'); + echon(); + return (int)c; +} + +#endif /* ?(UNIX || __BEOS__) */ + +#endif /* UNZIP && !FUNZIP */ +#endif /* !HAVE_WORKING_GETCH */ + + +#if CRYPT /* getp() is only used with full encryption */ + +/* + * Simple compile-time check for source compatibility between + * zcrypt and ttyio: + */ +#if (!defined(CR_MAJORVER) || (CR_MAJORVER < 2) || (CR_MINORVER < 7)) + error: This Info-ZIP tool requires zcrypt 2.7 or later. +#endif + +/* + * Get a password of length n-1 or less into *p using the prompt *m. + * The entered password is not echoed. + */ + +#ifdef HAVE_WORKING_GETCH +/* + * For the AMIGA, getch() is defined as Agetch(), which is in + * amiga/filedate.c; SAS/C 6.x provides a getch(), but since Agetch() + * uses the infrastructure that is already in place in filedate.c, it is + * smaller. With this function, echoff() and echon() are not needed. + * + * For the MAC, a non-echo macgetch() function is defined in the MacOS + * specific sources which uses the event handling mechanism of the + * desktop window manager to get a character from the keyboard. + * + * For the other systems in this section, a non-echo getch() function + * is either contained the C runtime library (conio package), or getch() + * is defined as an alias for a similar system specific RTL function. + */ + +#ifndef WINDLL /* WINDLL does not support a console interface */ +#ifndef QDOS /* QDOS supplies a variant of this function */ + +/* This is the getp() function for all systems (with TTY type user interface) + * that supply a working `non-echo' getch() function for "raw" console input. + */ +char *getp(__G__ m, p, n) + __GDEF + ZCONST char *m; /* prompt for password */ + char *p; /* return value: line input */ + int n; /* bytes available in p[] */ +{ + char c; /* one-byte buffer for read() to use */ + int i; /* number of characters input */ + char *w; /* warning on retry */ + + /* get password */ + w = ""; + do { + fputs(w, stderr); /* warning if back again */ + fputs(m, stderr); /* display prompt and flush */ + fflush(stderr); + i = 0; + do { /* read line, keeping first n characters */ + if ((c = (char)getch()) == '\r') + c = '\n'; /* until user hits CR */ + if (c == 8 || c == 127) { + if (i > 0) i--; /* the `backspace' and `del' keys works */ + } + else if (i < n) + p[i++] = c; /* truncate past n */ + } while (c != '\n'); + PUTC('\n', stderr); fflush(stderr); + w = "(line too long--try again)\n"; + } while (p[i-1] != '\n'); + p[i-1] = 0; /* terminate at newline */ + + return p; /* return pointer to password */ + +} /* end function getp() */ + +#endif /* !QDOS */ +#endif /* !WINDLL */ + + +#else /* !HAVE_WORKING_GETCH */ + + +#if (defined(UNIX) || defined(__MINT__) || defined(__BEOS__)) + +#ifndef _PATH_TTY +# ifdef __MINT__ +# define _PATH_TTY ttyname(2) +# else +# define _PATH_TTY "/dev/tty" +# endif +#endif + +char *getp(__G__ m, p, n) + __GDEF + ZCONST char *m; /* prompt for password */ + char *p; /* return value: line input */ + int n; /* bytes available in p[] */ +{ + char c; /* one-byte buffer for read() to use */ + int i; /* number of characters input */ + char *w; /* warning on retry */ + int f; /* file descriptor for tty device */ + +#ifdef PASSWD_FROM_STDIN + /* Read from stdin. This is unsafe if the password is stored on disk. */ + f = 0; +#else + /* turn off echo on tty */ + + if ((f = open(_PATH_TTY, 0)) == -1) + return NULL; +#endif + /* get password */ + w = ""; + do { + fputs(w, stderr); /* warning if back again */ + fputs(m, stderr); /* prompt */ + fflush(stderr); + i = 0; + echoff(f); + do { /* read line, keeping n */ + read(f, &c, 1); + if (i < n) + p[i++] = c; + } while (c != '\n'); + echon(); + PUTC('\n', stderr); fflush(stderr); + w = "(line too long--try again)\n"; + } while (p[i-1] != '\n'); + p[i-1] = 0; /* terminate at newline */ + +#ifndef PASSWD_FROM_STDIN + close(f); +#endif + + return p; /* return pointer to password */ + +} /* end function getp() */ + +#endif /* UNIX || __MINT__ || __BEOS__ */ + + + +#if (defined(VMS) || defined(CMS_MVS)) + +char *getp(__G__ m, p, n) + __GDEF + ZCONST char *m; /* prompt for password */ + char *p; /* return value: line input */ + int n; /* bytes available in p[] */ +{ + char c; /* one-byte buffer for read() to use */ + int i; /* number of characters input */ + char *w; /* warning on retry */ + FILE *f; /* file structure for SYS$COMMAND device */ + +#ifdef PASSWD_FROM_STDIN + f = stdin; +#else + if ((f = fopen(ctermid(NULL), "r")) == NULL) + return NULL; +#endif + + /* get password */ + fflush(stdout); + w = ""; + do { + if (*w) /* bug: VMS apparently adds \n to NULL fputs */ + fputs(w, stderr); /* warning if back again */ + fputs(m, stderr); /* prompt */ + fflush(stderr); + i = 0; + echoff(f); + do { /* read line, keeping n */ + if ((c = (char)getc(f)) == '\r') + c = '\n'; + if (i < n) + p[i++] = c; + } while (c != '\n'); + echon(); + PUTC('\n', stderr); fflush(stderr); + w = "(line too long--try again)\n"; + } while (p[i-1] != '\n'); + p[i-1] = 0; /* terminate at newline */ +#ifndef PASSWD_FROM_STDIN + fclose(f); +#endif + + return p; /* return pointer to password */ + +} /* end function getp() */ + +#endif /* VMS || CMS_MVS */ +#endif /* ?HAVE_WORKING_GETCH */ +#endif /* CRYPT */ +#endif /* CRYPT || (UNZIP && !FUNZIP) */ + +const char *BOINC_RCSID_f1f55f5592 = "$Id: z_ttyio.c 4979 2005-01-02 18:29:53Z ballen $"; diff -Nru boinc-7.0.7+dfsg/zip/zip/z_ttyio.h boinc-7.0.14+dfsg/zip/zip/z_ttyio.h --- boinc-7.0.7+dfsg/zip/zip/z_ttyio.h 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/zip/z_ttyio.h 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,218 @@ +/* + Copyright (c) 1990-1999 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 1999-Oct-05 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, both of these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html +*/ +/* + ttyio.h + */ + +#ifndef __ttyio_h /* don't include more than once */ +#define __ttyio_h + +//#ifndef __crypt_h +//# include "crypt.h" /* ensure that encryption header file has been seen */ +//#endif + +#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) +/* + * Non-echo keyboard/console input support is needed and enabled. + */ + +#ifndef __G /* UnZip only, for now (DLL stuff) */ +# define __G +# define __G__ +# define __GDEF +# define __GPRO void +# define __GPRO__ +#endif + +#ifndef ZCONST /* UnZip only (until have configure script like Zip) */ +# define ZCONST const +#endif + +#if (defined(MSDOS) || defined(OS2) || defined(WIN32)) +# ifndef DOS_OS2_W32 +# define DOS_OS2_W32 +# endif +#endif + +#if (defined(DOS_OS2_W32) || defined(__human68k__)) +# ifndef DOS_H68_OS2_W32 +# define DOS_H68_OS2_W32 +# endif +#endif + +#if (defined(DOS_OS2_W32) || defined(FLEXOS)) +# ifndef DOS_FLX_OS2_W32 +# define DOS_FLX_OS2_W32 +# endif +#endif + +#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) +# ifndef DOS_FLX_H68_OS2_W32 +# define DOS_FLX_H68_OS2_W32 +# endif +#endif + +#if (defined(VM_CMS) || defined(MVS)) +# ifndef CMS_MVS +# define CMS_MVS +# endif +#endif + + +/* Function prototypes */ + +/* The following systems supply a `non-echo' character input function "getch()" + * (or an alias) and do not need the echoff() / echon() function pair. + */ +#ifdef AMIGA +# define echoff(f) +# define echon() +# define getch() Agetch() +# define HAVE_WORKING_GETCH +#endif /* AMIGA */ + +#ifdef ATARI +# define echoff(f) +# define echon() +# include +# define getch() (Cnecin() & 0x000000ff) +# define HAVE_WORKING_GETCH +#endif + +#ifdef MACOS +# define echoff(f) +# define echon() +# define getch() macgetch() +# define HAVE_WORKING_GETCH +#endif + +#ifdef NLM +# define echoff(f) +# define echon() +# define HAVE_WORKING_GETCH +#endif + +#ifdef QDOS +# define echoff(f) +# define echon() +# define HAVE_WORKING_GETCH +#endif + +#ifdef RISCOS +# define echoff(f) +# define echon() +# define getch() SWI_OS_ReadC() +# define HAVE_WORKING_GETCH +#endif + +#ifdef DOS_H68_OS2_W32 +# define echoff(f) +# define echon() +# ifdef WIN32 +# ifndef getch +# define getch() getch_win32() +# endif +# else /* !WIN32 */ +# ifdef __EMX__ +# ifndef getch +# define getch() _read_kbd(0, 1, 0) +# endif +# else /* !__EMX__ */ +# ifdef __GO32__ +# include +# define getch() getkey() +# else /* !__GO32__ */ +# include +# endif /* ?__GO32__ */ +# endif /* ?__EMX__ */ +# endif /* ?WIN32 */ +# define HAVE_WORKING_GETCH +#endif /* DOS_H68_OS2_W32 */ + +#ifdef FLEXOS +# define echoff(f) +# define echon() +# define getch() getchar() /* not correct, but may not be on a console */ +# define HAVE_WORKING_GETCH +#endif + +/* For VM/CMS and MVS, we do not (yet) have any support to switch terminal + * input echo on and off. The following "fake" definitions allow inclusion + * of crypt support and UnZip's "pause prompting" features, but without + * any echo suppression. + */ +#ifdef CMS_MVS +# define echoff(f) +# define echon() +#endif + +#ifdef TANDEM +# define echoff(f) +# define echon() +# define getch() zgetch() /* defined in TANDEMC */ +# define HAVE_WORKING_GETCH +#endif + +/* The THEOS C runtime library supplies the function conmask() to toggle + * terminal input echo on (conmask("e")) and off (conmask("n")). But, + * since THEOS C RTL also contains a working non-echo getch() function, + * the echo toggles are not needed. + */ +#ifdef THEOS +# define echoff(f) +# define echon() +# define HAVE_WORKING_GETCH +#endif + +/* VMS has a single echo() function in ttyio.c to toggle terminal + * input echo on and off. + */ +#ifdef VMS +# define echoff(f) echo(0) +# define echon() echo(1) + int echo OF((int)); +#endif + +/* For all other systems, ttyio.c supplies the two functions Echoff() and + * Echon() for suppressing and (re)enabling console input echo. + */ +#ifndef echoff +# define echoff(f) Echoff(__G__ f) +# define echon() Echon(__G) + void Echoff OF((__GPRO__ int f)); + void Echon OF((__GPRO)); +#endif + +/* this stuff is used by MORE and also now by the ctrl-S code; fileio.c only */ +#if (defined(UNZIP) && !defined(FUNZIP)) +# ifdef HAVE_WORKING_GETCH +# define FGETCH(f) getch() +# endif +# ifndef FGETCH + /* default for all systems where no getch()-like function is available */ + int zgetch OF((__GPRO__ int f)); +# define FGETCH(f) zgetch(__G__ f) +# endif +#endif /* UNZIP && !FUNZIP */ + +#if (CRYPT && !defined(WINDLL)) + char *getp OF((__GPRO__ ZCONST char *m, char *p, int n)); +#endif + +#else /* !(CRYPT || (UNZIP && !FUNZIP)) */ + +/* + * No need for non-echo keyboard/console input; provide dummy definitions. + */ +#define echoff(f) +#define echon() + +#endif /* ?(CRYPT || (UNZIP && !FUNZIP)) */ + +#endif /* !__ttyio_h */ diff -Nru boinc-7.0.7+dfsg/zip/ziptest.cpp boinc-7.0.14+dfsg/zip/ziptest.cpp --- boinc-7.0.7+dfsg/zip/ziptest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/ziptest.cpp 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,65 @@ +// ziptest.cpp : Defines the entry point for the console application. +// + +#ifndef _WIN32 +#include "../config.h" +#endif +#include "boinc_zip.h" +#include "filesys.h" +#include // CMC -- test that we "co-exist" with the "stock" zlib library + +int do_gzip(const char* strGZ, const char* strInput) +{ + // take an input file (strInput) and turn it into a compressed file (strGZ) + // get rid of the input file after + + FILE* fIn = boinc_fopen(strInput, "rb"); + if (!fIn) return 1; //error + gzFile fOut = gzopen(strGZ, "wb"); + if (!fOut) return 1; //error + + fseek(fIn, 0, SEEK_SET); // go to the top of the files + gzseek(fOut, 0, SEEK_SET); + unsigned char buf[1024]; + long lRead = 0, lWrite = 0; + while (!feof(fIn)) { // read 1KB at a time until end of file + memset(buf, 0x00, 1024); + lRead = 0; + lRead = fread(buf, 1, 1024, fIn); + lWrite = gzwrite(fOut, buf, lRead); + if (lRead != lWrite) break; + } + gzclose(fOut); + fclose(fIn); + + if (lRead != lWrite) return 1; //error -- read bytes != written bytes + + // if we made it here, it compressed OK, can erase strInput and leave + boinc_delete_file(strInput); + return 0; +} + +int main(int argc, char* argv[]) +{ + ZipFileList zflist; +#ifdef _WIN32 + boinc_filelist("c:\\temp", "", &zflist, SORT_NAME | SORT_ASCENDING); +#else + boinc_filelist("/tmp/junk", "", &zflist, SORT_NAME | SORT_ASCENDING); +#endif + int jj; + char strTmp[128], strTmp2[128]; + for (jj = 0; jj < zflist.size(); jj++) { + printf("%s %d\n", zflist[jj].c_str(), zflist[jj].m_statFile.st_mtime); + // now gzip it, silly but see how it goes! + sprintf(strTmp, "%s.gz", zflist[jj].c_str()); + sprintf(strTmp2, "%s.zip", strTmp); + printf("infile=%s outfile=%s\n", strTmp, strTmp2); + do_gzip(strTmp, zflist[jj].c_str()); + boinc_zip(ZIP_IT, strTmp2, strTmp); + } + boinc_zip(UNZIP_IT, "/tmp/boinc_zip.zip", "/tmp/junk/boinc_zip"); + return 0; +} + +const char *BOINC_RCSID_9851414a72 = "$Id: ziptest.cpp 7481 2005-08-25 21:33:28Z davea $"; diff -Nru boinc-7.0.7+dfsg/zip/ziptest.dsp boinc-7.0.14+dfsg/zip/ziptest.dsp --- boinc-7.0.7+dfsg/zip/ziptest.dsp 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/ziptest.dsp 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="ziptest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ziptest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ziptest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ziptest.mak" CFG="ziptest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ziptest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ziptest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +F90=df.exe +RSC=rc.exe + +!IF "$(CFG)" == "ziptest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE F90 /compile_only /nologo /warn:nofileopt +# ADD F90 /compile_only /nologo /warn:nofileopt +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ziptest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt +# ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../boinc/zip" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /TP /c +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 boinc_zipd.lib user32.lib /nologo /subsystem:console /debug /machine:I386 /out:"ziptest.exe" /pdbtype:sept /libpath:"../boinc/zip" + +!ENDIF + +# Begin Target + +# Name "ziptest - Win32 Release" +# Name "ziptest - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" +# Begin Source File + +SOURCE=..\boinc\lib\filesys.C +# End Source File +# Begin Source File + +SOURCE=..\boinc\lib\util.C +# End Source File +# Begin Source File + +SOURCE=.\ziptest.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=..\boinc\zip\boinc_zip.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff -Nru boinc-7.0.7+dfsg/zip/ziptest.vcproj boinc-7.0.14+dfsg/zip/ziptest.vcproj --- boinc-7.0.7+dfsg/zip/ziptest.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/zip/ziptest.vcproj 2012-01-14 05:48:01.000000000 +0000 @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      ApplicationOSTotal
      Results
      Pass RateFail RateFailed
      Downloading
      Failed
      Downloaded
      Failed
      Computing
      Failed
      Uploading
      Failed
      Uploaded
      Aborted
      "; - echo $res->version; - echo ""; - echo $res->platform; + echo sprintf("%.2f", $av->version_num/100)." $p->name [$av->plan_class]"; echo ""; @@ -202,5 +180,5 @@ admin_page_tail(); -$cvs_version_tracker[]="\$Id: pass_percentage_by_platform.php 23755 2011-06-20 17:17:56Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: pass_percentage_by_platform.php 25175 2012-01-31 20:25:26Z davea $"; //Generated automatically - do not edit ?> diff -Nru boinc-7.0.7+dfsg/html/ops/upgrade_db.php boinc-7.0.14+dfsg/html/ops/upgrade_db.php --- boinc-7.0.7+dfsg/html/ops/upgrade_db.php 2010-08-11 20:08:13.000000000 +0000 +++ boinc-7.0.14+dfsg/html/ops/upgrade_db.php 2012-01-02 07:33:08.000000000 +0000 @@ -58,6 +58,8 @@ echo "\nWarning: you are upgrading only web or server code,\nbut these updates may affect the other code as well.\nWe recommend that you run 'upgrade' again to upgrade both parts of the code.\n\n"; } +db_init_cli(); + foreach($updates as $update) { list($rev, $func) = $update; echo "performing update $func\n"; diff -Nru boinc-7.0.7+dfsg/html/user/apps.php boinc-7.0.14+dfsg/html/user/apps.php --- boinc-7.0.7+dfsg/html/user/apps.php 2011-08-25 22:12:48.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/apps.php 2012-01-31 07:21:42.000000000 +0000 @@ -53,19 +53,8 @@ "; } foreach ($platforms as $platform) { - $avs = BoincAppVersion::enum( - "appid=$app->id and platformid = $platform->id and deprecated=0" - ); + $avs = latest_avs_app_platform($app->id, $platform->id); foreach($avs as $av) { - foreach ($avs as $av2) { - if ($av->id == $av2->id) continue; - if ($av->plan_class == $av2->plan_class && $av->version_num > $av2->version_num) { - $av2->deprecated = 1; - } - } - } - foreach($avs as $av) { - if ($av->deprecated) continue; $create_time_f = pretty_time_str($av->create_time); if ($xml) { echo " \n"; diff -Nru boinc-7.0.7+dfsg/html/user/bbcode.php boinc-7.0.14+dfsg/html/user/bbcode.php --- boinc-7.0.7+dfsg/html/user/bbcode.php 2011-08-25 22:12:48.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/bbcode.php 2011-11-20 17:26:32.000000000 +0000 @@ -32,6 +32,7 @@ row2_plain("[b]".tra("Bold")."[/b]", "".tra("Bold").""); row2_plain("[i]".tra("Italic")."[/i]", "".tra("Italic").""); row2_plain("[u]".tra("Underline")."[/u]", "".tra("Underline").""); +row2_plain("[sup]".tra("Superscript")."[/sup]", "X".tra("Superscript").""); row2_plain("[size=15]".tra("Big text")."[/size]", "".tra("Big text").""); row2_plain("[color=red]".tra("Red text")."[/color]", "".tra("Red text").""); row2_plain("[url=http://google.com/]".tra("link to website")."[/url]", "".tra("link to website").""); diff -Nru boinc-7.0.7+dfsg/html/user/forum_report_post.php boinc-7.0.14+dfsg/html/user/forum_report_post.php --- boinc-7.0.7+dfsg/html/user/forum_report_post.php 2011-08-29 17:50:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/forum_report_post.php 2012-01-29 07:25:55.000000000 +0000 @@ -62,10 +62,10 @@ //__--------------- Display part if ($success_page==1) { page_head(tra("Report Registered")); - echo tra("Your report has been recorded. Thanks you for your input.")."

      " + echo tra("Your report has been recorded. Thanks for your input.")."

      " .tra("A moderator will now look at your report and decide what will happen - this may take a little while, so please be patient"); - echo "id, "#", $post->id, "\">".tra("Return to thread").""; + echo "

      id, "#", $post->id, "\">".tra("Return to thread").""; } elseif ($success_page==0){ page_head(tra("Report a forum post")); if (!$no_forum_rating) { diff -Nru boinc-7.0.7+dfsg/html/user/forum_thread.php boinc-7.0.14+dfsg/html/user/forum_thread.php --- boinc-7.0.7+dfsg/html/user/forum_thread.php 2011-08-29 05:37:52.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/forum_thread.php 2012-01-06 22:22:02.000000000 +0000 @@ -238,7 +238,7 @@ if ($thread->status) { show_button( "forum_thread_status.php?action=clear&id=$thread->id", - tra("Export"), + tra("Export as Notice"), tra("Export this news item as a Notice") ); } else { @@ -289,5 +289,5 @@ $thread->update("views=views+1"); page_tail(); -$cvs_version_tracker[]="\$Id: forum_thread.php 24064 2011-08-29 05:37:52Z davea $"; +$cvs_version_tracker[]="\$Id: forum_thread.php 25006 2012-01-06 22:22:02Z davea $"; ?> diff -Nru boinc-7.0.7+dfsg/html/user/get_output.php boinc-7.0.14+dfsg/html/user/get_output.php --- boinc-7.0.7+dfsg/html/user/get_output.php 2011-07-25 23:12:45.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/get_output.php 2012-01-03 08:10:12.000000000 +0000 @@ -22,7 +22,7 @@ require_once("../inc/util.inc"); require_once("../inc/result.inc"); -require_once("../inc/submit_db.inc"); +require_once("../inc/submit_util.inc"); // get a single output file // @@ -95,11 +95,6 @@ unlink($zip_filename); } -if (0) { -get_output_files(24, "xxx"); -exit; -} - $auth_str = get_str('auth_str'); $instance_name = get_str('instance_name', true); if ($instance_name) { diff -Nru boinc-7.0.7+dfsg/html/user/gpu_list.php boinc-7.0.14+dfsg/html/user/gpu_list.php --- boinc-7.0.7+dfsg/html/user/gpu_list.php 2011-10-26 22:11:37.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/gpu_list.php 2011-11-16 19:47:40.000000000 +0000 @@ -44,9 +44,9 @@ $models[$model]->count++; $models[$model]->time += $r->elapsed_time; } else { - $x = null; - $x->count = 1; - $x->time = $r->elapsed_time/$wu->rsc_fpops_est; + $x = null; + $x->count = 1; + $x->time = $r->elapsed_time/$wu->rsc_fpops_est; $models[$model] = $x; } } @@ -57,9 +57,13 @@ // $x->linux // $x->mac // -function get_gpu_list($vendor) { - $avs = BoincAppVersion::enum("plan_class like '%$vendor%'"); - if (count($avs) == 0) return null; +function get_gpu_list($vendor, $alt_vendor=null) { + $clause = "plan_class like '%$vendor%'"; + if ($alt_vendor) { + $clause .= " or plan_class like '%$alt_vendor%'"; + } + $avs = BoincAppVersion::enum($clause); + if (count($avs) == 0) return null; $av_ids = ""; foreach($avs as $av) { @@ -68,9 +72,11 @@ $av_ids .= "0"; $t = time() - 30*86400; - //echo "start enum $vendor $av_ids\n"; - $results = BoincResult::enum("app_version_id in ($av_ids) and create_time > $t and elapsed_time>100 limit 500"); - //echo "end enum\n"; + //echo "start enum $vendor $av_ids\n"; + $results = BoincResult::enum( + "app_version_id in ($av_ids) and create_time > $t and elapsed_time>100 limit 500" + ); + //echo "end enum\n"; $total = array(); $win = array(); $linux = array(); @@ -78,7 +84,7 @@ foreach ($results as $r) { $h = BoincHost::lookup_id($r->hostid); if (!$h) continue; - $wu = BoincWorkunit::lookup_id($r->workunitid); + $wu = BoincWorkunit::lookup_id($r->workunitid); if (!$wu) continue; $v = $vendor=="cuda"?"CUDA":"CAL"; $model = get_gpu_model($h->serialnum, $v); @@ -105,13 +111,13 @@ function get_gpu_lists() { $x = null; - $x->cuda = get_gpu_list("cuda"); + $x->cuda = get_gpu_list("cuda", "nvidia"); $x->ati = get_gpu_list("ati"); return $x; } function gpucmp($x1, $x2) { - return $x1->avg_time > $x2->avg_time; + return $x1->avg_time > $x2->avg_time; } function show_list($models, $name) { @@ -120,21 +126,21 @@ echo tra("No GPU tasks reported")."

      Result IDWorkunit IDHost IDClaimed credit
      ".tra("Result ID")."".tra("Workunit ID")."".tra("Host ID")."".tra("Claimed credit")."
      ".output_transform($msg->content, $options)."

      "; $tokens = url_tokens($logged_in_user->authenticator); - show_button("pm.php?action=new&replyto=$msg->id", tra("Reply"), "Reply to this message"); - show_button("pm.php?action=delete&id=$msg->id&$tokens", tra("Delete"), "Delete this message"); + show_button("pm.php?action=new&replyto=$msg->id", tra("Reply"), tra("Reply to this message")); + show_button("pm.php?action=delete&id=$msg->id&$tokens", tra("Delete"), tra("Delete this message")); echo "

      - Select all + ".tra("Select all")." | - Unselect all + ".tra("Unselect all")." @@ -128,7 +128,7 @@ $id = get_int("id"); $message = BoincPrivateMessage::lookup_id($id); if (!$message || $message->userid != $logged_in_user->id) { - error_page("no such message"); + error_page(tra("no such message")); } page_head(tra("Private messages")." : ".$message->subject); pm_header(); @@ -185,9 +185,9 @@ pm_form($replyto, $userid, tra("You need to fill all fields to send a private message")); } else { if (!akismet_check($logged_in_user, $content)) { - pm_form($replyto, $userid, "Your message was flagged as spam + pm_form($replyto, $userid, tra("Your message was flagged as spam by the Akismet anti-spam system. - Please modify your text and try again." + Please modify your text and try again.") ); } $to = str_replace(", ", ",", $to); // Filter out spaces after separator @@ -257,7 +257,7 @@ check_tokens($logged_in_user->authenticator); $id = post_int("id"); $blocked_user = BoincUser::lookup_id($id); - if (!$blocked_user) error_page("no such user"); + if (!$blocked_user) error_page(tra("no such user")); add_ignored_user($logged_in_user, $blocked_user); page_head(tra("User %1 blocked", $blocked_user->name)); @@ -299,7 +299,7 @@ } elseif ($action == "delete_selected") { do_delete_selected($logged_in_user); } else { - error_page("Unknown action"); + error_page(tra("Unknown action")); } page_tail(); diff -Nru boinc-7.0.7+dfsg/html/user/sandbox.php boinc-7.0.14+dfsg/html/user/sandbox.php --- boinc-7.0.7+dfsg/html/user/sandbox.php 1970-01-01 00:00:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/sandbox.php 2012-01-18 09:04:35.000000000 +0000 @@ -0,0 +1,162 @@ +. + +// Per-user "file sandboxes" for job submission. +// These are stored in project-root/sandbox/USERID/ +// +// The entries in a sandbox directory have contents +// size md5 +// +// The actual files are stored in the download hierarchy, +// with sb_userid_MD5 as the physical name + +// NOTE: PHP's default max file upload size is 2MB. +// To increase this, edit /etc/php.ini, and change, e.g. +// +// upload_max_filesize = 64M +// post_max_size = 64M + +error_reporting(E_ALL); +ini_set('display_errors', true); +ini_set('display_startup_errors', true); + +require_once("../inc/sandbox.inc"); +require_once("../inc/submit_db.inc"); + +function list_files($user) { + $dir = sandbox_dir($user); + $d = opendir($dir); + if (!$d) error_page("Can't open sandbox directory"); + page_head("file sandbox for $user->name"); + echo " +
      + + Upload a file to your sandbox: +

      +

      +

      +
      + "; + $files = array(); + while (($f = readdir($d)) !== false) { + if ($f == '.') continue; + if ($f == '..') continue; + $files[] = $f; + } + if (count($files) == 0) { + echo "Your sandbox is currently empty."; + } else { + sort($files); + start_table(); + table_header("Name
      (click to view)", "Modified", "Size (bytes)", "MD5", ""); + foreach($files as $f) { + $path = "$dir/$f"; + list($error, $size, $md5) = sandbox_parse_link_file($path); + if ($error) { + table_row($f, "Can't parse link file", "", "delete"); + } else { + $ct = time_str(filemtime($path)); + table_row( + "$f", + $ct, + $size, + $md5, + button_text( + "sandbox.php?action=delete_file&name=$f", + "Delete" + ) + ); + } + } + end_table(); + } + echo " +

      Submit LAMMPS jobs + "; + page_tail(); +} + +function upload_file($user) { + $tmp_name = $_FILES['new_file']['tmp_name']; + if (is_uploaded_file($tmp_name)) { + $name = $_FILES['new_file']['name']; + if (strstr($name, "/")) { + error_page("no / allowed"); + } + $md5 = md5_file($tmp_name); + $s = stat($tmp_name); + $size = $s['size']; + + // move file to download dir + // + $phys_path = sandbox_physical_path($user, $md5); + rename($tmp_name, $phys_path); + + // write link file + // + $dir = sandbox_dir($user); + $link_path = "$dir/$name"; + sandbox_write_link_file($link_path, $size, $md5); + } + Header("Location: sandbox.php"); +} + +function delete_file($user) { + $name = get_str('name'); + $dir = sandbox_dir($user); + list($error, $size, $md5) = sandbox_parse_link_file("$dir/$name"); + unlink("$dir/$name"); + if ($error) { + error_page("can't parse link file"); + } + $p = sandbox_physical_path($user, $md5); + if (!is_file($p)) { + error_page("no such physical file"); + } + unlink($p); + Header("Location: sandbox.php"); +} + +function view_file($user) { + $name = get_str('name'); + $dir = sandbox_dir($user); + list($error, $size, $md5) = sandbox_parse_link_file("$dir/$name"); + if ($error) error_page("no such link file"); + $p = sandbox_physical_path($user, $md5); + if (!is_file($p)) error_page("no such physical file"); + echo "

      \n";
      +    readfile($p);
      +    echo "
      \n"; +} + +$user = get_logged_in_user(); +$user_submit = BoincUserSubmit::lookup_userid($user->id); +if (!$user_submit) error_page("no job submission access"); + +$action = get_str('action', true); +if (!$action) $action = post_str('action', true); + +switch ($action) { +case '': list_files($user); break; +case 'upload_file': upload_file($user); break; +case 'delete_file': delete_file($user); break; +case 'view_file': view_file($user); break; +default: error_page("no such action: $action"); +} + +?> diff -Nru boinc-7.0.7+dfsg/html/user/show_user.php boinc-7.0.14+dfsg/html/user/show_user.php --- boinc-7.0.7+dfsg/html/user/show_user.php 2011-07-25 22:05:49.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/show_user.php 2011-12-01 18:44:19.000000000 +0000 @@ -23,7 +23,7 @@ // Object-caching and full-file caching is used to speed up queries // for data from this page. -$cvs_version_tracker[]="\$Id: show_user.php 23872 2011-07-25 22:05:49Z davea $"; //Generated automatically - do not edit +$cvs_version_tracker[]="\$Id: show_user.php 24708 2011-12-01 18:44:19Z davea $"; //Generated automatically - do not edit require_once("../inc/cache.inc"); require_once("../inc/util.inc"); @@ -33,7 +33,7 @@ require_once("../inc/forum.inc"); require_once("../project/project.inc"); -check_get_args(array("auth", "userid", "format")); +//check_get_args(array("auth", "userid", "format")); $auth = get_str("auth", true); if (!$auth) { diff -Nru boinc-7.0.7+dfsg/html/user/submit_example.php boinc-7.0.14+dfsg/html/user/submit_example.php --- boinc-7.0.7+dfsg/html/user/submit_example.php 2011-09-21 21:26:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/submit_example.php 2011-12-31 08:57:53.000000000 +0000 @@ -19,16 +19,19 @@ // example of a web interface to remote job submission // -// Notes: -// - You'll need to adapt/extend this considerably, -// especially if you want to run this -// on a server other than the BOINC project serve. -// - For convenience, this uses some functions from BOINC -// (page_head() etc.). +// Although the architecture is intended to support remote portals, +// this example must run on the BOINC project server. +// In particular: +// - It assumes cookie-based authentication, +// as is done by the BOINC code. +// You'll need to adapt/extend this considerably to run this +// on a server other than the BOINC project server. +// - It uses some functions from BOINC (page_head() etc.). // When you adapt this to your own purposes, // you can strip out this stuff if the web site doesn't use BOINC require_once("../inc/submit.inc"); +require_once("../inc/submit_util.inc"); require_once("../inc/submit_db.inc"); require_once("../inc/util.inc"); require_once("../project/project.inc"); @@ -60,13 +63,18 @@ echo " This is an example of a web interface for remote submission of BOINC jobs. - It lets you submit batches of jobs, - and see the status of in-progress and completed batches. + It lets you +
        +
      • Upload files +
      • submit batches of jobs, +
      • see the status of in-progress and completed batches. +

      To use this, you must be logged in as a user with permission to submit jobs.

      "; + show_button("submit_example.php?action=manage_files", "Manage files"); show_button("submit_example.php?action=create_form", "Create new batch"); $first = true; @@ -446,36 +454,23 @@ page_tail(); } +function manage_files() { + $files = submit_get_file_list(); +} + $action = get_str('action', true); switch ($action) { -case '': - handle_main(); - break; -case 'create_form': - handle_create_form(); - break; -case 'create_action': - handle_create_action(); - break; -case 'query_batch': - handle_query_batch(); - break; -case 'query_job': - handle_query_job(); - break; -case 'abort_batch_confirm': - handle_abort_batch_confirm(); - break; -case 'abort_batch': - handle_abort_batch(); - break; -case 'retire_batch_confirm': - handle_retire_batch_confirm(); - break; -case 'retire_batch': - handle_retire_batch(); - break; +case '': handle_main(); break; +case 'abort_batch': handle_abort_batch(); break; +case 'abort_batch_confirm': handle_abort_batch_confirm(); break; +case 'create_action': handle_create_action(); break; +case 'create_form': handle_create_form(); break; +case 'manage_files': manage_files(); break; +case 'query_batch': handle_query_batch(); break; +case 'query_job': handle_query_job(); break; +case 'retire_batch': handle_retire_batch(); break; +case 'retire_batch_confirm': handle_retire_batch_confirm(); break; default: error_page('no such action'); } diff -Nru boinc-7.0.7+dfsg/html/user/submit.php boinc-7.0.14+dfsg/html/user/submit.php --- boinc-7.0.7+dfsg/html/user/submit.php 2011-09-21 21:26:00.000000000 +0000 +++ boinc-7.0.14+dfsg/html/user/submit.php 2012-01-03 08:10:12.000000000 +0000 @@ -1,4 +1,5 @@ . -// Handler for remote job submission. -// See http://boinc.berkeley.edu/trac/wiki/RemoteJobs - -require_once("../inc/boinc_db.inc"); require_once("../inc/submit_db.inc"); -require_once("../inc/xml.inc"); -require_once("../inc/dir_hier.inc"); +require_once("../inc/util.inc"); require_once("../inc/result.inc"); require_once("../inc/submit_util.inc"); +require_once("../project/project.inc"); error_reporting(E_ALL); ini_set('display_errors', true); ini_set('display_startup_errors', true); -function error($s) { - echo "\n$s\n\n"; - exit; -} - -function authenticate_user($r, $app) { - $auth = (string)$r->authenticator; - if (!$auth) error("no authenticator"); - $user = BoincUser::lookup("authenticator='$auth'"); - if (!$user) error("bad authenticator"); - $user_submit = BoincUserSubmit::lookup_userid($user->id); - if (!$user_submit) error("no submit access"); - if ($app && !$user_submit->submit_all) { - $usa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id"); - if (!$usa) { - error("no submit access"); - } - } - return array($user, $user_submit); -} - -function get_app($r) { - $name = (string)($r->batch->app_name); - $app = BoincApp::lookup("name='$name'"); - if (!$app) error("no app"); - return $app; -} - -function batch_flop_count($r) { - $x = 0; - foreach($r->batch->job as $job) { - $x += (double)$job->rsc_fpops_est; - } - return $x; -} - -// estimate project FLOPS based on recent average credit +// the job submission "home page": +// show the user's in-progress and completed batches, +// and a button for creating a new batch // -function project_flops() { - $x = BoincUser::sum("expavg_credit"); - if ($x == 0) $x = 200; - $y = 1e9*$x/200; - return $y; -} - -function est_elapsed_time($r) { - // crude estimate: batch FLOPs / project FLOPS - // - return batch_flop_count($r) / project_flops(); -} - -function estimate_batch($r) { - $app = get_app($r); - list($user, $user_submit) = authenticate_user($r, $app); - - $e = est_elapsed_time($r); - echo "\n$e\n\n"; -} +function handle_main($user) { + page_head("Job submission and control"); -function read_input_template($app) { - $path = "../../templates/$app->name"."_in"; - return simplexml_load_file($path); -} + $first = true; + $batches = BoincBatch::enum("user_id = $user->id"); -function validate_batch($jobs, $template) { - $i = 0; - $n = count($template->file_info); - foreach($jobs as $job) { - $m = count($job->input_files); - if ($n != $m) { - error("wrong # of input files for job $i: need $n, got $m"); + foreach ($batches as $batch) { + if ($batch->state < BATCH_STATE_COMPLETE) { + $wus = BoincWorkunit::enum("batch = $batch->id"); + $batch = get_batch_params($batch, $wus); } - $i++; - } -} - -$fanout = parse_config(get_config(), ""); - -// stage a file, and return the physical name -// -function stage_file($file) { - global $fanout; - - $md5 = md5_file($file->source); - if (!$md5) { - error("Can't get MD5 of file $source"); - } - $name = "batch_$md5"; - $path = dir_hier_path($name, "../../download", $fanout); - if (file_exists($path)) return; - if (!copy($file->source, $path)) { - error("can't copy file from $file->source to $path"); - } - return $name; -} - -// stage all the files -// -function stage_files(&$jobs, $template) { - foreach($jobs as $job) { - foreach ($job->input_files as $file) { - $file->name = stage_file($file); + $app = BoincApp::lookup_id($batch->app_id); + if ($app) { + $batch->app_name = $app->name; + } else { + $batch->app_name = "unknown"; } } -} -function submit_job($job, $template, $app, $batch_id, $i) { - $cmd = "cd ../..; ./bin/create_work --appname $app->name --batch $batch_id --rsc_fpops_est $job->rsc_fpops_est"; - if ($job->command_line) { - $cmd .= " --command_line \"$job->command_line\""; - } - $cmd .= " --wu_name batch_".$batch_id."_".$i; - foreach ($job->input_files as $file) { - $cmd .= " $file->name"; - } - $ret = system($cmd); - if ($ret === FALSE) { - error("can't create job"); - } -} - -function xml_get_jobs($r) { - $jobs = array(); - foreach($r->batch->job as $j) { - $job = null; - $job->input_files = array(); - $job->command_line = (string)$j->command_line; - $job->rsc_fpops_est = (double)$j->rsc_fpops_est; - foreach ($j->input_file as $f) { - $file = null; - $file->source = (string)$f->source; - $job->input_files[] = $file; + foreach ($batches as $batch) { + if ($batch->state != BATCH_STATE_IN_PROGRESS) continue; + if ($first) { + $first = false; + echo "

      Batches in progress

      \n"; + start_table(); + table_header("name", "ID", "app", "# jobs", "progress", "submitted"); } - $jobs[] = $job; + $pct_done = (int)($batch->fraction_done*100); + table_row( + "id>$batch->name", + "id>$batch->id", + $batch->app_name, + $batch->njobs, + "$pct_done%", + local_time_str($batch->create_time) + ); + } + if ($first) { + echo "

      You have no in-progress batches.\n"; + } else { + end_table(); } - return $jobs; -} -function submit_batch($r) { - $app = get_app($r); - list($user, $user_submit) = authenticate_user($r, $app); - $template = read_input_template($app); - $jobs = xml_get_jobs($r); - validate_batch($jobs, $template); - stage_files($jobs, $template); - $njobs = count($jobs); - $now = time(); - $batch_name = (string)($r->batch->batch_name); - $batch_id = BoincBatch::insert( - "(user_id, create_time, njobs, name, app_id) values ($user->id, $now, $njobs, '$batch_name', $app->id)" - ); - $i = 0; - foreach($jobs as $job) { - submit_job($job, $template, $app, $batch_id, $i++); + $first = true; + foreach ($batches as $batch) { + if ($batch->state != BATCH_STATE_COMPLETE) continue; + if ($first) { + $first = false; + echo "

      Completed batches

      \n"; + start_table(); + table_header("name", "ID", "app", "# jobs", "submitted"); + } + table_row( + "id>$batch->name", + "id>$batch->id", + $batch->app_name, + $batch->njobs, + local_time_str($batch->create_time) + ); + } + if ($first) { + echo "

      You have no completed batches.\n"; + } else { + end_table(); } - $batch = BoincBatch::lookup_id($batch_id); - $batch->update("state=".BATCH_STATE_IN_PROGRESS); - echo "$batch_id\n"; -} -// given its WUs, compute params of a batch -// NOTE: eventually this should be done by server components -// (transitioner, validator etc.) as jobs complete or time out -// -// TODO: update est_completion_time -// -function get_batch_params($batch, $wus) { - $fp_total = 0; - $fp_done = 0; - $completed = true; - $batch->nerror_jobs = 0; - $batch->credit_canonical = 0; - foreach ($wus as $wu) { - $fp_total += $wu->rsc_fpops_est; - if ($wu->canonical_resultid) { - $fp_done += $wu->rsc_fpops_est; - $batch->credit_canonical += $wu->canonical_credit; - } else if ($wu->error_mask) { - $batch->nerror_jobs++; - } else { - $completed = false; + $first = true; + foreach ($batches as $batch) { + if ($batch->state != BATCH_STATE_ABORTED) continue; + if ($first) { + $first = false; + echo "

      Aborted batches

      \n"; + start_table(); + table_header("name", "ID", "app", "# jobs", "submitted"); } + table_row( + "id>$batch->name", + "id>$batch->id", + $batch->app_name, + $batch->njobs, + local_time_str($batch->create_time) + ); } - if ($fp_total) { - $batch->fraction_done = $fp_done / $fp_total; - } - if ($completed && $batch->state < BATCH_STATE_COMPLETE) { - $batch->state = BATCH_STATE_COMPLETE; - $batch->completion_time = time(); + if (!$first) { + end_table(); } - $batch->update("fraction_done = $batch->fraction_done, nerror_jobs = $batch->nerror_jobs, state=$batch->state, completion_time = $batch->completion_time, credit_canonical = $batch->credit_canonical"); - $batch->credit_estimate = flops_to_credit($fp_total); - return $batch; + echo "

      Return to job control page\n"; + page_tail(); } -function print_batch_params($batch) { +// show the details of an existing batch +// +function handle_query_batch($user) { + $batch_id = get_int('batch_id'); + $batch = BoincBatch::lookup_id($batch_id); $app = BoincApp::lookup_id($batch->app_id); - echo " - $batch->id - $batch->create_time - $batch->est_completion_time - $batch->njobs - $batch->fraction_done - $batch->nerror_jobs - $batch->state - $batch->completion_time - $batch->credit_estimate - $batch->credit_canonical - $batch->name - $app->name -"; -} -function query_batches($r) { - list($user, $user_submit) = authenticate_user($r, null); - $batches = BoincBatch::enum("user_id = $user->id"); - echo "\n"; - foreach ($batches as $batch) { - if ($batch->state < BATCH_STATE_COMPLETE) { - $wus = BoincWorkunit::enum("batch = $batch->id"); - $batch = get_batch_params($batch, $wus); + page_head("Batch $batch_id"); + start_table(); + row2("name", $batch->name); + row2("application", $app->name); + row2("state", batch_state_string($batch->state)); + row2("# jobs", $batch->njobs); + row2("# error jobs", $batch->nerror_jobs); + row2("progress", sprintf("%.0f%%", $batch->fraction_done*100)); + if ($batch->completion_time) { + row2("completed", local_time_str($batch->completion_time)); + } + row2("GFLOP/hours, estimated", number_format(credit_to_gflop_hours($batch->credit_estimate), 2)); + row2("GFLOP/hours, actual", number_format(credit_to_gflop_hours($batch->credit_canonical), 2)); + end_table(); + $url = boinc_get_output_files_url($user, $batch_id); + show_button($url, "Get zipped output files"); + switch ($batch->state) { + case BATCH_STATE_IN_PROGRESS: + echo "
      "; + show_button( + "submit.php?action=abort_batch_confirm&batch_id=$batch_id", + "Abort batch" + ); + break; + case BATCH_STATE_COMPLETE: + case BATCH_STATE_ABORTED: + echo "
      "; + show_button( + "submit.php?action=retire_batch_confirm&batch_id=$batch_id", + "Retire batch" + ); + break; + } + + echo "

      Jobs

      \n"; + start_table(); + table_header( + "Job ID
      click for details or to get output files", + "status", + "Canonical instance
      click to see result page on BOINC server" + ); + $wus = BoincWorkunit::enum("batch = $batch->id"); + foreach($wus as $wu) { + $resultid = $wu->canonical_resultid; + if ($resultid) { + $x = "$resultid"; + $y = "completed"; + } else { + $x = "---"; + $y = "in progress"; } - echo " \n"; - print_batch_params($batch); - echo " \n"; + + echo "
      id>$wu->id$y$x
      id>$result->id".state_string($result)." "; - } + $i = 0; + if ($result->server_state == 5) { + $names = get_outfile_names($result); + $fanout = parse_config(get_config(), ""); + $i = 0; + foreach ($names as $name) { + $url = boinc_get_output_file_url($user, $result, $i++); + $path = dir_hier_path($name, "../../upload", $fanout); + $s = stat($path); + $size = $s['size']; + echo "$size bytes"; } + $i++; } - echo "\n"; + echo "