renames some functions for building on freebsd

This commit is contained in:
hyung-hwan 2014-11-08 03:50:43 +00:00
parent a30c831081
commit 45b97e9f4d
4 changed files with 48 additions and 10 deletions

View File

@ -23,7 +23,7 @@ CPPFLAGS_LIB_COMMON += -DQSE_AWK_DEFAULT_MODPREFIX=\"$(libdir)/libqseawk-\" -DQS
endif endif
lib_LTLIBRARIES = libqseawk.la lib_LTLIBRARIES = libqseawk.la
libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h parse.h run.h tree.h libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h parse.h run.h tree.h std.h
libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libqseawk_la_LIBADD = $(LIBADD_LIB_COMMON) libqseawk_la_LIBADD = $(LIBADD_LIB_COMMON)

View File

@ -215,9 +215,9 @@ libqseawk_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3)
am__libqseawk_la_SOURCES_DIST = awk.c err.c tree.c parse.c run.c rec.c \ am__libqseawk_la_SOURCES_DIST = awk.c err.c tree.c parse.c run.c rec.c \
val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h \ val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h \
misc.h parse.h run.h tree.h mod-dir.c mod-dir.h mod-math.c \ misc.h parse.h run.h tree.h std.h mod-dir.c mod-dir.h \
mod-math.h mod-sed.c mod-sed.h mod-str.c mod-str.h mod-sys.c \ mod-math.c mod-math.h mod-sed.c mod-sed.h mod-str.c mod-str.h \
mod-sys.h mod-mpi.c mod-mpi.h mod-uci.c mod-uci.h mod-sys.c mod-sys.h mod-mpi.c mod-mpi.h mod-uci.c mod-uci.h
@ENABLE_STATIC_MODULE_TRUE@am__objects_1 = libqseawk_la-mod-dir.lo \ @ENABLE_STATIC_MODULE_TRUE@am__objects_1 = libqseawk_la-mod-dir.lo \
@ENABLE_STATIC_MODULE_TRUE@ libqseawk_la-mod-math.lo \ @ENABLE_STATIC_MODULE_TRUE@ libqseawk_la-mod-math.lo \
@ENABLE_STATIC_MODULE_TRUE@ libqseawk_la-mod-sed.lo \ @ENABLE_STATIC_MODULE_TRUE@ libqseawk_la-mod-sed.lo \
@ -500,7 +500,7 @@ LIBADD_LIB_COMMON = -lqsecmn $(LIBM) $(LIBLTDL)
lib_LTLIBRARIES = libqseawk.la $(am__append_3) lib_LTLIBRARIES = libqseawk.la $(am__append_3)
libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c \ libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c \
fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h \ fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h \
parse.h run.h tree.h $(am__append_4) $(am__append_6) \ parse.h run.h tree.h std.h $(am__append_4) $(am__append_6) \
$(am__append_9) $(am__append_9)
libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) $(am__append_7) libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) $(am__append_7)
libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) $(am__append_8) libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) $(am__append_8)

View File

@ -18,7 +18,7 @@
License along with QSE. If not, see <http://www.gnu.org/licenses/>. License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "awk.h" #include "std.h"
#include <qse/awk/stdawk.h> #include <qse/awk/stdawk.h>
#include <qse/cmn/sio.h> #include <qse/cmn/sio.h>
#include <qse/cmn/pio.h> #include <qse/cmn/pio.h>
@ -145,7 +145,7 @@ typedef struct ioattr_t
static ioattr_t* get_ioattr (qse_htb_t* tab, const qse_char_t* ptr, qse_size_t len); static ioattr_t* get_ioattr (qse_htb_t* tab, const qse_char_t* ptr, qse_size_t len);
static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) qse_awk_flt_t qse_awk_stdmathpow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y)
{ {
#if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_POWQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_POWQ)
return powq (x, y); return powq (x, y);
@ -160,7 +160,7 @@ static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_fl
#endif #endif
} }
static qse_awk_flt_t custom_awk_mod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) qse_awk_flt_t qse_awk_stdmathmod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y)
{ {
#if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_FMODQ) #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_FMODQ)
return fmodq (x, y); return fmodq (x, y);
@ -406,8 +406,8 @@ qse_awk_t* qse_awk_openstdwithmmgr (qse_mmgr_t* mmgr, qse_size_t xtnsize, qse_aw
qse_awk_prm_t prm; qse_awk_prm_t prm;
xtn_t* xtn; xtn_t* xtn;
prm.math.pow = custom_awk_pow; prm.math.pow = qse_awk_stdmathpow;
prm.math.mod = custom_awk_mod; prm.math.mod = qse_awk_stdmathmod;
prm.modopen = custom_awk_modopen; prm.modopen = custom_awk_modopen;
prm.modclose = custom_awk_modclose; prm.modclose = custom_awk_modclose;

38
qse/lib/awk/std.h Normal file
View File

@ -0,0 +1,38 @@
/*
* $Id$
*
Copyright 2006-2014 Chung, Hyung-Hwan.
This file is part of QSE.
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
QSE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _QSE_LIB_AWK_STD_H
#define _QSE_LIB_AWK_STD_H_
#include "awk.h"
#ifdef __cplusplus
extern "C" {
#endif
qse_awk_flt_t qse_awk_stdmathpow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y);
qse_awk_flt_t qse_awk_stdmathmod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y);
#ifdef __cplusplus
}
#endif
#endif