Revision: 5458
          http://ipcop.svn.sourceforge.net/ipcop/?rev=5458&view=rev
Author:   owes
Date:     2011-02-17 10:24:16 +0000 (Thu, 17 Feb 2011)

Log Message:
-----------
Visual and coding style changes

Modified Paths:
--------------
    ipcop/trunk/src/misc-progs/emailhelper.c

Modified: ipcop/trunk/src/misc-progs/emailhelper.c
===================================================================
--- ipcop/trunk/src/misc-progs/emailhelper.c    2011-02-17 08:37:00 UTC (rev 
5457)
+++ ipcop/trunk/src/misc-progs/emailhelper.c    2011-02-17 10:24:16 UTC (rev 
5458)
@@ -33,23 +33,22 @@
 
 
 /* defines for emailhelper return status*/
-#define EMAIL_SUCCESS      0           // everything ok
-#define EMAIL_ERR_ANY      1           // unspecified error
-#define EMAIL_ERR_SERVER      2           // invalid email server
-#define EMAIL_ERR_PORT      3           // invalid subject
-#define EMAIL_ERR_USR      4           // invalid username
-#define EMAIL_ERR_PW      5           // invalid password
-#define EMAIL_ERR_FROM      6           // invalid from email
-#define EMAIL_ERR_TO      7           // invalid to email
-#define EMAIL_ERR_SUBJECT      8           // invalid subject
-#define EMAIL_ERR_MESSAGE      9           // invalid messagefile
-#define EMAIL_ERR_ATTACH      10           // invalid attachment
-#define EMAIL_ERR_HOSTNAME      11           // invalid hostname
-#define EMAIL_ERR_DOMAINNAME      12           // invalid domainname
-#define EMAIL_ERR_SENDEMAIL      13           // error in sendEmail
+#define EMAIL_SUCCESS           0       // everything ok
+#define EMAIL_ERR_ANY           1       // unspecified error
+#define EMAIL_ERR_SERVER        2       // invalid email server
+#define EMAIL_ERR_PORT          3       // invalid subject
+#define EMAIL_ERR_USR           4       // invalid username
+#define EMAIL_ERR_PW            5       // invalid password
+#define EMAIL_ERR_FROM          6       // invalid from email
+#define EMAIL_ERR_TO            7       // invalid to email
+#define EMAIL_ERR_SUBJECT       8       // invalid subject
+#define EMAIL_ERR_MESSAGE       9       // invalid messagefile
+#define EMAIL_ERR_ATTACH        10      // invalid attachment
+#define EMAIL_ERR_HOSTNAME      11      // invalid hostname
+#define EMAIL_ERR_DOMAINNAME    12      // invalid domainname
+#define EMAIL_ERR_SENDEMAIL     13      // error in sendEmail
 
 
-
 static int flag_subject = 0;
 static int flag_messagefile = 0;
 static int flag_delete_messagefile  = 0;
@@ -167,8 +166,7 @@
 
     strcpy(server, "");
     verbose_printf(2, "Reading EMAIL_SERVER ... \n");
-    if (find_kv_default(kv, "EMAIL_SERVER", server) != SUCCESS)
-    {
+    if (find_kv_default(kv, "EMAIL_SERVER", server) != SUCCESS) {
         fprintf(stderr, "Cannot read EMAIL_SERVER\n");
         exit(EMAIL_ERR_SERVER);
     }
@@ -178,7 +176,7 @@
         fprintf(stderr, "Email server can not be empty\n");
         exit(EMAIL_ERR_SERVER);
     }
-    else if (strchr(server, ' ')){
+    else if (strchr(server, ' ')) {
         fprintf(stderr, "Email server can not contain spaces");
         exit(EMAIL_ERR_SERVER);
     }
@@ -190,14 +188,13 @@
 
     strcpy(opt_port, "");
     verbose_printf(2, "Reading EMAIL_SERVER_PORT ... \n");
-    if (find_kv_default(kv, "EMAIL_SERVER_PORT", opt_port) != SUCCESS)
-    {
+    if (find_kv_default(kv, "EMAIL_SERVER_PORT", opt_port) != SUCCESS) {
         fprintf(stderr, "Cannot read EMAIL_SERVER_PORT\n");
         exit(EMAIL_ERR_PORT);
     }
 
     verbose_printf(2, "Validate EMAIL_SERVER_PORT ... \n");
-    if (strchr(opt_port, ' ')){
+    if (strchr(opt_port, ' ')) {
         fprintf(stderr, "Email server port can not contain spaces");
         exit(EMAIL_ERR_PORT);
     }
@@ -217,14 +214,13 @@
 
     strcpy(opt_user, "");
     verbose_printf(2, "Reading EMAIL_USR ... \n");
-    if (find_kv_default(kv, "EMAIL_USR", opt_user) != SUCCESS)
-    {
+    if (find_kv_default(kv, "EMAIL_USR", opt_user) != SUCCESS) {
         fprintf(stderr, "Cannot read EMAIL_USR\n");
         exit(EMAIL_ERR_USR);
     }
 
     verbose_printf(2, "Validate EMAIL_USR ... \n");
-    if (strchr(opt_user, ' ')){
+    if (strchr(opt_user, ' ')) {
         fprintf(stderr, "Username port can not contain spaces");
         exit(EMAIL_ERR_USR);
     }
@@ -239,19 +235,18 @@
     else {
         verbose_printf(2, "No EMAIL_USR in settings... \n");
         strcpy(user, "");
-   }
+    }
 
 
     strcpy(opt_password, "");
     verbose_printf(2, "Reading EMAIL_PW ... \n");
-    if (find_kv_default(kv, "EMAIL_PW", opt_password) != SUCCESS)
-    {
+    if (find_kv_default(kv, "EMAIL_PW", opt_password) != SUCCESS) {
         fprintf(stderr, "Cannot read EMAIL_PW\n");
         exit(EMAIL_ERR_PW);
     }
 
     verbose_printf(2, "Validate EMAIL_PW ... \n");
-    if (strchr(opt_password, ' ')){
+    if (strchr(opt_password, ' ')) {
         fprintf(stderr, "Password can not contain spaces");
         exit(EMAIL_ERR_PW);
     }
@@ -271,8 +266,7 @@
 
     strcpy(from, "");
     verbose_printf(2, "Reading EMAIL_FROM ... \n");
-    if (find_kv_default(kv, "EMAIL_FROM", from) != SUCCESS)
-    {
+    if (find_kv_default(kv, "EMAIL_FROM", from) != SUCCESS) {
         fprintf(stderr, "Cannot read EMAIL_FROM\n");
         exit(EMAIL_ERR_FROM);
     }
@@ -282,7 +276,7 @@
         fprintf(stderr, "From email can not be empty\n");
         exit(EMAIL_ERR_FROM);
     }
-    else if (strchr(from, ' ')){
+    else if (strchr(from, ' ')) {
         fprintf(stderr, "From email can not contain spaces");
         exit(EMAIL_ERR_FROM);
     }
@@ -294,8 +288,7 @@
 
     strcpy(to, "");
     verbose_printf(2, "Reading EMAIL_TO ... \n");
-    if (find_kv_default(kv, "EMAIL_TO", to) != SUCCESS)
-    {
+    if (find_kv_default(kv, "EMAIL_TO", to) != SUCCESS) {
         fprintf(stderr, "Cannot read EMAIL_TO\n");
         exit(EMAIL_ERR_TO);
     }
@@ -305,7 +298,7 @@
         fprintf(stderr, "To email can not be empty\n");
         exit(EMAIL_ERR_TO);
     }
-    else if (strchr(to, ' ')){
+    else if (strchr(to, ' ')) {
         fprintf(stderr, "To email can not contain spaces");
         exit(EMAIL_ERR_TO);
     }
@@ -324,8 +317,7 @@
 
     strcpy(hostname, "");
     verbose_printf(2, "Reading HOSTNAME ... \n");
-    if (find_kv_default(main_kv, "HOSTNAME", hostname) != SUCCESS)
-    {
+    if (find_kv_default(main_kv, "HOSTNAME", hostname) != SUCCESS) {
         fprintf(stderr, "Cannot read HOSTNAME\n");
         exit(EMAIL_ERR_HOSTNAME);
     }
@@ -333,8 +325,7 @@
 
     strcpy(domainname, "");
     verbose_printf(2, "Reading DOMAINNAME ... \n");
-    if (find_kv_default(main_kv, "DOMAINNAME", domainname) != SUCCESS)
-    {
+    if (find_kv_default(main_kv, "DOMAINNAME", domainname) != SUCCESS) {
         fprintf(stderr, "Cannot read DOMAINNAME\n");
         exit(EMAIL_ERR_DOMAINNAME);
     }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to