mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-04 14:48:44 +00:00
[docs] catch up to new map integration; change function forward declarations for map
This commit is contained in:
@@ -131,27 +131,29 @@
|
|||||||
//~ Message Levels
|
//~ Message Levels
|
||||||
|
|
||||||
@enum MD_MessageKind: {
|
@enum MD_MessageKind: {
|
||||||
Error,
|
None,
|
||||||
Warning,
|
Warning,
|
||||||
|
Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ String-To-Node table
|
//~ String-To-Node table
|
||||||
|
|
||||||
@enum MD_NodeTableCollisionRule: {
|
@enum MD_MapCollisionRule: {
|
||||||
Chain,
|
Chain,
|
||||||
Overwrite,
|
Overwrite,
|
||||||
}
|
}
|
||||||
|
|
||||||
@struct MD_NodeTableSlot: {
|
@struct MD_MapSlot: {
|
||||||
next: *MD_NodeTableSlot,
|
next: *MD_MapSlot,
|
||||||
hash: MD_u64,
|
hash: MD_u64,
|
||||||
node: *MD_Node,
|
key: *void;
|
||||||
|
value: *void;
|
||||||
};
|
};
|
||||||
|
|
||||||
@struct MD_NodeTable: {
|
@struct MD_Map: {
|
||||||
table_size: MD_u64,
|
table_size: MD_u64,
|
||||||
table: **MD_NodeTableSlot,
|
table: **MD_MapSlot,
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
@@ -198,7 +200,7 @@
|
|||||||
Newline,
|
Newline,
|
||||||
WhitespaceMax,
|
WhitespaceMax,
|
||||||
|
|
||||||
MD_TokenKind_NonASCII,
|
MD_TokenKind_BadCharacter,
|
||||||
|
|
||||||
MAX,
|
MAX,
|
||||||
};
|
};
|
||||||
@@ -237,7 +239,7 @@
|
|||||||
at: *MD_u8,
|
at: *MD_u8,
|
||||||
filename: MD_String8,
|
filename: MD_String8,
|
||||||
file_contents: MD_String8,
|
file_contents: MD_String8,
|
||||||
namespace_table: MD_NodeTable,
|
namespace_table: MD_Map,
|
||||||
selected_namespace: *MD_Node,
|
selected_namespace: *MD_Node,
|
||||||
catastrophic_error: MD_b32,
|
catastrophic_error: MD_b32,
|
||||||
};
|
};
|
||||||
@@ -647,15 +649,15 @@
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ String-To-Node-List Table
|
//~ String-To-Node-List Table
|
||||||
|
|
||||||
@func MD_NodeTable_Lookup: {
|
@func MD_Map_Lookup: {
|
||||||
table: *MD_NodeTable,
|
table: *MD_Map,
|
||||||
string: MD_String8,
|
string: MD_String8,
|
||||||
return: *MD_NodeTableSlot,
|
return: *MD_MapSlot,
|
||||||
};
|
};
|
||||||
|
|
||||||
@func MD_NodeTable_Insert: {
|
@func MD_Map_Insert: {
|
||||||
table: *MD_NodeTable,
|
table: *MD_Map,
|
||||||
collision_rule: MD_NodeTableCollisionRule,
|
collision_rule: MD_MapCollisionRule,
|
||||||
string: MD_String8,
|
string: MD_String8,
|
||||||
node: *MD_Node,
|
node: *MD_Node,
|
||||||
return: MD_b32,
|
return: MD_b32,
|
||||||
@@ -513,7 +513,7 @@ GeneratePageContent(MD_Map *index_table, SiteInfo *site_info, PageInfo *page_inf
|
|||||||
MD_Node *index_string = 0;
|
MD_Node *index_string = 0;
|
||||||
for(MD_u64 idx = 0; !MD_NodeIsNil(index_string = MD_ChildFromIndex(node, idx)); idx += 1)
|
for(MD_u64 idx = 0; !MD_NodeIsNil(index_string = MD_ChildFromIndex(node, idx)); idx += 1)
|
||||||
{
|
{
|
||||||
for(MD_MapSlot *slot = MD_NodeTable_Lookup(index_table, index_string->string);
|
for(MD_MapSlot *slot = MD_Map_Lookup(index_table, index_string->string);
|
||||||
slot; slot = slot->next)
|
slot; slot = slot->next)
|
||||||
{
|
{
|
||||||
if(slot->value)
|
if(slot->value)
|
||||||
|
|||||||
+2
-2
@@ -698,8 +698,8 @@ MD_FUNCTION MD_String8 MD_S8FromS32(MD_String32 str);
|
|||||||
MD_FUNCTION MD_String32 MD_S32FromS8(MD_String8 str);
|
MD_FUNCTION MD_String32 MD_S32FromS8(MD_String8 str);
|
||||||
|
|
||||||
//~ String-To-Node-List Table
|
//~ String-To-Node-List Table
|
||||||
MD_FUNCTION MD_MapSlot *MD_NodeTable_Lookup(MD_Map *table, MD_String8 string);
|
MD_FUNCTION MD_MapSlot *MD_Map_Lookup(MD_Map *table, MD_String8 string);
|
||||||
MD_FUNCTION MD_b32 MD_NodeTable_Insert(MD_Map *table, MD_MapCollisionRule collision_rule, MD_String8 string, MD_Node *node);
|
MD_FUNCTION MD_b32 MD_Map_Insert(MD_Map *table, MD_MapCollisionRule collision_rule, MD_String8 string, MD_Node *node);
|
||||||
|
|
||||||
//~ Parsing
|
//~ Parsing
|
||||||
MD_FUNCTION MD_b32 MD_TokenKindIsWhitespace(MD_TokenKind kind);
|
MD_FUNCTION MD_b32 MD_TokenKindIsWhitespace(MD_TokenKind kind);
|
||||||
|
|||||||
Reference in New Issue
Block a user