mirror of
https://github.com/Ed94/metadesk.git
synced 2026-06-13 07:52:22 -07: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
|
||||
|
||||
@enum MD_MessageKind: {
|
||||
Error,
|
||||
None,
|
||||
Warning,
|
||||
Error,
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ String-To-Node table
|
||||
|
||||
@enum MD_NodeTableCollisionRule: {
|
||||
@enum MD_MapCollisionRule: {
|
||||
Chain,
|
||||
Overwrite,
|
||||
}
|
||||
|
||||
@struct MD_NodeTableSlot: {
|
||||
next: *MD_NodeTableSlot,
|
||||
@struct MD_MapSlot: {
|
||||
next: *MD_MapSlot,
|
||||
hash: MD_u64,
|
||||
node: *MD_Node,
|
||||
key: *void;
|
||||
value: *void;
|
||||
};
|
||||
|
||||
@struct MD_NodeTable: {
|
||||
@struct MD_Map: {
|
||||
table_size: MD_u64,
|
||||
table: **MD_NodeTableSlot,
|
||||
table: **MD_MapSlot,
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
@@ -198,7 +200,7 @@
|
||||
Newline,
|
||||
WhitespaceMax,
|
||||
|
||||
MD_TokenKind_NonASCII,
|
||||
MD_TokenKind_BadCharacter,
|
||||
|
||||
MAX,
|
||||
};
|
||||
@@ -237,7 +239,7 @@
|
||||
at: *MD_u8,
|
||||
filename: MD_String8,
|
||||
file_contents: MD_String8,
|
||||
namespace_table: MD_NodeTable,
|
||||
namespace_table: MD_Map,
|
||||
selected_namespace: *MD_Node,
|
||||
catastrophic_error: MD_b32,
|
||||
};
|
||||
@@ -647,15 +649,15 @@
|
||||
////////////////////////////////
|
||||
//~ String-To-Node-List Table
|
||||
|
||||
@func MD_NodeTable_Lookup: {
|
||||
table: *MD_NodeTable,
|
||||
@func MD_Map_Lookup: {
|
||||
table: *MD_Map,
|
||||
string: MD_String8,
|
||||
return: *MD_NodeTableSlot,
|
||||
return: *MD_MapSlot,
|
||||
};
|
||||
|
||||
@func MD_NodeTable_Insert: {
|
||||
table: *MD_NodeTable,
|
||||
collision_rule: MD_NodeTableCollisionRule,
|
||||
@func MD_Map_Insert: {
|
||||
table: *MD_Map,
|
||||
collision_rule: MD_MapCollisionRule,
|
||||
string: MD_String8,
|
||||
node: *MD_Node,
|
||||
return: MD_b32,
|
||||
@@ -513,7 +513,7 @@ GeneratePageContent(MD_Map *index_table, SiteInfo *site_info, PageInfo *page_inf
|
||||
MD_Node *index_string = 0;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
//~ String-To-Node-List Table
|
||||
MD_FUNCTION MD_MapSlot *MD_NodeTable_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_MapSlot *MD_Map_Lookup(MD_Map *table, MD_String8 string);
|
||||
MD_FUNCTION MD_b32 MD_Map_Insert(MD_Map *table, MD_MapCollisionRule collision_rule, MD_String8 string, MD_Node *node);
|
||||
|
||||
//~ Parsing
|
||||
MD_FUNCTION MD_b32 MD_TokenKindIsWhitespace(MD_TokenKind kind);
|
||||
|
||||
Reference in New Issue
Block a user