home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / lynx-2.4 / WWW / Library / Implementation / HTRules.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-28  |  4.0 KB  |  166 lines

  1. /*                                                           Configuration Manager for libwww
  2.                                   CONFIGURATION MANAGER
  3.                                              
  4.    Author Tim Berners-Lee/CERN. Public domain. Please mail changes to timbl@info.cern.ch.
  5.    
  6.    The configuration information loaded includes tables (file suffixes, presentation
  7.    methods) in other modules.  The most likely routines needed by developers will be:
  8.    
  9.   HTSetConfiguration      to load configuration information.
  10.                          
  11.   HTLoadRules             to load a whole file of configuration information
  12.                          
  13.   HTTranslate             to translate a URL using the rule table.
  14.                          
  15.  */
  16. #ifndef HTRULE_H
  17. #define HTRULE_H
  18.  
  19. #ifndef HTUTILS_H
  20. #include "HTUtils.h"
  21. #endif /* HTUTILS_H */
  22.  
  23. typedef enum _HTRuleOp {
  24.         HT_Invalid,
  25.         HT_Map,
  26.         HT_Pass,
  27.         HT_Fail,
  28.         HT_DefProt,
  29.         HT_Protect
  30. } HTRuleOp;
  31.  
  32. #ifdef SHORT_NAMES
  33. #define HTSearSc HTSearchScript
  34. #endif /*SHORT_NAMES*/
  35.  
  36. /*
  37.  
  38. Server Side Script Execution
  39.  
  40.    If a URL starts with /htbin/ it is understood to mean a script execution request on
  41.    server. This feature needs to be turned on by setting HTBinDir by the htbin rule.
  42.    Index searching is enabled by setting HTSearchScript into the name of script in BinDir
  43.    doing the actual search by search rule (BinDir must also be set in this case, of
  44.    course).
  45.    
  46.  */
  47.  
  48. extern char * HTBinDir;         /* Physical /htbin location */
  49. extern char * HTSearchScript;   /* Search script name */
  50.  
  51. /*
  52.  
  53. HTAddRule:  Add rule to the list
  54.  
  55.   ON ENTRY,
  56.   
  57.   pattern                points to 0-terminated string containing a single "*"
  58.                          
  59.   equiv                  points to the equivalent string with * for the place where the
  60.                          text matched by * goes.
  61.                          
  62.   ON EXIT,
  63.   
  64.   returns                0 if success, -1 if error.
  65.                          
  66.    Note that if BYTE_ADDRESSING is set, the three blocks required are allocated and
  67.    deallocated as one. This will save time and storage, when malloc's allocation units are
  68.    large.
  69.    
  70.  */
  71. extern int HTAddRule PARAMS((HTRuleOp op, const char * pattern, const char * equiv));
  72.  
  73.  
  74. /*
  75.  
  76. HTClearRules: Clear all rules
  77.  
  78.   ON EXIT,
  79.   
  80.   Rule file               There are no rules
  81.                          
  82.   returns
  83.                           0 if success, -1 if error.
  84.                          
  85.  */
  86.  
  87. #ifdef __STDC__
  88. extern int HTClearRules(void);
  89. #else
  90. extern int HTClearRules();
  91. #endif
  92.  
  93.  
  94. /*
  95.  
  96. HTTranslate: Translate by rules
  97.  
  98.  */
  99.         
  100. /*
  101.  
  102.   ON ENTRY,
  103.   
  104.   required                points to a string whose equivalent value is neeed
  105.                          
  106.   ON EXIT,
  107.   
  108.   returns                 the address of the equivalent string allocated from the heap
  109.                          which the CALLER MUST FREE. If no translation occured, then it is
  110.                          a copy of the original.
  111.                          
  112.  */
  113. #ifdef __STDC__
  114. extern char * HTTranslate(const char * required);
  115. #else
  116. extern char * HTTranslate();
  117. #endif
  118.  
  119.  
  120. /*
  121.  
  122. HTSetConfiguration:  Load one line of configuration information
  123.  
  124.   ON ENTRY,
  125.   
  126.   config                  is a string in the syntax of a rule file line.
  127.                          
  128.    This routine may be used for loading configuration information from sources other than
  129.    the  rule file, for example INI files for X resources.
  130.    
  131.  */
  132. extern int HTSetConfiguration PARAMS((CONST char * config));
  133.  
  134.  
  135. /*
  136.  
  137. HtLoadRules:  Load the rules from a file
  138.  
  139.   ON ENTRY,
  140.   
  141.   Rule table              Rules can be in any state
  142.                          
  143.   ON EXIT,
  144.   
  145.   Rule table              Any existing rules will have been kept. Any new rules will have
  146.                          been loaded on top, so as to be tried first.
  147.                          
  148.   Returns                 0 if no error.
  149.                          
  150.  */
  151.  
  152. #ifdef __STDC__
  153. extern int HTLoadRules(const char * filename);
  154. #else
  155. extern int HTLoadRules();
  156. #endif
  157. /*
  158.  
  159.  */
  160.  
  161.  
  162. #endif /* HTUtils.h */
  163. /*
  164.  
  165.    end */
  166.