FastqPuri
str_manip.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (C) 2017 by Paula Perez Rubio *
3  * *
4  * This file is part of FastqPuri. *
5  * *
6  * FastqPuri is free software: you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation, either version 3 of the *
9  * License, or (at your option) any later version. *
10  * *
11  * FastqPuri is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with FastqPuri. *
18  * If not, see <http://www.gnu.org/licenses/>. *
19  ****************************************************************************/
20 
29 #ifndef STR_MANIP_H_
30 #define STR_MANIP_H_
31 
32 
36 typedef struct _split {
37  int N;
38  char **s;
39 } Split;
40 
41 
42 int str_isascii(char* s);
43 
44 int strindex(char *s, char *t);
45 
46 int count_char(char *s, char c);
47 
48 Split strsplit(char *str, char sep);
49 
50 #endif // endif STR_MANIP_H_
int count_char(char *s, char c)
returns the # of occurences of char c in string s
Definition: str_manip.c:67
contains a splitted string and the number or splitted fields
Definition: str_manip.h:36
struct _split Split
contains a splitted string and the number or splitted fields
char ** s
Definition: str_manip.h:38
Split strsplit(char *str, char sep)
Separates strings by a separator.
Definition: str_manip.c:94
int strindex(char *s, char *t)
returns index of t in s (start, first occurence)
Definition: str_manip.c:53
int N
Definition: str_manip.h:37
int str_isascii(char *s)
return nonzero iff all elements in the string are in the ASCII set.
Definition: str_manip.c:39