diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/wordsplit.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/wordsplit.h b/include/wordsplit.h index a175275..d7eb26f 100644 --- a/include/wordsplit.h +++ b/include/wordsplit.h | |||
@@ -77,2 +77,12 @@ struct wordsplit | |||
77 | size_t ws_envsiz; /* Size of the ws_envbuf array */ | 77 | size_t ws_envsiz; /* Size of the ws_envbuf array */ |
78 | |||
79 | char const **ws_paramv; /* [WRDSO_PARAMV] User-supplied positional | ||
80 | parameters */ | ||
81 | size_t ws_paramc; /* Number of positional parameters */ | ||
82 | |||
83 | /* Temporary storage for parameters. Works similarly to ws_enbuf. | ||
84 | */ | ||
85 | char **ws_parambuf; | ||
86 | size_t ws_paramidx; | ||
87 | size_t ws_paramsiz; | ||
78 | 88 | ||
@@ -101,3 +111,3 @@ struct wordsplit | |||
101 | return values. */ | 111 | return values. */ |
102 | 112 | ||
103 | const char *ws_input; /* Input string (the S argument to wordsplit. */ | 113 | const char *ws_input; /* Input string (the S argument to wordsplit. */ |
@@ -228,2 +238,8 @@ struct wordsplit | |||
228 | 238 | ||
239 | /* Enable positional parameters */ | ||
240 | #define WRDSO_PARAMV 0x00004000 | ||
241 | /* Enable negative positional indices (${-1} is the last positional | ||
242 | parameter) */ | ||
243 | #define WRDSO_PARAM_NEGIDX 0x00008000 | ||
244 | |||
229 | #define WRDSO_BSKEEP WRDSO_BSKEEP_WORD | 245 | #define WRDSO_BSKEEP WRDSO_BSKEEP_WORD |
@@ -252,2 +268,3 @@ struct wordsplit | |||
252 | #define WRDSE_USERERR 9 | 268 | #define WRDSE_USERERR 9 |
269 | #define WRDSE_BADPARAM 10 | ||
253 | 270 | ||
@@ -258,2 +275,3 @@ void wordsplit_free_words (wordsplit_t *ws); | |||
258 | void wordsplit_free_envbuf (wordsplit_t *ws); | 275 | void wordsplit_free_envbuf (wordsplit_t *ws); |
276 | void wordsplit_free_parambuf (struct wordsplit *ws); | ||
259 | int wordsplit_get_words (wordsplit_t *ws, size_t *wordc, char ***wordv); | 277 | int wordsplit_get_words (wordsplit_t *ws, size_t *wordc, char ***wordv); |