1 #ifndef VIENNA_RNA_PACKAGE_UTILS_H 2 #define VIENNA_RNA_PACKAGE_UTILS_H 5 #define VRNA_BACKWARD_COMPAT 7 #ifdef VRNA_WARN_DEPRECATED 9 # define DEPRECATED(func) func __attribute__ ((deprecated)) 11 # define DEPRECATED(func) func 14 # define DEPRECATED(func) func 40 #define PRIVATE static 45 #define VRNA_INPUT_ERROR 1U 49 #define VRNA_INPUT_QUIT 2U 53 #define VRNA_INPUT_MISC 4U 62 #define VRNA_INPUT_FASTA_HEADER 8U 69 #define VRNA_INPUT_SEQUENCE 16U 75 #define VRNA_INPUT_CONSTRAINT 32U 81 #define VRNA_INPUT_NO_TRUNCATION 256U 86 #define VRNA_INPUT_NO_REST 512U 91 #define VRNA_INPUT_NO_SPAN 1024U 96 #define VRNA_INPUT_NOSKIP_BLANK_LINES 2048U 101 #define VRNA_INPUT_BLANK_LINE 4096U 106 #define VRNA_INPUT_NOSKIP_COMMENTS 128U 111 #define VRNA_INPUT_COMMENT 8192U 116 #define MIN2(A, B) ((A) < (B) ? (A) : (B)) 121 #define MAX2(A, B) ((A) > (B) ? (A) : (B)) 126 #define MIN3(A, B, C) (MIN2( (MIN2((A),(B))) ,(C))) 131 #define MAX3(A, B, C) (MAX2( (MAX2((A),(B))) ,(C))) 137 #define vrna_alloc(S) calloc(1,(S)) 138 #define vrna_realloc(p, S) xrealloc(p, S) 259 extern unsigned short xsubi[3];
311 unsigned int options);
367 #ifdef VRNA_BACKWARD_COMPAT 369 DEPRECATED(
int *get_indx(
unsigned int length));
371 DEPRECATED(
int *get_iindx(
unsigned int length));
385 DEPRECATED(
char *
get_line(FILE *fp));
412 DEPRECATED(
void warn_user(
const char message[]));
419 DEPRECATED(
void nrerror(
const char message[]));
426 DEPRECATED(
void *
space(
unsigned size));
433 DEPRECATED(
void *
xrealloc(
void *p,
unsigned size));
446 DEPRECATED(
double urn(
void));
453 DEPRECATED(
int int_urn(
int from,
int to));
460 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.
void vrna_message_error(const char *format,...)
Print an error message and die.
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.
char * time_stamp(void)
Get a timestamp.
Functions to process, convert, and generally handle different nucleotide and/or base pair alphabets...
char * get_line(FILE *fp)
Read a line of arbitrary length from a stream.
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...
void vrna_message_info(FILE *fp, const char *format,...)
Print an info message.
int int_urn(int from, int to)
Generates a pseudo random integer in a specified range.
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...
void vrna_message_vinfo(FILE *fp, const char *format, va_list args)
Print an info message.
char * vrna_time_stamp(void)
Get a timestamp.
Various data structures and pre-processor macros.
Various utility- and helper-functions for secondary structure parsing, converting, etc.
Several utilities for file handling.
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.
void vrna_message_warning(const char *format,...)
Print a warning message.
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_verror(const char *format, va_list args)
Print an error message and die.
double urn(void)
get a random number from [0..1]
unsigned short xsubi[3]
Current 48 bit random number.
void vrna_message_vwarning(const char *format, va_list args)
Print a warning message.
void init_rand(void)
Make random number seeds.
double vrna_urn(void)
get a random number from [0..1]