Skip to content

Commit

Permalink
API,DIST: Rename Oniguruma to Onigmo (Issue #66)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-takata committed Oct 10, 2016
1 parent 94e4b33 commit d35c78a
Show file tree
Hide file tree
Showing 33 changed files with 137 additions and 138 deletions.
38 changes: 19 additions & 19 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Makefile.am for Onigmo
encdir = $(top_srcdir)/enc
sampledir = $(top_srcdir)/sample
libname = libonig.la
libname = libonigmo.la

ACLOCAL_AMFLAGS = -I m4
#AM_CFLAGS = -DNOT_RUBY
Expand All @@ -10,10 +10,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir)

SUBDIRS = . sample

include_HEADERS = oniguruma.h oniggnu.h onigposix.h
include_HEADERS = onigmo.h onigmognu.h onigmoposix.h
lib_LTLIBRARIES = $(libname)

libonig_la_SOURCES = regint.h regparse.h regenc.h st.h \
libonigmo_la_SOURCES = regint.h regparse.h regenc.h st.h \
regerror.c regparse.c regext.c regcomp.c regexec.c reggnu.c \
regenc.c regsyntax.c regtrav.c regversion.c st.c \
regposix.c regposerr.c \
Expand All @@ -34,26 +34,26 @@ libonig_la_SOURCES = regint.h regparse.h regenc.h st.h \
$(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \
$(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/windows_1251.c

libonig_la_LDFLAGS = -version-info $(LTVERSION) -no-undefined
libonigmo_la_LDFLAGS = -version-info $(LTVERSION) -no-undefined

EXTRA_DIST = .gitignore oniguruma.pc.in HISTORY README.ja index.html \
EXTRA_DIST = .gitignore onigmo.pc.in HISTORY README.ja index.html \
index_ja.html doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \
doc/UnicodeProps.txt \
tool/.gitignore tool/case-folding.rb tool/convert-name2ctype.sh \
tool/convert-jis-props.sh \
tool/enc-unicode.rb tool/download-ucd.sh tool/update-doc.py \
win32/Makefile win32/Makefile.mingw win32/config.h win32/testc.c \
win32/makedef.py win32/onig.rc \
win32/makedef.py win32/onigmo.rc \
$(encdir)/koi8.c $(encdir)/mktable.c \
$(sampledir)/encode.c $(sampledir)/listcap.c $(sampledir)/names.c \
$(sampledir)/posix.c $(sampledir)/simple.c $(sampledir)/sql.c \
$(sampledir)/syntax.c $(sampledir)/crnl.c \
test.rb testconv.rb testconvu.rb \
onig.py testpy.py .editorconfig
onigmo.py testpy.py .editorconfig

bin_SCRIPTS = onig-config
bin_SCRIPTS = onigmo-config

onig-config: onig-config.in
onigmo-config: onigmo-config.in

do_subst = sed \
-e 's,[@]datadir[@],$(datadir),g' \
Expand All @@ -64,16 +64,16 @@ do_subst = sed \
-e 's,[@]libdir[@],$(libdir),g' \
-e 's,[@]includedir[@],$(includedir),g'

oniguruma.pc: $(srcdir)/oniguruma.pc.in Makefile
$(do_subst) < $(srcdir)/oniguruma.pc.in > $(@)
onigmo.pc: $(srcdir)/onigmo.pc.in Makefile
$(do_subst) < $(srcdir)/onigmo.pc.in > $(@)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = oniguruma.pc
pkgconfig_DATA = onigmo.pc

dll:
$(CXX) -shared -Wl,--output-def,libonig.def -o libonig.dll *.o \
$(CXX) -shared -Wl,--output-def,libonigmo.def -o libonigmo.dll *.o \
$(LIBS)
strip libonig.dll
strip libonigmo.dll

# Ruby TEST
rtest:
Expand All @@ -90,22 +90,22 @@ TESTS = testc testp testcu
check_PROGRAMS = testc testp testcu

atest: testc testp testcu
@echo "[Oniguruma API, ASCII/EUC-JP check]"
@echo "[Onigmo API, ASCII/EUC-JP check]"
@$(top_builddir)/testc | grep RESULT
@echo "[POSIX API, ASCII/EUC-JP check]"
@$(top_builddir)/testp | grep RESULT
@echo "[Oniguruma API, UTF-16 check]"
@echo "[Onigmo API, UTF-16 check]"
@$(top_builddir)/testcu | grep RESULT

testc_SOURCES = testc.c
testc_LDADD = libonig.la
testc_LDADD = libonigmo.la

testp_SOURCES = testc.c
testp_LDADD = libonig.la
testp_LDADD = libonigmo.la
testp_CFLAGS = -DPOSIX_TEST

testcu_SOURCES = testu.c
testcu_LDADD = libonig.la
testcu_LDADD = libonigmo.la


testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb
Expand Down
4 changes: 2 additions & 2 deletions configure.in → configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(onig, 5.15.0)
AC_INIT(onigmo, 6.0.0)

AC_CONFIG_MACRO_DIR([m4])

Expand Down Expand Up @@ -114,4 +114,4 @@ if test "${multithread}" = yes; then
fi


AC_OUTPUT([Makefile onig-config sample/Makefile], [chmod +x onig-config])
AC_OUTPUT([Makefile onigmo-config sample/Makefile], [chmod +x onigmo-config])
4 changes: 2 additions & 2 deletions doc/API
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Onigmo (Oniguruma-mod) API Version 5.14.0 2014/07/01
Onigmo (Oniguruma-mod) API Version 6.0.0 2016/10/10

#include <oniguruma.h>
#include <onigmo.h>


# int onig_init(void)
Expand Down
4 changes: 2 additions & 2 deletions doc/API.ja
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Onigmo インターフェース Version 5.14.0 2014/07/01
Onigmo インターフェース Version 6.0.0 2016/10/10

#include <oniguruma.h>
#include <onigmo.h>


# int onig_init(void)
Expand Down
10 changes: 5 additions & 5 deletions onig-config.in → onigmo-config.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh
# Copyright (C) 2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp)

ONIG_VERSION=@PACKAGE_VERSION@
ONIGMO_VERSION=@PACKAGE_VERSION@

show_usage()
{
cat <<EOF
Usage: onig-config [OPTION]
Usage: onigmo-config [OPTION]
Values for OPTION are:
--prefix[=DIR] change prefix to DIR
Expand All @@ -15,7 +15,7 @@ Usage: onig-config [OPTION]
--exec-prefix print exec_prefix
--cflags print C compiler flags
--libs print library information
--version print oniguruma version
--version print onigmo version
--help print this help
EOF
Expand Down Expand Up @@ -63,10 +63,10 @@ while test $# -gt 0; do
echo $show_includedir
;;
--libs)
echo -L@libdir@ -lonig
echo -L@libdir@ -lonigmo
;;
--version)
echo $ONIG_VERSION
echo $ONIGMO_VERSION
;;
*)
show_usage
Expand Down
13 changes: 6 additions & 7 deletions oniguruma.h → onigmo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ONIGURUMA_H
#define ONIGURUMA_H
#ifndef ONIGMO_H
#define ONIGMO_H
/**********************************************************************
oniguruma.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
Expand Down Expand Up @@ -37,10 +37,9 @@ extern "C" {
#endif
#endif

#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 5
#define ONIGURUMA_VERSION_MINOR 15
#define ONIGURUMA_VERSION_TEENY 0
#define ONIGMO_VERSION_MAJOR 6
#define ONIGMO_VERSION_MINOR 0
#define ONIGMO_VERSION_TEENY 0

#ifdef __cplusplus
# ifndef HAVE_PROTOTYPES
Expand Down Expand Up @@ -960,4 +959,4 @@ RUBY_SYMBOL_EXPORT_END
}
#endif

#endif /* ONIGURUMA_H */
#endif /* ONIGMO_H */
4 changes: 2 additions & 2 deletions oniguruma.pc.in → onigmo.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@

Name: oniguruma
Name: onigmo
Description: Regular expression library
Version: @PACKAGE_VERSION@
Requires:
Libs: -L${libdir} -lonig
Libs: -L${libdir} -lonigmo
Cflags: -I${includedir}

8 changes: 4 additions & 4 deletions onig.py → onigmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This provides almost same API as the original C API, so the API is not
object oriented.
Onigmo DLL (onig.dll, libonig.so, etc.) must be placed in the
Onigmo DLL (onigmo.dll, libonigmo.so, etc.) must be placed in the
default search path. The default search path depends on the system.
"""

Expand Down Expand Up @@ -108,11 +108,11 @@ class OnigErrorInfo(ctypes.Structure):
# load the DLL or the shared library

if os.name in ("nt", "ce"):
_libname = "onig.dll"
_libname = "onigmo.dll"
elif sys.platform == "cygwin":
_libname = "libonig.dll"
_libname = "libonigmo.dll"
else:
_libname = "libonig.so"
_libname = "libonigmo.so"

libonig = ctypes.cdll.LoadLibrary(_libname)

Expand Down
10 changes: 5 additions & 5 deletions oniggnu.h → onigmognu.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ONIGGNU_H
#define ONIGGNU_H
#ifndef ONIGMOGNU_H
#define ONIGMOGNU_H
/**********************************************************************
oniggnu.h - Oniguruma (regular expression library)
onigmognu.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
Expand Down Expand Up @@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/

#include "oniguruma.h"
#include "onigmo.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -82,4 +82,4 @@ int re_alloc_pattern P_((struct re_pattern_buffer**)); /* added */
}
#endif

#endif /* ONIGGNU_H */
#endif /* ONIGMOGNU_H */
12 changes: 6 additions & 6 deletions onigposix.h → onigmoposix.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ONIGPOSIX_H
#define ONIGPOSIX_H
#ifndef ONIGMOPOSIX_H
#define ONIGMOPOSIX_H
/**********************************************************************
onigposix.h - Oniguruma (regular expression library)
onigmoposix.h - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
Expand Down Expand Up @@ -109,7 +109,7 @@ typedef struct {
#define ONIG_EXTERN extern
#endif

#ifndef ONIGURUMA_H
#ifndef ONIGMO_H
typedef unsigned int OnigOptionType;

/* syntax */
Expand Down Expand Up @@ -148,7 +148,7 @@ ONIG_EXTERN void onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from))
ONIG_EXTERN const char* onig_version P_((void));
ONIG_EXTERN const char* onig_copyright P_((void));

#endif /* ONIGURUMA_H */
#endif /* ONIGMO_H */


ONIG_EXTERN int regcomp P_((regex_t* reg, const char* pat, int options));
Expand All @@ -166,4 +166,4 @@ ONIG_EXTERN int reg_number_of_names P_((regex_t* reg));
}
#endif

#endif /* ONIGPOSIX_H */
#endif /* ONIGMOPOSIX_H */
12 changes: 6 additions & 6 deletions regenc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ONIGURUMA_REGENC_H
#define ONIGURUMA_REGENC_H
#ifndef ONIGMO_REGENC_H
#define ONIGMO_REGENC_H
/**********************************************************************
regenc.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
Expand Down Expand Up @@ -31,7 +31,7 @@
*/

#ifdef RUBY
#ifndef ONIGURUMA_REGINT_H
#ifndef ONIGMO_REGINT_H
#ifndef RUBY_EXTERN
#include "ruby/config.h"
#include "ruby/defines.h"
Expand All @@ -49,9 +49,9 @@
#endif

#ifdef RUBY
#include "ruby/oniguruma.h"
#include "ruby/onigmo.h"
#else
#include "oniguruma.h"
#include "onigmo.h"
#endif

RUBY_SYMBOL_EXPORT_BEGIN
Expand Down Expand Up @@ -245,4 +245,4 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);

RUBY_SYMBOL_EXPORT_END

#endif /* ONIGURUMA_REGENC_H */
#endif /* ONIGMO_REGENC_H */
6 changes: 3 additions & 3 deletions regint.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ONIGURUMA_REGINT_H
#define ONIGURUMA_REGINT_H
#ifndef ONIGMO_REGINT_H
#define ONIGMO_REGINT_H
/**********************************************************************
regint.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
Expand Down Expand Up @@ -1005,4 +1005,4 @@ extern size_t onig_region_memsize P_((const struct re_registers *regs));

RUBY_SYMBOL_EXPORT_END

#endif /* ONIGURUMA_REGINT_H */
#endif /* ONIGMO_REGINT_H */
6 changes: 3 additions & 3 deletions regparse.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ONIGURUMA_REGPARSE_H
#define ONIGURUMA_REGPARSE_H
#ifndef ONIGMO_REGPARSE_H
#define ONIGMO_REGPARSE_H
/**********************************************************************
regparse.h - Onigmo (Oniguruma-mod) (regular expression library)
**********************************************************************/
Expand Down Expand Up @@ -366,4 +366,4 @@ extern int onig_print_names(FILE*, regex_t*);

RUBY_SYMBOL_EXPORT_END

#endif /* ONIGURUMA_REGPARSE_H */
#endif /* ONIGMO_REGPARSE_H */
14 changes: 7 additions & 7 deletions regversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

#include "config.h"
#include "oniguruma.h"
#include "onigmo.h"
#include <stdio.h>

extern const char*
Expand All @@ -38,9 +38,9 @@ onig_version(void)
static char s[12];

sprintf(s, "%d.%d.%d",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
ONIGMO_VERSION_MAJOR,
ONIGMO_VERSION_MINOR,
ONIGMO_VERSION_TEENY);
return s;
}

Expand All @@ -51,8 +51,8 @@ onig_copyright(void)

sprintf(s, "Onigmo %d.%d.%d : Copyright (C) 2002-2009 K.Kosako, "
"2011-2014 K.Takata",
ONIGURUMA_VERSION_MAJOR,
ONIGURUMA_VERSION_MINOR,
ONIGURUMA_VERSION_TEENY);
ONIGMO_VERSION_MAJOR,
ONIGMO_VERSION_MINOR,
ONIGMO_VERSION_TEENY);
return s;
}
Loading

0 comments on commit d35c78a

Please sign in to comment.