projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename "declaration" to "definition"
[babeltrace.git]
/
types
/
variant.c
diff --git
a/types/variant.c
b/types/variant.c
index ea20808b7205f1e31ea1fee4dce603e5584359bf..66c8f59f7051a0378360a2b947e61f6062bb11cb 100644
(file)
--- a/
types/variant.c
+++ b/
types/variant.c
@@
-1,5
+1,5
@@
/*
/*
-
* variant.c
+* variant.c
*
* BabelTrace - Variant Type Converter
*
*
* BabelTrace - Variant Type Converter
*
@@
-21,17
+21,17
@@
#include <errno.h>
static
#include <errno.h>
static
-struct de
claration *_variant_declara
tion_new(struct type *type,
- struct de
clara
tion_scope *parent_scope);
+struct de
finition *_variant_defini
tion_new(struct type *type,
+ struct de
fini
tion_scope *parent_scope);
static
static
-void _variant_de
claration_free(struct declaration *declara
tion);
+void _variant_de
finition_free(struct definition *defini
tion);
void variant_copy(struct stream_pos *dest, const struct format *fdest,
struct stream_pos *src, const struct format *fsrc,
void variant_copy(struct stream_pos *dest, const struct format *fdest,
struct stream_pos *src, const struct format *fsrc,
- struct de
claration *declara
tion)
+ struct de
finition *defini
tion)
{
{
- struct de
clara
tion_variant *variant =
- container_of(de
claration, struct declara
tion_variant, p);
+ struct de
fini
tion_variant *variant =
+ container_of(de
finition, struct defini
tion_variant, p);
struct type_variant *variant_type = variant->type;
struct field *field;
struct type *field_type;
struct type_variant *variant_type = variant->type;
struct field *field;
struct type *field_type;
@@
-40,8
+40,8
@@
void variant_copy(struct stream_pos *dest, const struct format *fdest,
fdest->variant_begin(dest, variant_type);
field = variant_get_current_field(variant);
fdest->variant_begin(dest, variant_type);
field = variant_get_current_field(variant);
- field_type = field->de
clara
tion->type;
- field_type->copy(dest, fdest, src, fsrc, field->de
clara
tion);
+ field_type = field->de
fini
tion->type;
+ field_type->copy(dest, fdest, src, fsrc, field->de
fini
tion);
fsrc->variant_end(src, variant_type);
fdest->variant_end(dest, variant_type);
fsrc->variant_end(src, variant_type);
fdest->variant_end(dest, variant_type);
@@
-86,28
+86,28
@@
struct type_variant *variant_type_new(const char *name,
type->alignment = 1;
type->copy = variant_copy;
type->type_free = _variant_type_free;
type->alignment = 1;
type->copy = variant_copy;
type->type_free = _variant_type_free;
- type->de
claration_new = _variant_declara
tion_new;
- type->de
claration_free = _variant_declara
tion_free;
+ type->de
finition_new = _variant_defini
tion_new;
+ type->de
finition_free = _variant_defini
tion_free;
type->ref = 1;
return variant_type;
}
static
type->ref = 1;
return variant_type;
}
static
-struct de
clara
tion *
- _variant_de
clara
tion_new(struct type *type,
-
struct declara
tion_scope *parent_scope)
+struct de
fini
tion *
+ _variant_de
fini
tion_new(struct type *type,
+
struct defini
tion_scope *parent_scope)
{
struct type_variant *variant_type =
container_of(type, struct type_variant, p);
{
struct type_variant *variant_type =
container_of(type, struct type_variant, p);
- struct de
clara
tion_variant *variant;
+ struct de
fini
tion_variant *variant;
unsigned long i;
unsigned long i;
- variant = g_new(struct de
clara
tion_variant, 1);
+ variant = g_new(struct de
fini
tion_variant, 1);
type_ref(&variant_type->p);
variant->p.type = type;
variant->type = variant_type;
variant->p.ref = 1;
type_ref(&variant_type->p);
variant->p.type = type;
variant->type = variant_type;
variant->p.ref = 1;
- variant->scope = new_de
clara
tion_scope(parent_scope);
+ variant->scope = new_de
fini
tion_scope(parent_scope);
variant->fields = g_array_sized_new(FALSE, TRUE,
sizeof(struct field),
DEFAULT_NR_STRUCT_FIELDS);
variant->fields = g_array_sized_new(FALSE, TRUE,
sizeof(struct field),
DEFAULT_NR_STRUCT_FIELDS);
@@
-120,8
+120,8
@@
struct declaration *
struct field, i);
field->name = type_field->name;
struct field, i);
field->name = type_field->name;
- field->de
clara
tion =
- type_field->type->de
clara
tion_new(type_field->type,
+ field->de
fini
tion =
+ type_field->type->de
fini
tion_new(type_field->type,
variant->scope);
}
variant->current_field = NULL;
variant->scope);
}
variant->current_field = NULL;
@@
-129,19
+129,19
@@
struct declaration *
}
static
}
static
-void _variant_de
claration_free(struct declaration *declara
tion)
+void _variant_de
finition_free(struct definition *defini
tion)
{
{
- struct de
clara
tion_variant *variant =
- container_of(de
claration, struct declara
tion_variant, p);
+ struct de
fini
tion_variant *variant =
+ container_of(de
finition, struct defini
tion_variant, p);
unsigned long i;
assert(variant->fields->len == variant->type->fields->len);
for (i = 0; i < variant->fields->len; i++) {
struct field *field = &g_array_index(variant->fields,
struct field, i);
unsigned long i;
assert(variant->fields->len == variant->type->fields->len);
for (i = 0; i < variant->fields->len; i++) {
struct field *field = &g_array_index(variant->fields,
struct field, i);
- de
claration_unref(field->declara
tion);
+ de
finition_unref(field->defini
tion);
}
}
- free_de
clara
tion_scope(variant->scope);
+ free_de
fini
tion_scope(variant->scope);
type_unref(variant->p.type);
g_free(variant);
}
type_unref(variant->p.type);
g_free(variant);
}
@@
-183,11
+183,11
@@
struct_type_get_field_from_tag(struct type_variant *variant_type, GQuark tag)
/*
* tag_instance is assumed to be an enumeration.
*/
/*
* tag_instance is assumed to be an enumeration.
*/
-int variant_de
claration_set_tag(struct declara
tion_variant *variant,
-
struct declara
tion *enum_tag)
+int variant_de
finition_set_tag(struct defini
tion_variant *variant,
+
struct defini
tion *enum_tag)
{
{
- struct de
clara
tion_enum *_enum =
- container_of(variant->enum_tag, struct de
clara
tion_enum, p);
+ struct de
fini
tion_enum *_enum =
+ container_of(variant->enum_tag, struct de
fini
tion_enum, p);
struct type_enum *enum_type = _enum->type;
int missing_field = 0;
unsigned long i;
struct type_enum *enum_type = _enum->type;
int missing_field = 0;
unsigned long i;
@@
-229,10
+229,10
@@
int variant_declaration_set_tag(struct declaration_variant *variant,
/*
* field returned only valid as long as the field structure is not appended to.
*/
/*
* field returned only valid as long as the field structure is not appended to.
*/
-struct field *variant_get_current_field(struct de
clara
tion_variant *variant)
+struct field *variant_get_current_field(struct de
fini
tion_variant *variant)
{
{
- struct de
clara
tion_enum *_enum =
- container_of(variant->enum_tag, struct de
clara
tion_enum, p);
+ struct de
fini
tion_enum *_enum =
+ container_of(variant->enum_tag, struct de
fini
tion_enum, p);
struct type_variant *variant_type = variant->type;
unsigned long index;
GArray *tag_array;
struct type_variant *variant_type = variant->type;
unsigned long index;
GArray *tag_array;
This page took
0.032824 seconds
and
4
git commands to generate.