1 #ifndef VIENNA_RNA_PACKAGE_UTILS_H 2 #define VIENNA_RNA_PACKAGE_UTILS_H 5 #define VRNA_BACKWARD_COMPAT 7 #ifdef DEPRECATION_WARNINGS 9 # define DEPRECATED(func) func __attribute__ ((deprecated)) 11 # define DEPRECATED(func) func 14 # define DEPRECATED(func) func 36 #define PRIVATE static 41 #define VRNA_INPUT_ERROR 1U 45 #define VRNA_INPUT_QUIT 2U 49 #define VRNA_INPUT_MISC 4U 58 #define VRNA_INPUT_FASTA_HEADER 8U 65 #define VRNA_INPUT_SEQUENCE 16U 71 #define VRNA_INPUT_CONSTRAINT 32U 77 #define VRNA_INPUT_NO_TRUNCATION 256U 82 #define VRNA_INPUT_NO_REST 512U 87 #define VRNA_INPUT_NO_SPAN 1024U 92 #define VRNA_INPUT_NOSKIP_BLANK_LINES 2048U 97 #define VRNA_INPUT_BLANK_LINE 4096U 102 #define VRNA_INPUT_NOSKIP_COMMENTS 128U 107 #define VRNA_INPUT_COMMENT 8192U 112 #define MIN2(A, B) ((A) < (B) ? (A) : (B)) 117 #define MAX2(A, B) ((A) > (B) ? (A) : (B)) 122 #define MIN3(A, B, C) (MIN2( (MIN2((A),(B))) ,(C))) 127 #define MAX3(A, B, C) (MAX2( (MAX2((A),(B))) ,(C))) 133 #define vrna_alloc(S) calloc(1,(S)) 134 #define vrna_realloc(p, S) xrealloc(p, S) 173 void vrna_message_info(FILE *fp,
const char message[]);
188 extern unsigned short xsubi[3];
258 unsigned int options);
314 #ifdef VRNA_BACKWARD_COMPAT 316 DEPRECATED(
int *get_indx(
unsigned int length));
318 DEPRECATED(
int *get_iindx(
unsigned int length));
345 DEPRECATED(
void warn_user(
const char message[]));
352 DEPRECATED(
void nrerror(
const char message[]));
359 DEPRECATED(
void *
space(
unsigned size));
366 DEPRECATED(
void *
xrealloc(
void *p,
unsigned size));
379 DEPRECATED(
double urn(
void));
386 DEPRECATED(
int int_urn(
int from,
int to));
393 DEPRECATED(
void filecopy(FILE *from, FILE *to));
void * vrna_alloc(unsigned size)
Allocate space safely.
void vrna_message_input_seq(const char *s)
Print a line with a user defined string and a ruler to stdout.
unsigned int get_input_line(char **string, unsigned int options)
void * space(unsigned size)
Allocate space safely.
char * get_line(FILE *fp)
Read a line of arbitrary length from a stream.
void warn_user(const char message[])
Print a warning message.
void vrna_message_input_seq_simple(void)
Print a line to stdout that asks for an input sequence.
void vrna_message_warning(const char message[])
Print a warning message.
char * time_stamp(void)
Get a timestamp.
Functions to process, convert, and generally handle different nucleotide and/or base pair alphabets...
int * vrna_idx_col_wise(unsigned int length)
Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions...
int int_urn(int from, int to)
Generates a pseudo random integer in a specified range.
void vrna_file_copy(FILE *from, FILE *to)
Inefficient `cp'.
void filecopy(FILE *from, FILE *to)
Inefficient cp
void vrna_init_rand(void)
Initialize seed for random number generator.
void print_tty_input_seq(void)
Print a line to stdout that asks for an input sequence.
General utility- and helper-functions for RNA sequence and structure strings used throughout the Vien...
int * vrna_idx_row_wise(unsigned int length)
Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function relat...
char * vrna_time_stamp(void)
Get a timestamp.
Various utility- and helper-functions for secondary structure parsing, converting, etc.
void nrerror(const char message[])
Die with an error message.
void * xrealloc(void *p, unsigned size)
Reallocate space safely.
void * vrna_realloc(void *p, unsigned size)
Reallocate space safely.
int vrna_int_urn(int from, int to)
Generates a pseudo random integer in a specified range.
void print_tty_input_seq_str(const char *s)
Print a line with a user defined string and a ruler to stdout.
void vrna_message_error(const char message[])
Die with an error message.
double urn(void)
get a random number from [0..1]
unsigned short xsubi[3]
Current 48 bit random number.
void init_rand(void)
Make random number seeds.
double vrna_urn(void)
get a random number from [0..1]