libsnobol4 1.0.2
High-performance SNOBOL4-style pattern matching library
Loading...
Searching...
No Matches
snobol_internal.h File Reference
#include "snobol/c23_compat.h"
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for snobol_internal.h:

Go to the source code of this file.

Macros

#define STANDALONE_BUILD   1
#define snobol_malloc   malloc
#define snobol_free   free
#define snobol_realloc   realloc
#define snobol_calloc   calloc
#define snobol_check_alloc(ptr)
#define SNOBOL_LOG(fmt, ...)

Enumerations

enum  { SNBL_REG_NONE = 0 , SNBL_REG_CAPTURE = 1 << 0 , SNBL_REG_VARS = 1 << 1 , SNBL_REG_COUNTERS = 1 << 2 }

Functions

uint8_t snobol_bc_register_classes (const uint8_t *bc, size_t bc_len)
size_t snobol_bc_body_len (const uint8_t *bc, size_t bc_len)

Macro Definition Documentation

◆ snobol_calloc

#define snobol_calloc   calloc

Definition at line 40 of file snobol_internal.h.

◆ snobol_check_alloc

#define snobol_check_alloc ( ptr)
Value:
((ptr) != NULL)

snobol_check_alloc(ptr) — NULL-check a heap allocation.

In STANDALONE builds this returns false and the pointer is null. In PHP builds the allocator never returns NULL, so this is a no-op that always returns true.

Usage: char *buf = snobol_malloc(n); if (!snobol_check_alloc(buf)) return ERROR_NOMEM;

Definition at line 60 of file snobol_internal.h.

◆ snobol_free

#define snobol_free   free

Definition at line 38 of file snobol_internal.h.

◆ SNOBOL_LOG

#define SNOBOL_LOG ( fmt,
... )
Value:
((void)0)

Definition at line 92 of file snobol_internal.h.

◆ snobol_malloc

#define snobol_malloc   malloc

Definition at line 37 of file snobol_internal.h.

◆ snobol_realloc

#define snobol_realloc   realloc

Definition at line 39 of file snobol_internal.h.

◆ STANDALONE_BUILD

#define STANDALONE_BUILD   1

Definition at line 25 of file snobol_internal.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SNBL_REG_NONE 
SNBL_REG_CAPTURE 
SNBL_REG_VARS 
SNBL_REG_COUNTERS 

Definition at line 105 of file snobol_internal.h.

Function Documentation

◆ snobol_bc_body_len()

size_t snobol_bc_body_len ( const uint8_t * bc,
size_t bc_len )

◆ snobol_bc_register_classes()

uint8_t snobol_bc_register_classes ( const uint8_t * bc,
size_t bc_len )