Skip to content

Commit 475308e

Browse files
Add comments explaining that some single-use wrappers are meant for extensions (closes #219)
1 parent 8a720ce commit 475308e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/env.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ typedef struct Env {
3232
} Env;
3333

3434
Env *env_create(Env *parent);
35+
// Kept to make extension development easier.
3536
void env_retain(Env *env);
3637
void env_free(Env *env);
3738

3839
bool env_define(Env *env, const char *name, DeclType type, int base, Value template);
3940
bool env_assign(Env *env, const char *name, Value value, DeclType type, int type_base, bool declare_if_missing);
4041
bool env_get(Env *env, const char *name, Value *out_value, DeclType *out_type, int *out_base, bool *out_initialized);
4142
bool env_delete(Env *env, const char *name);
43+
// Kept to make extension development easier.
4244
bool env_exists(Env *env, const char *name);
4345
// Return a per-thread snapshot of the EnvEntry for the given name, searching parents.
4446
// The snapshot is safe to read after the function returns even when the
@@ -59,14 +61,19 @@ bool env_set_alias_cross(Env *env, const char *name, Env *target_env, const char
5961

6062
// Symbol freezing API
6163
// Returns 0 on success, -1 if the identifier was not found.
64+
// Kept to make extension development easier.
6265
int env_freeze(Env *env, const char *name);
6366
// Returns 0 on success, -1 if not found, -2 if identifier is permanently frozen
67+
// Kept to make extension development easier.
6468
int env_thaw(Env *env, const char *name);
6569
// Returns 0 on success, -1 if not found
70+
// Kept to make extension development easier.
6671
int env_permafreeze(Env *env, const char *name);
6772
// Returns -1 if permanently frozen, 1 if frozen, 0 if not frozen or not found
73+
// Kept to make extension development easier.
6874
int env_frozen_state(Env *env, const char *name);
6975
// Returns 1 if permanently frozen, 0 otherwise (or not found)
76+
// Kept to make extension development easier.
7077
int env_permafrozen(Env *env, const char *name);
7178

7279
// ---- Direct (unbuffered) entry points used by the namespace buffer ----

0 commit comments

Comments
 (0)