php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
tag.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Alexander Borisov
3 *
4 * Author: Alexander Borisov <borisov@lexbor.com>
5 */
6
7
8#ifndef LXB_HTML_TAG_H
9#define LXB_HTML_TAG_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#include "lexbor/html/base.h"
16
17#include "lexbor/tag/tag.h"
18#include "lexbor/ns/ns.h"
19
20
22
34
35typedef struct {
37 unsigned int len;
38}
40
41
42#define LXB_HTML_TAG_RES_CATS
43#define LXB_HTML_TAG_RES_FIXNAME_SVG
44#include "lexbor/html/tag_res.h"
45
46
47/*
48 * Inline functions
49 */
50lxb_inline bool
53{
54 if (tag_id < LXB_TAG__LAST_ENTRY && ns < LXB_NS__LAST_ENTRY) {
55 return lxb_html_tag_res_cats[tag_id][ns] & cat;
56 }
57
59}
60
63{
64 if (tag_id >= LXB_TAG__LAST_ENTRY) {
65 return NULL;
66 }
67
68 return &lxb_html_tag_res_fixname_svg[tag_id];
69}
70
71lxb_inline bool
73{
74 switch (tag_id) {
75 case LXB_TAG_AREA:
76 case LXB_TAG_BASE:
77 case LXB_TAG_BR:
78 case LXB_TAG_COL:
79 case LXB_TAG_EMBED:
80 case LXB_TAG_HR:
81 case LXB_TAG_IMG:
82 case LXB_TAG_INPUT:
83 case LXB_TAG_LINK:
84 case LXB_TAG_META:
85 case LXB_TAG_SOURCE:
86 case LXB_TAG_TRACK:
87 case LXB_TAG_WBR:
88 return true;
89
90 default:
91 return false;
92 }
93
94 return false;
95}
96
97
98#ifdef __cplusplus
99} /* extern "C" */
100#endif
101
102#endif /* LXB_HTML_TAG_H */
#define NULL
Definition gdcache.h:45
lxb_html_tag_category
Definition tag.h:23
@ LXB_HTML_TAG_CATEGORY_SCOPE_SELECT
Definition tag.h:32
@ LXB_HTML_TAG_CATEGORY_SCOPE_BUTTON
Definition tag.h:30
@ LXB_HTML_TAG_CATEGORY__UNDEF
Definition tag.h:24
@ LXB_HTML_TAG_CATEGORY_SCOPE_TABLE
Definition tag.h:31
@ LXB_HTML_TAG_CATEGORY_SCOPE_LIST_ITEM
Definition tag.h:29
@ LXB_HTML_TAG_CATEGORY_SPECIAL
Definition tag.h:26
@ LXB_HTML_TAG_CATEGORY_FORMATTING
Definition tag.h:27
@ LXB_HTML_TAG_CATEGORY_ORDINARY
Definition tag.h:25
@ LXB_HTML_TAG_CATEGORY_SCOPE
Definition tag.h:28
lxb_inline bool lxb_html_tag_is_category(lxb_tag_id_t tag_id, lxb_ns_id_t ns, lxb_html_tag_category_t cat)
Definition tag.h:51
lxb_inline bool lxb_html_tag_is_void(lxb_tag_id_t tag_id)
Definition tag.h:72
int lxb_html_tag_category_t
Definition tag.h:21
lxb_inline const lxb_html_tag_fixname_t * lxb_html_tag_fixname_svg(lxb_tag_id_t tag_id)
Definition tag.h:62
uintptr_t lxb_ns_id_t
Definition const.h:20
@ LXB_NS__LAST_ENTRY
Definition const.h:32
const lxb_char_t * name
Definition tag.h:36
unsigned int len
Definition tag.h:37
@ LXB_TAG_COL
Definition const.h:64
@ LXB_TAG_HR
Definition const.h:124
@ LXB_TAG_WBR
Definition const.h:218
@ LXB_TAG_AREA
Definition const.h:42
@ LXB_TAG_TRACK
Definition const.h:212
@ LXB_TAG_INPUT
Definition const.h:130
@ LXB_TAG_META
Definition const.h:148
@ LXB_TAG_IMG
Definition const.h:129
@ LXB_TAG__LAST_ENTRY
Definition const.h:220
@ LXB_TAG_BASE
Definition const.h:47
@ LXB_TAG_SOURCE
Definition const.h:190
@ LXB_TAG_LINK
Definition const.h:139
@ LXB_TAG_BR
Definition const.h:56
@ LXB_TAG_EMBED
Definition const.h:79
uintptr_t lxb_tag_id_t
Definition const.h:21
#define lxb_inline
Definition types.h:21
unsigned char lxb_char_t
Definition types.h:27