summaryrefslogtreecommitdiffabout
path: root/include/wordsplit.h
Side-by-side diff
Diffstat (limited to 'include/wordsplit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/wordsplit.h20
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
size_t ws_envsiz; /* Size of the ws_envbuf array */
+
+ char const **ws_paramv; /* [WRDSO_PARAMV] User-supplied positional
+ parameters */
+ size_t ws_paramc; /* Number of positional parameters */
+
+ /* Temporary storage for parameters. Works similarly to ws_enbuf.
+ */
+ char **ws_parambuf;
+ size_t ws_paramidx;
+ size_t ws_paramsiz;
@@ -101,3 +111,3 @@ struct wordsplit
return values. */
-
+
const char *ws_input; /* Input string (the S argument to wordsplit. */
@@ -228,2 +238,8 @@ struct wordsplit
+/* Enable positional parameters */
+#define WRDSO_PARAMV 0x00004000
+/* Enable negative positional indices (${-1} is the last positional
+ parameter) */
+#define WRDSO_PARAM_NEGIDX 0x00008000
+
#define WRDSO_BSKEEP WRDSO_BSKEEP_WORD
@@ -252,2 +268,3 @@ struct wordsplit
#define WRDSE_USERERR 9
+#define WRDSE_BADPARAM 10
@@ -258,2 +275,3 @@ void wordsplit_free_words (wordsplit_t *ws);
void wordsplit_free_envbuf (wordsplit_t *ws);
+void wordsplit_free_parambuf (struct wordsplit *ws);
int wordsplit_get_words (wordsplit_t *ws, size_t *wordc, char ***wordv);

Return to:

Send suggestions and report system problems to the System administrator.