RNAlib-2.6.3
 
Loading...
Searching...
No Matches
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
64char *
65strdup(const char *s);
66
67
68#endif
69#endif
70
89char *
90vrna_strdup_printf(const char *format,
91 ...);
92
93
108char *
109vrna_strdup_vprintf(const char *format,
110 va_list argp);
111
112
131int
133 const char *format,
134 ...);
135
136
149int
151 const char *format,
152 va_list args);
153
154
159#define VRNA_TRIM_LEADING 1U
160
165#define VRNA_TRIM_TRAILING 2U
166
171#define VRNA_TRIM_IN_BETWEEN 4U
172
177#define VRNA_TRIM_SUBST_BY_FIRST 8U
178
183#define VRNA_TRIM_DEFAULT ( VRNA_TRIM_LEADING | VRNA_TRIM_TRAILING )
184
189#define VRNA_TRIM_ALL ( VRNA_TRIM_DEFAULT | VRNA_TRIM_IN_BETWEEN )
190
237unsigned int
238vrna_strtrim(char *string,
239 const char *delimiters,
240 unsigned int keep,
241 unsigned int options);
242
243
289char **
290vrna_strsplit(const char *string,
291 const char *delimiter);
292
293
294char *
295vrna_strjoin(const char **strings,
296 const char *delimiter);
297
298
306char *
308 const char symbols[]);
309
310
318int
320 const char *s2);
321
322
333int
335 const char *s2,
336 int n);
337
338
346void
347vrna_seq_toRNA(char *sequence);
348
349
355void
356vrna_seq_toupper(char *sequence);
357
358
373void
374vrna_seq_reverse(char *sequence);
375
376
395char *
396vrna_DNA_complement(const char *sequence);
397
398
405char *
406vrna_seq_ungapped(const char *sequence);
407
408
420char *
421vrna_cut_point_insert(const char *string,
422 int cp);
423
424
437char *
438vrna_cut_point_remove(const char *string,
439 int *cp);
440
441
442
451size_t *
452vrna_strchr(const char *string,
453 int c,
454 size_t n);
455
456
461#ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
462
467DEPRECATED(void
468 str_uppercase(char *sequence),
469 "Use vrna_seq_toupper() instead");
470
476DEPRECATED(void
477 str_DNA2RNA(char *sequence),
478 "Use vrna_seq_toRNA() instead");
479
485DEPRECATED(char *random_string(int l,
486 const char symbols[]),
487 "Use vrna_random_string() instead");
488
494DEPRECATED(int
495 hamming(const char *s1,
496 const char *s2),
497 "Use vrna_hamming_distance() instead");
498
504DEPRECATED(int
505 hamming_bound(const char *s1,
506 const char *s2,
507 int n),
508 "Use vrna_hamming_distance_bound() instead");
509
510#endif
511
512#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.
int vrna_hamming_distance(const char *s1, const char *s2)
Calculate hamming distance between two sequences.
char * vrna_cut_point_insert(const char *string, int cp)
Add a separating '&' character into a string according to cut-point position.
void vrna_seq_toupper(char *sequence)
Convert an input sequence to uppercase.
char * vrna_DNA_complement(const char *sequence)
Retrieve a DNA sequence which resembles the complement of the input sequence.
char * vrna_seq_ungapped(const char *sequence)
Remove gap characters from a nucleotide sequence.
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_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.
int vrna_strcat_printf(char **dest, const char *format,...)
Safely append a formatted string to another string.
size_t * vrna_strchr(const char *string, int c, size_t n)
Find (all) occurrences of a character within a string.
void vrna_seq_toRNA(char *sequence)
Convert an input sequence (possibly containing DNA alphabet characters) to RNA alphabet.
unsigned int vrna_strtrim(char *string, const char *delimiters, unsigned int keep, unsigned int options)
Trim a string by removing (multiple) occurences of a particular character.
void vrna_seq_reverse(char *sequence)
Reverse a string in-place.
char * vrna_cut_point_remove(const char *string, int *cp)
Remove a separating '&' character from a string.
char ** vrna_strsplit(const char *string, const char *delimiter)
Split a string into tokens using a delimiting character.
void str_uppercase(char *sequence)
Convert an input sequence to uppercase.
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.
char * random_string(int l, const char symbols[])
Create a random string using characters from a specified symbol set.
int hamming(const char *s1, const char *s2)
Calculate hamming distance between two sequences.