diff options
author | hunt <hunt> | 2005-03-22 08:57:11 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-03-22 08:57:11 +0000 |
commit | b9c556e44326b40b2c927a0a5b5626332a8c9587 (patch) | |
tree | d0497c9323dedcb292d353d79fef769fa6fef210 /runtime/docs/html/map_8h-source.html | |
parent | 4a4753cb066f60eb09906a6021997ec280d3fdc5 (diff) | |
download | systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.gz systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.xz systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.zip |
*** empty log message ***
Diffstat (limited to 'runtime/docs/html/map_8h-source.html')
-rw-r--r-- | runtime/docs/html/map_8h-source.html | 286 |
1 files changed, 151 insertions, 135 deletions
diff --git a/runtime/docs/html/map_8h-source.html b/runtime/docs/html/map_8h-source.html index 7ecc890f..443fb9c9 100644 --- a/runtime/docs/html/map_8h-source.html +++ b/runtime/docs/html/map_8h-source.html @@ -1,146 +1,162 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> -<title>SystemTap: SystemTap Runtime Library</title> +<title>SystemTap: map.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> -<div class="qindex"><a class="qindex" href="index.html">Intro</a> | <a class="qindex" href="globals_func.html">Functions</a> | <a class="qindex" href="globals_defs.html">Defines</a> | <a class="qindex" href="globals_enum.html">Enumerations</a> | <a class="qindex" href="globals_eval.html">Enumeration Values</a></div> - <!-- Generated by Doxygen 1.4.1 --> -<h1>map.h</h1><a href="map_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/* -*- linux-c -*- */</span> -00002 <span class="preprocessor">#include <linux/types.h></span> -00003 -<a name="l00004"></a><a class="code" href="structstat.html">00004</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00005"></a><a class="code" href="structstat.html#o0">00005</a> int64_t count; -<a name="l00006"></a><a class="code" href="structstat.html#o1">00006</a> int64_t sum; -<a name="l00007"></a><a class="code" href="structstat.html#o2">00007</a> int64_t min, max; -<a name="l00008"></a><a class="code" href="structstat.html#o4">00008</a> int64_t histogram[BUCKETS]; -00009 } <a class="code" href="structstat.html">stat</a>; -00010 -<a name="l00011"></a><a class="code" href="unionkey__data.html">00011</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> { -<a name="l00012"></a><a class="code" href="unionkey__data.html#o0">00012</a> <span class="keywordtype">long</span> <a class="code" href="unionkey__data.html#o0">val</a>; -<a name="l00013"></a><a class="code" href="unionkey__data.html#o1">00013</a> <span class="keywordtype">char</span> *<a class="code" href="unionkey__data.html#o1">str</a>; -00014 }; -00015 -<a name="l00016"></a><a class="code" href="map_8h.html#a18">00016</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> { <a class="code" href="map_8h.html#a18a11">NONE</a>, <a class="code" href="map_8h.html#a18a12">LONG</a>, <a class="code" href="map_8h.html#a18a13">STR</a> } __attribute__ ((packed)); -<a name="l00017"></a><a class="code" href="map_8h.html#a19">00017</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a19">valtype</a> { <a class="code" href="map_8h.html#a19a14">INT64</a>, <a class="code" href="map_8h.html#a19a15">STAT</a>, <a class="code" href="map_8h.html#a19a16">STRING</a>, <a class="code" href="map_8h.html#a19a17">END</a> }; -00018 -00019 <span class="comment">/* all map nodes have the following structure */</span> -<a name="l00020"></a><a class="code" href="structmap__node.html">00020</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> { -<a name="l00021"></a><a class="code" href="structmap__node.html#o0">00021</a> <span class="keyword">struct </span>list_head lnode; -<a name="l00022"></a><a class="code" href="structmap__node.html#o1">00022</a> <span class="keyword">struct </span>hlist_node hnode; -<a name="l00023"></a><a class="code" href="structmap__node.html#o2">00023</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key1; -<a name="l00024"></a><a class="code" href="structmap__node.html#o3">00024</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key2; -<a name="l00025"></a><a class="code" href="structmap__node.html#o4">00025</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> <a class="code" href="structmap__node.html#o4">key1type</a>; -<a name="l00026"></a><a class="code" href="structmap__node.html#o5">00026</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> <a class="code" href="structmap__node.html#o5">key2type</a>; -00027 }; -00028 -00029 <span class="comment">/* specific map nodes with data attached */</span> -<a name="l00030"></a><a class="code" href="structmap__node__int64.html">00030</a> <span class="keyword">struct </span><a class="code" href="structmap__node__int64.html">map_node_int64</a> { -<a name="l00031"></a><a class="code" href="structmap__node__int64.html#o0">00031</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; -<a name="l00032"></a><a class="code" href="structmap__node__int64.html#o1">00032</a> int64_t <a class="code" href="structmap__node__int64.html#o1">val</a>; -00033 }; -00034 -<a name="l00035"></a><a class="code" href="structmap__node__str.html">00035</a> <span class="keyword">struct </span><a class="code" href="structmap__node__str.html">map_node_str</a> { -<a name="l00036"></a><a class="code" href="structmap__node__str.html#o0">00036</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; -<a name="l00037"></a><a class="code" href="structmap__node__str.html#o1">00037</a> <span class="keywordtype">char</span> *<a class="code" href="structmap__node__str.html#o1">str</a>; -00038 }; -00039 -<a name="l00040"></a><a class="code" href="structmap__node__stat.html">00040</a> <span class="keyword">struct </span><a class="code" href="structmap__node__stat.html">map_node_stat</a> { -<a name="l00041"></a><a class="code" href="structmap__node__stat.html#o0">00041</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; -<a name="l00042"></a><a class="code" href="structmap__node__stat.html#o1">00042</a> <a class="code" href="structstat.html">stat</a> <a class="code" href="structmap__node__stat.html#o1">stats</a>; -00043 }; -00044 -<a name="l00045"></a><a class="code" href="structmap__root.html">00045</a> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> { -00046 <span class="comment">/* type of the values stored in the array */</span> -<a name="l00047"></a><a class="code" href="structmap__root.html#o0">00047</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a19">valtype</a> <a class="code" href="structmap__root.html#o0">type</a>; +<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div> +<h1>map.h</h1><a href="map_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span> +00002 <span class="comment">/** @file map.h</span> +00003 <span class="comment"> * @brief Header file for maps and lists</span> +00004 <span class="comment"> */</span> +00005 +00006 <span class="preprocessor">#include <linux/types.h></span> +00007 <span class="comment"></span> +00008 <span class="comment">/** Statistics are stored in this struct</span> +00009 <span class="comment">*/</span> +<a name="l00010"></a><a class="code" href="structstat.html">00010</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ +00011 int64_t count; +00012 int64_t sum; +00013 int64_t min, max; +00014 int64_t histogram[BUCKETS]; +00015 } <a class="code" href="structstat.html">stat</a>; +00016 <span class="comment"></span> +00017 <span class="comment">/** Keys are either longs or char *</span> +00018 <span class="comment"> */</span> +<a name="l00019"></a><a class="code" href="unionkey__data.html">00019</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> { +00020 <span class="keywordtype">long</span> val; +00021 <span class="keywordtype">char</span> *str; +00022 }; +00023 +00024 <span class="keyword">enum</span> keytype { NONE, LONG, STR } __attribute__ ((packed)); +00025 <span class="keyword">enum</span> valtype { INT64, STAT, STRING, END }; +00026 <span class="comment"></span> +00027 <span class="comment">/** all map nodes have the following structure </span> +00028 <span class="comment">*/</span> +<a name="l00029"></a><a class="code" href="structmap__node.html">00029</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> { +00030 <span class="keyword">struct </span>list_head lnode; +00031 <span class="keyword">struct </span>hlist_node hnode; +00032 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key1; +00033 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> key2; +00034 <span class="keyword">enum</span> keytype key1type; +00035 <span class="keyword">enum</span> keytype key2type; +00036 }; +00037 +00038 <span class="comment">/* specific map nodes with data attached */</span> +00039 <span class="keyword">struct </span>map_node_int64 { +00040 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; +00041 int64_t val; +00042 }; +00043 +00044 <span class="keyword">struct </span>map_node_str { +00045 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; +00046 <span class="keywordtype">char</span> *str; +00047 }; 00048 -00049 <span class="comment">/* maximum number of elements allowed in the array. */</span> -<a name="l00050"></a><a class="code" href="structmap__root.html#o1">00050</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o1">maxnum</a>; -00051 -00052 <span class="comment">/* current number of elements */</span> -<a name="l00053"></a><a class="code" href="structmap__root.html#o2">00053</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o2">num</a>; -00054 -00055 <span class="comment">/* when more than maxnum elements, wrap or discard */</span> -<a name="l00056"></a><a class="code" href="structmap__root.html#o3">00056</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o3">no_wrap</a>; -00057 -00058 <span class="comment">/* linked list of current entries */</span> -<a name="l00059"></a><a class="code" href="structmap__root.html#o4">00059</a> <span class="keyword">struct </span>list_head head; +00049 <span class="keyword">struct </span>map_node_stat { +00050 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> n; +00051 <a class="code" href="structstat.html">stat</a> stats; +00052 }; +00053 <span class="comment"></span> +00054 <span class="comment">/** This structure contains all information about a map.</span> +00055 <span class="comment"> * It is allocated once when _stp_map_new() is called.</span> +00056 <span class="comment"> */</span> +<a name="l00057"></a><a class="code" href="structmap__root.html">00057</a> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> { +00058 <span class="keyword">enum</span> valtype type; <span class="comment">/** type of the values stored in the array */</span> +<a name="l00059"></a><a class="code" href="structmap__root.html#o1">00059</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o1">maxnum</a>; <span class="comment">/** maximum number of elements allowed in the array. */</span> 00060 -00061 <span class="comment">/* pool of unused entries. Used only when entries are statically allocated */</span> -00062 <span class="comment">/* at startup. */</span> -<a name="l00063"></a><a class="code" href="structmap__root.html#o5">00063</a> <span class="keyword">struct </span>list_head pool; -00064 -00065 <span class="comment">/* saved key entry for lookups */</span> -<a name="l00066"></a><a class="code" href="structmap__root.html#o6">00066</a> <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *<a class="code" href="structmap__root.html#o6">key</a>; -00067 -00068 <span class="comment">/* this is the creation data saved between the key functions and the */</span> -00069 <span class="comment">/* set/get functions */</span> -<a name="l00070"></a><a class="code" href="structmap__root.html#o7">00070</a> u_int8_t <a class="code" href="structmap__root.html#o7">create</a>; -<a name="l00071"></a><a class="code" href="structmap__root.html#o8">00071</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> <a class="code" href="structmap__root.html#o8">c_key1type</a>; -<a name="l00072"></a><a class="code" href="structmap__root.html#o9">00072</a> <span class="keyword">enum</span> <a class="code" href="map_8h.html#a18">keytype</a> <a class="code" href="structmap__root.html#o9">c_key2type</a>; -<a name="l00073"></a><a class="code" href="structmap__root.html#o10">00073</a> <span class="keyword">struct </span>hlist_head *<a class="code" href="structmap__root.html#o10">c_keyhead</a>; -<a name="l00074"></a><a class="code" href="structmap__root.html#o11">00074</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key1; -<a name="l00075"></a><a class="code" href="structmap__root.html#o12">00075</a> <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key2; +00061 <span class="comment">/* current number of elements */</span> +<a name="l00062"></a><a class="code" href="structmap__root.html#o2">00062</a> <span class="keywordtype">int</span> <a class="code" href="structmap__root.html#o2">num</a>; +00063 +00064 <span class="comment">/* when more than maxnum elements, wrap or discard */</span> +00065 <span class="keywordtype">int</span> no_wrap; +00066 +00067 <span class="comment">/* linked list of current entries */</span> +00068 <span class="keyword">struct </span>list_head head; +00069 +00070 <span class="comment">/* pool of unused entries. Used only when entries are statically allocated */</span> +00071 <span class="comment">/* at startup. */</span> +00072 <span class="keyword">struct </span>list_head pool; +00073 +00074 <span class="comment">/* saved key entry for lookups */</span> +00075 <span class="keyword">struct </span><a class="code" href="structmap__node.html">map_node</a> *key; 00076 -00077 <span class="comment">/* the hash table for this array */</span> -<a name="l00078"></a><a class="code" href="structmap__root.html#o13">00078</a> <span class="keyword">struct </span>hlist_head hashes[HASH_TABLE_SIZE]; -00079 -00080 <span class="comment">/* pointer to allocated memory space */</span> -<a name="l00081"></a><a class="code" href="structmap__root.html#o14">00081</a> <span class="keywordtype">void</span> *<a class="code" href="structmap__root.html#o14">membuf</a>; -00082 }; -00083 -<a name="l00084"></a><a class="code" href="map_8h.html#a10">00084</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> *<a class="code" href="structmap__root.html">MAP</a>; +00077 <span class="comment">/* this is the creation data saved between the key functions and the */</span> +00078 <span class="comment">/* set/get functions */</span> +00079 u_int8_t create; +00080 <span class="keyword">enum</span> keytype c_key1type; +00081 <span class="keyword">enum</span> keytype c_key2type; +00082 <span class="keyword">struct </span>hlist_head *c_keyhead; +00083 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key1; +00084 <span class="keyword">union </span><a class="code" href="unionkey__data.html">key_data</a> c_key2; 00085 -<a name="l00086"></a><a class="code" href="map_8h.html#a0">00086</a> <span class="preprocessor">#define key1str(ptr) (ptr->n.key1.str)</span> -<a name="l00087"></a><a class="code" href="map_8h.html#a1">00087</a> <span class="preprocessor"></span><span class="preprocessor">#define key2str(ptr) (ptr->n.key2.str)</span> -<a name="l00088"></a><a class="code" href="map_8h.html#a2">00088</a> <span class="preprocessor"></span><span class="preprocessor">#define key1int(ptr) (ptr->n.key1.val)</span> -<a name="l00089"></a><a class="code" href="map_8h.html#a3">00089</a> <span class="preprocessor"></span><span class="preprocessor">#define key2int(ptr) (ptr->n.key2.val)</span> -00090 <span class="preprocessor"></span> -<a name="l00091"></a><a class="code" href="map_8h.html#a4">00091</a> <span class="preprocessor">#define _stp_map_key2(map, key1, key2) \</span> -00092 <span class="preprocessor"> ({ \</span> -00093 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key1), char[])) \</span> -00094 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> -00095 <span class="preprocessor"> _stp_map_key_str_str (map, (char *)(key1), (char *)(key2)); \</span> -00096 <span class="preprocessor"> else \</span> -00097 <span class="preprocessor"> _stp_map_key_str_long (map, (char *)(key1), (long)(key2)); \</span> -00098 <span class="preprocessor"> else \</span> -00099 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> -00100 <span class="preprocessor"> _stp_map_key_long_str (map, (long)(key1), (char *)(key2)); \</span> -00101 <span class="preprocessor"> else \</span> -00102 <span class="preprocessor"> _stp_map_key_long_long (map, (long)(key1), (long)(key2)); \</span> -00103 <span class="preprocessor"> })</span> -00104 <span class="preprocessor"></span> -<a name="l00105"></a><a class="code" href="map_8h.html#a5">00105</a> <span class="preprocessor">#define _stp_map_key(map, key) \</span> -00106 <span class="preprocessor"> ({ \</span> -00107 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key), char[])) \</span> -00108 <span class="preprocessor"> _stp_map_key_str (map, (char *)(key)); \</span> +00086 <span class="comment">/* the hash table for this array */</span> +00087 <span class="keyword">struct </span>hlist_head hashes[HASH_TABLE_SIZE]; +00088 +00089 <span class="comment">/* pointer to allocated memory space */</span> +00090 <span class="keywordtype">void</span> *membuf; +00091 }; +00092 <span class="comment"></span> +00093 <span class="comment">/** All maps are of this type.</span> +00094 <span class="comment"> */</span> +<a name="l00095"></a><a class="code" href="map_8h.html#a10">00095</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structmap__root.html">map_root</a> *<a class="code" href="structmap__root.html">MAP</a>; +00096 +00097 <span class="preprocessor">#define key1str(ptr) (ptr->n.key1.str)</span> +00098 <span class="preprocessor"></span><span class="preprocessor">#define key2str(ptr) (ptr->n.key2.str)</span> +00099 <span class="preprocessor"></span><span class="preprocessor">#define key1int(ptr) (ptr->n.key1.val)</span> +00100 <span class="preprocessor"></span><span class="preprocessor">#define key2int(ptr) (ptr->n.key2.val)</span> +00101 <span class="preprocessor"></span> +00102 <span class="preprocessor">#define _stp_map_key2(map, key1, key2) \</span> +00103 <span class="preprocessor"> ({ \</span> +00104 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key1), char[])) \</span> +00105 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> +00106 <span class="preprocessor"> _stp_map_key_str_str (map, (char *)(key1), (char *)(key2)); \</span> +00107 <span class="preprocessor"> else \</span> +00108 <span class="preprocessor"> _stp_map_key_str_long (map, (char *)(key1), (long)(key2)); \</span> 00109 <span class="preprocessor"> else \</span> -00110 <span class="preprocessor"> _stp_map_key_long (map, (long)(key)); \</span> -00111 <span class="preprocessor"> })</span> -00112 <span class="preprocessor"></span> -<a name="l00113"></a><a class="code" href="map_8h.html#a6">00113</a> <span class="preprocessor">#define _stp_map_set(map, val) \</span> -00114 <span class="preprocessor"> ({ \</span> -00115 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> -00116 <span class="preprocessor"> _stp_map_set_str (map, (char *)(val)); \</span> -00117 <span class="preprocessor"> else \</span> -00118 <span class="preprocessor"> _stp_map_set_int64 (map, (int64_t)(val)); \</span> -00119 <span class="preprocessor"> })</span> -00120 <span class="preprocessor"></span> -<a name="l00121"></a><a class="code" href="map_8h.html#a7">00121</a> <span class="preprocessor">#define _stp_list_add(map, val) \</span> -00122 <span class="preprocessor"> ({ \</span> -00123 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> -00124 <span class="preprocessor"> _stp_list_add_str (map, (char *)(val)); \</span> -00125 <span class="preprocessor"> else \</span> -00126 <span class="preprocessor"> _stp_list_add_int64 (map, (int64_t)(val)); \</span> -00127 <span class="preprocessor"> })</span> -00128 <span class="preprocessor"></span> -00129 -<a name="l00138"></a><a class="code" href="map_8h.html#a8">00138</a> <span class="preprocessor">#define foreach(map, ptr) \</span> -00139 <span class="preprocessor"> for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \</span> -00140 <span class="preprocessor"> ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))</span> -00141 <span class="preprocessor"></span> -</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Mar 21 13:29:45 2005 for SystemTap by -<a href="http://www.doxygen.org/index.html"> -<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address> -</body> +00110 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key2), char[])) \</span> +00111 <span class="preprocessor"> _stp_map_key_long_str (map, (long)(key1), (char *)(key2)); \</span> +00112 <span class="preprocessor"> else \</span> +00113 <span class="preprocessor"> _stp_map_key_long_long (map, (long)(key1), (long)(key2)); \</span> +00114 <span class="preprocessor"> })</span> +00115 <span class="preprocessor"></span> +00116 <span class="preprocessor">#define _stp_map_key(map, key) \</span> +00117 <span class="preprocessor"> ({ \</span> +00118 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (key), char[])) \</span> +00119 <span class="preprocessor"> _stp_map_key_str (map, (char *)(key)); \</span> +00120 <span class="preprocessor"> else \</span> +00121 <span class="preprocessor"> _stp_map_key_long (map, (long)(key)); \</span> +00122 <span class="preprocessor"> })</span> +00123 <span class="preprocessor"></span> +00124 <span class="preprocessor">#define _stp_map_set(map, val) \</span> +00125 <span class="preprocessor"> ({ \</span> +00126 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> +00127 <span class="preprocessor"> _stp_map_set_str (map, (char *)(val)); \</span> +00128 <span class="preprocessor"> else \</span> +00129 <span class="preprocessor"> _stp_map_set_int64 (map, (int64_t)(val)); \</span> +00130 <span class="preprocessor"> })</span> +00131 <span class="preprocessor"></span> +00132 <span class="preprocessor">#define _stp_list_add(map, val) \</span> +00133 <span class="preprocessor"> ({ \</span> +00134 <span class="preprocessor"> if (__builtin_types_compatible_p (typeof (val), char[])) \</span> +00135 <span class="preprocessor"> _stp_list_add_str (map, (char *)(val)); \</span> +00136 <span class="preprocessor"> else \</span> +00137 <span class="preprocessor"> _stp_list_add_int64 (map, (int64_t)(val)); \</span> +00138 <span class="preprocessor"> })</span> +00139 <span class="preprocessor"></span> +00140 <span class="comment"></span> +00141 <span class="comment">/** Loop through all elements of a map.</span> +00142 <span class="comment"> * @param map </span> +00143 <span class="comment"> * @param ptr pointer to a map_node_stat, map_node_int64 or map_node_str</span> +00144 <span class="comment"> *</span> +00145 <span class="comment"> * @b Example:</span> +00146 <span class="comment"> * @include foreach.c</span> +00147 <span class="comment"> */</span> +00148 +<a name="l00149"></a><a class="code" href="map_8h.html#a8">00149</a> <span class="preprocessor">#define foreach(map, ptr) \</span> +00150 <span class="preprocessor"> for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \</span> +00151 <span class="preprocessor"> ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))</span> +00152 <span class="preprocessor"></span> +</pre></div><hr size="1"><address style="align: right;"><small> +Generated on Tue Mar 22 00:32:02 2005 for SystemTap.</small></body> </html> |