cleaned up code

This commit is contained in:
2009-07-19 06:02:24 +00:00
parent 07af9f53fb
commit 35e65743ab
8 changed files with 399 additions and 690 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.hpp 238 2009-07-17 12:42:02Z hyunghwan.chung $
* $Id: Awk.hpp 239 2009-07-18 12:02:24Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -873,7 +873,10 @@ public:
* - 9 is greater if #QSE_AWK_NCMPONSTR is off;
* - "10.9" is greater if #QSE_AWK_NCMPONSTR is on
*/
OPT_NCMPONSTR = QSE_AWK_NCMPONSTR
OPT_NCMPONSTR = QSE_AWK_NCMPONSTR,
/** Enables 'include' */
OPT_INCLUDE = QSE_AWK_INCLUDE
};
/** Gets the option */
int getOption () const;
@ -991,28 +994,20 @@ public:
*/
/*@{*/
int getWord (
const char_t* ow, qse_size_t owl,
const char_t** nw, qse_size_t* nwl
const cstr_t* ow,
cstr_t* nw
);
int setWord (
const char_t* ow, const char_t* nw
);
int setWord (
const char_t* ow, qse_size_t owl,
const char_t* nw, qse_size_t nwl
const cstr_t* ow,
const cstr_t* nw
);
int unsetWord (
const char_t* ow
const cstr_t* ow
);
int unsetWord (
const char_t* ow, qse_size_t owl
);
int unsetAllWords ();
void unsetAllWords ();
/*@}*/
protected:

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.h 238 2009-07-17 12:42:02Z hyunghwan.chung $
* $Id: awk.h 239 2009-07-18 12:02:24Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -574,6 +574,11 @@ enum qse_awk_option_t
*/
QSE_AWK_STRICTNAMING = (1 << 15),
/**
* supports file inclusion by enabling a keyword 'include'
*/
QSE_AWK_INCLUDE = (1 << 16),
/**
* makes #qse_awk_t to behave as compatibly as classical AWK
* implementations
@ -1059,17 +1064,14 @@ void qse_awk_setmaxdepth (
);
int qse_awk_getword (
qse_awk_t* awk,
const qse_char_t* okw,
qse_size_t olen,
const qse_char_t** nkw,
qse_size_t* nlen
qse_awk_t* awk,
const qse_cstr_t* okw,
qse_cstr_t* nkw
);
int qse_awk_unsetword (
qse_awk_t* awk,
const qse_char_t* kw,
qse_size_t len
const qse_cstr_t* kw
);
void qse_awk_unsetallwords (
@ -1089,16 +1091,9 @@ void qse_awk_unsetallwords (
* @return 0 on success, -1 on failure
*/
int qse_awk_setword (
/* the pointer to a qse_awk_t instance */
qse_awk_t* awk,
/* the pointer to an old keyword */
const qse_char_t* okw,
/* the length of the old keyword */
qse_size_t olen,
/* the pointer to an new keyword */
const qse_char_t* nkw,
/* the length of the new keyword */
qse_size_t nlen
qse_awk_t* awk, /**< awk object */
const qse_cstr_t* okw, /**< old keyword */
const qse_cstr_t* nkw /**< new keyword */
);
/**

View File

@ -1,5 +1,5 @@
/*
* $Id: std.h 232 2009-07-14 08:06:14Z hyunghwan.chung $
* $Id: std.h 239 2009-07-18 12:02:24Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -34,6 +34,7 @@
* - add code to treat a function as a value
* - add RQ and LQ for more powerful record splitting
* - improve performance in qse_awk_rtx_readio() if RS is logner than 2 chars.
* - implement 'include'
*/
/**