Changeset 907


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.)

Location:
trunk
Files:
12 added
107 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r905 r907  
    1818 o Update includes to allow standalone usage (Steven)
    1919 o Switch to wrc.exe default; support USE_RC from environment (Steven)
     20 o Avoid out of memory traps in Compare Directories (Steven)
    2021
    21223.08
  • trunk/av2.c

    r873 r907  
    1414***********************************************************************/
    1515
    16 #include <stdarg.h>
    17 #include <stdio.h>
    1816#include <stdlib.h>
    1917#include <string.h>
    20 #include <ctype.h>
    2118
    2219#define INCL_DOS
    2320#define INCL_WIN
    24 #include <os2.h>
    25 
    26 #include "dll\fm3dll.h"
     21#define INCL_LONGLONG
     22
    2723#include "dll\version.h"
    2824#include "dll\fm3str.h"
     25#include "dll\arccnrs.h"
     26#include "dll\fm3dll.h"
    2927
    3028HMTX av2Sem;
  • trunk/databar.c

    r551 r907  
    1616***********************************************************************/
    1717
     18#include <string.h>
     19
    1820#define INCL_DOS
    1921#define INCL_WIN
    20 #include <os2.h>
     22#define INCL_LONGLONG
    2123
    22 #include <stdarg.h>
    23 #include <stdio.h>
    24 #include <stdlib.h>
    25 #include <string.h>
    26 #include <ctype.h>
    27 
    28 #include "dll\fm3dll.h"
    2924#include "dll\datamin.h"
    3025#include "dll\fm3dlg.h"
     26#include "dll\fm3dll.h"
    3127
    32 #ifdef NEVER
     28#ifdef NEVER                            // 05 Jan 08 SHL fixme to be gone?
    3329
    3430VOID APIENTRY deinit(ULONG why)
    3531{
    36 
    3732  if (fmprof)
    3833    PrfCloseProfile(fmprof);
     
    4843int main(int argc, char *argv[])
    4944{
    50 
    5145  HAB hab;
    5246  HMQ hmq;
  • trunk/dirsize.c

    r552 r907  
    99  Copyright (c) 2004 Steven H.Levine
    1010
    11   Revisions     11 Jun 02 SHL - Baseline
    12                 06 Jan 04 SHL - Total drives >4GB better
     11  11 Jun 02 SHL Baseline
     12  06 Jan 04 SHL Total drives >4GB better
    1313
    1414***********************************************************************/
     15
     16#include <string.h>
     17#include <ctype.h>
    1518
    1619#define INCL_DOS
    1720#define INCL_WIN
    1821
    19 #include <os2.h>
    20 #include <stdarg.h>
    21 #include <stdio.h>
    22 #include <stdlib.h>
    23 #include <string.h>
    24 #include <ctype.h>
    25 
    26 #include "dll\fm3dll.h"
    2722#include "dll\fm3dlg.h"
    2823#include "dirsize.h"
     24#include "dll\fm3dll.h"
    2925
    3026MRESULT EXPENTRY DirMainProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     
    10197        else if (type & DRIVE_REMOTE)
    10298          WinSetDlgItemText(hwnd, DIRSIZE_LOCAL, "Remote drive");
    103         else if (type & DRIVE_VIRTUAL)
    104             WinSetDlgItemText(hwnd, DIRSIZE_LOCAL, "Virtual drive");
    105         else if (type & DRIVE_RAMDISK)
     99        else if (type & DRIVE_VIRTUAL)
     100            WinSetDlgItemText(hwnd, DIRSIZE_LOCAL, "Virtual drive");
     101        else if (type & DRIVE_RAMDISK)
    106102          WinSetDlgItemText(hwnd, DIRSIZE_LOCAL, "Ramdisk");
    107103        else {
     
    205201}
    206202
    207 #ifdef NEVER
     203#ifdef NEVER                            // 05 Jan 08 SHL fixme to be gone?
    208204
    209205VOID APIENTRY deinit(ULONG why)
  • trunk/dll/arccnrs.c

    r906 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  11 Jun 02 SHL Ensure archive name not garbage
     
    5252***********************************************************************/
    5353
     54#include <stdlib.h>                     // free..
     55#include <string.h>
     56#include <ctype.h>
     57#include <direct.h>                     // rmdir
     58#include <share.h>                      // SH_DENYWR
     59#include <limits.h>                     // ULONG_MAX
     60#include <process.h>                    // _beginthread
     61
     62#if 0
     63#include <malloc.h>                     // _heapchk
     64#endif
     65
    5466#define INCL_DOS
    5567#define INCL_DOSERRORS
    5668#define INCL_WIN
    57 #define INCL_GPI
    5869#define INCL_LONGLONG
    59 #include <os2.h>
    60 
    61 #include <stdarg.h>
    62 #include <stdio.h>
    63 #include <stdlib.h>
    64 #include <string.h>
    65 #include <ctype.h>
    66 #include <time.h>
    67 #include <direct.h>
    68 #include <share.h>
    69 #include <limits.h>
    70 #include <process.h>                    // _beginthread
    71 
    72 #if 0
    73 #include <malloc.h>                     // _heapchk
    74 #endif
    75 
    76 #include "fm3dll.h"
     70
     71#include "arccnrs.h"                    // StartArcCnr
    7772#include "fm3dlg.h"
    7873#include "fm3str.h"
    7974#include "mle.h"
     75#include "pathutil.h"                   // BldFullPathName
     76#include "filldir.h"                    // EmptyCnr...
     77#include "errutil.h"                    // Dos_Error...
     78#include "strutil.h"                    // GetPString
     79#include "fm3dll.h"
    8080
    8181#pragma data_seg(DATA1)
     
    8383static INT DefArcSortFlags;
    8484static PSZ pszSrcFile = __FILE__;
    85 
    86 /**
    87  * Build quoted full path name in callers buffer given
    88  * directory name and filename
    89  * @param pszPathName points to drive/directory if not NULL
    90  * @returns pointer to quoted path name in caller's buffer
    91  */
    92 
    93 PSZ BldQuotedFullPathName(PSZ pszFullPathName, PSZ pszPathName, PSZ pszFileName)
    94 {
    95   UINT c = pszPathName ? strlen(pszPathName) : 0;
    96   BOOL q = needs_quoting(pszPathName) ||
    97            needs_quoting(pszFileName);
    98   PSZ psz = pszFullPathName;
    99 
    100   if (q)
    101     *psz++ = '"';
    102   if (c > 0) {
    103     memcpy(psz, pszPathName, c);
    104     psz += c;
    105     if (*(psz - 1) != '\\')
    106       *psz++ = '\\';
    107   }
    108   strcpy(psz, pszFileName);
    109   if (q) {
    110     psz += strlen(psz);
    111     *psz++ = '"';
    112     *psz = 0;
    113   }
    114   return pszFullPathName;
    115 }
    116 
    117 /**
    118  * Build quoted full path name in callers buffer given a filename
    119  * @returns pointer to quoted file name in caller's buffer
    120  */
    121 
    122 PSZ BldQuotedFileName(PSZ pszQuotedFileName, PSZ pszFileName)
    123 {
    124   BOOL q = needs_quoting(pszFileName);
    125   PSZ psz = pszQuotedFileName;
    126 
    127   if (q)
    128     *psz++ = '"';
    129   strcpy(psz, pszFileName);
    130   if (q) {
    131     psz += strlen(psz);
    132     *psz++ = '"';
    133     *psz = 0;
    134   }
    135   return pszQuotedFileName;
    136 }
    13785
    13886static MRESULT EXPENTRY ArcErrProc(HWND hwnd, ULONG msg, MPARAM mp1,
     
    202150          if (*viewer) {
    203151            ExecOnList((HWND) 0, viewer, WINDOWED | SEPARATE |
    204                             (fViewChild ? CHILD : 0),
    205                              NULL, list, NULL, pszSrcFile, __LINE__);
     152                            (fViewChild ? CHILD : 0),
     153                             NULL, list, NULL, pszSrcFile, __LINE__);
    206154          }
    207155          else
     
    271219    case SORT_LWDATE:
    272220      ret = TestCDates(&pai1->date, &pai1->time,
    273                        &pai2->date, &pai2->time);
    274         /*(pai1->date.year < pai2->date.year) ? 1 :
     221                       &pai2->date, &pai2->time);
     222        /*(pai1->date.year < pai2->date.year) ? 1 :
    275223        (pai1->date.year > pai2->date.year) ? -1 :
    276224        (pai1->date.month < pai2->date.month) ? 1 :
     
    15181466        free(s);
    15191467        if (IsFile(filename) == 1) {
     1468#if 1 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58  testing
    15201469          if (fViewChild && fArcStuffVisible)
    15211470            DosSleep(100);  // Allow unzip session to finish closing 14 Mar 07 SHL
     1471#endif
    15221472          WinSendMsg(dcd->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID);
    15231473        }
     
    15781528
    15791529              if (IsFile(li->list[x]))
    1580                 BldQuotedFileName(szBuffer + strlen(szBuffer), li->list[x]);
     1530                BldQuotedFileName(szBuffer + strlen(szBuffer), li->list[x]);
    15811531              else
    1582                 BldQuotedFullPathName(szBuffer + strlen(szBuffer), li->list[x], "*");
     1532                BldQuotedFullPathName(szBuffer + strlen(szBuffer), li->list[x], "*");
    15831533
    15841534              x++;
     
    15861536                  strlen(li->list[x]) + 5 > 1024) {
    15871537                runemf2(SEPARATE | WINDOWED |
    1588                         (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
    1589                         WAIT, hwnd, pszSrcFile, __LINE__,
    1590                         NULL, NULL, "%s", szBuffer);
     1538                        (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
     1539                        WAIT, hwnd, pszSrcFile, __LINE__,
     1540                        NULL, NULL, "%s", szBuffer);
    15911541                *p = 0;
    15921542              }
     
    16961646              CHAR fullname[CCHMAXPATH * 2];
    16971647              CHAR **exfiles = NULL;
    1698               INT numfiles = 0, numalloc = 0;
     1648              UINT numfiles = 0, numalloc = 0;
    16991649
    17001650              for (x = 0; li->list[x]; x++) {
     
    17671717              runemf2(SEPARATE | WINDOWED |
    17681718                      (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
    1769                       WAIT, hwnd, pszSrcFile, __LINE__,
    1770                       li->targetpath, NULL, "%s", cl);
     1719                      WAIT, hwnd, pszSrcFile, __LINE__,
     1720                      li->targetpath, NULL, "%s", cl);
    17711721              *endofit = 0;
    17721722            } while (li->list[x]);
     
    18261776                         WINDOWED | SEPARATEKEEP | PROMPT,
    18271777                         li->targetpath,
    1828                         NULL, GetPString(IDS_EXECARCFILETITLETEXT),
    1829                         pszSrcFile, __LINE__);
     1778                        NULL, GetPString(IDS_EXECARCFILETITLETEXT),
     1779                        pszSrcFile, __LINE__);
    18301780            else if (li->type == IDM_VIRUSSCAN)
    18311781              ExecOnList(hwnd, virus, PROMPT | WINDOWED | SEPARATEKEEP,
    18321782                         li->targetpath, NULL,
    1833                         GetPString(IDS_VIRUSSCANARCHIVETITLETEXT),
    1834                         pszSrcFile, __LINE__);
     1783                        GetPString(IDS_VIRUSSCANARCHIVETITLETEXT),
     1784                        pszSrcFile, __LINE__);
    18351785            else if (li->type == IDM_VIEW || li->type == IDM_VIEWTEXT ||
    18361786                     li->type == IDM_VIEWBINARY || li->type == IDM_EDIT ||
     
    19661916        case IDM_FIND:
    19671917          {
    1968             INT numfiles = 0, numalloced = 0;
     1918            UINT numfiles = 0, numalloced = 0;
    19691919            CHAR **list2 = NULL, fullname[CCHMAXPATH * 2], *p;
    19701920
     
    28312781          runemf2(SEPARATE | WINDOWED |
    28322782                  (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    2833                   hwnd, pszSrcFile, __LINE__,
    2834                   dcd->directory, NULL, "%s %s", dcd->info->extract,
     2783                  hwnd, pszSrcFile, __LINE__,
     2784                  dcd->directory, NULL, "%s %s", dcd->info->extract,
    28352785                  BldQuotedFileName(szQuotedArcName, dcd->arcname));
    28362786        if (SHORT1FROMMP(mp1) == IDM_ARCEXTRACTEXIT)
     
    28432793          runemf2(SEPARATE | WINDOWED |
    28442794                  (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    2845                   hwnd, pszSrcFile, __LINE__,
    2846                   dcd->directory, NULL, "%s %s",
     2795                  hwnd, pszSrcFile, __LINE__,
     2796                  dcd->directory, NULL, "%s %s",
    28472797                  dcd->info->exwdirs,
    28482798                  BldQuotedFileName(szQuotedArcName, dcd->arcname));
  • trunk/dll/archive.c

    r888 r907  
    1717***********************************************************************/
    1818
     19#include <string.h>
     20
    1921#define INCL_WIN
    2022#define INCL_DOS
    21 #include <os2.h>
    22 
    23 #include <stdlib.h>
    24 #include <stdio.h>
    25 #include <share.h>
    26 #include <string.h>
    27 #include <time.h>
    28 #include <ctype.h>
    29 
    30 #include "fm3dll.h"
     23#define INCL_LONGLONG                   // dircnrs.h
     24
    3125#include "fm3dlg.h"
    3226#include "fm3str.h"
     27#include "strutil.h"                    // GetPString
     28#include "errutil.h"                    // Runtime_Error
     29#include "fm3dll.h"
    3330
    3431static PSZ pszSrcFile = __FILE__;
  • trunk/dll/assoc.c

    r888 r907  
    55
    66  Copyright (c) 1993-98 M. Kimes
    7   Copyright (c) 2004, 2007 Steven H.Levine
     7  Copyright (c) 2004, 2008 Steven H.Levine
    88
    99  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    1818**************************************************************************************/
    1919
     20#include <stdlib.h>
     21#include <string.h>
     22#include <share.h>
     23
    2024#define INCL_DOS
    2125#define INCL_WIN
    2226#define INCL_PM
    2327#define INCL_WINHOOKS
    24 
    25 #include <os2.h>
    26 #include <stdio.h>
    27 #include <stdlib.h>
    28 #include <string.h>
    29 #include <ctype.h>
    30 #include <share.h>
    31 #include "fm3dll.h"
     28#define INCL_LONGLONG                   // dircnrs.h
     29
    3230#include "fm3dlg.h"
    3331#include "fm3str.h"
     32#include "pathutil.h"                   // BldQuotedFileName
     33#include "errutil.h"                    // Dos_Error...
     34#include "strutil.h"                    // GetPString
     35#include "fm3dll.h"
    3436
    3537#pragma data_seg(DATA1)
  • trunk/dll/attribs.c

    r847 r907  
    1515***********************************************************************/
    1616
     17#include <ctype.h>
     18
    1719#define INCL_DOS
    1820#define INCL_WIN
    19 #define INCL_LONGLONG
    20 #include <os2.h>
    21 
    22 #include <stdarg.h>
    23 #include <stdio.h>
    24 #include <stdlib.h>
    25 #include <string.h>
    26 #include <ctype.h>
    27 #include <time.h>
    28 
    29 #include "fm3dll.h"
     21
    3022#include "fm3dlg.h"
    3123#include "fm3str.h"
     24#include "makelist.h"                   // LISTINFO
     25#include "errutil.h"                    // Runtime_Error
     26#include "strutil.h"                    // GetPString
     27#include "fm3dll.h"
    3228
    3329static PSZ pszSrcFile = __FILE__;
     
    293289        {
    294290          CHAR szBuffer[CCHMAXPATH + 1];
    295           INT numfiles = 0, numalloc = 0, error;
     291          UINT numfiles = 0, numalloc = 0;
     292          INT error;
    296293
    297294          if (li->list)
  • trunk/dll/autoview.c

    r897 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2006 Steven H.Levine
     9  Copyright (c) 2001, 2008 Steven H.Levine
    1010
    1111  12 Sep 02 SHL AutoObjProc: catch buff2 overflows
     
    2626***********************************************************************/
    2727
     28#include <stdlib.h>
     29#include <string.h>
     30#include <ctype.h>
     31#include <process.h>                    // _beginthread
     32
    2833#define INCL_DOS
    2934#define INCL_WIN
    3035#define INCL_GPI
    3136#define INCL_LONGLONG
    32 #include <os2.h>
    33 
    34 #include <stdlib.h>
    35 #include <stdio.h>
    36 #include <string.h>
    37 #include <ctype.h>
    38 #include <process.h>                    // _beginthread
    39 
    40 #include "fm3dll.h"
     37
    4138#include "fm3dlg.h"
    4239#include "fm3str.h"
    4340#include "mle.h"
     41#include "pathutil.h"                   // BldFullPathName
     42#include "errutil.h"                    // Dos_Error...
     43#include "strutil.h"                    // GetPString
     44#include "fm3dll.h"
    4445
    4546#pragma data_seg(DATA1)
  • trunk/dll/avl.c

    r850 r907  
    77
    88  Copyright (c) 1993, 1998 M. Kimes
    9   Copyright (c) 2004, 2007 Steven H.Levine
     9  Copyright (c) 2004, 2008 Steven H.Levine
    1010
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    3333***********************************************************************/
    3434
     35#include <stdlib.h>
     36#include <string.h>
     37#include <ctype.h>
     38#include <share.h>
     39
     40#define INCL_DOS
    3541#define INCL_WIN
    3642#define INCL_WINSTDDRAG
    37 #define INCL_DOS
    3843#define INCL_LONGLONG
    39 #include <os2.h>
    40 
    41 #include <stdlib.h>
    42 #include <stdio.h>
    43 #include <string.h>
    44 #include <share.h>
    45 #include <ctype.h>
    46 
    47 #include "fm3dll.h"
     44
    4845#include "fm3dlg.h"
    4946#include "fm3str.h"
     47#include "avl.h"
     48#include "strutil.h"                    // GetPString
     49#include "errutil.h"                    // Runtime_Error
     50#include "fm3dll.h"
    5051
    5152static PSZ pszSrcFile = __FILE__;
  • trunk/dll/avv.c

    r906 r907  
    2626***********************************************************************/
    2727
     28#include <stdlib.h>
     29#include <string.h>
     30
    2831#define INCL_DOS
    2932#define INCL_WIN
    30 #include <os2.h>
    31 
    32 #include <stdlib.h>
    33 #include <stdio.h>
    34 #include <stdarg.h>
    35 #include <string.h>
    36 #include <ctype.h>
    37 #include <time.h>
    38 
    39 #include "fm3dll.h"
     33#define INCL_LONGLONG                   // dircnrs.h
     34
    4035#include "fm3dlg.h"
    4136#include "version.h"
    4237#include "fm3str.h"
     38#include "strutil.h"                    // GetPString
     39#include "errutil.h"                    // Runtime_Error
     40#include "fm3dll.h"
    4341
    4442#pragma data_seg(DATA1)
  • trunk/dll/chklist.c

    r847 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005, 2006 Steven H.Levine
     9  Copyright (c) 2005, 2008 Steven H.Levine
    1010
    1111  10 Jan 05 SHL Allow DND_TARGET to hold CCHMAXPATH
     
    1616***********************************************************************/
    1717
     18#include <string.h>
     19#include <ctype.h>
     20
    1821#define INCL_DOS
    1922#define INCL_WIN
    2023#define INCL_GPI
    2124#define INCL_LONGLONG
    22 #include <os2.h>
    23 
    24 #include <stdio.h>
    25 #include <stdlib.h>
    26 #include <string.h>
    27 #include <ctype.h>
    28 
    29 #include "fm3dll.h"
     25
    3026#include "fm3dlg.h"
    3127#include "fm3str.h"
     28#include "makelist.h"                   // AddToList
     29#include "errutil.h"                    // Dos_Error...
     30#include "strutil.h"                    // GetPString
     31#include "fm3dll.h"
    3232
    3333#pragma data_seg(DATA1)
     
    193193
    194194        CHAR szBuffer[CCHMAXPATH + 1];
    195         INT numfiles = 0, numalloc = 0, error;
     195        UINT numfiles = 0, numalloc = 0;
     196        INT error;
    196197        SHORT x;
    197198
     
    508509        SHORT x;
    509510        CHAR szBuffer[CCHMAXPATH + 1];
    510         INT numfiles = 0, numalloc = 0, error;
     511        UINT numfiles = 0, numalloc = 0;
     512        INT error;
    511513        USHORT cmd;
    512514
  • trunk/dll/cmdline.c

    r793 r907  
    1919***********************************************************************/
    2020
     21#include <stdlib.h>
     22#include <string.h>
     23#include <share.h>
     24#include <io.h>                         // unlink
     25
    2126#define INCL_DOS
    2227#define INCL_WIN
    23 #include <os2.h>
    24 
    25 #include <stdio.h>
    26 #include <stdlib.h>
    27 #include <string.h>
    28 #include <ctype.h>
    29 #include <share.h>
    30 #include <io.h>                         // unlink
    31 
    32 #include "fm3dll.h"
     28#define INCL_LONGLONG                   // dircnrs.h
     29
    3330#include "fm3dlg.h"
    3431#include "fm3str.h"
    3532#include "mle.h"
     33#include "errutil.h"                    // Dos_Error...
     34#include "strutil.h"                    // GetPString
     35#include "fm3dll.h"
    3636
    3737static PSZ pszSrcFile = __FILE__;
  • trunk/dll/codepage.c

    r793 r907  
    1414***********************************************************************/
    1515
     16#include <stdlib.h>
     17#include <string.h>
     18
    1619#define INCL_DOS
    1720#define INCL_WIN
    18 #include <os2.h>
    19 
    20 #include <stdlib.h>
    21 #include <stdio.h>
    22 #include <string.h>
    23 #include <time.h>
    24 
    25 #include "fm3dll.h"
     21#define INCL_LONGLONG                   // dircnrs.h
     22
    2623#include "fm3dlg.h"
    2724#include "fm3str.h"
     25#include "strutil.h"                    // GetPString
     26#include "errutil.h"                    // Runtime_Error
     27#include "fm3dll.h"
    2828
    2929#pragma data_seg(DATA1)
  • 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,
  • trunk/dll/colors.c

    r793 r907  
    1515***********************************************************************/
    1616
     17#include <string.h>
     18
    1719#define INCL_DOS
    1820#define INCL_WIN
    1921#define INCL_GPI
    20 #include <os2.h>
     22#define INCL_LONGLONG                   // dircnrs.h
    2123
    22 #include <stdlib.h>
    23 #include <stdio.h>
    24 #include <string.h>
    25 #include <ctype.h>
    26 
     24#include "fm3dlg.h"
     25#include "strutil.h"                    // GetPString
     26#include "errutil.h"                    // Runtime_Error
    2727#include "fm3dll.h"
    28 #include "fm3dlg.h"
    2928
    3029#pragma data_seg(DATA2)
  • trunk/dll/commafmt.c

    r860 r907  
    2929 */
    3030
    31 #define INCL_WIN
    32 #define INCL_LONGLONG
    33 #include <os2.h>
     31#include <string.h>
    3432
    35 #include <stdlib.h>
    36 #include <stdio.h>
    37 #include <string.h>
    3833#include "fm3dll.h"
    3934
  • trunk/dll/command.c

    r888 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2007 Steven H. Levine
     9  Copyright (c) 2004, 2008 Steven H. Levine
    1010
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    2424***********************************************************************/
    2525
     26#include <stdlib.h>
     27#include <string.h>
     28#include <share.h>
     29
    2630#define INCL_DOS
    2731#define INCL_WIN
    28 #include <os2.h>
    29 
    30 #include <stdio.h>
    31 #include <stdlib.h>
    32 #include <string.h>
    33 #include <ctype.h>
    34 #include <share.h>
    35 
    36 #include "fm3dll.h"
     32#define INCL_LONGLONG                   // dircnrs.h
     33
    3734#include "fm3dlg.h"
    3835#include "fm3str.h"
    3936#include "tools.h"
     37#include "arccnrs.h"                    // BldQuotedFileName
     38#include "errutil.h"                    // Dos_Error...
     39#include "strutil.h"                    // GetPString
     40#include "fm3dll.h"
     41
    4042
    4143typedef struct
  • trunk/dll/common.c

    r888 r907  
    77
    88  Copyright (c) 1993, 1998 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  13 Aug 05 SHL Renames
     
    2323***********************************************************************/
    2424
     25#include <stdlib.h>
     26#include <string.h>
     27#include <ctype.h>
     28
    2529#define INCL_DOS
    2630#define INCL_DOSERRORS
    2731#define INCL_WIN
    2832#define INCL_GPI
    29 #define INCL_LONGLONG
    30 #include <os2.h>
    31 
    32 #include <stdarg.h>
    33 #include <stdio.h>
    34 #include <stdlib.h>
    35 #include <string.h>
    36 #include <ctype.h>
    37 #include <time.h>
    38 #include <direct.h>
    39 #include <share.h>
    40 #include <limits.h>
    41 
    42 #include "fm3dll.h"
     33#define INCL_LONGLONG                   // dircnrs.h
     34
    4335#include "fm3dlg.h"
    4436#include "fm3str.h"
    4537#include "mle.h"
     38#include "filldir.h"                    // RemoveCnrItems
     39#include "errutil.h"                    // Dos_Error...
     40#include "strutil.h"                    // GetPString
     41#include "fm3dll.h"
    4642
    4743#pragma data_seg(DATA1)
     
    244240  case IDM_CHKDSK:
    245241    runemf2(SEPARATE | WINDOWED,
    246             hwnd, pszSrcFile, __LINE__, NULL, NULL,
    247             "PMCHKDSK.EXE %c:", toupper(*dv));
     242            hwnd, pszSrcFile, __LINE__, NULL, NULL,
     243            "PMCHKDSK.EXE %c:", toupper(*dv));
    248244    break;
    249245  case IDM_OPTIMIZE:
     
    265261  case IDM_FORMAT:
    266262    runemf2(SEPARATE | WINDOWED,
    267             hwnd, pszSrcFile, __LINE__, NULL, NULL,
    268             "PMFORMAT.EXE %c:", toupper(*dv));
     263            hwnd, pszSrcFile, __LINE__, NULL, NULL,
     264            "PMFORMAT.EXE %c:", toupper(*dv));
    269265    break;
    270266
  • trunk/dll/comp.c

    r897 r907  
    77
    88  Copyright (c) 1993-02 M. Kimes
    9   Copyright (c) 2003, 2007 Steven H. Levine
     9  Copyright (c) 2003, 2008 Steven H. Levine
    1010
    1111  16 Oct 02 MK Baseline
     
    4040  27 Sep 07 SHL Correct ULONGLONG size formatting
    4141  30 Dec 07 GKY Use TestCDates for compare by file date/time
     42  04 Jan 08 SHL Avoid traps if CM_ALLOCRECORD returns less that requested
     43  05 Jan 08 SHL Use WM_TIMER for progress messaging
     44  05 Jan 08 SHL Use ITIMER_DESC for hogging control
    4245
    4346***********************************************************************/
     47
     48#include <stdlib.h>
     49#include <string.h>
     50#include <share.h>
     51#include <io.h>
     52#include <process.h>                    // _beginthread
    4453
    4554#define INCL_DOS
     
    4857#define INCL_GPI
    4958#define INCL_LONGLONG
    50 #include <os2.h>
    51 
    52 #include <stdio.h>
    53 #include <stdlib.h>
    54 #include <string.h>
    55 #include <ctype.h>
    56 #include <share.h>
    57 #include <io.h>
    58 #include <process.h>                    // _beginthread
    59 
    60 #include "fm3dll.h"
     59
    6160#include "fm3dlg.h"
    6261#include "fm3str.h"
     62#include "pathutil.h"                   // BldFullPathName
     63#include "filldir.h"                    // EmptyCnr...
     64#include "makelist.h"                   // AddToFileList...
     65#include "errutil.h"                    // Dos_Error...
     66#include "strutil.h"                    // GetPString
     67#include "tmrsvcs.h"                    // IsITimerExpired
     68#include "comp.h"
     69#include "fm3dll.h"
    6370
    6471typedef struct
     
    7178
    7279static PSZ pszSrcFile = __FILE__;
    73 
    74 /**
    75  * Build full path name in callers buffer given directory
    76  * name and filename
    77  * @param pszPathName points to drive/directory if not NULL
    78  * @returns pointer to full path name in caller's buffer
    79  * @note OK for pszFullPathName and pszPathName to point to same buffer
    80  *
    81  */
    82 
    83 PSZ BldFullPathName(PSZ pszFullPathName, PSZ pszPathName, PSZ pszFileName)
    84 {
    85   UINT c = pszPathName ? strlen(pszPathName) : 0;
    86   if (c > 0) {
    87     memcpy(pszFullPathName, pszPathName, c);
    88     if (pszFullPathName[c - 1] != '\\')
    89       pszFullPathName[c++] = '\\';
    90   }
    91   strcpy(pszFullPathName + c, pszFileName);
    92   return pszFullPathName;
    93 }
    9480
    9581//=== SnapShot() Write directory tree to file and recurse if requested ===
     
    116102      // 13 Aug 07 SHL fixme to report errors
    117103      if (!xDosFindFirst(mask,
    118                          &hdir,
     104                         &hdir,
    119105                         FILE_NORMAL | FILE_DIRECTORY |
    120106                         FILE_ARCHIVED | FILE_READONLY | FILE_HIDDEN |
     
    450436                        MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    451437
     438      WinStartTimer(hab, cmp->hwnd, ID_TIMER, 2000);
     439
    452440      while (pci && (INT)pci != -1 && pciD && (INT)pciD != -1) {
    453441
     
    675663      } // while
    676664    Abort:
     665      WinStopTimer(hab, cmp->hwnd, ID_TIMER);
    677666      WinDestroyMsgQueue(hmq);
    678667    }
     668    PostMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPFROMLONG(1L), MPVOID);
     669    PostMsg(cmp->hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DESELECTALL, 0), MPVOID);
    679670    DecrThreadUsage();
    680671    WinTerminate(hab);
    681672  }
    682   PostMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPFROMLONG(1L), MPVOID);
    683   PostMsg(cmp->hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DESELECTALL, 0), MPVOID);
    684673  free(cmp);
    685674}
     
    707696      IncrThreadUsage();
    708697      priority_normal();
     698      WinStartTimer(hab, cmp->hwnd, ID_TIMER, 2000);
    709699      switch (cmp->action) {
    710700      case IDM_INVERT:
     
    724714        break;
    725715      }
     716      WinStopTimer(hab, cmp->hwnd, ID_TIMER);
    726717      if (!PostMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPFROMLONG(1L), MPVOID))
    727718        WinSendMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPFROMLONG(1L), MPVOID);
     
    738729 */
    739730
    740 static VOID FillDirList(CHAR *str, INT skiplen, BOOL recurse,
    741                         FILELIST ***list, INT *numfiles, INT *numalloc)
     731static VOID FillDirList(CHAR *str, UINT skiplen, BOOL recurse,
     732                        FILELIST ***list, UINT *pnumfiles, UINT *pnumalloc)
    742733{
    743734  CHAR *enddir;
     
    780771  ulFindCnt = FilesToGet;
    781772  rc = xDosFindFirst(maskstr, &hDir,
    782                      FILE_NORMAL | FILE_READONLY | FILE_ARCHIVED |
     773                     FILE_NORMAL | FILE_READONLY | FILE_ARCHIVED |
    783774                     FILE_SYSTEM | FILE_HIDDEN |
    784775                     (recurse ? FILE_DIRECTORY : 0),
     
    799790              strlwr(pffbFile->achName);
    800791            memcpy(enddir, pffbFile->achName, pffbFile->cchName + 1);
    801             FillDirList(maskstr, skiplen, recurse, list, numfiles, numalloc);
     792            FillDirList(maskstr, skiplen, recurse, list, pnumfiles, pnumalloc);
    802793          }
    803794        }
     
    809800          memcpy(enddir, pffbFile->achName, pffbFile->cchName + 1);
    810801          if (AddToFileList(maskstr + skiplen,
    811                             pffbFile, list, numfiles, numalloc)) {
     802                            pffbFile, list, pnumfiles, pnumalloc)) {
    812803            goto Abort;
    813804          }
     
    847838}
    848839
    849 // 20 Aug 07 SHL experimental fixme
    850 
    851 typedef struct {
    852   // Caller must init
    853   UINT sleepTime;               // How long to sleep
    854   UINT interval;                // How often to sleep
    855   // Owned by SleepIfNeeded
    856   UINT modulo;                  // How often to call GetMSecTimer
    857   UINT cntr;                    // Call counter
    858   ULONG lastMSec;               // Last time DosSleep invoked
    859 } SLEEP_DESC;
    860 
    861 VOID SleepIfNeeded(BOOL id, UINT interval, UINT sleepTime)
    862 {
    863   static ULONG lastMSec[10];
    864   static UINT cntr;
    865   static UINT modulo = 32;
    866   BOOL yes = ++cntr >= modulo;
    867 
    868   if (yes) {
    869     ULONG newMSec = GetMSecTimer();
    870     // 1st time will have large difference, but don't care
    871     ULONG diff = newMSec - lastMSec[id];
    872     cntr = 0;
    873     yes = diff >= interval;
    874     // Try to tune modulo counter to approx 12% error
    875     if (yes) {
    876       lastMSec[id] = newMSec;
    877       if (diff >= interval + (interval / 8) && modulo > 0)
    878         modulo--;
    879     }
    880     else {
    881       if (diff < interval - (interval / 8))
    882         modulo++;
    883     }
    884     DosSleep(sleepTime);
    885   }
    886 }
    887 
    888840//=== FillCnrsThread() Fill left and right containers ===
    889841
     
    894846  HMQ hmq;
    895847  BOOL notified = FALSE;
    896 
    897 #if 0
    898   ULONG lastMSec = GetMSecTimer();
    899   ULONG ul;
    900 #endif
     848  ITIMER_DESC itdSleep = { 0 };
    901849
    902850  HWND hwndLeft, hwndRight;
     
    912860
    913861  DosError(FERR_DISABLEHARDERR);
     862
     863  InitITimer(&itdSleep, 500);           // Sleep every 500 mSec
    914864
    915865  hab = WinInitialize(0);
     
    923873    else {
    924874      INT x;
    925       INT l;
    926       INT r;
     875      UINT l;
     876      UINT r;
    927877      UINT cntr;
    928878      FILELIST **filesl = NULL;
    929879      FILELIST **filesr = NULL;
    930       INT numfilesl = 0;
    931       INT numfilesr = 0;
    932       INT numallocl = 0;
    933       INT numallocr = 0;
     880      UINT numfilesl = 0;
     881      UINT numfilesr = 0;
     882      UINT numallocl = 0;
     883      UINT numallocr = 0;
    934884      INT ret = 0;
    935885      UINT lenl;                        // Directory prefix length
    936886      UINT lenr;
    937887      UINT recsNeeded;
     888      UINT recsGotten;
     889      UINT filesSeenL;
     890      UINT filesSeenR;
    938891      PCNRITEM pcilFirst;
    939892      PCNRITEM pcirFirst;
     893      PCNRITEM pcilLast;
     894      PCNRITEM pcirLast;
    940895      PCNRITEM pcil;
    941896      PCNRITEM pcir;
     
    945900      WinCancelShutdown(hmq, TRUE);
    946901      IncrThreadUsage();
     902      WinStartTimer(hab, cmp->hwnd, ID_TIMER, 2000);
     903
    947904      hwndLeft = WinWindowFromID(cmp->hwnd, COMP_LEFTDIR);
    948905      hwndRight = WinWindowFromID(cmp->hwnd, COMP_RIGHTDIR);
     
    965922        strupr(cmp->leftdir);
    966923      FillDirList(cmp->leftdir, lenl, cmp->includesubdirs,
    967                   &filesl, &numfilesl, &numallocl);
     924                  &filesl, &cmp->cmp->totalleft, &numallocl);
     925      numfilesl = cmp->cmp->totalleft;
    968926
    969927      if (filesl)
     
    979937          strupr(cmp->rightdir);
    980938        FillDirList(cmp->rightdir, lenr, cmp->includesubdirs,
    981                     &filesr, &numfilesr, &numallocr);
     939                    &filesr, &cmp->cmp->totalright, &numallocr);
     940        numfilesr = cmp->cmp->totalright;
    982941      }
    983942      else {
     
    11441103      } // while
    11451104
     1105      // Say building list - fixme to post?
    11461106      WinSendMsg(cmp->hwnd, UM_CONTAINERHWND, MPVOID, MPVOID);
    11471107
     
    11781138        pcil = pcilFirst;
    11791139        pcir = pcirFirst;
     1140        pcilLast = 0;
     1141        pcirLast = 0;
     1142
     1143        recsGotten = 0;
     1144        filesSeenL = 0;
     1145        filesSeenR = 0;
     1146
    11801147        while ((filesl && filesl[l]) || (filesr && filesr[r])) {
     1148
     1149          // 03 Jan 08 SHL fixme to have user friendly message
     1150          if (!pcil) {
     1151            Runtime_Error(pszSrcFile, __LINE__, "pcil short %u/%u",
     1152                          recsGotten, recsNeeded);
     1153            break;
     1154          }
     1155
     1156          // 03 Jan 08 SHL fixme to have user friendly message
     1157          if (!pcir) {
     1158            Runtime_Error(pszSrcFile, __LINE__, "pcir short %u/%u",
     1159                          recsGotten, recsNeeded);
     1160            break;
     1161          }
     1162          recsGotten++;
    11811163          pcir->hwndCnr = hwndRight;
    11821164          pcir->rc.hptrIcon = (HPOINTER) 0;
     
    11951177          if (x <= 0) {
    11961178            // File appears on left side
     1179            filesSeenL++;
    11971180            BldFullPathName(szBuf, cmp->leftdir, filesl[l]->fname);
    11981181            //sprintf(szBuf, "%s%s%s", cmp->leftdir,
     
    12331216          if (x >= 0) {
    12341217            // File appears on right side
     1218            filesSeenR++;
    12351219            BldFullPathName(szBuf, cmp->rightdir, filesr[r]->fname);
    12361220            //sprintf(szBuf, "%s%s%s", cmp->rightdir,
     
    12911275              strcpy(pch, GetPString(IDS_SMALLERTEXT));
    12921276              pch += 7;
    1293             }
    1294             ret = TestCDates(&pcir->date, &pcir->time,
    1295                              &pcil->date, &pcil->time);
    1296             if (ret == 1)
    1297               /*((pcil->date.year > pcir->date.year) ? TRUE :
     1277            }
     1278            ret = TestCDates(&pcir->date, &pcir->time,
     1279                             &pcil->date, &pcil->time);
     1280            if (ret == 1)
     1281              /*((pcil->date.year > pcir->date.year) ? TRUE :
    12981282                (pcil->date.year < pcir->date.year) ? FALSE :
    12991283                (pcil->date.month > pcir->date.month) ? TRUE :
     
    13161300              pch += 5;
    13171301            }
    1318             else if (ret == -1)
    1319               /*((pcil->date.year < pcir->date.year) ? TRUE :
     1302            else if (ret == -1)
     1303              /*((pcil->date.year < pcir->date.year) ? TRUE :
    13201304                     (pcil->date.year > pcir->date.year) ? FALSE :
    13211305                     (pcil->date.month < pcir->date.month) ? TRUE :
     
    13821366            pcir->pszDispAttr = NullStr;
    13831367
    1384 #if 0                                   // 20 Aug 07 SHL fixme to be gone
    1385           if (!(cntr % 500))
    1386             DosSleep(1);
    1387           else if (!(cntr % 50))
    1388             DosSleep(0);
    1389           cntr++;
    1390 #endif
    1391 #if 0                                   // 20 Aug 07 SHL
    1392           if (cntr++ % 256 == 0) {
    1393             ul = GetMSecTimer();
    1394             if (ul - lastMSec >= 200) {
    1395               lastMSec = ul;
    1396               DosSleep(1);
    1397             }
    1398           }
    1399 #endif
    1400 #if 1                                   // 20 Aug 07 SHL
    1401           SleepIfNeeded(0, 500, 1);
    1402 #endif
    1403 
     1368          // Avoid hogging systems
     1369          SleepIfNeeded(&itdSleep, 0);
     1370
     1371          pcilLast = pcil;
     1372          pcirLast = pcir;
    14041373          pcil = (PCNRITEM) pcil->rc.preccNextRecord;
    14051374          pcir = (PCNRITEM) pcir->rc.preccNextRecord;
    14061375
     1376          // Show running totals every 2 seconds
     1377          cmp->cmp->totalleft = filesSeenL;
     1378          cmp->cmp->totalright = filesSeenR;
     1379
    14071380        } // while filling left or right
     1381
     1382        // If stopped early CM_ALLOCATERECORD partially failed
     1383        // Free up container records we did not use on other side
     1384        // Free up filesl/filer entries we skipped
     1385        if (recsGotten < recsNeeded) {
     1386          if (pcil) {
     1387            pcilLast->rc.preccNextRecord = NULL;
     1388            FreeCnrItemList(hwndLeft, pcil);
     1389          }
     1390          if (filesl) {
     1391            while (filesl[l]) {
     1392              free(filesl[l]);
     1393              l++;
     1394            }
     1395          }
     1396          if (pcir) {
     1397            pcirLast->rc.preccNextRecord = NULL;
     1398            FreeCnrItemList(hwndRight, pcir);
     1399          }
     1400          if (filesr) {
     1401            while (filesr[r]) {
     1402              free(filesr[r]);
     1403              r++;
     1404            }
     1405          }
     1406          // Reduce counts to match what is in container
     1407          if (numfilesl > filesSeenL)
     1408            numfilesl = filesSeenL;
     1409          if (numfilesr > filesSeenR)
     1410            numfilesr = filesSeenR;
     1411          recsNeeded = recsGotten;
     1412        } // if insufficient resources
     1413
    14081414
    14091415        if (filesl)
     
    14131419          free(filesr);
    14141420        filesr = NULL;
    1415         // Insert 'em
     1421
     1422        // Say inserting
    14161423        WinSendMsg(cmp->hwnd, UM_CONTAINERDIR, MPVOID, MPVOID);
    14171424
     1425        // Insert left side
    14181426        memset(&ri, 0, sizeof(RECORDINSERT));
    14191427        ri.cb = sizeof(RECORDINSERT);
     
    14301438        }
    14311439
     1440        // Insert right side
    14321441        memset(&ri, 0, sizeof(RECORDINSERT));
    14331442        ri.cb = sizeof(RECORDINSERT);
     
    14531462      } // if recsNeeded
    14541463
     1464      WinStopTimer(hab, cmp->hwnd, ID_TIMER);
     1465
    14551466      Deselect(hwndLeft);
    14561467      Deselect(hwndRight);
     
    14581469      // DbgMsg(pszSrcFile, __LINE__, "FillCnrsThread deselected");
    14591470
     1471      // Request window update
    14601472      if (!PostMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID))
    14611473        WinSendMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID);
     
    14701482
    14711483      WinDestroyMsgQueue(hmq);
    1472     }
     1484    } // if have queue
     1485    if (!notified)
     1486      PostMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID);
    14731487    DecrThreadUsage();
    14741488    WinTerminate(hab);
    14751489  }
    1476   if (!notified)
    1477     PostMsg(cmp->hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID);
    14781490  free(cmp);
    14791491  DosPostEventSem(CompactSem);
     
    14851497#define hwndLeft        (WinWindowFromID(hwnd,COMP_LEFTDIR))
    14861498#define hwndRight       (WinWindowFromID(hwnd,COMP_RIGHTDIR))
    1487 
    1488 // 20 Aug 07 SHL fixme experimental
    1489 
    1490 BOOL NeedGUIUpdate(BOOL id)
    1491 {
    1492   static ULONG lastMSec[10];
    1493   static UINT cntr;
    1494   static UINT modulo = 32;
    1495   BOOL yes = ++cntr >= modulo;
    1496 
    1497   if (yes) {
    1498     ULONG newMSec = GetMSecTimer();
    1499     // 1st time will have large difference, but don't care
    1500     ULONG diff = newMSec - lastMSec[id];
    1501     cntr = 0;
    1502     yes = diff >= 500;
    1503     // Try to tune modulo counter to 10% error
    1504     if (yes) {
    1505       lastMSec[id] = newMSec;
    1506       if (diff >= 550 && modulo > 0)
    1507         modulo--;
    1508     }
    1509     else {
    1510       if (diff < 450)
    1511         modulo++;
    1512     }
    1513   }
    1514   return yes;
    1515 }
    15161499
    15171500//=== CompareDlgProc() Compare directories dialog procedure ===
     
    15211504  COMPARE *cmp;
    15221505  BOOL temp;
     1506  CHAR s[81];
    15231507
    15241508  static HPOINTER hptr;
     
    17101694
    17111695  case UM_CONTAINERHWND:
     1696    // Building list
    17121697    WinSetDlgItemText(hwnd, COMP_NOTE, GetPString(IDS_COMPHOLDBLDLISTTEXT));
    17131698    return 0;
    17141699
    17151700  case UM_CONTAINERDIR:
     1701    // Filling container
    17161702    WinSetDlgItemText(hwnd, COMP_NOTE, GetPString(IDS_COMPHOLDFILLCNRTEXT));
    17171703    return 0;
     1704
     1705  case WM_TIMER:
     1706    // Show current totals
     1707    cmp = INSTDATA(hwnd);
     1708    if (!cmp) {
     1709      Runtime_Error(pszSrcFile, __LINE__, "pCompare NULL");
     1710      WinDismissDlg(hwnd, 0);
     1711    }
     1712    else {
     1713      // 05 Jan 08 SHL fixme to use timer id to optimize output
     1714      sprintf(s, " %d", cmp->totalleft);
     1715      WinSetDlgItemText(hwnd, COMP_TOTALLEFT, s);
     1716      sprintf(s, " %d", cmp->totalright);
     1717      WinSetDlgItemText(hwnd, COMP_TOTALRIGHT, s);
     1718      sprintf(s, " %d", cmp->selleft);
     1719      WinSetDlgItemText(hwnd, COMP_SELLEFT, s);
     1720      sprintf(s, " %d", cmp->selright);
     1721      WinSetDlgItemText(hwnd, COMP_SELRIGHT, s);
     1722    }
     1723    break;
    17181724
    17191725  case UM_CONTAINER_FILLED:
     
    17241730    }
    17251731    else {
    1726       CHAR s[81];
    17271732
    17281733      // DbgMsg(pszSrcFile, __LINE__, "CompareDlgProc UM_CONTAINER_FILLED enter");
     
    19381943              else {
    19391944
    1940                 CHAR s[81];
    1941 
    19421945                cmp = INSTDATA(hwnd);
    19431946                if (pci->rc.flRecordAttr & CRA_SELECTED) {
     
    19551958                    if (cmp->selright)
    19561959                      cmp->selright--;
    1957                   }
    1958                 }
    1959                 if (SHORT1FROMMP(mp1) == COMP_LEFTDIR) {
    1960                   // if (WinIsWindowEnabled(hwndLeft) || !(cmp->selleft % 50)) {
    1961                   if (WinIsWindowEnabled(hwndLeft) || NeedGUIUpdate(0)) {
    1962                     sprintf(s, " %d", cmp->selleft);
    1963                     WinSetDlgItemText(hwnd, COMP_SELLEFT, s);
    1964                   }
    1965                 }
    1966                 else {
    1967                   // if (WinIsWindowEnabled(hwndRight) || !(cmp->selright % 50)) {
    1968                   if (WinIsWindowEnabled(hwndRight) || NeedGUIUpdate(1)) {
    1969                     sprintf(s, " %d", cmp->selright);
    1970                     WinSetDlgItemText(hwnd, COMP_SELRIGHT, s);
    19711960                  }
    19721961                }
     
    21802169            fakelist[2] = NULL;
    21812170            ExecOnList(hwnd, compare,
    2182                        WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
    2183                        pszSrcFile, __LINE__);
     2171                       WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
     2172                       pszSrcFile, __LINE__);
    21842173          }
    21852174          else {
  • trunk/dll/copyf.c

    r847 r907  
    2121***********************************************************************/
    2222
     23#include <stdlib.h>
     24#include <string.h>
     25#include <stdarg.h>
     26#include <ctype.h>
     27
    2328#define INCL_DOS
    2429#define INCL_DOSERRORS
    2530#define INCL_WIN
    2631#define INCL_LONGLONG
    27 #include <os2.h>
    28 
    29 #include <io.h>
    30 #include <string.h>
    31 #include <stdlib.h>
    32 #include <stdio.h>
    33 #include <stdarg.h>
    34 #include <ctype.h>
    35 #include <time.h>
    36 
     32
     33#include "fm3str.h"
     34#include "errutil.h"                    // Dos_Error...
     35#include "strutil.h"                    // GetPString
    3736#include "fm3dll.h"
    38 #include "fm3str.h"
    3937
    4038static PSZ pszSrcFile = __FILE__;
  • trunk/dll/datamin.c

    r888 r907  
    2424***********************************************************************/
    2525
     26#include <string.h>
     27#include <ctype.h>
     28#include <limits.h>
     29#include <process.h>                    // _beginthread
     30
    2631#define INCL_DOS
    2732#define INCL_DOSERRORS
     
    2934#define INCL_GPI
    3035#define INCL_LONGLONG
    31 #include <os2.h>
    32 
    33 #include <stdio.h>
    34 #include <stdlib.h>
    35 #include <string.h>
    36 #include <ctype.h>
    37 #include <limits.h>
    38 #include <process.h>                    // _beginthread
    39 
    40 #include "fm3dll.h"
     36
    4137#include "fm3dlg.h"
    4238#include "fm3str.h"
    4339#include "procstat.h"
    4440#include "datamin.h"
     41#include "errutil.h"                    // Dos_Error...
     42#include "strutil.h"                    // GetPString
     43#include "fm3dll.h"
    4544
    4645#pragma data_seg(DATA2)
  • trunk/dll/defview.c

    r901 r907  
    55
    66  Copyright (c) 1993-98 M. Kimes
    7   Copyright (c) 2003, 2007 Steven H.Levine
     7  Copyright (c) 2003, 2008 Steven H.Levine
    88
    99  Default file viewer
     
    2020***********************************************************************/
    2121
     22#include <string.h>
     23#include <ctype.h>
     24
    2225#define INCL_DOS
    2326#define INCL_WIN
    2427#define INCL_GPI
    2528#define INCL_MMIOOS2
     29#define INCL_LONGLONG                   // dircnrs.h
    2630#include <os2.h>
    2731#include <os2me.h>
    2832
    29 #include <stdio.h>
    30 #include <stdlib.h>
    31 #include <string.h>
    32 #include <ctype.h>
    33 
     33#include "fm3dlg.h"
     34#include "arccnrs.h"                    // StartArcCnr
     35#include "errutil.h"                    // Dos_Error...
    3436#include "fm3dll.h"
    35 #include "fm3dlg.h"
    3637
    3738static PSZ pszSrcFile = __FILE__;
  • trunk/dll/dircnrs.c

    r888 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  16 Oct 02 SHL Handle large partitions
     
    3535***********************************************************************/
    3636
    37 #define INCL_DOS
    38 #define INCL_WIN
    39 #define INCL_GPI
    40 #define INCL_DOSERRORS
    41 #define INCL_LONGLONG
    42 
    43 #include <os2.h>
    44 #include <stdarg.h>
    45 #include <stdio.h>
    4637#include <stdlib.h>
    4738#include <string.h>
    4839#include <ctype.h>
    4940#include <limits.h>
    50 #include "fm3dll.h"
     41#include <process.h>                    // _beginthread
     42
     43#define INCL_DOS
     44#define INCL_WIN
     45#define INCL_DOSERRORS
     46#define INCL_LONGLONG
     47
    5148#include "fm3dlg.h"
    5249#include "fm3str.h"
    5350#include "mle.h"
    54 #include <process.h>                    // _beginthread
     51#include "arccnrs.h"                    // StartArcCnr
     52#include "comp.h"                       // COMPARE
     53#include "filldir.h"                    // EmptyCnr...
     54#include "errutil.h"                    // Dos_Error...
     55#include "strutil.h"                    // GetPString
     56#include "fm3dll.h"
    5557
    5658#pragma data_seg(DATA1)
     
    132134            }
    133135          }
    134           hwndButtonPopup = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id);
    135           CopyPresParams(hwndButtonPopup, hwnd);
     136          hwndButtonPopup = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id);
     137          CopyPresParams(hwndButtonPopup, hwnd);
    136138          if (hwndButtonPopup) {
    137139            WinSetWindowUShort(hwndButtonPopup, QWS_ID, id);
     
    596598      li =
    597599        DoFileDrop(dcd->hwndCnr, dcd->directory, FALSE, MPVOID,
    598                    MPFROMP(&cni));
     600                   MPFROMP(&cni));
    599601      CheckPmDrgLimit(cni.pDragInfo);
    600602      if (li) {
     
    800802            !strnicmp(dcd->directory, dcd->previous,
    801803                      strlen(dcd->directory)))
    802         {
     804        {
    803805          PCNRITEM pci = FindCnrRecord(dcd->hwndCnr,
    804                                        dcd->previous,
     806                                       dcd->previous,
    805807                                       NULL, TRUE, FALSE, TRUE);
    806808          if (pci && (INT) pci != -1) {
     
    15541556      switch (SHORT1FROMMP(mp1)) {
    15551557      case IDM_FILESMENU:
    1556         CopyPresParams((HWND) mp2, hwndMainMenu);
    1557         if (isalpha(*dcd->directory)) {
     1558        CopyPresParams((HWND) mp2, hwndMainMenu);
     1559        if (isalpha(*dcd->directory)) {
    15581560          if (driveflags[toupper(*dcd->directory) - 'A'] & DRIVE_NOTWRITEABLE) {
    15591561            WinEnableMenuItem((HWND) mp2, IDM_MOVEMENU, FALSE);
     
    15781580            WinEnableMenuItem((HWND) mp2, IDM_EDITTEXT, TRUE);
    15791581            WinEnableMenuItem((HWND) mp2, IDM_EDITBINARY, TRUE);
    1580             WinEnableMenuItem((HWND) mp2, IDM_ATTRS, TRUE);
     1582            WinEnableMenuItem((HWND) mp2, IDM_ATTRS, TRUE);
    15811583          }
    15821584        }
     
    15841586
    15851587      case IDM_VIEWSMENU:
    1586         SetViewMenu((HWND) mp2, dcd->flWindowAttr);
     1588        SetViewMenu((HWND) mp2, dcd->flWindowAttr);
    15871589        CopyPresParams((HWND) mp2, hwndMainMenu);
    1588         WinEnableMenuItem((HWND) mp2, IDM_RESELECT,
    1589                           (dcd->lastselection != NULL));
    1590         if (isalpha(*dcd->directory)) {
     1590        WinEnableMenuItem((HWND) mp2, IDM_RESELECT,
     1591                          (dcd->lastselection != NULL));
     1592        if (isalpha(*dcd->directory)) {
    15911593          if (driveflags[toupper(*dcd->directory) - 'A'] & DRIVE_NOTWRITEABLE)
    15921594            WinEnableMenuItem((HWND) mp2, IDM_MKDIR, FALSE);
     
    17271729                  dummy[1] = NULL;
    17281730                  ExecOnList(hwnd,
    1729                              editor, WINDOWED | SEPARATE, NULL, dummy, NULL,
    1730                              pszSrcFile, __LINE__);
     1731                             editor, WINDOWED | SEPARATE, NULL, dummy, NULL,
     1732                             pszSrcFile, __LINE__);
    17311733                }
    17321734                else
     
    22342236      case IDM_MKDIR:
    22352237        {
    2236          // PCNRITEM pci;
    2237 
    2238          // pci = (PCNRITEM) CurrentRecord(hwnd);
     2238          PCNRITEM pci;
     2239          BOOL saved;
     2240
     2241          saved = fSelectedAlways;
     2242          fSelectedAlways = FALSE;
     2243          pci = (PCNRITEM)CurrentRecord(hwnd);
     2244          // 01 Oct 07 SHL Make below selected directory or in current directory
    22392245          PMMkDir(dcd->hwndParent,
    2240                   (dcd->directory), FALSE);
     2246                  pci && (INT)pci != -1 ? pci->pszFileName : dcd->directory,
     2247                  FALSE);
     2248          fSelectedAlways = saved;
    22412249        }
    22422250        break;
     
    25942602              memset(&volser, 0, sizeof(volser));
    25952603              DosError(FERR_DISABLEHARDERR);
    2596               // fixme
     2604              // fixme?
    25972605              rc = DosQueryFSInfo(toupper(*pci->pszFileName) - '@',
    25982606                                  FSIL_VOLSER, &volser, sizeof(volser));
     
    26092617                if (SHORT2FROMMP(mp1) == CN_COLLAPSETREE &&
    26102618                    !volser.serial ||
    2611                     driveserial[toupper(*pci->pszFileName) - 'A'] !=
     2619                    driveserial[toupper(*pci->pszFileName) - 'A'] !=
    26122620                    volser.serial)
    26132621                  UnFlesh(hwnd, pci);
     
    26472655                       CM_SETRECORDEMPHASIS,
    26482656                       MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED));
    2649             MarkAll(hwnd, FALSE, FALSE, TRUE);
    2650             if (pci->attrFile & FILE_DIRECTORY)
     2657            MarkAll(hwnd, FALSE, FALSE, TRUE);
     2658            if (pci->attrFile & FILE_DIRECTORY)
    26512659              dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP);
    26522660            else
     
    27322740          pci = (PCNRITEM) ((PCNRDRAGINFO) mp2)->pRecord;
    27332741          pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo;
    2734           if (!DrgAccessDraginfo(pDInfo)) {
    2735             Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
    2736                       "DrgAccessDraginfo");
     2742          if (!DrgAccessDraginfo(pDInfo)) {
     2743            Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
     2744                      "DrgAccessDraginfo");
    27372745              return (MRFROM2SHORT(DOR_NEVERDROP, 0));
    2738           }
    2739           if (*dcd->directory &&
     2746          }
     2747          if (*dcd->directory &&
    27402748             (driveflags[toupper(*dcd->directory) - 'A'] &
    27412749              DRIVE_NOTWRITEABLE)) {
     
    28522860          ULONG action = UM_ACTION;
    28532861
    2854           // DbgMsg(pszSrcFile, __LINE__, "calling DoFileDrop");
    2855           li = DoFileDrop(hwnd, dcd->directory, TRUE, mp1, mp2);
    2856           CheckPmDrgLimit(((PCNRDRAGINFO)mp2)->pDragInfo);
     2862          // DbgMsg(pszSrcFile, __LINE__, "calling DoFileDrop");
     2863          li = DoFileDrop(hwnd, dcd->directory, TRUE, mp1, mp2);
     2864          CheckPmDrgLimit(((PCNRDRAGINFO)mp2)->pDragInfo);
    28572865          if (li) {
    28582866            if (li->list && li->list[0] && IsRoot(li->list[0]))
     
    28882896              strcat(li->targetpath, " %a");
    28892897              ExecOnList(dcd->hwndParent, li->targetpath,
    2890                         PROMPT | WINDOWED, NULL, li->list, NULL,
    2891                         pszSrcFile, __LINE__);
     2898                        PROMPT | WINDOWED, NULL, li->list, NULL,
     2899                        pszSrcFile, __LINE__);
    28922900              FreeList(li->list);
    28932901              li->list = NULL;
     
    32633271
    32643272      HWND ret = StartMLEEditor(dcd->hwndParent,
    3265                                 (INT)mp1, (CHAR *)mp2, dcd->hwndFrame);
     3273                                (INT)mp1, (CHAR *)mp2, dcd->hwndFrame);
    32663274      if (mp2)
    32673275        free((CHAR *)mp2);
  • trunk/dll/dirs.c

    r843 r907  
    1313***********************************************************************/
    1414
    15 #define INCL_WIN
    16 #define INCL_WINERRORS
    17 #define INCL_DOS
    18 #define INCL_DOSERRORS
    19 #define INCL_LONGLONG
    20 
    21 #include <os2.h>
    2215#include <stdlib.h>
    23 #include <stdio.h>
    24 #include <stdarg.h>
    2516#include <string.h>
    2617#include <ctype.h>
     18
     19#define INCL_LONGLONG                   // dircnrs.h
     20
    2721#include "fm3dll.h"
    2822
    2923APIRET save_dir2(CHAR * curdir)
    3024{
    31 
    3225  CHAR *env = getenv("FM3INI");
    3326
  • trunk/dll/dirsize.c

    r850 r907  
    3434***********************************************************************/
    3535
    36 #define INCL_DOS
    37 #define INCL_WIN
    38 #define INCL_GPI
    39 #define INCL_LONGLONG
    40 #define INCL_DOSERRORS
    41 #include <os2.h>
    42 
    43 #include <stdio.h>
    4436#include <stdlib.h>
    4537#include <string.h>
     
    4739#include <process.h>                    // _beginthread
    4840
    49 #include "fm3dll.h"
     41#define INCL_DOS
     42#define INCL_DOSERRORS
     43#define INCL_WIN
     44#define INCL_GPI
     45#define INCL_LONGLONG
     46
    5047#include "fm3dlg.h"
    5148#include "fm3str.h"
     49#include "dircnrs.h"
     50#include "errutil.h"                    // Dos_Error...
     51#include "strutil.h"                    // GetPString
     52#include "fm3dll.h"
    5253
    5354typedef struct
     
    223224    while (!rc) {
    224225
    225 #if 0 // 13 Aug 07 SHL fixme to be gone
    226       {
    227         static ULONG ulMaxCnt = 1;
    228         if (ulFindCnt > ulMaxCnt) {
    229           ulMaxCnt = ulFindCnt;
    230           DbgMsg(pszSrcFile, __LINE__, "ulMaxCnt %u/%u", ulMaxCnt, FilesToGet);
    231         }
    232       }
    233 #endif
    234 
    235226      priority_normal();
    236227      pffbFile = pffbArray;
     
    258249          break;
    259250        pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + pffbFile->oNextEntryOffset);
    260 
    261 #if 0 // 13 Aug 07 SHL fixme to be gone
    262         {
    263           static ULONG ulMaxBytes = 65535;
    264           ULONG ul = (PBYTE)pffbFile - (PBYTE)pffbArray;
    265           if (ul > ulMaxBytes) {
    266             ulMaxBytes = ul;
    267             DbgMsg(pszSrcFile, __LINE__, "ulFindCnt %u/%u ulMaxBytes %u/%u",
    268                    ulFindCnt, FilesToGet, ulMaxBytes, ulBufBytes);
    269           }
    270         }
    271 #endif
    272251
    273252      } // for matches
  • trunk/dll/draglist.c

    r847 r907  
    2424***********************************************************************/
    2525
     26#include <stdlib.h>
     27#include <string.h>
     28#include <ctype.h>
     29
    2630#define INCL_DOS
    2731#define INCL_WIN
    2832#define INCL_SHLERRORS
    2933#define INCL_LONGLONG
    30 #include <os2.h>
    31 
    32 #include <stdio.h>
    33 #include <stdlib.h>
    34 #include <string.h>
    35 #include <ctype.h>
    36 
     34
     35#include "errutil.h"                    // Dos_Error...
    3736#include "fm3dll.h"
    3837
  • trunk/dll/droplist.c

    r847 r907  
    2424***********************************************************************/
    2525
     26#include <string.h>
     27
    2628#define INCL_DOS
    2729#define INCL_WIN
    2830#define INCL_LONGLONG
    29 #include <os2.h>
    30 
    31 #include <stdio.h>
    32 #include <stdlib.h>
    33 #include <string.h>
    34 #include <ctype.h>
    35 
     31
     32#include "fm3str.h"
     33#include "errutil.h"                    // Dos_Error...
     34#include "strutil.h"                    // GetPString
    3635#include "fm3dll.h"
    37 #include "fm3str.h"
    3836
    3937static PSZ pszSrcFile = __FILE__;
     
    501499  FreeDragInfoData(hwndCnr, pDInfo);
    502500
    503   // 02 Aug 07 SHL fixme to be gone someday or use Runtime_Error is really an error
     501  // 02 Aug 07 SHL fixme to be gone someday or use Runtime_Error if really an error
    504502  if (numfail || numok == 0)
    505503    DbgMsg(pszSrcFile, __LINE__, "calling FreeDragInfoData with %u ok, %u failed", numok, numfail);
  • trunk/dll/eas.c

    r880 r907  
    2424***********************************************************************/
    2525
     26#include <stdlib.h>
     27#include <stdio.h>
     28#include <string.h>
     29#include <ctype.h>
     30
    2631#define INCL_WIN
    2732#define INCL_DOS
    2833#define INCL_DOSERRORS
    2934#define INCL_LONGLONG
    30 #include <os2.h>
    31 
    32 #include <stdlib.h>
    33 #include <stdio.h>
    34 #include <string.h>
    35 #include <ctype.h>
    36 
    37 #include "fm3dll.h"
     35
    3836#include "fm3dlg.h"
    3937#include "fm3str.h"
    4038#include "mle.h"
     39#include "errutil.h"                    // Dos_Error...
     40#include "strutil.h"                    // GetPString
     41#include "fm3dll.h"
    4142
    4243#pragma data_seg(DATA1)
  • trunk/dll/errutil.c

    r904 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2007 Steven H. Levine
     9  Copyright (c) 2004, 2008 Steven H. Levine
    1010
    1111  12 Aug 04 SHL Comments
     
    2727  14 Aug 07 SHL Add GetMSecTimer
    2828  14 Aug 07 SHL Use GetMSecTimer in DbgMsg
     29  05 Jan 08 SHL Renamed from error.c to match errutil.h
    2930
    3031***********************************************************************/
     32
     33#include <stdio.h>
     34#include <string.h>
     35#include <stdarg.h>
    3136
    3237#define INCL_DOS
     
    3439#define INCL_WIN
    3540
    36 #include <os2.h>
    37 #include <stdlib.h>
    38 #include <stdio.h>
    39 #include <string.h>
    40 #include <stdarg.h>
    41 
    42 #include "fm3dll.h"
     41#include "errutil.h"
     42#include "strutil.h"                    // GetPString
    4343#include "fm3str.h"
     44
     45#pragma data_seg(GLOBAL2)
     46PSZ DEBUG_STRING;
    4447
    4548#pragma data_seg(DATA1)
     
    219222  pErrInfoBlk = WinGetErrorInfo(hab);
    220223  if (!pErrInfoBlk) {
    221     ERRORID id = WinGetLastError(hab);  // 03 Jan 08 SHL fixme debug
     224    ERRORID id = WinGetLastError(hab);
    222225    psz = pszBuf + strlen(pszBuf);
    223226    sprintf(psz, " WinGetErrorInfo failed (%u)", id);
  • trunk/dll/extract.c

    r888 r907  
    1717***********************************************************************/
    1818
     19#include <string.h>
     20#include <ctype.h>
     21
    1922#define INCL_WIN
    2023#define INCL_DOS
    21 #include <os2.h>
    22 
    23 #include <stdlib.h>
    24 #include <stdio.h>
    25 #include <string.h>
    26 #include <time.h>
    27 #include <ctype.h>
    28 
    29 #include "fm3dll.h"
     24#define INCL_LONGLONG                   // dircnrs.h
     25
    3026#include "fm3dlg.h"
    3127#include "fm3str.h"
     28#include "errutil.h"                    // Dos_Error...
     29#include "strutil.h"                    // GetPString
     30#include "fm3dll.h"
    3231
    3332#pragma data_seg(DATA1)
  • trunk/dll/filldir.c

    r859 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  10 Jan 04 SHL ProcessDirectory: avoid most large drive failures
     
    4343***********************************************************************/
    4444
     45#include <stdlib.h>
     46#include <string.h>
     47#include <ctype.h>
     48
     49#if 0 // fixme to disable or to be configurable
     50#include <malloc.h>                     // _heapchk
     51#endif
     52
    4553#define INCL_DOS
    4654#define INCL_WIN
    4755#define INCL_DOSERRORS
    4856#define INCL_LONGLONG
    49 #include <os2.h>
    50 
    51 #include <stdarg.h>
    52 #include <stdio.h>
    53 #include <stdlib.h>
    54 #include <string.h>
    55 #include <ctype.h>
    56 #include <time.h>
    57 #include <time.h>
    58 
    59 #if 0 // fixme to disable or to be configurable
    60 #include <malloc.h>                     // _heapchk
    61 #endif
    62 
     57
     58#include "fm3str.h"
     59#include "filldir.h"
     60#include "errutil.h"                    // Dos_Error...
     61#include "strutil.h"                    // GetPString
    6362#include "fm3dll.h"
    64 #include "fm3str.h"
    6563
    6664static PSZ pszSrcFile = __FILE__;
     
    486484
    487485ULONGLONG FillInRecordFromFSA(HWND hwndCnr, PCNRITEM pci,
    488                               const PSZ pszFileName,
    489                               const PFILESTATUS4L pfsa4,
    490                               const BOOL partial, DIRCNRDATA * dcd)     // Optional
     486                              const PSZ pszFileName,
     487                              const PFILESTATUS4L pfsa4,
     488                              const BOOL partial, DIRCNRDATA * dcd)     // Optional
    491489{
    492490  HPOINTER hptr;
     
    792790         * network file systems exhibit such a problem).
    793791         */
    794 #if 0 // 13 Aug 07 SHL fixme to be gone
    795         {
    796           static ULONG ulMaxCnt = 1;
    797           if (ulFindCnt > ulMaxCnt) {
    798             ulMaxCnt = ulFindCnt;
    799             DbgMsg(pszSrcFile, __LINE__, "ulMaxCnt %u/%u", ulMaxCnt, ulFindMax);
    800           }
    801         }
    802 #endif // fixme to be gone
    803792
    804793        if (stopflag && *stopflag)
     
    838827            }
    839828            else {
     829              // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    840830              pci = pciFirst;
    841831              ullTotalBytes = 0;
     
    937927        }
    938928        else {
     929          // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    939930          pci = pciFirst;
    940931          ullTotalBytes = 0;
     
    11051096  if (!pciFirst) {
    11061097    Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, IDS_CMALLOCRECERRTEXT);
     1098    // 04 Jan 08 SHL fixme not just up and die
    11071099    exit(0);
    11081100  }
    11091101
     1102  // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    11101103  pci = pciFirst;
    11111104  for (x = 0; x < 26; x++) {
     
    16801673      while (pci) {
    16811674        // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ???
    1682         static PCNRITEM pciLast;                // 12 Sep 07 SHL
    1683         ULONG ulSize = sizeof(*pci);
    1684         ULONG ulAttr;
     1675        static PCNRITEM pciLast;                // 12 Sep 07 SHL
     1676        ULONG ulSize = sizeof(*pci);
     1677        ULONG ulAttr;
    16851678        APIRET apiret = DosQueryMem((PVOID)pci, &ulSize, &ulAttr);
    16861679        if (apiret)
    1687           Dos_Error(MB_ENTER, apiret, HWND_DESKTOP, pszSrcFile, __LINE__,
     1680          Dos_Error(MB_ENTER, apiret, HWND_DESKTOP, pszSrcFile, __LINE__,
    16881681                    "DosQueryMem failed pci %p pciLast %p", pci, pciLast);
    16891682        FreeCnrItemData(pci);
  • trunk/dll/filter.c

    r888 r907  
    33
    44  $Id$
     5
     6  Filter mask select dialog
    57
    68  Copyright (c) 1993-98 M. Kimes
     
    1517***********************************************************************/
    1618
    17 #define INCL_WIN
    18 #define INCL_DOS
    19 #include <os2.h>
    20 
    21 #include <stdio.h>
    2219#include <stdlib.h>
    2320#include <string.h>
    2421#include <share.h>
    2522
    26 #include "fm3dll.h"
     23#define INCL_WIN
     24#define INCL_DOS
     25#define INCL_LONGLONG                   // dircnrs.h
     26
    2727#include "fm3dlg.h"
    2828#include "fm3str.h"
     29#include "errutil.h"                    // Dos_Error...
     30#include "strutil.h"                    // GetPString
     31#include "fm3dll.h"
    2932
    3033#pragma data_seg(FILTER_DATA)
  • trunk/dll/findrec.c

    r793 r907  
    1313***********************************************************************/
    1414
    15 #define INCL_WIN
     15#include <string.h>
    1616
    17 #include <os2.h>
    18 #include <stdarg.h>
    19 #include <stdio.h>
    20 #include <stdlib.h>
    21 #include <string.h>
     17#define INCL_LONGLONG                   // dircnrs.h
     18
    2219#include "fm3dll.h"
    2320
     
    2522                       BOOL partial, BOOL partmatch, BOOL noenv)
    2623{
    27 
    2824  SEARCHSTRING srch;
    2925  PCNRITEM pci;
  • trunk/dll/flesh.c

    r847 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005, 2007 Steven H. Levine
     9  Copyright (c) 2005, 2008 Steven H. Levine
    1010
    1111  24 May 05 SHL Rework Win_Error usage
     
    2020  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
    2121
    22 
    2322***********************************************************************/
     23
     24#include <stdlib.h>
     25#include <string.h>
     26#include <ctype.h>
    2427
    2528#define INCL_DOS
    2629#define INCL_DOSERRORS
    2730#define INCL_WIN
    28 #define INCL_LONGLONG
    29 #include <os2.h>
    30 
    31 #include <stdarg.h>
    32 #include <stdio.h>
    33 #include <stdlib.h>
    34 #include <string.h>
    35 #include <ctype.h>
    36 
     31#define INCL_LONGLONG                   // dircnrs.h
     32
     33#include "fm3str.h"
     34#include "filldir.h"                    // FileAttrToString...
     35#include "errutil.h"                    // Dos_Error...
     36#include "strutil.h"                    // GetPString
    3737#include "fm3dll.h"
    38 #include "fm3str.h"
    3938
    4039#pragma data_seg(DATA1)
  • trunk/dll/fm2cmd.c

    r793 r907  
    1313***********************************************************************/
    1414
     15#include <string.h>
     16
    1517#define INCL_DOS
    1618#define INCL_WIN
     19#define INCL_LONGLONG                   // dircnrs.h
    1720
    18 #include <os2.h>
    19 #include <stdio.h>
    20 #include <stdlib.h>
    21 #include <string.h>
    22 #include <ctype.h>
    23 #include <share.h>
    24 #include "fm3dll.h"
    2521#include "fm3dlg.h"
    2622#include "fm3str.h"
     23#include "errutil.h"                    // Dos_Error...
     24#include "strutil.h"                    // GetPString
     25#include "fm3dll.h"
    2726
    2827#pragma data_seg(DATA2)
  • trunk/dll/fm3dll.h

    r906 r907  
    7070  30 Dec 07 GKY Add TestCDates to compare CNRITEMs by CDATE/CTIME data
    7171  04 Jan 08 SHL Allow standalone usage
     72  05 Jan 08 SHL Move comp.c definitions to comp.h
     73  05 Jan 08 SHL Move dircnr.c definitions to dircnr.h
     74  05 Jan 08 SHL Move makelist.c definitions to makelist.h
     75  05 Jan 08 SHL Move error.c definitions to errutil.h
     76  05 Jan 08 SHL Move string.c definitions to strutil.h
    7277
    7378***********************************************************************/
     
    8590#define INCL_WINPROGRAMLIST
    8691#define INCL_WINHELP
     92#define INCL_LONGLONG                   // 05 Jan 08 SHL fixme to be gone eventually
    8793#include <os2.h>
    8894#else
     
    99105#error INCL_WINHELP required
    100106#endif
     107#if !defined(INCL_LONGLONG)
     108#error INCL_LONGLONG required
     109#endif
    101110#endif // OS2_INCLUDED
    102111
     
    109118#endif
    110119#endif
     120
     121#include "dircnrs.h"    // 05 Jan 08 SHL fixme to be gone when DIRCNRDATA refs gone
     122#include "makelist.h"   // 05 Jan 08 SHL fixme to be gone when LISTINFO refs gone
    111123
    112124#ifdef DEFINE_GLOBALS
     
    326338typedef struct
    327339{
    328   CHAR szMask[CCHMAXPATH];
    329   CHAR szMaskCopy[CCHMAXPATH];
    330   CHAR *pszMasks[26];
    331   ULONG attrFile;
    332   ULONG antiattr;
    333   BOOL fNoAttribs;
    334   BOOL fShowDirs;
    335   BOOL fNoDirs;
    336   BOOL fIsTree;
    337   BOOL fIsSeeAll;
    338   BOOL fFilesIncluded;
    339   BOOL fText;
    340   CHAR szText[256];
    341   CHAR prompt[80];
    342 }
    343 MASK;
    344 
    345 typedef struct
    346 {
    347340  CHAR *title;                  /* title of dialog */
    348341  CHAR *prompt;                 /* prompt to user */
     
    380373typedef struct
    381374{
    382   HWND hwnd;
    383   HWND hwndS;
    384   USHORT type;
    385   USHORT id;
    386   INT flags;
    387   struct __arc_type__ *info;
    388   CHAR **list;
    389   ULONG *ulitemID;
    390   ULONGLONG *cbFile;
    391   CHAR targetpath[CCHMAXPATH + 6];
    392   CHAR arcname[CCHMAXPATH];
    393   CHAR runfile[CCHMAXPATH];
    394 }
    395 LISTINFO;
    396 
    397 typedef struct
    398 {
    399375  USHORT size;
    400376  USHORT dummy;
     
    447423#define ARCFLAGS_REALDIR    0x00000001
    448424#define ARCFLAGS_PSEUDODIR  0x00000002
    449 
    450 #define CBLIST_TO_EASIZE(cb) ((cb) > 4 ? (cb) / 2 : 0)  // FILEFINDBUF4L.cbList to logical EA size
    451 
    452 typedef struct _CNRITEM
    453 {                               /* CONTAINER RECORD STRUCTURE */
    454   MINIRECORDCORE rc;            /* Base information */
    455   HWND hwndCnr;                 /* The container holding this record */
    456   PSZ pszFileName;              // Points to buffer holding full pathname or NullStr
    457   PSZ pszDisplayName;           // Points to displayable part of path name  - used by CFA_STRING
    458   CHAR *pszSubject;             // Points subject buffer or Nullstr - used by fm/2 and by CFA_STRING
    459   CHAR *pszDispAttr;            // Points to szDispAttr - required by CFA_STRING
    460   CDATE date;                   /* Last write date of file */
    461   CTIME time;                   /* Last write time of file */
    462   CDATE ladate;                 /* Last access date of file */
    463   CTIME latime;                 /* Last access time of file */
    464   CDATE crdate;                 /* Creation date of file */
    465   CTIME crtime;                 /* Creation time of file */
    466   CHAR *pszLongName;            // Points to long name buffer - used by code and by CFA_STRING
    467   CHAR *pszFmtFileSize;         // Comma formatted file size for large file support
    468   ULONGLONG cbFile;             /* File size */
    469   ULONGLONG easize;             // Size of EAs - dirsize uses this - hack cough
    470   ULONG attrFile;               /* Attributes of this file */
    471   ULONG flags;
    472 }
    473 CNRITEM, *PCNRITEM;
    474425
    475426typedef struct _ARCITEM
     
    493444typedef struct
    494445{
    495   ULONG attrFile;
    496   ULONGLONG cbFile;
    497   ULONGLONG easize;
    498   FDATE date;
    499   FTIME time;
    500   FDATE ladate;
    501   FTIME latime;
    502   FDATE crdate;
    503   FTIME crtime;
    504   CHAR fname[1];
    505 }
    506 FILELIST;
    507 
    508 typedef struct __arc_type__
    509 {
    510   CHAR *id;                     // User id
    511   CHAR *ext;                    // Extension (without leading dot)
    512   LONG file_offset;             // Offset to signature (0..n)
    513   CHAR *list;                   // List command
    514   CHAR *extract;                // Extract command
    515   CHAR *exwdirs;                // Extract with directories command
    516   CHAR *test;                   // Test command
    517   CHAR *create;                 // Create without directories
    518   CHAR *move;                   // Move into archive without directories
    519   CHAR *createrecurse;          // Create with recurse and directories
    520   CHAR *createwdirs;            // Create with directories
    521   CHAR *movewdirs;              // Move into archive with directories
    522   CHAR *delete;                 // Delete from archive
    523   CHAR *signature;              // Archiver signature
    524   CHAR *startlist;              // Listing start marker (blank means no start marker)
    525   CHAR *endlist;                // Listing end marker (blank means next blank line or EOF)
    526   INT siglen;                   // Signature length in bytes
    527   INT osizepos;                 // Original file size position (0..n) or -1
    528   INT nsizepos;                 // Compressed file size position or -1
    529   INT fdpos;                    // File date position or -1
    530   INT fdflds;                   // File date element count (typically 3) or -1
    531   INT fnpos;                    // File name position or -1 if last
    532   INT datetype;                 // Date field format
    533   UINT comment_line_num;        // Comment start in old sig file (1..n), 0 if none
    534   UINT defn_line_num;           // Definition start in old sig file (1..n), 0 if none
    535   BOOL nameislast;              // Name is last item on line
    536   BOOL nameisnext;              // File name is on next line
    537   BOOL nameisfirst;             // File name is first item on line
    538   struct __arc_type__ *next;
    539   struct __arc_type__ *prev;
    540 }
    541 ARC_TYPE;
    542 
    543 typedef struct
    544 {
    545446  USHORT size;
    546447  ARC_TYPE *info;
     
    553454EXTRDATA;
    554455
    555 typedef struct
    556 {
    557   ARC_TYPE *info;
    558   CHAR listname[CCHMAXPATH];
    559   CHAR arcname[CCHMAXPATH];
    560   CHAR *errmsg;
    561 }
    562 ARCDUMP;
    563 
    564 typedef struct DIRCNRDATA
    565 {
    566   USHORT size;
    567   USHORT id;
    568   INT type;
    569   ULONG flWindowAttr;
    570   HWND hwndParent;
    571   HWND hwndCnr;
    572   HWND hwndObject;
    573   HWND hwndFrame;
    574   HWND hwndClient;
    575   HWND hwndLastMenu;
    576   HWND hwndExtract;
    577   HWND hwndLastDirCnr;
    578   HWND hwndRestore;
    579   CHAR directory[CCHMAXPATH];
    580   CHAR previous[CCHMAXPATH];
    581   ULONG fg, bg, hifg, hibg, border;
    582   PFNWP oldproc;
    583   CHAR font[CCHMAXPATH];
    584   MASK mask;
    585   ULONGLONG ullTotalBytes;
    586   ULONGLONG selectedbytes;
    587   ULONG selectedfiles;
    588   ULONG totalfiles;
    589   BOOL cnremphasized;
    590   BOOL dontclose;
    591   ARC_TYPE *info;
    592   CHAR arcname[CCHMAXPATH];
    593   CHAR command[257];
    594   CHAR stopflag;
    595   CHAR workdir[CCHMAXPATH];
    596   CHAR lastfilename[CCHMAXPATH];
    597   BOOL namecanchange;
    598   BOOL fmoving;
    599   BOOL amextracted;
    600   INT lasthelp;
    601   INT sortFlags;
    602   BOOL detailsladate, detailslatime, detailscrdate, detailscrtime,
    603     detailslongname, detailsea, detailssize, detailssubject,
    604     detailslwdate, detailslwtime, detailsattr, detailsicon;
    605   CHAR **lastselection;
    606   USHORT shiftstate;
    607   USHORT suspendview;
    608   CHAR szCommonName[CCHMAXPATH];
    609   ULONG lasttime;
    610   BOOL arcfilled;
    611   HMTX filling;
    612   BOOL firsttree;
    613   ULONG lastattr;
    614   ULONG ulItemsToUnHilite;
    615 }
    616 DIRCNRDATA;
    617 
    618 typedef struct
    619 {
    620   USHORT size;
    621   HWND hwndCnr;
    622   CHAR directory[CCHMAXPATH];
    623   BOOL collapsefirst;
    624   DIRCNRDATA *dcd;
    625 }
    626 SHOWREC;
    627 
    628 typedef struct
    629 {
    630   USHORT size;
    631   USHORT dummy;
    632   CHAR file1[CCHMAXPATH];
    633   CHAR file2[CCHMAXPATH];
    634   HWND hwndParent;
    635   HWND hwndList;
    636   HWND hwndReport;
    637   HWND hwndHelp;
    638 }
    639 FCOMPARE;
    640 
    641 typedef struct COMPARE
    642 {
    643   USHORT size;
    644   HWND hwnd;
    645   HWND hwndParent;
    646   CHAR leftdir[CCHMAXPATH + 2];
    647   CHAR rightdir[CCHMAXPATH + 2];
    648   BOOL forcescroll;
    649   BOOL filling;
    650   BOOL includesubdirs;
    651   INT action;
    652   INT selleft;
    653   INT selright;
    654   INT totalleft;
    655   INT totalright;
    656   CHAR rightlist[CCHMAXPATH];   // Snapshot file name
    657   BOOL reset;
    658   HWND hwndCalling;
    659   struct COMPARE *cmp;          // callers compare defintion
    660   struct DIRCNRDATA dcd;
    661 }
    662 COMPARE;
    663 
    664456/* init.c */
    665457VOID FindSwapperDat(VOID);
    666458BOOL InitFM3DLL(HAB hab, int argc, char **argv);
    667459HWND StartFM3(HAB hab, INT argc, CHAR ** argv);
    668 
    669 /* filldir.c */
    670 VOID EmptyCnr(HWND hwnd);
    671 const PSZ FileAttrToString(ULONG fileAttr);
    672 VOID FillDirCnr(HWND hwndCnr, CHAR *pszDirectory, DIRCNRDATA *pdcd,
    673                 PULONGLONG pullBytes);
    674 VOID FillTreeCnr(HWND hwndCnr, HWND hwndParent);
    675 VOID ProcessDirectory(const HWND hwndCnr, const PCNRITEM pciParent,
    676                       const CHAR *szDirBase, const BOOL filestoo,
    677                       const BOOL recurse, const BOOL partial,
    678                       CHAR *stopflag, DIRCNRDATA *pdcd,
    679                       PULONG pullTotalFiles, PULONGLONG pullTotalBytes);
    680 ULONGLONG FillInRecordFromFFB(HWND hwndCnr, PCNRITEM pci,
    681                               const PSZ pszDirectory,
    682                               const PFILEFINDBUF4L pffb, const BOOL partial,
    683                               DIRCNRDATA *pdcd);
    684 ULONGLONG FillInRecordFromFSA(HWND hwndCnr, PCNRITEM pci,
    685                               const PSZ pszFileName, const PFILESTATUS4L pfsa4,
    686                               const BOOL partial, DIRCNRDATA *pdcd);
    687 VOID FreeCnrItem(HWND hwnd, PCNRITEM pci);
    688 VOID FreeCnrItemList(HWND hwnd, PCNRITEM pciFirst);
    689 VOID FreeCnrItemData(PCNRITEM pci);
    690 INT RemoveCnrItems(HWND hwnd, PCNRITEM pci, USHORT usCnt, USHORT usFlags);
    691460
    692461/* flesh.c */
     
    695464BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent);
    696465BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent);
    697 
    698 /* error.c */
    699 VOID DbgMsg(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    700 INT Dos_Error(ULONG mb_type, ULONG ulRC, HWND hwndOwner,
    701               PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    702 INT Dos_Error2(ULONG mb_type, ULONG ulRC, HWND hwndOwner, PCSZ pszSrcFile,
    703                UINT uSrcLineNo, UINT idMsg);
    704 ULONG GetMSecTimer(void);
    705 VOID Runtime_Error(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    706 VOID Runtime_Error2(PCSZ pszSrcFile, UINT uSrcLineNo, UINT idMsg);
    707 APIRET saymsg(ULONG mb_type, HWND hwnd, PCSZ pszTitle, PCSZ pszFmt, ...);
    708 VOID Win_Error(HWND hwndErr, HWND hwndOwner,
    709                PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    710 VOID Win_Error2(HWND hwndErr, HWND hwndOwner, PCSZ pszSrcFile,
    711                 UINT uSrcLineNo, UINT idMsg);
    712 VOID Win_Error_NoMsgBox(HWND hwndErr, HWND hwndOwner,
    713                         PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...);
    714466
    715467/* valid.c */
     
    835587MRESULT EXPENTRY OpenButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    836588
    837 /* dircnrs.c */
    838 MRESULT EXPENTRY DirClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1,
    839                                   MPARAM mp2);
    840 HWND StartDirCnr(HWND hwndParent, CHAR * directory, HWND hwndRestore,
    841                  ULONG flags);
    842 MRESULT EXPENTRY DirTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    843 MRESULT EXPENTRY DirFolderProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    844 MRESULT EXPENTRY DirMaxProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    845 MRESULT EXPENTRY DirObjWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    846 
    847589/* presparm.c */
    848590VOID StoreWndPresParams(HWND hwnd, CHAR * tagname, HINI prof);
     
    924666CHAR *findstring(CHAR * findthis, ULONG lenthis, CHAR * findin,
    925667                 ULONG lenin, BOOL insensitive);
    926 
    927 /* avl.c */
    928 ARC_TYPE *quick_find_type(CHAR * filespec, ARC_TYPE * topsig);
    929 ARC_TYPE *find_type(CHAR * filespec, ARC_TYPE * topsig);
    930 INT load_archivers(VOID);
    931 BOOL ArcDateTime(CHAR * dt, INT type, CDATE * cdate, CTIME * ctime);
    932668
    933669/* avv.c */
     
    973709                                 MPARAM mp2);
    974710
    975 /* makelist.c */
    976 INT AddToList(CHAR * string, CHAR *** list, INT * numfiles, INT * numalloced);
    977 INT AddToFileList(CHAR * string, FILEFINDBUF4L * ffb4, FILELIST *** list,
    978                   INT * numfiles, INT * numalloced);
    979 CHAR **BuildList(HWND hwndCnr);
    980 VOID FreeListInfo(LISTINFO * li);
    981 VOID FreeList(CHAR ** list);
    982 VOID SortList(LISTINFO * li);
    983 CHAR **BuildArcList(HWND hwndCnr);
    984 CHAR **RemoveFromList(CHAR ** list, CHAR * item);
    985 CHAR **CombineLists(CHAR ** prime, CHAR ** add);
    986 
    987711/* chklist.c */
    988712VOID PosOverOkay(HWND hwnd);
     
    1104828                                   MPARAM mp2);
    1105829
    1106 /* arccnrs.c */
    1107 MRESULT EXPENTRY ArcClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1,
    1108                                   MPARAM mp2);
    1109 HWND StartArcCnr(HWND hwndParent, HWND hwndCaller, CHAR * arcname, INT flags,
    1110                  ARC_TYPE * sinfo);
    1111 MRESULT EXPENTRY ArcTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    1112 MRESULT EXPENTRY ArcFolderProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    1113 MRESULT EXPENTRY ArcObjWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    1114 PSZ BldQuotedFullPathName(PSZ pszFullPathName, PSZ pszPathName, PSZ pszFileName);
    1115 PSZ BldQuotedFileName(PSZ pszQuotedFileName, PSZ pszFileName);
    1116 
    1117830/* assoc.c */
    1118831INT ExecAssociation(HWND hwnd, CHAR * datafile);
     
    1165878/* rename.c */
    1166879MRESULT EXPENTRY RenameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    1167 
    1168 /* comp.c */
    1169 PSZ BldFullPathName(PSZ pszFullPathName, PSZ pszPathName, PSZ pszFileName);
    1170 MRESULT EXPENTRY CFileDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    1171 MRESULT EXPENTRY CompareDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
    1172880
    1173881/* findrec.c */
     
    13551063VOID DecrThreadUsage(VOID);
    13561064
    1357 /* string.c */
    1358 BOOL LoadStrings(char *filename);
    1359 char *GetPString(ULONG id);
    1360 BOOL StringsLoaded(void);
    1361 
    13621065/* wrappers.c */
    13631066APIRET xDosFindFirst(PSZ pszFileSpec,
    1364                      PHDIR phdir,
    1365                      ULONG  flAttribute,
    1366                      PVOID  pfindbuf,
    1367                      ULONG  cbBuf,
    1368                      PULONG pcFileNames,
    1369                      ULONG  ulInfoLevel);
     1067                     PHDIR phdir,
     1068                     ULONG  flAttribute,
     1069                     PVOID  pfindbuf,
     1070                     ULONG  cbBuf,
     1071                     PULONG pcFileNames,
     1072                     ULONG  ulInfoLevel);
    13701073APIRET xDosFindNext(HDIR   hDir,
    1371                     PVOID  pfindbuf,
    1372                     ULONG  cbfindbuf,
    1373                     PULONG pcFilenames,
     1074                    PVOID  pfindbuf,
     1075                    ULONG  cbfindbuf,
     1076                    PULONG pcFilenames,
    13741077                    ULONG  ulInfoLevel);        // 06 Oct 07 SHL Added
    13751078APIRET xDosSetPathInfo(PSZ   pszPathName,
    1376                        ULONG ulInfoLevel,
    1377                        PVOID pInfoBuf,
    1378                        ULONG cbInfoBuf,
    1379                        ULONG flOptions);
     1079                       ULONG ulInfoLevel,
     1080                       PVOID pInfoBuf,
     1081                       ULONG cbInfoBuf,
     1082                       ULONG flOptions);
    13801083PSZ xfgets(PSZ pszBuf, size_t cMaxBytes, FILE * fp, PCSZ pszSrcFile,
    13811084           UINT uiLineNumber);
     
    14651168#pragma data_seg(GLOBAL2)
    14661169#endif
    1467 DATADEF CHAR *DEBUG_STRING, *FM3Str, *FM2Str, *NullStr, *Default, *Settings,
     1170
     1171DATADEF CHAR *FM3Str, *FM2Str, *NullStr, *Default, *Settings,
    14681172  *DRM_OS2FILE, *DRM_FM2ARCMEMBER, *DRF_FM2ARCHIVE,
    14691173  *DRMDRFLIST, *DRMDRFOS2FILE, *DRMDRFFM2ARC,
  • trunk/dll/fonts.c

    r793 r907  
    1 /* handles setting fonts */
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Font support
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H. Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <string.h>
    216
    317#define INCL_DOS
    418#define INCL_WIN
    519#define INCL_GPI
    6 
    7 #include <os2.h>
    8 #include <stdlib.h>
    9 #include <stdio.h>
    10 #include <string.h>
     20#define INCL_LONGLONG                   // dircnrs.h
     21
     22#include "fm3str.h"
     23#include "errutil.h"                    // Dos_Error...
     24#include "strutil.h"                    // GetPString
    1125#include "fm3dll.h"
    12 #include "fm3str.h"
    1326
    1427#pragma data_seg(DATA1)
  • trunk/dll/fsopen.c

    r844 r907  
    1616#if defined(__IBMC__)
    1717
    18 #define INCL_WIN
    19 #define INCL_DOS
    20 #define INCL_LONGLONG
    21 
    22 #include <os2.h>
    2318#include <stdlib.h>
    2419#include <stdio.h>
     
    2722#include <fcntl.h>
    2823#include <share.h>
     24
     25#define INCL_WIN
     26#define INCL_DOS
     27#define INCL_LONGLONG
     28
    2929#include "fm3dll.h"
    3030
  • trunk/dll/getnames.c

    r847 r907  
    1313
    1414***********************************************************************/
     15
     16#include <string.h>
     17#include <ctype.h>
    1518
    1619#define INCL_DOS
    1720#define INCL_WIN
    1821#define INCL_LONGLONG
    19 #include <os2.h>
    20 
    21 #include <stdlib.h>
    22 #include <stdio.h>
    23 #include <string.h>
    24 #include <time.h>
    25 
    26 #include <ctype.h>
    27 #include "fm3dll.h"
     22
    2823#include "fm3dlg.h"
    2924#include "fm3str.h"
     25#include "errutil.h"                    // Dos_Error...
     26#include "strutil.h"                    // GetPString
     27#include "fm3dll.h"
    3028
    3129#pragma data_seg(DATA1)
  • trunk/dll/grep.c

    r850 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  12 Feb 03 SHL insert_grepfile: standardize EA math
     
    3030***********************************************************************/
    3131
    32 #define INCL_DOS
    33 #define INCL_WIN
    34 #define INCL_DOSERRORS
    35 #define INCL_LONGLONG
    36 #include <os2.h>
    37 
    3832#include <stdlib.h>
    3933#include <string.h>
    4034#include <ctype.h>
    41 #include <stdio.h>
    4235#include <share.h>
    4336
    44 #include "fm3dll.h"
     37#define INCL_DOS
     38#define INCL_DOSERRORS
     39#define INCL_WIN
     40#define INCL_LONGLONG
     41
    4542#include "fm3str.h"
    4643#include "grep.h"
     44#include "pathutil.h"                   // BldFullPathName
     45#include "filldir.h"                    // FillInRecordFromFFB
     46#include "makelist.h"                   // AddToList
     47#include "errutil.h"                    // Dos_Error...
     48#include "strutil.h"                    // GetPString
     49#include "fm3dll.h"
    4750
    4851#pragma data_seg(DATA2)
     
    588591                   MPFROMLONG(EXTRA_RECORD_BYTES),
    589592                   MPFROMLONG(grep->toinsert));
     593  // 04 Jan 08 SHL fixme to complain if CM_ALLOCRECORD fails
    590594  if (pci) {
     595    // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    591596    if (grep->sayfiles)
    592597      WinSetWindowText(grep->hwndCurFile, GetPString(IDS_GREPINSERTINGTEXT));
     
    11251130  register CHAR *pc, *pi;
    11261131  CHAR **list = NULL;
    1127   INT numfiles = 0, numalloced = 0, error;
     1132  UINT numfiles = 0, numalloced = 0;
     1133  INT error;
    11281134  register ULONG x = 0, y = 0;
    11291135  ULONG cntr = 1000;
  • trunk/dll/grep.h

    r902 r907  
    1919
    2020#if !defined(OS2_INCLUDED)
     21#define INCL_LONGLONG
    2122#include <os2.h>
     23#else
     24#if !defined(INCL_LONGLONG)
     25#error INCL_LONGLONG required by grep.h
     26#endif
    2227#endif
    2328
  • trunk/dll/grep2.c

    r793 r907  
    2121  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
    2222
    23 
    2423  fixme for more excess locals to be gone
    2524
    2625***********************************************************************/
    2726
    28 #define INCL_DOS
    29 #define INCL_WIN
    30 #define INCL_GPI
    31 #define INCL_DOSERRORS
    32 #include <os2.h>
    33 
    34 #include <stdarg.h>
    35 #include <stdio.h>
    3627#include <stdlib.h>
    3728#include <string.h>
    3829#include <ctype.h>
    39 #include <time.h>
    4030#include <share.h>
    41 #include <limits.h>
    4231#include <process.h>                    // _beginthread
    4332
    44 #include "fm3dll.h"
     33#define INCL_DOS
     34#define INCL_WIN
     35#define INCL_LONGLONG                   // dircnrs.h
     36#define INCL_WINSTDCNR                  // makelist.h
     37
    4538#include "fm3dlg.h"
    4639#include "fm3str.h"
    4740#include "mle.h"
    4841#include "grep.h"
     42#include "errutil.h"                    // Dos_Error...
     43#include "strutil.h"                    // GetPString
     44#include "fm3dll.h"
    4945
    5046#pragma data_seg(DATA1)
  • trunk/dll/info.c

    r897 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2006 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  16 Oct 02 SHL Handle large partitions
     
    2727***********************************************************************/
    2828
     29#include <stdlib.h>
     30#include <string.h>
     31#include <ctype.h>
     32#include <share.h>
     33
    2934#define INCL_DOS
    3035#define INCL_WIN
    3136#define INCL_GPI
    3237#define INCL_LONGLONG
    33 #include <os2.h>
    34 
    35 #include <stdio.h>
    36 #include <stdlib.h>
    37 #include <string.h>
    38 #include <ctype.h>
    39 #include <share.h>
    40 
    41 #include "fm3dll.h"
     38
    4239#include "fm3dlg.h"
    4340#include "fm3str.h"
     41#include "makelist.h"                   // AddToList
     42#include "errutil.h"                    // Dos_Error...
     43#include "strutil.h"                    // GetPString
     44#include "fm3dll.h"
    4445
    4546#pragma data_seg(DATA1)
     
    541542
    542543          LISTINFO li;
    543           INT numfiles = 0, numalloc = 0;
     544          UINT numfiles = 0, numalloc = 0;
    544545
    545546          memset(&li, 0, sizeof(LISTINFO));
  • trunk/dll/inis.c

    r900 r907  
    2424***********************************************************************/
    2525
    26 #define INCL_WIN
    27 #define INCL_GPI
    28 #define INCL_DOS
    29 #define INCL_DOSERRORS
    30 #include <os2.h>
    31 
    3226#include <stdlib.h>
    33 #include <stdio.h>
    3427#include <string.h>
    3528#include <ctype.h>
     
    3730#include <process.h>                    // _beginthread
    3831
    39 #include "fm3dll.h"
     32#define INCL_DOS
     33#define INCL_DOSERRORS
     34#define INCL_WIN
     35#define INCL_GPI
     36#define INCL_LONGLONG                   // dircnrs.h
     37
    4038#include "fm3dlg.h"
    4139#include "fm3str.h"
    4240#include "mle.h"
     41#include "errutil.h"                    // Dos_Error...
     42#include "strutil.h"                    // GetPString
     43#include "fm3dll.h"
    4344
    4445#pragma data_seg(DATA2)
  • trunk/dll/init.c

    r898 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  11 Jun 02 SHL Add CheckVersion
     
    4343
    4444#include <stdlib.h>
    45 #include <stdio.h>
    4645#include <string.h>
    47 #include <ctype.h>
    4846#include <share.h>
    49 #include <time.h>
    5047#include <process.h>
    5148
     
    6259#define DEFINE_GLOBALS 1
    6360
    64 #include "fm3dll.h"
    6561#include "fm3dlg.h"
    6662#include "datamin.h"
     
    6864#include "fm3str.h"
    6965#include "version.h"
     66#include "pathutil.h"                   // BldFullPathName
     67#include "arccnrs.h"                    // ArcClientWndProc
     68#include "errutil.h"                    // Dos_Error...
     69#include "strutil.h"                    // GetPString
     70#include "fm3dll.h"
    7071
    7172#ifdef __IBMC__
  • trunk/dll/input.c

    r793 r907  
    1616***********************************************************************/
    1717
     18#include <string.h>
     19
    1820#define INCL_DOS
    1921#define INCL_WIN
    20 #include <os2.h>
     22#define INCL_LONGLONG                   // dircnrs.h
    2123
    22 #include <stdlib.h>
    23 #include <stdio.h>
    24 #include <string.h>
    25 
    26 #include "fm3dll.h"
    2724#include "fm3dlg.h"
    2825#include "fm3str.h"
     26#include "errutil.h"                    // Dos_Error...
     27#include "strutil.h"                    // GetPString
     28#include "fm3dll.h"
    2929
    3030static PSZ pszSrcFile = __FILE__;
  • trunk/dll/instant.c

    r888 r907  
    1616***********************************************************************/
    1717
    18 #define INCL_DOS
    19 #define INCL_WIN
    20 #include <os2.h>
    21 
    22 #include <stdlib.h>
    23 #include <stdio.h>
    2418#include <string.h>
    2519#include <ctype.h>
    2620
    27 #include "fm3dll.h"
     21#define INCL_DOS
     22#define INCL_WIN
     23#define INCL_LONGLONG                   // dircnrs.h
     24
    2825#include "fm3dlg.h"
    2926#include "fm3str.h"
    3027#include "mle.h"
     28#include "errutil.h"                    // Dos_Error...
     29#include "strutil.h"                    // GetPString
     30#include "fm3dll.h"
    3131
    3232#pragma data_seg(DATA1)
  • trunk/dll/key.c

    r814 r907  
    1717***********************************************************************/
    1818
     19#include <string.h>
     20
    1921#define INCL_DOS
    2022#define INCL_WIN
    21 
    22 #include <os2.h>
    23 
    24 #include <stdlib.h>
    25 #include <stdio.h>
    26 #include <string.h>
    27 #include <time.h>
    28 #include <ctype.h>
    29 
    30 #include "fm3dll.h"
     23#define INCL_LONGLONG                   // dircnrs.h
     24
    3125#include "fm3dlg.h"
    3226#include "fm3str.h"
    3327#include "version.h"
     28#include "errutil.h"                    // Dos_Error...
     29#include "strutil.h"                    // GetPString
     30#include "fm3dll.h"
    3431
    3532#pragma data_seg(DATA1)
  • trunk/dll/killproc.c

    r888 r907  
    2121***********************************************************************/
    2222
    23 #define INCL_DOSERRORS
    24 #define INCL_DOS
    25 #define INCL_WIN
    26 #include <os2.h>
    27 
    2823#include <stdlib.h>
    29 #include <stdio.h>
    3024#include <string.h>
    31 #include <time.h>
    3225#include <ctype.h>
    3326#include <process.h>
    3427#include <limits.h>
    3528
    36 #include "fm3dll.h"
     29#define INCL_DOS
     30#define INCL_DOSERRORS
     31#define INCL_WIN
     32#define INCL_LONGLONG                   // dircnrs.h
     33
    3734#include "fm3dlg.h"
    3835#include "fm3str.h"
    3936#include "procstat.h"
     37#include "errutil.h"                    // Dos_Error...
     38#include "strutil.h"                    // GetPString
     39#include "fm3dll.h"
    4040
    4141#pragma data_seg(DATA2)
  • trunk/dll/literal.c

    r871 r907  
    2020***********************************************************************/
    2121
     22#include <stdlib.h>
     23#include <string.h>
     24#include <ctype.h>
     25
    2226#define INCL_OS2
    2327#define INCL_WIN
    24 #include <os2.h>
    25 
    26 #include <ctype.h>
    27 #include <stdlib.h>
    28 #include <stdio.h>
    29 #include <string.h>
    30 
     28#define INCL_LONGLONG                   // dircnrs.h
     29
     30#include "errutil.h"                    // Dos_Error...
    3131#include "fm3dll.h"
    3232
  • trunk/dll/loadbmp.c

    r793 r907  
    1717***********************************************************************/
    1818
    19 #define INCL_DOS
    20 #define INCL_WIN
    21 #define INCL_GPI
    22 #include <os2.h>
    23 
    2419#include <stdlib.h>
    2520#include <stdio.h>
     
    2722#include <share.h>
    2823
     24#define INCL_DOS
     25#define INCL_WIN
     26#define INCL_GPI
     27#define INCL_LONGLONG                   // dircnrs.h
     28
     29#include "errutil.h"                    // Dos_Error...
    2930#include "fm3dll.h"
    3031
  • trunk/dll/mainwnd.c

    r888 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  11 Jun 02 SHL Drop obsolete xor code
     
    4646***********************************************************************/
    4747
     48#include <stdlib.h>
     49#include <string.h>
     50#include <ctype.h>
     51#include <process.h>                    // _beginthread
     52
    4853#define INCL_DOS
    4954#define INCL_WIN
    50 // #define INCL_WINERRORS
    5155#define INCL_SHLERRORS                  // PMERR_NOT_IN_IDX
    5256#define INCL_WINHELP
    5357#define INCL_GPI
    5458#define INCL_LONGLONG
    55 #include <os2.h>
    56 
    57 #include <stdarg.h>
    58 #include <stdio.h>
    59 #include <stdlib.h>
    60 #include <string.h>
    61 #include <ctype.h>
    62 #include <share.h>
    63 #include <process.h>                    // _beginthread
    64 
    65 #include "fm3dll.h"
     59
    6660#include "fm3dlg.h"
    6761#include "fm3str.h"
    6862#include "tools.h"
     63#include "comp.h"
    6964#include "datamin.h"
     65#include "arccnrs.h"                    // BldQuotedFileName
     66#include "errutil.h"                    // Dos_Error...
     67#include "strutil.h"                    // GetPString
     68#include "fm3dll.h"
    7069
    7170#pragma data_seg(DATA1)
  • trunk/dll/mainwnd2.c

    r888 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005, 2007 Steven H. Levine
     9  Copyright (c) 2005, 2008 Steven H. Levine
    1010
    1111  23 May 05 SHL Use datamin.h
     
    2323***********************************************************************/
    2424
     25#include <stdlib.h>
     26#include <string.h>
     27#include <share.h>
     28#include <process.h>                    // _beginthread
     29
    2530#define INCL_DOS
    2631#define INCL_WIN
    2732#define INCL_GPI
    2833#define INCL_LONGLONG
    29 #include <os2.h>
    30 
    31 #include <stdlib.h>
    32 #include <stdio.h>
    33 #include <string.h>
    34 #include <ctype.h>
    35 #include <share.h>
    36 #include <process.h>                    // _beginthread
    37 
    38 #include "fm3dll.h"
     34
    3935#include "fm3dlg.h"
    4036#include "fm3str.h"
    4137#include "tools.h"
    4238#include "datamin.h"
     39#include "comp.h"                       // COMPARE
     40#include "arccnrs.h"                    // BldQuotedFileName
     41#include "errutil.h"                    // Dos_Error...
     42#include "strutil.h"                    // GetPString
     43#include "fm3dll.h"
    4344
    4445typedef struct
  • trunk/dll/makefile

    r903 r907  
    3535# 03 Jan 08 SHL Prepare for final, implending switch to wrc.exe
    3636# 03 Jan 08 SHL Switch to wrc.exe default; support USE_RC from environment
     37# 05 Jan 08 SHL Sync with .c renames
    3738
    3839# Environment:
     
    9293# -wcd14        no reference to symbol
    9394# -wcd726       no reference to formal parameter
     95# -we           treat warnings as errors
    9496# -wx           max warnings
    9597# -zfp          disable fs use
     
    99101
    100102!ifdef DEBUG
    101 CFLAGS =  -bt=os2 -mf -bd -bm -hd -d2 -olirs -s -sg -j -wx -zfp -zgp -zp4 -zq
    102 CFLAGS =  -bt=os2 -mf -bd -bm -hd -d2        -s -sg -j -wx -zfp -zgp -zp4 -zq
    103 !else
    104 CFLAGS =  -bt=os2 -mf -bd -bm -hd -d1 -olirs -s -sg -j -wx -zfp -zgp -zp4 -zq
     103CFLAGS =  -bt=os2 -mf -bd -bm -hd -d2 -olirs -s -sg -j -we -wx -zfp -zgp -zp4 -zq
     104CFLAGS =  -bt=os2 -mf -bd -bm -hd -d2        -s -sg -j -we -wx -zfp -zgp -zp4 -zq
     105!else
     106CFLAGS =  -bt=os2 -mf -bd -bm -hd -d1 -olirs -s -sg -j -we -wx -zfp -zgp -zp4 -zq
    105107!endif
    106108
    107109# for fm3res only
    108 CFLAGSR = -bt=os2 -mf -bd -bm         -olirs -s     -j -wx -zfp -zgp -zp4 -zq
     110CFLAGSR = -bt=os2 -mf -bd -bm         -olirs -s     -j -we -wx -zfp -zgp -zp4 -zq
    109111
    110112!ifdef DEBUG
     
    138140       collect.obj colors.obj commafmt.obj command.obj common.obj &
    139141       comp.obj copyf.obj datamin.obj defview.obj delims.obj dircnrs.obj &
    140        dirs.obj dirsize.obj draglist.obj droplist.obj eas.obj error.obj &
     142       dirs.obj dirsize.obj draglist.obj droplist.obj eas.obj errutil.obj &
    141143       extract.obj filldir.obj filter.obj findrec.obj flesh.obj fm2cmd.obj &
    142144       fonts.obj fsopen.obj getnames.obj grep.obj grep2.obj info.obj inis.obj &
     
    144146       loadbmp.obj mainwnd.obj mainwnd2.obj makelist.obj menu.obj misc.obj &
    145147       mkdir.obj mle.obj newview.obj notebook.obj notify.obj objcnr.obj &
    146        objwin.obj presparm.obj printer.obj remap.obj rename.obj saveclip.obj &
     148       objwin.obj &
     149       pathutil.obj &
     150       presparm.obj printer.obj remap.obj rename.obj saveclip.obj &
    147151       seeall.obj select.obj seticon.obj shadow.obj sortcnr.obj srchpath.obj &
    148        string.obj strips.obj stristr.obj subj.obj sysinfo.obj systemf.obj &
    149        timer.obj tools.obj treecnr.obj undel.obj update.obj uudecode.obj &
     152       strutil.obj strips.obj stristr.obj subj.obj sysinfo.obj systemf.obj &
     153       timer.obj tmrsvcs.obj tools.obj treecnr.obj &
     154       undel.obj update.obj uudecode.obj &
    150155       valid.obj viewer.obj viewinf.obj walkem.obj winlist.obj worker.obj &
    151156       wrappers.obj
  • trunk/dll/makelist.c

    r841 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  12 Feb 03 SHL AddToFileList: standardize EA math
     
    1717***********************************************************************/
    1818
     19#include <stdlib.h>
     20#include <string.h>
     21
    1922#define INCL_DOS
    2023#define INCL_WIN
    2124#define INCL_LONGLONG
    22 #include <os2.h>
    23 
    24 #include <stdio.h>
    25 #include <stdlib.h>
    26 #include <string.h>
    27 #include <ctype.h>
    28 
    29 #include "fm3dll.h"
     25
    3026#include "fm3str.h"
     27#include "makelist.h"
     28#include "errutil.h"                    // Dos_Error...
     29#include "strutil.h"                    // GetPString
     30#include "dircnrs.h"
     31#include "fm3dll.h"                     // 05 Jan 08 SHL fixme to be gone
    3132
    3233static PSZ pszSrcFile = __FILE__;
    3334
    34 VOID SortList(LISTINFO * li)
     35VOID SortList(LISTINFO *li)
    3536{
    3637  /* bubble-sort entries by size, descending */
    3738
    38   INT x;
     39  UINT x;
    3940  CHAR *s;
    4041  ULONG l;
     
    6465}
    6566
    66 VOID FreeListInfo(LISTINFO * li)
     67VOID FreeListInfo(LISTINFO *li)
    6768{
    6869  if (li) {
     
    7778}
    7879
    79 VOID FreeList(CHAR ** list)
    80 {
    81   register INT x;
     80VOID FreeList(CHAR **list)
     81{
     82  UINT x;
    8283
    8384  if (list) {
     
    9697}
    9798
    98 INT AddToFileList(CHAR * string, FILEFINDBUF4L * ffb4, FILELIST *** list,
    99                   INT * numfiles, INT * numalloced)
     99INT AddToFileList(CHAR *string, FILEFINDBUF4L *ffb4, FILELIST ***list,
     100                  UINT *pnumfiles, UINT *pnumalloced)
    100101{
    101102  FILELIST *pfl;
     
    103104  if (string && ffb4) {
    104105    // Ensure room for NULL entry
    105     if (((*numfiles) + 3) > *numalloced) {
     106    if (((*pnumfiles) + 3) > *pnumalloced) {
    106107      FILELIST **pflArray;
    107108
    108109      // Use plain realloc for speed
    109110      // 06 Aug 07 SHL fixme to know why + 6
    110       pflArray = realloc(*list, (*numalloced + 6) * sizeof(FILELIST *));
     111      pflArray = realloc(*list, (*pnumalloced + 6) * sizeof(FILELIST *));
    111112      if (!pflArray) {
    112113        Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_OUTOFMEMORY));
    113114        return 1;
    114115      }
    115       (*numalloced) += 6;
     116      (*pnumalloced) += 6;
    116117      *list = pflArray;
    117118    }
     
    132133    pfl->easize = CBLIST_TO_EASIZE(ffb4->cbList);
    133134    strcpy(pfl->fname, string);
    134     (*list)[*numfiles] = pfl;
    135     (*numfiles)++;
     135    (*list)[*pnumfiles] = pfl;
     136    (*pnumfiles)++;
    136137    // Ensure list always ends with two NULL entries
    137138    // 06 Aug 07 SHL fixme to know why
    138     (*list)[*numfiles] = NULL;
    139     (*list)[(*numfiles) + 1] = NULL;
     139    (*list)[*pnumfiles] = NULL;
     140    (*list)[(*pnumfiles) + 1] = NULL;
    140141#ifdef __DEBUG_ALLOC__
    141142    _heap_check();
     
    151152 */
    152153
    153 INT AddToList(CHAR * string, CHAR *** list, INT * numfiles, INT * numalloced)
     154INT AddToList(CHAR *string, CHAR ***list, UINT *pnumfiles, UINT *pnumalloced)
    154155{
    155156  CHAR **ppsz;
     
    157158
    158159  if (string) {
    159     if (((*numfiles) + 3) > *numalloced) {
     160    if (((*pnumfiles) + 3) > *pnumalloced) {
    160161      // Use plain realloc for speed
    161       ppsz = realloc(*list, (*numalloced + 6) * sizeof(CHAR *));
     162      ppsz = realloc(*list, (*pnumalloced + 6) * sizeof(CHAR *));
    162163      if (!ppsz) {
    163164        Runtime_Error(pszSrcFile, __LINE__, "realloc");
    164165        return 1;
    165166      }
    166       (*numalloced) += 6;
     167      (*pnumalloced) += 6;
    167168      *list = ppsz;
    168169    }
     
    173174      return 2;
    174175    }
    175     (*list)[*numfiles] = psz;
    176     strcpy((*list)[*numfiles], string); // Add entry
    177     (*numfiles)++;
    178     (*list)[*numfiles] = NULL;          // Add end marker
    179     (*list)[(*numfiles) + 1] = NULL;    // Add 2nd end marker - fixme to know why?
     176    (*list)[*pnumfiles] = psz;
     177    strcpy((*list)[*pnumfiles], string);        // Add entry
     178    (*pnumfiles)++;
     179    (*list)[*pnumfiles] = NULL;         // Add end marker
     180    (*list)[(*pnumfiles) + 1] = NULL;   // Add 2nd end marker - fixme to know why?
    180181#ifdef __DEBUG_ALLOC__
    181182    _heap_check();
     
    189190  PCNRITEM pci;
    190191  CHAR **list = NULL, **test;
    191   INT numfiles = 0, numalloc = 0, error = 0, attribute = CRA_CURSORED;
     192  UINT numfiles = 0, numalloc = 0;
     193  INT error = 0, attribute = CRA_CURSORED;
    192194
    193195  pci = (PCNRITEM) CurrentRecord(hwndCnr);
     
    220222  PARCITEM pai;
    221223  CHAR **list = NULL;
    222   INT numfiles = 0, numalloc = 0, error = 0, attribute = CRA_CURSORED;
     224  UINT numfiles = 0, numalloc = 0;
     225  INT error = 0, attribute = CRA_CURSORED;
    223226
    224227  pai = (PARCITEM) CurrentRecord(hwndCnr);
     
    239242}
    240243
    241 CHAR **RemoveFromList(CHAR ** list, CHAR * item)
    242 {
    243   register INT x, y;
     244CHAR **RemoveFromList(CHAR **list, CHAR *item)
     245{
     246  UINT x, y;
    244247
    245248  if (list && list[0] && item) {
     
    264267}
    265268
    266 CHAR **CombineLists(CHAR ** prime, CHAR ** add)
    267 {
    268   register INT x;
    269   INT numalloc, numfiles = 0;
     269CHAR **CombineLists(CHAR **prime, CHAR **add)
     270{
     271  UINT x;
     272  UINT numalloc, numfiles = 0;
    270273
    271274  if (add && add[0]) {
  • trunk/dll/menu.c

    r793 r907  
    1616***********************************************************************/
    1717
    18 #define INCL_DOS
    19 #define INCL_WIN
    20 #include <os2.h>
    21 
    22 #include <stdio.h>
    2318#include <stdlib.h>
    2419#include <string.h>
    2520#include <share.h>
    2621
     22#define INCL_WIN
     23#define INCL_LONGLONG                   // dircnrs.h
     24
     25#include "menu.h"
     26#include "errutil.h"                    // Dos_Error...
    2727#include "fm3dll.h"
    28 #include "menu.h"
    2928
    3029#pragma data_seg(DATA2)
  • trunk/dll/misc.c

    r891 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  11 Jun 03 SHL Add JFS and FAT32 support
     
    3939***********************************************************************/
    4040
     41#include <stdlib.h>
     42#include <string.h>
     43#include <ctype.h>
     44#include <share.h>
     45#include <malloc.h>                     // _heapmin
     46
    4147#define INCL_DOS
    4248#define INCL_WIN
    4349#define INCL_GPI
    4450#define INCL_LONGLONG
    45 #include <os2.h>
    46 
    47 #include <stdarg.h>
    48 #include <stdio.h>
    49 #include <stdlib.h>
    50 #include <string.h>
    51 #include <ctype.h>
    52 #include <share.h>
    53 #include <malloc.h>                     // headmin
    54 
    55 #include "fm3dll.h"
     51
    5652#include "fm3dlg.h"
    5753#include "fm3str.h"
     54#include "pathutil.h"                   // BldQuotedFileName
     55#include "errutil.h"                    // Dos_Error...
     56#include "strutil.h"                    // GetPString
     57#include "fm3dll.h"
    5858
    5959#pragma data_seg(DATA1)
  • trunk/dll/mkdir.c

    r551 r907  
    1 #define INCL_DOS
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Make directory dialog
     7
     8  Copyright (c) 1993-97 M. Kimes
     9  Copyright (c) 2004, 2007 Steven H.Levine
     10
     11  01 Aug 04 SHL Baseline
     12
     13***********************************************************************/
     14
     15#include <string.h>
     16#include <ctype.h>
     17
    218#define INCL_DOSERRORS
    319#define INCL_WIN
    4 
    5 #include <os2.h>
    6 #include <stdarg.h>
    7 #include <stdio.h>
    8 #include <stdlib.h>
    9 #include <string.h>
    10 #include <ctype.h>
    11 #include "fm3dll.h"
     20#define INCL_LONGLONG                   // dircnrs.h
     21
    1222#include "fm3dlg.h"
    1323#include "fm3str.h"
     24#include "errutil.h"                    // Dos_Error...
     25#include "strutil.h"                    // GetPString
     26#include "fm3dll.h"
    1427
    1528#pragma alloc_text(MKDIR,MassMkdir,SetDir,PMMkDir,SetTargetDir)
     
    1730APIRET MassMkdir(HWND hwndClient, CHAR * dir)
    1831{
    19 
    2032  APIRET last, was = 0;
    2133  CHAR *p;
  • trunk/dll/mle.c

    r892 r907  
    2121***********************************************************************/
    2222
    23 #define INCL_DOS
    24 #define INCL_WIN
    25 #define INCL_LONGLONG
    26 #include <os2.h>
    27 
    2823#include <stdlib.h>
    29 #include <stdio.h>
    3024#include <string.h>
    3125#include <ctype.h>
     
    3327#include <process.h>                    // _beginthread
    3428
    35 #include "fm3dll.h"
     29#define INCL_DOS
     30#define INCL_WIN
     31#define INCL_LONGLONG
     32
    3633#include "fm3dlg.h"
    3734#include "mle.h"
    3835#include "fm3str.h"
     36#include "errutil.h"                    // Dos_Error...
     37#include "strutil.h"                    // GetPString
     38#include "fm3dll.h"
    3939
    4040static PSZ pszSrcFile = __FILE__;
  • trunk/dll/newview.c

    r906 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  01 Dec 03 SHL Comments
     
    3232***********************************************************************/
    3333
     34#include <stdlib.h>
     35#include <string.h>
     36#include <process.h>
     37#include <limits.h>
     38#include <share.h>
     39
    3440#define INCL_DOS
    3541#define INCL_WIN
    3642#define INCL_GPI
    3743#define INCL_LONGLONG
    38 #include <os2.h>
    39 
    40 #include <stdlib.h>
    41 #include <stdio.h>
    42 #include <string.h>
    43 #include <ctype.h>
    44 #include <process.h>
    45 #include <limits.h>
    46 #include <share.h>
    47 
    48 #include "fm3dll.h"
     44
    4945#include "fm3dlg.h"
    5046#include "fm3str.h"
    5147#include "mle.h"
     48#include "makelist.h"                   // AddToList
     49#include "errutil.h"                    // Dos_Error...
     50#include "strutil.h"                    // GetPString
     51#include "fm3dll.h"
    5252
    5353#pragma data_seg(DATA2)
     
    357357  CHAR **list = NULL, s[SEARCHSTRINGLEN], a;
    358358  register CHAR *p, *e;
    359   INT numlines = 0, numalloc = 0;
     359  UINT numlines = 0, numalloc = 0;
    360360
    361361  if (ad && ad->selected) {
     
    396396            while (*e != '\r' && *e != '\n' && e < ad->text + ad->textsize)
    397397              e++;
    398 /*
    399    if((*e == '\r' || *e == '\n') && e > p)
    400    e--;
    401  */
     398            /* fixme to be gone?
     399               if((*e == '\r' || *e == '\n') && e > p)
     400               e--;
     401            */
    402402            width = e - p;
    403403          }
     
    434434  CHAR **list = NULL, s[SEARCHSTRINGLEN];
    435435  SHORT x, z;
    436   INT numlines = 0, numalloc = 0;
     436  UINT numlines = 0, numalloc = 0;
    437437
    438438  if (ad) {
  • trunk/dll/notebook.c

    r906 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2007 Steven H. Levine
     9  Copyright (c) 2004, 2008 Steven H. Levine
    1010
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    2424***********************************************************************/
    2525
    26 #define INCL_DOS
    27 #define INCL_WIN
    28 #include <os2.h>
    29 
    3026#include <stdio.h>
    3127#include <stdlib.h>
    3228#include <string.h>
    3329
    34 #include "fm3dll.h"
     30#define INCL_DOS
     31#define INCL_WIN
     32#define INCL_LONGLONG                   // dircnrs.h
     33
    3534#include "fm3dlg.h"
    3635#include "fm3str.h"
     36#include "pathutil.h"                   // BldQuotedFileName
     37#include "errutil.h"                    // Dos_Error...
     38#include "strutil.h"                    // GetPString
     39#include "fm3dll.h"
    3740
    3841#pragma data_seg(DATA2)
  • trunk/dll/notify.c

    r793 r907  
    1818***********************************************************************/
    1919
     20#include <stdlib.h>
     21#include <string.h>
     22#include <ctype.h>
     23#include <stddef.h>                     // _threadid
     24#include <process.h>                    // _beginthread
     25
    2026#define INCL_DOS
    2127#define INCL_WIN
    2228#define INCL_GPI
    23 #include <os2.h>
    24 
    25 #include <stdarg.h>
    26 #include <stdio.h>
    27 #include <stdlib.h>
    28 #include <string.h>
    29 #include <ctype.h>
    30 #include <time.h>
    31 #include <stddef.h>
    32 #include <process.h>                    // _beginthread
    33 
    34 #include "fm3dll.h"
     29#define INCL_LONGLONG                   // dircnrs.h
     30
    3531#include "fm3dlg.h"
    3632#include "fm3str.h"
     33#include "errutil.h"                    // Dos_Error...
     34#include "strutil.h"                    // GetPString
     35#include "fm3dll.h"
    3736
    3837#pragma data_seg(DATA1)
  • trunk/dll/objcnr.c

    r850 r907  
    2424***********************************************************************/
    2525
     26#include <stdlib.h>
     27#include <string.h>
     28#include <ctype.h>
     29#include <process.h>                    // _beginthread
     30
    2631#define INCL_DOS
    2732#define INCL_WIN
    2833#define INCL_DOSERRORS
    2934#define INCL_LONGLONG
    30 #include <os2.h>
    31 
    32 #include <stdio.h>
    33 #include <stdlib.h>
    34 #include <string.h>
    35 #include <ctype.h>
    36 #include <process.h>                    // _beginthread
    37 
    38 #include "fm3dll.h"
     35
    3936#include "fm3dlg.h"
    4037#include "fm3str.h"
     38#include "errutil.h"                    // Dos_Error...
     39#include "strutil.h"                    // GetPString
     40#include "fm3dll.h"
    4141
    4242typedef struct
  • trunk/dll/objwin.c

    r793 r907  
    1818#define INCL_DOS
    1919#define INCL_WIN
    20 #define INCL_GPI
    21 #include <os2.h>
     20#define INCL_LONGLONG                   // dircnrs.h
    2221
    23 #include <stdarg.h>
    24 #include <stdio.h>
    25 #include <stdlib.h>
    26 #include <string.h>
    27 #include <ctype.h>
    28 #include <stddef.h>
    29 
    30 #include "fm3dll.h"
    3122#include "fm3dlg.h"
    3223#include "fm3str.h"
     24#include "arccnrs.h"                    // ArcObjWndProc
     25#include "errutil.h"                    // Win_Error
     26#include "fm3dll.h"
    3327
    3428static PSZ pszSrcFile = __FILE__;
  • trunk/dll/presparm.c

    r882 r907  
    1616***********************************************************************/
    1717
    18 #define INCL_DOS
     18#include <string.h>
     19
    1920#define INCL_WIN
    20 #define INCL_GPI
    21 #include <os2.h>
    22 
    23 #include <stdarg.h>
    24 #include <stdio.h>
    25 #include <stdlib.h>
    26 #include <string.h>
    27 #include <ctype.h>
     21#define INCL_LONGLONG                   // dircnrs.h
    2822
    2923#include "fm3dll.h"
  • trunk/dll/printer.c

    r843 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2006 Steven H.Levine
     9  Copyright (c) 2004, 2008 Steven H.Levine
    1010
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    2121#include <string.h>
    2222#include <ctype.h>
    23 #include <stdio.h>
    24 #include <io.h>
    2523#include <share.h>
    26 #include <string.h>
    2724
    2825#define INCL_DOS
    2926#define INCL_WIN
    30 #include <os2.h>
    31 
    32 #include "fm3dll.h"
     27#define INCL_LONGLONG                   // dircnrs.h
     28
    3329#include "fm3dlg.h"
    3430#include "fm3str.h"
     31#include "makelist.h"                   // AddToList
     32#include "errutil.h"                    // Dos_Error...
     33#include "strutil.h"                    // GetPString
     34#include "fm3dll.h"
    3535
    3636#pragma data_seg(DATA1)
     
    547547        {
    548548          CHAR szBuffer[CCHMAXPATH + 1];
    549           INT numfiles = 0, numalloc = 0, error;
     549          UINT numfiles = 0, numalloc = 0;
     550          INT error;
    550551          SHORT x;
    551552
  • trunk/dll/remap.c

    r888 r907  
    1616***********************************************************************/
    1717
    18 #define INCL_WIN
    19 #define INCL_DOS
    20 #include <os2.h>
    21 
    2218#include <stdlib.h>
    23 #include <stdio.h>
    2419#include <string.h>
    25 #include <ctype.h>
    26 #include <time.h>
    2720#include <share.h>
    2821#include <io.h>                         // unlink
    2922
    30 #include "fm3dll.h"
     23#define INCL_DOS
     24#define INCL_WIN
     25#define INCL_LONGLONG                   // dircnrs.h
     26
    3127#include "fm3dlg.h"
    3228#include "fm3str.h"
     29#include "errutil.h"                    // Dos_Error...
     30#include "strutil.h"                    // GetPString
     31#include "fm3dll.h"
    3332
    3433#pragma data_seg(DATA1)
  • trunk/dll/rename.c

    r897 r907  
    1616***********************************************************************/
    1717
    18 #define INCL_DOS
     18#include <string.h>
     19
    1920#define INCL_WIN
    2021#define INCL_LONGLONG
    2122
    22 #include <os2.h>
    23 #include <stdarg.h>
    24 #include <stdio.h>
    25 #include <stdlib.h>
    26 #include <string.h>
    27 #include <ctype.h>
    28 #include "fm3dll.h"
    2923#include "fm3dlg.h"
    3024#include "fm3str.h"
     25#include "errutil.h"                    // Dos_Error...
     26#include "strutil.h"                    // GetPString
     27#include "fm3dll.h"
    3128
    3229MRESULT EXPENTRY RenameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
  • trunk/dll/saveclip.c

    r897 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005, 2007 Steven H. Levine
     9  Copyright (c) 2005, 2008 Steven H. Levine
    1010
    1111  12 Feb 03 SHL SaveListDlgProc: standardize EA math
     
    2424***********************************************************************/
    2525
    26 #define INCL_DOS
    27 #define INCL_WIN
    28 #define INCL_LONGLONG
    29 #include <os2.h>
    30 
    31 #include <stdarg.h>
    32 #include <stdio.h>
    3326#include <stdlib.h>
    3427#include <string.h>
    3528#include <share.h>
    3629
    37 #include "fm3dll.h"
     30#define INCL_WIN
     31#define INCL_LONGLONG
     32
    3833#include "fm3dlg.h"
    3934#include "fm3str.h"
     35#include "makelist.h"                   // AddToList
     36#include "errutil.h"                    // Dos_Error...
     37#include "strutil.h"                    // GetPString
     38#include "fm3dll.h"
    4039
    4140static PSZ pszSrcFile = __FILE__;
     
    158157{
    159158  CHAR *p, *pp, *text = NULL, **list = NULL;
    160   INT numfiles = 0, numalloced = 0;
     159  UINT numfiles = 0, numalloced = 0;
    161160
    162161  if (WinOpenClipbrd(hab)) {
  • trunk/dll/seeall.c

    r897 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  16 Oct 02 SHL Handle large partitions
     
    3636***********************************************************************/
    3737
     38#include <stdlib.h>
     39#include <string.h>
     40#include <ctype.h>
     41#include <process.h>
     42
    3843#define INCL_DOS
    3944#define INCL_DOSERRORS
     
    4146#define INCL_GPI
    4247#define INCL_LONGLONG
    43 #include <os2.h>
    44 
    45 #include <stdlib.h>
    46 #include <stdio.h>
    47 #include <string.h>
    48 #include <ctype.h>
    49 #include <process.h>
    50 
    51 #include "fm3dll.h"
     48
    5249#include "fm3dlg.h"
    5350#include "fm3str.h"
     51#include "pathutil.h"                   // BldQuotedFullPathName...
     52#include "makelist.h"                   // AddToList
     53#include "errutil.h"                    // Dos_Error...
     54#include "strutil.h"                    // GetPString
     55#include "fm3dll.h"
    5456
    5557#pragma data_seg(DATA2)
     
    262264    {
    263265      CHAR **files = NULL, **list = (CHAR **) mp2, path[CCHMAXPATH];
    264       INT numfiles = 0, numalloc = 0, plen = 0;
     266      UINT numfiles = 0, numalloc = 0;
     267      INT plen = 0;
    265268      HWND hwndFrame = WinQueryWindowULong(hwnd, QWL_USER);
    266269      CHAR message[CCHMAXPATH * 2], wildname[CCHMAXPATH];
     
    13171320  ULONG z = 0;
    13181321  CHAR **list = NULL;
    1319   INT numfiles = 0;
    1320   INT numalloc = 0;
     1322  UINT numfiles = 0;
     1323  UINT numalloc = 0;
    13211324  INT error;
    13221325
     
    19241927  if (!rc) {
    19251928    do {
    1926 #if 0 // 13 Aug 07 SHL fixme to be gone
    1927       {
    1928         static ULONG ulMaxCnt = 1;
    1929         if (ulFindCnt > ulMaxCnt) {
    1930           ulMaxCnt = ulFindCnt;
    1931           DbgMsg(pszSrcFile, __LINE__, "ulMaxCnt %u/%u", ulMaxCnt, ulFindMax);
    1932         }
    1933       }
    1934 #endif // fixme to be gone
    19351929      priority_normal();
    19361930      pffbFile = pffbArray;
  • trunk/dll/select.c

    r897 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2007 Steven H. Levine
     9  Copyright (c) 2004, 2008 Steven H. Levine
    1010
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    3131***********************************************************************/
    3232
    33 #define INCL_DOS
    34 #define INCL_WIN
    35 #define INCL_LONGLONG
    36 #include <os2.h>
    37 
    38 #include <stdio.h>
    3933#include <stdlib.h>
    4034#include <string.h>
     
    4236#include <io.h>
    4337
     38#define INCL_DOS
     39#define INCL_WIN
     40#define INCL_LONGLONG
     41
     42#include "fm3str.h"
     43#include "filldir.h"                    // RemoveCnrItems
     44#include "makelist.h"                   // AddToList
     45#include "errutil.h"                    // Dos_Error...
     46#include "strutil.h"                    // GetPString
    4447#include "fm3dll.h"
    45 #include "fm3str.h"
    4648
    4749static PSZ pszSrcFile = __FILE__;
     
    5052{
    5153  PCNRITEM pci;
    52   INT numfiles = 0, numalloc = 0, x = 0;
     54  UINT numfiles = 0, numalloc = 0;
     55  UINT x = 0;
    5356  INT attribute = CRA_CURSORED;
    5457
  • trunk/dll/seticon.c

    r793 r907  
    1515***********************************************************************/
    1616
    17 #define INCL_DOS
    18 #define INCL_WIN
    19 #include <os2.h>
    20 
    21 #include <stdio.h>
    2217#include <stdlib.h>
    2318#include <string.h>
    24 #include <ctype.h>
    2519#include <share.h>
    2620
     21#define INCL_WIN
     22#define INCL_LONGLONG                   // dircnrs.h
     23
     24#include "fm3dlg.h"
     25#include "errutil.h"                    // Dos_Error...
    2726#include "fm3dll.h"
    28 #include "fm3dlg.h"
    2927
    3028#pragma data_seg(DATA2)
  • trunk/dll/shadow.c

    r847 r907  
    77
    88  Copyright (c) 1993-97 M. Kimes
    9   Copyright (c) 2006, 2007 Steven H. Levine
     9  Copyright (c) 2006, 2008 Steven H. Levine
    1010
    1111  22 Jul 06 SHL Check more run time errors
     
    1616***********************************************************************/
    1717
     18#include <stdlib.h>
     19#include <string.h>
     20
    1821#define INCL_DOS
    1922#define INCL_WIN
    2023#define INCL_LONGLONG
    21 #include <os2.h>
    22 
    23 #include <stdlib.h>
    24 #include <stdio.h>
    25 #include <string.h>
    26 
    27 #include "fm3dll.h"
     24
    2825#include "fm3dlg.h"
    2926#include "fm3str.h"
     27#include "pathutil.h"                   // BldFullPathName
     28#include "errutil.h"                    // Dos_Error...
     29#include "strutil.h"                    // GetPString
     30#include "fm3dll.h"
    3031
    3132#pragma data_seg(DATA1)
     
    136137      BldFullPathName(temp, path, objtitle);
    137138      // sprintf(temp,
    138       //              "%s%s%s", (path) ? path : "", (path) ? "\\" : "", objtitle);
     139      //              "%s%s%s", (path) ? path : "", (path) ? "\\" : "", objtitle);
    139140      p = strrchr(temp, '.');
    140141      if (p) {
  • trunk/dll/sortcnr.c

    r897 r907  
    1616***********************************************************************/
    1717
     18#include <string.h>
     19
    1820#define INCL_WIN
    19 #define INCL_LONGLONG
    20 #include <os2.h>
    21 
    22 #include <stdio.h>
    23 #include <stdlib.h>
    24 #include <string.h>
    2521
    2622#include "fm3dll.h"
  • trunk/dll/srchpath.c

    r891 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  22 Apr 07 GKY Add RunFM2Util to find and run apps from the FM2Utilities
     
    1414
    1515***********************************************************************/
     16
     17#include <string.h>
     18
    1619#define INCL_WIN
    17 #define INCL_WINERRORS
    1820#define INCL_DOS
    19 #define INCL_DOSERRORS
    20 #define INCL_LONGLONG
     21#define INCL_LONGLONG                   // dircnrs.h
    2122
    22 #include <os2.h>
    23 #include <stdlib.h>
    24 #include <stdio.h>
    25 #include <string.h>
    26 #include <stdarg.h>
    27 
    28 #include "fm3dll.h"
    2923#include "fm3dlg.h"
    3024#include "fm3str.h"
     25#include "pathutil.h"                   // BldQuotedFileName
     26#include "errutil.h"                    // Dos_Error...
     27#include "fm3dll.h"
    3128
    3229static PSZ pszSrcFile = __FILE__;
  • trunk/dll/strips.c

    r906 r907  
    1616***********************************************************************/
    1717
     18#include <string.h>
     19
    1820#include <os2.h>
    19 #include <stdlib.h>
    20 #include <string.h>
    21 #include <ctype.h>
    2221
    2322VOID chop_at_crnl(PSZ pszSrc)
  • trunk/dll/stristr.c

    r793 r907  
    1313***********************************************************************/
    1414
    15 #define INCL_DOS
    16 
    17 #include <os2.h>
    18 #include <stdlib.h>
    19 #include <stdio.h>
    2015#include <string.h>
    2116#include <ctype.h>
    2217
     18#include <os2.h>
     19
    2320CHAR *stristr(register CHAR * t, CHAR * s)
    2421{
    25 
    2622  /* case-insensitive strstr() */
    2723
     
    4844CHAR *strnistr(register CHAR * t, CHAR * s, LONG len)
    4945{
    50 
    5146  /* case-insensitive strnstr() */
    5247
     
    7469CHAR *strnstr(register CHAR * t, CHAR * s, LONG len)
    7570{
    76 
    7771  /* strnstr() */
    7872
     
    10195                 ULONG lenin, BOOL sensitive)
    10296{
    103 
    10497  register CHAR *this, *in;
    10598  register ULONG lenthis2, lenin2;
  • trunk/dll/strutil.c

    r901 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2006 Steven H. Levine
     9  Copyright (c) 2006, 2008 Steven H. Levine
    1010
    1111  22 Jul 06 SHL Comments
    1212  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
     13  05 Jan 08 SHL Rename from string.c to avoid string.h conflict
    1314
    1415***********************************************************************/
    1516
    16 #define INCL_DOS
    17 #define INCL_WIN
    18 #include <os2.h>
     17#include <stdio.h>
     18#include <share.h>
    1919
    20 #include <stdlib.h>
    21 #include <stdio.h>
    22 #include <string.h>
    23 #include <share.h>
    24 #include <io.h>
    25 
    26 #include "fm3dll.h"
     20#include "strutil.h"
    2721#include "fm3str.h"
    2822#include "version.h"
     23
     24extern PSZ NullStr;                     // 05 Jan 08 SHL fixme to be in some .h
    2925
    3026static char **strs, *str;
  • trunk/dll/subj.c

    r841 r907  
    1717***********************************************************************/
    1818
     19#include <stdlib.h>
     20#include <string.h>
     21#include <ctype.h>
     22
    1923#define INCL_WIN
    2024#define INCL_DOS
    2125#define INCL_DOSERRORS
    2226#define INCL_LONGLONG
    23 #include <os2.h>
    2427
    25 #include <stdlib.h>
    26 #include <stdio.h>
    27 #include <string.h>
    28 #include <ctype.h>
    29 
    30 #include "fm3dll.h"
    3128#include "fm3dlg.h"
    3229#include "fm3str.h"
     30#include "errutil.h"                    // Dos_Error...
     31#include "strutil.h"                    // GetPString
     32#include "fm3dll.h"
    3333
    3434static PSZ pszSrcFile = __FILE__;
  • trunk/dll/sysinfo.c

    r888 r907  
    1818***********************************************************************/
    1919
     20#include <string.h>
     21
    2022#define INCL_DOS
    2123#define INCL_WIN
    22 #include <os2.h>
    23 
    24 #include <stdlib.h>
    25 #include <stdio.h>
    26 #include <string.h>
    27 
     24#define INCL_LONGLONG
     25
     26#include "fm3dlg.h"
    2827#include "fm3dll.h"
    29 #include "fm3dlg.h"
    3028
    3129#pragma data_seg(DATA1)
  • trunk/dll/systemf.c

    r906 r907  
    2121  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
    2222
    23 
    2423***********************************************************************/
    2524
    26 #define INCL_WIN
    27 #define INCL_WINERRORS
    28 #define INCL_DOS
    29 #define INCL_DOSERRORS
    30 #include <os2.h>
    31 
    3225#include <stdlib.h>
    33 #include <stdio.h>
    3426#include <stdarg.h>
    3527#include <string.h>
    3628#include <ctype.h>
    37 #include <time.h>
    38 
    39 #include "fm3dll.h"
     29
     30#define INCL_DOS
     31#define INCL_DOSERRORS
     32#define INCL_WIN
     33#define INCL_LONGLONG                   // dircnrs.h
     34
    4035#include "fm3dlg.h"
    4136#include "fm3str.h"
     37#include "errutil.h"                    // Dos_Error...
     38#include "strutil.h"                    // GetPString
     39#include "pathutil.h"
     40#include "fm3dll.h"
    4241
    4342static PSZ pszSrcFile = __FILE__;
  • trunk/dll/timer.c

    r793 r907  
    1414***********************************************************************/
    1515
     16#include <process.h>                    // _beginthread
     17
    1618#define INCL_DOS
    1719#define INCL_DOSERRORS
    1820#define INCL_WIN
    19 #include <os2.h>
     21#define INCL_LONGLONG                   // dircnrs.h
    2022
    21 #include <stdarg.h>
    22 #include <stdio.h>
    23 #include <stdlib.h>
    24 #include <string.h>
    25 #include <process.h>                    // _beginthread
    26 
     23#include "fm3str.h"
     24#include "errutil.h"                    // Dos_Error...
     25#include "strutil.h"                    // GetPString
    2726#include "fm3dll.h"
    28 #include "fm3str.h"
    2927
    3028static PSZ pszSrcFile = __FILE__;
  • trunk/dll/tools.c

    r888 r907  
    2020***********************************************************************/
    2121
     22#include <stdlib.h>
     23#include <string.h>
     24#include <share.h>
     25
    2226#define INCL_DOS
    2327#define INCL_WIN
    2428#define INCL_LONGLONG
    25 #include <os2.h>
    26 
    27 #include <stdio.h>
    28 #include <stdlib.h>
    29 #include <string.h>
    30 #include <share.h>
    31 
    32 #include "fm3dll.h"
     29
    3330#include "fm3dlg.h"
    3431#include "tools.h"
    3532#include "fm3str.h"
     33#include "errutil.h"                    // Dos_Error...
     34#include "strutil.h"                    // GetPString
     35#include "fm3dll.h"
    3636
    3737#pragma data_seg(DATA1)
  • trunk/dll/treecnr.c

    r906 r907  
     1
    12/***********************************************************************
    23
     
    67
    78  Copyright (c) 1993-98 M. Kimes
    8   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    910
    1011  16 Oct 02 SHL Handle large partitions
     
    4546***********************************************************************/
    4647
    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>
    5648#include <stdlib.h>
    5749#include <string.h>
     
    5951#include <process.h>                    // _beginthread
    6052
    61 #include "fm3dll.h"
     53#define INCL_DOS
     54#define INCL_WIN
     55#define INCL_LONGLONG
     56
    6257#include "fm3dlg.h"
    6358#include "fm3str.h"
    6459#include "mle.h"
     60#include "comp.h"                       // COMPARE
     61#include "filldir.h"                    // RemoveCnrItems...
     62#include "errutil.h"                    // Dos_Error...
     63#include "strutil.h"                    // GetPString
     64#include "fm3dll.h"
    6565
    6666#pragma data_seg(DATA1)
     
    202202    if (~pci->rc.flRecordAttr & CRA_CURSORED) {
    203203      if (collapsefirst) {
    204         // DbgMsg(pszSrcFile, __LINE__, "collapsing");  // 14 Aug 07 SHL fixme
     204        // DbgMsg(pszSrcFile, __LINE__, "collapsing");  // 14 Aug 07 SHL fixme
    205205        pciP = WinSendMsg(hwndCnr,
    206206                          CM_QUERYRECORD,
    207207                          MPVOID, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    208208        while (pciP && (INT) pciP != -1) {
    209 #if 1
     209#if 1 // // 05 Jan 08 SHL fixme to be sure this is correct code
    210210          if (pciP->rc.flRecordAttr & CRA_EXPANDED) {
    211211            // collapse top level of all branches
     
    256256      }
    257257      if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED) {
    258         // DbgMsg(pszSrcFile, __LINE__, "expanding current");   // 14 Aug 07 SHL fixme
     258        // DbgMsg(pszSrcFile, __LINE__, "expanding current");   // 14 Aug 07 SHL fixme
    259259        WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
    260         // DbgMsg(pszSrcFile, __LINE__, "expanded");    // 14 Aug 07 SHL fixme
     260        // DbgMsg(pszSrcFile, __LINE__, "expanded");    // 14 Aug 07 SHL fixme
    261261      }
    262262      if (!quickbail) {
    263         WinSendMsg(hwndCnr,
     263        WinSendMsg(hwndCnr,
    264264                   CM_SETRECORDEMPHASIS,
    265265                   MPFROMP(pciToSelect),
     
    20542054
    20552055            CopyPresParams((HWND) mp2, hwndMainMenu);
    2056             WinEnableMenuItem((HWND) mp2, IDM_INFO, rdy);
     2056            WinEnableMenuItem((HWND) mp2, IDM_INFO, rdy);
    20572057
    20582058            WinEnableMenuItem((HWND) mp2, IDM_ATTRS, writeable);
     
    20922092            WinEnableMenuItem((HWND) mp2, IDM_MOVEMENU, !underenv
    20932093                              && writeable);
    2094             WinEnableMenuItem((HWND) mp2, IDM_RENAME, !underenv && writeable);
     2094            WinEnableMenuItem((HWND) mp2, IDM_RENAME, !underenv && writeable);
    20952095
    20962096          }
     
    21012101        WinCheckMenuItem((HWND) mp2,
    21022102                         IDM_MINIICONS, ((dcd->flWindowAttr & CV_MINI) != 0));
    2103         CopyPresParams((HWND) mp2, hwndMainMenu);
     2103        CopyPresParams((HWND) mp2, hwndMainMenu);
    21042104        WinEnableMenuItem((HWND) mp2, IDM_RESELECT, FALSE);
    2105         break;
     2105        break;
    21062106
    21072107      case IDM_COMMANDSMENU:
    2108         SetupCommandMenu((HWND) mp2, hwnd);
    2109         CopyPresParams((HWND) mp2, hwndMainMenu);
     2108        SetupCommandMenu((HWND) mp2, hwnd);
     2109        CopyPresParams((HWND) mp2, hwndMainMenu);
    21102110        break;
    21112111
    21122112      case IDM_SORTSUBMENU:
    21132113        SetSortChecks((HWND) mp2, TreesortFlags);
    2114         CopyPresParams((HWND) mp2, hwndMainMenu);
    2115         break;
     2114        CopyPresParams((HWND) mp2, hwndMainMenu);
     2115        break;
    21162116
    21172117      case IDM_WINDOWSMENU:
    21182118        SetupWinList((HWND) mp2,
    2119                      (hwndMain) ? hwndMain : (HWND) 0, dcd->hwndFrame);
    2120         CopyPresParams((HWND) mp2, hwndMainMenu);
     2119                     (hwndMain) ? hwndMain : (HWND) 0, dcd->hwndFrame);
     2120        CopyPresParams((HWND) mp2, hwndMainMenu);
    21212121        break;
    21222122      }
     
    24112411
    24122412      case IDM_PARTITION:
    2413         runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
    2414                 NULL, NULL,
     2413        runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
     2414                NULL, NULL,
    24152415                "%s", "MINILVM.EXE");
    24162416        break;
    24172417
    24182418      case IDM_PARTITIONDF:
    2419         runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
    2420                 NULL, NULL,
     2419        runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
     2420                NULL, NULL,
    24212421                "%s", "DFSOS2.EXE");
    24222422        break;
    24232423
    24242424      case IDM_PARTITIONLVMG:
    2425         runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
    2426                 NULL, NULL,
     2425        runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
     2426                NULL, NULL,
    24272427                "%s", "LVMGUI.CMD");
    24282428        break;
    24292429
    24302430      case IDM_PARTITIONFD:
    2431         runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
    2432                 NULL, NULL,
     2431        runemf2(SEPARATE | WINDOWED, HWND_DESKTOP, pszSrcFile, __LINE__,
     2432                NULL, NULL,
    24332433                "%s", "FDISKPM.EXE");
    24342434        break;
  • trunk/dll/undel.c

    r888 r907  
    1717***********************************************************************/
    1818
    19 #define INCL_DOSERRORS
     19#include <stdlib.h>
     20#include <string.h>
     21#include <ctype.h>
     22#include <process.h>                    // _beginthread
     23
    2024#define INCL_DOS
    2125#define INCL_WIN
    2226#define INCL_LONGLONG
    23 #include <os2.h>
    24 
    25 #include <stdlib.h>
    26 #include <stdio.h>
    27 #include <string.h>
    28 #include <time.h>
    29 #include <ctype.h>
    30 #include <process.h>                    // _beginthread
    31 
    32 #include "fm3dll.h"
     27
    3328#include "fm3dlg.h"
    3429#include "fm3str.h"
     30#include "errutil.h"                    // Dos_Error...
     31#include "strutil.h"                    // GetPString
     32#include "fm3dll.h"
    3533
    3634#pragma data_seg(DATA2)
  • trunk/dll/update.c

    r841 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  12 Feb 03 SHL Standardize EA math
     
    2222***********************************************************************/
    2323
     24#include <stdlib.h>
     25#include <string.h>
     26#include <ctype.h>
     27
    2428#define INCL_DOS
    2529#define INCL_WIN
    2630#define INCL_LONGLONG
    27 #include <os2.h>
    28 
    29 #include <stdarg.h>
    30 #include <stdio.h>
    31 #include <stdlib.h>
    32 #include <string.h>
    33 #include <ctype.h>
    34 
     31
     32#include "fm3str.h"
     33#include "errutil.h"                    // Dos_Error...
     34#include "filldir.h"                    // FillInRecordFromFFB
     35#include "dircnrs.h"
    3536#include "fm3dll.h"
    36 #include "fm3str.h"
    3737
    3838static PSZ pszSrcFile = __FILE__;
  • trunk/dll/uudecode.c

    r793 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005, 2007 Steven H. Levine
     9  Copyright (c) 2005, 2008 Steven H. Levine
    1010
    1111  06 Jun 05 SHL Indent -i2
     
    1919***********************************************************************/
    2020
     21#include <stdlib.h>
     22#include <string.h>
     23#include <share.h>
     24
    2125#define INCL_DOS
    2226#define INCL_WIN
    23 #include <os2.h>
    24 
    25 #include <stdlib.h>
    26 #include <stdio.h>
    27 #include <string.h>
    28 #include <share.h>
    29 
    30 #include "fm3dll.h"
     27#define INCL_LONGLONG                   // dircnrs.h
     28
    3129#include "fm3dlg.h"
    3230#include "fm3str.h"
     31#include "makelist.h"                   // AddToList
     32#include "errutil.h"                    // Dos_Error...
     33#include "strutil.h"                    // GetPString
     34#include "fm3dll.h"
    3335
    3436static PSZ pszSrcFile = __FILE__;
     
    325327        BOOL append, binary;
    326328        CHAR **list = NULL, **test, szBuffer[CCHMAXPATH];
    327         INT numfiles = 0, numalloc = 0, error;
     329        UINT numfiles = 0, numalloc = 0;
     330        INT error;
    328331        SHORT x, y;
    329332
  • trunk/dll/valid.c

    r897 r907  
    2929***********************************************************************/
    3030
     31#include <string.h>
     32#include <ctype.h>
     33
    3134#define INCL_DOS
    3235#define INCL_WIN
    33 #define INCL_DOSDEVICES                 // DosDevIOCtl
    3436#define INCL_DOSDEVIOCTL                // DosDevIOCtl
    3537#define INCL_LONGLONG
    36 #include <os2.h>
    37 
    38 #include <stdlib.h>
    39 #include <stdio.h>
    40 #include <string.h>
    41 #include <ctype.h>
    42 
     38
     39#include "fm3str.h"
     40#include "errutil.h"                    // Dos_Error...
     41#include "strutil.h"                    // GetPString
    4342#include "fm3dll.h"
    44 #include "fm3str.h"
    4543
    4644static PSZ pszSrcFile = __FILE__;
  • trunk/dll/version.h

    r870 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  11 Jun 02 SHL Add CheckVersion VERREALMINOR
     
    4646  31 Aug 07 GKY v3.07: Release modified ini structure
    4747  11 Nov 07 GKY v3.08 Release large file support
     48  12 Nov 07 SHL v3.09pre (shl)
    4849
    4950***********************************************************************/
    5051
    5152#define VERMAJOR       3
    52 #define VERMINOR       8
     53#define VERMINOR       9
    5354// Ensure VERREALMINOR nul for non-beta releases
    5455// #define VERREALMINOR   ""
    55 #define VERREALMINOR   " "__DATE__
    56 //#define VERREALMINOR   "beta01 " __DATE__ " " __TIME__
     56// #define VERREALMINOR   " "__DATE__
     57#define VERREALMINOR   "pre (shl) " __DATE__ " " __TIME__
    5758
    5859#define APPNAME         "FM2"
  • trunk/dll/viewer.c

    r892 r907  
    1919***********************************************************************/
    2020
     21#include <stdlib.h>
     22#include <string.h>
     23#include <io.h>
     24
    2125#define INCL_DOS
    2226#define INCL_WIN
    2327#define INCL_LONGLONG
    24 #include <os2.h>
    25 
    26 #include <stdlib.h>
    27 #include <stdio.h>
    28 #include <string.h>
    29 #include <time.h>
    30 #include <io.h>
    31 
    32 #include "fm3dll.h"
     28
    3329#include "fm3dlg.h"
    3430#include "fm3str.h"
    3531#include "mle.h"
     32#include "errutil.h"                    // Dos_Error...
     33#include "strutil.h"                    // GetPString
     34#include "fm3dll.h"
    3635
    3736#pragma data_seg(DATA1)
  • trunk/dll/viewinf.c

    r888 r907  
    1919/* offset 107:  title of INF file */
    2020
     21#include <stdlib.h>
     22#include <string.h>
     23#include <share.h>
     24#include <process.h>                    // _beginthread
     25
    2126#define INCL_DOS
    2227#define INCL_WIN
    2328#define INCL_LONGLONG
    24 #include <os2.h>
    25 
    26 #include <stdio.h>
    27 #include <stdlib.h>
    28 #include <string.h>
    29 #include <ctype.h>
    30 #include <share.h>
    31 #include <process.h>                    // _beginthread
    32 
    33 #include "fm3dll.h"
     29
    3430#include "fm3dlg.h"
    3531#include "fm3str.h"
     32#include "errutil.h"                    // Dos_Error...
     33#include "strutil.h"                    // GetPString
     34#include "fm3dll.h"
    3635
    3736#pragma data_seg(DATA1)
  • trunk/dll/walkem.c

    r865 r907  
    2626***********************************************************************/
    2727
     28#include <stdlib.h>
     29#include <string.h>
     30#include <ctype.h>
     31#include <share.h>
     32
    2833#define INCL_WIN
    2934#define INCL_DOS
     
    3136#define INCL_SHLERRORS                  // PMERR_NOT_IN_IDX
    3237#define INCL_LONGLONG
    33 #include <os2.h>
    34 
    35 #include <stdlib.h>
    36 #include <stdio.h>
    37 #include <string.h>
    38 #include <ctype.h>
    39 #include <time.h>
    40 #include <share.h>
    41 
    42 #include "fm3dll.h"
     38
    4339#include "fm3dlg.h"
    4440#include "fm3str.h"
     41#include "errutil.h"                    // Dos_Error...
     42#include "strutil.h"                    // GetPString
     43#include "fm3dll.h"
    4544
    4645#pragma data_seg(DATA1)
     
    6968static LINKDIRS *pFirstSetup;
    7069static const PSZ pszLastSetups = "LastSetups";
    71 // // 18 Aug 07 SHL fixme to stop supporting old style 1 year from now?
     70// 18 Aug 07 SHL fixme to stop supporting old style 1 year from now?
    7271static const ULONG ulOldSetupsBytes = 100 * 13; // Prior to 3.0.7
    7372
  • trunk/dll/winlist.c

    r794 r907  
    1515***********************************************************************/
    1616
     17#include <stdlib.h>
     18#include <string.h>
     19
    1720#define INCL_DOS
    1821#define INCL_WIN
    19 #include <os2.h>
    20 
    21 #include <stdarg.h>
    22 #include <stdio.h>
    23 #include <stdlib.h>
    24 #include <string.h>
    25 #include <ctype.h>
    26 
     22
     23#include "fm3dlg.h"
    2724#include "fm3dll.h"
    28 #include "fm3dlg.h"
    2925
    3026#pragma data_seg(DATA1)
  • trunk/dll/worker.c

    r888 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  16 Oct 02 SHL Comments
     
    2727***********************************************************************/
    2828
    29 #define INCL_DOS
    30 #define INCL_WIN
    31 #define INCL_DOSERRORS
    32 #define INCL_WPCLASS                    // WinQueryObjectPath
    33 #define INCL_LONGLONG
    34 #include <os2.h>
    35 
    36 #include <stdarg.h>
    37 #include <stdio.h>
    3829#include <stdlib.h>
    3930#include <string.h>
    4031#include <ctype.h>
    41 #include <stddef.h>
    4232#include <share.h>
    43 #include <time.h>
    4433#include <process.h>                    // _beginthread
    4534
    46 #include "fm3dll.h"
     35#define INCL_DOS
     36#define INCL_DOSERRORS
     37#define INCL_WINPROGRAMLIST
     38#define INCL_WINHELP
     39#define INCL_LONGLONG
     40#define INCL_WINPOINTERS
     41
    4742#include "fm3dlg.h"
    4843#include "fm3str.h"
     44#include "comp.h"                       // FCOMPARE
     45#include "pathutil.h"                   // BldQuotedFileName
     46#include "makelist.h"                   // AddToList
     47#include "errutil.h"                    // Dos_Error...
     48#include "strutil.h"                    // GetPString
     49#include "fm3dll.h"
    4950
    5051#pragma data_seg(DATA2)
    5152
    5253static PSZ pszSrcFile = __FILE__;
    53 
    5454
    5555#ifdef UNDO
     
    116116  HMQ hmq2;
    117117  CHAR **files = NULL;
    118   INT numfiles = 0, numalloc = 0, plen = 0;
     118  UINT numfiles = 0, numalloc = 0;
     119  INT plen = 0;
    119120  CHAR *p, *pp;
    120121  CHAR szQuotedDirName[CCHMAXPATH];
     
    462463                                   FM3ModHandle, FLE_FRAME, (PVOID) list)) {
    463464                      goto Abort;
    464                     }
     465                    }
    465466                  }
    466467                  else {
     
    857858                  else {
    858859                    runemf2(SEPARATE,
    859                             HWND_DESKTOP, pszSrcFile, __LINE__,
    860                             NULL, NULL,
     860                            HWND_DESKTOP, pszSrcFile, __LINE__,
     861                            NULL, NULL,
    861862                            "%s %s %s",
    862863                            dircompare,
     
    873874                  ExecOnList(wk->hwndFrame,
    874875                             compare,
    875                              WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
    876                              pszSrcFile, __LINE__);
     876                             WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
     877                             pszSrcFile, __LINE__);
    877878                }
    878879                else {
     
    972973  CHAR **files = NULL;
    973974  register CHAR *p, *pp;
    974   INT numfiles = 0, numalloc = 0;
     975  UINT numfiles = 0, numalloc = 0;
    975976
    976977  if (wk) {
     
    10191020                       "%a",
    10201021                       WINDOWED | SEPARATE | PROMPT,
    1021                        NULL, wk->li->list, GetPString(IDS_DOITYOURSELFTEXT),
    1022                        pszSrcFile, __LINE__);
     1022                       NULL, wk->li->list, GetPString(IDS_DOITYOURSELFTEXT),
     1023                       pszSrcFile, __LINE__);
    10231024            break;
    10241025
     
    10261027            {
    10271028              register INT x;
    1028               register ULONG total;
    1029               CHAR fbuf[CCHMAXPATH];
    1030 
    1031               if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
    1032                                 SEARCH_CUR_DIRECTORY,
    1033                                 "PATH", "FM2PLAY.EXE", fbuf, CCHMAXPATH - 1))
    1034                 total += strlen("..\\FM2UTILS\\FM2PLAY.EXE ");
    1035               else
    1036                 total = strlen(fbuf);
     1029              register ULONG total;
     1030              CHAR fbuf[CCHMAXPATH];
     1031
     1032              if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
     1033                                SEARCH_CUR_DIRECTORY,
     1034                                "PATH", "FM2PLAY.EXE", fbuf, CCHMAXPATH - 1))
     1035                total += strlen("..\\FM2UTILS\\FM2PLAY.EXE ");
     1036              else
     1037                total = strlen(fbuf);
    10371038              for (x = 0; wk->li->list[x]; x++)
    10381039                total += (strlen(wk->li->list[x]) + 1 +
     
    10481049                    fprintf(fp, "%s\n", wk->li->list[x]);
    10491050                  fprintf(fp, ";end\n");
    1050                   fclose(fp);
    1051                   RunFM2Util("FM2PLAY.EXE", "/#$FM2PLAY.$$$");
     1051                  fclose(fp);
     1052                  RunFM2Util("FM2PLAY.EXE", "/#$FM2PLAY.$$$");
    10521053                  break;
    10531054                }
     
    10611062                 wk->li->info->extract && *wk->li->targetpath)) {
    10621063
    1063               CHAR szBuffer[1025];
    1064               CHAR fbuf[CCHMAXPATH];
     1064              CHAR szBuffer[1025];
     1065              CHAR fbuf[CCHMAXPATH];
    10651066              register INT x;
    10661067
     
    10741075              }
    10751076              else {
    1076                 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
    1077                                   SEARCH_CUR_DIRECTORY,
    1078                                   "PATH", "FM2PLAY.EXE", fbuf, CCHMAXPATH - 1))
     1077                if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
     1078                                  SEARCH_CUR_DIRECTORY,
     1079                                  "PATH", "FM2PLAY.EXE", fbuf, CCHMAXPATH - 1))
    10791080                  strcpy(szBuffer, "UTILS\\FM2PLAY.EXE");
    10801081                else
     
    12681269              ExecOnList((HWND) 0,
    12691270                         binview,
    1270                         WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
    1271                         pszSrcFile, __LINE__);
     1271                        WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
     1272                        pszSrcFile, __LINE__);
    12721273              break;
    12731274            }
     
    12791280                         WINDOWED | SEPARATE |
    12801281                         ((fViewChild) ? CHILD : 0),
    1281                         NULL, wk->li->list, NULL,
    1282                         pszSrcFile, __LINE__);
     1282                        NULL, wk->li->list, NULL,
     1283                        pszSrcFile, __LINE__);
    12831284            else {
    12841285
     
    13141315              ExecOnList((HWND) 0,
    13151316                         bined,
    1316                         WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
    1317                         pszSrcFile, __LINE__);
     1317                        WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
     1318                        pszSrcFile, __LINE__);
    13181319              break;
    13191320            }
     
    13241325              ExecOnList((HWND) 0,
    13251326                         editor,
    1326                         WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
    1327                         pszSrcFile, __LINE__);
     1327                        WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
     1328                        pszSrcFile, __LINE__);
    13281329            else {
    13291330
  • trunk/dll/wrappers.c

    r850 r907  
    1717***********************************************************************/
    1818
     19#include <stdio.h>
     20#include <stdlib.h>
     21#include <string.h>
     22
    1923#define INCL_WIN
    2024#define INCL_DOS
     
    2327#include <os2.h>
    2428
    25 #include <stdio.h>
    26 #include <stdlib.h>
    27 #include <string.h>
    28 
    2929#include "fm3dll.h"
    3030#include "fm3str.h"
     31#include "errutil.h"                    // Dos_Error...
     32#include "strutil.h"                    // GetPString
    3133
    3234static PSZ pszSrcFile = __FILE__;
  • trunk/eas.c

    r754 r907  
    1616***********************************************************************/
    1717
    18 #include <stdarg.h>
    19 #include <stdio.h>
    2018#include <stdlib.h>
    2119#include <string.h>
    22 #include <ctype.h>
    2320
    2421#define INCL_DOS
    2522#define INCL_WIN
    26 #include <os2.h>
    2723
     24#include "dll\fm3dlg.h"
     25#include "dll\makelist.h"
    2826#include "dll\fm3dll.h"
    29 #include "dll\fm3dlg.h"
    3027
    3128int main (int argc,char *argv[])
     
    3532  CHAR fullname[CCHMAXPATH];
    3633  CHAR **list = NULL;
    37   INT x,numfiles = 0,numalloc = 0;
     34  UINT x,numfiles = 0,numalloc = 0;
    3835
    3936  DosError(FERR_DISABLEHARDERR);
  • trunk/fm3.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  fm/2 starter
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <string.h>
     16
    117#define INCL_DOS
    218#define INCL_WIN
     19#define INCL_LONGLONG
    320
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
    10 #include <direct.h>
    11 #include "dll\fm3dll.h"
    1221#include "dll\tools.h"
    1322#include "dll\version.h"
     23#include "dll\fm3dll.h"
    1424
    1525int main(int argc, char *argv[])
    1626{
    17 
    1827  HAB hab;
    1928  HMQ hmq;
  • trunk/fm4.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  fm/2 lite applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <string.h>
     16
    117#define INCL_DOS
    218#define INCL_WIN
     19#define INCL_LONGLONG
    320
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
    10 #include <direct.h>
    11 #include "dll\fm3dll.h"
    1221#include "dll\tools.h"
    1322#include "dll\version.h"
     23#include "dll\fm3dll.h"
    1424
    1525int main(int argc, char *argv[])
    1626{
    17 
    1827  HAB hab;
    1928  HMQ hmq;
  • trunk/global.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  See all files applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <string.h>
     16
    117#define INCL_DOS
    218#define INCL_WIN
    319
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
    1020#include "dll\fm3dll.h"
    1121#include "dll\fm3str.h"
     
    1323int main(int argc, char *argv[])
    1424{
    15 
    1625  HAB hab;
    1726  HMQ hmq;
  • trunk/ini.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Ini view/edit applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
    317
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
    1018#include "dll\fm3dll.h"
    1119
    1220int main(int argc, char *argv[])
    1321{
    14 
    1522  HAB hab;
    1623  HMQ hmq;
  • trunk/killproc.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Process killer applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
    317
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
     18#include "dll\fm3dlg.h"
    1019#include "dll\fm3dll.h"
    11 #include "dll\fm3dlg.h"
    1220
    1321int main(int argc, char *argv[])
    1422{
    15 
    1623  HAB hab;
    1724  HMQ hmq;
  • trunk/makefile_pre.mk

    r903 r907  
    5656# -wcd14        no reference to symbol
    5757# -wcd726       no reference to formal parameter
     58# -we           treat warnings as errors
    5859# -wx           max warnings
    5960# -zfp          disable fs use
     
    6364
    6465# We always compile with debug info to avoid needed a full rebuild just to debug
    65 CFLAGS = -bt=os2 -mf -bm -d2 -olirs   -s -j -wx -zfp -zgp -zp4 -zq -hd
     66CFLAGS = -bt=os2 -mf -bm -d2 -olirs   -s -j -we -wx -zfp -zgp -zp4 -zq -hd
    6667
    6768LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map
  • trunk/sysinfo.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  System information applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
    317
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
     18#include "dll\fm3dlg.h"
    1019#include "dll\fm3dll.h"
    11 #include "dll\fm3dlg.h"
    1220
    1321int main(int argc, char *argv[])
    1422{
    15 
    1623  HAB hab;
    1724  HMQ hmq;
  • trunk/undel.c

    r862 r907  
    1414***********************************************************************/
    1515
    16 #include <stdarg.h>
    17 #include <stdio.h>
    18 #include <stdlib.h>
    1916#include <string.h>
    20 #include <ctype.h>
    2117
    2218#define INCL_DOS
    23 #define INCL_WIN
    24 #include <os2.h>
    2519
     20#include "dll\fm3dlg.h"
    2621#include "dll\fm3dll.h"
    27 #include "dll\fm3dlg.h"
    2822
    2923int main(int argc, char *argv[])
  • trunk/vcollect.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Collector applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2007, 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <string.h>
     16
    117#define INCL_DOS
    218#define INCL_WIN
    319
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
     20#include "dll\fm3str.h"
    1021#include "dll\fm3dll.h"
    11 #include "dll\fm3str.h"
    1222
    1323int main(int argc, char *argv[])
    1424{
    15 
    1625  HAB hab;
    1726  HMQ hmq;
  • trunk/vdir.c

    r551 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  INF directory viewer applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2007, 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <string.h>
     16
    117#define INCL_DOS
    218#define INCL_WIN
    319
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
    1020#include "dll\fm3dll.h"
    1121
    1222int main(int argc, char *argv[])
    1323{
    14 
    1524  HAB hab;
    1625  HMQ hmq;
  • trunk/viewinfs.c

    r753 r907  
    1313***********************************************************************/
    1414
    15 #include <stdarg.h>
    16 #include <stdio.h>
    17 #include <stdlib.h>
    18 #include <string.h>
    19 #include <ctype.h>
    20 
    2115#define INCL_DOS                        // DosSleep
    2216#define INCL_WIN
    23 #include <os2.h>
    2417
     18#include "dll\fm3dlg.h"
    2519#include "dll\fm3dll.h"
    26 #include "dll\fm3dlg.h"
    2720
    2821int main(int argc, char *argv[])
  • trunk/vtree.c

    r766 r907  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Tree viewer applet
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2008 Steven H.Levine
     10
     11  05 Jan 08 SHL Sync
     12
     13***********************************************************************/
     14
     15#include <stdlib.h>
     16#include <string.h>
     17
    118#define INCL_DOS
    219#define INCL_WIN
    320
    4 #include <os2.h>
    5 #include <stdarg.h>
    6 #include <stdio.h>
    7 #include <stdlib.h>
    8 #include <string.h>
    9 #include <ctype.h>
    1021#include "dll\fm3dll.h"
    1122
    1223int main(int argc, char *argv[])
    1324{
    14 
    1525  HAB hab;
    1626  HMQ hmq;
Note: See TracChangeset for help on using the changeset viewer.