GDB (xrefs)

Classes | Macros | Typedefs | Functions
/tmp/gdb-8.1/gdb/registry.h File Reference

Go to the source code of this file.

## Classes
struct | registry_fields
struct | registry_data
struct | registry_data_registration
struct | registry_data_registry

## Macros
#define | REGISTRY_FIELDS struct registry_fields registry_data
#define | REGISTRY_ACCESS_FIELD(CONTAINER) (CONTAINER)
#define | DEFINE_REGISTRY(TAG, ACCESS)
#define | DECLARE_REGISTRY(TAG)

## Typedefs
typedef void(* | registry_data_callback) (struct registry_container *, void *)
typedef void(* | registry_callback_adaptor) (registry_data_callback func, struct registry_container *container, void *data)

## Functions
const struct registry_data * | register_data_with_cleanup (struct registry_data_registry *registry, registry_data_callback save, registry_data_callback free)
void | registry_alloc_data (struct registry_data_registry *registry, struct registry_fields *registry_fields)
void | registry_clear_data (struct registry_data_registry *data_registry, registry_callback_adaptor adaptor, struct registry_container *container, struct registry_fields *fields)
void | registry_container_free_data (struct registry_data_registry *data_registry, registry_callback_adaptor adaptor, struct registry_container *container, struct registry_fields *fields)
void | registry_set_data (struct registry_fields *fields, const struct registry_data *data, void *value)
void * | registry_data (struct registry_fields *fields, const struct registry_data *data)

## Macro Definition Documentation

## ◆ DECLARE_REGISTRY

#define DECLARE_REGISTRY | ( |  | TAG | ) |

Value:
struct TAG ## _data; \
typedef void (*registry_ ## TAG ## _callback) (struct TAG *, void *); \
extern const struct TAG ## _data *register_ ## TAG ## _data (void); \
extern const struct TAG ## _data *register_ ## TAG ## _data_with_cleanup \
(registry_ ## TAG ## _callback save, registry_ ## TAG ## _callback free); \
extern void clear_ ## TAG ## _data (struct TAG *); \
extern void set_ ## TAG ## _data (struct TAG *, \
const struct TAG ## _data *data, \
void *value); \
extern void *TAG ## _data (struct TAG *, \
const struct TAG ## _data *data);
free
void free(T *ptr)=delete
TAG
#define TAG(tag, text, kind)
value
Definition: value.c:169

Definition at line 240 of file registry.h.

## ◆ DEFINE_REGISTRY

#define DEFINE_REGISTRY | ( |  | TAG,
|  |  | ACCESS
| ) |  |

Definition at line 154 of file registry.h.

## ◆ REGISTRY_ACCESS_FIELD

#define REGISTRY_ACCESS_FIELD | ( |  | CONTAINER | ) | (CONTAINER)

Definition at line 85 of file registry.h.

## ◆ REGISTRY_FIELDS

#define REGISTRY_FIELDS struct registry_fields registry_data

Definition at line 78 of file registry.h.

## Typedef Documentation

## ◆ registry_callback_adaptor

typedef void(* registry_callback_adaptor) (registry_data_callback func, struct registry_container *container, void *data)

Definition at line 131 of file registry.h.

## ◆ registry_data_callback

typedef void(* registry_data_callback) (struct registry_container *, void *)

Definition at line 97 of file registry.h.

## Function Documentation

## ◆ register_data_with_cleanup()

const struct registry_data* register_data_with_cleanup | ( | struct registry_data_registry * | registry,
|  | registry_data_callback | save,
|  | registry_data_callback | free
| ) |  |

Definition at line 23 of file registry.c.

References free(), registry_data_registration::next, registry_data_registry::num_registrations, registry_data_registry::registrations, and XNEW.

## ◆ registry_alloc_data()

void registry_alloc_data | ( | struct registry_data_registry * | registry,
|  | struct registry_fields * | registry_fields
| ) |  |

Definition at line 46 of file registry.c.

References registry_fields::data, gdb_assert, registry_fields::num_data, registry_data_registry::num_registrations, and XCNEWVEC.

## ◆ registry_clear_data()

void registry_clear_data | ( | struct registry_data_registry * | data_registry,
|  | registry_callback_adaptor | adaptor,
|  | struct registry_container * | container,
|  | struct registry_fields * | fields
| ) |  |

Definition at line 55 of file registry.c.

References registry_fields::data, registry_data_registration::data, registry_data::free, gdb_assert, memset(), registry_data_registration::next, registry_fields::num_data, registry_data_registry::registrations, and registry_data::save.

Referenced by registry_container_free_data().

## ◆ registry_container_free_data()

void registry_container_free_data | ( | struct registry_data_registry * | data_registry,
|  | registry_callback_adaptor | adaptor,
|  | struct registry_container * | container,
|  | struct registry_fields * | fields
| ) |  |

Definition at line 85 of file registry.c.

References registry_fields::data, gdb_assert, registry_clear_data(), and xfree().

## ◆ registry_data()

void* registry_data | ( | struct registry_fields * | fields,
|  | const struct registry_data * | data
| ) |  |

Definition at line 107 of file registry.c.

References registry_fields::data, registry_data_registration::data, gdb_assert, registry_data::index, and registry_fields::num_data.

## ◆ registry_set_data()

void registry_set_data | ( | struct registry_fields * | fields,
|  | const struct registry_data * | data,
|  | void * | value
| ) |  |

Definition at line 98 of file registry.c.

References registry_fields::data, registry_data_registration::data, gdb_assert, registry_data::index, and registry_fields::num_data.