Object inspection functions

Object inspection functions — Functions to inspect an object for debugging.

Synopsis

void                gcut_inspect_direct                 (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_int                    (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_uint                   (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_string                 (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_type                   (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_flags                  (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_enum                   (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);
void                gcut_inspect_pointer                (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Description

In test result, we need to know detail of inspected objects for debugging. Functions of this section help us to inspect interested objects.

Details

gcut_inspect_direct ()

void                gcut_inspect_direct                 (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as unsigned integer.

e.g.:

1
gcut_inspect_direct(string, GUINT_TO_POINTER(100), NULL) -> "100"

string :

the output string.

data :

the interested target.

user_data :

the data passed by user. (ignored)

Since 1.0.6


gcut_inspect_int ()

void                gcut_inspect_int                    (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as integer.

e.g.:

1
gcut_inspect_int(string, GINT_TO_POINTER(100), NULL) -> "100"

string :

the output string.

data :

the interested target.

user_data :

the data passed by user. (ignored)

Since 1.0.6


gcut_inspect_uint ()

void                gcut_inspect_uint                   (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as unsigned integer.

e.g.:

1
gcut_inspect_uint(string, GUINT_TO_POINTER(100), NULL) -> "100"

string :

the output string.

data :

the interested target.

user_data :

the data passed by user. (ignored)

Since 1.0.6


gcut_inspect_string ()

void                gcut_inspect_string                 (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as string. It also accepts NULL.

e.g.:

1
gcut_inspect_string(string, "string", NULL) -> "\"string\""

string :

the output string.

data :

the interested target.

user_data :

the data passed by user. (ignored)

Since 1.0.6


gcut_inspect_type ()

void                gcut_inspect_type                   (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as GType.

e.g.:

1
gcut_inspect_type(string, GTK_TYPE_WINDOW, NULL) -> "<GtkWindow>"

string :

the output string.

data :

the interested target.

user_data :

the data passed by user. (ignored)

Since 1.0.6


gcut_inspect_flags ()

void                gcut_inspect_flags                  (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as value a GFlags type.

e.g.:

1
2
3
4
5
6
7
GType flags_type;
GtkWidgetFlags flags;

flags_type = GTK_TYPE_WIDGET_FLAGS;
flags = GTK_TOPLEVEL | GTK_VISIBLE;
gcut_inspect_flags(string, &flags, &flags_type);
-> #<GtkWidgetFlags: toplevel|visible (GTK_TOPLEVEL:0x10)|(GTK_VISIBLE:0x100)>

string :

the output string.

data :

the interested target.

user_data :

the pointer of GFlags type.

Since 1.0.6


gcut_inspect_enum ()

void                gcut_inspect_enum                   (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as value of a GEnum type.

e.g.:

1
2
3
4
5
6
7
GType enum_type;
GtkWidgetHelpType value;

enum_type = GTK_TYPE_WIDGET_HELP_TYPE;
value = GTK_WIDGET_HELP_TOOLTIP;
gcut_inspect_enum(string, &value, &enum_type);
-> #<GtkWidgetHelpType: tooltip(GTK_WIDGET_HELP_TOOLTIP:0)>

string :

the output string.

data :

the interested target.

user_data :

the pointer of GEnum type.

Since 1.0.6


gcut_inspect_pointer ()

void                gcut_inspect_pointer                (GString *string,
                                                         gconstpointer data,
                                                         gpointer user_data);

Shows data as a pointer.

e.g.:

1
2
memory = malloc(1);
gcut_inspect_pointer(string, memory, NULL) -> "#<0xXXXXXXX>"

string :

the output string.

data :

the interested target.

user_data :

the data passed by user. (ignored)

Since 1.0.6