~ubuntu-branches/ubuntu/intrepid/gnutls26/intrepid-security

« back to all changes in this revision

Viewing changes to src/cfg/platon/str/strdyn.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2008-05-01 13:09:49 UTC
  • Revision ID: james.westby@ubuntu.com-20080501130949-qsbsi06stso6a0ij
Tags: upstream-2.2.3~rc
ImportĀ upstreamĀ versionĀ 2.2.3~rc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _PLATON_STR_STRDYN_H
 
2
#define _PLATON_STR_STRDYN_H
 
3
 
 
4
/*
 
5
 * TODO list:
 
6
 *
 
7
 * 1. Functions for removing from array.
 
8
 * 2. Optimalizations (in strdyn_explode_ar() and similar).
 
9
 */
 
10
 
 
11
#ifndef PLATON_FUNC
 
12
# define PLATON_FUNC(_name) _name
 
13
#endif
 
14
#ifndef PLATON_FUNC_STR
 
15
# define PLATON_FUNC_STR(_name) #_name
 
16
#endif
 
17
 
 
18
#define strdyn_count(ar)           PLATON_FUNC(strdyn_get_size)(ar)
 
19
#define strdyn_duplicate(ar)       PLATON_FUNC(strdyn_create_ar)(ar)
 
20
#define strdyn_safe_duplicate(ar)  PLATON_FUNC(strdyn_safe_create_ar)(ar)
 
21
#define strdyn_remove(ar, s)       PLATON_FUNC(strdyn_remove_str)(ar, s)
 
22
#define strdyn_intersect(ar1, ar2) PLATON_FUNC(strdyn_conjunct)(ar1, ar2)
 
23
#define strdyn_join(ar1, ar2)      PLATON_FUNC(strdyn_consolide)(ar1, ar2)
 
24
#define strdyn_union(ar1, ar2)     PLATON_FUNC(strdyn_consolide)(ar1, ar2)
 
25
#define strdyn_explode(str, sep)   PLATON_FUNC(strdyn_explode_str)(str, sep)
 
26
#define strdyn_explode2(str, sep)  PLATON_FUNC(strdyn_explode2_str)(str, sep)
 
27
#define strdyn_implode(str, sep)   PLATON_FUNC(strdyn_implode_str)(str, sep)
 
28
#define strdyn_implode2(str, sep)  PLATON_FUNC(strdyn_implode2_str)(str, sep)
 
29
#define strdyn_cmp(ar, s)          PLATON_FUNC(strdyn_compare)(ar, s)
 
30
#define strdyn_casecmp(ar, s)      PLATON_FUNC(strdyn_casecompare)(ar, s)
 
31
#define strdyn_str(s, ar)          PLATON_FUNC(strdyn_str2)(s, ar, NULL)
 
32
 
 
33
 
 
34
#ifdef __cplusplus
 
35
extern "C" {
 
36
#endif
 
37
 
 
38
        void PLATON_FUNC(strdyn_free)(char **ar);
 
39
        void PLATON_FUNC(strdyn_safe_free)(char **ar);
 
40
        int  PLATON_FUNC(strdyn_get_size)(char **ar);
 
41
        char **PLATON_FUNC(strdyn_create)(void);
 
42
        char **PLATON_FUNC(strdyn_create_va)(char *s1, ...);
 
43
        char **PLATON_FUNC(strdyn_create_ar)(char **ar);
 
44
        char **PLATON_FUNC(strdyn_safe_create_ar)(char **ar);
 
45
        char **PLATON_FUNC(strdyn_add)(char **ar, const char *s);
 
46
        char **PLATON_FUNC(strdyn_add_va)(char **ar, ...);
 
47
        char **PLATON_FUNC(strdyn_add_ar)(char **ar, char * const *s_ar);
 
48
        char **PLATON_FUNC(strdyn_remove_idx)(char **ar, int idx);
 
49
        char **PLATON_FUNC(strdyn_remove_str)(char **ar, char *s);
 
50
        char **PLATON_FUNC(strdyn_remove_str_all)(char **ar, char *s);
 
51
        char **PLATON_FUNC(strdyn_remove_empty)(char **ar);
 
52
        char **PLATON_FUNC(strdyn_remove_all)(char **ar);
 
53
        char **PLATON_FUNC(strdyn_explode_chr)(char *str, int sep);
 
54
        char **PLATON_FUNC(strdyn_explode2_chr)(char *str, int sep);
 
55
        char **PLATON_FUNC(strdyn_explode_str)(char *str, char *sep);
 
56
        char **PLATON_FUNC(strdyn_explode2_str)(char *str, char *sep);
 
57
        char **PLATON_FUNC(strdyn_explode_ar)(char *str, char **sep);
 
58
        char **PLATON_FUNC(strdyn_explode2_ar)(char *str, char **sep);
 
59
        char *PLATON_FUNC(strdyn_implode_chr)(char **ar, int sep);
 
60
        char *PLATON_FUNC(strdyn_implode2_chr)(char **ar, int sep);
 
61
        char *PLATON_FUNC(strdyn_implode_str)(char **ar, char *sep);
 
62
        char *PLATON_FUNC(strdyn_implode2_str)(char **ar, char *str);
 
63
        char **PLATON_FUNC(strdyn_conjunct)(char **ar1, char **ar2);
 
64
        char **PLATON_FUNC(strdyn_consolide)(char **ar1, char **ar2);
 
65
        int  PLATON_FUNC(strdyn_search)(char **ar, char *s);
 
66
        int  PLATON_FUNC(strdyn_casesearch)(char **ar, char *s);
 
67
        int  PLATON_FUNC(strdyn_compare)(char **ar, char *s);
 
68
        int  PLATON_FUNC(strdyn_casecompare)(char **ar, char *s);
 
69
        int  PLATON_FUNC(strdyn_compare_all)(char **ar, char *s);
 
70
        char *PLATON_FUNC(strdyn_str2)(char *s, char **ar, int *idx);
 
71
 
 
72
#ifdef __cplusplus
 
73
}
 
74
#endif
 
75
 
 
76
#endif /* _PLATON_STR_STRDYN_H */
 
77