2019-12-13 04:29:58 +00:00
|
|
|
/*
|
2020-04-16 03:42:30 +00:00
|
|
|
Copyright (c) 2006-2020 Chung, Hyung-Hwan. All rights reserved.
|
2019-12-13 04:29:58 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _HAWK_PARSE_PRV_H_
|
|
|
|
#define _HAWK_PARSE_PRV_H_
|
|
|
|
|
|
|
|
/* these enums should match kwtab in parse.c */
|
|
|
|
enum hawk_kwid_t
|
|
|
|
{
|
|
|
|
HAWK_KWID_XABORT,
|
2024-05-02 13:36:50 +00:00
|
|
|
HAWK_KWID_XARGC,
|
|
|
|
HAWK_KWID_XARGV,
|
2019-12-13 04:29:58 +00:00
|
|
|
HAWK_KWID_XGLOBAL,
|
|
|
|
HAWK_KWID_XINCLUDE,
|
|
|
|
HAWK_KWID_XINCLUDE_ONCE,
|
|
|
|
HAWK_KWID_XLOCAL,
|
2020-11-10 02:56:29 +00:00
|
|
|
HAWK_KWID_XNIL,
|
2019-12-13 04:29:58 +00:00
|
|
|
HAWK_KWID_XPRAGMA,
|
|
|
|
HAWK_KWID_XRESET,
|
|
|
|
HAWK_KWID_BEGIN,
|
|
|
|
HAWK_KWID_END,
|
|
|
|
HAWK_KWID_BREAK,
|
|
|
|
HAWK_KWID_CONTINUE,
|
|
|
|
HAWK_KWID_DELETE,
|
|
|
|
HAWK_KWID_DO,
|
|
|
|
HAWK_KWID_ELSE,
|
|
|
|
HAWK_KWID_EXIT,
|
|
|
|
HAWK_KWID_FOR,
|
|
|
|
HAWK_KWID_FUNCTION,
|
2020-01-16 09:22:59 +00:00
|
|
|
HAWK_KWID_GETBLINE,
|
2019-12-13 04:29:58 +00:00
|
|
|
HAWK_KWID_GETLINE,
|
|
|
|
HAWK_KWID_IF,
|
|
|
|
HAWK_KWID_IN,
|
|
|
|
HAWK_KWID_NEXT,
|
|
|
|
HAWK_KWID_NEXTFILE,
|
|
|
|
HAWK_KWID_NEXTOFILE,
|
|
|
|
HAWK_KWID_PRINT,
|
|
|
|
HAWK_KWID_PRINTF,
|
|
|
|
HAWK_KWID_RETURN,
|
|
|
|
HAWK_KWID_WHILE
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum hawk_kwid_t hawk_kwid_t;
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-12-25 16:01:43 +00:00
|
|
|
int hawk_putsrcoocstr (
|
|
|
|
hawk_t* hawk,
|
2019-12-13 04:29:58 +00:00
|
|
|
const hawk_ooch_t* str
|
|
|
|
);
|
|
|
|
|
2019-12-25 16:01:43 +00:00
|
|
|
int hawk_putsrcoochars (
|
|
|
|
hawk_t* hawk,
|
2019-12-13 04:29:58 +00:00
|
|
|
const hawk_ooch_t* str,
|
2019-12-25 16:01:43 +00:00
|
|
|
hawk_oow_t len
|
2019-12-13 04:29:58 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
const hawk_ooch_t* hawk_getgblname (
|
2019-12-25 16:01:43 +00:00
|
|
|
hawk_t* hawk,
|
2019-12-13 04:29:58 +00:00
|
|
|
hawk_oow_t idx,
|
|
|
|
hawk_oow_t* len
|
|
|
|
);
|
|
|
|
|
|
|
|
void hawk_getkwname (
|
2019-12-25 16:01:43 +00:00
|
|
|
hawk_t* hawk,
|
|
|
|
hawk_kwid_t id,
|
|
|
|
hawk_oocs_t* s
|
2019-12-13 04:29:58 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
int hawk_initgbls (
|
2019-12-25 16:01:43 +00:00
|
|
|
hawk_t* hawk
|
2019-12-13 04:29:58 +00:00
|
|
|
);
|
|
|
|
|
2019-12-25 16:01:43 +00:00
|
|
|
hawk_ooch_t* hawk_addsionamewithuchars (
|
|
|
|
hawk_t* hawk,
|
|
|
|
const hawk_uch_t* ptr,
|
|
|
|
hawk_oow_t len
|
|
|
|
);
|
|
|
|
|
|
|
|
hawk_ooch_t* hawk_addsionamewithbchars (
|
|
|
|
hawk_t* hawk,
|
|
|
|
const hawk_bch_t* ptr,
|
|
|
|
hawk_oow_t len
|
|
|
|
);
|
|
|
|
|
|
|
|
#if defined(HAWK_OOCH_IS_UCH)
|
|
|
|
# define hawk_addsionamewithoochars hawk_addsionamewithuchars
|
|
|
|
#else
|
|
|
|
# define hawk_addsionamewithoochars hawk_addsionamewithbchars
|
|
|
|
#endif
|
|
|
|
|
2019-12-13 04:29:58 +00:00
|
|
|
void hawk_clearsionames (
|
2019-12-25 16:01:43 +00:00
|
|
|
hawk_t* hawk
|
2019-12-13 04:29:58 +00:00
|
|
|
);
|
|
|
|
|
2020-12-28 07:10:17 +00:00
|
|
|
|
2022-04-06 15:49:23 +00:00
|
|
|
hawk_mod_t* hawk_querymodulewithname (
|
2022-06-03 06:01:52 +00:00
|
|
|
hawk_t* hawk,
|
|
|
|
hawk_ooch_t* name, /* this must be a mutable null-terminated string */
|
|
|
|
hawk_mod_sym_t* sym
|
2020-12-28 07:10:17 +00:00
|
|
|
);
|
|
|
|
|
2019-12-13 04:29:58 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|