added qse_awk_rtx_getvalstr() and qse_awk_rtx_freevalstr().

changed some code to use the 2 new functions.
added the sed module to awk. incomplete yet
This commit is contained in:
2014-02-19 15:24:33 +00:00
parent b5de91921c
commit 2e9bb90c39
20 changed files with 629 additions and 344 deletions

View File

@ -984,4 +984,66 @@ Now you run the following script on a UTF-8 console of a Linux box.
Note that 你 has been converted to a question mark since the letter is
not supported by cp949.
Modules
-------
QSEAWK supports various external modules.
## String ##
The *str* module provides an extensive set of string manipulation functions.
- str::index
- str::isalnum
- str::isalpha
- str::isblank
- str::iscntrl
- str::isdigit
- str::isgraph
- str::islower
- str::isprint
- str::ispunct
- str::isspace
- str::isupper
- str::isxdigit
- str::ltrim
- str::normspace
- str::rindex
- str::rtrim
- str::trim
## Directory ##
The *dir* module provides an interface to read file names in a specified directory.
- dir::open
- dir::close
- dir::read
- dir::reset
- dir::errno
- dir::errstr
~~~~~{.awk}
BEGIN {
x = dir::open (".");
while ((dir::read(x, file)) > 0) print file;
dir::close(x);
}'
~~~~~
## SED ##
The *sed* module provides built-in sed capabilities.
- sed::file_to_file
- sed::str_to_str
~~~~~{.awk}
BEGIN {
sed::file_to_file ("s/[a-z]/#/g", "in.txt", "out.txt");
}'
~~~~~
[awkbook]: http://cm.bell-labs.com/cm/cs/awkbook/