1 /* This file is part of GNU Mailutils
2 Copyright (C) 2009-2021 Free Software Foundation, Inc.
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General
15 Public License along with this library. If not, see
16 <http://www.gnu.org/licenses/>. */
17
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21 #include <stdlib.h>
22 #include <string.h>
23 #include <mailutils/types.h>
24 #include <mailutils/cctype.h>
25 #include <mailutils/cstr.h>
26
27 char *
mu_str_skip_class(const char * str,int class)28 mu_str_skip_class (const char *str, int class)
29 {
30 for (; *str && mu_c_is_class (*str, class); str++)
31 ;
32 return (char*) str;
33 }
34
35 char *
mu_str_skip_class_comp(const char * str,int class)36 mu_str_skip_class_comp (const char *str, int class)
37 {
38 for (; *str && !mu_c_is_class (*str, class); str++)
39 ;
40 return (char*) str;
41 }
42
43 char *
mu_str_skip_cset(const char * str,const char * cset)44 mu_str_skip_cset (const char *str, const char *cset)
45 {
46 for (; *str && strchr (cset, *str); str++)
47 ;
48 return (char*) str;
49 }
50
51 char *
mu_str_skip_cset_comp(const char * str,const char * cset)52 mu_str_skip_cset_comp (const char *str, const char *cset)
53 {
54 for (; *str && strchr (cset, *str) == NULL; str++)
55 ;
56 return (char*) str;
57 }
58
59
60