This header covers routines to create and manipulate LALCache structures and to read LAL cache files.
Prototypes | |
LALCache * | XLALCreateCache (UINT4 length) |
Creates a LALCache structure. More... | |
void | XLALDestroyCache (LALCache *cache) |
Destroys a LALCache structure. More... | |
LALCache * | XLALCacheDuplicate (const LALCache *cache) |
Duplicates a LALCache structure. More... | |
LALCache * | XLALCacheMerge (const LALCache *cache1, const LALCache *cache2) |
Returns a new LALCache structure that is the merge of two. More... | |
LALCache * | XLALCacheFileRead (LALFILE *fp) |
Reads a LAL cache file and produces a LALCache structure. More... | |
LALCache * | XLALCacheImport (const char *fname) |
Reads a LAL cache file and produces a LALCache structure. More... | |
LALCache * | XLALCacheGlob (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 *filename) |
Exports a LALCache structure to an output LAL cache file. More... | |
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... | |
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... | |
LALCacheEntry * | XLALCacheEntrySeek (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... | |
Data Structures | |
struct | LALCacheEntry |
An entry in a LAL cache. More... | |
struct | LALCache |
The LALCache structure is an array of entries. More... | |
Creates a LALCache structure.
Definition at line 154 of file LALCache.c.
void XLALDestroyCache | ( | LALCache * | cache | ) |
Destroys a LALCache structure.
Definition at line 172 of file LALCache.c.
Duplicates a LALCache structure.
Definition at line 187 of file LALCache.c.
Returns a new LALCache structure that is the merge of two.
Definition at line 201 of file LALCache.c.
LALCache* XLALCacheFileRead | ( | LALFILE * | fp | ) |
Reads a LAL cache file and produces a LALCache structure.
Definition at line 225 of file LALCache.c.
LALCache* XLALCacheImport | ( | const char * | fname | ) |
Reads a LAL cache file and produces a LALCache structure.
Definition at line 252 of file LALCache.c.
LALCache* XLALCacheGlob | ( | const char * | dirstr, |
const char * | fnptrn | ||
) |
Globs a directory and construct LALCache from matching entries.
[in] | dirstr | Colon-delimited list of directories. |
[in] | fnptrn | Glob pattern for matching files. |
Definition at line 314 of file LALCache.c.
int XLALCacheFileWrite | ( | LALFILE * | fp, |
const LALCache * | cache | ||
) |
Writes a LALCache structure to output LALFILE.
Definition at line 382 of file LALCache.c.
int XLALCacheExport | ( | const LALCache * | cache, |
const char * | filename | ||
) |
Exports a LALCache structure to an output LAL cache file.
Definition at line 408 of file LALCache.c.
int XLALCacheSort | ( | LALCache * | cache | ) |
Sorts entries in a LALCache structure.
Definition at line 466 of file LALCache.c.
int XLALCacheUniq | ( | LALCache * | cache | ) |
Prunes duplicate entries keeping the second one; cache is reduced in length if there are.
Entries are duplicates if their metadata are the same (even if the urls are different
Definition at line 477 of file LALCache.c.
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.
cache | UNDOCUMENTED |
t0 | Remove entries ending before t0 (0 to disable). |
t1 | Remove entries ending after t1 (0 to disable). |
srcregex | Regular expression to match src field (NULL to disable). |
dscregex | Regular expression to match dsc field (NULL to disable). |
urlregex | Regular expression to match url field (NULL to disable). |
Definition at line 544 of file LALCache.c.
LALCacheEntry* XLALCacheEntrySeek | ( | 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.
Returns NULL if the time is after the last entry.
Definition at line 654 of file LALCache.c.
LALFILE* XLALCacheEntryOpen | ( | const LALCacheEntry * | entry | ) |
Open a file identified by an entry in a LALCache structure.
Definition at line 663 of file LALCache.c.