2007-05-02 01:07:00 +00:00
|
|
|
/*
|
2012-08-16 03:47:55 +00:00
|
|
|
* $Id$
|
2007-05-02 01:07:00 +00:00
|
|
|
*
|
2019-06-06 05:28:23 +00:00
|
|
|
Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved.
|
2014-11-19 14:42:24 +00:00
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions
|
|
|
|
are met:
|
|
|
|
1. Redistributions of source code must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
|
|
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2007-05-02 01:07:00 +00:00
|
|
|
*/
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
#ifndef _QSE_LIB_AWK_MISC_H_
|
|
|
|
#define _QSE_LIB_AWK_MISC_H_
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2014-11-14 02:44:20 +00:00
|
|
|
#if defined(__cplusplus)
|
2007-05-02 01:07:00 +00:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-02-15 00:21:19 +00:00
|
|
|
qse_char_t* qse_awk_rtx_strtok (
|
|
|
|
qse_awk_rtx_t* rtx, const qse_char_t* s,
|
2014-07-08 14:30:42 +00:00
|
|
|
const qse_char_t* delim, qse_cstr_t* tok);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2009-02-15 00:21:19 +00:00
|
|
|
qse_char_t* qse_awk_rtx_strxtok (
|
|
|
|
qse_awk_rtx_t* rtx, const qse_char_t* s, qse_size_t len,
|
2014-07-08 14:30:42 +00:00
|
|
|
const qse_char_t* delim, qse_cstr_t* tok);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2009-02-15 00:21:19 +00:00
|
|
|
qse_char_t* qse_awk_rtx_strntok (
|
|
|
|
qse_awk_rtx_t* rtx, const qse_char_t* s,
|
2014-07-08 14:30:42 +00:00
|
|
|
const qse_char_t* delim, qse_size_t delim_len, qse_cstr_t* tok);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2009-02-15 00:21:19 +00:00
|
|
|
qse_char_t* qse_awk_rtx_strxntok (
|
|
|
|
qse_awk_rtx_t* rtx, const qse_char_t* s, qse_size_t len,
|
2014-07-08 14:30:42 +00:00
|
|
|
const qse_char_t* delim, qse_size_t delim_len, qse_cstr_t* tok);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2009-02-15 00:21:19 +00:00
|
|
|
qse_char_t* qse_awk_rtx_strxntokbyrex (
|
2009-05-16 07:31:43 +00:00
|
|
|
qse_awk_rtx_t* rtx,
|
|
|
|
const qse_char_t* str,
|
|
|
|
qse_size_t len,
|
|
|
|
const qse_char_t* substr,
|
|
|
|
qse_size_t sublen,
|
|
|
|
void* rex,
|
2014-07-08 14:30:42 +00:00
|
|
|
qse_cstr_t* tok,
|
2009-06-02 03:34:34 +00:00
|
|
|
qse_awk_errnum_t* errnum
|
2009-05-16 07:31:43 +00:00
|
|
|
);
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2009-09-22 07:28:18 +00:00
|
|
|
qse_char_t* qse_awk_rtx_strxnfld (
|
|
|
|
qse_awk_rtx_t* rtx,
|
|
|
|
qse_char_t* str,
|
|
|
|
qse_size_t len,
|
|
|
|
qse_char_t fs,
|
|
|
|
qse_char_t lq,
|
|
|
|
qse_char_t rq,
|
|
|
|
qse_char_t ec,
|
2014-07-08 14:30:42 +00:00
|
|
|
qse_cstr_t* tok
|
2009-09-22 07:28:18 +00:00
|
|
|
);
|
|
|
|
|
2013-08-23 15:19:29 +00:00
|
|
|
int qse_awk_buildrex (
|
2009-06-02 03:34:34 +00:00
|
|
|
qse_awk_t* awk,
|
|
|
|
const qse_char_t* ptn,
|
|
|
|
qse_size_t len,
|
2013-08-23 15:19:29 +00:00
|
|
|
qse_awk_errnum_t* errnum,
|
|
|
|
void** code,
|
|
|
|
void** icode
|
2009-06-02 03:34:34 +00:00
|
|
|
);
|
2008-03-04 03:31:41 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
int qse_awk_matchrex (
|
2013-08-23 15:19:29 +00:00
|
|
|
qse_awk_t* awk, void* code, int icase,
|
2014-07-08 14:30:42 +00:00
|
|
|
const qse_cstr_t* str, const qse_cstr_t* substr,
|
2016-11-09 14:12:22 +00:00
|
|
|
qse_cstr_t* match, qse_cstr_t submat[9], qse_awk_errnum_t* errnum
|
2009-06-02 03:34:34 +00:00
|
|
|
);
|
2008-03-04 03:31:41 +00:00
|
|
|
|
2013-08-23 15:19:29 +00:00
|
|
|
void qse_awk_freerex (qse_awk_t* awk, void* code, void* icode);
|
|
|
|
|
|
|
|
int qse_awk_rtx_matchrex (
|
|
|
|
qse_awk_rtx_t* rtx, qse_awk_val_t* val,
|
2014-07-08 14:30:42 +00:00
|
|
|
const qse_cstr_t* str, const qse_cstr_t* substr,
|
2016-11-09 14:12:22 +00:00
|
|
|
qse_cstr_t* match, qse_cstr_t submat[9]
|
2013-08-23 15:19:29 +00:00
|
|
|
);
|
2013-04-06 13:39:56 +00:00
|
|
|
|
2014-11-14 02:44:20 +00:00
|
|
|
#if defined(__cplusplus)
|
2007-05-02 01:07:00 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|