LALPulsar 7.1.1.1-eeff03c
GCTtoplist.h File Reference

Prototypes

int create_gctFstat_toplist (toplist_t **list, UINT8 length, SortBy_t whatToSortBy)
 creates a toplist with length elements, returns -1 on error (usually out of memory), else 0 More...
 
void free_gctFstat_toplist (toplist_t **list)
 frees the space occupied by the toplist More...
 
int insert_into_gctFstat_toplist (toplist_t *list, GCTtopOutputEntry *line)
 Inserts an element in to the toplist either if there is space left or the element is larger than the smallest element in the toplist. More...
 
int write_gctFstat_toplist_to_fp (toplist_t *list, FILE *fp, UINT4 *checksum)
 Writes the toplist to an (already open) filepointer Returns the number of written charactes sets the checksum if non-NULL Returns something <0 on error. More...
 
void sort_gctFstat_toplist (toplist_t *list)
 sorts the toplist with an internal sorting function, used before finally writing it More...
 
void sort_gctFstat_toplist_strongest (toplist_t *list)
 sorts the toplist with an internal sorting function, used before doing the follow-up analysis More...
 
int write_gct_checkpoint (const char *filename, toplist_t *tl, toplist_t *t2, toplist_t *t3, UINT4 counter, BOOLEAN do_sync)
 Checkpointing. More...
 
int read_gct_checkpoint (const char *filename, toplist_t *tl, toplist_t *t2, toplist_t *t3, UINT4 *counter)
 tries to read a checkpoint More...
 
int clear_gct_checkpoint (const char *filename)
 removes a checkpoint returns 0 on success, errno on failure More...
 
int write_hfs_oputput (const char *filename, toplist_t *tl)
 write the final output file: More...
 

Go to the source code of this file.

Data Structures

struct  GCTtopOutputEntry
 

Enumerations

enum  SortBy_t {
  SORTBY_F = 0 , SORTBY_NC = 1 , SORTBY_BSGL = 2 , SORTBY_DUAL_F_BSGL = 3 ,
  SORTBY_BSGLtL = 4 , SORTBY_BtSGLtL = 5 , SORTBY_TRIPLE_BStSGLtL = 6 , SORTBY_F_BSGLtL_BtSGLtL = 7 ,
  SORTBY_LAST
}
 enumerate all toplist-sorting options: by F (0), number-count (1), BSGL (2), "dual" toplists F + BSGL (3) More...
 

Variables

char ** global_argv
 
int global_argc
 

Enumeration Type Documentation

◆ SortBy_t

enum SortBy_t

enumerate all toplist-sorting options: by F (0), number-count (1), BSGL (2), "dual" toplists F + BSGL (3)

Enumerator
SORTBY_F 
SORTBY_NC 
SORTBY_BSGL 
SORTBY_DUAL_F_BSGL 
SORTBY_BSGLtL 
SORTBY_BtSGLtL 
SORTBY_TRIPLE_BStSGLtL 
SORTBY_F_BSGLtL_BtSGLtL 
SORTBY_LAST 

Definition at line 71 of file GCTtoplist.h.

Function Documentation

◆ create_gctFstat_toplist()

int create_gctFstat_toplist ( toplist_t **  list,
UINT8  length,
SortBy_t  whatToSortBy 
)

creates a toplist with length elements, returns -1 on error (usually out of memory), else 0

Definition at line 246 of file GCTtoplist.c.

◆ free_gctFstat_toplist()

void free_gctFstat_toplist ( toplist_t **  list)

frees the space occupied by the toplist

Definition at line 270 of file GCTtoplist.c.

◆ insert_into_gctFstat_toplist()

int insert_into_gctFstat_toplist ( toplist_t list,
GCTtopOutputEntry line 
)

Inserts an element in to the toplist either if there is space left or the element is larger than the smallest element in the toplist.

In the latter case, remove the smallest element from the toplist Returns 1 if the element was actually inserted, 0 if not.

Definition at line 281 of file GCTtoplist.c.

◆ write_gctFstat_toplist_to_fp()

int write_gctFstat_toplist_to_fp ( toplist_t list,
FILE *  fp,
UINT4 checksum 
)

Writes the toplist to an (already open) filepointer Returns the number of written charactes sets the checksum if non-NULL Returns something <0 on error.

Definition at line 489 of file GCTtoplist.c.

◆ sort_gctFstat_toplist()

void sort_gctFstat_toplist ( toplist_t list)

sorts the toplist with an internal sorting function, used before finally writing it

Definition at line 291 of file GCTtoplist.c.

◆ sort_gctFstat_toplist_strongest()

void sort_gctFstat_toplist_strongest ( toplist_t list)

sorts the toplist with an internal sorting function, used before doing the follow-up analysis

◆ write_gct_checkpoint()

int write_gct_checkpoint ( const char filename,
toplist_t tl,
toplist_t t2,
toplist_t t3,
UINT4  counter,
BOOLEAN  do_sync 
)

Checkpointing.

writes a checkpoint:

  • constructs temporary filename (by appending .TMP)
  • writes number of elements ("elems") in toplist to tempfile
  • dumps data to tempfile
  • appends counter
  • appends checksum (of elems, data and counter)
  • renames tempfile to final name returns -1 in case of an I/O error, -2 if out of memory, 0 otherwise (successful)

Definition at line 688 of file GCTtoplist.c.

◆ read_gct_checkpoint()

int read_gct_checkpoint ( const char filename,
toplist_t tl,
toplist_t t2,
toplist_t t3,
UINT4 counter 
)

tries to read a checkpoint

  • tries to open the file, returns 1 if no file found
  • reads elems, data, counter and checksum
  • verifies checksum
  • restores the heap by sorting returns 0 if successfully read a checkpoint 1 if no checkpoint was found -1 in case of an I/O error -2 if the checksum was wrong or elems was unreasonable

Definition at line 941 of file GCTtoplist.c.

◆ clear_gct_checkpoint()

int clear_gct_checkpoint ( const char filename)

removes a checkpoint returns 0 on success, errno on failure

Definition at line 1242 of file GCTtoplist.c.

◆ write_hfs_oputput()

int write_hfs_oputput ( const char filename,
toplist_t tl 
)

write the final output file:

  • re-sort the toplist into freq/alpha/delta/fdot order
  • write out the toplist in ASCII format with end marker to a temporary file
  • rename the file to the final name

Definition at line 1284 of file GCTtoplist.c.

Variable Documentation

◆ global_argv

char** global_argv
extern

Definition at line 70 of file HierarchSearchGCT.c.

◆ global_argc

int global_argc
extern

Definition at line 71 of file HierarchSearchGCT.c.