Changeset 907 for trunk/dll/collect.c


Ignore:
Timestamp:
Jan 6, 2008, 8:26:17 AM (18 years ago)
Author:
Steven Levine
Message:

Avoid out of memory traps in Compare Directories
Rework Compare Directories progress display for 2 second update rate
Start refactoring to reduce dependence on fm3dll.h
Add timer services (IsITimerExpired etc.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r906 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2003, 2007 Steven H. Levine
     9  Copyright (c) 2003, 2008 Steven H. Levine
    1010
    1111  15 Oct 02 MK Baseline
     
    4545***********************************************************************/
    4646
    47 #define INCL_DOS
    48 #define INCL_WIN
    49 #define INCL_GPI
    50 #define INCL_DOSERRORS
    51 #define INCL_LONGLONG
    52 #include <os2.h>
    53 
    54 #include <stdarg.h>
    55 #include <stdio.h>
    5647#include <stdlib.h>
    5748#include <string.h>
    5849#include <ctype.h>
    59 #include <time.h>
    6050#include <share.h>
    6151#include <limits.h>
    6252#include <process.h>                    // _beginthread
    6353
    64 #include "fm3dll.h"
     54#define INCL_DOS                        // QSV_MS_COUNT
     55#define INCL_WIN
     56#define INCL_DOSERRORS
     57#define INCL_LONGLONG
     58
    6559#include "fm3dlg.h"
    6660#include "fm3str.h"
    6761#include "mle.h"
    6862#include "grep.h"
     63#include "comp.h"
     64#include "arccnrs.h"                    // StartArcCnr
     65#include "filldir.h"                    // EmptyCnr...
     66#include "strutil.h"                    // GetPString
     67#include "errutil.h"                    // Runtime_Error
     68#include "fm3dll.h"
    6969
    7070#pragma data_seg(DATA1)
     
    127127              if (dcd) {
    128128                SetViewMenu(hwndButtonPopup, dcd->flWindowAttr);
    129                 SetDetailsSwitches(hwndButtonPopup, dcd);
    130                 CopyPresParams(hwndButtonPopup, hwnd);
     129                SetDetailsSwitches(hwndButtonPopup, dcd);
     130                CopyPresParams(hwndButtonPopup, hwnd);
    131131              }
    132132
     
    572572        else {
    573573          pciFirst = pci;
     574          // 04 Jan 08 SHL fixme like comp.c if CM_ALLOCRECORD returns unexpected record count
    574575          for (x = 0; li->list[x]; x++) {
    575576            nm = 1;
     
    587588                               TRUE) &&
    588589                !xDosFindFirst(fullname,
    589                                &hdir,
    590                                FILE_NORMAL | FILE_DIRECTORY |
    591                                FILE_ARCHIVED | FILE_SYSTEM |
    592                                FILE_HIDDEN | FILE_READONLY,
    593                                &fb4, sizeof(fb4), &nm, FIL_QUERYEASIZEL)) {
     590                               &hdir,
     591                               FILE_NORMAL | FILE_DIRECTORY |
     592                               FILE_ARCHIVED | FILE_SYSTEM |
     593                               FILE_HIDDEN | FILE_READONLY,
     594                               &fb4, sizeof(fb4), &nm, FIL_QUERYEASIZEL)) {
    594595              DosFindClose(hdir);
    595596              priority_normal();
     
    13591360        SetViewMenu((HWND) mp2, dcd->flWindowAttr);
    13601361        WinEnableMenuItem((HWND) mp2, IDM_RESELECT,
    1361                           (dcd->lastselection != NULL));
    1362         CopyPresParams((HWND) mp2, hwnd);
     1362                          (dcd->lastselection != NULL));
     1363        CopyPresParams((HWND) mp2, hwnd);
    13631364        break;
    13641365
     
    20922093            if (dcd->hwndLastMenu == CollectorCnrMenu) {
    20932094              SetViewMenu(dcd->hwndLastMenu, dcd->flWindowAttr);
    2094               SetDetailsSwitches(dcd->hwndLastMenu, dcd);
    2095               CopyPresParams(dcd->hwndLastMenu, hwnd);
     2095              SetDetailsSwitches(dcd->hwndLastMenu, dcd);
     2096              CopyPresParams(dcd->hwndLastMenu, hwnd);
    20962097              if (dcd->flWindowAttr & CV_MINI)
    20972098                WinCheckMenuItem(dcd->hwndLastMenu, IDM_MINIICONS, TRUE);
     
    23002301                strcat(li->targetpath, " %a");
    23012302                ExecOnList(dcd->hwndParent, li->targetpath,
    2302                            PROMPT | WINDOWED, NULL, li->list, NULL,
    2303                            pszSrcFile, __LINE__);
     2303                           PROMPT | WINDOWED, NULL, li->list, NULL,
     2304                           pszSrcFile, __LINE__);
    23042305                FreeList(li->list);
    23052306                li->list = NULL;
     
    25232524            DosError(FERR_DISABLEHARDERR);
    25242525            status = DosFindFirst(pci->pszFileName, &hDir,
    2525                                    FILE_NORMAL | FILE_DIRECTORY |
     2526                                   FILE_NORMAL | FILE_DIRECTORY |
    25262527                                   FILE_ARCHIVED | FILE_READONLY |
    25272528                                   FILE_HIDDEN | FILE_SYSTEM,
Note: See TracChangeset for help on using the changeset viewer.