/Home/aooliver/work/stagersvc/org.glite.data.lcg_gfal/src/checkprotolib.c File Reference

#include <sys/types.h>
#include <errno.h>
#include <dirent.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "gfal.h"

Go to the source code of this file.

Functions

static ssize_t dummysetfilchg (int fd, const void *buffer, size_t size)
proto_opsfind_pops (const char *protocol)
static int fnotsup ()
char ** get_sup_proto ()
 mapposixerror (struct proto_ops *pops, int ioflag)

Variables

static struct proto_ops pops_array []


Function Documentation

static ssize_t dummysetfilchg int  fd,
const void *  buffer,
size_t  size
[static]
 

Definition at line 248 of file checkprotolib.c.

00249 {
00250         return (0);
00251 }

struct proto_ops* find_pops const char *  protocol  ) 
 

Definition at line 254 of file checkprotolib.c.

References pops_array, and proto_ops::proto_name.

Referenced by deletepfn(), gfal_access(), gfal_chmod(), gfal_lstat(), gfal_lstat64(), gfal_mkdir(), gfal_open(), gfal_opendir(), gfal_rename(), gfal_rmdir(), gfal_stat(), and gfal_stat64().

00255 {
00256         struct proto_ops *pops;
00257         struct proto_ops *tmp;
00258 
00259         for (pops = pops_array; *pops->proto_name; pops++) {
00260                 if (strcmp (protocol, pops->proto_name) == 0)
00261                         break;
00262         }
00263         if (*pops->proto_name) {
00264                 if (pops->libok > 0)
00265                         return (pops);
00266                 if (pops->libok == 0 && pops->checkprotolib (pops) == 0) {
00267                         for (tmp = pops_array; *tmp->proto_name; tmp++) {
00268                                 if (tmp != pops &&
00269                                     tmp->checkprotolib == pops->checkprotolib)
00270                                         memcpy (&tmp->libok, &pops->libok,
00271                                             sizeof(struct proto_ops) - sizeof(char *));
00272                         }
00273                         return (pops);
00274                 }
00275         }
00276         errno = EPROTONOSUPPORT;
00277         return (NULL);
00278 }

static int fnotsup  )  [static]
 

Definition at line 281 of file checkprotolib.c.

00282 {
00283         errno = ENOTSUP;
00284         return (-1);
00285 }

char** get_sup_proto  ) 
 

Definition at line 288 of file checkprotolib.c.

References proto_ops::checkprotolib, proto_ops::libok, pops_array, and proto_ops::proto_name.

Referenced by gfal_open(), and turlfromsfn().

00289 {
00290         int i = 0;
00291         struct proto_ops *pops;
00292         static char *supported_protocols[sizeof(pops_array)/sizeof(struct proto_ops)];
00293         struct proto_ops *tmp;
00294 
00295         for (pops = pops_array;; pops++) {
00296                 if (pops->libok < 0) continue;          /* library not accessible */
00297                 if (pops->libok == 0) {
00298                         if (pops->checkprotolib (pops))
00299                                 continue;
00300                         for (tmp = pops_array; *tmp->proto_name; tmp++) {
00301                                 if (tmp != pops &&
00302                                     tmp->checkprotolib == pops->checkprotolib)
00303                                         memcpy (&tmp->libok, &pops->libok,
00304                                             sizeof(struct proto_ops) - sizeof(char *));
00305                         }
00306                 }
00307                 supported_protocols[i++] = pops->proto_name;
00308                 if (*pops->proto_name == '\0') break;
00309         }
00310         return (supported_protocols);
00311 }

mapposixerror struct proto_ops pops,
int  ioflag
 

Definition at line 313 of file checkprotolib.c.

00314 {
00315         return (errno);
00316 }


Variable Documentation

struct proto_ops pops_array[] [static]
 

Definition at line 185 of file checkprotolib.c.

Referenced by find_pops(), and get_sup_proto().


Generated on Fri Sep 8 20:20:47 2006 for GFAL by  doxygen 1.4.6