This commit is contained in:
@ -67,12 +67,12 @@ $ make install
|
|||||||
Here's an example of how Hawk can be embedded within a C application:
|
Here's an example of how Hawk can be embedded within a C application:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#include <hawk-std.h>
|
#include <hawk.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static const hawk_bch_t* src =
|
static const hawk_bch_t* src =
|
||||||
"BEGIN { print ARGV[0]"
|
"BEGIN { print ARGV[0];"
|
||||||
" for (i=2;i<=9;i++)"
|
" for (i=2;i<=9;i++)"
|
||||||
" {"
|
" {"
|
||||||
" for (j=1;j<=9;j++)"
|
" for (j=1;j<=9;j++)"
|
||||||
|
@ -2239,7 +2239,7 @@ static int run_block (hawk_rtx_t* rtx, hawk_nde_blk_t* nde)
|
|||||||
rtx->depth.block >= rtx->hawk->opt.depth.s.block_run)
|
rtx->depth.block >= rtx->hawk->opt.depth.s.block_run)
|
||||||
{
|
{
|
||||||
hawk_rtx_seterrnum(rtx, &nde->loc, HAWK_EBLKNST);
|
hawk_rtx_seterrnum(rtx, &nde->loc, HAWK_EBLKNST);
|
||||||
return -1;;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtx->depth.block++;
|
rtx->depth.block++;
|
||||||
|
@ -294,7 +294,7 @@ struct cmdline_t
|
|||||||
int argc;
|
int argc;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int handle_cmdline (MyHawk& awk, int argc, hawk_bch_t* argv[], cmdline_t* cmdline)
|
static int handle_cmdline (MyHawk& hawk, int argc, hawk_bch_t* argv[], cmdline_t* cmdline)
|
||||||
{
|
{
|
||||||
static hawk_bcli_t opt =
|
static hawk_bcli_t opt =
|
||||||
{
|
{
|
||||||
@ -351,9 +351,9 @@ static int handle_cmdline (MyHawk& awk, int argc, hawk_bch_t* argv[], cmdline_t*
|
|||||||
cmdline->argc = 0;
|
cmdline->argc = 0;
|
||||||
while (opt.ind < argc)
|
while (opt.ind < argc)
|
||||||
{
|
{
|
||||||
if (awk.addArgument(argv[opt.ind++]) <= -1)
|
if (hawk.addArgument(argv[opt.ind++]) <= -1)
|
||||||
{
|
{
|
||||||
print_error (awk);
|
print_error(hawk);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,6 @@ int execute_sed (int argc, hawk_bch_t* argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
sed.close();
|
sed.close();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user