Modified in accordance to coding guidelines for header and C files.
[glsdk/dual-decode.git] / src / main.c
index 37121748e95fae2b01af97fe43c5a751600f8ad8..beef8f055df48f2106bc17ad74d8320ca260e48d 100644 (file)
@@ -50,8 +50,8 @@
 #include <string.h>
 #include <linux/limits.h>
 
-#include <common.h>
-#include <gui.h>
+#include "common.h"
+#include "gui.h"
 
 gint decodeMode                = DECODE_MODE_NONE; 
 gchar *filename[]              = {NULL, NULL};
@@ -63,7 +63,7 @@ const gchar *version_text = "0.2";
 
 gint setAbsolutePathname (gchar *file, gchar **uri)                                                                     
 {              
-       gchar *realPath = NULL;
+       gchar *realPathname = NULL;
        gint ret                = ERR_SUCCESS;
 
        if (NULL == uri){
@@ -71,26 +71,26 @@ gint setAbsolutePathname (gchar *file, gchar **uri)
        }       
 
        if (NULL == file){
-               g_printerr("BUG: file: " __FILE__ " line: %d" "\n", __LINE__);          
+               g_printerr ("BUG: file: " __FILE__ " line: %d" "\n", __LINE__);         
                return ERR_BUG;
        }
 
        *uri = (gchar *) g_malloc (sizeof(gchar) * PATH_MAX_LEN);          
-       realPath = realpath (file, realPath);
-       if (NULL == realPath) {
+       realPathname = realpath (file, realPathname);
+       if (NULL == realPathname) {
                g_printerr ("File %s not found\n", file);
                ret = ERR_FILENOTFOUND;
                goto destroy;   
        }
-       g_snprintf (*uri,PATH_MAX_LEN,"file://%s",realPath);
+       g_snprintf (*uri,PATH_MAX_LEN,"file://%s",realPathname);
 
        goto last;      
 
 destroy:
-       g_free(*uri);
+       g_free (*uri);
        *uri = NULL;
 last:
-       free (realPath);
+       free (realPathname);
        return ret;                                                                                                                                
 }                                                                                                                
 
@@ -117,7 +117,7 @@ gint processOpts()
                        decodeMode++;
                        filename[fileCount] = uri;
                }else{
-                       g_printerr("Ignoring file : %s\n",files[fileCount]);
+                       g_printerr ("Ignoring file : %s\n",files[fileCount]);
                }
                fileCount++;
        }
@@ -147,7 +147,7 @@ gint processArgs (int *argc, char **argv[])
        /* Parse the command line arguments and options*/                                                  
        if (!g_option_context_parse (context, argc, argv, &error)) {                       
                g_printerr ("option parsing failed: %s\n", error->message);                               
-               g_error_free(error);
+               g_error_free (error);
                return ERR_OPTIONPARSE;                                                                                                                          
        }                                                                                                                          
        return processOpts ();
@@ -155,7 +155,7 @@ gint processArgs (int *argc, char **argv[])
 
          
 
-int main(int argc, char *argv[])
+int main (int argc, char *argv[])
 {
        gint ret = ERR_SUCCESS;
 
@@ -164,7 +164,7 @@ int main(int argc, char *argv[])
                return ret;
        }
 
-       if(FALSE == DualDecode_initGUI(&argc,&argv)){
+       if (FALSE == DualDecode_initGUI(&argc,&argv)) {
                /*replace with a debug*/
                g_printerr("X is not found. Exiting\n");
                return ERR_XNOTFOUND;