Enlightenment CVS committal

Author  : sarajervi
Project : misc
Module  : erss

Dir     : misc/erss/src


Modified Files:
        config.h.in erss.c erss.h parse.c 


Log Message:

Bugfix catching when url's have &.
New feature: "config alias matching" if you do erss -c slashdot it will look
for a config file with the string slashdot in the filename.


===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/config.h.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- config.h.in 22 Dec 2003 15:17:29 -0000      1.1.1.1
+++ config.h.in 12 Jan 2004 22:59:34 -0000      1.2
@@ -15,39 +15,26 @@
 #undef ENTRANCE_XSESSION
 #undef HAVE_ECORE_GL_X11
 
-/* 
-   Name of package */
+/* Name of package */
 #undef PACKAGE
 
-/* 
-   Define to the address where bug reports for
-   this package should be sent. */
+/* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
-/* 
-   Define to the full name of this package.
-   */
+/* Define to the full name of this package. */
 #undef PACKAGE_NAME
 
-/* 
-   Define to the full name and version of
-   this package. */
+/* Define to the full name and version of this package. */
 #undef PACKAGE_STRING
 
-/* 
-   Define to the one symbol short name of
-   this package. */
+/* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* 
-   Define to the version of this package. */
+/* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* 
-   Define to 1 if you have the ANSI
-   C header files. */
+/* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* 
-   Version number of package */
+/* Version number of package */
 #undef VERSION
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/erss.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- erss.c      11 Jan 2004 23:23:56 -0000      1.12
+++ erss.c      12 Jan 2004 22:59:34 -0000      1.13
@@ -11,7 +11,7 @@
 Evas_Object *bg;
 Evas_Object *cont;
 Evas_Object *tid;
-Ewd_List *config_files;
+Ewd_List *config_files = NULL;
 
 char *main_buffer;
 char *last_time;
@@ -188,12 +188,12 @@
         */
        if (total_connects == 1)
                printf ("%s info: sending HTTP request ...\n", PACKAGE);
-
+       
        snprintf (c, sizeof (c), "GET %s HTTP/1.0\r\n", cfg->url);
        ecore_con_server_send (server, c, strlen (c));
        snprintf (c, sizeof (c), "Host: %s \r\n\r\n", cfg->hostname);
        ecore_con_server_send (server, c, strlen (c));
-
+       
        waiting_for_reply = TRUE;
 
        return 1;
@@ -320,7 +320,7 @@
                rc->browser = strdup ("mozilla");
        }
        
-       snprintf (c, sizeof (c), "%s %s", rc->browser, item->url);
+       snprintf (c, sizeof (c), "%s \"%s\"", rc->browser, item->url);
        ecore_exe_run (c, NULL);
 }
 
@@ -402,8 +402,9 @@
 
                                        if (strstr (dentries[num]->d_name, ".cfg")) {
                                                found_files = TRUE;
-                                               printf ("\t%s\n", file);
-                                               ewd_list_append (config_files, file);
+                                               ewd_list_append (config_files, strdup 
(file));
+                                               if (output)
+                                                       printf ("\t%s\n", file);
                                        }
                                }
 
@@ -573,7 +574,6 @@
        if (!ecore_evas_init ())
                return -1;
 
-
        width = 300;
        height = 16 * cfg->num_stories;
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/erss.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- erss.h      11 Jan 2004 23:23:56 -0000      1.3
+++ erss.h      12 Jan 2004 22:59:34 -0000      1.4
@@ -33,10 +33,12 @@
 extern Ecore_Evas *ee;
 extern Ewd_List *list;
 extern Evas_Object *cont;
+extern Ewd_List *config_files;
 
 void cb_mouse_out_item (void *data, Evas_Object *o, const char *sig, const char *src);
 void cb_mouse_in (void *data, Evas *e, Evas_Object *obj, void *event_info);
 void cb_mouse_out (void *data, Evas *e, Evas_Object *obj, void *event_info);
+void list_config_files (int output);
        
 
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/parse.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- parse.c     11 Jan 2004 23:23:56 -0000      1.9
+++ parse.c     12 Jan 2004 22:59:34 -0000      1.10
@@ -6,7 +6,6 @@
 Config *cfg = NULL;
 Rc_Config *rc = NULL;
 
-
 char *get_element (char **buffer, char *type)
 {
        char tmp_char;
@@ -262,7 +261,7 @@
        memset(rc, 0, sizeof(Rc_Config));
        
        fp = fopen (file, "r");
-       
+
        while (fp && (line = get_next_line (fp)) != NULL)
        {
                if ((c = get_element (&line, "config")) != NULL)
@@ -344,12 +343,37 @@
        FILE *fp;
        char *line;
        char *c;
+       char *str;
+       int match = FALSE;
 
-       if ((fp = fopen (file, "r")) == NULL)
-       {
-               fprintf (stderr, "%s error: Can't open config file %s\n", 
-                               PACKAGE, file);
-               exit (-1);
+       if ((fp = fopen (file, "r")) == NULL) {
+               list_config_files (FALSE);
+
+               str = ewd_list_goto_first (config_files);
+               while ((str = ewd_list_current (config_files))) {
+                       if (strstr (str, file))  {
+                               
+                               if ((fp = fopen (str, "r")) == NULL) {
+                                       fprintf (stderr, "%s error: Can't open config 
file %s\n",
+                                                       PACKAGE, str);
+                                       exit (-1);
+                               }
+
+                               match = TRUE;
+                               break;
+                       } 
+                       
+                       ewd_list_next (config_files);
+               }
+
+               if (!match) {
+                       fprintf (stderr, "%s error: No match for %s\n", PACKAGE, file);
+                       exit (-1);
+               } else {
+                       printf ("%s info: your string '%s' matches %s\n", PACKAGE, 
file, str);
+                       printf ("%s info: using %s as config file\n", PACKAGE, str);
+               }
+                       
        }
 
        cfg = malloc (sizeof (Config));




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to