diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-17 11:44:08 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-17 11:44:08 +0100 |
commit | 35681d4e1d171117c9d4c2c4fd7d474b5871f81f (patch) | |
tree | 9abb180d6e35a961e7e798b08101fef59cab6c18 /test | |
parent | 5b80e3c687fb2b47b06d9ffe6ac07bec475d812a (diff) | |
download | uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.tar.gz uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.tar.bz2 uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.tar.xz uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.zip |
Rename struct_name_t to struct_name and create typedefs
Diffstat (limited to 'test')
-rw-r--r-- | test/control.c | 26 | ||||
-rw-r--r-- | test/enum.c | 10 | ||||
-rw-r--r-- | test/grab.c | 8 |
3 files changed, 22 insertions, 22 deletions
diff --git a/test/control.c b/test/control.c index 98daffd..449c4ea 100644 --- a/test/control.c +++ b/test/control.c @@ -13,8 +13,8 @@ typedef struct { int width; int height; int bits; - struct uca_camera_t *cam; - struct uca_t *uca; + struct uca_camera *cam; + struct uca *u; } ThreadData ; typedef struct { @@ -65,14 +65,14 @@ static void destroy(GtkWidget *widget, gpointer data) { ThreadData *td = (ThreadData *) data; td->running = FALSE; - uca_destroy(td->uca); + uca_destroy(td->u); gtk_main_quit(); } void *grab_thread(void *args) { ThreadData *data = (ThreadData *) args; - struct uca_camera_t *cam = data->cam; + struct uca_camera *cam = data->cam; while (data->running) { cam->grab(cam, (char *) data->buffer); @@ -99,7 +99,7 @@ static void on_toolbutton_run_clicked(GtkWidget *widget, gpointer args) data->cam->start_recording(data->cam); if (!g_thread_create(grab_thread, data, FALSE, &error)) { g_printerr("Failed to create thread: %s\n", error->message); - uca_destroy(data->uca); + uca_destroy(data->u); } } @@ -122,7 +122,7 @@ static void on_valuecell_edited(GtkCellRendererText *renderer, gchar *path, gcha GtkTreeIter iter; if (gtk_tree_model_get_iter(tree_model, &iter, tree_path)) { - struct uca_camera_t *cam = value_data->thread_data->cam; + struct uca_camera *cam = value_data->thread_data->cam; uint32_t prop_id; gtk_tree_model_get(tree_model, &iter, COLUMN_UCA_ID, &prop_id, -1); @@ -202,10 +202,10 @@ void find_recursively(GtkTreeStore *store, GtkTreeIter *root, GtkTreeIter *resul find_recursively(store, &iter, result, tokens, depth+1); } -void fill_tree_store(GtkTreeStore *tree_store, struct uca_camera_t *cam) +void fill_tree_store(GtkTreeStore *tree_store, struct uca_camera *cam) { GtkTreeIter iter, child; - struct uca_property_t *property; + struct uca_property *property; const size_t num_bytes = 256; gchar *value_string = g_malloc(num_bytes); guint8 value_8; @@ -259,7 +259,7 @@ void value_cell_data_func(GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkT uint32_t prop_id; gtk_tree_model_get(model, iter, COLUMN_UCA_ID, &prop_id, -1); - struct uca_property_t *property = uca_get_full_property(prop_id); + struct uca_property *property = uca_get_full_property(prop_id); if (property->access & uca_write) { g_object_set(cell, "mode", GTK_CELL_RENDERER_MODE_EDITABLE, NULL); g_object_set(GTK_CELL_RENDERER_TEXT(cell), "editable", TRUE, NULL); @@ -274,14 +274,14 @@ void value_cell_data_func(GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkT int main(int argc, char *argv[]) { - struct uca_t *uca = uca_init(NULL); - if (uca == NULL) { + struct uca *u = uca_init(NULL); + if (u == NULL) { g_print("Couldn't initialize frame grabber and/or cameras\n"); return 1; } int width, height, bits_per_sample; - struct uca_camera_t *cam = uca->cameras; + struct uca_camera *cam = u->cameras; cam->get_property(cam, UCA_PROP_WIDTH, &width, 0); cam->get_property(cam, UCA_PROP_HEIGHT, &height, 0); cam->get_property(cam, UCA_PROP_BITDEPTH, &bits_per_sample, 0); @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) td.height = height; td.bits = bits_per_sample; td.cam = cam; - td.uca = uca; + td.u = u; td.running = FALSE; g_signal_connect(window, "delete-event", diff --git a/test/enum.c b/test/enum.c index 88f226e..954b734 100644 --- a/test/enum.c +++ b/test/enum.c @@ -21,14 +21,14 @@ void print_level(int depth) int main(int argc, char *argv[]) { - struct uca_t *uca = uca_init(NULL); - if (uca == NULL) { + struct uca *u = uca_init(NULL); + if (u == NULL) { printf("Couldn't find a camera\n"); return 1; } /* take first camera */ - struct uca_camera_t *cam = uca->cameras; + struct uca_camera *cam = u->cameras; const size_t num_bytes = 256; char string_value[num_bytes]; @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) while (cam != NULL) { for (int i = 0; i < UCA_PROP_LAST; i++) { - struct uca_property_t *prop = uca_get_full_property(i); + struct uca_property *prop = uca_get_full_property(i); print_level(count_dots(prop->name)); printf("%s = ", prop->name); switch (prop->type) { @@ -68,6 +68,6 @@ int main(int argc, char *argv[]) cam = cam->next; } - uca_destroy(uca); + uca_destroy(u); return 0; } diff --git a/test/grab.c b/test/grab.c index 2994689..446a117 100644 --- a/test/grab.c +++ b/test/grab.c @@ -6,14 +6,14 @@ int main(int argc, char *argv[]) { - struct uca_t *uca = uca_init(NULL); - if (uca == NULL) { + struct uca *u = uca_init(NULL); + if (u == NULL) { printf("Couldn't find a camera\n"); return 1; } /* take first camera */ - struct uca_camera_t *cam = uca->cameras; + struct uca_camera *cam = u->cameras; uint32_t val = 1; cam->set_property(cam, UCA_PROP_EXPOSURE, &val); @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) cam->start_recording(cam); cam->grab(cam, (char *) buffer); cam->stop_recording(cam); - uca_destroy(uca); + uca_destroy(u); FILE *fp = fopen("out.raw", "wb"); fwrite(buffer, width*height, pixel_size, fp); |