RNAlib-2.4.16
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
150  const char *format,
151  va_list args);
152 
153 
192 char **
193 vrna_strsplit(const char *string,
194  const char *delimiter);
195 
196 
197 char *
198 vrna_strjoin(const char **strings,
199  const char *delimiter);
200 
208 char *
210  const char symbols[]);
211 
212 
220 int
221 vrna_hamming_distance(const char *s1,
222  const char *s2);
223 
224 
235 int
237  const char *s2,
238  int n);
239 
240 
248 void
249 vrna_seq_toRNA(char *sequence);
250 
251 
257 void
258 vrna_seq_toupper(char *sequence);
259 
260 
267 char *
268 vrna_seq_ungapped(const char *seq);
269 
270 
282 char *
283 vrna_cut_point_insert(const char *string,
284  int cp);
285 
286 
299 char *
300 vrna_cut_point_remove(const char *string,
301  int *cp);
302 
303 
308 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
309 
314 DEPRECATED(void str_uppercase(char *sequence), "Use vrna_seq_toupper() instead");
315 
321 DEPRECATED(void str_DNA2RNA(char *sequence), "Use vrna_seq_toRNA() instead");
322 
328 DEPRECATED(char *random_string(int l,
329  const char symbols[]),
330  "Use vrna_random_string() instead");
331 
337 DEPRECATED(int hamming(const char *s1,
338  const char *s2),
339  "Use vrna_hamming_distance() instead");
340 
346 DEPRECATED(int hamming_bound(const char *s1,
347  const char *s2,
348  int n),
349  "Use vrna_hamming_distance_bound() instead");
350 
351 #endif
352 
353 #endif
vrna_strsplit
char ** vrna_strsplit(const char *string, const char *delimiter)
Split a string into tokens using a delimiting character.
vrna_random_string
char * vrna_random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
vrna_strdup_printf
char * vrna_strdup_printf(const char *format,...)
Safely create a formatted string.
vrna_hamming_distance
int vrna_hamming_distance(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
vrna_seq_ungapped
char * vrna_seq_ungapped(const char *seq)
Remove gap characters from a nucleotide sequence.
hamming_bound
int hamming_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
random_string
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
vrna_cut_point_insert
char * vrna_cut_point_insert(const char *string, int cp)
Add a separating '&' character into a string according to cut-point position.
str_DNA2RNA
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
basic.h
Various data structures and pre-processor macros.
vrna_strcat_vprintf
int vrna_strcat_vprintf(char **dest, const char *format, va_list args)
Safely append a formatted string to another string.
vrna_cut_point_remove
char * vrna_cut_point_remove(const char *string, int *cp)
Remove a separating '&' character from a string.
vrna_seq_toRNA
void vrna_seq_toRNA(char *sequence)
Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet.
vrna_hamming_distance_bound
int vrna_hamming_distance_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
str_uppercase
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
vrna_strcat_printf
int vrna_strcat_printf(char **dest, const char *format,...)
Safely append a formatted string to another string.
vrna_seq_toupper
void vrna_seq_toupper(char *sequence)
Convert an input sequence to uppercase.
vrna_strdup_vprintf
char * vrna_strdup_vprintf(const char *format, va_list argp)
Safely create a formatted string.
hamming
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.