00001 /******************************************************************************/ 00002 /* XrdFfsDent.hh help functions to merge direntries */ 00003 /* */ 00004 /* (c) 2010 by the Board of Trustees of the Leland Stanford, Jr., University */ 00005 /* All Rights Reserved */ 00006 /* Author: Wei Yang (SLAC National Accelerator Laboratory, 2009) */ 00007 /* Contract DE-AC02-76-SFO0515 with the Department of Energy */ 00008 /* */ 00009 /* This file is part of the XRootD software suite. */ 00010 /* */ 00011 /* XRootD is free software: you can redistribute it and/or modify it under */ 00012 /* the terms of the GNU Lesser General Public License as published by the */ 00013 /* Free Software Foundation, either version 3 of the License, or (at your */ 00014 /* option) any later version. */ 00015 /* */ 00016 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00017 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00018 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00019 /* License for more details. */ 00020 /* */ 00021 /* You should have received a copy of the GNU Lesser General Public License */ 00022 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00023 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00024 /* */ 00025 /* The copyright holder's institutional names and contributor's names may not */ 00026 /* be used to endorse or promote products derived from this software without */ 00027 /* specific prior written permission of the institution or contributor. */ 00028 /******************************************************************************/ 00029 00030 #include <string.h> 00031 #include <stdlib.h> 00032 #include <time.h> 00033 #include <pthread.h> 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 struct XrdFfsDentnames { 00040 char *name; 00041 struct XrdFfsDentnames *next; 00042 }; 00043 00044 void XrdFfsDent_names_del(struct XrdFfsDentnames **p); 00045 void XrdFfsDent_names_add(struct XrdFfsDentnames **p, char *name); 00046 void XrdFfsDent_names_join(struct XrdFfsDentnames **p, struct XrdFfsDentnames **n); 00047 int XrdFfsDent_names_extract(struct XrdFfsDentnames **p, char ***dnarray); 00048 00049 void XrdFfsDent_cache_init(); 00050 void XrdFfsDent_cache_destroy(); 00051 int XrdFfsDent_cache_fill(char *dname, char ***dnarray, int nents); 00052 int XrdFfsDent_cache_search(char *dname, char *dentname); 00053 00054 #ifdef __cplusplus 00055 } 00056 #endif 00057 00058