Intro | Functions | Defines | Enumerations | Enumeration Values

map.h File Reference

#include <linux/types.h>

Go to the source code of this file.

Defines

#define key1str(ptr)   (ptr->n.key1.str)
#define key2str(ptr)   (ptr->n.key2.str)
#define key1int(ptr)   (ptr->n.key1.val)
#define key2int(ptr)   (ptr->n.key2.val)
#define _stp_map_key2(map, key1, key2)
#define _stp_map_key(map, key)
#define _stp_map_set(map, val)
#define _stp_list_add(map, val)
#define foreach(map, ptr)
 Loop through all elements of a map.

Typedefs

typedef map_rootMAP

Enumerations

enum  keytype { NONE, LONG, STR }
enum  valtype { INT64, STAT, STRING, END }

Variables

enum keytype packed


Define Documentation

#define _stp_list_add map,
val   ) 
 

Value:

({                                                              \
    if (__builtin_types_compatible_p (typeof (val), char[]))    \
      _stp_list_add_str (map, (char *)(val));                           \
    else                                                        \
      _stp_list_add_int64 (map, (int64_t)(val));                        \
  })

Definition at line 121 of file map.h.

#define _stp_map_key map,
key   ) 
 

Value:

({                                                              \
    if (__builtin_types_compatible_p (typeof (key), char[]))    \
      _stp_map_key_str (map, (char *)(key));                            \
    else                                                        \
      _stp_map_key_long (map, (long)(key));                             \
  })

Definition at line 105 of file map.h.

#define _stp_map_key2 map,
key1,
key2   ) 
 

Value:

({                                                              \
    if (__builtin_types_compatible_p (typeof (key1), char[]))   \
      if (__builtin_types_compatible_p (typeof (key2), char[])) \
        _stp_map_key_str_str (map, (char *)(key1), (char *)(key2));     \
      else                                                      \
        _stp_map_key_str_long (map, (char *)(key1), (long)(key2));      \
    else                                                        \
      if (__builtin_types_compatible_p (typeof (key2), char[])) \
        _stp_map_key_long_str (map, (long)(key1), (char *)(key2));      \
      else                                                      \
        _stp_map_key_long_long (map, (long)(key1), (long)(key2));       \
  })

Definition at line 91 of file map.h.

#define _stp_map_set map,
val   ) 
 

Value:

({                                                              \
    if (__builtin_types_compatible_p (typeof (val), char[]))    \
      _stp_map_set_str (map, (char *)(val));                            \
    else                                                        \
      _stp_map_set_int64 (map, (int64_t)(val));                 \
  })

Definition at line 113 of file map.h.

#define foreach map,
ptr   ) 
 

Value:

for (ptr = (typeof(ptr))_stp_map_start(map); ptr; \
       ptr = (typeof(ptr))_stp_map_iter (map, (struct map_node *)ptr))
Loop through all elements of a map.

Parameters:
map 
ptr pointer to a map_node_stat, map_node_int64 or map_node_str
Example:
/* example showing how to print all the stats in a map using foreach() */

struct map_node_stat *ptr;

foreach (map, ptr)
     printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), 
             key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, 
             ptr->stats.max);

Definition at line 138 of file map.h.

#define key1int ptr   )     (ptr->n.key1.val)
 

Definition at line 88 of file map.h.

#define key1str ptr   )     (ptr->n.key1.str)
 

Definition at line 86 of file map.h.

#define key2int ptr   )     (ptr->n.key2.val)
 

Definition at line 89 of file map.h.

#define key2str ptr   )     (ptr->n.key2.str)
 

Definition at line 87 of file map.h.


Typedef Documentation

typedef struct map_root* MAP
 

Definition at line 84 of file map.h.


Enumeration Type Documentation

enum keytype
 

Enumeration values:
NONE 
LONG 
STR 

Definition at line 16 of file map.h.

enum valtype
 

Enumeration values:
INT64 
STAT 
STRING 
END 

Definition at line 17 of file map.h.


Variable Documentation

enum keytype packed
 


Generated on Mon Mar 21 13:29:45 2005 for SystemTap by  doxygen 1.4.1