m17nChartable(3m17n)
π m17nChartable β bestie, let's talk chartables π
okay so this is a page from The m17n Library, manual section 3m17n, and it's all about MCharTable β the iconic little data structure that holds attributes for a truly unhinged number of characters. no cap. let's get into it π«Ά
β¨ NAME β¨
m17nChartable_-_Chart β Chartable objects and the API for them. that's the vibe. π
πΈ SYNOPSIS πΈ
π Typedefs
typedef struct MCharTable MCharTableβ the type of chartables. yep, that's the whole typedef, it's giving minimalism β¨
π¦ Functions
MCharTable * mchartable (MSymbol key, void *default_value)
Create a new chartable. baby's first chartable πΌ
int mchartable_min_char (MCharTable *table)
Return the minimum character whose value is set in a chartabe. (yes the original says "chartabe", we love a typo, we keep it fr fr π)
int mchartable_max_char (MCharTable *table)
Return the maximum character whose value is set in a chartabe. π
void * mchartable_lookup (MCharTable *table, int c)
Return the assigned value of a character in a chartable. π
int mchartable_set (MCharTable *table, int c, void *val)
Assign a value to a character in a chartable. βοΈ
int mchartable_set_range (MCharTable *table, int from, int to, void *val)
Assign a value to the characters in the specified range. a whole range, she's efficient π
void mchartable_range (MCharTable *table, int *from, int *to)
Search for characters that have non-default value. π
int mchartable_map (MCharTable *table, void *ignore, void(*func)(int, int, void *, void *), void *func_arg)
Call a function for characters in a chartable. very main character energy π₯
π Variables
MSymbol Mchar_tableβ the symbol, bestie, the symbol β
π Detailed Description π
Chartable objects and API for them. periodt.
Symbol whose name is 'char-table'.
so here's the tea: The m17n library supports enormous number of characters. like, so many. Thus, if attributes of each character are to be stored in a simple array, such an array would be impractically big. π a whole array? for all of them? absolutely not.
The attributes usually used, however, are often assigned only to a range of characters. Even when all characters have attributes, characters of consecutive character code tend to have the same attribute values. it's giving patterns, it's giving structure, we love to see it π
The m17n library utilizes this tendency to store characters and their attribute values efficiently in an object called Chartable. Although a chartable object is not a simple array, application programs can handle a chartable as if it is an array. β¨ the way that it's a whole nother data structure but you can pretend, iconic.
Attribute values of a character can be obtained by accessing a Chartable for the attribute with the character code of the specified character.
A chartable is a managed object. π«Ά
The symbol Mchar_table has the name 'char-table'.
π§ Typedef Documentation π§
π typedef struct MCharTable MCharTable
Type of chartables. <>
The type MCharTable is for a chartable objects. Its internal structure is concealed from application programs. π like, mind your business, she's mysterious, she's private, you get the API and that's it.
π Variable Documentation π
β MSymbol Mchar_table
(she's a variable. she's Mchar_table. that's the whole entry. short queen π)
π Author π
Generated automatically by Doxygen for The m17n Library from the source code. so technically a robot wrote it, but the robot ate. π€β¨
π COPYRIGHT π
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
ok bestie real talk: this doc is under the GNU Free Documentation License, so copy/distribute/modify is allowed under those terms β that's not a vibe, that's a legal thing, respect it π
and that's the page!! π this was Version 1.8.4, dated Mon Sep 25 2023, and it's the m17nChartable(3m17n) page from The m17n Library. slay, go store some character attributes efficiently, you got this πΈπ¦β¨
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms