HTStruct.h
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:2k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. /*                                                               Structured Stream Definition
  2.                                STRUCTURED STREAM DEFINITION
  3.                                              
  4.  */
  5. /*
  6. **      (c) COPYRIGHT MIT 1995.
  7. **      Please first read the full copyright statement in the file COPYRIGH.
  8. */
  9. /*
  10.    This module is a part of the W3C Reference Library.
  11.    
  12.  */
  13. #ifndef HTSTRUCT_H
  14. #define HTSTRUCT_H
  15. #include "HTStream.h"
  16. #include "HTList.h"
  17. /*
  18.    A structured object is something which can reasonably be represented in for eaxmple
  19.    SGML.  I'll rephrase that.  A structured object is am ordered tree-structured
  20.    arrangement of data which is representable as text. An example is the SGML parser which
  21.    outputs to a Structured Object. A Structured object can output its contents to another
  22.    Structured Object. It's a kind of typed stream. The architecure is largely Dan
  23.    Conolly's. Elements and entities are passed to the sob by number, implying a knowledge
  24.    of the DTD.
  25.    
  26.    The Streuctured Stream is a subclass of a Generic Stream Object. As always, we don't
  27.    have classes in basic C so we have to do this by hand!
  28.    
  29.    NOTE: The put_block method was write, but this upset systems which had macros for
  30.    write(). See the Generic Stream Definition for valid return codes.
  31.    
  32.  */
  33. typedef struct _HTStructured HTStructured;
  34. typedef struct _HTStructuredClass {
  35.     char * name;
  36.     int (*flush)        (HTStructured * me);
  37.     int (*_free)        (HTStructured * me);
  38.     int (*abort)        (HTStructured * me, HTList * errorlist);
  39.     int (*put_character)(HTStructured * me, char ch);
  40.     int (*put_string)   (HTStructured * me, CONST char * str);
  41.     int (*put_block)    (HTStructured * me, CONST char * str, int len);
  42. /*
  43.    See the Generic Stream Definition for an explanation of these methods. Note that they
  44.    all have a HTStructured object a the parameter, not a generic stream. This is to avoid
  45.    incompatible pointer warnings
  46.    
  47.  */
  48.     void (*start_element)(HTStructured *me,
  49.                           int           element_number,
  50.                           CONST BOOL *  attribute_present,
  51.                           CONST char ** attribute_value);
  52.     void (*end_element) (HTStructured * me, int element_number);
  53.     void (*put_entity)  (HTStructured * me, int entity_number);
  54.                 
  55. } HTStructuredClass;
  56. #endif
  57. /*
  58.    End of Structured Stream definition */