add __call__ support
This commit is contained in:
@@ -24,4 +24,9 @@ void add_field(ArgonObject *target, char *name, ArgonObject *object) {
|
||||
hashmap_insert_GC(target->dict,
|
||||
siphash64_bytes(name, strlen(name), siphash_key), name,
|
||||
object, 0);
|
||||
}
|
||||
|
||||
ArgonObject *get_field(ArgonObject *target, char *name) {
|
||||
uint64_t hash = siphash64_bytes(name, strlen(name), siphash_key);
|
||||
return hashmap_lookup_GC(target->dict, hash);
|
||||
}
|
||||
@@ -16,4 +16,7 @@ typedef struct ArgonObject ArgonObject;
|
||||
ArgonObject *new_object();
|
||||
|
||||
void add_field(ArgonObject *target, char *name, ArgonObject *object);
|
||||
|
||||
ArgonObject *get_field(ArgonObject *target, char *name);
|
||||
|
||||
#endif // OBJECT_H
|
||||
Reference in New Issue
Block a user