home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / fsrc1241.zip / areascan.c < prev    next >
C/C++ Source or Header  |  1999-02-14  |  4KB  |  117 lines

  1. /*---------------------------------------------------------------------------+
  2.  | Titel: AREASCAN.C                                                         |
  3.  +-----------------------------------------+---------------------------------+
  4.  | Erstellt von: Michael Hohner            | Am: 21.06.1995                  |
  5.  +-----------------------------------------+---------------------------------+
  6.  | System: OS/2 2.x/3.x                                                      |
  7.  +---------------------------------------------------------------------------+
  8.  | Beschreibung:                                                             |
  9.  |                                                                           |
  10.  |     Area-Scan von FleetStreet                                             |
  11.  |                                                                           |
  12.  |                                                                           |
  13.  +---------------------------------------------------------------------------+
  14.  | Bemerkungen:                                                              |
  15.  +---------------------------------------------------------------------------*/
  16.  
  17. /*----------------------------- Header-Dateien ------------------------------*/
  18. #pragma strings(readonly)
  19.  
  20. #define INCL_WIN
  21. #define INCL_BASE
  22. #include <os2.h>
  23. #include <stdio.h>
  24. #include <string.h>
  25. #include <fcntl.h>
  26. #include <io.h>
  27. #include <sys\stat.h>
  28. #include <share.h>
  29.  
  30. #include "main.h"
  31. #include "messages.h"
  32. #include "structs.h"
  33. #include "msgheader.h"
  34. #include "areaman\areaman.h"
  35. #include "handlemsg\handlemsg.h"
  36. #include "dump\expt.h"
  37.  
  38. #include "areascan.h"
  39.  
  40. /*--------------------------------- Defines ---------------------------------*/
  41.  
  42. /*---------------------------------- Typen ----------------------------------*/
  43.  
  44. /*---------------------------- Globale Variablen ----------------------------*/
  45.  
  46. /*--------------------------- Funktionsprototypen ---------------------------*/
  47.  
  48. /*----------------------- interne Funktionsprototypen -----------------------*/
  49.  
  50. /*-----------------------------------------------------------------------------
  51.  | Funktionsname: ScanAreas
  52.  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  53.  | Beschreibung: Thread-Funktion, scannt die Areas, die mit dem SCAN-Flag
  54.  |               markiert sind.
  55.  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  56.  | Parameter: scanlist: Anfang der Area-Liste
  57.  |
  58.  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  59.  | Rückgabewerte: -
  60.  |
  61.  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  62.  | Sonstiges:
  63.  |
  64.  +---------------------------------------------------------------------------*/
  65.  
  66. void _Optlink ScanAreas(void *scanlist)
  67. {
  68.    AREADEFLIST *zeiger;
  69.    extern BOOL DoingAreaScan;
  70.    extern BOOL StopAreaScan;
  71.    extern HWND client;
  72.    extern MISCOPTIONS miscoptions;
  73.    extern char CurrentArea[LEN_AREATAG+1];
  74.  
  75.    INSTALLEXPT("Areascan");
  76.  
  77.    /* Flag setzen */
  78.    DoingAreaScan=TRUE;
  79.    StopAreaScan=FALSE;
  80.  
  81.    zeiger=((PAREALIST)scanlist)->pFirstArea;
  82.    while (zeiger)
  83.    {
  84.       if (zeiger->flWork & WORK_SCAN)
  85.       {
  86.          if (stricmp(zeiger->areadata.areatag, CurrentArea) &&
  87.              !zeiger->bLocked)
  88.          {
  89.             extern DRIVEREMAP driveremap;
  90.  
  91.             /* Meldung in Statuszeile */
  92.             WinPostMsg(client, SM_AREASCANNED, MPFROMP(zeiger->areadata.areatag), NULL);
  93.  
  94.             if (!MSG_OpenArea(scanlist, zeiger->areadata.areatag, miscoptions.lastreadoffset, &driveremap))
  95.                MSG_CloseArea(scanlist, zeiger->areadata.areatag, FALSE, miscoptions.lastreadoffset, &driveremap);
  96.          }
  97.          zeiger->flWork &= ~WORK_SCAN;
  98.       }
  99.       zeiger=zeiger->next;
  100.       if (StopAreaScan)
  101.          break;
  102.    }
  103.    /* Ende-Meldung */
  104.    while (!WinPostMsg(client, SM_SCANENDED, NULL, NULL))
  105.       DosSleep(500);
  106.  
  107.    /* Flag wegnehmen */
  108.    DoingAreaScan=FALSE;
  109.  
  110.    DEINSTALLEXPT;
  111.  
  112.    return;
  113. }
  114.  
  115. /*-------------------------------- Modulende --------------------------------*/
  116.  
  117.