Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
symap.h File Reference

API for Symap, a basic symbol map (string interner). More...

#include <stdint.h>
Include dependency graph for symap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Symap
 

Macros

#define ZSYMAP   (ZRYTHM->symap)
 

Functions

Symapsymap_new (void)
 Create a new symbol map.
 
void symap_free (Symap *map)
 Free a symbol map.
 
uint32_t symap_try_map (Symap *map, const char *sym)
 Map a string to a symbol ID if it is already mapped, otherwise return 0.
 
uint32_t symap_map (Symap *map, const char *sym)
 Map a string to a symbol ID.
 
const char * symap_unmap (Symap *map, uint32_t id)
 Unmap a symbol ID back to a symbol, or NULL if no such ID exists.
 

Detailed Description

API for Symap, a basic symbol map (string interner).

Particularly useful for implementing LV2 URI mapping.

See also
LV2 URID
LV2 URI Map

Definition in file symap.h.

Macro Definition Documentation

◆ ZSYMAP

#define ZSYMAP   (ZRYTHM->symap)

Definition at line 33 of file symap.h.

Function Documentation

◆ symap_map()

uint32_t symap_map ( Symap * map,
const char * sym )

Map a string to a symbol ID.

Note that 0 is never a valid symbol ID.

◆ symap_unmap()

const char * symap_unmap ( Symap * map,
uint32_t id )

Unmap a symbol ID back to a symbol, or NULL if no such ID exists.

Note that 0 is never a valid symbol ID.