*** empty log message ***
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 8 Apr 2005 12:08:12 +0000 (12:08 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 8 Apr 2005 12:08:12 +0000 (12:08 +0000)
org.glite.jp.primary/src/builtin_plugins.h [new file with mode: 0644]
org.glite.jp.primary/src/file_plugin.c [new file with mode: 0644]

diff --git a/org.glite.jp.primary/src/builtin_plugins.h b/org.glite.jp.primary/src/builtin_plugins.h
new file mode 100644 (file)
index 0000000..3b2c201
--- /dev/null
@@ -0,0 +1,7 @@
+
+#define GLITE_JP_FILETYPE_TAGS "urn:org.glite.jp.primary:tags"
+#define GLITE_JP_FILETYPE_LB   "urn:org.glite.jp.primary:lb"
+#define GLITE_JP_FILETYPE_ISB  "urn:org.glite.jp.primary:isb"
+#define GLITE_JP_FILETYPE_OSB  "urn:org.glite.jp.primary:osb"
+
+#define GLITE_JP_FPLUG_TAGS_APPEND     0
diff --git a/org.glite.jp.primary/src/file_plugin.c b/org.glite.jp.primary/src/file_plugin.c
new file mode 100644 (file)
index 0000000..ec3db35
--- /dev/null
@@ -0,0 +1,65 @@
+#include <stdio.h>
+#include <getopt.h>
+#include <dlfcn.h>
+#include <errno.h>
+
+#include <glite/jp/types.h>
+#include "file_plugin.h"
+
+static struct option opts[] = {
+       { "plugin", 1, NULL, 'p' },
+       { NULL }
+};
+
+static void *loadit(glite_jp_context_t ctx,const char *so)
+{
+       void    *dl_handle = dlopen(so,RTLD_NOW);
+       glite_jp_error_t        err;
+       char    *e;
+
+       glite_jpps_fplug_init_t init;
+
+       if (!dl_handle) {
+               err.source = "dlopen()";
+               err.code = EINVAL;
+               err.desc = dlerror();
+               glite_jp_stack_error(ctx,&err);
+               return NULL;
+       }
+
+       dlerror();
+       init = dlsym(dl_handle,"init");
+       e = dlerror();
+       if (e) {
+               char    buf[300];
+               snprintf(buf,sizeof buf,"dlsym(\"%s\",\"init\")",so);
+               buf[299] = 0;
+               err.source = buf;
+               err.code = ENOENT;
+               err.desc = e;
+       }
+
+       /* FIXME: zavolat init */
+
+}
+
+int glite_jpps_fplug_load(glite_jp_context_t ctx,int *argc,char **argv)
+{
+       int     opt;
+       void    *fctx;
+
+       while ((opt = getopt_long(*argc,argv,"p:",opts,NULL)) != EOF) switch (opt) {
+               case 'p': fctx = loadit(ctx,optarg);
+                       if (!fctx) return -1;
+               default: break;
+       }
+
+       return 0;
+}
+
+int glite_jpps_fplug_lookup(glite_jp_context_t ctx,const char *uri, glite_jpps_fplug_data_t *plugin_data)
+{
+       /* TODO */
+       return 0;
+}
+