infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
type_registry.c File Reference

Implements the named type registry and definition parser. More...

#include "common/infix_internals.h"
#include <ctype.h>
#include <string.h>
Include dependency graph for type_registry.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _registry_parser_state_t
 

Macros

#define INITIAL_REGISTRY_BUCKETS   61
 

Functions

static uint64_t _registry_hash_string (const char *str)
 
static _infix_registry_entry_t_registry_lookup (infix_registry_t *registry, const char *name)
 
static _infix_registry_entry_t_registry_insert (infix_registry_t *registry, const char *name)
 
c23_nodiscard infix_registry_tinfix_registry_create (void)
 Implementation for the public infix_registry_create function.
 
void infix_registry_destroy (infix_registry_t *registry)
 Implementation for the public infix_registry_destroy function.
 
static void _registry_parser_skip_whitespace (_registry_parser_state_t *state)
 
static char * _registry_parser_parse_name (_registry_parser_state_t *state, char *buffer, size_t buf_size)
 
c23_nodiscard infix_status infix_register_types (infix_registry_t *registry, const char *definitions)
 Implementation of the public infix_register_types function.
 
c23_nodiscard infix_status _infix_resolve_type_graph (infix_type **type_ptr, infix_registry_t *registry)
 Walks a type graph, replacing all @Name placeholders with their concrete definitions from a registry.
 

Detailed Description

Implements the named type registry and definition parser.

Copyright (c) 2025 Sanko Robinson

This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.

SPDX-License-Identifier: (Artistic-2.0 OR MIT)

The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

SPDX-License-Identifier: CC-BY-4.0

Macro Definition Documentation

◆ INITIAL_REGISTRY_BUCKETS

#define INITIAL_REGISTRY_BUCKETS   61

Function Documentation

◆ _infix_resolve_type_graph()

c23_nodiscard infix_status _infix_resolve_type_graph ( infix_type **  type_ptr,
infix_registry_t registry 
)

Walks a type graph, replacing all @Name placeholders with their concrete definitions from a registry.

◆ _registry_hash_string()

static uint64_t _registry_hash_string ( const char *  str)
static

◆ _registry_insert()

static _infix_registry_entry_t * _registry_insert ( infix_registry_t registry,
const char *  name 
)
static

◆ _registry_lookup()

static _infix_registry_entry_t * _registry_lookup ( infix_registry_t registry,
const char *  name 
)
static

◆ _registry_parser_parse_name()

static char * _registry_parser_parse_name ( _registry_parser_state_t state,
char *  buffer,
size_t  buf_size 
)
static

◆ _registry_parser_skip_whitespace()

static void _registry_parser_skip_whitespace ( _registry_parser_state_t state)
static