diff options
Diffstat (limited to 'gconf/wordsplit.h')
-rw-r--r-- | gconf/wordsplit.h | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/gconf/wordsplit.h b/gconf/wordsplit.h deleted file mode 100644 index d4d1f0c..0000000 --- a/gconf/wordsplit.h +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | /* wordsplit - a word splitter | ||
2 | Copyright (C) 2009 Sergey Poznyakoff | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify it | ||
5 | under the terms of the GNU General Public License as published by the | ||
6 | Free Software Foundation; either version 3 of the License, or (at your | ||
7 | option) any later version. | ||
8 | |||
9 | This program 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 | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License along | ||
15 | with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | |||
17 | struct wordsplit | ||
18 | { | ||
19 | size_t ws_wordc; | ||
20 | char **ws_wordv; | ||
21 | size_t ws_offs; | ||
22 | size_t ws_wordn; | ||
23 | int ws_flags; | ||
24 | const char *ws_delim; | ||
25 | const char *ws_comment; | ||
26 | |||
27 | const char *ws_input; | ||
28 | size_t ws_len; | ||
29 | size_t ws_endp; | ||
30 | }; | ||
31 | |||
32 | /* Append the words found to the array resulting from a previous | ||
33 | call. */ | ||
34 | #define WRDSF_APPEND 0x0001 | ||
35 | /* Insert we_offs initial NULLs in the array ws_wordv. | ||
36 | (These are not counted in the returned ws_wordc.) */ | ||
37 | #define WRDSF_DOOFFS 0x0002 | ||
38 | /* Don't do command substitution. Reserved for future use. */ | ||
39 | #define WRDSF_NOCMD 0x0004 | ||
40 | /* The parameter p resulted from a previous call to | ||
41 | wordsplit(), and wordsplit_free() was not called. Reuse the | ||
42 | allocated storage. */ | ||
43 | #define WRDSF_REUSE 0x0008 | ||
44 | /* Print errors */ | ||
45 | #define WRDSF_SHOWERR 0x0010 | ||
46 | /* Consider it an error if an undefined shell variable | ||
47 | is expanded. */ | ||
48 | #define WRDSF_UNDEF 0x0020 | ||
49 | |||
50 | /* Don't do variable expansion. Reserved for future use. */ | ||
51 | #define WRDSF_NOVAR 0x0040 | ||
52 | /* Abort on ENOMEM error */ | ||
53 | #define WRDSF_ENOMEMABRT 0x0080 | ||
54 | /* Treat whitespace as delimiters */ | ||
55 | #define WRDSF_WS 0x0100 | ||
56 | /* Handle quotes and escape directives */ | ||
57 | #define WRDSF_QUOTE 0x0200 | ||
58 | /* Replace each input sequence of repeated delimiters with a single | ||
59 | delimiter */ | ||
60 | #define WRDSF_SQUEEZE_DELIMS 0x0400 | ||
61 | /* Return delimiters */ | ||
62 | #define WRDSF_RETURN_DELIMS 0x0800 | ||
63 | /* Treat sed expressions as words */ | ||
64 | #define WRDSF_SED_EXPR 0x1000 | ||
65 | /* ws_delim field is initialized */ | ||
66 | #define WRDSF_DELIM 0x2000 | ||
67 | /* ws_comment field is initialized */ | ||
68 | #define WRDSF_COMMENT 0x4000 | ||
69 | |||
70 | #define WRDSF_DEFFLAGS \ | ||
71 | (WRDSF_NOVAR | WRDSF_NOCMD | \ | ||
72 | WRDSF_WS | WRDSF_QUOTE | WRDSF_SQUEEZE_DELIMS) | ||
73 | |||
74 | #define WRDSE_EOF 0 | ||
75 | #define WRDSE_QUOTE 1 | ||
76 | #define WRDSE_NOSPACE 2 | ||
77 | |||
78 | int wordsplit (const char *s, struct wordsplit *p, int flags); | ||
79 | void wordsplit_free (struct wordsplit *p); | ||
80 | |||
81 | int wordsplit_unquote_char (int c); | ||
82 | int wordsplit_quote_char (int c); | ||
83 | size_t wordsplit_quoted_length (const char *str, int quote_hex, int *quote); | ||
84 | void wordsplit_unquote_copy (char *dst, const char *src, size_t n); | ||
85 | void wordsplit_quote_copy (char *dst, const char *src, int quote_hex); | ||
86 | |||
87 | |||
88 | |||