Changeset 748 for trunk/dll/select.c


Ignore:
Timestamp:
Aug 2, 2007, 7:09:27 AM (18 years ago)
Author:
Steven Levine
Message:

Rework comp.c to to sync with CNRITEM mods
Rework comp.c to remove vast amount of duplicate code
Clean up select.c while auditing for CNRITEM sync
Sync fm3dll.h with comp.c mods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/select.c

    r730 r748  
    2020  12 May 07 SHL Use dcd->ulItemsToUnHilite
    2121  14 Jun 07 SHL SelectAll: make odd expression go away
     22  01 Aug 07 SHL Clean up while auditing for CNRITEM sync
    2223
    2324***********************************************************************/
     
    5455  }
    5556  pci = (PCNRITEM) CurrentRecord(hwndCnr);
    56   if (pci && (INT) pci != -1) {
     57  if (pci && (INT)pci != -1) {
    5758    if (pci->rc.flRecordAttr & CRA_SELECTED) {
    5859      attribute = CRA_SELECTED;
     
    6061                       MPFROMSHORT(attribute));
    6162    }
    62     while (pci && (INT) pci != -1) {
     63    while (pci && (INT)pci != -1) {
    6364      WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
    6465                 MPFROM2SHORT(FALSE, CRA_SELECTED));
     
    7980
    8081VOID SelectList(HWND hwndCnr, BOOL partial, BOOL deselect, BOOL clearfirst,
    81                 PCNRITEM pciParent, CHAR * filename, CHAR ** list)
     82                PCNRITEM pciParent, PSZ filename, CHAR ** list)
    8283{
    8384
     
    157158}
    158159
    159 VOID SelectAll(HWND hwndCnr, BOOL files, BOOL dirs, CHAR * maskstr,
    160                CHAR * text, BOOL is_arc)
     160VOID SelectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
     161               PSZ text, BOOL is_arc)
    161162{
    162163
    163164  PCNRITEM pci;
    164165  BOOL markit;
    165   register CHAR *file;
     166  PSZ file;
     167  PSZ pszToMatch;
    166168  MASK Mask;
    167   register INT x;
     169  INT x;
    168170  ULONG textlen = 0;
    169171
     
    175177  pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
    176178                              MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    177   while (pci && (INT) pci != -1) {
     179  while (pci && (INT)pci != -1) {
     180
    178181    markit = FALSE;
    179     if (!(pci->rc.flRecordAttr & CRA_FILTERED)) {
     182
     183    if (~pci->rc.flRecordAttr & CRA_FILTERED) {
    180184      if (!is_arc) {
    181         if (files && !(pci->attrFile & FILE_DIRECTORY))
     185        if (files && ~pci->attrFile & FILE_DIRECTORY)
    182186          markit = TRUE;
    183         if (dirs && (pci->attrFile & FILE_DIRECTORY))
     187        if (dirs && pci->attrFile & FILE_DIRECTORY)
    184188          markit = TRUE;
    185189      }
     
    188192      if (maskstr && *maskstr && markit) {
    189193        markit = FALSE;
     194        // Point a filename part
    190195        file = strrchr(pci->pszFileName, '\\');
    191196        if (!file)
     
    197202        for (x = 0; Mask.pszMasks[x]; x++) {
    198203          if (*Mask.pszMasks[x]) {
     204            if ((strchr(Mask.pszMasks[x], '\\') ||
     205                strchr(Mask.pszMasks[x], ':')))
     206              pszToMatch = pci->pszFileName;
     207            else
     208              pszToMatch = file;
    199209            if (*Mask.pszMasks[x] != '/') {
    200               if (wildcard((strchr(Mask.pszMasks[x], '\\') ||
    201                             strchr(Mask.pszMasks[x], ':')) ?
    202                              pci->pszFileName :
    203                              file,
    204                            Mask.pszMasks[x],
    205                            FALSE)) {
     210              if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE)) {
    206211                markit = TRUE;
    207212              }
    208213            }
    209214            else {
    210               if (wildcard((strchr(Mask.pszMasks[x], '\\') ||
    211                             strchr(Mask.pszMasks[x], ':')) ?
    212                               pci->pszFileName :
    213                               file,
    214                             Mask.pszMasks[x] + 1,
    215                            FALSE)) {
     215              if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
    216216                markit = FALSE;
    217217                break;
     
    222222      }
    223223    }
    224     if (markit && text && *text && !(pci->attrFile & FILE_DIRECTORY)) {
    225 
    226       CHAR *input;
    227 
    228       markit = FALSE;
    229       input = xmalloc(65537, pszSrcFile, __LINE__);
    230       if (input) {
    231         ULONG pos;
    232         LONG len;
    233         FILE *inputFile;
    234 
    235         if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
    236           pos = ftell(inputFile);
    237           while (!feof(inputFile)) {
    238             if (pos)
    239               fseek(inputFile, pos - 256, SEEK_SET);
    240             len = fread(input, 1, 65536, inputFile);
    241             if (len >= 0) {
    242               if (findstring(text, textlen, input, len, FALSE)) {
    243                 markit = TRUE;
     224
     225    if (markit && text && *text) {
     226      if (~pci->attrFile & FILE_DIRECTORY) {
     227        PSZ input;
     228        markit = FALSE;
     229        input = xmalloc(65537, pszSrcFile, __LINE__);
     230        if (input) {
     231          ULONG pos;
     232          LONG len;
     233          FILE *inputFile;
     234
     235          if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
     236            pos = ftell(inputFile);
     237            while (!feof(inputFile)) {
     238              if (pos)
     239                fseek(inputFile, pos - 256, SEEK_SET);
     240              len = fread(input, 1, 65536, inputFile);
     241              if (len >= 0) {
     242                if (findstring(text, textlen, input, len, FALSE)) {
     243                  markit = TRUE;
     244                  break;
     245                }
     246              }
     247              else
    244248                break;
    245               }
    246249            }
    247             else
    248               break;
     250            fclose(inputFile);
    249251          }
    250           fclose(inputFile);
     252          free(input);
     253          DosSleep(1L);
    251254        }
    252         free(input);
    253         DosSleep(1L);
    254       }
    255     }
    256     else if (markit && text && *text && (pci->attrFile & FILE_DIRECTORY))
    257       markit = FALSE;
     255      }
     256      else
     257        markit = FALSE;
     258    }
     259
    258260    if (markit)
    259261      WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
     
    264266}
    265267
    266 VOID DeselectAll(HWND hwndCnr, BOOL files, BOOL dirs, CHAR * maskstr,
    267                  CHAR * text, BOOL is_arc)
     268VOID DeselectAll(HWND hwndCnr, BOOL files, BOOL dirs, PSZ maskstr,
     269                 PSZ text, BOOL is_arc)
    268270{
    269271  PCNRITEM pci;
    270272  BOOL unmarkit;
    271   register CHAR *file;
     273  PSZ file;
     274  PSZ pszToMatch;
    272275  MASK Mask;
    273276  register INT x;
     
    281284  pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
    282285                              MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    283   while (pci && (INT) pci != -1) {
     286  while (pci && (INT)pci != -1) {
    284287    unmarkit = FALSE;
    285     if (!(pci->rc.flRecordAttr & CRA_FILTERED)) {
     288    if (~pci->rc.flRecordAttr & CRA_FILTERED) {
    286289      if (!is_arc) {
    287         if (files && !(pci->attrFile & FILE_DIRECTORY))
     290        if (files && ~pci->attrFile & FILE_DIRECTORY)
    288291          unmarkit = TRUE;
    289292        if (dirs && (pci->attrFile & FILE_DIRECTORY))
     
    303306        for (x = 0; Mask.pszMasks[x]; x++) {
    304307          if (*Mask.pszMasks[x]) {
     308            if (strchr(Mask.pszMasks[x], '\\') ||
     309                strchr(Mask.pszMasks[x], ':'))
     310              pszToMatch = pci->pszFileName;
     311            else
     312              pszToMatch = file;
    305313            if (*Mask.pszMasks[x] != '/') {
    306               if (wildcard((strchr(Mask.pszMasks[x], '\\') ||
    307                             strchr(Mask.pszMasks[x], ':')) ?
    308                            pci->pszFileName : file, Mask.pszMasks[x], FALSE))
     314              if (wildcard(pszToMatch, Mask.pszMasks[x], FALSE))
    309315                unmarkit = TRUE;
    310316            }
    311317            else {
    312               if (wildcard((strchr(Mask.pszMasks[x], '\\') ||
    313                             strchr(Mask.pszMasks[x], ':')) ?
    314                            pci->pszFileName : file, Mask.pszMasks[x] + 1,
    315                            FALSE)) {
     318              if (wildcard(pszToMatch, Mask.pszMasks[x] + 1, FALSE)) {
    316319                unmarkit = FALSE;
    317320                break;
     
    322325      }
    323326    }
    324     if (unmarkit && text && *text && !(pci->attrFile & FILE_DIRECTORY)) {
    325 
    326       CHAR *input;
    327 
    328       unmarkit = FALSE;
    329       input = xmalloc(65537, pszSrcFile, __LINE__);
    330       if (input) {
    331         ULONG pos;
    332         LONG len;
    333         FILE *inputFile;
    334 
    335         if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
    336           pos = ftell(inputFile);
    337           while (!feof(inputFile)) {
    338             if (pos)
    339               fseek(inputFile, pos - 256, SEEK_SET);
    340             len = fread(input, 1, 65536, inputFile);
    341             if (len >= 0) {
    342               if (findstring(text, textlen, input, len, FALSE)) {
    343                 unmarkit = TRUE;
     327
     328    if (unmarkit && text && *text) {
     329      if (~pci->attrFile & FILE_DIRECTORY) {
     330        PSZ input;
     331        unmarkit = FALSE;
     332        input = xmalloc(65537, pszSrcFile, __LINE__);
     333        if (input) {
     334          ULONG pos;
     335          LONG len;
     336          FILE *inputFile;
     337
     338          if ((inputFile = _fsopen(pci->pszFileName, "rb", SH_DENYNO)) != NULL) {
     339            pos = ftell(inputFile);
     340            while (!feof(inputFile)) {
     341              if (pos)
     342                fseek(inputFile, pos - 256, SEEK_SET);
     343              len = fread(input, 1, 65536, inputFile);
     344              if (len >= 0) {
     345                if (findstring(text, textlen, input, len, FALSE)) {
     346                  unmarkit = TRUE;
     347                  break;
     348                }
     349              }
     350              else
    344351                break;
    345               }
    346352            }
    347             else
    348               break;
     353            fclose(inputFile);
    349354          }
    350           fclose(inputFile);
     355          free(input);
     356          DosSleep(1L);
    351357        }
    352         free(input);
    353         DosSleep(1L);
    354       }
    355     }
    356     else if (unmarkit && text && *text && (pci->attrFile & FILE_DIRECTORY))
    357       unmarkit = FALSE;
     358      }
     359      else
     360        unmarkit = FALSE;
     361    }
     362
    358363    if (unmarkit)
    359364      WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, pci,
     
    372377                               MPFROMLONG(CMA_FIRST),
    373378                               MPFROMSHORT(CRA_SELECTED));
    374   while (pcil && (INT) pcil != -1) {
     379  while (pcil && (INT)pcil != -1) {
    375380    WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pcil),
    376381               MPFROM2SHORT(FALSE, CRA_SELECTED));
     
    394399             MPFROMLONG(sizeof(CNRINFO)));
    395400  pci = (PCNRITEM) CurrentRecord(hwndCnr);
    396   if (pci && (INT) pci != -1) {
     401  if (pci && (INT)pci != -1) {
    397402    if (pci->rc.flRecordAttr & CRA_SELECTED) {
    398403      attribute = CRA_SELECTED;
     
    401406    }
    402407  }
    403   while (pci && (INT) pci != -1) {
     408  while (pci && (INT)pci != -1) {
    404409    pciH = WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS, MPFROMP(pci),
    405410                      MPFROMSHORT(attribute));
     
    433438  pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORDEMPHASIS,
    434439                              MPFROMLONG(CMA_FIRST), MPFROMSHORT(attribute));
    435   if (pci && (INT) pci != -1) {
     440  if (pci && (INT)pci != -1) {
    436441    if (attribute == CRA_CURSORED) {
    437442      if (pci->rc.flRecordAttr & CRA_SELECTED) {
     
    443448    }
    444449  }
    445   while (pci && (INT) pci != -1) {
     450  while (pci && (INT)pci != -1) {
    446451    WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
    447452               MPFROM2SHORT(!quitit,
     
    462467
    463468  pci = (PCNRITEM) CurrentRecord(hwndCnr);
    464   if (pci && (INT) pci != -1) {
     469  if (pci && (INT)pci != -1) {
    465470    if (pci->rc.flRecordAttr & CRA_SELECTED) {
    466471      attribute = CRA_SELECTED;
     
    469474    }
    470475  }
    471   while (pci && (INT) pci != -1) {
    472     if (!(pci->rc.flRecordAttr & CRA_FILTERED)) {
     476  while (pci && (INT)pci != -1) {
     477    if (~pci->rc.flRecordAttr & CRA_FILTERED) {
    473478      didone = TRUE;
    474479      if (pulTotalFiles)
     
    531536                           MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    532537  if (pciParent) {
    533     if (expand && !(pciParent->rc.flRecordAttr & CRA_EXPANDED))
     538    if (expand && ~pciParent->rc.flRecordAttr & CRA_EXPANDED)
    534539      WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciParent), MPVOID);
    535540    else if (!expand && (pciParent->rc.flRecordAttr & CRA_EXPANDED))
     
    539544    if (pci)
    540545      DosSleep(1L);
    541     while (pci && (INT) pci != -1) {
     546    while (pci && (INT)pci != -1) {
    542547      ExpandAll(hwndCnr, expand, pci);
    543548      pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci),
     
    545550    }
    546551  }
    547   DosSleep(0L);
     552  DosSleep(1);
    548553}
    549554
     
    554559  pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPVOID,
    555560                              MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    556   while (pci && (INT) pci != -1) {
    557     if (!(pci->rc.flRecordAttr & CRA_FILTERED)) {
    558       if (!(pci->rc.flRecordAttr & CRA_SELECTED))
     561  while (pci && (INT)pci != -1) {
     562    if (~pci->rc.flRecordAttr & CRA_FILTERED) {
     563      if (~pci->rc.flRecordAttr & CRA_SELECTED)
    559564        WinSendMsg(hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci),
    560565                   MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    616621                               MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    617622  x = 0;
    618   while (pciD && (INT) pciD != -1 && x < numD) {
     623  while (pciD && (INT)pciD != -1 && x < numD) {
    619624    if (reset)
    620625      pciD->flags = 0;
     
    629634      DosSleep(1L);
    630635    else if (!(x % 50))
    631       DosSleep(0L);
     636      DosSleep(1);
    632637  }
    633638  if (numD != x) {
     
    646651                               MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    647652  x = 0;
    648   while (pciS && (INT) pciS != -1 && x < numS) {
     653  while (pciS && (INT)pciS != -1 && x < numS) {
    649654    if (reset)
    650655      pciS->flags = 0;
     
    659664      DosSleep(1L);
    660665    else if (!(x % 50))
    661       DosSleep(0L);
     666      DosSleep(1);
    662667  }
    663668  if (numS != x) {
     
    674679  if (reset) {
    675680    for (x = 0; x < numS; x++) {
     681
    676682      if (!*pciSa[x]->pszFileName || !*pciDa[x]->pszFileName)
    677683        continue;
     684
    678685      pciSa[x]->flags |= CNRITEM_EXISTS;
    679686      pciDa[x]->flags |= CNRITEM_EXISTS;
     
    722729        DosSleep(1L);
    723730      else if (!(x % 50))
    724         DosSleep(0L);
     731        DosSleep(1);
    725732    }
    726733  }
     
    729736  case IDM_SELECTIDENTICAL:
    730737    for (x = 0; x < numS; x++) {
    731       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED)) {
     738      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED) {
    732739        if (*pciSa[x]->pszFileName &&
    733             (pciSa[x]->flags & CNRITEM_EXISTS) &&
    734             !(pciSa[x]->flags & CNRITEM_SMALLER) &&
    735             !(pciSa[x]->flags & CNRITEM_LARGER) &&
    736             !(pciSa[x]->flags & CNRITEM_NEWER) &&
    737             !(pciSa[x]->flags & CNRITEM_OLDER)) {
    738           if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     740            pciSa[x]->flags & CNRITEM_EXISTS &&
     741            ~pciSa[x]->flags & CNRITEM_SMALLER &&
     742            ~pciSa[x]->flags & CNRITEM_LARGER &&
     743            ~pciSa[x]->flags & CNRITEM_NEWER &&
     744            ~pciSa[x]->flags & CNRITEM_OLDER) {
     745          if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    739746            WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    740747                       MPFROM2SHORT(TRUE, CRA_SELECTED));
    741           if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     748          if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    742749            WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    743750                       MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    746753          DosSleep(1L);
    747754        else if (!(x % 50))
    748           DosSleep(0L);
     755          DosSleep(1);
    749756      }
    750757    }
     
    753760  case IDM_SELECTSAME:
    754761    for (x = 0; x < numS; x++) {
    755       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
     762      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
    756763          *pciSa[x]->pszFileName &&
    757           (pciSa[x]->flags & CNRITEM_EXISTS) &&
    758           !(pciSa[x]->flags & CNRITEM_SMALLER) &&
    759           !(pciSa[x]->flags & CNRITEM_LARGER)) {
    760         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     764          pciSa[x]->flags & CNRITEM_EXISTS &&
     765          ~pciSa[x]->flags & CNRITEM_SMALLER &&
     766          ~pciSa[x]->flags & CNRITEM_LARGER) {
     767        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    761768          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    762769                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    763         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     770        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    764771          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    765772                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    768775        DosSleep(1L);
    769776      else if (!(x % 50))
    770         DosSleep(0L);
     777        DosSleep(1);
    771778    }
    772779    break;
     
    779786          *pciDa[x]->pszFileName &&
    780787          pciSa[x]->flags & CNRITEM_EXISTS &&
    781           pciDa[x]->flags & CNRITEM_EXISTS) {
    782 
     788          pciDa[x]->flags & CNRITEM_EXISTS)
     789      {
    783790        FILE *fp1 = NULL;
    784791        FILE *fp2 = NULL;
     
    839846        }
    840847        if (gotMatch) {
    841           if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     848          if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    842849            WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    843850                       MPFROM2SHORT(TRUE, CRA_SELECTED));
    844           if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     851          if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    845852            WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    846853                       MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    850857        DosSleep(1L);
    851858      else if (!(x % 50))
    852         DosSleep(0L);
     859        DosSleep(1);
    853860    }                                   // for records
    854861    break;
     
    856863  case IDM_SELECTBOTH:
    857864    for (x = 0; x < numS; x++) {
    858       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    859           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_EXISTS)) {
    860         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     865      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     866          *pciSa[x]->pszFileName &&
     867          pciSa[x]->flags & CNRITEM_EXISTS) {
     868        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    861869          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    862870                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    863         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     871        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    864872          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    865873                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    868876        DosSleep(1L);
    869877      else if (!(x % 50))
    870         DosSleep(0L);
     878        DosSleep(1);
    871879    }
    872880    break;
     
    874882  case IDM_SELECTONE:
    875883    for (x = 0; x < numS; x++) {
    876       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    877           *pciSa[x]->pszFileName && !(pciSa[x]->flags & CNRITEM_EXISTS)) {
    878         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     884      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     885          *pciSa[x]->pszFileName &&
     886          ~pciSa[x]->flags & CNRITEM_EXISTS)
     887      {
     888        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    879889          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    880890                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    881891      }
    882       else if (*pciDa[x]->pszFileName && !(pciDa[x]->flags & CNRITEM_EXISTS)) {
    883         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     892      else if (*pciDa[x]->pszFileName &&
     893               ~pciDa[x]->flags & CNRITEM_EXISTS) {
     894        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    884895          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    885896                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    888899        DosSleep(1L);
    889900      else if (!(x % 50))
    890         DosSleep(0L);
     901        DosSleep(1);
    891902    }
    892903    break;
     
    894905  case IDM_SELECTBIGGER:
    895906    for (x = 0; x < numS; x++) {
    896       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    897           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_LARGER)) {
    898         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     907      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     908          pciSa[x]->flags & CNRITEM_LARGER) {
     909        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    899910          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    900911                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    901912      }
    902       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    903                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_LARGER)) {
    904         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     913      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     914               *pciDa[x]->pszFileName &&
     915               pciDa[x]->flags & CNRITEM_LARGER) {
     916        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    905917          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    906918                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    909921        DosSleep(1L);
    910922      else if (!(x % 50))
    911         DosSleep(0L);
     923        DosSleep(1);
    912924    }
    913925    break;
     
    915927  case IDM_SELECTSMALLER:
    916928    for (x = 0; x < numS; x++) {
    917       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    918           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_SMALLER)) {
    919         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     929      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     930          *pciSa[x]->pszFileName &&
     931          pciSa[x]->flags & CNRITEM_SMALLER) {
     932        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    920933          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    921934                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    922935      }
    923       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    924                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_SMALLER)) {
    925         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     936      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     937               *pciDa[x]->pszFileName &&
     938               pciDa[x]->flags & CNRITEM_SMALLER) {
     939        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    926940          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    927941                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    930944        DosSleep(1L);
    931945      else if (!(x % 50))
    932         DosSleep(0L);
     946        DosSleep(1);
    933947    }
    934948    break;
     
    936950  case IDM_SELECTNEWER:
    937951    for (x = 0; x < numS; x++) {
    938       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    939           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_NEWER)) {
    940         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     952      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     953          *pciSa[x]->pszFileName &&
     954          pciSa[x]->flags & CNRITEM_NEWER) {
     955        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    941956          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    942957                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    943958      }
    944       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    945                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_NEWER)) {
    946         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     959      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     960               *pciDa[x]->pszFileName &&
     961               pciDa[x]->flags & CNRITEM_NEWER) {
     962        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    947963          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    948964                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    951967        DosSleep(1L);
    952968      else if (!(x % 50))
    953         DosSleep(0L);
     969        DosSleep(1);
    954970    }
    955971    break;
     
    957973  case IDM_SELECTOLDER:
    958974    for (x = 0; x < numS; x++) {
    959       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    960           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_OLDER)) {
    961         if (!(pciSa[x]->rc.flRecordAttr & CRA_SELECTED))
     975      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     976          *pciSa[x]->pszFileName &&
     977          pciSa[x]->flags & CNRITEM_OLDER) {
     978        if (~pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    962979          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    963980                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    964981      }
    965       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    966                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_OLDER)) {
    967         if (!(pciDa[x]->rc.flRecordAttr & CRA_SELECTED))
     982      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     983               *pciDa[x]->pszFileName &&
     984               pciDa[x]->flags & CNRITEM_OLDER) {
     985        if (~pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    968986          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
    969987                     MPFROM2SHORT(TRUE, CRA_SELECTED));
     
    972990        DosSleep(1L);
    973991      else if (!(x % 50))
    974         DosSleep(0L);
     992        DosSleep(1);
    975993    }
    976994    break;
     
    978996  case IDM_DESELECTBOTH:
    979997    for (x = 0; x < numS; x++) {
    980       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    981           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_EXISTS)) {
     998      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     999          *pciSa[x]->pszFileName &&
     1000          pciSa[x]->flags & CNRITEM_EXISTS) {
    9821001        if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    9831002          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
     
    9901009        DosSleep(1L);
    9911010      else if (!(x % 50))
    992         DosSleep(0L);
     1011        DosSleep(1);
    9931012    }
    9941013    break;
     
    9961015  case IDM_DESELECTONE:
    9971016    for (x = 0; x < numS; x++) {
    998       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    999           *pciSa[x]->pszFileName && !(pciSa[x]->flags & CNRITEM_EXISTS)) {
     1017      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1018          *pciSa[x]->pszFileName &&
     1019          ~pciSa[x]->flags & CNRITEM_EXISTS) {
    10001020        if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    10011021          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    10021022                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    10031023      }
    1004       else if (*pciDa[x]->pszFileName && !(pciDa[x]->flags & CNRITEM_EXISTS)) {
     1024      else if (*pciDa[x]->pszFileName &&
     1025               ~pciDa[x]->flags & CNRITEM_EXISTS) {
    10051026        if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    10061027          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
     
    10101031        DosSleep(1L);
    10111032      else if (!(x % 50))
    1012         DosSleep(0L);
     1033        DosSleep(1);
    10131034    }
    10141035    break;
     
    10161037  case IDM_DESELECTBIGGER:
    10171038    for (x = 0; x < numS; x++) {
    1018       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1019           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_LARGER)) {
     1039      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1040          *pciSa[x]->pszFileName &&
     1041          pciSa[x]->flags & CNRITEM_LARGER) {
    10201042        if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    10211043          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    10221044                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    10231045      }
    1024       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1025                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_LARGER)) {
     1046      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1047               *pciDa[x]->pszFileName &&
     1048               pciDa[x]->flags & CNRITEM_LARGER) {
    10261049        if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    10271050          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
     
    10311054        DosSleep(1L);
    10321055      else if (!(x % 50))
    1033         DosSleep(0L);
     1056        DosSleep(1);
    10341057    }
    10351058    break;
     
    10371060  case IDM_DESELECTSMALLER:
    10381061    for (x = 0; x < numS; x++) {
    1039       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1040           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_SMALLER)) {
     1062      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1063          *pciSa[x]->pszFileName &&
     1064          pciSa[x]->flags & CNRITEM_SMALLER) {
    10411065        if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    10421066          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    10431067                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    10441068      }
    1045       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1046                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_SMALLER)) {
     1069      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1070               *pciDa[x]->pszFileName &&
     1071               pciDa[x]->flags & CNRITEM_SMALLER) {
    10471072        if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    10481073          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
     
    10521077        DosSleep(1L);
    10531078      else if (!(x % 50))
    1054         DosSleep(0L);
     1079        DosSleep(1);
    10551080    }
    10561081    break;
     
    10581083  case IDM_DESELECTNEWER:
    10591084    for (x = 0; x < numS; x++) {
    1060       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1061           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_NEWER)) {
     1085      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1086          *pciSa[x]->pszFileName &&
     1087          pciSa[x]->flags & CNRITEM_NEWER) {
    10621088        if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    10631089          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    10641090                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    10651091      }
    1066       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1067                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_NEWER)) {
     1092      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1093               *pciDa[x]->pszFileName &&
     1094               pciDa[x]->flags & CNRITEM_NEWER) {
    10681095        if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    10691096          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
     
    10731100        DosSleep(1L);
    10741101      else if (!(x % 50))
    1075         DosSleep(0L);
     1102        DosSleep(1);
    10761103    }
    10771104    break;
     
    10791106  case IDM_DESELECTOLDER:
    10801107    for (x = 0; x < numS; x++) {
    1081       if (!(pciSa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1082           *pciSa[x]->pszFileName && (pciSa[x]->flags & CNRITEM_OLDER)) {
     1108      if (~pciSa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1109          *pciSa[x]->pszFileName &&
     1110          pciSa[x]->flags & CNRITEM_OLDER) {
    10831111        if (pciSa[x]->rc.flRecordAttr & CRA_SELECTED)
    10841112          WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciSa[x]),
    10851113                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    10861114      }
    1087       else if (!(pciDa[x]->rc.flRecordAttr & CRA_FILTERED) &&
    1088                *pciDa[x]->pszFileName && (pciDa[x]->flags & CNRITEM_OLDER)) {
     1115      else if (~pciDa[x]->rc.flRecordAttr & CRA_FILTERED &&
     1116               *pciDa[x]->pszFileName &&
     1117               pciDa[x]->flags & CNRITEM_OLDER) {
    10891118        if (pciDa[x]->rc.flRecordAttr & CRA_SELECTED)
    10901119          WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciDa[x]),
     
    10941123        DosSleep(1L);
    10951124      else if (!(x % 50))
    1096         DosSleep(0L);
     1125        DosSleep(1);
    10971126    }
    10981127    break;
     
    11061135      WinSendMsg(hwndCnrS, CM_INVALIDATERECORD,
    11071136                 MPFROMP(pciSa), MPFROM2SHORT((min(numS, 65535)), 0));
    1108       DosSleep(0L);
     1137      DosSleep(1);
    11091138      WinSendMsg(hwndCnrD, CM_INVALIDATERECORD,
    11101139                 MPFROMP(pciDa), MPFROM2SHORT((min(numD, 65535)), 0));
    11111140      numS -= min(numS, 65535);
    11121141      if (numS)
    1113         DosSleep(0L);
     1142        DosSleep(1);
    11141143    }
    11151144  }
     
    11371166  struct SS *ss2 = (struct SS *)s2;
    11381167
    1139   return stricmp((CHAR *) s1, ss2->pci->pszFileName);
     1168  return stricmp((PSZ)s1, ss2->pci->pszFileName);
    11401169}
    11411170
     
    12011230               hwndCnr,
    12021231               UM_NOTIFY, MPFROMP(GetPString(IDS_BUILDINGLISTSTEXT)), MPVOID);
    1203     DosSleep(0L);
     1232    DosSleep(1);
    12041233  }
    12051234
     
    12111240                                MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    12121241    x = 0;
    1213     while (pci && (INT) pci != -1) {
    1214       if (!(pci->rc.flRecordAttr & CRA_FILTERED) &&
    1215           !(pci->attrFile & FILE_DIRECTORY)) {
     1242    while (pci && (INT)pci != -1) {
     1243      if (~pci->rc.flRecordAttr & CRA_FILTERED &&
     1244          ~pci->attrFile & FILE_DIRECTORY) {
    12161245        Cnrs[z].ss =
    12171246          xrealloc(Cnrs[z].ss, (x + 1) * sizeof(struct SS), pszSrcFile,
     
    12311260                                  MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
    12321261    }
    1233     DosSleep(0L);
     1262    DosSleep(1);
    12341263    Cnrs[z].numfiles = x;
    12351264    if (Cnrs[z].numfiles)
     
    13391368        Cnrs[z].ss[x].oldest = Cnrs[z].ss[x].newest = Cnrs[z].ss[x].all =
    13401369          Cnrs[z].ss[x].largest = Cnrs[z].ss[x].smallest = FALSE;
    1341       DosSleep(0L);
     1370      DosSleep(1);
    13421371    }
    13431372    DosSleep(1L);
     
    13531382                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    13541383      }
    1355       DosSleep(0L);
     1384      DosSleep(1);
    13561385    }
    13571386    break;
     
    13641393                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    13651394      }
    1366       DosSleep(0L);
     1395      DosSleep(1);
    13671396    }
    13681397    break;
     
    13751404                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    13761405      }
    1377       DosSleep(0L);
     1406      DosSleep(1);
    13781407    }
    13791408    break;
     
    13861415                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    13871416      }
    1388       DosSleep(0L);
     1417      DosSleep(1);
    13891418    }
    13901419    break;
     
    13971426                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    13981427      }
    1399       DosSleep(0L);
     1428      DosSleep(1);
    14001429    }
    14011430    break;
     
    14081437                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    14091438      }
    1410       DosSleep(0L);
     1439      DosSleep(1);
    14111440    }
    14121441    break;
     
    14191448                     MPFROM2SHORT(TRUE, CRA_SELECTED));
    14201449      }
    1421       DosSleep(0L);
     1450      DosSleep(1);
    14221451    }
    14231452    break;
     
    14311460                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14321461      }
    1433       DosSleep(0L);
     1462      DosSleep(1);
    14341463    }
    14351464    break;
     
    14421471                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14431472      }
    1444       DosSleep(0L);
     1473      DosSleep(1);
    14451474    }
    14461475    break;
     
    14531482                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14541483      }
    1455       DosSleep(0L);
     1484      DosSleep(1);
    14561485    }
    14571486    break;
     
    14641493                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14651494      }
    1466       DosSleep(0L);
     1495      DosSleep(1);
    14671496    }
    14681497    break;
     
    14751504                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14761505      }
    1477       DosSleep(0L);
     1506      DosSleep(1);
    14781507    }
    14791508    break;
     
    14861515                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14871516      }
    1488       DosSleep(0L);
     1517      DosSleep(1);
    14891518    }
    14901519    break;
     
    14971526                     MPFROM2SHORT(FALSE, CRA_SELECTED));
    14981527      }
    1499       DosSleep(0L);
     1528      DosSleep(1);
    15001529    }
    15011530    break;
Note: See TracChangeset for help on using the changeset viewer.