⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sgml.h

📁 www工具包. 这是W3C官方支持的www支撑库. 其中提供通用目的的客户端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
💻 H
字号:
/*    					W3C Sample Code Library libwww SGML Parser!  SGML Parser!*//***	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.*//*The SGML parser is a state machine. It is called for every character of theinput stream. The DTD data structure contains pointers to functions whichare called to implement the actual effect of the text read. When these functionsare called, the attribute structures pointed to by the DTD are valid, andthe function is parsed a pointer to the curent tag structure, and an "elementstack" which represents the state of nesting within SGML elements. See alsothe the generic Stream definitionThe following aspects are from Dan Connolly's suggestions: Binary search,Strcutured object scheme basically, SGML content enum type.This module is implemented by SGML.c, and it is a partof the W3C Sample Code Library.*/#ifndef SGML_H#define SGML_H#include "HTStream.h"#include "HTStruct.h"/*.  SGML Content Types.*/typedef enum _SGMLContent{    SGML_EMPTY,    	/* no content */    SGML_LITERAL, 	/* character data. Recognized exact close tag only.  		    	   Old www server compatibility only! Not SGML */    SGML_CDATA,    	/* character data. recognize </ only */    SGML_RCDATA,   	/* replaceable character data. recognize </ and &ref; */    SGML_MIXED,    	/* elements and parsed character data. recognize all markup */    SGML_ELEMENT   	/* any data found will be returned as an error*/} SGMLContent;/*.  Attribute Types.Describes the SGML tag attribute*/typedef struct _HTAttr {    char *	name;		/* The (constant) name of the attribute */    				/* Could put type info in here */} HTAttr;extern char * HTAttr_name (HTAttr * attr);/*.  Tag Structure Describing SGML Elements.      name      is the string which comes after the tag opener "<".      attributes      points to a zero-terminated array of attribute names.      litteral      determines how the SGML engine parses the charaters within the element. If    set, tag openers are ignored except for that which opens a matching closing    tag.*/typedef struct _HTTag {    char *      name;			/* The name of the tag */    HTAttr *	attributes;		/* The list of acceptable attributes */    int		number_of_attributes;	/* Number of possible attributes */    SGMLContent contents;		/* End only on end tag @@ */		} HTTag;extern char * HTTag_name (HTTag * tag);extern SGMLContent HTTag_content (HTTag * tag);extern int HTTag_attributes (HTTag * tag);extern char * HTTag_attributeName (HTTag * tag, int attribute_number);/*.  DTD Information.Not the whole DTD, but all this parser uses of it.*/#define MAX_ATTRIBUTES 32	     /* Max number of attributes per element */typedef struct {    HTTag *		tags;		/* Must be in strcmp order by name */     int			number_of_tags;    const char **	entity_names;	/* Must be in strcmp order by name */    int			number_of_entities;} SGML_dtd;extern HTTag * SGML_findTag (SGML_dtd * dtd, int element_number);extern char * SGML_findTagName (SGML_dtd * dtd, int element_number);extern SGMLContent SGML_findTagContents (SGML_dtd * dtd, int element_number);extern int SGML_findElementNumber(SGML_dtd *dtd, char *name_element);/*.  Create an SGML Parser Instance.Create an SGML parser instance which converts a stream to a structured stream.*/extern HTStream * SGML_new (const SGML_dtd * 	dtd,			    HTStructured *	target);/**/#endif	/* SGML_H *//*    @(#) $Id: SGML.html,v 2.30 1999/04/02 16:10:36 frystyk Exp $*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -