summaryrefslogtreecommitdiffabout
path: root/include/wordsplit.h
authorSergey Poznyakoff <gray@gnu.org>2019-05-14 16:59:07 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-05-14 16:59:07 (GMT)
commit39beda10e855d265b5af74ea53a5d7a89a91296a (patch) (side-by-side diff)
tree86f671ebea706d691d1667304522c260f56924bd /include/wordsplit.h
parentf6586d810d8430d6d9f833119af39726a60e4a6c (diff)
downloadgrecs-39beda10e855d265b5af74ea53a5d7a89a91296a.tar.gz
grecs-39beda10e855d265b5af74ea53a5d7a89a91296a.tar.bz2
wordsplit: whitespace cleanup
Diffstat (limited to 'include/wordsplit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/wordsplit.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/include/wordsplit.h b/include/wordsplit.h
index d7eb26f..d4975b3 100644
--- a/include/wordsplit.h
+++ b/include/wordsplit.h
@@ -27,22 +27,22 @@ typedef struct wordsplit wordsplit_t;
used, the member is internal and must not be used by the caller.
In the comments below, the identifiers in parentheses indicate bits that
must be set (or unset, if starting with !) in ws_flags (if starting with
WRDSF_) or ws_options (if starting with WRDSO_) to initialize or use the
given member.
-
+
If not redefined explicitly, most of them are set to some reasonable
default value upon entry to wordsplit(). */
-struct wordsplit
+struct wordsplit
{
size_t ws_wordc; /* [Output] Number of words in ws_wordv. */
char **ws_wordv; /* [Output] Array of parsed out words. */
size_t ws_offs; /* [Input] (WRDSF_DOOFFS) Number of initial
elements in ws_wordv to fill with NULLs. */
- size_t ws_wordn; /* Number of elements ws_wordv can accomodate. */
+ size_t ws_wordn; /* Number of elements ws_wordv can accomodate. */
int ws_flags; /* [Input] Flags passed to wordsplit. */
int ws_options; /* [Input] (WRDSF_OPTIONS)
Additional options. */
size_t ws_maxwords; /* [Input] (WRDSO_MAXWORDS) Return at most that
many words */
size_t ws_wordi; /* [Output] (WRDSF_INCREMENTAL) Total number of
@@ -50,21 +50,21 @@ struct wordsplit
const char *ws_delim; /* [Input] (WRDSF_DELIM) Word delimiters. */
const char *ws_comment; /* [Input] (WRDSF_COMMENT) Comment characters. */
const char *ws_escape[2]; /* [Input] (WRDSF_ESCAPE) Characters to be escaped
with backslash. */
void (*ws_alloc_die) (wordsplit_t *wsp);
- /* [Input] (WRDSF_ALLOC_DIE) Function called when
+ /* [Input] (WRDSF_ALLOC_DIE) Function called when
out of memory. Must not return. */
void (*ws_error) (const char *, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)));
- /* [Input] (WRDSF_ERROR) Function used for error
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+ /* [Input] (WRDSF_ERROR) Function used for error
reporting */
void (*ws_debug) (const char *, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)));
- /* [Input] (WRDSF_DEBUG) Function used for debug
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+ /* [Input] (WRDSF_DEBUG) Function used for debug
output. */
const char **ws_env; /* [Input] (WRDSF_ENV, !WRDSF_NOVAR) Array of
environment variables. */
/* Temporary storage for environment variables. It is initialized
upon first assignment which occurs during the parsing process
@@ -77,52 +77,52 @@ 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.
+ /* Temporary storage for parameters. Works similarly to ws_enbuf.
*/
char **ws_parambuf;
size_t ws_paramidx;
size_t ws_paramsiz;
-
+
int (*ws_getvar) (char **ret, const char *var, size_t len, void *clos);
- /* [Input] (WRDSF_GETVAR, !WRDSF_NOVAR) Looks up
+ /* [Input] (WRDSF_GETVAR, !WRDSF_NOVAR) Looks up
the name VAR (LEN bytes long) in the table of
variables and if found returns in memory
location pointed to by RET the value of that
variable. Returns WRDSE_OK (0) on success,
and an error code (see WRDSE_* defines below)
on error. User-specific errors can be returned
by storing the error diagnostic string in RET
and returning WRDSE_USERERR.
- Whatever is stored in RET, it must be allocated
+ Whatever is stored in RET, it must be allocated
using malloc(3). */
void *ws_closure; /* [Input] (WRDSF_CLOSURE) Passed as the CLOS
argument to ws_getvar and ws_command. */
int (*ws_command) (char **ret, const char *cmd, size_t len, char **argv,
- void *clos);
- /* [Input] (!WRDSF_NOCMD) Returns in the memory
+ void *clos);
+ /* [Input] (!WRDSF_NOCMD) Returns in the memory
location pointed to by RET the expansion of
the command CMD (LEN bytes long). On input,
ARGV contains CMD split out to words.
See ws_getvar for a discussion of possible
return values. */
- const char *ws_input; /* Input string (the S argument to wordsplit. */
+ const char *ws_input; /* Input string (the S argument to wordsplit. */
size_t ws_len; /* Length of ws_input. */
size_t ws_endp; /* Points past the last processed byte in
ws_input. */
int ws_errno; /* [Output] Error code, if an error occurred. */
char *ws_usererr; /* Points to textual description of
the error, if ws_errno is WRDSE_USERERR. Must
be allocated with malloc(3). */
struct wordsplit_node *ws_head, *ws_tail;
- /* Doubly-linked list of parsed out nodes. */
+ /* Doubly-linked list of parsed out nodes. */
int ws_lvl; /* Invocation nesting level. */
};
/* Initial size for ws_env, if allocated automatically */
#define WORDSPLIT_ENV_INIT 16
@@ -239,15 +239,15 @@ 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
-#define WRDSO_OESC WRDSO_OESC_WORD
-#define WRDSO_XESC WRDSO_XESC_WORD
+#define WRDSO_BSKEEP WRDSO_BSKEEP_WORD
+#define WRDSO_OESC WRDSO_OESC_WORD
+#define WRDSO_XESC WRDSO_XESC_WORD
/* Indices into ws_escape */
#define WRDSX_WORD 0
#define WRDSX_QUOTE 1
/* Set escape option F in WS for words (Q==0) or quoted strings (Q==1) */

Return to:

Send suggestions and report system problems to the System administrator.