Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/examples


Modified Files:
        exe_example.c output_tester.c 


Log Message:
Formatting.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/examples/exe_example.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- exe_example.c       15 Jan 2006 11:27:19 -0000      1.10
+++ exe_example.c       1 Mar 2006 06:00:41 -0000       1.11
@@ -11,39 +11,40 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-int size = 0;
-int exe_count = 0;
-int data_count = 0;
-int line_count = 0;
-double then = 0.0, now = 0.0;
-Ecore_Exe *exe0 = NULL;
-Ecore_Exe *exe1 = NULL;
-Ecore_Exe *exe2 = NULL;
-Ecore_Exe *exe3 = NULL;
+int                 size = 0;
+int                 exe_count = 0;
+int                 data_count = 0;
+int                 line_count = 0;
+double              then = 0.0, now = 0.0;
+Ecore_Exe          *exe0 = NULL;
+Ecore_Exe          *exe1 = NULL;
+Ecore_Exe          *exe2 = NULL;
+Ecore_Exe          *exe3 = NULL;
 
 static int
 exe_data(void *data, int type, void *event)
 {
    Ecore_Exe_Event_Data *ev;
-   int i;
+   int                 i;
 
    ev = event;
-   printf("  [*] DATA RET EXE %p - %p [%i bytes]\n", ev->exe, ev->data, 
ev->size);
+   printf("  [*] DATA RET EXE %p - %p [%i bytes]\n", ev->exe, ev->data,
+         ev->size);
 
    if (ev->lines)
-      {
-         int i;
-              
-        for (i = 0; ev->lines[i].line != NULL; i++)
-           {
-               printf("%d %s\n", ev->lines[i].size, ev->lines[i].line);
-           }
-      }
+     {
+       int                 i;
+
+       for (i = 0; ev->lines[i].line != NULL; i++)
+         {
+            printf("%d %s\n", ev->lines[i].size, ev->lines[i].line);
+         }
+     }
    else
-      {
-         for (i = 0; i < ev->size; i++)
-            putchar(((unsigned char *)ev->data)[i]);
-      }
+     {
+       for (i = 0; i < ev->size; i++)
+          putchar(((unsigned char *)ev->data)[i]);
+     }
    printf("\n");
    return 1;
 }
@@ -52,29 +53,32 @@
 exe_data_count(void *data, int type, void *event)
 {
    Ecore_Exe_Event_Data *ev;
-   int i;
+   int                 i;
 
    ev = event;
 
    if (ev->lines)
-      {
-        for (i = 0; ev->lines[i].line != NULL; i++)
-           line_count++;
-         /* printf("%d ", i);   This is for testing the number of lines per 
event.*/
-      }
+     {
+       for (i = 0; ev->lines[i].line != NULL; i++)
+          line_count++;
+       /* printf("%d ", i);   This is for testing the number of lines per 
event. */
+     }
 
    data_count += ev->size;
    if (data_count >= size)
-      {
-         now = ecore_time_get();
-        printf("\n\nApproximate data rate - %f bytes/second (%d lines and %d 
bytes (x2) in %f seconds).\n", ((double) data_count * 2.0) / (now - then), 
line_count, data_count, now - then);
-        if (data_count != size)
-           printf("Size discrepency of %d bytes.\n", size - data_count);
-         printf("\n");
-
-         /* Since there does not seem to be anyway to convince /bin/cat to 
finish... */
-        ecore_exe_terminate(exe0);
-      }
+     {
+       now = ecore_time_get();
+       printf
+          ("\n\nApproximate data rate - %f bytes/second (%d lines and %d bytes 
(x2) in %f seconds).\n",
+           ((double)data_count * 2.0) / (now - then), line_count, data_count,
+           now - then);
+       if (data_count != size)
+          printf("Size discrepency of %d bytes.\n", size - data_count);
+       printf("\n");
+
+       /* Since there does not seem to be anyway to convince /bin/cat to 
finish... */
+       ecore_exe_terminate(exe0);
+     }
 
    return 1;
 }
@@ -92,88 +96,93 @@
    return 1;
 }
 
-int timer_once(void *data)
+int
+timer_once(void *data)
 {
-   int argc;
-   char **argv;
-   int i = 1;
+   int                 argc;
+   char              **argv;
+   int                 i = 1;
 
    ecore_app_args_get(&argc, &argv);
    ecore_event_handler_add(ECORE_EXE_EVENT_DATA, exe_data_count, NULL);
    printf("FILE : %s\n", argv[i]);
-   exe0 = ecore_exe_pipe_run("/bin/cat", ECORE_EXE_PIPE_WRITE | 
ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL);
+   exe0 =
+      ecore_exe_pipe_run("/bin/cat",
+                        ECORE_EXE_PIPE_WRITE | ECORE_EXE_PIPE_READ |
+                        ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL);
 
    if (exe0)
-      {
-         struct stat s;
+     {
+       struct stat         s;
 
-        exe_count++;
-         if (stat(argv[i], &s) == 0)
-           {
-              int fd;
-
-               size = s.st_size;
-              if ((fd = open(argv[i], O_RDONLY)) != -1)
-                 {
-                     char buf[1024];
-                     int length;
-
-                      then = ecore_time_get();
-                     while ((length = read(fd, buf, 1024)) > 0)
-                         ecore_exe_send(exe0, buf, length);
-                     close(fd);
-                 }
-           }
-         /* FIXME: Fuckit, neither of these will actually cause /bin/cat to 
shut down.  What the fuck does it take? */
-         ecore_exe_send(exe0, "\004", 1);  /* Send an EOF. */
-         ecore_exe_close_stdin(exe0);  /* /bin/cat should stop when it's stdin 
closes. */
-      }
+       exe_count++;
+       if (stat(argv[i], &s) == 0)
+         {
+            int                 fd;
+
+            size = s.st_size;
+            if ((fd = open(argv[i], O_RDONLY)) != -1)
+              {
+                 char                buf[1024];
+                 int                 length;
+
+                 then = ecore_time_get();
+                 while ((length = read(fd, buf, 1024)) > 0)
+                    ecore_exe_send(exe0, buf, length);
+                 close(fd);
+              }
+         }
+       /* FIXME: Fuckit, neither of these will actually cause /bin/cat to shut 
down.  What the fuck does it take? */
+       ecore_exe_send(exe0, "\004", 1);        /* Send an EOF. */
+       ecore_exe_close_stdin(exe0);    /* /bin/cat should stop when it's stdin 
closes. */
+     }
 
-  return 0;
+   return 0;
 }
 
-int main(int argc, char **argv) 
+int
+main(int argc, char **argv)
 {
-  ecore_app_args_set(argc, (const char **) argv);
+   ecore_app_args_set(argc, (const char **)argv);
 
    ecore_init();
    ecore_event_handler_add(ECORE_EXE_EVENT_DEL, exe_exit, NULL);
 
    if (argc == 1)
-      {
-         ecore_event_handler_add(ECORE_EXE_EVENT_DATA, exe_data, NULL);
-         exe0 = ecore_exe_run("/bin/uname -a", NULL);
-         if (exe0)   exe_count++;
-
-         exe1 = ecore_exe_pipe_run("/bin/sh",
-                           ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE,
-                           NULL);
-         if (exe1)
-           {
-              exe_count++;
-               ecore_exe_send(exe1, "ls\n", 3);
-               ecore_exe_send(exe1, "exit\n", 5);
-           }
-
-         exe2 = ecore_exe_pipe_run("/usr/bin/find . -print",
-                           ECORE_EXE_PIPE_READ | 
ECORE_EXE_PIPE_READ_LINE_BUFFERED,
-                           NULL);
-         if (exe2)   exe_count++;
-
-         exe3 = ecore_exe_pipe_run("/bin/cat",
-                           ECORE_EXE_PIPE_WRITE,
-                           NULL);
-         if (exe3)
-           {
-              exe_count++;
-               ecore_exe_send(exe3, "ls\n", 3);
-           }
-
-         printf("  [*] exe0 = %p (/bin/uname -a)\n", exe0);
-         printf("  [*] exe1 = %p (echo \"ls\" | /bin/sh)\n", exe1);
-         printf("  [*] exe2 = %p (/usr/bin/find / -print)\n", exe2);
-         printf("  [*] exe3 = %p (echo \"ls\" | /bin/cat)\n", exe3);
-      }
+     {
+       ecore_event_handler_add(ECORE_EXE_EVENT_DATA, exe_data, NULL);
+       exe0 = ecore_exe_run("/bin/uname -a", NULL);
+       if (exe0)
+          exe_count++;
+
+       exe1 = ecore_exe_pipe_run("/bin/sh",
+                                 ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE,
+                                 NULL);
+       if (exe1)
+         {
+            exe_count++;
+            ecore_exe_send(exe1, "ls\n", 3);
+            ecore_exe_send(exe1, "exit\n", 5);
+         }
+
+       exe2 = ecore_exe_pipe_run("/usr/bin/find . -print",
+                                 ECORE_EXE_PIPE_READ |
+                                 ECORE_EXE_PIPE_READ_LINE_BUFFERED, NULL);
+       if (exe2)
+          exe_count++;
+
+       exe3 = ecore_exe_pipe_run("/bin/cat", ECORE_EXE_PIPE_WRITE, NULL);
+       if (exe3)
+         {
+            exe_count++;
+            ecore_exe_send(exe3, "ls\n", 3);
+         }
+
+       printf("  [*] exe0 = %p (/bin/uname -a)\n", exe0);
+       printf("  [*] exe1 = %p (echo \"ls\" | /bin/sh)\n", exe1);
+       printf("  [*] exe2 = %p (/usr/bin/find / -print)\n", exe2);
+       printf("  [*] exe3 = %p (echo \"ls\" | /bin/cat)\n", exe3);
+     }
    else
       ecore_timer_add(0.5, timer_once, NULL);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/examples/output_tester.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- output_tester.c     24 Jan 2006 05:55:00 -0000      1.2
+++ output_tester.c     1 Mar 2006 06:00:41 -0000       1.3
@@ -5,85 +5,118 @@
 
 #include <stdlib.h>
 #include <stdio.h>
- 
-Ecore_Timer *timer1 = NULL;
 
-char *data1 = "data1";
-   
+Ecore_Timer        *timer1 = NULL;
+
+char               *data1 = "data1";
+
 int
 timer1_tick(void *data)
 {
-   printf("Once only timer called at %3.2f seconds, data %p\n", 
-          ecore_time_get(), data);
+   printf("Once only timer called at %3.2f seconds, data %p\n",
+         ecore_time_get(), data);
    fprintf(stderr, "This is an error message from the timer callback.\n");
    fprintf(stdout, "This is an output message from the timer callback.\n");
-   fprintf(stderr, "Some text for testing the various problems that may occur. 
 It should all be to stderr.\n");
+   fprintf(stderr,
+          "Some text for testing the various problems that may occur.  It 
should all be to stderr.\n");
    fprintf(stderr, "[EMAIL PROTECTED]&*(){}|[]\\/\\\\=?+',.\"<>`~-_;:\n");
    fprintf(stderr, "1234567890\n");
    fprintf(stderr, "abcdefghijklmnopqrstuvwxyz\n");
    fprintf(stderr, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n");
-   fprintf(stderr, "This is a really long line that is used to test the 
systems response to really long lines.  Having said that, if I hadn't added 
this extra sentence it would not have been as long as the introduction line 
that is five lines above this one.  If you got this far, then you may actually 
have no life, as this is just a really long test line that says nothing 
important, and the only parts that have any actual relevance are the beginning 
and the end.\n");
-   fprintf(stderr, "This line is almost identical to the one above, only \\n's 
ae added to test multiline.\nThis is a really long line that is used to test 
the systems response to really long lines.\nHaving said that, if I hadn't added 
this extra sentence it would not have been as long as the introduction line 
that is five lines above this one.\nIf you got this far, then you may actually 
have no life, as this is just a really long test line that says nothing 
important, and the only parts that have any actual relevance are the beginning 
and the\nend.\n");
+   fprintf(stderr,
+          "This is a really long line that is used to test the systems 
response to really long lines.  Having said that, if I hadn't added this extra 
sentence it would not have been as long as the introduction line that is five 
lines above this one.  If you got this far, then you may actually have no life, 
as this is just a really long test line that says nothing important, and the 
only parts that have any actual relevance are the beginning and the end.\n");
+   fprintf(stderr,
+          "This line is almost identical to the one above, only \\n's ae added 
to test multiline.\nThis is a really long line that is used to test the systems 
response to really long lines.\nHaving said that, if I hadn't added this extra 
sentence it would not have been as long as the introduction line that is five 
lines above this one.\nIf you got this far, then you may actually have no life, 
as this is just a really long test line that says nothing important, and the 
only parts that have any actual relevance are the beginning and the\nend.\n");
    fprintf(stderr, "&gt;&amp;&lt; == <&>\n");
    fprintf(stderr, "This - <br> - is a HTML line break.\n");
    fprintf(stderr, "&gt;br&lt; == <br>\n");
-   fprintf(stderr, "The rest is just some lines cut and paste from 
http://matrix-rad.net/ coz I need a big lump of text, and it was handy.  Used 
with the permission of the author, coz I (David 'onefang' Seikel) am the 
author, apply the standard E17 license to this part when it is part of E17 
cvs.\n");
+   fprintf(stderr,
+          "The rest is just some lines cut and paste from 
http://matrix-rad.net/ coz I need a big lump of text, and it was handy.  Used 
with the permission of the author, coz I (David 'onefang' Seikel) am the 
author, apply the standard E17 license to this part when it is part of E17 
cvs.\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "NAWS stands for Not A Widget Set, it will not be a widget 
set, it will be a\n");
-   fprintf(stderr, "single, generalised widget and a single generalized widget 
container.\n");
+   fprintf(stderr,
+          "NAWS stands for Not A Widget Set, it will not be a widget set, it 
will be a\n");
+   fprintf(stderr,
+          "single, generalised widget and a single generalized widget 
container.\n");
    fprintf(stderr, "  </P>\n");
    fprintf(stderr, "  <P>\n");
    fprintf(stderr, "The idea is roughly this -<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "NAWS should allow pixel perfect layout on any OS/JVM 
combination. This is very\n");
-   fprintf(stderr, "important, it gives the GUI designers the freedom from 
differences that has been\n");
+   fprintf(stderr,
+          "NAWS should allow pixel perfect layout on any OS/JVM combination. 
This is very\n");
+   fprintf(stderr,
+          "important, it gives the GUI designers the freedom from differences 
that has been\n");
    fprintf(stderr, "sorely lacking on the web.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "All widgets should be shaped, so that you can have two 
roundish widgets\n");
-   fprintf(stderr, "snuggling up to each other. All widgets should be font 
sensitive, this could\n");
-   fprintf(stderr, "break pixel perfection though. The shape should be 
definable by a mask graphic,\n");
+   fprintf(stderr,
+          "All widgets should be shaped, so that you can have two roundish 
widgets\n");
+   fprintf(stderr,
+          "snuggling up to each other. All widgets should be font sensitive, 
this could\n");
+   fprintf(stderr,
+          "break pixel perfection though. The shape should be definable by a 
mask graphic,\n");
    fprintf(stderr, "or a combination of graphics primitives.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "Labels should be able to display multiline flowed text or 
a graphic, with the\n");
-   fprintf(stderr, "graphic being a .png, .jpg, .gif (in that order of 
preference), and with\n");
-   fprintf(stderr, "animation support. Labels should be able to be attached to 
all other widgets as\n");
-   fprintf(stderr, "prompts. Labels should have automatic disabled graphics 
(ghosting) created and\n");
-   fprintf(stderr, "the option of supplying one. So that a widgets prompt gets 
ghosted when the\n");
-   fprintf(stderr, "widget gets ghosted, and to provide ghosting support for 
the other widget types.\n");
-   fprintf(stderr, "Labels can have a different text / graphic for the mouse 
hover state. Label\n");
+   fprintf(stderr,
+          "Labels should be able to display multiline flowed text or a 
graphic, with the\n");
+   fprintf(stderr,
+          "graphic being a .png, .jpg, .gif (in that order of preference), and 
with\n");
+   fprintf(stderr,
+          "animation support. Labels should be able to be attached to all 
other widgets as\n");
+   fprintf(stderr,
+          "prompts. Labels should have automatic disabled graphics (ghosting) 
created and\n");
+   fprintf(stderr,
+          "the option of supplying one. So that a widgets prompt gets ghosted 
when the\n");
+   fprintf(stderr,
+          "widget gets ghosted, and to provide ghosting support for the other 
widget types.\n");
+   fprintf(stderr,
+          "Labels can have a different text / graphic for the mouse hover 
state. Label\n");
    fprintf(stderr, "graphics should naturally be paintable.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "Borders are shaped outlines that can be put around 
anything. Not really a\n");
-   fprintf(stderr, "widget, just a decoration. When using graphics, the border 
could be part of the\n");
-   fprintf(stderr, "graphic, so no actual border is needed. Might be able to 
make Labels as\n");
+   fprintf(stderr,
+          "Borders are shaped outlines that can be put around anything. Not 
really a\n");
+   fprintf(stderr,
+          "widget, just a decoration. When using graphics, the border could be 
part of the\n");
+   fprintf(stderr,
+          "graphic, so no actual border is needed. Might be able to make 
Labels as\n");
    fprintf(stderr, "containers do the job of Borders.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "Buttons are Labels that can be clicked. Alternate text / 
graphics for the\n");
-   fprintf(stderr, "clicked state should be catered for. Radio buttons can be 
handled by widget\n");
-   fprintf(stderr, "notification. Checkboxes are buttons that are sticky. The 
difference between\n");
-   fprintf(stderr, "Checkboxes and toggled Buttons is purely 
cosmetic.<BR><BR>\n");
+   fprintf(stderr,
+          "Buttons are Labels that can be clicked. Alternate text / graphics 
for the\n");
+   fprintf(stderr,
+          "clicked state should be catered for. Radio buttons can be handled 
by widget\n");
+   fprintf(stderr,
+          "notification. Checkboxes are buttons that are sticky. The 
difference between\n");
+   fprintf(stderr,
+          "Checkboxes and toggled Buttons is purely cosmetic.<BR><BR>\n");
    fprintf(stderr, "\n");
    fprintf(stderr, "Icons are movable Buttons.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "Text editing fields are Labels that allow the text to be 
edited. Masks and\n");
+   fprintf(stderr,
+          "Text editing fields are Labels that allow the text to be edited. 
Masks and\n");
    fprintf(stderr, "validation should be built in.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "Progress indicators are Labels with two graphics where the 
first graphic is\n");
-   fprintf(stderr, "slowly revealed by chipping away at the second overlayed 
graphic. Default\n");
+   fprintf(stderr,
+          "Progress indicators are Labels with two graphics where the first 
graphic is\n");
+   fprintf(stderr,
+          "slowly revealed by chipping away at the second overlayed graphic. 
Default\n");
    fprintf(stderr, "graphics should be supplied.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "Containers should be automatically scrollable if needed. 
Actually, Containers\n");
-   fprintf(stderr, "could be just Labels that allow sub widgets, but I don't 
think I will go that\n");
+   fprintf(stderr,
+          "Containers should be automatically scrollable if needed. Actually, 
Containers\n");
+   fprintf(stderr,
+          "could be just Labels that allow sub widgets, but I don't think I 
will go that\n");
    fprintf(stderr, "far B-). On second thoughts, I might.<BR><BR>\n");
    fprintf(stderr, "\n");
-   fprintf(stderr, "All else is really just a Container with several of the 
basic widgets in them. A\n");
-   fprintf(stderr, "List is just a collection of Buttons. A Menu is not very 
different from a List\n");
-   fprintf(stderr, "with sub Lists. Choices are Lists where the selected item 
is usually all that is\n");
+   fprintf(stderr,
+          "All else is really just a Container with several of the basic 
widgets in them. A\n");
+   fprintf(stderr,
+          "List is just a collection of Buttons. A Menu is not very different 
from a List\n");
+   fprintf(stderr,
+          "with sub Lists. Choices are Lists where the selected item is 
usually all that is\n");
    fprintf(stderr, "\n");
    ecore_main_loop_quit();
    return 0;
 }
- 
+
 int
 main(int argc, char **argv)
 {




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to