Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : apps/entrance

Dir     : e17/apps/entrance/src/client


Modified Files:
        entrance_auth.c entrance_session.c main.c 


Log Message:
ran indent so incoming one liners don't look like a gigantic code change.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_auth.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- entrance_auth.c     1 Jan 2004 20:58:55 -0000       1.10
+++ entrance_auth.c     2 Jan 2004 18:19:31 -0000       1.11
@@ -102,8 +102,8 @@
 void
 entrance_auth_clear_pass(Entrance_Auth * e)
 {
-   if(e->pw)
-      if(e->pw->pw_passwd)
+   if (e->pw)
+      if (e->pw->pw_passwd)
          free(e->pw->pw_passwd);
    memset(e->pass, 0, sizeof(e->pass));
 }
@@ -115,7 +115,7 @@
 void
 entrance_auth_free(Entrance_Auth * e)
 {
-   if(e->pw)
+   if (e->pw)
       e->pw = struct_passwd_free(e->pw);
 
    memset(e->pass, 0, sizeof(e->pass));
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- entrance_session.c  1 Jan 2004 20:58:55 -0000       1.25
+++ entrance_session.c  2 Jan 2004 18:19:31 -0000       1.26
@@ -87,10 +87,14 @@
 {
    if (e)
    {
-      if(e->auth) entrance_auth_free(e->auth);
-      if(e->config) entrance_config_free(e->config);
-      if(e->ee) ecore_evas_free(e->ee);
-      if(e->session) free(e->session);
+      if (e->auth)
+         entrance_auth_free(e->auth);
+      if (e->config)
+         entrance_config_free(e->config);
+      if (e->ee)
+         ecore_evas_free(e->ee);
+      if (e->session)
+         free(e->session);
 
       free(e);
    }
@@ -268,38 +272,38 @@
       if (pam_open_session(e->auth->pam.handle, 0) != PAM_SUCCESS)
       {
          syslog(LOG_CRIT, "Unable to open PAM session. Aborting.");
-        ecore_main_loop_quit();
+         ecore_main_loop_quit();
       }
    }
 #endif
 
-   switch((pid = fork()))
+   switch ((pid = fork()))
    {
      case 0:
-       if (initgroups(e->auth->pw->pw_name, e->auth->pw->pw_gid))
-           syslog(LOG_CRIT,
-             "Unable to initialize group (is entrance running as root?).");
-       if (setgid(e->auth->pw->pw_gid))
-           syslog(LOG_CRIT, "Unable to set group id.");
-       if (setuid(e->auth->pw->pw_uid))
-           syslog(LOG_CRIT, "Unable to set user id.");
-       entrance_auth_free(e->auth); 
-       e->auth = NULL;
-       execl("/bin/sh", "/bin/sh", "-c", buf, NULL);
-       exit(0);
-       break;
+        if (initgroups(e->auth->pw->pw_name, e->auth->pw->pw_gid))
+           syslog(LOG_CRIT,
+                  "Unable to initialize group (is entrance running as root?).");
+        if (setgid(e->auth->pw->pw_gid))
+           syslog(LOG_CRIT, "Unable to set group id.");
+        if (setuid(e->auth->pw->pw_uid))
+           syslog(LOG_CRIT, "Unable to set user id.");
+        entrance_auth_free(e->auth);
+        e->auth = NULL;
+        execl("/bin/sh", "/bin/sh", "-c", buf, NULL);
+        exit(0);
+        break;
      case -1:
         syslog(LOG_INFO, "FORK FAILED, UH OH");
-       exit(0);
+        exit(0);
      default:
-       break;
+        break;
    }
    /* clear users's password out of memory */
-   entrance_auth_clear_pass(e->auth); 
+   entrance_auth_clear_pass(e->auth);
    if (waitpid(pid, NULL, 0) == pid)
    {
-       entrance_auth_session_end(e->auth);
-       syslog(LOG_CRIT, "User Xsession Ended");
+      entrance_auth_session_end(e->auth);
+      syslog(LOG_CRIT, "User Xsession Ended");
    }
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- main.c      1 Jan 2004 20:58:55 -0000       1.27
+++ main.c      2 Jan 2004 18:19:31 -0000       1.28
@@ -58,7 +58,7 @@
 static int
 exit_cb(void *data, int ev_type, void *ev)
 {
-    fprintf(stderr, "HELP\n");
+   fprintf(stderr, "HELP\n");
    ecore_main_loop_quit();
    return 1;
 }
@@ -293,7 +293,8 @@
 done_cb(void *data, Evas_Object * o, const char *emission, const char *source)
 {
    if (!session->authed)
-      syslog(LOG_CRIT, "Theme attempted to launch session without finishing 
authentication. Please fix your theme.");
+      syslog(LOG_CRIT,
+             "Theme attempted to launch session without finishing authentication. 
Please fix your theme.");
    ecore_main_loop_quit();
 }
 
@@ -374,7 +375,7 @@
    if (session->config->reboot.allow)
    {
       pid_t pid;
-      
+
       entrance_session_free(session);
       session = NULL;
       switch (pid = fork())
@@ -444,26 +445,40 @@
 {
    printf("Entrance - The Enlightened Display Manager\n");
    printf("Usage: %s [OPTION]...\n\n", argv[0]);
-   
printf("---------------------------------------------------------------------------\n");
-   printf("  -d, --display=DISPLAY        Specify which display Entrance should 
use\n");
+   printf
+      
("---------------------------------------------------------------------------\n");
+   printf
+      ("  -d, --display=DISPLAY        Specify which display Entrance should use\n");
    printf("  -h, --help                   Display this help message\n");
-   printf("  -g, --geometry=WIDTHxHEIGHT  Specify the size of the Entrance 
window.\n");
-   printf("                               Use of this option disables fullscreen 
mode.\n");
-   printf("  -t, --theme=THEME            Specify the theme to load. You may 
specify\n");
-   printf("                               either the name of an installed theme, or 
an\n");
-   printf("                               arbitrary path to an eet file (use ./ 
for\n");
+   printf
+      ("  -g, --geometry=WIDTHxHEIGHT  Specify the size of the Entrance window.\n");
+   printf
+      ("                               Use of this option disables fullscreen 
mode.\n");
+   printf
+      ("  -t, --theme=THEME            Specify the theme to load. You may specify\n");
+   printf
+      ("                               either the name of an installed theme, or 
an\n");
+   printf
+      ("                               arbitrary path to an eet file (use ./ for\n");
    printf("                               the current directory).\n");
-   printf("  -T, --test                   Enable testing mode. This will cause 
xterm\n");
-   printf("                               to be executed instead of the selected\n");
-   printf("                               session upon authentication, and uses a\n");
-   printf("                               geometry of 800x600 (-g overrides this)\n");
-   
printf("===========================================================================\n\n");
-   printf("Note: To automatically launch an X server that will be managed, please 
use\n");
-   printf("      entranced instead of entrance. Entrance requires an existing X 
server\n");
+   printf
+      ("  -T, --test                   Enable testing mode. This will cause xterm\n");
+   printf
+      ("                               to be executed instead of the selected\n");
+   printf
+      ("                               session upon authentication, and uses a\n");
+   printf
+      ("                               geometry of 800x600 (-g overrides this)\n");
+   printf
+      
("===========================================================================\n\n");
+   printf
+      ("Note: To automatically launch an X server that will be managed, please 
use\n");
+   printf
+      ("      entranced instead of entrance. Entrance requires an existing X 
server\n");
    printf("      to run. Run entranced --help for more information.\n\n");
    exit(0);
 }
-         
+
 /**
  * timer_cb - we handle this iteration outside of the theme
  */
@@ -510,12 +525,12 @@
    int g_x = WINW, g_y = WINH;
    char *theme = NULL;
    int fs_en = 1;
-   
+
    session = entrance_session_new();
 
 /*   if (argv[1])
       snprintf(buf, PATH_MAX, "%s", argv[1]);*/
-   
+
    /* Basic ecore initialization */
    if (!ecore_init())
       return (-1);
@@ -525,65 +540,73 @@
    while (1)
    {
       char *t;
+
       c = getopt_long(argc, argv, "hd:g:t:T", d_opt, NULL);
       if (c == -1)
          break;
       switch (c)
       {
-         case 'h':
-            entrance_help(argv);
-         case 'd':
-            display = strdup(optarg);
-            break;
-         case 'g':
-            t = strchr((const char *) optarg, 'x');
-            if(!t || t >= (optarg + strlen(optarg)))
-            {
-               syslog(LOG_CRIT, "Invalid argument '%s' given for geometry. Exiting.", 
optarg);
-               return (-1);
-            }
-            else
-            {
-               g_x = atoi((const char *) optarg);
-               g_y = atoi((const char *) (t + 1));
-               if (!g_x || !g_y)
-               {
-                  syslog(LOG_CRIT, "Invalid argument '%s' given for geometry. 
Exiting.", optarg);
-                  return (-1);
-               }
-               fs_en = 0;
-            }
-            break;
-         case 't':
-            /* Allow arbitrary paths to theme files */
-            t = strchr((const char *) optarg, '/');
-            if (t)
-               theme = strdup(optarg);
-            else
-            {
-               theme = calloc(1, PATH_MAX);
-               t = strrchr((const char *) optarg, '.');
-               if (t && !strcmp(t, ".eet"))
-                  snprintf(theme, PATH_MAX, "%s/themes/%s", PACKAGE_DATA_DIR, optarg);
-               else
-                  snprintf(theme, PATH_MAX, "%s/themes/%s.eet", PACKAGE_DATA_DIR, 
optarg);
-            }
-            break;
-         case 'T':
-            _entrance_test_en = 1;
-            fs_en = 0;
-            break;
-         default:
-            entrance_help(argv);
+        case 'h':
+           entrance_help(argv);
+        case 'd':
+           display = strdup(optarg);
+           break;
+        case 'g':
+           t = strchr((const char *) optarg, 'x');
+           if (!t || t >= (optarg + strlen(optarg)))
+           {
+              syslog(LOG_CRIT,
+                     "Invalid argument '%s' given for geometry. Exiting.",
+                     optarg);
+              return (-1);
+           }
+           else
+           {
+              g_x = atoi((const char *) optarg);
+              g_y = atoi((const char *) (t + 1));
+              if (!g_x || !g_y)
+              {
+                 syslog(LOG_CRIT,
+                        "Invalid argument '%s' given for geometry. Exiting.",
+                        optarg);
+                 return (-1);
+              }
+              fs_en = 0;
+           }
+           break;
+        case 't':
+           /* Allow arbitrary paths to theme files */
+           t = strchr((const char *) optarg, '/');
+           if (t)
+              theme = strdup(optarg);
+           else
+           {
+              theme = calloc(1, PATH_MAX);
+              t = strrchr((const char *) optarg, '.');
+              if (t && !strcmp(t, ".eet"))
+                 snprintf(theme, PATH_MAX, "%s/themes/%s", PACKAGE_DATA_DIR,
+                          optarg);
+              else
+                 snprintf(theme, PATH_MAX, "%s/themes/%s.eet",
+                          PACKAGE_DATA_DIR, optarg);
+           }
+           break;
+        case 'T':
+           _entrance_test_en = 1;
+           fs_en = 0;
+           break;
+        default:
+           entrance_help(argv);
       }
    }
-   
+
 #if 1
    if (!ecore_x_init(display))
    {
       if (display)
          syslog(LOG_CRIT,
-                "Cannot initialize requested display \"%s\". Exiting.", display);
+                "Cannot initialize requested display \"%s\". Exiting.",
+                display);
       else if ((str = getenv("DISPLAY")))
          syslog(LOG_CRIT,
                 "Cannot initialize default display \"%s\". Exiting.", str);
@@ -618,7 +641,7 @@
       }
 
       ew = ecore_evas_software_x11_window_get(e);
-      if(_entrance_test_en)
+      if (_entrance_test_en)
          ecore_evas_title_set(e, "Entrance - Testing Mode");
       else
          ecore_evas_title_set(e, "Entrance");
@@ -650,7 +673,7 @@
       if (!edje_object_file_set(edje, buf, "Main"))
       {
          syslog(LOG_CRIT, "Failed to load theme %s\n", theme);
-        entrance_session_free(session);
+         entrance_session_free(session);
          exit(1);
       }
       evas_object_move(edje, 0, 0);
@@ -738,7 +761,7 @@
 
 #if (X_TESTING == 0)
       ecore_evas_resize(e, g_x, g_y);
-      if(fs_en)
+      if (fs_en)
          ecore_evas_fullscreen_set(e, 1);
 #elif (X_TESTING == 1)
       ecore_evas_resize(e, g_x, g_y);
@@ -747,16 +770,19 @@
       entrance_session_ecore_evas_set(session, e);
       entrance_session_run(session);
       fprintf(stderr, "%s", "BING\n");
-      
-      if(session->authed) {
-       entrance_session_start_user_session(session);
+
+      if (session->authed)
+      {
+         entrance_session_start_user_session(session);
       }
       entrance_session_free(session);
       closelog();
       ecore_evas_shutdown();
       ecore_x_shutdown();
       ecore_shutdown();
-   } else {
+   }
+   else
+   {
       fprintf(stderr, "Fatal error: Could not initialize ecore_evas!\n");
       exit(1);
    }




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to