From 200a3f6656f80cb3563626a308a6c581eb3e73b7 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 22 Dec 2009 06:44:33 +0000 Subject: [PATCH] touched up code a bit --- qse/cmd/cut/cut.c | 1 - qse/include/qse/cut/Cut.hpp | 1 + qse/include/qse/cut/cut.h | 3 ++- qse/include/qse/cut/std.h | 4 ++-- qse/include/qse/sed/Sed.hpp | 4 ++-- qse/include/qse/sed/std.h | 8 ++++++-- qse/samples/sed/sed01.c | 10 +++++----- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/qse/cmd/cut/cut.c b/qse/cmd/cut/cut.c index d16eaf15..19ede836 100644 --- a/qse/cmd/cut/cut.c +++ b/qse/cmd/cut/cut.c @@ -35,7 +35,6 @@ static int g_infile_end = 0; static const qse_char_t* g_infile = QSE_NULL; static const qse_char_t* g_outfile = QSE_NULL; static int g_option = 0; -static int g_infile_index = 0; static qse_cint_t g_din = QSE_CHAR_EOF; static qse_cint_t g_dout = QSE_CHAR_EOF; diff --git a/qse/include/qse/cut/Cut.hpp b/qse/include/qse/cut/Cut.hpp index 499aec33..72e64931 100644 --- a/qse/include/qse/cut/Cut.hpp +++ b/qse/include/qse/cut/Cut.hpp @@ -58,6 +58,7 @@ public: class Stream: public Types { public: + /// The Mode type defines I/O operation mode. enum Mode { READ, ///< open for read diff --git a/qse/include/qse/cut/cut.h b/qse/include/qse/cut/cut.h index 027f28da..4a55e158 100644 --- a/qse/include/qse/cut/cut.h +++ b/qse/include/qse/cut/cut.h @@ -26,7 +26,7 @@ #include /** @file - * cut utility + * This file defines a text cutter utility. * * @todo QSE_CUT_ORDEREDSEL - A selector 5,3,1 is ordered to 1,3,5 */ @@ -37,6 +37,7 @@ */ /** @struct qse_cut_t + * The qes_cut_t type defines a text cutter. */ typedef struct qse_cut_t qse_cut_t; diff --git a/qse/include/qse/cut/std.h b/qse/include/qse/cut/std.h index 8eb45c3a..5e0c2524 100644 --- a/qse/include/qse/cut/std.h +++ b/qse/include/qse/cut/std.h @@ -61,8 +61,8 @@ int qse_cut_compstd ( /** * The qse_cut_execstd() function executes the compiled script * over an input file @a infile and an output file @a outfile. - * If @infile is QSE_NULL, the standard console input is used. - * If @outfile is QSE_NULL, the standard console output is used.. + * If @a infile is QSE_NULL, the standard console input is used. + * If @a outfile is QSE_NULL, the standard console output is used.. */ int qse_cut_execstd ( qse_cut_t* cut, diff --git a/qse/include/qse/sed/Sed.hpp b/qse/include/qse/sed/Sed.hpp index 1e3b4985..b6f925c6 100644 --- a/qse/include/qse/sed/Sed.hpp +++ b/qse/include/qse/sed/Sed.hpp @@ -1,5 +1,5 @@ /* - * $Id: Sed.hpp 320 2009-12-21 12:29:52Z hyunghwan.chung $ + * $Id: Sed.hpp 321 2009-12-21 12:44:33Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. This file is part of QSE. @@ -93,7 +93,7 @@ public: void setHandle (void* handle) { arg->handle = handle; } /// The getName() function returns an I/O name. - /// @return QSE_NULL for the main data stream, + /// @return #QSE_NULL for the main data stream, /// file path for explicit file stream const char_t* getName () const { return arg->path; } diff --git a/qse/include/qse/sed/std.h b/qse/include/qse/sed/std.h index 84b725d2..42332c29 100644 --- a/qse/include/qse/sed/std.h +++ b/qse/include/qse/sed/std.h @@ -25,6 +25,10 @@ /** @file * This file defines a simple stream editor. + * + * @example sed01.c + * This example shows how to write a simple stream editor using easy API + * functions. */ #ifdef __cplusplus @@ -59,8 +63,8 @@ int qse_sed_compstd ( /** * The qse_sed_execstd() function executes the compiled script * over an input file @a infile and an output file @a outfile. - * If @infile is QSE_NULL, the standard console input is used. - * If @outfile is QSE_NULL, the standard console output is used. + * If @a infile is QSE_NULL, the standard console input is used. + * If @a outfile is QSE_NULL, the standard console output is used. */ int qse_sed_execstd ( qse_sed_t* sed, diff --git a/qse/samples/sed/sed01.c b/qse/samples/sed/sed01.c index 8bb3a974..7c5885c2 100644 --- a/qse/samples/sed/sed01.c +++ b/qse/samples/sed/sed01.c @@ -1,5 +1,5 @@ /* - * $Id: sed01.c 316 2009-12-14 12:50:11Z hyunghwan.chung $ + * $Id$ * Copyright 2006-2009 Chung, Hyung-Hwan. This file is part of QSE. @@ -25,15 +25,15 @@ int sed_main (int argc, qse_char_t* argv[]) { qse_sed_t* sed = QSE_NULL; - qse_char_t* infile; - qse_char_t* outfile; + qse_char_t* infile; + qse_char_t* outfile; int ret = -1; if (argc < 2 || argc > 4) { qse_fprintf (QSE_STDERR, QSE_T("USAGE: %s command-string [input-file [output-file]]\n"), argv[0]); - return -1; - } + return -1; + } sed = qse_sed_openstd (0); if (sed == QSE_NULL)