Changeset 1075

Show
Ignore:
Timestamp:
07/18/08 06:44:01 (3 months ago)
Author:
gyoung
Message:

Debulked TMP code; Added comments;

Location:
trunk/dll
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1073 r1075  
    18591859                CHAR szTempFile[CCHMAXPATH]; 
    18601860 
    1861                 if (fUseTmp) 
    1862                   BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 
    1863                 else 
    1864                   strcpy(szTempFile, "$FM2PLAY.$$$"); 
    1865  
     1861                BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 
    18661862                fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__); 
    18671863                if (fp) { 
  • trunk/dll/filldir.c

    r1069 r1075  
    4242  29 Feb 08 GKY Use xfree where appropriate 
    4343  07 Jul 08 SHL Use NULL rather than NullStr in FreeCnrItemData 
     44  16 JUL 08 GKY Use TMP directory for temp files 
    4445 
    4546***********************************************************************/ 
  • trunk/dll/fm3dll.h

    r1069 r1075  
    8383                all the details view settings (both the global variables and those in the 
    8484                DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 
     85  16 JUL 08 GKY Use TMP directory for temp files 
    8586 
    8687***********************************************************************/ 
  • trunk/dll/init.c

    r1074 r1075  
    4949                all the details view settings (both the global variables and those in the 
    5050                DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 
     51  16 JUL 08 GKY Use TMP directory for temp files 
    5152  17 Jul 08 SHL Reduce code bulk in fUseTmp setup 
    5253 
     
    455456  /* cleanup */ 
    456457  static CHAR s[CCHMAXPATH]; 
    457   CHAR *enddir; 
     458  CHAR *enddir, szTempFile[CCHMAXPATH]; 
    458459  HDIR search_handle; 
    459460  ULONG num_matches; 
     
    538539    DosFindClose(search_handle); 
    539540  } 
    540   if (fUseTmp) { 
    541     CHAR szTempFile[CCHMAXPATH]; 
    542  
    543     BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 
    544     DosForceDelete(szTempFile); 
    545   } 
    546   else 
    547     DosForceDelete("$FM2PLAY.$$$"); 
    548  
     541  BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 
     542  DosForceDelete(szTempFile); 
    549543  EndNote(); 
    550544  if (FM3ModHandle) 
     
    666660      if (fs3.attrFile & FILE_DIRECTORY) { 
    667661        // 17 Jul 08 SHL fixme to check writable someday 
    668         BldFullPathName(ArcTempRoot, env, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$"); 
    669662        pTmpDir = xstrdup(env, pszSrcFile, __LINE__); 
    670663        fUseTmp = TRUE; 
     
    672665    } 
    673666  } 
    674   if (!fUseTmp) { 
    675     if (!fAmAV2) 
    676       strcpy(ArcTempRoot, "$FM$ARC$"); 
    677     else 
    678       strcpy(ArcTempRoot, "$AV$ARC$"); 
    679   } 
     667  BldFullPathName(ArcTempRoot, env, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$"); 
    680668 
    681669  /* initialize random number generator */ 
  • trunk/dll/killproc.c

    r1073 r1075  
    1818  02 Sep 07 GKY Replaced DosQProcStatus with DosQuerySysState to fix trap in thunk code 
    1919  02 Sep 07 SHL Expand FillKillListThread2 stack to avoid exception in __TNK 
     20  16 JUL 08 GKY Use TMP directory for temp files 
    2021 
    2122***********************************************************************/ 
     
    237238 
    238239  WinSendDlgItemMsg(hwnd, KILL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID); 
    239   if (fUseTmp) 
    240     BldFullPathName(s, pTmpDir, "$PSTAT#$.#$#"); 
    241   else 
    242     strcpy(s, "$PSTAT#$.#$#"); 
     240  BldFullPathName(s, pTmpDir, "$PSTAT#$.#$#"); 
    243241  unlinkf("%s", s); 
    244242  fp = fopen(s, "w"); 
     
    307305  } 
    308306Abort: 
    309   if (fUseTmp) { 
    310     CHAR szTempFile[CCHMAXPATH]; 
    311  
    312     BldFullPathName(szTempFile, pTmpDir, "$PSTAT#$.#$#"); 
    313     DosForceDelete(szTempFile); 
    314   } 
    315   else 
    316     DosForceDelete("$PSTAT#$.#$#"); 
     307  BldFullPathName(s, pTmpDir, "$PSTAT#$.#$#"); 
     308  DosForceDelete(s); 
    317309  PostMsg(hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID); 
    318310  WinDestroyMsgQueue(thmq); 
  • trunk/dll/sysinfo.c

    r1073 r1075  
    1515  29 Jul 06 SHL Use xfgets 
    1616  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 
     17  16 JUL 08 GKY Use TMP directory for temp files 
    1718 
    1819***********************************************************************/ 
     
    4950    if (!WinIsWindow(thab, hwnd)) 
    5051      goto Abort; 
    51     if (fUseTmp) 
    52       BldFullPathName(szTempFile, pTmpDir, "$RMVIEW.#$#"); 
    53     else 
    54       strcpy(szTempFile, "$RMVIEW.#$#"); 
     52    BldFullPathName(szTempFile, pTmpDir, "$RMVIEW.#$#"); 
    5553    unlinkf("%s", szTempFile); 
    5654    fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__); 
  • trunk/dll/undel.c

    r1073 r1075  
    1515  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 
    1616  29 Feb 08 GKY Use xfree where appropriate 
     17  16 JUL 08 GKY Use TMP directory for temp files 
    1718 
    1819***********************************************************************/ 
     
    7374    IncrThreadUsage(); 
    7475    WinSendDlgItemMsg(hwnd, UNDEL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID); 
    75     if (fUseTmp) 
    76       BldFullPathName(szTempFile, pTmpDir, "$UDELETE.#$#"); 
    77     else 
    78       strcpy(szTempFile, "$UDELETE.#$#"); 
     76    BldFullPathName(szTempFile, pTmpDir, "$UDELETE.#$#"); 
    7977    unlinkf("%s", szTempFile); 
    8078    fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__); 
  • trunk/dll/worker.c

    r1069 r1075  
    10691069 
    10701070                FILE *fp; 
    1071                 CHAR TempFile[CCHMAXPATH]; 
    1072  
    1073                 if (fUseTmp) 
    1074                   BldFullPathName(TempFile, pTmpDir, "$FM2PLAY.$$$"); 
    1075                 else 
    1076                   strcpy(TempFile, "$FM2PLAY.$$$"); 
    1077  
    1078                 fp = xfopen(TempFile, "w", pszSrcFile, __LINE__); 
     1071                CHAR szTempFile[CCHMAXPATH]; 
     1072 
     1073                BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 
     1074                fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__); 
    10791075                if (fp) { 
    10801076                  fprintf(fp, "%s", ";AV/2-built FM2Play listfile\n"); 
     
    10831079                  fprintf(fp, ";end\n"); 
    10841080                  fclose(fp); 
    1085                   strrev(TempFile); 
    1086                   strcat(TempFile, "@/"); 
    1087                   strrev(TempFile); 
    1088                   RunFM2Util("FM2PLAY.EXE", TempFile); 
    1089                 } 
    1090                 /*FILE *fp; 
    1091  
    1092                 fp = xfopen("$FM2PLAY.$$$", "w", pszSrcFile, __LINE__); 
    1093                 if (fp) { 
    1094                   fprintf(fp, "%s", ";FM/2-built FM2Play listfile\n"); 
    1095                   for (x = 0; wk->li->list[x]; x++) 
    1096                     fprintf(fp, "%s\n", wk->li->list[x]); 
    1097                   fprintf(fp, ";end\n"); 
    1098                   fclose(fp); 
    1099                   RunFM2Util("FM2PLAY.EXE", "/#$FM2PLAY.$$$"); 
    1100                   break; 
    1101                 }*/ 
     1081                  strrev(szTempFile); 
     1082                  strcat(szTempFile, "@/"); 
     1083                  strrev(szTempFile); 
     1084                  RunFM2Util("FM2PLAY.EXE", szTempFile); 
     1085                } 
    11021086              } 
    11031087            }