RNAlib-2.4.14
strings.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 #ifdef VRNA_WARN_DEPRECATED
5 # if defined(__clang__)
6 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
7 # elif defined(__GNUC__)
8 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
9 # else
10 # define DEPRECATED(func, msg) func
11 # endif
12 #else
13 # define DEPRECATED(func, msg) func
14 #endif
15 
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 
66 
67 #endif
68 #endif
69 
88 char *
89 vrna_strdup_printf(const char *format,
90  ...);
91 
92 
107 char *
108 vrna_strdup_vprintf(const char *format,
109  va_list argp);
110 
111 
130 int
131 vrna_strcat_printf(char **dest,
132  const char *format,
133  ...);
134 
135 
148 int
149 vrna_strcat_vprintf(char **dest,
150  const char *format,
151  va_list args);
152 
153 
192 char **
193 vrna_strsplit(const char *string,
194  const char *delimiter);
195 
196 
204 char *
205 vrna_random_string(int l,
206  const char symbols[]);
207 
208 
216 int
217 vrna_hamming_distance(const char *s1,
218  const char *s2);
219 
220 
231 int
232 vrna_hamming_distance_bound(const char *s1,
233  const char *s2,
234  int n);
235 
236 
244 void
245 vrna_seq_toRNA(char *sequence);
246 
247 
253 void
254 vrna_seq_toupper(char *sequence);
255 
256 
263 char *
264 vrna_seq_ungapped(const char *seq);
265 
266 
278 char *
279 vrna_cut_point_insert(const char *string,
280  int cp);
281 
282 
295 char *
296 vrna_cut_point_remove(const char *string,
297  int *cp);
298 
299 
304 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
305 
310 DEPRECATED(void str_uppercase(char *sequence), "Use vrna_seq_toupper() instead");
311 
317 DEPRECATED(void str_DNA2RNA(char *sequence), "Use vrna_seq_toRNA() instead");
318 
324 DEPRECATED(char *random_string(int l,
325  const char symbols[]),
326  "Use vrna_random_string() instead");
327 
333 DEPRECATED(int hamming(const char *s1,
334  const char *s2),
335  "Use vrna_hamming_distance() instead");
336 
342 DEPRECATED(int hamming_bound(const char *s1,
343  const char *s2,
344  int n),
345  "Use vrna_hamming_distance_bound() instead");
346 
347 #endif
348 
349 #endif
int vrna_hamming_distance(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char ** vrna_strsplit(const char *string, const char *delimiter)
Split a string into tokens using a delimiting character.
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.
int hamming_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.
char * vrna_seq_ungapped(const char *seq)
Remove gap characters from a nucleotide sequence.
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.
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.
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
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.
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char * vrna_strdup_vprintf(const char *format, va_list argp)
Safely create a formatted string.