Enlightenment CVS committal
Author : doursse
Project : e17
Module : proto/evil
Dir : e17/proto/evil/src/bin
Modified Files:
test_dlfcn.c test_pipe.c
Log Message:
update doc, add init/shutdown functions for the socket system, add Tor
Lillqvist as author and other miscellaneous fixes
===================================================================
RCS file: /cvs/e/e17/proto/evil/src/bin/test_dlfcn.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- test_dlfcn.c 27 Feb 2008 21:01:30 -0000 1.1
+++ test_dlfcn.c 29 Feb 2008 22:42:14 -0000 1.2
@@ -9,46 +9,44 @@
int
-main()
+main(int argc, char *argv[])
{
- struct timeval tv;
- void *module;
- double t1 = 0.0;
- double t2 = 0.0;
+ void *module;
+ void *symbol;
- int (*time)(struct timeval *tv, void *tz);
+ if (argc < 3)
+ {
+ printf ("Usage: %s file.dll symbol\n\n", argv[0]);
+ return EXIT_FAILURE;
+ }
- module = dlopen("d:\\msys\\1.0\\local\\bin\\libevil-0.dll", 0);
+ printf ("opening module %s\n", argv[1]);
+ module = dlopen(argv[1], 0);
if (!module)
{
printf ("%s\n", dlerror());
return EXIT_FAILURE;
}
+ printf ("opening module %s successful\n", argv[1]);
- time = dlsym(module, "gettimeofday");
- if (!time)
+ printf ("getting symbol %s\n", argv[2]);
+ symbol = dlsym(module, argv[2]);
+ if (!symbol)
{
printf ("%s\n", dlerror());
if (dlclose(module))
printf ("%s\n", dlerror());
return EXIT_FAILURE;
}
+ printf ("getting symbol %s successful\n", argv[2]);
- if (time(&tv, NULL) == 0)
- t1 = tv.tv_sec + tv.tv_usec / 1000000.0;
-
- Sleep(3000);
-
- if (time(&tv, NULL) == 0)
- t2 = tv.tv_sec + tv.tv_usec / 1000000.0;
-
- printf ("3 seconds ? %f\n", t2 - t1);
-
+ printf ("closing module %s\n", argv[1]);
if (dlclose(module))
{
printf ("%s\n", dlerror());
return EXIT_FAILURE;
}
+ printf ("closing module %s successful\n", argv[1]);
return EXIT_SUCCESS;
}
===================================================================
RCS file: /cvs/e/e17/proto/evil/src/bin/test_pipe.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- test_pipe.c 27 Feb 2008 21:01:30 -0000 1.1
+++ test_pipe.c 29 Feb 2008 22:42:14 -0000 1.2
@@ -25,9 +25,7 @@
Sleep (2 * 1000);
d = (data *)param;
buf[0] = d;
- printf ("writing...\n");
send(d->fd_write, (char *)buf, sizeof(buf), 0);
- printf ("end of writing...\n");
return 0;
}
@@ -60,13 +58,11 @@
d = (data *)malloc(sizeof (data));
d->val = 14;
d->fd_write = sockets[FDWRITE];
- printf (" pointeur 0 : %p\n", d);
+ printf (" pointeur sent........: %p\n", d);
h = CreateThread (NULL, 0, thread, d, 0, &thread_id);
- printf (" * select : %d %d\n", sockets[0], sockets[1]);
ret = select(sockets[FDREAD] + 1, &rfds, NULL, NULL, &t);
- printf (" * select : ret %d\n", ret);
if (ret < 0) return -1;
@@ -81,16 +77,14 @@
int j = 0;
void *buf[1];
- printf ("bon \n");
while ((len = recv(sockets[FDREAD], (char *)buf, sizeof(buf), 0)) > 0)
{
- printf ("len : %d\n", len);
if (len == sizeof(buf))
{
d = buf[0];
- printf (" pointeur 1 : %p\n", d);
+ printf (" pointeur received....: %p\n", d);
j = d->val;
- printf ("reussite : %d\n", j);
+ printf (" value (should be 14) : %d\n", j);
}
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs