diff options
author | axel <axel@liljencrantz.se> | 2005-10-07 20:36:51 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-10-07 20:36:51 +1000 |
commit | 8ff36deeb49e517ee076bb1a8db3d98adb6d7012 (patch) | |
tree | 85db57e65b96d0e2d02f12d8d6b2fcca1152ebb9 /expand.h | |
parent | b11aa091429489d318228500031f256c9c1b9133 (diff) |
API cleanup
darcs-hash:20051007103651-ac50b-3b518ce795adf2d39b8ebfcba6a2df7c36411b15.gz
Diffstat (limited to 'expand.h')
-rw-r--r-- | expand.h | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -111,14 +111,31 @@ int expand_string( wchar_t *in, array_list_t *out, int flag ); wchar_t *expand_one( wchar_t *in, int flag ); /** + Expand backslashed escapes and substitute them with their unescaped + counterparts. Also optionally change the wildcards, the tilde + character and a few more into constants which are defined to be + outside of the valid character space, but still inside the valid + space for a wchar_t. This assumes that a wchar_t is at least 32 + bits long AND that the characterset is UCS4 or some other 31-bit + character set. + + The result must be free()d. The original string is not modified. If + an invalid sequence is specified, 0 is returned. + +*/ +wchar_t *expand_unescape( const wchar_t * in, int escape_special ); + +/** Replace special characters with escape sequences. Newline is replaced with \n, etc. + The result must be free()d. The original string is not modified. + \param in The string to be escaped \param escape_all Whether all characters wich hold special meaning in fish (Pipe, semicolon, etc,) should be escaped, or only unprintable characters - \return The escaped string, or 0 if there is not enough memory + \return The escaped string */ -wchar_t *expand_escape( wchar_t *in, int escape_all ); +wchar_t *expand_escape( const wchar_t *in, int escape_all ); /** Convert the variable value to a human readable form, i.e. escape things, handle arrays, etc. Suitable for pretty-printing. @@ -150,22 +167,6 @@ int expand_locate_subshell( wchar_t *in, /** - Expand backslashed escapes and substitute them with their unescaped - counterparts. Also optionally change the wildcards, the tilde - character and a few more into constants which are defined to be - outside of the valid character space, but still inside the valid - space for a wchar_t. This assumes that a wchar_t is at least 32 - bits long AND that the characterset is UCS4 or some other 31-bit - character set. - - Since removing the escape sequences can never lengthen the string, - the specified string is modified instead of allocating a new one. - -*/ -wchar_t *expand_backslash( wchar_t * in, int escape_special ); - - -/** Tokenize the specified string into the specified array_list_t. Each new element is allocated using malloc and must be freed by the caller. |