home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 April / enter-2004-04.iso / files / httrack-3.30.exe / {app} / src_win / WinHTTrack / Shell.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-05-30  |  5.5 KB  |  221 lines

  1. // Shell.h : main header file for the SHELL application
  2. //
  3.  
  4. #if !defined(AFX_SHELL_H__ED81E637_E017_11D1_A97E_006097BC6150__INCLUDED_)
  5. #define AFX_SHELL_H__ED81E637_E017_11D1_A97E_006097BC6150__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #ifndef __AFXWIN_H__
  10.     #error include 'stdafx.h' before including this file for PCH
  11. #endif
  12.  
  13. /* basic HTTrack defs */
  14. extern "C" {
  15.   #include "htsglobal.h"
  16.   #include "htsopt.h"
  17. }
  18.  
  19. //
  20. // connectΘ via HTTrack? (dΘfini dans projet)
  21. #define USE_RAS 1
  22. //
  23.  
  24. // sleep (taux de refresh) en ms
  25. #define HTS_SLEEP_WIN 100
  26.  
  27. #include "resource.h"       // main symbols
  28. #include "cpp_lang.h"
  29. // Ras
  30. #if USE_RAS
  31. #include "RasLoad.h"
  32. #endif
  33. #include "MainTab.h"
  34.  
  35. // helper launcher
  36. #include "LaunchHelp.h"
  37.  
  38. // lang.h
  39. #include "newlang.h"
  40.  
  41. // message requests
  42. #define wm_ViewRestart (WM_USER + 100)
  43. // test 
  44. #define wm_WizRequest1 (WM_USER + 101)
  45. #define wm_WizRequest2 (WM_USER + 102)
  46. #define wm_WizRequest3 (WM_USER + 103)
  47.  
  48. // char[] dynamiques
  49. #define dynstrcpy(dest,src) { \
  50.   if (dest) free(dest);\
  51.   dest=(char*) malloc(strlen(src)+1);\
  52.   if (dest)\
  53.     strcpy(dest,src);\
  54.   }
  55. #define dynclear(dest) { if (dest) { free(dest); dest=NULL; }}
  56.  
  57. typedef struct {
  58.   char nom[HTS_URLMAXSIZE*2];
  59.   char fichier[HTS_URLMAXSIZE];
  60.   char etat[256];
  61.   char url_sav[HTS_URLMAXSIZE*2];    // pour cancel
  62.   char url_adr[HTS_URLMAXSIZE*2];
  63.   char url_fil[HTS_URLMAXSIZE*2];
  64.   LLint size;
  65.   LLint sizetot;
  66.   int offset;
  67.   //
  68.   int back;
  69.   //
  70.   int actived;    // pour disabled
  71. } t_StatsBuffer;
  72.  
  73. typedef struct {
  74.   int ask_refresh;
  75.   int refresh;
  76.   LLint stat_bytes;
  77.   int stat_time;
  78.   int lien_n;
  79.   int lien_tot;
  80.   int stat_nsocket;
  81.   int rate;
  82.   int irate;
  83.   int ft;
  84.   LLint stat_written;
  85.   int stat_updated;
  86.   int stat_errors;
  87.   int stat_warnings;
  88.   int stat_infos;
  89.   TStamp stat_timestart;
  90.   int stat_back;
  91. } InpInfo;
  92.  
  93.  
  94. /* WinHTTrack mutex */
  95. extern HANDLE WhttMutex;
  96. #define WHTT_LOCK() WaitForSingleObject(WhttMutex,INFINITE)
  97. #define WHTT_UNLOCK() ReleaseMutex(WhttMutex)
  98.  
  99. /* Location */
  100. extern char* WhttLocation;
  101. #define WHTT_LOCATION(a) WhttLocation=(a)
  102.  
  103. // fonctions moteur
  104. int   __cdecl httrackengine_check(char* adr,char* fil,int status);
  105. void  __cdecl httrackengine_init();
  106. void  __cdecl httrackengine_uninit();
  107. int   __cdecl httrackengine_start(void* dummy);
  108. int   __cdecl httrackengine_end();
  109. int   __cdecl httrackengine_htmlcheck(char* html,int len,char* url_adresse,char* url_fichier);
  110. int   __cdecl httrackengine_chopt(void* opt);
  111. int   __cdecl httrackengine_loop(void* _back,int back_max,int back_index,int lien_n,int lien_tot,int stat_time,hts_stat_struct* stats);
  112. char* __cdecl httrackengine_query(char* question);
  113. char* __cdecl httrackengine_query2(char* question);
  114. char* __cdecl httrackengine_query3(char* question);
  115. void  __cdecl httrackengine_pause(char* lockfile);
  116.  
  117.  
  118. // profile
  119. int Save_current_profile(int ask);
  120. //
  121. int MyGetProfileInt(CString path,CString dummy,CString name,int value);
  122. int MyGetProfileIntFile(FILE* fp,CString dummy,CString name,int value);
  123. int MyWriteProfileString(CString path,CString dummy,CString name,CString value);
  124. int MyWriteProfileStringFile(FILE* fp,CString dummy,CString name,CString value);
  125. CString MyGetProfileStringFile(FILE* fp,CString dummy,CString name,CString value);
  126. CString MyGetProfileString(CString path,CString dummy,CString name,CString value="");
  127. void Write_profile(CString path,int load_path);
  128. void Read_profile(CString path,int load_path);
  129. int MyWriteProfileInt(CString path,CString dummy,CString name,int value);
  130. int MyWriteProfileIntFile(FILE* fp,CString dummy,CString name,int value);
  131.  
  132. void Build_TopIndex(BOOL check_empty=TRUE);
  133.  
  134. void InitRAS();
  135.  
  136. // Gestion rΘpertoires
  137. int CheckDirInfo(CString path);
  138. BOOL RemoveEmptyDir(CString path);
  139.  
  140.  
  141. // RAS //
  142. /*
  143. #include "Ras.h"
  144. typedef unsigned long (* t_RasHangUp)(HRASCONN);
  145. */
  146. // RAS END //
  147.  
  148. /* lang extensions */
  149. void SetCombo(CWnd* _this,int id,char* lang_string);
  150.  
  151.  
  152. // HTTrack params - pour le multithread interface/robot
  153. class HTTrack_Params {
  154. public:
  155.   int argc;
  156.   char** argv;
  157.   //
  158.   int* result;
  159. };
  160. typedef struct {
  161.   int argc;
  162.   char** argv;
  163. } Robot_params;
  164.  
  165. // Lancement du miroir
  166. BOOL LaunchMirror();
  167.  
  168.  
  169. #define NStatsBuffer                    14
  170.  
  171.  
  172. /////////////////////////////////////////////////////////////////////////////
  173. // CShellApp:
  174. // See Shell.cpp for the implementation of this class
  175. //
  176. //class CShellApp : public CWinApp
  177. class CShellApp
  178. {
  179. public:
  180.     CShellApp();
  181.   void init_lance();
  182.   CString end_path;
  183.   CString end_path_complete;
  184.   /*
  185.   int suivant0(void);
  186.   int suivant1(void);
  187.   int suivant2(void);
  188.   //int suivant3(void);
  189.   int suivant4(void);
  190.   */
  191.   void OptPannel();
  192.  
  193.   //BOOL InitInstance();
  194.   
  195.   /*
  196. // Overrides
  197.     // ClassWizard generated virtual function overrides
  198.     //{{AFX_VIRTUAL(CShellApp)
  199.     public:
  200.     virtual BOOL InitInstance();
  201.     //}}AFX_VIRTUAL
  202.  
  203. // Implementation
  204.  
  205.     //{{AFX_MSG(CShellApp)
  206.     afx_msg void OnAppAbout();
  207.         // NOTE - the ClassWizard will add and remove member functions here.
  208.         //    DO NOT EDIT what you see in these blocks of generated code !
  209.     //}}AFX_MSG
  210.     DECLARE_MESSAGE_MAP()
  211.   */
  212. };
  213.  
  214.  
  215. /////////////////////////////////////////////////////////////////////////////
  216.  
  217. //{{AFX_INSERT_LOCATION}}
  218. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  219.  
  220. #endif // !defined(AFX_SHELL_H__ED81E637_E017_11D1_A97E_006097BC6150__INCLUDED_)
  221.