Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : proto

Dir     : e17/proto/esmart/src/container


Modified Files:
        Makefile.am container_plugin.c container_private.h 
        container_util.c 


Log Message:

some cleanups.
use lt error reporting correctly (hopefully)

===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/container/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 13 Jan 2004 00:48:29 -0000      1.2
+++ Makefile.am 13 Jan 2004 19:26:41 -0000      1.3
@@ -20,4 +20,4 @@
 
 libecontainer_la_LIBADD = @evas_libs@ @imlib_libs@ -lm
 libecontainer_la_LDFLAGS = -version-info 1:0:0
-libecontainer_la_CFLAGS = -g
+libecontainer_la_CFLAGS = -g -Wall
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/container/container_plugin.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- container_plugin.c  13 Jan 2004 18:46:29 -0000      1.3
+++ container_plugin.c  13 Jan 2004 19:26:41 -0000      1.4
@@ -8,22 +8,21 @@
 #include <string.h>
 #include <limits.h>
 #include "container.h"
+#include "container_private.h"
 
 
 static char *_find_plugin(const char *dir, const char *name)
 {
   Evas_List *files, *l;
-  char *ret = NULL, tmp[128], buf[4086];
+  char *ret = NULL, tmp[128];
 
   if (!(files = _dir_get_files(dir)))
     return NULL;
 
   for (l = files; l; l = l->next) {
-    printf("current file: %s\n", l->data);
     sscanf((char *)l->data, "%127[^.].so", tmp);
 
     if (!strcasecmp(name, tmp)) {
-      printf("match!\n");
       ret = strdup(l->data);
       break;
     }
@@ -45,7 +44,7 @@
   Container_Layout_Plugin *p;
 
   int (*init)(void *p);
-  char *error, path[PATH_MAX + 1];
+  char path[PATH_MAX + 1];
   char *right_name;
   int numerr;
 
@@ -62,9 +61,10 @@
 
   snprintf(path, sizeof(path), "%s/%s.so", CONTAINER_PLUGIN_DIR, name); 
 
-  if (numerr = lt_dlinit())
+  if ((numerr = lt_dlinit()))
   {
     fprintf(stderr, "ERROR: initting lt, %d\n", numerr);
+    fprintf(stderr, "ERROR - lt: (%s)\n", lt_dlerror());
   }
 
   if (!(p->handle = lt_dlopen(path))) {
@@ -81,6 +81,7 @@
     if (!(p->handle = lt_dlopen(path)))
     {
       fprintf(stderr, "ERROR: can't dlopen plugin (%s)\n", path);
+      fprintf(stderr, "ERROR - lt: (%s)\n", lt_dlerror());
       _container_layout_plugin_free(p);
       return NULL;
     }
@@ -88,24 +89,10 @@
   
   init = lt_dlsym(p->handle, "plugin_init");
 
-  if ((error = lt_dlerror()))
-  {
-    fprintf(stderr, "ERROR: lt (%s)\n", error);
-    
-    /*
-     * FIXME: i get errors regardless (even when working), so this is
-     * is commented out for now
-     */
-
-    /*
-    _container_layout_plugin_free(p);
-    return NULL;
-    */
-  }
-  
   if (!(*init)(p))
   {
     fprintf(stderr, "ERROR: can't init plugin\n");
+    fprintf(stderr, "ERROR - lt: (%s)\n", lt_dlerror());
     _container_layout_plugin_free(p);
     return NULL;
   }
@@ -138,6 +125,13 @@
     fprintf(stderr, "ERROR: no container\n");
     return 0;
   }
+
+  if (cont->plugin)
+  {
+    lt_dlclose(cont->plugin->handle);
+    _container_layout_plugin_free(cont->plugin);
+    cont->plugin = NULL;
+  }
  
   if (!(cont->plugin = _container_layout_plugin_new(plugin)))
   {
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/container/container_private.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- container_private.h 13 Jan 2004 18:46:29 -0000      1.2
+++ container_private.h 13 Jan 2004 19:26:41 -0000      1.3
@@ -13,5 +13,10 @@
 void _cb_element_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
 void _container_scale_scroll(Container *cont, double old_length);
+int is_dir(const char *dir);
+Evas_List *_dir_get_files(const char *directory);
+
+void _container_layout_plugin_free(Container_Layout_Plugin *p);
+Container_Layout_Plugin *_container_layout_plugin_new(const char *name);
 
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/container/container_util.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- container_util.c    13 Jan 2004 00:48:29 -0000      1.3
+++ container_util.c    13 Jan 2004 19:26:41 -0000      1.4
@@ -35,7 +35,9 @@
   
 }
 
-int is_dir(const char *dir) {
+int
+is_dir(const char *dir)
+{
        struct stat st;
 
        if (stat(dir, &st))




-------------------------------------------------------
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