diff --git a/qse/cmd/awk/awk.c b/qse/cmd/awk/awk.c index 9e4b703d..b2b8ac81 100644 --- a/qse/cmd/awk/awk.c +++ b/qse/cmd/awk/awk.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/qse/cmd/cut/cut.c b/qse/cmd/cut/cut.c index b7a2dca2..ea53fea6 100644 --- a/qse/cmd/cut/cut.c +++ b/qse/cmd/cut/cut.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/qse/cmd/sed/sed.c b/qse/cmd/sed/sed.c index cbb68e37..cbb0b8db 100644 --- a/qse/cmd/sed/sed.c +++ b/qse/cmd/sed/sed.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/qse/include/qse/cmn/Makefile.am b/qse/include/qse/cmn/Makefile.am index dfb1c27e..c009886e 100644 --- a/qse/include/qse/cmn/Makefile.am +++ b/qse/include/qse/cmn/Makefile.am @@ -13,9 +13,9 @@ pkginclude_HEADERS = \ main.h \ map.h \ mem.h \ - misc.h \ oht.h \ opt.h \ + path.h \ pio.h \ pma.h \ rbt.h \ diff --git a/qse/include/qse/cmn/Makefile.in b/qse/include/qse/cmn/Makefile.in index 0e8c7f95..a3fdc055 100644 --- a/qse/include/qse/cmn/Makefile.in +++ b/qse/include/qse/cmn/Makefile.in @@ -52,7 +52,7 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__pkginclude_HEADERS_DIST = alg.h chr.h dll.h env.h fio.h fma.h \ - gdl.h htb.h lda.h main.h map.h mem.h misc.h oht.h opt.h pio.h \ + gdl.h htb.h lda.h main.h map.h mem.h oht.h opt.h path.h pio.h \ pma.h rbt.h rex.h sio.h sll.h stdio.h str.h time.h tio.h tre.h \ xma.h Mmgr.hpp StdMmgr.hpp Mmged.hpp am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -224,7 +224,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkginclude_HEADERS = alg.h chr.h dll.h env.h fio.h fma.h gdl.h htb.h \ - lda.h main.h map.h mem.h misc.h oht.h opt.h pio.h pma.h rbt.h \ + lda.h main.h map.h mem.h oht.h opt.h path.h pio.h pma.h rbt.h \ rex.h sio.h sll.h stdio.h str.h time.h tio.h tre.h xma.h \ $(am__append_1) all: all-am diff --git a/qse/include/qse/cmn/misc.h b/qse/include/qse/cmn/path.h similarity index 55% rename from qse/include/qse/cmn/misc.h rename to qse/include/qse/cmn/path.h index 26bca8db..861d6348 100644 --- a/qse/include/qse/cmn/misc.h +++ b/qse/include/qse/cmn/path.h @@ -18,8 +18,12 @@ License along with QSE. If not, see . */ -#ifndef _QSE_CMN_MISC_H_ -#define _QSE_CMN_MISC_H_ +#ifndef _QSE_CMN_PATH_H_ +#define _QSE_CMN_PATH_H_ + +/** @file + * This file provides functions for simple path name manipulation. + */ #include #include @@ -42,6 +46,24 @@ const qse_wchar_t* qse_wcsbasename ( const qse_wchar_t* path ); +/* + * The qse_canonpath() function deletes unnecessary path segments + * from a path name 'path' and stores it to a memory buffer pointed + * to by 'canon'. It null-terminates the canonical path in 'canon' and + * returns the number of characters excluding the terminating null. + * The caller must ensure that it is large enough before calling this + * because this function does not check the size of the memory buffer. + * Since the canonical path cannot be larger than the original path, + * you can simply ensure this by providing a memory buffer as long as + * the number of characters and a terminating null in the original path. + * + * @return the number of characters in the resulting canonical path. + */ +qse_size_t qse_canonpath ( + const qse_char_t* path, + qse_char_t* canon +); + #ifdef __cplusplus } #endif diff --git a/qse/include/qse/sed/std.h b/qse/include/qse/sed/std.h index 90ed4883..6a722c7e 100644 --- a/qse/include/qse/sed/std.h +++ b/qse/include/qse/sed/std.h @@ -111,6 +111,26 @@ int qse_sed_compstd ( qse_size_t* count /**< number of input scripts opened */ ); +/** + * The qse_sed_compstdfile() function compiles a sed script from + * a single file @a infile. + * @return 0 on success, -1 on failure + */ +int qse_sed_compstdfile ( + qse_sed_t* sed, + const qse_char_t* infile +); + +/** + * The qse_sed_compstdmem() function compiles a sed script stored + * in a null-terminated string pointed to by @a str. + * @return 0 on success, -1 on failure + */ +int qse_sed_compstdmem ( + qse_sed_t* sed, + const qse_char_t* str +); + /** * The qse_sed_execstd() function executes a compiled script * over input streams @a in and an output stream @a out. diff --git a/qse/lib/awk/StdAwk.cpp b/qse/lib/awk/StdAwk.cpp index 13a28ab9..685cdea8 100644 --- a/qse/lib/awk/StdAwk.cpp +++ b/qse/lib/awk/StdAwk.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "awk.h" diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index 7ce80ffb..7e96aba3 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include /* TODO: remove dependency on qse_vsprintf */ #include "../cmn/mem.h" diff --git a/qse/lib/cmn/Makefile.am b/qse/lib/cmn/Makefile.am index 33eb8900..ed7cb58c 100644 --- a/qse/lib/cmn/Makefile.am +++ b/qse/lib/cmn/Makefile.am @@ -25,11 +25,12 @@ libqsecmn_la_SOURCES = \ main.c \ mem.c \ mem.h \ - misc.c \ oht.c \ opt.c \ - pma.c \ + path-basename.c \ + path-canon.c \ pio.c \ + pma.c \ rbt.c \ rex.c \ sio.c \ diff --git a/qse/lib/cmn/Makefile.in b/qse/lib/cmn/Makefile.in index a394ba91..6c33992d 100644 --- a/qse/lib/cmn/Makefile.in +++ b/qse/lib/cmn/Makefile.in @@ -75,17 +75,17 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libqsecmn_la_DEPENDENCIES = am_libqsecmn_la_OBJECTS = alg-search.lo alg-sort.lo assert.lo chr.lo \ chr-cnv.lo dll.lo env.lo gdl.lo htb.lo lda.lo fio.lo fma.lo \ - main.lo mem.lo misc.lo oht.lo opt.lo pma.lo pio.lo rbt.lo \ - rex.lo sio.lo sll.lo str-beg.lo str-cat.lo str-chr.lo \ - str-cnv.lo str-cmp.lo str-cpy.lo str-del.lo str-dup.lo \ - str-dynm.lo str-dynw.lo str-end.lo str-excl.lo str-fcpy.lo \ - str-fnmat.lo str-incl.lo str-len.lo str-pac.lo str-pbrk.lo \ - str-put.lo str-rev.lo str-rot.lo str-set.lo str-spl.lo \ - str-spn.lo str-str.lo str-subst.lo str-tok.lo str-trm.lo \ - str-word.lo time.lo tio.lo tio-get.lo tio-put.lo tre.lo \ - tre-ast.lo tre-compile.lo tre-match-backtrack.lo \ - tre-match-parallel.lo tre-parse.lo tre-stack.lo stdio.lo \ - xma.lo + main.lo mem.lo oht.lo opt.lo path-basename.lo path-canon.lo \ + pio.lo pma.lo rbt.lo rex.lo sio.lo sll.lo str-beg.lo \ + str-cat.lo str-chr.lo str-cnv.lo str-cmp.lo str-cpy.lo \ + str-del.lo str-dup.lo str-dynm.lo str-dynw.lo str-end.lo \ + str-excl.lo str-fcpy.lo str-fnmat.lo str-incl.lo str-len.lo \ + str-pac.lo str-pbrk.lo str-put.lo str-rev.lo str-rot.lo \ + str-set.lo str-spl.lo str-spn.lo str-str.lo str-subst.lo \ + str-tok.lo str-trm.lo str-word.lo time.lo tio.lo tio-get.lo \ + tio-put.lo tre.lo tre-ast.lo tre-compile.lo \ + tre-match-backtrack.lo tre-match-parallel.lo tre-parse.lo \ + tre-stack.lo stdio.lo xma.lo libqsecmn_la_OBJECTS = $(am_libqsecmn_la_OBJECTS) libqsecmn_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -291,11 +291,12 @@ libqsecmn_la_SOURCES = \ main.c \ mem.c \ mem.h \ - misc.c \ oht.c \ opt.c \ - pma.c \ + path-basename.c \ + path-canon.c \ pio.c \ + pma.c \ rbt.c \ rex.c \ sio.c \ @@ -448,9 +449,10 @@ distclean-compile: @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)/mem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oht.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path-basename.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path-canon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pma.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rbt.Plo@am__quote@ diff --git a/qse/lib/cmn/misc.c b/qse/lib/cmn/path-basename.c similarity index 98% rename from qse/lib/cmn/misc.c rename to qse/lib/cmn/path-basename.c index 3ab99a14..e2dcfe1e 100644 --- a/qse/lib/cmn/misc.c +++ b/qse/lib/cmn/path-basename.c @@ -18,7 +18,7 @@ License along with QSE. If not, see . */ -#include +#include const qse_mchar_t* qse_mbsbasename (const qse_mchar_t* path) diff --git a/qse/lib/fs/path.c b/qse/lib/cmn/path-canon.c similarity index 89% rename from qse/lib/fs/path.c rename to qse/lib/cmn/path-canon.c index b401bb25..69320aa7 100644 --- a/qse/lib/fs/path.c +++ b/qse/lib/cmn/path-canon.c @@ -18,7 +18,7 @@ License along with QSE. If not, see . */ -#include +#include #if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) # define ISSEP(c) ((c) == QSE_T('/') || (c) == QSE_T('\\')) @@ -59,18 +59,23 @@ qse_size_t qse_canonpath (const qse_char_t* path, qse_char_t* canon) has_root = 1; #if defined(_WIN32) - /* handle UNC path */ + /* handle UNC path for Windows */ if (ISSEP(*ptr)) { *dst++ = *ptr++; - /* if it starts with \\, process host name */ - while (!ISSEPNIL(*ptr)) *dst++ = *ptr++; - - /* \ following the host name. note that - * \\\ is treated as if the host name is empty. */ - - if (ISSEP(*ptr)) *dst++ = *ptr++; + if (ISSEPNIL(*ptr)) + { + /* if there is another separator after \\, + * it's not an UNC path. */ + dst--; + } + else + { + /* if it starts with \\, process host name */ + do { *dst++ = *ptr++; } while (!ISSEPNIL(*ptr)); + if (ISSEP(*ptr)) *dst++ = *ptr++; + } } #endif } @@ -183,8 +188,13 @@ qse_size_t qse_canonpath (const qse_char_t* path, qse_char_t* canon) else { normal: - while (seg <= ptr) *dst++ = *seg++; - if (ISSEP(*ptr)) ptr++; + while (seg < ptr) *dst++ = *seg++; + if (ISSEP(*ptr)) + { + /* this segment ended with a separator */ + *dst++ = *seg++; /* copy the separator */ + ptr++; /* move forward the pointer */ + } } } while (1); diff --git a/qse/lib/fs/Makefile.am b/qse/lib/fs/Makefile.am index ec21124f..94972bc0 100644 --- a/qse/lib/fs/Makefile.am +++ b/qse/lib/fs/Makefile.am @@ -7,8 +7,7 @@ AM_CPPFLAGS = \ lib_LTLIBRARIES = libqsefs.la libqsefs_la_SOURCES = \ - dir.c \ - path.c + dir.c libqsefs_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn -L$(libdir) libqsefs_la_LIBADD = -lqsecmn diff --git a/qse/lib/fs/Makefile.in b/qse/lib/fs/Makefile.in index b2f204cc..4d5ac414 100644 --- a/qse/lib/fs/Makefile.in +++ b/qse/lib/fs/Makefile.in @@ -72,7 +72,7 @@ am__base_list = \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libqsefs_la_DEPENDENCIES = -am_libqsefs_la_OBJECTS = dir.lo path.lo +am_libqsefs_la_OBJECTS = dir.lo libqsefs_la_OBJECTS = $(am_libqsefs_la_OBJECTS) libqsefs_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -244,8 +244,7 @@ AM_CPPFLAGS = \ lib_LTLIBRARIES = libqsefs.la libqsefs_la_SOURCES = \ - dir.c \ - path.c + dir.c libqsefs_la_LDFLAGS = -version-info 1:0:0 -no-undefined -L../cmn -L$(libdir) libqsefs_la_LIBADD = -lqsecmn @@ -324,7 +323,6 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/qse/lib/sed/std.c b/qse/lib/sed/std.c index d437cf04..781c551a 100644 --- a/qse/lib/sed/std.c +++ b/qse/lib/sed/std.c @@ -756,6 +756,29 @@ int qse_sed_execstd ( return n; } +int qse_sed_compstdfile (qse_sed_t* sed, const qse_char_t* file) +{ + qse_sed_iostd_t in[2]; + + in[0].type = QSE_SED_IOSTD_FILE; + in[0].u.file = file; + in[1].type = QSE_SED_IOSTD_NULL; + + return qse_sed_compstd (sed, in, QSE_NULL); +} + +int qse_sed_compstdmem (qse_sed_t* sed, const qse_char_t* script) +{ + qse_sed_iostd_t in[2]; + + in[0].type = QSE_SED_IOSTD_MEM; + in[0].u.mem.ptr = script; + in[0].u.mem.len = qse_strlen(script); + in[1].type = QSE_SED_IOSTD_NULL; + + return qse_sed_compstd (sed, in, QSE_NULL); +} + int qse_sed_execstdfile ( qse_sed_t* sed, const qse_char_t* infile, const qse_char_t* outfile) { diff --git a/qse/samples/cmn/Makefile.am b/qse/samples/cmn/Makefile.am index 88ec407c..1f33d170 100644 --- a/qse/samples/cmn/Makefile.am +++ b/qse/samples/cmn/Makefile.am @@ -6,7 +6,7 @@ AM_CPPFLAGS = \ -I$(includedir) -bin_PROGRAMS = xma fma pma chr str sll dll lda oht htb rbt fio pio sio time main main2 rex01 env tre01 +bin_PROGRAMS = xma fma pma chr str sll dll lda oht htb rbt fio pio sio time main main2 rex01 env path01 tre01 LDFLAGS = -L../../lib/cmn LDADD = -lqsecmn @@ -30,6 +30,7 @@ main_SOURCES = main.c main2_SOURCES = main2.c rex01_SOURCES = rex01.c env_SOURCES = env.c +path01_SOURCES = path01.c tre01_SOURCES = tre01.c if ENABLE_CXX diff --git a/qse/samples/cmn/Makefile.in b/qse/samples/cmn/Makefile.in index cca5820f..92fdf77a 100644 --- a/qse/samples/cmn/Makefile.in +++ b/qse/samples/cmn/Makefile.in @@ -38,7 +38,8 @@ bin_PROGRAMS = xma$(EXEEXT) fma$(EXEEXT) pma$(EXEEXT) chr$(EXEEXT) \ str$(EXEEXT) sll$(EXEEXT) dll$(EXEEXT) lda$(EXEEXT) \ oht$(EXEEXT) htb$(EXEEXT) rbt$(EXEEXT) fio$(EXEEXT) \ pio$(EXEEXT) sio$(EXEEXT) time$(EXEEXT) main$(EXEEXT) \ - main2$(EXEEXT) rex01$(EXEEXT) env$(EXEEXT) tre01$(EXEEXT) + main2$(EXEEXT) rex01$(EXEEXT) env$(EXEEXT) path01$(EXEEXT) \ + tre01$(EXEEXT) subdir = samples/cmn DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -95,6 +96,10 @@ am_oht_OBJECTS = oht.$(OBJEXT) oht_OBJECTS = $(am_oht_OBJECTS) oht_LDADD = $(LDADD) oht_DEPENDENCIES = +am_path01_OBJECTS = path01.$(OBJEXT) +path01_OBJECTS = $(am_path01_OBJECTS) +path01_LDADD = $(LDADD) +path01_DEPENDENCIES = am_pio_OBJECTS = pio.$(OBJEXT) pio_OBJECTS = $(am_pio_OBJECTS) pio_LDADD = $(LDADD) @@ -150,15 +155,16 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(chr_SOURCES) $(dll_SOURCES) $(env_SOURCES) $(fio_SOURCES) \ $(fma_SOURCES) $(htb_SOURCES) $(lda_SOURCES) $(main_SOURCES) \ - $(main2_SOURCES) $(oht_SOURCES) $(pio_SOURCES) $(pma_SOURCES) \ - $(rbt_SOURCES) $(rex01_SOURCES) $(sio_SOURCES) $(sll_SOURCES) \ - $(str_SOURCES) $(time_SOURCES) $(tre01_SOURCES) $(xma_SOURCES) + $(main2_SOURCES) $(oht_SOURCES) $(path01_SOURCES) \ + $(pio_SOURCES) $(pma_SOURCES) $(rbt_SOURCES) $(rex01_SOURCES) \ + $(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) $(time_SOURCES) \ + $(tre01_SOURCES) $(xma_SOURCES) DIST_SOURCES = $(chr_SOURCES) $(dll_SOURCES) $(env_SOURCES) \ $(fio_SOURCES) $(fma_SOURCES) $(htb_SOURCES) $(lda_SOURCES) \ - $(main_SOURCES) $(main2_SOURCES) $(oht_SOURCES) $(pio_SOURCES) \ - $(pma_SOURCES) $(rbt_SOURCES) $(rex01_SOURCES) $(sio_SOURCES) \ - $(sll_SOURCES) $(str_SOURCES) $(time_SOURCES) $(tre01_SOURCES) \ - $(xma_SOURCES) + $(main_SOURCES) $(main2_SOURCES) $(oht_SOURCES) \ + $(path01_SOURCES) $(pio_SOURCES) $(pma_SOURCES) $(rbt_SOURCES) \ + $(rex01_SOURCES) $(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) \ + $(time_SOURCES) $(tre01_SOURCES) $(xma_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -329,6 +335,7 @@ main_SOURCES = main.c main2_SOURCES = main2.c rex01_SOURCES = rex01.c env_SOURCES = env.c +path01_SOURCES = path01.c tre01_SOURCES = tre01.c all: all-am @@ -437,6 +444,9 @@ main2$(EXEEXT): $(main2_OBJECTS) $(main2_DEPENDENCIES) oht$(EXEEXT): $(oht_OBJECTS) $(oht_DEPENDENCIES) @rm -f oht$(EXEEXT) $(LINK) $(oht_OBJECTS) $(oht_LDADD) $(LIBS) +path01$(EXEEXT): $(path01_OBJECTS) $(path01_DEPENDENCIES) + @rm -f path01$(EXEEXT) + $(LINK) $(path01_OBJECTS) $(path01_LDADD) $(LIBS) pio$(EXEEXT): $(pio_OBJECTS) $(pio_DEPENDENCIES) @rm -f pio$(EXEEXT) $(LINK) $(pio_OBJECTS) $(pio_LDADD) $(LIBS) @@ -484,6 +494,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oht.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pma.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rbt.Po@am__quote@ diff --git a/qse/samples/fs/path01.c b/qse/samples/cmn/path01.c similarity index 96% rename from qse/samples/fs/path01.c rename to qse/samples/cmn/path01.c index f9f522a6..60cd1904 100644 --- a/qse/samples/fs/path01.c +++ b/qse/samples/cmn/path01.c @@ -1,5 +1,5 @@ -#include +#include #include #include #include diff --git a/qse/samples/cmn/rex01.c b/qse/samples/cmn/rex01.c index f6457b34..4f2764b2 100644 --- a/qse/samples/cmn/rex01.c +++ b/qse/samples/cmn/rex01.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include static int rex_main (int argc, qse_char_t* argv[]) diff --git a/qse/samples/cmn/tre01.c b/qse/samples/cmn/tre01.c index e93ad29f..8777bca3 100644 --- a/qse/samples/cmn/tre01.c +++ b/qse/samples/cmn/tre01.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include static int test_main (int argc, qse_char_t* argv[], qse_char_t* envp[]) diff --git a/qse/samples/fs/Makefile.am b/qse/samples/fs/Makefile.am index 6886abdc..dd17df47 100644 --- a/qse/samples/fs/Makefile.am +++ b/qse/samples/fs/Makefile.am @@ -6,12 +6,10 @@ AM_CPPFLAGS = \ -I$(includedir) bin_PROGRAMS = \ - dir01 \ - path01 + dir01 LDFLAGS += -L../../lib/cmn -L../../lib/fs LDADD = -lqsefs -lqsecmn dir01_SOURCES = dir01.c -path01_SOURCES = path01.c diff --git a/qse/samples/fs/Makefile.in b/qse/samples/fs/Makefile.in index 34d6643b..4b3b26a8 100644 --- a/qse/samples/fs/Makefile.in +++ b/qse/samples/fs/Makefile.in @@ -34,7 +34,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = dir01$(EXEEXT) path01$(EXEEXT) +bin_PROGRAMS = dir01$(EXEEXT) subdir = samples/fs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -55,10 +55,6 @@ am_dir01_OBJECTS = dir01.$(OBJEXT) dir01_OBJECTS = $(am_dir01_OBJECTS) dir01_LDADD = $(LDADD) dir01_DEPENDENCIES = -am_path01_OBJECTS = path01.$(OBJEXT) -path01_OBJECTS = $(am_path01_OBJECTS) -path01_LDADD = $(LDADD) -path01_DEPENDENCIES = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/ac/depcomp am__depfiles_maybe = depfiles @@ -72,8 +68,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(dir01_SOURCES) $(path01_SOURCES) -DIST_SOURCES = $(dir01_SOURCES) $(path01_SOURCES) +SOURCES = $(dir01_SOURCES) +DIST_SOURCES = $(dir01_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -226,7 +222,6 @@ AM_CPPFLAGS = \ LDADD = -lqsefs -lqsecmn dir01_SOURCES = dir01.c -path01_SOURCES = path01.c all: all-am .SUFFIXES: @@ -307,9 +302,6 @@ clean-binPROGRAMS: dir01$(EXEEXT): $(dir01_OBJECTS) $(dir01_DEPENDENCIES) @rm -f dir01$(EXEEXT) $(LINK) $(dir01_OBJECTS) $(dir01_LDADD) $(LIBS) -path01$(EXEEXT): $(path01_OBJECTS) $(path01_DEPENDENCIES) - @rm -f path01$(EXEEXT) - $(LINK) $(path01_OBJECTS) $(path01_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -318,7 +310,6 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir01.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path01.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/qse/samples/sed/sed01.c b/qse/samples/sed/sed01.c index 0aaf1286..982f5191 100644 --- a/qse/samples/sed/sed01.c +++ b/qse/samples/sed/sed01.c @@ -42,7 +42,7 @@ int sed_main (int argc, qse_char_t* argv[]) goto oops; } - if (qse_sed_compstd (sed, argv[1]) <= -1) + if (qse_sed_compstdmem (sed, argv[1]) <= -1) { qse_fprintf (QSE_STDERR, QSE_T("ERROR: %s\n"), qse_sed_geterrmsg(sed)); goto oops;