home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Magazine / wwwoffle-2.1.tar.gz / wwwoffle-2.1 / wwwoffle.h < prev    next >
C/C++ Source or Header  |  1998-02-26  |  5KB  |  155 lines

  1. /***************************************
  2.   $Header: /home/amb/wwwoffle/RCS/wwwoffle.h 2.33 1998/02/26 20:04:44 amb Exp $
  3.  
  4.   WWWOFFLE - World Wide Web Offline Explorer - Version 2.1.
  5.   A header file for all of the programs wwwoffle, wwwoffled.
  6.   ******************/ /******************
  7.   Written by Andrew M. Bishop
  8.  
  9.   This file Copyright 1996,97,98 Andrew M. Bishop
  10.   It may be distributed under the GNU Public License, version 2, or
  11.   any higher version.  See section COPYING of the GNU Public license
  12.   for conditions under which this file may be redistributed.
  13.   ***************************************/
  14.  
  15.  
  16. #ifndef WWWOFFLE_H
  17. #define WWWOFFLE_H    /*+ To stop multiple inclusions. +*/
  18.  
  19.  
  20. /* ------------------------------------------------------------
  21.    The values in the section below can be changed if required, see INSTALL. */
  22.  
  23. /*+ The default port number to use for the http proxy demon. +*/
  24. #define DEF_HTTP_PORT 8080
  25.  
  26. /*+ The default port number to use for the wwwoffle control. +*/
  27. #define DEF_WWWOFFLE_PORT 8081
  28.  
  29. /*+ The default spool directory. +*/
  30. #define DEF_SPOOL "/var/spool/wwwoffle"
  31.  
  32. /*+ The default configuration file directory. +*/
  33. #define DEF_CONF "/var/spool/wwwoffle"
  34.  
  35. /*+ The default age of pages in days before purging. +*/
  36. #define DEF_PURGE_AGE 14
  37.  
  38. /*+ The absolute maximum number of servers to fork in total. +*/
  39. #define MAX_SERVERS 64
  40. /*+ The default total number of servers to fork. +*/
  41. #define DEF_MAX_SERVERS 8
  42.  
  43. /*+ The absolute maximum number of servers to fork for fetching previously requested pages. +*/
  44. #define MAX_FETCH_SERVERS 48
  45. /*+ The default number of servers to fork for fetching pages. +*/
  46. #define DEF_MAX_FETCH_SERVERS 4
  47.  
  48. /*+ The time in seconds to wait while reading from a socket. +*/
  49. #define SOCKET_TIMEOUT 120
  50.  
  51. /* The values in the section above can be changed if required, see INSTALL.
  52.    ------------------------------------------------------------ */
  53.  
  54. #include "misc.h"
  55.  
  56. /* In connect.c */
  57.  
  58. void CommandConnect(int client);
  59. void ForkServer(int client,int browser);
  60.  
  61. /* In purge.c */
  62.  
  63. void PurgeCache(int fd);
  64.  
  65. /* In spool.c */
  66.  
  67. int OpenOutgoingSpoolFile(int rw);
  68. void CloseOutgoingSpoolFile(int fd,URL *Url);
  69. int ExistsOutgoingSpoolFile(URL *Url);
  70. char *HashOutgoingSpoolFile(URL *Url);
  71. char *DeleteOutgoingSpoolFile(URL *Url);
  72.  
  73. int OpenWebpageSpoolFile(int rw,URL *Url);
  74. char *DeleteWebpageSpoolFile(URL *Url,int all);
  75. void TouchWebpageSpoolFile(URL *Url);
  76. int ExistsWebpageSpoolFile(URL *Url);
  77.  
  78. void CreateBackupWebpageSpoolFile(URL *Url,int fd);
  79. void RestoreBackupWebpageSpoolFile(URL *Url);
  80. void DeleteBackupWebpageSpoolFile(URL *Url);
  81.  
  82. char *DeleteLastTimeSpoolFile(URL *Url);
  83. int CreateLastTimeSpoolFile(URL *Url);
  84.  
  85. int OpenMonitorSpoolFile(URL *Url);
  86. char *DeleteMonitorSpoolFile(URL *Url);
  87.  
  88. char *FileNameToURL(char *file);
  89. char *URLToFileName(URL *Url);
  90.  
  91. /* In parse.c */
  92.  
  93. char *ParseRequest(int fd,char **request_head,char **request_body);
  94.  
  95. int RequestChanges(int fd,char **request_head);
  96. char *MovedLocation(URL *Url,char *reply_head);
  97. char *RequestURL(char *url,char *referer);
  98.  
  99. char *ModifyRequest(URL *Url,char *request_head);
  100.  
  101. char *MakeRequestAuthorised(char *proxy,char *request_head);
  102. char *MakeRequestNonProxy(char *request_head);
  103.  
  104. int ParseReply(URL *Url,char **reply_head);
  105.  
  106. /* In messages.c */
  107.  
  108. void ServerError(int fd,char *string);
  109. void RemoteHostError(int fd,URL *Url,char *reason,int cache,int backup);
  110. void CantRefreshPosted(int fd,URL *Url);
  111. void WillGetURL(int fd,URL *Url,int already);
  112. void RefreshRedirect(int fd,URL *Url);
  113. void WelcomePage(int fd);
  114. void IllegalPage(int fd,char *pathargs);
  115. void PasswordDisallowed(int fd,URL *Url);
  116. void IllegalProto(int fd,char *url,char *proto);
  117. void NotModified(int fd);
  118. void RefusedRequest(int fd,URL *Url);
  119.  
  120. /* In index.c */
  121.  
  122. void IndexPage(int fd,char *path,char *args);
  123.  
  124. /* In control.c */
  125.  
  126. void ControlPage(int fd,char *path,char *args,char *request_head,char *request_body);
  127.  
  128. /* In configedit.c */
  129.  
  130. void ConfigEditPage(int fd,char *args,char *request_body);
  131.  
  132. /* In refresh.c */
  133.  
  134. char *RefreshPage(int fd,char *path,char *args,char *url,char *request,int is_online);
  135.  
  136. /* In monitor.c */
  137.  
  138. void MonitorPage(int fd,char *path,char *args,char *request_body);
  139. void RequestMonitoredPages(void);
  140.  
  141. /* In html.c (html.l) */
  142.  
  143. int ParseHTML(int fd,URL *Url,int html);
  144. char **ListImages(void);
  145. char **ListLinks(void);
  146. char **ListFrames(void);
  147. char *MetaRefresh(void);
  148. int GetHTMLEnd(void);
  149.  
  150. /* In wwwoffles.c */
  151.  
  152. int wwwoffles(int online,int browser,int client);
  153.  
  154. #endif /* WWWOFFLE_H */
  155.