RNAlib-2.3.1
string_utils.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_STRING_UTILS_H
2 #define VIENNA_RNA_PACKAGE_STRING_UTILS_H
3 
4 /* make this interface backward compatible with RNAlib < 2.2.0 */
5 #define VRNA_BACKWARD_COMPAT
6 
7 #ifdef DEPRECATION_WARNINGS
8 # ifdef __GNUC__
9 # define DEPRECATED(func) func __attribute__ ((deprecated))
10 # else
11 # define DEPRECATED(func) func
12 # endif
13 #else
14 # define DEPRECATED(func) func
15 #endif
16 
29 
33 #define XSTR(s) STR(s)
34 
38 #define STR(s) #s
39 
40 #ifndef FILENAME_MAX_LENGTH
41 
48 #define FILENAME_MAX_LENGTH 80
49 
56 #define FILENAME_ID_LENGTH 42
57 
58 #endif
59 
60 #ifdef HAVE_CONFIG_H
61 #include <config.h>
62 #ifndef HAVE_STRDUP
63 char *strdup(const char *s);
64 #endif
65 #endif
66 
85 char *vrna_strdup_printf(const char *format, ...);
86 
87 
102 char *vrna_strdup_vprintf(const char *format, va_list argp);
103 
104 
123 int vrna_strcat_printf(char **dest, const char *format, ...);
124 
125 
138 int vrna_strcat_vprintf(char **dest, const char *format, va_list args);
139 
140 
148 char *vrna_random_string(int l, const char symbols[]);
149 
157 int vrna_hamming_distance(const char *s1, const char *s2);
158 
169 int vrna_hamming_distance_bound(const char *s1, const char *s2, int n);
170 
178 void vrna_seq_toRNA(char *sequence);
179 
185 void vrna_seq_toupper(char *sequence);
186 
198 char *vrna_cut_point_insert(const char *string,
199  int cp);
200 
213 char *vrna_cut_point_remove(const char *string,
214  int *cp);
215 
220 #ifdef VRNA_BACKWARD_COMPAT
221 
226 DEPRECATED(void str_uppercase(char *sequence));
227 
233 DEPRECATED(void str_DNA2RNA(char *sequence));
234 
240 DEPRECATED(char *random_string(int l, const char symbols[]));
241 
247 DEPRECATED(int hamming(const char *s1, const char *s2));
248 
254 DEPRECATED(int hamming_bound(const char *s1, const char *s2, int n));
255 
256 #endif
257 
258 #endif
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
int vrna_hamming_distance(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char * vrna_strdup_printf(const char *format,...)
Safely create a formatted string.
int vrna_hamming_distance_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
char * vrna_random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
Various data structures and pre-processor macros.
void vrna_seq_toRNA(char *sequence)
Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet.
char * vrna_cut_point_insert(const char *string, int cp)
Add a separating &#39;&&#39; character into a string according to cut-point position.
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
char * vrna_cut_point_remove(const char *string, int *cp)
Remove a separating &#39;&&#39; character from a string.
int vrna_strcat_printf(char **dest, const char *format,...)
Safely append a formatted string to another string.
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
int vrna_strcat_vprintf(char **dest, const char *format, va_list args)
Safely append a formatted string to another string.
void vrna_seq_toupper(char *sequence)
Convert an input sequence to uppercase.
char * vrna_strdup_vprintf(const char *format, va_list argp)
Safely create a formatted string.
int hamming_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.