RNAlib-2.3.2
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 
28 #include <stdarg.h>
30 
34 #define XSTR(s) STR(s)
35 
39 #define STR(s) #s
40 
41 #ifndef FILENAME_MAX_LENGTH
42 
49 #define FILENAME_MAX_LENGTH 80
50 
57 #define FILENAME_ID_LENGTH 42
58 
59 #endif
60 
61 #ifdef HAVE_CONFIG_H
62 #include <config.h>
63 #ifndef HAVE_STRDUP
64 char *strdup(const char *s);
65 #endif
66 #endif
67 
86 char *vrna_strdup_printf(const char *format, ...);
87 
88 
103 char *vrna_strdup_vprintf(const char *format, va_list argp);
104 
105 
124 int vrna_strcat_printf(char **dest, const char *format, ...);
125 
126 
139 int vrna_strcat_vprintf(char **dest, const char *format, va_list args);
140 
141 
149 char *vrna_random_string(int l, const char symbols[]);
150 
158 int vrna_hamming_distance(const char *s1, const char *s2);
159 
170 int vrna_hamming_distance_bound(const char *s1, const char *s2, int n);
171 
179 void vrna_seq_toRNA(char *sequence);
180 
186 void vrna_seq_toupper(char *sequence);
187 
199 char *vrna_cut_point_insert(const char *string,
200  int cp);
201 
214 char *vrna_cut_point_remove(const char *string,
215  int *cp);
216 
221 #ifdef VRNA_BACKWARD_COMPAT
222 
227 DEPRECATED(void str_uppercase(char *sequence));
228 
234 DEPRECATED(void str_DNA2RNA(char *sequence));
235 
241 DEPRECATED(char *random_string(int l, const char symbols[]));
242 
248 DEPRECATED(int hamming(const char *s1, const char *s2));
249 
255 DEPRECATED(int hamming_bound(const char *s1, const char *s2, int n));
256 
257 #endif
258 
259 #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.