RNAlib-2.4.11
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 *vrna_strdup_printf(const char *format,
89  ...);
90 
91 
106 char *vrna_strdup_vprintf(const char *format,
107  va_list argp);
108 
109 
128 int vrna_strcat_printf(char **dest,
129  const char *format,
130  ...);
131 
132 
145 int vrna_strcat_vprintf(char **dest,
146  const char *format,
147  va_list args);
148 
149 
188 char **vrna_strsplit(const char *string,
189  const char *delimiter);
190 
191 
199 char *vrna_random_string(int l,
200  const char symbols[]);
201 
202 
210 int vrna_hamming_distance(const char *s1,
211  const char *s2);
212 
213 
224 int vrna_hamming_distance_bound(const char *s1,
225  const char *s2,
226  int n);
227 
228 
236 void vrna_seq_toRNA(char *sequence);
237 
238 
244 void vrna_seq_toupper(char *sequence);
245 
246 
253 char *
254 vrna_seq_ungapped(const char *seq);
255 
256 
268 char *vrna_cut_point_insert(const char *string,
269  int cp);
270 
271 
284 char *vrna_cut_point_remove(const char *string,
285  int *cp);
286 
287 
292 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
293 
298 DEPRECATED(void str_uppercase(char *sequence), "Use vrna_seq_toupper() instead");
299 
305 DEPRECATED(void str_DNA2RNA(char *sequence), "Use vrna_seq_toRNA() instead");
306 
312 DEPRECATED(char *random_string(int l,
313  const char symbols[]),
314 "Use vrna_random_string() instead");
315 
321 DEPRECATED(int hamming(const char *s1,
322  const char *s2),
323 "Use vrna_hamming_distance() instead");
324 
330 DEPRECATED(int hamming_bound(const char *s1,
331  const char *s2,
332  int n),
333 "Use vrna_hamming_distance_bound() instead");
334 
335 #endif
336 
337 #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.