Skip to content

Commit

Permalink
optscript: introduce opt_dict_known_and_get as new C API
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed Sep 1, 2024
1 parent 54733ef commit 82561b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dsl/optscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,12 @@ opt_dict_known_and_get_cstr (EsObject *dict, const char* name, EsObject **val)
return dict_op_known_and_get (dict, sym, val);
}

bool
opt_dict_known_and_get (EsObject *dict, EsObject *key, EsObject **val)
{
return dict_op_known_and_get (dict, key, val);
}

bool
opt_dict_foreach (EsObject *dict, bool (* fn) (EsObject *, EsObject *, void*), void *data)
{
Expand Down
1 change: 1 addition & 0 deletions dsl/optscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ unsigned int opt_vm_ostack_count (OptVM *vm);

EsObject *opt_dict_new (unsigned int size);
bool opt_dict_known_and_get_cstr (EsObject *dict, const char* name, EsObject **val);
bool opt_dict_known_and_get (EsObject *dict, EsObject *key, EsObject **val);
bool opt_dict_foreach (EsObject *dict, bool (* fn) (EsObject *, EsObject *, void*), void *data);
void opt_dict_def (EsObject *dict, EsObject *sym, EsObject *val);
bool opt_dict_undef (EsObject *dict, EsObject *sym);
Expand Down

0 comments on commit 82561b0

Please sign in to comment.