RNAlib-2.4.18
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 
275 void
276 vrna_seq_reverse(char *sequence);
277 
278 
297 char *
298 vrna_DNA_complement(const char *sequence);
299 
300 
307 char *
308 vrna_seq_ungapped(const char *sequence);
309 
310 
322 char *
323 vrna_cut_point_insert(const char *string,
324  int cp);
325 
326 
339 char *
340 vrna_cut_point_remove(const char *string,
341  int *cp);
342 
343 
348 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
349 
354 DEPRECATED(void str_uppercase(char *sequence), "Use vrna_seq_toupper() instead");
355 
361 DEPRECATED(void str_DNA2RNA(char *sequence), "Use vrna_seq_toRNA() instead");
362 
368 DEPRECATED(char *random_string(int l,
369  const char symbols[]),
370  "Use vrna_random_string() instead");
371 
377 DEPRECATED(int hamming(const char *s1,
378  const char *s2),
379  "Use vrna_hamming_distance() instead");
380 
386 DEPRECATED(int hamming_bound(const char *s1,
387  const char *s2,
388  int n),
389  "Use vrna_hamming_distance_bound() instead");
390 
391 #endif
392 
393 #endif
Various data structures and pre-processor macros.
int vrna_strcat_vprintf(char **dest, const char *format, va_list args)
Safely append a formatted string to another string.
char * vrna_cut_point_remove(const char *string, int *cp)
Remove a separating '&' character from a string.
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.
char * vrna_strdup_vprintf(const char *format, va_list argp)
Safely create a formatted string.
char * vrna_random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
void vrna_seq_toupper(char *sequence)
Convert an input sequence to uppercase.
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_cut_point_insert(const char *string, int cp)
Add a separating '&' character into a string according to cut-point position.
char * vrna_seq_ungapped(const char *sequence)
Remove gap characters from a nucleotide sequence.
int vrna_strcat_printf(char **dest, const char *format,...)
Safely append a formatted string to another string.
char ** vrna_strsplit(const char *string, const char *delimiter)
Split a string into tokens using a delimiting character.
void vrna_seq_toRNA(char *sequence)
Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet.
char * vrna_DNA_complement(const char *sequence)
Retrieve a DNA sequence which resembles the complement of the input sequence.
void vrna_seq_reverse(char *sequence)
Reverse a string in-place.
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
int hamming_bound(const char *s1, const char *s2, int n)
Calculate hamming distance between two sequences up to a specified length.
void str_DNA2RNA(char *sequence)
Convert a DNA input sequence to RNA alphabet.
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.