LAL  7.5.0.1-b72065a
LALCache.c File Reference

Prototypes

static int XLALCacheFileReadRow (char *s, size_t len, LALFILE *fp, int *line)
 
static int XLALCacheFileCountRows (LALFILE *fp)
 
static char * XLALCacheFileNextField (char **ps)
 
static int XLALCacheFileParseEntry (struct tagLALCacheEntry *entry, char *s)
 
static int XLALCacheEntryCopy (LALCacheEntry *dst, const LALCacheEntry *src)
 
LALCacheXLALCreateCache (UINT4 length)
 Creates a LALCache structure. More...
 
void XLALDestroyCache (LALCache *cache)
 Destroys a LALCache structure. More...
 
LALCacheXLALCacheDuplicate (const LALCache *cache)
 Duplicates a LALCache structure. More...
 
LALCacheXLALCacheMerge (const LALCache *cache1, const LALCache *cache2)
 Returns a new LALCache structure that is the merge of two. More...
 
LALCacheXLALCacheFileRead (LALFILE *fp)
 Reads a LAL cache file and produces a LALCache structure. More...
 
LALCacheXLALCacheImport (const char *fname)
 Reads a LAL cache file and produces a LALCache structure. More...
 
LALCacheXLALCacheGlob (const char *dirstr, const char *fnptrn)
 Globs a directory and construct LALCache from matching entries. More...
 
int XLALCacheFileWrite (LALFILE *fp, const LALCache *cache)
 Writes a LALCache structure to output LALFILE. More...
 
int XLALCacheExport (const LALCache *cache, const char *fname)
 Exports a LALCache structure to an output LAL cache file. More...
 
static int XLALCacheCompareSource (void UNUSED *p, const void *p1, const void *p2)
 
static int XLALCacheCompareDescription (void UNUSED *p, const void *p1, const void *p2)
 
static int XLALCacheCompareStartTime (void UNUSED *p, const void *p1, const void *p2)
 
static int XLALCacheCompareDuration (void UNUSED *p, const void *p1, const void *p2)
 
static int XLALCacheCompareEntryMetadata (void *p, const void *p1, const void *p2)
 
int XLALCacheSort (LALCache *cache)
 Sorts entries in a LALCache structure. More...
 
int XLALCacheUniq (LALCache *cache)
 Prunes duplicate entries keeping the second one; cache is reduced in length if there are. More...
 
static int XLALCacheEntryMatchTime (const LALCacheEntry *entry, INT4 t0, INT4 t1)
 
int XLALCacheSieve (LALCache *cache, INT4 t0, INT4 t1, const char *srcregex, const char *dscregex, const char *urlregex)
 Selects only matching entries in a LALCache structure – other entries are deleted from the LALCache structure. More...
 
static int XLALCacheEntryBsearchCompare (const void *key, const void *ptr)
 
LALCacheEntryXLALCacheEntrySeek (const LALCache *cache, double t)
 Finds the first entry that contains the requested time, or the first entry after the time if the time is in a gap or before the first entry. More...
 
LALFILE * XLALCacheEntryOpen (const LALCacheEntry *entry)
 Open a file identified by an entry in a LALCache structure. More...
 

Go to the source code of this file.

Data Structures

struct  LALCacheEntryBsearchKey
 

Macros

#define _GNU_SOURCE   /* for realpath() */
 
#define NAME_MAX   FILENAME_MAX
 
#define FS   "\t" /* field separator */
 
#define RS   "\n" /* record separator */
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE   /* for realpath() */

Definition at line 20 of file LALCache.c.

◆ NAME_MAX

#define NAME_MAX   FILENAME_MAX

Definition at line 51 of file LALCache.c.

◆ FS

#define FS   "\t" /* field separator */

◆ RS

#define RS   "\n" /* record separator */

Function Documentation

◆ XLALCacheFileReadRow()

static int XLALCacheFileReadRow ( char *  s,
size_t  len,
LALFILE *  fp,
int *  line 
)
static

Definition at line 54 of file LALCache.c.

◆ XLALCacheFileCountRows()

static int XLALCacheFileCountRows ( LALFILE *  fp)
static

Definition at line 76 of file LALCache.c.

◆ XLALCacheFileNextField()

static char* XLALCacheFileNextField ( char **  ps)
static

Definition at line 91 of file LALCache.c.

◆ XLALCacheFileParseEntry()

static int XLALCacheFileParseEntry ( struct tagLALCacheEntry *  entry,
char *  s 
)
static

Definition at line 111 of file LALCache.c.

◆ XLALCacheEntryCopy()

static int XLALCacheEntryCopy ( LALCacheEntry dst,
const LALCacheEntry src 
)
static

Definition at line 141 of file LALCache.c.

◆ XLALCacheCompareSource()

static int XLALCacheCompareSource ( void UNUSED *  p,
const void *  p1,
const void *  p2 
)
static

Definition at line 420 of file LALCache.c.

◆ XLALCacheCompareDescription()

static int XLALCacheCompareDescription ( void UNUSED *  p,
const void *  p1,
const void *  p2 
)
static

Definition at line 428 of file LALCache.c.

◆ XLALCacheCompareStartTime()

static int XLALCacheCompareStartTime ( void UNUSED *  p,
const void *  p1,
const void *  p2 
)
static

Definition at line 436 of file LALCache.c.

◆ XLALCacheCompareDuration()

static int XLALCacheCompareDuration ( void UNUSED *  p,
const void *  p1,
const void *  p2 
)
static

Definition at line 444 of file LALCache.c.

◆ XLALCacheCompareEntryMetadata()

static int XLALCacheCompareEntryMetadata ( void *  p,
const void *  p1,
const void *  p2 
)
static

Definition at line 452 of file LALCache.c.

◆ XLALCacheEntryMatchTime()

static int XLALCacheEntryMatchTime ( const LALCacheEntry entry,
INT4  t0,
INT4  t1 
)
static

Definition at line 532 of file LALCache.c.

◆ XLALCacheEntryBsearchCompare()

static int XLALCacheEntryBsearchCompare ( const void *  key,
const void *  ptr 
)
static

Definition at line 624 of file LALCache.c.