1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Map_get ( MapPtr M, Map_item Index, Map_item* ValuePtr);

Index is used to access the Map. Either it is present or it is absent. If it is absent then ValuePtr->type will be Map_Undefined. (basically the empty entry that stopped the search). If found, then ValuePtr will point to the correct Map_item for the Value field.

----------------------------------------------------------------------------------- Map_set ( MapPtr M, Map_item Index, Map_item Value);

Adds Index and Value to the found entry supplied by Index. If that cell is already occupied by a term with the same Index but a different Value, the previous Value is discarded (freed, if a string)

IMAGE imgs/lec-15.sli01.gif

Index

Value

top.c and spell.c use <String, Integer> entries only, anagram.c uses <String, String> entries

March 1, 1999

Page 1

C201/TAM