]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/string_dictionary_aux.h
r4264@bucket (orig r254): kcr | 2008-01-20 22:11:44 -0500
[1ts-debian.git] / zephyr / zwgc / string_dictionary_aux.h
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It is one of the source files comprising zwgc, the Zephyr WindowGram
3  * client.
4  *
5  *      Created by:     Marc Horowitz <marc@athena.mit.edu>
6  *
7  *      $Id$
8  *
9  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
10  *      For copying and distribution information, see the file
11  *      "mit-copyright.h".
12  */
13
14 #ifndef string_dictionary_aux_MODULE
15 #define string_dictionary_aux_MODULE
16
17 #include "new_memory.h"
18 #include "string_dictionary.h"
19
20 /*
21  *    void string_dictionary_Set(string_dictionary d, string key,string value):
22  *        Modifies: d
23  *        Effects: Binds key to value in d.  Automatically free's the
24  *                 previous value of key, if any.  Value is copied on the
25  *                 heap.
26  */
27
28 extern void string__dictionary_Set(string_dictionary, string, string);
29 #ifdef DEBUG_MEMORY
30 #define string_dictionary_Set(a,b,c)         (set_module(__FILE__,__LINE__),\
31                                               string__dictionary_Set(a,b,c))
32 #else
33 #define string_dictionary_Set(a,b,c)         string__dictionary_Set(a,b,c)
34 #endif
35
36 /*
37  *    char *string_dictionary_Fetch(string_dictionary d, string key)
38  *        Effects: If key is not bound in d, returns 0.  Otherwise,
39  *                 returns the value that key is bound to.  
40  *                 Note that the returned string if any should not be
41  *                 freed or modified in any way.  Note also that it may
42  *                 disappear later if key is rebound.
43  */
44
45 extern char *string_dictionary_Fetch(string_dictionary,
46                                      string);
47
48 /*
49  *    void string_dictionary_SafeDestroy(string_dictionary d)
50  *        Modifies: d
51  *        Effects: Like string_dictionary_Destroy except first frees
52  *                 all value's in the dictionary.
53  */
54
55 extern void string_dictionary_SafeDestroy(string_dictionary);
56
57 #endif