mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Started working on Toy_Scope, incomplete
I only worked for a couple hours today.
This commit is contained in:
28
source/toy_scope.h.txt
Normal file
28
source/toy_scope.h.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "toy_common.h"
|
||||
|
||||
#include "toy_bucket.h"
|
||||
#include "toy_value.h"
|
||||
#include "toy_string.h"
|
||||
#include "toy_table.h"
|
||||
|
||||
//wraps Toy_Table, restricting keys to name strings, and handles scopes as a linked list
|
||||
typedef struct Toy_Scope {
|
||||
struct Toy_Scope* next;
|
||||
Toy_Table* table;
|
||||
unsigned int refCount;
|
||||
} Toy_Scope;
|
||||
|
||||
//handle deep scopes
|
||||
TOY_API Toy_Scope* Toy_pushScope(Toy_Bucket** bucketHandle, Toy_Scope* scope);
|
||||
TOY_API Toy_Scope* Toy_popScope(Toy_Scope* scope);
|
||||
|
||||
TOY_API Toy_Scope* deepCopyScope(Toy_Bucket** bucketHandle, Toy_Scope* scope);
|
||||
|
||||
//manage the contents
|
||||
TOY_API void Toy_declareScope(Toy_Bucket** bucketHandle, Toy_Scope* scope, Toy_String key, Toy_Value value);
|
||||
TOY_API void Toy_assignScope(Toy_Bucket** bucketHandle, Toy_Scope* scope, Toy_String key, Toy_Value value);
|
||||
TOY_API Toy_Value Toy_accessScope(Toy_Bucket** bucketHandle, Toy_Scope* scope, Toy_String key);
|
||||
|
||||
TOY_API bool Toy_isDeclaredScope(Toy_Bucket** bucketHandle, Toy_Scope* scope, Toy_String key);
|
||||
Reference in New Issue
Block a user