summaryrefslogtreecommitdiff
path: root/legacy/eeze/src/bin
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2010-05-14 05:21:52 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2010-05-14 05:21:52 +0000
commit90b028d63c2359cfb20b671fc692a66af1ca2f12 (patch)
tree1697f6562387bdcc8af27e64eea153f5a280f1c6 /legacy/eeze/src/bin
parent308c35adac1a939cf054a1e9c463814d204bd2b8 (diff)
move/rename all files/functions/variables to eeze_udev for proper namespacing
SVN revision: 48845
Diffstat (limited to 'legacy/eeze/src/bin')
-rw-r--r--legacy/eeze/src/bin/Makefile.am10
-rw-r--r--legacy/eeze/src/bin/eeze_udev_test.c42
2 files changed, 26 insertions, 26 deletions
diff --git a/legacy/eeze/src/bin/Makefile.am b/legacy/eeze/src/bin/Makefile.am
index b328ad00b1..cba60d5c06 100644
--- a/legacy/eeze/src/bin/Makefile.am
+++ b/legacy/eeze/src/bin/Makefile.am
@@ -7,15 +7,15 @@ EEZE_CPPFLAGS = \
7LIBS = \ 7LIBS = \
8@ECORE_LIBS@ 8@ECORE_LIBS@
9 9
10if BUILD_EUDEV 10if BUILD_EEZE_UDEV
11EUDEV_PROG = eeze_udev_test 11EEZE_UDEV_PROG = eeze_udev_test
12endif 12endif
13 13
14bin_PROGRAMS = \ 14bin_PROGRAMS = \
15$(EUDEV_PROG) 15$(EEZE_UDEV_PROG)
16 16
17if BUILD_EUDEV 17if BUILD_EEZE_UDEV
18eeze_udev_test_SOURCES = eeze_udev_test.c 18eeze_udev_test_SOURCES = eeze_udev_test.c
19eeze_udev_test_CPPFLAGS = $(EEZE_CPPFLAGS) 19eeze_udev_test_CPPFLAGS = $(EEZE_CPPFLAGS)
20eeze_udev_test_LDADD = $(top_builddir)/src/lib/udev/libeudev.la 20eeze_udev_test_LDADD = $(top_builddir)/src/lib/udev/libeeze_udev.la
21endif 21endif
diff --git a/legacy/eeze/src/bin/eeze_udev_test.c b/legacy/eeze/src/bin/eeze_udev_test.c
index 4a3cc6da6e..e6e91022bf 100644
--- a/legacy/eeze/src/bin/eeze_udev_test.c
+++ b/legacy/eeze/src/bin/eeze_udev_test.c
@@ -1,4 +1,4 @@
1#include <E_Udev.h> 1#include <Eeze_Udev.h>
2#include <Ecore.h> 2#include <Ecore.h>
3#include <stdio.h> 3#include <stdio.h>
4 4
@@ -28,7 +28,7 @@ catch_events(const char *device, const char *event, void *data, Eudev_Watch *wat
28 if (strstr(device, name)) goto end; 28 if (strstr(device, name)) goto end;
29 29
30 /* check to see if the device was just plugged in */ 30 /* check to see if the device was just plugged in */
31 if (e_udev_syspath_is_kbd(device) || e_udev_syspath_is_mouse(device)) 31 if (eeze_udev_syspath_is_kbd(device) || eeze_udev_syspath_is_mouse(device))
32 { 32 {
33 new = 1; 33 new = 1;
34 goto end; 34 goto end;
@@ -46,7 +46,7 @@ end:
46 */ 46 */
47 if (new) 47 if (new)
48 { 48 {
49 dev = e_udev_syspath_get_devpath(device); 49 dev = eeze_udev_syspath_get_devpath(device);
50 type = "plugged in"; 50 type = "plugged in";
51 } 51 }
52 else 52 else
@@ -66,9 +66,9 @@ end:
66 /* and quit the main loop */ 66 /* and quit the main loop */
67 ecore_main_loop_quit(); 67 ecore_main_loop_quit();
68 /* and delete the watch */ 68 /* and delete the watch */
69 e_udev_watch_del(watch); 69 eeze_udev_watch_del(watch);
70 /* and shut down eudev */ 70 /* and shut down eudev */
71 e_udev_shutdown(); 71 eeze_udev_shutdown();
72} 72}
73 73
74static void 74static void
@@ -85,7 +85,7 @@ int main()
85 Eina_Hash *hash; 85 Eina_Hash *hash;
86 86
87 ecore_init(); 87 ecore_init();
88 e_udev_init(); 88 eeze_udev_init();
89 89
90 hash = eina_hash_stringshared_new(hash_free); 90 hash = eina_hash_stringshared_new(hash_free);
91 akbdmouse = malloc(sizeof(kbdmouse)); 91 akbdmouse = malloc(sizeof(kbdmouse));
@@ -93,10 +93,10 @@ int main()
93 93
94 printf("For my first trick, I will find all of your keyboards and return their syspaths.\n"); 94 printf("For my first trick, I will find all of your keyboards and return their syspaths.\n");
95 /* find all keyboards using type EUDEV_TYPE_KEYBOARD */ 95 /* find all keyboards using type EUDEV_TYPE_KEYBOARD */
96 type = e_udev_find_by_type(EUDEV_TYPE_KEYBOARD, NULL); 96 type = eeze_udev_find_by_type(EUDEV_TYPE_KEYBOARD, NULL);
97 EINA_LIST_FOREACH(type, l, name) 97 EINA_LIST_FOREACH(type, l, name)
98 { /* add the devpath to the hash for use in the cb later */ 98 { /* add the devpath to the hash for use in the cb later */
99 eina_hash_direct_add(hash, name, e_udev_syspath_get_devpath(name)); 99 eina_hash_direct_add(hash, name, eeze_udev_syspath_get_devpath(name));
100 printf("Found keyboard: %s\n", name); 100 printf("Found keyboard: %s\n", name);
101 } 101 }
102 /* we save this list for later, because once a device is unplugged it can 102 /* we save this list for later, because once a device is unplugged it can
@@ -107,11 +107,11 @@ int main()
107 107
108 printf("\nNext, I will find all of your mice and print the corresponding manufacturer.\n"); 108 printf("\nNext, I will find all of your mice and print the corresponding manufacturer.\n");
109 /* find all mice using type EUDEV_TYPE_MOUSE */ 109 /* find all mice using type EUDEV_TYPE_MOUSE */
110 type = e_udev_find_by_type(EUDEV_TYPE_MOUSE, NULL); 110 type = eeze_udev_find_by_type(EUDEV_TYPE_MOUSE, NULL);
111 EINA_LIST_FOREACH(type, l, name) 111 EINA_LIST_FOREACH(type, l, name)
112 { /* add the devpath to the hash for use in the cb later */ 112 { /* add the devpath to the hash for use in the cb later */
113 eina_hash_direct_add(hash, name, e_udev_syspath_get_devpath(name)); /* get a property using the device's syspath */ 113 eina_hash_direct_add(hash, name, eeze_udev_syspath_get_devpath(name)); /* get a property using the device's syspath */
114 printf("Found mouse %s with vendor: %s\n", name, e_udev_syspath_get_property(name, "ID_VENDOR")); 114 printf("Found mouse %s with vendor: %s\n", name, eeze_udev_syspath_get_property(name, "ID_VENDOR"));
115 } 115 }
116 /* we save this list for later, because once a device is unplugged it can 116 /* we save this list for later, because once a device is unplugged it can
117 * no longer be detected by udev, and any related properties are unusable unless 117 * no longer be detected by udev, and any related properties are unusable unless
@@ -121,13 +121,13 @@ int main()
121 121
122 printf("\nNow let's try something a little more difficult. Mountable filesystems!\n"); 122 printf("\nNow let's try something a little more difficult. Mountable filesystems!\n");
123 /* find all mountable drives using type EUDEV_TYPE_DRIVE_MOUNTABLE */ 123 /* find all mountable drives using type EUDEV_TYPE_DRIVE_MOUNTABLE */
124 type = e_udev_find_by_type(EUDEV_TYPE_DRIVE_MOUNTABLE, NULL); 124 type = eeze_udev_find_by_type(EUDEV_TYPE_DRIVE_MOUNTABLE, NULL);
125 EINA_LIST_FOREACH(type, l, name) 125 EINA_LIST_FOREACH(type, l, name)
126 { 126 {
127 printf("Found device: %s\n", name); /* get a property using the device's syspath */ 127 printf("Found device: %s\n", name); /* get a property using the device's syspath */
128 printf("\tYou probably know it better as %s\n", e_udev_syspath_get_property(name, "DEVNAME")); 128 printf("\tYou probably know it better as %s\n", eeze_udev_syspath_get_property(name, "DEVNAME"));
129 printf("\tIt's formatted as %s", e_udev_syspath_get_property(name, "ID_FS_TYPE")); 129 printf("\tIt's formatted as %s", eeze_udev_syspath_get_property(name, "ID_FS_TYPE"));
130 check = e_udev_syspath_get_property(name, "FSTAB_DIR"); 130 check = eeze_udev_syspath_get_property(name, "FSTAB_DIR");
131 if (check) 131 if (check)
132 printf(", and gets mounted at %s", check); 132 printf(", and gets mounted at %s", check);
133 printf("!\n"); 133 printf("!\n");
@@ -136,17 +136,17 @@ int main()
136 136
137 printf("\nInternal drives, anyone? With serial numbers?\n"); 137 printf("\nInternal drives, anyone? With serial numbers?\n");
138 /* find all internal drives using type EUDEV_TYPE_DRIVE_INTERNAL */ 138 /* find all internal drives using type EUDEV_TYPE_DRIVE_INTERNAL */
139 type = e_udev_find_by_type(EUDEV_TYPE_DRIVE_INTERNAL, NULL); 139 type = eeze_udev_find_by_type(EUDEV_TYPE_DRIVE_INTERNAL, NULL);
140 EINA_LIST_FOREACH(type, l, name) /* get a property using the device's syspath */ 140 EINA_LIST_FOREACH(type, l, name) /* get a property using the device's syspath */
141 printf("%s: %s\n", name, e_udev_syspath_get_property(name, "ID_SERIAL")); 141 printf("%s: %s\n", name, eeze_udev_syspath_get_property(name, "ID_SERIAL"));
142 eina_list_free(type); 142 eina_list_free(type);
143 143
144 printf("\nGot any removables? I'm gonna find em!\n"); 144 printf("\nGot any removables? I'm gonna find em!\n");
145 /* find all removable media using type EUDEV_TYPE_DRIVE_REMOVABLE */ 145 /* find all removable media using type EUDEV_TYPE_DRIVE_REMOVABLE */
146 type = e_udev_find_by_type(EUDEV_TYPE_DRIVE_REMOVABLE, NULL); 146 type = eeze_udev_find_by_type(EUDEV_TYPE_DRIVE_REMOVABLE, NULL);
147 EINA_LIST_FOREACH(type, l, name) /* get a property using the device's syspath */ 147 EINA_LIST_FOREACH(type, l, name) /* get a property using the device's syspath */
148 printf("\tOoh, a %s attached on your %s bus!\n", e_udev_syspath_get_property(name, "ID_MODEL"), 148 printf("\tOoh, a %s attached on your %s bus!\n", eeze_udev_syspath_get_property(name, "ID_MODEL"),
149 e_udev_syspath_get_property(name, "ID_BUS")); 149 eeze_udev_syspath_get_property(name, "ID_BUS"));
150 eina_list_free(type); 150 eina_list_free(type);
151 151
152 152
@@ -154,7 +154,7 @@ int main()
154 * set the events to be sent to callback function catch_events(), and attach 154 * set the events to be sent to callback function catch_events(), and attach
155 * kbdmouse to the watch as associated data 155 * kbdmouse to the watch as associated data
156 */ 156 */
157 e_udev_watch_add(EUDEV_TYPE_NONE, catch_events, akbdmouse); 157 eeze_udev_watch_add(EUDEV_TYPE_NONE, catch_events, akbdmouse);
158 printf("\nAnd now for something more complicated. Plug or unplug your keyboard or mouse for me.\n"); 158 printf("\nAnd now for something more complicated. Plug or unplug your keyboard or mouse for me.\n");
159 159
160 /* main loop must be started to use ecore fd polling */ 160 /* main loop must be started to use ecore fd polling */