![]()  | 
  
    libgpac
    
   Documentation of the core library of GPAC 
   | 
  
#include <stdlib.h>#include <stdio.h>#include <stdarg.h>#include <inttypes.h>#include <string.h>#include <assert.h>#include "cutils.h"#include "libregexp.h"#include "libunicode.h"#include "libregexp-opcode.h"
 Include dependency graph for libregexp.c:Data Structures | |
| struct | REParseState | 
| struct | REOpCode | 
| struct | REString | 
| struct | REStringList | 
| struct | REExecState | 
| struct | REExecContext | 
| union | REParseState.u | 
Macros | |
| #define | DEF(id, size) REOP_ ## id, | 
| #define | CAPTURE_COUNT_MAX 255 | 
| #define | STACK_SIZE_MAX 255 | 
| #define | INTERRUPT_COUNTER_INIT 10000 | 
| #define | CP_LS 0x2028 | 
| #define | CP_PS 0x2029 | 
| #define | TMP_BUF_SIZE 128 | 
| #define | DEF(id, size) { size }, | 
| #define | RE_HEADER_FLAGS 0 | 
| #define | RE_HEADER_CAPTURE_COUNT 2 | 
| #define | RE_HEADER_STACK_SIZE 3 | 
| #define | RE_HEADER_BYTECODE_LEN 4 | 
| #define | RE_HEADER_LEN 8 | 
| #define | CLASS_RANGE_BASE 0x40000000 | 
| #define | GET_CHAR(c, cptr, cbuf_end, cbuf_type) | 
| #define | PEEK_CHAR(c, cptr, cbuf_end, cbuf_type) | 
| #define | PEEK_PREV_CHAR(c, cptr, cbuf_start, cbuf_type) | 
| #define | GET_PREV_CHAR(c, cptr, cbuf_start, cbuf_type) | 
| #define | PREV_CHAR(cptr, cbuf_start, cbuf_type) | 
Typedefs | |
| typedef uintptr_t | StackInt | 
Enumerations | |
| enum | REOPCodeEnum { REOP_COUNT } | 
| enum | CharRangeEnum {  CHAR_RANGE_d , CHAR_RANGE_D , CHAR_RANGE_s , CHAR_RANGE_S , CHAR_RANGE_w , CHAR_RANGE_W }  | 
| enum | REExecStateEnum { RE_EXEC_STATE_SPLIT , RE_EXEC_STATE_LOOKAHEAD , RE_EXEC_STATE_NEGATIVE_LOOKAHEAD , RE_EXEC_STATE_GREEDY_QUANT } | 
Functions | |
| static int | is_digit (int c) | 
| static int | dbuf_insert (DynBuf *s, int pos, int len) | 
| static uint32_t | re_string_hash (int len, const uint32_t *buf) | 
| static void | re_string_list_init (REParseState *s1, REStringList *s) | 
| static void | re_string_list_free (REStringList *s) | 
| static void | lre_print_char (int c, BOOL is_range) | 
| static __maybe_unused void | re_string_list_dump (const char *str, const REStringList *s) | 
| static int | re_string_find2 (REStringList *s, int len, const uint32_t *buf, uint32_t h0, BOOL add_flag) | 
| static int | re_string_find (REStringList *s, int len, const uint32_t *buf, BOOL add_flag) | 
| static int | re_string_add (REStringList *s, int len, const uint32_t *buf) | 
| static int | re_string_list_op (REStringList *a, REStringList *b, int op) | 
| static int | re_string_list_canonicalize (REParseState *s1, REStringList *s, BOOL is_unicode) | 
| static int | cr_init_char_range (REParseState *s, REStringList *cr, uint32_t c) | 
| static void | re_emit_op (REParseState *s, int op) | 
| static int | re_emit_op_u32 (REParseState *s, int op, uint32_t val) | 
| static int | re_emit_goto (REParseState *s, int op, uint32_t val) | 
| static void | re_emit_op_u8 (REParseState *s, int op, uint32_t val) | 
| static void | re_emit_op_u16 (REParseState *s, int op, uint32_t val) | 
| static int | __attribute__ ((format(printf, 2, 3))) | 
| static int | re_parse_out_of_memory (REParseState *s) | 
| static int | parse_digits (const uint8_t **pp, BOOL allow_overflow) | 
| static int | re_parse_expect (REParseState *s, const uint8_t **pp, int c) | 
| int | lre_parse_escape (const uint8_t **pp, int allow_utf16) | 
| static BOOL | is_unicode_char (int c) | 
| static void | seq_prop_cb (void *opaque, const uint32_t *seq, int seq_len) | 
| static int | parse_unicode_property (REParseState *s, REStringList *cr, const uint8_t **pp, BOOL is_inv, BOOL allow_sequence_prop) | 
| static int | get_class_atom (REParseState *s, REStringList *cr, const uint8_t **pp, BOOL inclass) | 
| static int | parse_class_string_disjunction (REParseState *s, REStringList *cr, const uint8_t **pp) | 
| static int | re_emit_range (REParseState *s, const CharRange *cr) | 
| static int | re_string_cmp_len (const void *a, const void *b, void *arg) | 
| static void | re_emit_char (REParseState *s, int c) | 
| static int | re_emit_string_list (REParseState *s, const REStringList *sl) | 
| static int | re_parse_nested_class (REParseState *s, REStringList *cr, const uint8_t **pp) | 
| static int | re_parse_class_set_operand (REParseState *s, REStringList *cr, const uint8_t **pp) | 
| static int | re_parse_char_class (REParseState *s, const uint8_t **pp) | 
| static BOOL | re_need_check_advance (const uint8_t *bc_buf, int bc_buf_len) | 
| static int | re_is_simple_quantifier (const uint8_t *bc_buf, int bc_buf_len) | 
| static int | re_parse_group_name (char *buf, int buf_size, const uint8_t **pp) | 
| static int | re_parse_captures (REParseState *s, int *phas_named_captures, const char *capture_name) | 
| static int | re_count_captures (REParseState *s) | 
| static BOOL | re_has_named_captures (REParseState *s) | 
| static int | find_group_name (REParseState *s, const char *name) | 
| static int | re_parse_disjunction (REParseState *s, BOOL is_backward_dir) | 
| static int | re_parse_modifiers (REParseState *s, const uint8_t **pp) | 
| static BOOL | update_modifier (BOOL val, int add_mask, int remove_mask, int mask) | 
| static int | re_parse_term (REParseState *s, BOOL is_backward_dir) | 
| static int | re_parse_alternative (REParseState *s, BOOL is_backward_dir) | 
| static int | compute_stack_size (const uint8_t *bc_buf, int bc_buf_len) | 
| static void * | lre_bytecode_realloc (void *opaque, void *ptr, size_t size) | 
| uint8_t * | lre_compile (int *plen, char *error_msg, int error_msg_size, const char *buf, size_t buf_len, int re_flags, void *opaque) | 
| static BOOL | is_line_terminator (uint32_t c) | 
| static BOOL | is_word_char (uint32_t c) | 
| static int | push_state (REExecContext *s, uint8_t **capture, StackInt *stack, size_t stack_len, const uint8_t *pc, const uint8_t *cptr, REExecStateEnum type, size_t count) | 
| static int | lre_poll_timeout (REExecContext *s) | 
| static intptr_t | lre_exec_backtrack (REExecContext *s, uint8_t **capture, StackInt *stack, int stack_len, const uint8_t *pc, const uint8_t *cptr, BOOL no_recurse) | 
| int | lre_exec (uint8_t **capture, const uint8_t *bc_buf, const uint8_t *cbuf, int cindex, int clen, int cbuf_type, void *opaque) | 
| int | lre_get_capture_count (const uint8_t *bc_buf) | 
| int | lre_get_flags (const uint8_t *bc_buf) | 
| const char * | lre_get_groupnames (const uint8_t *bc_buf) | 
Variables | |
| static const REOpCode | reopcode_info [REOP_COUNT] | 
| static const uint16_t | char_range_d [] | 
| static const uint16_t | char_range_s [] | 
| static const uint16_t | char_range_w [] | 
| static const uint16_t *const | char_range_table [] | 
| struct REParseState | 
 Collaboration diagram for REParseState:| Data Fields | ||
|---|---|---|
| DynBuf | byte_code | |
| const uint8_t * | buf_ptr | |
| const uint8_t * | buf_end | |
| const uint8_t * | buf_start | |
| int | re_flags | |
| BOOL | is_unicode | |
| BOOL | unicode_sets | |
| BOOL | ignore_case | |
| BOOL | multi_line | |
| BOOL | dotall | |
| int | capture_count | |
| int | total_capture_count | |
| int | has_named_captures | |
| void * | opaque | |
| DynBuf | group_names | |
| union REParseState.u | u | |
| struct REOpCode | 
| Data Fields | ||
|---|---|---|
| uint8_t | size | |
| struct REString | 
| struct REStringList | 
| struct REExecState | 
| Data Fields | ||
|---|---|---|
| REExecStateEnum | type: 8 | |
| uint8_t | stack_len | |
| size_t | count | |
| const uint8_t * | cptr | |
| const uint8_t * | pc | |
| void * | buf[0] | |
| struct REExecContext | 
| union REParseState.u | 
| Data Fields | ||
|---|---|---|
| char | error_msg[TMP_BUF_SIZE] | |
| char | tmp_buf[TMP_BUF_SIZE] | |
| #define DEF | ( | id, | |
| size | |||
| ) | REOP_ ## id, | 
| #define CAPTURE_COUNT_MAX 255 | 
| #define STACK_SIZE_MAX 255 | 
| #define INTERRUPT_COUNTER_INIT 10000 | 
| #define CP_LS 0x2028 | 
| #define CP_PS 0x2029 | 
| #define TMP_BUF_SIZE 128 | 
| #define DEF | ( | id, | |
| size | |||
| ) | { size }, | 
| #define RE_HEADER_FLAGS 0 | 
| #define RE_HEADER_CAPTURE_COUNT 2 | 
| #define RE_HEADER_STACK_SIZE 3 | 
| #define RE_HEADER_BYTECODE_LEN 4 | 
| #define RE_HEADER_LEN 8 | 
| #define CLASS_RANGE_BASE 0x40000000 | 
| #define GET_CHAR | ( | c, | |
| cptr, | |||
| cbuf_end, | |||
| cbuf_type | |||
| ) | 
| #define PEEK_CHAR | ( | c, | |
| cptr, | |||
| cbuf_end, | |||
| cbuf_type | |||
| ) | 
| #define PEEK_PREV_CHAR | ( | c, | |
| cptr, | |||
| cbuf_start, | |||
| cbuf_type | |||
| ) | 
| #define GET_PREV_CHAR | ( | c, | |
| cptr, | |||
| cbuf_start, | |||
| cbuf_type | |||
| ) | 
| #define PREV_CHAR | ( | cptr, | |
| cbuf_start, | |||
| cbuf_type | |||
| ) | 
| typedef uintptr_t StackInt | 
| enum REOPCodeEnum | 
| enum CharRangeEnum | 
| enum REExecStateEnum | 
      
  | 
  static | 
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
      
  | 
  static | 
 Here is the caller graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the caller graph for this function:| int lre_parse_escape | ( | const uint8_t ** | pp, | 
| int | allow_utf16 | ||
| ) | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the caller graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:| uint8_t * lre_compile | ( | int * | plen, | 
| char * | error_msg, | ||
| int | error_msg_size, | ||
| const char * | buf, | ||
| size_t | buf_len, | ||
| int | re_flags, | ||
| void * | opaque | ||
| ) | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
 Here is the call graph for this function:
 Here is the caller graph for this function:| int lre_exec | ( | uint8_t ** | capture, | 
| const uint8_t * | bc_buf, | ||
| const uint8_t * | cbuf, | ||
| int | cindex, | ||
| int | clen, | ||
| int | cbuf_type, | ||
| void * | opaque | ||
| ) | 
 Here is the call graph for this function:
 Here is the caller graph for this function:| int lre_get_capture_count | ( | const uint8_t * | bc_buf | ) | 
 Here is the caller graph for this function:| int lre_get_flags | ( | const uint8_t * | bc_buf | ) | 
 Here is the call graph for this function:
 Here is the caller graph for this function:| const char * lre_get_groupnames | ( | const uint8_t * | bc_buf | ) | 
 Here is the call graph for this function:
 Here is the caller graph for this function:
      
  | 
  static | 
      
  | 
  static | 
      
  | 
  static | 
      
  | 
  static | 
      
  | 
  static |