php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2023 Alexander Borisov
3 *
4 * Author: Alexander Borisov <borisov@lexbor.com>
5 */
6
7#ifndef LEXBOR_BASE_H
8#define LEXBOR_BASE_H
9
10#ifdef __cplusplus
11#define __STDC_LIMIT_MACROS
12#define __STDC_CONSTANT_MACROS
13
14extern "C" {
15#endif
16
17#include <stdlib.h>
18#include <stddef.h>
19#include <stdio.h>
20#include <stdarg.h>
21#include <memory.h>
22#include <limits.h>
23#include <string.h>
24
25#include "lexbor/core/def.h"
26#include "lexbor/core/types.h"
27#include "lexbor/core/lexbor.h"
28
29#define LEXBOR_VERSION_MAJOR 1
30#define LEXBOR_VERSION_MINOR 7
31#define LEXBOR_VERSION_PATCH 0
32
33#define LEXBOR_VERSION_STRING LEXBOR_STRINGIZE(LEXBOR_VERSION_MAJOR) "." \
34 LEXBOR_STRINGIZE(LEXBOR_VERSION_MINOR) "." \
35 LEXBOR_STRINGIZE(LEXBOR_VERSION_PATCH)
36
37#define lexbor_assert(val)
38
39#define lexbor_max(val1, val2) ((val1) > (val2) ? (val1) : (val2))
40#define lexbor_min(val1, val2) ((val1) < (val2) ? (val1) : (val2))
41
42
43/*
44 * Very important!!!
45 *
46 * for lexbor 0..00AFFF; LXB_STATUS_OK == 0x000000
47 */
72
73typedef enum {
77}
79
80
82(*lexbor_serialize_cb_f)(const lxb_char_t *data, size_t len, void *ctx);
83
85(*lexbor_serialize_cb_cp_f)(const lxb_codepoint_t *cps, size_t len, void *ctx);
86
87
88typedef struct {
90 void *ctx;
91
92 intptr_t opt;
93 size_t count;
94}
96
97
98#ifdef __cplusplus
99} /* extern "C" */
100#endif
101
102#endif /* LEXBOR_BASE_H */
103
size_t len
Definition apprentice.c:174
lxb_status_t(* lexbor_serialize_cb_f)(const lxb_char_t *data, size_t len, void *ctx)
Definition base.h:82
lexbor_status_t
Definition base.h:48
@ LXB_STATUS_ERROR_NO_FREE_SLOT
Definition base.h:55
@ LXB_STATUS_ERROR_INCOMPLETE_OBJECT
Definition base.h:54
@ LXB_STATUS_ERROR_SMALL_BUFFER
Definition base.h:53
@ LXB_STATUS_STOPPED
Definition base.h:66
@ LXB_STATUS_SMALL_BUFFER
Definition base.h:64
@ LXB_STATUS_CONTINUE
Definition base.h:63
@ LXB_STATUS_WARNING
Definition base.h:69
@ LXB_STATUS_ERROR_MEMORY_ALLOCATION
Definition base.h:51
@ LXB_STATUS_STOP
Definition base.h:68
@ LXB_STATUS_ERROR_OBJECT_IS_NULL
Definition base.h:52
@ LXB_STATUS_ERROR_WRONG_STAGE
Definition base.h:59
@ LXB_STATUS_ABORTED
Definition base.h:65
@ LXB_STATUS_ERROR_WRONG_ARGS
Definition base.h:58
@ LXB_STATUS_OK
Definition base.h:49
@ LXB_STATUS_ERROR_OVERFLOW
Definition base.h:62
@ LXB_STATUS_ERROR_NOT_EXISTS
Definition base.h:57
@ LXB_STATUS_ERROR_UNEXPECTED_RESULT
Definition base.h:60
@ LXB_STATUS_ERROR_UNEXPECTED_DATA
Definition base.h:61
@ LXB_STATUS_ERROR_TOO_SMALL_SIZE
Definition base.h:56
@ LXB_STATUS_NEXT
Definition base.h:67
@ LXB_STATUS_ERROR
Definition base.h:50
lxb_status_t(* lexbor_serialize_cb_cp_f)(const lxb_codepoint_t *cps, size_t len, void *ctx)
Definition base.h:85
lexbor_action_t
Definition base.h:73
@ LEXBOR_ACTION_NEXT
Definition base.h:76
@ LEXBOR_ACTION_OK
Definition base.h:74
@ LEXBOR_ACTION_STOP
Definition base.h:75
zend_constant * data
lexbor_serialize_cb_f cb
Definition base.h:89
unsigned int lxb_status_t
Definition types.h:28
unsigned char lxb_char_t
Definition types.h:27
uint32_t lxb_codepoint_t
Definition types.h:26