From 3bb54d8917edc197b09fa93bce8a33c5e5287923 Mon Sep 17 00:00:00 2001 From: Pekka Pirinen Date: Tue, 27 Apr 1999 12:18:20 +0100 Subject: [PATCH] New unit Dictionary interface Copied from Perforce Change: 20751 ServerID: perforce.ravenbrook.com --- mps/src/table.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mps/src/table.h diff --git a/mps/src/table.h b/mps/src/table.h new file mode 100644 index 00000000000..adfeb86ae74 --- /dev/null +++ b/mps/src/table.h @@ -0,0 +1,27 @@ +/* impl.h.table: Interface for a dictionary + * Copyright (C) 1997, 1999 Harlequin Group plc. All rights reserved. + * + * $HopeName$ + */ + +#ifndef table_h +#define table_h + +#include "mpmtypes.h" +#include + + +typedef struct TableStruct *Table; + +extern Res TableCreate(Table *tableReturn, size_t length); +extern void TableDestroy(Table table); +extern Res TableDefine(Table table, Word key, void *value); +extern Res TableRedefine(Table table, Word key, void *value); +extern void *TableLookup(Table table, Word key); +extern void *TableSlowLookup(Table table, Word key); +extern Res TableRemove(Table table, Word key); +extern size_t TableCount(Table table); +extern void TableApply(Table table, void(*fun)(Word key, void *value)); + + +#endif /* table_h */