From 07d38add5dd4920b8fc6bc54d28c16309ca09766 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 16 Jan 2013 07:51:42 +0000 Subject: [PATCH] revised docs --- qse/doc/Doxyfile.in | 2 ++ qse/doc/page/awk-lang.md | 26 +++++++++++++++++--------- qse/include/qse/cmn/mbwc.h | 16 ++++++++++++++-- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/qse/doc/Doxyfile.in b/qse/doc/Doxyfile.in index 163455e8..c2d0d93f 100644 --- a/qse/doc/Doxyfile.in +++ b/qse/doc/Doxyfile.in @@ -1552,6 +1552,8 @@ PREDEFINED = "QSE_BEGIN_NAMESPACE(x)=namespace x {" \ "QSE_SIZEOF_OFF_T=@QSE_SIZEOF_OFF_T@" \ "QSE_SIZEOF_OFF64_T=@QSE_SIZEOF_OFF64_T@" \ "QSE_EXPORT=" \ + "QSE_ENABLE_XCMGRS=" \ + "QSE_ENABLE_BUNDLED_UNICODE=" \ "QSE_ENABLE_SEDTRACER=" \ "@CHAR_MODE@" diff --git a/qse/doc/page/awk-lang.md b/qse/doc/page/awk-lang.md index 7b55d7ca..5c78276b 100644 --- a/qse/doc/page/awk-lang.md +++ b/qse/doc/page/awk-lang.md @@ -84,9 +84,9 @@ string literals and regular expressions. Tokens ------ -When QSEAWK parses a program, it classifies the a series of input charcters +When QSEAWK parses a program, it classifies a series of input characters into meaningful tokens. It can extract the smallest meaningful unit through -this tokenization process. There are +this tokenization process. ### Numbers ### @@ -650,18 +650,26 @@ of *r* causes the function to close the read-end of the pipe and the value of The function returns 0 on success and -1 on failure. Though not so useful, it is possible to create more than 1 streams of different -kinds under the same name. It is undefined which stream *close* -should close in the following program. +kinds under the same name. The following program generates a shell script +/tmp/x containing a command *ls -laF* and executes it without closing the +script file being generated. It reads the execution output via a pipe and +prints it to the console. It is undefined which stream the last *close* +should close assuming the first *close* is commented out and the program works. ~~~~~{.awk} - BEGIN { - "/tmp/x" || getline y; # rwpipe stream - print 1 | "/tmp/x"; # pipe stream - print 1 > "/tmp/x"; # file stream - close ("/tmp/x"); + BEGIN { + print "ls -laF" > "/tmp/x"; # file stream + system ("chmod ugo+x /tmp/x"); + #close ("/tmp/x"); + while(("/tmp/x" | getline y) > 0) print y; # pipe stream + close ("/tmp/x"); # which stream to close? } ~~~~~ +Note that the execution of generated script fails if the script file is +open on some platforms. That's what the first *close* commented out is +actually for. + ### fflush (io-name) ### The *fflush* function flushes the output stream indicated by *io-name*. diff --git a/qse/include/qse/cmn/mbwc.h b/qse/include/qse/cmn/mbwc.h index b0db7df1..ceb7ac1b 100644 --- a/qse/include/qse/cmn/mbwc.h +++ b/qse/include/qse/cmn/mbwc.h @@ -35,14 +35,26 @@ typedef qse_cmgr_t* (*qse_cmgr_finder_t) (const qse_char_t* name); */ enum qse_cmgr_id_t { + /** The slmb cmgr relies on the locale routnines in the underlying + * platforms. You should initialize locale properly before using this. + */ QSE_CMGR_SLMB, + + /** + * The utf cmgr converts between utf8 and unicode characters. + */ QSE_CMGR_UTF8, + + /** + * The mb8 cmgr is used to convert raw bytes to wide characters and + * vice versa. + */ QSE_CMGR_MB8 #if defined(QSE_ENABLE_XCMGRS) , - QSE_CMGR_CP949, - QSE_CMGR_CP950 + QSE_CMGR_CP949, /**< cp949 */ + QSE_CMGR_CP950 /**< cp950 */ #endif }; typedef enum qse_cmgr_id_t qse_cmgr_id_t;