From 551e6f7c09bab1d30e4759f21f6ea754cab70fa6 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 4 Jun 2009 15:50:32 +0000 Subject: [PATCH] reorganized files --- qse/cmd/awk/Awk.cpp | 4 +- qse/cmd/awk/awk.c | 6 +-- qse/cmd/lsp/lsp.c | 4 +- qse/cmd/utl/tgp.c | 4 +- qse/doc/page/main.doc | 2 +- qse/include/qse/cmn/Makefile.am | 5 ++- qse/include/qse/cmn/Makefile.in | 6 ++- qse/include/qse/{utl => cmn}/main.h | 4 +- qse/include/qse/cmn/sio.h | 6 ++- qse/include/qse/{utl => cmn}/stdio.h | 18 +++++++-- qse/include/qse/utl/Makefile.am | 2 +- qse/include/qse/utl/Makefile.in | 2 +- qse/lib/Makefile.am | 2 +- qse/lib/Makefile.in | 2 +- qse/lib/awk/Awk.cpp | 3 +- qse/lib/awk/Makefile.am | 8 ++-- qse/lib/awk/Makefile.in | 8 ++-- qse/lib/awk/StdAwk.cpp | 4 +- qse/lib/awk/run.c | 4 +- qse/lib/awk/std.c | 4 +- qse/lib/awk/val.c | 4 +- qse/lib/cmn/Makefile.am | 5 ++- qse/lib/cmn/Makefile.in | 10 ++++- qse/lib/cmn/assert.c | 55 ++++++++++++++++++++++++++++ qse/lib/{utl => cmn}/main.c | 16 +++++++- qse/lib/{utl => cmn}/stdio.c | 16 +++++++- qse/lib/lsp/mem.c | 2 +- qse/lib/sed/Makefile.am | 8 ++-- qse/lib/sed/Makefile.in | 8 ++-- qse/lib/utl/Makefile.am | 2 +- qse/lib/utl/Makefile.in | 7 +--- qse/lib/utl/assert.c | 32 ---------------- qse/test/Makefile.am | 2 +- qse/test/Makefile.in | 2 +- qse/test/awk/Makefile.am | 4 +- qse/test/awk/Makefile.in | 4 +- qse/test/awk/awk01.c | 4 +- qse/test/awk/awk02.c | 4 +- qse/test/awk/awk03.c | 4 +- qse/test/awk/awk04.c | 4 +- qse/test/cmn/Makefile.am | 4 +- qse/test/cmn/Makefile.in | 4 +- qse/test/cmn/chr.c | 2 +- qse/test/cmn/fio.c | 2 +- qse/test/cmn/lda.c | 2 +- qse/test/cmn/map.c | 2 +- qse/test/cmn/pio.c | 2 +- qse/test/cmn/sll.c | 2 +- qse/test/cmn/str.c | 2 +- qse/test/cmn/time.c | 2 +- qse/test/sed/Makefile.am | 4 +- qse/test/sed/Makefile.in | 4 +- qse/test/sed/sed01.c | 4 +- qse/test/sed/sed02.cpp | 4 +- qse/test/sed/sed03.cpp | 2 +- 55 files changed, 204 insertions(+), 129 deletions(-) rename qse/include/qse/{utl => cmn}/main.h (97%) rename qse/include/qse/{utl => cmn}/stdio.h (77%) create mode 100644 qse/lib/cmn/assert.c rename qse/lib/{utl => cmn}/main.c (71%) rename qse/lib/{utl => cmn}/stdio.c (92%) delete mode 100644 qse/lib/utl/assert.c diff --git a/qse/cmd/awk/Awk.cpp b/qse/cmd/awk/Awk.cpp index 9b6d390d..7ac03f6e 100644 --- a/qse/cmd/awk/Awk.cpp +++ b/qse/cmd/awk/Awk.cpp @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/qse/cmd/awk/awk.c b/qse/cmd/awk/awk.c index cebb58fc..53a5c191 100644 --- a/qse/cmd/awk/awk.c +++ b/qse/cmd/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c 90 2009-03-01 09:58:19Z hyunghwan.chung $ + * $Id: awk.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/qse/cmd/lsp/lsp.c b/qse/cmd/lsp/lsp.c index d5a756cc..184825ac 100644 --- a/qse/cmd/lsp/lsp.c +++ b/qse/cmd/lsp/lsp.c @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/qse/cmd/utl/tgp.c b/qse/cmd/utl/tgp.c index 955275da..545dfc45 100644 --- a/qse/cmd/utl/tgp.c +++ b/qse/cmd/utl/tgp.c @@ -4,8 +4,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/qse/doc/page/main.doc b/qse/doc/page/main.doc index 51901492..010d41bc 100644 --- a/qse/doc/page/main.doc +++ b/qse/doc/page/main.doc @@ -95,6 +95,6 @@ on each module. - @subpage awk "AWK Interpreter" @section design_model DESIGN MODEL -The design of a data structure is usually derived from object-oriented model. +The design of a data structure is derived from object-oriented model. <>> */ diff --git a/qse/include/qse/cmn/Makefile.am b/qse/include/qse/cmn/Makefile.am index 8dc2f48b..72d0aea2 100644 --- a/qse/include/qse/cmn/Makefile.am +++ b/qse/include/qse/cmn/Makefile.am @@ -1,5 +1,8 @@ -pkginclude_HEADERS = mem.h chr.h str.h lda.h map.h rex.h sll.h dll.h opt.h tio.h fio.h pio.h sio.h time.h +pkginclude_HEADERS = \ + mem.h chr.h str.h lda.h map.h \ + rex.h sll.h dll.h opt.h tio.h \ + fio.h pio.h sio.h time.h main.h stdio.h #if ENABLE_CXX #pkginclude_HEADERS += diff --git a/qse/include/qse/cmn/Makefile.in b/qse/include/qse/cmn/Makefile.in index 82c527e8..021e343a 100644 --- a/qse/include/qse/cmn/Makefile.in +++ b/qse/include/qse/cmn/Makefile.in @@ -192,7 +192,11 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -pkginclude_HEADERS = mem.h chr.h str.h lda.h map.h rex.h sll.h dll.h opt.h tio.h fio.h pio.h sio.h time.h +pkginclude_HEADERS = \ + mem.h chr.h str.h lda.h map.h \ + rex.h sll.h dll.h opt.h tio.h \ + fio.h pio.h sio.h time.h main.h stdio.h + CLEANFILES = *dist all: all-am diff --git a/qse/include/qse/utl/main.h b/qse/include/qse/cmn/main.h similarity index 97% rename from qse/include/qse/utl/main.h rename to qse/include/qse/cmn/main.h index 60127182..30c0a41b 100644 --- a/qse/include/qse/utl/main.h +++ b/qse/include/qse/cmn/main.h @@ -16,8 +16,8 @@ limitations under the License. */ -#ifndef _QSE_UTL_MAIN_H_ -#define _QSE_UTL_MAIN_H_ +#ifndef _QSE_CMN_MAIN_H_ +#define _QSE_CMN_MAIN_H_ #include #include diff --git a/qse/include/qse/cmn/sio.h b/qse/include/qse/cmn/sio.h index c803d155..269c4176 100644 --- a/qse/include/qse/cmn/sio.h +++ b/qse/include/qse/cmn/sio.h @@ -1,5 +1,5 @@ /* - * $Id: sio.h 75 2009-02-22 14:10:34Z hyunghwan.chung $ + * $Id: sio.h 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -61,6 +61,10 @@ extern qse_sio_t* qse_sio_in; extern qse_sio_t* qse_sio_out; extern qse_sio_t* qse_sio_err; +#define QSE_SIO_IN qse_sio_in +#define QSE_SIO_OUT qse_sio_out +#define QSE_SIO_ERR qse_sio_err + qse_sio_t* qse_sio_open ( qse_mmgr_t* mmgr, qse_size_t ext, diff --git a/qse/include/qse/utl/stdio.h b/qse/include/qse/cmn/stdio.h similarity index 77% rename from qse/include/qse/utl/stdio.h rename to qse/include/qse/cmn/stdio.h index 2411f640..e192d577 100644 --- a/qse/include/qse/utl/stdio.h +++ b/qse/include/qse/cmn/stdio.h @@ -1,11 +1,23 @@ /* * $Id: stdio.h 419 2008-10-13 11:32:58Z baconevi $ * - * {License} + Copyright 2006-2009 Chung, Hyung-Hwan. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ -#ifndef _QSE_UTL_STDIO_H_ -#define _QSE_UTL_STDIO_H_ +#ifndef _QSE_CMN_STDIO_H_ +#define _QSE_CMN_STDIO_H_ #include #include diff --git a/qse/include/qse/utl/Makefile.am b/qse/include/qse/utl/Makefile.am index 35576e28..8324ae5e 100644 --- a/qse/include/qse/utl/Makefile.am +++ b/qse/include/qse/utl/Makefile.am @@ -1,5 +1,5 @@ -pkginclude_HEADERS = http.h main.h stdio.h tgp.h +pkginclude_HEADERS = http.h tgp.h pkgincludedir= $(includedir)/qse/utl diff --git a/qse/include/qse/utl/Makefile.in b/qse/include/qse/utl/Makefile.in index 537d9933..07d74776 100644 --- a/qse/include/qse/utl/Makefile.in +++ b/qse/include/qse/utl/Makefile.in @@ -188,7 +188,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -pkginclude_HEADERS = http.h main.h stdio.h tgp.h +pkginclude_HEADERS = http.h tgp.h CLEANFILES = *dist all: all-am diff --git a/qse/lib/Makefile.am b/qse/lib/Makefile.am index f1cb8755..4f0287fa 100644 --- a/qse/lib/Makefile.am +++ b/qse/lib/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = cmn utl sed awk lsp +SUBDIRS = cmn sed awk lsp utl DIST_SUBDIRS = $(SUBDIRS) diff --git a/qse/lib/Makefile.in b/qse/lib/Makefile.in index 352a6717..effe0bae 100644 --- a/qse/lib/Makefile.in +++ b/qse/lib/Makefile.in @@ -186,7 +186,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = cmn utl sed awk lsp +SUBDIRS = cmn sed awk lsp utl DIST_SUBDIRS = $(SUBDIRS) all: all-recursive diff --git a/qse/lib/awk/Awk.cpp b/qse/lib/awk/Awk.cpp index e2f97c79..e4c4f588 100644 --- a/qse/lib/awk/Awk.cpp +++ b/qse/lib/awk/Awk.cpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.cpp 172 2009-06-01 13:33:01Z hyunghwan.chung $ + * $Id: Awk.cpp 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -21,7 +21,6 @@ #include "../cmn/mem.h" #include "awk.h" -#include ///////////////////////////////// QSE_BEGIN_NAMESPACE(QSE) ///////////////////////////////// diff --git a/qse/lib/awk/Makefile.am b/qse/lib/awk/Makefile.am index e8b0b3c1..e1d4bf0a 100644 --- a/qse/lib/awk/Makefile.am +++ b/qse/lib/awk/Makefile.am @@ -5,12 +5,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/include 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 rio.h val.h fnc.h misc.h parse.h run.h tree.h -libqseawk_la_LDFLAGS = -L../cmn -L../utl -version-info 1:0:0 -no-undefined -libqseawk_la_LIBADD = -lqsecmn -lqseutl +libqseawk_la_LDFLAGS = -L../cmn -version-info 1:0:0 -no-undefined +libqseawk_la_LIBADD = -lqsecmn if ENABLE_CXX lib_LTLIBRARIES += libqseawk++.la libqseawk___la_SOURCES = Awk.cpp StdAwk.cpp -libqseawk___la_LDFLAGS = -L. -L../cmn -L../utl -version-info 1:0:0 -no-undefined -libqseawk___la_LIBADD = -lqseawk -lqsecmn -lqseutl +libqseawk___la_LDFLAGS = -L. -L../cmn -version-info 1:0:0 -no-undefined +libqseawk___la_LIBADD = -lqseawk -lqsecmn endif diff --git a/qse/lib/awk/Makefile.in b/qse/lib/awk/Makefile.in index b1580b5e..c3104a40 100644 --- a/qse/lib/awk/Makefile.in +++ b/qse/lib/awk/Makefile.in @@ -229,11 +229,11 @@ AUTOMAKE_OPTIONS = nostdinc AM_CPPFLAGS = -I$(top_srcdir)/include lib_LTLIBRARIES = libqseawk.la $(am__append_1) 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 rio.h val.h fnc.h misc.h parse.h run.h tree.h -libqseawk_la_LDFLAGS = -L../cmn -L../utl -version-info 1:0:0 -no-undefined -libqseawk_la_LIBADD = -lqsecmn -lqseutl +libqseawk_la_LDFLAGS = -L../cmn -version-info 1:0:0 -no-undefined +libqseawk_la_LIBADD = -lqsecmn @ENABLE_CXX_TRUE@libqseawk___la_SOURCES = Awk.cpp StdAwk.cpp -@ENABLE_CXX_TRUE@libqseawk___la_LDFLAGS = -L. -L../cmn -L../utl -version-info 1:0:0 -no-undefined -@ENABLE_CXX_TRUE@libqseawk___la_LIBADD = -lqseawk -lqsecmn -lqseutl +@ENABLE_CXX_TRUE@libqseawk___la_LDFLAGS = -L. -L../cmn -version-info 1:0:0 -no-undefined +@ENABLE_CXX_TRUE@libqseawk___la_LIBADD = -lqseawk -lqsecmn all: all-am .SUFFIXES: diff --git a/qse/lib/awk/StdAwk.cpp b/qse/lib/awk/StdAwk.cpp index 6a9215bc..51d26878 100644 --- a/qse/lib/awk/StdAwk.cpp +++ b/qse/lib/awk/StdAwk.cpp @@ -1,5 +1,5 @@ /* - * $Id: StdAwk.cpp 158 2009-05-26 13:29:47Z hyunghwan.chung $ + * $Id: StdAwk.cpp 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/qse/lib/awk/run.c b/qse/lib/awk/run.c index eeafdc5b..23080b13 100644 --- a/qse/lib/awk/run.c +++ b/qse/lib/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c 171 2009-06-01 09:34:34Z hyunghwan.chung $ + * $Id: run.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -19,7 +19,7 @@ #include "awk.h" #ifdef DEBUG_RUN -#include +#include #endif #define CMP_ERROR -99 diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index d07ff3a7..f74566b3 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -1,5 +1,5 @@ /* - * $Id: std.c 127 2009-05-07 13:15:04Z hyunghwan.chung $ + * $Id: std.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -22,7 +22,7 @@ #include #include #include -#include /* TODO: remove dependency on qse_vsprintf */ +#include /* TODO: remove dependency on qse_vsprintf */ #include #include diff --git a/qse/lib/awk/val.c b/qse/lib/awk/val.c index 9f0e6a90..9c2cf254 100644 --- a/qse/lib/awk/val.c +++ b/qse/lib/awk/val.c @@ -1,5 +1,5 @@ /* - * $Id: val.c 90 2009-03-01 09:58:19Z hyunghwan.chung $ + * $Id: val.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -19,7 +19,7 @@ #include "awk.h" #ifdef DEBUG_VAL -#include +#include #endif #define CHUNKSIZE QSE_AWK_VAL_CHUNK_SIZE diff --git a/qse/lib/cmn/Makefile.am b/qse/lib/cmn/Makefile.am index 74b52986..2bebdee5 100644 --- a/qse/lib/cmn/Makefile.am +++ b/qse/lib/cmn/Makefile.am @@ -11,7 +11,10 @@ libqsecmn_la_SOURCES = \ tio.c tio_get.c tio_put.c \ fio.c pio.c sio.c \ time.c \ - misc.c + misc.c \ + assert.c \ + main.c \ + stdio.c libqsecmn_la_LDFLAGS = -version-info 1:0:0 -no-undefined if WIN32 diff --git a/qse/lib/cmn/Makefile.in b/qse/lib/cmn/Makefile.in index 70196c72..25cf2f5a 100644 --- a/qse/lib/cmn/Makefile.in +++ b/qse/lib/cmn/Makefile.in @@ -54,7 +54,7 @@ libqsecmn_la_DEPENDENCIES = am_libqsecmn_la_OBJECTS = mem.lo chr.lo chr_cnv.lo rex.lo str_bas.lo \ str_cnv.lo str_dyn.lo str_utl.lo lda.lo map.lo sll.lo dll.lo \ opt.lo tio.lo tio_get.lo tio_put.lo fio.lo pio.lo sio.lo \ - time.lo misc.lo + time.lo misc.lo assert.lo main.lo stdio.lo libqsecmn_la_OBJECTS = $(am_libqsecmn_la_OBJECTS) libqsecmn_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -219,7 +219,10 @@ libqsecmn_la_SOURCES = \ tio.c tio_get.c tio_put.c \ fio.c pio.c sio.c \ time.c \ - misc.c + misc.c \ + assert.c \ + main.c \ + stdio.c libqsecmn_la_LDFLAGS = -version-info 1:0:0 -no-undefined @WIN32_TRUE@libqsecmn_la_LIBADD = -lpsapi @@ -292,11 +295,13 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chr_cnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lda.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @@ -305,6 +310,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sll.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_bas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_cnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str_dyn.Plo@am__quote@ diff --git a/qse/lib/cmn/assert.c b/qse/lib/cmn/assert.c new file mode 100644 index 00000000..675b7e10 --- /dev/null +++ b/qse/lib/cmn/assert.c @@ -0,0 +1,55 @@ +/* + * $Id: assert.c 223 2008-06-26 06:44:41Z baconevi $ + * + Copyright 2006-2009 Chung, Hyung-Hwan. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#include +#include + +#ifndef NDEBUG + +#include +#include + +void qse_assert_failed ( + const qse_char_t* expr, const qse_char_t* desc, + const qse_char_t* file, qse_size_t line) +{ + qse_sio_puts (QSE_SIO_ERR, QSE_T("=[ASSERTION FAILURE]============================================================")); + + qse_sio_puts (QSE_SIO_ERR, QSE_T("FILE ")); + qse_sio_puts (QSE_SIO_ERR, file); + qse_sio_puts (QSE_SIO_ERR, QSE_T("LINE ")); + +/*qse_sio_puts the number */ + + qse_sio_puts (QSE_SIO_ERR, QSE_T(": ")); + qse_sio_puts (QSE_SIO_ERR, expr); + qse_sio_puts (QSE_SIO_ERR, QSE_T("\n")); + + if (desc != QSE_NULL) + { + qse_sio_puts (QSE_SIO_ERR, QSE_T("DESCRIPTION: ")); + qse_sio_puts (QSE_SIO_ERR, desc); + qse_sio_puts (QSE_SIO_ERR, QSE_T("\n")); + } + qse_sio_puts (QSE_SIO_ERR, QSE_T("================================================================================")); + + abort (); +} + +#endif + diff --git a/qse/lib/utl/main.c b/qse/lib/cmn/main.c similarity index 71% rename from qse/lib/utl/main.c rename to qse/lib/cmn/main.c index 0d333c7e..ec675501 100644 --- a/qse/lib/utl/main.c +++ b/qse/lib/cmn/main.c @@ -1,10 +1,22 @@ /* * $Id: main.c 463 2008-12-09 06:52:03Z baconevi $ * - * {License} + Copyright 2006-2009 Chung, Hyung-Hwan. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ -#include +#include #include #include #include diff --git a/qse/lib/utl/stdio.c b/qse/lib/cmn/stdio.c similarity index 92% rename from qse/lib/utl/stdio.c rename to qse/lib/cmn/stdio.c index abc61e48..0a45a1b5 100644 --- a/qse/lib/utl/stdio.c +++ b/qse/lib/cmn/stdio.c @@ -1,10 +1,22 @@ /* * $Id: stdio.c 463 2008-12-09 06:52:03Z baconevi $ * - * {License} + Copyright 2006-2009 Chung, Hyung-Hwan. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. */ -#include +#include #include #include diff --git a/qse/lib/lsp/mem.c b/qse/lib/lsp/mem.c index 50933f38..728027a3 100644 --- a/qse/lib/lsp/mem.c +++ b/qse/lib/lsp/mem.c @@ -326,7 +326,7 @@ static void __mark_objs_in_use (qse_lsp_mem_t* mem) if (mem->macro != QSE_NULL) __mark_obj (mem->lsp, mem->macro); } -//#include +//#include static void __sweep_unmarked_objs (qse_lsp_mem_t* mem) { qse_lsp_obj_t* obj, * prev, * next; diff --git a/qse/lib/sed/Makefile.am b/qse/lib/sed/Makefile.am index 4ad6f90e..64ac5458 100644 --- a/qse/lib/sed/Makefile.am +++ b/qse/lib/sed/Makefile.am @@ -3,13 +3,13 @@ AM_CPPFLAGS = -I$(top_builddir)/include lib_LTLIBRARIES = libqsesed.la libqsesed_la_SOURCES = sed.c err.c sed.h -libqsesed_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn -L../utl -libqsesed_la_LIBADD = -lqsecmn -lqseutl +libqsesed_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn +libqsesed_la_LIBADD = -lqsecmn if ENABLE_CXX lib_LTLIBRARIES += libqsesed++.la libqsesed___la_SOURCES = Sed.cpp StdSed.cpp -libqsesed___la_LDFLAGS = -L. -L../cmn -L../utl -version-info 1:0:0 -no-undefined -libqsesed___la_LIBADD = -lqsesed -lqsecmn -lqseutl +libqsesed___la_LDFLAGS = -L. -L../cmn -version-info 1:0:0 -no-undefined +libqsesed___la_LIBADD = -lqsesed -lqsecmn endif diff --git a/qse/lib/sed/Makefile.in b/qse/lib/sed/Makefile.in index 6bb5e651..8061c316 100644 --- a/qse/lib/sed/Makefile.in +++ b/qse/lib/sed/Makefile.in @@ -227,11 +227,11 @@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_builddir)/include lib_LTLIBRARIES = libqsesed.la $(am__append_1) libqsesed_la_SOURCES = sed.c err.c sed.h -libqsesed_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn -L../utl -libqsesed_la_LIBADD = -lqsecmn -lqseutl +libqsesed_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn +libqsesed_la_LIBADD = -lqsecmn @ENABLE_CXX_TRUE@libqsesed___la_SOURCES = Sed.cpp StdSed.cpp -@ENABLE_CXX_TRUE@libqsesed___la_LDFLAGS = -L. -L../cmn -L../utl -version-info 1:0:0 -no-undefined -@ENABLE_CXX_TRUE@libqsesed___la_LIBADD = -lqsesed -lqsecmn -lqseutl +@ENABLE_CXX_TRUE@libqsesed___la_LDFLAGS = -L. -L../cmn -version-info 1:0:0 -no-undefined +@ENABLE_CXX_TRUE@libqsesed___la_LIBADD = -lqsesed -lqsecmn all: all-am .SUFFIXES: diff --git a/qse/lib/utl/Makefile.am b/qse/lib/utl/Makefile.am index d6640edc..e0394bb1 100644 --- a/qse/lib/utl/Makefile.am +++ b/qse/lib/utl/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(top_builddir)/include lib_LTLIBRARIES = libqseutl.la libqseutl_la_SOURCES = \ - assert.c http.c main.c stdio.c \ + http.c \ tgp.c \ tgp.h libqseutl_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn diff --git a/qse/lib/utl/Makefile.in b/qse/lib/utl/Makefile.in index 0bc138b9..8753c158 100644 --- a/qse/lib/utl/Makefile.in +++ b/qse/lib/utl/Makefile.in @@ -51,7 +51,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libqseutl_la_DEPENDENCIES = -am_libqseutl_la_OBJECTS = assert.lo http.lo main.lo stdio.lo tgp.lo +am_libqseutl_la_OBJECTS = http.lo tgp.lo libqseutl_la_OBJECTS = $(am_libqseutl_la_OBJECTS) libqseutl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -208,7 +208,7 @@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_builddir)/include lib_LTLIBRARIES = libqseutl.la libqseutl_la_SOURCES = \ - assert.c http.c main.c stdio.c \ + http.c \ tgp.c \ tgp.h @@ -283,10 +283,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tgp.Plo@am__quote@ .c.o: diff --git a/qse/lib/utl/assert.c b/qse/lib/utl/assert.c deleted file mode 100644 index 615314bd..00000000 --- a/qse/lib/utl/assert.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * $Id: assert.c 223 2008-06-26 06:44:41Z baconevi $ - */ - -#include -#include - -#ifndef NDEBUG - -#include -#include - -void qse_assert_failed ( - const qse_char_t* expr, const qse_char_t* desc, - const qse_char_t* file, qse_size_t line) -{ - qse_fprintf (QSE_STDERR, QSE_T("=[ASSERTION FAILURE]============================================================")); - qse_fprintf (QSE_STDERR, QSE_T("FILE %s LINE %lu: %s\n"), - file, (unsigned long)line, expr); - - if (desc != QSE_NULL) - { - qse_fprintf (QSE_STDERR, QSE_T("DESCRIPTION: %s\n"), - file, (unsigned long)line, expr, desc); - } - qse_fprintf (QSE_STDERR, QSE_T("================================================================================")); - - abort (); -} - -#endif - diff --git a/qse/test/Makefile.am b/qse/test/Makefile.am index d3db3ed8..c25f2f69 100644 --- a/qse/test/Makefile.am +++ b/qse/test/Makefile.am @@ -1 +1 @@ -SUBDIRS = cmn utl sed awk +SUBDIRS = cmn sed awk utl diff --git a/qse/test/Makefile.in b/qse/test/Makefile.in index 63f73238..c6da1854 100644 --- a/qse/test/Makefile.in +++ b/qse/test/Makefile.in @@ -187,7 +187,7 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = cmn utl sed awk +SUBDIRS = cmn sed awk utl all: all-recursive .SUFFIXES: diff --git a/qse/test/awk/Makefile.am b/qse/test/awk/Makefile.am index 26feb39f..0fad3594 100644 --- a/qse/test/awk/Makefile.am +++ b/qse/test/awk/Makefile.am @@ -2,8 +2,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = awk01 awk02 awk03 awk04 -LDFLAGS = -L../../lib/cmn -L../../lib/utl -L../../lib/awk -LDADD = -lqseawk -lqseutl -lqsecmn $(LIBM) +LDFLAGS = -L../../lib/cmn -L../../lib/awk +LDADD = -lqseawk -lqsecmn $(LIBM) awk01_SOURCES = awk01.c awk02_SOURCES = awk02.c diff --git a/qse/test/awk/Makefile.in b/qse/test/awk/Makefile.in index 02eee00e..cb3973a1 100644 --- a/qse/test/awk/Makefile.in +++ b/qse/test/awk/Makefile.in @@ -121,7 +121,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ -LDFLAGS = -L../../lib/cmn -L../../lib/utl -L../../lib/awk +LDFLAGS = -L../../lib/cmn -L../../lib/awk LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -215,7 +215,7 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/include -LDADD = -lqseawk -lqseutl -lqsecmn $(LIBM) +LDADD = -lqseawk -lqsecmn $(LIBM) awk01_SOURCES = awk01.c awk02_SOURCES = awk02.c awk03_SOURCES = awk03.c diff --git a/qse/test/awk/awk01.c b/qse/test/awk/awk01.c index ef8794f3..f72d2899 100644 --- a/qse/test/awk/awk01.c +++ b/qse/test/awk/awk01.c @@ -1,5 +1,5 @@ /* - * $Id: awk01.c 151 2009-05-21 06:50:02Z hyunghwan.chung $ + * $Id: awk01.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -18,7 +18,7 @@ #include #include -#include +#include const qse_char_t* src = QSE_T( "BEGIN {" diff --git a/qse/test/awk/awk02.c b/qse/test/awk/awk02.c index da8f1f1c..61bb3003 100644 --- a/qse/test/awk/awk02.c +++ b/qse/test/awk/awk02.c @@ -1,5 +1,5 @@ /* - * $Id: awk02.c 151 2009-05-21 06:50:02Z hyunghwan.chung $ + * $Id: awk02.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -19,7 +19,7 @@ #include #include #include -#include +#include static const qse_char_t* src = QSE_T( "BEGIN {" diff --git a/qse/test/awk/awk03.c b/qse/test/awk/awk03.c index d541cbcb..46adfbf4 100644 --- a/qse/test/awk/awk03.c +++ b/qse/test/awk/awk03.c @@ -1,5 +1,5 @@ /* - * $Id: awk03.c 151 2009-05-21 06:50:02Z hyunghwan.chung $ + * $Id: awk03.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -18,7 +18,7 @@ #include #include -#include +#include static const qse_char_t* src = QSE_T( "function init() { a = 20; return a; }" diff --git a/qse/test/awk/awk04.c b/qse/test/awk/awk04.c index 4b0922e8..b108c42f 100644 --- a/qse/test/awk/awk04.c +++ b/qse/test/awk/awk04.c @@ -1,5 +1,5 @@ /* - * $Id: awk04.c 90 2009-03-01 09:58:19Z hyunghwan.chung $ + * $Id: awk04.c 182 2009-06-03 21:50:32Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -26,7 +26,7 @@ #include #include -#include +#include static const qse_char_t* src = QSE_T( "function pow(x,y) { return x ** y; }" diff --git a/qse/test/cmn/Makefile.am b/qse/test/cmn/Makefile.am index 26bad0ce..f42e1ed2 100644 --- a/qse/test/cmn/Makefile.am +++ b/qse/test/cmn/Makefile.am @@ -2,8 +2,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = chr str sll map lda fio pio sio time -LDFLAGS = -L../../lib/cmn -L../../lib/utl -LDADD = -lqseutl -lqsecmn +LDFLAGS = -L../../lib/cmn +LDADD = -lqsecmn chr_SOURCES = chr.c str_SOURCES = str.c diff --git a/qse/test/cmn/Makefile.in b/qse/test/cmn/Makefile.in index 943df53a..0d53c8a0 100644 --- a/qse/test/cmn/Makefile.in +++ b/qse/test/cmn/Makefile.in @@ -143,7 +143,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ -LDFLAGS = -L../../lib/cmn -L../../lib/utl +LDFLAGS = -L../../lib/cmn LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -237,7 +237,7 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/include -LDADD = -lqseutl -lqsecmn +LDADD = -lqsecmn chr_SOURCES = chr.c str_SOURCES = str.c sll_SOURCES = sll.c diff --git a/qse/test/cmn/chr.c b/qse/test/cmn/chr.c index e0498d84..9d9c09f4 100644 --- a/qse/test/cmn/chr.c +++ b/qse/test/cmn/chr.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/qse/test/cmn/fio.c b/qse/test/cmn/fio.c index 95e62a1f..ab0a79a7 100644 --- a/qse/test/cmn/fio.c +++ b/qse/test/cmn/fio.c @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/qse/test/cmn/lda.c b/qse/test/cmn/lda.c index d72b7023..2be89079 100644 --- a/qse/test/cmn/lda.c +++ b/qse/test/cmn/lda.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #define R(f) \ diff --git a/qse/test/cmn/map.c b/qse/test/cmn/map.c index 55cb9711..5e9e2d11 100644 --- a/qse/test/cmn/map.c +++ b/qse/test/cmn/map.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #define R(f) \ do { \ diff --git a/qse/test/cmn/pio.c b/qse/test/cmn/pio.c index d0f06921..78e2d701 100644 --- a/qse/test/cmn/pio.c +++ b/qse/test/cmn/pio.c @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/qse/test/cmn/sll.c b/qse/test/cmn/sll.c index ed6fb52c..674ad402 100644 --- a/qse/test/cmn/sll.c +++ b/qse/test/cmn/sll.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #define R(f) \ diff --git a/qse/test/cmn/str.c b/qse/test/cmn/str.c index d32459e2..c8ef34c4 100644 --- a/qse/test/cmn/str.c +++ b/qse/test/cmn/str.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/qse/test/cmn/time.c b/qse/test/cmn/time.c index 946d0f41..99c2152c 100644 --- a/qse/test/cmn/time.c +++ b/qse/test/cmn/time.c @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/qse/test/sed/Makefile.am b/qse/test/sed/Makefile.am index 4b31bdb4..b1cb66f9 100644 --- a/qse/test/sed/Makefile.am +++ b/qse/test/sed/Makefile.am @@ -2,8 +2,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = sed01 -LDFLAGS = -L../../lib/cmn -L../../lib/utl -L../../lib/sed -LDADD = -lqsesed -lqseutl -lqsecmn $(LIBM) +LDFLAGS = -L../../lib/cmn -L../../lib/sed +LDADD = -lqsesed -lqsecmn $(LIBM) sed01_SOURCES = sed01.c diff --git a/qse/test/sed/Makefile.in b/qse/test/sed/Makefile.in index 8f4eed8e..4d932092 100644 --- a/qse/test/sed/Makefile.in +++ b/qse/test/sed/Makefile.in @@ -127,7 +127,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ -LDFLAGS = -L../../lib/cmn -L../../lib/utl -L../../lib/sed +LDFLAGS = -L../../lib/cmn -L../../lib/sed LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -221,7 +221,7 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/include -LDADD = -lqsesed -lqseutl -lqsecmn $(LIBM) +LDADD = -lqsesed -lqsecmn $(LIBM) sed01_SOURCES = sed01.c @ENABLE_CXX_TRUE@sed02_SOURCES = sed02.cpp @ENABLE_CXX_TRUE@sed02_LDADD = -lqsesed++ $(LDADD) diff --git a/qse/test/sed/sed01.c b/qse/test/sed/sed01.c index 658eca3d..60039747 100644 --- a/qse/test/sed/sed01.c +++ b/qse/test/sed/sed01.c @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include #include #include diff --git a/qse/test/sed/sed02.cpp b/qse/test/sed/sed02.cpp index 58ced2fa..d4b458fd 100644 --- a/qse/test/sed/sed02.cpp +++ b/qse/test/sed/sed02.cpp @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include int sed_main (int argc, qse_char_t* argv[]) { diff --git a/qse/test/sed/sed03.cpp b/qse/test/sed/sed03.cpp index 5cdcbc5a..f7db17f1 100644 --- a/qse/test/sed/sed03.cpp +++ b/qse/test/sed/sed03.cpp @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include