aboutsummaryrefslogtreecommitdiffstats
path: root/camel/string-utils.h
blob: f37abbd08b01da06b53a541e50c29709ff961e5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* string-util : utilities for normal gchar * strings  */

/* 
 *
 * Author : 
 *  Bertrand Guiheneuf <bertrand@helixcode.com>
 *
 * Copyright 1999, 2000 HelixCode (http://www.helixcode.com) .
 *
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */



#ifndef STRING_UTIL_H
#define STRING_UTIL_H 1


#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus }*/

#include <glib.h>



typedef enum {
    STRING_DICHOTOMY_NONE            =     0,
    STRING_DICHOTOMY_RIGHT_DIR       =     1,
    STRING_DICHOTOMY_STRIP_TRAILING  =     2,
    STRING_DICHOTOMY_STRIP_LEADING   =     4
    
} StringDichotomyOption;


typedef enum {
    STRING_TRIM_NONE            =     0,
    STRING_TRIM_STRIP_TRAILING  =     1,
    STRING_TRIM_STRIP_LEADING   =     2
} StringTrimOption;



gboolean string_equal_for_glist (gconstpointer v, gconstpointer v2);

gchar    string_dichotomy       (const gchar *string, gchar sep,
                 gchar **prefix, gchar **suffix,
                 StringDichotomyOption options);
void     string_list_free       (GList *string_list);

GList   *string_split           (const gchar *string, char sep,
                 const gchar *trim_chars, StringTrimOption trim_options);
void     string_trim            (gchar *string, const gchar *chars,
                 StringTrimOption options);

gchar   *string_prefix (const gchar *s, const gchar *suffix, gboolean *suffix_found);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* STRING_UTIL_H */
/a>amdmi32015-05-171-1/+5 * Fix iconv related build problem. The port is still marked BROKEN.tijl2015-05-161-0/+1 * - Update to 0.23sunpoet2015-05-162-3/+3 * Update to 1.12.5 and fix the build with GSSAPI by requiring KRB from ports.marcus2015-05-164-10/+14 * net/megatools: update to 1.9.95jbeich2015-05-163-7/+5 * net/tcpkali: update to 0.6jbeich2015-05-162-4/+4 * Don't set DISTNAME with USE_GITHUB.mat2015-05-162-4/+3 * net/py-maxminddb: add portxmj2015-05-165-2/+38 * net/miruo: update to 0.9.6jbeich2015-05-162-3/+3 * Don't define DISTNAME with USE_GITHUB.mat2015-05-162-4/+3 * net/py-GeoIP2: add portxmj2015-05-164-0/+34 * - Update to 0.2.2sunpoet2015-05-162-3/+3 * MASTER_SITES cleanup.mat2015-05-1478-151/+79 * net/ntopng: Unbreakbofh2015-05-142-19/+15 * - Cleanup GH_* knobs:sunpoet2015-05-142-4/+3 * - Cleanup GH_* knobs: remove GH_TAGNAMEsunpoet2015-05-142-3/+2 * - Update to 0.20.14sunpoet2015-05-145-37/+8 * net/libnss-cache: fix distinfoxmj2015-05-141-2/+2 * net/hanstunnel: update to 0.4.4 [1] and improvejbeich2015-05-1412-182/+50 * net/libnss-cache: fix some threading issuesxmj2015-05-132-3/+4 * Remove typo.cy2015-05-131-1/+1 * Reintroduce ntp-rc. Ntp release candidates are available again.cy2015-05-137-1/+782 * Update 4.3.20 --> 4.3.33cy2015-05-133-4/+6 * Upgrade to version 3.5.2.olgeni2015-05-132-3/+3 * - Update to 0.5wen2015-05-122-3/+3 * net/py-raet: NEW PORT - Reliable Asynchronous Event Transport protocol libraryrobak2015-05-125-0/+148 * Fix build on head and stable/10antoine2015-05-121-1/+7 * Cleanup DIST* variables.mat2015-05-1216