php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
sbst.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
#ifndef LEXBOR_SBST_H
8
#define LEXBOR_SBST_H
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
13
14
#include <string.h>
15
16
#include "
lexbor/core/base.h
"
17
18
19
typedef
struct
{
20
lxb_char_t
key
;
21
22
lxb_char_t
value
[6];
23
unsigned
char
value_len
;
24
25
unsigned
short
left
;
26
unsigned
short
right
;
27
unsigned
short
next
;
28
}
29
lexbor_sbst_entry_static_t
;
30
31
32
/*
33
* Inline functions
34
*/
35
lxb_inline
const
lexbor_sbst_entry_static_t
*
36
lexbor_sbst_entry_static_find
(
const
lexbor_sbst_entry_static_t
*strt,
37
const
lexbor_sbst_entry_static_t
*root,
38
const
lxb_char_t
key
)
39
{
40
while
(root != strt) {
41
if
(root->
key
==
key
) {
42
return
root;
43
}
44
else
if
(
key
> root->
key
) {
45
root = &strt[root->
right
];
46
}
47
else
{
48
root = &strt[root->
left
];
49
}
50
}
51
52
return
NULL
;
53
}
54
55
#ifdef __cplusplus
56
}
/* extern "C" */
57
#endif
58
59
#endif
/* LEXBOR_SBST_H */
base.h
NULL
#define NULL
Definition
gdcache.h:45
key
unsigned char key[REFLECTION_KEY_LEN]
Definition
php_reflection.c:63
lexbor_sbst_entry_static_find
lxb_inline const lexbor_sbst_entry_static_t * lexbor_sbst_entry_static_find(const lexbor_sbst_entry_static_t *strt, const lexbor_sbst_entry_static_t *root, const lxb_char_t key)
Definition
sbst.h:36
lexbor_sbst_entry_static_t
Definition
sbst.h:19
lexbor_sbst_entry_static_t::key
lxb_char_t key
Definition
sbst.h:20
lexbor_sbst_entry_static_t::left
unsigned short left
Definition
sbst.h:25
lexbor_sbst_entry_static_t::next
unsigned short next
Definition
sbst.h:27
lexbor_sbst_entry_static_t::value
lxb_char_t value[6]
Definition
sbst.h:22
lexbor_sbst_entry_static_t::right
unsigned short right
Definition
sbst.h:26
lexbor_sbst_entry_static_t::value_len
unsigned char value_len
Definition
sbst.h:23
lxb_inline
#define lxb_inline
Definition
types.h:21
lxb_char_t
unsigned char lxb_char_t
Definition
types.h:27
ext
dom
lexbor
lexbor
core
sbst.h
Generated on Sat Aug 23 2025 01:46:06 for php-internal-docs by
1.13.2