exposed hcl_addbuiltinprims().
This commit is contained in:
parent
89f3fc2d08
commit
46ff9acfe2
@ -353,7 +353,6 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
@ -584,7 +583,7 @@ distdir: $(DISTFILES)
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
@ -610,7 +609,7 @@ dist-shar: distdir
|
||||
@echo WARNING: "Support for shar distribution archives is" \
|
||||
"deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
@ -628,7 +627,7 @@ dist dist-all:
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
@ -638,7 +637,7 @@ distcheck: dist
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
|
14
configure
vendored
14
configure
vendored
@ -781,7 +781,6 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@ -875,7 +874,6 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@ -1128,15 +1126,6 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||
| --run | --ru | --r)
|
||||
ac_prev=runstatedir ;;
|
||||
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
| --run=* | --ru=* | --r=*)
|
||||
runstatedir=$ac_optarg ;;
|
||||
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@ -1274,7 +1263,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
libdir localedir mandir runstatedir
|
||||
libdir localedir mandir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@ -1427,7 +1416,6 @@ Fine tuning of the installation directories:
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
|
@ -420,7 +420,6 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -996,13 +996,6 @@ hcl_pfbase_t* hcl_querymod (
|
||||
hcl_mod_t** mod
|
||||
);
|
||||
|
||||
/* ========================================================================= */
|
||||
/* prim.c */
|
||||
/* ========================================================================= */
|
||||
int hcl_addbuiltinprims (
|
||||
hcl_t* hcl
|
||||
);
|
||||
|
||||
/* ========================================================================= */
|
||||
/* logfmt.c */
|
||||
/* ========================================================================= */
|
||||
|
@ -1396,8 +1396,8 @@ static int get_token (hcl_server_proto_t* proto)
|
||||
|
||||
SET_TOKEN_TYPE (proto, HCL_SERVER_PROTO_TOKEN_EOF); /* is it correct? */
|
||||
proto->tok.len = 0;
|
||||
proto->tok.loc = proto->hcl->c->lxc.l; /* set token location */
|
||||
|
||||
proto->tok.loc = proto->lxc->l; /* set token location */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case HCL_OOCI_EOF:
|
||||
|
@ -1583,6 +1583,10 @@ HCL_EXPORT int hcl_ignite (
|
||||
hcl_t* hcl
|
||||
);
|
||||
|
||||
HCL_EXPORT int hcl_addbuiltinprims (
|
||||
hcl_t* hcl
|
||||
);
|
||||
|
||||
/**
|
||||
* The hcl_execute() function executes an activated context.
|
||||
*/
|
||||
|
27
lib/main-s.c
27
lib/main-s.c
@ -127,7 +127,7 @@ static int write_all (int fd, const hcl_bch_t* ptr, hcl_oow_t len)
|
||||
}
|
||||
|
||||
|
||||
static int write_log (hcl_server_t* server, const hcl_bch_t* ptr, hcl_oow_t len)
|
||||
static int write_log (hcl_server_t* server, int fd, const hcl_bch_t* ptr, hcl_oow_t len)
|
||||
{
|
||||
server_xtn_t* xtn;
|
||||
|
||||
@ -161,7 +161,7 @@ static int write_log (hcl_server_t* server, const hcl_bch_t* ptr, hcl_oow_t len)
|
||||
rcapa = HCL_COUNTOF(xtn->logbuf.buf);
|
||||
if (len >= rcapa)
|
||||
{
|
||||
write_all (xtn->logfd, ptr, rcapa);
|
||||
write_all (fd, ptr, rcapa);
|
||||
ptr += rcapa;
|
||||
len -= rcapa;
|
||||
}
|
||||
@ -179,13 +179,13 @@ static int write_log (hcl_server_t* server, const hcl_bch_t* ptr, hcl_oow_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void flush_log (hcl_server_t* server)
|
||||
static void flush_log (hcl_server_t* server, int fd)
|
||||
{
|
||||
server_xtn_t* xtn;
|
||||
xtn = hcl_server_getxtn(server);
|
||||
if (xtn->logbuf.len > 0)
|
||||
{
|
||||
write_all (xtn->logfd, xtn->logbuf.buf, xtn->logbuf.len);
|
||||
write_all (fd, xtn->logbuf.buf, xtn->logbuf.len);
|
||||
xtn->logbuf.len = 0;
|
||||
}
|
||||
}
|
||||
@ -241,22 +241,21 @@ static void log_write (hcl_server_t* server, hcl_oow_t wid, unsigned int mask, c
|
||||
tslen = 25;
|
||||
}
|
||||
|
||||
/* TODO: less write system calls by having a buffer */
|
||||
write_log (server, ts, tslen);
|
||||
write_log (server, logfd, ts, tslen);
|
||||
|
||||
if (wid != HCL_SERVER_WID_INVALID)
|
||||
{
|
||||
/* TODO: check if the underlying snprintf support %zd */
|
||||
tslen = snprintf (ts, sizeof(ts), "[%zu] ", wid);
|
||||
write_log (server, ts, tslen);
|
||||
write_log (server, logfd, ts, tslen);
|
||||
}
|
||||
}
|
||||
|
||||
if (xtn->logfd_istty)
|
||||
{
|
||||
if (mask & HCL_LOG_FATAL) write_log (server, "\x1B[1;31m", 7);
|
||||
else if (mask & HCL_LOG_ERROR) write_log (server, "\x1B[1;32m", 7);
|
||||
else if (mask & HCL_LOG_WARN) write_log (server, "\x1B[1;33m", 7);
|
||||
if (mask & HCL_LOG_FATAL) write_log (server, logfd, "\x1B[1;31m", 7);
|
||||
else if (mask & HCL_LOG_ERROR) write_log (server, logfd, "\x1B[1;32m", 7);
|
||||
else if (mask & HCL_LOG_WARN) write_log (server, logfd, "\x1B[1;33m", 7);
|
||||
}
|
||||
|
||||
#if defined(HCL_OOCH_IS_UCH)
|
||||
@ -279,7 +278,7 @@ static void log_write (hcl_server_t* server, hcl_oow_t wid, unsigned int mask, c
|
||||
/*assert (ucslen > 0);*/
|
||||
|
||||
/* attempt to write all converted characters */
|
||||
if (write_log(server, buf, bcslen) <= -1) break;
|
||||
if (write_log(server, logfd, buf, bcslen) <= -1) break;
|
||||
|
||||
if (n == 0) break;
|
||||
else
|
||||
@ -295,15 +294,15 @@ static void log_write (hcl_server_t* server, hcl_oow_t wid, unsigned int mask, c
|
||||
}
|
||||
}
|
||||
#else
|
||||
write_log (server, msg, len);
|
||||
write_log (server, logfd, msg, len);
|
||||
#endif
|
||||
|
||||
if (xtn->logfd_istty)
|
||||
{
|
||||
if (mask & (HCL_LOG_FATAL | HCL_LOG_ERROR | HCL_LOG_WARN)) write_log (server, "\x1B[0m", 4);
|
||||
if (mask & (HCL_LOG_FATAL | HCL_LOG_ERROR | HCL_LOG_WARN)) write_log (server, logfd, "\x1B[0m", 4);
|
||||
}
|
||||
|
||||
flush_log (server);
|
||||
flush_log (server, logfd);
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
|
@ -376,7 +376,6 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
Loading…
Reference in New Issue
Block a user