This commit is contained in:
@ -21,7 +21,7 @@ int main ()
|
||||
int ret;
|
||||
|
||||
hawk = hawk_openstd(0, HAWK_NULL); /* create a hawk instance */
|
||||
if (!hawk)
|
||||
if (!hawk)
|
||||
{
|
||||
fprintf (stderr, "ERROR: cannot open hawk\n");
|
||||
ret = -1; goto oops;
|
||||
@ -37,13 +37,13 @@ int main ()
|
||||
ret = hawk_parsestd(hawk, psin, HAWK_NULL); /* parse the script */
|
||||
if (ret <= -1)
|
||||
{
|
||||
hawk_logbfmt (hawk, HAWK_LOG_STDERR, "ERROR(parse): %js\n", hawk_geterrmsg(hawk));
|
||||
hawk_logbfmt(hawk, HAWK_LOG_STDERR, "ERROR(parse): %js\n", hawk_geterrmsg(hawk));
|
||||
ret = -1; goto oops;
|
||||
}
|
||||
|
||||
/* create a runtime context needed for execution */
|
||||
rtx = hawk_rtx_openstd (
|
||||
hawk,
|
||||
rtx = hawk_rtx_openstd(
|
||||
hawk,
|
||||
0,
|
||||
HAWK_T("hawk02"),
|
||||
HAWK_NULL, /* stdin */
|
||||
@ -52,7 +52,7 @@ int main ()
|
||||
);
|
||||
if (!rtx)
|
||||
{
|
||||
hawk_logbfmt (hawk, HAWK_LOG_STDERR, "ERROR(rtx_open): %js\n", hawk_geterrmsg(hawk));
|
||||
hawk_logbfmt(hawk, HAWK_LOG_STDERR, "ERROR(rtx_open): %js\n", hawk_geterrmsg(hawk));
|
||||
ret = -1; goto oops;
|
||||
}
|
||||
|
||||
@ -60,16 +60,16 @@ int main ()
|
||||
retv = hawk_rtx_loop(rtx);
|
||||
if (!retv)
|
||||
{
|
||||
hawk_logbfmt (hawk, HAWK_LOG_STDERR, "ERROR(rtx_loop): %js\n", hawk_geterrmsg(hawk));
|
||||
hawk_logbfmt(hawk, HAWK_LOG_STDERR, "ERROR(rtx_loop): %js\n", hawk_geterrmsg(hawk));
|
||||
ret = -1; goto oops;
|
||||
}
|
||||
|
||||
/* lowered the reference count of the returned value */
|
||||
hawk_rtx_refdownval (rtx, retv);
|
||||
hawk_rtx_refdownval(rtx, retv);
|
||||
ret = 0;
|
||||
|
||||
oops:
|
||||
if (rtx) hawk_rtx_close (rtx); /* destroy the runtime context */
|
||||
if (hawk) hawk_close (hawk); /* destroy the hawk instance */
|
||||
if (rtx) hawk_rtx_close(rtx); /* destroy the runtime context */
|
||||
if (hawk) hawk_close(hawk); /* destroy the hawk instance */
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user