From 14dae9eabafb8c1725b9ab8ee6a8d4b7f0e0c902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Sun, 26 Jan 1997 17:21:35 -0800 Subject: [PATCH] low_mapping_string_lookup added Rev: src/mapping.c:1.10 Rev: src/mapping.h:1.3 --- src/mapping.c | 13 +++++++++++-- src/mapping.h | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mapping.c b/src/mapping.c index 8aaa8ed6b9..4739c11d85 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: mapping.c,v 1.9 1996/12/05 01:51:22 hubbe Exp $"); +RCSID("$Id: mapping.c,v 1.10 1997/01/27 01:21:34 hubbe Exp $"); #include "main.h" #include "types.h" #include "object.h" @@ -103,7 +103,7 @@ static void init_mapping(struct mapping *m, INT32 size) /* This function allocates an empty mapping with room for 'size' values */ -static struct mapping *allocate_mapping(int size) +struct mapping *allocate_mapping(int size) { struct mapping *m; @@ -465,6 +465,15 @@ struct svalue *low_mapping_lookup(struct mapping *m, return 0; } +struct svalue *low_mapping_string_lookup(struct mapping *m, + struct pike_string *p) +{ + struct svalue tmp; + tmp.type=T_STRING; + tmp.u.string=p; + return low_mapping_lookup(m, &tmp); +} + void mapping_index_no_free(struct svalue *dest, struct mapping *m, struct svalue *key) diff --git a/src/mapping.h b/src/mapping.h index 12d0a296ba..558e460aa4 100644 --- a/src/mapping.h +++ b/src/mapping.h @@ -25,6 +25,7 @@ struct mapping /* Prototypes begin here */ struct keypair; +struct mapping *allocate_mapping(int size); void really_free_mapping(struct mapping *m); void mapping_fix_type_field(struct mapping *m); void mapping_insert(struct mapping *m, @@ -38,6 +39,8 @@ void map_delete(struct mapping *m, void check_mapping_for_destruct(struct mapping *m); struct svalue *low_mapping_lookup(struct mapping *m, struct svalue *key); +struct svalue *low_mapping_string_lookup(struct mapping *m, + struct pike_string *p); void mapping_index_no_free(struct svalue *dest, struct mapping *m, struct svalue *key); -- GitLab