32R2LJVVWLNUAUQRKVTLEJARATST7Y36ODIXATP25L33UOLCRMEAC Copyright © 2003-2014 Kepler Project.Permission is hereby granted, free of charge, to any personobtaining a copy of this software and associated documentationfiles (the "Software"), to deal in the Software withoutrestriction, including without limitation the rights to use, copy,modify, merge, publish, distribute, sublicense, and/or sell copiesof the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERSBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ANACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
# $Id: Makefile,v 1.36 2009/09/21 17:02:44 mascarenhas Exp $T= lfsCONFIG= ./configinclude $(CONFIG)SRCS= src/$T.cOBJS= src/$T.olib: src/lfs.sosrc/lfs.so: $(OBJS)$(CC) $(CFLAGS) $(LIB_OPTION) -o src/lfs.so $(OBJS)install:mkdir -p $(LUA_LIBDIR)cp src/lfs.so $(LUA_LIBDIR)clean:rm -f src/lfs.so $(OBJS)
# Installation directories# Default installation prefixPREFIX=/usr/local# System's libraries directory (where binary libraries are installed)LUA_LIBDIR= $(LUA_SRC_PATH)/lib# Lua includes directoryLUA_INC= $(LUA_INC_PATH)/# OS dependent#LIB_OPTION= -shared #for LinuxLIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS XOPENSSL_INC=/usr/local/opt/openssl/include/LIBNAME= $T.so.$V# Compilation directivesWARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedanticINCS= -I$(LUA_INC) -I$(OPENSSL_INC)CFLAGS= $(WARN) $(INCS)CC= gcc# $Id: config,v 1.21 2007/10/27 22:42:32 carregal Exp $
/*** LuaFileSystem** Copyright Kepler Project 2003 - 2016 (http://keplerproject.github.io/luafilesystem)**** File system manipulation library.** This library offers these functions:** lfs.attributes (filepath [, attributename | attributetable])** lfs.chdir (path)** lfs.currentdir ()** lfs.dir (path)** lfs.link (old, new[, symlink])** lfs.lock (fh, mode)** lfs.lock_dir (path)** lfs.mkdir (path)** lfs.rmdir (path)** lfs.setmode (filepath, mode)** lfs.symlinkattributes (filepath [, attributename])** lfs.touch (filepath [, atime [, mtime]])** lfs.unlock (fh)*/#ifndef LFS_DO_NOT_USE_LARGE_FILE#ifndef _WIN32#ifndef _AIX#define _FILE_OFFSET_BITS 64 /* Linux, Solaris and HP-UX */#else#define _LARGE_FILES 1 /* AIX */#endif#endif#endif#ifndef LFS_DO_NOT_USE_LARGE_FILE#define _LARGEFILE64_SOURCE#endif#include <errno.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <time.h>#include <sys/stat.h>#ifdef _WIN32#include <direct.h>#include <windows.h>#include <io.h>#include <sys/locking.h>#ifdef __BORLANDC__#include <utime.h>#else#include <sys/utime.h>#endif#include <fcntl.h>/* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */#define LFS_MAXPATHLEN MAX_PATH#else#include <unistd.h>#include <dirent.h>#include <fcntl.h>#include <sys/types.h>#include <utime.h>#include <sys/param.h> /* for MAXPATHLEN */#define LFS_MAXPATHLEN MAXPATHLEN#endif#include <lua.h>#include <lauxlib.h>#include <lualib.h>#include "lfs.h"#define LFS_VERSION "1.6.3"#define LFS_LIBNAME "lfs"#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */#ifndef luaL_optlong#define luaL_optlong luaL_optinteger#endif#endif#if LUA_VERSION_NUM < 502# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))#endif/* Define 'strerror' for systems that do not implement it */#ifdef NO_STRERROR#define strerror(_) "System unable to describe the error"#endif#define DIR_METATABLE "directory metatable"typedef struct dir_data {int closed;#ifdef _WIN32intptr_t hFile;char pattern[MAX_PATH+1];#elseDIR *dir;#endif} dir_data;#define LOCK_METATABLE "lock metatable"#ifdef _WIN32#ifdef __BORLANDC__#define lfs_setmode(file, m) (setmode(_fileno(file), m))#define STAT_STRUCT struct stati64#else#define lfs_setmode(file, m) (_setmode(_fileno(file), m))#define STAT_STRUCT struct _stati64#endif#define STAT_FUNC _stati64#define LSTAT_FUNC STAT_FUNC#else#define _O_TEXT 0#define _O_BINARY 0#define lfs_setmode(file, m) ((void)file, (void)m, 0)#define STAT_STRUCT struct stat#define STAT_FUNC stat#define LSTAT_FUNC lstat#endif/*** Utility functions*/static int pusherror(lua_State *L, const char *info){lua_pushnil(L);if (info==NULL)lua_pushstring(L, strerror(errno));elselua_pushfstring(L, "%s: %s", info, strerror(errno));lua_pushinteger(L, errno);return 3;}static int pushresult(lua_State *L, int i, const char *info){if (i==-1)return pusherror(L, info);lua_pushinteger(L, i);return 1;}/*** This function changes the working (current) directory*/static int change_dir (lua_State *L) {const char *path = luaL_checkstring(L, 1);if (chdir(path)) {lua_pushnil (L);lua_pushfstring (L,"Unable to change working directory to '%s'\n%s\n",path, chdir_error);return 2;} else {lua_pushboolean (L, 1);return 1;}}/*** This function returns the current directory** If unable to get the current directory, it returns nil** and a string describing the error*/static int get_dir (lua_State *L) {#ifdef NO_GETCWDlua_pushnil(L);lua_pushstring(L, "Function 'getcwd' not provided by system");return 2;#elsechar *path = NULL;/* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */size_t size = LFS_MAXPATHLEN; /* initial buffer size */int result;while (1) {path = realloc(path, size);if (!path) /* failed to allocate */return pusherror(L, "get_dir realloc() failed");if (getcwd(path, size) != NULL) {/* success, push the path to the Lua stack */lua_pushstring(L, path);result = 1;break;}if (errno != ERANGE) { /* unexpected error */result = pusherror(L, "get_dir getcwd() failed");break;}/* ERANGE = insufficient buffer capacity, double size and retry */size *= 2;}free(path);return result;#endif}/*** Check if the given element on the stack is a file and returns it.*/static FILE *check_file (lua_State *L, int idx, const char *funcname) {#if LUA_VERSION_NUM == 501FILE **fh = (FILE **)luaL_checkudata (L, idx, "FILE*");if (*fh == NULL) {luaL_error (L, "%s: closed file", funcname);return 0;} elsereturn *fh;#elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 503luaL_Stream *fh = (luaL_Stream *)luaL_checkudata (L, idx, "FILE*");if (fh->closef == 0 || fh->f == NULL) {luaL_error (L, "%s: closed file", funcname);return 0;} elsereturn fh->f;#else#error unsupported Lua version#endif}/****/static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long start, long len, const char *funcname) {int code;#ifdef _WIN32/* lkmode valid values are:LK_LOCK Locks the specified bytes. If the bytes cannot be locked, the program immediately tries again after 1 second. If, after 10 attempts, the bytes cannot be locked, the constant returns an error.LK_NBLCK Locks the specified bytes. If the bytes cannot be locked, the constant returns an error.LK_NBRLCK Same as _LK_NBLCK.LK_RLCK Same as _LK_LOCK.LK_UNLCK Unlocks the specified bytes, which must have been previously locked.Regions should be locked only briefly and should be unlocked before closing a file or exiting the program.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__locking.asp*/int lkmode;switch (*mode) {case 'r': lkmode = LK_NBLCK; break;case 'w': lkmode = LK_NBLCK; break;case 'u': lkmode = LK_UNLCK; break;default : return luaL_error (L, "%s: invalid mode", funcname);}if (!len) {fseek (fh, 0L, SEEK_END);len = ftell (fh);}fseek (fh, start, SEEK_SET);#ifdef __BORLANDC__code = locking (fileno(fh), lkmode, len);#elsecode = _locking (fileno(fh), lkmode, len);#endif#elsestruct flock f;switch (*mode) {case 'w': f.l_type = F_WRLCK; break;case 'r': f.l_type = F_RDLCK; break;case 'u': f.l_type = F_UNLCK; break;default : return luaL_error (L, "%s: invalid mode", funcname);}f.l_whence = SEEK_SET;f.l_start = (off_t)start;f.l_len = (off_t)len;code = fcntl (fileno(fh), F_SETLK, &f);#endifreturn (code != -1);}#ifdef _WIN32typedef struct lfs_Lock {HANDLE fd;} lfs_Lock;static int lfs_lock_dir(lua_State *L) {size_t pathl; HANDLE fd;lfs_Lock *lock;char *ln;const char *lockfile = "/lockfile.lfs";const char *path = luaL_checklstring(L, 1, &pathl);ln = (char*)malloc(pathl + strlen(lockfile) + 1);if(!ln) {lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;}strcpy(ln, path); strcat(ln, lockfile);if((fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_NEW,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL)) == INVALID_HANDLE_VALUE) {int en = GetLastError();free(ln); lua_pushnil(L);if(en == ERROR_FILE_EXISTS || en == ERROR_SHARING_VIOLATION)lua_pushstring(L, "File exists");elselua_pushstring(L, strerror(en));return 2;}free(ln);lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock));lock->fd = fd;luaL_getmetatable (L, LOCK_METATABLE);lua_setmetatable (L, -2);return 1;}static int lfs_unlock_dir(lua_State *L) {lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);if(lock->fd != INVALID_HANDLE_VALUE) {CloseHandle(lock->fd);lock->fd=INVALID_HANDLE_VALUE;}return 0;}#elsetypedef struct lfs_Lock {char *ln;} lfs_Lock;static int lfs_lock_dir(lua_State *L) {lfs_Lock *lock;size_t pathl;char *ln;const char *lockfile = "/lockfile.lfs";const char *path = luaL_checklstring(L, 1, &pathl);lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock));ln = (char*)malloc(pathl + strlen(lockfile) + 1);if(!ln) {lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;}strcpy(ln, path); strcat(ln, lockfile);if(symlink("lock", ln) == -1) {free(ln); lua_pushnil(L);lua_pushstring(L, strerror(errno)); return 2;}lock->ln = ln;luaL_getmetatable (L, LOCK_METATABLE);lua_setmetatable (L, -2);return 1;}static int lfs_unlock_dir(lua_State *L) {lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);if(lock->ln) {unlink(lock->ln);free(lock->ln);lock->ln = NULL;}return 0;}#endifstatic int lfs_g_setmode (lua_State *L, FILE *f, int arg) {static const int mode[] = {_O_BINARY, _O_TEXT};static const char *const modenames[] = {"binary", "text", NULL};int op = luaL_checkoption(L, arg, NULL, modenames);int res = lfs_setmode(f, mode[op]);if (res != -1) {int i;lua_pushboolean(L, 1);for (i = 0; modenames[i] != NULL; i++) {if (mode[i] == res) {lua_pushstring(L, modenames[i]);return 2;}}lua_pushnil(L);return 2;} else {return pusherror(L, NULL);}}static int lfs_f_setmode(lua_State *L) {return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2);}/*** Locks a file.** @param #1 File handle.** @param #2 String with lock mode ('w'rite, 'r'ead).** @param #3 Number with start position (optional).** @param #4 Number with length (optional).*/static int file_lock (lua_State *L) {FILE *fh = check_file (L, 1, "lock");const char *mode = luaL_checkstring (L, 2);const long start = (long) luaL_optinteger (L, 3, 0);long len = (long) luaL_optinteger (L, 4, 0);if (_file_lock (L, fh, mode, start, len, "lock")) {lua_pushboolean (L, 1);return 1;} else {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}}/*** Unlocks a file.** @param #1 File handle.** @param #2 Number with start position (optional).** @param #3 Number with length (optional).*/static int file_unlock (lua_State *L) {FILE *fh = check_file (L, 1, "unlock");const long start = (long) luaL_optinteger (L, 2, 0);long len = (long) luaL_optinteger (L, 3, 0);if (_file_lock (L, fh, "u", start, len, "unlock")) {lua_pushboolean (L, 1);return 1;} else {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}}/*** Creates a link.** @param #1 Object to link to.** @param #2 Name of link.** @param #3 True if link is symbolic (optional).*/static int make_link(lua_State *L){#ifndef _WIN32const char *oldpath = luaL_checkstring(L, 1);const char *newpath = luaL_checkstring(L, 2);return pushresult(L,(lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL);#elseerrno = ENOSYS; /* = "Function not implemented" */return pushresult(L, -1, "make_link is not supported on Windows");#endif}/*** Creates a directory.** @param #1 Directory path.*/static int make_dir (lua_State *L) {const char *path = luaL_checkstring (L, 1);int fail;#ifdef _WIN32fail = _mkdir (path);#elsefail = mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );#endifif (fail) {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}lua_pushboolean (L, 1);return 1;}/*** Removes a directory.** @param #1 Directory path.*/static int remove_dir (lua_State *L) {const char *path = luaL_checkstring (L, 1);int fail;fail = rmdir (path);if (fail) {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}lua_pushboolean (L, 1);return 1;}/*** Directory iterator*/static int dir_iter (lua_State *L) {#ifdef _WIN32struct _finddata_t c_file;#elsestruct dirent *entry;#endifdir_data *d = (dir_data *)luaL_checkudata (L, 1, DIR_METATABLE);luaL_argcheck (L, d->closed == 0, 1, "closed directory");#ifdef _WIN32if (d->hFile == 0L) { /* first entry */if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) {lua_pushnil (L);lua_pushstring (L, strerror (errno));d->closed = 1;return 2;} else {lua_pushstring (L, c_file.name);return 1;}} else { /* next entry */if (_findnext (d->hFile, &c_file) == -1L) {/* no more entries => close directory */_findclose (d->hFile);d->closed = 1;return 0;} else {lua_pushstring (L, c_file.name);return 1;}}#elseif ((entry = readdir (d->dir)) != NULL) {lua_pushstring (L, entry->d_name);return 1;} else {/* no more entries => close directory */closedir (d->dir);d->closed = 1;return 0;}#endif}/*** Closes directory iterators*/static int dir_close (lua_State *L) {dir_data *d = (dir_data *)lua_touserdata (L, 1);#ifdef _WIN32if (!d->closed && d->hFile) {_findclose (d->hFile);}#elseif (!d->closed && d->dir) {closedir (d->dir);}#endifd->closed = 1;return 0;}/*** Factory of directory iterators*/static int dir_iter_factory (lua_State *L) {const char *path = luaL_checkstring (L, 1);dir_data *d;lua_pushcfunction (L, dir_iter);d = (dir_data *) lua_newuserdata (L, sizeof(dir_data));luaL_getmetatable (L, DIR_METATABLE);lua_setmetatable (L, -2);d->closed = 0;#ifdef _WIN32d->hFile = 0L;if (strlen(path) > MAX_PATH-2)luaL_error (L, "path too long: %s", path);elsesprintf (d->pattern, "%s/*", path);#elsed->dir = opendir (path);if (d->dir == NULL)luaL_error (L, "cannot open %s: %s", path, strerror (errno));#endifreturn 2;}/*** Creates directory metatable.*/static int dir_create_meta (lua_State *L) {luaL_newmetatable (L, DIR_METATABLE);/* Method table */lua_newtable(L);lua_pushcfunction (L, dir_iter);lua_setfield(L, -2, "next");lua_pushcfunction (L, dir_close);lua_setfield(L, -2, "close");/* Metamethods */lua_setfield(L, -2, "__index");lua_pushcfunction (L, dir_close);lua_setfield (L, -2, "__gc");return 1;}/*** Creates lock metatable.*/static int lock_create_meta (lua_State *L) {luaL_newmetatable (L, LOCK_METATABLE);/* Method table */lua_newtable(L);lua_pushcfunction(L, lfs_unlock_dir);lua_setfield(L, -2, "free");/* Metamethods */lua_setfield(L, -2, "__index");lua_pushcfunction(L, lfs_unlock_dir);lua_setfield(L, -2, "__gc");return 1;}#ifdef _WIN32#ifndef S_ISDIR#define S_ISDIR(mode) (mode&_S_IFDIR)#endif#ifndef S_ISREG#define S_ISREG(mode) (mode&_S_IFREG)#endif#ifndef S_ISLNK#define S_ISLNK(mode) (0)#endif#ifndef S_ISSOCK#define S_ISSOCK(mode) (0)#endif#ifndef S_ISFIFO#define S_ISFIFO(mode) (0)#endif#ifndef S_ISCHR#define S_ISCHR(mode) (mode&_S_IFCHR)#endif#ifndef S_ISBLK#define S_ISBLK(mode) (0)#endif#endif/*** Convert the inode protection mode to a string.*/#ifdef _WIN32static const char *mode2string (unsigned short mode) {#elsestatic const char *mode2string (mode_t mode) {#endifif ( S_ISREG(mode) )return "file";else if ( S_ISDIR(mode) )return "directory";else if ( S_ISLNK(mode) )return "link";else if ( S_ISSOCK(mode) )return "socket";else if ( S_ISFIFO(mode) )return "named pipe";else if ( S_ISCHR(mode) )return "char device";else if ( S_ISBLK(mode) )return "block device";elsereturn "other";}/*** Set access time and modification values for file*/static int file_utime (lua_State *L) {const char *file = luaL_checkstring (L, 1);struct utimbuf utb, *buf;if (lua_gettop (L) == 1) /* set to current date/time */buf = NULL;else {utb.actime = (time_t)luaL_optnumber (L, 2, 0);utb.modtime = (time_t) luaL_optinteger (L, 3, utb.actime);buf = &utb;}if (utime (file, buf)) {lua_pushnil (L);lua_pushfstring (L, "%s", strerror (errno));return 2;}lua_pushboolean (L, 1);return 1;}/* inode protection mode */static void push_st_mode (lua_State *L, STAT_STRUCT *info) {lua_pushstring (L, mode2string (info->st_mode));}/* device inode resides on */static void push_st_dev (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_dev);}/* inode's number */static void push_st_ino (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_ino);}/* number of hard links to the file */static void push_st_nlink (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_nlink);}/* user-id of owner */static void push_st_uid (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_uid);}/* group-id of owner */static void push_st_gid (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_gid);}/* device type, for special file inode */static void push_st_rdev (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_rdev);}/* time of last access */static void push_st_atime (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_atime);}/* time of last data modification */static void push_st_mtime (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_mtime);}/* time of last file status change */static void push_st_ctime (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_ctime);}/* file size, in bytes */static void push_st_size (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_size);}#ifndef _WIN32/* blocks allocated for file */static void push_st_blocks (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_blocks);}/* optimal file system I/O blocksize */static void push_st_blksize (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_blksize);}#endif/*** Convert the inode protection mode to a permission list.*/#ifdef _WIN32static const char *perm2string (unsigned short mode) {static char perms[10] = "---------";int i;for (i=0;i<9;i++) perms[i]='-';if (mode & _S_IREAD){ perms[0] = 'r'; perms[3] = 'r'; perms[6] = 'r'; }if (mode & _S_IWRITE){ perms[1] = 'w'; perms[4] = 'w'; perms[7] = 'w'; }if (mode & _S_IEXEC){ perms[2] = 'x'; perms[5] = 'x'; perms[8] = 'x'; }return perms;}#elsestatic const char *perm2string (mode_t mode) {static char perms[10] = "---------";int i;for (i=0;i<9;i++) perms[i]='-';if (mode & S_IRUSR) perms[0] = 'r';if (mode & S_IWUSR) perms[1] = 'w';if (mode & S_IXUSR) perms[2] = 'x';if (mode & S_IRGRP) perms[3] = 'r';if (mode & S_IWGRP) perms[4] = 'w';if (mode & S_IXGRP) perms[5] = 'x';if (mode & S_IROTH) perms[6] = 'r';if (mode & S_IWOTH) perms[7] = 'w';if (mode & S_IXOTH) perms[8] = 'x';return perms;}#endif/* permssions string */static void push_st_perm (lua_State *L, STAT_STRUCT *info) {lua_pushstring (L, perm2string (info->st_mode));}typedef void (*_push_function) (lua_State *L, STAT_STRUCT *info);struct _stat_members {const char *name;_push_function push;};struct _stat_members members[] = {{ "mode", push_st_mode },{ "dev", push_st_dev },{ "ino", push_st_ino },{ "nlink", push_st_nlink },{ "uid", push_st_uid },{ "gid", push_st_gid },{ "rdev", push_st_rdev },{ "access", push_st_atime },{ "modification", push_st_mtime },{ "change", push_st_ctime },{ "size", push_st_size },{ "permissions", push_st_perm },#ifndef _WIN32{ "blocks", push_st_blocks },{ "blksize", push_st_blksize },#endif{ NULL, NULL }};/*** Get file or symbolic link information*/static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) {STAT_STRUCT info;const char *file = luaL_checkstring (L, 1);int i;if (st(file, &info)) {lua_pushnil(L);lua_pushfstring(L, "cannot obtain information from file '%s': %s", file, strerror(errno));return 2;}if (lua_isstring (L, 2)) {const char *member = lua_tostring (L, 2);for (i = 0; members[i].name; i++) {if (strcmp(members[i].name, member) == 0) {/* push member value and return */members[i].push (L, &info);return 1;}}/* member not found */return luaL_error(L, "invalid attribute name '%s'", member);}/* creates a table if none is given, removes extra arguments */lua_settop(L, 2);if (!lua_istable (L, 2)) {lua_newtable (L);}/* stores all members in table on top of the stack */for (i = 0; members[i].name; i++) {lua_pushstring (L, members[i].name);members[i].push (L, &info);lua_rawset (L, -3);}return 1;}/*** Get file information using stat.*/static int file_info (lua_State *L) {return _file_info_ (L, STAT_FUNC);}/*** Push the symlink target to the top of the stack.** Assumes the file name is at position 1 of the stack.** Returns 1 if successful (with the target on top of the stack),** 0 on failure (with stack unchanged, and errno set).*/static int push_link_target(lua_State *L) {#ifdef _WIN32errno = ENOSYS;return 0;#elseconst char *file = luaL_checkstring(L, 1);char *target = NULL;int tsize, size = 256; /* size = initial buffer capacity */while (1) {target = realloc(target, size);if (!target) /* failed to allocate */return 0;tsize = readlink(file, target, size);if (tsize < 0) { /* a readlink() error occurred */free(target);return 0;}if (tsize < size)break;/* possibly truncated readlink() result, double size and retry */size *= 2;}target[tsize] = '\0';lua_pushlstring(L, target, tsize);free(target);return 1;#endif}/*** Get symbolic link information using lstat.*/static int link_info (lua_State *L) {int ret;if (lua_isstring (L, 2) && (strcmp(lua_tostring(L, 2), "target") == 0)) {int ok = push_link_target(L);return ok ? 1 : pusherror(L, "could not obtain link target");}ret = _file_info_ (L, LSTAT_FUNC);if (ret == 1 && lua_type(L, -1) == LUA_TTABLE) {int ok = push_link_target(L);if (ok) {lua_setfield(L, -2, "target");}}return ret;}/*** Assumes the table is on top of the stack.*/static void set_info (lua_State *L) {lua_pushliteral(L, "Copyright (C) 2003-2016 Kepler Project");lua_setfield(L, -2, "_COPYRIGHT");lua_pushliteral(L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution");lua_setfield(L, -2, "_DESCRIPTION");lua_pushliteral(L, "LuaFileSystem " LFS_VERSION);lua_setfield(L, -2, "_VERSION");}static const struct luaL_Reg fslib[] = {{"attributes", file_info},{"chdir", change_dir},{"currentdir", get_dir},{"dir", dir_iter_factory},{"link", make_link},{"lock", file_lock},{"mkdir", make_dir},{"rmdir", remove_dir},{"symlinkattributes", link_info},{"setmode", lfs_f_setmode},{"touch", file_utime},{"unlock", file_unlock},{"lock_dir", lfs_lock_dir},{NULL, NULL},};LFS_EXPORT int luaopen_lfs (lua_State *L) {dir_create_meta (L);lock_create_meta (L);luaL_newlib (L, fslib);lua_pushvalue(L, -1);lua_setglobal(L, LFS_LIBNAME);set_info (L);return 1;}
/*** LuaFileSystem** Copyright Kepler Project 2003 - 2016 (http://keplerproject.github.io/luafilesystem)*//* Define 'chdir' for systems that do not implement it */#ifdef NO_CHDIR#define chdir(p) (-1)#define chdir_error "Function 'chdir' not provided by system"#else#define chdir_error strerror(errno)#endif#ifdef _WIN32#define chdir(p) (_chdir(p))#define getcwd(d, s) (_getcwd(d, s))#define rmdir(p) (_rmdir(p))#define LFS_EXPORT __declspec (dllexport)#ifndef fileno#define fileno(f) (_fileno(f))#endif#else#define LFS_EXPORT#endif#ifdef __cplusplusextern "C" {#endifLFS_EXPORT int luaopen_lfs (lua_State *L);#ifdef __cplusplus}#endif
language: csudo: falseenv:- LUA="lua 5.1"- LUA="lua 5.2"- LUA="lua 5.3"- LUA="luajit 2.0"before_install:- pip install --user cpp-coveralls hererocks- hererocks env --$LUA --luarocks latest- export PATH="$PWD/env/bin:$PATH"- luarocks install Lua-cURL --server=https://luarocks.org/dev- luarocks install lua-path- luarocks install lua-cjson- luarocks install luacov# install luacov-coveralls, but avoids installing luafilesystem- luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=noneinstall:- luarocks make rockspecs/luafilesystem-cvs-3.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"script:- lua -lluacov tests/test.luaafter_success:- coveralls -b . -i src --dump c.report.json- luacov-coveralls -j c.report.json -vnotifications:email:on_success: changeon_failure: always
Copyright © 2003-2014 Kepler Project.Permission is hereby granted, free of charge, to any personobtaining a copy of this software and associated documentationfiles (the "Software"), to deal in the Software withoutrestriction, including without limitation the rights to use, copy,modify, merge, publish, distribute, sublicense, and/or sell copiesof the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERSBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ANACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
# $Id: Makefile,v 1.36 2009/09/21 17:02:44 mascarenhas Exp $T= lfsCONFIG= ./configinclude $(CONFIG)SRCS= src/$T.cOBJS= src/$T.olib: src/lfs.sosrc/lfs.so: $(OBJS)MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/lfs.so $(OBJS)install:mkdir -p $(LUA_LIBDIR)cp src/lfs.so $(LUA_LIBDIR)clean:rm -f src/lfs.so $(OBJS)
[](LICENCE.txt)[](https://travis-ci.org/keplerproject/luafilesystem)[](https://ci.appveyor.com/project/ignacio/luafilesystem)[](https://coveralls.io/r/keplerproject/luafilesystem)# LuaFileSystem - File System Library for LuaCopyright 2003-2016 Kepler Projecthttp://keplerproject.github.io/luafilesystem# DescriptionLuaFileSystem is a Lua library developed to complement the set of functionsrelated to file systems offered by the standard Lua distribution.LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.LuaFileSystem is free software and uses the same license as Lua 5.1# LuaRocks Installation```luarocks install luafilesystem```# DocumentationPlease check the documentation at doc/us/ for more information.
# Installation directories# Default installation prefixPREFIX=/usr/local# System's libraries directory (where binary libraries are installed)LUA_LIBDIR= $(LUA_SRC_PATH)/lib/# Lua includes directoryLUA_INC= $(LUA_INC_PATH)/# OS dependentLIB_OPTION= -shared #for Linux#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS XLIBNAME= $T.so.$V# Compilation directivesWARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedanticINCS= -I$(LUA_INC)CFLAGS= $(WARN) $(INCS)CC= gcc# $Id: config,v 1.21 2007/10/27 22:42:32 carregal Exp $
/*** LuaFileSystem** Copyright Kepler Project 2003 - 2016 (http://keplerproject.github.io/luafilesystem)**** File system manipulation library.** This library offers these functions:** lfs.attributes (filepath [, attributename | attributetable])** lfs.chdir (path)** lfs.currentdir ()** lfs.dir (path)** lfs.link (old, new[, symlink])** lfs.lock (fh, mode)** lfs.lock_dir (path)** lfs.mkdir (path)** lfs.rmdir (path)** lfs.setmode (filepath, mode)** lfs.symlinkattributes (filepath [, attributename])** lfs.touch (filepath [, atime [, mtime]])** lfs.unlock (fh)*/#ifndef LFS_DO_NOT_USE_LARGE_FILE#ifndef _WIN32#ifndef _AIX#define _FILE_OFFSET_BITS 64 /* Linux, Solaris and HP-UX */#else#define _LARGE_FILES 1 /* AIX */#endif#endif#endif#ifndef LFS_DO_NOT_USE_LARGE_FILE#define _LARGEFILE64_SOURCE#endif#include <errno.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <time.h>#include <sys/stat.h>#ifdef _WIN32#include <direct.h>#include <windows.h>#include <io.h>#include <sys/locking.h>#ifdef __BORLANDC__#include <utime.h>#else#include <sys/utime.h>#endif#include <fcntl.h>/* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */#define LFS_MAXPATHLEN MAX_PATH#else#include <unistd.h>#include <dirent.h>#include <fcntl.h>#include <sys/types.h>#include <utime.h>#include <sys/param.h> /* for MAXPATHLEN */#define LFS_MAXPATHLEN MAXPATHLEN#endif#include <lua.h>#include <lauxlib.h>#include <lualib.h>#include "lfs.h"#define LFS_VERSION "1.6.3"#define LFS_LIBNAME "lfs"#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */#ifndef luaL_optlong#define luaL_optlong luaL_optinteger#endif#endif#if LUA_VERSION_NUM < 502# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))#endif/* Define 'strerror' for systems that do not implement it */#ifdef NO_STRERROR#define strerror(_) "System unable to describe the error"#endif#define DIR_METATABLE "directory metatable"typedef struct dir_data {int closed;#ifdef _WIN32intptr_t hFile;char pattern[MAX_PATH+1];#elseDIR *dir;#endif} dir_data;#define LOCK_METATABLE "lock metatable"#ifdef _WIN32#ifdef __BORLANDC__#define lfs_setmode(file, m) (setmode(_fileno(file), m))#define STAT_STRUCT struct stati64#else#define lfs_setmode(file, m) (_setmode(_fileno(file), m))#define STAT_STRUCT struct _stati64#endif#define STAT_FUNC _stati64#define LSTAT_FUNC STAT_FUNC#else#define _O_TEXT 0#define _O_BINARY 0#define lfs_setmode(file, m) ((void)file, (void)m, 0)#define STAT_STRUCT struct stat#define STAT_FUNC stat#define LSTAT_FUNC lstat#endif/*** Utility functions*/static int pusherror(lua_State *L, const char *info){lua_pushnil(L);if (info==NULL)lua_pushstring(L, strerror(errno));elselua_pushfstring(L, "%s: %s", info, strerror(errno));lua_pushinteger(L, errno);return 3;}static int pushresult(lua_State *L, int i, const char *info){if (i==-1)return pusherror(L, info);lua_pushinteger(L, i);return 1;}/*** This function changes the working (current) directory*/static int change_dir (lua_State *L) {const char *path = luaL_checkstring(L, 1);if (chdir(path)) {lua_pushnil (L);lua_pushfstring (L,"Unable to change working directory to '%s'\n%s\n",path, chdir_error);return 2;} else {lua_pushboolean (L, 1);return 1;}}/*** This function returns the current directory** If unable to get the current directory, it returns nil** and a string describing the error*/static int get_dir (lua_State *L) {#ifdef NO_GETCWDlua_pushnil(L);lua_pushstring(L, "Function 'getcwd' not provided by system");return 2;#elsechar *path = NULL;/* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */size_t size = LFS_MAXPATHLEN; /* initial buffer size */int result;while (1) {path = realloc(path, size);if (!path) /* failed to allocate */return pusherror(L, "get_dir realloc() failed");if (getcwd(path, size) != NULL) {/* success, push the path to the Lua stack */lua_pushstring(L, path);result = 1;break;}if (errno != ERANGE) { /* unexpected error */result = pusherror(L, "get_dir getcwd() failed");break;}/* ERANGE = insufficient buffer capacity, double size and retry */size *= 2;}free(path);return result;#endif}/*** Check if the given element on the stack is a file and returns it.*/static FILE *check_file (lua_State *L, int idx, const char *funcname) {#if LUA_VERSION_NUM == 501FILE **fh = (FILE **)luaL_checkudata (L, idx, "FILE*");if (*fh == NULL) {luaL_error (L, "%s: closed file", funcname);return 0;} elsereturn *fh;#elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 503luaL_Stream *fh = (luaL_Stream *)luaL_checkudata (L, idx, "FILE*");if (fh->closef == 0 || fh->f == NULL) {luaL_error (L, "%s: closed file", funcname);return 0;} elsereturn fh->f;#else#error unsupported Lua version#endif}/****/static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long start, long len, const char *funcname) {int code;#ifdef _WIN32/* lkmode valid values are:LK_LOCK Locks the specified bytes. If the bytes cannot be locked, the program immediately tries again after 1 second. If, after 10 attempts, the bytes cannot be locked, the constant returns an error.LK_NBLCK Locks the specified bytes. If the bytes cannot be locked, the constant returns an error.LK_NBRLCK Same as _LK_NBLCK.LK_RLCK Same as _LK_LOCK.LK_UNLCK Unlocks the specified bytes, which must have been previously locked.Regions should be locked only briefly and should be unlocked before closing a file or exiting the program.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__locking.asp*/int lkmode;switch (*mode) {case 'r': lkmode = LK_NBLCK; break;case 'w': lkmode = LK_NBLCK; break;case 'u': lkmode = LK_UNLCK; break;default : return luaL_error (L, "%s: invalid mode", funcname);}if (!len) {fseek (fh, 0L, SEEK_END);len = ftell (fh);}fseek (fh, start, SEEK_SET);#ifdef __BORLANDC__code = locking (fileno(fh), lkmode, len);#elsecode = _locking (fileno(fh), lkmode, len);#endif#elsestruct flock f;switch (*mode) {case 'w': f.l_type = F_WRLCK; break;case 'r': f.l_type = F_RDLCK; break;case 'u': f.l_type = F_UNLCK; break;default : return luaL_error (L, "%s: invalid mode", funcname);}f.l_whence = SEEK_SET;f.l_start = (off_t)start;f.l_len = (off_t)len;code = fcntl (fileno(fh), F_SETLK, &f);#endifreturn (code != -1);}#ifdef _WIN32typedef struct lfs_Lock {HANDLE fd;} lfs_Lock;static int lfs_lock_dir(lua_State *L) {size_t pathl; HANDLE fd;lfs_Lock *lock;char *ln;const char *lockfile = "/lockfile.lfs";const char *path = luaL_checklstring(L, 1, &pathl);ln = (char*)malloc(pathl + strlen(lockfile) + 1);if(!ln) {lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;}strcpy(ln, path); strcat(ln, lockfile);if((fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_NEW,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL)) == INVALID_HANDLE_VALUE) {int en = GetLastError();free(ln); lua_pushnil(L);if(en == ERROR_FILE_EXISTS || en == ERROR_SHARING_VIOLATION)lua_pushstring(L, "File exists");elselua_pushstring(L, strerror(en));return 2;}free(ln);lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock));lock->fd = fd;luaL_getmetatable (L, LOCK_METATABLE);lua_setmetatable (L, -2);return 1;}static int lfs_unlock_dir(lua_State *L) {lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);if(lock->fd != INVALID_HANDLE_VALUE) {CloseHandle(lock->fd);lock->fd=INVALID_HANDLE_VALUE;}return 0;}#elsetypedef struct lfs_Lock {char *ln;} lfs_Lock;static int lfs_lock_dir(lua_State *L) {lfs_Lock *lock;size_t pathl;char *ln;const char *lockfile = "/lockfile.lfs";const char *path = luaL_checklstring(L, 1, &pathl);lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock));ln = (char*)malloc(pathl + strlen(lockfile) + 1);if(!ln) {lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;}strcpy(ln, path); strcat(ln, lockfile);if(symlink("lock", ln) == -1) {free(ln); lua_pushnil(L);lua_pushstring(L, strerror(errno)); return 2;}lock->ln = ln;luaL_getmetatable (L, LOCK_METATABLE);lua_setmetatable (L, -2);return 1;}static int lfs_unlock_dir(lua_State *L) {lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE);if(lock->ln) {unlink(lock->ln);free(lock->ln);lock->ln = NULL;}return 0;}#endifstatic int lfs_g_setmode (lua_State *L, FILE *f, int arg) {static const int mode[] = {_O_BINARY, _O_TEXT};static const char *const modenames[] = {"binary", "text", NULL};int op = luaL_checkoption(L, arg, NULL, modenames);int res = lfs_setmode(f, mode[op]);if (res != -1) {int i;lua_pushboolean(L, 1);for (i = 0; modenames[i] != NULL; i++) {if (mode[i] == res) {lua_pushstring(L, modenames[i]);return 2;}}lua_pushnil(L);return 2;} else {return pusherror(L, NULL);}}static int lfs_f_setmode(lua_State *L) {return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2);}/*** Locks a file.** @param #1 File handle.** @param #2 String with lock mode ('w'rite, 'r'ead).** @param #3 Number with start position (optional).** @param #4 Number with length (optional).*/static int file_lock (lua_State *L) {FILE *fh = check_file (L, 1, "lock");const char *mode = luaL_checkstring (L, 2);const long start = (long) luaL_optinteger (L, 3, 0);long len = (long) luaL_optinteger (L, 4, 0);if (_file_lock (L, fh, mode, start, len, "lock")) {lua_pushboolean (L, 1);return 1;} else {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}}/*** Unlocks a file.** @param #1 File handle.** @param #2 Number with start position (optional).** @param #3 Number with length (optional).*/static int file_unlock (lua_State *L) {FILE *fh = check_file (L, 1, "unlock");const long start = (long) luaL_optinteger (L, 2, 0);long len = (long) luaL_optinteger (L, 3, 0);if (_file_lock (L, fh, "u", start, len, "unlock")) {lua_pushboolean (L, 1);return 1;} else {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}}/*** Creates a link.** @param #1 Object to link to.** @param #2 Name of link.** @param #3 True if link is symbolic (optional).*/static int make_link(lua_State *L){#ifndef _WIN32const char *oldpath = luaL_checkstring(L, 1);const char *newpath = luaL_checkstring(L, 2);return pushresult(L,(lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL);#elseerrno = ENOSYS; /* = "Function not implemented" */return pushresult(L, -1, "make_link is not supported on Windows");#endif}/*** Creates a directory.** @param #1 Directory path.*/static int make_dir (lua_State *L) {const char *path = luaL_checkstring (L, 1);int fail;#ifdef _WIN32fail = _mkdir (path);#elsefail = mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );#endifif (fail) {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}lua_pushboolean (L, 1);return 1;}/*** Removes a directory.** @param #1 Directory path.*/static int remove_dir (lua_State *L) {const char *path = luaL_checkstring (L, 1);int fail;fail = rmdir (path);if (fail) {lua_pushnil (L);lua_pushfstring (L, "%s", strerror(errno));return 2;}lua_pushboolean (L, 1);return 1;}/*** Directory iterator*/static int dir_iter (lua_State *L) {#ifdef _WIN32struct _finddata_t c_file;#elsestruct dirent *entry;#endifdir_data *d = (dir_data *)luaL_checkudata (L, 1, DIR_METATABLE);luaL_argcheck (L, d->closed == 0, 1, "closed directory");#ifdef _WIN32if (d->hFile == 0L) { /* first entry */if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) {lua_pushnil (L);lua_pushstring (L, strerror (errno));d->closed = 1;return 2;} else {lua_pushstring (L, c_file.name);return 1;}} else { /* next entry */if (_findnext (d->hFile, &c_file) == -1L) {/* no more entries => close directory */_findclose (d->hFile);d->closed = 1;return 0;} else {lua_pushstring (L, c_file.name);return 1;}}#elseif ((entry = readdir (d->dir)) != NULL) {lua_pushstring (L, entry->d_name);return 1;} else {/* no more entries => close directory */closedir (d->dir);d->closed = 1;return 0;}#endif}/*** Closes directory iterators*/static int dir_close (lua_State *L) {dir_data *d = (dir_data *)lua_touserdata (L, 1);#ifdef _WIN32if (!d->closed && d->hFile) {_findclose (d->hFile);}#elseif (!d->closed && d->dir) {closedir (d->dir);}#endifd->closed = 1;return 0;}/*** Factory of directory iterators*/static int dir_iter_factory (lua_State *L) {const char *path = luaL_checkstring (L, 1);dir_data *d;lua_pushcfunction (L, dir_iter);d = (dir_data *) lua_newuserdata (L, sizeof(dir_data));luaL_getmetatable (L, DIR_METATABLE);lua_setmetatable (L, -2);d->closed = 0;#ifdef _WIN32d->hFile = 0L;if (strlen(path) > MAX_PATH-2)luaL_error (L, "path too long: %s", path);elsesprintf (d->pattern, "%s/*", path);#elsed->dir = opendir (path);if (d->dir == NULL)luaL_error (L, "cannot open %s: %s", path, strerror (errno));#endifreturn 2;}/*** Creates directory metatable.*/static int dir_create_meta (lua_State *L) {luaL_newmetatable (L, DIR_METATABLE);/* Method table */lua_newtable(L);lua_pushcfunction (L, dir_iter);lua_setfield(L, -2, "next");lua_pushcfunction (L, dir_close);lua_setfield(L, -2, "close");/* Metamethods */lua_setfield(L, -2, "__index");lua_pushcfunction (L, dir_close);lua_setfield (L, -2, "__gc");return 1;}/*** Creates lock metatable.*/static int lock_create_meta (lua_State *L) {luaL_newmetatable (L, LOCK_METATABLE);/* Method table */lua_newtable(L);lua_pushcfunction(L, lfs_unlock_dir);lua_setfield(L, -2, "free");/* Metamethods */lua_setfield(L, -2, "__index");lua_pushcfunction(L, lfs_unlock_dir);lua_setfield(L, -2, "__gc");return 1;}#ifdef _WIN32#ifndef S_ISDIR#define S_ISDIR(mode) (mode&_S_IFDIR)#endif#ifndef S_ISREG#define S_ISREG(mode) (mode&_S_IFREG)#endif#ifndef S_ISLNK#define S_ISLNK(mode) (0)#endif#ifndef S_ISSOCK#define S_ISSOCK(mode) (0)#endif#ifndef S_ISFIFO#define S_ISFIFO(mode) (0)#endif#ifndef S_ISCHR#define S_ISCHR(mode) (mode&_S_IFCHR)#endif#ifndef S_ISBLK#define S_ISBLK(mode) (0)#endif#endif/*** Convert the inode protection mode to a string.*/#ifdef _WIN32static const char *mode2string (unsigned short mode) {#elsestatic const char *mode2string (mode_t mode) {#endifif ( S_ISREG(mode) )return "file";else if ( S_ISDIR(mode) )return "directory";else if ( S_ISLNK(mode) )return "link";else if ( S_ISSOCK(mode) )return "socket";else if ( S_ISFIFO(mode) )return "named pipe";else if ( S_ISCHR(mode) )return "char device";else if ( S_ISBLK(mode) )return "block device";elsereturn "other";}/*** Set access time and modification values for file*/static int file_utime (lua_State *L) {const char *file = luaL_checkstring (L, 1);struct utimbuf utb, *buf;if (lua_gettop (L) == 1) /* set to current date/time */buf = NULL;else {utb.actime = (time_t)luaL_optnumber (L, 2, 0);utb.modtime = (time_t) luaL_optinteger (L, 3, utb.actime);buf = &utb;}if (utime (file, buf)) {lua_pushnil (L);lua_pushfstring (L, "%s", strerror (errno));return 2;}lua_pushboolean (L, 1);return 1;}/* inode protection mode */static void push_st_mode (lua_State *L, STAT_STRUCT *info) {lua_pushstring (L, mode2string (info->st_mode));}/* device inode resides on */static void push_st_dev (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_dev);}/* inode's number */static void push_st_ino (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_ino);}/* number of hard links to the file */static void push_st_nlink (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_nlink);}/* user-id of owner */static void push_st_uid (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_uid);}/* group-id of owner */static void push_st_gid (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_gid);}/* device type, for special file inode */static void push_st_rdev (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_rdev);}/* time of last access */static void push_st_atime (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_atime);}/* time of last data modification */static void push_st_mtime (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_mtime);}/* time of last file status change */static void push_st_ctime (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer) info->st_ctime);}/* file size, in bytes */static void push_st_size (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_size);}#ifndef _WIN32/* blocks allocated for file */static void push_st_blocks (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_blocks);}/* optimal file system I/O blocksize */static void push_st_blksize (lua_State *L, STAT_STRUCT *info) {lua_pushinteger (L, (lua_Integer)info->st_blksize);}#endif/*** Convert the inode protection mode to a permission list.*/#ifdef _WIN32static const char *perm2string (unsigned short mode) {static char perms[10] = "---------";int i;for (i=0;i<9;i++) perms[i]='-';if (mode & _S_IREAD){ perms[0] = 'r'; perms[3] = 'r'; perms[6] = 'r'; }if (mode & _S_IWRITE){ perms[1] = 'w'; perms[4] = 'w'; perms[7] = 'w'; }if (mode & _S_IEXEC){ perms[2] = 'x'; perms[5] = 'x'; perms[8] = 'x'; }return perms;}#elsestatic const char *perm2string (mode_t mode) {static char perms[10] = "---------";int i;for (i=0;i<9;i++) perms[i]='-';if (mode & S_IRUSR) perms[0] = 'r';if (mode & S_IWUSR) perms[1] = 'w';if (mode & S_IXUSR) perms[2] = 'x';if (mode & S_IRGRP) perms[3] = 'r';if (mode & S_IWGRP) perms[4] = 'w';if (mode & S_IXGRP) perms[5] = 'x';if (mode & S_IROTH) perms[6] = 'r';if (mode & S_IWOTH) perms[7] = 'w';if (mode & S_IXOTH) perms[8] = 'x';return perms;}#endif/* permssions string */static void push_st_perm (lua_State *L, STAT_STRUCT *info) {lua_pushstring (L, perm2string (info->st_mode));}typedef void (*_push_function) (lua_State *L, STAT_STRUCT *info);struct _stat_members {const char *name;_push_function push;};struct _stat_members members[] = {{ "mode", push_st_mode },{ "dev", push_st_dev },{ "ino", push_st_ino },{ "nlink", push_st_nlink },{ "uid", push_st_uid },{ "gid", push_st_gid },{ "rdev", push_st_rdev },{ "access", push_st_atime },{ "modification", push_st_mtime },{ "change", push_st_ctime },{ "size", push_st_size },{ "permissions", push_st_perm },#ifndef _WIN32{ "blocks", push_st_blocks },{ "blksize", push_st_blksize },#endif{ NULL, NULL }};/*** Get file or symbolic link information*/static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) {STAT_STRUCT info;const char *file = luaL_checkstring (L, 1);int i;if (st(file, &info)) {lua_pushnil(L);lua_pushfstring(L, "cannot obtain information from file '%s': %s", file, strerror(errno));return 2;}if (lua_isstring (L, 2)) {const char *member = lua_tostring (L, 2);for (i = 0; members[i].name; i++) {if (strcmp(members[i].name, member) == 0) {/* push member value and return */members[i].push (L, &info);return 1;}}/* member not found */return luaL_error(L, "invalid attribute name '%s'", member);}/* creates a table if none is given, removes extra arguments */lua_settop(L, 2);if (!lua_istable (L, 2)) {lua_newtable (L);}/* stores all members in table on top of the stack */for (i = 0; members[i].name; i++) {lua_pushstring (L, members[i].name);members[i].push (L, &info);lua_rawset (L, -3);}return 1;}/*** Get file information using stat.*/static int file_info (lua_State *L) {return _file_info_ (L, STAT_FUNC);}/*** Push the symlink target to the top of the stack.** Assumes the file name is at position 1 of the stack.** Returns 1 if successful (with the target on top of the stack),** 0 on failure (with stack unchanged, and errno set).*/static int push_link_target(lua_State *L) {#ifdef _WIN32errno = ENOSYS;return 0;#elseconst char *file = luaL_checkstring(L, 1);char *target = NULL;int tsize, size = 256; /* size = initial buffer capacity */while (1) {target = realloc(target, size);if (!target) /* failed to allocate */return 0;tsize = readlink(file, target, size);if (tsize < 0) { /* a readlink() error occurred */free(target);return 0;}if (tsize < size)break;/* possibly truncated readlink() result, double size and retry */size *= 2;}target[tsize] = '\0';lua_pushlstring(L, target, tsize);free(target);return 1;#endif}/*** Get symbolic link information using lstat.*/static int link_info (lua_State *L) {int ret;if (lua_isstring (L, 2) && (strcmp(lua_tostring(L, 2), "target") == 0)) {int ok = push_link_target(L);return ok ? 1 : pusherror(L, "could not obtain link target");}ret = _file_info_ (L, LSTAT_FUNC);if (ret == 1 && lua_type(L, -1) == LUA_TTABLE) {int ok = push_link_target(L);if (ok) {lua_setfield(L, -2, "target");}}return ret;}/*** Assumes the table is on top of the stack.*/static void set_info (lua_State *L) {lua_pushliteral(L, "Copyright (C) 2003-2016 Kepler Project");lua_setfield(L, -2, "_COPYRIGHT");lua_pushliteral(L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution");lua_setfield(L, -2, "_DESCRIPTION");lua_pushliteral(L, "LuaFileSystem " LFS_VERSION);lua_setfield(L, -2, "_VERSION");}static const struct luaL_Reg fslib[] = {{"attributes", file_info},{"chdir", change_dir},{"currentdir", get_dir},{"dir", dir_iter_factory},{"link", make_link},{"lock", file_lock},{"mkdir", make_dir},{"rmdir", remove_dir},{"symlinkattributes", link_info},{"setmode", lfs_f_setmode},{"touch", file_utime},{"unlock", file_unlock},{"lock_dir", lfs_lock_dir},{NULL, NULL},};LFS_EXPORT int luaopen_lfs (lua_State *L) {dir_create_meta (L);lock_create_meta (L);luaL_newlib (L, fslib);lua_pushvalue(L, -1);lua_setglobal(L, LFS_LIBNAME);set_info (L);return 1;}
/*** LuaFileSystem** Copyright Kepler Project 2003 - 2016 (http://keplerproject.github.io/luafilesystem)*//* Define 'chdir' for systems that do not implement it */#ifdef NO_CHDIR#define chdir(p) (-1)#define chdir_error "Function 'chdir' not provided by system"#else#define chdir_error strerror(errno)#endif#ifdef _WIN32#define chdir(p) (_chdir(p))#define getcwd(d, s) (_getcwd(d, s))#define rmdir(p) (_rmdir(p))#define LFS_EXPORT __declspec (dllexport)#ifndef fileno#define fileno(f) (_fileno(f))#endif#else#define LFS_EXPORT#endif#ifdef __cplusplusextern "C" {#endifLFS_EXPORT int luaopen_lfs (lua_State *L);#ifdef __cplusplus}#endif
Oniguruma LICENSE-----------------/*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/
History2010/01/09: Version 5.9.22010/01/05: [bug] fix utf16be_code_to_mbc() and utf16le_code_to_mbc().2008/09/16: [bug] fix memory leaks in parse_exp().2008/08/01: [bug] fix memory leaks.2008/06/17: [bug] invalid type of argument was usedin onig_st_lookup_strend().2008/06/16: [bug] invalid CaseFoldMap entry in ISO-8859-5. 0xdf -> 0xde2008/02/19: [new] add: onig_reg_init().2008/02/19: [new] add: onig_free_body().2008/02/19: [new] add: onig_new_without_alloc().2008/02/19: [API] rename onig_alloc_init() to onig_reg_init(),and argument type changed.2008/01/31: [impl] move UTF16_IS_SURROGATE_XXX() to regenc.h.2008/01/30: [bug] (thanks akr)fix euctw_islead().2008/01/23: [bug] update enc/koi8.c.2007/12/22: Version 5.9.12007/12/21: [impl] add sprint_byte().2007/11/28: [bug] (thanks Andy Armstrong)don't overwrite error code in fetch_name().2007/11/12: [bug] utf8 mbc length of code 0xfe, 0xff are not 1,2007/10/23: [spec] onig_enc_len() takes three arguments. (not used)2007/10/15: [impl] (thanks Rui Hirokawa)add check HAVE_STDARG_H.2007/09/07: [API] rename enc_len() to onig_enc_len() in oniguruma.h.2007/09/04: [API] remove ONIGENC_ERR_XXXXX.2007/09/03: [API] add error ONIGERR_INVALID_CODE_POINT_VALUE.2007/09/03: [impl] change error message to "invaid code point value"for ONIGERR_INVALID_WIDE_CHAR_VALUE.2007/09/03: [bug] xxx_code_to_mbclen() should returnONIGERR_INVALID_WIDE_CHAR_VALUE for invalid code point.ex. /[\x{7fffffff}]/ for ASCII encoding.2007/08/28: [impl] remove "warning: no previous declaration ...".2007/08/21: [impl] remove warnings in enc/mktable.c.2007/08/20: [impl] remove "warning: unused parameter"2007/08/20: [impl] remove "warning: comparison between signed and unsigned".2007/08/06: [impl] remove clear_not_flag_cclass().2007/08/03: [bug] fix the case of undefined USE_NAMED_GROUP.2007/08/02: [spec] add backref by number.2007/08/01: [API] add OnigCtype.2007/07/27: [spec] add USE_CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS.2007/07/24: [impl] define PLATFORM_UNALIGNED_WORD_ACCESS.2007/07/23: [dist] fix doc/FAQ.ja.2007/07/14: Version 5.9.02007/07/13: [bug] add check into onig_reduce_nested_quantifier().2007/06/26: [spec] (thanks K.Takata)ONIG_OPTION_SINGLELINE: '$' -> '\Z' (as Perl)2007/06/26: [dist] (thanks K.Takata)fix documents API and API.ja.2007/06/19: [impl] remove IS_NOT_NULL() check before onig_node_free().2007/06/18: [bug] (thanks KUBO Takehiro)WORD_ALIGNMENT_SIZE must be sizeof(OnigCodePoint).2007/06/18: [impl] rename CClassNode flags.2007/06/18: [bug] initialization miss.2007/06/13: [impl] change node type reference NXXXX.2007/06/11: [impl] add node type bit.2007/06/11: [spec] allow anchor in enclosed repeater. /(\z)*/2007/06/11: [impl] rename node types.2007/06/08: [impl] remove OP_SET_OPTION_PUSH and OP_SET_OPTION from match_at().2007/06/07: [impl] use xvsnprintf().2007/06/06: [tune] don't set qn->next_head_exact for string first byte is zero.2007/06/06: [impl] remove unused variables.2007/06/04: Version 5.8.02007/06/04: [impl] add #ifndef vsnprintf into regint.h.2007/05/31: [dist] add configure option '--enable-crnl-as-line-terminator'.2007/05/30: [dist] add sample/crnl.c.2007/05/30: [bug] should check USE_CRNL_AS_LINE_TERMINATOR casein onig_search().2007/05/29: [impl] move USE_CRNL_AS_LINE_TERMINATOR into regenc.h.2007/05/29: [impl] should check USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINEin forward_search_range() and backward_search_range().2007/04/27: Version 5.7.02007/04/20: [spec] add config USE_MATCH_RANGE_IS_COMPLETE_RANGE.2007/04/20: [impl] refactoring in match_at().2007/04/12: Version 5.6.12007/04/12: [bug] must not use UChar in oniguruma.h.2007/04/09: [impl] change STATE_CHECK_BUFF_MAX_SIZE value from 0x8000to 0x4000. [ruby-core:10883]2007/04/04: Version 5.6.0 (mourning for Hideo Takamatsu)2007/04/03: [spec] add new notation (?'name'), \k'name', \g'name'.2007/04/03: [impl] remove unused variable.2007/03/26: [impl] add 'void' to function declarations.2007/03/06: Version 5.5.32007/03/06: [bug] add #include <malloc.h> for bcc32.(In bcc32, alloca() is declared in malloc.h.)2007/03/02: [bug] invalid optimization for semi-end-buf in onig_search().ex. /\n\Z/.match("aaaaaaaaaa\n")2007/03/02: [impl] move range > start check position in end_buf process.2007/01/09: Version 5.5.22007/01/09: [impl] rename USE_EXTERNAL_LOWER_CASE_CONV_TABLE.2007/01/05: [tune] select_opt_exact_info() didn't work for empty info.ex. /.a/ make MAP info instead of EXACT info.2006/12/28: [impl] add print_enc_string() for ONIG_DEBUG mode.2006/12/22: Version 5.5.12006/12/22: [impl] rename ADD_PAD_TO_SHORT_BYTE_STRING. to USE_PAD_TO_SHORT_BYTE_CHAR.2006/12/21: [spec] should check too short multibyte char in parse_exp().add ADD_PAD_TO_SHORT_BYTE_STRING.ex. /\x00/ in UTF16 should be error.2006/12/06: Version 5.5.02006/12/05: [bug] should add unfold-1 codes from folded code intoonigenc_unicode_get_case_fold_codes_by_str().(ex. "S" -> "s" -> 0x017f)2006/12/05: [new] add flag ONIGENC_CASE_FOLD_TURKISH_AZERI andUSE_UNICODE_CASE_FOLD_TURKISH_AZERI. (disabled in default)2006/12/04: [spec] remove ONIGENC_CASE_FOLD_FULL.2006/11/30: [impl] remove unnecessary check in xxx_mbc_case_fold().2006/11/29: Version 5.4.02006/11/28: [spec] INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR is enabled indefault case fold status.2006/11/28: [spec] rename ONIGENC_CASE_FOLD_MULTI_CHAR toINTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR.2006/11/28: [impl] remove USE_UNICODE_CASE_FOLD_MULTI_CHAR.2006/11/28: [impl] remove Fold[123]Table and add FoldTable.2006/11/27: [impl] change tool/unicode_fc.rb to see CaseFolding.txt.2006/11/24: [bug] should call callback for to[j] <-> to[k] inonigenc_unicode_apply_all_case_fold().2006/11/22: Version 5.3.02006/11/22: [dist] add index_ja.html.2006/11/22: [impl] undef ONIG_ESCAPE_UCHAR_COLLISION in regint.h and regenc.h.2006/11/21: [bug] invalid array access.2006/11/21: [impl] escape UChar collision from config.h.2006/11/20: [new] add Hiragana/Katakana properties into Shift_JIS.2006/11/20: [impl] fix CR_Katakana[] values in EUC-JP.2006/11/17: [impl] declare strend hash table functions in regint.h.2006/11/17: [impl] move property list functions to regenc.c.2006/11/17: [new] add Hiragana/Katakana properties into EUC-JP.2006/11/15: [impl] remove NOT_RUBY from AM_CFLAGS.2006/11/14: Version 5.2.02006/11/14: [impl] remove program codes for Ruby.2006/11/14: [impl] reduce program codes for Ruby.2006/11/10: [bug] 0x24, 0x2b, 0x3c, 0x3d, 0x3e, 0x5e, 0x60, 0x7c, 0x7eshould be [:punct:].2006/11/09: [new] (thanks Byte)add new character encoding CP1251.2006/11/08: [impl] rename QUALIFIER -> QUANTIFIER.2006/11/07: Version 5.1.02006/11/07: [dist] remove test.rb, testconv.rb and testconvu.rb.2006/11/07: [bug] get_case_fold_codes_by_str() should handle 'Ss' and 'sS'combination for ess-tsett.2006/11/07: [impl] apply_all_case_fold() doesn't need to return allcase character combination for multi-character folding.(ONIGENC_CASE_FOLD_MULTI_CHAR)2006/11/07: [bug] (thanks Byte)add { 0xa3, 0xb3 } to CaseFoldMap[] for KOI8-R.2006/11/06: [spec] change ONIG_OPTION_FIND_LONGEST to search all ofthe string range.add USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE.2006/11/02: [impl] re-implement expand_case_fold_string() forONIGENC_CASE_FOLD_MULTI_CHAR.2006/10/30: [impl] add NSTR_DONT_GET_OPTINFO flag.2006/10/30: [impl] (thanks K.Takata)add THREAD_SYSTEM_INIT and THREAD_SYSTEM_END.2006/10/30: [bug] (thanks Wolfgang Nadasi-Donner)invalid offset value was used in STATE_CHECK_BUFF_INIT().2006/10/27: [tune] speed up ONIGENC_MBC_CASE_FOLD() for UTF-16, UTF-32.(ASCII code check)2006/10/27: [tune] (thanks Kornelius Kalnbach)String#scan for long string needs long time compare withold Rubyby initialization time for combination explosion checkex. ("test " * 100_000).scan(/\w*\s?/)change STATE_CHECK_BUFF_MAX_SIZE from 0x8000000 to 0x8000.reduce initialization area of state_check_buff.2006/10/25: [impl] add DISABLE_CASE_FOLD_MULTI_CHAR().2006/10/23: Version 5.0.12006/10/23: [bug] should fold string in expand_case_fold_string().2006/10/23: [bug] (thanks Km)too many case fold/unfold expansion problem.don't expand and set ambig flag to the string node.(except ONIGENC_CASE_FOLD_MULTI_CHAR).2006/10/23: [bug] (thanks K.Takata)invalid \p{Alnum}, \p{ASCII}, [:alnum:], [:ascii:].fix OnigEncAsciiCtypeTable[] etc...2006/10/23: [spec] (thanks K.Takata)add [:word:] POSIX bracket.2006/10/23: [bug] (thanks K.Takata)\p{Word} doesn't work.2006/10/20: [impl] don't expand for AMBIG_FLAG string inexpand_case_fold_string().2006/10/19: Version 5.0.02006/10/18: [bug] ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM should be 13.2006/10/18: [impl] remove unused functions.2006/10/18: [dist] update documents.2006/10/18: [API] move OnigMetaCharTableType to OnigSyntaxType.2006/10/18: [dev] add too/unicode_fc.rb, unicode_pc.rb.2006/10/18: [dist] remove MANIFEST-RUBY from distribution.2006/10/18: [bug] return duplicated code inonigenc_unicode_get_case_fold_codes_by_str().2006/10/18 [API] remove ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS.2006/10/18: [dev] add tool/19.2006/10/18: [dist] remove target 19 from Makefile.am.2006/10/17: [dist] add enc/unicode.c to target 19 of win32/Makefile.2006/10/17: [impl] change type for escape VC++ warning.2006/10/17: [API] rename ONIGENC_CASE_FOLD_NONE to ONIGENC_CASE_FOLD_MIN.2006/10/17: [dist] remove INSTALL-RUBY from distribution.2006/10/17: [dist] update LTVERSION to "2:0:0".2006/10/17: [impl] remove warnings for [make CFLAGS="-g -O2 -Wall"]in the case USE_UNICODE_PROPERTIES andUSE_UNICODE_CASE_FOLD_MULTI_CHAR are undefined.2006/10/17: [impl] remove warnings for [make CFLAGS="-g -O2 -Wall"].2006/10/17: [impl] re-implement onigenc_unicode_apply_all_case_fold().multi-char by case folded char-class is treated ascaseless-string (ambig flag on).enable OP_EXACT1_IC and OP_EXACTN_IC.2006/10/16: [bug] unfold expand for 1->2, 1->3 folding inonigenc_unicode_apply_all_case_fold().add CaseFoldExpand_12[], CaseFoldExpand_13[].2006/10/16: [bug] (thanks Akinori Musha)first argument of rb_warn() should be format string.2006/10/16: [impl] add msa.state_check_buff_size initializationin onig_search().2006/10/16: [spec] re-implement Unicode Caseless Match codes.2006/10/10: [bug] should call onig_st_free_table() inonig_free_shared_cclass_table().2006/10/10: [impl] remove OnigCompCaseFoldCodes.2006/10/10: [impl] remove onigenc_ascii_is_mbc_ambiguous() andonigenc_mbn_is_mbc_ambiguous().2006/10/10: [API] remove is_mbc_ambiguous() member from OnigEncodingType.2006/10/10: [API] rename onig_set_default_ambig_flag() toonig_set_default_case_fold_flag(),onig_get_default_ambig_flag() toonig_get_default_case_fold_flag(),onig_get_ambig_flag() to onig_get_case_fold_flag().2006/10/10: [API] rename ambig_flag to case_fold_flag.2006/10/10: [API] rename OnigAmbigType to OnigCaseFoldType.2006/10/10: [impl] rename ONIGENC_IS_CODE_SB_WORD() to IS_CODE_SB_WORD()and move to regint.h.2006/10/10: [impl] remove OP_WORD_SB and OP_WORD_MB.2006/10/10: [impl] remove OP_EXACT1_IC and OP_EXACTN_IC from match_at().2006/10/10: [impl] should free new_str in expand_case_fold_string().2006/10/06: [dist] add test entrys to sample/encode.c.2006/10/06: [impl] re-implement caseless match (case-fold).2006/10/06: [impl] expand string node by case fold variations.add expand_case_fold_string().2006/10/05: [spec] rename OnigCompAmbigCodeItem to OnigCaseFoldCodeItem.2006/10/05: [spec] add apply_all_case_fold() and get_case_fold_codes_by_str()to OnigEncodingType.2006/10/05: [spec] remove ambig_flag, get_all_pair_ambig_codes() andget_all_comp_ambig_codes() member from OnigEncodingType.2006/10/03: [impl] rename mbc_to_normalize() to mbc_case_fold().2006/10/03: [spec] rename ONIGENC_AMBIGUOUS_MATCH_XXXto ONIGENC_CASE_FOLD_XXX.rename ONIGENC_CASE_FOLD_COMPOUNDto ONIGENC_CASE_FOLD_MULTI_CHAR.2006/10/02: [impl] remove all ONIG_RUBY_M17N part.2006/09/29: [impl] initialize state_check_buff_size in STATE_CHECK_BUFF_INIT().make valgrind happy.2006/09/22: [impl] remove parse time ctype values (CTYPE_WORD etc...)2006/09/22: [ruby] enable USE_BACKREF_AT_LEVEL for Ruby mode.2006/09/22: [spec] (thanks Allan Odgaard)allow upper case letter as the first characterof group name.fetch_name() and fetch_name_with_level()2006/09/21: [impl] convert to ascii for parameter string inonig_error_code_to_str().add enc member into OnigErrorInfo.2006/09/21: [dist] update documents for Unicode Property.2006/09/21: [new] add Unicode Properties. (enc/unicode.c)Any, Assigned, C, Cc, L, Lm, Arabic, Greek etc...2006/09/21: [impl] add USE_UNICODE_PROPERTIES into regenc.h.2006/09/21: [impl] remove USE_UNICODE_FULL_RANGE_CTYPE.2006/09/20: [impl] change ONIGENC_CTYPE_XXXX to sequencial values.add BIT_CTYPE_XXXX bit flags to regenc.h.update XXXX_CtypeTable[] for BIT_CTYPE_ALNUM.2006/09/19: [memo] move from CVS to Subversion (1.3.2).2006/09/19: [impl] (thanks KOYAMA Tetsuji)HAVE_STDARG_PROTOTYPES was not defined in Mac OS Xby Xcode 2.4(gcc 4.0.1) problem. [php-dev 1312] etc...2006/09/15: [bug] (thanks Allan Odgaard)out of range access in bm_search_notrev().(p < s)2006/09/13: [impl] add ONIGENC_CTYPE_ENC_EXT flag.2006/09/13: [spec] remove 'Is' prefix check for property namefrom fetch_char_property_to_ctype().2006/09/13: [API] add property_name_to_ctype member to OnigEncodingType.2006/09/12: [spec][ruby] add ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY andONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT to OnigSyntaxRuby.2006/09/08: Version 4.4.22006/09/08: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].2006/09/08: [bug] (thanks K.Takata)out of range access in bm_search_notrev().2006/09/04: [spec] (thanks K.Takata)allow look-behind in negative look-behind.ex. /(?<!(?<=a)b|c)d/2006/08/29: Version 4.4.12006/08/29: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].2006/08/29: [dist] (thanks Seiji Masugata)add configure option --enable-combination-explosion-check2006/08/25: Version 4.4.02006/08/25: [test] success in ruby 1.9.0 (2006-08-22) [i686-linux].2006/08/25: [impl] add_state_check_num() should be enclosed inifdef USE_COMBINATION_EXPLOSION_CHECK.2006/08/23: [spec] config USE_COMBINATION_EXPLOSION_CHECK is enabledin Ruby mode only.2006/08/22: [impl] remove last line comma in enum OpCode.2006/08/22: [impl] remove OP_STATE_CHECK_ANYCHAR_STAR_PEEK_NEXT andOP_STATE_CHECK_ANYCHAR_ML_STAR_PEEK_NEXT.2006/08/22: [impl] remove OP_BACKREF3.2006/08/21: Version 4.3.12006/08/21: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].2006/08/21: [impl] change stack type valuesand re-define STK_MASK_TO_VOID_TARGET etc...2006/08/21: [impl] set repeat_range[].upper to 0x7fffffff as infinite.2006/08/21: [impl] add STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE.2006/08/21: [impl] reduce (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n}2006/09/21: [impl] reduce (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n}if backreference is not used.2006/08/17: [bug] should check scan_env.num_call > 0 for backrefed patternin combination explosion check.2006/08/17: Version 4.3.02006/08/17: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].2006/08/17: [new] add config USE_COMBINATION_EXPLOSION_CHECK.check /(.+)*/, /(\s*foo\s*)*/ etc...[API] add num_comb_exp_check member in regex_t.[dist] change LTVERSION value to "1:0:0" in configure.in.2006/08/15: [bug] OP_REPEAT_INC process in match_at().should check repeat-count >= range-upper andrange-upper may be infinite.2006/08/11: Version 4.2.32006/08/11: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].2006/08/10: [impl] remove double call in set_qualifier().2006/08/10: [impl] remove by_number member in QualifierNode.2006/08/09: [impl] remove a comma at the end of enum ReduceTypefor escape warning on Mac OS X.2006/08/07: [impl] remove warning in regcomp.c.2006/08/07: [spec] move definition of USE_BACKREF_AT_LEVEL into NOT_RUBY.2006/08/03: Version 4.2.22006/08/03: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].2006/08/03: [bug] (thanks Hiroyuki Yamamoto)segmentation fault in regexec(). (POSIX API)2006/08/02: [bug] combination of \G in look-ahead/look-behind and otheranchors(\A, \z, \Z) cause invalid result.ex. /(?!\G)a\z/.match("ba")start arg. of MATCH_ARG_INIT() should be originalarg. of onig_search().2006/07/31: Version 4.2.12006/07/31: [test] success in ruby 1.9.0 (2006-07-28) [i686-linux].2006/07/31: [bug] (thanks Kimura Minoru)re-implement bm_search_notrev().2006/07/31: [impl] bm_search_notrev() refactoring.2006/07/31: [bug] (thanks Kimura Minoru)fix incomplete multibyte string in exact info.2006/07/31: [impl] (thanks Seiji Masugata)remove cast in va_init_list() for Intel C Compiler.2006/07/18: Version 4.2.02006/07/18: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/07/18: [new] (thanks Wolfgang Nadasi-Donner)add back reference with nest level.\k<name+n>, \k<name-n>2006/07/11: [impl] change long to unsigned long for ONIG_OPTION_XXXand ONIG_SYN_XXX number literals.2006/07/03: Version 4.1.22006/07/03: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/07/03: [spec] (thanks Wolfgang Nadasi-Donner)allow \G in look-behind.add ANCHOR_BEGIN_POSITION flag in setup_tree().2006/06/12: [impl] (thanks matz)fix cast from char* to const char*in onig_snprintf_with_pattern().fix cast from char* to const char*for PopularQStr[] and ReduceQStr[].2006/05/22: Version 4.1.12006/05/22: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/05/22: [impl] add position string argument to STACK_BASE_CHECK().2006/05/22: [bug] (thanks NARUSE, Yui)add STK_NULL_CHECK_END to IS_TO_VOID_TARGET().ex. core dump in/(?<pare>\(([^\(\)]++|\g<pare>)*+\))/.match('((a))')2006/05/15: Version 4.1.02006/05/15: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/05/15: [impl] thread atomic changes for onig_end() andonig_free_node_list().2006/05/15: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2005/05/15: [dist] update API, API.ja, FAQ, FAQ.ja.2006/05/15: [spec] remove onig_recompile(), onig_recompile_deluxe()and re_recompile_pattern().add config USE_RECOMPILE_API.2006/05/15: [impl] improved thread safe implementation of onig_search()and onig_match().2006/05/11: Version 4.0.42006/05/11: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/05/11: [bug] (thanks Yuji Kaneda)dead-lock in onig_end().2006/05/11: [dist] update index.html.2006/05/08: Version 4.0.32006/05/08: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/05/08: [bug] (thanks Allan Odgaard)Segmentation fault in backward search.ex. /^\t.*$/2006/04/18: [dist] update index.html.2006/04/05: [dist] update index.html.2006/03/24: [dist] update doc/RE, doc/RE.ja.2006/03/23: Version 4.0.22006/03/22: [test] success in ruby 1.9.0 (2006-03-01) [i686-linux].2006/03/22: [impl] add both of ONIG_OPTION_DONT_CAPTURE_GROUPand ONIG_OPTION_CAPTURE_GROUP check.2006/03/22: [spec] add error code ONIGERR_INVALID_COMBINATION_OF_OPTIONS.2006/03/22: [impl] remove USE_NAMED_GROUP condition fromONIG_OPTION_DONT_CAPTURE_GROUP check in parse_effect().2006/03/22: [new] add API onig_noname_group_capture_is_active().2006/03/01: [spec] rename regex object type from regex_t to OnigRegexType.add typedef OnigRegexType regex_tunless ONIG_ESCAPE_REGEX_T_COLLISION is defined.2006/02/27: [spec] change ONIG_MAX_MULTI_BYTE_RANGES_NUM from 1000to 10000. (for docdiff program)2006/02/17: [dist] change COPYING year 2005 -> 2006.2006/02/07: Version 4.0.12006/02/07: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux].2006/02/07: [bug] memory leaks in onig_free_shared_cclass_table().2006/02/03: [ruby] add -m 0644 option to install command in "make 19".2006/02/03: [impl] rename ANCHOR_ANYCHAR_STAR_PL to ANCHOR_ANYCHAR_STAR_ML.change from IS_POSIXLINE() to IS_MULTILINE()for ANCHOR_ANYCHAR_START/_ML decisionin optimize_node_left().2006/01/26: [dist] update index.html for Oniguruma 2.5.3.2006/01/25: [dist] update URL in index.html.2006/01/24: Version 4.0.02006/01/24: [test] success in ruby 1.9.0 (2005-11-28) [i386-cygwin].2006/01/24: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux].2006/01/24: [dist] remove warnings from sample/encode.c.2006/01/24: [dist] change install description in README(.ja).2006/01/24: [dist] remove re.c.XXX.patch from distribution and CVS.2006/01/24: [dist] --- support shared library ---use GNU libtool/automake.change configure.in and add Makefile.am, sample/Makefile.am.add AUTHORS file.2006/01/24: [dist] test programs return exit code -1 when test fails.2006/01/24: [bug] (thanks KIMURA Koichi)invalid syntax definition in ONIG_SYNTAX_GREP.ONIG_SYN_OP_BRACE_INTERVAL-> ONIG_SYN_OP_ESC_BRACE_INTERVAL2006/01/23: [dist] fix configure.in for onig-config.2006/01/19: [new] add new config USE_UNICODE_ALL_LINE_TERMINATORS.(U+000d, U+0085, U+2028, U+2029)2005/12/29: [dist] change pmatch array size to 25 in testconv.rb.2005/12/26: [dist] fix name in test.rb.2005/12/26: [dist] update index.html for 2.5.1.2005/11/29: Version 3.9.12005/11/29: [test] success in ruby 1.9.0 (2005-11-28) [i686-linux].2005/11/24: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].2005/11/21: [test] success in ruby 1.9.0 (2005-11-20) [i386-cygwin].2005/11/21: [bug] (thanks Allan Odgaard)utf-8 character comments in extended mode leadsinvalid result.ex. /(?x)(?<= # <any-utf-8 multibyte char>o\n~) /fix onigenc_unicode_is_code_ctype() andutf8_is_code_ctype().2005/11/20: [bug] (thanks MATSUMOTO Satoshi) (thanks Isao Sonobe)begin-line anchor and BM search optimization leadsinvalid result in UTF-16/32.fix in set_optimize_exact_info().2005/11/20: Version 3.9.02005/11/20: [test] success in ruby 1.9.0 (2005-11-20) [i386-cygwin].2005/11/20: [test] success in ruby 1.9.0 (2005-10-18) [i386-cygwin].2005/11/20: [new] add new config USE_CRNL_AS_LINE_TERMINATOR.(!!! NO SUPPORT experimental option !!!)2005/11/15: [bug] (thanks Allan Odgaard)tok->escape was not cleared in fetch_token_in_cc().ex. [\s&&[^\n]] makes wrong result.2005/10/18: [impl] (thanks nobu)change sjis_mbc_enc_len()and node_new_cclass_by_codepoint_range() scope to static.2005/09/05: [dist] remove link to MultiFind.2005/09/01: [dist] add link to yagrep.2005/08/23: Version 3.8.92005/08/23: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].2005/08/23: [inst] fix Makefile.in for make ctest/ptest.2005/08/23: Version 3.8.82005/08/23: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].2005/08/23: [impl] split is_code_in_cc() from onig_is_code_in_cc().2005/08/23: [impl] should check DATA_ENSURE() at OP_CCLASS_NODE in match_at().2005/08/23: [impl] (thanks akr)add ONIG_OPTION_MAXBIT for escape conflict withRuby's option.2005/08/22: [impl] escape GCC 4.0 warnings for testc.c.2005/08/22: [bug] (thanks nobu, matz) [ruby-dev:26840]UTF-8 0xFE, 0xFF handling bug in code_is_in_cclass_node().abort on /\S*/ =~ "\xfe"2005/08/22: [impl] escape GCC 4.0 warnings for sample/*.c.2005/08/22: [impl] fix testconvu.rb.2005/08/22: [impl] escape GCC 4.0 warnings.2005/08/09: Version 3.8.72005/08/09: [test] success in ruby 1.9.0 (2005-08-09) [i686-linux].2005/08/09: [bug] (thanks Allan Odgaard)should not call enc_len() for s == rangein onig_search().2005/08/01: [dist] add mkdir $prefix, mkdir $exec_prefix to make install.2005/07/27: Version 3.8.62005/07/27: [test] success in ruby 1.9.0 (2005-07-26) [i686-linux].2005/07/27: [impl] update onig-config.in.2005/07/26: [new] (thanks Yen-Ju Chen)add Oniguruma configuration check program.(onig-config.in)2005/07/14: Version 3.8.52005/07/14: [test] success in ruby 1.9.0 (2005-07-14) [i686-linux].2005/07/11: [test] success in ruby 1.9.0 (2005-07-04) [i686-linux].2005/07/11: [bug] (thanks nobu) [ruby-dev:26505]invalid handling for /\c\x/ and /\C-\x/.fix fetch_escaped_value().2005/07/05: [impl] (thanks Alexey Zakhlestine)escape GCC 4.0 warnings.2005/07/01: Version 3.8.42005/07/01: [test] success in ruby 1.9.0 (2005-07-01) [i686-linux].2005/06/30: [test] success in ruby 1.9.0 (2005-06-28) [i686-linux].2005/06/30: [dist] add GB 18030 test to sample/encode.c.2005/06/30: [impl] escape warning of gb18030_left_adjust_char_head().2005/06/30: [new] (contributed by KUBO Takehiro)add new character encoding ONIG_ENCODING_GB18030.2005/06/30: [bug] invalid ctype check for multibyte encodings.("graph", "print")fix onigenc_mb2/4_is_code_ctype(),eucjp_is_code_ctype() and sjis_is_code_ctype().2005/06/30: [bug] invalid conversion from code point to mbc inonigenc_mb4_code_to_mbc().2005/06/28: Version 3.8.32005/06/28: [test] success in ruby 1.9.0 (2005-06-28) [i686-linux].2005/06/27: [test] success in ruby 1.9.0 (2005-05-31) [i686-linux].2005/06/27: [bug] (thanks Wolfgang Nadasi-Donner)invalid check for never ending recursion.lower zero quantifier should be treated asa non-recursive call alternative.ex. /(?<bal>[^()]*(\(\g<bal>\)[^()]*)*)/2005/06/15: [impl] add divide_ambig_string_node_sub().2005/06/15: [dist] add a test to sample/encode.c.2005/06/10: [new] add ONIG_SYNTAX_PERL_NG. (Perl + named group)2005/06/01: Version 3.8.22005/06/01: [test] success in ruby 1.9.0 (2005-05-31) [i686-linux].2005/05/31: [dist] add doc/FAQ and doc/FAQ.ja.2005/05/31: [impl] minor change in node_new().2005/05/30: [test] success in ruby 1.9.0 (2005-05-11) [i686-linux].2005/05/30: [bug] (thanks Allan Odgaard)FreeNodeList null check should be on thread-atomicin node_new().2005/05/11: Version 3.8.12005/05/11: [test] success in ruby 1.9.0 (2005-05-11) [i386-mswin32].2005/05/11: [dist] update win32/Makefile (make 19).2005/05/11: [test] success in ruby 1.9.0 (2005-05-11) [i686-linux].2005/05/06: [test] success in ruby 1.9.0 (2005-05-06) [i686-linux].2005/05/06: [impl] (thanks nobu) [ruby-core:4815]add #ifdef USE_VARIABLE_META_CHARS to goto label.2005/04/25: [test] success in ruby 1.9.0 (2005-04-25) [i686-linux].2005/04/25: [impl] change DEFAULT_WARN_FUNCTION and DEFAULT_VERB_WARN_FUNCTIONto onig_rb_warn() and onig_rb_warning().2005/04/15: Version 3.8.02005/04/15: [test] success in ruby 1.9.0 (2005-04-14) [i686-linux].2005/04/01: [test] success in ruby 1.9.0 (2005-03-24) [i686-linux].2005/04/01: [impl] (thanks Joe Orton)(thanks Moriyoshi Koizumi)many const-ification to many *.[ch] files.2005/03/25: Version 3.7.22005/03/25: [test] success in ruby 1.9.0 (2005-03-24) [i686-linux].2005/03/23: [test] success in ruby 1.9.0 (2005-03-20) [i686-linux].2005/03/23: [test] success in ruby 1.9.0 (2005-03-08) [i686-linux].2005/03/23: [new] add ONIG_SYNTAX_ASIS.2005/03/23: [new] add ONIG_SYN_OP2_INEFFECTIVE_ESCAPE.2005/03/09: [spec] rename MBCTYPE_XXX to RE_MBCTYPE_XXX. (GNU API)2005/03/08: [test] success in ruby 1.9.0 (2005-03-08) [i686-linux].2005/03/08: [impl] (thanks matz) [ruby-dev:25783]should not allocate memory for key data in st.c.move st_*_strend() functions from st.c. fixed somepotential memory leaks.(imported from Ruby 1.9 2005-03-08)2005/03/07: Version 3.7.12005/03/07: [test] success in ruby 1.9.0 (2005-03-07) [i686-linux].2005/03/07: [impl] (thanks Rui Hirokawa)add ONIG_ESCAPE_UCHAR_COLLISION.rename UChar to OnigUChar in oniguruma.h.2005/03/07: [impl] remove declarations for Ruby in oniggnu.h.2005/03/05: [bug] ANCHOR_ANYCHAR_STAR didn't work in onig_search().2005/03/01: [dist] remove oniggnu.h from MANIFEST-RUBY.remove oniggnu.h from make 19.2005/03/01: [bug] (thanks matz) [ruby-dev:25778]uninitialized member (OptEnv.backrefed_status)was used.2005/02/19: Version 3.7.02005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin].2005/02/19: [new] (thanks Minero Aoki)add onig_region_set().2005/02/19: [API] change onig_region_init() to extern.2005/02/19: [dist] remove reggnu.c from MANIFEST-RUBY.remove reggnu.c from make 19.2005/02/19: [dist] update doc/API and doc/API.ja.2005/02/19: [test] success in ruby 1.9.0 (2005-02-19) [i386-cygwin].2005/02/19: [impl] (thanks Alexey Zakhlestine)change UChar* to const UChar* in oniguruma.h,regenc.h and regparse.h.2005/02/13: [impl] change UChar* to const UChar* in oniguruma.h andonigposix.h and st.h.2005/02/12: [test] success in ruby 1.9.0 (2005-02-11) [i386-cygwin].2005/02/12: [bug] (thanks nobu) [ruby-dev:25676]type_cclass_hash() fix overrun.2005/02/09: [test] success in ruby 1.9.0 (2005-02-09) [i686-linux].2005/02/09: [spec] add RE_OPTION_FIND_NOT_EMPTY etc.. to oniggnu.h.2005/02/09: [dist] remove hash.c.patch.2005/02/07: [impl] remove re_mbctab, mbctab_ascii etc...(USE_COMPATIBILITY_FOR_RUBY_EXTENSION_LIBRARY)2005/02/04: Version 3.6.02005/02/04: [test] success in ruby 1.9.0 (2005-02-04) [i686-linux].2005/02/01: [bug] add key_free() call to st_free_table().2005/02/01: [new] add onig_get_default_ambig_flag() andonig_set_default_ambig_flag().2005/02/01: [dist] update MANIFEST-RUBY.2005/01/31: [test] success in ruby 1.9.0 (2005-01-29) [i686-linux].2005/01/31: [spec] remove ONIGENC_AMBIGUOUS_MATCH_COMPOUNDfrom ONIGENC_AMBIGUOUS_MATCH_DEFAULT.2005/01/31: [dist] update Makefile.in (make 19).2005/01/29: [memo] (thanks Kazuo Saito)Oniguruma 3.5.4 was merged to Ruby 1.9.0.2005/01/28: [impl] (thanks UK-taniyama)add extern "C" { } directive to oniguruma.h, oniggnu.hand onigposix.h for C++.2005/01/25: [impl] remove nested function call for xxx_code_to_mbclen().(euc_kr.c, euc_tw.c, big5.c)2005/01/19: Version 3.5.42005/01/19: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux].2005/01/19: [bug] (thanks Isao Sonobe)callback function argument name_end of onig_foreach_name()was wrong.name key of name table should be null terminated forcharacter encoding length.add strdup_with_null(), rename onig_strdup() to k_strdup().use e->name_len in i_names().2005/01/17: [impl] (thanks UK-taniyama)add HAVE_SYS_TYPES_H to config.h.in.2005/01/13: Version 3.5.32005/01/13: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux].2005/01/13: [bug] ignore case match bug.ex. /s+/iu.match("SSSSS") ==> [4..5]fix OP_EXACT1_IC, OP_EXACTN_IC process.2005/01/13: [bug] (thanks Isao Sonobe)ignore case match bug.ex. /is/iu.match("ss") fail.fix str_lower_case_match() etc.2005/01/05: Version 3.5.22005/01/05: [test] success in ruby 1.9.0 (2005-01-05) [i686-linux].2005/01/05: [test] success in ruby 1.9.0 (2004-12-16) [i686-linux].2005/01/05: [bug] (thanks Isao Sonobe)ignore case match bug.ex. /s+/iu.match("sssss") ==> [4..5]fix OP_EXACT1_IC, OP_EXACTN_IC process.2005/01/05: [bug] (thanks Isao Sonobe)group name table should be renumbered.add onig_renumber_name_table().2004/12/24: [dist] remove file onigcmpt200.h.2004/12/17: Version 3.5.12004/12/17: [dist] add INSTALL-RUBY to archive.2004/12/16: [test] success in ruby 1.9.0 (2004-12-16) [i686-linux].2004/12/16: [dist] update hash.c.patch.2004/12/15: [bug] (thanks matz)char > 127 should be casted to unsigned char. (utf8.c)2004/12/13: [impl] add HAVE_PROTOTYPES and HAVE_STDARG_PROTOTYPES definitionto oniguruma.h in the case __cplusplus.2004/12/06: [dist] update doc/RE and doc/RE.ja.2004/12/03: [impl] (thanks nobu)st.h fix prototype for C++.2004/12/03: Version 3.5.02004/12/02: [test] success in ruby 1.9.0 (2004-12-02) [i686-linux].2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i386-mswin32].2004/12/01: [dist] add make targets 19 and 19up to win32/Makefile.2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i386-cygwin].2004/12/01: [test] success in ruby 1.9.0 (2004-12-01) [i686-linux].2004/12/01: [impl] double cast for escape warning in Cygwin.(HashDataType* )((void* )(&e)) in regparse.c2004/12/01: [test] success in ruby 1.9.0 (2004-11-30) [i686-linux].2004/12/01: [tune] change implementation of clear_opt_map_info().(which was 10-16% cost in gprof result for my test program)2004/12/01: [dist] remove regex.c from distribution files.2004/11/30: [memo] remove targets 16 and 18 from Makefile.in.2004/11/30: [test] success in ruby 1.9.0 (2004-11-30) [i686-linux].2004/11/30: [inst] add "cp -p st.[ch] st.[ch].ruby_orig" to "make 19".2004/11/30: [tune] map_position_value() return 20 if code is 0and minimum enclen > 1.2004/11/30: [test] success in ruby 1.9.0 (2004-11-29) [i686-linux].2004/11/30: [impl] minor changes for multi-thread in regexec.c and regcomp.c.2004/11/30: [impl] change THREAD_PASS_LIMIT_COUNT value from 10 to 8.2004/11/30: [impl] add THREAD_ATOMIC_XXX to FreeNodeList access in regparse.c2004/11/29: [impl] add USE_MULTI_THREAD_SYSTEM.2004/11/29: [memo] add hash.c.patch to CVS.2004/11/29: [dist] change mail address to 'sndgk393 AT ...'2004/11/29: [dist] add -s option (silent mode) to test.rb.2004/11/29: [tune] change THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS valuefrom 20 to 8.2004/11/29: [inst] add make target "19up".2004/11/29: [dist] change Oniguruma Home Page URL.2004/11/29: [impl] remove onig_is_in_code_range_array().2004/11/29: [dist] fix doc/RE and RE.ja (character types).2004/11/26: [dist] fix win32/Makefile.2004/11/26: [dist] fix doc/RE and RE.ja (multibyte character types).2004/11/26: [impl] add onig_free_shared_cclass_table().2004/11/26: [impl] move definition USE_UNICODE_FULL_RANGE_CTYPE to regenc.h.2004/11/26: [impl] add opcode OP_CCLASS_NODE.2004/11/26: [impl] move definition of CClassNode to regint.h.2004/11/26: [impl] add type PointerType in regint.h.2004/11/25: [impl] remove ONIGENC_CTYPE_MOD_NOT.2004/11/25: [impl] rename onig_node_new_cclass_by_codepoint_range tonode_new_cclass_by_codepoint_range.2004/11/25: [impl] remove get_type_cc_node method from OnigEncodingType.2004/11/25: [impl] move implementation of shared char-class from enc/*.cto regparse.c.2004/11/25: [dist] add hash.c.patch for Ruby 1.9 hash.c change.2004/11/22: [impl] change utf8_get_type_node().2004/11/22: [impl] add ONIGENC_CTYPE_MOD_NOT.2004/11/22: [bug] (thanks MIYAMUKO Katsuyuki)ruby make test fail in HP-UX B.11.23 ia64.should use tok->u.code instead of tok->u.c inthe case of TK_CODE_POINT.2004/11/19: [bug] (thanks Yoshida Masato)invalid multibyte code causes segmentation fault.ex. /[\xFF-\xFF]/u2004/11/19: [bug] (thanks Yoshida Masato)illegal check in char-class range in UTF-8.ex. s = "[\xC2\xA0-\xC3\xBE]"p(Regexp.new(s, nil, "u") =~ "\xC3\xBE")2004/11/18: [impl] add onig_node_new_cclass_by_codepoint_range().2004/11/18: [impl] remove OnigCodePointRange type. (use OnigCodePoint[].)2004/11/17: [bug] (thanks nobu)abort in "a".gsub(/a\Z/, "")fix ONIGENC_STEP_BACK() argument in onig_search().2004/11/16: [impl] add key2 member to st_table_entry in st.[ch].change API of st for non-null terminated string key.2004/11/16: [impl] add get_type_cc_node method to OnigEncodingType.2004/11/15: [impl] add st.h and st.c from Ruby 1.9.use st-hash always.2004/11/12: [impl] change menber 'not' of CClassNode to 'flags'.add flags FLAG_CCLASS_NOT and FLAG_CCLASS_SHARE.2004/11/12: [impl] add onig_is_in_code_range_array() to enc/unicode.c.2004/11/12: [impl] fix CRWord in enc/unicode.c and MBWord in enc/utf8.c.2004/11/11: [bug] fix enc/utf8.c.size 0 array initializer was compile error in VC++.2004/11/09: [inst] (thanks Hiroki YAGITA)change installed file mode to 0644.2004/11/09: [bug] (thanks UK-taniyama)wrong definitions GET_RELADDR_INC(), GET_ABSADDR_INC()etc... (NOT PLATFORM_UNALIGNED_WORD_ACCESS)2004/11/09: [impl] type cast in regexec() for remove compile time warning.(WIN32, regposix.c)2004/11/08: [spec] fix Unicode character types.0x00ad (soft hyphen) should be [:cntrl:] and [:space:] type.[0x0009..0x000d], 0x0085 should be [:print:] type.0x00ad should not be [:punct:] type.2004/11/08: [inst] fix Makefile.in. (for make ctest/ptest/testcu)2004/11/06: [impl] (thanks Kazuo Saito)too many alternatives pattern causes core dump.change implementation of onig_node_free().2004/11/05: [spec] rename ONIGERR_END_PATTERN_AT_BACKSLASH toONIGERR_END_PATTERN_AT_ESCAPE.2004/11/05: [impl] (thanks matz)escape compile time warnings for x86-64 Linux.StackIndex type int -> long2004/11/05: [memo] (thanks Kazuo Saito)Oniguruma 3.4.0 was merged to Ruby 1.9.0.2004/10/30: Version 3.4.02004/10/30: [test] success in ruby 1.9.0 (2004-09-24) [i686-linux].2004/10/30: [new] add hexadecimal digit char type. (\h, \H)syntax: ONIG_SYN_OP2_ESC_H_XDIGIT2004/10/30: [bug] (thanks Guy Decoux)reluctant infinite repeat bug.ex. /^[a-z]{2,}?$/.match("aaa") fail.fix OP_REPEAT_INC_NG process in match_at().2004/10/18: Version 3.3.12004/10/18: [test] success in ruby 1.9.0 (2004-09-24) [i686-linux].2004/10/18: [impl] (thanks Imai Yasumasa)enclose #include <sys/types.h> by #ifndef __BORLANDC__.2004/10/18: [bug] (thanks Imai Yasumasa)memory acess violation in select_opt_exact_info().2004/09/25: [dist] fix doc/API and doc/API.ja.2004/09/25: [bug] fix OP_SEMI_END_BUF process in match_at() forthe case USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINEis not defined.2004/09/17: Version 3.3.02004/09/17: [dist] add COPYING to program source files.2004/09/17: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux].2004/09/17: [bug] (thanks Isao Sonobe)memory access violations in xxx_mbc_enc_len(),and xxx_mbc_to_normalize() andxxx_left_adjust_char_head().add string range check in match_at() and onig_search().2004/09/08: [dist] change mail address format.(kosako AT sofnec ...)2004/09/04: Version 3.2.92004/09/04: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux].2004/09/04: [bug] (thanks Bob Kerstetter and Richard Koch)search fail in ignore case mode.fix str_lower_case_match().2004/09/04: [inst] (thanks Isao Sonobe)clear sample directory in 'make clean'.2004/09/04: [bug] fix ONIGENC_AMBIGUOUS_MATCH_COMPOUND/ASCII/NONASCIImeanings in XXXXX_mbc_to_normalize() andXXXXX_is_mbc_ambiguous().2004/08/28: [bug] fix ONIGENC_AMBIGUOUS_MATCH_COMPOUND/ASCII/NONASCIImeanings in iso_8859_XX_mbc_to_normalize() andiso_8859_XX_is_mbc_ambiguous().2004/08/24: Version 3.2.82004/08/24: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux].2004/08/24: [spec] add ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY./a{n}?/ == /(?:a{n})?/2004/08/24: [dist] fix doc/RE and doc/RE.ja.2004/08/24: [bug] (thanks starfish)memory leak in set_optimize_exact_info().2004/08/21: Version 3.2.72004/08/21: [test] success in ruby 1.8.2 (2004-07-28) [i686-linux].(1.8.2 preview2)2004/08/21: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux].2004/08/21: [bug] (thanks Isao Sonobe) (thanks kage)memory access violation in bm_search_notrev().(forgotten to merge from 2.X)2004/07/24: Version 3.2.62004/07/24: [test] success in ruby 1.9.0 (2004-07-23) [i686-linux].2004/07/24: [test] success in ruby 1.8.2 (2004-07-16) [i686-linux].2004/07/24: [bug] fix warnings for regexec.c. (gcc 2.91.66)2004/07/24: [memo] change version control system from Subversionto CVS 1.11.17.2004/07/20: [bug] (thanks Isao Sonobe)illegal result in negative character class in ignore casemode. fix pair-ambig-codes process in parse_exp().ex. /[^a]/i.match("A")2004/07/20: [bug] (thanks Isao Sonobe)undefined bytecode error happens in UTF-16BE etc..compile_length_cclass_node() was not consistent withcompile_cclass_node().2004/07/01: Version 3.2.52004/07/01: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux].2004/07/01: [new] add onig_get_syntax_{op,op2,behavior,options}.2004/07/01: [bug] (thanks Isao Sonobe)invalid result in onig_capture_tree_traverse().fix make_capture_history_tree().2004/06/29: Version 3.2.42004/06/29: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux].2004/06/29: [new] (thanks Isao Sonobe)add onig_number_of_captures().2004/06/25: Version 3.2.32004/06/25: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux].2004/06/25: [bug] (thanks Isao Sonobe)invalid result in onig_capture_tree_traverse().fix make_capture_history_tree().2004/06/24: Version 3.2.22004/06/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/06/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2004/06/24: [test] success in ruby 1.8.2 (2004-06-23) [i686-linux].2004/06/24: [new] (thanks Isao Sonobe)add onig_number_of_capture_histories().2004/06/24: [bug] (thanks Isao Sonobe)invalid char position match in UTF-16 and UTF-32.add onigenc_always_false_is_allowed_reverse_match().2004/06/17: Version 3.2.12004/06/17: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/06/17: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2004/06/17: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux].2004/06/17: [impl] should not use OP_REPEAT for (...)? even if target sizeis long.2004/06/17: [bug] (thanks nobu) [ruby-dev:23703]should use STACK_AT() instead of stkp in OP_REPEAT_INC.add IN_VAR_REPEAT flag in setup_tree().2004/06/16: [impl] change select_opt_exact_info() to use ByteValTable[].2004/06/16: [impl] change map_position_value() table values.2004/06/14: [impl] (thanks John Carter)RelAddrType, AbsAddrType and LengthType changefrom short int to int type for the very long string match.2004/06/14: [bug] (thanks Greg A. Woods)fix nmatch argument of regexec() is smaller thanreg->num_mem + 1 case. (POSIX API)2004/06/14: [spec] (thanks Greg A. Woods)set pmatch to NULL if nmatch is 0 in regexec(). (POSIX API)2004/06/10: Version 3.2.02004/06/10: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/06/10: [test] success in ruby 1.9.0 (2004-05-27) [i386-mswin32].2004/06/10: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux].2004/06/10: [dist] add README.ja.2004/06/10: [new] add onig_copy_encoding().2004/06/10: [API] add encoding argument to onig_set_meta_char().add meta_char_table member to OnigEncodingType.2004/06/08: [dist] add doc/API.ja.2004/06/07: [API] add num_of_elements member to OnigCompileInfo.2004/05/29: [memo] (thanks Kazuo Saito)Oniguruma 3.1.0 was merged to Ruby 1.9.0.2004/05/26: [impl] rename NST_SIMPLE_REPEAT to NST_STOP_BT_SIMPLE_REPEAT.2004/05/26: [impl] doesn't need to check that target's simple repeat-nessfor EFFECT_MEMORY type node in setup_tree().2004/05/25: Version 3.1.02004/05/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2004/05/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/05/25: [test] success in ruby 1.9.0 (2004-05-23) [i686-linux].2004/05/25: [test] success in ruby 1.8.2 (2004-05-18) [i686-linux].2004/05/25: [bug] (thanks Masahiro Sakai) [ruby-dev:23560]ruby -ruri -ve 'URI::ABS_URI =~"http://example.org/Andr\xC3\xA9"'nested STK_REPEAT type stack can't backtrack repeat_stk[].add OP_REPEAT_INC_SG and OP_REPEAT_INC_NG_SG.2004/05/25: [new] support UTF-32LE. (ONIG_ENCODING_UTF32_LE)2004/05/25: [new] support UTF-32BE. (ONIG_ENCODING_UTF32_BE)2004/05/24: [impl] divide enc/utf16.c to utf16_be.c and utf16_le.c.2004/05/24: [impl] add enc/unicode.c.2004/05/24: [API] change calling sequences of onig_new_deluxe() andonig_recompile_deluxe().define OnigCompileInfo type.2004/05/21: [impl] perform ensure process for rb_trap_exec() in match_at().add onig_exec_trap() and CHECK_INTERRUPT_IN_MATCH_AT.2004/05/21: [impl] add regex status check to onig_match().2004/05/21: [new] add onig_get_capture_tree() andonig_capture_tree_traverse().2004/05/20: [spec] (thanks Isao Sonobe)capture history return capture data tree.(see sample/listcap.c)2004/05/19: [bug] (thanks Simon Strandgaard)Control-C does not work in matching process on Ruby.add calling of CHECK_INTERRUPT into match_at().ex. /<(?:[^">]+|"[^"]*")+>/.match('<META http-equiv= \"Content-Type content="text/html; charset=iso-8859-1">')2004/05/19: [bug] (thanks Simon Strandgaard)define virtual codepoint values for invalid encodingbyte 0xfe and 0xff in UTF-8.ex. /\w+/u.match("%a\xffb\xfec%") ==> "a"2004/05/19: [spec] (thanks Simon Strandgaard)too big backref number should be treated as a sequence ofan octal char and number digits.ex. /b\3777\c/.match("b\3777\c")2004/05/17: [spec] rename encoding names "UTF-16 BE" and "UTF-16 LE"to "UTF-16BE" and "UTF-16LE".2004/05/17: [impl] move ismbchar() and mbclen() from oniguruma.h to oniggnu.h.2004/05/17: [impl] rename onigenc_single_byte_is_allowed_reverse_match() toonigenc_always_true_is_allowed_reverse_match().2004/05/14: Version 3.0.02004/05/14: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/05/14: [test] success in ruby 1.9.0 (2004-05-14) [i686-linux].2004/05/14: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].(* need to edit parse.y:register int c; ---> int c; in yylex())2004/05/14: [impl] add regext.c.2004/05/14: [spec] KOI8 is not included in library archive by default setup.2004/05/14: [impl] implementation changes are completed for all encoding files.2004/05/12: [impl] add divide_ambig_string_node().ambiguous string is divided and normalized beforeoptimization and compilation process.2004/05/11: [dist] remove INSTALL-RUBY from distribution.2004/04/28: [memo] (thanks Kazuo Saito)Oniguruma 2.2.8 was merged to Ruby 1.9.0.2004/04/26: [spec] change value DEFAULT_MATCH_STACK_LIMIT_SIZE = 0 : unlimited2004/04/26: [new] add onig_get_match_stack_limit_size() andonig_set_match_stack_limit_size().2004/04/26: [bug] add error check to re.c.181.patch and re.c.168.patch.2004/04/23: [impl] remove ctype_support_level from OnigEncodingType.2004/04/22: [spec] allow the range from single byte char to multibyte char incharacter class for implementation reason.ex. /[a-\xbb\xcc]/ in EUC-JP encoding.2004/04/21: [impl] remove max_enc_len_by_first_byte() from OnigEncodingType.2004/04/20: [new] add onig_copyright().2004/04/20: [impl] add regversion.c.2004/04/15: [new] add onig_get_ambig_flag().2004/04/14: [bug] (thanks Isao Sonobe)undefined bytecode error happens if ONIG_OPTION_FIND_LONGESTis setted.should finish matching process if find-conditionis fail at OP_END in match_at().2004/04/12: [impl] add ambig_flag to regex_t.2004/04/09: [impl] move onig_set_meta_char() to regsyntax.c.2004/04/09: [bug] (thanks HIROSE Masaaki) fix onig_version().2004/04/08: [impl] add regsyntax.c.2004/04/07: [new] support UTF-16 LE. (ONIG_ENCODING_UTF16_LE)2004/04/05: [impl] add ONIGENC_CTYPE_NEWLINE.2004/04/05: [memo] (thanks Kazuo Saito)Oniguruma 2.2.6 was merged to Ruby 1.9.0.2004/04/02: [memo] Version 2.2.6 was released.2004/03/26: [new] support UTF-16 BE. (ONIG_ENCODING_UTF16_BE)2004/03/25: [spec] support non 8-bit encodings.2004/03/16: [memo] 2.X branch for 8-bit encodings only.2004/03/16: Version 2.2.52004/03/16: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2004/03/16: [test] success in ruby 1.9.0 (2004-02-24) [i686-linux].2004/03/16: [impl] add property name to error message ofONIGERR_INVALID_CHAR_PROPERTY_NAME.2004/03/16: [spec] allow prefix 'Is' for \p{...} in ONIG_SYNTAX_PERL.add syntax op. ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS.2004/03/15: [dist] add sample/syntax.c.2004/03/15: [spec] support NOT op. in char property. \p{^...}, \P{^...}.add syntax op. ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT.2004/03/15: [spec] rename ONIG_SYN_OP2_ESC_P_CHAR_PROPERTY toONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY.2004/03/10: [impl] move ONIGERR_XXX from regenc.h to oniguruma.h,rename ONIGERR_XXX to ONIGENCERR_XXX in regenc.h.2004/03/08: [impl] (thanks eban)replace defined(__CYGWIN__) to defined(__GNUC__).2004/03/08: [bug] (thanks eban) [ruby-dev:23172]need to separate initialization for bcc32.2004/03/06: [memo] (thanks Kazuo Saito)Oniguruma 2.2.4 was merged to Ruby 1.9.0.2004/03/05: [API] change second argument type of onig_set_meta_char()from unsigned int to OnigCodePoint.2004/03/05: [dist] (thanks Kazuo Saito)add MANIFEST-RUBY.2004/03/04: Version 2.2.42004/03/04: [impl] (thanks Moriyoshi Koizumi)fix many warnings in Win32 VC++ with /W3 option.2004/03/02: Version 2.2.32004/03/02: [bug] (thanks Isao Sonobe)return invalid capture region value if capture historyis used. (OP_MEMORY_END_PUSH_REC bug)ex. /\g<p>(?@<p>\(\g<s>\)){0}(?<s>(?:\g<p>)*|){0}/.match("((())())")2004/03/02: [impl] (thanks Kazuo Saito)add :nodoc: to onig_stat_print() for RDoc.2004/03/02: [impl] don't use ONIG_SOURCE_IS_WRAPPED.2004/02/27: Version 2.2.22004/02/27: [impl] fix the position of onig_stat_print().2004/02/27: [impl] define ONIG_RUBY_DEFINE_GLOBAL_FUNCTION() in regint.hfor ignored by RDoc.2004/02/26: Version 2.2.12004/02/26: [bug] [bugs.php.net:#26677] (thanks behrens)invalid definition at onig_error_code_to_str()in the case of NOT HAVE_STDARG_PROTOTYPES.2004/02/25: Version 2.2.02004/02/25: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2004/02/24: [test] success in ruby 1.9.0 (2004-02-24) [i686-linux].2004/02/24: [bug] undefined IS_BLANK() and IS_GRAPH() was used inonigenc_is_code_ctype() in the case of Ruby M17N.2004/02/24: [new] support ISO-8859-16. (ONIG_ENCODING_ISO_8859_16)2004/02/24: [bug] should not fold match for 0xdf in iso8859_6.c.2004/02/24: [new] support ISO-8859-14. (ONIG_ENCODING_ISO_8859_14)2004/02/23: [new] support ISO-8859-13. (ONIG_ENCODING_ISO_8859_13)2004/02/23: [new] support ISO-8859-10. (ONIG_ENCODING_ISO_8859_10)2004/02/20: [bug] fix iso_8859_4_mbc_is_case_ambig().2004/02/20: [new] support ISO-8859-9. (ONIG_ENCODING_ISO_8859_9)2004/02/19: [bug] correct ctype tables for ISO-8859-3, ISO-8859-4,ISO-8859-6, ISO-8859-7, ISO-8859-8, KOI8_R.2004/02/18: [bug] wrong replaced name OnigSyntaxGnuOnigex.2004/02/17: [spec] check capture status for empty infinite loop.[ruby-dev:20224] etc...ex. /(?:\1a|())*/.match("a"),/(?:()|()|()|(x)|()|())*\2b\5/.match("b")add USE_INFINITE_REPEAT_MONOMANIAC_MEM_STATUS_CHECK.add OP_NULL_CHECK_END_MEMST, OP_NULL_CHECK_END_MEMST_PUSH.add stack type STK_NULL_CHECK_END.2004/02/13: [impl] add OnigEncodingEUC_CN to enc/euc_kr.c.2004/02/13: [bug] (thanks Simon Strandgaard)parsing of nested repeat was invalid.ex. /ab{2,3}*/ was /(?:a(?:b{2,3}))*/,should be /a(?:b{2,3}*)/2004/02/12: [bug] (thanks Simon Strandgaard)OP_REPEAT_INC_NG process in match_at() is wrong.ex. bad match /a.{0,2}?a/ =~ "0aXXXa0"2004/02/12: [bug] (thanks Simon Strandgaard)wrong fetch after (?x) option. ex. "(?x)\ta .\n+b"2004/02/12: [bug] (thanks Simon Strandgaard)[\^] is not a empty char class.2004/02/09: [new] add onig_set_syntax_op(), onig_set_syntax_op2(),onig_set_syntax_behavior(), onig_set_syntax_options().2004/02/06: [dist] add a new target 'site' to Makefile.in.2004/02/06: [dist] add index.html.2004/02/03: [bug] oniggnu.h was not installed by 'make install'.2004/02/02: Version 2.1.02004/02/02: [test] success in ruby 1.9.0 (2004-02-02) [i686-linux].2004/02/02: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/02/02: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2004/02/02: [new] support ISO-8859-11. (ONIG_ENCODING_ISO_8859_11)2004/02/02: [new] support ISO-8859-5. (ONIG_ENCODING_ISO_8859_5)2004/02/02: [impl] should check single byte encoding or not in and_cclass()and or_cclass().2004/01/30: [dist] add oniggnu.h.2004/01/30: [bug] ISO-8859-7 0xb7 (middle dot) is Punct type.2004/01/30: [new] support ISO-8859-8. (ONIG_ENCODING_ISO_8859_8)2004/01/29: [new] support ISO-8859-7. (ONIG_ENCODING_ISO_8859_7)2004/01/29: [new] support ISO-8859-6. (ONIG_ENCODING_ISO_8859_6)2004/01/28: [new] support KOI8-R. (ONIG_ENCODING_KOI8_R)2004/01/28: [new] support KOI8. (ONIG_ENCODING_KOI8)2004/01/27: [dist] rename enc/isotable.c to enc/mktable.c.2004/01/27: [new] support ISO-8859-4. (ONIG_ENCODING_ISO_8859_4)2004/01/26: [new] support ISO-8859-3. (ONIG_ENCODING_ISO_8859_3)2004/01/26: [bug] EncISO_8859_{1,15}_CtypeTable[256] was wrong.(0x80 - 0xff is not ASCII)2004/01/23: [new] support ISO-8859-2. (ONIG_ENCODING_ISO_8859_2)2004/01/23: [dist] add enc/isotable.c.2004/01/22: [new] support EUC-TW. (ONIG_ENCODING_EUC_TW)2004/01/22: [bug] definition of GET_ALIGNMENT_PAD_SIZE() andALIGNMENT_RIGHT() was wrong.type casting should be unsigned int, not int.2004/01/22: [impl] add defined(__x86_64) || defined(__x86_64__)to unaligned word access condition. (AMD64 ?)2004/01/21: [dist] rename enc/eucjp.c to enc/euc_jp.c.2004/01/21: [new] support EUC-KR. (ONIG_ENCODING_EUC_KR)2004/01/20: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2004/01/20: [dist] change Makefile.in.2004/01/20: [spec] add \p{...}, \P{...} in char class.2004/01/20: [new] character property operators \p{...}, \P{...}.supported in ONIG_SYNTAX_JAVA and ONIG_SYNTAX_PERL.2004/01/19: [spec] allow /a{,n}/ as /a{0,n}/. (but don't allow /a{,}/)2004/01/19: [dist] rename onigcomp200.h to onigcmpt200.h.2004/01/19: [dist] update re.c.168.patch. svn add re.c.181.patch.2004/01/16: [dist] update sample/*.c for new API.2004/01/16: [dist] add onigcomp200.h. (for old API compatibility)2004/01/16: [dist] update documents API, RE and RE.ja.2004/01/16: [spec] change prefix REG_ -> ONIG_, regex_ onig_,ENC_ -> ONIGENC, enc_ -> onigenc_.2004/01/15: [impl] rename ENC_IS_MBC_E_WORD() to ENC_IS_MBC_WORD().rename ENC_CTYPE_SUPPORT_LEVEL_SB_ONLY toENC_CTYPE_SUPPORT_LEVEL_SB.2004/01/14: [impl] rename UNALIGNED_WORD_ACCESS toPLATFORM_UNALIGNED_WORD_ACCESS.2004/01/14: [impl] change MATCH_STACK_LIMIT_SIZE value from 200000 to 500000.2004/01/13: [impl] remove ENC_CODE_TO_MBC_FIRST(enc,code) in regenc.h.remove code_to_mbc_first member in RegCharEncodingType.2004/01/13: [impl] remove head byte bitset information in cclass->mbuf.2003/12/26: [impl] change macro name ismb_xxxx() in enc/*.c forescape conflict.2003/12/24: Version 2.0.02003/12/24: [spec] ignore case option is effective to numbered char.ex. /\x61/i =~ "A"2003/12/24: [test] success in ruby 1.8.1 (2003-12-24) [i686-linux].2003/12/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2003/12/24: [test] success in ruby 1.8.0 (2003-08-08) [i386-mswin32].2003/12/24: [test] success in regex.c compile test on ruby-m17n.(but can't make miniruby because re.c patch fail.)2003/12/24: [bug] (thanks H.Miyamoto) /[\W]/ was wrong in 1.9.5.2003/12/22: [spec] implement fold match on UTF-8 encoding.2003/12/19: [impl] add ctype_support_level and ctype_add_codes() member toRegCharEncoding type.2003/12/19: [impl] add add_ctype_to_cc() in regparse.c.2003/12/19: [impl] add enc_is_code_ctype() in REG_RUBY_M17N case.2003/12/19: [impl] change ENC_CODE_TO_MBC() interface.2003/12/18: [new] implement fold match. (variable number of charmatch in ignore case mode.)ex. German alphabet ess-tsett(U+00DF) match "SS" and "ss".2003/12/17: [impl] refactoring of encoding system.2003/12/17: [impl] add enc_init() in regenc.c.2003/12/17: [new] support Big5. (REG_ENCODING_BIG5)2003/12/16: [impl] change CodePoint from unsigned int to unsigned long.2003/12/16: [new] support ISO 8859-15. (REG_ENCODING_ISO_8859_15)2003/12/16: [impl] change P_() macro definition condition for Win32.2003/12/16: [dist] add sample/encode.c2003/12/16: [new] support ISO 8859-1. (REG_ENCODING_ISO_8859_1)2003/12/15: [impl] rename IS_ENC_XXXX to ENC_IS_XXXX.2003/12/15: [impl] rename RegDefaultCharEncoding to EncDefaultCharEncoding.2003/12/15: [impl] divide encoding files. (enc/ascii.c, enc/utf8.c etc...)2003/12/15: [bug] unexpected infinite loop in regex_snprintf_with_pattern().change local var. type char* to UChar*.2003/12/15: [impl] remove REG_MBLEN_TABLE[].2003/12/15: [spec] rename function prefix regex_get_prev_char_head(),regex_get_left_adjust_char_head() andregex_get_right_adjust_char_head() to enc_xxxxxx().2003/12/15: [impl] rename function prefixes in regenc.h from regex_ to enc_.2003/12/12: [impl] remove USE_SBMB_CLASS.2003/12/12: [impl] rename mb -> mbc, mblen() to enc_len().2003/12/12: [impl] rename WCINT to CodePoint.2003/12/11: [impl] delete IS_XXXX() ctype macros from regint.h.2003/12/11: [impl] add enc->wc_is_ctype() and RegAsciiCtypeTable[256].2003/12/11: [impl] remove RegAsciiCaseAmbigTable.2003/12/10: [impl] use ENC_TO_LOWER() for ignore case comparison.2003/12/08: [impl] *** re-defined RegCharEncoding in oniguruma.h. ***2003/12/08: [impl] add USE_POSIX_REGION_OPTION to regint.h.2003/12/08: [impl] add IS_ENC_WORD() to regenc.h.2003/12/05: [impl] rename IS_CODE_XXXX() to IS_ENC_XXXX().2003/12/05: [impl] delete IS_CODE_WORD() from regenc.h.2003/12/04: [spec] rename REG_SYN_OP_BACK_REF to REG_SYN_OP_DECIMAL_BACKREF.2003/12/04: [spec] add (REG_SYN_OP_ESC_W_WORD | REG_SYN_OP_ESC_B_WORD_BOUND |REG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | REG_SYN_OP_BACK_REF)to RegSyntaxGrep.2003/12/04: [spec] remove REG_ENCODING_DEFAULT and REGCODE_DEFAULT.2003/12/04: [spec] move declarations of regex_get_default_encoding() andregex_set_default_encoding() from oniguruma.h to regenc.h.2003/12/03: [new] add regex_get_default_encoding() andregex_set_default_encoding().2003/12/03: [spec] REG_ENCODING_DEFAULT meaning is changed.(current default value, not initial default value.)2003/12/03: [spec] REGCODE_XXX is obsoleted. use REG_ENCODING_XXX.2003/12/02: [memo] alias svnst='svn status | grep -v "^\?"'2003/12/02: [spec] move regex_set_default_trans_table() declarationfrom oniguruma.h to regenc.h. (obsoleted API)2003/12/02: [impl] move variables RegDefaultCharEncoding, DefaultTransTable andAmbiguityTable to regenc.c.2003/12/01: [impl] add regex_continuous_sbmb() to regenc.c.2003/12/01: [dist] add regenc.h and regenc.c.2003/11/18: [dist] change testconv.rb.2003/11/18: [bug] (thanks Masaru Tsuda)memory leak in parse_subexp().2003/11/18: [bug] (thanks Masaru Tsuda)memory leak in names_clear() and parse_char_class().2003/11/17: [bug] memory leak in parse_char_class().2003/11/17: [bug] (thanks Masaru Tsuda)OptExactInfo length should not over OPT_EXACT_MAXLEN.(concat_opt_exact_info_str())2003/11/12: Version 1.9.52003/11/12: [test] success in ruby 1.8.0 (2003-08-08) [i386-cygwin].2003/11/12: [test] success in ruby 1.8.1 (2003-11-11) [i686-linux].2003/11/12: [spec] add definition of REG_INEFFECTIVE_META_CHAR.2003/11/11: [dist] add a sample program sample/sql.c.2003/11/11: [new] add variable meta character.regex_set_meta_char()2003/11/11: [spec] add syntax op. REG_SYN_OP_VARIABLE_META_CHARS.2003/11/11: [spec] rename REG_SYN_OP_ESC_CAPITAL_Q_QUOTE toREG_SYN_OP2_ESC_CAPITAL_Q_QUOTE,REG_SYN_OP_QMARK_GROUP_EFFECT toREG_SYN_OP2_QMARK_GROUP_EFFECT.2003/11/06: [impl] define THREAD_PASS as rb_thread_schedule() in Ruby mode.2003/11/05: [spec] add syntax behavior REG_SYN_WARN_REDUNDANT_NESTED_REPEAT.2003/11/05: [spec] rename REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPED toREG_SYN_WARN_CC_OP_NOT_ESCAPED.2003/11/04: [new] add regex_set_warn_func() and regex_set_verb_warn_func().2003/10/30: [new] add regex_name_to_backref_number().(for multiplex definition name, see sample/names.c)2003/10/30: [spec] add name_end and reg argument to callback function ofregex_foreach_name(). (see sample/names.c)2003/10/29: [spec] add syntax behavior REG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME.add error code REGERR_MULTIPLEX_DEFINED_NAME.2003/10/14: [dist] modify sample/simple.c.2003/10/03: [bug] (thanks nobu) [ruby-dev:21472]sub-anchor of optimization map info was wrongin concat_left_node_opt_info().ex. /^(x?y)/ = "xy" fail.2003/09/17: Version 1.9.42003/09/17: [spec] change specification of char-class range in ignore case modefollows with Ruby 1.8(2003-09-17).ex. /[H-c]/i ==> (H-Z, 0x5b-0x60, a-c)/i==> H-Z, h-z, 0x5b-0x60, a-c, A-C2003/09/16: [bug] (thanks Guy Decoux)remove env->option == option check in parse_effect().change env->option for dynamic option in parse_exp().(ex. bad match /(?i)(?-i)a/ =~ "A")2003/09/12: [spec] rename REG_SYN_ALLOW_RANGE_OP_IN_CC toREG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC,REG_SYN_ESCAPE_IN_CC to REG_SYN_BACKSLASH_ESCAPE_IN_CC.2003/09/11: [bug] change to IS_SYNTAX_OP2 at REG_SYN_OP2_ESC_GNU_BUF_ANCHOR.2003/09/09: [spec] rename REG_SYN_OP2_ESC_M_BAR_META toREG_SYN_OP2_ESC_CAPITAL_M_BAR_META,REG_SYN_OP_ESC_Q_QUOTE to REG_SYN_OP_ESC_CAPITAL_Q_QUOTE,REG_SYN_OP_ESC_SUBEXP to REG_SYN_OP_ESC_LPAREN_SUBEXP,REG_SYN_OP_ESC_BUF_ANCHOR to REG_SYN_OP_ESC_AZ_BUF_ANCHOR,REG_SYN_OP_ESC_GNU_BUF_ANCHOR toREG_SYN_OP2_ESC_GNU_BUF_ANCHOR,REG_SYN_OP_ESC_CONTROL_CHAR to REG_SYN_OP_ESC_CONTROL_CHARS,REG_SYN_OP_ESC_WORD to REG_SYN_OP_ESC_W_WORD,REG_SYN_OP_ESC_WORD_BEGIN_END toREG_SYN_OP_ESC_LTGT_WORD_BEGIN_END,REG_SYN_OP_ESC_WORD_BOUND to REG_SYN_OP_ESC_B_WORD_BOUND,REG_SYN_OP_ESC_WHITE_SPACE to REG_SYN_OP_ESC_S_WHITE_SPACE,REG_SYN_OP_ESC_DIGIT to REG_SYN_OP_ESC_D_DIGIT,REG_SYN_OP_CC to REG_SYN_OP_BRACKET_CC,REG_SYN_OP2_CCLASS_SET to REG_SYN_OP2_CCLASS_SET_OP,REG_SYN_CONTEXT_INDEP_OPS toREG_SYN_CONTEXT_INDEP_REPEAT_OPS,REG_SYN_CONTEXT_INVALID_REPEAT_OPS toREG_SYN_CONTEXT_INVALID_REPEAT_OPS.add REG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR.2003/09/08: [spec] rename REG_SYN_OP_ANYCHAR to REG_SYN_OP_DOT_ANYCHAR,REG_SYN_OP_0INF to REG_SYN_OP_ASTERISK_ZERO_INF,REG_SYN_OP_ESC_0INF to REG_SYN_OP_ESC_ASTERISK_ZERO_INF,REG_SYN_OP_1INF to REG_SYN_OP_PLUS_ONE_INF,REG_SYN_OP_ESC_1INF to REG_SYN_OP_ESC_PLUS_ONE_INF,REG_SYN_OP_0INF to REG_SYN_OP_QMARK_ZERO_ONE,REG_SYN_OP_ESC_0INF to REG_SYN_OP_ESC_QMARK_ZERO_ONE,REG_SYN_OP_INTERVAL to REG_SYN_OP_BRACE_INTERVAL,REG_SYN_OP_ESC_INTERVAL to REG_SYN_OP_ESC_BRACE_INTERVAL,REG_SYN_OP_SUBEXP to REG_SYN_OP_LPAREN_SUBEXP,REG_SYN_OP_ALT to REG_SYN_OP_VBAR_ALT,REG_SYN_OP_ESC_ALT to REG_SYN_OP_ESC_VBAR_ALT,REG_SYN_OP_NON_GREEDY to REG_SYN_OP_QMARK_NON_GREEDY,REG_SYN_OP_SUBEXP_EFFECT to REG_SYN_OP_QMARK_GROUP_EFFECT,REG_SYN_OP2_POSSESSIVE_{REPEAT,INTERVAL} toREG_SYN_OP2_PLUS_POSSESSIVE_{REPEAT,INTERVAL},REG_SYN_OP2_SUBEXP_CALL to REG_SYN_OP2_ESC_G_SUBEXP_CALL,REG_SYN_OP2_NAMED_GROUP to REG_SYN_OP2_QMARK_LT_NAMED_GROUPand REG_SYN_OP2_ESC_K_NAMED_BACKREF.2003/09/02: [tune] call reduce_nested_qualifier() after disabling capture forno-name group in noname_disable_map().ex. /(a+)*(?<name>...)/2003/09/02: [impl] include <stdio.h> is forgotten to erase in regcomp.c.2003/09/01: [dist] update doc/RE and doc/RE.ja.2003/08/26: [bug] (thanks Guy Decoux)should not double free node at the case TK_CC_CC_OPENin parse_char_class().2003/08/19: Version 1.9.32003/08/19: [inst] change re.c.180.patch.2003/08/19: [impl] rename 'list of captures' to 'capture history'.2003/08/19: [dist] add doc/RE.ja. (Japanese)2003/08/19: [new] add regex_copy_syntax().2003/08/19: [spec] rename REG_SYN_OP2_ATMARK_LIST_OF_CAPTURES toREG_SYN_OP2_ATMARK_CAPTURE_HISTORY.2003/08/18: [spec] (thanks nobu)don't use IMPORT in oniguruma.h and onigposix.h.2003/08/18: [impl] (thanks nobu) change error output to stdout in testconv.rb.2003/08/18: [inst] (thanks nobu) lacked $(srcdir) in Makefile.in.2003/08/18: [bug] REG_MBLEN_TABLE[SJIS][0xFD-0xFF] should be 1.2003/08/18: [bug] (thanks nobu) mbctab_sjis[0x80] should be 0.2003/08/18: [bug] (thanks nobu)single/multi-byte decision was wrong in parse_char_class().add regex_wc2mblen().should not set fetched to 1 in TK_RAW_BYTE case.2003/08/18: [bug] should update BitSet in the case inc_n >= 0in add_wc_range_to_buf().2003/08/13: [bug] change re.c.180.patch for fix rb_reg_to_s() in re.c.2003/08/11: [bug] should clear region->list in regex_region_resize().2003/08/08: Version 1.9.22003/08/08: [test] success in ruby 1.8.0 (2003-08-08) on Windows 2000VC++ 6.0 and Cygwin.2003/08/08: [impl] don't define macro vsnprintf for WIN32 platform,because definition is added in win32\win32.h.2003/08/08: [test] success in ruby 1.8.0 and ruby 1.6.8(2003-08-03) on Linux.2003/08/08: [dist] change re.c.180.patch and re.c.168.patch.2003/08/08: [new] (thanks akr)implemented list of captures. (?@...), (?@<name>...)2003/08/07: [dist] add sample/listcap.c.2003/08/06: [bug] OP_MEMORY_END_PUSH_REC case in match_at().renewal of mem_start_stk[] should be afterSTACK_PUSH_MEM_END() call.2003/07/29: [new] add regex_get_encoding(), regex_get_options() andregex_get_syntax().2003/07/25: [spec] (thanks akr)change group(...) to shy-group(?:...) if named group isused in the pattern.add REG_SYN_CAPTURE_ONLY_NAMED_GROUP.2003/07/24: [spec] rename REG_OPTION_CAPTURE_ONLY_NAMED_GROUP toREG_OPTION_DONT_CAPTURE_GROUP.add REG_OPTION_CAPTURE_GROUP.2003/07/17: [spec] rename REG_SYN_OP2_NAMED_SUBEXP to REG_SYN_OP2_NAMED_GROUP.2003/07/17: [spec] add REGERR_EMPTY_GROUP_NAME.2003/07/17: [spec] rename REGERR_INVALID_SUBEXP_NAMEto REGERR_INVALID_CHAR_IN_GROUP_NAME.2003/07/17: [spec] restrict usable chars of group name to alphabet, digit,'_' or multibyte-char in fetch_name(). [ruby-dev:20706]2003/07/16: [impl] minor change of sample/names.c.2003/07/14: [impl] rename USE_NAMED_SUBEXP to USE_NAMED_GROUP.2003/07/14: [bug] add fetch_name() for USE_NAMED_SUBEXP off case.2003/07/14: [API] add regex_number_of_names().2003/07/08: [impl] change error message for undefined group number call.'undefined group reference: /(a)\g<2>/'--> 'undefined group <2> reference: /(a)\g<2>/'2003/07/08: [dist] modify doc/RE.2003/07/07: [impl] OP_SET_OPTION is not needed in compiled code.add IS_DYNAMIC_OPTION() to regint.h.2003/07/07: [spec] called group should not ignore outside option (?i:...).ex. /(?i:(?<n>(a)\2)){0}\g<n>/.match("aA")add opcode OP_BACKREFN_IC and OP_BACKREF_MULTI_IC.set option status to effect memory in optimize_node_left().2003/07/07: [impl] add opcode OP_ANYCHAR_ML, OP_ANYCHAR_ML_STAR andOP_ANYCHAR_ML_START_PEEK_NEXT.2003/07/07: [bug] (thanks nobu) REG_MBLEN_TABLE[SJIS][0x80] should be 1.2003/07/07: [spec] rename REG_SYN_OP_QUOTE to REG_SYN_OP_ESC_Q_QUOTE.2003/07/04: Version 1.9.12003/07/04: [new] add REG_OPTION_CAPTURE_ONLY_NAMED_GROUP. (thanks .NET)2003/07/04: [spec] check mbuf member in the case ofREG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC in parse_char_class().2003/07/04: [spec] typo REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED.should be REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPED.2003/07/04: [bug] conflict values on REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED andREG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC. (thanks nobu)2003/07/03: [spec] add REG_SYN_OP_ESC_CONTROL_CHAR flag.2003/07/03: [spec] remove REG_SYN_OP_ESC_OCTAL3 and REG_SYN_OP_ESC_X_HEX2flag from RegSyntaxGnuRegex.2003/07/03: [spec] remove REG_SYN_OP_NON_GREEDY flag from RegSyntaxGnuRegex.2003/07/02: [dist] fix doc/RE.2003/07/01: [impl] add config flag USE_VARIABLE_SYNTAX.(turn off variable syntax on Ruby)2003/07/01: [spec] add syntax behavior REG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND.2003/06/30: [spec] allow different length top-level alternativesin look-behind. ex. (?<=abc|abcd), (?<!a|bc)2003/06/26: [spec] add option REG_OPTION_NEGATE_SINGLELINE.2003/06/26: [spec] should default on REG_OPTION_SINGLELINEfor REG_SYNTAX_PERL and REG_SYNTAX_JAVA.2003/06/26: [impl] add options member to RegStntaxType.2003/06/26: [spec] don't change the meaning of '\Z' for REG_OPTION_SINGLELINE.2003/06/25: [dist] don't use option REG_NEWLINE for sample/posix.c.2003/06/25: [dist] modify testconv.rb.should match and convert double quoted string data.ex. x(/\ca/, "\001", 0, 1)2003/06/25: [impl] add REG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL andREG_SYN_OP2_ESC_M_BAR_META.2003/06/25: [impl] add REG_SYN_OP_ESC_OCTAL3 and REG_SYN_OP_ESC_X_HEX2.2003/06/24: [impl] add REG_SYN_OP2_ESC_V_VTAB. (\v is VTAB)2003/06/24: [bug] should invert REG_OPTION_SINGLELINE flagin REG_SYN_OP2_OPTION_PERL.2003/06/24: [impl] add REG_SYN_OP2_OPTION_PERL and REG_SYN_OP2_OPTION_RUBY.meaning of (?m) and (?s) are depend on syntax.2003/06/20: Version 1.9.02003/06/20: [spec] \Q...\E is not effective on REG_SYNTAX_RUBY. (thanks akr)2003/06/19: [inst] rename regex.h to oniguruma.h.2003/06/18: [impl] change REG_EXTERN setting condition. (__CYGWIN__)2003/06/18: [bug] return wrong result UTF-8 case in regex_mb2wc().2003/06/18: [impl] add REG_SYN_OP2_POSSESSIVE_INTERVAL. a{n,m}+2003/06/18: [new] add REG_SYNTAX_JAVA.2003/06/18: [spec] add REG_SYN_OP_QUOTE.2003/06/18: [spec] add op2 member to RegSyntaxType.rename some REG_SYN_OP_XXX to REG_SYN_OP2.2003/06/16: [new] Perl-like quotation operator \Q, \E.2003/06/16: [spec] should not control ignore case mode by escaped char.ex. /\J/i =~ "j", /[\J]/i =~ "j" (same as Perl)2003/06/13: [bug] modify onigposix.h.2003/06/13: [bug] should use -DIMPORT for link with DLL in win32/Makefile.2003/06/13: [dist] add sample/names.c2003/06/12: [bug] range should be from - 1 in not_wc_range_buf().2003/06/12: [spec] should warn for '-' before '&&' operator in char-class.2003/06/12: [new] add REG_SYNTAX_PERL.2003/06/12: [spec] add syntax behavior REG_SYN_WARN_FOR_CC_OP_NOT_ESCAPEED.2003/06/12: [spec] invalid POSIX bracket should be error. ex. [[:upper :]]2003/06/11: [new] char-class in char-class (as Java(TM)).2003/06/11: [spec] change AND operator in char-class from &&[..] to &&.2003/06/04: [spec] {n,m}+ should not be possessive operator.ex. a{3}+ should be (?:a{3})+2003/06/03: [bug] should compare strings with min-length in is_not_included().2003/06/03: [impl] automatic possessivate optimization. a*b ==> (?>a*)b(thanks Jeffrey E. F. Friedl)2003/06/02: [impl] remove multibyte-BitSet for OP_CCLASS_MB/OP_CCLASS_MB_NOT.2003/05/30: [new] char class intersection operator &&[...] like Java(TM).(thanks akr)2003/05/30: [bug] should use bbuf_free() for CClassNode in regex_node_free().2003/05/29: [bug] wrong usage of syntax REG_SYN_ALLOW_EMPTY_RANGE_IN_CC./[d-a]/ should be error.2003/05/28: [impl] optimize stop-backtrack compiled code.(/(?>a*)/, /(?>\w+)/ etc...)add OP_POP opcode.2003/05/28: [new] possessive repeat operator. (?+, *+, ++, {n,m}+)2003/05/27: [spec] '-' at beginning of char-class should be warn only ifit is start of range. (ex. /[--a]/)2003/05/27: [spec] should not warn for right bracket at beginning of pattern.ex. /]aaa/2003/05/27: [spec] change CCEND_ESC_WARN() from VERB_WARNING() to WARNING().2003/05/27: [spec] /[]aaa/ should be empty char-class error./[]aaa]/ should be warn for 'without backslash'.(add char_exist_check() in regparse.c)2003/05/26: [bug] OP_REPEAT in recursive subexp call.ex. /(?<n>(a|b\g<n>c){3,5})/.match("baaaaca") => "baaaaca"was wrong result. (should be "aaaa")2003/05/26: [impl] add num_call member to regex_t.2003/05/26: [impl] add repeat_range member to regex_t.(for delete upper,lower members from StackType.u.repeat)2003/05/26: [bug] change print_names() to external regex_print_names().2003/05/26: [tune] change OP_NULL_CHECK_END process in match_at().2003/05/26: [spec] change CCEND_ESC_WARN() from WARNING() to VERB_WARNING().2003/05/26: [spec] remove POSIXLINE option. (?p:...)(be made the same as Ruby.)2003/05/22: [spec] use OP_NULL_CHECK_XXX only if repeat is infinite.prev. /(?:()|()){0,10}\1\2/ =~ "" ==> FAILnow /(?:()|()){0,10}\1\2/ =~ "" ==> MATCH2003/05/22: [impl] change target_empty setting condition in setup_tree().2003/05/19: [impl] avoid zero length repeat optimization. (thanks matz)/()*/ ==> /()?/, /()+/ ==> /()/ etc...2003/05/19: [impl] minor changes for gcc -Wall. (-DREG_DEBUG_STATISTICS case)2003/05/19: [spec] rename regex_foreach_names() to regex_foreach_name().2003/05/16: [new] add --with-statistics option to configure.2003/05/16: [bug] move RegOpInfo[] definition to regint.h.2003/05/16: [new] add regex_version().2003/05/14: Version 1.8.62003/05/14: [bug] use _vsnprintf() on Win32.2003/05/14: [spec] define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE.(/\n$/ =~ "\n", /\n\Z/ =~ "\n") [ruby-dev:20125]2003/05/14: [impl] minor changes for gcc -Wall.2003/05/14: [impl] add string.h check in AC_CHECK_HEADERS().2003/05/13: [impl] minor changes for gcc -Wall.2003/05/13: [impl] add regex_snprintf_with_pattern().2003/05/13: [spec] add warning for char class meta character without escapein Ruby mode ('[', '-', ']').2003/05/13: [impl] define WARNING() and VERB_WARNING() in regint.h.2003/05/13: [bug] correct is_code_ascii() for /[[:ascii:]]/.2003/05/12: [dist] add regular expression document (doc/RE).2003/05/12: [spec] specification of $(END_LINE) was made the same as Ruby 1.8.[ruby-dev:20130] (thanks matz)2003/05/12: [memo] shifted to Subversion(version 0.21.0) from CVS.2003/03/19: Version 1.8.52003/03/19: [impl] change REG_EXTERN definition. (thanks nobu)2003/03/19: [impl] abbreviation for long error_par in regex_error_code_to_str().2003/03/18: [dist] change re.c.XXX.patch for GNU regex API changes.2003/03/18: [spec] change API regex_new(), regex_recompile() andregex_error_code_to_str().change API re_compile_pattern() and re_recompile_pattern().2003/03/18: [spec] replace REGERR_END_PATTERN_AT_GROUP_{COMMENT|OPTION} toREGERR_END_PATTERN_IN_GROUP.2003/03/17: [impl] should free err_arg.2003/03/17: [bug] mistake(high -> to) in add_wc_range_to_buf().2003/03/17: [spec] add err_arg argument to regex_new() and regex_recompile().for detail error message. (thanks akr)2003/03/12: Version 1.8.42003/03/12: [tune] use cached value of effect node in get_min_match_length().2003/03/12: [bug] escaped alphabet should be TK_RAW_BYTEin fetch_token() and fetch_token_in_cc().2003/03/12: [spec] change named backref and subexp call format.backref: \k<name>, call: \g<name> (thanks akr)2003/03/11: [inst] add regparse.[ch] in win32/Makefile.2003/03/11: [bug] if UNALIGNED_WORD_ACCESS isn't settedthen compile error in unset_addr_list_fix(). (thanks knu)2003/03/10: [impl] divide regcomp.c to regcomp.c, regparse.c and regparse.h.2003/03/10: [bug] should handle multi-byte code name in fetch_name().2003/03/10: [spec] remove REGERR_TABLE_FOR_IGNORE_CASE_IS_NOT_SETTED.2003/03/10: [spec] support POSIX API option REG_NOSUB.add comp_options member to POSIX API regex_t.2003/03/10: Version 1.8.32003/03/10: [bug] can not compile with Ruby 1.6.8.(inconsistent st.h with 1.6 and 1.8)use hash table on Ruby 1.8 only.2003/03/10: [spec] forbid to use '\' in group name.2003/03/08: [impl] remove check_backref_number().2003/03/08: [bug] called group in 0-repeat should not be eliminated fromcompile code. ex. /(?*n)(?<n>){0}/ (thanks akr)add is_refered member to QualifierNode.2003/03/07: [impl] use hash table(st.[ch]) for implementation of name table.(enable on Ruby in default)2003/03/07: [new] add regex_foreach_names().2003/03/06: [impl] add member reg->stack_pop_level.2003/03/06: [impl] add operator OP_MEMORY_START and member reg->backtrack_mem.2003/03/06: [bug] if REG_OPTION_FIND_LONGEST or REG_OPTION_NOT_EMPTY,should handle backtrack of MEM_END.add OP_MEMORY_END_PUSH and OP_MEMORY_END_PUSH_REC.2003/03/06: [impl] rename OP_MEMORY_END_PUSH to OP_MEMORY_END_MARK.2003/03/06: [spec] change error messages.2003/03/06: [tune] add tiny_pop check in STACK_POP.2003/03/05: Version 1.8.22003/03/05: [impl] use cache info in EFFECT_MEMORY casein optimize_node_info().2003/03/05: [impl] add EFFECT_MEMORY node reference count checkin optimize_node_left().2003/03/05: [impl] add min-len, max-len, char-len cache in EffectNode.2003/03/05: [spec] allow to call in look behind. ex. /(?<=(?*a))/2003/03/05: [bug] forgotten N_ANCHOR case in check_backref_number(),subexp_inf_recursive_check_trav() etc...2003/03/05: [impl] rename USE_ONIGURUMA_EXTENSION to USE_SBMB_CLASS.2003/03/04: [impl] add CALL-node info in optimize_node_left().2003/03/04: [spec] prohibit left recursion of subexp call. ex. (?<n>|(?*n)a)add subexp_inf_recursive_check_trav().2003/03/04: [spec] rename REG_SYN_STRICT_CHECK_BACKREF_NUMBERto REG_SYN_STRICT_CHECK_BACKREF2003/03/03: [bug] /(?<n>a(?*n)|)/ isn't infinite recursion.fix N_LIST case in subexp_recursive_check(). (thanks akr)2003/03/03: [bug] /(?<n>|(?*n))+/ segmentation fault.should re-allocate in unset_addr_list_add(). (thanks akr)2003/03/01: Version 1.8.12003/03/01: [bug] change STACK_GET_MEM_START() and STACK_PUSH_MEM_END().2003/03/01: [new] add reg_name_to_group_numbers() to POSIX API.2003/03/01: [impl] use OP_MEMORY_END_PUSH in callable subexp compiled codeonly if subexp is recursive.2003/03/01: [spec] rename regex_name_to_backrefs() toregex_name_to_group_numbers().2003/02/28: [impl] use function stack_double() instead of macro.2003/02/28: [new] subexp call. (?*name) (thanks akr)2003/02/28: [spec] add match stack limit check. (MATCH_STACK_LIMIT_SIZE)2003/02/28: [impl] check recursive subexp call.2003/02/28: [impl] add opcode OP_MEMORY_END_PUSH for callable subexp.2003/02/28: [impl] add opcode OP_CALL, OP_RETURN.add stack type STK_CALL_FRAME, STK_RETURN, STK_MEM_END.2003/02/26: [spec] add new syntax behavior REG_SYN_STRICT_CHECK_BACKREF_NUMBER.if it is setted, then error /(\1)/, /\1(..)/ etc...2003/02/26: [spec] if backref number is greater than max group number,then return compile error. (REGERR_INVALID_BACKREF_NUMBER)2003/02/26: [tune] bad implemented N_ALT case in get_min_match_length().2003/02/26: [dist] auto update testc.c and win32/testc.c in dist target.2003/02/26: [impl] add -win option to testconv.rb.2003/02/25: [spec] allow to assign same name to different group.add OP_BACKREF_MULTI.2003/02/24: [impl] reduce redundant repeat of empty target.ex. /()*/ ==> /()?/, /()+/ ==> /()/, /(?:)+/ ==> //2003/02/24: [impl] change condition in regex_is_allow_reverse_match().2003/02/24: [impl] convert i(/../, ...) functions in testconv.rb.2003/02/24: [impl] change name table struct.2003/02/22: Version 1.8.02003/02/22: [new] named subexp, named back reference. (thanks akr)define: (?<name>...), back-ref: \g<name>2003/02/22: [impl] use str_node_can_be_split().2003/02/21: [dist] add sample/posix.c2003/02/21: [spec] rename some error code symbols.2003/02/21: [spec] max number of multibyte ranges(255) is small.255 --> 1000. (thanks MoonWolf)2003/02/20: [new] supported Basic Regular Expression(BRE) in POSIX API.(REG_EXTENDED option: Extended RE)2003/02/20: [new] variable syntax.2003/02/12: Version 1.7.22003/02/12: [bug] mismatch /\?a/i.match('?A').check raw value in scan_make_node() and scan_backslash().(thanks Nobu)2003/02/12: [impl] rename 'max_mem' to 'num_mem' in regex_t.2003/02/12: [impl] rename 'code' to 'enc' in regex_t.2003/02/12: [spec] remove transtable argument in regex_new and regex_recompile.remove transtable member in regex_t.2003/02/10: [inst] change backup file suffix name from '.orig' to '.ruby_orig'.(win32/Makefile)2003/02/10: [spec] number check in scan_char_class() ignore-case mode.ex. /[\x58-\x64]/i2003/02/10: [impl] don't use OP_MEMORY_END_PUSH (and STK_MEM_END).2003/02/10: [impl] lift up head_exact value from child qualifier node to parent.2003/02/10: [tune] change stack type values.2003/02/10: [dist] add HISTORY.2003/02/08: [tune] change stack type values.2003/02/08: [tune] add STACK_BASE_CHECK().2003/02/08: [tune] add STACK_PUSH_ENSURED().2003/02/08: [dist] change contents of doc/API.2003/02/07: [inst] change backup file suffix name from '.orig' to '.ruby_orig'.2003/02/07: [spec] range in char-class should be same spec. with Rubyin ignore-case mode. (ex. /[A-c]/i == /[a-c]/i)(thanks MoonWolf)2003/02/07: [spec] [!--] should be allowed. (thanks MoonWolf)2003/02/07: [dist] refresh re.c.180.patch for re.c (2003-02-06).2003/02/07: Version 1.7.12003/02/07: [impl] check first byte of string in ignore-case mode.(get_head_exact_node())2003/02/07: [impl] remove redundant statements in setup_tree().2003/02/06: [new] create Win32 DLL.2003/02/06: [impl] use P_() macro for function prototype.2003/02/06: [impl] add HAVE_PROTOTYPE, HAVE_STDARG_PROTOTYPES inconfigure.in and config.h.in.2003/02/06: [spec] /[0-9-a]/ is allowed as usual char '-' and 'a' in Ruby.add USE_BETTER_COMPATIBILITY_FOR_ORIGINAL_REGEX inregint.h. (thanks MoonWolf)2003/02/06: [spec] rename REG_MBCTYPE_XXXX to REG_ENCODING_XXXX in onigposix.h.2003/02/05: [spec] rename MBCTYPE_XXXX to REG_MBCTYPE_XXXX in onigposix.h.2003/02/05: [spec] add POSIX API error REG_EONIG_THREAD to onigposix.h.2003/02/05: [dist] add .cvsignore file.2003/02/04: Version 1.72003/02/04: [bug] typo miss in regex_region_copy().2003/02/04: [impl] change THREAD_PASS macro. (regint.h)2003/02/04: [dist] add API document file doc/API.2003/02/04: [tune] if sub_anchor has ANCHOR_BEGIN_LINE thenset REG_OPTIMIZE_EXACT_BM in set_optimize_exact_info().2003/02/04: [spec] reimplement regex_clone() and it is obsoleted.2003/02/04: [bug] add REGERR_OVER_THREAD_PASS_LIMIT_COUNTto regerror.c regposix.c.2003/02/03: [bug] Hankaku-Kana may be second byte in Shift_JISregex_is_allow_reverse_match().2003/02/03: [impl] add optimization type REG_OPTIMIZE_EXACT_BM_NOT_REV.remove exact_allow_reverse_match member in regex_t.2003/02/03: [impl] add exact_allow_reverse_match member in regex_t.2003/02/03: [impl] compile-search conflict in regex_search() is handled.2003/02/01: [tune] decrease regex_region_clear() calling from regex_search().2003/02/01: [tune] remove region argument from match_at().2003/01/31: [tune] don't use strlen() in regexec() and regcomp().2003/01/31: [tune] decrease regex_reduce_chain() calling in regex_search().2003/01/31: [bug] STRING_CMP() in regexec.c was wrong in ignore-case.2003/01/31: [impl] convert to lower-case char at string compile time.change SBTRANSCMP() in regexec.c.2003/01/31: [impl] rename TTRANS() to TOLOWER().2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile.2003/01/30: [impl] add -DNOT_RUBY to Makefile.in.NOT_RUBY is refered in regint.h for escape doubleincluding config.h.2003/01/30: [impl] when string hasn't case ambiguity, don't compileto ignore case opcode.2003/01/29: [impl] add SJIS, UTF-8 test_sb() test.2003/01/29: [dist] add INSTALL-RUBY file.2003/01/28: [test] success in Cygwin, Ruby 1.8.0 (2003-01-27).2003/01/24: [inst] add rback target to Makefile.in.2003/01/24: [impl] change SBCMP() -> IS_NEWLINE() in match_at().2003/01/23: [impl] add encoding arg to scan_xxxx_number().2003/01/23: [impl] rename WCInt to WCINT.2003/01/22: [bug] POSIX API regexec() was not thread safe.remove region member from POSIX regex_t.[new] add search time option REG_OPTION_POSIX_REGION.(region argument is treated as regmatch_t[] type)speed up regexec().2003/01/22: [memo] start CVS entry in my box.2003/01/21: Version 1.62003/01/21: [test] Mac OS X 10.1, Ruby 1.8.0 (2003-01-20)2003/01/20: [impl] add UTF-8 check to test.rb. (thanks UENO Katsuhiro)2003/01/18: [impl] change REGION_NOTPOS to REG_REGION_NOTPOS in regex.h.2003/01/17: [dist] add sample/simple.c.2003/01/17: [inst] add configure option --with-rubydir.2003/01/17: [bug] bad implemeted POSIX API options.default: /./ not match "\n", anchor not match "\n"REG_NEWLINE: /./ not match "\n", anchor match "\n"2003/01/16: [impl] rewrite POSIX API regexec() for speed up.2003/01/16: [impl] add region member to POSIX regex_t struct.2003/01/16: [inst] rename library file from 'libregex.a' to 'libonig.a'.2003/01/15: [dist] add testc.c to distribution file.2003/01/15: [test] success in 'make rtest/ctest/ptest' on Windows 2000.2003/01/15: [bug] change '/' to \' in win32/Makefile.2003/01/14: [test] success in Ruby make test on Windows 2000.VC++6.0, Ruby 1.6.8 (2003-01-12)2003/01/14: [inst] change Makefile.in and win32/Makefile.2003/01/11: [inst] changes for Win32 platform. (regint.h, reggnu.c, regcomp.c)2003/01/11: [dist] add win32 directory. (config.h, Makefile, testc.c)2003/01/10: [inst] add onigposix.h to install target. (Makefile.in)2003/01/10: [bug] lacked a comma in ESTRING[]. (regposerr.c)2003/01/10: [bug] local variable name was wrong. buf -> tbuf (regerror())2003/01/10: [spec] remove REG_RUBY_M17N case from onigposix.h and regposix.c.2003/01/09: Version 1.52003/01/09: [inst] replace Ruby re.c.XXX.patch files. (166 -> 168, 172 -> 180)2003/01/09: [new] implement POSIX API. (thanks knu)(onigposix.h, regposix.c, regposerr.c)2003/01/08: [spec] remove REGERR_END_PATTERN_AFTER_BACKSLASH in regex.h.2003/01/08: [spec] region arg can be NULL in regex_search() and regex_match().2003/01/08: Version 1.42003/01/08: [inst] add test program converter (test.rb -> testc.c).2003/01/08: [bug] move GET_WCINT() from regcomp.c to regint.h.2003/01/07: [inst] add new test script (test.rb).2002/12/30: [bug] wrong merge in multibyte mode (alt_merge_opt_exact_info()).2002/12/28: [inst] add rtest target to Makefile.in.2002/12/28: [bug] /\xfe/.match("\xfe") mismatch in multibyte mode.add "raw" flag arg to concat_opt_exact_info_str().2002/12/25: [bug] check condition was wrong in alt_merge_opt_map_info().2002/12/25: [impl] add threshold_len check in regex_search().2002/12/23: [bug] prec-read in alternative (/a|(?=z).f/.match("zf") => nil)2002/12/23: [bug] \G in alternative (/a|\Gz/.match("bza") => "z").add start member in MatchArg. (regexec.c)2002/12/21: [impl] **** rewrite all optimization process. ****2002/12/16: [impl] remove node subtype EFFECT_EMPTY.2002/12/12: [impl] reconstruct node types. (regcomp.c)2002/12/11: [impl] add regerror.c2002/12/10: [bug] [ruby-dev:19042] (thanks Nobu)anchor(\G etc...) influenced outside of "|". (/a|\Gb/)2002/11/30: [bug] [ruby-dev:18966] (thanks Nobu)char-class(\S, [^\s] etc...) optimize map-info was wrong.2002/11/29: [bug] infinite loop on NULL-pointer str search (regex_search()).(thanks matz)2002/11/29: [bug] change static -> extern (regex_chain_reduce()).2002/11/29: [bug] change encoding to RegDefaultCharEncodingin re_recompile_pattern(). (adapt to re.c)2002/04/24: [spec] USE_ONIGURUMA_EXTENSION is disabled in default.2002/04/24: [new] add searching time option: REG_OPTION_NOTBOL/NOTEOL.add searching time option argument to regex_search() andregex_match(). (prepare for POSIX API)2002/04/20: [impl] divide regex.c file into regcomp.c, regexec.c, reggnu.cand regint.h.2002/04/09: [impl] move IS_MULTILINE() to outside of loop in OP_ANYCHAR_STAR.2002/04/08: [impl] don't use OP_REPEAT operator for '??'.2002/04/06: [impl] reduce redundant nested repeat operators(?,*,+,??,*?,+?).ex. (?:a*)?, (?:a??)* etc..2002/04/06: [spec] should not warn for /(?:a?)+?/.2002/04/04: [spec] should allow fixed length alternative and repeat patternin look-behind. ex. /(?<=(a|b){3})/ (thanks Guy Decoux)2002/04/02: [spec] should warn for /(?:a+)?/ and /(?:a*)??/. (thanks akr)2002/04/01: Version 1.32002/04/01: [dist] add COPYING.2002/03/30: [spec] warn redundant nested repeat operatorin Ruby verbose mode. ex. (?:a*)?2002/03/30: [spec] nested repeat operator error check should besame with GNU regex. (thanks Guy Decoux)2002/03/30: [new] add \x{hexadecimal-wide-char}. (thanks matz)2002/03/27: [bug] MBCTYPE_XXX symbol values should be same with GNU regex.2002/03/27: [impl] add THREAD_ATOMIC to regex_clone(), regex_init(), regex_end().2002/03/25: [spec] if encoding is utf-8, allow combination of singlebyte andmultibyte code range in char class.(cancelled 2002/04/01: for M17N compatibility)2002/03/25: [dist] description of the license condition is added to README.2002/03/23: [bug] should set all bits of reg->mem_stats,if REG_OPTION_FIND_LONGEST or REG_OPTION_NOT_EMPTY.2002/03/23: [new] add a new option REG_OPTION_NOT_EMPTY.2002/03/20: [spec] allow incompleted left brace as an usual char.ex. /{/, /({)/, /a{2,3/ etc...2002/03/20: [impl] serialize integer in bytecode.(switch by UNALIGNED_WORD_ACCESS in regex.c)2002/03/20: [impl] change re_mbcinit() for REG_RUBY_M17N.2002/03/19: [impl] word alignment of char class multi-byte code ranges.2002/03/19: [impl] replace OP_EXACTMB4N with OP_EXACTMB3N.2002/03/19: [bug] OP_CCLASS_MB_NOT process in matchAt() is wrong.2002/03/19: [new] add re_mbctab[] for Ruby extension library compatibility.2002/03/19: [spec] allow nested repeat operator, if operator is {n,m} type.2002/03/19: [new] add REG_IS_PATTERN_ERROR(ecode) in regex.h2002/03/18: [spec] /[a-b-c]/ should be error.2002/03/18: [bug] /[\w-a]/ should be error. (thanks Guy Decoux)2002/03/18: [bug] /[\]/ should be error. (thanks Guy Decoux)2002/03/18: [bug] /()*/ etc.. should not be error. (thanks Guy Decoux)2002/03/18: [spec] /a{1}*/ should not be error. (thanks Guy Decoux)2002/03/18: [bug] ab{2}{3} was interpreded to (?:a(?:b{2})){3}(thanks Guy Decoux)2002/03/18: [bug] abort /(?i)*a/ etc... (thanks Guy Decoux)2002/03/18: [bug] abort /a|*/,/a|{1}/ etc... (thanks Guy Decoux)2002/03/13: Version 1.22002/03/13: [test] success in rubicon/builtin/AllBuiltinTests.rb.(thanks rubicon)2002/03/13: [bug] OP_EXACTMBN process in matchAt() is wrong.2002/03/13: [bug] start argument of BackwardSearchRange() is wrong.2002/03/12: [spec] change function name style from CamelCaseto underline_separation. (includes API)2002/03/12: [bug] if pattern has nested null-check, cause infinite loop.correct STACK_NULL_CHECK() macro. (thanks Guy Decoux)2002/03/11: [bug] it is wrong that four numbers to continue asan octal value in scanBackSlash(). ex. /\0111/(thanks matz)2002/03/11: [new] \k (single-byte word char), \K (multi-byte char).2002/03/09: [inst] add two targets to Makefile.in (166 and 172).2002/03/09: [spec] decrease REG_MAX_BACKREF_NUM, REG_MAX_REPEAT_NUMvalues.2002/03/08: [spec] allow use of "\A"(begin-buf) in look-behind.2002/03/08: [impl] add a new opcode OP_PUSH_IF_PEEK_NEXT.2002/03/08: [impl] add a new opcode OP_ANYCHAR_STAR_PEEK_NEXT.2002/03/07: [spec] prohibit use of capture group "(...)"in negative look-behind.2002/03/07: [inst] add configure.in, config.h.in, Makefile.in.2002/03/07: [impl] call Init_REGEX_STAT() in RegexInit().2002/03/07: [spec] less length string match with negative look-behind.ex. /(?<!XXX)a/.match("Xa"). (thanks Nobu)2002/03/06: [impl] expand repeated string, if expanded length <= 100.ex. /(?:abc){10}/2002/03/06: [new] add a symbol REG_TRANSTABLE_USE_DEFAULT in regex.h.2002/03/06: [impl] rename RegDefaultCharCode to RegDefaultCharEncoding.2002/03/06: [bug] if pattern has NULL(\000) char, infinite loop happensin ScanMakeNode(). (beware of strchr(). thanks Nobu)2002/03/06: [bug] range argument of ForwardSearchRange() is wrong.ex. /\A.a/, /\G.a/ mismatched with "aa". (thanks Nobu)2002/03/05: [new] add RegexMatch() API. rename regexMatch() to matchAt().2002/03/05: [impl] change function definition style.2002/03/05: [impl] abolish use of macro symbol which name begin with underline.2002/03/04: [bug] make up a break-statement in compileTree().(compile error on Mac OS X 10.1.3)2002/03/04: Version 1.12002/03/04: [impl] replace STK_BOTTOM with STK_ALT.2002/03/02: [impl] add new opcode OP_FINISH and new stack typeSTK_BOTTOM for (little bit) speed up STACK_POP.2002/03/02: [impl] add new opcode OP_EXACT1_IC, OP_EXACTN_ICfor compile time ignore case check.remove opcode OP_EXACT1_RAW, OP_EXACTN_RAW.2002/03/02: [impl] add OpTime info to statistical data.2002/02/28: [bug] sub_anchor($) in ForwardSearch() and BackwardSearch().ex. /$\x0az/.match("\nz")2002/02/28: [new] look-behind (?<=pattern), (?<!pattern).2002/02/27: [bug] use StackIndex instead of StackType* for realloc problem.2002/02/27: [impl] use m17n_codepoint() as mb2wc() in REG_RUBY_M17N.2002/02/27: [spec] undefined POSIX bracket /[[:xyz:]]/ should be syntax error.2002/02/26: [bug] ex. /$*/, /[a-]/, /((?i)a)b/ (thanks matz)2002/02/25: Version 1.0 (first release)--[bug: bug fix][API: API change/new/delete][new: new feature][spec: specification change][impl: implementation change][tune: tune for speed up][inst: changes for installation][dist: distribution change][test: test][dev: development][memo: memo]--<create tag>svn copy file:///home/kosako/svnreps/svnrep_onig/trunk file:///home/kosako/svnreps/svnrep_onig/tags/5.0.0 -m "ADD TAG: 5.0.0"<set ignore files by .cvsignore>svn propset svn:ignore -F .cvsignore .svn commit -m "..."<CVS: show all tags>cvs history -T<CVS: add tag>cvs rtag "VERSION_X_X_X" oniguruma<GNU Autotools: bootstrap>* write Makefile.am and configure.in.> aclocal> libtoolize or glibtoolize> automake --foreign --add-missing> autoconf> configure --with-rubydir=... CFLAGS="-O2 -Wall"<GNU libtool: version management>VERSION = current:revision:agecurrent: interface number (from 0)revision: implementation number of same interface (from 0)age: number of supported previous interfaces(if current only supported then age == 0)//END
Installation Instructions*************************Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 FreeSoftware Foundation, Inc.This file is free documentation; the Free Software Foundation givesunlimited permission to copy, distribute and modify it.Basic Installation==================These are generic installation instructions.The `configure' shell script attempts to guess correct values forvarious system-dependent variables used during compilation. It usesthose values to create a `Makefile' in each directory of the package.It may also create one or more `.h' files containing system-dependentdefinitions. Finally, it creates a shell script `config.status' thatyou can run in the future to recreate the current configuration, and afile `config.log' containing compiler output (useful mainly fordebugging `configure').It can also use an optional file (typically called `config.cache'and enabled with `--cache-file=config.cache' or simply `-C') that savesthe results of its tests to speed up reconfiguring. (Caching isdisabled by default to prevent problems with accidental use of stalecache files.)If you need to do unusual things to compile the package, please tryto figure out how `configure' could check whether to do them, and maildiffs or instructions to the address given in the `README' so they canbe considered for the next release. If you are using the cache, and atsome point `config.cache' contains results you don't want to keep, youmay remove or edit it.The file `configure.ac' (or `configure.in') is used to create`configure' by a program called `autoconf'. You only need`configure.ac' if you want to change it or regenerate `configure' usinga newer version of `autoconf'.The simplest way to compile this package is:1. `cd' to the directory containing the package's source code and type`./configure' to configure the package for your system. If you'reusing `csh' on an old version of System V, you might need to type`sh ./configure' instead to prevent `csh' from trying to execute`configure' itself.Running `configure' takes awhile. While running, it prints somemessages telling which features it is checking for.2. Type `make' to compile the package.3. Optionally, type `make check' to run any self-tests that come withthe package.4. Type `make install' to install the programs and any data files anddocumentation.5. You can remove the program binaries and object files from thesource code directory by typing `make clean'. To also remove thefiles that `configure' created (so you can compile the package fora different kind of computer), type `make distclean'. There isalso a `make maintainer-clean' target, but that is intended mainlyfor the package's developers. If you use it, you may have to getall sorts of other programs in order to regenerate files that camewith the distribution.Compilers and Options=====================Some systems require unusual options for compilation or linking that the`configure' script does not know about. Run `./configure --help' fordetails on some of the pertinent environment variables.You can give `configure' initial values for configuration parametersby setting variables in the command line or in the environment. Hereis an example:./configure CC=c89 CFLAGS=-O2 LIBS=-lposix*Note Defining Variables::, for more details.Compiling For Multiple Architectures====================================You can compile the package for more than one kind of computer at thesame time, by placing the object files for each architecture in theirown directory. To do this, you must use a version of `make' thatsupports the `VPATH' variable, such as GNU `make'. `cd' to thedirectory where you want the object files and executables to go and runthe `configure' script. `configure' automatically checks for thesource code in the directory that `configure' is in and in `..'.If you have to use a `make' that does not support the `VPATH'variable, you have to compile the package for one architecture at atime in the source code directory. After you have installed thepackage for one architecture, use `make distclean' before reconfiguringfor another architecture.Installation Names==================By default, `make install' will install the package's files in`/usr/local/bin', `/usr/local/man', etc. You can specify aninstallation prefix other than `/usr/local' by giving `configure' theoption `--prefix=PREFIX'.You can specify separate installation prefixes forarchitecture-specific files and architecture-independent files. If yougive `configure' the option `--exec-prefix=PREFIX', the package willuse PREFIX as the prefix for installing programs and libraries.Documentation and other data files will still use the regular prefix.In addition, if you use an unusual directory layout you can giveoptions like `--bindir=DIR' to specify different values for particularkinds of files. Run `configure --help' for a list of the directoriesyou can set and what kinds of files go in them.If the package supports it, you can cause programs to be installedwith an extra prefix or suffix on their names by giving `configure' theoption `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.Optional Features=================Some packages pay attention to `--enable-FEATURE' options to`configure', where FEATURE indicates an optional part of the package.They may also pay attention to `--with-PACKAGE' options, where PACKAGEis something like `gnu-as' or `x' (for the X Window System). The`README' should mention any `--enable-' and `--with-' options that thepackage recognizes.For packages that use the X Window System, `configure' can usuallyfind the X include and library files automatically, but if it doesn't,you can use the `configure' options `--x-includes=DIR' and`--x-libraries=DIR' to specify their locations.Specifying the System Type==========================There may be some features `configure' cannot figure out automatically,but needs to determine by the type of machine the package will run on.Usually, assuming the package is built to be run on the _same_architectures, `configure' can figure that out, but if it prints amessage saying it cannot guess the machine type, give it the`--build=TYPE' option. TYPE can either be a short name for the systemtype, such as `sun4', or a canonical name which has the form:CPU-COMPANY-SYSTEMwhere SYSTEM can have one of these forms:OS KERNEL-OSSee the file `config.sub' for the possible values of each field. If`config.sub' isn't included in this package, then this package doesn'tneed to know the machine type.If you are _building_ compiler tools for cross-compiling, you shoulduse the `--target=TYPE' option to select the type of system they willproduce code for.If you want to _use_ a cross compiler, that generates code for aplatform different from the build platform, you should specify the"host" platform (i.e., that on which the generated programs willeventually be run) with `--host=TYPE'.Sharing Defaults================If you want to set default values for `configure' scripts to share, youcan create a site shell script called `config.site' that gives defaultvalues for variables like `CC', `cache_file', and `prefix'.`configure' looks for `PREFIX/share/config.site' if it exists, then`PREFIX/etc/config.site' if it exists. Or, you can set the`CONFIG_SITE' environment variable to the location of the site script.A warning: not all `configure' scripts look for a site script.Defining Variables==================Variables not defined in a site shell script can be set in theenvironment passed to `configure'. However, some packages may runconfigure again during the build, and the customized values of thesevariables may be lost. In order to avoid this problem, you should setthem in the `configure' command line, using `VAR=value'. For example:./configure CC=/usr/local2/bin/gcccauses the specified `gcc' to be used as the C compiler (unless it isoverridden in the site shell script). Here is a another example:/bin/bash ./configure CONFIG_SHELL=/bin/bashHere the `CONFIG_SHELL=/bin/bash' operand causes subsequentconfiguration-related scripts to be executed by `/bin/bash'.`configure' Invocation======================`configure' recognizes the following options to control how it operates.`--help'`-h'Print a summary of the options to `configure', and exit.`--version'`-V'Print the version of Autoconf used to generate the `configure'script, and exit.`--cache-file=FILE'Enable the cache: use and save the results of the tests in FILE,traditionally `config.cache'. FILE defaults to `/dev/null' todisable caching.`--config-cache'`-C'Alias for `--cache-file=config.cache'.`--quiet'`--silent'`-q'Do not print messages saying which checks are being made. Tosuppress all normal output, redirect it to `/dev/null' (any errormessages will still be shown).`--srcdir=DIR'Look for the package's source code in directory DIR. Usually`configure' can determine that directory automatically.`configure' also accepts some other, not widely useful, options. Run`configure --help' for more details.
## Makefile.am for Onigurumaencdir = $(top_srcdir)/encsampledir = $(top_srcdir)/samplelibname = libonig.la#AM_CFLAGS = -DNOT_RUBYAM_CFLAGS =INCLUDES = -I$(top_srcdir) -I$(includedir)SUBDIRS = . sampleinclude_HEADERS = oniguruma.h oniggnu.h onigposix.hlib_LTLIBRARIES = $(libname)libonig_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 \$(encdir)/unicode.c $(encdir)/ascii.c $(encdir)/utf8.c \$(encdir)/utf16_be.c $(encdir)/utf16_le.c \$(encdir)/utf32_be.c $(encdir)/utf32_le.c \$(encdir)/euc_jp.c $(encdir)/sjis.c $(encdir)/iso8859_1.c \$(encdir)/iso8859_2.c $(encdir)/iso8859_3.c \$(encdir)/iso8859_4.c $(encdir)/iso8859_5.c \$(encdir)/iso8859_6.c $(encdir)/iso8859_7.c \$(encdir)/iso8859_8.c $(encdir)/iso8859_9.c \$(encdir)/iso8859_10.c $(encdir)/iso8859_11.c \$(encdir)/iso8859_13.c $(encdir)/iso8859_14.c \$(encdir)/iso8859_15.c $(encdir)/iso8859_16.c \$(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \$(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/cp1251.clibonig_la_LDFLAGS = -version-info $(LTVERSION)EXTRA_DIST = HISTORY README.ja index.html index_ja.html \doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \win32/Makefile win32/config.h win32/testc.c \$(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.cbin_SCRIPTS = onig-configonig-config: onig-config.indll:$(CXX) -shared -Wl,--output-def,libonig.def -o libonig.dll *.o \$(LIBS)strip libonig.dll# Ruby TESTrtest:$(RUBYDIR)/ruby -w -Ke $(srcdir)/test.rb# character-types-table source generatormktable: $(encdir)/mktable.c $(srcdir)/regenc.h$(CC) -I$(top_srcdir) -o mktable $(encdir)/mktable.c# TESTTESTS = testc testp testcucheck_PROGRAMS = testc testp testcuatest: testc testp testcu@echo "[Oniguruma 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]"@$(top_builddir)/testcu | grep RESULTtestc_SOURCES = testc.ctestc_LDADD = libonig.latestp_SOURCES = testc.ctestp_LDADD = libonig.latestp_CFLAGS = -DPOSIX_TESTtestcu_SOURCES = testu.ctestcu_LDADD = libonig.la#testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb# ruby -Ke $(srcdir)/testconv.rb < $(srcdir)/test.rb > $@#testu.c: $(srcdir)/test.rb $(srcdir)/testconvu.rb# ruby -Ke $(srcdir)/testconvu.rb $(srcdir)/test.rb > $@#win32/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb# ruby -Ke $(srcdir)/testconv.rb -win < $(srcdir)/test.rb | nkf -cs > $@## END OF FILE
# Makefile.in generated by automake 1.10 from Makefile.am.# @configure_input@# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.# This Makefile.in is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY, to the extent permitted by law; without# even the implied warranty of MERCHANTABILITY or FITNESS FOR A# PARTICULAR PURPOSE.@SET_MAKE@VPATH = @srcdir@pkgdatadir = $(datadir)/@PACKAGE@pkglibdir = $(libdir)/@PACKAGE@pkgincludedir = $(includedir)/@PACKAGE@am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cdinstall_sh_DATA = $(install_sh) -c -m 644install_sh_PROGRAM = $(install_sh) -cinstall_sh_SCRIPT = $(install_sh) -cINSTALL_HEADER = $(INSTALL_DATA)transform = $(program_transform_name)NORMAL_INSTALL = :PRE_INSTALL = :POST_INSTALL = :NORMAL_UNINSTALL = :PRE_UNINSTALL = :POST_UNINSTALL = :build_triplet = @build@host_triplet = @host@TESTS = testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT)check_PROGRAMS = testc$(EXEEXT) testp$(EXEEXT) testcu$(EXEEXT)subdir = .DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \$(srcdir)/Makefile.am $(srcdir)/Makefile.in \$(srcdir)/config.h.in $(srcdir)/onig-config.in \$(top_srcdir)/configure AUTHORS COPYING INSTALL config.guess \config.sub depcomp install-sh ltmain.sh missingACLOCAL_M4 = $(top_srcdir)/aclocal.m4am__aclocal_m4_deps = $(top_srcdir)/configure.inam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \$(ACLOCAL_M4)am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \configure.lineno config.status.linenomkinstalldirs = $(install_sh) -dCONFIG_HEADER = config.hCONFIG_CLEAN_FILES = onig-configam__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;am__vpath_adj = case $$p in \$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \*) f=$$p;; \esac;am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \"$(DESTDIR)$(includedir)"libLTLIBRARIES_INSTALL = $(INSTALL)LTLIBRARIES = $(lib_LTLIBRARIES)libonig_la_LIBADD =am_libonig_la_OBJECTS = regerror.lo regparse.lo regext.lo regcomp.lo \regexec.lo reggnu.lo regenc.lo regsyntax.lo regtrav.lo \regversion.lo st.lo regposix.lo regposerr.lo unicode.lo \ascii.lo utf8.lo utf16_be.lo utf16_le.lo utf32_be.lo \utf32_le.lo euc_jp.lo sjis.lo iso8859_1.lo iso8859_2.lo \iso8859_3.lo iso8859_4.lo iso8859_5.lo iso8859_6.lo \iso8859_7.lo iso8859_8.lo iso8859_9.lo iso8859_10.lo \iso8859_11.lo iso8859_13.lo iso8859_14.lo iso8859_15.lo \iso8859_16.lo euc_tw.lo euc_kr.lo big5.lo gb18030.lo koi8_r.lo \cp1251.lolibonig_la_OBJECTS = $(am_libonig_la_OBJECTS)libonig_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \$(libonig_la_LDFLAGS) $(LDFLAGS) -o $@am_testc_OBJECTS = testc.$(OBJEXT)testc_OBJECTS = $(am_testc_OBJECTS)testc_DEPENDENCIES = libonig.laam_testcu_OBJECTS = testu.$(OBJEXT)testcu_OBJECTS = $(am_testcu_OBJECTS)testcu_DEPENDENCIES = libonig.laam_testp_OBJECTS = testp-testc.$(OBJEXT)testp_OBJECTS = $(am_testp_OBJECTS)testp_DEPENDENCIES = libonig.latestp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \--mode=link $(CCLD) $(testp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \$(LDFLAGS) -o $@binSCRIPT_INSTALL = $(INSTALL_SCRIPT)SCRIPTS = $(bin_SCRIPTS)DEFAULT_INCLUDES = -I.@am__isrc@depcomp = $(SHELL) $(top_srcdir)/depcompam__depfiles_maybe = depfilesCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)CCLD = $(CC)LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \$(LDFLAGS) -o $@SOURCES = $(libonig_la_SOURCES) $(testc_SOURCES) $(testcu_SOURCES) \$(testp_SOURCES)DIST_SOURCES = $(libonig_la_SOURCES) $(testc_SOURCES) \$(testcu_SOURCES) $(testp_SOURCES)RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \html-recursive info-recursive install-data-recursive \install-dvi-recursive install-exec-recursive \install-html-recursive install-info-recursive \install-pdf-recursive install-ps-recursive install-recursive \installcheck-recursive installdirs-recursive pdf-recursive \ps-recursive uninstall-recursiveincludeHEADERS_INSTALL = $(INSTALL_HEADER)HEADERS = $(include_HEADERS)RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \distclean-recursive maintainer-clean-recursiveETAGS = etagsCTAGS = ctagsDIST_SUBDIRS = $(SUBDIRS)DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)distdir = $(PACKAGE)-$(VERSION)top_distdir = $(distdir)am__remove_distdir = \{ test ! -d $(distdir) \|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \&& rm -fr $(distdir); }; }DIST_ARCHIVES = $(distdir).tar.gzGZIP_ENV = --bestdistuninstallcheck_listfiles = find . -type f -printdistcleancheck_listfiles = find . -type f -printACLOCAL = @ACLOCAL@ALLOCA = @ALLOCA@AMTAR = @AMTAR@AR = @AR@AUTOCONF = @AUTOCONF@AUTOHEADER = @AUTOHEADER@AUTOMAKE = @AUTOMAKE@AWK = @AWK@CC = @CC@CCDEPMODE = @CCDEPMODE@CFLAGS = @CFLAGS@CPP = @CPP@CPPFLAGS = @CPPFLAGS@CYGPATH_W = @CYGPATH_W@DEFS = @DEFS@DEPDIR = @DEPDIR@DSYMUTIL = @DSYMUTIL@DUMPBIN = @DUMPBIN@ECHO_C = @ECHO_C@ECHO_N = @ECHO_N@ECHO_T = @ECHO_T@EGREP = @EGREP@EXEEXT = @EXEEXT@FGREP = @FGREP@GREP = @GREP@INSTALL = @INSTALL@INSTALL_DATA = @INSTALL_DATA@INSTALL_PROGRAM = @INSTALL_PROGRAM@INSTALL_SCRIPT = @INSTALL_SCRIPT@INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@LD = @LD@LDFLAGS = @LDFLAGS@LIBOBJS = @LIBOBJS@LIBS = @LIBS@LIBTOOL = @LIBTOOL@LIPO = @LIPO@LN_S = @LN_S@LTLIBOBJS = @LTLIBOBJS@LTVERSION = @LTVERSION@MAKEINFO = @MAKEINFO@MKDIR_P = @MKDIR_P@NM = @NM@NMEDIT = @NMEDIT@OBJEXT = @OBJEXT@OTOOL = @OTOOL@OTOOL64 = @OTOOL64@PACKAGE = @PACKAGE@PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@PACKAGE_NAME = @PACKAGE_NAME@PACKAGE_STRING = @PACKAGE_STRING@PACKAGE_TARNAME = @PACKAGE_TARNAME@PACKAGE_VERSION = @PACKAGE_VERSION@PATH_SEPARATOR = @PATH_SEPARATOR@RANLIB = @RANLIB@RUBYDIR = @RUBYDIR@SED = @SED@SET_MAKE = @SET_MAKE@SHELL = @SHELL@STATISTICS = @STATISTICS@STRIP = @STRIP@VERSION = @VERSION@abs_builddir = @abs_builddir@abs_srcdir = @abs_srcdir@abs_top_builddir = @abs_top_builddir@abs_top_srcdir = @abs_top_srcdir@ac_ct_CC = @ac_ct_CC@ac_ct_DUMPBIN = @ac_ct_DUMPBIN@am__include = @am__include@am__leading_dot = @am__leading_dot@am__quote = @am__quote@am__tar = @am__tar@am__untar = @am__untar@bindir = @bindir@build = @build@build_alias = @build_alias@build_cpu = @build_cpu@build_os = @build_os@build_vendor = @build_vendor@builddir = @builddir@datadir = @datadir@datarootdir = @datarootdir@docdir = @docdir@dvidir = @dvidir@exec_prefix = @exec_prefix@host = @host@host_alias = @host_alias@host_cpu = @host_cpu@host_os = @host_os@host_vendor = @host_vendor@htmldir = @htmldir@includedir = @includedir@infodir = @infodir@install_sh = @install_sh@libdir = @libdir@libexecdir = @libexecdir@localedir = @localedir@localstatedir = @localstatedir@lt_ECHO = @lt_ECHO@mandir = @mandir@mkdir_p = @mkdir_p@oldincludedir = @oldincludedir@pdfdir = @pdfdir@prefix = @prefix@program_transform_name = @program_transform_name@psdir = @psdir@sbindir = @sbindir@sharedstatedir = @sharedstatedir@srcdir = @srcdir@sysconfdir = @sysconfdir@target_alias = @target_alias@top_builddir = @top_builddir@top_srcdir = @top_srcdir@encdir = $(top_srcdir)/encsampledir = $(top_srcdir)/samplelibname = libonig.la#AM_CFLAGS = -DNOT_RUBYAM_CFLAGS =INCLUDES = -I$(top_srcdir) -I$(includedir)SUBDIRS = . sampleinclude_HEADERS = oniguruma.h oniggnu.h onigposix.hlib_LTLIBRARIES = $(libname)libonig_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 \$(encdir)/unicode.c $(encdir)/ascii.c $(encdir)/utf8.c \$(encdir)/utf16_be.c $(encdir)/utf16_le.c \$(encdir)/utf32_be.c $(encdir)/utf32_le.c \$(encdir)/euc_jp.c $(encdir)/sjis.c $(encdir)/iso8859_1.c \$(encdir)/iso8859_2.c $(encdir)/iso8859_3.c \$(encdir)/iso8859_4.c $(encdir)/iso8859_5.c \$(encdir)/iso8859_6.c $(encdir)/iso8859_7.c \$(encdir)/iso8859_8.c $(encdir)/iso8859_9.c \$(encdir)/iso8859_10.c $(encdir)/iso8859_11.c \$(encdir)/iso8859_13.c $(encdir)/iso8859_14.c \$(encdir)/iso8859_15.c $(encdir)/iso8859_16.c \$(encdir)/euc_tw.c $(encdir)/euc_kr.c $(encdir)/big5.c \$(encdir)/gb18030.c $(encdir)/koi8_r.c $(encdir)/cp1251.clibonig_la_LDFLAGS = -version-info $(LTVERSION)EXTRA_DIST = HISTORY README.ja index.html index_ja.html \doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \win32/Makefile win32/config.h win32/testc.c \$(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.cbin_SCRIPTS = onig-configtestc_SOURCES = testc.ctestc_LDADD = libonig.latestp_SOURCES = testc.ctestp_LDADD = libonig.latestp_CFLAGS = -DPOSIX_TESTtestcu_SOURCES = testu.ctestcu_LDADD = libonig.laall: config.h$(MAKE) $(AM_MAKEFLAGS) all-recursive.SUFFIXES:.SUFFIXES: .c .lo .o .objam--refresh:@:$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)@for dep in $?; do \case '$(am__configure_deps)' in \*$$dep*) \echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \cd $(srcdir) && $(AUTOMAKE) --foreign \&& exit 0; \exit 1;; \esac; \done; \echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \cd $(top_srcdir) && \$(AUTOMAKE) --foreign Makefile.PRECIOUS: MakefileMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status@case '$?' in \*config.status*) \echo ' $(SHELL) ./config.status'; \$(SHELL) ./config.status;; \*) \echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \esac;$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)$(SHELL) ./config.status --recheck$(top_srcdir)/configure: $(am__configure_deps)cd $(srcdir) && $(AUTOCONF)$(ACLOCAL_M4): $(am__aclocal_m4_deps)cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)config.h: stamp-h1@if test ! -f $@; then \rm -f stamp-h1; \$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \else :; fistamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status@rm -f stamp-h1cd $(top_builddir) && $(SHELL) ./config.status config.h$(srcdir)/config.h.in: $(am__configure_deps)cd $(top_srcdir) && $(AUTOHEADER)rm -f stamp-h1touch $@distclean-hdr:-rm -f config.h stamp-h1onig-config: $(top_builddir)/config.status $(srcdir)/onig-config.incd $(top_builddir) && $(SHELL) ./config.status $@install-libLTLIBRARIES: $(lib_LTLIBRARIES)@$(NORMAL_INSTALL)test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"@list='$(lib_LTLIBRARIES)'; for p in $$list; do \if test -f $$p; then \f=$(am__strip_dir) \echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \else :; fi; \doneuninstall-libLTLIBRARIES:@$(NORMAL_UNINSTALL)@list='$(lib_LTLIBRARIES)'; for p in $$list; do \p=$(am__strip_dir) \echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \doneclean-libLTLIBRARIES:-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)@list='$(lib_LTLIBRARIES)'; for p in $$list; do \dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \test "$$dir" != "$$p" || dir=.; \echo "rm -f \"$${dir}/so_locations\""; \rm -f "$${dir}/so_locations"; \donelibonig.la: $(libonig_la_OBJECTS) $(libonig_la_DEPENDENCIES)$(libonig_la_LINK) -rpath $(libdir) $(libonig_la_OBJECTS) $(libonig_la_LIBADD) $(LIBS)clean-checkPROGRAMS:@list='$(check_PROGRAMS)'; for p in $$list; do \f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \echo " rm -f $$p $$f"; \rm -f $$p $$f ; \donetestc$(EXEEXT): $(testc_OBJECTS) $(testc_DEPENDENCIES)@rm -f testc$(EXEEXT)$(LINK) $(testc_OBJECTS) $(testc_LDADD) $(LIBS)testcu$(EXEEXT): $(testcu_OBJECTS) $(testcu_DEPENDENCIES)@rm -f testcu$(EXEEXT)$(LINK) $(testcu_OBJECTS) $(testcu_LDADD) $(LIBS)testp$(EXEEXT): $(testp_OBJECTS) $(testp_DEPENDENCIES)@rm -f testp$(EXEEXT)$(testp_LINK) $(testp_OBJECTS) $(testp_LDADD) $(LIBS)install-binSCRIPTS: $(bin_SCRIPTS)@$(NORMAL_INSTALL)test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"@list='$(bin_SCRIPTS)'; for p in $$list; do \if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \if test -f $$d$$p; then \f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \else :; fi; \doneuninstall-binSCRIPTS:@$(NORMAL_UNINSTALL)@list='$(bin_SCRIPTS)'; for p in $$list; do \f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \rm -f "$(DESTDIR)$(bindir)/$$f"; \donemostlyclean-compile:-rm -f *.$(OBJEXT)distclean-compile:-rm -f *.tab.c@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/big5.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cp1251.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euc_jp.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euc_kr.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/euc_tw.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gb18030.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_1.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_10.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_11.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_13.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_14.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_15.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_16.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_2.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_3.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_4.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_5.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_6.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_7.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_8.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iso8859_9.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/koi8_r.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regenc.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regerror.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regext.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reggnu.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regparse.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regposerr.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regposix.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regsyntax.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regtrav.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regversion.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sjis.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/st.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testc.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testp-testc.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testu.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicode.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf16_be.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf16_le.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf32_be.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf32_le.Plo@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Plo@am__quote@.c.o:@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(COMPILE) -c $<.c.obj:@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`.c.lo:@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<unicode.lo: $(encdir)/unicode.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT unicode.lo -MD -MP -MF $(DEPDIR)/unicode.Tpo -c -o unicode.lo `test -f '$(encdir)/unicode.c' || echo '$(srcdir)/'`$(encdir)/unicode.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/unicode.Tpo $(DEPDIR)/unicode.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/unicode.c' object='unicode.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o unicode.lo `test -f '$(encdir)/unicode.c' || echo '$(srcdir)/'`$(encdir)/unicode.cascii.lo: $(encdir)/ascii.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ascii.lo -MD -MP -MF $(DEPDIR)/ascii.Tpo -c -o ascii.lo `test -f '$(encdir)/ascii.c' || echo '$(srcdir)/'`$(encdir)/ascii.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ascii.Tpo $(DEPDIR)/ascii.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/ascii.c' object='ascii.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ascii.lo `test -f '$(encdir)/ascii.c' || echo '$(srcdir)/'`$(encdir)/ascii.cutf8.lo: $(encdir)/utf8.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf8.lo -MD -MP -MF $(DEPDIR)/utf8.Tpo -c -o utf8.lo `test -f '$(encdir)/utf8.c' || echo '$(srcdir)/'`$(encdir)/utf8.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/utf8.Tpo $(DEPDIR)/utf8.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf8.c' object='utf8.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf8.lo `test -f '$(encdir)/utf8.c' || echo '$(srcdir)/'`$(encdir)/utf8.cutf16_be.lo: $(encdir)/utf16_be.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf16_be.lo -MD -MP -MF $(DEPDIR)/utf16_be.Tpo -c -o utf16_be.lo `test -f '$(encdir)/utf16_be.c' || echo '$(srcdir)/'`$(encdir)/utf16_be.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/utf16_be.Tpo $(DEPDIR)/utf16_be.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf16_be.c' object='utf16_be.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf16_be.lo `test -f '$(encdir)/utf16_be.c' || echo '$(srcdir)/'`$(encdir)/utf16_be.cutf16_le.lo: $(encdir)/utf16_le.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf16_le.lo -MD -MP -MF $(DEPDIR)/utf16_le.Tpo -c -o utf16_le.lo `test -f '$(encdir)/utf16_le.c' || echo '$(srcdir)/'`$(encdir)/utf16_le.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/utf16_le.Tpo $(DEPDIR)/utf16_le.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf16_le.c' object='utf16_le.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf16_le.lo `test -f '$(encdir)/utf16_le.c' || echo '$(srcdir)/'`$(encdir)/utf16_le.cutf32_be.lo: $(encdir)/utf32_be.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf32_be.lo -MD -MP -MF $(DEPDIR)/utf32_be.Tpo -c -o utf32_be.lo `test -f '$(encdir)/utf32_be.c' || echo '$(srcdir)/'`$(encdir)/utf32_be.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/utf32_be.Tpo $(DEPDIR)/utf32_be.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf32_be.c' object='utf32_be.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf32_be.lo `test -f '$(encdir)/utf32_be.c' || echo '$(srcdir)/'`$(encdir)/utf32_be.cutf32_le.lo: $(encdir)/utf32_le.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT utf32_le.lo -MD -MP -MF $(DEPDIR)/utf32_le.Tpo -c -o utf32_le.lo `test -f '$(encdir)/utf32_le.c' || echo '$(srcdir)/'`$(encdir)/utf32_le.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/utf32_le.Tpo $(DEPDIR)/utf32_le.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/utf32_le.c' object='utf32_le.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o utf32_le.lo `test -f '$(encdir)/utf32_le.c' || echo '$(srcdir)/'`$(encdir)/utf32_le.ceuc_jp.lo: $(encdir)/euc_jp.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT euc_jp.lo -MD -MP -MF $(DEPDIR)/euc_jp.Tpo -c -o euc_jp.lo `test -f '$(encdir)/euc_jp.c' || echo '$(srcdir)/'`$(encdir)/euc_jp.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/euc_jp.Tpo $(DEPDIR)/euc_jp.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/euc_jp.c' object='euc_jp.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o euc_jp.lo `test -f '$(encdir)/euc_jp.c' || echo '$(srcdir)/'`$(encdir)/euc_jp.csjis.lo: $(encdir)/sjis.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sjis.lo -MD -MP -MF $(DEPDIR)/sjis.Tpo -c -o sjis.lo `test -f '$(encdir)/sjis.c' || echo '$(srcdir)/'`$(encdir)/sjis.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/sjis.Tpo $(DEPDIR)/sjis.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/sjis.c' object='sjis.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sjis.lo `test -f '$(encdir)/sjis.c' || echo '$(srcdir)/'`$(encdir)/sjis.ciso8859_1.lo: $(encdir)/iso8859_1.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_1.lo -MD -MP -MF $(DEPDIR)/iso8859_1.Tpo -c -o iso8859_1.lo `test -f '$(encdir)/iso8859_1.c' || echo '$(srcdir)/'`$(encdir)/iso8859_1.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_1.Tpo $(DEPDIR)/iso8859_1.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_1.c' object='iso8859_1.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_1.lo `test -f '$(encdir)/iso8859_1.c' || echo '$(srcdir)/'`$(encdir)/iso8859_1.ciso8859_2.lo: $(encdir)/iso8859_2.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_2.lo -MD -MP -MF $(DEPDIR)/iso8859_2.Tpo -c -o iso8859_2.lo `test -f '$(encdir)/iso8859_2.c' || echo '$(srcdir)/'`$(encdir)/iso8859_2.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_2.Tpo $(DEPDIR)/iso8859_2.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_2.c' object='iso8859_2.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_2.lo `test -f '$(encdir)/iso8859_2.c' || echo '$(srcdir)/'`$(encdir)/iso8859_2.ciso8859_3.lo: $(encdir)/iso8859_3.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_3.lo -MD -MP -MF $(DEPDIR)/iso8859_3.Tpo -c -o iso8859_3.lo `test -f '$(encdir)/iso8859_3.c' || echo '$(srcdir)/'`$(encdir)/iso8859_3.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_3.Tpo $(DEPDIR)/iso8859_3.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_3.c' object='iso8859_3.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_3.lo `test -f '$(encdir)/iso8859_3.c' || echo '$(srcdir)/'`$(encdir)/iso8859_3.ciso8859_4.lo: $(encdir)/iso8859_4.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_4.lo -MD -MP -MF $(DEPDIR)/iso8859_4.Tpo -c -o iso8859_4.lo `test -f '$(encdir)/iso8859_4.c' || echo '$(srcdir)/'`$(encdir)/iso8859_4.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_4.Tpo $(DEPDIR)/iso8859_4.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_4.c' object='iso8859_4.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_4.lo `test -f '$(encdir)/iso8859_4.c' || echo '$(srcdir)/'`$(encdir)/iso8859_4.ciso8859_5.lo: $(encdir)/iso8859_5.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_5.lo -MD -MP -MF $(DEPDIR)/iso8859_5.Tpo -c -o iso8859_5.lo `test -f '$(encdir)/iso8859_5.c' || echo '$(srcdir)/'`$(encdir)/iso8859_5.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_5.Tpo $(DEPDIR)/iso8859_5.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_5.c' object='iso8859_5.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_5.lo `test -f '$(encdir)/iso8859_5.c' || echo '$(srcdir)/'`$(encdir)/iso8859_5.ciso8859_6.lo: $(encdir)/iso8859_6.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_6.lo -MD -MP -MF $(DEPDIR)/iso8859_6.Tpo -c -o iso8859_6.lo `test -f '$(encdir)/iso8859_6.c' || echo '$(srcdir)/'`$(encdir)/iso8859_6.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_6.Tpo $(DEPDIR)/iso8859_6.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_6.c' object='iso8859_6.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_6.lo `test -f '$(encdir)/iso8859_6.c' || echo '$(srcdir)/'`$(encdir)/iso8859_6.ciso8859_7.lo: $(encdir)/iso8859_7.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_7.lo -MD -MP -MF $(DEPDIR)/iso8859_7.Tpo -c -o iso8859_7.lo `test -f '$(encdir)/iso8859_7.c' || echo '$(srcdir)/'`$(encdir)/iso8859_7.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_7.Tpo $(DEPDIR)/iso8859_7.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_7.c' object='iso8859_7.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_7.lo `test -f '$(encdir)/iso8859_7.c' || echo '$(srcdir)/'`$(encdir)/iso8859_7.ciso8859_8.lo: $(encdir)/iso8859_8.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_8.lo -MD -MP -MF $(DEPDIR)/iso8859_8.Tpo -c -o iso8859_8.lo `test -f '$(encdir)/iso8859_8.c' || echo '$(srcdir)/'`$(encdir)/iso8859_8.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_8.Tpo $(DEPDIR)/iso8859_8.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_8.c' object='iso8859_8.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_8.lo `test -f '$(encdir)/iso8859_8.c' || echo '$(srcdir)/'`$(encdir)/iso8859_8.ciso8859_9.lo: $(encdir)/iso8859_9.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_9.lo -MD -MP -MF $(DEPDIR)/iso8859_9.Tpo -c -o iso8859_9.lo `test -f '$(encdir)/iso8859_9.c' || echo '$(srcdir)/'`$(encdir)/iso8859_9.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_9.Tpo $(DEPDIR)/iso8859_9.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_9.c' object='iso8859_9.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_9.lo `test -f '$(encdir)/iso8859_9.c' || echo '$(srcdir)/'`$(encdir)/iso8859_9.ciso8859_10.lo: $(encdir)/iso8859_10.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_10.lo -MD -MP -MF $(DEPDIR)/iso8859_10.Tpo -c -o iso8859_10.lo `test -f '$(encdir)/iso8859_10.c' || echo '$(srcdir)/'`$(encdir)/iso8859_10.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_10.Tpo $(DEPDIR)/iso8859_10.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_10.c' object='iso8859_10.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_10.lo `test -f '$(encdir)/iso8859_10.c' || echo '$(srcdir)/'`$(encdir)/iso8859_10.ciso8859_11.lo: $(encdir)/iso8859_11.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_11.lo -MD -MP -MF $(DEPDIR)/iso8859_11.Tpo -c -o iso8859_11.lo `test -f '$(encdir)/iso8859_11.c' || echo '$(srcdir)/'`$(encdir)/iso8859_11.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_11.Tpo $(DEPDIR)/iso8859_11.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_11.c' object='iso8859_11.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_11.lo `test -f '$(encdir)/iso8859_11.c' || echo '$(srcdir)/'`$(encdir)/iso8859_11.ciso8859_13.lo: $(encdir)/iso8859_13.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_13.lo -MD -MP -MF $(DEPDIR)/iso8859_13.Tpo -c -o iso8859_13.lo `test -f '$(encdir)/iso8859_13.c' || echo '$(srcdir)/'`$(encdir)/iso8859_13.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_13.Tpo $(DEPDIR)/iso8859_13.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_13.c' object='iso8859_13.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_13.lo `test -f '$(encdir)/iso8859_13.c' || echo '$(srcdir)/'`$(encdir)/iso8859_13.ciso8859_14.lo: $(encdir)/iso8859_14.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_14.lo -MD -MP -MF $(DEPDIR)/iso8859_14.Tpo -c -o iso8859_14.lo `test -f '$(encdir)/iso8859_14.c' || echo '$(srcdir)/'`$(encdir)/iso8859_14.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_14.Tpo $(DEPDIR)/iso8859_14.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_14.c' object='iso8859_14.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_14.lo `test -f '$(encdir)/iso8859_14.c' || echo '$(srcdir)/'`$(encdir)/iso8859_14.ciso8859_15.lo: $(encdir)/iso8859_15.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_15.lo -MD -MP -MF $(DEPDIR)/iso8859_15.Tpo -c -o iso8859_15.lo `test -f '$(encdir)/iso8859_15.c' || echo '$(srcdir)/'`$(encdir)/iso8859_15.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_15.Tpo $(DEPDIR)/iso8859_15.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_15.c' object='iso8859_15.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_15.lo `test -f '$(encdir)/iso8859_15.c' || echo '$(srcdir)/'`$(encdir)/iso8859_15.ciso8859_16.lo: $(encdir)/iso8859_16.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iso8859_16.lo -MD -MP -MF $(DEPDIR)/iso8859_16.Tpo -c -o iso8859_16.lo `test -f '$(encdir)/iso8859_16.c' || echo '$(srcdir)/'`$(encdir)/iso8859_16.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/iso8859_16.Tpo $(DEPDIR)/iso8859_16.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/iso8859_16.c' object='iso8859_16.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iso8859_16.lo `test -f '$(encdir)/iso8859_16.c' || echo '$(srcdir)/'`$(encdir)/iso8859_16.ceuc_tw.lo: $(encdir)/euc_tw.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT euc_tw.lo -MD -MP -MF $(DEPDIR)/euc_tw.Tpo -c -o euc_tw.lo `test -f '$(encdir)/euc_tw.c' || echo '$(srcdir)/'`$(encdir)/euc_tw.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/euc_tw.Tpo $(DEPDIR)/euc_tw.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/euc_tw.c' object='euc_tw.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o euc_tw.lo `test -f '$(encdir)/euc_tw.c' || echo '$(srcdir)/'`$(encdir)/euc_tw.ceuc_kr.lo: $(encdir)/euc_kr.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT euc_kr.lo -MD -MP -MF $(DEPDIR)/euc_kr.Tpo -c -o euc_kr.lo `test -f '$(encdir)/euc_kr.c' || echo '$(srcdir)/'`$(encdir)/euc_kr.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/euc_kr.Tpo $(DEPDIR)/euc_kr.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/euc_kr.c' object='euc_kr.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o euc_kr.lo `test -f '$(encdir)/euc_kr.c' || echo '$(srcdir)/'`$(encdir)/euc_kr.cbig5.lo: $(encdir)/big5.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT big5.lo -MD -MP -MF $(DEPDIR)/big5.Tpo -c -o big5.lo `test -f '$(encdir)/big5.c' || echo '$(srcdir)/'`$(encdir)/big5.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/big5.Tpo $(DEPDIR)/big5.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/big5.c' object='big5.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o big5.lo `test -f '$(encdir)/big5.c' || echo '$(srcdir)/'`$(encdir)/big5.cgb18030.lo: $(encdir)/gb18030.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gb18030.lo -MD -MP -MF $(DEPDIR)/gb18030.Tpo -c -o gb18030.lo `test -f '$(encdir)/gb18030.c' || echo '$(srcdir)/'`$(encdir)/gb18030.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gb18030.Tpo $(DEPDIR)/gb18030.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/gb18030.c' object='gb18030.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gb18030.lo `test -f '$(encdir)/gb18030.c' || echo '$(srcdir)/'`$(encdir)/gb18030.ckoi8_r.lo: $(encdir)/koi8_r.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT koi8_r.lo -MD -MP -MF $(DEPDIR)/koi8_r.Tpo -c -o koi8_r.lo `test -f '$(encdir)/koi8_r.c' || echo '$(srcdir)/'`$(encdir)/koi8_r.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/koi8_r.Tpo $(DEPDIR)/koi8_r.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/koi8_r.c' object='koi8_r.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o koi8_r.lo `test -f '$(encdir)/koi8_r.c' || echo '$(srcdir)/'`$(encdir)/koi8_r.ccp1251.lo: $(encdir)/cp1251.c@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cp1251.lo -MD -MP -MF $(DEPDIR)/cp1251.Tpo -c -o cp1251.lo `test -f '$(encdir)/cp1251.c' || echo '$(srcdir)/'`$(encdir)/cp1251.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cp1251.Tpo $(DEPDIR)/cp1251.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(encdir)/cp1251.c' object='cp1251.lo' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cp1251.lo `test -f '$(encdir)/cp1251.c' || echo '$(srcdir)/'`$(encdir)/cp1251.ctestp-testc.o: testc.c@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -MT testp-testc.o -MD -MP -MF $(DEPDIR)/testp-testc.Tpo -c -o testp-testc.o `test -f 'testc.c' || echo '$(srcdir)/'`testc.c@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testp-testc.Tpo $(DEPDIR)/testp-testc.Po@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testc.c' object='testp-testc.o' libtool=no @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -c -o testp-testc.o `test -f 'testc.c' || echo '$(srcdir)/'`testc.ctestp-testc.obj: testc.c@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -MT testp-testc.obj -MD -MP -MF $(DEPDIR)/testp-testc.Tpo -c -o testp-testc.obj `if test -f 'testc.c'; then $(CYGPATH_W) 'testc.c'; else $(CYGPATH_W) '$(srcdir)/testc.c'; fi`@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testp-testc.Tpo $(DEPDIR)/testp-testc.Po@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testc.c' object='testp-testc.obj' libtool=no @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testp_CFLAGS) $(CFLAGS) -c -o testp-testc.obj `if test -f 'testc.c'; then $(CYGPATH_W) 'testc.c'; else $(CYGPATH_W) '$(srcdir)/testc.c'; fi`mostlyclean-libtool:-rm -f *.loclean-libtool:-rm -rf .libs _libsdistclean-libtool:-rm -f libtoolinstall-includeHEADERS: $(include_HEADERS)@$(NORMAL_INSTALL)test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"@list='$(include_HEADERS)'; for p in $$list; do \if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \f=$(am__strip_dir) \echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \doneuninstall-includeHEADERS:@$(NORMAL_UNINSTALL)@list='$(include_HEADERS)'; for p in $$list; do \f=$(am__strip_dir) \echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \rm -f "$(DESTDIR)$(includedir)/$$f"; \done# This directory's subdirectories are mostly independent; you can cd# into them and run `make' without going through this Makefile.# To change the values of `make' variables: instead of editing Makefiles,# (1) if the variable is set in `config.status', edit `config.status'# (which will cause the Makefiles to be regenerated when you run `make');# (2) otherwise, pass the desired values on the `make' command line.$(RECURSIVE_TARGETS):@failcom='exit 1'; \for f in x $$MAKEFLAGS; do \case $$f in \*=* | --[!k]*);; \*k*) failcom='fail=yes';; \esac; \done; \dot_seen=no; \target=`echo $@ | sed s/-recursive//`; \list='$(SUBDIRS)'; for subdir in $$list; do \echo "Making $$target in $$subdir"; \if test "$$subdir" = "."; then \dot_seen=yes; \local_target="$$target-am"; \else \local_target="$$target"; \fi; \(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \|| eval $$failcom; \done; \if test "$$dot_seen" = "no"; then \$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \fi; test -z "$$fail"$(RECURSIVE_CLEAN_TARGETS):@failcom='exit 1'; \for f in x $$MAKEFLAGS; do \case $$f in \*=* | --[!k]*);; \*k*) failcom='fail=yes';; \esac; \done; \dot_seen=no; \case "$@" in \distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \*) list='$(SUBDIRS)' ;; \esac; \rev=''; for subdir in $$list; do \if test "$$subdir" = "."; then :; else \rev="$$subdir $$rev"; \fi; \done; \rev="$$rev ."; \target=`echo $@ | sed s/-recursive//`; \for subdir in $$rev; do \echo "Making $$target in $$subdir"; \if test "$$subdir" = "."; then \local_target="$$target-am"; \else \local_target="$$target"; \fi; \(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \|| eval $$failcom; \done && test -z "$$fail"tags-recursive:list='$(SUBDIRS)'; for subdir in $$list; do \test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \donectags-recursive:list='$(SUBDIRS)'; for subdir in $$list; do \test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \doneID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \unique=`for i in $$list; do \if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \done | \$(AWK) ' { files[$$0] = 1; } \END { for (i in files) print i; }'`; \mkid -fID $$uniquetags: TAGSTAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \$(TAGS_FILES) $(LISP)tags=; \here=`pwd`; \if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \include_option=--etags-include; \empty_fix=.; \else \include_option=--include; \empty_fix=; \fi; \list='$(SUBDIRS)'; for subdir in $$list; do \if test "$$subdir" = .; then :; else \test ! -f $$subdir/TAGS || \tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \fi; \done; \list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \unique=`for i in $$list; do \if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \done | \$(AWK) ' { files[$$0] = 1; } \END { for (i in files) print i; }'`; \if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \test -n "$$unique" || unique=$$empty_fix; \$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \$$tags $$unique; \fictags: CTAGSCTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \$(TAGS_FILES) $(LISP)tags=; \here=`pwd`; \list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \unique=`for i in $$list; do \if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \done | \$(AWK) ' { files[$$0] = 1; } \END { for (i in files) print i; }'`; \test -z "$(CTAGS_ARGS)$$tags$$unique" \|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \$$tags $$uniqueGTAGS:here=`$(am__cd) $(top_builddir) && pwd` \&& cd $(top_srcdir) \&& gtags -i $(GTAGS_ARGS) $$heredistclean-tags:-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tagscheck-TESTS: $(TESTS)@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \srcdir=$(srcdir); export srcdir; \list=' $(TESTS) '; \if test -n "$$list"; then \for tst in $$list; do \if test -f ./$$tst; then dir=./; \elif test -f $$tst; then dir=; \else dir="$(srcdir)/"; fi; \if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \all=`expr $$all + 1`; \case " $(XFAIL_TESTS) " in \*$$ws$$tst$$ws*) \xpass=`expr $$xpass + 1`; \failed=`expr $$failed + 1`; \echo "XPASS: $$tst"; \;; \*) \echo "PASS: $$tst"; \;; \esac; \elif test $$? -ne 77; then \all=`expr $$all + 1`; \case " $(XFAIL_TESTS) " in \*$$ws$$tst$$ws*) \xfail=`expr $$xfail + 1`; \echo "XFAIL: $$tst"; \;; \*) \failed=`expr $$failed + 1`; \echo "FAIL: $$tst"; \;; \esac; \else \skip=`expr $$skip + 1`; \echo "SKIP: $$tst"; \fi; \done; \if test "$$failed" -eq 0; then \if test "$$xfail" -eq 0; then \banner="All $$all tests passed"; \else \banner="All $$all tests behaved as expected ($$xfail expected failures)"; \fi; \else \if test "$$xpass" -eq 0; then \banner="$$failed of $$all tests failed"; \else \banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \fi; \fi; \dashes="$$banner"; \skipped=""; \if test "$$skip" -ne 0; then \skipped="($$skip tests were not run)"; \test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \dashes="$$skipped"; \fi; \report=""; \if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \report="Please report to $(PACKAGE_BUGREPORT)"; \test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \dashes="$$report"; \fi; \dashes=`echo "$$dashes" | sed s/./=/g`; \echo "$$dashes"; \echo "$$banner"; \test -z "$$skipped" || echo "$$skipped"; \test -z "$$report" || echo "$$report"; \echo "$$dashes"; \test "$$failed" -eq 0; \else :; fidistdir: $(DISTFILES)$(am__remove_distdir)test -d $(distdir) || mkdir $(distdir)@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \list='$(DISTFILES)'; \dist_files=`for file in $$list; do echo $$file; done | \sed -e "s|^$$srcdirstrip/||;t" \-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \case $$dist_files in \*/*) $(MKDIR_P) `echo "$$dist_files" | \sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \sort -u` ;; \esac; \for file in $$dist_files; do \if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \if test -d $$d/$$file; then \dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \fi; \cp -pR $$d/$$file $(distdir)$$dir || exit 1; \else \test -f $(distdir)/$$file \|| cp -p $$d/$$file $(distdir)/$$file \|| exit 1; \fi; \donelist='$(DIST_SUBDIRS)'; for subdir in $$list; do \if test "$$subdir" = .; then :; else \test -d "$(distdir)/$$subdir" \|| $(MKDIR_P) "$(distdir)/$$subdir" \|| exit 1; \distdir=`$(am__cd) $(distdir) && pwd`; \top_distdir=`$(am__cd) $(top_distdir) && pwd`; \(cd $$subdir && \$(MAKE) $(AM_MAKEFLAGS) \top_distdir="$$top_distdir" \distdir="$$distdir/$$subdir" \am__remove_distdir=: \am__skip_length_check=: \distdir) \|| exit 1; \fi; \done-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \! -type d ! -perm -400 -exec chmod a+r {} \; -o \! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \|| chmod -R a+r $(distdir)dist-gzip: distdirtardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz$(am__remove_distdir)dist-bzip2: distdirtardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2$(am__remove_distdir)dist-tarZ: distdirtardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z$(am__remove_distdir)dist-shar: distdirshar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz$(am__remove_distdir)dist-zip: distdir-rm -f $(distdir).zipzip -rq $(distdir).zip $(distdir)$(am__remove_distdir)dist dist-all: distdirtardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz$(am__remove_distdir)# This target untars the dist file and tries a VPATH configuration. Then# it guarantees that the distribution is self-contained by making another# tarfile.distcheck: distcase '$(DIST_ARCHIVES)' in \*.tar.gz*) \GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\*.tar.bz2*) \bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\*.tar.Z*) \uncompress -c $(distdir).tar.Z | $(am__untar) ;;\*.shar.gz*) \GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\*.zip*) \unzip $(distdir).zip ;;\esacchmod -R a-w $(distdir); chmod a+w $(distdir)mkdir $(distdir)/_buildmkdir $(distdir)/_instchmod a-w $(distdir)dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \&& cd $(distdir)/_build \&& ../configure --srcdir=.. --prefix="$$dc_install_base" \$(DISTCHECK_CONFIGURE_FLAGS) \&& $(MAKE) $(AM_MAKEFLAGS) \&& $(MAKE) $(AM_MAKEFLAGS) dvi \&& $(MAKE) $(AM_MAKEFLAGS) check \&& $(MAKE) $(AM_MAKEFLAGS) install \&& $(MAKE) $(AM_MAKEFLAGS) installcheck \&& $(MAKE) $(AM_MAKEFLAGS) uninstall \&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \distuninstallcheck \&& chmod -R a-w "$$dc_install_base" \&& ({ \(cd ../.. && umask 077 && mkdir "$$dc_destdir") \&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \} || { rm -rf "$$dc_destdir"; exit 1; }) \&& rm -rf "$$dc_destdir" \&& $(MAKE) $(AM_MAKEFLAGS) dist \&& rm -rf $(DIST_ARCHIVES) \&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck$(am__remove_distdir)@(echo "$(distdir) archives ready for distribution: "; \list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'distuninstallcheck:@cd $(distuninstallcheck_dir) \&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \|| { echo "ERROR: files left after uninstall:" ; \if test -n "$(DESTDIR)"; then \echo " (check DESTDIR support)"; \fi ; \$(distuninstallcheck_listfiles) ; \exit 1; } >&2distcleancheck: distclean@if test '$(srcdir)' = . ; then \echo "ERROR: distcleancheck can only run from a VPATH build" ; \exit 1 ; \fi@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \|| { echo "ERROR: files left in build directory after distclean:" ; \$(distcleancheck_listfiles) ; \exit 1; } >&2check-am: all-am$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)$(MAKE) $(AM_MAKEFLAGS) check-TESTScheck: check-recursiveall-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(HEADERS) config.hinstalldirs: installdirs-recursiveinstalldirs-am:for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \test -z "$$dir" || $(MKDIR_P) "$$dir"; \doneinstall: install-recursiveinstall-exec: install-exec-recursiveinstall-data: install-data-recursiveuninstall: uninstall-recursiveinstall-am: all-am@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-aminstallcheck: installcheck-recursiveinstall-strip:$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \`test -z '$(STRIP)' || \echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` installmostlyclean-generic:clean-generic:distclean-generic:-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)maintainer-clean-generic:@echo "This command is intended for maintainers to use"@echo "it deletes files that may require special tools to rebuild."clean: clean-recursiveclean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \clean-libtool mostlyclean-amdistclean: distclean-recursive-rm -f $(am__CONFIG_DISTCLEAN_FILES)-rm -rf ./$(DEPDIR)-rm -f Makefiledistclean-am: clean-am distclean-compile distclean-generic \distclean-hdr distclean-libtool distclean-tagsdvi: dvi-recursivedvi-am:html: html-recursiveinfo: info-recursiveinfo-am:install-data-am: install-includeHEADERSinstall-dvi: install-dvi-recursiveinstall-exec-am: install-binSCRIPTS install-libLTLIBRARIESinstall-html: install-html-recursiveinstall-info: install-info-recursiveinstall-man:install-pdf: install-pdf-recursiveinstall-ps: install-ps-recursiveinstallcheck-am:maintainer-clean: maintainer-clean-recursive-rm -f $(am__CONFIG_DISTCLEAN_FILES)-rm -rf $(top_srcdir)/autom4te.cache-rm -rf ./$(DEPDIR)-rm -f Makefilemaintainer-clean-am: distclean-am maintainer-clean-genericmostlyclean: mostlyclean-recursivemostlyclean-am: mostlyclean-compile mostlyclean-generic \mostlyclean-libtoolpdf: pdf-recursivepdf-am:ps: ps-recursiveps-am:uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \uninstall-libLTLIBRARIES.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \install-strip.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \all all-am am--refresh check check-TESTS check-am clean \clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \distclean-compile distclean-generic distclean-hdr \distclean-libtool distclean-tags distcleancheck distdir \distuninstallcheck dvi dvi-am html html-am info info-am \install install-am install-binSCRIPTS install-data \install-data-am install-dvi install-dvi-am install-exec \install-exec-am install-html install-html-am \install-includeHEADERS install-info install-info-am \install-libLTLIBRARIES install-man install-pdf install-pdf-am \install-ps install-ps-am install-strip installcheck \installcheck-am installdirs installdirs-am maintainer-clean \maintainer-clean-generic mostlyclean mostlyclean-compile \mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \tags tags-recursive uninstall uninstall-am \uninstall-binSCRIPTS uninstall-includeHEADERS \uninstall-libLTLIBRARIESonig-config: onig-config.indll:$(CXX) -shared -Wl,--output-def,libonig.def -o libonig.dll *.o \$(LIBS)strip libonig.dll# Ruby TESTrtest:$(RUBYDIR)/ruby -w -Ke $(srcdir)/test.rb# character-types-table source generatormktable: $(encdir)/mktable.c $(srcdir)/regenc.h$(CC) -I$(top_srcdir) -o mktable $(encdir)/mktable.catest: testc testp testcu@echo "[Oniguruma 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]"@$(top_builddir)/testcu | grep RESULT#testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb# ruby -Ke $(srcdir)/testconv.rb < $(srcdir)/test.rb > $@#testu.c: $(srcdir)/test.rb $(srcdir)/testconvu.rb# ruby -Ke $(srcdir)/testconvu.rb $(srcdir)/test.rb > $@#win32/testc.c: $(srcdir)/test.rb $(srcdir)/testconv.rb# ruby -Ke $(srcdir)/testconv.rb -win < $(srcdir)/test.rb | nkf -cs > $@# Tell versions [3.59,3.63) of GNU make to not export all variables.# Otherwise a system limit (for SysV at least) may be exceeded..NOEXPORT:
README 2007/05/31Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>http://www.geocities.jp/kosako3/oniguruma/Oniguruma is a regular expressions library.The characteristics of this library is that different character encodingfor every regular expression object can be specified.Supported character encodings:ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,EUC-JP, EUC-TW, EUC-KR, EUC-CN,Shift_JIS, Big5, GB18030, KOI8-R, CP1251,ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16* GB18030: contributed by KUBO Takehiro* CP1251: contributed by Byte------------------------------------------------------------LicenseBSD license.InstallCase 1: Unix and Cygwin platform1. ./configure2. make3. make install* uninstallmake uninstall* test (ASCII/EUC-JP)make atest* configuration checkonig-config --cflagsonig-config --libsonig-config --prefixonig-config --exec-prefixCase 2: Win32 platform (VC++)1. copy win32\Makefile Makefile2. copy win32\config.h config.h3. nmakeonig_s.lib: static link libraryonig.dll: dynamic link library* test (ASCII/Shift_JIS)4. copy win32\testc.c testc.c5. nmake ctestRegular ExpressionsSee doc/RE (or doc/RE.ja for Japanese).UsageInclude oniguruma.h in your program. (Oniguruma API)See doc/API for Oniguruma API.If you want to disable UChar type (== unsigned char) definitionin oniguruma.h, define ONIG_ESCAPE_UCHAR_COLLISION and theninclude oniguruma.h.If you want to disable regex_t type definition in oniguruma.h,define ONIG_ESCAPE_REGEX_T_COLLISION and then include oniguruma.h.Example of the compiling/linking command line in Unix or Cygwin,(prefix == /usr/local case)cc sample.c -L/usr/local/lib -lonigIf you want to use static link library(onig_s.lib) in Win32,add option -DONIG_EXTERN=extern to C compiler.Sample Programssample/simple.c example of the minimum (Oniguruma API)sample/names.c example of the named group callback.sample/encode.c example of some encodings.sample/listcap.c example of the capture history.sample/posix.c POSIX API sample.sample/sql.c example of the variable meta characters.(SQL-like pattern matching)Test Programssample/syntax.c Perl, Java and ASIS syntax test.sample/crnl.c --enable-crnl-as-line-terminator testSource Filesoniguruma.h Oniguruma API header file. (public)onig-config.in configuration check program template.regenc.h character encodings framework header file.regint.h internal definitionsregparse.h internal definitions for regparse.c and regcomp.cregcomp.c compiling and optimization functionsregenc.c character encodings framework.regerror.c error message functionregext.c extended API functions. (deluxe version API)regexec.c search and match functionsregparse.c parsing functions.regsyntax.c pattern syntax functions and built-in syntax definitions.regtrav.c capture history tree data traverse functions.regversion.c version info function.st.h hash table functions header filest.c hash table functionsoniggnu.h GNU regex API header file. (public)reggnu.c GNU regex API functionsonigposix.h POSIX API header file. (public)regposerr.c POSIX error message function.regposix.c POSIX API functions.enc/mktable.c character type table generator.enc/ascii.c ASCII encoding.enc/euc_jp.c EUC-JP encoding.enc/euc_tw.c EUC-TW encoding.enc/euc_kr.c EUC-KR, EUC-CN encoding.enc/sjis.c Shift_JIS encoding.enc/big5.c Big5 encoding.enc/gb18030.c GB18030 encoding.enc/koi8.c KOI8 encoding.enc/koi8_r.c KOI8-R encoding.enc/cp1251.c CP1251 encoding.enc/iso8859_1.c ISO-8859-1 encoding. (Latin-1)enc/iso8859_2.c ISO-8859-2 encoding. (Latin-2)enc/iso8859_3.c ISO-8859-3 encoding. (Latin-3)enc/iso8859_4.c ISO-8859-4 encoding. (Latin-4)enc/iso8859_5.c ISO-8859-5 encoding. (Cyrillic)enc/iso8859_6.c ISO-8859-6 encoding. (Arabic)enc/iso8859_7.c ISO-8859-7 encoding. (Greek)enc/iso8859_8.c ISO-8859-8 encoding. (Hebrew)enc/iso8859_9.c ISO-8859-9 encoding. (Latin-5 or Turkish)enc/iso8859_10.c ISO-8859-10 encoding. (Latin-6 or Nordic)enc/iso8859_11.c ISO-8859-11 encoding. (Thai)enc/iso8859_13.c ISO-8859-13 encoding. (Latin-7 or Baltic Rim)enc/iso8859_14.c ISO-8859-14 encoding. (Latin-8 or Celtic)enc/iso8859_15.c ISO-8859-15 encoding. (Latin-9 or West European with Euro)enc/iso8859_16.c ISO-8859-16 encoding.(Latin-10 or South-Eastern European with Euro)enc/utf8.c UTF-8 encoding.enc/utf16_be.c UTF-16BE encoding.enc/utf16_le.c UTF-16LE encoding.enc/utf32_be.c UTF-32BE encoding.enc/utf32_le.c UTF-32LE encoding.enc/unicode.c Unicode information data.win32/Makefile Makefile for Win32 (VC++)win32/config.h config.h for Win32ToDo? case fold flag: Katakana <-> Hiragana.? add ONIG_OPTION_NOTBOS/NOTEOS. (\A, \z, \Z)?? \X (== \PM\pM*)?? implement syntax behavior ONIG_SYN_CONTEXT_INDEP_ANCHORS.?? transmission stopper. (return ONIG_STOP from match_at())and I'm thankful to Akinori MUSHA.Mail Address: K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
# generated automatically by aclocal 1.10 -*- Autoconf -*-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,# 2005, 2006 Free Software Foundation, Inc.# This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY, to the extent permitted by law; without# even the implied warranty of MERCHANTABILITY or FITNESS FOR A# PARTICULAR PURPOSE.m4_if(m4_PACKAGE_VERSION, [2.61],,[m4_fatal([this file was generated for autoconf 2.61.You have another version of autoconf. If you want to use that,you should regenerate the build system entirely.], [63])])# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-## Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,# 2006, 2007, 2008 Free Software Foundation, Inc.# Written by Gordon Matzigkeit, 1996## This file is free software; the Free Software Foundation gives# unlimited permission to copy and/or distribute it, with or without# modifications, as long as this notice is preserved.m4_define([_LT_COPYING], [dnl# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,# 2006, 2007, 2008 Free Software Foundation, Inc.# Written by Gordon Matzigkeit, 1996## This file is part of GNU Libtool.## GNU Libtool is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as# published by the Free Software Foundation; either version 2 of# the License, or (at your option) any later version.## As a special exception to the GNU General Public License,# if you distribute this file as part of a program or library that# is built using GNU Libtool, you may include this file under the# same distribution terms that you use for the rest of that program.## GNU Libtool 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 General Public License for more details.## You should have received a copy of the GNU General Public License# along with GNU Libtool; see the file COPYING. If not, a copy# can be downloaded from http://www.gnu.org/licenses/gpl.html, or# obtained by writing to the Free Software Foundation, Inc.,# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.])# serial 56 LT_INIT# LT_PREREQ(VERSION)# ------------------# Complain and exit if this libtool version is less that VERSION.m4_defun([LT_PREREQ],[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,[m4_default([$3],[m4_fatal([Libtool version $1 or higher is required],63)])],[$2])])# _LT_CHECK_BUILDDIR# ------------------# Complain if the absolute build directory name contains unusual charactersm4_defun([_LT_CHECK_BUILDDIR],[case `pwd` in*\ * | *\ *)AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;esac])# LT_INIT([OPTIONS])# ------------------AC_DEFUN([LT_INIT],[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULTAC_BEFORE([$0], [LT_LANG])dnlAC_BEFORE([$0], [LT_OUTPUT])dnlAC_BEFORE([$0], [LTDL_INIT])dnlm4_require([_LT_CHECK_BUILDDIR])dnldnl Autoconf doesn't catch unexpanded LT_ macros by default:m4_pattern_forbid([^_?LT_[A-Z_]+$])dnlm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnldnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4dnl unless we require an AC_DEFUNed macro:AC_REQUIRE([LTOPTIONS_VERSION])dnlAC_REQUIRE([LTSUGAR_VERSION])dnlAC_REQUIRE([LTVERSION_VERSION])dnlAC_REQUIRE([LTOBSOLETE_VERSION])dnlm4_require([_LT_PROG_LTMAIN])dnldnl Parse OPTIONS_LT_SET_OPTIONS([$0], [$1])# This can be used to rebuild libtool when neededLIBTOOL_DEPS="$ltmain"# Always use our own libtool.LIBTOOL='$(SHELL) $(top_builddir)/libtool'AC_SUBST(LIBTOOL)dnl_LT_SETUP# Only expand once:m4_define([LT_INIT])])# LT_INIT# Old names:AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_PROG_LIBTOOL], [])dnl AC_DEFUN([AM_PROG_LIBTOOL], [])# _LT_CC_BASENAME(CC)# -------------------# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.m4_defun([_LT_CC_BASENAME],[for cc_temp in $1""; docase $cc_temp incompile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;\-*) ;;*) break;;esacdonecc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`])# _LT_FILEUTILS_DEFAULTS# ----------------------# It is okay to use these file commands and assume they have been set# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.m4_defun([_LT_FILEUTILS_DEFAULTS],[: ${CP="cp -f"}: ${MV="mv -f"}: ${RM="rm -f"}])# _LT_FILEUTILS_DEFAULTS# _LT_SETUP# ---------m4_defun([_LT_SETUP],[AC_REQUIRE([AC_CANONICAL_HOST])dnlAC_REQUIRE([AC_CANONICAL_BUILD])dnl_LT_DECL([], [host_alias], [0], [The host system])dnl_LT_DECL([], [host], [0])dnl_LT_DECL([], [host_os], [0])dnldnl_LT_DECL([], [build_alias], [0], [The build system])dnl_LT_DECL([], [build], [0])dnl_LT_DECL([], [build_os], [0])dnldnlAC_REQUIRE([AC_PROG_CC])dnlAC_REQUIRE([LT_PATH_LD])dnlAC_REQUIRE([LT_PATH_NM])dnldnlAC_REQUIRE([AC_PROG_LN_S])dnltest -z "$LN_S" && LN_S="ln -s"_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnldnlAC_REQUIRE([LT_CMD_MAX_LEN])dnl_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnldnlm4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_CHECK_SHELL_FEATURES])dnlm4_require([_LT_CMD_RELOAD])dnlm4_require([_LT_CHECK_MAGIC_METHOD])dnlm4_require([_LT_CMD_OLD_ARCHIVE])dnlm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl_LT_CONFIG_LIBTOOL_INIT([# See if we are running on zsh, and set the options which allow our# commands through without removal of \ escapes INIT.if test -n "\${ZSH_VERSION+set}" ; thensetopt NO_GLOB_SUBSTfi])if test -n "${ZSH_VERSION+set}" ; thensetopt NO_GLOB_SUBSTfi_LT_CHECK_OBJDIRm4_require([_LT_TAG_COMPILER])dnl_LT_PROG_ECHO_BACKSLASHcase $host_os inaix3*)# AIX sometimes has problems with the GCC collect2 program. For some# reason, if we set the COLLECT_NAMES environment variable, the problems# vanish in a puff of smoke.if test "X${COLLECT_NAMES+set}" != Xset; thenCOLLECT_NAMES=export COLLECT_NAMESfi;;esac# Sed substitution that helps us do robust quoting. It backslashifies# metacharacters that are still active within double-quoted strings.sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'# Same as above, but do not quote variable references.double_quote_subst='s/\([["`\\]]\)/\\\1/g'# Sed substitution to delay expansion of an escaped shell variable in a# double_quote_subst'ed string.delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'# Sed substitution to delay expansion of an escaped single quote.delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'# Sed substitution to avoid accidental globbing in evaled expressionsno_glob_subst='s/\*/\\\*/g'# Global variables:ofile=libtoolcan_build_shared=yes# All known linkers require a `.a' archive for static linking (except MSVC,# which needs '.lib').libext=awith_gnu_ld="$lt_cv_prog_gnu_ld"old_CC="$CC"old_CFLAGS="$CFLAGS"# Set sane defaults for various variablestest -z "$CC" && CC=cctest -z "$LTCC" && LTCC=$CCtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGStest -z "$LD" && LD=ldtest -z "$ac_objext" && ac_objext=o_LT_CC_BASENAME([$compiler])# Only perform the check for file, if the check method requires ittest -z "$MAGIC_CMD" && MAGIC_CMD=filecase $deplibs_check_method infile_magic*)if test "$file_magic_cmd" = '$MAGIC_CMD'; then_LT_PATH_MAGICfi;;esac# Use C for the default configuration in the libtool scriptLT_SUPPORTED_TAG([CC])_LT_LANG_C_CONFIG_LT_LANG_DEFAULT_CONFIG_LT_CONFIG_COMMANDS])# _LT_SETUP# _LT_PROG_LTMAIN# ---------------# Note that this code is called both from `configure', and `config.status'# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,# `config.status' has no value for ac_aux_dir unless we are using Automake,# so we pass a copy along to make sure it has a sensible value anyway.m4_defun([_LT_PROG_LTMAIN],[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])ltmain="$ac_aux_dir/ltmain.sh"])# _LT_PROG_LTMAIN# So that we can recreate a full libtool script including additional# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS# in macros and then make a single call at the end using the `libtool'# label.# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])# ----------------------------------------# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.m4_define([_LT_CONFIG_LIBTOOL_INIT],[m4_ifval([$1],[m4_append([_LT_OUTPUT_LIBTOOL_INIT],[$1])])])# Initialize.m4_define([_LT_OUTPUT_LIBTOOL_INIT])# _LT_CONFIG_LIBTOOL([COMMANDS])# ------------------------------# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.m4_define([_LT_CONFIG_LIBTOOL],[m4_ifval([$1],[m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],[$1])])])# Initialize.m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])# -----------------------------------------------------m4_defun([_LT_CONFIG_SAVE_COMMANDS],[_LT_CONFIG_LIBTOOL([$1])_LT_CONFIG_LIBTOOL_INIT([$2])])# _LT_FORMAT_COMMENT([COMMENT])# -----------------------------# Add leading comment marks to the start of each line, and a trailing# full-stop to the whole comment if one is not present already.m4_define([_LT_FORMAT_COMMENT],[m4_ifval([$1], [m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],[['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]))])# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])# -------------------------------------------------------------------# CONFIGNAME is the name given to the value in the libtool script.# VARNAME is the (base) name used in the configure script.# VALUE may be 0, 1 or 2 for a computed quote escaped value based on# VARNAME. Any other value will be used directly.m4_define([_LT_DECL],[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],[lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],[m4_ifval([$1], [$1], [$2])])lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])m4_ifval([$4],[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])lt_dict_add_subkey([lt_decl_dict], [$2],[tagged?], [m4_ifval([$5], [yes], [no])])])])# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])# --------------------------------------------------------m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])# ------------------------------------------------m4_define([lt_decl_tag_varnames],[_lt_decl_filter([tagged?], [yes], $@)])# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])# ---------------------------------------------------------m4_define([_lt_decl_filter],[m4_case([$#],[0], [m4_fatal([$0: too few arguments: $#])],[1], [m4_fatal([$0: too few arguments: $#: $1])],[2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],[3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],[lt_dict_filter([lt_decl_dict], $@)])[]dnl])# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])# --------------------------------------------------m4_define([lt_decl_quote_varnames],[_lt_decl_filter([value], [1], $@)])# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])# ---------------------------------------------------m4_define([lt_decl_dquote_varnames],[_lt_decl_filter([value], [2], $@)])# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])# ---------------------------------------------------m4_define([lt_decl_varnames_tagged],[_$0(m4_quote(m4_default([$1], [[, ]])),m4_quote(m4_if([$2], [],m4_quote(lt_decl_tag_varnames),m4_quote(m4_shift($@)))),m4_split(m4_normalize(m4_quote(_LT_TAGS))))])m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)])# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])# ------------------------------------------------m4_define([lt_decl_all_varnames],[_$0(m4_quote(m4_default([$1], [[, ]])),m4_if([$2], [],m4_quote(lt_decl_varnames),m4_quote(m4_shift($@))))[]dnl])m4_define([_lt_decl_all_varnames],[lt_join($@, lt_decl_varnames_tagged([$1],lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl])# _LT_CONFIG_STATUS_DECLARE([VARNAME])# ------------------------------------# Quote a variable value, and forward it to `config.status' so that its# declaration there will have the same value as in `configure'. VARNAME# must have a single quote delimited value for this to work.m4_define([_LT_CONFIG_STATUS_DECLARE],[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])# _LT_CONFIG_STATUS_DECLARATIONS# ------------------------------# We delimit libtool config variables with single quotes, so when# we write them to config.status, we have to be sure to quote all# embedded single quotes properly. In configure, this macro expands# each variable declared with _LT_DECL (and _LT_TAGDECL) into:## <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),[m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])# _LT_LIBTOOL_TAGS# ----------------# Output comment and list of tags supported by the scriptm4_defun([_LT_LIBTOOL_TAGS],[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnlavailable_tags="_LT_TAGS"dnl])# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])# -----------------------------------# Extract the dictionary values for VARNAME (optionally with TAG) and# expand to a commented shell variable setting:## # Some comment about what VAR is for.# visible_name=$lt_internal_namem4_define([_LT_LIBTOOL_DECLARE],[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],[description])))[]dnlm4_pushdef([_libtool_name],m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnlm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),[0], [_libtool_name=[$]$1],[1], [_libtool_name=$lt_[]$1],[2], [_libtool_name=$lt_[]$1],[_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnlm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl])# _LT_LIBTOOL_CONFIG_VARS# -----------------------# Produce commented declarations of non-tagged libtool config variables# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'# script. Tagged libtool config variables (even for the LIBTOOL CONFIG# section) are produced by _LT_LIBTOOL_TAG_VARS.m4_defun([_LT_LIBTOOL_CONFIG_VARS],[m4_foreach([_lt_var],m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),[m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])# _LT_LIBTOOL_TAG_VARS(TAG)# -------------------------m4_define([_LT_LIBTOOL_TAG_VARS],[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),[m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])# _LT_TAGVAR(VARNAME, [TAGNAME])# ------------------------------m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])# _LT_CONFIG_COMMANDS# -------------------# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of# variables for single and double quote escaping we saved from calls# to _LT_DECL, we can put quote escaped variables declarations# into `config.status', and then the shell code to quote escape them in# for loops in `config.status'. Finally, any additional code accumulated# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.m4_defun([_LT_CONFIG_COMMANDS],[AC_PROVIDE_IFELSE([LT_OUTPUT],dnl If the libtool generation code has been placed in $CONFIG_LT,dnl instead of duplicating it all over again into config.status,dnl then we will have config.status run $CONFIG_LT later, so itdnl needs to know what name is stored there:[AC_CONFIG_COMMANDS([libtool],[$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],dnl If the libtool generation code is destined for config.status,dnl expand the accumulated commands and init code now:[AC_CONFIG_COMMANDS([libtool],[_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])])#_LT_CONFIG_COMMANDS# Initialize.m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],[# The HP-UX ksh and POSIX shell print the target directory to stdout# if CDPATH is set.(unset CDPATH) >/dev/null 2>&1 && unset CDPATHsed_quote_subst='$sed_quote_subst'double_quote_subst='$double_quote_subst'delay_variable_subst='$delay_variable_subst'_LT_CONFIG_STATUS_DECLARATIONSLTCC='$LTCC'LTCFLAGS='$LTCFLAGS'compiler='$compiler_DEFAULT'# Quote evaled strings.for var in lt_decl_all_varnames([[ \]], lt_decl_quote_varnames); docase \`eval \\\\\$ECHO "X\\\\\$\$var"\` in*[[\\\\\\\`\\"\\\$]]*)eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"";;*)eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"";;esacdone# Double-quote double-evaled strings.for var in lt_decl_all_varnames([[ \]], lt_decl_dquote_varnames); docase \`eval \\\\\$ECHO "X\\\\\$\$var"\` in*[[\\\\\\\`\\"\\\$]]*)eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"";;*)eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"";;esacdone# Fix-up fallback echo if it was mangled by the above quoting rules.case \$lt_ECHO in*'\\\[$]0 --fallback-echo"')dnl "lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`;;esac_LT_OUTPUT_LIBTOOL_INIT])# LT_OUTPUT# ---------# This macro allows early generation of the libtool script (before# AC_OUTPUT is called), incase it is used in configure for compilation# tests.AC_DEFUN([LT_OUTPUT],[: ${CONFIG_LT=./config.lt}AC_MSG_NOTICE([creating $CONFIG_LT])cat >"$CONFIG_LT" <<_LTEOF#! $SHELL# Generated by $as_me.# Run this file to recreate a libtool stub with the current configuration.lt_cl_silent=falseSHELL=\${CONFIG_SHELL-$SHELL}_LTEOFcat >>"$CONFIG_LT" <<\_LTEOFAS_SHELL_SANITIZE_AS_PREPAREexec AS_MESSAGE_FD>&1exec AS_MESSAGE_LOG_FD>>config.log{echoAS_BOX([Running $as_me.])} >&AS_MESSAGE_LOG_FDlt_cl_help="\\`$as_me' creates a local libtool stub from the current configuration,for use in further configure time tests before the real libtool isgenerated.Usage: $[0] [[OPTIONS]]-h, --help print this help, then exit-V, --version print version number, then exit-q, --quiet do not print progress messages-d, --debug don't remove temporary filesReport bugs to <bug-libtool@gnu.org>."lt_cl_version="\m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnlm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])configured by $[0], generated by m4_PACKAGE_STRING.Copyright (C) 2008 Free Software Foundation, Inc.This config.lt script is free software; the Free Software Foundationgives unlimited permision to copy, distribute and modify it."while test $[#] != 0docase $[1] in--version | --v* | -V )echo "$lt_cl_version"; exit 0 ;;--help | --h* | -h )echo "$lt_cl_help"; exit 0 ;;--debug | --d* | -d )debug=: ;;--quiet | --q* | --silent | --s* | -q )lt_cl_silent=: ;;-*) AC_MSG_ERROR([unrecognized option: $[1]Try \`$[0] --help' for more information.]) ;;*) AC_MSG_ERROR([unrecognized argument: $[1]Try \`$[0] --help' for more information.]) ;;esacshiftdoneif $lt_cl_silent; thenexec AS_MESSAGE_FD>/dev/nullfi_LTEOFcat >>"$CONFIG_LT" <<_LTEOF_LT_OUTPUT_LIBTOOL_COMMANDS_INIT_LTEOFcat >>"$CONFIG_LT" <<\_LTEOFAC_MSG_NOTICE([creating $ofile])_LT_OUTPUT_LIBTOOL_COMMANDSAS_EXIT(0)_LTEOFchmod +x "$CONFIG_LT"# configure is writing to config.log, but config.lt does its own redirection,# appending to config.log, which fails on DOS, as config.log is still kept# open by configure. Here we exec the FD to /dev/null, effectively closing# config.log, so it can be properly (re)opened and appended to by config.lt.if test "$no_create" != yes; thenlt_cl_success=:test "$silent" = yes &<_config_lt_args="$lt_config_lt_args --quiet"exec AS_MESSAGE_LOG_FD>/dev/null$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=falseexec AS_MESSAGE_LOG_FD>>config.log$lt_cl_success || AS_EXIT(1)fi])# LT_OUTPUT# _LT_CONFIG(TAG)# ---------------# If TAG is the built-in tag, create an initial libtool script with a# default configuration from the untagged config vars. Otherwise add code# to config.status for appending the configuration named by TAG from the# matching tagged config vars.m4_defun([_LT_CONFIG],[m4_require([_LT_FILEUTILS_DEFAULTS])dnl_LT_CONFIG_SAVE_COMMANDS([m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnlm4_if(_LT_TAG, [C], [# See if we are running on zsh, and set the options which allow our# commands through without removal of \ escapes.if test -n "${ZSH_VERSION+set}" ; thensetopt NO_GLOB_SUBSTficfgfile="${ofile}T"trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15$RM -f "$cfgfile"cat <<_LT_EOF >> "$cfgfile"#! $SHELL# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:# NOTE: Changes made to this file will be lost: look at ltmain.sh.#_LT_COPYING_LT_LIBTOOL_TAGS# ### BEGIN LIBTOOL CONFIG_LT_LIBTOOL_CONFIG_VARS_LT_LIBTOOL_TAG_VARS# ### END LIBTOOL CONFIG_LT_EOFcase $host_os inaix3*)cat <<\_LT_EOF >> "$cfgfile"# AIX sometimes has problems with the GCC collect2 program. For some# reason, if we set the COLLECT_NAMES environment variable, the problems# vanish in a puff of smoke.if test "X${COLLECT_NAMES+set}" != Xset; thenCOLLECT_NAMES=export COLLECT_NAMESfi_LT_EOF;;esac_LT_PROG_LTMAIN# We use sed instead of cat because bash on DJGPP gets confused if# if finds mixed CR/LF and LF-only lines. Since sed operates in# text mode, it properly converts lines to CR/LF. This bash problem# is reportedly fixed, but why not run on old versions too?sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \|| (rm -f "$cfgfile"; exit 1)_LT_PROG_XSI_SHELLFNSsed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \|| (rm -f "$cfgfile"; exit 1)mv -f "$cfgfile" "$ofile" ||(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")chmod +x "$ofile"],[cat <<_LT_EOF >> "$ofile"dnl Unfortunately we have to use $1 here, since _LT_TAG is not expandeddnl in a comment (ie after a #).# ### BEGIN LIBTOOL TAG CONFIG: $1_LT_LIBTOOL_TAG_VARS(_LT_TAG)# ### END LIBTOOL TAG CONFIG: $1_LT_EOF])dnl /m4_if],[m4_if([$1], [], [PACKAGE='$PACKAGE'VERSION='$VERSION'TIMESTAMP='$TIMESTAMP'RM='$RM'ofile='$ofile'], [])])dnl /_LT_CONFIG_SAVE_COMMANDS])# _LT_CONFIG# LT_SUPPORTED_TAG(TAG)# ---------------------# Trace this macro to discover what tags are supported by the libtool# --tag option, using:# autoconf --trace 'LT_SUPPORTED_TAG:$1'AC_DEFUN([LT_SUPPORTED_TAG], [])# C support is built-in for nowm4_define([_LT_LANG_C_enabled], [])m4_define([_LT_TAGS], [])# LT_LANG(LANG)# -------------# Enable libtool support for the given language if not already enabled.AC_DEFUN([LT_LANG],[AC_BEFORE([$0], [LT_OUTPUT])dnlm4_case([$1],[C], [_LT_LANG(C)],[C++], [_LT_LANG(CXX)],[Java], [_LT_LANG(GCJ)],[Fortran 77], [_LT_LANG(F77)],[Fortran], [_LT_LANG(FC)],[Windows Resource], [_LT_LANG(RC)],[m4_ifdef([_LT_LANG_]$1[_CONFIG],[_LT_LANG($1)],[m4_fatal([$0: unsupported language: "$1"])])])dnl])# LT_LANG# _LT_LANG(LANGNAME)# ------------------m4_defun([_LT_LANG],[m4_ifdef([_LT_LANG_]$1[_enabled], [],[LT_SUPPORTED_TAG([$1])dnlm4_append([_LT_TAGS], [$1 ])dnlm4_define([_LT_LANG_]$1[_enabled], [])dnl_LT_LANG_$1_CONFIG($1)])dnl])# _LT_LANG# _LT_LANG_DEFAULT_CONFIG# -----------------------m4_defun([_LT_LANG_DEFAULT_CONFIG],[AC_PROVIDE_IFELSE([AC_PROG_CXX],[LT_LANG(CXX)],[m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])AC_PROVIDE_IFELSE([AC_PROG_F77],[LT_LANG(F77)],[m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])AC_PROVIDE_IFELSE([AC_PROG_FC],[LT_LANG(FC)],[m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocaldnl pulling things in needlessly.AC_PROVIDE_IFELSE([AC_PROG_GCJ],[LT_LANG(GCJ)],[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[LT_LANG(GCJ)],[AC_PROVIDE_IFELSE([LT_PROG_GCJ],[LT_LANG(GCJ)],[m4_ifdef([AC_PROG_GCJ],[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])m4_ifdef([A][M_PROG_GCJ],[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])m4_ifdef([LT_PROG_GCJ],[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])AC_PROVIDE_IFELSE([LT_PROG_RC],[LT_LANG(RC)],[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])])# _LT_LANG_DEFAULT_CONFIG# Obsolete macros:AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_CXX], [])dnl AC_DEFUN([AC_LIBTOOL_F77], [])dnl AC_DEFUN([AC_LIBTOOL_FC], [])dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])# _LT_TAG_COMPILER# ----------------m4_defun([_LT_TAG_COMPILER],[AC_REQUIRE([AC_PROG_CC])dnl_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl# If no C compiler was specified, use CC.LTCC=${LTCC-"$CC"}# If no C compiler flags were specified, use CFLAGS.LTCFLAGS=${LTCFLAGS-"$CFLAGS"}# Allow CC to be a program name with arguments.compiler=$CC])# _LT_TAG_COMPILER# _LT_COMPILER_BOILERPLATE# ------------------------# Check for compiler boilerplate output or warnings with# the simple compiler test code.m4_defun([_LT_COMPILER_BOILERPLATE],[m4_require([_LT_DECL_SED])dnlac_outfile=conftest.$ac_objextecho "$lt_simple_compile_test_code" >conftest.$ac_exteval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err_lt_compiler_boilerplate=`cat conftest.err`$RM -r conftest*])# _LT_COMPILER_BOILERPLATE# _LT_LINKER_BOILERPLATE# ----------------------# Check for linker boilerplate output or warnings with# the simple link test code.m4_defun([_LT_LINKER_BOILERPLATE],[m4_require([_LT_DECL_SED])dnlac_outfile=conftest.$ac_objextecho "$lt_simple_link_test_code" >conftest.$ac_exteval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err_lt_linker_boilerplate=`cat conftest.err`$RM -r conftest*])# _LT_LINKER_BOILERPLATE# _LT_REQUIRED_DARWIN_CHECKS# -------------------------m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[case $host_os inrhapsody* | darwin*)AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])AC_CHECK_TOOL([NMEDIT], [nmedit], [:])AC_CHECK_TOOL([LIPO], [lipo], [:])AC_CHECK_TOOL([OTOOL], [otool], [:])AC_CHECK_TOOL([OTOOL64], [otool64], [:])_LT_DECL([], [DSYMUTIL], [1],[Tool to manipulate archived DWARF debug symbol files on Mac OS X])_LT_DECL([], [NMEDIT], [1],[Tool to change global to local symbols on Mac OS X])_LT_DECL([], [LIPO], [1],[Tool to manipulate fat objects and archives on Mac OS X])_LT_DECL([], [OTOOL], [1],[ldd/readelf like tool for Mach-O binaries on Mac OS X])_LT_DECL([], [OTOOL64], [1],[ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],[lt_cv_apple_cc_single_mod=noif test -z "${LT_MULTI_MODULE}"; then# By default we will add the -single_module flag. You can override# by either setting the environment variable LT_MULTI_MODULE# non-empty at configure time, or by adding -multi_module to the# link flags.rm -rf libconftest.dylib*echo "int foo(void){return 1;}" > conftest.cecho "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \-dynamiclib -Wl,-single_module conftest.c 2>conftest.err_lt_result=$?if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; thenlt_cv_apple_cc_single_mod=yeselsecat conftest.err >&AS_MESSAGE_LOG_FDfirm -rf libconftest.dylib*rm -f conftest.*fi])AC_CACHE_CHECK([for -exported_symbols_list linker flag],[lt_cv_ld_exported_symbols_list],[lt_cv_ld_exported_symbols_list=nosave_LDFLAGS=$LDFLAGSecho "_main" > conftest.symLDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],[lt_cv_ld_exported_symbols_list=yes],[lt_cv_ld_exported_symbols_list=no])LDFLAGS="$save_LDFLAGS"])case $host_os inrhapsody* | darwin1.[[012]])_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;darwin1.*)_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;darwin*) # darwin 5.x on# if running on 10.5 or later, the deployment target defaults# to the OS version, if on x86, and 10.4, the deployment# target defaults to 10.4. Don't you love it?case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;10.[[012]]*)_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;10.*)_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;esac;;esacif test "$lt_cv_apple_cc_single_mod" = "yes"; then_lt_dar_single_mod='$single_module'fiif test "$lt_cv_ld_exported_symbols_list" = "yes"; then_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'else_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'fiif test "$DSYMUTIL" != ":"; then_lt_dsymutil='~$DSYMUTIL $lib || :'else_lt_dsymutil=fi;;esac])# _LT_DARWIN_LINKER_FEATURES# --------------------------# Checks for linker and compiler features on darwinm4_defun([_LT_DARWIN_LINKER_FEATURES],[m4_require([_LT_REQUIRED_DARWIN_CHECKS])_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_automatic, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported_LT_TAGVAR(whole_archive_flag_spec, $1)=''_LT_TAGVAR(link_all_deplibs, $1)=yes_LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"if test "$GCC" = "yes"; thenoutput_verbose_link_cmd=echo_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"_LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"m4_if([$1], [CXX],[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"_LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"fi],[])else_LT_TAGVAR(ld_shlibs, $1)=nofi])# _LT_SYS_MODULE_PATH_AIX# -----------------------# Links a minimal program and checks the executable# for the system default hardcoded library path. In most cases,# this is /usr/lib:/lib, but when the MPI compilers are used# the location of the communication and MPI libs are included too.# If we don't find anything, use the default library path according# to the aix ld manual.m4_defun([_LT_SYS_MODULE_PATH_AIX],[m4_require([_LT_DECL_SED])dnlAC_LINK_IFELSE(AC_LANG_PROGRAM,[lt_aix_libpath_sed='/Import File Strings/,/^$/ {/^0/ {s/^0 *\(.*\)$/\1/p}}'aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`# Check for a 64-bit object if we didn't find anything.if test -z "$aix_libpath"; thenaix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`fi],[])if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi])# _LT_SYS_MODULE_PATH_AIX# _LT_SHELL_INIT(ARG)# -------------------m4_define([_LT_SHELL_INIT],[ifdef([AC_DIVERSION_NOTICE],[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],[AC_DIVERT_PUSH(NOTICE)])$1AC_DIVERT_POP])# _LT_SHELL_INIT# _LT_PROG_ECHO_BACKSLASH# -----------------------# Add some code to the start of the generated configure script which# will find an echo command which doesn't interpret backslashes.m4_defun([_LT_PROG_ECHO_BACKSLASH],[_LT_SHELL_INIT([# Check that we are running under the correct shell.SHELL=${CONFIG_SHELL-/bin/sh}case X$lt_ECHO inX*--fallback-echo)# Remove one level of quotation (which was required for Make).ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`;;esacECHO=${lt_ECHO-echo}if test "X[$]1" = X--no-reexec; then# Discard the --no-reexec flag, and continue.shiftelif test "X[$]1" = X--fallback-echo; then# Avoid inline document here, it may be left over:elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then# Yippee, $ECHO works!:else# Restart under the correct shell.exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}fiif test "X[$]1" = X--fallback-echo; then# used as fallback echoshiftcat <<_LT_EOF[$]*_LT_EOFexit 0fi# The HP-UX ksh and POSIX shell print the target directory to stdout# if CDPATH is set.(unset CDPATH) >/dev/null 2>&1 && unset CDPATHif test -z "$lt_ECHO"; thenif test "X${echo_test_string+set}" != Xset; then# find a string as large as possible, as long as the shell can cope with itfor cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...if { echo_test_string=`eval $cmd`; } 2>/dev/null &&{ test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/nullthenbreakfidonefiif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; then:else# The Solaris, AIX, and Digital Unix default echo programs unquote# backslashes. This makes it impossible to quote backslashes using# echo "$something" | sed 's/\\/\\\\/g'## So, first we look for a working echo in the user's PATH.lt_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor dir in $PATH /usr/ucb; doIFS="$lt_save_ifs"if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; thenECHO="$dir/echo"breakfidoneIFS="$lt_save_ifs"if test "X$ECHO" = Xecho; then# We didn't find a better echo, so look for alternatives.if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; then# This shell has a builtin print -r that does the trick.ECHO='print -r'elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&test "X$CONFIG_SHELL" != X/bin/ksh; then# If we have ksh, try running configure again with it.ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}export ORIGINAL_CONFIG_SHELLCONFIG_SHELL=/bin/kshexport CONFIG_SHELLexec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}else# Try using printf.ECHO='printf %s\n'if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; then# Cool, printf works:elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&test "X$echo_testing_string" = 'X\t' &&echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; thenCONFIG_SHELL=$ORIGINAL_CONFIG_SHELLexport CONFIG_SHELLSHELL="$CONFIG_SHELL"export SHELLECHO="$CONFIG_SHELL [$]0 --fallback-echo"elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&test "X$echo_testing_string" = 'X\t' &&echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; thenECHO="$CONFIG_SHELL [$]0 --fallback-echo"else# maybe with a smaller string...prev=:for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; doif { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/nullthenbreakfiprev="$cmd"doneif test "$prev" != 'sed 50q "[$]0"'; thenecho_test_string=`eval $prev`export echo_test_stringexec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}else# Oops. We lost completely, so just stick with echo.ECHO=echofifififififi# Copy echo and quote the copy suitably for passing to libtool from# the Makefile, instead of quoting the original, which is used later.lt_ECHO=$ECHOif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; thenlt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"fiAC_SUBST(lt_ECHO)])_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])_LT_DECL([], [ECHO], [1],[An echo program that does not interpret backslashes])])# _LT_PROG_ECHO_BACKSLASH# _LT_ENABLE_LOCK# ---------------m4_defun([_LT_ENABLE_LOCK],[AC_ARG_ENABLE([libtool-lock],[AS_HELP_STRING([--disable-libtool-lock],[avoid locking (might break parallel builds)])])test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes# Some flags need to be propagated to the compiler or linker for good# libtool support.case $host inia64-*-hpux*)# Find out which ABI we are using.echo 'int i;' > conftest.$ac_extif AC_TRY_EVAL(ac_compile); thencase `/usr/bin/file conftest.$ac_objext` in*ELF-32*)HPUX_IA64_MODE="32";;*ELF-64*)HPUX_IA64_MODE="64";;esacfirm -rf conftest*;;*-*-irix6*)# Find out which ABI we are using.echo '[#]line __oline__ "configure"' > conftest.$ac_extif AC_TRY_EVAL(ac_compile); thenif test "$lt_cv_prog_gnu_ld" = yes; thencase `/usr/bin/file conftest.$ac_objext` in*32-bit*)LD="${LD-ld} -melf32bsmip";;*N32*)LD="${LD-ld} -melf32bmipn32";;*64-bit*)LD="${LD-ld} -melf64bmip";;esacelsecase `/usr/bin/file conftest.$ac_objext` in*32-bit*)LD="${LD-ld} -32";;*N32*)LD="${LD-ld} -n32";;*64-bit*)LD="${LD-ld} -64";;esacfifirm -rf conftest*;;x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \s390*-*linux*|s390*-*tpf*|sparc*-*linux*)# Find out which ABI we are using.echo 'int i;' > conftest.$ac_extif AC_TRY_EVAL(ac_compile); thencase `/usr/bin/file conftest.o` in*32-bit*)case $host inx86_64-*kfreebsd*-gnu)LD="${LD-ld} -m elf_i386_fbsd";;x86_64-*linux*)LD="${LD-ld} -m elf_i386";;ppc64-*linux*|powerpc64-*linux*)LD="${LD-ld} -m elf32ppclinux";;s390x-*linux*)LD="${LD-ld} -m elf_s390";;sparc64-*linux*)LD="${LD-ld} -m elf32_sparc";;esac;;*64-bit*)case $host inx86_64-*kfreebsd*-gnu)LD="${LD-ld} -m elf_x86_64_fbsd";;x86_64-*linux*)LD="${LD-ld} -m elf_x86_64";;ppc*-*linux*|powerpc*-*linux*)LD="${LD-ld} -m elf64ppc";;s390*-*linux*|s390*-*tpf*)LD="${LD-ld} -m elf64_s390";;sparc*-*linux*)LD="${LD-ld} -m elf64_sparc";;esac;;esacfirm -rf conftest*;;*-*-sco3.2v5*)# On SCO OpenServer 5, we need -belf to get full-featured binaries.SAVE_CFLAGS="$CFLAGS"CFLAGS="$CFLAGS -belf"AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,[AC_LANG_PUSH(C)AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])AC_LANG_POP])if test x"$lt_cv_cc_needs_belf" != x"yes"; then# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belfCFLAGS="$SAVE_CFLAGS"fi;;sparc*-*solaris*)# Find out which ABI we are using.echo 'int i;' > conftest.$ac_extif AC_TRY_EVAL(ac_compile); thencase `/usr/bin/file conftest.o` in*64-bit*)case $lt_cv_prog_gnu_ld inyes*) LD="${LD-ld} -m elf64_sparc" ;;*)if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; thenLD="${LD-ld} -64"fi;;esac;;esacfirm -rf conftest*;;esacneed_locks="$enable_libtool_lock"])# _LT_ENABLE_LOCK# _LT_CMD_OLD_ARCHIVE# -------------------m4_defun([_LT_CMD_OLD_ARCHIVE],[AC_CHECK_TOOL(AR, ar, false)test -z "$AR" && AR=artest -z "$AR_FLAGS" && AR_FLAGS=cru_LT_DECL([], [AR], [1], [The archiver])_LT_DECL([], [AR_FLAGS], [1])AC_CHECK_TOOL(STRIP, strip, :)test -z "$STRIP" && STRIP=:_LT_DECL([], [STRIP], [1], [A symbol stripping program])AC_CHECK_TOOL(RANLIB, ranlib, :)test -z "$RANLIB" && RANLIB=:_LT_DECL([], [RANLIB], [1],[Commands used to install an old-style archive])# Determine commands to create old-style static archives.old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'old_postinstall_cmds='chmod 644 $oldlib'old_postuninstall_cmds=if test -n "$RANLIB"; thencase $host_os inopenbsd*)old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib";;*)old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib";;esacold_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"fi_LT_DECL([], [old_postinstall_cmds], [2])_LT_DECL([], [old_postuninstall_cmds], [2])_LT_TAGDECL([], [old_archive_cmds], [2],[Commands used to build an old-style archive])])# _LT_CMD_OLD_ARCHIVE# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])# ----------------------------------------------------------------# Check whether the given compiler option worksAC_DEFUN([_LT_COMPILER_OPTION],[m4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_DECL_SED])dnlAC_CACHE_CHECK([$1], [$2],[$2=nom4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])echo "$lt_simple_compile_test_code" > conftest.$ac_extlt_compiler_flag="$3"# Insert the option either (1) after the last *FLAGS variable, or# (2) before a word containing "conftest.", or (3) at the end.# Note that $ac_compile itself does not contain backslashes and begins# with a dollar sign (not a hyphen), so the echo should work correctly.# The option is referenced via a variable to avoid confusing sed.lt_compile=`echo "$ac_compile" | $SED \-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \-e 's:$: $lt_compiler_flag:'`(eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)(eval "$lt_compile" 2>conftest.err)ac_status=$?cat conftest.err >&AS_MESSAGE_LOG_FDecho "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FDif (exit $ac_status) && test -s "$ac_outfile"; then# The compiler can only warn and ignore the option if not recognized# So say no if there are warnings other than the usual output.$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then$2=yesfifi$RM -r conftest*])if test x"[$]$2" = xyes; thenm4_if([$5], , :, [$5])elsem4_if([$6], , :, [$6])fi])# _LT_COMPILER_OPTION# Old name:AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,# [ACTION-SUCCESS], [ACTION-FAILURE])# ----------------------------------------------------# Check whether the given linker option worksAC_DEFUN([_LT_LINKER_OPTION],[m4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_DECL_SED])dnlAC_CACHE_CHECK([$1], [$2],[$2=nosave_LDFLAGS="$LDFLAGS"LDFLAGS="$LDFLAGS $3"echo "$lt_simple_link_test_code" > conftest.$ac_extif (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then# The linker can only warn and ignore the option if not recognized# So say no if there are warningsif test -s conftest.err; then# Append any errors to the config.log.cat conftest.err 1>&AS_MESSAGE_LOG_FD$ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2if diff conftest.exp conftest.er2 >/dev/null; then$2=yesfielse$2=yesfifi$RM -r conftest*LDFLAGS="$save_LDFLAGS"])if test x"[$]$2" = xyes; thenm4_if([$4], , :, [$4])elsem4_if([$5], , :, [$5])fi])# _LT_LINKER_OPTION# Old name:AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])# LT_CMD_MAX_LEN#---------------AC_DEFUN([LT_CMD_MAX_LEN],[AC_REQUIRE([AC_CANONICAL_HOST])dnl# find the maximum length of command line argumentsAC_MSG_CHECKING([the maximum length of command line arguments])AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnli=0teststring="ABCD"case $build_os inmsdosdjgpp*)# On DJGPP, this test can blow up pretty badly due to problems in libc# (any single argument exceeding 2000 bytes causes a buffer overrun# during glob expansion). Even if it were fixed, the result of this# check would be larger than it should be.lt_cv_sys_max_cmd_len=12288; # 12K is about right;;gnu*)# Under GNU Hurd, this test is not required because there is# no limit to the length of command line arguments.# Libtool will interpret -1 as no limit whatsoeverlt_cv_sys_max_cmd_len=-1;;;cygwin* | mingw*)# On Win9x/ME, this test blows up -- it succeeds, but takes# about 5 minutes as the teststring grows exponentially.# Worse, since 9x/ME are not pre-emptively multitasking,# you end up with a "frozen" computer, even though with patience# the test eventually succeeds (with a max line length of 256k).# Instead, let's just punt: use the minimum linelength reported by# all of the supported platforms: 8192 (on NT/2K/XP).lt_cv_sys_max_cmd_len=8192;;;amigaos*)# On AmigaOS with pdksh, this test takes hours, literally.# So we just punt and use a minimum line length of 8192.lt_cv_sys_max_cmd_len=8192;;;netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)# This has been around since 386BSD, at least. Likely further.if test -x /sbin/sysctl; thenlt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`elif test -x /usr/sbin/sysctl; thenlt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`elselt_cv_sys_max_cmd_len=65536 # usable default for all BSDsfi# And add a safety zonelt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`;;interix*)# We know the value 262144 and hardcode it with a safety zone (like BSD)lt_cv_sys_max_cmd_len=196608;;osf*)# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not# nice to cause kernel panics so lets avoid the loop below.# First set a reasonable default.lt_cv_sys_max_cmd_len=16384#if test -x /sbin/sysconfig; thencase `/sbin/sysconfig -q proc exec_disable_arg_limit` in*1*) lt_cv_sys_max_cmd_len=-1 ;;esacfi;;sco3.2v5*)lt_cv_sys_max_cmd_len=102400;;sysv5* | sco5v6* | sysv4.2uw2*)kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`if test -n "$kargmax"; thenlt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`elselt_cv_sys_max_cmd_len=32768fi;;*)lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`if test -n "$lt_cv_sys_max_cmd_len"; thenlt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`else# Make teststring a little bigger before we do anything with it.# a 1K string should be a reasonable start.for i in 1 2 3 4 5 6 7 8 ; doteststring=$teststring$teststringdoneSHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}# If test is not a shell built-in, we'll probably end up computing a# maximum length that is only half of the actual maximum length, but# we can't tell.while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \= "XX$teststring$teststring"; } >/dev/null 2>&1 &&test $i != 17 # 1/2 MB should be enoughdoi=`expr $i + 1`teststring=$teststring$teststringdone# Only check the string length outside the loop.lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`teststring=# Add a significant safety factor because C++ compilers can tack on# massive amounts of additional arguments before passing them to the# linker. It appears as though 1/2 is a usable value.lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`fi;;esac])if test -n $lt_cv_sys_max_cmd_len ; thenAC_MSG_RESULT($lt_cv_sys_max_cmd_len)elseAC_MSG_RESULT(none)fimax_cmd_len=$lt_cv_sys_max_cmd_len_LT_DECL([], [max_cmd_len], [0],[What is the maximum length of a command?])])# LT_CMD_MAX_LEN# Old name:AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])# _LT_HEADER_DLFCN# ----------------m4_defun([_LT_HEADER_DLFCN],[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl])# _LT_HEADER_DLFCN# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)# ----------------------------------------------------------------m4_defun([_LT_TRY_DLOPEN_SELF],[m4_require([_LT_HEADER_DLFCN])dnlif test "$cross_compiling" = yes; then :[$4]elselt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2lt_status=$lt_dlunknowncat > conftest.$ac_ext <<_LT_EOF[#line __oline__ "configure"#include "confdefs.h"#if HAVE_DLFCN_H#include <dlfcn.h>#endif#include <stdio.h>#ifdef RTLD_GLOBAL# define LT_DLGLOBAL RTLD_GLOBAL#else# ifdef DL_GLOBAL# define LT_DLGLOBAL DL_GLOBAL# else# define LT_DLGLOBAL 0# endif#endif/* We may have to define LT_DLLAZY_OR_NOW in the command line if wefind out it does not work in some platform. */#ifndef LT_DLLAZY_OR_NOW# ifdef RTLD_LAZY# define LT_DLLAZY_OR_NOW RTLD_LAZY# else# ifdef DL_LAZY# define LT_DLLAZY_OR_NOW DL_LAZY# else# ifdef RTLD_NOW# define LT_DLLAZY_OR_NOW RTLD_NOW# else# ifdef DL_NOW# define LT_DLLAZY_OR_NOW DL_NOW# else# define LT_DLLAZY_OR_NOW 0# endif# endif# endif# endif#endif#ifdef __cplusplusextern "C" void exit (int);#endifvoid fnord() { int i=42;}int main (){void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);int status = $lt_dlunknown;if (self){if (dlsym (self,"fnord")) status = $lt_dlno_uscore;else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;/* dlclose (self); */}elseputs (dlerror ());exit (status);}]_LT_EOFif AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then(./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/nulllt_status=$?case x$lt_status inx$lt_dlno_uscore) $1 ;;x$lt_dlneed_uscore) $2 ;;x$lt_dlunknown|x*) $3 ;;esacelse :# compilation failed$3fifirm -fr conftest*])# _LT_TRY_DLOPEN_SELF# LT_SYS_DLOPEN_SELF# ------------------AC_DEFUN([LT_SYS_DLOPEN_SELF],[m4_require([_LT_HEADER_DLFCN])dnlif test "x$enable_dlopen" != xyes; thenenable_dlopen=unknownenable_dlopen_self=unknownenable_dlopen_self_static=unknownelselt_cv_dlopen=nolt_cv_dlopen_libs=case $host_os inbeos*)lt_cv_dlopen="load_add_on"lt_cv_dlopen_libs=lt_cv_dlopen_self=yes;;mingw* | pw32*)lt_cv_dlopen="LoadLibrary"lt_cv_dlopen_libs=;;cygwin*)lt_cv_dlopen="dlopen"lt_cv_dlopen_libs=;;darwin*)# if libdl is installed we need to link against itAC_CHECK_LIB([dl], [dlopen],[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[lt_cv_dlopen="dyld"lt_cv_dlopen_libs=lt_cv_dlopen_self=yes]);;*)AC_CHECK_FUNC([shl_load],[lt_cv_dlopen="shl_load"],[AC_CHECK_LIB([dld], [shl_load],[lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],[AC_CHECK_FUNC([dlopen],[lt_cv_dlopen="dlopen"],[AC_CHECK_LIB([dl], [dlopen],[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[AC_CHECK_LIB([svld], [dlopen],[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],[AC_CHECK_LIB([dld], [dld_link],[lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])])])])])]);;esacif test "x$lt_cv_dlopen" != xno; thenenable_dlopen=yeselseenable_dlopen=noficase $lt_cv_dlopen indlopen)save_CPPFLAGS="$CPPFLAGS"test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"save_LDFLAGS="$LDFLAGS"wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"save_LIBS="$LIBS"LIBS="$lt_cv_dlopen_libs $LIBS"AC_CACHE_CHECK([whether a program can dlopen itself],lt_cv_dlopen_self, [dnl_LT_TRY_DLOPEN_SELF(lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)])if test "x$lt_cv_dlopen_self" = xyes; thenwl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"AC_CACHE_CHECK([whether a statically linked program can dlopen itself],lt_cv_dlopen_self_static, [dnl_LT_TRY_DLOPEN_SELF(lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)])fiCPPFLAGS="$save_CPPFLAGS"LDFLAGS="$save_LDFLAGS"LIBS="$save_LIBS";;esaccase $lt_cv_dlopen_self inyes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;*) enable_dlopen_self=unknown ;;esaccase $lt_cv_dlopen_self_static inyes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;*) enable_dlopen_self_static=unknown ;;esacfi_LT_DECL([dlopen_support], [enable_dlopen], [0],[Whether dlopen is supported])_LT_DECL([dlopen_self], [enable_dlopen_self], [0],[Whether dlopen of programs is supported])_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],[Whether dlopen of statically linked programs is supported])])# LT_SYS_DLOPEN_SELF# Old name:AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])# _LT_COMPILER_C_O([TAGNAME])# ---------------------------# Check to see if options -c and -o are simultaneously supported by compiler.# This macro does not hard code the compiler like AC_PROG_CC_C_O.m4_defun([_LT_COMPILER_C_O],[m4_require([_LT_DECL_SED])dnlm4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_TAG_COMPILER])dnlAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],[_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no$RM -r conftest 2>/dev/nullmkdir conftestcd conftestmkdir outecho "$lt_simple_compile_test_code" > conftest.$ac_extlt_compiler_flag="-o out/conftest2.$ac_objext"# Insert the option either (1) after the last *FLAGS variable, or# (2) before a word containing "conftest.", or (3) at the end.# Note that $ac_compile itself does not contain backslashes and begins# with a dollar sign (not a hyphen), so the echo should work correctly.lt_compile=`echo "$ac_compile" | $SED \-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \-e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \-e 's:$: $lt_compiler_flag:'`(eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)(eval "$lt_compile" 2>out/conftest.err)ac_status=$?cat out/conftest.err >&AS_MESSAGE_LOG_FDecho "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FDif (exit $ac_status) && test -s out/conftest2.$ac_objextthen# The compiler can only warn and ignore the option if not recognized# So say no if there are warnings$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yesfifichmod u+w . 2>&AS_MESSAGE_LOG_FD$RM -r conftest*# SGI C++ compiler will create directory out/ii_files/ for# template instantiationtest -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files$RM out/* && rmdir outcd ..$RM -r conftest$RM -r conftest*])_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],[Does compiler simultaneously support -c and -o options?])])# _LT_COMPILER_C_O# _LT_COMPILER_FILE_LOCKS([TAGNAME])# ----------------------------------# Check to see if we can do hard links to lock some files if neededm4_defun([_LT_COMPILER_FILE_LOCKS],[m4_require([_LT_ENABLE_LOCK])dnlm4_require([_LT_FILEUTILS_DEFAULTS])dnl_LT_COMPILER_C_O([$1])hard_links="nottested"if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then# do not overwrite the value of need_locks provided by the userAC_MSG_CHECKING([if we can lock with hard links])hard_links=yes$RM -r conftest*ln conftest.a conftest.b 2>/dev/null && hard_links=notouch conftest.aln conftest.a conftest.b 2>&5 || hard_links=noln conftest.a conftest.b 2>/dev/null && hard_links=noAC_MSG_RESULT([$hard_links])if test "$hard_links" = no; thenAC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])need_locks=warnfielseneed_locks=nofi_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])])# _LT_COMPILER_FILE_LOCKS# _LT_CHECK_OBJDIR# ----------------m4_defun([_LT_CHECK_OBJDIR],[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],[rm -f .libs 2>/dev/nullmkdir .libs 2>/dev/nullif test -d .libs; thenlt_cv_objdir=.libselse# MS-DOS does not allow filenames that begin with a dot.lt_cv_objdir=_libsfirmdir .libs 2>/dev/null])objdir=$lt_cv_objdir_LT_DECL([], [objdir], [0],[The name of the directory that contains temporary libtool files])dnlm4_pattern_allow([LT_OBJDIR])dnlAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",[Define to the sub-directory in which libtool stores uninstalled libraries.])])# _LT_CHECK_OBJDIR# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])# --------------------------------------# Check hardcoding attributes.m4_defun([_LT_LINKER_HARDCODE_LIBPATH],[AC_MSG_CHECKING([how to hardcode library paths into programs])_LT_TAGVAR(hardcode_action, $1)=if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||test -n "$_LT_TAGVAR(runpath_var, $1)" ||test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then# We can hardcode non-existent directories.if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&# If the only mechanism to avoid hardcoding is shlibpath_var, we# have to relink, otherwise we might link with an installed library# when we should be linking with a yet-to-be-installed one## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then# Linking always hardcodes the temporary library directory._LT_TAGVAR(hardcode_action, $1)=relinkelse# We can link without hardcoding, and we can hardcode nonexisting dirs._LT_TAGVAR(hardcode_action, $1)=immediatefielse# We cannot hardcode anything, or else we can only hardcode existing# directories._LT_TAGVAR(hardcode_action, $1)=unsupportedfiAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then# Fast installation is not supportedenable_fast_install=noelif test "$shlibpath_overrides_runpath" = yes ||test "$enable_shared" = no; then# Fast installation is not necessaryenable_fast_install=needlessfi_LT_TAGDECL([], [hardcode_action], [0],[How to hardcode a shared library path into an executable])])# _LT_LINKER_HARDCODE_LIBPATH# _LT_CMD_STRIPLIB# ----------------m4_defun([_LT_CMD_STRIPLIB],[m4_require([_LT_DECL_EGREP])striplib=old_striplib=AC_MSG_CHECKING([whether stripping libraries is possible])if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; thentest -z "$old_striplib" && old_striplib="$STRIP --strip-debug"test -z "$striplib" && striplib="$STRIP --strip-unneeded"AC_MSG_RESULT([yes])else# FIXME - insert some real tests, host_os isn't really good enoughcase $host_os indarwin*)if test -n "$STRIP" ; thenstriplib="$STRIP -x"old_striplib="$STRIP -S"AC_MSG_RESULT([yes])elseAC_MSG_RESULT([no])fi;;*)AC_MSG_RESULT([no]);;esacfi_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])_LT_DECL([], [striplib], [1])])# _LT_CMD_STRIPLIB# _LT_SYS_DYNAMIC_LINKER([TAG])# -----------------------------# PORTME Fill in your ld.so characteristicsm4_defun([_LT_SYS_DYNAMIC_LINKER],[AC_REQUIRE([AC_CANONICAL_HOST])dnlm4_require([_LT_DECL_EGREP])dnlm4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_DECL_SED])dnlAC_MSG_CHECKING([dynamic linker characteristics])m4_if([$1],[], [if test "$GCC" = yes; thencase $host_os indarwin*) lt_awk_arg="/^libraries:/,/LR/" ;;*) lt_awk_arg="/^libraries:/" ;;esaclt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then# if the path contains ";" then we assume it to be the separator# otherwise default to the standard path separator (i.e. ":") - it is# assumed that no part of a normal pathname contains ";" but that should# okay in the real world where ";" in dirpaths is itself problematic.lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`elselt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`fi# Ok, now we have the path, separated by spaces, we can step through it# and add multilib dir if necessary.lt_tmp_lt_search_path_spec=lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`for lt_sys_path in $lt_search_path_spec; doif test -d "$lt_sys_path/$lt_multi_os_dir"; thenlt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"elsetest -d "$lt_sys_path" && \lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"fidonelt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk 'BEGIN {RS=" "; FS="/|\n";} {lt_foo="";lt_count=0;for (lt_i = NF; lt_i > 0; lt_i--) {if ($lt_i != "" && $lt_i != ".") {if ($lt_i == "..") {lt_count++;} else {if (lt_count == 0) {lt_foo="/" $lt_i lt_foo;} else {lt_count--;}}}}if (lt_foo != "") { lt_freq[[lt_foo]]++; }if (lt_freq[[lt_foo]] == 1) { print lt_foo; }}'`sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`elsesys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"fi])library_names_spec=libname_spec='lib$name'soname_spec=shrext_cmds=".so"postinstall_cmds=postuninstall_cmds=finish_cmds=finish_eval=shlibpath_var=shlibpath_overrides_runpath=unknownversion_type=nonedynamic_linker="$host_os ld.so"sys_lib_dlsearch_path_spec="/lib /usr/lib"need_lib_prefix=unknownhardcode_into_libs=no# when you set need_version to no, make sure it does not cause -set_version# flags to be left without argumentsneed_version=unknowncase $host_os inaix3*)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'shlibpath_var=LIBPATH# AIX 3 has no versioning support, so we append a major version to the name.soname_spec='${libname}${release}${shared_ext}$major';;aix[[4-9]]*)version_type=linuxneed_lib_prefix=noneed_version=nohardcode_into_libs=yesif test "$host_cpu" = ia64; then# AIX 5 supports IA64library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHelse# With GCC up to 2.95.x, collect2 would create an import file# for dependence libraries. The import file would start with# the line `#! .'. This would cause the generated library to# depend on `.', always an invalid library. This was fixed in# development snapshots of GCC prior to 3.0.case $host_os inaix4 | aix4.[[01]] | aix4.[[01]].*)if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'echo ' yes 'echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then:elsecan_build_shared=nofi;;esac# AIX (on Power*) has no versioning support, so currently we can not hardcode correct# soname into executable. Probably we can add versioning support to# collect2, so additional links can be useful in future.if test "$aix_use_runtimelinking" = yes; then# If using run time linking (on AIX 4.2 or later) use lib<name>.so# instead of lib<name>.a to let people know that these are not# typical AIX shared libraries.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'else# We preserve .a as extension for shared libraries through AIX4.2# and later when we are not doing run time linking.library_names_spec='${libname}${release}.a $libname.a'soname_spec='${libname}${release}${shared_ext}$major'fishlibpath_var=LIBPATHfi;;amigaos*)case $host_cpu inpowerpc)# Since July 2007 AmigaOS4 officially supports .so libraries.# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}';;m68k)library_names_spec='$libname.ixlibrary $libname.a'# Create ${libname}_ixlibrary.a entries in /sys/libs.finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done';;esac;;beos*)library_names_spec='${libname}${shared_ext}'dynamic_linker="$host_os ld.so"shlibpath_var=LIBRARY_PATH;;bsdi[[45]]*)version_type=linuxneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'shlibpath_var=LD_LIBRARY_PATHsys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"# the default ld.so.conf also contains /usr/contrib/lib and# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow# libtool to hard-code these into programs;;cygwin* | mingw* | pw32*)version_type=windowsshrext_cmds=".dll"need_version=noneed_lib_prefix=nocase $GCC,$host_os inyes,cygwin* | yes,mingw* | yes,pw32*)library_names_spec='$libname.dll.a'# DLL is installed to $(libdir)/../bin by postinstall_cmdspostinstall_cmds='base_file=`basename \${file}`~dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~dldir=$destdir/`dirname \$dlpath`~test -d \$dldir || mkdir -p \$dldir~$install_prog $dir/$dlname \$dldir/$dlname~chmod a+x \$dldir/$dlname~if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; theneval '\''$striplib \$dldir/$dlname'\'' || exit \$?;fi'postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~dlpath=$dir/\$dldll~$RM \$dlpath'shlibpath_overrides_runpath=yescase $host_os incygwin*)# Cygwin DLLs use 'cyg' prefix rather than 'lib'soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib";;mingw*)# MinGW DLLs use traditional 'lib' prefixsoname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then# It is most probably a Windows format PATH printed by# mingw gcc, but we are running on Cygwin. Gcc prints its search# path with ; separators, and with drive letters. We can handle the# drive letters (cygwin fileutils understands them), so leave them,# especially as we might pass files found there to a mingw objdump,# which wouldn't understand a cygwinified path. Ahh.sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`elsesys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`fi;;pw32*)# pw32 DLLs use 'pw' prefix rather than 'lib'library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}';;esac;;*)library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib';;esacdynamic_linker='Win32 ld.exe'# FIXME: first we should search . and the directory the executable is inshlibpath_var=PATH;;darwin* | rhapsody*)dynamic_linker="$host_os dyld"version_type=darwinneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext'soname_spec='${libname}${release}${major}$shared_ext'shlibpath_overrides_runpath=yesshlibpath_var=DYLD_LIBRARY_PATHshrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'m4_if([$1], [],[sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib';;dgux*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATH;;freebsd1*)dynamic_linker=no;;freebsd* | dragonfly*)# DragonFly does not have aout. When/if they implement a new# versioning mechanism, adjust this.if test -x /usr/bin/objformat; thenobjformat=`/usr/bin/objformat`elsecase $host_os infreebsd[[123]]*) objformat=aout ;;*) objformat=elf ;;esacfiversion_type=freebsd-$objformatcase $version_type infreebsd-elf*)library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'need_version=noneed_lib_prefix=no;;freebsd-*)library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'need_version=yes;;esacshlibpath_var=LD_LIBRARY_PATHcase $host_os infreebsd2*)shlibpath_overrides_runpath=yes;;freebsd3.[[01]]* | freebsdelf3.[[01]]*)shlibpath_overrides_runpath=yeshardcode_into_libs=yes;;freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)shlibpath_overrides_runpath=nohardcode_into_libs=yes;;*) # from 4.6 on, and DragonFlyshlibpath_overrides_runpath=yeshardcode_into_libs=yes;;esac;;gnu*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHhardcode_into_libs=yes;;hpux9* | hpux10* | hpux11*)# Give a soname corresponding to the major version so that dld.sl refuses to# link against other versions.version_type=sunosneed_lib_prefix=noneed_version=nocase $host_cpu inia64*)shrext_cmds='.so'hardcode_into_libs=yesdynamic_linker="$host_os dld.so"shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yes # Unless +noenvvar is specified.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'if test "X$HPUX_IA64_MODE" = X32; thensys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"elsesys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"fisys_lib_dlsearch_path_spec=$sys_lib_search_path_spec;;hppa*64*)shrext_cmds='.sl'hardcode_into_libs=yesdynamic_linker="$host_os dld.sl"shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATHshlibpath_overrides_runpath=yes # Unless +noenvvar is specified.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec;;*)shrext_cmds='.sl'dynamic_linker="$host_os dld.sl"shlibpath_var=SHLIB_PATHshlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATHlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major';;esac# HP-UX runs *really* slowly unless shared libraries are mode 555.postinstall_cmds='chmod 555 $lib';;interix[[3-9]]*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=nohardcode_into_libs=yes;;irix5* | irix6* | nonstopux*)case $host_os innonstopux*) version_type=nonstopux ;;*)if test "$lt_cv_prog_gnu_ld" = yes; thenversion_type=linuxelseversion_type=irixfi ;;esacneed_lib_prefix=noneed_version=nosoname_spec='${libname}${release}${shared_ext}$major'library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'case $host_os inirix5* | nonstopux*)libsuff= shlibsuff=;;*)case $LD in # libtool.m4 will add one of these switches to LD*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")libsuff= shlibsuff= libmagic=32-bit;;*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")libsuff=32 shlibsuff=N32 libmagic=N32;;*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")libsuff=64 shlibsuff=64 libmagic=64-bit;;*) libsuff= shlibsuff= libmagic=never-match;;esac;;esacshlibpath_var=LD_LIBRARY${shlibsuff}_PATHshlibpath_overrides_runpath=nosys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"hardcode_into_libs=yes;;# No shared lib support for Linux oldld, aout, or coff.linux*oldld* | linux*aout* | linux*coff*)dynamic_linker=no;;# This must be Linux ELF.linux* | k*bsd*-gnu)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=no# Some binutils ld are patched to set DT_RUNPATHsave_LDFLAGS=$LDFLAGSsave_libdir=$libdireval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],[AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],[shlibpath_overrides_runpath=yes])])LDFLAGS=$save_LDFLAGSlibdir=$save_libdir# This implies no fast_install, which is unacceptable.# Some rework will be needed to allow for fast_install# before this can be enabled.hardcode_into_libs=yes# Append ld.so.conf contents to the search pathif test -f /etc/ld.so.conf; thenlt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"fi# We used to test for /lib/ld.so.1 and disable shared libraries on# powerpc, because MkLinux only supported shared libraries with the# GNU dynamic linker. Since this was broken with cross compilers,# most powerpc-linux boxes support dynamic linking these days and# people can always --disable-shared, the test was removed, and we# assume the GNU/Linux dynamic linker is in use.dynamic_linker='GNU/Linux ld.so';;netbsd*)version_type=sunosneed_lib_prefix=noneed_version=noif echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; thenlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'dynamic_linker='NetBSD (a.out) ld.so'elselibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'dynamic_linker='NetBSD ld.elf_so'fishlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yeshardcode_into_libs=yes;;newsos6)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yes;;*nto* | *qnx*)version_type=qnxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=nohardcode_into_libs=yesdynamic_linker='ldqnx.so';;openbsd*)version_type=sunossys_lib_dlsearch_path_spec="/usr/lib"need_lib_prefix=no# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.case $host_os inopenbsd3.3 | openbsd3.3.*) need_version=yes ;;*) need_version=no ;;esaclibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'shlibpath_var=LD_LIBRARY_PATHif test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; thencase $host_os inopenbsd2.[[89]] | openbsd2.[[89]].*)shlibpath_overrides_runpath=no;;*)shlibpath_overrides_runpath=yes;;esacelseshlibpath_overrides_runpath=yesfi;;os2*)libname_spec='$name'shrext_cmds=".dll"need_lib_prefix=nolibrary_names_spec='$libname${shared_ext} $libname.a'dynamic_linker='OS/2 ld.exe'shlibpath_var=LIBPATH;;osf3* | osf4* | osf5*)version_type=osfneed_lib_prefix=noneed_version=nosoname_spec='${libname}${release}${shared_ext}$major'library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHsys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec";;rdos*)dynamic_linker=no;;solaris*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yeshardcode_into_libs=yes# ldd complains unless libraries are executablepostinstall_cmds='chmod +x $lib';;sunos4*)version_type=sunoslibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yesif test "$with_gnu_ld" = yes; thenneed_lib_prefix=nofineed_version=yes;;sysv4 | sysv4.3*)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHcase $host_vendor insni)shlibpath_overrides_runpath=noneed_lib_prefix=norunpath_var=LD_RUN_PATH;;siemens)need_lib_prefix=no;;motorola)need_lib_prefix=noneed_version=noshlibpath_overrides_runpath=nosys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib';;esac;;sysv4*MP*)if test -d /usr/nec ;thenversion_type=linuxlibrary_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'soname_spec='$libname${shared_ext}.$major'shlibpath_var=LD_LIBRARY_PATHfi;;sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)version_type=freebsd-elfneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yeshardcode_into_libs=yesif test "$with_gnu_ld" = yes; thensys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'elsesys_lib_search_path_spec='/usr/ccs/lib /usr/lib'case $host_os insco3.2v5*)sys_lib_search_path_spec="$sys_lib_search_path_spec /lib";;esacfisys_lib_dlsearch_path_spec='/usr/lib';;tpf*)# TPF is a cross-target only. Preferred cross-host = GNU/Linux.version_type=linuxneed_lib_prefix=noneed_version=nolibrary_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=nohardcode_into_libs=yes;;uts4*)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATH;;*)dynamic_linker=no;;esacAC_MSG_RESULT([$dynamic_linker])test "$dynamic_linker" = no && can_build_shared=novariables_saved_for_relink="PATH $shlibpath_var $runpath_var"if test "$GCC" = yes; thenvariables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"fiif test "${lt_cv_sys_lib_search_path_spec+set}" = set; thensys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"fiif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; thensys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"fi_LT_DECL([], [variables_saved_for_relink], [1],[Variables whose values should be saved in libtool wrapper scripts andrestored at link time])_LT_DECL([], [need_lib_prefix], [0],[Do we need the "lib" prefix for modules?])_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])_LT_DECL([], [version_type], [0], [Library versioning type])_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])_LT_DECL([], [shlibpath_overrides_runpath], [0],[Is shlibpath searched before the hard-coded library search path?])_LT_DECL([], [libname_spec], [1], [Format of library name prefix])_LT_DECL([], [library_names_spec], [1],[[List of archive names. First name is the real one, the rest are links.The last name is the one that the linker finds with -lNAME]])_LT_DECL([], [soname_spec], [1],[[The coded name of the library, if different from the real name]])_LT_DECL([], [postinstall_cmds], [2],[Command to use after installation of a shared archive])_LT_DECL([], [postuninstall_cmds], [2],[Command to use after uninstallation of a shared archive])_LT_DECL([], [finish_cmds], [2],[Commands used to finish a libtool library installation in a directory])_LT_DECL([], [finish_eval], [1],[[As "finish_cmds", except a single script fragment to be evaled butnot shown]])_LT_DECL([], [hardcode_into_libs], [0],[Whether we should hardcode library paths into libraries])_LT_DECL([], [sys_lib_search_path_spec], [2],[Compile-time system search path for libraries])_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],[Run-time system search path for libraries])])# _LT_SYS_DYNAMIC_LINKER# _LT_PATH_TOOL_PREFIX(TOOL)# --------------------------# find a file program which can recognize shared libraryAC_DEFUN([_LT_PATH_TOOL_PREFIX],[m4_require([_LT_DECL_EGREP])dnlAC_MSG_CHECKING([for $1])AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,[case $MAGIC_CMD in[[\\/*] | ?:[\\/]*])lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.;;*)lt_save_MAGIC_CMD="$MAGIC_CMD"lt_save_ifs="$IFS"; IFS=$PATH_SEPARATORdnl $ac_dummy forces splitting on constant user-supplied paths.dnl POSIX.2 word splitting is done only on the output of word expansions,dnl not every word. This closes a longstanding sh security hole.ac_dummy="m4_if([$2], , $PATH, [$2])"for ac_dir in $ac_dummy; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.if test -f $ac_dir/$1; thenlt_cv_path_MAGIC_CMD="$ac_dir/$1"if test -n "$file_magic_test_file"; thencase $deplibs_check_method in"file_magic "*)file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`MAGIC_CMD="$lt_cv_path_MAGIC_CMD"if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |$EGREP "$file_magic_regex" > /dev/null; then:elsecat <<_LT_EOF 1>&2*** Warning: the command libtool uses to detect shared libraries,*** $file_magic_cmd, produces output that libtool cannot recognize.*** The result is that libtool may fail to recognize shared libraries*** as such. This will affect the creation of libtool libraries that*** depend on shared libraries, but programs linked with such libtool*** libraries will work regardless of this problem. Nevertheless, you*** may want to report the problem to your system manager and/or to*** bug-libtool@gnu.org_LT_EOFfi ;;esacfibreakfidoneIFS="$lt_save_ifs"MAGIC_CMD="$lt_save_MAGIC_CMD";;esac])MAGIC_CMD="$lt_cv_path_MAGIC_CMD"if test -n "$MAGIC_CMD"; thenAC_MSG_RESULT($MAGIC_CMD)elseAC_MSG_RESULT(no)fi_LT_DECL([], [MAGIC_CMD], [0],[Used to examine libraries when file_magic_cmd begins with "file"])dnl])# _LT_PATH_TOOL_PREFIX# Old name:AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])# _LT_PATH_MAGIC# --------------# find a file program which can recognize a shared librarym4_defun([_LT_PATH_MAGIC],[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)if test -z "$lt_cv_path_MAGIC_CMD"; thenif test -n "$ac_tool_prefix"; then_LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)elseMAGIC_CMD=:fifi])# _LT_PATH_MAGIC# LT_PATH_LD# ----------# find the pathname to the GNU or non-GNU linkerAC_DEFUN([LT_PATH_LD],[AC_REQUIRE([AC_PROG_CC])dnlAC_REQUIRE([AC_CANONICAL_HOST])dnlAC_REQUIRE([AC_CANONICAL_BUILD])dnlm4_require([_LT_DECL_SED])dnlm4_require([_LT_DECL_EGREP])dnlAC_ARG_WITH([gnu-ld],[AS_HELP_STRING([--with-gnu-ld],[assume the C compiler uses GNU ld @<:@default=no@:>@])],[test "$withval" = no || with_gnu_ld=yes],[with_gnu_ld=no])dnlac_prog=ldif test "$GCC" = yes; then# Check if gcc -print-prog-name=ld gives a path.AC_MSG_CHECKING([for ld used by $CC])case $host in*-*-mingw*)# gcc leaves a trailing carriage return which upsets mingwac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;*)ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;esaccase $ac_prog in# Accept absolute paths.[[\\/]]* | ?:[[\\/]]*)re_direlt='/[[^/]][[^/]]*/\.\./'# Canonicalize the pathname of ldac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; doac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`donetest -z "$LD" && LD="$ac_prog";;"")# If it fails, then pretend we aren't using GCC.ac_prog=ld;;*)# If it is relative, then search for the first ld in PATH.with_gnu_ld=unknown;;esacelif test "$with_gnu_ld" = yes; thenAC_MSG_CHECKING([for GNU ld])elseAC_MSG_CHECKING([for non-GNU ld])fiAC_CACHE_VAL(lt_cv_path_LD,[if test -z "$LD"; thenlt_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor ac_dir in $PATH; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; thenlt_cv_path_LD="$ac_dir/$ac_prog"# Check to see if the program is GNU ld. I'd rather use --version,# but apparently some variants of GNU ld only accept -v.# Break only if it was the GNU/non-GNU ld that we prefer.case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in*GNU* | *'with BFD'*)test "$with_gnu_ld" != no && break;;*)test "$with_gnu_ld" != yes && break;;esacfidoneIFS="$lt_save_ifs"elselt_cv_path_LD="$LD" # Let the user override the test with a path.fi])LD="$lt_cv_path_LD"if test -n "$LD"; thenAC_MSG_RESULT($LD)elseAC_MSG_RESULT(no)fitest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])_LT_PATH_LD_GNUAC_SUBST([LD])_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])])# LT_PATH_LD# Old names:AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AM_PROG_LD], [])dnl AC_DEFUN([AC_PROG_LD], [])# _LT_PATH_LD_GNU#- --------------m4_defun([_LT_PATH_LD_GNU],[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,[# I'd rather use --version here, but apparently some GNU lds only accept -v.case `$LD -v 2>&1 </dev/null` in*GNU* | *'with BFD'*)lt_cv_prog_gnu_ld=yes;;*)lt_cv_prog_gnu_ld=no;;esac])with_gnu_ld=$lt_cv_prog_gnu_ld])# _LT_PATH_LD_GNU# _LT_CMD_RELOAD# --------------# find reload flag for linker# -- PORTME Some linkers may need a different reload flag.m4_defun([_LT_CMD_RELOAD],[AC_CACHE_CHECK([for $LD option to reload object files],lt_cv_ld_reload_flag,[lt_cv_ld_reload_flag='-r'])reload_flag=$lt_cv_ld_reload_flagcase $reload_flag in"" | " "*) ;;*) reload_flag=" $reload_flag" ;;esacreload_cmds='$LD$reload_flag -o $output$reload_objs'case $host_os indarwin*)if test "$GCC" = yes; thenreload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'elsereload_cmds='$LD$reload_flag -o $output$reload_objs'fi;;esac_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl_LT_DECL([], [reload_cmds], [2])dnl])# _LT_CMD_RELOAD# _LT_CHECK_MAGIC_METHOD# ----------------------# how to check for library dependencies# -- PORTME fill in with the dynamic library characteristicsm4_defun([_LT_CHECK_MAGIC_METHOD],[m4_require([_LT_DECL_EGREP])AC_CACHE_CHECK([how to recognize dependent libraries],lt_cv_deplibs_check_method,[lt_cv_file_magic_cmd='$MAGIC_CMD'lt_cv_file_magic_test_file=lt_cv_deplibs_check_method='unknown'# Need to set the preceding variable on all platforms that support# interlibrary dependencies.# 'none' -- dependencies not supported.# `unknown' -- same as none, but documents that we really don't know.# 'pass_all' -- all dependencies passed with no checks.# 'test_compile' -- check by making test program.# 'file_magic [[regex]]' -- check by looking for files in library path# which responds to the $file_magic_cmd with a given extended regex.# If you have `file' or equivalent on your system and you're not sure# whether `pass_all' will *always* work, you probably want this one.case $host_os inaix[[4-9]]*)lt_cv_deplibs_check_method=pass_all;;beos*)lt_cv_deplibs_check_method=pass_all;;bsdi[[45]]*)lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'lt_cv_file_magic_cmd='/usr/bin/file -L'lt_cv_file_magic_test_file=/shlib/libc.so;;cygwin*)# func_win32_libid is a shell function defined in ltmain.shlt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'lt_cv_file_magic_cmd='func_win32_libid';;mingw* | pw32*)# Base MSYS/MinGW do not provide the 'file' command needed by# func_win32_libid shell function, so use a weaker test based on 'objdump',# unless we find 'file', for example because we are cross-compiling.if ( file / ) >/dev/null 2>&1; thenlt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'lt_cv_file_magic_cmd='func_win32_libid'elselt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'lt_cv_file_magic_cmd='$OBJDUMP -f'fi;;darwin* | rhapsody*)lt_cv_deplibs_check_method=pass_all;;freebsd* | dragonfly*)if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; thencase $host_cpu ini*86 )# Not sure whether the presence of OpenBSD here was a mistake.# Let's accept both of them until this is cleared up.lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'lt_cv_file_magic_cmd=/usr/bin/filelt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`;;esacelselt_cv_deplibs_check_method=pass_allfi;;gnu*)lt_cv_deplibs_check_method=pass_all;;hpux10.20* | hpux11*)lt_cv_file_magic_cmd=/usr/bin/filecase $host_cpu inia64*)lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so;;hppa*64*)[lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl;;*)lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'lt_cv_file_magic_test_file=/usr/lib/libc.sl;;esac;;interix[[3-9]]*)# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a herelt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$';;irix5* | irix6* | nonstopux*)case $LD in*-32|*"-32 ") libmagic=32-bit;;*-n32|*"-n32 ") libmagic=N32;;*-64|*"-64 ") libmagic=64-bit;;*) libmagic=never-match;;esaclt_cv_deplibs_check_method=pass_all;;# This must be Linux ELF.linux* | k*bsd*-gnu)lt_cv_deplibs_check_method=pass_all;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; thenlt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'elselt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'fi;;newos6*)lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'lt_cv_file_magic_cmd=/usr/bin/filelt_cv_file_magic_test_file=/usr/lib/libnls.so;;*nto* | *qnx*)lt_cv_deplibs_check_method=pass_all;;openbsd*)if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; thenlt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'elselt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'fi;;osf3* | osf4* | osf5*)lt_cv_deplibs_check_method=pass_all;;rdos*)lt_cv_deplibs_check_method=pass_all;;solaris*)lt_cv_deplibs_check_method=pass_all;;sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)lt_cv_deplibs_check_method=pass_all;;sysv4 | sysv4.3*)case $host_vendor inmotorola)lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`;;ncr)lt_cv_deplibs_check_method=pass_all;;sequent)lt_cv_file_magic_cmd='/bin/file'lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )';;sni)lt_cv_file_magic_cmd='/bin/file'lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"lt_cv_file_magic_test_file=/lib/libc.so;;siemens)lt_cv_deplibs_check_method=pass_all;;pc)lt_cv_deplibs_check_method=pass_all;;esac;;tpf*)lt_cv_deplibs_check_method=pass_all;;esac])file_magic_cmd=$lt_cv_file_magic_cmddeplibs_check_method=$lt_cv_deplibs_check_methodtest -z "$deplibs_check_method" && deplibs_check_method=unknown_LT_DECL([], [deplibs_check_method], [1],[Method to check whether dependent libraries are shared objects])_LT_DECL([], [file_magic_cmd], [1],[Command to use when deplibs_check_method == "file_magic"])])# _LT_CHECK_MAGIC_METHOD# LT_PATH_NM# ----------# find the pathname to a BSD- or MS-compatible name listerAC_DEFUN([LT_PATH_NM],[AC_REQUIRE([AC_PROG_CC])dnlAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,[if test -n "$NM"; then# Let the user override the test.lt_cv_path_NM="$NM"elselt_nm_to_check="${ac_tool_prefix}nm"if test -n "$ac_tool_prefix" && test "$build" = "$host"; thenlt_nm_to_check="$lt_nm_to_check nm"fifor lt_tmp_nm in $lt_nm_to_check; dolt_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.tmp_nm="$ac_dir/$lt_tmp_nm"if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then# Check to see if the nm accepts a BSD-compat flag.# Adding the `sed 1q' prevents false positives on HP-UX, which says:# nm: unknown option "B" ignored# Tru64's nm complains that /dev/null is an invalid object filecase `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in*/dev/null* | *'Invalid file or object type'*)lt_cv_path_NM="$tmp_nm -B"break;;*)case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in*/dev/null*)lt_cv_path_NM="$tmp_nm -p"break;;*)lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, butcontinue # so that we can try to find one that supports BSD flags;;esac;;esacfidoneIFS="$lt_save_ifs"done: ${lt_cv_path_NM=no}fi])if test "$lt_cv_path_NM" != "no"; thenNM="$lt_cv_path_NM"else# Didn't find any BSD compatible name lister, look for dumpbin.AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)AC_SUBST([DUMPBIN])if test "$DUMPBIN" != ":"; thenNM="$DUMPBIN"fifitest -z "$NM" && NM=nmAC_SUBST([NM])_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnlAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],[lt_cv_nm_interface="BSD nm"echo "int some_variable = 0;" > conftest.$ac_ext(eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)(eval "$ac_compile" 2>conftest.err)cat conftest.err >&AS_MESSAGE_LOG_FD(eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)cat conftest.err >&AS_MESSAGE_LOG_FD(eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)cat conftest.out >&AS_MESSAGE_LOG_FDif $GREP 'External.*some_variable' conftest.out > /dev/null; thenlt_cv_nm_interface="MS dumpbin"firm -r -f conftest*])])# LT_PATH_NM# Old names:AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AM_PROG_NM], [])dnl AC_DEFUN([AC_PROG_NM], [])# LT_LIB_M# --------# check for math libraryAC_DEFUN([LT_LIB_M],[AC_REQUIRE([AC_CANONICAL_HOST])dnlLIBM=case $host in*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)# These system don't have libm, or don't need it;;*-ncr-sysv4.3*)AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm");;*)AC_CHECK_LIB(m, cos, LIBM="-lm");;esacAC_SUBST([LIBM])])# LT_LIB_M# Old name:AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_CHECK_LIBM], [])# _LT_COMPILER_NO_RTTI([TAGNAME])# -------------------------------m4_defun([_LT_COMPILER_NO_RTTI],[m4_require([_LT_TAG_COMPILER])dnl_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=if test "$GCC" = yes; then_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'_LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],lt_cv_prog_compiler_rtti_exceptions,[-fno-rtti -fno-exceptions], [],[_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])fi_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],[Compiler flag to turn off builtin functions])])# _LT_COMPILER_NO_RTTI# _LT_CMD_GLOBAL_SYMBOLS# ----------------------m4_defun([_LT_CMD_GLOBAL_SYMBOLS],[AC_REQUIRE([AC_CANONICAL_HOST])dnlAC_REQUIRE([AC_PROG_CC])dnlAC_REQUIRE([LT_PATH_NM])dnlAC_REQUIRE([LT_PATH_LD])dnlm4_require([_LT_DECL_SED])dnlm4_require([_LT_DECL_EGREP])dnlm4_require([_LT_TAG_COMPILER])dnl# Check for command to grab the raw symbol name followed by C symbol from nm.AC_MSG_CHECKING([command to parse $NM output from $compiler object])AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],[# These are sane defaults that work on at least a few old systems.# [They come from Ultrix. What could be older than Ultrix?!! ;)]# Character class describing NM global symbol codes.symcode='[[BCDEGRST]]'# Regexp to match symbols that can be accessed directly from C.sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'# Define system-specific variables.case $host_os inaix*)symcode='[[BCDT]]';;cygwin* | mingw* | pw32*)symcode='[[ABCDGISTW]]';;hpux*)if test "$host_cpu" = ia64; thensymcode='[[ABCDEGRST]]'fi;;irix* | nonstopux*)symcode='[[BCDEGRST]]';;osf*)symcode='[[BCDEGQRST]]';;solaris*)symcode='[[BDRT]]';;sco3.2v5*)symcode='[[DT]]';;sysv4.2uw2*)symcode='[[DT]]';;sysv5* | sco5v6* | unixware* | OpenUNIX*)symcode='[[ABDT]]';;sysv4)symcode='[[DFNSTU]]';;esac# If we're using GNU nm, then use its standard symbol codes.case `$NM -V 2>&1` in*GNU* | *'with BFD'*)symcode='[[ABCDGIRSTW]]' ;;esac# Transform an extracted symbol line into a proper C declaration.# Some systems (esp. on ia64) link data and code symbols differently,# so use this general approach.lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"# Transform an extracted symbol line into symbol name and symbol addresslt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"# Handle CRLF in mingw tool chainopt_cr=case $build_os inmingw*)opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp;;esac# Try without a prefix underscore, then with it.for ac_symprfx in "" "_"; do# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.symxfrm="\\1 $ac_symprfx\\2 \\2"# Write the raw and C identifiers.if test "$lt_cv_nm_interface" = "MS dumpbin"; then# Fake it for dumpbin and say T for any non-static function# and D for any global variable.# Also find C++ and __fastcall symbols from MSVC++,# which start with @ or ?.lt_cv_sys_global_symbol_pipe="$AWK ['"\" {last_section=section; section=\$ 3};"\" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\" \$ 0!~/External *\|/{next};"\" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\" {if(hide[section]) next};"\" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\" s[1]~/^[@?]/{print s[1], s[1]; next};"\" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\" ' prfx=^$ac_symprfx]"elselt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"fi# Check to see that the pipe works correctly.pipe_works=norm -r -f conftest*cat > conftest.$ac_ext <<_LT_EOF#ifdef __cplusplusextern "C" {#endifchar nm_test_var;void nm_test_func(void);void nm_test_func(void){}#ifdef __cplusplus}#endifint main(){nm_test_var='a';nm_test_func();return(0);}_LT_EOFif AC_TRY_EVAL(ac_compile); then# Now try to grab the symbols.nlist=conftest.nmif AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then# Try sorting and uniquifying the output.if sort "$nlist" | uniq > "$nlist"T; thenmv -f "$nlist"T "$nlist"elserm -f "$nlist"Tfi# Make sure that we snagged all the symbols we need.if $GREP ' nm_test_var$' "$nlist" >/dev/null; thenif $GREP ' nm_test_func$' "$nlist" >/dev/null; thencat <<_LT_EOF > conftest.$ac_ext#ifdef __cplusplusextern "C" {#endif_LT_EOF# Now generate the symbol file.eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'cat <<_LT_EOF >> conftest.$ac_ext/* The mapping between symbol names and symbols. */const struct {const char *name;void *address;}lt__PROGRAM__LTX_preloaded_symbols[[]] ={{ "@PROGRAM@", (void *) 0 },_LT_EOF$SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_extcat <<\_LT_EOF >> conftest.$ac_ext{0, (void *) 0}};/* This works around a problem in FreeBSD linker */#ifdef FREEBSD_WORKAROUNDstatic const void *lt_preloaded_setup() {return lt__PROGRAM__LTX_preloaded_symbols;}#endif#ifdef __cplusplus}#endif_LT_EOF# Now try linking the two files.mv conftest.$ac_objext conftstm.$ac_objextlt_save_LIBS="$LIBS"lt_save_CFLAGS="$CFLAGS"LIBS="conftstm.$ac_objext"CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; thenpipe_works=yesfiLIBS="$lt_save_LIBS"CFLAGS="$lt_save_CFLAGS"elseecho "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FDfielseecho "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FDfielseecho "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FDfielseecho "$progname: failed program was:" >&AS_MESSAGE_LOG_FDcat conftest.$ac_ext >&5firm -rf conftest* conftst*# Do not use the global_symbol_pipe unless it works.if test "$pipe_works" = yes; thenbreakelselt_cv_sys_global_symbol_pipe=fidone])if test -z "$lt_cv_sys_global_symbol_pipe"; thenlt_cv_sys_global_symbol_to_cdecl=fiif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; thenAC_MSG_RESULT(failed)elseAC_MSG_RESULT(ok)fi_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],[Take the output of nm and produce a listing of raw symbols and C names])_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],[Transform the output of nm in a proper C declaration])_LT_DECL([global_symbol_to_c_name_address],[lt_cv_sys_global_symbol_to_c_name_address], [1],[Transform the output of nm in a C name address pair])_LT_DECL([global_symbol_to_c_name_address_lib_prefix],[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],[Transform the output of nm in a C name address pair when lib prefix is needed])]) # _LT_CMD_GLOBAL_SYMBOLS# _LT_COMPILER_PIC([TAGNAME])# ---------------------------m4_defun([_LT_COMPILER_PIC],[m4_require([_LT_TAG_COMPILER])dnl_LT_TAGVAR(lt_prog_compiler_wl, $1)=_LT_TAGVAR(lt_prog_compiler_pic, $1)=_LT_TAGVAR(lt_prog_compiler_static, $1)=AC_MSG_CHECKING([for $compiler option to produce PIC])m4_if([$1], [CXX], [# C++ specific cases for pic, static, wl, etc.if test "$GXX" = yes; then_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'case $host_os inaix*)# All AIX code is PIC.if test "$host_cpu" = ia64; then# AIX 5 now supports IA64 processor_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'fi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so support_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;m68k)# FIXME: we need at least 68020 code to build shared libraries, but# adding the `-m68020' flag to GCC prevents building anything better,# like `-m68040'._LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4';;esac;;beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)# PIC is the default for these OSes.;;mingw* | cygwin* | os2* | pw32*)# This hack is so that the source file can tell whether it is being# built for inclusion in a dll (and should export symbols for example).# Although the cygwin gcc ignores -fPIC, still need this for old-style# (--disable-auto-import) librariesm4_if([$1], [GCJ], [],[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']);;darwin* | rhapsody*)# PIC is the default on this platform# Common symbols not allowed in MH_DYLIB files_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common';;*djgpp*)# DJGPP does not support shared libraries at all_LT_TAGVAR(lt_prog_compiler_pic, $1)=;;interix[[3-9]]*)# Interix 3.x gcc -fpic/-fPIC options generate broken code.# Instead, we relocate shared libraries at runtime.;;sysv4*MP*)if test -d /usr/nec; then_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_picfi;;hpux*)# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but# not for PA HP-UX.case $host_cpu inhppa*64*|ia64*);;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;esac;;*qnx* | *nto*)# QNX uses GNU C++, but need to define -shared option too, otherwise# it will coredump._LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared';;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;esacelsecase $host_os inaix[[4-9]]*)# All AIX code is PIC.if test "$host_cpu" = ia64; then# AIX 5 now supports IA64 processor_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'else_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'fi;;chorus*)case $cc_basename incxch68*)# Green Hills C++ Compiler# _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a";;esac;;dgux*)case $cc_basename inec++*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC';;ghcx*)# Green Hills C++ Compiler_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic';;*);;esac;;freebsd* | dragonfly*)# FreeBSD uses GNU C++;;hpux9* | hpux10* | hpux11*)case $cc_basename inCC*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'if test "$host_cpu" != ia64; then_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'fi;;aCC*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'case $host_cpu inhppa*64*|ia64*)# +Z the default;;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z';;esac;;*);;esac;;interix*)# This is c89, which is MS Visual C++ (no shared libs)# Anyone wants to do a port?;;irix5* | irix6* | nonstopux*)case $cc_basename inCC*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'# CC pic flag -KPIC is the default.;;*);;esac;;linux* | k*bsd*-gnu)case $cc_basename inKCC*)# KAI C++ Compiler_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;icpc* | ecpc* )# Intel C++_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-static';;pgCC* | pgcpp*)# Portland Group C++ compiler_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;cxx*)# Compaq C++# Make sure the PIC flag is empty. It appears that all Alpha# Linux and Compaq Tru64 Unix objects are PIC._LT_TAGVAR(lt_prog_compiler_pic, $1)=_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared';;xlc* | xlC*)# IBM XL 8.0 on PPC_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink';;*)case `$CC -V 2>&1 | sed 5q` in*Sun\ C*)# Sun C++ 5.9_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;esac;;esac;;lynxos*);;m88k*);;mvs*)case $cc_basename incxx*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall';;*);;esac;;netbsd*);;*qnx* | *nto*)# QNX uses GNU C++, but need to define -shared option too, otherwise# it will coredump._LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared';;osf3* | osf4* | osf5*)case $cc_basename inKCC*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,';;RCC*)# Rational C++ 2.4.1_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic';;cxx*)# Digital/Compaq C++_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'# Make sure the PIC flag is empty. It appears that all Alpha# Linux and Compaq Tru64 Unix objects are PIC._LT_TAGVAR(lt_prog_compiler_pic, $1)=_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared';;*);;esac;;psos*);;solaris*)case $cc_basename inCC*)# Sun C++ 4.2, 5.x and Centerline C++_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;gcx*)# Green Hills C++ Compiler_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC';;*);;esac;;sunos4*)case $cc_basename inCC*)# Sun C++ 4.x_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;lcc*)# Lucid_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic';;*);;esac;;sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)case $cc_basename inCC*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;esac;;tandem*)case $cc_basename inNCC*)# NonStop-UX NCC 3.20_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC';;*);;esac;;vxworks*);;*)_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no;;esacfi],[if test "$GCC" = yes; then_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'case $host_os inaix*)# All AIX code is PIC.if test "$host_cpu" = ia64; then# AIX 5 now supports IA64 processor_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'fi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so support_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;m68k)# FIXME: we need at least 68020 code to build shared libraries, but# adding the `-m68020' flag to GCC prevents building anything better,# like `-m68040'._LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4';;esac;;beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)# PIC is the default for these OSes.;;mingw* | cygwin* | pw32* | os2*)# This hack is so that the source file can tell whether it is being# built for inclusion in a dll (and should export symbols for example).# Although the cygwin gcc ignores -fPIC, still need this for old-style# (--disable-auto-import) librariesm4_if([$1], [GCJ], [],[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']);;darwin* | rhapsody*)# PIC is the default on this platform# Common symbols not allowed in MH_DYLIB files_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common';;hpux*)# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but# not for PA HP-UX.case $host_cpu inhppa*64*|ia64*)# +Z the default;;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;esac;;interix[[3-9]]*)# Interix 3.x gcc -fpic/-fPIC options generate broken code.# Instead, we relocate shared libraries at runtime.;;msdosdjgpp*)# Just because we use GCC doesn't mean we suddenly get shared libraries# on systems that don't support them._LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=noenable_shared=no;;*nto* | *qnx*)# QNX uses GNU C++, but need to define -shared option too, otherwise# it will coredump._LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared';;sysv4*MP*)if test -d /usr/nec; then_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_picfi;;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC';;esacelse# PORTME Check for flag to pass linker flags through the system compiler.case $host_os inaix*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'if test "$host_cpu" = ia64; then# AIX 5 now supports IA64 processor_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'else_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'fi;;mingw* | cygwin* | pw32* | os2*)# This hack is so that the source file can tell whether it is being# built for inclusion in a dll (and should export symbols for example).m4_if([$1], [GCJ], [],[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']);;hpux9* | hpux10* | hpux11*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but# not for PA HP-UX.case $host_cpu inhppa*64*|ia64*)# +Z the default;;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z';;esac# Is there a better lt_prog_compiler_static that works with the bundled CC?_LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive';;irix5* | irix6* | nonstopux*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'# PIC (with -KPIC) is the default._LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared';;linux* | k*bsd*-gnu)case $cc_basename inicc* | ecc* | ifort*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-static';;pgcc* | pgf77* | pgf90* | pgf95*)# Portland Group compilers (*not* the Pentium gcc compiler,# which looks to be a dead project)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;ccc*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'# All Alpha code is PIC._LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared';;xl*)# IBM XL C 8.0/Fortran 10.1 on PPC_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink';;*)case `$CC -V 2>&1 | sed 5q` in*Sun\ C*)# Sun C 5.9_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;*Sun\ F*)# Sun Fortran 8.3 passes all unrecognized flags to the linker_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'_LT_TAGVAR(lt_prog_compiler_wl, $1)='';;esac;;esac;;newsos6)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;*nto* | *qnx*)# QNX uses GNU C++, but need to define -shared option too, otherwise# it will coredump._LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared';;osf3* | osf4* | osf5*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'# All OSF/1 code is PIC._LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared';;rdos*)_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared';;solaris*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'case $cc_basename inf77* | f90* | f95*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;esac;;sunos4*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;sysv4 | sysv4.2uw2* | sysv4.3*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;sysv4*MP*)if test -d /usr/nec ;then_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'fi;;sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;unicos*)_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no;;uts4*)_LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic';;*)_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no;;esacfi])case $host_os in# For platforms which do not support PIC, -DPIC is meaningless:*djgpp*)_LT_TAGVAR(lt_prog_compiler_pic, $1)=;;*)_LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])";;esacAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],[How to pass a linker flag through the compiler])## Check to make sure the PIC flag actually works.#if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then_LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],[_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],[$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],[case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in"" | " "*) ;;*) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;esac],[_LT_TAGVAR(lt_prog_compiler_pic, $1)=_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])fi_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],[Additional compiler flags for building library objects])## Check to make sure the static flag actually works.#wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],_LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),$lt_tmp_static_flag,[],[_LT_TAGVAR(lt_prog_compiler_static, $1)=])_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],[Compiler flag to prevent dynamic linking])])# _LT_COMPILER_PIC# _LT_LINKER_SHLIBS([TAGNAME])# ----------------------------# See if the linker supports building shared libraries.m4_defun([_LT_LINKER_SHLIBS],[AC_REQUIRE([LT_PATH_LD])dnlAC_REQUIRE([LT_PATH_NM])dnlm4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_DECL_EGREP])dnlm4_require([_LT_DECL_SED])dnlm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnlm4_require([_LT_TAG_COMPILER])dnlAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])m4_if([$1], [CXX], [_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'case $host_os inaix[[4-9]]*)# If we're using GNU nm, then we don't want the "-C" option.# -C means demangle to AIX nm, but means don't demangle with GNU nmif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'else_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'fi;;pw32*)_LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds";;cygwin* | mingw*)_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols';;*)_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols';;esac_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']], [runpath_var=_LT_TAGVAR(allow_undefined_flag, $1)=_LT_TAGVAR(always_export_symbols, $1)=no_LT_TAGVAR(archive_cmds, $1)=_LT_TAGVAR(archive_expsym_cmds, $1)=_LT_TAGVAR(compiler_needs_object, $1)=no_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no_LT_TAGVAR(export_dynamic_flag_spec, $1)=_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'_LT_TAGVAR(hardcode_automatic, $1)=no_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_direct_absolute, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=_LT_TAGVAR(hardcode_libdir_separator, $1)=_LT_TAGVAR(hardcode_minus_L, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported_LT_TAGVAR(inherit_rpath, $1)=no_LT_TAGVAR(link_all_deplibs, $1)=unknown_LT_TAGVAR(module_cmds, $1)=_LT_TAGVAR(module_expsym_cmds, $1)=_LT_TAGVAR(old_archive_from_new_cmds, $1)=_LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=_LT_TAGVAR(thread_safe_flag_spec, $1)=_LT_TAGVAR(whole_archive_flag_spec, $1)=# include_expsyms should be a list of space-separated symbols to be *always*# included in the symbol list_LT_TAGVAR(include_expsyms, $1)=# exclude_expsyms can be an extended regexp of symbols to exclude# it will be wrapped by ` (' and `)$', so one must not match beginning or# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',# as well as any symbol that contains `d'._LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out# platforms (ab)use it in PIC code, but their linkers get confused if# the symbol is explicitly referenced. Since portable code cannot# rely on this symbol name, it's probably fine to never include it in# preloaded symbol tables.# Exclude shared library initialization/finalization symbols.dnl Note also adjust exclude_expsyms for C++ above.extract_expsyms_cmds=case $host_os incygwin* | mingw* | pw32*)# FIXME: the MSVC++ port hasn't been tested in a loooong time# When not using gcc, we currently assume that we are using# Microsoft Visual C++.if test "$GCC" != yes; thenwith_gnu_ld=nofi;;interix*)# we just hope/assume this is gcc and not c89 (= MSVC++)with_gnu_ld=yes;;openbsd*)with_gnu_ld=no;;esac_LT_TAGVAR(ld_shlibs, $1)=yesif test "$with_gnu_ld" = yes; then# If archive_cmds runs LD, not CC, wlarc should be emptywlarc='${wl}'# Set some defaults for GNU ld with shared library support. These# are reset later if shared libraries are not supported. Putting them# here allows them to be overridden if necessary.runpath_var=LD_RUN_PATH_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'# ancient GNU ld didn't support --whole-archive et. al.if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'else_LT_TAGVAR(whole_archive_flag_spec, $1)=fisupports_anon_versioning=nocase `$LD -v 2>&1` in*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...*\ 2.11.*) ;; # other 2.11 versions*) supports_anon_versioning=yes ;;esac# See if GNU ld supports shared libraries.case $host_os inaix[[3-9]]*)# On AIX/PPC, the GNU linker is very brokenif test "$host_cpu" != ia64; then_LT_TAGVAR(ld_shlibs, $1)=nocat <<_LT_EOF 1>&2*** Warning: the GNU linker, at least up to release 2.9.1, is reported*** to be unable to reliably create shared libraries on AIX.*** Therefore, libtool is disabling shared libraries support. If you*** really care for shared libraries, you may want to modify your PATH*** so that a non-GNU linker is found, and then restart._LT_EOFfi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so support_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='';;m68k)_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_minus_L, $1)=yes;;esac;;beos*)if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then_LT_TAGVAR(allow_undefined_flag, $1)=unsupported# Joseph Beckenbach <jrb3@best.com> says some releases of gcc# support --undefined. This deserves some investigation. FIXME_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;cygwin* | mingw* | pw32*)# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,# as there is no search path for DLLs._LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(allow_undefined_flag, $1)=unsupported_LT_TAGVAR(always_export_symbols, $1)=no_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'# If the export-symbols file already is a .def file (1st line# is EXPORTS), use it as is; otherwise, prepend..._LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; thencp $export_symbols $output_objdir/$soname.def;elseecho EXPORTS > $output_objdir/$soname.def;cat $export_symbols >> $output_objdir/$soname.def;fi~$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;interix[[3-9]]*)_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.# Instead, shared libraries are loaded at an image base (0x10000000 by# default) and relocated if they conflict, which is a slow very memory# consuming and fragmenting process. To avoid this, we pick a random,# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link# time. Moving up from 0x10000000 also allows more sbrk(2) space._LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib';;gnu* | linux* | tpf* | k*bsd*-gnu)tmp_diet=noif test "$host_os" = linux-dietlibc; thencase $cc_basename indiet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)esacfiif $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \&& test "$tmp_diet" = nothentmp_addflag=tmp_sharedflag='-shared'case $cc_basename,$host_cpu inpgcc*) # Portland Group C compiler_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'tmp_addflag=' $pic_flag';;pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'tmp_addflag=' $pic_flag -Mnomain' ;;ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64tmp_addflag=' -i_dynamic' ;;efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64tmp_addflag=' -i_dynamic -nofor_main' ;;ifc* | ifort*) # Intel Fortran compilertmp_addflag=' -nofor_main' ;;xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)tmp_sharedflag='-qmkshrobj'tmp_addflag= ;;esaccase `$CC -V 2>&1 | sed 5q` in*Sun\ C*) # Sun C 5.9_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'_LT_TAGVAR(compiler_needs_object, $1)=yestmp_sharedflag='-G' ;;*Sun\ F*) # Sun Fortran 8.3tmp_sharedflag='-G' ;;esac_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'if test "x$supports_anon_versioning" = xyes; then_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~echo "local: *; };" >> $output_objdir/$libname.ver~$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'ficase $cc_basename inxlf*)# IBM XL Fortran 10.1 on PPC cannot create shared libs itself_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'if test "x$supports_anon_versioning" = xyes; then_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~echo "local: *; };" >> $output_objdir/$libname.ver~$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'fi;;esacelse_LT_TAGVAR(ld_shlibs, $1)=nofi;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'wlarc=else_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'fi;;solaris*)if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then_LT_TAGVAR(ld_shlibs, $1)=nocat <<_LT_EOF 1>&2*** Warning: The releases 2.8.* of the GNU linker cannot reliably*** create shared libraries on Solaris systems. Therefore, libtool*** is disabling shared libraries support. We urge you to upgrade GNU*** binutils to release 2.9.1 or newer. Another option is to modify*** your PATH or compiler configuration so that the native linker is*** used, and then restart._LT_EOFelif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)case `$LD -v 2>&1` in*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)_LT_TAGVAR(ld_shlibs, $1)=nocat <<_LT_EOF 1>&2*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not*** reliably create shared libraries on SCO systems. Therefore, libtool*** is disabling shared libraries support. We urge you to upgrade GNU*** binutils to release 2.16.91.0.3 or newer. Another option is to modify*** your PATH or compiler configuration so that the native linker is*** used, and then restart._LT_EOF;;*)# For security reasons, it is highly recommended that you always# use absolute paths for naming shared libraries, and exclude the# DT_RUNPATH tag from executables and libraries. But doing so# requires that you compile everything twice, which is a pain.if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;esac;;sunos4*)_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'wlarc=_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;*)if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;esacif test "$_LT_TAGVAR(ld_shlibs, $1)" = no; thenrunpath_var=_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=_LT_TAGVAR(export_dynamic_flag_spec, $1)=_LT_TAGVAR(whole_archive_flag_spec, $1)=fielse# PORTME fill in a description of your system's linker (not GNU ld)case $host_os inaix3*)_LT_TAGVAR(allow_undefined_flag, $1)=unsupported_LT_TAGVAR(always_export_symbols, $1)=yes_LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'# Note: this linker hardcodes the directories in LIBPATH if there# are no directories specified by -L._LT_TAGVAR(hardcode_minus_L, $1)=yesif test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then# Neither direct hardcoding nor static linking is supported with a# broken collect2._LT_TAGVAR(hardcode_direct, $1)=unsupportedfi;;aix[[4-9]]*)if test "$host_cpu" = ia64; then# On IA64, the linker does run time linking by default, so we don't# have to do anything special.aix_use_runtimelinking=noexp_sym_flag='-Bexport'no_entry_flag=""else# If we're using GNU nm, then we don't want the "-C" option.# -C means demangle to AIX nm, but means don't demangle with GNU nmif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'else_LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'fiaix_use_runtimelinking=no# Test if we are trying to use run time linking or normal# AIX style linking. If -brtl is somewhere in LDFLAGS, we# need to do runtime linking.case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)for ld_flag in $LDFLAGS; doif (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); thenaix_use_runtimelinking=yesbreakfidone;;esacexp_sym_flag='-bexport'no_entry_flag='-bnoentry'fi# When large executables or shared objects are built, AIX ld can# have problems creating the table of contents. If linking a library# or program results in "error TOC overflow" add -mminimal-toc to# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS._LT_TAGVAR(archive_cmds, $1)=''_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_direct_absolute, $1)=yes_LT_TAGVAR(hardcode_libdir_separator, $1)=':'_LT_TAGVAR(link_all_deplibs, $1)=yes_LT_TAGVAR(file_list_spec, $1)='${wl}-f,'if test "$GCC" = yes; thencase $host_os in aix4.[[012]]|aix4.[[012]].*)# We only want to do this on AIX 4.2 and lower, the check# below for broken collect2 doesn't work under 4.3+collect2name=`${CC} -print-prog-name=collect2`if test -f "$collect2name" &&strings "$collect2name" | $GREP resolve_lib_name >/dev/nullthen# We have reworked collect2:else# We have old collect2_LT_TAGVAR(hardcode_direct, $1)=unsupported# It fails to find uninstalled libraries when the uninstalled# path is not listed in the libpath. Setting hardcode_minus_L# to unsupported forces relinking_LT_TAGVAR(hardcode_minus_L, $1)=yes_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=fi;;esacshared_flag='-shared'if test "$aix_use_runtimelinking" = yes; thenshared_flag="$shared_flag "'${wl}-G'fielse# not using gccif test "$host_cpu" = ia64; then# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release# chokes on -Wl,-G. The following line is correct:shared_flag='-G'elseif test "$aix_use_runtimelinking" = yes; thenshared_flag='${wl}-G'elseshared_flag='${wl}-bM:SRE'fififi# It seems that -bexpall does not export symbols beginning with# underscore (_), so it is better to generate a list of symbols to export._LT_TAGVAR(always_export_symbols, $1)=yesif test "$aix_use_runtimelinking" = yes; then# Warning - without using the other runtime loading flags (-brtl),# -berok will link without error, but may produce a broken library._LT_TAGVAR(allow_undefined_flag, $1)='-berok'# Determine the default libpath from the value encoded in an# empty executable._LT_SYS_MODULE_PATH_AIX_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"elseif test "$host_cpu" = ia64; then_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"else# Determine the default libpath from the value encoded in an# empty executable._LT_SYS_MODULE_PATH_AIX_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"# Warning - without using the other run time loading flags,# -berok will link without error, but may produce a broken library._LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'# Exported symbols can be pulled into shared objects from archives_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'_LT_TAGVAR(archive_cmds_need_lc, $1)=yes# This is similar to how AIX traditionally builds its shared libraries._LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'fifi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so support_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='';;m68k)_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_minus_L, $1)=yes;;esac;;bsdi[[45]]*)_LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic;;cygwin* | mingw* | pw32*)# When not using gcc, we currently assume that we are using# Microsoft Visual C++.# hardcode_libdir_flag_spec is actually meaningless, as there is# no search path for DLLs._LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '_LT_TAGVAR(allow_undefined_flag, $1)=unsupported# Tell ltmain to make .lib files, not .a files.libext=lib# Tell ltmain to make .dll files, not .so files.shrext_cmds=".dll"# FIXME: Setting linknames here is a bad hack._LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='# The linker will automatically build a .lib file if we build a DLL._LT_TAGVAR(old_archive_from_new_cmds, $1)='true'# FIXME: Should let the user specify the lib program._LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'_LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes;;darwin* | rhapsody*)_LT_DARWIN_LINKER_FEATURES($1);;dgux*)_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;freebsd1*)_LT_TAGVAR(ld_shlibs, $1)=no;;# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor# support. Future versions do this automatically, but an explicit c++rt0.o# does not break anything, and helps significantly (at the cost of a little# extra space).freebsd2.2*)_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;# Unfortunately, older versions of FreeBSD 2 do not have this feature.freebsd2*)_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_minus_L, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;# FreeBSD 3 and greater uses gcc -shared to do shared libraries.freebsd* | dragonfly*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;hpux9*)if test "$GCC" = yes; then_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'else_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'fi_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:_LT_TAGVAR(hardcode_direct, $1)=yes# hardcode_minus_L: Not really in the search PATH,# but as the default location of the library._LT_TAGVAR(hardcode_minus_L, $1)=yes_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E';;hpux10*)if test "$GCC" = yes -a "$with_gnu_ld" = no; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'else_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'fiif test "$with_gnu_ld" = no; then_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_direct_absolute, $1)=yes_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'# hardcode_minus_L: Not really in the search PATH,# but as the default location of the library._LT_TAGVAR(hardcode_minus_L, $1)=yesfi;;hpux11*)if test "$GCC" = yes -a "$with_gnu_ld" = no; thencase $host_cpu inhppa*64*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags';;ia64*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags';;esacelsecase $host_cpu inhppa*64*)_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags';;ia64*)_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags';;esacfiif test "$with_gnu_ld" = no; then_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:case $host_cpu inhppa*64*|ia64*)_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;*)_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_direct_absolute, $1)=yes_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'# hardcode_minus_L: Not really in the search PATH,# but as the default location of the library._LT_TAGVAR(hardcode_minus_L, $1)=yes;;esacfi;;irix5* | irix6* | nonstopux*)if test "$GCC" = yes; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'# Try to use the -exported_symbol ld option, if it does not# work, assume that -exports_file does not work either and# implicitly export all symbols.save_LDFLAGS="$LDFLAGS"LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"AC_LINK_IFELSE(int foo(void) {},_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib')LDFLAGS="$save_LDFLAGS"else_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'fi_LT_TAGVAR(archive_cmds_need_lc, $1)='no'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:_LT_TAGVAR(inherit_rpath, $1)=yes_LT_TAGVAR(link_all_deplibs, $1)=yes;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.outelse_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELFfi_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;newsos6)_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;*nto* | *qnx*);;openbsd*)if test -f /usr/libexec/ld.so; then_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(hardcode_direct_absolute, $1)=yesif test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'elsecase $host_os inopenbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir';;esacfielse_LT_TAGVAR(ld_shlibs, $1)=nofi;;os2*)_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_minus_L, $1)=yes_LT_TAGVAR(allow_undefined_flag, $1)=unsupported_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'_LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def';;osf3*)if test "$GCC" = yes; then_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'else_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'fi_LT_TAGVAR(archive_cmds_need_lc, $1)='no'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:;;osf4* | osf5*) # as osf3* with the addition of -msym flagif test "$GCC" = yes; then_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'else_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'# Both c and cxx compiler support -rpath directly_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'fi_LT_TAGVAR(archive_cmds_need_lc, $1)='no'_LT_TAGVAR(hardcode_libdir_separator, $1)=:;;solaris*)_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'if test "$GCC" = yes; thenwlarc='${wl}'_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'elsecase `$CC -V 2>&1` in*"Compilers 5.0"*)wlarc=''_LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp';;*)wlarc='${wl}'_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp';;esacfi_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(hardcode_shlibpath_var, $1)=nocase $host_os insolaris2.[[0-5]] | solaris2.[[0-5]].*) ;;*)# The compiler driver will combine and reorder linker options,# but understands `-z linker_flag'. GCC discards it without `$wl',# but is careful enough not to reorder.# Supported since Solaris 2.6 (maybe 2.5.1?)if test "$GCC" = yes; then_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'else_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'fi;;esac_LT_TAGVAR(link_all_deplibs, $1)=yes;;sunos4*)if test "x$host_vendor" = xsequent; then# Use $CC to link under sequent, because it throws in some extra .o# files that make .init and .fini sections work._LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'else_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'fi_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_minus_L, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;sysv4)case $host_vendor insni)_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???;;siemens)## LD is ld it makes a PLAMLIB## CC just makes a GrossModule._LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'_LT_TAGVAR(hardcode_direct, $1)=no;;motorola)_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie;;esacrunpath_var='LD_RUN_PATH'_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;sysv4.3*)_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport';;sysv4*MP*)if test -d /usr/nec; then_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_shlibpath_var, $1)=norunpath_var=LD_RUN_PATHhardcode_runpath_var=yes_LT_TAGVAR(ld_shlibs, $1)=yesfi;;sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=norunpath_var='LD_RUN_PATH'if test "$GCC" = yes; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'else_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'fi;;sysv5* | sco3.2v5* | sco5v6*)# Note: We can NOT use -z defs as we might desire, because we do not# link with -lc, and that would cause any symbols used from libc to# always be unresolved, which means just about no library would# ever link correctly. If we're not using GNU ld we use -z text# though, which does catch some bad symbols but isn't as heavy-handed# as -z defs._LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=':'_LT_TAGVAR(link_all_deplibs, $1)=yes_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'runpath_var='LD_RUN_PATH'if test "$GCC" = yes; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'else_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'fi;;uts4*)_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;*)_LT_TAGVAR(ld_shlibs, $1)=no;;esacif test x$host_vendor = xsni; thencase $host insysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym';;esacfifi])AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl_LT_DECL([], [extract_expsyms_cmds], [2],[The commands to extract the exported symbol list from a shared archive])## Do we need to explicitly link libc?#case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" inx|xyes)# Assume -lc should be added_LT_TAGVAR(archive_cmds_need_lc, $1)=yesif test "$enable_shared" = yes && test "$GCC" = yes; thencase $_LT_TAGVAR(archive_cmds, $1) in*'~'*)# FIXME: we may have to deal with multi-command sequences.;;'$CC '*)# Test whether the compiler implicitly links with -lc since on some# systems, -lgcc has to come before -lc. If gcc already passes -lc# to ld, don't add -lc before -lgcc.AC_MSG_CHECKING([whether -lc should be explicitly linked in])$RM -r conftest*echo "$lt_simple_compile_test_code" > conftest.$ac_extif AC_TRY_EVAL(ac_compile) 2>conftest.err; thensoname=conftestlib=conftestlibobjs=conftest.$ac_objextdeplibs=wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)compiler_flags=-vlinker_flags=-vverstring=output_objdir=.libname=conftestlt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)_LT_TAGVAR(allow_undefined_flag, $1)=if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)then_LT_TAGVAR(archive_cmds_need_lc, $1)=noelse_LT_TAGVAR(archive_cmds_need_lc, $1)=yesfi_LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flagelsecat conftest.err 1>&5fi$RM -r conftest*AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]);;esacfi;;esac_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],[Whether or not to add -lc for building shared libraries])_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],[enable_shared_with_static_runtimes], [0],[Whether or not to disallow shared libs when runtime libs are static])_LT_TAGDECL([], [export_dynamic_flag_spec], [1],[Compiler flag to allow reflexive dlopens])_LT_TAGDECL([], [whole_archive_flag_spec], [1],[Compiler flag to generate shared objects directly from archives])_LT_TAGDECL([], [compiler_needs_object], [1],[Whether the compiler copes with passing no objects directly])_LT_TAGDECL([], [old_archive_from_new_cmds], [2],[Create an old-style archive from a shared archive])_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],[Create a temporary old-style archive to link instead of a shared archive])_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])_LT_TAGDECL([], [archive_expsym_cmds], [2])_LT_TAGDECL([], [module_cmds], [2],[Commands used to build a loadable module if different from buildinga shared archive.])_LT_TAGDECL([], [module_expsym_cmds], [2])_LT_TAGDECL([], [with_gnu_ld], [1],[Whether we are building with GNU ld or not])_LT_TAGDECL([], [allow_undefined_flag], [1],[Flag that allows shared libraries with undefined symbols to be built])_LT_TAGDECL([], [no_undefined_flag], [1],[Flag that enforces no undefined symbols])_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],[Flag to hardcode $libdir into a binary during linking.This must work even if $libdir does not exist])_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],[[If ld is used when linking, flag to hardcode $libdir into a binaryduring linking. This must work even if $libdir does not exist]])_LT_TAGDECL([], [hardcode_libdir_separator], [1],[Whether we need a single "-rpath" flag with a separated argument])_LT_TAGDECL([], [hardcode_direct], [0],[Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodesDIR into the resulting binary])_LT_TAGDECL([], [hardcode_direct_absolute], [0],[Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodesDIR into the resulting binary and the resulting library dependency is"absolute", i.e impossible to change by setting ${shlibpath_var} if thelibrary is relocated])_LT_TAGDECL([], [hardcode_minus_L], [0],[Set to "yes" if using the -LDIR flag during linking hardcodes DIRinto the resulting binary])_LT_TAGDECL([], [hardcode_shlibpath_var], [0],[Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIRinto the resulting binary])_LT_TAGDECL([], [hardcode_automatic], [0],[Set to "yes" if building a shared library automatically hardcodes DIRinto the library and all subsequent libraries and executables linkedagainst it])_LT_TAGDECL([], [inherit_rpath], [0],[Set to yes if linker adds runtime paths of dependent librariesto runtime path list])_LT_TAGDECL([], [link_all_deplibs], [0],[Whether libtool must link a program against all its dependency libraries])_LT_TAGDECL([], [fix_srcfile_path], [1],[Fix the shell variable $srcfile for the compiler])_LT_TAGDECL([], [always_export_symbols], [0],[Set to "yes" if exported symbols are required])_LT_TAGDECL([], [export_symbols_cmds], [2],[The commands to list exported symbols])_LT_TAGDECL([], [exclude_expsyms], [1],[Symbols that should not be listed in the preloaded symbols])_LT_TAGDECL([], [include_expsyms], [1],[Symbols that must always be exported])_LT_TAGDECL([], [prelink_cmds], [2],[Commands necessary for linking programs (against libraries) with templates])_LT_TAGDECL([], [file_list_spec], [1],[Specify filename containing input files])dnl FIXME: Not yet implementeddnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],dnl [Compiler flag to generate thread safe objects])])# _LT_LINKER_SHLIBS# _LT_LANG_C_CONFIG([TAG])# ------------------------# Ensure that the configuration variables for a C compiler are suitably# defined. These variables are subsequently used by _LT_CONFIG to write# the compiler configuration to `libtool'.m4_defun([_LT_LANG_C_CONFIG],[m4_require([_LT_DECL_EGREP])dnllt_save_CC="$CC"AC_LANG_PUSH(C)# Source file extension for C test sources.ac_ext=c# Object file extension for compiled C test sources.objext=o_LT_TAGVAR(objext, $1)=$objext# Code to be used in simple compile testslt_simple_compile_test_code="int some_variable = 0;"# Code to be used in simple link testslt_simple_link_test_code='int main(){return(0);}'_LT_TAG_COMPILER# Save the default compiler, since it gets overwritten when the other# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.compiler_DEFAULT=$CC# save warnings/boilerplate of simple test code_LT_COMPILER_BOILERPLATE_LT_LINKER_BOILERPLATEif test -n "$compiler"; then_LT_COMPILER_NO_RTTI($1)_LT_COMPILER_PIC($1)_LT_COMPILER_C_O($1)_LT_COMPILER_FILE_LOCKS($1)_LT_LINKER_SHLIBS($1)_LT_SYS_DYNAMIC_LINKER($1)_LT_LINKER_HARDCODE_LIBPATH($1)LT_SYS_DLOPEN_SELF_LT_CMD_STRIPLIB# Report which library types will actually be builtAC_MSG_CHECKING([if libtool supports shared libraries])AC_MSG_RESULT([$can_build_shared])AC_MSG_CHECKING([whether to build shared libraries])test "$can_build_shared" = "no" && enable_shared=no# On AIX, shared libraries and static libraries use the same namespace, and# are all built from PIC.case $host_os inaix3*)test "$enable_shared" = yes && enable_static=noif test -n "$RANLIB"; thenarchive_cmds="$archive_cmds~\$RANLIB \$lib"postinstall_cmds='$RANLIB $lib'fi;;aix[[4-9]]*)if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; thentest "$enable_shared" = yes && enable_static=nofi;;esacAC_MSG_RESULT([$enable_shared])AC_MSG_CHECKING([whether to build static libraries])# Make sure either enable_shared or enable_static is yes.test "$enable_shared" = yes || enable_static=yesAC_MSG_RESULT([$enable_static])_LT_CONFIG($1)fiAC_LANG_POPCC="$lt_save_CC"])# _LT_LANG_C_CONFIG# _LT_PROG_CXX# ------------# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++# compiler, we have our own version here.m4_defun([_LT_PROG_CXX],[pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])AC_PROG_CXXif test -n "$CXX" && ( test "X$CXX" != "Xno" &&( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||(test "X$CXX" != "Xg++"))) ; thenAC_PROG_CXXCPPelse_lt_caught_CXX_error=yesfipopdef([AC_MSG_ERROR])])# _LT_PROG_CXXdnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([_LT_PROG_CXX], [])# _LT_LANG_CXX_CONFIG([TAG])# --------------------------# Ensure that the configuration variables for a C++ compiler are suitably# defined. These variables are subsequently used by _LT_CONFIG to write# the compiler configuration to `libtool'.m4_defun([_LT_LANG_CXX_CONFIG],[AC_REQUIRE([_LT_PROG_CXX])dnlm4_require([_LT_FILEUTILS_DEFAULTS])dnlm4_require([_LT_DECL_EGREP])dnlAC_LANG_PUSH(C++)_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(allow_undefined_flag, $1)=_LT_TAGVAR(always_export_symbols, $1)=no_LT_TAGVAR(archive_expsym_cmds, $1)=_LT_TAGVAR(compiler_needs_object, $1)=no_LT_TAGVAR(export_dynamic_flag_spec, $1)=_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_direct_absolute, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=_LT_TAGVAR(hardcode_libdir_separator, $1)=_LT_TAGVAR(hardcode_minus_L, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported_LT_TAGVAR(hardcode_automatic, $1)=no_LT_TAGVAR(inherit_rpath, $1)=no_LT_TAGVAR(module_cmds, $1)=_LT_TAGVAR(module_expsym_cmds, $1)=_LT_TAGVAR(link_all_deplibs, $1)=unknown_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds_LT_TAGVAR(no_undefined_flag, $1)=_LT_TAGVAR(whole_archive_flag_spec, $1)=_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no# Source file extension for C++ test sources.ac_ext=cpp# Object file extension for compiled C++ test sources.objext=o_LT_TAGVAR(objext, $1)=$objext# No sense in running all these tests if we already determined that# the CXX compiler isn't working. Some variables (like enable_shared)# are currently assumed to apply to all compilers on this platform,# and will be corrupted by setting them based on a non-working compiler.if test "$_lt_caught_CXX_error" != yes; then# Code to be used in simple compile testslt_simple_compile_test_code="int some_variable = 0;"# Code to be used in simple link testslt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'# ltmain only uses $CC for tagged configurations so make sure $CC is set._LT_TAG_COMPILER# save warnings/boilerplate of simple test code_LT_COMPILER_BOILERPLATE_LT_LINKER_BOILERPLATE# Allow CC to be a program name with arguments.lt_save_CC=$CClt_save_LD=$LDlt_save_GCC=$GCCGCC=$GXXlt_save_with_gnu_ld=$with_gnu_ldlt_save_path_LD=$lt_cv_path_LDif test -n "${lt_cv_prog_gnu_ldcxx+set}"; thenlt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxxelse$as_unset lt_cv_prog_gnu_ldfiif test -n "${lt_cv_path_LDCXX+set}"; thenlt_cv_path_LD=$lt_cv_path_LDCXXelse$as_unset lt_cv_path_LDfitest -z "${LDCXX+set}" || LD=$LDCXXCC=${CXX-"c++"}compiler=$CC_LT_TAGVAR(compiler, $1)=$CC_LT_CC_BASENAME([$compiler])if test -n "$compiler"; then# We don't want -fno-exception when compiling C++ code, so set the# no_builtin_flag separatelyif test "$GXX" = yes; then_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'else_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=fiif test "$GXX" = yes; then# Set up default GNU C++ configurationLT_PATH_LD# Check if GNU C++ uses GNU ld as the underlying linker, since the# archiving commands below assume that GNU ld is being used.if test "$with_gnu_ld" = yes; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'# If archive_cmds runs LD, not CC, wlarc should be empty# XXX I think wlarc can be eliminated in ltcf-cxx, but I need to# investigate it a little bit more. (MM)wlarc='${wl}'# ancient GNU ld didn't support --whole-archive et. al.if eval "`$CC -print-prog-name=ld` --help 2>&1" |$GREP 'no-whole-archive' > /dev/null; then_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'else_LT_TAGVAR(whole_archive_flag_spec, $1)=fielsewith_gnu_ld=nowlarc=# A generic and very simple default shared library creation# command for GNU C++ for the case where it uses the native# linker, instead of GNU ld. If possible, this setting should# overridden to take advantage of the native linker features on# the platform it is being used on._LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'fi# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'elseGXX=nowith_gnu_ld=nowlarc=fi# PORTME: fill in a description of your system's C++ link characteristicsAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])_LT_TAGVAR(ld_shlibs, $1)=yescase $host_os inaix3*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;aix[[4-9]]*)if test "$host_cpu" = ia64; then# On IA64, the linker does run time linking by default, so we don't# have to do anything special.aix_use_runtimelinking=noexp_sym_flag='-Bexport'no_entry_flag=""elseaix_use_runtimelinking=no# Test if we are trying to use run time linking or normal# AIX style linking. If -brtl is somewhere in LDFLAGS, we# need to do runtime linking.case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)for ld_flag in $LDFLAGS; docase $ld_flag in*-brtl*)aix_use_runtimelinking=yesbreak;;esacdone;;esacexp_sym_flag='-bexport'no_entry_flag='-bnoentry'fi# When large executables or shared objects are built, AIX ld can# have problems creating the table of contents. If linking a library# or program results in "error TOC overflow" add -mminimal-toc to# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS._LT_TAGVAR(archive_cmds, $1)=''_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_direct_absolute, $1)=yes_LT_TAGVAR(hardcode_libdir_separator, $1)=':'_LT_TAGVAR(link_all_deplibs, $1)=yes_LT_TAGVAR(file_list_spec, $1)='${wl}-f,'if test "$GXX" = yes; thencase $host_os in aix4.[[012]]|aix4.[[012]].*)# We only want to do this on AIX 4.2 and lower, the check# below for broken collect2 doesn't work under 4.3+collect2name=`${CC} -print-prog-name=collect2`if test -f "$collect2name" &&strings "$collect2name" | $GREP resolve_lib_name >/dev/nullthen# We have reworked collect2:else# We have old collect2_LT_TAGVAR(hardcode_direct, $1)=unsupported# It fails to find uninstalled libraries when the uninstalled# path is not listed in the libpath. Setting hardcode_minus_L# to unsupported forces relinking_LT_TAGVAR(hardcode_minus_L, $1)=yes_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=fiesacshared_flag='-shared'if test "$aix_use_runtimelinking" = yes; thenshared_flag="$shared_flag "'${wl}-G'fielse# not using gccif test "$host_cpu" = ia64; then# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release# chokes on -Wl,-G. The following line is correct:shared_flag='-G'elseif test "$aix_use_runtimelinking" = yes; thenshared_flag='${wl}-G'elseshared_flag='${wl}-bM:SRE'fififi# It seems that -bexpall does not export symbols beginning with# underscore (_), so it is better to generate a list of symbols to# export._LT_TAGVAR(always_export_symbols, $1)=yesif test "$aix_use_runtimelinking" = yes; then# Warning - without using the other runtime loading flags (-brtl),# -berok will link without error, but may produce a broken library._LT_TAGVAR(allow_undefined_flag, $1)='-berok'# Determine the default libpath from the value encoded in an empty# executable._LT_SYS_MODULE_PATH_AIX_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"elseif test "$host_cpu" = ia64; then_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"else# Determine the default libpath from the value encoded in an# empty executable._LT_SYS_MODULE_PATH_AIX_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"# Warning - without using the other run time loading flags,# -berok will link without error, but may produce a broken library._LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'# Exported symbols can be pulled into shared objects from archives_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'_LT_TAGVAR(archive_cmds_need_lc, $1)=yes# This is similar to how AIX traditionally builds its shared# libraries._LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'fifi;;beos*)if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then_LT_TAGVAR(allow_undefined_flag, $1)=unsupported# Joseph Beckenbach <jrb3@best.com> says some releases of gcc# support --undefined. This deserves some investigation. FIXME_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;chorus*)case $cc_basename in*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;esac;;cygwin* | mingw* | pw32*)# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,# as there is no search path for DLLs._LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'_LT_TAGVAR(allow_undefined_flag, $1)=unsupported_LT_TAGVAR(always_export_symbols, $1)=no_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yesif $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'# If the export-symbols file already is a .def file (1st line# is EXPORTS), use it as is; otherwise, prepend..._LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; thencp $export_symbols $output_objdir/$soname.def;elseecho EXPORTS > $output_objdir/$soname.def;cat $export_symbols >> $output_objdir/$soname.def;fi~$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'else_LT_TAGVAR(ld_shlibs, $1)=nofi;;darwin* | rhapsody*)_LT_DARWIN_LINKER_FEATURES($1);;dgux*)case $cc_basename inec++*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;ghcx*)# Green Hills C++ Compiler# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;esac;;freebsd[[12]]*)# C++ shared libraries reported to be fairly broken before# switch to ELF_LT_TAGVAR(ld_shlibs, $1)=no;;freebsd-elf*)_LT_TAGVAR(archive_cmds_need_lc, $1)=no;;freebsd* | dragonfly*)# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF# conventions_LT_TAGVAR(ld_shlibs, $1)=yes;;gnu*);;hpux9*)_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,# but as the default# location of the library.case $cc_basename inCC*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;aCC*)_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.## There doesn't appear to be a way to prevent this compiler from# explicitly linking system object files so we need to strip them# from the output so that they don't get included in the library# dependencies.output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed';;*)if test "$GXX" = yes; then_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'else# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=nofi;;esac;;hpux10*|hpux11*)if test $with_gnu_ld = no; then_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:case $host_cpu inhppa*64*|ia64*);;*)_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E';;esacficase $host_cpu inhppa*64*|ia64*)_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=no;;*)_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_direct_absolute, $1)=yes_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,# but as the default# location of the library.;;esaccase $cc_basename inCC*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;aCC*)case $host_cpu inhppa*64*)_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags';;ia64*)_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags';;esac# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.## There doesn't appear to be a way to prevent this compiler from# explicitly linking system object files so we need to strip them# from the output so that they don't get included in the library# dependencies.output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed';;*)if test "$GXX" = yes; thenif test $with_gnu_ld = no; thencase $host_cpu inhppa*64*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags';;ia64*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags';;esacfielse# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=nofi;;esac;;interix[[3-9]]*)_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.# Instead, shared libraries are loaded at an image base (0x10000000 by# default) and relocated if they conflict, which is a slow very memory# consuming and fragmenting process. To avoid this, we pick a random,# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link# time. Moving up from 0x10000000 also allows more sbrk(2) space._LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib';;irix5* | irix6*)case $cc_basename inCC*)# SGI C++_LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'# Archives containing C++ object files must be created using# "CC -ar", where "CC" is the IRIX C++ compiler. This is# necessary to make sure instantiated templates are included# in the archive._LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs';;*)if test "$GXX" = yes; thenif test "$with_gnu_ld" = no; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'else_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'fifi_LT_TAGVAR(link_all_deplibs, $1)=yes;;esac_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:_LT_TAGVAR(inherit_rpath, $1)=yes;;linux* | k*bsd*-gnu)case $cc_basename inKCC*)# Kuck and Associates, Inc. (KAI) C++ Compiler# KCC will only create a shared library if the output file# ends with ".so" (or ".sl" for HP-UX), so rename the library# to its proper name (with version) after linking._LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.## There doesn't appear to be a way to prevent this compiler from# explicitly linking system object files so we need to strip them# from the output so that they don't get included in the library# dependencies.output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'# Archives containing C++ object files must be created using# "CC -Bstatic", where "CC" is the KAI C++ compiler._LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs';;icpc* | ecpc* )# Intel C++with_gnu_ld=yes# version 8.0 and above of icpc choke on multiply defined symbols# if we add $predep_objects and $postdep_objects, however 7.1 and# earlier do not add the objects themselves.case `$CC -V 2>&1` in*"Version 7."*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib';;*) # Version 8.0 or newertmp_idyn=case $host_cpu inia64*) tmp_idyn=' -i_dynamic';;esac_LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib';;esac_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive';;pgCC* | pgcpp*)# Portland Group C++ compilercase `$CC -V` in*pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~rm -rf $tpldir~$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~rm -rf $tpldir~$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~$RANLIB $oldlib'_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~rm -rf $tpldir~$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~rm -rf $tpldir~$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib';;*) # Version 6 will use weak symbols_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib';;esac_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive';;cxx*)# Compaq C++_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'runpath_var=LD_RUN_PATH_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.## There doesn't appear to be a way to prevent this compiler from# explicitly linking system object files so we need to strip them# from the output so that they don't get included in the library# dependencies.output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed';;xl*)# IBM XL 8.0 on PPC, with GNU ld_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'if test "x$supports_anon_versioning" = xyes; then_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~echo "local: *; };" >> $output_objdir/$libname.ver~$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'fi;;*)case `$CC -V 2>&1 | sed 5q` in*Sun\ C*)# Sun C++ 5.9_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'_LT_TAGVAR(compiler_needs_object, $1)=yes# Not sure whether something based on# $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1# would be better.output_verbose_link_cmd='echo'# Archives containing C++ object files must be created using# "CC -xar", where "CC" is the Sun C++ compiler. This is# necessary to make sure instantiated templates are included# in the archive._LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs';;esac;;esac;;lynxos*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;m88k*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;mvs*)case $cc_basename incxx*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;esac;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'wlarc=_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=nofi# Workaround some broken pre-1.5 toolchainsoutput_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"';;*nto* | *qnx*)_LT_TAGVAR(ld_shlibs, $1)=yes;;openbsd2*)# C++ shared libraries are fairly broken_LT_TAGVAR(ld_shlibs, $1)=no;;openbsd*)if test -f /usr/libexec/ld.so; then_LT_TAGVAR(hardcode_direct, $1)=yes_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(hardcode_direct_absolute, $1)=yes_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'_LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'fioutput_verbose_link_cmd=echoelse_LT_TAGVAR(ld_shlibs, $1)=nofi;;osf3* | osf4* | osf5*)case $cc_basename inKCC*)# Kuck and Associates, Inc. (KAI) C++ Compiler# KCC will only create a shared library if the output file# ends with ".so" (or ".sl" for HP-UX), so rename the library# to its proper name (with version) after linking._LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:# Archives containing C++ object files must be created using# the KAI C++ compiler.case $host inosf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;esac;;RCC*)# Rational C++ 2.4.1# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;cxx*)case $host inosf3*)_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir';;*)_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~echo "-hidden">> $lib.exp~$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir';;esac_LT_TAGVAR(hardcode_libdir_separator, $1)=:# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.## There doesn't appear to be a way to prevent this compiler from# explicitly linking system object files so we need to strip them# from the output so that they don't get included in the library# dependencies.output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed';;*)if test "$GXX" = yes && test "$with_gnu_ld" = no; then_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'case $host inosf3*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib';;esac_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=:# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'else# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=nofi;;esac;;psos*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;sunos4*)case $cc_basename inCC*)# Sun C++ 4.x# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;lcc*)# Lucid# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;esac;;solaris*)case $cc_basename inCC*)# Sun C++ 4.2, 5.x and Centerline C++_LT_TAGVAR(archive_cmds_need_lc,$1)=yes_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'_LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'_LT_TAGVAR(hardcode_shlibpath_var, $1)=nocase $host_os insolaris2.[[0-5]] | solaris2.[[0-5]].*) ;;*)# The compiler driver will combine and reorder linker options,# but understands `-z linker_flag'.# Supported since Solaris 2.6 (maybe 2.5.1?)_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract';;esac_LT_TAGVAR(link_all_deplibs, $1)=yesoutput_verbose_link_cmd='echo'# Archives containing C++ object files must be created using# "CC -xar", where "CC" is the Sun C++ compiler. This is# necessary to make sure instantiated templates are included# in the archive._LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs';;gcx*)# Green Hills C++ Compiler_LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'# The C++ compiler must be used to create the archive._LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs';;*)# GNU C++ compiler with Solaris linkerif test "$GXX" = yes && test "$with_gnu_ld" = no; then_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'if $CC --version | $GREP -v '^2\.7' > /dev/null; then_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'else# g++ 2.7 appears to require `-G' NOT `-shared' on this# platform._LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'# Commands to make compiler produce verbose output that lists# what "hidden" libraries, object files and flags are used when# linking a shared library.output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'fi_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'case $host_os insolaris2.[[0-5]] | solaris2.[[0-5]].*) ;;*)_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract';;esacfi;;esac;;sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=norunpath_var='LD_RUN_PATH'case $cc_basename inCC*)_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags';;esac;;sysv5* | sco3.2v5* | sco5v6*)# Note: We can NOT use -z defs as we might desire, because we do not# link with -lc, and that would cause any symbols used from libc to# always be unresolved, which means just about no library would# ever link correctly. If we're not using GNU ld we use -z text# though, which does catch some bad symbols but isn't as heavy-handed# as -z defs._LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(hardcode_shlibpath_var, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'_LT_TAGVAR(hardcode_libdir_separator, $1)=':'_LT_TAGVAR(link_all_deplibs, $1)=yes_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'runpath_var='LD_RUN_PATH'case $cc_basename inCC*)_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags';;*)_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags';;esac;;tandem*)case $cc_basename inNCC*)# NonStop-UX NCC 3.20# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;esac;;vxworks*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;*)# FIXME: insert proper C++ library support_LT_TAGVAR(ld_shlibs, $1)=no;;esacAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no_LT_TAGVAR(GCC, $1)="$GXX"_LT_TAGVAR(LD, $1)="$LD"## CAVEAT EMPTOR:## There is no encapsulation within the following macros, do not change## the running order or otherwise move them around unless you know exactly## what you are doing..._LT_SYS_HIDDEN_LIBDEPS($1)_LT_COMPILER_PIC($1)_LT_COMPILER_C_O($1)_LT_COMPILER_FILE_LOCKS($1)_LT_LINKER_SHLIBS($1)_LT_SYS_DYNAMIC_LINKER($1)_LT_LINKER_HARDCODE_LIBPATH($1)_LT_CONFIG($1)fi # test -n "$compiler"CC=$lt_save_CCLDCXX=$LDLD=$lt_save_LDGCC=$lt_save_GCCwith_gnu_ld=$lt_save_with_gnu_ldlt_cv_path_LDCXX=$lt_cv_path_LDlt_cv_path_LD=$lt_save_path_LDlt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ldlt_cv_prog_gnu_ld=$lt_save_with_gnu_ldfi # test "$_lt_caught_CXX_error" != yesAC_LANG_POP])# _LT_LANG_CXX_CONFIG# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])# ---------------------------------# Figure out "hidden" library dependencies from verbose# compiler output when linking a shared library.# Parse the compiler output and extract the necessary# objects, libraries and library flags.m4_defun([_LT_SYS_HIDDEN_LIBDEPS],[m4_require([_LT_FILEUTILS_DEFAULTS])dnl# Dependencies to place before and after the object being linked:_LT_TAGVAR(predep_objects, $1)=_LT_TAGVAR(postdep_objects, $1)=_LT_TAGVAR(predeps, $1)=_LT_TAGVAR(postdeps, $1)=_LT_TAGVAR(compiler_lib_search_path, $1)=dnl we can't use the lt_simple_compile_test_code here,dnl because it contains code intended for an executable,dnl not a library. It's possible we should let eachdnl tag define a new lt_????_link_test_code variable,dnl but it's only used here...m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOFint a;void foo (void) { a = 0; }_LT_EOF], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOFclass Foo{public:Foo (void) { a = 0; }private:int a;};_LT_EOF], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOFsubroutine fooimplicit noneinteger*4 aa=0returnend_LT_EOF], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOFsubroutine fooimplicit noneinteger aa=0returnend_LT_EOF], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOFpublic class foo {private int a;public void bar (void) {a = 0;}};_LT_EOF])dnl Parse the compiler output and extract the necessarydnl objects, libraries and library flags.if AC_TRY_EVAL(ac_compile); then# Parse the compiler output and extract the necessary# objects, libraries and library flags.# Sentinel used to keep track of whether or not we are before# the conftest object file.pre_test_object_deps_done=nofor p in `eval "$output_verbose_link_cmd"`; docase $p in-L* | -R* | -l*)# Some compilers place space between "-{L,R}" and the path.# Remove the space.if test $p = "-L" ||test $p = "-R"; thenprev=$pcontinueelseprev=fiif test "$pre_test_object_deps_done" = no; thencase $p in-L* | -R*)# Internal compiler library paths should come after those# provided the user. The postdeps already come after the# user supplied libs so there is no need to process them.if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then_LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"else_LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"fi;;# The "-l" case would never come before the object being# linked, so don't bother handling this case.esacelseif test -z "$_LT_TAGVAR(postdeps, $1)"; then_LT_TAGVAR(postdeps, $1)="${prev}${p}"else_LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"fifi;;*.$objext)# This assumes that the test object file only shows up# once in the compiler output.if test "$p" = "conftest.$objext"; thenpre_test_object_deps_done=yescontinuefiif test "$pre_test_object_deps_done" = no; thenif test -z "$_LT_TAGVAR(predep_objects, $1)"; then_LT_TAGVAR(predep_objects, $1)="$p"else_LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"fielseif test -z "$_LT_TAGVAR(postdep_objects, $1)"; then_LT_TAGVAR(postdep_objects, $1)="$p"else_LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"fifi;;*) ;; # Ignore the rest.esacdone# Clean up.rm -f a.out a.exeelseecho "libtool.m4: error: problem compiling $1 test program"fi$RM -f confest.$objext# PORTME: override above test on systems where it is brokenm4_if([$1], [CXX],[case $host_os ininterix[[3-9]]*)# Interix 3.5 installs completely hosed .la files for C++, so rather than# hack all around it, let's just trust "g++" to DTRT._LT_TAGVAR(predep_objects,$1)=_LT_TAGVAR(postdep_objects,$1)=_LT_TAGVAR(postdeps,$1)=;;linux*)case `$CC -V 2>&1 | sed 5q` in*Sun\ C*)# Sun C++ 5.9# The more standards-conforming stlport4 library is# incompatible with the Cstd library. Avoid specifying# it if it's in CXXFLAGS. Ignore libCrun as# -library=stlport4 depends on it.case " $CXX $CXXFLAGS " in*" -library=stlport4 "*)solaris_use_stlport4=yes;;esacif test "$solaris_use_stlport4" != yes; then_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'fi;;esac;;solaris*)case $cc_basename inCC*)# The more standards-conforming stlport4 library is# incompatible with the Cstd library. Avoid specifying# it if it's in CXXFLAGS. Ignore libCrun as# -library=stlport4 depends on it.case " $CXX $CXXFLAGS " in*" -library=stlport4 "*)solaris_use_stlport4=yes;;esac# Adding this requires a known-good setup of shared libraries for# Sun compiler versions before 5.6, else PIC objects from an old# archive will be linked into the output, leading to subtle bugs.if test "$solaris_use_stlport4" != yes; then_LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'fi;;esac;;esac])case " $_LT_TAGVAR(postdeps, $1) " in*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;esac_LT_TAGVAR(compiler_lib_search_dirs, $1)=if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then_LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`fi_LT_TAGDECL([], [compiler_lib_search_dirs], [1],[The directories searched by this compiler when creating a shared library])_LT_TAGDECL([], [predep_objects], [1],[Dependencies to place before and after the objects being linked tocreate a shared library])_LT_TAGDECL([], [postdep_objects], [1])_LT_TAGDECL([], [predeps], [1])_LT_TAGDECL([], [postdeps], [1])_LT_TAGDECL([], [compiler_lib_search_path], [1],[The library search path used internally by the compiler when linkinga shared library])])# _LT_SYS_HIDDEN_LIBDEPS# _LT_PROG_F77# ------------# Since AC_PROG_F77 is broken, in that it returns the empty string# if there is no fortran compiler, we have our own version here.m4_defun([_LT_PROG_F77],[pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])AC_PROG_F77if test -z "$F77" || test "X$F77" = "Xno"; then_lt_disable_F77=yesfipopdef([AC_MSG_ERROR])])# _LT_PROG_F77dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([_LT_PROG_F77], [])# _LT_LANG_F77_CONFIG([TAG])# --------------------------# Ensure that the configuration variables for a Fortran 77 compiler are# suitably defined. These variables are subsequently used by _LT_CONFIG# to write the compiler configuration to `libtool'.m4_defun([_LT_LANG_F77_CONFIG],[AC_REQUIRE([_LT_PROG_F77])dnlAC_LANG_PUSH(Fortran 77)_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(allow_undefined_flag, $1)=_LT_TAGVAR(always_export_symbols, $1)=no_LT_TAGVAR(archive_expsym_cmds, $1)=_LT_TAGVAR(export_dynamic_flag_spec, $1)=_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_direct_absolute, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=_LT_TAGVAR(hardcode_libdir_separator, $1)=_LT_TAGVAR(hardcode_minus_L, $1)=no_LT_TAGVAR(hardcode_automatic, $1)=no_LT_TAGVAR(inherit_rpath, $1)=no_LT_TAGVAR(module_cmds, $1)=_LT_TAGVAR(module_expsym_cmds, $1)=_LT_TAGVAR(link_all_deplibs, $1)=unknown_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds_LT_TAGVAR(no_undefined_flag, $1)=_LT_TAGVAR(whole_archive_flag_spec, $1)=_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no# Source file extension for f77 test sources.ac_ext=f# Object file extension for compiled f77 test sources.objext=o_LT_TAGVAR(objext, $1)=$objext# No sense in running all these tests if we already determined that# the F77 compiler isn't working. Some variables (like enable_shared)# are currently assumed to apply to all compilers on this platform,# and will be corrupted by setting them based on a non-working compiler.if test "$_lt_disable_F77" != yes; then# Code to be used in simple compile testslt_simple_compile_test_code="\subroutine treturnend"# Code to be used in simple link testslt_simple_link_test_code="\program tend"# ltmain only uses $CC for tagged configurations so make sure $CC is set._LT_TAG_COMPILER# save warnings/boilerplate of simple test code_LT_COMPILER_BOILERPLATE_LT_LINKER_BOILERPLATE# Allow CC to be a program name with arguments.lt_save_CC="$CC"lt_save_GCC=$GCCCC=${F77-"f77"}compiler=$CC_LT_TAGVAR(compiler, $1)=$CC_LT_CC_BASENAME([$compiler])GCC=$G77if test -n "$compiler"; thenAC_MSG_CHECKING([if libtool supports shared libraries])AC_MSG_RESULT([$can_build_shared])AC_MSG_CHECKING([whether to build shared libraries])test "$can_build_shared" = "no" && enable_shared=no# On AIX, shared libraries and static libraries use the same namespace, and# are all built from PIC.case $host_os inaix3*)test "$enable_shared" = yes && enable_static=noif test -n "$RANLIB"; thenarchive_cmds="$archive_cmds~\$RANLIB \$lib"postinstall_cmds='$RANLIB $lib'fi;;aix[[4-9]]*)if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; thentest "$enable_shared" = yes && enable_static=nofi;;esacAC_MSG_RESULT([$enable_shared])AC_MSG_CHECKING([whether to build static libraries])# Make sure either enable_shared or enable_static is yes.test "$enable_shared" = yes || enable_static=yesAC_MSG_RESULT([$enable_static])_LT_TAGVAR(GCC, $1)="$G77"_LT_TAGVAR(LD, $1)="$LD"## CAVEAT EMPTOR:## There is no encapsulation within the following macros, do not change## the running order or otherwise move them around unless you know exactly## what you are doing..._LT_COMPILER_PIC($1)_LT_COMPILER_C_O($1)_LT_COMPILER_FILE_LOCKS($1)_LT_LINKER_SHLIBS($1)_LT_SYS_DYNAMIC_LINKER($1)_LT_LINKER_HARDCODE_LIBPATH($1)_LT_CONFIG($1)fi # test -n "$compiler"GCC=$lt_save_GCCCC="$lt_save_CC"fi # test "$_lt_disable_F77" != yesAC_LANG_POP])# _LT_LANG_F77_CONFIG# _LT_PROG_FC# -----------# Since AC_PROG_FC is broken, in that it returns the empty string# if there is no fortran compiler, we have our own version here.m4_defun([_LT_PROG_FC],[pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])AC_PROG_FCif test -z "$FC" || test "X$FC" = "Xno"; then_lt_disable_FC=yesfipopdef([AC_MSG_ERROR])])# _LT_PROG_FCdnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([_LT_PROG_FC], [])# _LT_LANG_FC_CONFIG([TAG])# -------------------------# Ensure that the configuration variables for a Fortran compiler are# suitably defined. These variables are subsequently used by _LT_CONFIG# to write the compiler configuration to `libtool'.m4_defun([_LT_LANG_FC_CONFIG],[AC_REQUIRE([_LT_PROG_FC])dnlAC_LANG_PUSH(Fortran)_LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(allow_undefined_flag, $1)=_LT_TAGVAR(always_export_symbols, $1)=no_LT_TAGVAR(archive_expsym_cmds, $1)=_LT_TAGVAR(export_dynamic_flag_spec, $1)=_LT_TAGVAR(hardcode_direct, $1)=no_LT_TAGVAR(hardcode_direct_absolute, $1)=no_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=_LT_TAGVAR(hardcode_libdir_separator, $1)=_LT_TAGVAR(hardcode_minus_L, $1)=no_LT_TAGVAR(hardcode_automatic, $1)=no_LT_TAGVAR(inherit_rpath, $1)=no_LT_TAGVAR(module_cmds, $1)=_LT_TAGVAR(module_expsym_cmds, $1)=_LT_TAGVAR(link_all_deplibs, $1)=unknown_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds_LT_TAGVAR(no_undefined_flag, $1)=_LT_TAGVAR(whole_archive_flag_spec, $1)=_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no# Source file extension for fc test sources.ac_ext=${ac_fc_srcext-f}# Object file extension for compiled fc test sources.objext=o_LT_TAGVAR(objext, $1)=$objext# No sense in running all these tests if we already determined that# the FC compiler isn't working. Some variables (like enable_shared)# are currently assumed to apply to all compilers on this platform,# and will be corrupted by setting them based on a non-working compiler.if test "$_lt_disable_FC" != yes; then# Code to be used in simple compile testslt_simple_compile_test_code="\subroutine treturnend"# Code to be used in simple link testslt_simple_link_test_code="\program tend"# ltmain only uses $CC for tagged configurations so make sure $CC is set._LT_TAG_COMPILER# save warnings/boilerplate of simple test code_LT_COMPILER_BOILERPLATE_LT_LINKER_BOILERPLATE# Allow CC to be a program name with arguments.lt_save_CC="$CC"lt_save_GCC=$GCCCC=${FC-"f95"}compiler=$CCGCC=$ac_cv_fc_compiler_gnu_LT_TAGVAR(compiler, $1)=$CC_LT_CC_BASENAME([$compiler])if test -n "$compiler"; thenAC_MSG_CHECKING([if libtool supports shared libraries])AC_MSG_RESULT([$can_build_shared])AC_MSG_CHECKING([whether to build shared libraries])test "$can_build_shared" = "no" && enable_shared=no# On AIX, shared libraries and static libraries use the same namespace, and# are all built from PIC.case $host_os inaix3*)test "$enable_shared" = yes && enable_static=noif test -n "$RANLIB"; thenarchive_cmds="$archive_cmds~\$RANLIB \$lib"postinstall_cmds='$RANLIB $lib'fi;;aix[[4-9]]*)if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; thentest "$enable_shared" = yes && enable_static=nofi;;esacAC_MSG_RESULT([$enable_shared])AC_MSG_CHECKING([whether to build static libraries])# Make sure either enable_shared or enable_static is yes.test "$enable_shared" = yes || enable_static=yesAC_MSG_RESULT([$enable_static])_LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"_LT_TAGVAR(LD, $1)="$LD"## CAVEAT EMPTOR:## There is no encapsulation within the following macros, do not change## the running order or otherwise move them around unless you know exactly## what you are doing..._LT_SYS_HIDDEN_LIBDEPS($1)_LT_COMPILER_PIC($1)_LT_COMPILER_C_O($1)_LT_COMPILER_FILE_LOCKS($1)_LT_LINKER_SHLIBS($1)_LT_SYS_DYNAMIC_LINKER($1)_LT_LINKER_HARDCODE_LIBPATH($1)_LT_CONFIG($1)fi # test -n "$compiler"GCC=$lt_save_GCCCC="$lt_save_CC"fi # test "$_lt_disable_FC" != yesAC_LANG_POP])# _LT_LANG_FC_CONFIG# _LT_LANG_GCJ_CONFIG([TAG])# --------------------------# Ensure that the configuration variables for the GNU Java Compiler compiler# are suitably defined. These variables are subsequently used by _LT_CONFIG# to write the compiler configuration to `libtool'.m4_defun([_LT_LANG_GCJ_CONFIG],[AC_REQUIRE([LT_PROG_GCJ])dnlAC_LANG_SAVE# Source file extension for Java test sources.ac_ext=java# Object file extension for compiled Java test sources.objext=o_LT_TAGVAR(objext, $1)=$objext# Code to be used in simple compile testslt_simple_compile_test_code="class foo {}"# Code to be used in simple link testslt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'# ltmain only uses $CC for tagged configurations so make sure $CC is set._LT_TAG_COMPILER# save warnings/boilerplate of simple test code_LT_COMPILER_BOILERPLATE_LT_LINKER_BOILERPLATE# Allow CC to be a program name with arguments.lt_save_CC="$CC"lt_save_GCC=$GCCGCC=yesCC=${GCJ-"gcj"}compiler=$CC_LT_TAGVAR(compiler, $1)=$CC_LT_TAGVAR(LD, $1)="$LD"_LT_CC_BASENAME([$compiler])# GCJ did not exist at the time GCC didn't implicitly link libc in._LT_TAGVAR(archive_cmds_need_lc, $1)=no_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmdsif test -n "$compiler"; then_LT_COMPILER_NO_RTTI($1)_LT_COMPILER_PIC($1)_LT_COMPILER_C_O($1)_LT_COMPILER_FILE_LOCKS($1)_LT_LINKER_SHLIBS($1)_LT_LINKER_HARDCODE_LIBPATH($1)_LT_CONFIG($1)fiAC_LANG_RESTOREGCC=$lt_save_GCCCC="$lt_save_CC"])# _LT_LANG_GCJ_CONFIG# _LT_LANG_RC_CONFIG([TAG])# -------------------------# Ensure that the configuration variables for the Windows resource compiler# are suitably defined. These variables are subsequently used by _LT_CONFIG# to write the compiler configuration to `libtool'.m4_defun([_LT_LANG_RC_CONFIG],[AC_REQUIRE([LT_PROG_RC])dnlAC_LANG_SAVE# Source file extension for RC test sources.ac_ext=rc# Object file extension for compiled RC test sources.objext=o_LT_TAGVAR(objext, $1)=$objext# Code to be used in simple compile testslt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'# Code to be used in simple link testslt_simple_link_test_code="$lt_simple_compile_test_code"# ltmain only uses $CC for tagged configurations so make sure $CC is set._LT_TAG_COMPILER# save warnings/boilerplate of simple test code_LT_COMPILER_BOILERPLATE_LT_LINKER_BOILERPLATE# Allow CC to be a program name with arguments.lt_save_CC="$CC"lt_save_GCC=$GCCGCC=CC=${RC-"windres"}compiler=$CC_LT_TAGVAR(compiler, $1)=$CC_LT_CC_BASENAME([$compiler])_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yesif test -n "$compiler"; then:_LT_CONFIG($1)fiGCC=$lt_save_GCCAC_LANG_RESTORECC="$lt_save_CC"])# _LT_LANG_RC_CONFIG# LT_PROG_GCJ# -----------AC_DEFUN([LT_PROG_GCJ],[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],[m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],[AC_CHECK_TOOL(GCJ, gcj,)test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"AC_SUBST(GCJFLAGS)])])[]dnl])# Old name:AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([LT_AC_PROG_GCJ], [])# LT_PROG_RC# ----------AC_DEFUN([LT_PROG_RC],[AC_CHECK_TOOL(RC, windres,)])# Old name:AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([LT_AC_PROG_RC], [])# _LT_DECL_EGREP# --------------# If we don't have a new enough Autoconf to choose the best grep# available, choose the one first in the user's PATH.m4_defun([_LT_DECL_EGREP],[AC_REQUIRE([AC_PROG_EGREP])dnlAC_REQUIRE([AC_PROG_FGREP])dnltest -z "$GREP" && GREP=grep_LT_DECL([], [GREP], [1], [A grep program that handles long lines])_LT_DECL([], [EGREP], [1], [An ERE matcher])_LT_DECL([], [FGREP], [1], [A literal string matcher])dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here tooAC_SUBST([GREP])])# _LT_DECL_SED# ------------# Check for a fully-functional sed program, that truncates# as few characters as possible. Prefer GNU sed if found.m4_defun([_LT_DECL_SED],[AC_PROG_SEDtest -z "$SED" && SED=sedXsed="$SED -e 1s/^X//"_LT_DECL([], [SED], [1], [A sed program that does not truncate output])_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],[Sed that helps us avoid accidentally triggering echo(1) options like -n])])# _LT_DECL_SEDm4_ifndef([AC_PROG_SED], [# NOTE: This macro has been submitted for inclusion into ## GNU Autoconf as AC_PROG_SED. When it is available in ## a released version of Autoconf we should remove this ## macro and use it instead. #m4_defun([AC_PROG_SED],[AC_MSG_CHECKING([for a sed that does not truncate output])AC_CACHE_VAL(lt_cv_path_SED,[# Loop through the user's path and test for sed and gsed.# Then use that list of sed's as ones to test for truncation.as_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for lt_ac_prog in sed gsed; dofor ac_exec_ext in '' $ac_executable_extensions; doif $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; thenlt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"fidonedonedoneIFS=$as_save_IFSlt_ac_max=0lt_ac_count=0# Add /usr/xpg4/bin/sed as it is typically found on Solaris# along with /bin/sed that truncates output.for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; dotest ! -f $lt_ac_sed && continuecat /dev/null > conftest.inlt_ac_count=0echo $ECHO_N "0123456789$ECHO_C" >conftest.in# Check for GNU sed and select it if it is found.if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; thenlt_cv_path_SED=$lt_ac_sedbreakfiwhile true; docat conftest.in conftest.in >conftest.tmpmv conftest.tmp conftest.incp conftest.in conftest.nlecho >>conftest.nl$lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || breakcmp -s conftest.out conftest.nl || break# 10000 chars as input seems more than enoughtest $lt_ac_count -gt 10 && breaklt_ac_count=`expr $lt_ac_count + 1`if test $lt_ac_count -gt $lt_ac_max; thenlt_ac_max=$lt_ac_countlt_cv_path_SED=$lt_ac_sedfidonedone])SED=$lt_cv_path_SEDAC_SUBST([SED])AC_MSG_RESULT([$SED])])#AC_PROG_SED])#m4_ifndef# Old name:AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([LT_AC_PROG_SED], [])# _LT_CHECK_SHELL_FEATURES# ------------------------# Find out whether the shell is Bourne or XSI compatible,# or has some other useful features.m4_defun([_LT_CHECK_SHELL_FEATURES],[AC_MSG_CHECKING([whether the shell understands some XSI constructs])# Try some XSI featuresxsi_shell=no( _lt_dummy="a/b/c"test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \= c,a/b,, \&& eval 'test $(( 1 + 1 )) -eq 2 \&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \&& xsi_shell=yesAC_MSG_RESULT([$xsi_shell])_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])AC_MSG_CHECKING([whether the shell understands "+="])lt_shell_append=no( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \>/dev/null 2>&1 \&& lt_shell_append=yesAC_MSG_RESULT([$lt_shell_append])_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; thenlt_unset=unsetelselt_unset=falsefi_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl# test EBCDIC or ASCIIcase `echo X|tr X '\101'` inA) # ASCII based system# \n is not interpreted correctly by Solaris 8 /usr/ucb/trlt_SP2NL='tr \040 \012'lt_NL2SP='tr \015\012 \040\040';;*) # EBCDIC based systemlt_SP2NL='tr \100 \n'lt_NL2SP='tr \r\n \100\100';;esac_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl])# _LT_CHECK_SHELL_FEATURES# _LT_PROG_XSI_SHELLFNS# ---------------------# Bourne and XSI compatible variants of some useful shell functions.m4_defun([_LT_PROG_XSI_SHELLFNS],[case $xsi_shell inyes)cat << \_LT_EOF >> "$cfgfile"# func_dirname file append nondir_replacement# Compute the dirname of FILE. If nonempty, add APPEND to the result,# otherwise set result to NONDIR_REPLACEMENT.func_dirname (){case ${1} in*/*) func_dirname_result="${1%/*}${2}" ;;* ) func_dirname_result="${3}" ;;esac}# func_basename filefunc_basename (){func_basename_result="${1##*/}"}# func_dirname_and_basename file append nondir_replacement# perform func_basename and func_dirname in a single function# call:# dirname: Compute the dirname of FILE. If nonempty,# add APPEND to the result, otherwise set result# to NONDIR_REPLACEMENT.# value returned in "$func_dirname_result"# basename: Compute filename of FILE.# value retuned in "$func_basename_result"# Implementation must be kept synchronized with func_dirname# and func_basename. For efficiency, we do not delegate to# those functions but instead duplicate the functionality here.func_dirname_and_basename (){case ${1} in*/*) func_dirname_result="${1%/*}${2}" ;;* ) func_dirname_result="${3}" ;;esacfunc_basename_result="${1##*/}"}# func_stripname prefix suffix name# strip PREFIX and SUFFIX off of NAME.# PREFIX and SUFFIX must not contain globbing or regex special# characters, hashes, percent signs, but SUFFIX may contain a leading# dot (in which case that matches only a dot).func_stripname (){# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are# positional parameters, so assign one to ordinary parameter first.func_stripname_result=${3}func_stripname_result=${func_stripname_result#"${1}"}func_stripname_result=${func_stripname_result%"${2}"}}# func_opt_splitfunc_opt_split (){func_opt_split_opt=${1%%=*}func_opt_split_arg=${1#*=}}# func_lo2o objectfunc_lo2o (){case ${1} in*.lo) func_lo2o_result=${1%.lo}.${objext} ;;*) func_lo2o_result=${1} ;;esac}# func_xform libobj-or-sourcefunc_xform (){func_xform_result=${1%.*}.lo}# func_arith arithmetic-term...func_arith (){func_arith_result=$(( $[*] ))}# func_len string# STRING may not start with a hyphen.func_len (){func_len_result=${#1}}_LT_EOF;;*) # Bourne compatible functions.cat << \_LT_EOF >> "$cfgfile"# func_dirname file append nondir_replacement# Compute the dirname of FILE. If nonempty, add APPEND to the result,# otherwise set result to NONDIR_REPLACEMENT.func_dirname (){# Extract subdirectory from the argument.func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`if test "X$func_dirname_result" = "X${1}"; thenfunc_dirname_result="${3}"elsefunc_dirname_result="$func_dirname_result${2}"fi}# func_basename filefunc_basename (){func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`}dnl func_dirname_and_basenamednl A portable version of this function is already defined in general.m4shdnl so there is no need for it here.# func_stripname prefix suffix name# strip PREFIX and SUFFIX off of NAME.# PREFIX and SUFFIX must not contain globbing or regex special# characters, hashes, percent signs, but SUFFIX may contain a leading# dot (in which case that matches only a dot).# func_strip_suffix prefix namefunc_stripname (){case ${2} in.*) func_stripname_result=`$ECHO "X${3}" \| $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;*) func_stripname_result=`$ECHO "X${3}" \| $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;esac}# sed scripts:my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'my_sed_long_arg='1s/^-[[^=]]*=//'# func_opt_splitfunc_opt_split (){func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`}# func_lo2o objectfunc_lo2o (){func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`}# func_xform libobj-or-sourcefunc_xform (){func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`}# func_arith arithmetic-term...func_arith (){func_arith_result=`expr "$[@]"`}# func_len string# STRING may not start with a hyphen.func_len (){func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`}_LT_EOFesaccase $lt_shell_append inyes)cat << \_LT_EOF >> "$cfgfile"# func_append var value# Append VALUE to the end of shell variable VAR.func_append (){eval "$[1]+=\$[2]"}_LT_EOF;;*)cat << \_LT_EOF >> "$cfgfile"# func_append var value# Append VALUE to the end of shell variable VAR.func_append (){eval "$[1]=\$$[1]\$[2]"}_LT_EOF;;esac])# Helper functions for option handling. -*- Autoconf -*-## Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.# Written by Gary V. Vaughan, 2004## This file is free software; the Free Software Foundation gives# unlimited permission to copy and/or distribute it, with or without# modifications, as long as this notice is preserved.# serial 6 ltoptions.m4# This is to help aclocal find these macros, as it can't see m4_define.AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)# ------------------------------------------m4_define([_LT_MANGLE_OPTION],[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)# ---------------------------------------# Set option OPTION-NAME for macro MACRO-NAME, and if there is a# matching handler defined, dispatch to it. Other OPTION-NAMEs are# saved as a flag.m4_define([_LT_SET_OPTION],[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnlm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),_LT_MANGLE_DEFUN([$1], [$2]),[m4_warning([Unknown $1 option `$2'])])[]dnl])# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])# ------------------------------------------------------------# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.m4_define([_LT_IF_OPTION],[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)# -------------------------------------------------------# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME# are set.m4_define([_LT_UNLESS_OPTIONS],[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),[m4_define([$0_found])])])[]dnlm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3])[]dnl])# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)# ----------------------------------------# OPTION-LIST is a space-separated list of Libtool options associated# with MACRO-NAME. If any OPTION has a matching handler declared with# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about# the unknown option and exit.m4_defun([_LT_SET_OPTIONS],[# Set optionsm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),[_LT_SET_OPTION([$1], _LT_Option)])m4_if([$1],[LT_INIT],[dnldnl Simply set some default values (i.e off) if boolean options were notdnl specified:_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no])_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no])dnldnl If no reference was made to various pairs of opposing options, thendnl we run the default mode handler for the pair. For example, if neitherdnl `shared' nor `disable-shared' was passed, we enable building of shareddnl archives by default:_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],[_LT_ENABLE_FAST_INSTALL])])])# _LT_SET_OPTIONS# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)# -----------------------------------------m4_define([_LT_MANGLE_DEFUN],[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)# -----------------------------------------------m4_define([LT_OPTION_DEFINE],[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl])# LT_OPTION_DEFINE# dlopen# ------LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes])AU_DEFUN([AC_LIBTOOL_DLOPEN],[_LT_SET_OPTION([LT_INIT], [dlopen])AC_DIAGNOSE([obsolete],[$0: Remove this warning and the call to _LT_SET_OPTION when youput the `dlopen' option into LT_INIT's first parameter.])])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])# win32-dll# ---------# Declare package support for building win32 dll's.LT_OPTION_DEFINE([LT_INIT], [win32-dll],[enable_win32_dll=yescase $host in*-*-cygwin* | *-*-mingw* | *-*-pw32*)AC_CHECK_TOOL(AS, as, false)AC_CHECK_TOOL(DLLTOOL, dlltool, false)AC_CHECK_TOOL(OBJDUMP, objdump, false);;esactest -z "$AS" && AS=as_LT_DECL([], [AS], [0], [Assembler program])dnltest -z "$DLLTOOL" && DLLTOOL=dlltool_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnltest -z "$OBJDUMP" && OBJDUMP=objdump_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl])# win32-dllAU_DEFUN([AC_LIBTOOL_WIN32_DLL],[AC_REQUIRE([AC_CANONICAL_HOST])dnl_LT_SET_OPTION([LT_INIT], [win32-dll])AC_DIAGNOSE([obsolete],[$0: Remove this warning and the call to _LT_SET_OPTION when youput the `win32-dll' option into LT_INIT's first parameter.])])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])# _LT_ENABLE_SHARED([DEFAULT])# ----------------------------# implement the --enable-shared flag, and supports the `shared' and# `disable-shared' LT_INIT options.# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.m4_define([_LT_ENABLE_SHARED],[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnlAC_ARG_ENABLE([shared],[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],[p=${PACKAGE-default}case $enableval inyes) enable_shared=yes ;;no) enable_shared=no ;;*)enable_shared=no# Look at the argument we got. We use all the common list separators.lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"for pkg in $enableval; doIFS="$lt_save_ifs"if test "X$pkg" = "X$p"; thenenable_shared=yesfidoneIFS="$lt_save_ifs";;esac],[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)_LT_DECL([build_libtool_libs], [enable_shared], [0],[Whether or not to build shared libraries])])# _LT_ENABLE_SHAREDLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])# Old names:AC_DEFUN([AC_ENABLE_SHARED],[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])])AC_DEFUN([AC_DISABLE_SHARED],[_LT_SET_OPTION([LT_INIT], [disable-shared])])AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AM_ENABLE_SHARED], [])dnl AC_DEFUN([AM_DISABLE_SHARED], [])# _LT_ENABLE_STATIC([DEFAULT])# ----------------------------# implement the --enable-static flag, and support the `static' and# `disable-static' LT_INIT options.# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.m4_define([_LT_ENABLE_STATIC],[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnlAC_ARG_ENABLE([static],[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],[p=${PACKAGE-default}case $enableval inyes) enable_static=yes ;;no) enable_static=no ;;*)enable_static=no# Look at the argument we got. We use all the common list separators.lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"for pkg in $enableval; doIFS="$lt_save_ifs"if test "X$pkg" = "X$p"; thenenable_static=yesfidoneIFS="$lt_save_ifs";;esac],[enable_static=]_LT_ENABLE_STATIC_DEFAULT)_LT_DECL([build_old_libs], [enable_static], [0],[Whether or not to build static libraries])])# _LT_ENABLE_STATICLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])# Old names:AC_DEFUN([AC_ENABLE_STATIC],[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])])AC_DEFUN([AC_DISABLE_STATIC],[_LT_SET_OPTION([LT_INIT], [disable-static])])AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AM_ENABLE_STATIC], [])dnl AC_DEFUN([AM_DISABLE_STATIC], [])# _LT_ENABLE_FAST_INSTALL([DEFAULT])# ----------------------------------# implement the --enable-fast-install flag, and support the `fast-install'# and `disable-fast-install' LT_INIT options.# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.m4_define([_LT_ENABLE_FAST_INSTALL],[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnlAC_ARG_ENABLE([fast-install],[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],[p=${PACKAGE-default}case $enableval inyes) enable_fast_install=yes ;;no) enable_fast_install=no ;;*)enable_fast_install=no# Look at the argument we got. We use all the common list separators.lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"for pkg in $enableval; doIFS="$lt_save_ifs"if test "X$pkg" = "X$p"; thenenable_fast_install=yesfidoneIFS="$lt_save_ifs";;esac],[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)_LT_DECL([fast_install], [enable_fast_install], [0],[Whether or not to optimize for fast installation])dnl])# _LT_ENABLE_FAST_INSTALLLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])# Old names:AU_DEFUN([AC_ENABLE_FAST_INSTALL],[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])AC_DIAGNOSE([obsolete],[$0: Remove this warning and the call to _LT_SET_OPTION when you putthe `fast-install' option into LT_INIT's first parameter.])])AU_DEFUN([AC_DISABLE_FAST_INSTALL],[_LT_SET_OPTION([LT_INIT], [disable-fast-install])AC_DIAGNOSE([obsolete],[$0: Remove this warning and the call to _LT_SET_OPTION when you putthe `disable-fast-install' option into LT_INIT's first parameter.])])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])# _LT_WITH_PIC([MODE])# --------------------# implement the --with-pic flag, and support the `pic-only' and `no-pic'# LT_INIT options.# MODE is either `yes' or `no'. If omitted, it defaults to `both'.m4_define([_LT_WITH_PIC],[AC_ARG_WITH([pic],[AS_HELP_STRING([--with-pic],[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],[pic_mode="$withval"],[pic_mode=default])test -z "$pic_mode" && pic_mode=m4_default([$1], [default])_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl])# _LT_WITH_PICLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])# Old name:AU_DEFUN([AC_LIBTOOL_PICMODE],[_LT_SET_OPTION([LT_INIT], [pic-only])AC_DIAGNOSE([obsolete],[$0: Remove this warning and the call to _LT_SET_OPTION when youput the `pic-only' option into LT_INIT's first parameter.])])dnl aclocal-1.4 backwards compatibility:dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])m4_define([_LTDL_MODE], [])LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],[m4_define([_LTDL_MODE], [nonrecursive])])LT_OPTION_DEFINE([LTDL_INIT], [recursive],[m4_define([_LTDL_MODE], [recursive])])LT_OPTION_DEFINE([LTDL_INIT], [subproject],[m4_define([_LTDL_MODE], [subproject])])m4_define([_LTDL_TYPE], [])LT_OPTION_DEFINE([LTDL_INIT], [installable],[m4_define([_LTDL_TYPE], [installable])])LT_OPTION_DEFINE([LTDL_INIT], [convenience],[m4_define([_LTDL_TYPE], [convenience])])# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-## Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.# Written by Gary V. Vaughan, 2004## This file is free software; the Free Software Foundation gives# unlimited permission to copy and/or distribute it, with or without# modifications, as long as this notice is preserved.# serial 5 ltsugar.m4# This is to help aclocal find these macros, as it can't see m4_define.AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])# lt_join(SEP, ARG1, [ARG2...])# -----------------------------# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their# associated separator.# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier# versions in m4sugar had bugs.m4_define([lt_join],[m4_if([$#], [1], [],[$#], [2], [[$2]],[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])m4_define([_lt_join],[m4_if([$#$2], [2], [],[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])# lt_car(LIST)# lt_cdr(LIST)# ------------# Manipulate m4 lists.# These macros are necessary as long as will still need to support# Autoconf-2.59 which quotes differently.m4_define([lt_car], [[$1]])m4_define([lt_cdr],[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],[$#], 1, [],[m4_dquote(m4_shift($@))])])m4_define([lt_unquote], $1)# lt_append(MACRO-NAME, STRING, [SEPARATOR])# ------------------------------------------# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.# Note that neither SEPARATOR nor STRING are expanded; they are appended# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).# No SEPARATOR is output if MACRO-NAME was previously undefined (different# than defined and empty).## This macro is needed until we can rely on Autoconf 2.62, since earlier# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.m4_define([lt_append],[m4_define([$1],m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])# ----------------------------------------------------------# Produce a SEP delimited list of all paired combinations of elements of# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list# has the form PREFIXmINFIXSUFFIXn.m4_define([lt_combine],[m4_if([$2], [], [],[m4_if([$4], [], [],[lt_join(m4_quote(m4_default([$1], [[, ]])),lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2],[m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]),[_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl])# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])# -----------------------------------------------------------------------# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.m4_define([lt_if_append_uniq],[m4_ifdef([$1],[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],[lt_append([$1], [$2], [$3])$4],[$5])],[lt_append([$1], [$2], [$3])$4])])# lt_dict_add(DICT, KEY, VALUE)# -----------------------------m4_define([lt_dict_add],[m4_define([$1($2)], [$3])])# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)# --------------------------------------------m4_define([lt_dict_add_subkey],[m4_define([$1($2:$3)], [$4])])# lt_dict_fetch(DICT, KEY, [SUBKEY])# ----------------------------------m4_define([lt_dict_fetch],[m4_ifval([$3],m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])# -----------------------------------------------------------------m4_define([lt_if_dict_fetch],[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],[$5],[$6])])# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])# --------------------------------------------------------------m4_define([lt_dict_filter],[m4_if([$5], [], [],[lt_join(m4_quote(m4_default([$4], [[, ]])),lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl])# ltversion.m4 -- version numbers -*- Autoconf -*-## Copyright (C) 2004 Free Software Foundation, Inc.# Written by Scott James Remnant, 2004## This file is free software; the Free Software Foundation gives# unlimited permission to copy and/or distribute it, with or without# modifications, as long as this notice is preserved.# Generated from ltversion.in.# serial 2976 ltversion.m4# This file is part of GNU Libtoolm4_define([LT_PACKAGE_VERSION], [2.2.4])m4_define([LT_PACKAGE_REVISION], [1.2976])AC_DEFUN([LTVERSION_VERSION],[macro_version='2.2.4'macro_revision='1.2976'_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])_LT_DECL(, macro_revision, 0)])# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-## Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.# Written by Scott James Remnant, 2004.## This file is free software; the Free Software Foundation gives# unlimited permission to copy and/or distribute it, with or without# modifications, as long as this notice is preserved.# serial 4 lt~obsolete.m4# These exist entirely to fool aclocal when bootstrapping libtool.## In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)# which have later been changed to m4_define as they aren't part of the# exported API, or moved to Autoconf or Automake where they belong.## The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us# using a macro with the same name in our local m4/libtool.m4 it'll# pull the old libtool.m4 in (it doesn't see our shiny new m4_define# and doesn't know about Autoconf macros at all.)## So we provide this file, which has a silly filename so it's always# included after everything else. This provides aclocal with the# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything# because those macros already exist, or will be overwritten later.# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.## Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.# Yes, that means every name once taken will need to remain here until# we give up compatibility with versions before 1.7, at which point# we need to keep only those names which we still refer to.# This is to help aclocal find these macros, as it can't see m4_define.AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# AM_AUTOMAKE_VERSION(VERSION)# ----------------------------# Automake X.Y traces this macro to ensure aclocal.m4 has been# generated from the m4 files accompanying Automake X.Y.# (This private macro should not be called outside this file.)AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version='1.10'dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way todnl require some minimum version. Point them to the right macro.m4_if([$1], [1.10], [],[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl])# _AM_AUTOCONF_VERSION(VERSION)# -----------------------------# aclocal traces this macro to find the Autoconf version.# This is a private macro too. Using m4_define simplifies# the logic in aclocal, which can simply ignore this definition.m4_define([_AM_AUTOCONF_VERSION], [])# AM_SET_CURRENT_AUTOMAKE_VERSION# -------------------------------# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],[AM_AUTOMAKE_VERSION([1.10])dnl_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])# AM_AUX_DIR_EXPAND -*- Autoconf -*-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to# `$srcdir', `$srcdir/..', or `$srcdir/../..'.## Of course, Automake must honor this variable whenever it calls a# tool from the auxiliary directory. The problem is that $srcdir (and# therefore $ac_aux_dir as well) can be either absolute or relative,# depending on how configure is run. This is pretty annoying, since# it makes $ac_aux_dir quite unusable in subdirectories: in the top# source directory, any form will work fine, but in subdirectories a# relative path needs to be adjusted first.## $ac_aux_dir/missing# fails when called from a subdirectory if $ac_aux_dir is relative# $top_srcdir/$ac_aux_dir/missing# fails if $ac_aux_dir is absolute,# fails when called from a subdirectory in a VPATH build with# a relative $ac_aux_dir## The reason of the latter failure is that $top_srcdir and $ac_aux_dir# are both prefixed by $srcdir. In an in-source build this is usually# harmless because $srcdir is `.', but things will broke when you# start a VPATH build or use an absolute $srcdir.## So we could use something similar to $top_srcdir/$ac_aux_dir/missing,# iff we strip the leading $srcdir from $ac_aux_dir. That would be:# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`# and then we would define $MISSING as# MISSING="\${SHELL} $am_aux_dir/missing"# This will work as long as MISSING is not called from configure, because# unfortunately $(top_srcdir) has no meaning in configure.# However there are other variables, like CC, which are often used in# configure, and could therefore not use this "fixed" $ac_aux_dir.## Another solution, used here, is to always expand $ac_aux_dir to an# absolute PATH. The drawback is that using absolute paths prevent a# configured tree to be moved without reconfiguration.AC_DEFUN([AM_AUX_DIR_EXPAND],[dnl Rely on autoconf to set up CDPATH properly.AC_PREREQ([2.50])dnl# expand $ac_aux_dir to an absolute patham_aux_dir=`cd $ac_aux_dir && pwd`])# AM_CONDITIONAL -*- Autoconf -*-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006# Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 8# AM_CONDITIONAL(NAME, SHELL-CONDITION)# -------------------------------------# Define a conditional.AC_DEFUN([AM_CONDITIONAL],[AC_PREREQ(2.52)dnlifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnlAC_SUBST([$1_TRUE])dnlAC_SUBST([$1_FALSE])dnl_AM_SUBST_NOTMAKE([$1_TRUE])dnl_AM_SUBST_NOTMAKE([$1_FALSE])dnlif $2; then$1_TRUE=$1_FALSE='#'else$1_TRUE='#'$1_FALSE=fiAC_CONFIG_COMMANDS_PRE([if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; thenAC_MSG_ERROR([[conditional "$1" was never defined.Usually this means the macro was only invoked conditionally.]])fi])])# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006# Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 9# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be# written in clear, in which case automake, when reading aclocal.m4,# will think it sees a *use*, and therefore will trigger all it's# C support machinery. Also note that it means that autoscan, seeing# CC etc. in the Makefile, will ask for an AC_PROG_CC use...# _AM_DEPENDENCIES(NAME)# ----------------------# See how the compiler implements dependency checking.# NAME is "CC", "CXX", "GCJ", or "OBJC".# We try a few techniques and use that to set a single cache variable.## We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular# dependency, and given that the user is not expected to run this macro,# just rely on AC_PROG_CC.AC_DEFUN([_AM_DEPENDENCIES],[AC_REQUIRE([AM_SET_DEPDIR])dnlAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnlAC_REQUIRE([AM_MAKE_INCLUDE])dnlAC_REQUIRE([AM_DEP_TRACK])dnlifelse([$1], CC, [depcc="$CC" am_compiler_list=],[$1], CXX, [depcc="$CXX" am_compiler_list=],[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],[$1], UPC, [depcc="$UPC" am_compiler_list=],[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],[depcc="$$1" am_compiler_list=])AC_CACHE_CHECK([dependency style of $depcc],[am_cv_$1_dependencies_compiler_type],[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then# We make a subdir and do the tests there. Otherwise we can end up# making bogus files that we don't know about and never remove. For# instance it was reported that on HP-UX the gcc test will end up# making a dummy file named `D' -- because `-MD' means `put the output# in D'.mkdir conftest.dir# Copy depcomp to subdir because otherwise we won't find it if we're# using a relative directory.cp "$am_depcomp" conftest.dircd conftest.dir# We will build objects and dependencies in a subdirectory because# it helps to detect inapplicable dependency modes. For instance# both Tru64's cc and ICC support -MD to output dependencies as a# side effect of compilation, but ICC will put the dependencies in# the current directory while Tru64 will put them in the object# directory.mkdir subam_cv_$1_dependencies_compiler_type=noneif test "$am_compiler_list" = ""; thenam_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`fifor depmode in $am_compiler_list; do# Setup a source with many dependencies, because some compilers# like to wrap large dependency lists on column 80 (with \), and# we should not choose a depcomp mode which is confused by this.## We need to recreate these files for each test, as the compiler may# overwrite some of them when testing with obscure command lines.# This happens at least with the AIX C compiler.: > sub/conftest.cfor i in 1 2 3 4 5 6; doecho '#include "conftst'$i'.h"' >> sub/conftest.c# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with# Solaris 8's {/usr,}/bin/sh.touch sub/conftst$i.hdoneecho "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmfcase $depmode innosideeffect)# after this tag, mechanisms are not by side-effect, so they'll# only be used when explicitly requestedif test "x$enable_dependency_tracking" = xyes; thencontinueelsebreakfi;;none) break ;;esac# We check with `-c' and `-o' for the sake of the "dashmstdout"# mode. It turns out that the SunPro C++ compiler does not properly# handle `-M -o', and we need to detect this.if depmode=$depmode \source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \>/dev/null 2>conftest.err &&grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&${MAKE-make} -s -f confmf > /dev/null 2>&1; then# icc doesn't choke on unknown options, it will just issue warnings# or remarks (even with -Werror). So we grep stderr for any message# that says an option was ignored or not supported.# When given -MP, icc 7.0 and 7.1 complain thusly:# icc: Command line warning: ignoring option '-M'; no argument required# The diagnosis changed in icc 8.0:# icc: Command line remark: option '-MP' not supportedif (grep 'ignoring option' conftest.err ||grep 'not supported' conftest.err) >/dev/null 2>&1; then :; elseam_cv_$1_dependencies_compiler_type=$depmodebreakfifidonecd ..rm -rf conftest.direlseam_cv_$1_dependencies_compiler_type=nonefi])AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])AM_CONDITIONAL([am__fastdep$1], [test "x$enable_dependency_tracking" != xno \&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])])# AM_SET_DEPDIR# -------------# Choose a directory name for dependency files.# This macro is AC_REQUIREd in _AM_DEPENDENCIESAC_DEFUN([AM_SET_DEPDIR],[AC_REQUIRE([AM_SET_LEADING_DOT])dnlAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl])# AM_DEP_TRACK# ------------AC_DEFUN([AM_DEP_TRACK],[AC_ARG_ENABLE(dependency-tracking,[ --disable-dependency-tracking speeds up one-time build--enable-dependency-tracking do not reject slow dependency extractors])if test "x$enable_dependency_tracking" != xno; thenam_depcomp="$ac_aux_dir/depcomp"AMDEPBACKSLASH='\'fiAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])AC_SUBST([AMDEPBACKSLASH])dnl_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl])# Generate code to set up dependency tracking. -*- Autoconf -*-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005# Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.#serial 3# _AM_OUTPUT_DEPENDENCY_COMMANDS# ------------------------------AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],[for mf in $CONFIG_FILES; do# Strip MF so we end up with the name of the file.mf=`echo "$mf" | sed -e 's/:.*$//'`# Check whether this is an Automake generated Makefile or not.# We used to match only the files named `Makefile.in', but# some people rename them; so instead we look at the file content.# Grep'ing the first line is not enough: some people post-process# each Makefile.in and add a new line on top of each file to say so.# Grep'ing the whole file is not good either: AIX grep has a line# limit of 2048, but all sed's we know have understand at least 4000.if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; thendirpart=`AS_DIRNAME("$mf")`elsecontinuefi# Extract the definition of DEPDIR, am__include, and am__quote# from the Makefile without running `make'.DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`test -z "$DEPDIR" && continueam__include=`sed -n 's/^am__include = //p' < "$mf"`test -z "am__include" && continueam__quote=`sed -n 's/^am__quote = //p' < "$mf"`# When using ansi2knr, U may be empty or an underscore; expand itU=`sed -n 's/^U = //p' < "$mf"`# Find all dependency output files, they are included files with# $(DEPDIR) in their names. We invoke sed twice because it is the# simplest approach to changing $(DEPDIR) to its actual value in the# expansion.for file in `sed -n "s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do# Make sure the directory exists.test -f "$dirpart/$file" && continuefdir=`AS_DIRNAME(["$file"])`AS_MKDIR_P([$dirpart/$fdir])# echo "creating $dirpart/$file"echo '# dummy' > "$dirpart/$file"donedone])# _AM_OUTPUT_DEPENDENCY_COMMANDS# AM_OUTPUT_DEPENDENCY_COMMANDS# -----------------------------# This macro should only be invoked once -- use via AC_REQUIRE.## This code is only required when automatic dependency tracking# is enabled. FIXME. This creates each `.P' file that we will# need in order to bootstrap the dependency handling code.AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[AC_CONFIG_COMMANDS([depfiles],[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])])# Do all the work for Automake. -*- Autoconf -*-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,# 2005, 2006 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 12# This macro actually does too much. Some checks are only needed if# your package does certain things. But this isn't really a big deal.# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])# AM_INIT_AUTOMAKE([OPTIONS])# -----------------------------------------------# The call with PACKAGE and VERSION arguments is the old style# call (pre autoconf-2.50), which is being phased out. PACKAGE# and VERSION should now be passed to AC_INIT and removed from# the call to AM_INIT_AUTOMAKE.# We support both call styles for the transition. After# the next Automake release, Autoconf can make the AC_INIT# arguments mandatory, and then we can depend on a new Autoconf# release and drop the old call support.AC_DEFUN([AM_INIT_AUTOMAKE],[AC_PREREQ([2.60])dnldnl Autoconf wants to disallow AM_ names. We explicitly allowdnl the ones we care about.m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnlAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnlAC_REQUIRE([AC_PROG_INSTALL])dnlif test "`cd $srcdir && pwd`" != "`pwd`"; then# Use -I$(srcdir) only when $(srcdir) != ., so that make's output# is not polluted with repeated "-I."AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl# test to see if srcdir already configuredif test -f $srcdir/config.status; thenAC_MSG_ERROR([source directory already configured; run "make distclean" there first])fifi# test whether we have cygpathif test -z "$CYGPATH_W"; thenif (cygpath --version) >/dev/null 2>/dev/null; thenCYGPATH_W='cygpath -w'elseCYGPATH_W=echofifiAC_SUBST([CYGPATH_W])# Define the identity of the package.dnl Distinguish between old-style and new-style calls.m4_ifval([$2],[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnlAC_SUBST([PACKAGE], [$1])dnlAC_SUBST([VERSION], [$2])],[_AM_SET_OPTIONS([$1])dnldnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,[m4_fatal([AC_INIT should be called with package and version arguments])])dnlAC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnlAC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl_AM_IF_OPTION([no-define],,[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl# Some tools Automake needs.AC_REQUIRE([AM_SANITY_CHECK])dnlAC_REQUIRE([AC_ARG_PROGRAM])dnlAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})AM_MISSING_PROG(AUTOCONF, autoconf)AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})AM_MISSING_PROG(AUTOHEADER, autoheader)AM_MISSING_PROG(MAKEINFO, makeinfo)AM_PROG_INSTALL_SHAM_PROG_INSTALL_STRIPAC_REQUIRE([AM_PROG_MKDIR_P])dnl# We need awk for the "check" target. The system "awk" is bad on# some platforms.AC_REQUIRE([AC_PROG_AWK])dnlAC_REQUIRE([AC_PROG_MAKE_SET])dnlAC_REQUIRE([AM_SET_LEADING_DOT])dnl_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],[_AM_PROG_TAR([v7])])])_AM_IF_OPTION([no-dependencies],,[AC_PROVIDE_IFELSE([AC_PROG_CC],[_AM_DEPENDENCIES(CC)],[define([AC_PROG_CC],defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnlAC_PROVIDE_IFELSE([AC_PROG_CXX],[_AM_DEPENDENCIES(CXX)],[define([AC_PROG_CXX],defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnlAC_PROVIDE_IFELSE([AC_PROG_OBJC],[_AM_DEPENDENCIES(OBJC)],[define([AC_PROG_OBJC],defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl])])# When config.status generates a header, we must update the stamp-h file.# This file resides in the same directory as the config header# that is generated. The stamp files are numbered to have different names.# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the# loop where config.status creates the headers, so we can generate# our stamp files there.AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],[# Compute $1's index in $config_headers._am_stamp_count=1for _am_header in $config_headers :; docase $_am_header in$1 | $1:* )break ;;* )_am_stamp_count=`expr $_am_stamp_count + 1` ;;esacdoneecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# AM_PROG_INSTALL_SH# ------------------# Define $install_sh.AC_DEFUN([AM_PROG_INSTALL_SH],[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnlinstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}AC_SUBST(install_sh)])# Copyright (C) 2003, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 2# Check whether the underlying file-system supports filenames# with a leading dot. For instance MS-DOS doesn't.AC_DEFUN([AM_SET_LEADING_DOT],[rm -rf .tst 2>/dev/nullmkdir .tst 2>/dev/nullif test -d .tst; thenam__leading_dot=.elseam__leading_dot=_firmdir .tst 2>/dev/nullAC_SUBST([am__leading_dot])])# Check to see how 'make' treats includes. -*- Autoconf -*-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 3# AM_MAKE_INCLUDE()# -----------------# Check to see how make treats includes.AC_DEFUN([AM_MAKE_INCLUDE],[am_make=${MAKE-make}cat > confinc << 'END'am__doit:@echo done.PHONY: am__doitEND# If we don't find an include directive, just comment out the code.AC_MSG_CHECKING([for style of include used by $am_make])am__include="#"am__quote=_am_result=none# First try GNU make style include.echo "include confinc" > confmf# We grep out `Entering directory' and `Leaving directory'# messages which can occur if `w' ends up in MAKEFLAGS.# In particular we don't look at `^make:' because GNU make might# be invoked under some other name (usually "gmake"), in which# case it prints its new name instead of `make'.if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; thenam__include=includeam__quote=_am_result=GNUfi# Now try BSD make style include.if test "$am__include" = "#"; thenecho '.include "confinc"' > confmfif test "`$am_make -s -f confmf 2> /dev/null`" = "done"; thenam__include=.includeam__quote="\""_am_result=BSDfifiAC_SUBST([am__include])AC_SUBST([am__quote])AC_MSG_RESULT([$_am_result])rm -f confinc confmf])# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005# Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 5# AM_MISSING_PROG(NAME, PROGRAM)# ------------------------------AC_DEFUN([AM_MISSING_PROG],[AC_REQUIRE([AM_MISSING_HAS_RUN])$1=${$1-"${am_missing_run}$2"}AC_SUBST($1)])# AM_MISSING_HAS_RUN# ------------------# Define MISSING if not defined so far and test if it supports --run.# If it does, set am_missing_run to use it, otherwise, to nothing.AC_DEFUN([AM_MISSING_HAS_RUN],[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnlAC_REQUIRE_AUX_FILE([missing])dnltest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"# Use eval to expand $SHELLif eval "$MISSING --run true"; thenam_missing_run="$MISSING --run "elseam_missing_run=AC_MSG_WARN([`missing' script is too old or missing])fi])# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# AM_PROG_MKDIR_P# ---------------# Check for `mkdir -p'.AC_DEFUN([AM_PROG_MKDIR_P],[AC_PREREQ([2.60])dnlAC_REQUIRE([AC_PROG_MKDIR_P])dnldnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,dnl while keeping a definition of mkdir_p for backward compatibility.dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake ofdnl Makefile.ins that do not define MKDIR_P, so we do our owndnl adjustment using top_builddir (which is defined more often thandnl MKDIR_P).AC_SUBST([mkdir_p], ["$MKDIR_P"])dnlcase $mkdir_p in[[\\/$]]* | ?:[[\\/]]*) ;;*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;esac])# Helper functions for option handling. -*- Autoconf -*-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 3# _AM_MANGLE_OPTION(NAME)# -----------------------AC_DEFUN([_AM_MANGLE_OPTION],[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])# _AM_SET_OPTION(NAME)# ------------------------------# Set option NAME. Presently that only means defining a flag for this option.AC_DEFUN([_AM_SET_OPTION],[m4_define(_AM_MANGLE_OPTION([$1]), 1)])# _AM_SET_OPTIONS(OPTIONS)# ----------------------------------# OPTIONS is a space-separated list of Automake options.AC_DEFUN([_AM_SET_OPTIONS],[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])# -------------------------------------------# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.AC_DEFUN([_AM_IF_OPTION],[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])# Check to make sure that the build environment is sane. -*- Autoconf -*-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005# Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 4# AM_SANITY_CHECK# ---------------AC_DEFUN([AM_SANITY_CHECK],[AC_MSG_CHECKING([whether build environment is sane])# Just in casesleep 1echo timestamp > conftest.file# Do `set' in a subshell so we don't clobber the current shell's# arguments. Must try -L first in case configure is actually a# symlink; some systems play weird games with the mod time of symlinks# (eg FreeBSD returns the mod time of the symlink's containing# directory).if (set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`if test "$[*]" = "X"; then# -L didn't work.set X `ls -t $srcdir/configure conftest.file`firm -f conftest.fileif test "$[*]" != "X $srcdir/configure conftest.file" \&& test "$[*]" != "X conftest.file $srcdir/configure"; then# If neither matched, then we have a broken ls. This can happen# if, for instance, CONFIG_SHELL is bash and it inherits a# broken ls alias from the environment. This has actually# happened. Such a system could not be considered "sane".AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a brokenalias in your environment])fitest "$[2]" = conftest.file)then# Ok.:elseAC_MSG_ERROR([newly created file is older than distributed files!Check your system clock])fiAC_MSG_RESULT(yes)])# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# AM_PROG_INSTALL_STRIP# ---------------------# One issue with vendor `install' (even GNU) is that you can't# specify the program used to strip binaries. This is especially# annoying in cross-compiling environments, where the build's strip# is unlikely to handle the host's binaries.# Fortunately install-sh will honor a STRIPPROG variable, so we# always use install-sh in `make install-strip', and initialize# STRIPPROG with the value of the STRIP variable (set by the user).AC_DEFUN([AM_PROG_INSTALL_STRIP],[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl# Installed binaries are usually stripped using `strip' when the user# run `make install-strip'. However `strip' might not be the right# tool to use in cross-compilation environments, therefore Automake# will honor the `STRIP' environment variable to overrule this program.dnl Don't test for $cross_compiling = yes, because it might be `maybe'.if test "$cross_compiling" != no; thenAC_CHECK_TOOL([STRIP], [strip], :)fiINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"AC_SUBST([INSTALL_STRIP_PROGRAM])])# Copyright (C) 2006 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# _AM_SUBST_NOTMAKE(VARIABLE)# ---------------------------# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.# This macro is traced by Automake.AC_DEFUN([_AM_SUBST_NOTMAKE])# Check how to create a tarball. -*- Autoconf -*-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.## This file is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# serial 2# _AM_PROG_TAR(FORMAT)# --------------------# Check how to create a tarball in format FORMAT.# FORMAT should be one of `v7', `ustar', or `pax'.## Substitute a variable $(am__tar) that is a command# writing to stdout a FORMAT-tarball containing the directory# $tardir.# tardir=directory && $(am__tar) > result.tar## Substitute a variable $(am__untar) that extract such# a tarball read from stdin.# $(am__untar) < result.tarAC_DEFUN([_AM_PROG_TAR],[# Always define AMTAR for backward compatibility.AM_MISSING_PROG([AMTAR], [tar])m4_if([$1], [v7],[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],[m4_case([$1], [ustar],, [pax],,[m4_fatal([Unknown tar format])])AC_MSG_CHECKING([how to create a $1 tar archive])# Loop over all known methods to create a tar archive until one works._am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'_am_tools=${am_cv_prog_tar_$1-$_am_tools}# Do not fold the above two line into one, because Tru64 sh and# Solaris sh will not grok spaces in the rhs of `-'.for _am_tool in $_am_toolsdocase $_am_tool ingnutar)for _am_tar in tar gnutar gtar;doAM_RUN_LOG([$_am_tar --version]) && breakdoneam__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'am__untar="$_am_tar -xf -";;plaintar)# Must skip GNU tar: if it does not support --format= it doesn't create# ustar tarball either.(tar --version) >/dev/null 2>&1 && continueam__tar='tar chf - "$$tardir"'am__tar_='tar chf - "$tardir"'am__untar='tar xf -';;pax)am__tar='pax -L -x $1 -w "$$tardir"'am__tar_='pax -L -x $1 -w "$tardir"'am__untar='pax -r';;cpio)am__tar='find "$$tardir" -print | cpio -o -H $1 -L'am__tar_='find "$tardir" -print | cpio -o -H $1 -L'am__untar='cpio -i -H $1 -d';;none)am__tar=falseam__tar_=falseam__untar=false;;esac# If the value was cached, stop now. We just wanted to have am__tar# and am__untar set.test -n "${am_cv_prog_tar_$1}" && break# tar/untar a dummy directory, and stop if the command worksrm -rf conftest.dirmkdir conftest.direcho GrepMe > conftest.dir/fileAM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])rm -rf conftest.dirif test -s conftest.tar; thenAM_RUN_LOG([$am__untar <conftest.tar])grep GrepMe conftest.dir/file >/dev/null 2>&1 && breakfidonerm -rf conftest.dirAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])AC_MSG_RESULT([$am_cv_prog_tar_$1])])AC_SUBST([am__tar])AC_SUBST([am__untar])]) # _AM_PROG_TAR
#! /bin/sh# Attempt to guess a canonical system name.# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,# Inc.timestamp='2006-07-02'# This file is free software; you can redistribute it and/or modify it# under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program 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# General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA# 02110-1301, USA.## As a special exception to the GNU General Public License, if you# distribute this file as part of a program that contains a# configuration script generated by Autoconf, you may include it under# the same distribution terms that you use for the rest of that program.# Originally written by Per Bothner <per@bothner.com>.# Please send patches to <config-patches@gnu.org>. Submit a context# diff and a properly formatted ChangeLog entry.## This script attempts to guess a canonical system name similar to# config.sub. If it succeeds, it prints the system name on stdout, and# exits with 0. Otherwise, it exits with 1.## The plan is that this can be called by configure scripts if you# don't specify an explicit build system type.me=`echo "$0" | sed -e 's,.*/,,'`usage="\Usage: $0 [OPTION]Output the configuration name of the system \`$me' is run on.Operation modes:-h, --help print this help, then exit-t, --time-stamp print date of last modification, then exit-v, --version print version number, then exitReport bugs and patches to <config-patches@gnu.org>."version="\GNU config.guess ($timestamp)Originally written by Per Bothner.Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."help="Try \`$me --help' for more information."# Parse command linewhile test $# -gt 0 ; docase $1 in--time-stamp | --time* | -t )echo "$timestamp" ; exit ;;--version | -v )echo "$version" ; exit ;;--help | --h* | -h )echo "$usage"; exit ;;-- ) # Stop option processingshift; break ;;- ) # Use stdin as input.break ;;-* )echo "$me: invalid option $1$help" >&2exit 1 ;;* )break ;;esacdoneif test $# != 0; thenecho "$me: too many arguments$help" >&2exit 1fitrap 'exit 1' 1 2 15# CC_FOR_BUILD -- compiler used by this script. Note that the use of a# compiler to aid in system detection is discouraged as it requires# temporary files to be created and, as you can see below, it is a# headache to deal with in a portable fashion.# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still# use `HOST_CC' if defined, but it is deprecated.# Portable tmp directory creation inspired by the Autoconf team.set_cc_for_build='trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;: ${TMPDIR=/tmp} ;{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;dummy=$tmp/dummy ;tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;case $CC_FOR_BUILD,$HOST_CC,$CC in,,) echo "int x;" > $dummy.c ;for c in cc gcc c89 c99 ; doif ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; thenCC_FOR_BUILD="$c"; break ;fi ;done ;if test x"$CC_FOR_BUILD" = x ; thenCC_FOR_BUILD=no_compiler_found ;fi;;,,*) CC_FOR_BUILD=$CC ;;,*,*) CC_FOR_BUILD=$HOST_CC ;;esac ; set_cc_for_build= ;'# This is needed to find uname on a Pyramid OSx when run in the BSD universe.# (ghazi@noc.rutgers.edu 1994-08-24)if (test -f /.attbin/uname) >/dev/null 2>&1 ; thenPATH=$PATH:/.attbin ; export PATHfiUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknownUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknownUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknownUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown# Note: order is significant - the case branches are not exclusive.case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in*:NetBSD:*:*)# NetBSD (nbsd) targets should (where applicable) match one or# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently# switched to ELF, *-*-netbsd* would select the old# object file format. This provides both forward# compatibility and a consistent mechanism for selecting the# object file format.## Note: NetBSD doesn't particularly care about the vendor# portion of the name. We always set it to "unknown".sysctl="sysctl -n hw.machine_arch"UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \/usr/sbin/$sysctl 2>/dev/null || echo unknown)`case "${UNAME_MACHINE_ARCH}" inarmeb) machine=armeb-unknown ;;arm*) machine=arm-unknown ;;sh3el) machine=shl-unknown ;;sh3eb) machine=sh-unknown ;;*) machine=${UNAME_MACHINE_ARCH}-unknown ;;esac# The Operating System including object format, if it has switched# to ELF recently, or will in the future.case "${UNAME_MACHINE_ARCH}" inarm*|i386|m68k|ns32k|sh3*|sparc|vax)eval $set_cc_for_buildif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \| grep __ELF__ >/dev/nullthen# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).# Return netbsd for either. FIX?os=netbsdelseos=netbsdelffi;;*)os=netbsd;;esac# The OS release# Debian GNU/NetBSD machines have a different userland, and# thus, need a distinct triplet. However, they do not need# kernel version information, so it can be replaced with a# suitable tag, in the style of linux-gnu.case "${UNAME_VERSION}" inDebian*)release='-gnu';;*)release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`;;esac# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:# contains redundant information, the shorter form:# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.echo "${machine}-${os}${release}"exit ;;*:OpenBSD:*:*)UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}exit ;;*:ekkoBSD:*:*)echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}exit ;;*:SolidBSD:*:*)echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}exit ;;macppc:MirBSD:*:*)echo powerpc-unknown-mirbsd${UNAME_RELEASE}exit ;;*:MirBSD:*:*)echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}exit ;;alpha:OSF1:*:*)case $UNAME_RELEASE in*4.0)UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`;;*5.*)UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`;;esac# According to Compaq, /usr/sbin/psrinfo has been available on# OSF/1 and Tru64 systems produced since 1995. I hope that# covers most systems running today. This code pipes the CPU# types through head -n 1, so we only detect the type of CPU 0.ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`case "$ALPHA_CPU_TYPE" in"EV4 (21064)")UNAME_MACHINE="alpha" ;;"EV4.5 (21064)")UNAME_MACHINE="alpha" ;;"LCA4 (21066/21068)")UNAME_MACHINE="alpha" ;;"EV5 (21164)")UNAME_MACHINE="alphaev5" ;;"EV5.6 (21164A)")UNAME_MACHINE="alphaev56" ;;"EV5.6 (21164PC)")UNAME_MACHINE="alphapca56" ;;"EV5.7 (21164PC)")UNAME_MACHINE="alphapca57" ;;"EV6 (21264)")UNAME_MACHINE="alphaev6" ;;"EV6.7 (21264A)")UNAME_MACHINE="alphaev67" ;;"EV6.8CB (21264C)")UNAME_MACHINE="alphaev68" ;;"EV6.8AL (21264B)")UNAME_MACHINE="alphaev68" ;;"EV6.8CX (21264D)")UNAME_MACHINE="alphaev68" ;;"EV6.9A (21264/EV69A)")UNAME_MACHINE="alphaev69" ;;"EV7 (21364)")UNAME_MACHINE="alphaev7" ;;"EV7.9 (21364A)")UNAME_MACHINE="alphaev79" ;;esac# A Pn.n version is a patched version.# A Vn.n version is a released version.# A Tn.n version is a released field test version.# A Xn.n version is an unreleased experimental baselevel.# 1.2 uses "1.2" for uname -r.echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`exit ;;Alpha\ *:Windows_NT*:*)# How do we know it's Interix rather than the generic POSIX subsystem?# Should we change UNAME_MACHINE based on the output of uname instead# of the specific Alpha model?echo alpha-pc-interixexit ;;21064:Windows_NT:50:3)echo alpha-dec-winnt3.5exit ;;Amiga*:UNIX_System_V:4.0:*)echo m68k-unknown-sysv4exit ;;*:[Aa]miga[Oo][Ss]:*:*)echo ${UNAME_MACHINE}-unknown-amigaosexit ;;*:[Mm]orph[Oo][Ss]:*:*)echo ${UNAME_MACHINE}-unknown-morphosexit ;;*:OS/390:*:*)echo i370-ibm-openeditionexit ;;*:z/VM:*:*)echo s390-ibm-zvmoeexit ;;*:OS400:*:*)echo powerpc-ibm-os400exit ;;arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)echo arm-acorn-riscix${UNAME_RELEASE}exit ;;arm:riscos:*:*|arm:RISCOS:*:*)echo arm-unknown-riscosexit ;;SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)echo hppa1.1-hitachi-hiuxmppexit ;;Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.if test "`(/bin/universe) 2>/dev/null`" = att ; thenecho pyramid-pyramid-sysv3elseecho pyramid-pyramid-bsdfiexit ;;NILE*:*:*:dcosx)echo pyramid-pyramid-svr4exit ;;DRS?6000:unix:4.0:6*)echo sparc-icl-nx6exit ;;DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)case `/usr/bin/uname -p` insparc) echo sparc-icl-nx7; exit ;;esac ;;sun4H:SunOS:5.*:*)echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`exit ;;sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`exit ;;i86pc:SunOS:5.*:*)echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`exit ;;sun4*:SunOS:6*:*)# According to config.sub, this is the proper way to canonicalize# SunOS6. Hard to guess exactly what SunOS6 will be like, but# it's likely to be more like Solaris than SunOS4.echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`exit ;;sun4*:SunOS:*:*)case "`/usr/bin/arch -k`" inSeries*|S4*)UNAME_RELEASE=`uname -v`;;esac# Japanese Language versions have a version number like `4.1.3-JL'.echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`exit ;;sun3*:SunOS:*:*)echo m68k-sun-sunos${UNAME_RELEASE}exit ;;sun*:*:4.2BSD:*)UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3case "`/bin/arch`" insun3)echo m68k-sun-sunos${UNAME_RELEASE};;sun4)echo sparc-sun-sunos${UNAME_RELEASE};;esacexit ;;aushp:SunOS:*:*)echo sparc-auspex-sunos${UNAME_RELEASE}exit ;;# The situation for MiNT is a little confusing. The machine name# can be virtually everything (everything which is not# "atarist" or "atariste" at least should have a processor# > m68000). The system name ranges from "MiNT" over "FreeMiNT"# to the lowercase version "mint" (or "freemint"). Finally# the system name "TOS" denotes a system which is actually not# MiNT. But MiNT is downward compatible to TOS, so this should# be no problem.atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)echo m68k-atari-mint${UNAME_RELEASE}exit ;;atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)echo m68k-atari-mint${UNAME_RELEASE}exit ;;*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)echo m68k-atari-mint${UNAME_RELEASE}exit ;;milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)echo m68k-milan-mint${UNAME_RELEASE}exit ;;hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)echo m68k-hades-mint${UNAME_RELEASE}exit ;;*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)echo m68k-unknown-mint${UNAME_RELEASE}exit ;;m68k:machten:*:*)echo m68k-apple-machten${UNAME_RELEASE}exit ;;powerpc:machten:*:*)echo powerpc-apple-machten${UNAME_RELEASE}exit ;;RISC*:Mach:*:*)echo mips-dec-mach_bsd4.3exit ;;RISC*:ULTRIX:*:*)echo mips-dec-ultrix${UNAME_RELEASE}exit ;;VAX*:ULTRIX*:*:*)echo vax-dec-ultrix${UNAME_RELEASE}exit ;;2020:CLIX:*:* | 2430:CLIX:*:*)echo clipper-intergraph-clix${UNAME_RELEASE}exit ;;mips:*:*:UMIPS | mips:*:*:RISCos)eval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#ifdef __cplusplus#include <stdio.h> /* for printf() prototype */int main (int argc, char *argv[]) {#elseint main (argc, argv) int argc; char *argv[]; {#endif#if defined (host_mips) && defined (MIPSEB)#if defined (SYSTYPE_SYSV)printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);#endif#if defined (SYSTYPE_SVR4)printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);#endif#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);#endif#endifexit (-1);}EOF$CC_FOR_BUILD -o $dummy $dummy.c &&dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&SYSTEM_NAME=`$dummy $dummyarg` &&{ echo "$SYSTEM_NAME"; exit; }echo mips-mips-riscos${UNAME_RELEASE}exit ;;Motorola:PowerMAX_OS:*:*)echo powerpc-motorola-powermaxexit ;;Motorola:*:4.3:PL8-*)echo powerpc-harris-powermaxexit ;;Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)echo powerpc-harris-powermaxexit ;;Night_Hawk:Power_UNIX:*:*)echo powerpc-harris-powerunixexit ;;m88k:CX/UX:7*:*)echo m88k-harris-cxux7exit ;;m88k:*:4*:R4*)echo m88k-motorola-sysv4exit ;;m88k:*:3*:R3*)echo m88k-motorola-sysv3exit ;;AViiON:dgux:*:*)# DG/UX returns AViiON for all architecturesUNAME_PROCESSOR=`/usr/bin/uname -p`if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]thenif [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \[ ${TARGET_BINARY_INTERFACE}x = x ]thenecho m88k-dg-dgux${UNAME_RELEASE}elseecho m88k-dg-dguxbcs${UNAME_RELEASE}fielseecho i586-dg-dgux${UNAME_RELEASE}fiexit ;;M88*:DolphinOS:*:*) # DolphinOS (SVR3)echo m88k-dolphin-sysv3exit ;;M88*:*:R3*:*)# Delta 88k system running SVR3echo m88k-motorola-sysv3exit ;;XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)echo m88k-tektronix-sysv3exit ;;Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)echo m68k-tektronix-bsdexit ;;*:IRIX*:*:*)echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`exit ;;????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.echo romp-ibm-aix # uname -m gives an 8 hex-code CPU idexit ;; # Note that: echo "'`uname -s`'" gives 'AIX 'i*86:AIX:*:*)echo i386-ibm-aixexit ;;ia64:AIX:*:*)if [ -x /usr/bin/oslevel ] ; thenIBM_REV=`/usr/bin/oslevel`elseIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}fiecho ${UNAME_MACHINE}-ibm-aix${IBM_REV}exit ;;*:AIX:2:3)if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; theneval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#include <sys/systemcfg.h>main(){if (!__power_pc())exit(1);puts("powerpc-ibm-aix3.2.5");exit(0);}EOFif $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`thenecho "$SYSTEM_NAME"elseecho rs6000-ibm-aix3.2.5fielif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; thenecho rs6000-ibm-aix3.2.4elseecho rs6000-ibm-aix3.2fiexit ;;*:AIX:*:[45])IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; thenIBM_ARCH=rs6000elseIBM_ARCH=powerpcfiif [ -x /usr/bin/oslevel ] ; thenIBM_REV=`/usr/bin/oslevel`elseIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}fiecho ${IBM_ARCH}-ibm-aix${IBM_REV}exit ;;*:AIX:*:*)echo rs6000-ibm-aixexit ;;ibmrt:4.4BSD:*|romp-ibm:BSD:*)echo romp-ibm-bsd4.4exit ;;ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD andecho romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added toexit ;; # report: romp-ibm BSD 4.3*:BOSX:*:*)echo rs6000-bull-bosxexit ;;DPX/2?00:B.O.S.:*:*)echo m68k-bull-sysv3exit ;;9000/[34]??:4.3bsd:1.*:*)echo m68k-hp-bsdexit ;;hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)echo m68k-hp-bsd4.4exit ;;9000/[34678]??:HP-UX:*:*)HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`case "${UNAME_MACHINE}" in9000/31? ) HP_ARCH=m68000 ;;9000/[34]?? ) HP_ARCH=m68k ;;9000/[678][0-9][0-9])if [ -x /usr/bin/getconf ]; thensc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`case "${sc_cpu_version}" in523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1532) # CPU_PA_RISC2_0case "${sc_kernel_bits}" in32) HP_ARCH="hppa2.0n" ;;64) HP_ARCH="hppa2.0w" ;;'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20esac ;;esacfiif [ "${HP_ARCH}" = "" ]; theneval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#define _HPUX_SOURCE#include <stdlib.h>#include <unistd.h>int main (){#if defined(_SC_KERNEL_BITS)long bits = sysconf(_SC_KERNEL_BITS);#endiflong cpu = sysconf (_SC_CPU_VERSION);switch (cpu){case CPU_PA_RISC1_0: puts ("hppa1.0"); break;case CPU_PA_RISC1_1: puts ("hppa1.1"); break;case CPU_PA_RISC2_0:#if defined(_SC_KERNEL_BITS)switch (bits){case 64: puts ("hppa2.0w"); break;case 32: puts ("hppa2.0n"); break;default: puts ("hppa2.0"); break;} break;#else /* !defined(_SC_KERNEL_BITS) */puts ("hppa2.0"); break;#endifdefault: puts ("hppa1.0"); break;}exit (0);}EOF(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`test -z "$HP_ARCH" && HP_ARCH=hppafi ;;esacif [ ${HP_ARCH} = "hppa2.0w" ]theneval $set_cc_for_build# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler# generating 64-bit code. GNU and HP use different nomenclature:## $ CC_FOR_BUILD=cc ./config.guess# => hppa2.0w-hp-hpux11.23# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess# => hppa64-hp-hpux11.23if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |grep __LP64__ >/dev/nullthenHP_ARCH="hppa2.0w"elseHP_ARCH="hppa64"fifiecho ${HP_ARCH}-hp-hpux${HPUX_REV}exit ;;ia64:HP-UX:*:*)HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`echo ia64-hp-hpux${HPUX_REV}exit ;;3050*:HI-UX:*:*)eval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#include <unistd.h>intmain (){long cpu = sysconf (_SC_CPU_VERSION);/* The order matters, because CPU_IS_HP_MC68K erroneously returnstrue for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correctresults, however. */if (CPU_IS_PA_RISC (cpu)){switch (cpu){case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;default: puts ("hppa-hitachi-hiuxwe2"); break;}}else if (CPU_IS_HP_MC68K (cpu))puts ("m68k-hitachi-hiuxwe2");else puts ("unknown-hitachi-hiuxwe2");exit (0);}EOF$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&{ echo "$SYSTEM_NAME"; exit; }echo unknown-hitachi-hiuxwe2exit ;;9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )echo hppa1.1-hp-bsdexit ;;9000/8??:4.3bsd:*:*)echo hppa1.0-hp-bsdexit ;;*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)echo hppa1.0-hp-mpeixexit ;;hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )echo hppa1.1-hp-osfexit ;;hp8??:OSF1:*:*)echo hppa1.0-hp-osfexit ;;i*86:OSF1:*:*)if [ -x /usr/sbin/sysversion ] ; thenecho ${UNAME_MACHINE}-unknown-osf1mkelseecho ${UNAME_MACHINE}-unknown-osf1fiexit ;;parisc*:Lites*:*:*)echo hppa1.1-hp-litesexit ;;C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)echo c1-convex-bsdexit ;;C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)if getsysinfo -f scalar_accthen echo c32-convex-bsdelse echo c2-convex-bsdfiexit ;;C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)echo c34-convex-bsdexit ;;C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)echo c38-convex-bsdexit ;;C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)echo c4-convex-bsdexit ;;CRAY*Y-MP:*:*:*)echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'exit ;;CRAY*[A-Z]90:*:*:*)echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \-e 's/\.[^.]*$/.X/'exit ;;CRAY*TS:*:*:*)echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'exit ;;CRAY*T3E:*:*:*)echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'exit ;;CRAY*SV1:*:*:*)echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'exit ;;*:UNICOS/mp:*:*)echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'exit ;;F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"exit ;;5000:UNIX_System_V:4.*:*)FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"exit ;;i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}exit ;;sparc*:BSD/OS:*:*)echo sparc-unknown-bsdi${UNAME_RELEASE}exit ;;*:BSD/OS:*:*)echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}exit ;;*:FreeBSD:*:*)case ${UNAME_MACHINE} inpc98)echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;amd64)echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;*)echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;esacexit ;;i*:CYGWIN*:*)echo ${UNAME_MACHINE}-pc-cygwinexit ;;i*:MINGW*:*)echo ${UNAME_MACHINE}-pc-mingw32exit ;;i*:windows32*:*)# uname -m includes "-pc" on this system.echo ${UNAME_MACHINE}-mingw32exit ;;i*:PW*:*)echo ${UNAME_MACHINE}-pc-pw32exit ;;x86:Interix*:[3456]*)echo i586-pc-interix${UNAME_RELEASE}exit ;;EM64T:Interix*:[3456]*)echo x86_64-unknown-interix${UNAME_RELEASE}exit ;;[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)echo i${UNAME_MACHINE}-pc-mksexit ;;i*:Windows_NT*:* | Pentium*:Windows_NT*:*)# How do we know it's Interix rather than the generic POSIX subsystem?# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we# UNAME_MACHINE based on the output of uname instead of i386?echo i586-pc-interixexit ;;i*:UWIN*:*)echo ${UNAME_MACHINE}-pc-uwinexit ;;amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)echo x86_64-unknown-cygwinexit ;;p*:CYGWIN*:*)echo powerpcle-unknown-cygwinexit ;;prep*:SunOS:5.*:*)echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`exit ;;*:GNU:*:*)# the GNU systemecho `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`exit ;;*:GNU/*:*:*)# other systems with GNU libc and userlandecho ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnuexit ;;i*86:Minix:*:*)echo ${UNAME_MACHINE}-pc-minixexit ;;arm*:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;avr32*:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;cris:Linux:*:*)echo cris-axis-linux-gnuexit ;;crisv32:Linux:*:*)echo crisv32-axis-linux-gnuexit ;;frv:Linux:*:*)echo frv-unknown-linux-gnuexit ;;ia64:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;m32r*:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;m68*:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;mips:Linux:*:*)eval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#undef CPU#undef mips#undef mipsel#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)CPU=mipsel#else#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)CPU=mips#elseCPU=#endif#endifEOFeval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::gp}'`"test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; };;mips64:Linux:*:*)eval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#undef CPU#undef mips64#undef mips64el#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)CPU=mips64el#else#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)CPU=mips64#elseCPU=#endif#endifEOFeval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::gp}'`"test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; };;or32:Linux:*:*)echo or32-unknown-linux-gnuexit ;;ppc:Linux:*:*)echo powerpc-unknown-linux-gnuexit ;;ppc64:Linux:*:*)echo powerpc64-unknown-linux-gnuexit ;;alpha:Linux:*:*)case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` inEV5) UNAME_MACHINE=alphaev5 ;;EV56) UNAME_MACHINE=alphaev56 ;;PCA56) UNAME_MACHINE=alphapca56 ;;PCA57) UNAME_MACHINE=alphapca56 ;;EV6) UNAME_MACHINE=alphaev6 ;;EV67) UNAME_MACHINE=alphaev67 ;;EV68*) UNAME_MACHINE=alphaev68 ;;esacobjdump --private-headers /bin/sh | grep ld.so.1 >/dev/nullif test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fiecho ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}exit ;;parisc:Linux:*:* | hppa:Linux:*:*)# Look for CPU levelcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` inPA7*) echo hppa1.1-unknown-linux-gnu ;;PA8*) echo hppa2.0-unknown-linux-gnu ;;*) echo hppa-unknown-linux-gnu ;;esacexit ;;parisc64:Linux:*:* | hppa64:Linux:*:*)echo hppa64-unknown-linux-gnuexit ;;s390:Linux:*:* | s390x:Linux:*:*)echo ${UNAME_MACHINE}-ibm-linuxexit ;;sh64*:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;sh*:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;sparc:Linux:*:* | sparc64:Linux:*:*)echo ${UNAME_MACHINE}-unknown-linux-gnuexit ;;vax:Linux:*:*)echo ${UNAME_MACHINE}-dec-linux-gnuexit ;;x86_64:Linux:*:*)echo x86_64-unknown-linux-gnuexit ;;i*86:Linux:*:*)# The BFD linker knows what the default object file format is, so# first see if it will tell us. cd to the root directory to prevent# problems with other programs or directories called `ld' in the path.# Set LC_ALL=C to ensure ld outputs messages in English.ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \| sed -ne '/supported targets:/!ds/[ ][ ]*/ /gs/.*supported targets: *//s/ .*//p'`case "$ld_supported_targets" inelf32-i386)TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu";;a.out-i386-linux)echo "${UNAME_MACHINE}-pc-linux-gnuaout"exit ;;coff-i386)echo "${UNAME_MACHINE}-pc-linux-gnucoff"exit ;;"")# Either a pre-BFD a.out linker (linux-gnuoldld) or# one that does not give us useful --help.echo "${UNAME_MACHINE}-pc-linux-gnuoldld"exit ;;esac# Determine whether the default compiler is a.out or elfeval $set_cc_for_buildsed 's/^ //' << EOF >$dummy.c#include <features.h>#ifdef __ELF__# ifdef __GLIBC__# if __GLIBC__ >= 2LIBC=gnu# elseLIBC=gnulibc1# endif# elseLIBC=gnulibc1# endif#else#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)LIBC=gnu#elseLIBC=gnuaout#endif#endif#ifdef __dietlibc__LIBC=dietlibc#endifEOFeval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::gp}'`"test x"${LIBC}" != x && {echo "${UNAME_MACHINE}-pc-linux-${LIBC}"exit}test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; };;i*86:DYNIX/ptx:4*:*)# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.# earlier versions are messed up and put the nodename in both# sysname and nodename.echo i386-sequent-sysv4exit ;;i*86:UNIX_SV:4.2MP:2.*)# Unixware is an offshoot of SVR4, but it has its own version# number series starting with 2...# I am not positive that other SVR4 systems won't match this,# I just have to hope. -- rms.# Use sysv4.2uw... so that sysv4* matches it.echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}exit ;;i*86:OS/2:*:*)# If we were able to find `uname', then EMX Unix compatibility# is probably installed.echo ${UNAME_MACHINE}-pc-os2-emxexit ;;i*86:XTS-300:*:STOP)echo ${UNAME_MACHINE}-unknown-stopexit ;;i*86:atheos:*:*)echo ${UNAME_MACHINE}-unknown-atheosexit ;;i*86:syllable:*:*)echo ${UNAME_MACHINE}-pc-syllableexit ;;i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)echo i386-unknown-lynxos${UNAME_RELEASE}exit ;;i*86:*DOS:*:*)echo ${UNAME_MACHINE}-pc-msdosdjgppexit ;;i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; thenecho ${UNAME_MACHINE}-univel-sysv${UNAME_REL}elseecho ${UNAME_MACHINE}-pc-sysv${UNAME_REL}fiexit ;;i*86:*:5:[678]*)# UnixWare 7.x, OpenUNIX and OpenServer 6.case `/bin/uname -X | grep "^Machine"` in*486*) UNAME_MACHINE=i486 ;;*Pentium) UNAME_MACHINE=i586 ;;*Pent*|*Celeron) UNAME_MACHINE=i686 ;;esacecho ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}exit ;;i*86:*:3.2:*)if test -f /usr/options/cb.name; thenUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`echo ${UNAME_MACHINE}-pc-isc$UNAME_RELelif /bin/uname -X 2>/dev/null >/dev/null ; thenUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \&& UNAME_MACHINE=i586(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \&& UNAME_MACHINE=i686(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \&& UNAME_MACHINE=i686echo ${UNAME_MACHINE}-pc-sco$UNAME_RELelseecho ${UNAME_MACHINE}-pc-sysv32fiexit ;;pc:*:*:*)# Left here for compatibility:# uname -m prints for DJGPP always 'pc', but it prints nothing about# the processor, so we play safe by assuming i386.echo i386-pc-msdosdjgppexit ;;Intel:Mach:3*:*)echo i386-pc-mach3exit ;;paragon:*:*:*)echo i860-intel-osf1exit ;;i860:*:4.*:*) # i860-SVR4if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; thenecho i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4else # Add other i860-SVR4 vendors below as they are discovered.echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4fiexit ;;mini*:CTIX:SYS*5:*)# "miniframe"echo m68010-convergent-sysvexit ;;mc68k:UNIX:SYSTEM5:3.51m)echo m68k-convergent-sysvexit ;;M680?0:D-NIX:5.3:*)echo m68k-diab-dnixexit ;;M68*:*:R3V[5678]*:*)test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)OS_REL=''test -r /etc/.relid \&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`/bin/uname -p 2>/dev/null | grep 86 >/dev/null \&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)/bin/uname -p 2>/dev/null | grep 86 >/dev/null \&& { echo i486-ncr-sysv4; exit; } ;;m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)echo m68k-unknown-lynxos${UNAME_RELEASE}exit ;;mc68030:UNIX_System_V:4.*:*)echo m68k-atari-sysv4exit ;;TSUNAMI:LynxOS:2.*:*)echo sparc-unknown-lynxos${UNAME_RELEASE}exit ;;rs6000:LynxOS:2.*:*)echo rs6000-unknown-lynxos${UNAME_RELEASE}exit ;;PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)echo powerpc-unknown-lynxos${UNAME_RELEASE}exit ;;SM[BE]S:UNIX_SV:*:*)echo mips-dde-sysv${UNAME_RELEASE}exit ;;RM*:ReliantUNIX-*:*:*)echo mips-sni-sysv4exit ;;RM*:SINIX-*:*:*)echo mips-sni-sysv4exit ;;*:SINIX-*:*:*)if uname -p 2>/dev/null >/dev/null ; thenUNAME_MACHINE=`(uname -p) 2>/dev/null`echo ${UNAME_MACHINE}-sni-sysv4elseecho ns32k-sni-sysvfiexit ;;PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort# says <Richard.M.Bartel@ccMail.Census.GOV>echo i586-unisys-sysv4exit ;;*:UNIX_System_V:4*:FTX*)# From Gerald Hewes <hewes@openmarket.com>.# How about differentiating between stratus architectures? -djmecho hppa1.1-stratus-sysv4exit ;;*:*:*:FTX*)# From seanf@swdc.stratus.com.echo i860-stratus-sysv4exit ;;i*86:VOS:*:*)# From Paul.Green@stratus.com.echo ${UNAME_MACHINE}-stratus-vosexit ;;*:VOS:*:*)# From Paul.Green@stratus.com.echo hppa1.1-stratus-vosexit ;;mc68*:A/UX:*:*)echo m68k-apple-aux${UNAME_RELEASE}exit ;;news*:NEWS-OS:6*:*)echo mips-sony-newsos6exit ;;R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)if [ -d /usr/nec ]; thenecho mips-nec-sysv${UNAME_RELEASE}elseecho mips-unknown-sysv${UNAME_RELEASE}fiexit ;;BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.echo powerpc-be-beosexit ;;BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.echo powerpc-apple-beosexit ;;BePC:BeOS:*:*) # BeOS running on Intel PC compatible.echo i586-pc-beosexit ;;SX-4:SUPER-UX:*:*)echo sx4-nec-superux${UNAME_RELEASE}exit ;;SX-5:SUPER-UX:*:*)echo sx5-nec-superux${UNAME_RELEASE}exit ;;SX-6:SUPER-UX:*:*)echo sx6-nec-superux${UNAME_RELEASE}exit ;;Power*:Rhapsody:*:*)echo powerpc-apple-rhapsody${UNAME_RELEASE}exit ;;*:Rhapsody:*:*)echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}exit ;;*:Darwin:*:*)UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknowncase $UNAME_PROCESSOR inunknown) UNAME_PROCESSOR=powerpc ;;esacecho ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}exit ;;*:procnto*:*:* | *:QNX:[0123456789]*:*)UNAME_PROCESSOR=`uname -p`if test "$UNAME_PROCESSOR" = "x86"; thenUNAME_PROCESSOR=i386UNAME_MACHINE=pcfiecho ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}exit ;;*:QNX:*:4*)echo i386-pc-qnxexit ;;NSE-?:NONSTOP_KERNEL:*:*)echo nse-tandem-nsk${UNAME_RELEASE}exit ;;NSR-?:NONSTOP_KERNEL:*:*)echo nsr-tandem-nsk${UNAME_RELEASE}exit ;;*:NonStop-UX:*:*)echo mips-compaq-nonstopuxexit ;;BS2000:POSIX*:*:*)echo bs2000-siemens-sysvexit ;;DS/*:UNIX_System_V:*:*)echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}exit ;;*:Plan9:*:*)# "uname -m" is not consistent, so use $cputype instead. 386# is converted to i386 for consistency with other x86# operating systems.if test "$cputype" = "386"; thenUNAME_MACHINE=i386elseUNAME_MACHINE="$cputype"fiecho ${UNAME_MACHINE}-unknown-plan9exit ;;*:TOPS-10:*:*)echo pdp10-unknown-tops10exit ;;*:TENEX:*:*)echo pdp10-unknown-tenexexit ;;KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)echo pdp10-dec-tops20exit ;;XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)echo pdp10-xkl-tops20exit ;;*:TOPS-20:*:*)echo pdp10-unknown-tops20exit ;;*:ITS:*:*)echo pdp10-unknown-itsexit ;;SEI:*:*:SEIUX)echo mips-sei-seiux${UNAME_RELEASE}exit ;;*:DragonFly:*:*)echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`exit ;;*:*VMS:*:*)UNAME_MACHINE=`(uname -p) 2>/dev/null`case "${UNAME_MACHINE}" inA*) echo alpha-dec-vms ; exit ;;I*) echo ia64-dec-vms ; exit ;;V*) echo vax-dec-vms ; exit ;;esac ;;*:XENIX:*:SysV)echo i386-pc-xenixexit ;;i*86:skyos:*:*)echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'exit ;;i*86:rdos:*:*)echo ${UNAME_MACHINE}-pc-rdosexit ;;esac#echo '(No uname command or uname output not recognized.)' 1>&2#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2eval $set_cc_for_buildcat >$dummy.c <<EOF#ifdef _SEQUENT_# include <sys/types.h># include <sys/utsname.h>#endifmain (){#if defined (sony)#if defined (MIPSEB)/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,I don't know.... */printf ("mips-sony-bsd\n"); exit (0);#else#include <sys/param.h>printf ("m68k-sony-newsos%s\n",#ifdef NEWSOS4"4"#else""#endif); exit (0);#endif#endif#if defined (__arm) && defined (__acorn) && defined (__unix)printf ("arm-acorn-riscix\n"); exit (0);#endif#if defined (hp300) && !defined (hpux)printf ("m68k-hp-bsd\n"); exit (0);#endif#if defined (NeXT)#if !defined (__ARCHITECTURE__)#define __ARCHITECTURE__ "m68k"#endifint version;version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;if (version < 4)printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);elseprintf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);exit (0);#endif#if defined (MULTIMAX) || defined (n16)#if defined (UMAXV)printf ("ns32k-encore-sysv\n"); exit (0);#else#if defined (CMU)printf ("ns32k-encore-mach\n"); exit (0);#elseprintf ("ns32k-encore-bsd\n"); exit (0);#endif#endif#endif#if defined (__386BSD__)printf ("i386-pc-bsd\n"); exit (0);#endif#if defined (sequent)#if defined (i386)printf ("i386-sequent-dynix\n"); exit (0);#endif#if defined (ns32000)printf ("ns32k-sequent-dynix\n"); exit (0);#endif#endif#if defined (_SEQUENT_)struct utsname un;uname(&un);if (strncmp(un.version, "V2", 2) == 0) {printf ("i386-sequent-ptx2\n"); exit (0);}if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */printf ("i386-sequent-ptx1\n"); exit (0);}printf ("i386-sequent-ptx\n"); exit (0);#endif#if defined (vax)# if !defined (ultrix)# include <sys/param.h># if defined (BSD)# if BSD == 43printf ("vax-dec-bsd4.3\n"); exit (0);# else# if BSD == 199006printf ("vax-dec-bsd4.3reno\n"); exit (0);# elseprintf ("vax-dec-bsd\n"); exit (0);# endif# endif# elseprintf ("vax-dec-bsd\n"); exit (0);# endif# elseprintf ("vax-dec-ultrix\n"); exit (0);# endif#endif#if defined (alliant) && defined (i860)printf ("i860-alliant-bsd\n"); exit (0);#endifexit (1);}EOF$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&{ echo "$SYSTEM_NAME"; exit; }# Apollos put the system type in the environment.test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }# Convex versions that predate uname can use getsysinfo(1)if [ -x /usr/convex/getsysinfo ]thencase `getsysinfo -f cpu_type` inc1*)echo c1-convex-bsdexit ;;c2*)if getsysinfo -f scalar_accthen echo c32-convex-bsdelse echo c2-convex-bsdfiexit ;;c34*)echo c34-convex-bsdexit ;;c38*)echo c38-convex-bsdexit ;;c4*)echo c4-convex-bsdexit ;;esacficat >&2 <<EOF$0: unable to guess system typeThis script, last modified $timestamp, has failed to recognizethe operating system you are using. It is advised that youdownload the most up to date version of the config scripts fromhttp://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guessandhttp://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.subIf the version you run ($0) is already up to date, pleasesend the following data and any information you think might bepertinent to <config-patches@gnu.org> in order to provide the neededinformation to handle your system.config.guess timestamp = $timestampuname -m = `(uname -m) 2>/dev/null || echo unknown`uname -r = `(uname -r) 2>/dev/null || echo unknown`uname -s = `(uname -s) 2>/dev/null || echo unknown`uname -v = `(uname -v) 2>/dev/null || echo unknown`/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`/bin/uname -X = `(/bin/uname -X) 2>/dev/null`hostinfo = `(hostinfo) 2>/dev/null`/bin/universe = `(/bin/universe) 2>/dev/null`/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`/bin/arch = `(/bin/arch) 2>/dev/null`/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`UNAME_MACHINE = ${UNAME_MACHINE}UNAME_RELEASE = ${UNAME_RELEASE}UNAME_SYSTEM = ${UNAME_SYSTEM}UNAME_VERSION = ${UNAME_VERSION}EOFexit 1# Local variables:# eval: (add-hook 'write-file-hooks 'time-stamp)# time-stamp-start: "timestamp='"# time-stamp-format: "%:y-%02m-%02d"# time-stamp-end: "'"# End:
/* config.h. Generated from config.h.in by configure. *//* config.h.in. Generated from configure.in by autoheader. *//* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMPsystems. This function is required for `alloca.c' support on those systems.*//* #undef CRAY_STACKSEG_END *//* Define to 1 if using `alloca.c'. *//* #undef C_ALLOCA *//* Define to 1 if you have `alloca', as a function or macro. */#define HAVE_ALLOCA 1/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).*/#define HAVE_ALLOCA_H 1/* Define to 1 if you have the <dlfcn.h> header file. */#define HAVE_DLFCN_H 1/* Define to 1 if you have the <inttypes.h> header file. */#define HAVE_INTTYPES_H 1/* Define to 1 if you have the <memory.h> header file. */#define HAVE_MEMORY_H 1/* Define if compilerr supports prototypes */#define HAVE_PROTOTYPES 1/* Define if compiler supports stdarg prototypes */#define HAVE_STDARG_PROTOTYPES 1/* Define to 1 if you have the <stdint.h> header file. */#define HAVE_STDINT_H 1/* Define to 1 if you have the <stdlib.h> header file. */#define HAVE_STDLIB_H 1/* Define to 1 if you have the <strings.h> header file. */#define HAVE_STRINGS_H 1/* Define to 1 if you have the <string.h> header file. */#define HAVE_STRING_H 1/* Define to 1 if you have the <sys/stat.h> header file. */#define HAVE_SYS_STAT_H 1/* Define to 1 if you have the <sys/times.h> header file. */#define HAVE_SYS_TIMES_H 1/* Define to 1 if you have the <sys/time.h> header file. */#define HAVE_SYS_TIME_H 1/* Define to 1 if you have the <sys/types.h> header file. */#define HAVE_SYS_TYPES_H 1/* Define to 1 if you have the <unistd.h> header file. */#define HAVE_UNISTD_H 1/* Define to the sub-directory in which libtool stores uninstalled libraries.*/#define LT_OBJDIR ".libs/"/* Name of package */#define PACKAGE "onig"/* Define to the address where bug reports for this package should be sent. */#define PACKAGE_BUGREPORT ""/* Define to the full name of this package. */#define PACKAGE_NAME "onig"/* Define to the full name and version of this package. */#define PACKAGE_STRING "onig 5.9.2"/* Define to the one symbol short name of this package. */#define PACKAGE_TARNAME "onig"/* Define to the version of this package. */#define PACKAGE_VERSION "5.9.2"/* The size of `int', as computed by sizeof. */#define SIZEOF_INT 4/* The size of `long', as computed by sizeof. */#define SIZEOF_LONG 8/* The size of `short', as computed by sizeof. */#define SIZEOF_SHORT 2/* If using the C implementation of alloca, define if you know thedirection of stack growth for your system; otherwise it will beautomatically deduced at runtime.STACK_DIRECTION > 0 => grows toward higher addressesSTACK_DIRECTION < 0 => grows toward lower addressesSTACK_DIRECTION = 0 => direction of growth unknown *//* #undef STACK_DIRECTION *//* Define to 1 if you have the ANSI C header files. */#define STDC_HEADERS 1/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */#define TIME_WITH_SYS_TIME 1/* Define if combination explosion check *//* #undef USE_COMBINATION_EXPLOSION_CHECK *//* Define if enable CR+NL as line terminator *//* #undef USE_CRNL_AS_LINE_TERMINATOR *//* Version number of package */#define VERSION "5.9.2"/* Define to empty if `const' does not conform to ANSI C. *//* #undef const */
/* config.h.in. Generated from configure.in by autoheader. *//* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMPsystems. This function is required for `alloca.c' support on those systems.*/#undef CRAY_STACKSEG_END/* Define to 1 if using `alloca.c'. */#undef C_ALLOCA/* Define to 1 if you have `alloca', as a function or macro. */#undef HAVE_ALLOCA/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).*/#undef HAVE_ALLOCA_H/* Define to 1 if you have the <dlfcn.h> header file. */#undef HAVE_DLFCN_H/* Define to 1 if you have the <inttypes.h> header file. */#undef HAVE_INTTYPES_H/* Define to 1 if you have the <memory.h> header file. */#undef HAVE_MEMORY_H/* Define if compilerr supports prototypes */#undef HAVE_PROTOTYPES/* Define if compiler supports stdarg prototypes */#undef HAVE_STDARG_PROTOTYPES/* Define to 1 if you have the <stdint.h> header file. */#undef HAVE_STDINT_H/* Define to 1 if you have the <stdlib.h> header file. */#undef HAVE_STDLIB_H/* Define to 1 if you have the <strings.h> header file. */#undef HAVE_STRINGS_H/* Define to 1 if you have the <string.h> header file. */#undef HAVE_STRING_H/* Define to 1 if you have the <sys/stat.h> header file. */#undef HAVE_SYS_STAT_H/* Define to 1 if you have the <sys/times.h> header file. */#undef HAVE_SYS_TIMES_H/* Define to 1 if you have the <sys/time.h> header file. */#undef HAVE_SYS_TIME_H/* Define to 1 if you have the <sys/types.h> header file. */#undef HAVE_SYS_TYPES_H/* Define to 1 if you have the <unistd.h> header file. */#undef HAVE_UNISTD_H/* Define to the sub-directory in which libtool stores uninstalled libraries.*/#undef LT_OBJDIR/* Name of package */#undef PACKAGE/* Define to the address where bug reports for this package should be sent. */#undef PACKAGE_BUGREPORT/* Define to the full name of this package. */#undef PACKAGE_NAME/* Define to the full name and version of this package. */#undef PACKAGE_STRING/* Define to the one symbol short name of this package. */#undef PACKAGE_TARNAME/* Define to the version of this package. */#undef PACKAGE_VERSION/* The size of `int', as computed by sizeof. */#undef SIZEOF_INT/* The size of `long', as computed by sizeof. */#undef SIZEOF_LONG/* The size of `short', as computed by sizeof. */#undef SIZEOF_SHORT/* If using the C implementation of alloca, define if you know thedirection of stack growth for your system; otherwise it will beautomatically deduced at runtime.STACK_DIRECTION > 0 => grows toward higher addressesSTACK_DIRECTION < 0 => grows toward lower addressesSTACK_DIRECTION = 0 => direction of growth unknown */#undef STACK_DIRECTION/* Define to 1 if you have the ANSI C header files. */#undef STDC_HEADERS/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */#undef TIME_WITH_SYS_TIME/* Define if combination explosion check */#undef USE_COMBINATION_EXPLOSION_CHECK/* Define if enable CR+NL as line terminator */#undef USE_CRNL_AS_LINE_TERMINATOR/* Version number of package */#undef VERSION/* Define to empty if `const' does not conform to ANSI C. */#undef const
#! /bin/sh# Configuration validation subroutine script.# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,# Inc.timestamp='2006-09-20'# This file is (in principle) common to ALL GNU software.# The presence of a machine in this file suggests that SOME GNU software# can handle that machine. It does not imply ALL GNU software can.## This file is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## This program 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 General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA# 02110-1301, USA.## As a special exception to the GNU General Public License, if you# distribute this file as part of a program that contains a# configuration script generated by Autoconf, you may include it under# the same distribution terms that you use for the rest of that program.# Please send patches to <config-patches@gnu.org>. Submit a context# diff and a properly formatted ChangeLog entry.## Configuration subroutine to validate and canonicalize a configuration type.# Supply the specified configuration type as an argument.# If it is invalid, we print an error message on stderr and exit with code 1.# Otherwise, we print the canonical config type on stdout and succeed.# This file is supposed to be the same for all GNU packages# and recognize all the CPU types, system types and aliases# that are meaningful with *any* GNU software.# Each package is responsible for reporting which valid configurations# it does not support. The user should be able to distinguish# a failure to support a valid configuration from a meaningless# configuration.# The goal of this file is to map all the various variations of a given# machine specification into a single specification in the form:# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM# or in some cases, the newer four-part form:# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM# It is wrong to echo any other type of specification.me=`echo "$0" | sed -e 's,.*/,,'`usage="\Usage: $0 [OPTION] CPU-MFR-OPSYS$0 [OPTION] ALIASCanonicalize a configuration name.Operation modes:-h, --help print this help, then exit-t, --time-stamp print date of last modification, then exit-v, --version print version number, then exitReport bugs and patches to <config-patches@gnu.org>."version="\GNU config.sub ($timestamp)Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."help="Try \`$me --help' for more information."# Parse command linewhile test $# -gt 0 ; docase $1 in--time-stamp | --time* | -t )echo "$timestamp" ; exit ;;--version | -v )echo "$version" ; exit ;;--help | --h* | -h )echo "$usage"; exit ;;-- ) # Stop option processingshift; break ;;- ) # Use stdin as input.break ;;-* )echo "$me: invalid option $1$help"exit 1 ;;*local*)# First pass through any local machine types.echo $1exit ;;* )break ;;esacdonecase $# in0) echo "$me: missing argument$help" >&2exit 1;;1) ;;*) echo "$me: too many arguments$help" >&2exit 1;;esac# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).# Here we must recognize all the valid KERNEL-OS combinations.maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`case $maybe_os innto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \storm-chaos* | os2-emx* | rtmk-nova*)os=-$maybe_osbasic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`;;*)basic_machine=`echo $1 | sed 's/-[^-]*$//'`if [ $basic_machine != $1 ]then os=`echo $1 | sed 's/.*-/-/'`else os=; fi;;esac### Let's recognize common machines as not being operating systems so### that things like config.sub decstation-3100 work. We also### recognize some manufacturers as not being operating systems, so we### can provide default operating systems below.case $os in-sun*os*)# Prevent following clause from handling this invalid input.;;-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \-apple | -axis | -knuth | -cray)os=basic_machine=$1;;-sim | -cisco | -oki | -wec | -winbond)os=basic_machine=$1;;-scout);;-wrs)os=-vxworksbasic_machine=$1;;-chorusos*)os=-chorusosbasic_machine=$1;;-chorusrdb)os=-chorusrdbbasic_machine=$1;;-hiux*)os=-hiuxwe2;;-sco6)os=-sco5v6basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-sco5)os=-sco3.2v5basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-sco4)os=-sco3.2v4basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-sco3.2.[4-9]*)os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-sco3.2v[4-9]*)# Don't forget version if it is 3.2v4 or newer.basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-sco5v6*)# Don't forget version if it is 3.2v4 or newer.basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-sco*)os=-sco3.2v2basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-udk*)basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-isc)os=-isc2.2basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-clix*)basic_machine=clipper-intergraph;;-isc*)basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`;;-lynx*)os=-lynxos;;-ptx*)basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`;;-windowsnt*)os=`echo $os | sed -e 's/windowsnt/winnt/'`;;-psos*)os=-psos;;-mint | -mint[0-9]*)basic_machine=m68k-atarios=-mint;;esac# Decode aliases for certain CPU-COMPANY combinations.case $basic_machine in# Recognize the basic CPU types without company name.# Some are omitted here because they have special meanings below.1750a | 580 \| a29k \| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \| am33_2.0 \| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \| bfin \| c4x | clipper \| d10v | d30v | dlx | dsp16xx \| fr30 | frv \| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \| i370 | i860 | i960 | ia64 \| ip2k | iq2000 \| m32c | m32r | m32rle | m68000 | m68k | m88k \| maxq | mb | microblaze | mcore \| mips | mipsbe | mipseb | mipsel | mipsle \| mips16 \| mips64 | mips64el \| mips64vr | mips64vrel \| mips64orion | mips64orionel \| mips64vr4100 | mips64vr4100el \| mips64vr4300 | mips64vr4300el \| mips64vr5000 | mips64vr5000el \| mips64vr5900 | mips64vr5900el \| mipsisa32 | mipsisa32el \| mipsisa32r2 | mipsisa32r2el \| mipsisa64 | mipsisa64el \| mipsisa64r2 | mipsisa64r2el \| mipsisa64sb1 | mipsisa64sb1el \| mipsisa64sr71k | mipsisa64sr71kel \| mipstx39 | mipstx39el \| mn10200 | mn10300 \| mt \| msp430 \| nios | nios2 \| ns16k | ns32k \| or32 \| pdp10 | pdp11 | pj | pjl \| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \| pyramid \| score \| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \| sh64 | sh64le \| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \| sparcv8 | sparcv9 | sparcv9b | sparcv9v \| spu | strongarm \| tahoe | thumb | tic4x | tic80 | tron \| v850 | v850e \| we32k \| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \| z8k)basic_machine=$basic_machine-unknown;;m6811 | m68hc11 | m6812 | m68hc12)# Motorola 68HC11/12.basic_machine=$basic_machine-unknownos=-none;;m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k);;ms1)basic_machine=mt-unknown;;# We use `pc' rather than `unknown'# because (1) that's what they normally are, and# (2) the word "unknown" tends to confuse beginning users.i*86 | x86_64)basic_machine=$basic_machine-pc;;# Object if more than one company name word.*-*-*)echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2exit 1;;# Recognize the basic CPU types with company name.580-* \| a29k-* \| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \| arm-* | armbe-* | armle-* | armeb-* | armv*-* \| avr-* | avr32-* \| bfin-* | bs2000-* \| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \| clipper-* | craynv-* | cydra-* \| d10v-* | d30v-* | dlx-* \| elxsi-* \| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \| h8300-* | h8500-* \| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \| i*86-* | i860-* | i960-* | ia64-* \| ip2k-* | iq2000-* \| m32c-* | m32r-* | m32rle-* \| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \| m88110-* | m88k-* | maxq-* | mcore-* \| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \| mips16-* \| mips64-* | mips64el-* \| mips64vr-* | mips64vrel-* \| mips64orion-* | mips64orionel-* \| mips64vr4100-* | mips64vr4100el-* \| mips64vr4300-* | mips64vr4300el-* \| mips64vr5000-* | mips64vr5000el-* \| mips64vr5900-* | mips64vr5900el-* \| mipsisa32-* | mipsisa32el-* \| mipsisa32r2-* | mipsisa32r2el-* \| mipsisa64-* | mipsisa64el-* \| mipsisa64r2-* | mipsisa64r2el-* \| mipsisa64sb1-* | mipsisa64sb1el-* \| mipsisa64sr71k-* | mipsisa64sr71kel-* \| mipstx39-* | mipstx39el-* \| mmix-* \| mt-* \| msp430-* \| nios-* | nios2-* \| none-* | np1-* | ns16k-* | ns32k-* \| orion-* \| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \| pyramid-* \| romp-* | rs6000-* \| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \| sparclite-* \| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \| tahoe-* | thumb-* \| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \| tron-* \| v850-* | v850e-* | vax-* \| we32k-* \| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \| xstormy16-* | xtensa-* \| ymp-* \| z8k-*);;# Recognize the various machine names and aliases which stand# for a CPU type and a company and sometimes even an OS.386bsd)basic_machine=i386-unknownos=-bsd;;3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)basic_machine=m68000-att;;3b*)basic_machine=we32k-att;;a29khif)basic_machine=a29k-amdos=-udi;;abacus)basic_machine=abacus-unknown;;adobe68k)basic_machine=m68010-adobeos=-scout;;alliant | fx80)basic_machine=fx80-alliant;;altos | altos3068)basic_machine=m68k-altos;;am29k)basic_machine=a29k-noneos=-bsd;;amd64)basic_machine=x86_64-pc;;amd64-*)basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`;;amdahl)basic_machine=580-amdahlos=-sysv;;amiga | amiga-*)basic_machine=m68k-unknown;;amigaos | amigados)basic_machine=m68k-unknownos=-amigaos;;amigaunix | amix)basic_machine=m68k-unknownos=-sysv4;;apollo68)basic_machine=m68k-apolloos=-sysv;;apollo68bsd)basic_machine=m68k-apolloos=-bsd;;aux)basic_machine=m68k-appleos=-aux;;balance)basic_machine=ns32k-sequentos=-dynix;;c90)basic_machine=c90-crayos=-unicos;;convex-c1)basic_machine=c1-convexos=-bsd;;convex-c2)basic_machine=c2-convexos=-bsd;;convex-c32)basic_machine=c32-convexos=-bsd;;convex-c34)basic_machine=c34-convexos=-bsd;;convex-c38)basic_machine=c38-convexos=-bsd;;cray | j90)basic_machine=j90-crayos=-unicos;;craynv)basic_machine=craynv-crayos=-unicosmp;;cr16c)basic_machine=cr16c-unknownos=-elf;;crds | unos)basic_machine=m68k-crds;;crisv32 | crisv32-* | etraxfs*)basic_machine=crisv32-axis;;cris | cris-* | etrax*)basic_machine=cris-axis;;crx)basic_machine=crx-unknownos=-elf;;da30 | da30-*)basic_machine=m68k-da30;;decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)basic_machine=mips-dec;;decsystem10* | dec10*)basic_machine=pdp10-decos=-tops10;;decsystem20* | dec20*)basic_machine=pdp10-decos=-tops20;;delta | 3300 | motorola-3300 | motorola-delta \| 3300-motorola | delta-motorola)basic_machine=m68k-motorola;;delta88)basic_machine=m88k-motorolaos=-sysv3;;djgpp)basic_machine=i586-pcos=-msdosdjgpp;;dpx20 | dpx20-*)basic_machine=rs6000-bullos=-bosx;;dpx2* | dpx2*-bull)basic_machine=m68k-bullos=-sysv3;;ebmon29k)basic_machine=a29k-amdos=-ebmon;;elxsi)basic_machine=elxsi-elxsios=-bsd;;encore | umax | mmax)basic_machine=ns32k-encore;;es1800 | OSE68k | ose68k | ose | OSE)basic_machine=m68k-ericssonos=-ose;;fx2800)basic_machine=i860-alliant;;genix)basic_machine=ns32k-ns;;gmicro)basic_machine=tron-gmicroos=-sysv;;go32)basic_machine=i386-pcos=-go32;;h3050r* | hiux*)basic_machine=hppa1.1-hitachios=-hiuxwe2;;h8300hms)basic_machine=h8300-hitachios=-hms;;h8300xray)basic_machine=h8300-hitachios=-xray;;h8500hms)basic_machine=h8500-hitachios=-hms;;harris)basic_machine=m88k-harrisos=-sysv3;;hp300-*)basic_machine=m68k-hp;;hp300bsd)basic_machine=m68k-hpos=-bsd;;hp300hpux)basic_machine=m68k-hpos=-hpux;;hp3k9[0-9][0-9] | hp9[0-9][0-9])basic_machine=hppa1.0-hp;;hp9k2[0-9][0-9] | hp9k31[0-9])basic_machine=m68000-hp;;hp9k3[2-9][0-9])basic_machine=m68k-hp;;hp9k6[0-9][0-9] | hp6[0-9][0-9])basic_machine=hppa1.0-hp;;hp9k7[0-79][0-9] | hp7[0-79][0-9])basic_machine=hppa1.1-hp;;hp9k78[0-9] | hp78[0-9])# FIXME: really hppa2.0-hpbasic_machine=hppa1.1-hp;;hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)# FIXME: really hppa2.0-hpbasic_machine=hppa1.1-hp;;hp9k8[0-9][13679] | hp8[0-9][13679])basic_machine=hppa1.1-hp;;hp9k8[0-9][0-9] | hp8[0-9][0-9])basic_machine=hppa1.0-hp;;hppa-next)os=-nextstep3;;hppaosf)basic_machine=hppa1.1-hpos=-osf;;hppro)basic_machine=hppa1.1-hpos=-proelf;;i370-ibm* | ibm*)basic_machine=i370-ibm;;# I'm not sure what "Sysv32" means. Should this be sysv3.2?i*86v32)basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`os=-sysv32;;i*86v4*)basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`os=-sysv4;;i*86v)basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`os=-sysv;;i*86sol2)basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`os=-solaris2;;i386mach)basic_machine=i386-machos=-mach;;i386-vsta | vsta)basic_machine=i386-unknownos=-vsta;;iris | iris4d)basic_machine=mips-sgicase $os in-irix*);;*)os=-irix4;;esac;;isi68 | isi)basic_machine=m68k-isios=-sysv;;m88k-omron*)basic_machine=m88k-omron;;magnum | m3230)basic_machine=mips-mipsos=-sysv;;merlin)basic_machine=ns32k-utekos=-sysv;;mingw32)basic_machine=i386-pcos=-mingw32;;miniframe)basic_machine=m68000-convergent;;*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)basic_machine=m68k-atarios=-mint;;mips3*-*)basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`;;mips3*)basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown;;monitor)basic_machine=m68k-rom68kos=-coff;;morphos)basic_machine=powerpc-unknownos=-morphos;;msdos)basic_machine=i386-pcos=-msdos;;ms1-*)basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`;;mvs)basic_machine=i370-ibmos=-mvs;;ncr3000)basic_machine=i486-ncros=-sysv4;;netbsd386)basic_machine=i386-unknownos=-netbsd;;netwinder)basic_machine=armv4l-rebelos=-linux;;news | news700 | news800 | news900)basic_machine=m68k-sonyos=-newsos;;news1000)basic_machine=m68030-sonyos=-newsos;;news-3600 | risc-news)basic_machine=mips-sonyos=-newsos;;necv70)basic_machine=v70-necos=-sysv;;next | m*-next )basic_machine=m68k-nextcase $os in-nextstep* );;-ns2*)os=-nextstep2;;*)os=-nextstep3;;esac;;nh3000)basic_machine=m68k-harrisos=-cxux;;nh[45]000)basic_machine=m88k-harrisos=-cxux;;nindy960)basic_machine=i960-intelos=-nindy;;mon960)basic_machine=i960-intelos=-mon960;;nonstopux)basic_machine=mips-compaqos=-nonstopux;;np1)basic_machine=np1-gould;;nsr-tandem)basic_machine=nsr-tandem;;op50n-* | op60c-*)basic_machine=hppa1.1-okios=-proelf;;openrisc | openrisc-*)basic_machine=or32-unknown;;os400)basic_machine=powerpc-ibmos=-os400;;OSE68000 | ose68000)basic_machine=m68000-ericssonos=-ose;;os68k)basic_machine=m68k-noneos=-os68k;;pa-hitachi)basic_machine=hppa1.1-hitachios=-hiuxwe2;;paragon)basic_machine=i860-intelos=-osf;;pbd)basic_machine=sparc-tti;;pbb)basic_machine=m68k-tti;;pc532 | pc532-*)basic_machine=ns32k-pc532;;pc98)basic_machine=i386-pc;;pc98-*)basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`;;pentium | p5 | k5 | k6 | nexgen | viac3)basic_machine=i586-pc;;pentiumpro | p6 | 6x86 | athlon | athlon_*)basic_machine=i686-pc;;pentiumii | pentium2 | pentiumiii | pentium3)basic_machine=i686-pc;;pentium4)basic_machine=i786-pc;;pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`;;pentiumpro-* | p6-* | 6x86-* | athlon-*)basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`;;pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`;;pentium4-*)basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`;;pn)basic_machine=pn-gould;;power) basic_machine=power-ibm;;ppc) basic_machine=powerpc-unknown;;ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`;;ppcle | powerpclittle | ppc-le | powerpc-little)basic_machine=powerpcle-unknown;;ppcle-* | powerpclittle-*)basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`;;ppc64) basic_machine=powerpc64-unknown;;ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`;;ppc64le | powerpc64little | ppc64-le | powerpc64-little)basic_machine=powerpc64le-unknown;;ppc64le-* | powerpc64little-*)basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`;;ps2)basic_machine=i386-ibm;;pw32)basic_machine=i586-unknownos=-pw32;;rdos)basic_machine=i386-pcos=-rdos;;rom68k)basic_machine=m68k-rom68kos=-coff;;rm[46]00)basic_machine=mips-siemens;;rtpc | rtpc-*)basic_machine=romp-ibm;;s390 | s390-*)basic_machine=s390-ibm;;s390x | s390x-*)basic_machine=s390x-ibm;;sa29200)basic_machine=a29k-amdos=-udi;;sb1)basic_machine=mipsisa64sb1-unknown;;sb1el)basic_machine=mipsisa64sb1el-unknown;;sde)basic_machine=mipsisa32-sdeos=-elf;;sei)basic_machine=mips-seios=-seiux;;sequent)basic_machine=i386-sequent;;sh)basic_machine=sh-hitachios=-hms;;sh64)basic_machine=sh64-unknown;;sparclite-wrs | simso-wrs)basic_machine=sparclite-wrsos=-vxworks;;sps7)basic_machine=m68k-bullos=-sysv2;;spur)basic_machine=spur-unknown;;st2000)basic_machine=m68k-tandem;;stratus)basic_machine=i860-stratusos=-sysv4;;sun2)basic_machine=m68000-sun;;sun2os3)basic_machine=m68000-sunos=-sunos3;;sun2os4)basic_machine=m68000-sunos=-sunos4;;sun3os3)basic_machine=m68k-sunos=-sunos3;;sun3os4)basic_machine=m68k-sunos=-sunos4;;sun4os3)basic_machine=sparc-sunos=-sunos3;;sun4os4)basic_machine=sparc-sunos=-sunos4;;sun4sol2)basic_machine=sparc-sunos=-solaris2;;sun3 | sun3-*)basic_machine=m68k-sun;;sun4)basic_machine=sparc-sun;;sun386 | sun386i | roadrunner)basic_machine=i386-sun;;sv1)basic_machine=sv1-crayos=-unicos;;symmetry)basic_machine=i386-sequentos=-dynix;;t3e)basic_machine=alphaev5-crayos=-unicos;;t90)basic_machine=t90-crayos=-unicos;;tic54x | c54x*)basic_machine=tic54x-unknownos=-coff;;tic55x | c55x*)basic_machine=tic55x-unknownos=-coff;;tic6x | c6x*)basic_machine=tic6x-unknownos=-coff;;tx39)basic_machine=mipstx39-unknown;;tx39el)basic_machine=mipstx39el-unknown;;toad1)basic_machine=pdp10-xklos=-tops20;;tower | tower-32)basic_machine=m68k-ncr;;tpf)basic_machine=s390x-ibmos=-tpf;;udi29k)basic_machine=a29k-amdos=-udi;;ultra3)basic_machine=a29k-nyuos=-sym1;;v810 | necv810)basic_machine=v810-necos=-none;;vaxv)basic_machine=vax-decos=-sysv;;vms)basic_machine=vax-decos=-vms;;vpp*|vx|vx-*)basic_machine=f301-fujitsu;;vxworks960)basic_machine=i960-wrsos=-vxworks;;vxworks68)basic_machine=m68k-wrsos=-vxworks;;vxworks29k)basic_machine=a29k-wrsos=-vxworks;;w65*)basic_machine=w65-wdcos=-none;;w89k-*)basic_machine=hppa1.1-winbondos=-proelf;;xbox)basic_machine=i686-pcos=-mingw32;;xps | xps100)basic_machine=xps100-honeywell;;ymp)basic_machine=ymp-crayos=-unicos;;z8k-*-coff)basic_machine=z8k-unknownos=-sim;;none)basic_machine=none-noneos=-none;;# Here we handle the default manufacturer of certain CPU types. It is in# some cases the only manufacturer, in others, it is the most popular.w89k)basic_machine=hppa1.1-winbond;;op50n)basic_machine=hppa1.1-oki;;op60c)basic_machine=hppa1.1-oki;;romp)basic_machine=romp-ibm;;mmix)basic_machine=mmix-knuth;;rs6000)basic_machine=rs6000-ibm;;vax)basic_machine=vax-dec;;pdp10)# there are many clones, so DEC is not a safe betbasic_machine=pdp10-unknown;;pdp11)basic_machine=pdp11-dec;;we32k)basic_machine=we32k-att;;sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)basic_machine=sh-unknown;;sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)basic_machine=sparc-sun;;cydra)basic_machine=cydra-cydrome;;orion)basic_machine=orion-highlevel;;orion105)basic_machine=clipper-highlevel;;mac | mpw | mac-mpw)basic_machine=m68k-apple;;pmac | pmac-mpw)basic_machine=powerpc-apple;;*-unknown)# Make sure to match an already-canonicalized machine name.;;*)echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2exit 1;;esac# Here we canonicalize certain aliases for manufacturers.case $basic_machine in*-digital*)basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`;;*-commodore*)basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`;;*);;esac# Decode manufacturer-specific aliases for certain operating systems.if [ x"$os" != x"" ]thencase $os in# First match some system type aliases# that might get confused with valid system types.# -solaris* is a basic system type, with this one exception.-solaris1 | -solaris1.*)os=`echo $os | sed -e 's|solaris1|sunos4|'`;;-solaris)os=-solaris2;;-svr4*)os=-sysv4;;-unixware*)os=-sysv4.2uw;;-gnu/linux*)os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`;;# First accept the basic system types.# The portable systems comes first.# Each alternative MUST END IN A *, to match a version number.# -sysv* is not here because it comes later, after sysvr4.-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \| -aos* \| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \| -openbsd* | -solidbsd* \| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \| -chorusos* | -chorusrdb* \| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \| -uxpv* | -beos* | -mpeix* | -udk* \| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \| -skyos* | -haiku* | -rdos* | -toppers*)# Remember, each alternative MUST END IN *, to match a version number.;;-qnx*)case $basic_machine inx86-* | i*86-*);;*)os=-nto$os;;esac;;-nto-qnx*);;-nto*)os=`echo $os | sed -e 's|nto|nto-qnx|'`;;-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*);;-mac*)os=`echo $os | sed -e 's|mac|macos|'`;;-linux-dietlibc)os=-linux-dietlibc;;-linux*)os=`echo $os | sed -e 's|linux|linux-gnu|'`;;-sunos5*)os=`echo $os | sed -e 's|sunos5|solaris2|'`;;-sunos6*)os=`echo $os | sed -e 's|sunos6|solaris3|'`;;-opened*)os=-openedition;;-os400*)os=-os400;;-wince*)os=-wince;;-osfrose*)os=-osfrose;;-osf*)os=-osf;;-utek*)os=-bsd;;-dynix*)os=-bsd;;-acis*)os=-aos;;-atheos*)os=-atheos;;-syllable*)os=-syllable;;-386bsd)os=-bsd;;-ctix* | -uts*)os=-sysv;;-nova*)os=-rtmk-nova;;-ns2 )os=-nextstep2;;-nsk*)os=-nsk;;# Preserve the version number of sinix5.-sinix5.*)os=`echo $os | sed -e 's|sinix|sysv|'`;;-sinix*)os=-sysv4;;-tpf*)os=-tpf;;-triton*)os=-sysv3;;-oss*)os=-sysv3;;-svr4)os=-sysv4;;-svr3)os=-sysv3;;-sysvr4)os=-sysv4;;# This must come after -sysvr4.-sysv*);;-ose*)os=-ose;;-es1800*)os=-ose;;-xenix)os=-xenix;;-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)os=-mint;;-aros*)os=-aros;;-kaos*)os=-kaos;;-zvmoe)os=-zvmoe;;-none);;*)# Get rid of the `-' at the beginning of $os.os=`echo $os | sed 's/[^-]*-//'`echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2exit 1;;esacelse# Here we handle the default operating systems that come with various machines.# The value should be what the vendor currently ships out the door with their# machine or put another way, the most popular os provided with the machine.# Note that if you're going to try to match "-MANUFACTURER" here (say,# "-sun"), then you have to tell the case statement up towards the top# that MANUFACTURER isn't an operating system. Otherwise, code above# will signal an error saying that MANUFACTURER isn't an operating# system, and we'll never get to this point.case $basic_machine inscore-*)os=-elf;;spu-*)os=-elf;;*-acorn)os=-riscix1.2;;arm*-rebel)os=-linux;;arm*-semi)os=-aout;;c4x-* | tic4x-*)os=-coff;;# This must come before the *-dec entry.pdp10-*)os=-tops20;;pdp11-*)os=-none;;*-dec | vax-*)os=-ultrix4.2;;m68*-apollo)os=-domain;;i386-sun)os=-sunos4.0.2;;m68000-sun)os=-sunos3# This also exists in the configure program, but was not the# default.# os=-sunos4;;m68*-cisco)os=-aout;;mips*-cisco)os=-elf;;mips*-*)os=-elf;;or32-*)os=-coff;;*-tti) # must be before sparc entry or we get the wrong os.os=-sysv3;;sparc-* | *-sun)os=-sunos4.1.1;;*-be)os=-beos;;*-haiku)os=-haiku;;*-ibm)os=-aix;;*-knuth)os=-mmixware;;*-wec)os=-proelf;;*-winbond)os=-proelf;;*-oki)os=-proelf;;*-hp)os=-hpux;;*-hitachi)os=-hiux;;i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)os=-sysv;;*-cbm)os=-amigaos;;*-dg)os=-dgux;;*-dolphin)os=-sysv3;;m68k-ccur)os=-rtu;;m88k-omron*)os=-luna;;*-next )os=-nextstep;;*-sequent)os=-ptx;;*-crds)os=-unos;;*-ns)os=-genix;;i370-*)os=-mvs;;*-next)os=-nextstep3;;*-gould)os=-sysv;;*-highlevel)os=-bsd;;*-encore)os=-bsd;;*-sgi)os=-irix;;*-siemens)os=-sysv4;;*-masscomp)os=-rtu;;f30[01]-fujitsu | f700-fujitsu)os=-uxpv;;*-rom68k)os=-coff;;*-*bug)os=-coff;;*-apple)os=-macos;;*-atari*)os=-mint;;*)os=-none;;esacfi# Here we handle the case where we know the os, and the CPU type, but not the# manufacturer. We pick the logical manufacturer.vendor=unknowncase $basic_machine in*-unknown)case $os in-riscix*)vendor=acorn;;-sunos*)vendor=sun;;-aix*)vendor=ibm;;-beos*)vendor=be;;-hpux*)vendor=hp;;-mpeix*)vendor=hp;;-hiux*)vendor=hitachi;;-unos*)vendor=crds;;-dgux*)vendor=dg;;-luna*)vendor=omron;;-genix*)vendor=ns;;-mvs* | -opened*)vendor=ibm;;-os400*)vendor=ibm;;-ptx*)vendor=sequent;;-tpf*)vendor=ibm;;-vxsim* | -vxworks* | -windiss*)vendor=wrs;;-aux*)vendor=apple;;-hms*)vendor=hitachi;;-mpw* | -macos*)vendor=apple;;-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)vendor=atari;;-vos*)vendor=stratus;;esacbasic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`;;esacecho $basic_machine$osexit# Local variables:# eval: (add-hook 'write-file-hooks 'time-stamp)# time-stamp-start: "timestamp='"# time-stamp-format: "%:y-%02m-%02d"# time-stamp-end: "'"# End:
#! /bin/sh# Guess values for system-dependent variables and create Makefiles.# Generated by GNU Autoconf 2.61 for onig 5.9.2.## Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.# This configure script is free software; the Free Software Foundation# gives unlimited permission to copy, distribute and modify it.## --------------------- #### M4sh Initialization. #### --------------------- ### Be more Bourne compatibleDUALCASE=1; export DUALCASE # for MKS shif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; thenemulate shNULLCMD=:# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which# is contrary to our usage. Disable this feature.alias -g '${1+"$@"}'='"$@"'setopt NO_GLOB_SUBSTelsecase `(set -o) 2>/dev/null` in*posix*) set -o posix ;;esacfi# PATH needs CR# Avoid depending upon Character Ranges.as_cr_letters='abcdefghijklmnopqrstuvwxyz'as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'as_cr_Letters=$as_cr_letters$as_cr_LETTERSas_cr_digits='0123456789'as_cr_alnum=$as_cr_Letters$as_cr_digits# The user is always right.if test "${PATH_SEPARATOR+set}" != set; thenecho "#! /bin/sh" >conf$$.shecho "exit 0" >>conf$$.shchmod +x conf$$.shif (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; thenPATH_SEPARATOR=';'elsePATH_SEPARATOR=:firm -f conf$$.shfi# Support unset when possible.if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; thenas_unset=unsetelseas_unset=falsefi# IFS# We need space, tab and new line, in precisely that order. Quoting is# there to prevent editors from complaining about space-tab.# (If _AS_PATH_WALK were called with IFS unset, it would disable word# splitting by setting IFS to empty value.)as_nl=''IFS=" "" $as_nl"# Find who we are. Look in the path if we contain no directory separator.case $0 in*[\\/]* ) as_myself=$0 ;;*) as_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.test -r "$as_dir/$0" && as_myself=$as_dir/$0 && breakdoneIFS=$as_save_IFS;;esac# We did not find ourselves, most probably we were run as `sh COMMAND'# in which case we are not to be found in the path.if test "x$as_myself" = x; thenas_myself=$0fiif test ! -f "$as_myself"; thenecho "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2{ (exit 1); exit 1; }fi# Work around bugs in pre-3.0 UWIN ksh.for as_var in ENV MAIL MAILPATHdo ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_vardonePS1='$ 'PS2='> 'PS4='+ '# NLS nuisances.for as_var in \LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \LC_TELEPHONE LC_TIMEdoif (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); theneval $as_var=C; export $as_varelse($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_varfidone# Required to use basename.if expr a : '\(a\)' >/dev/null 2>&1 &&test "X`expr 00001 : '.*\(...\)'`" = X001; thenas_expr=exprelseas_expr=falsefiif (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; thenas_basename=basenameelseas_basename=falsefi# Name of the executable.as_me=`$as_basename -- "$0" ||$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \X"$0" : 'X\(//\)$' \| \X"$0" : 'X\(/\)' \| . 2>/dev/null ||echo X/"$0" |sed '/^.*\/\([^/][^/]*\)\/*$/{s//\1/q}/^X\/\(\/\/\)$/{s//\1/q}/^X\/\(\/\).*/{s//\1/q}s/.*/./; q'`# CDPATH.$as_unset CDPATHif test "x$CONFIG_SHELL" = x; thenif (eval ":") 2>/dev/null; thenas_have_required=yeselseas_have_required=nofiif test $as_have_required = yes && (eval ":(as_func_return () {(exit \$1)}as_func_success () {as_func_return 0}as_func_failure () {as_func_return 1}as_func_ret_success () {return 0}as_func_ret_failure () {return 1}exitcode=0if as_func_success; then:elseexitcode=1echo as_func_success failed.fiif as_func_failure; thenexitcode=1echo as_func_failure succeeded.fiif as_func_ret_success; then:elseexitcode=1echo as_func_ret_success failed.fiif as_func_ret_failure; thenexitcode=1echo as_func_ret_failure succeeded.fiif ( set x; as_func_ret_success y && test x = \"\$1\" ); then:elseexitcode=1echo positional parameters were not saved.fitest \$exitcode = 0) || { (exit 1); exit 1; }(as_lineno_1=\$LINENOas_lineno_2=\$LINENOtest \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }") 2> /dev/null; then:elseas_candidate_shells=as_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.case $as_dir in/*)for as_base in sh bash ksh sh5; doas_candidate_shells="$as_candidate_shells $as_dir/$as_base"done;;esacdoneIFS=$as_save_IFSfor as_shell in $as_candidate_shells $SHELL; do# Try only shells that exist, to save several forks.if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&{ ("$as_shell") 2> /dev/null <<\_ASEOFif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; thenemulate shNULLCMD=:# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which# is contrary to our usage. Disable this feature.alias -g '${1+"$@"}'='"$@"'setopt NO_GLOB_SUBSTelsecase `(set -o) 2>/dev/null` in*posix*) set -o posix ;;esacfi:_ASEOF}; thenCONFIG_SHELL=$as_shellas_have_required=yesif { "$as_shell" 2> /dev/null <<\_ASEOFif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; thenemulate shNULLCMD=:# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which# is contrary to our usage. Disable this feature.alias -g '${1+"$@"}'='"$@"'setopt NO_GLOB_SUBSTelsecase `(set -o) 2>/dev/null` in*posix*) set -o posix ;;esacfi:(as_func_return () {(exit $1)}as_func_success () {as_func_return 0}as_func_failure () {as_func_return 1}as_func_ret_success () {return 0}as_func_ret_failure () {return 1}exitcode=0if as_func_success; then:elseexitcode=1echo as_func_success failed.fiif as_func_failure; thenexitcode=1echo as_func_failure succeeded.fiif as_func_ret_success; then:elseexitcode=1echo as_func_ret_success failed.fiif as_func_ret_failure; thenexitcode=1echo as_func_ret_failure succeeded.fiif ( set x; as_func_ret_success y && test x = "$1" ); then:elseexitcode=1echo positional parameters were not saved.fitest $exitcode = 0) || { (exit 1); exit 1; }(as_lineno_1=$LINENOas_lineno_2=$LINENOtest "x$as_lineno_1" != "x$as_lineno_2" &&test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }_ASEOF}; thenbreakfifidoneif test "x$CONFIG_SHELL" != x; thenfor as_var in BASH_ENV ENVdo ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_vardoneexport CONFIG_SHELLexec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}fiif test $as_have_required = no; thenecho This script requires a shell more modern than all theecho shells that I found on your system. Please install aecho modern shell, or manually run the script under such aecho shell if you do have one.{ (exit 1); exit 1; }fififi(eval "as_func_return () {(exit \$1)}as_func_success () {as_func_return 0}as_func_failure () {as_func_return 1}as_func_ret_success () {return 0}as_func_ret_failure () {return 1}exitcode=0if as_func_success; then:elseexitcode=1echo as_func_success failed.fiif as_func_failure; thenexitcode=1echo as_func_failure succeeded.fiif as_func_ret_success; then:elseexitcode=1echo as_func_ret_success failed.fiif as_func_ret_failure; thenexitcode=1echo as_func_ret_failure succeeded.fiif ( set x; as_func_ret_success y && test x = \"\$1\" ); then:elseexitcode=1echo positional parameters were not saved.fitest \$exitcode = 0") || {echo No shell found that supports shell functions.echo Please tell autoconf@gnu.org about your system,echo including any error possibly output before thisecho message}as_lineno_1=$LINENOas_lineno_2=$LINENOtest "x$as_lineno_1" != "x$as_lineno_2" &&test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {# Create $as_me.lineno as a copy of $as_myself, but with $LINENO# uniformly replaced by the line number. The first 'sed' inserts a# line-number line after each line using $LINENO; the second 'sed'# does the real work. The second script uses 'N' to pair each# line-number line with the line containing $LINENO, and appends# trailing '-' during substitution so that $LINENO is not a special# case at line end.# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the# scripts with optimization help from Paolo Bonzini. Blame Lee# E. McMahon (1931-1989) for sed's syntax. :-)sed -n 'p/[$]LINENO/=' <$as_myself |sed 's/[$]LINENO.*/&-/t linenob:linenoN:loops/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/t loops/-\n.*//' >$as_me.lineno &&chmod +x "$as_me.lineno" ||{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2{ (exit 1); exit 1; }; }# Don't try to exec as it changes $[0], causing all sort of problems# (the dirname of $[0] is not the place where we might find the# original and so on. Autoconf is especially sensitive to this).. "./$as_me.lineno"# Exit status is that of the last command.exit}if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; thenas_dirname=dirnameelseas_dirname=falsefiECHO_C= ECHO_N= ECHO_T=case `echo -n x` in-n*)case `echo 'x\c'` in*c*) ECHO_T=' ';; # ECHO_T is single tab character.*) ECHO_C='\c';;esac;;*)ECHO_N='-n';;esacif expr a : '\(a\)' >/dev/null 2>&1 &&test "X`expr 00001 : '.*\(...\)'`" = X001; thenas_expr=exprelseas_expr=falsefirm -f conf$$ conf$$.exe conf$$.fileif test -d conf$$.dir; thenrm -f conf$$.dir/conf$$.fileelserm -f conf$$.dirmkdir conf$$.dirfiecho >conf$$.fileif ln -s conf$$.file conf$$ 2>/dev/null; thenas_ln_s='ln -s'# ... but there are two gotchas:# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.# In both cases, we have to default to `cp -p'.ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||as_ln_s='cp -p'elif ln conf$$.file conf$$ 2>/dev/null; thenas_ln_s=lnelseas_ln_s='cp -p'firm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.filermdir conf$$.dir 2>/dev/nullif mkdir -p . 2>/dev/null; thenas_mkdir_p=:elsetest -d ./-p && rmdir ./-pas_mkdir_p=falsefiif test -x / >/dev/null 2>&1; thenas_test_x='test -x'elseif ls -dL / >/dev/null 2>&1; thenas_ls_L_option=Lelseas_ls_L_option=fias_test_x='eval sh -c '\''if test -d "$1"; thentest -d "$1/.";elsecase $1 in-*)set "./$1";;esac;case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in???[sx]*):;;*)false;;esac;fi'\'' sh'fias_executable_p=$as_test_x# Sed expression to map a string onto a valid CPP name.as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"# Sed expression to map a string onto a valid variable name.as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"# Check that we are running under the correct shell.SHELL=${CONFIG_SHELL-/bin/sh}case X$lt_ECHO inX*--fallback-echo)# Remove one level of quotation (which was required for Make).ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`;;esacECHO=${lt_ECHO-echo}if test "X$1" = X--no-reexec; then# Discard the --no-reexec flag, and continue.shiftelif test "X$1" = X--fallback-echo; then# Avoid inline document here, it may be left over:elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then# Yippee, $ECHO works!:else# Restart under the correct shell.exec $SHELL "$0" --no-reexec ${1+"$@"}fiif test "X$1" = X--fallback-echo; then# used as fallback echoshiftcat <<_LT_EOF$*_LT_EOFexit 0fi# The HP-UX ksh and POSIX shell print the target directory to stdout# if CDPATH is set.(unset CDPATH) >/dev/null 2>&1 && unset CDPATHif test -z "$lt_ECHO"; thenif test "X${echo_test_string+set}" != Xset; then# find a string as large as possible, as long as the shell can cope with itfor cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...if { echo_test_string=`eval $cmd`; } 2>/dev/null &&{ test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/nullthenbreakfidonefiif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; then:else# The Solaris, AIX, and Digital Unix default echo programs unquote# backslashes. This makes it impossible to quote backslashes using# echo "$something" | sed 's/\\/\\\\/g'## So, first we look for a working echo in the user's PATH.lt_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor dir in $PATH /usr/ucb; doIFS="$lt_save_ifs"if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; thenECHO="$dir/echo"breakfidoneIFS="$lt_save_ifs"if test "X$ECHO" = Xecho; then# We didn't find a better echo, so look for alternatives.if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; then# This shell has a builtin print -r that does the trick.ECHO='print -r'elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&test "X$CONFIG_SHELL" != X/bin/ksh; then# If we have ksh, try running configure again with it.ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}export ORIGINAL_CONFIG_SHELLCONFIG_SHELL=/bin/kshexport CONFIG_SHELLexec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}else# Try using printf.ECHO='printf %s\n'if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; then# Cool, printf works:elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&test "X$echo_testing_string" = 'X\t' &&echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; thenCONFIG_SHELL=$ORIGINAL_CONFIG_SHELLexport CONFIG_SHELLSHELL="$CONFIG_SHELL"export SHELLECHO="$CONFIG_SHELL $0 --fallback-echo"elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&test "X$echo_testing_string" = 'X\t' &&echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&test "X$echo_testing_string" = "X$echo_test_string"; thenECHO="$CONFIG_SHELL $0 --fallback-echo"else# maybe with a smaller string...prev=:for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; doif { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/nullthenbreakfiprev="$cmd"doneif test "$prev" != 'sed 50q "$0"'; thenecho_test_string=`eval $prev`export echo_test_stringexec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}else# Oops. We lost completely, so just stick with echo.ECHO=echofifififififi# Copy echo and quote the copy suitably for passing to libtool from# the Makefile, instead of quoting the original, which is used later.lt_ECHO=$ECHOif test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; thenlt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"fiexec 7<&0 </dev/null 6>&1# Name of the host.# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,# so uname gets run too.ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`## Initializations.#ac_default_prefix=/usr/localac_clean_files=ac_config_libobj_dir=.LIBOBJS=cross_compiling=nosubdirs=MFLAGS=MAKEFLAGS=SHELL=${CONFIG_SHELL-/bin/sh}# Identity of this package.PACKAGE_NAME='onig'PACKAGE_TARNAME='onig'PACKAGE_VERSION='5.9.2'PACKAGE_STRING='onig 5.9.2'PACKAGE_BUGREPORT=''# Factoring default headers for most tests.ac_includes_default="\#include <stdio.h>#ifdef HAVE_SYS_TYPES_H# include <sys/types.h>#endif#ifdef HAVE_SYS_STAT_H# include <sys/stat.h>#endif#ifdef STDC_HEADERS# include <stdlib.h># include <stddef.h>#else# ifdef HAVE_STDLIB_H# include <stdlib.h># endif#endif#ifdef HAVE_STRING_H# if !defined STDC_HEADERS && defined HAVE_MEMORY_H# include <memory.h># endif# include <string.h>#endif#ifdef HAVE_STRINGS_H# include <strings.h>#endif#ifdef HAVE_INTTYPES_H# include <inttypes.h>#endif#ifdef HAVE_STDINT_H# include <stdint.h>#endif#ifdef HAVE_UNISTD_H# include <unistd.h>#endif"ac_subst_vars='SHELLPATH_SEPARATORPACKAGE_NAMEPACKAGE_TARNAMEPACKAGE_VERSIONPACKAGE_STRINGPACKAGE_BUGREPORTexec_prefixprefixprogram_transform_namebindirsbindirlibexecdirdatarootdirdatadirsysconfdirsharedstatedirlocalstatedirincludediroldincludedirdocdirinfodirhtmldirdvidirpdfdirpsdirlibdirlocaledirmandirDEFSECHO_CECHO_NECHO_TLIBSbuild_aliashost_aliastarget_aliasINSTALL_PROGRAMINSTALL_SCRIPTINSTALL_DATAam__isrcCYGPATH_WPACKAGEVERSIONACLOCALAUTOCONFAUTOMAKEAUTOHEADERMAKEINFOinstall_shSTRIPINSTALL_STRIP_PROGRAMmkdir_pAWKSET_MAKEam__leading_dotAMTARam__taram__untarRUBYDIRSTATISTICSCCCFLAGSLDFLAGSCPPFLAGSac_ct_CCEXEEXTOBJEXTDEPDIRam__includeam__quoteAMDEP_TRUEAMDEP_FALSEAMDEPBACKSLASHCCDEPMODEam__fastdepCC_TRUEam__fastdepCC_FALSELIBTOOLbuildbuild_cpubuild_vendorbuild_oshosthost_cpuhost_vendorhost_osSEDGREPEGREPFGREPLDDUMPBINac_ct_DUMPBINNMLN_SARRANLIBlt_ECHODSYMUTILNMEDITLIPOOTOOLOTOOL64CPPLTVERSIONALLOCALIBOBJSLTLIBOBJS'ac_subst_files=''ac_precious_vars='build_aliashost_aliastarget_aliasCCCFLAGSLDFLAGSLIBSCPPFLAGSCPP'# Initialize some variables set by options.ac_init_help=ac_init_version=false# The variables have the same names as the options, with# dashes changed to underlines.cache_file=/dev/nullexec_prefix=NONEno_create=no_recursion=prefix=NONEprogram_prefix=NONEprogram_suffix=NONEprogram_transform_name=s,x,x,silent=site=srcdir=verbose=x_includes=NONEx_libraries=NONE# Installation directory options.# These are left unexpanded so users can "make install exec_prefix=/foo"# and all the variables that are supposed to be based on exec_prefix# by default will actually change.# Use braces instead of parens because sh, perl, etc. also accept them.# (The list follows the same order as the GNU Coding Standards.)bindir='${exec_prefix}/bin'sbindir='${exec_prefix}/sbin'libexecdir='${exec_prefix}/libexec'datarootdir='${prefix}/share'datadir='${datarootdir}'sysconfdir='${prefix}/etc'sharedstatedir='${prefix}/com'localstatedir='${prefix}/var'includedir='${prefix}/include'oldincludedir='/usr/include'docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'infodir='${datarootdir}/info'htmldir='${docdir}'dvidir='${docdir}'pdfdir='${docdir}'psdir='${docdir}'libdir='${exec_prefix}/lib'localedir='${datarootdir}/locale'mandir='${datarootdir}/man'ac_prev=ac_dashdash=for ac_optiondo# If the previous option needs an argument, assign it.if test -n "$ac_prev"; theneval $ac_prev=\$ac_optionac_prev=continueficase $ac_option in*=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;*) ac_optarg=yes ;;esac# Accept the important Cygnus configure options, so we can diagnose typos.case $ac_dashdash$ac_option in--)ac_dashdash=yes ;;-bindir | --bindir | --bindi | --bind | --bin | --bi)ac_prev=bindir ;;-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)bindir=$ac_optarg ;;-build | --build | --buil | --bui | --bu)ac_prev=build_alias ;;-build=* | --build=* | --buil=* | --bui=* | --bu=*)build_alias=$ac_optarg ;;-cache-file | --cache-file | --cache-fil | --cache-fi \| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)ac_prev=cache_file ;;-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)cache_file=$ac_optarg ;;--config-cache | -C)cache_file=config.cache ;;-datadir | --datadir | --datadi | --datad)ac_prev=datadir ;;-datadir=* | --datadir=* | --datadi=* | --datad=*)datadir=$ac_optarg ;;-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \| --dataroo | --dataro | --datar)ac_prev=datarootdir ;;-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)datarootdir=$ac_optarg ;;-disable-* | --disable-*)ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`# Reject names that are not valid shell variable names.expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&{ echo "$as_me: error: invalid feature name: $ac_feature" >&2{ (exit 1); exit 1; }; }ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`eval enable_$ac_feature=no ;;-docdir | --docdir | --docdi | --doc | --do)ac_prev=docdir ;;-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)docdir=$ac_optarg ;;-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)ac_prev=dvidir ;;-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)dvidir=$ac_optarg ;;-enable-* | --enable-*)ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`# Reject names that are not valid shell variable names.expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&{ echo "$as_me: error: invalid feature name: $ac_feature" >&2{ (exit 1); exit 1; }; }ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`eval enable_$ac_feature=\$ac_optarg ;;-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \| --exec | --exe | --ex)ac_prev=exec_prefix ;;-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \| --exec=* | --exe=* | --ex=*)exec_prefix=$ac_optarg ;;-gas | --gas | --ga | --g)# Obsolete; use --with-gas.with_gas=yes ;;-help | --help | --hel | --he | -h)ac_init_help=long ;;-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)ac_init_help=recursive ;;-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)ac_init_help=short ;;-host | --host | --hos | --ho)ac_prev=host_alias ;;-host=* | --host=* | --hos=* | --ho=*)host_alias=$ac_optarg ;;-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)ac_prev=htmldir ;;-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \| --ht=*)htmldir=$ac_optarg ;;-includedir | --includedir | --includedi | --included | --include \| --includ | --inclu | --incl | --inc)ac_prev=includedir ;;-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \| --includ=* | --inclu=* | --incl=* | --inc=*)includedir=$ac_optarg ;;-infodir | --infodir | --infodi | --infod | --info | --inf)ac_prev=infodir ;;-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)infodir=$ac_optarg ;;-libdir | --libdir | --libdi | --libd)ac_prev=libdir ;;-libdir=* | --libdir=* | --libdi=* | --libd=*)libdir=$ac_optarg ;;-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \| --libexe | --libex | --libe)ac_prev=libexecdir ;;-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \| --libexe=* | --libex=* | --libe=*)libexecdir=$ac_optarg ;;-localedir | --localedir | --localedi | --localed | --locale)ac_prev=localedir ;;-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)localedir=$ac_optarg ;;-localstatedir | --localstatedir | --localstatedi | --localstated \| --localstate | --localstat | --localsta | --localst | --locals)ac_prev=localstatedir ;;-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)localstatedir=$ac_optarg ;;-mandir | --mandir | --mandi | --mand | --man | --ma | --m)ac_prev=mandir ;;-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)mandir=$ac_optarg ;;-nfp | --nfp | --nf)# Obsolete; use --without-fp.with_fp=no ;;-no-create | --no-create | --no-creat | --no-crea | --no-cre \| --no-cr | --no-c | -n)no_create=yes ;;-no-recursion | --no-recursion | --no-recursio | --no-recursi \| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)no_recursion=yes ;;-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \| --oldin | --oldi | --old | --ol | --o)ac_prev=oldincludedir ;;-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)oldincludedir=$ac_optarg ;;-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)ac_prev=prefix ;;-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)prefix=$ac_optarg ;;-program-prefix | --program-prefix | --program-prefi | --program-pref \| --program-pre | --program-pr | --program-p)ac_prev=program_prefix ;;-program-prefix=* | --program-prefix=* | --program-prefi=* \| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)program_prefix=$ac_optarg ;;-program-suffix | --program-suffix | --program-suffi | --program-suff \| --program-suf | --program-su | --program-s)ac_prev=program_suffix ;;-program-suffix=* | --program-suffix=* | --program-suffi=* \| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)program_suffix=$ac_optarg ;;-program-transform-name | --program-transform-name \| --program-transform-nam | --program-transform-na \| --program-transform-n | --program-transform- \| --program-transform | --program-transfor \| --program-transfo | --program-transf \| --program-trans | --program-tran \| --progr-tra | --program-tr | --program-t)ac_prev=program_transform_name ;;-program-transform-name=* | --program-transform-name=* \| --program-transform-nam=* | --program-transform-na=* \| --program-transform-n=* | --program-transform-=* \| --program-transform=* | --program-transfor=* \| --program-transfo=* | --program-transf=* \| --program-trans=* | --program-tran=* \| --progr-tra=* | --program-tr=* | --program-t=*)program_transform_name=$ac_optarg ;;-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)ac_prev=pdfdir ;;-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)pdfdir=$ac_optarg ;;-psdir | --psdir | --psdi | --psd | --ps)ac_prev=psdir ;;-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)psdir=$ac_optarg ;;-q | -quiet | --quiet | --quie | --qui | --qu | --q \| -silent | --silent | --silen | --sile | --sil)silent=yes ;;-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)ac_prev=sbindir ;;-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \| --sbi=* | --sb=*)sbindir=$ac_optarg ;;-sharedstatedir | --sharedstatedir | --sharedstatedi \| --sharedstated | --sharedstate | --sharedstat | --sharedsta \| --sharedst | --shareds | --shared | --share | --shar \| --sha | --sh)ac_prev=sharedstatedir ;;-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \| --sha=* | --sh=*)sharedstatedir=$ac_optarg ;;-site | --site | --sit)ac_prev=site ;;-site=* | --site=* | --sit=*)site=$ac_optarg ;;-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)ac_prev=srcdir ;;-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)srcdir=$ac_optarg ;;-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \| --syscon | --sysco | --sysc | --sys | --sy)ac_prev=sysconfdir ;;-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)sysconfdir=$ac_optarg ;;-target | --target | --targe | --targ | --tar | --ta | --t)ac_prev=target_alias ;;-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)target_alias=$ac_optarg ;;-v | -verbose | --verbose | --verbos | --verbo | --verb)verbose=yes ;;-version | --version | --versio | --versi | --vers | -V)ac_init_version=: ;;-with-* | --with-*)ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`# Reject names that are not valid shell variable names.expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&{ echo "$as_me: error: invalid package name: $ac_package" >&2{ (exit 1); exit 1; }; }ac_package=`echo $ac_package | sed 's/[-.]/_/g'`eval with_$ac_package=\$ac_optarg ;;-without-* | --without-*)ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`# Reject names that are not valid shell variable names.expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&{ echo "$as_me: error: invalid package name: $ac_package" >&2{ (exit 1); exit 1; }; }ac_package=`echo $ac_package | sed 's/[-.]/_/g'`eval with_$ac_package=no ;;--x)# Obsolete; use --with-x.with_x=yes ;;-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \| --x-incl | --x-inc | --x-in | --x-i)ac_prev=x_includes ;;-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)x_includes=$ac_optarg ;;-x-libraries | --x-libraries | --x-librarie | --x-librari \| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)ac_prev=x_libraries ;;-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)x_libraries=$ac_optarg ;;-*) { echo "$as_me: error: unrecognized option: $ac_optionTry \`$0 --help' for more information." >&2{ (exit 1); exit 1; }; };;*=*)ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`# Reject names that are not valid shell variable names.expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2{ (exit 1); exit 1; }; }eval $ac_envvar=\$ac_optargexport $ac_envvar ;;*)# FIXME: should be removed in autoconf 3.0.echo "$as_me: WARNING: you should use --build, --host, --target" >&2expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&echo "$as_me: WARNING: invalid host type: $ac_option" >&2: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option};;esacdoneif test -n "$ac_prev"; thenac_option=--`echo $ac_prev | sed 's/_/-/g'`{ echo "$as_me: error: missing argument to $ac_option" >&2{ (exit 1); exit 1; }; }fi# Be sure to have absolute directory names.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 mandirdoeval ac_val=\$$ac_varcase $ac_val in[\\/$]* | ?:[\\/]* ) continue;;NONE | '' ) case $ac_var in *prefix ) continue;; esac;;esac{ echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2{ (exit 1); exit 1; }; }done# There might be people who depend on the old broken behavior: `$host'# used to hold the argument of --host etc.# FIXME: To remove some day.build=$build_aliashost=$host_aliastarget=$target_alias# FIXME: To remove some day.if test "x$host_alias" != x; thenif test "x$build_alias" = x; thencross_compiling=maybeecho "$as_me: WARNING: If you wanted to set the --build type, don't use --host.If a cross compiler is detected then cross compile mode will be used." >&2elif test "x$build_alias" != "x$host_alias"; thencross_compiling=yesfifiac_tool_prefix=test -n "$host_alias" && ac_tool_prefix=$host_alias-test "$silent" = yes && exec 6>/dev/nullac_pwd=`pwd` && test -n "$ac_pwd" &&ac_ls_di=`ls -di .` &&ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||{ echo "$as_me: error: Working directory cannot be determined" >&2{ (exit 1); exit 1; }; }test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||{ echo "$as_me: error: pwd does not report name of working directory" >&2{ (exit 1); exit 1; }; }# Find the source files, if location was not specified.if test -z "$srcdir"; thenac_srcdir_defaulted=yes# Try the directory containing this script, then the parent directory.ac_confdir=`$as_dirname -- "$0" ||$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$0" : 'X\(//\)[^/]' \| \X"$0" : 'X\(//\)$' \| \X"$0" : 'X\(/\)' \| . 2>/dev/null ||echo X"$0" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`srcdir=$ac_confdirif test ! -r "$srcdir/$ac_unique_file"; thensrcdir=..fielseac_srcdir_defaulted=nofiif test ! -r "$srcdir/$ac_unique_file"; thentest "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."{ echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2{ (exit 1); exit 1; }; }fiac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"ac_abs_confdir=`(cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2{ (exit 1); exit 1; }; }pwd)`# When building in place, set srcdir=.if test "$ac_abs_confdir" = "$ac_pwd"; thensrcdir=.fi# Remove unnecessary trailing slashes from srcdir.# Double slashes in file names in object file debugging info# mess up M-x gdb in Emacs.case $srcdir in*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;esacfor ac_var in $ac_precious_vars; doeval ac_env_${ac_var}_set=\${${ac_var}+set}eval ac_env_${ac_var}_value=\$${ac_var}eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}eval ac_cv_env_${ac_var}_value=\$${ac_var}done## Report the --help message.#if test "$ac_init_help" = "long"; then# Omit some internal or obsolete options to make the list less imposing.# This message is too long to be a string in the A/UX 3.1 sh.cat <<_ACEOF\`configure' configures onig 5.9.2 to adapt to many kinds of systems.Usage: $0 [OPTION]... [VAR=VALUE]...To assign environment variables (e.g., CC, CFLAGS...), specify them asVAR=VALUE. See below for descriptions of some of the useful variables.Defaults for the options are specified in brackets.Configuration:-h, --help display this help and exit--help=short display options specific to this package--help=recursive display the short help of all the included packages-V, --version display version information and exit-q, --quiet, --silent do not print \`checking...' messages--cache-file=FILE cache test results in FILE [disabled]-C, --config-cache alias for \`--cache-file=config.cache'-n, --no-create do not create output files--srcdir=DIR find the sources in DIR [configure dir or \`..']Installation directories:--prefix=PREFIX install architecture-independent files in PREFIX[$ac_default_prefix]--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX[PREFIX]By default, \`make install' will install all the files in\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specifyan installation prefix other than \`$ac_default_prefix' using \`--prefix',for instance \`--prefix=\$HOME'.For better control, use the options below.Fine tuning of the installation directories:--bindir=DIR user executables [EPREFIX/bin]--sbindir=DIR system admin executables [EPREFIX/sbin]--libexecdir=DIR program executables [EPREFIX/libexec]--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]--libdir=DIR object code libraries [EPREFIX/lib]--includedir=DIR C header files [PREFIX/include]--oldincludedir=DIR C header files for non-gcc [/usr/include]--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]--datadir=DIR read-only architecture-independent data [DATAROOTDIR]--infodir=DIR info documentation [DATAROOTDIR/info]--localedir=DIR locale-dependent data [DATAROOTDIR/locale]--mandir=DIR man documentation [DATAROOTDIR/man]--docdir=DIR documentation root [DATAROOTDIR/doc/onig]--htmldir=DIR html documentation [DOCDIR]--dvidir=DIR dvi documentation [DOCDIR]--pdfdir=DIR pdf documentation [DOCDIR]--psdir=DIR ps documentation [DOCDIR]_ACEOFcat <<\_ACEOFProgram names:--program-prefix=PREFIX prepend PREFIX to installed program names--program-suffix=SUFFIX append SUFFIX to installed program names--program-transform-name=PROGRAM run sed PROGRAM on installed program namesSystem types:--build=BUILD configure for building on BUILD [guessed]--host=HOST cross-compile to build programs to run on HOST [BUILD]_ACEOFfiif test -n "$ac_init_help"; thencase $ac_init_help inshort | recursive ) echo "Configuration of onig 5.9.2:";;esaccat <<\_ACEOFOptional Features:--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)--enable-FEATURE[=ARG] include FEATURE [ARG=yes]--enable-combination-explosion-check enable combination explosion check--enable-crnl-as-line-terminator enable CR+NL as line terminator--disable-dependency-tracking speeds up one-time build--enable-dependency-tracking do not reject slow dependency extractors--enable-shared[=PKGS] build shared libraries [default=yes]--enable-static[=PKGS] build static libraries [default=yes]--enable-fast-install[=PKGS]optimize for fast installation [default=yes]--disable-libtool-lock avoid locking (might break parallel builds)Optional Packages:--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)--with-rubydir=RUBYDIR specify value for RUBYDIR (default ..)--with-statistics take matching time statistical data--with-pic try to use only PIC/non-PIC objects [default=useboth]--with-gnu-ld assume the C compiler uses GNU ld [default=no]Some influential environment variables:CC C compiler commandCFLAGS C compiler flagsLDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in anonstandard directory <lib dir>LIBS libraries to pass to the linker, e.g. -l<library>CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> ifyou have headers in a nonstandard directory <include dir>CPP C preprocessorUse these variables to override the choices made by `configure' or to helpit to find libraries and programs with nonstandard names/locations._ACEOFac_status=$?fiif test "$ac_init_help" = "recursive"; then# If there are subdirs, report their specific --help.for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continuetest -d "$ac_dir" || continueac_builddir=.case "$ac_dir" in.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;*)ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`# A ".." for each directory in $ac_dir_suffix.ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`case $ac_top_builddir_sub in"") ac_top_builddir_sub=. ac_top_build_prefix= ;;*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;esac ;;esacac_abs_top_builddir=$ac_pwdac_abs_builddir=$ac_pwd$ac_dir_suffix# for backward compatibility:ac_top_builddir=$ac_top_build_prefixcase $srcdir in.) # We are building in place.ac_srcdir=.ac_top_srcdir=$ac_top_builddir_subac_abs_top_srcdir=$ac_pwd ;;[\\/]* | ?:[\\/]* ) # Absolute name.ac_srcdir=$srcdir$ac_dir_suffix;ac_top_srcdir=$srcdirac_abs_top_srcdir=$srcdir ;;*) # Relative name.ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffixac_top_srcdir=$ac_top_build_prefix$srcdirac_abs_top_srcdir=$ac_pwd/$srcdir ;;esacac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffixcd "$ac_dir" || { ac_status=$?; continue; }# Check for guested configure.if test -f "$ac_srcdir/configure.gnu"; thenecho &&$SHELL "$ac_srcdir/configure.gnu" --help=recursiveelif test -f "$ac_srcdir/configure"; thenecho &&$SHELL "$ac_srcdir/configure" --help=recursiveelseecho "$as_me: WARNING: no configuration information is in $ac_dir" >&2fi || ac_status=$?cd "$ac_pwd" || { ac_status=$?; break; }donefitest -n "$ac_init_help" && exit $ac_statusif $ac_init_version; thencat <<\_ACEOFonig configure 5.9.2generated by GNU Autoconf 2.61Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.This configure script is free software; the Free Software Foundationgives unlimited permission to copy, distribute and modify it._ACEOFexitficat >config.log <<_ACEOFThis file contains any messages produced by compilers whilerunning configure, to aid debugging if configure makes a mistake.It was created by onig $as_me 5.9.2, which wasgenerated by GNU Autoconf 2.61. Invocation command line was$ $0 $@_ACEOFexec 5>>config.log{cat <<_ASUNAME## --------- #### Platform. #### --------- ##hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`uname -m = `(uname -m) 2>/dev/null || echo unknown`uname -r = `(uname -r) 2>/dev/null || echo unknown`uname -s = `(uname -s) 2>/dev/null || echo unknown`uname -v = `(uname -v) 2>/dev/null || echo unknown`/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`_ASUNAMEas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.echo "PATH: $as_dir"doneIFS=$as_save_IFS} >&5cat >&5 <<_ACEOF## ----------- #### Core tests. #### ----------- ##_ACEOF# Keep a trace of the command line.# Strip out --no-create and --no-recursion so they do not pile up.# Strip out --silent because we don't want to record it for future runs.# Also quote any args containing shell meta-characters.# Make two passes to allow for proper duplicate-argument suppression.ac_configure_args=ac_configure_args0=ac_configure_args1=ac_must_keep_next=falsefor ac_pass in 1 2dofor ac_argdocase $ac_arg in-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;-q | -quiet | --quiet | --quie | --qui | --qu | --q \| -silent | --silent | --silen | --sile | --sil)continue ;;*\'*)ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;esaccase $ac_pass in1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;2)ac_configure_args1="$ac_configure_args1 '$ac_arg'"if test $ac_must_keep_next = true; thenac_must_keep_next=false # Got value, back to normal.elsecase $ac_arg in*=* | --config-cache | -C | -disable-* | --disable-* \| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \| -with-* | --with-* | -without-* | --without-* | --x)case "$ac_configure_args0 " in"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;esac;;-* ) ac_must_keep_next=true ;;esacfiac_configure_args="$ac_configure_args '$ac_arg'";;esacdonedone$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }# When interrupted or exit'd, cleanup temporary files, and complete# config.log. We remove comments because anyway the quotes in there# would cause problems or look ugly.# WARNING: Use '\'' to represent an apostrophe within the trap.# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.trap 'exit_status=$?# Save into config.log some information that might help in debugging.{echocat <<\_ASBOX## ---------------- #### Cache variables. #### ---------------- ##_ASBOXecho# The following way of writing the cache mishandles newlines in values,(for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; doeval ac_val=\$$ac_varcase $ac_val in #(*${as_nl}*)case $ac_var in #(*_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;esaccase $ac_var in #(_ | IFS | as_nl) ;; #(*) $as_unset $ac_var ;;esac ;;esacdone(set) 2>&1 |case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(*${as_nl}ac_space=\ *)sed -n \"s/'\''/'\''\\\\'\'''\''/g;s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p";; #(*)sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p";;esac |sort)echocat <<\_ASBOX## ----------------- #### Output variables. #### ----------------- ##_ASBOXechofor ac_var in $ac_subst_varsdoeval ac_val=\$$ac_varcase $ac_val in*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;esacecho "$ac_var='\''$ac_val'\''"done | sortechoif test -n "$ac_subst_files"; thencat <<\_ASBOX## ------------------- #### File substitutions. #### ------------------- ##_ASBOXechofor ac_var in $ac_subst_filesdoeval ac_val=\$$ac_varcase $ac_val in*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;esacecho "$ac_var='\''$ac_val'\''"done | sortechofiif test -s confdefs.h; thencat <<\_ASBOX## ----------- #### confdefs.h. #### ----------- ##_ASBOXechocat confdefs.hechofitest "$ac_signal" != 0 &&echo "$as_me: caught signal $ac_signal"echo "$as_me: exit $exit_status"} >&5rm -f core *.core core.conftest.* &&rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&exit $exit_status' 0for ac_signal in 1 2 13 15; dotrap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signaldoneac_signal=0# confdefs.h avoids OS command line length limits that DEFS can exceed.rm -f -r conftest* confdefs.h# Predefined preprocessor variables.cat >>confdefs.h <<_ACEOF#define PACKAGE_NAME "$PACKAGE_NAME"_ACEOFcat >>confdefs.h <<_ACEOF#define PACKAGE_TARNAME "$PACKAGE_TARNAME"_ACEOFcat >>confdefs.h <<_ACEOF#define PACKAGE_VERSION "$PACKAGE_VERSION"_ACEOFcat >>confdefs.h <<_ACEOF#define PACKAGE_STRING "$PACKAGE_STRING"_ACEOFcat >>confdefs.h <<_ACEOF#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"_ACEOF# Let the site file select an alternate cache file if it wants to.# Prefer explicitly selected file to automatically selected ones.if test -n "$CONFIG_SITE"; thenset x "$CONFIG_SITE"elif test "x$prefix" != xNONE; thenset x "$prefix/share/config.site" "$prefix/etc/config.site"elseset x "$ac_default_prefix/share/config.site" \"$ac_default_prefix/etc/config.site"fishiftfor ac_site_filedoif test -r "$ac_site_file"; then{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5echo "$as_me: loading site script $ac_site_file" >&6;}sed 's/^/| /' "$ac_site_file" >&5. "$ac_site_file"fidoneif test -r "$cache_file"; then# Some versions of bash will fail to source /dev/null (special# files actually), so we avoid doing that.if test -f "$cache_file"; then{ echo "$as_me:$LINENO: loading cache $cache_file" >&5echo "$as_me: loading cache $cache_file" >&6;}case $cache_file in[\\/]* | ?:[\\/]* ) . "$cache_file";;*) . "./$cache_file";;esacfielse{ echo "$as_me:$LINENO: creating cache $cache_file" >&5echo "$as_me: creating cache $cache_file" >&6;}>$cache_filefi# Check that the precious variables saved in the cache have kept the same# value.ac_cache_corrupted=falsefor ac_var in $ac_precious_vars; doeval ac_old_set=\$ac_cv_env_${ac_var}_seteval ac_new_set=\$ac_env_${ac_var}_seteval ac_old_val=\$ac_cv_env_${ac_var}_valueeval ac_new_val=\$ac_env_${ac_var}_valuecase $ac_old_set,$ac_new_set inset,){ echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}ac_cache_corrupted=: ;;,set){ echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}ac_cache_corrupted=: ;;,);;*)if test "x$ac_old_val" != "x$ac_new_val"; then{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}{ echo "$as_me:$LINENO: former value: $ac_old_val" >&5echo "$as_me: former value: $ac_old_val" >&2;}{ echo "$as_me:$LINENO: current value: $ac_new_val" >&5echo "$as_me: current value: $ac_new_val" >&2;}ac_cache_corrupted=:fi;;esac# Pass precious variables to config.status.if test "$ac_new_set" = set; thencase $ac_new_val in*\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;*) ac_arg=$ac_var=$ac_new_val ;;esaccase " $ac_configure_args " in*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.*) ac_configure_args="$ac_configure_args '$ac_arg'" ;;esacfidoneif $ac_cache_corrupted; then{ echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5echo "$as_me: error: changes in the environment can compromise the build" >&2;}{ { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}{ (exit 1); exit 1; }; }fiac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnuam__api_version='1.10'ac_aux_dir=for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; doif test -f "$ac_dir/install-sh"; thenac_aux_dir=$ac_dirac_install_sh="$ac_aux_dir/install-sh -c"breakelif test -f "$ac_dir/install.sh"; thenac_aux_dir=$ac_dirac_install_sh="$ac_aux_dir/install.sh -c"breakelif test -f "$ac_dir/shtool"; thenac_aux_dir=$ac_dirac_install_sh="$ac_aux_dir/shtool install -c"breakfidoneif test -z "$ac_aux_dir"; then{ { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}{ (exit 1); exit 1; }; }fi# These three variables are undocumented and unsupported,# and are intended to be withdrawn in a future Autoconf release.# They can cause serious problems if a builder's source tree is in a directory# whose full name contains unusual characters.ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.# Find a good install program. We prefer a C program (faster),# so one script is as good as another. But avoid the broken or# incompatible versions:# SysV /etc/install, /usr/sbin/install# SunOS /usr/etc/install# IRIX /sbin/install# AIX /bin/install# AmigaOS /C/install, which installs bootblocks on floppy discs# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag# AFS /usr/afsws/bin/install, which mishandles nonexistent args# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"# OS/2's system install, which has a completely different semantic# ./install, which can be erroneously created by make from ./install.sh.{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }if test -z "$INSTALL"; thenif test "${ac_cv_path_install+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.# Account for people who put trailing slashes in PATH elements.case $as_dir/ in./ | .// | /cC/* | \/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \/usr/ucb/* ) ;;*)# OSF1 and SCO ODT 3.0 have their own names for install.# Don't use installbsd from OSF since it installs stuff as root# by default.for ac_prog in ginstall scoinst install; dofor ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; thenif test $ac_prog = install &&grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then# AIX install. It has an incompatible calling convention.:elif test $ac_prog = install &&grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then# program-specific install script used by HP pwplus--don't use.:elseac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"break 3fifidonedone;;esacdoneIFS=$as_save_IFSfiif test "${ac_cv_path_install+set}" = set; thenINSTALL=$ac_cv_path_installelse# As a last resort, use the slow shell script. Don't cache a# value for INSTALL within a source directory, because that will# break other packages using the cache if that directory is# removed, or if the value is a relative name.INSTALL=$ac_install_shfifi{ echo "$as_me:$LINENO: result: $INSTALL" >&5echo "${ECHO_T}$INSTALL" >&6; }# Use test -z because SunOS4 sh mishandles braces in ${var-val}.# It thinks the first close brace ends the variable substitution.test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }# Just in casesleep 1echo timestamp > conftest.file# Do `set' in a subshell so we don't clobber the current shell's# arguments. Must try -L first in case configure is actually a# symlink; some systems play weird games with the mod time of symlinks# (eg FreeBSD returns the mod time of the symlink's containing# directory).if (set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`if test "$*" = "X"; then# -L didn't work.set X `ls -t $srcdir/configure conftest.file`firm -f conftest.fileif test "$*" != "X $srcdir/configure conftest.file" \&& test "$*" != "X conftest.file $srcdir/configure"; then# If neither matched, then we have a broken ls. This can happen# if, for instance, CONFIG_SHELL is bash and it inherits a# broken ls alias from the environment. This has actually# happened. Such a system could not be considered "sane".{ { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a brokenalias in your environment" >&5echo "$as_me: error: ls -t appears to fail. Make sure there is not a brokenalias in your environment" >&2;}{ (exit 1); exit 1; }; }fitest "$2" = conftest.file)then# Ok.:else{ { echo "$as_me:$LINENO: error: newly created file is older than distributed files!Check your system clock" >&5echo "$as_me: error: newly created file is older than distributed files!Check your system clock" >&2;}{ (exit 1); exit 1; }; }fi{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }test "$program_prefix" != NONE &&program_transform_name="s&^&$program_prefix&;$program_transform_name"# Use a double $ so make ignores it.test "$program_suffix" != NONE &&program_transform_name="s&\$&$program_suffix&;$program_transform_name"# Double any \ or $. echo might interpret backslashes.# By default was `s,x,x', remove it if useless.cat <<\_ACEOF >conftest.seds/[\\$]/&&/g;s/;s,x,x,$//_ACEOFprogram_transform_name=`echo $program_transform_name | sed -f conftest.sed`rm -f conftest.sed# expand $ac_aux_dir to an absolute patham_aux_dir=`cd $ac_aux_dir && pwd`test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"# Use eval to expand $SHELLif eval "$MISSING --run true"; thenam_missing_run="$MISSING --run "elseam_missing_run={ echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}fi{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }if test -z "$MKDIR_P"; thenif test "${ac_cv_path_mkdir+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bindoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_prog in mkdir gmkdir; dofor ac_exec_ext in '' $ac_executable_extensions; do{ test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continuecase `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #('mkdir (GNU coreutils) '* | \'mkdir (coreutils) '* | \'mkdir (fileutils) '4.1*)ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_extbreak 3;;esacdonedonedoneIFS=$as_save_IFSfiif test "${ac_cv_path_mkdir+set}" = set; thenMKDIR_P="$ac_cv_path_mkdir -p"else# As a last resort, use the slow shell script. Don't cache a# value for MKDIR_P within a source directory, because that will# break other packages using the cache if that directory is# removed, or if the value is a relative name.test -d ./--version && rmdir ./--versionMKDIR_P="$ac_install_sh -d"fifi{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5echo "${ECHO_T}$MKDIR_P" >&6; }mkdir_p="$MKDIR_P"case $mkdir_p in[\\/$]* | ?:[\\/]*) ;;*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;esacfor ac_prog in gawk mawk nawk awkdo# Extract the first word of "$ac_prog", so it can be a program name with args.set dummy $ac_prog; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_AWK+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$AWK"; thenac_cv_prog_AWK="$AWK" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_AWK="$ac_prog"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiAWK=$ac_cv_prog_AWKif test -n "$AWK"; then{ echo "$as_me:$LINENO: result: $AWK" >&5echo "${ECHO_T}$AWK" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fitest -n "$AWK" && breakdone{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.make <<\_ACEOFSHELL = /bin/shall:@echo '@@@%%%=$(MAKE)=@@@%%%'_ACEOF# GNU make sometimes prints "make[1]: Entering...", which would confuse us.case `${MAKE-make} -f conftest.make 2>/dev/null` in*@@@%%%=?*=@@@%%%*)eval ac_cv_prog_make_${ac_make}_set=yes;;*)eval ac_cv_prog_make_${ac_make}_set=no;;esacrm -f conftest.makefiif eval test \$ac_cv_prog_make_${ac_make}_set = yes; then{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }SET_MAKE=else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }SET_MAKE="MAKE=${MAKE-make}"firm -rf .tst 2>/dev/nullmkdir .tst 2>/dev/nullif test -d .tst; thenam__leading_dot=.elseam__leading_dot=_firmdir .tst 2>/dev/nullif test "`cd $srcdir && pwd`" != "`pwd`"; then# Use -I$(srcdir) only when $(srcdir) != ., so that make's output# is not polluted with repeated "-I."am__isrc=' -I$(srcdir)'# test to see if srcdir already configuredif test -f $srcdir/config.status; then{ { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}{ (exit 1); exit 1; }; }fifi# test whether we have cygpathif test -z "$CYGPATH_W"; thenif (cygpath --version) >/dev/null 2>/dev/null; thenCYGPATH_W='cygpath -w'elseCYGPATH_W=echofifi# Define the identity of the package.PACKAGE='onig'VERSION='5.9.2'cat >>confdefs.h <<_ACEOF#define PACKAGE "$PACKAGE"_ACEOFcat >>confdefs.h <<_ACEOF#define VERSION "$VERSION"_ACEOF# Some tools Automake needs.ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}# Installed binaries are usually stripped using `strip' when the user# run `make install-strip'. However `strip' might not be the right# tool to use in cross-compilation environments, therefore Automake# will honor the `STRIP' environment variable to overrule this program.if test "$cross_compiling" != no; thenif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.set dummy ${ac_tool_prefix}strip; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_STRIP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$STRIP"; thenac_cv_prog_STRIP="$STRIP" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_STRIP="${ac_tool_prefix}strip"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiSTRIP=$ac_cv_prog_STRIPif test -n "$STRIP"; then{ echo "$as_me:$LINENO: result: $STRIP" >&5echo "${ECHO_T}$STRIP" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_STRIP"; thenac_ct_STRIP=$STRIP# Extract the first word of "strip", so it can be a program name with args.set dummy strip; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_STRIP"; thenac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_STRIP="strip"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_STRIP=$ac_cv_prog_ac_ct_STRIPif test -n "$ac_ct_STRIP"; then{ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5echo "${ECHO_T}$ac_ct_STRIP" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_STRIP" = x; thenSTRIP=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacSTRIP=$ac_ct_STRIPfielseSTRIP="$ac_cv_prog_STRIP"fifiINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"# We need awk for the "check" target. The system "awk" is bad on# some platforms.# Always define AMTAR for backward compatibility.AMTAR=${AMTAR-"${am_missing_run}tar"}am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'ac_config_headers="$ac_config_headers config.h"RUBYDIR=".."# Check whether --with-rubydir was given.if test "${with_rubydir+set}" = set; thenwithval=$with_rubydir; RUBYDIR=$withvalfiSTATISTICS=""# Check whether --with-statistics was given.if test "${with_statistics+set}" = set; thenwithval=$with_statistics; STATISTICS=-DONIG_DEBUG_STATISTICSfi# Check whether --enable-combination-explosion-check was given.if test "${enable_combination_explosion_check+set}" = set; thenenableval=$enable_combination_explosion_check; comb_expl_check=$enablevalfiif test $comb_expl_check = yes; thencat >>confdefs.h <<\_ACEOF#define USE_COMBINATION_EXPLOSION_CHECK 1_ACEOFfi# Check whether --enable-crnl-as-line-terminator was given.if test "${enable_crnl_as_line_terminator+set}" = set; thenenableval=$enable_crnl_as_line_terminator; crnl_as_line_terminator=$enablevalfiif test $crnl_as_line_terminator = yes; thencat >>confdefs.h <<\_ACEOF#define USE_CRNL_AS_LINE_TERMINATOR 1_ACEOFfiac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnuif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.set dummy ${ac_tool_prefix}gcc; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_CC+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$CC"; thenac_cv_prog_CC="$CC" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_CC="${ac_tool_prefix}gcc"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiCC=$ac_cv_prog_CCif test -n "$CC"; then{ echo "$as_me:$LINENO: result: $CC" >&5echo "${ECHO_T}$CC" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_CC"; thenac_ct_CC=$CC# Extract the first word of "gcc", so it can be a program name with args.set dummy gcc; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_CC+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_CC"; thenac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_CC="gcc"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_CC=$ac_cv_prog_ac_ct_CCif test -n "$ac_ct_CC"; then{ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5echo "${ECHO_T}$ac_ct_CC" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_CC" = x; thenCC=""elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacCC=$ac_ct_CCfielseCC="$ac_cv_prog_CC"fiif test -z "$CC"; thenif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.set dummy ${ac_tool_prefix}cc; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_CC+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$CC"; thenac_cv_prog_CC="$CC" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_CC="${ac_tool_prefix}cc"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiCC=$ac_cv_prog_CCif test -n "$CC"; then{ echo "$as_me:$LINENO: result: $CC" >&5echo "${ECHO_T}$CC" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fififiif test -z "$CC"; then# Extract the first word of "cc", so it can be a program name with args.set dummy cc; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_CC+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$CC"; thenac_cv_prog_CC="$CC" # Let the user override the test.elseac_prog_rejected=noas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenif test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; thenac_prog_rejected=yescontinuefiac_cv_prog_CC="cc"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSif test $ac_prog_rejected = yes; then# We found a bogon in the path, so make sure we never use it.set dummy $ac_cv_prog_CCshiftif test $# != 0; then# We chose a different compiler from the bogus one.# However, it has the same basename, so the bogon will be chosen# first if we set CC to just the basename; use the full file name.shiftac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"fifififiCC=$ac_cv_prog_CCif test -n "$CC"; then{ echo "$as_me:$LINENO: result: $CC" >&5echo "${ECHO_T}$CC" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$CC"; thenif test -n "$ac_tool_prefix"; thenfor ac_prog in cl.exedo# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.set dummy $ac_tool_prefix$ac_prog; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_CC+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$CC"; thenac_cv_prog_CC="$CC" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_CC="$ac_tool_prefix$ac_prog"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiCC=$ac_cv_prog_CCif test -n "$CC"; then{ echo "$as_me:$LINENO: result: $CC" >&5echo "${ECHO_T}$CC" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fitest -n "$CC" && breakdonefiif test -z "$CC"; thenac_ct_CC=$CCfor ac_prog in cl.exedo# Extract the first word of "$ac_prog", so it can be a program name with args.set dummy $ac_prog; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_CC+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_CC"; thenac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_CC="$ac_prog"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_CC=$ac_cv_prog_ac_ct_CCif test -n "$ac_ct_CC"; then{ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5echo "${ECHO_T}$ac_ct_CC" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fitest -n "$ac_ct_CC" && breakdoneif test "x$ac_ct_CC" = x; thenCC=""elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacCC=$ac_ct_CCfififitest -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATHSee \`config.log' for more details." >&5echo "$as_me: error: no acceptable C compiler found in \$PATHSee \`config.log' for more details." >&2;}{ (exit 1); exit 1; }; }# Provide some information about the compiler.echo "$as_me:$LINENO: checking for C compiler version" >&5ac_compiler=`set X $ac_compile; echo $2`{ (ac_try="$ac_compiler --version >&5"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compiler --version >&5") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }{ (ac_try="$ac_compiler -v >&5"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compiler -v >&5") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }{ (ac_try="$ac_compiler -V >&5"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compiler -V >&5") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFac_clean_files_save=$ac_clean_filesac_clean_files="$ac_clean_files a.out a.exe b.out"# Try to create an executable without -o first, disregard a.out.# It will help us diagnose broken compilers, and finding out an intuition# of exeext.{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`## List of possible output files, starting from the most likely.# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)# only as a last resort. b.out is created by i960 compilers.ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'## The IRIX 6 linker writes into existing files which may not be# executable, retaining their permissions. Remove them first so a# subsequent execution test works.ac_rmfiles=for ac_file in $ac_filesdocase $ac_file in*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;* ) ac_rmfiles="$ac_rmfiles $ac_file";;esacdonerm -f $ac_rmfilesif { (ac_try="$ac_link_default"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link_default") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; then# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'# in a Makefile. We should not override ac_cv_exeext if it was cached,# so that the user can short-circuit this test for compilers unknown to# Autoconf.for ac_file in $ac_files ''dotest -f "$ac_file" || continuecase $ac_file in*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj );;[ab].out )# We found the default executable, but exeext='' is most# certainly right.break;;*.* )if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;then :; elseac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`fi# We set ac_cv_exeext here because the later test for it is not# safe: cross compilers may not add the suffix if given an `-o'# argument, so we may need to know it at that point already.# Even if this section looks crufty: it has the advantage of# actually working.break;;* )break;;esacdonetest "$ac_cv_exeext" = no && ac_cv_exeext=elseac_file=''fi{ echo "$as_me:$LINENO: result: $ac_file" >&5echo "${ECHO_T}$ac_file" >&6; }if test -z "$ac_file"; thenecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5{ { echo "$as_me:$LINENO: error: C compiler cannot create executablesSee \`config.log' for more details." >&5echo "$as_me: error: C compiler cannot create executablesSee \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }fiac_exeext=$ac_cv_exeext# Check that the compiler produces executables we can run. If not, either# the compiler is broken, or we cross compile.{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }# FIXME: These cross compiler hacks should be removed for Autoconf 3.0# If not cross compiling, check that we can run a simple program.if test "$cross_compiling" != yes; thenif { ac_try='./$ac_file'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; thencross_compiling=noelseif test "$cross_compiling" = maybe; thencross_compiling=yeselse{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.If you meant to cross compile, use \`--host'.See \`config.log' for more details." >&5echo "$as_me: error: cannot run C compiled programs.If you meant to cross compile, use \`--host'.See \`config.log' for more details." >&2;}{ (exit 1); exit 1; }; }fififi{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }rm -f a.out a.exe conftest$ac_cv_exeext b.outac_clean_files=$ac_clean_files_save# Check that the compiler produces executables we can run. If not, either# the compiler is broken, or we cross compile.{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }{ echo "$as_me:$LINENO: result: $cross_compiling" >&5echo "${ECHO_T}$cross_compiling" >&6; }{ echo "$as_me:$LINENO: checking for suffix of executables" >&5echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }if { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; then# If both `conftest.exe' and `conftest' are `present' (well, observable)# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will# work properly (i.e., refer to `conftest.exe'), while it won't with# `rm'.for ac_file in conftest.exe conftest conftest.*; dotest -f "$ac_file" || continuecase $ac_file in*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`break;;* ) break;;esacdoneelse{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and linkSee \`config.log' for more details." >&5echo "$as_me: error: cannot compute suffix of executables: cannot compile and linkSee \`config.log' for more details." >&2;}{ (exit 1); exit 1; }; }firm -f conftest$ac_cv_exeext{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5echo "${ECHO_T}$ac_cv_exeext" >&6; }rm -f conftest.$ac_extEXEEXT=$ac_cv_exeextac_exeext=$EXEEXT{ echo "$as_me:$LINENO: checking for suffix of object files" >&5echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }if test "${ac_cv_objext+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.o conftest.objif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; thenfor ac_file in conftest.o conftest.obj conftest.*; dotest -f "$ac_file" || continue;case $ac_file in*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`break;;esacdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compileSee \`config.log' for more details." >&5echo "$as_me: error: cannot compute suffix of object files: cannot compileSee \`config.log' for more details." >&2;}{ (exit 1); exit 1; }; }firm -f conftest.$ac_cv_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5echo "${ECHO_T}$ac_cv_objext" >&6; }OBJEXT=$ac_cv_objextac_objext=$OBJEXT{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }if test "${ac_cv_c_compiler_gnu+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){#ifndef __GNUC__choke me#endif;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_compiler_gnu=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_compiler_gnu=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extac_cv_c_compiler_gnu=$ac_compiler_gnufi{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }GCC=`test $ac_compiler_gnu = yes && echo yes`ac_test_CFLAGS=${CFLAGS+set}ac_save_CFLAGS=$CFLAGS{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }if test "${ac_cv_prog_cc_g+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_save_c_werror_flag=$ac_c_werror_flagac_c_werror_flag=yesac_cv_prog_cc_g=noCFLAGS="-g"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_prog_cc_g=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5CFLAGS=""cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; then:elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_c_werror_flag=$ac_save_c_werror_flagCFLAGS="-g"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_prog_cc_g=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5firm -f core conftest.err conftest.$ac_objext conftest.$ac_extfirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfirm -f core conftest.err conftest.$ac_objext conftest.$ac_extac_c_werror_flag=$ac_save_c_werror_flagfi{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }if test "$ac_test_CFLAGS" = set; thenCFLAGS=$ac_save_CFLAGSelif test $ac_cv_prog_cc_g = yes; thenif test "$GCC" = yes; thenCFLAGS="-g -O2"elseCFLAGS="-g"fielseif test "$GCC" = yes; thenCFLAGS="-O2"elseCFLAGS=fifi{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }if test "${ac_cv_prog_cc_c89+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_cv_prog_cc_c89=noac_save_CC=$CCcat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <stdarg.h>#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */struct buf { int x; };FILE * (*rcsopen) (struct buf *, struct stat *, int);static char *e (p, i)char **p;int i;{return p[i];}static char *f (char * (*g) (char **, int), char **p, ...){char *s;va_list v;va_start (v,p);s = g (p, va_arg (v,int));va_end (v);return s;}/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It hasfunction prototypes and stuff, but not '\xHH' hex character constants.These don't provoke an error unfortunately, instead are silently treatedas 'x'. The following induces an error, until -std is added to getproper ANSI mode. Curiously '\x00'!='x' always comes out true, for anarray size at least. It's necessary to write '\x00'==0 to get somethingthat's true only with -std. */int osf4_cc_array ['\x00' == 0 ? 1 : -1];/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parametersinside strings and character constants. */#define FOO(x) 'x'int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];int test (int i, double x);struct s1 {int (*f) (int a);};struct s2 {int (*f) (double a);};int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);int argc;char **argv;intmain (){return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];;return 0;}_ACEOFfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"doCC="$ac_save_CC $ac_arg"rm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_prog_cc_c89=$ac_argelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5firm -f core conftest.err conftest.$ac_objexttest "x$ac_cv_prog_cc_c89" != "xno" && breakdonerm -f conftest.$ac_extCC=$ac_save_CCfi# AC_CACHE_VALcase "x$ac_cv_prog_cc_c89" inx){ echo "$as_me:$LINENO: result: none needed" >&5echo "${ECHO_T}none needed" >&6; } ;;xno){ echo "$as_me:$LINENO: result: unsupported" >&5echo "${ECHO_T}unsupported" >&6; } ;;*)CC="$CC $ac_cv_prog_cc_c89"{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;esacac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnuDEPDIR="${am__leading_dot}deps"ac_config_commands="$ac_config_commands depfiles"am_make=${MAKE-make}cat > confinc << 'END'am__doit:@echo done.PHONY: am__doitEND# If we don't find an include directive, just comment out the code.{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }am__include="#"am__quote=_am_result=none# First try GNU make style include.echo "include confinc" > confmf# We grep out `Entering directory' and `Leaving directory'# messages which can occur if `w' ends up in MAKEFLAGS.# In particular we don't look at `^make:' because GNU make might# be invoked under some other name (usually "gmake"), in which# case it prints its new name instead of `make'.if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; thenam__include=includeam__quote=_am_result=GNUfi# Now try BSD make style include.if test "$am__include" = "#"; thenecho '.include "confinc"' > confmfif test "`$am_make -s -f confmf 2> /dev/null`" = "done"; thenam__include=.includeam__quote="\""_am_result=BSDfifi{ echo "$as_me:$LINENO: result: $_am_result" >&5echo "${ECHO_T}$_am_result" >&6; }rm -f confinc confmf# Check whether --enable-dependency-tracking was given.if test "${enable_dependency_tracking+set}" = set; thenenableval=$enable_dependency_tracking;fiif test "x$enable_dependency_tracking" != xno; thenam_depcomp="$ac_aux_dir/depcomp"AMDEPBACKSLASH='\'fiif test "x$enable_dependency_tracking" != xno; thenAMDEP_TRUE=AMDEP_FALSE='#'elseAMDEP_TRUE='#'AMDEP_FALSE=fidepcc="$CC" am_compiler_list={ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }if test "${am_cv_CC_dependencies_compiler_type+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then# We make a subdir and do the tests there. Otherwise we can end up# making bogus files that we don't know about and never remove. For# instance it was reported that on HP-UX the gcc test will end up# making a dummy file named `D' -- because `-MD' means `put the output# in D'.mkdir conftest.dir# Copy depcomp to subdir because otherwise we won't find it if we're# using a relative directory.cp "$am_depcomp" conftest.dircd conftest.dir# We will build objects and dependencies in a subdirectory because# it helps to detect inapplicable dependency modes. For instance# both Tru64's cc and ICC support -MD to output dependencies as a# side effect of compilation, but ICC will put the dependencies in# the current directory while Tru64 will put them in the object# directory.mkdir subam_cv_CC_dependencies_compiler_type=noneif test "$am_compiler_list" = ""; thenam_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`fifor depmode in $am_compiler_list; do# Setup a source with many dependencies, because some compilers# like to wrap large dependency lists on column 80 (with \), and# we should not choose a depcomp mode which is confused by this.## We need to recreate these files for each test, as the compiler may# overwrite some of them when testing with obscure command lines.# This happens at least with the AIX C compiler.: > sub/conftest.cfor i in 1 2 3 4 5 6; doecho '#include "conftst'$i'.h"' >> sub/conftest.c# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with# Solaris 8's {/usr,}/bin/sh.touch sub/conftst$i.hdoneecho "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmfcase $depmode innosideeffect)# after this tag, mechanisms are not by side-effect, so they'll# only be used when explicitly requestedif test "x$enable_dependency_tracking" = xyes; thencontinueelsebreakfi;;none) break ;;esac# We check with `-c' and `-o' for the sake of the "dashmstdout"# mode. It turns out that the SunPro C++ compiler does not properly# handle `-M -o', and we need to detect this.if depmode=$depmode \source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \>/dev/null 2>conftest.err &&grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&${MAKE-make} -s -f confmf > /dev/null 2>&1; then# icc doesn't choke on unknown options, it will just issue warnings# or remarks (even with -Werror). So we grep stderr for any message# that says an option was ignored or not supported.# When given -MP, icc 7.0 and 7.1 complain thusly:# icc: Command line warning: ignoring option '-M'; no argument required# The diagnosis changed in icc 8.0:# icc: Command line remark: option '-MP' not supportedif (grep 'ignoring option' conftest.err ||grep 'not supported' conftest.err) >/dev/null 2>&1; then :; elseam_cv_CC_dependencies_compiler_type=$depmodebreakfifidonecd ..rm -rf conftest.direlseam_cv_CC_dependencies_compiler_type=nonefifi{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_typeiftest "x$enable_dependency_tracking" != xno \&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; thenam__fastdepCC_TRUE=am__fastdepCC_FALSE='#'elseam__fastdepCC_TRUE='#'am__fastdepCC_FALSE=ficase `pwd` in*\ * | *\ *){ echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;esacmacro_version='2.2.4'macro_revision='1.2976'ltmain="$ac_aux_dir/ltmain.sh"# Make sure we can run config.sub.$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||{ { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}{ (exit 1); exit 1; }; }{ echo "$as_me:$LINENO: checking build system type" >&5echo $ECHO_N "checking build system type... $ECHO_C" >&6; }if test "${ac_cv_build+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_build_alias=$build_aliastest "x$ac_build_alias" = x &&ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`test "x$ac_build_alias" = x &&{ { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5echo "$as_me: error: cannot guess build type; you must specify one" >&2;}{ (exit 1); exit 1; }; }ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||{ { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}{ (exit 1); exit 1; }; }fi{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5echo "${ECHO_T}$ac_cv_build" >&6; }case $ac_cv_build in*-*-*) ;;*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5echo "$as_me: error: invalid value of canonical build" >&2;}{ (exit 1); exit 1; }; };;esacbuild=$ac_cv_buildac_save_IFS=$IFS; IFS='-'set x $ac_cv_buildshiftbuild_cpu=$1build_vendor=$2shift; shift# Remember, the first character of IFS is used to create $*,# except with old shells:build_os=$*IFS=$ac_save_IFScase $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac{ echo "$as_me:$LINENO: checking host system type" >&5echo $ECHO_N "checking host system type... $ECHO_C" >&6; }if test "${ac_cv_host+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "x$host_alias" = x; thenac_cv_host=$ac_cv_buildelseac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||{ { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}{ (exit 1); exit 1; }; }fifi{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5echo "${ECHO_T}$ac_cv_host" >&6; }case $ac_cv_host in*-*-*) ;;*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5echo "$as_me: error: invalid value of canonical host" >&2;}{ (exit 1); exit 1; }; };;esachost=$ac_cv_hostac_save_IFS=$IFS; IFS='-'set x $ac_cv_hostshifthost_cpu=$1host_vendor=$2shift; shift# Remember, the first character of IFS is used to create $*,# except with old shells:host_os=$*IFS=$ac_save_IFScase $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }if test "${ac_cv_path_SED+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/for ac_i in 1 2 3 4 5 6 7; doac_script="$ac_script$as_nl$ac_script"doneecho "$ac_script" | sed 99q >conftest.sed$as_unset ac_script || ac_script=# Extract the first word of "sed gsed" to use in msg outputif test -z "$SED"; thenset dummy sed gsed; ac_prog_name=$2if test "${ac_cv_path_SED+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_path_SED_found=false# Loop through the user's path and test for each of PROGNAME-LISTas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_prog in sed gsed; dofor ac_exec_ext in '' $ac_executable_extensions; doac_path_SED="$as_dir/$ac_prog$ac_exec_ext"{ test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue# Check for GNU ac_path_SED and select it if it is found.# Check for GNU $ac_path_SEDcase `"$ac_path_SED" --version 2>&1` in*GNU*)ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;*)ac_count=0echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"while :docat "conftest.in" "conftest.in" >"conftest.tmp"mv "conftest.tmp" "conftest.in"cp "conftest.in" "conftest.nl"echo '' >> "conftest.nl""$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || breakdiff "conftest.out" "conftest.nl" >/dev/null 2>&1 || breakac_count=`expr $ac_count + 1`if test $ac_count -gt ${ac_path_SED_max-0}; then# Best one so far, save it but keep looking for a better oneac_cv_path_SED="$ac_path_SED"ac_path_SED_max=$ac_countfi# 10*(2^10) chars as input seems more than enoughtest $ac_count -gt 10 && breakdonerm -f conftest.in conftest.tmp conftest.nl conftest.out;;esac$ac_path_SED_found && break 3donedonedoneIFS=$as_save_IFSfiSED="$ac_cv_path_SED"if test -z "$SED"; then{ { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;}{ (exit 1); exit 1; }; }fielseac_cv_path_SED=$SEDfifi{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5echo "${ECHO_T}$ac_cv_path_SED" >&6; }SED="$ac_cv_path_SED"rm -f conftest.sedtest -z "$SED" && SED=sedXsed="$SED -e 1s/^X//"{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }if test "${ac_cv_path_GREP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6else# Extract the first word of "grep ggrep" to use in msg outputif test -z "$GREP"; thenset dummy grep ggrep; ac_prog_name=$2if test "${ac_cv_path_GREP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_path_GREP_found=false# Loop through the user's path and test for each of PROGNAME-LISTas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bindoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_prog in grep ggrep; dofor ac_exec_ext in '' $ac_executable_extensions; doac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"{ test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue# Check for GNU ac_path_GREP and select it if it is found.# Check for GNU $ac_path_GREPcase `"$ac_path_GREP" --version 2>&1` in*GNU*)ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;*)ac_count=0echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"while :docat "conftest.in" "conftest.in" >"conftest.tmp"mv "conftest.tmp" "conftest.in"cp "conftest.in" "conftest.nl"echo 'GREP' >> "conftest.nl""$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || breakdiff "conftest.out" "conftest.nl" >/dev/null 2>&1 || breakac_count=`expr $ac_count + 1`if test $ac_count -gt ${ac_path_GREP_max-0}; then# Best one so far, save it but keep looking for a better oneac_cv_path_GREP="$ac_path_GREP"ac_path_GREP_max=$ac_countfi# 10*(2^10) chars as input seems more than enoughtest $ac_count -gt 10 && breakdonerm -f conftest.in conftest.tmp conftest.nl conftest.out;;esac$ac_path_GREP_found && break 3donedonedoneIFS=$as_save_IFSfiGREP="$ac_cv_path_GREP"if test -z "$GREP"; then{ { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}{ (exit 1); exit 1; }; }fielseac_cv_path_GREP=$GREPfifi{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5echo "${ECHO_T}$ac_cv_path_GREP" >&6; }GREP="$ac_cv_path_GREP"{ echo "$as_me:$LINENO: checking for egrep" >&5echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }if test "${ac_cv_path_EGREP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif echo a | $GREP -E '(a|b)' >/dev/null 2>&1then ac_cv_path_EGREP="$GREP -E"else# Extract the first word of "egrep" to use in msg outputif test -z "$EGREP"; thenset dummy egrep; ac_prog_name=$2if test "${ac_cv_path_EGREP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_path_EGREP_found=false# Loop through the user's path and test for each of PROGNAME-LISTas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bindoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_prog in egrep; dofor ac_exec_ext in '' $ac_executable_extensions; doac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"{ test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue# Check for GNU ac_path_EGREP and select it if it is found.# Check for GNU $ac_path_EGREPcase `"$ac_path_EGREP" --version 2>&1` in*GNU*)ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;*)ac_count=0echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"while :docat "conftest.in" "conftest.in" >"conftest.tmp"mv "conftest.tmp" "conftest.in"cp "conftest.in" "conftest.nl"echo 'EGREP' >> "conftest.nl""$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || breakdiff "conftest.out" "conftest.nl" >/dev/null 2>&1 || breakac_count=`expr $ac_count + 1`if test $ac_count -gt ${ac_path_EGREP_max-0}; then# Best one so far, save it but keep looking for a better oneac_cv_path_EGREP="$ac_path_EGREP"ac_path_EGREP_max=$ac_countfi# 10*(2^10) chars as input seems more than enoughtest $ac_count -gt 10 && breakdonerm -f conftest.in conftest.tmp conftest.nl conftest.out;;esac$ac_path_EGREP_found && break 3donedonedoneIFS=$as_save_IFSfiEGREP="$ac_cv_path_EGREP"if test -z "$EGREP"; then{ { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}{ (exit 1); exit 1; }; }fielseac_cv_path_EGREP=$EGREPfififi{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }EGREP="$ac_cv_path_EGREP"{ echo "$as_me:$LINENO: checking for fgrep" >&5echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; }if test "${ac_cv_path_FGREP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1then ac_cv_path_FGREP="$GREP -F"else# Extract the first word of "fgrep" to use in msg outputif test -z "$FGREP"; thenset dummy fgrep; ac_prog_name=$2if test "${ac_cv_path_FGREP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_path_FGREP_found=false# Loop through the user's path and test for each of PROGNAME-LISTas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bindoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_prog in fgrep; dofor ac_exec_ext in '' $ac_executable_extensions; doac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"{ test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue# Check for GNU ac_path_FGREP and select it if it is found.# Check for GNU $ac_path_FGREPcase `"$ac_path_FGREP" --version 2>&1` in*GNU*)ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;*)ac_count=0echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"while :docat "conftest.in" "conftest.in" >"conftest.tmp"mv "conftest.tmp" "conftest.in"cp "conftest.in" "conftest.nl"echo 'FGREP' >> "conftest.nl""$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || breakdiff "conftest.out" "conftest.nl" >/dev/null 2>&1 || breakac_count=`expr $ac_count + 1`if test $ac_count -gt ${ac_path_FGREP_max-0}; then# Best one so far, save it but keep looking for a better oneac_cv_path_FGREP="$ac_path_FGREP"ac_path_FGREP_max=$ac_countfi# 10*(2^10) chars as input seems more than enoughtest $ac_count -gt 10 && breakdonerm -f conftest.in conftest.tmp conftest.nl conftest.out;;esac$ac_path_FGREP_found && break 3donedonedoneIFS=$as_save_IFSfiFGREP="$ac_cv_path_FGREP"if test -z "$FGREP"; then{ { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}{ (exit 1); exit 1; }; }fielseac_cv_path_FGREP=$FGREPfififi{ echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5echo "${ECHO_T}$ac_cv_path_FGREP" >&6; }FGREP="$ac_cv_path_FGREP"test -z "$GREP" && GREP=grep# Check whether --with-gnu-ld was given.if test "${with_gnu_ld+set}" = set; thenwithval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yeselsewith_gnu_ld=nofiac_prog=ldif test "$GCC" = yes; then# Check if gcc -print-prog-name=ld gives a path.{ echo "$as_me:$LINENO: checking for ld used by $CC" >&5echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }case $host in*-*-mingw*)# gcc leaves a trailing carriage return which upsets mingwac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;*)ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;esaccase $ac_prog in# Accept absolute paths.[\\/]* | ?:[\\/]*)re_direlt='/[^/][^/]*/\.\./'# Canonicalize the pathname of ldac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; doac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`donetest -z "$LD" && LD="$ac_prog";;"")# If it fails, then pretend we aren't using GCC.ac_prog=ld;;*)# If it is relative, then search for the first ld in PATH.with_gnu_ld=unknown;;esacelif test "$with_gnu_ld" = yes; then{ echo "$as_me:$LINENO: checking for GNU ld" >&5echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }else{ echo "$as_me:$LINENO: checking for non-GNU ld" >&5echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }fiif test "${lt_cv_path_LD+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -z "$LD"; thenlt_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor ac_dir in $PATH; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; thenlt_cv_path_LD="$ac_dir/$ac_prog"# Check to see if the program is GNU ld. I'd rather use --version,# but apparently some variants of GNU ld only accept -v.# Break only if it was the GNU/non-GNU ld that we prefer.case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in*GNU* | *'with BFD'*)test "$with_gnu_ld" != no && break;;*)test "$with_gnu_ld" != yes && break;;esacfidoneIFS="$lt_save_ifs"elselt_cv_path_LD="$LD" # Let the user override the test with a path.fifiLD="$lt_cv_path_LD"if test -n "$LD"; then{ echo "$as_me:$LINENO: result: $LD" >&5echo "${ECHO_T}$LD" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fitest -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}{ (exit 1); exit 1; }; }{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }if test "${lt_cv_prog_gnu_ld+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6else# I'd rather use --version here, but apparently some GNU lds only accept -v.case `$LD -v 2>&1 </dev/null` in*GNU* | *'with BFD'*)lt_cv_prog_gnu_ld=yes;;*)lt_cv_prog_gnu_ld=no;;esacfi{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }with_gnu_ld=$lt_cv_prog_gnu_ld{ echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6; }if test "${lt_cv_path_NM+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$NM"; then# Let the user override the test.lt_cv_path_NM="$NM"elselt_nm_to_check="${ac_tool_prefix}nm"if test -n "$ac_tool_prefix" && test "$build" = "$host"; thenlt_nm_to_check="$lt_nm_to_check nm"fifor lt_tmp_nm in $lt_nm_to_check; dolt_save_ifs="$IFS"; IFS=$PATH_SEPARATORfor ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.tmp_nm="$ac_dir/$lt_tmp_nm"if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then# Check to see if the nm accepts a BSD-compat flag.# Adding the `sed 1q' prevents false positives on HP-UX, which says:# nm: unknown option "B" ignored# Tru64's nm complains that /dev/null is an invalid object filecase `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in*/dev/null* | *'Invalid file or object type'*)lt_cv_path_NM="$tmp_nm -B"break;;*)case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in*/dev/null*)lt_cv_path_NM="$tmp_nm -p"break;;*)lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, butcontinue # so that we can try to find one that supports BSD flags;;esac;;esacfidoneIFS="$lt_save_ifs"done: ${lt_cv_path_NM=no}fifi{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5echo "${ECHO_T}$lt_cv_path_NM" >&6; }if test "$lt_cv_path_NM" != "no"; thenNM="$lt_cv_path_NM"else# Didn't find any BSD compatible name lister, look for dumpbin.if test -n "$ac_tool_prefix"; thenfor ac_prog in "dumpbin -symbols" "link -dump -symbols"do# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.set dummy $ac_tool_prefix$ac_prog; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_DUMPBIN+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$DUMPBIN"; thenac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiDUMPBIN=$ac_cv_prog_DUMPBINif test -n "$DUMPBIN"; then{ echo "$as_me:$LINENO: result: $DUMPBIN" >&5echo "${ECHO_T}$DUMPBIN" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fitest -n "$DUMPBIN" && breakdonefiif test -z "$DUMPBIN"; thenac_ct_DUMPBIN=$DUMPBINfor ac_prog in "dumpbin -symbols" "link -dump -symbols"do# Extract the first word of "$ac_prog", so it can be a program name with args.set dummy $ac_prog; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_DUMPBIN"; thenac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_DUMPBIN="$ac_prog"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBINif test -n "$ac_ct_DUMPBIN"; then{ echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fitest -n "$ac_ct_DUMPBIN" && breakdoneif test "x$ac_ct_DUMPBIN" = x; thenDUMPBIN=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacDUMPBIN=$ac_ct_DUMPBINfifiif test "$DUMPBIN" != ":"; thenNM="$DUMPBIN"fifitest -z "$NM" && NM=nm{ echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; }if test "${lt_cv_nm_interface+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_nm_interface="BSD nm"echo "int some_variable = 0;" > conftest.$ac_ext(eval echo "\"\$as_me:4303: $ac_compile\"" >&5)(eval "$ac_compile" 2>conftest.err)cat conftest.err >&5(eval echo "\"\$as_me:4306: $NM \\\"conftest.$ac_objext\\\"\"" >&5)(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)cat conftest.err >&5(eval echo "\"\$as_me:4309: output\"" >&5)cat conftest.out >&5if $GREP 'External.*some_variable' conftest.out > /dev/null; thenlt_cv_nm_interface="MS dumpbin"firm -r -f conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5echo "${ECHO_T}$lt_cv_nm_interface" >&6; }{ echo "$as_me:$LINENO: checking whether ln -s works" >&5echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }LN_S=$as_ln_sif test "$LN_S" = "ln -s"; then{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }else{ echo "$as_me:$LINENO: result: no, using $LN_S" >&5echo "${ECHO_T}no, using $LN_S" >&6; }fi# find the maximum length of command line arguments{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }if test "${lt_cv_sys_max_cmd_len+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsei=0teststring="ABCD"case $build_os inmsdosdjgpp*)# On DJGPP, this test can blow up pretty badly due to problems in libc# (any single argument exceeding 2000 bytes causes a buffer overrun# during glob expansion). Even if it were fixed, the result of this# check would be larger than it should be.lt_cv_sys_max_cmd_len=12288; # 12K is about right;;gnu*)# Under GNU Hurd, this test is not required because there is# no limit to the length of command line arguments.# Libtool will interpret -1 as no limit whatsoeverlt_cv_sys_max_cmd_len=-1;;;cygwin* | mingw*)# On Win9x/ME, this test blows up -- it succeeds, but takes# about 5 minutes as the teststring grows exponentially.# Worse, since 9x/ME are not pre-emptively multitasking,# you end up with a "frozen" computer, even though with patience# the test eventually succeeds (with a max line length of 256k).# Instead, let's just punt: use the minimum linelength reported by# all of the supported platforms: 8192 (on NT/2K/XP).lt_cv_sys_max_cmd_len=8192;;;amigaos*)# On AmigaOS with pdksh, this test takes hours, literally.# So we just punt and use a minimum line length of 8192.lt_cv_sys_max_cmd_len=8192;;;netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)# This has been around since 386BSD, at least. Likely further.if test -x /sbin/sysctl; thenlt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`elif test -x /usr/sbin/sysctl; thenlt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`elselt_cv_sys_max_cmd_len=65536 # usable default for all BSDsfi# And add a safety zonelt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`;;interix*)# We know the value 262144 and hardcode it with a safety zone (like BSD)lt_cv_sys_max_cmd_len=196608;;osf*)# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not# nice to cause kernel panics so lets avoid the loop below.# First set a reasonable default.lt_cv_sys_max_cmd_len=16384#if test -x /sbin/sysconfig; thencase `/sbin/sysconfig -q proc exec_disable_arg_limit` in*1*) lt_cv_sys_max_cmd_len=-1 ;;esacfi;;sco3.2v5*)lt_cv_sys_max_cmd_len=102400;;sysv5* | sco5v6* | sysv4.2uw2*)kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`if test -n "$kargmax"; thenlt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`elselt_cv_sys_max_cmd_len=32768fi;;*)lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`if test -n "$lt_cv_sys_max_cmd_len"; thenlt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`else# Make teststring a little bigger before we do anything with it.# a 1K string should be a reasonable start.for i in 1 2 3 4 5 6 7 8 ; doteststring=$teststring$teststringdoneSHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}# If test is not a shell built-in, we'll probably end up computing a# maximum length that is only half of the actual maximum length, but# we can't tell.while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \= "XX$teststring$teststring"; } >/dev/null 2>&1 &&test $i != 17 # 1/2 MB should be enoughdoi=`expr $i + 1`teststring=$teststring$teststringdone# Only check the string length outside the loop.lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`teststring=# Add a significant safety factor because C++ compilers can tack on# massive amounts of additional arguments before passing them to the# linker. It appears as though 1/2 is a usable value.lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`fi;;esacfiif test -n $lt_cv_sys_max_cmd_len ; then{ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }else{ echo "$as_me:$LINENO: result: none" >&5echo "${ECHO_T}none" >&6; }fimax_cmd_len=$lt_cv_sys_max_cmd_len: ${CP="cp -f"}: ${MV="mv -f"}: ${RM="rm -f"}{ echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; }# Try some XSI featuresxsi_shell=no( _lt_dummy="a/b/c"test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \= c,a/b,, \&& eval 'test $(( 1 + 1 )) -eq 2 \&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \&& xsi_shell=yes{ echo "$as_me:$LINENO: result: $xsi_shell" >&5echo "${ECHO_T}$xsi_shell" >&6; }{ echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; }lt_shell_append=no( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \>/dev/null 2>&1 \&& lt_shell_append=yes{ echo "$as_me:$LINENO: result: $lt_shell_append" >&5echo "${ECHO_T}$lt_shell_append" >&6; }if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; thenlt_unset=unsetelselt_unset=falsefi# test EBCDIC or ASCIIcase `echo X|tr X '\101'` inA) # ASCII based system# \n is not interpreted correctly by Solaris 8 /usr/ucb/trlt_SP2NL='tr \040 \012'lt_NL2SP='tr \015\012 \040\040';;*) # EBCDIC based systemlt_SP2NL='tr \100 \n'lt_NL2SP='tr \r\n \100\100';;esac{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }if test "${lt_cv_ld_reload_flag+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_ld_reload_flag='-r'fi{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }reload_flag=$lt_cv_ld_reload_flagcase $reload_flag in"" | " "*) ;;*) reload_flag=" $reload_flag" ;;esacreload_cmds='$LD$reload_flag -o $output$reload_objs'case $host_os indarwin*)if test "$GCC" = yes; thenreload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'elsereload_cmds='$LD$reload_flag -o $output$reload_objs'fi;;esac{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }if test "${lt_cv_deplibs_check_method+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_file_magic_cmd='$MAGIC_CMD'lt_cv_file_magic_test_file=lt_cv_deplibs_check_method='unknown'# Need to set the preceding variable on all platforms that support# interlibrary dependencies.# 'none' -- dependencies not supported.# `unknown' -- same as none, but documents that we really don't know.# 'pass_all' -- all dependencies passed with no checks.# 'test_compile' -- check by making test program.# 'file_magic [[regex]]' -- check by looking for files in library path# which responds to the $file_magic_cmd with a given extended regex.# If you have `file' or equivalent on your system and you're not sure# whether `pass_all' will *always* work, you probably want this one.case $host_os inaix[4-9]*)lt_cv_deplibs_check_method=pass_all;;beos*)lt_cv_deplibs_check_method=pass_all;;bsdi[45]*)lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'lt_cv_file_magic_cmd='/usr/bin/file -L'lt_cv_file_magic_test_file=/shlib/libc.so;;cygwin*)# func_win32_libid is a shell function defined in ltmain.shlt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'lt_cv_file_magic_cmd='func_win32_libid';;mingw* | pw32*)# Base MSYS/MinGW do not provide the 'file' command needed by# func_win32_libid shell function, so use a weaker test based on 'objdump',# unless we find 'file', for example because we are cross-compiling.if ( file / ) >/dev/null 2>&1; thenlt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'lt_cv_file_magic_cmd='func_win32_libid'elselt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'lt_cv_file_magic_cmd='$OBJDUMP -f'fi;;darwin* | rhapsody*)lt_cv_deplibs_check_method=pass_all;;freebsd* | dragonfly*)if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; thencase $host_cpu ini*86 )# Not sure whether the presence of OpenBSD here was a mistake.# Let's accept both of them until this is cleared up.lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'lt_cv_file_magic_cmd=/usr/bin/filelt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`;;esacelselt_cv_deplibs_check_method=pass_allfi;;gnu*)lt_cv_deplibs_check_method=pass_all;;hpux10.20* | hpux11*)lt_cv_file_magic_cmd=/usr/bin/filecase $host_cpu inia64*)lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so;;hppa*64*)lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl;;*)lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'lt_cv_file_magic_test_file=/usr/lib/libc.sl;;esac;;interix[3-9]*)# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a herelt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$';;irix5* | irix6* | nonstopux*)case $LD in*-32|*"-32 ") libmagic=32-bit;;*-n32|*"-n32 ") libmagic=N32;;*-64|*"-64 ") libmagic=64-bit;;*) libmagic=never-match;;esaclt_cv_deplibs_check_method=pass_all;;# This must be Linux ELF.linux* | k*bsd*-gnu)lt_cv_deplibs_check_method=pass_all;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; thenlt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'elselt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'fi;;newos6*)lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'lt_cv_file_magic_cmd=/usr/bin/filelt_cv_file_magic_test_file=/usr/lib/libnls.so;;*nto* | *qnx*)lt_cv_deplibs_check_method=pass_all;;openbsd*)if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; thenlt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'elselt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'fi;;osf3* | osf4* | osf5*)lt_cv_deplibs_check_method=pass_all;;rdos*)lt_cv_deplibs_check_method=pass_all;;solaris*)lt_cv_deplibs_check_method=pass_all;;sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)lt_cv_deplibs_check_method=pass_all;;sysv4 | sysv4.3*)case $host_vendor inmotorola)lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`;;ncr)lt_cv_deplibs_check_method=pass_all;;sequent)lt_cv_file_magic_cmd='/bin/file'lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )';;sni)lt_cv_file_magic_cmd='/bin/file'lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"lt_cv_file_magic_test_file=/lib/libc.so;;siemens)lt_cv_deplibs_check_method=pass_all;;pc)lt_cv_deplibs_check_method=pass_all;;esac;;tpf*)lt_cv_deplibs_check_method=pass_all;;esacfi{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }file_magic_cmd=$lt_cv_file_magic_cmddeplibs_check_method=$lt_cv_deplibs_check_methodtest -z "$deplibs_check_method" && deplibs_check_method=unknownif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.set dummy ${ac_tool_prefix}ar; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_AR+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$AR"; thenac_cv_prog_AR="$AR" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_AR="${ac_tool_prefix}ar"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiAR=$ac_cv_prog_ARif test -n "$AR"; then{ echo "$as_me:$LINENO: result: $AR" >&5echo "${ECHO_T}$AR" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_AR"; thenac_ct_AR=$AR# Extract the first word of "ar", so it can be a program name with args.set dummy ar; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_AR+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_AR"; thenac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_AR="ar"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_AR=$ac_cv_prog_ac_ct_ARif test -n "$ac_ct_AR"; then{ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5echo "${ECHO_T}$ac_ct_AR" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_AR" = x; thenAR="false"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacAR=$ac_ct_ARfielseAR="$ac_cv_prog_AR"fitest -z "$AR" && AR=artest -z "$AR_FLAGS" && AR_FLAGS=cruif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.set dummy ${ac_tool_prefix}strip; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_STRIP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$STRIP"; thenac_cv_prog_STRIP="$STRIP" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_STRIP="${ac_tool_prefix}strip"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiSTRIP=$ac_cv_prog_STRIPif test -n "$STRIP"; then{ echo "$as_me:$LINENO: result: $STRIP" >&5echo "${ECHO_T}$STRIP" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_STRIP"; thenac_ct_STRIP=$STRIP# Extract the first word of "strip", so it can be a program name with args.set dummy strip; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_STRIP"; thenac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_STRIP="strip"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_STRIP=$ac_cv_prog_ac_ct_STRIPif test -n "$ac_ct_STRIP"; then{ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5echo "${ECHO_T}$ac_ct_STRIP" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_STRIP" = x; thenSTRIP=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacSTRIP=$ac_ct_STRIPfielseSTRIP="$ac_cv_prog_STRIP"fitest -z "$STRIP" && STRIP=:if test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.set dummy ${ac_tool_prefix}ranlib; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_RANLIB+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$RANLIB"; thenac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiRANLIB=$ac_cv_prog_RANLIBif test -n "$RANLIB"; then{ echo "$as_me:$LINENO: result: $RANLIB" >&5echo "${ECHO_T}$RANLIB" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_RANLIB"; thenac_ct_RANLIB=$RANLIB# Extract the first word of "ranlib", so it can be a program name with args.set dummy ranlib; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_RANLIB"; thenac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_RANLIB="ranlib"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIBif test -n "$ac_ct_RANLIB"; then{ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5echo "${ECHO_T}$ac_ct_RANLIB" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_RANLIB" = x; thenRANLIB=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacRANLIB=$ac_ct_RANLIBfielseRANLIB="$ac_cv_prog_RANLIB"fitest -z "$RANLIB" && RANLIB=:# Determine commands to create old-style static archives.old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'old_postinstall_cmds='chmod 644 $oldlib'old_postuninstall_cmds=if test -n "$RANLIB"; thencase $host_os inopenbsd*)old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib";;*)old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib";;esacold_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"fi# If no C compiler was specified, use CC.LTCC=${LTCC-"$CC"}# If no C compiler flags were specified, use CFLAGS.LTCFLAGS=${LTCFLAGS-"$CFLAGS"}# Allow CC to be a program name with arguments.compiler=$CC# Check for command to grab the raw symbol name followed by C symbol from nm.{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }if test "${lt_cv_sys_global_symbol_pipe+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6else# These are sane defaults that work on at least a few old systems.# [They come from Ultrix. What could be older than Ultrix?!! ;)]# Character class describing NM global symbol codes.symcode='[BCDEGRST]'# Regexp to match symbols that can be accessed directly from C.sympat='\([_A-Za-z][_A-Za-z0-9]*\)'# Define system-specific variables.case $host_os inaix*)symcode='[BCDT]';;cygwin* | mingw* | pw32*)symcode='[ABCDGISTW]';;hpux*)if test "$host_cpu" = ia64; thensymcode='[ABCDEGRST]'fi;;irix* | nonstopux*)symcode='[BCDEGRST]';;osf*)symcode='[BCDEGQRST]';;solaris*)symcode='[BDRT]';;sco3.2v5*)symcode='[DT]';;sysv4.2uw2*)symcode='[DT]';;sysv5* | sco5v6* | unixware* | OpenUNIX*)symcode='[ABDT]';;sysv4)symcode='[DFNSTU]';;esac# If we're using GNU nm, then use its standard symbol codes.case `$NM -V 2>&1` in*GNU* | *'with BFD'*)symcode='[ABCDGIRSTW]' ;;esac# Transform an extracted symbol line into a proper C declaration.# Some systems (esp. on ia64) link data and code symbols differently,# so use this general approach.lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"# Transform an extracted symbol line into symbol name and symbol addresslt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"# Handle CRLF in mingw tool chainopt_cr=case $build_os inmingw*)opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp;;esac# Try without a prefix underscore, then with it.for ac_symprfx in "" "_"; do# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.symxfrm="\\1 $ac_symprfx\\2 \\2"# Write the raw and C identifiers.if test "$lt_cv_nm_interface" = "MS dumpbin"; then# Fake it for dumpbin and say T for any non-static function# and D for any global variable.# Also find C++ and __fastcall symbols from MSVC++,# which start with @ or ?.lt_cv_sys_global_symbol_pipe="$AWK '"\" {last_section=section; section=\$ 3};"\" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\" \$ 0!~/External *\|/{next};"\" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\" {if(hide[section]) next};"\" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\" s[1]~/^[@?]/{print s[1], s[1]; next};"\" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\" ' prfx=^$ac_symprfx"elselt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"fi# Check to see that the pipe works correctly.pipe_works=norm -r -f conftest*cat > conftest.$ac_ext <<_LT_EOF#ifdef __cplusplusextern "C" {#endifchar nm_test_var;void nm_test_func(void);void nm_test_func(void){}#ifdef __cplusplus}#endifint main(){nm_test_var='a';nm_test_func();return(0);}_LT_EOFif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5(eval $ac_compile) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; then# Now try to grab the symbols.nlist=conftest.nmif { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5(eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && test -s "$nlist"; then# Try sorting and uniquifying the output.if sort "$nlist" | uniq > "$nlist"T; thenmv -f "$nlist"T "$nlist"elserm -f "$nlist"Tfi# Make sure that we snagged all the symbols we need.if $GREP ' nm_test_var$' "$nlist" >/dev/null; thenif $GREP ' nm_test_func$' "$nlist" >/dev/null; thencat <<_LT_EOF > conftest.$ac_ext#ifdef __cplusplusextern "C" {#endif_LT_EOF# Now generate the symbol file.eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'cat <<_LT_EOF >> conftest.$ac_ext/* The mapping between symbol names and symbols. */const struct {const char *name;void *address;}lt__PROGRAM__LTX_preloaded_symbols[] ={{ "@PROGRAM@", (void *) 0 },_LT_EOF$SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_extcat <<\_LT_EOF >> conftest.$ac_ext{0, (void *) 0}};/* This works around a problem in FreeBSD linker */#ifdef FREEBSD_WORKAROUNDstatic const void *lt_preloaded_setup() {return lt__PROGRAM__LTX_preloaded_symbols;}#endif#ifdef __cplusplus}#endif_LT_EOF# Now try linking the two files.mv conftest.$ac_objext conftstm.$ac_objextlt_save_LIBS="$LIBS"lt_save_CFLAGS="$CFLAGS"LIBS="conftstm.$ac_objext"CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5(eval $ac_link) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && test -s conftest${ac_exeext}; thenpipe_works=yesfiLIBS="$lt_save_LIBS"CFLAGS="$lt_save_CFLAGS"elseecho "cannot find nm_test_func in $nlist" >&5fielseecho "cannot find nm_test_var in $nlist" >&5fielseecho "cannot run $lt_cv_sys_global_symbol_pipe" >&5fielseecho "$progname: failed program was:" >&5cat conftest.$ac_ext >&5firm -rf conftest* conftst*# Do not use the global_symbol_pipe unless it works.if test "$pipe_works" = yes; thenbreakelselt_cv_sys_global_symbol_pipe=fidonefiif test -z "$lt_cv_sys_global_symbol_pipe"; thenlt_cv_sys_global_symbol_to_cdecl=fiif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then{ echo "$as_me:$LINENO: result: failed" >&5echo "${ECHO_T}failed" >&6; }else{ echo "$as_me:$LINENO: result: ok" >&5echo "${ECHO_T}ok" >&6; }fi# Check whether --enable-libtool-lock was given.if test "${enable_libtool_lock+set}" = set; thenenableval=$enable_libtool_lock;fitest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes# Some flags need to be propagated to the compiler or linker for good# libtool support.case $host inia64-*-hpux*)# Find out which ABI we are using.echo 'int i;' > conftest.$ac_extif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5(eval $ac_compile) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; thencase `/usr/bin/file conftest.$ac_objext` in*ELF-32*)HPUX_IA64_MODE="32";;*ELF-64*)HPUX_IA64_MODE="64";;esacfirm -rf conftest*;;*-*-irix6*)# Find out which ABI we are using.echo '#line 5420 "configure"' > conftest.$ac_extif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5(eval $ac_compile) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; thenif test "$lt_cv_prog_gnu_ld" = yes; thencase `/usr/bin/file conftest.$ac_objext` in*32-bit*)LD="${LD-ld} -melf32bsmip";;*N32*)LD="${LD-ld} -melf32bmipn32";;*64-bit*)LD="${LD-ld} -melf64bmip";;esacelsecase `/usr/bin/file conftest.$ac_objext` in*32-bit*)LD="${LD-ld} -32";;*N32*)LD="${LD-ld} -n32";;*64-bit*)LD="${LD-ld} -64";;esacfifirm -rf conftest*;;x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \s390*-*linux*|s390*-*tpf*|sparc*-*linux*)# Find out which ABI we are using.echo 'int i;' > conftest.$ac_extif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5(eval $ac_compile) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; thencase `/usr/bin/file conftest.o` in*32-bit*)case $host inx86_64-*kfreebsd*-gnu)LD="${LD-ld} -m elf_i386_fbsd";;x86_64-*linux*)LD="${LD-ld} -m elf_i386";;ppc64-*linux*|powerpc64-*linux*)LD="${LD-ld} -m elf32ppclinux";;s390x-*linux*)LD="${LD-ld} -m elf_s390";;sparc64-*linux*)LD="${LD-ld} -m elf32_sparc";;esac;;*64-bit*)case $host inx86_64-*kfreebsd*-gnu)LD="${LD-ld} -m elf_x86_64_fbsd";;x86_64-*linux*)LD="${LD-ld} -m elf_x86_64";;ppc*-*linux*|powerpc*-*linux*)LD="${LD-ld} -m elf64ppc";;s390*-*linux*|s390*-*tpf*)LD="${LD-ld} -m elf64_s390";;sparc*-*linux*)LD="${LD-ld} -m elf64_sparc";;esac;;esacfirm -rf conftest*;;*-*-sco3.2v5*)# On SCO OpenServer 5, we need -belf to get full-featured binaries.SAVE_CFLAGS="$CFLAGS"CFLAGS="$CFLAGS -belf"{ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }if test "${lt_cv_cc_needs_belf+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnucat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenlt_cv_cc_needs_belf=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5lt_cv_cc_needs_belf=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnufi{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }if test x"$lt_cv_cc_needs_belf" != x"yes"; then# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belfCFLAGS="$SAVE_CFLAGS"fi;;sparc*-*solaris*)# Find out which ABI we are using.echo 'int i;' > conftest.$ac_extif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5(eval $ac_compile) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; thencase `/usr/bin/file conftest.o` in*64-bit*)case $lt_cv_prog_gnu_ld inyes*) LD="${LD-ld} -m elf64_sparc" ;;*)if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; thenLD="${LD-ld} -64"fi;;esac;;esacfirm -rf conftest*;;esacneed_locks="$enable_libtool_lock"case $host_os inrhapsody* | darwin*)if test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.set dummy ${ac_tool_prefix}dsymutil; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_DSYMUTIL+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$DSYMUTIL"; thenac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiDSYMUTIL=$ac_cv_prog_DSYMUTILif test -n "$DSYMUTIL"; then{ echo "$as_me:$LINENO: result: $DSYMUTIL" >&5echo "${ECHO_T}$DSYMUTIL" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_DSYMUTIL"; thenac_ct_DSYMUTIL=$DSYMUTIL# Extract the first word of "dsymutil", so it can be a program name with args.set dummy dsymutil; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_DSYMUTIL"; thenac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_DSYMUTIL="dsymutil"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTILif test -n "$ac_ct_DSYMUTIL"; then{ echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_DSYMUTIL" = x; thenDSYMUTIL=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacDSYMUTIL=$ac_ct_DSYMUTILfielseDSYMUTIL="$ac_cv_prog_DSYMUTIL"fiif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.set dummy ${ac_tool_prefix}nmedit; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_NMEDIT+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$NMEDIT"; thenac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiNMEDIT=$ac_cv_prog_NMEDITif test -n "$NMEDIT"; then{ echo "$as_me:$LINENO: result: $NMEDIT" >&5echo "${ECHO_T}$NMEDIT" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_NMEDIT"; thenac_ct_NMEDIT=$NMEDIT# Extract the first word of "nmedit", so it can be a program name with args.set dummy nmedit; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_NMEDIT"; thenac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_NMEDIT="nmedit"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDITif test -n "$ac_ct_NMEDIT"; then{ echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5echo "${ECHO_T}$ac_ct_NMEDIT" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_NMEDIT" = x; thenNMEDIT=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacNMEDIT=$ac_ct_NMEDITfielseNMEDIT="$ac_cv_prog_NMEDIT"fiif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.set dummy ${ac_tool_prefix}lipo; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_LIPO+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$LIPO"; thenac_cv_prog_LIPO="$LIPO" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_LIPO="${ac_tool_prefix}lipo"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiLIPO=$ac_cv_prog_LIPOif test -n "$LIPO"; then{ echo "$as_me:$LINENO: result: $LIPO" >&5echo "${ECHO_T}$LIPO" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_LIPO"; thenac_ct_LIPO=$LIPO# Extract the first word of "lipo", so it can be a program name with args.set dummy lipo; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_LIPO"; thenac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_LIPO="lipo"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_LIPO=$ac_cv_prog_ac_ct_LIPOif test -n "$ac_ct_LIPO"; then{ echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5echo "${ECHO_T}$ac_ct_LIPO" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_LIPO" = x; thenLIPO=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacLIPO=$ac_ct_LIPOfielseLIPO="$ac_cv_prog_LIPO"fiif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.set dummy ${ac_tool_prefix}otool; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_OTOOL+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$OTOOL"; thenac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_OTOOL="${ac_tool_prefix}otool"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiOTOOL=$ac_cv_prog_OTOOLif test -n "$OTOOL"; then{ echo "$as_me:$LINENO: result: $OTOOL" >&5echo "${ECHO_T}$OTOOL" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_OTOOL"; thenac_ct_OTOOL=$OTOOL# Extract the first word of "otool", so it can be a program name with args.set dummy otool; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_OTOOL"; thenac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_OTOOL="otool"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOLif test -n "$ac_ct_OTOOL"; then{ echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5echo "${ECHO_T}$ac_ct_OTOOL" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_OTOOL" = x; thenOTOOL=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacOTOOL=$ac_ct_OTOOLfielseOTOOL="$ac_cv_prog_OTOOL"fiif test -n "$ac_tool_prefix"; then# Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.set dummy ${ac_tool_prefix}otool64; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_OTOOL64+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$OTOOL64"; thenac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiOTOOL64=$ac_cv_prog_OTOOL64if test -n "$OTOOL64"; then{ echo "$as_me:$LINENO: result: $OTOOL64" >&5echo "${ECHO_T}$OTOOL64" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fifiif test -z "$ac_cv_prog_OTOOL64"; thenac_ct_OTOOL64=$OTOOL64# Extract the first word of "otool64", so it can be a program name with args.set dummy otool64; ac_word=$2{ echo "$as_me:$LINENO: checking for $ac_word" >&5echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test -n "$ac_ct_OTOOL64"; thenac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.for ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; thenac_cv_prog_ac_ct_OTOOL64="otool64"echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5break 2fidonedoneIFS=$as_save_IFSfifiac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64if test -n "$ac_ct_OTOOL64"; then{ echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5echo "${ECHO_T}$ac_ct_OTOOL64" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test "x$ac_ct_OTOOL64" = x; thenOTOOL64=":"elsecase $cross_compiling:$ac_tool_warned inyes:){ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&5echo "$as_me: WARNING: In the future, Autoconf will not detect cross-toolswhose name does not start with the host triplet. If you think thisconfiguration is useful to you, please write to autoconf@gnu.org." >&2;}ac_tool_warned=yes ;;esacOTOOL64=$ac_ct_OTOOL64fielseOTOOL64="$ac_cv_prog_OTOOL64"fi{ echo "$as_me:$LINENO: checking for -single_module linker flag" >&5echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; }if test "${lt_cv_apple_cc_single_mod+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_apple_cc_single_mod=noif test -z "${LT_MULTI_MODULE}"; then# By default we will add the -single_module flag. You can override# by either setting the environment variable LT_MULTI_MODULE# non-empty at configure time, or by adding -multi_module to the# link flags.rm -rf libconftest.dylib*echo "int foo(void){return 1;}" > conftest.cecho "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \-dynamiclib -Wl,-single_module conftest.c" >&5$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \-dynamiclib -Wl,-single_module conftest.c 2>conftest.err_lt_result=$?if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; thenlt_cv_apple_cc_single_mod=yeselsecat conftest.err >&5firm -rf libconftest.dylib*rm -f conftest.*fifi{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; }{ echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; }if test "${lt_cv_ld_exported_symbols_list+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_ld_exported_symbols_list=nosave_LDFLAGS=$LDFLAGSecho "_main" > conftest.symLDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenlt_cv_ld_exported_symbols_list=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5lt_cv_ld_exported_symbols_list=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLDFLAGS="$save_LDFLAGS"fi{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }case $host_os inrhapsody* | darwin1.[012])_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;darwin1.*)_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;darwin*) # darwin 5.x on# if running on 10.5 or later, the deployment target defaults# to the OS version, if on x86, and 10.4, the deployment# target defaults to 10.4. Don't you love it?case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in10.0,*86*-darwin8*|10.0,*-darwin[91]*)_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;10.[012]*)_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;10.*)_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;esac;;esacif test "$lt_cv_apple_cc_single_mod" = "yes"; then_lt_dar_single_mod='$single_module'fiif test "$lt_cv_ld_exported_symbols_list" = "yes"; then_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'else_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'fiif test "$DSYMUTIL" != ":"; then_lt_dsymutil='~$DSYMUTIL $lib || :'else_lt_dsymutil=fi;;esacac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnu{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }# On Suns, sometimes $CPP names a directory.if test -n "$CPP" && test -d "$CPP"; thenCPP=fiif test -z "$CPP"; thenif test "${ac_cv_prog_CPP+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6else# Double quotes because CPP needs to be expandedfor CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"doac_preproc_ok=falsefor ac_c_preproc_warn_flag in '' yesdo# Use a header file that comes with gcc, so configuring glibc# with a fresh cross-compiler works.# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since# <limits.h> exists even on freestanding compilers.# On the NeXT, cc -E runs the code through the compiler's parser,# not just through cpp. "Syntax error" is here to catch this case.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#ifdef __STDC__# include <limits.h>#else# include <assert.h>#endifSyntax error_ACEOFif { (ac_try="$ac_cpp conftest.$ac_ext"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } >/dev/null && {test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||test ! -s conftest.err}; then:elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5# Broken: fails on valid input.continuefirm -f conftest.err conftest.$ac_ext# OK, works on sane cases. Now check whether nonexistent headers# can be detected and how.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <ac_nonexistent.h>_ACEOFif { (ac_try="$ac_cpp conftest.$ac_ext"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } >/dev/null && {test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||test ! -s conftest.err}; then# Broken: success on invalid input.continueelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5# Passes both tests.ac_preproc_ok=:breakfirm -f conftest.err conftest.$ac_extdone# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.rm -f conftest.err conftest.$ac_extif $ac_preproc_ok; thenbreakfidoneac_cv_prog_CPP=$CPPfiCPP=$ac_cv_prog_CPPelseac_cv_prog_CPP=$CPPfi{ echo "$as_me:$LINENO: result: $CPP" >&5echo "${ECHO_T}$CPP" >&6; }ac_preproc_ok=falsefor ac_c_preproc_warn_flag in '' yesdo# Use a header file that comes with gcc, so configuring glibc# with a fresh cross-compiler works.# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since# <limits.h> exists even on freestanding compilers.# On the NeXT, cc -E runs the code through the compiler's parser,# not just through cpp. "Syntax error" is here to catch this case.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#ifdef __STDC__# include <limits.h>#else# include <assert.h>#endifSyntax error_ACEOFif { (ac_try="$ac_cpp conftest.$ac_ext"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } >/dev/null && {test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||test ! -s conftest.err}; then:elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5# Broken: fails on valid input.continuefirm -f conftest.err conftest.$ac_ext# OK, works on sane cases. Now check whether nonexistent headers# can be detected and how.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <ac_nonexistent.h>_ACEOFif { (ac_try="$ac_cpp conftest.$ac_ext"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } >/dev/null && {test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||test ! -s conftest.err}; then# Broken: success on invalid input.continueelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5# Passes both tests.ac_preproc_ok=:breakfirm -f conftest.err conftest.$ac_extdone# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.rm -f conftest.err conftest.$ac_extif $ac_preproc_ok; then:else{ { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity checkSee \`config.log' for more details." >&5echo "$as_me: error: C preprocessor \"$CPP\" fails sanity checkSee \`config.log' for more details." >&2;}{ (exit 1); exit 1; }; }fiac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnu{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }if test "${ac_cv_header_stdc+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <float.h>intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_header_stdc=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_header_stdc=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extif test $ac_cv_header_stdc = yes; then# SunOS 4.x string.h does not declare mem*, contrary to ANSI.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <string.h>_ACEOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |$EGREP "memchr" >/dev/null 2>&1; then:elseac_cv_header_stdc=nofirm -f -r conftest*fiif test $ac_cv_header_stdc = yes; then# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <stdlib.h>_ACEOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |$EGREP "free" >/dev/null 2>&1; then:elseac_cv_header_stdc=nofirm -f -r conftest*fiif test $ac_cv_header_stdc = yes; then# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.if test "$cross_compiling" = yes; then:elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <ctype.h>#include <stdlib.h>#if ((' ' & 0x0FF) == 0x020)# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))#else# define ISLOWER(c) \(('a' <= (c) && (c) <= 'i') \|| ('j' <= (c) && (c) <= 'r') \|| ('s' <= (c) && (c) <= 'z'))# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))#endif#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))intmain (){int i;for (i = 0; i < 256; i++)if (XOR (islower (i), ISLOWER (i))|| toupper (i) != TOUPPER (i))return 2;return 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; then:elseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )ac_cv_header_stdc=nofirm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfififi{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5echo "${ECHO_T}$ac_cv_header_stdc" >&6; }if test $ac_cv_header_stdc = yes; thencat >>confdefs.h <<\_ACEOF#define STDC_HEADERS 1_ACEOFfi# On IRIX 5.3, sys/types and inttypes.h are conflicting.for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \inttypes.h stdint.h unistd.hdoas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`{ echo "$as_me:$LINENO: checking for $ac_header" >&5echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_default#include <$ac_header>_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; theneval "$as_ac_Header=yes"elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5eval "$as_ac_Header=no"firm -f core conftest.err conftest.$ac_objext conftest.$ac_extfiac_res=`eval echo '${'$as_ac_Header'}'`{ echo "$as_me:$LINENO: result: $ac_res" >&5echo "${ECHO_T}$ac_res" >&6; }if test `eval echo '${'$as_ac_Header'}'` = yes; thencat >>confdefs.h <<_ACEOF#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1_ACEOFfidonefor ac_header in dlfcn.hdoas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`{ echo "$as_me:$LINENO: checking for $ac_header" >&5echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_default#include <$ac_header>_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; theneval "$as_ac_Header=yes"elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5eval "$as_ac_Header=no"firm -f core conftest.err conftest.$ac_objext conftest.$ac_extfiac_res=`eval echo '${'$as_ac_Header'}'`{ echo "$as_me:$LINENO: result: $ac_res" >&5echo "${ECHO_T}$ac_res" >&6; }if test `eval echo '${'$as_ac_Header'}'` = yes; thencat >>confdefs.h <<_ACEOF#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1_ACEOFfidone# Set optionsenable_dlopen=noenable_win32_dll=no# Check whether --enable-shared was given.if test "${enable_shared+set}" = set; thenenableval=$enable_shared; p=${PACKAGE-default}case $enableval inyes) enable_shared=yes ;;no) enable_shared=no ;;*)enable_shared=no# Look at the argument we got. We use all the common list separators.lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"for pkg in $enableval; doIFS="$lt_save_ifs"if test "X$pkg" = "X$p"; thenenable_shared=yesfidoneIFS="$lt_save_ifs";;esacelseenable_shared=yesfi# Check whether --enable-static was given.if test "${enable_static+set}" = set; thenenableval=$enable_static; p=${PACKAGE-default}case $enableval inyes) enable_static=yes ;;no) enable_static=no ;;*)enable_static=no# Look at the argument we got. We use all the common list separators.lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"for pkg in $enableval; doIFS="$lt_save_ifs"if test "X$pkg" = "X$p"; thenenable_static=yesfidoneIFS="$lt_save_ifs";;esacelseenable_static=yesfi# Check whether --with-pic was given.if test "${with_pic+set}" = set; thenwithval=$with_pic; pic_mode="$withval"elsepic_mode=defaultfitest -z "$pic_mode" && pic_mode=default# Check whether --enable-fast-install was given.if test "${enable_fast_install+set}" = set; thenenableval=$enable_fast_install; p=${PACKAGE-default}case $enableval inyes) enable_fast_install=yes ;;no) enable_fast_install=no ;;*)enable_fast_install=no# Look at the argument we got. We use all the common list separators.lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"for pkg in $enableval; doIFS="$lt_save_ifs"if test "X$pkg" = "X$p"; thenenable_fast_install=yesfidoneIFS="$lt_save_ifs";;esacelseenable_fast_install=yesfi# This can be used to rebuild libtool when neededLIBTOOL_DEPS="$ltmain"# Always use our own libtool.LIBTOOL='$(SHELL) $(top_builddir)/libtool'test -z "$LN_S" && LN_S="ln -s"if test -n "${ZSH_VERSION+set}" ; thensetopt NO_GLOB_SUBSTfi{ echo "$as_me:$LINENO: checking for objdir" >&5echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }if test "${lt_cv_objdir+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elserm -f .libs 2>/dev/nullmkdir .libs 2>/dev/nullif test -d .libs; thenlt_cv_objdir=.libselse# MS-DOS does not allow filenames that begin with a dot.lt_cv_objdir=_libsfirmdir .libs 2>/dev/nullfi{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5echo "${ECHO_T}$lt_cv_objdir" >&6; }objdir=$lt_cv_objdircat >>confdefs.h <<_ACEOF#define LT_OBJDIR "$lt_cv_objdir/"_ACEOFcase $host_os inaix3*)# AIX sometimes has problems with the GCC collect2 program. For some# reason, if we set the COLLECT_NAMES environment variable, the problems# vanish in a puff of smoke.if test "X${COLLECT_NAMES+set}" != Xset; thenCOLLECT_NAMES=export COLLECT_NAMESfi;;esac# Sed substitution that helps us do robust quoting. It backslashifies# metacharacters that are still active within double-quoted strings.sed_quote_subst='s/\(["`$\\]\)/\\\1/g'# Same as above, but do not quote variable references.double_quote_subst='s/\(["`\\]\)/\\\1/g'# Sed substitution to delay expansion of an escaped shell variable in a# double_quote_subst'ed string.delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'# Sed substitution to delay expansion of an escaped single quote.delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'# Sed substitution to avoid accidental globbing in evaled expressionsno_glob_subst='s/\*/\\\*/g'# Global variables:ofile=libtoolcan_build_shared=yes# All known linkers require a `.a' archive for static linking (except MSVC,# which needs '.lib').libext=awith_gnu_ld="$lt_cv_prog_gnu_ld"old_CC="$CC"old_CFLAGS="$CFLAGS"# Set sane defaults for various variablestest -z "$CC" && CC=cctest -z "$LTCC" && LTCC=$CCtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGStest -z "$LD" && LD=ldtest -z "$ac_objext" && ac_objext=ofor cc_temp in $compiler""; docase $cc_temp incompile | *[\\/]compile | ccache | *[\\/]ccache ) ;;distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;\-*) ;;*) break;;esacdonecc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`# Only perform the check for file, if the check method requires ittest -z "$MAGIC_CMD" && MAGIC_CMD=filecase $deplibs_check_method infile_magic*)if test "$file_magic_cmd" = '$MAGIC_CMD'; then{ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }if test "${lt_cv_path_MAGIC_CMD+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecase $MAGIC_CMD in[\\/*] | ?:[\\/]*)lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.;;*)lt_save_MAGIC_CMD="$MAGIC_CMD"lt_save_ifs="$IFS"; IFS=$PATH_SEPARATORac_dummy="/usr/bin$PATH_SEPARATOR$PATH"for ac_dir in $ac_dummy; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.if test -f $ac_dir/${ac_tool_prefix}file; thenlt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"if test -n "$file_magic_test_file"; thencase $deplibs_check_method in"file_magic "*)file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`MAGIC_CMD="$lt_cv_path_MAGIC_CMD"if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |$EGREP "$file_magic_regex" > /dev/null; then:elsecat <<_LT_EOF 1>&2*** Warning: the command libtool uses to detect shared libraries,*** $file_magic_cmd, produces output that libtool cannot recognize.*** The result is that libtool may fail to recognize shared libraries*** as such. This will affect the creation of libtool libraries that*** depend on shared libraries, but programs linked with such libtool*** libraries will work regardless of this problem. Nevertheless, you*** may want to report the problem to your system manager and/or to*** bug-libtool@gnu.org_LT_EOFfi ;;esacfibreakfidoneIFS="$lt_save_ifs"MAGIC_CMD="$lt_save_MAGIC_CMD";;esacfiMAGIC_CMD="$lt_cv_path_MAGIC_CMD"if test -n "$MAGIC_CMD"; then{ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5echo "${ECHO_T}$MAGIC_CMD" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fiif test -z "$lt_cv_path_MAGIC_CMD"; thenif test -n "$ac_tool_prefix"; then{ echo "$as_me:$LINENO: checking for file" >&5echo $ECHO_N "checking for file... $ECHO_C" >&6; }if test "${lt_cv_path_MAGIC_CMD+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecase $MAGIC_CMD in[\\/*] | ?:[\\/]*)lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.;;*)lt_save_MAGIC_CMD="$MAGIC_CMD"lt_save_ifs="$IFS"; IFS=$PATH_SEPARATORac_dummy="/usr/bin$PATH_SEPARATOR$PATH"for ac_dir in $ac_dummy; doIFS="$lt_save_ifs"test -z "$ac_dir" && ac_dir=.if test -f $ac_dir/file; thenlt_cv_path_MAGIC_CMD="$ac_dir/file"if test -n "$file_magic_test_file"; thencase $deplibs_check_method in"file_magic "*)file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`MAGIC_CMD="$lt_cv_path_MAGIC_CMD"if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |$EGREP "$file_magic_regex" > /dev/null; then:elsecat <<_LT_EOF 1>&2*** Warning: the command libtool uses to detect shared libraries,*** $file_magic_cmd, produces output that libtool cannot recognize.*** The result is that libtool may fail to recognize shared libraries*** as such. This will affect the creation of libtool libraries that*** depend on shared libraries, but programs linked with such libtool*** libraries will work regardless of this problem. Nevertheless, you*** may want to report the problem to your system manager and/or to*** bug-libtool@gnu.org_LT_EOFfi ;;esacfibreakfidoneIFS="$lt_save_ifs"MAGIC_CMD="$lt_save_MAGIC_CMD";;esacfiMAGIC_CMD="$lt_cv_path_MAGIC_CMD"if test -n "$MAGIC_CMD"; then{ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5echo "${ECHO_T}$MAGIC_CMD" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fielseMAGIC_CMD=:fififi;;esac# Use C for the default configuration in the libtool scriptlt_save_CC="$CC"ac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnu# Source file extension for C test sources.ac_ext=c# Object file extension for compiled C test sources.objext=oobjext=$objext# Code to be used in simple compile testslt_simple_compile_test_code="int some_variable = 0;"# Code to be used in simple link testslt_simple_link_test_code='int main(){return(0);}'# If no C compiler was specified, use CC.LTCC=${LTCC-"$CC"}# If no C compiler flags were specified, use CFLAGS.LTCFLAGS=${LTCFLAGS-"$CFLAGS"}# Allow CC to be a program name with arguments.compiler=$CC# Save the default compiler, since it gets overwritten when the other# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.compiler_DEFAULT=$CC# save warnings/boilerplate of simple test codeac_outfile=conftest.$ac_objextecho "$lt_simple_compile_test_code" >conftest.$ac_exteval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err_lt_compiler_boilerplate=`cat conftest.err`$RM -r conftest*ac_outfile=conftest.$ac_objextecho "$lt_simple_link_test_code" >conftest.$ac_exteval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err_lt_linker_boilerplate=`cat conftest.err`$RM -r conftest*if test -n "$compiler"; thenlt_prog_compiler_no_builtin_flag=if test "$GCC" = yes; thenlt_prog_compiler_no_builtin_flag=' -fno-builtin'{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_prog_compiler_rtti_exceptions=noac_outfile=conftest.$ac_objextecho "$lt_simple_compile_test_code" > conftest.$ac_extlt_compiler_flag="-fno-rtti -fno-exceptions"# Insert the option either (1) after the last *FLAGS variable, or# (2) before a word containing "conftest.", or (3) at the end.# Note that $ac_compile itself does not contain backslashes and begins# with a dollar sign (not a hyphen), so the echo should work correctly.# The option is referenced via a variable to avoid confusing sed.lt_compile=`echo "$ac_compile" | $SED \-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \-e 's:$: $lt_compiler_flag:'`(eval echo "\"\$as_me:7267: $lt_compile\"" >&5)(eval "$lt_compile" 2>conftest.err)ac_status=$?cat conftest.err >&5echo "$as_me:7271: \$? = $ac_status" >&5if (exit $ac_status) && test -s "$ac_outfile"; then# The compiler can only warn and ignore the option if not recognized# So say no if there are warnings other than the usual output.$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; thenlt_cv_prog_compiler_rtti_exceptions=yesfifi$RM -r conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; thenlt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"else:fifilt_prog_compiler_wl=lt_prog_compiler_pic=lt_prog_compiler_static={ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }if test "$GCC" = yes; thenlt_prog_compiler_wl='-Wl,'lt_prog_compiler_static='-static'case $host_os inaix*)# All AIX code is PIC.if test "$host_cpu" = ia64; then# AIX 5 now supports IA64 processorlt_prog_compiler_static='-Bstatic'fi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so supportlt_prog_compiler_pic='-fPIC';;m68k)# FIXME: we need at least 68020 code to build shared libraries, but# adding the `-m68020' flag to GCC prevents building anything better,# like `-m68040'.lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4';;esac;;beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)# PIC is the default for these OSes.;;mingw* | cygwin* | pw32* | os2*)# This hack is so that the source file can tell whether it is being# built for inclusion in a dll (and should export symbols for example).# Although the cygwin gcc ignores -fPIC, still need this for old-style# (--disable-auto-import) librarieslt_prog_compiler_pic='-DDLL_EXPORT';;darwin* | rhapsody*)# PIC is the default on this platform# Common symbols not allowed in MH_DYLIB fileslt_prog_compiler_pic='-fno-common';;hpux*)# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but# not for PA HP-UX.case $host_cpu inhppa*64*|ia64*)# +Z the default;;*)lt_prog_compiler_pic='-fPIC';;esac;;interix[3-9]*)# Interix 3.x gcc -fpic/-fPIC options generate broken code.# Instead, we relocate shared libraries at runtime.;;msdosdjgpp*)# Just because we use GCC doesn't mean we suddenly get shared libraries# on systems that don't support them.lt_prog_compiler_can_build_shared=noenable_shared=no;;*nto* | *qnx*)# QNX uses GNU C++, but need to define -shared option too, otherwise# it will coredump.lt_prog_compiler_pic='-fPIC -shared';;sysv4*MP*)if test -d /usr/nec; thenlt_prog_compiler_pic=-Kconform_picfi;;*)lt_prog_compiler_pic='-fPIC';;esacelse# PORTME Check for flag to pass linker flags through the system compiler.case $host_os inaix*)lt_prog_compiler_wl='-Wl,'if test "$host_cpu" = ia64; then# AIX 5 now supports IA64 processorlt_prog_compiler_static='-Bstatic'elselt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'fi;;mingw* | cygwin* | pw32* | os2*)# This hack is so that the source file can tell whether it is being# built for inclusion in a dll (and should export symbols for example).lt_prog_compiler_pic='-DDLL_EXPORT';;hpux9* | hpux10* | hpux11*)lt_prog_compiler_wl='-Wl,'# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but# not for PA HP-UX.case $host_cpu inhppa*64*|ia64*)# +Z the default;;*)lt_prog_compiler_pic='+Z';;esac# Is there a better lt_prog_compiler_static that works with the bundled CC?lt_prog_compiler_static='${wl}-a ${wl}archive';;irix5* | irix6* | nonstopux*)lt_prog_compiler_wl='-Wl,'# PIC (with -KPIC) is the default.lt_prog_compiler_static='-non_shared';;linux* | k*bsd*-gnu)case $cc_basename inicc* | ecc* | ifort*)lt_prog_compiler_wl='-Wl,'lt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-static';;pgcc* | pgf77* | pgf90* | pgf95*)# Portland Group compilers (*not* the Pentium gcc compiler,# which looks to be a dead project)lt_prog_compiler_wl='-Wl,'lt_prog_compiler_pic='-fpic'lt_prog_compiler_static='-Bstatic';;ccc*)lt_prog_compiler_wl='-Wl,'# All Alpha code is PIC.lt_prog_compiler_static='-non_shared';;xl*)# IBM XL C 8.0/Fortran 10.1 on PPClt_prog_compiler_wl='-Wl,'lt_prog_compiler_pic='-qpic'lt_prog_compiler_static='-qstaticlink';;*)case `$CC -V 2>&1 | sed 5q` in*Sun\ C*)# Sun C 5.9lt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-Bstatic'lt_prog_compiler_wl='-Wl,';;*Sun\ F*)# Sun Fortran 8.3 passes all unrecognized flags to the linkerlt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-Bstatic'lt_prog_compiler_wl='';;esac;;esac;;newsos6)lt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-Bstatic';;*nto* | *qnx*)# QNX uses GNU C++, but need to define -shared option too, otherwise# it will coredump.lt_prog_compiler_pic='-fPIC -shared';;osf3* | osf4* | osf5*)lt_prog_compiler_wl='-Wl,'# All OSF/1 code is PIC.lt_prog_compiler_static='-non_shared';;rdos*)lt_prog_compiler_static='-non_shared';;solaris*)lt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-Bstatic'case $cc_basename inf77* | f90* | f95*)lt_prog_compiler_wl='-Qoption ld ';;*)lt_prog_compiler_wl='-Wl,';;esac;;sunos4*)lt_prog_compiler_wl='-Qoption ld 'lt_prog_compiler_pic='-PIC'lt_prog_compiler_static='-Bstatic';;sysv4 | sysv4.2uw2* | sysv4.3*)lt_prog_compiler_wl='-Wl,'lt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-Bstatic';;sysv4*MP*)if test -d /usr/nec ;thenlt_prog_compiler_pic='-Kconform_pic'lt_prog_compiler_static='-Bstatic'fi;;sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)lt_prog_compiler_wl='-Wl,'lt_prog_compiler_pic='-KPIC'lt_prog_compiler_static='-Bstatic';;unicos*)lt_prog_compiler_wl='-Wl,'lt_prog_compiler_can_build_shared=no;;uts4*)lt_prog_compiler_pic='-pic'lt_prog_compiler_static='-Bstatic';;*)lt_prog_compiler_can_build_shared=no;;esacficase $host_os in# For platforms which do not support PIC, -DPIC is meaningless:*djgpp*)lt_prog_compiler_pic=;;*)lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC";;esac{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }## Check to make sure the PIC flag actually works.#if test -n "$lt_prog_compiler_pic"; then{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }if test "${lt_cv_prog_compiler_pic_works+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_prog_compiler_pic_works=noac_outfile=conftest.$ac_objextecho "$lt_simple_compile_test_code" > conftest.$ac_extlt_compiler_flag="$lt_prog_compiler_pic -DPIC"# Insert the option either (1) after the last *FLAGS variable, or# (2) before a word containing "conftest.", or (3) at the end.# Note that $ac_compile itself does not contain backslashes and begins# with a dollar sign (not a hyphen), so the echo should work correctly.# The option is referenced via a variable to avoid confusing sed.lt_compile=`echo "$ac_compile" | $SED \-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \-e 's:$: $lt_compiler_flag:'`(eval echo "\"\$as_me:7591: $lt_compile\"" >&5)(eval "$lt_compile" 2>conftest.err)ac_status=$?cat conftest.err >&5echo "$as_me:7595: \$? = $ac_status" >&5if (exit $ac_status) && test -s "$ac_outfile"; then# The compiler can only warn and ignore the option if not recognized# So say no if there are warnings other than the usual output.$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; thenlt_cv_prog_compiler_pic_works=yesfifi$RM -r conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; }if test x"$lt_cv_prog_compiler_pic_works" = xyes; thencase $lt_prog_compiler_pic in"" | " "*) ;;*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;esacelselt_prog_compiler_pic=lt_prog_compiler_can_build_shared=nofifi## Check to make sure the static flag actually works.#wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }if test "${lt_cv_prog_compiler_static_works+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_prog_compiler_static_works=nosave_LDFLAGS="$LDFLAGS"LDFLAGS="$LDFLAGS $lt_tmp_static_flag"echo "$lt_simple_link_test_code" > conftest.$ac_extif (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then# The linker can only warn and ignore the option if not recognized# So say no if there are warningsif test -s conftest.err; then# Append any errors to the config.log.cat conftest.err 1>&5$ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2if diff conftest.exp conftest.er2 >/dev/null; thenlt_cv_prog_compiler_static_works=yesfielselt_cv_prog_compiler_static_works=yesfifi$RM -r conftest*LDFLAGS="$save_LDFLAGS"fi{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; }if test x"$lt_cv_prog_compiler_static_works" = xyes; then:elselt_prog_compiler_static=fi{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }if test "${lt_cv_prog_compiler_c_o+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_prog_compiler_c_o=no$RM -r conftest 2>/dev/nullmkdir conftestcd conftestmkdir outecho "$lt_simple_compile_test_code" > conftest.$ac_extlt_compiler_flag="-o out/conftest2.$ac_objext"# Insert the option either (1) after the last *FLAGS variable, or# (2) before a word containing "conftest.", or (3) at the end.# Note that $ac_compile itself does not contain backslashes and begins# with a dollar sign (not a hyphen), so the echo should work correctly.lt_compile=`echo "$ac_compile" | $SED \-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \-e 's:$: $lt_compiler_flag:'`(eval echo "\"\$as_me:7696: $lt_compile\"" >&5)(eval "$lt_compile" 2>out/conftest.err)ac_status=$?cat out/conftest.err >&5echo "$as_me:7700: \$? = $ac_status" >&5if (exit $ac_status) && test -s out/conftest2.$ac_objextthen# The compiler can only warn and ignore the option if not recognized# So say no if there are warnings$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; thenlt_cv_prog_compiler_c_o=yesfifichmod u+w . 2>&5$RM -r conftest*# SGI C++ compiler will create directory out/ii_files/ for# template instantiationtest -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files$RM out/* && rmdir outcd ..$RM -r conftest$RM -r conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }if test "${lt_cv_prog_compiler_c_o+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elselt_cv_prog_compiler_c_o=no$RM -r conftest 2>/dev/nullmkdir conftestcd conftestmkdir outecho "$lt_simple_compile_test_code" > conftest.$ac_extlt_compiler_flag="-o out/conftest2.$ac_objext"# Insert the option either (1) after the last *FLAGS variable, or# (2) before a word containing "conftest.", or (3) at the end.# Note that $ac_compile itself does not contain backslashes and begins# with a dollar sign (not a hyphen), so the echo should work correctly.lt_compile=`echo "$ac_compile" | $SED \-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \-e 's:$: $lt_compiler_flag:'`(eval echo "\"\$as_me:7751: $lt_compile\"" >&5)(eval "$lt_compile" 2>out/conftest.err)ac_status=$?cat out/conftest.err >&5echo "$as_me:7755: \$? = $ac_status" >&5if (exit $ac_status) && test -s out/conftest2.$ac_objextthen# The compiler can only warn and ignore the option if not recognized# So say no if there are warnings$ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; thenlt_cv_prog_compiler_c_o=yesfifichmod u+w . 2>&5$RM -r conftest*# SGI C++ compiler will create directory out/ii_files/ for# template instantiationtest -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files$RM out/* && rmdir outcd ..$RM -r conftest$RM -r conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }hard_links="nottested"if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then# do not overwrite the value of need_locks provided by the user{ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }hard_links=yes$RM -r conftest*ln conftest.a conftest.b 2>/dev/null && hard_links=notouch conftest.aln conftest.a conftest.b 2>&5 || hard_links=noln conftest.a conftest.b 2>/dev/null && hard_links=no{ echo "$as_me:$LINENO: result: $hard_links" >&5echo "${ECHO_T}$hard_links" >&6; }if test "$hard_links" = no; then{ echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}need_locks=warnfielseneed_locks=nofi{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }runpath_var=allow_undefined_flag=always_export_symbols=noarchive_cmds=archive_expsym_cmds=compiler_needs_object=noenable_shared_with_static_runtimes=noexport_dynamic_flag_spec=export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'hardcode_automatic=nohardcode_direct=nohardcode_direct_absolute=nohardcode_libdir_flag_spec=hardcode_libdir_flag_spec_ld=hardcode_libdir_separator=hardcode_minus_L=nohardcode_shlibpath_var=unsupportedinherit_rpath=nolink_all_deplibs=unknownmodule_cmds=module_expsym_cmds=old_archive_from_new_cmds=old_archive_from_expsyms_cmds=thread_safe_flag_spec=whole_archive_flag_spec=# include_expsyms should be a list of space-separated symbols to be *always*# included in the symbol listinclude_expsyms=# exclude_expsyms can be an extended regexp of symbols to exclude# it will be wrapped by ` (' and `)$', so one must not match beginning or# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',# as well as any symbol that contains `d'.exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out# platforms (ab)use it in PIC code, but their linkers get confused if# the symbol is explicitly referenced. Since portable code cannot# rely on this symbol name, it's probably fine to never include it in# preloaded symbol tables.# Exclude shared library initialization/finalization symbols.extract_expsyms_cmds=case $host_os incygwin* | mingw* | pw32*)# FIXME: the MSVC++ port hasn't been tested in a loooong time# When not using gcc, we currently assume that we are using# Microsoft Visual C++.if test "$GCC" != yes; thenwith_gnu_ld=nofi;;interix*)# we just hope/assume this is gcc and not c89 (= MSVC++)with_gnu_ld=yes;;openbsd*)with_gnu_ld=no;;esacld_shlibs=yesif test "$with_gnu_ld" = yes; then# If archive_cmds runs LD, not CC, wlarc should be emptywlarc='${wl}'# Set some defaults for GNU ld with shared library support. These# are reset later if shared libraries are not supported. Putting them# here allows them to be overridden if necessary.runpath_var=LD_RUN_PATHhardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'export_dynamic_flag_spec='${wl}--export-dynamic'# ancient GNU ld didn't support --whole-archive et. al.if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; thenwhole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'elsewhole_archive_flag_spec=fisupports_anon_versioning=nocase `$LD -v 2>&1` in*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...*\ 2.11.*) ;; # other 2.11 versions*) supports_anon_versioning=yes ;;esac# See if GNU ld supports shared libraries.case $host_os inaix[3-9]*)# On AIX/PPC, the GNU linker is very brokenif test "$host_cpu" != ia64; thenld_shlibs=nocat <<_LT_EOF 1>&2*** Warning: the GNU linker, at least up to release 2.9.1, is reported*** to be unable to reliably create shared libraries on AIX.*** Therefore, libtool is disabling shared libraries support. If you*** really care for shared libraries, you may want to modify your PATH*** so that a non-GNU linker is found, and then restart._LT_EOFfi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so supportarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'archive_expsym_cmds='';;m68k)archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'hardcode_libdir_flag_spec='-L$libdir'hardcode_minus_L=yes;;esac;;beos*)if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; thenallow_undefined_flag=unsupported# Joseph Beckenbach <jrb3@best.com> says some releases of gcc# support --undefined. This deserves some investigation. FIXMEarchive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'elseld_shlibs=nofi;;cygwin* | mingw* | pw32*)# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,# as there is no search path for DLLs.hardcode_libdir_flag_spec='-L$libdir'allow_undefined_flag=unsupportedalways_export_symbols=noenable_shared_with_static_runtimes=yesexport_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; thenarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'# If the export-symbols file already is a .def file (1st line# is EXPORTS), use it as is; otherwise, prepend...archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; thencp $export_symbols $output_objdir/$soname.def;elseecho EXPORTS > $output_objdir/$soname.def;cat $export_symbols >> $output_objdir/$soname.def;fi~$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'elseld_shlibs=nofi;;interix[3-9]*)hardcode_direct=nohardcode_shlibpath_var=nohardcode_libdir_flag_spec='${wl}-rpath,$libdir'export_dynamic_flag_spec='${wl}-E'# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.# Instead, shared libraries are loaded at an image base (0x10000000 by# default) and relocated if they conflict, which is a slow very memory# consuming and fragmenting process. To avoid this, we pick a random,# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link# time. Moving up from 0x10000000 also allows more sbrk(2) space.archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib';;gnu* | linux* | tpf* | k*bsd*-gnu)tmp_diet=noif test "$host_os" = linux-dietlibc; thencase $cc_basename indiet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)esacfiif $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \&& test "$tmp_diet" = nothentmp_addflag=tmp_sharedflag='-shared'case $cc_basename,$host_cpu inpgcc*) # Portland Group C compilerwhole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'tmp_addflag=' $pic_flag';;pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilerswhole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'tmp_addflag=' $pic_flag -Mnomain' ;;ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64tmp_addflag=' -i_dynamic' ;;efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64tmp_addflag=' -i_dynamic -nofor_main' ;;ifc* | ifort*) # Intel Fortran compilertmp_addflag=' -nofor_main' ;;xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)tmp_sharedflag='-qmkshrobj'tmp_addflag= ;;esaccase `$CC -V 2>&1 | sed 5q` in*Sun\ C*) # Sun C 5.9whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'compiler_needs_object=yestmp_sharedflag='-G' ;;*Sun\ F*) # Sun Fortran 8.3tmp_sharedflag='-G' ;;esacarchive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'if test "x$supports_anon_versioning" = xyes; thenarchive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~echo "local: *; };" >> $output_objdir/$libname.ver~$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'ficase $cc_basename inxlf*)# IBM XL Fortran 10.1 on PPC cannot create shared libs itselfwhole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'hardcode_libdir_flag_spec=hardcode_libdir_flag_spec_ld='-rpath $libdir'archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'if test "x$supports_anon_versioning" = xyes; thenarchive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~echo "local: *; };" >> $output_objdir/$libname.ver~$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'fi;;esacelseld_shlibs=nofi;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; thenarchive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'wlarc=elsearchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'fi;;solaris*)if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; thenld_shlibs=nocat <<_LT_EOF 1>&2*** Warning: The releases 2.8.* of the GNU linker cannot reliably*** create shared libraries on Solaris systems. Therefore, libtool*** is disabling shared libraries support. We urge you to upgrade GNU*** binutils to release 2.9.1 or newer. Another option is to modify*** your PATH or compiler configuration so that the native linker is*** used, and then restart._LT_EOFelif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; thenarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'elseld_shlibs=nofi;;sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)case `$LD -v 2>&1` in*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)ld_shlibs=nocat <<_LT_EOF 1>&2*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not*** reliably create shared libraries on SCO systems. Therefore, libtool*** is disabling shared libraries support. We urge you to upgrade GNU*** binutils to release 2.16.91.0.3 or newer. Another option is to modify*** your PATH or compiler configuration so that the native linker is*** used, and then restart._LT_EOF;;*)# For security reasons, it is highly recommended that you always# use absolute paths for naming shared libraries, and exclude the# DT_RUNPATH tag from executables and libraries. But doing so# requires that you compile everything twice, which is a pain.if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; thenhardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'elseld_shlibs=nofi;;esac;;sunos4*)archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'wlarc=hardcode_direct=yeshardcode_shlibpath_var=no;;*)if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; thenarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'elseld_shlibs=nofi;;esacif test "$ld_shlibs" = no; thenrunpath_var=hardcode_libdir_flag_spec=export_dynamic_flag_spec=whole_archive_flag_spec=fielse# PORTME fill in a description of your system's linker (not GNU ld)case $host_os inaix3*)allow_undefined_flag=unsupportedalways_export_symbols=yesarchive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'# Note: this linker hardcodes the directories in LIBPATH if there# are no directories specified by -L.hardcode_minus_L=yesif test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then# Neither direct hardcoding nor static linking is supported with a# broken collect2.hardcode_direct=unsupportedfi;;aix[4-9]*)if test "$host_cpu" = ia64; then# On IA64, the linker does run time linking by default, so we don't# have to do anything special.aix_use_runtimelinking=noexp_sym_flag='-Bexport'no_entry_flag=""else# If we're using GNU nm, then we don't want the "-C" option.# -C means demangle to AIX nm, but means don't demangle with GNU nmif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; thenexport_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'elseexport_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'fiaix_use_runtimelinking=no# Test if we are trying to use run time linking or normal# AIX style linking. If -brtl is somewhere in LDFLAGS, we# need to do runtime linking.case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)for ld_flag in $LDFLAGS; doif (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); thenaix_use_runtimelinking=yesbreakfidone;;esacexp_sym_flag='-bexport'no_entry_flag='-bnoentry'fi# When large executables or shared objects are built, AIX ld can# have problems creating the table of contents. If linking a library# or program results in "error TOC overflow" add -mminimal-toc to# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.archive_cmds=''hardcode_direct=yeshardcode_direct_absolute=yeshardcode_libdir_separator=':'link_all_deplibs=yesfile_list_spec='${wl}-f,'if test "$GCC" = yes; thencase $host_os in aix4.[012]|aix4.[012].*)# We only want to do this on AIX 4.2 and lower, the check# below for broken collect2 doesn't work under 4.3+collect2name=`${CC} -print-prog-name=collect2`if test -f "$collect2name" &&strings "$collect2name" | $GREP resolve_lib_name >/dev/nullthen# We have reworked collect2:else# We have old collect2hardcode_direct=unsupported# It fails to find uninstalled libraries when the uninstalled# path is not listed in the libpath. Setting hardcode_minus_L# to unsupported forces relinkinghardcode_minus_L=yeshardcode_libdir_flag_spec='-L$libdir'hardcode_libdir_separator=fi;;esacshared_flag='-shared'if test "$aix_use_runtimelinking" = yes; thenshared_flag="$shared_flag "'${wl}-G'fielse# not using gccif test "$host_cpu" = ia64; then# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release# chokes on -Wl,-G. The following line is correct:shared_flag='-G'elseif test "$aix_use_runtimelinking" = yes; thenshared_flag='${wl}-G'elseshared_flag='${wl}-bM:SRE'fififi# It seems that -bexpall does not export symbols beginning with# underscore (_), so it is better to generate a list of symbols to export.always_export_symbols=yesif test "$aix_use_runtimelinking" = yes; then# Warning - without using the other runtime loading flags (-brtl),# -berok will link without error, but may produce a broken library.allow_undefined_flag='-berok'# Determine the default libpath from the value encoded in an# empty executable.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenlt_aix_libpath_sed='/Import File Strings/,/^$/ {/^0/ {s/^0 *\(.*\)$/\1/p}}'aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`# Check for a 64-bit object if we didn't find anything.if test -z "$aix_libpath"; thenaix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`fielseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5firm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fihardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"elseif test "$host_cpu" = ia64; thenhardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'allow_undefined_flag="-z nodefs"archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"else# Determine the default libpath from the value encoded in an# empty executable.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenlt_aix_libpath_sed='/Import File Strings/,/^$/ {/^0/ {s/^0 *\(.*\)$/\1/p}}'aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`# Check for a 64-bit object if we didn't find anything.if test -z "$aix_libpath"; thenaix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`fielseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5firm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fihardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"# Warning - without using the other run time loading flags,# -berok will link without error, but may produce a broken library.no_undefined_flag=' ${wl}-bernotok'allow_undefined_flag=' ${wl}-berok'# Exported symbols can be pulled into shared objects from archiveswhole_archive_flag_spec='$convenience'archive_cmds_need_lc=yes# This is similar to how AIX traditionally builds its shared libraries.archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'fifi;;amigaos*)case $host_cpu inpowerpc)# see comment about AmigaOS4 .so supportarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'archive_expsym_cmds='';;m68k)archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'hardcode_libdir_flag_spec='-L$libdir'hardcode_minus_L=yes;;esac;;bsdi[45]*)export_dynamic_flag_spec=-rdynamic;;cygwin* | mingw* | pw32*)# When not using gcc, we currently assume that we are using# Microsoft Visual C++.# hardcode_libdir_flag_spec is actually meaningless, as there is# no search path for DLLs.hardcode_libdir_flag_spec=' 'allow_undefined_flag=unsupported# Tell ltmain to make .lib files, not .a files.libext=lib# Tell ltmain to make .dll files, not .so files.shrext_cmds=".dll"# FIXME: Setting linknames here is a bad hack.archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='# The linker will automatically build a .lib file if we build a DLL.old_archive_from_new_cmds='true'# FIXME: Should let the user specify the lib program.old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'fix_srcfile_path='`cygpath -w "$srcfile"`'enable_shared_with_static_runtimes=yes;;darwin* | rhapsody*)archive_cmds_need_lc=nohardcode_direct=nohardcode_automatic=yeshardcode_shlibpath_var=unsupportedwhole_archive_flag_spec=''link_all_deplibs=yesallow_undefined_flag="$_lt_dar_allow_undefined"if test "$GCC" = "yes"; thenoutput_verbose_link_cmd=echoarchive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"elseld_shlibs=nofi;;dgux*)archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_libdir_flag_spec='-L$libdir'hardcode_shlibpath_var=no;;freebsd1*)ld_shlibs=no;;# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor# support. Future versions do this automatically, but an explicit c++rt0.o# does not break anything, and helps significantly (at the cost of a little# extra space).freebsd2.2*)archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'hardcode_libdir_flag_spec='-R$libdir'hardcode_direct=yeshardcode_shlibpath_var=no;;# Unfortunately, older versions of FreeBSD 2 do not have this feature.freebsd2*)archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'hardcode_direct=yeshardcode_minus_L=yeshardcode_shlibpath_var=no;;# FreeBSD 3 and greater uses gcc -shared to do shared libraries.freebsd* | dragonfly*)archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'hardcode_libdir_flag_spec='-R$libdir'hardcode_direct=yeshardcode_shlibpath_var=no;;hpux9*)if test "$GCC" = yes; thenarchive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'elsearchive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'fihardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'hardcode_libdir_separator=:hardcode_direct=yes# hardcode_minus_L: Not really in the search PATH,# but as the default location of the library.hardcode_minus_L=yesexport_dynamic_flag_spec='${wl}-E';;hpux10*)if test "$GCC" = yes -a "$with_gnu_ld" = no; thenarchive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'elsearchive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'fiif test "$with_gnu_ld" = no; thenhardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'hardcode_libdir_flag_spec_ld='+b $libdir'hardcode_libdir_separator=:hardcode_direct=yeshardcode_direct_absolute=yesexport_dynamic_flag_spec='${wl}-E'# hardcode_minus_L: Not really in the search PATH,# but as the default location of the library.hardcode_minus_L=yesfi;;hpux11*)if test "$GCC" = yes -a "$with_gnu_ld" = no; thencase $host_cpu inhppa*64*)archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags';;ia64*)archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags';;*)archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags';;esacelsecase $host_cpu inhppa*64*)archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags';;ia64*)archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags';;*)archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags';;esacfiif test "$with_gnu_ld" = no; thenhardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'hardcode_libdir_separator=:case $host_cpu inhppa*64*|ia64*)hardcode_direct=nohardcode_shlibpath_var=no;;*)hardcode_direct=yeshardcode_direct_absolute=yesexport_dynamic_flag_spec='${wl}-E'# hardcode_minus_L: Not really in the search PATH,# but as the default location of the library.hardcode_minus_L=yes;;esacfi;;irix5* | irix6* | nonstopux*)if test "$GCC" = yes; thenarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'# Try to use the -exported_symbol ld option, if it does not# work, assume that -exports_file does not work either and# implicitly export all symbols.save_LDFLAGS="$LDFLAGS"LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"cat >conftest.$ac_ext <<_ACEOFint foo(void) {}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenarchive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5firm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLDFLAGS="$save_LDFLAGS"elsearchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'fiarchive_cmds_need_lc='no'hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'hardcode_libdir_separator=:inherit_rpath=yeslink_all_deplibs=yes;;netbsd*)if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; thenarchive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.outelsearchive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELFfihardcode_libdir_flag_spec='-R$libdir'hardcode_direct=yeshardcode_shlibpath_var=no;;newsos6)archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_direct=yeshardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'hardcode_libdir_separator=:hardcode_shlibpath_var=no;;*nto* | *qnx*);;openbsd*)if test -f /usr/libexec/ld.so; thenhardcode_direct=yeshardcode_shlibpath_var=nohardcode_direct_absolute=yesif test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; thenarchive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'hardcode_libdir_flag_spec='${wl}-rpath,$libdir'export_dynamic_flag_spec='${wl}-E'elsecase $host_os inopenbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'hardcode_libdir_flag_spec='-R$libdir';;*)archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'hardcode_libdir_flag_spec='${wl}-rpath,$libdir';;esacfielseld_shlibs=nofi;;os2*)hardcode_libdir_flag_spec='-L$libdir'hardcode_minus_L=yesallow_undefined_flag=unsupportedarchive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def';;osf3*)if test "$GCC" = yes; thenallow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'elseallow_undefined_flag=' -expect_unresolved \*'archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'fiarchive_cmds_need_lc='no'hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'hardcode_libdir_separator=:;;osf4* | osf5*) # as osf3* with the addition of -msym flagif test "$GCC" = yes; thenallow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'elseallow_undefined_flag=' -expect_unresolved \*'archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'# Both c and cxx compiler support -rpath directlyhardcode_libdir_flag_spec='-rpath $libdir'fiarchive_cmds_need_lc='no'hardcode_libdir_separator=:;;solaris*)no_undefined_flag=' -z defs'if test "$GCC" = yes; thenwlarc='${wl}'archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'elsecase `$CC -V 2>&1` in*"Compilers 5.0"*)wlarc=''archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp';;*)wlarc='${wl}'archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~$CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp';;esacfihardcode_libdir_flag_spec='-R$libdir'hardcode_shlibpath_var=nocase $host_os insolaris2.[0-5] | solaris2.[0-5].*) ;;*)# The compiler driver will combine and reorder linker options,# but understands `-z linker_flag'. GCC discards it without `$wl',# but is careful enough not to reorder.# Supported since Solaris 2.6 (maybe 2.5.1?)if test "$GCC" = yes; thenwhole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'elsewhole_archive_flag_spec='-z allextract$convenience -z defaultextract'fi;;esaclink_all_deplibs=yes;;sunos4*)if test "x$host_vendor" = xsequent; then# Use $CC to link under sequent, because it throws in some extra .o# files that make .init and .fini sections work.archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'elsearchive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'fihardcode_libdir_flag_spec='-L$libdir'hardcode_direct=yeshardcode_minus_L=yeshardcode_shlibpath_var=no;;sysv4)case $host_vendor insni)archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_direct=yes # is this really true???;;siemens)## LD is ld it makes a PLAMLIB## CC just makes a GrossModule.archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'reload_cmds='$CC -r -o $output$reload_objs'hardcode_direct=no;;motorola)archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_direct=no #Motorola manual says yes, but my tests say they lie;;esacrunpath_var='LD_RUN_PATH'hardcode_shlibpath_var=no;;sysv4.3*)archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_shlibpath_var=noexport_dynamic_flag_spec='-Bexport';;sysv4*MP*)if test -d /usr/nec; thenarchive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_shlibpath_var=norunpath_var=LD_RUN_PATHhardcode_runpath_var=yesld_shlibs=yesfi;;sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)no_undefined_flag='${wl}-z,text'archive_cmds_need_lc=nohardcode_shlibpath_var=norunpath_var='LD_RUN_PATH'if test "$GCC" = yes; thenarchive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'elsearchive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'fi;;sysv5* | sco3.2v5* | sco5v6*)# Note: We can NOT use -z defs as we might desire, because we do not# link with -lc, and that would cause any symbols used from libc to# always be unresolved, which means just about no library would# ever link correctly. If we're not using GNU ld we use -z text# though, which does catch some bad symbols but isn't as heavy-handed# as -z defs.no_undefined_flag='${wl}-z,text'allow_undefined_flag='${wl}-z,nodefs'archive_cmds_need_lc=nohardcode_shlibpath_var=nohardcode_libdir_flag_spec='${wl}-R,$libdir'hardcode_libdir_separator=':'link_all_deplibs=yesexport_dynamic_flag_spec='${wl}-Bexport'runpath_var='LD_RUN_PATH'if test "$GCC" = yes; thenarchive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'elsearchive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'fi;;uts4*)archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'hardcode_libdir_flag_spec='-L$libdir'hardcode_shlibpath_var=no;;*)ld_shlibs=no;;esacif test x$host_vendor = xsni; thencase $host insysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)export_dynamic_flag_spec='${wl}-Blargedynsym';;esacfifi{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5echo "${ECHO_T}$ld_shlibs" >&6; }test "$ld_shlibs" = no && can_build_shared=nowith_gnu_ld=$with_gnu_ld## Do we need to explicitly link libc?#case "x$archive_cmds_need_lc" inx|xyes)# Assume -lc should be addedarchive_cmds_need_lc=yesif test "$enable_shared" = yes && test "$GCC" = yes; thencase $archive_cmds in*'~'*)# FIXME: we may have to deal with multi-command sequences.;;'$CC '*)# Test whether the compiler implicitly links with -lc since on some# systems, -lgcc has to come before -lc. If gcc already passes -lc# to ld, don't add -lc before -lgcc.{ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }$RM -r conftest*echo "$lt_simple_compile_test_code" > conftest.$ac_extif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5(eval $ac_compile) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } 2>conftest.err; thensoname=conftestlib=conftestlibobjs=conftest.$ac_objextdeplibs=wl=$lt_prog_compiler_wlpic_flag=$lt_prog_compiler_piccompiler_flags=-vlinker_flags=-vverstring=output_objdir=.libname=conftestlt_save_allow_undefined_flag=$allow_undefined_flagallow_undefined_flag=if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5(eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }thenarchive_cmds_need_lc=noelsearchive_cmds_need_lc=yesfiallow_undefined_flag=$lt_save_allow_undefined_flagelsecat conftest.err 1>&5fi$RM -r conftest*{ echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5echo "${ECHO_T}$archive_cmds_need_lc" >&6; };;esacfi;;esac{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }if test "$GCC" = yes; thencase $host_os indarwin*) lt_awk_arg="/^libraries:/,/LR/" ;;*) lt_awk_arg="/^libraries:/" ;;esaclt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then# if the path contains ";" then we assume it to be the separator# otherwise default to the standard path separator (i.e. ":") - it is# assumed that no part of a normal pathname contains ";" but that should# okay in the real world where ";" in dirpaths is itself problematic.lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`elselt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`fi# Ok, now we have the path, separated by spaces, we can step through it# and add multilib dir if necessary.lt_tmp_lt_search_path_spec=lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`for lt_sys_path in $lt_search_path_spec; doif test -d "$lt_sys_path/$lt_multi_os_dir"; thenlt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"elsetest -d "$lt_sys_path" && \lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"fidonelt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk 'BEGIN {RS=" "; FS="/|\n";} {lt_foo="";lt_count=0;for (lt_i = NF; lt_i > 0; lt_i--) {if ($lt_i != "" && $lt_i != ".") {if ($lt_i == "..") {lt_count++;} else {if (lt_count == 0) {lt_foo="/" $lt_i lt_foo;} else {lt_count--;}}}}if (lt_foo != "") { lt_freq[lt_foo]++; }if (lt_freq[lt_foo] == 1) { print lt_foo; }}'`sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`elsesys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"filibrary_names_spec=libname_spec='lib$name'soname_spec=shrext_cmds=".so"postinstall_cmds=postuninstall_cmds=finish_cmds=finish_eval=shlibpath_var=shlibpath_overrides_runpath=unknownversion_type=nonedynamic_linker="$host_os ld.so"sys_lib_dlsearch_path_spec="/lib /usr/lib"need_lib_prefix=unknownhardcode_into_libs=no# when you set need_version to no, make sure it does not cause -set_version# flags to be left without argumentsneed_version=unknowncase $host_os inaix3*)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'shlibpath_var=LIBPATH# AIX 3 has no versioning support, so we append a major version to the name.soname_spec='${libname}${release}${shared_ext}$major';;aix[4-9]*)version_type=linuxneed_lib_prefix=noneed_version=nohardcode_into_libs=yesif test "$host_cpu" = ia64; then# AIX 5 supports IA64library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHelse# With GCC up to 2.95.x, collect2 would create an import file# for dependence libraries. The import file would start with# the line `#! .'. This would cause the generated library to# depend on `.', always an invalid library. This was fixed in# development snapshots of GCC prior to 3.0.case $host_os inaix4 | aix4.[01] | aix4.[01].*)if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'echo ' yes 'echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then:elsecan_build_shared=nofi;;esac# AIX (on Power*) has no versioning support, so currently we can not hardcode correct# soname into executable. Probably we can add versioning support to# collect2, so additional links can be useful in future.if test "$aix_use_runtimelinking" = yes; then# If using run time linking (on AIX 4.2 or later) use lib<name>.so# instead of lib<name>.a to let people know that these are not# typical AIX shared libraries.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'else# We preserve .a as extension for shared libraries through AIX4.2# and later when we are not doing run time linking.library_names_spec='${libname}${release}.a $libname.a'soname_spec='${libname}${release}${shared_ext}$major'fishlibpath_var=LIBPATHfi;;amigaos*)case $host_cpu inpowerpc)# Since July 2007 AmigaOS4 officially supports .so libraries.# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}';;m68k)library_names_spec='$libname.ixlibrary $libname.a'# Create ${libname}_ixlibrary.a entries in /sys/libs.finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done';;esac;;beos*)library_names_spec='${libname}${shared_ext}'dynamic_linker="$host_os ld.so"shlibpath_var=LIBRARY_PATH;;bsdi[45]*)version_type=linuxneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'shlibpath_var=LD_LIBRARY_PATHsys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"# the default ld.so.conf also contains /usr/contrib/lib and# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow# libtool to hard-code these into programs;;cygwin* | mingw* | pw32*)version_type=windowsshrext_cmds=".dll"need_version=noneed_lib_prefix=nocase $GCC,$host_os inyes,cygwin* | yes,mingw* | yes,pw32*)library_names_spec='$libname.dll.a'# DLL is installed to $(libdir)/../bin by postinstall_cmdspostinstall_cmds='base_file=`basename \${file}`~dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~dldir=$destdir/`dirname \$dlpath`~test -d \$dldir || mkdir -p \$dldir~$install_prog $dir/$dlname \$dldir/$dlname~chmod a+x \$dldir/$dlname~if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; theneval '\''$striplib \$dldir/$dlname'\'' || exit \$?;fi'postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~dlpath=$dir/\$dldll~$RM \$dlpath'shlibpath_overrides_runpath=yescase $host_os incygwin*)# Cygwin DLLs use 'cyg' prefix rather than 'lib'soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib";;mingw*)# MinGW DLLs use traditional 'lib' prefixsoname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then# It is most probably a Windows format PATH printed by# mingw gcc, but we are running on Cygwin. Gcc prints its search# path with ; separators, and with drive letters. We can handle the# drive letters (cygwin fileutils understands them), so leave them,# especially as we might pass files found there to a mingw objdump,# which wouldn't understand a cygwinified path. Ahh.sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`elsesys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`fi;;pw32*)# pw32 DLLs use 'pw' prefix rather than 'lib'library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}';;esac;;*)library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib';;esacdynamic_linker='Win32 ld.exe'# FIXME: first we should search . and the directory the executable is inshlibpath_var=PATH;;darwin* | rhapsody*)dynamic_linker="$host_os dyld"version_type=darwinneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext'soname_spec='${libname}${release}${major}$shared_ext'shlibpath_overrides_runpath=yesshlibpath_var=DYLD_LIBRARY_PATHshrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib';;dgux*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATH;;freebsd1*)dynamic_linker=no;;freebsd* | dragonfly*)# DragonFly does not have aout. When/if they implement a new# versioning mechanism, adjust this.if test -x /usr/bin/objformat; thenobjformat=`/usr/bin/objformat`elsecase $host_os infreebsd[123]*) objformat=aout ;;*) objformat=elf ;;esacfiversion_type=freebsd-$objformatcase $version_type infreebsd-elf*)library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'need_version=noneed_lib_prefix=no;;freebsd-*)library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'need_version=yes;;esacshlibpath_var=LD_LIBRARY_PATHcase $host_os infreebsd2*)shlibpath_overrides_runpath=yes;;freebsd3.[01]* | freebsdelf3.[01]*)shlibpath_overrides_runpath=yeshardcode_into_libs=yes;;freebsd3.[2-9]* | freebsdelf3.[2-9]* | \freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)shlibpath_overrides_runpath=nohardcode_into_libs=yes;;*) # from 4.6 on, and DragonFlyshlibpath_overrides_runpath=yeshardcode_into_libs=yes;;esac;;gnu*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHhardcode_into_libs=yes;;hpux9* | hpux10* | hpux11*)# Give a soname corresponding to the major version so that dld.sl refuses to# link against other versions.version_type=sunosneed_lib_prefix=noneed_version=nocase $host_cpu inia64*)shrext_cmds='.so'hardcode_into_libs=yesdynamic_linker="$host_os dld.so"shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yes # Unless +noenvvar is specified.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'if test "X$HPUX_IA64_MODE" = X32; thensys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"elsesys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"fisys_lib_dlsearch_path_spec=$sys_lib_search_path_spec;;hppa*64*)shrext_cmds='.sl'hardcode_into_libs=yesdynamic_linker="$host_os dld.sl"shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATHshlibpath_overrides_runpath=yes # Unless +noenvvar is specified.library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec;;*)shrext_cmds='.sl'dynamic_linker="$host_os dld.sl"shlibpath_var=SHLIB_PATHshlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATHlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major';;esac# HP-UX runs *really* slowly unless shared libraries are mode 555.postinstall_cmds='chmod 555 $lib';;interix[3-9]*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=nohardcode_into_libs=yes;;irix5* | irix6* | nonstopux*)case $host_os innonstopux*) version_type=nonstopux ;;*)if test "$lt_cv_prog_gnu_ld" = yes; thenversion_type=linuxelseversion_type=irixfi ;;esacneed_lib_prefix=noneed_version=nosoname_spec='${libname}${release}${shared_ext}$major'library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'case $host_os inirix5* | nonstopux*)libsuff= shlibsuff=;;*)case $LD in # libtool.m4 will add one of these switches to LD*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")libsuff= shlibsuff= libmagic=32-bit;;*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")libsuff=32 shlibsuff=N32 libmagic=N32;;*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")libsuff=64 shlibsuff=64 libmagic=64-bit;;*) libsuff= shlibsuff= libmagic=never-match;;esac;;esacshlibpath_var=LD_LIBRARY${shlibsuff}_PATHshlibpath_overrides_runpath=nosys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"hardcode_into_libs=yes;;# No shared lib support for Linux oldld, aout, or coff.linux*oldld* | linux*aout* | linux*coff*)dynamic_linker=no;;# This must be Linux ELF.linux* | k*bsd*-gnu)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=no# Some binutils ld are patched to set DT_RUNPATHsave_LDFLAGS=$LDFLAGSsave_libdir=$libdireval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenif ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; thenshlibpath_overrides_runpath=yesfielseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5firm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLDFLAGS=$save_LDFLAGSlibdir=$save_libdir# This implies no fast_install, which is unacceptable.# Some rework will be needed to allow for fast_install# before this can be enabled.hardcode_into_libs=yes# Append ld.so.conf contents to the search pathif test -f /etc/ld.so.conf; thenlt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"fi# We used to test for /lib/ld.so.1 and disable shared libraries on# powerpc, because MkLinux only supported shared libraries with the# GNU dynamic linker. Since this was broken with cross compilers,# most powerpc-linux boxes support dynamic linking these days and# people can always --disable-shared, the test was removed, and we# assume the GNU/Linux dynamic linker is in use.dynamic_linker='GNU/Linux ld.so';;netbsd*)version_type=sunosneed_lib_prefix=noneed_version=noif echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; thenlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'dynamic_linker='NetBSD (a.out) ld.so'elselibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'dynamic_linker='NetBSD ld.elf_so'fishlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yeshardcode_into_libs=yes;;newsos6)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yes;;*nto* | *qnx*)version_type=qnxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=nohardcode_into_libs=yesdynamic_linker='ldqnx.so';;openbsd*)version_type=sunossys_lib_dlsearch_path_spec="/usr/lib"need_lib_prefix=no# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.case $host_os inopenbsd3.3 | openbsd3.3.*) need_version=yes ;;*) need_version=no ;;esaclibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'shlibpath_var=LD_LIBRARY_PATHif test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; thencase $host_os inopenbsd2.[89] | openbsd2.[89].*)shlibpath_overrides_runpath=no;;*)shlibpath_overrides_runpath=yes;;esacelseshlibpath_overrides_runpath=yesfi;;os2*)libname_spec='$name'shrext_cmds=".dll"need_lib_prefix=nolibrary_names_spec='$libname${shared_ext} $libname.a'dynamic_linker='OS/2 ld.exe'shlibpath_var=LIBPATH;;osf3* | osf4* | osf5*)version_type=osfneed_lib_prefix=noneed_version=nosoname_spec='${libname}${release}${shared_ext}$major'library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHsys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec";;rdos*)dynamic_linker=no;;solaris*)version_type=linuxneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yeshardcode_into_libs=yes# ldd complains unless libraries are executablepostinstall_cmds='chmod +x $lib';;sunos4*)version_type=sunoslibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yesif test "$with_gnu_ld" = yes; thenneed_lib_prefix=nofineed_version=yes;;sysv4 | sysv4.3*)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHcase $host_vendor insni)shlibpath_overrides_runpath=noneed_lib_prefix=norunpath_var=LD_RUN_PATH;;siemens)need_lib_prefix=no;;motorola)need_lib_prefix=noneed_version=noshlibpath_overrides_runpath=nosys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib';;esac;;sysv4*MP*)if test -d /usr/nec ;thenversion_type=linuxlibrary_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'soname_spec='$libname${shared_ext}.$major'shlibpath_var=LD_LIBRARY_PATHfi;;sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)version_type=freebsd-elfneed_lib_prefix=noneed_version=nolibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=yeshardcode_into_libs=yesif test "$with_gnu_ld" = yes; thensys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'elsesys_lib_search_path_spec='/usr/ccs/lib /usr/lib'case $host_os insco3.2v5*)sys_lib_search_path_spec="$sys_lib_search_path_spec /lib";;esacfisys_lib_dlsearch_path_spec='/usr/lib';;tpf*)# TPF is a cross-target only. Preferred cross-host = GNU/Linux.version_type=linuxneed_lib_prefix=noneed_version=nolibrary_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'shlibpath_var=LD_LIBRARY_PATHshlibpath_overrides_runpath=nohardcode_into_libs=yes;;uts4*)version_type=linuxlibrary_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'soname_spec='${libname}${release}${shared_ext}$major'shlibpath_var=LD_LIBRARY_PATH;;*)dynamic_linker=no;;esac{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5echo "${ECHO_T}$dynamic_linker" >&6; }test "$dynamic_linker" = no && can_build_shared=novariables_saved_for_relink="PATH $shlibpath_var $runpath_var"if test "$GCC" = yes; thenvariables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"fiif test "${lt_cv_sys_lib_search_path_spec+set}" = set; thensys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"fiif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; thensys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"fi{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }hardcode_action=if test -n "$hardcode_libdir_flag_spec" ||test -n "$runpath_var" ||test "X$hardcode_automatic" = "Xyes" ; then# We can hardcode non-existent directories.if test "$hardcode_direct" != no &&# If the only mechanism to avoid hardcoding is shlibpath_var, we# have to relink, otherwise we might link with an installed library# when we should be linking with a yet-to-be-installed one## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&test "$hardcode_minus_L" != no; then# Linking always hardcodes the temporary library directory.hardcode_action=relinkelse# We can link without hardcoding, and we can hardcode nonexisting dirs.hardcode_action=immediatefielse# We cannot hardcode anything, or else we can only hardcode existing# directories.hardcode_action=unsupportedfi{ echo "$as_me:$LINENO: result: $hardcode_action" >&5echo "${ECHO_T}$hardcode_action" >&6; }if test "$hardcode_action" = relink ||test "$inherit_rpath" = yes; then# Fast installation is not supportedenable_fast_install=noelif test "$shlibpath_overrides_runpath" = yes ||test "$enable_shared" = no; then# Fast installation is not necessaryenable_fast_install=needlessfiif test "x$enable_dlopen" != xyes; thenenable_dlopen=unknownenable_dlopen_self=unknownenable_dlopen_self_static=unknownelselt_cv_dlopen=nolt_cv_dlopen_libs=case $host_os inbeos*)lt_cv_dlopen="load_add_on"lt_cv_dlopen_libs=lt_cv_dlopen_self=yes;;mingw* | pw32*)lt_cv_dlopen="LoadLibrary"lt_cv_dlopen_libs=;;cygwin*)lt_cv_dlopen="dlopen"lt_cv_dlopen_libs=;;darwin*)# if libdl is installed we need to link against it{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }if test "${ac_cv_lib_dl_dlopen+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_check_lib_save_LIBS=$LIBSLIBS="-ldl $LIBS"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar dlopen ();intmain (){return dlopen ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_lib_dl_dlopen=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_lib_dl_dlopen=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLIBS=$ac_check_lib_save_LIBSfi{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }if test $ac_cv_lib_dl_dlopen = yes; thenlt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"elselt_cv_dlopen="dyld"lt_cv_dlopen_libs=lt_cv_dlopen_self=yesfi;;*){ echo "$as_me:$LINENO: checking for shl_load" >&5echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }if test "${ac_cv_func_shl_load+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.For example, HP-UX 11i <limits.h> declares gettimeofday. */#define shl_load innocuous_shl_load/* System header to define __stub macros and hopefully few prototypes,which can conflict with char shl_load (); below.Prefer <limits.h> to <assert.h> if __STDC__ is defined, since<limits.h> exists even on freestanding compilers. */#ifdef __STDC__# include <limits.h>#else# include <assert.h>#endif#undef shl_load/* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar shl_load ();/* The GNU C library defines this for functions which it implementsto always fail with ENOSYS. Some functions are actually namedsomething starting with __ and the normal name is an alias. */#if defined __stub_shl_load || defined __stub___shl_loadchoke me#endifintmain (){return shl_load ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_func_shl_load=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_func_shl_load=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }if test $ac_cv_func_shl_load = yes; thenlt_cv_dlopen="shl_load"else{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }if test "${ac_cv_lib_dld_shl_load+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_check_lib_save_LIBS=$LIBSLIBS="-ldld $LIBS"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar shl_load ();intmain (){return shl_load ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_lib_dld_shl_load=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_lib_dld_shl_load=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLIBS=$ac_check_lib_save_LIBSfi{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }if test $ac_cv_lib_dld_shl_load = yes; thenlt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"else{ echo "$as_me:$LINENO: checking for dlopen" >&5echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }if test "${ac_cv_func_dlopen+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.For example, HP-UX 11i <limits.h> declares gettimeofday. */#define dlopen innocuous_dlopen/* System header to define __stub macros and hopefully few prototypes,which can conflict with char dlopen (); below.Prefer <limits.h> to <assert.h> if __STDC__ is defined, since<limits.h> exists even on freestanding compilers. */#ifdef __STDC__# include <limits.h>#else# include <assert.h>#endif#undef dlopen/* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar dlopen ();/* The GNU C library defines this for functions which it implementsto always fail with ENOSYS. Some functions are actually namedsomething starting with __ and the normal name is an alias. */#if defined __stub_dlopen || defined __stub___dlopenchoke me#endifintmain (){return dlopen ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_func_dlopen=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_func_dlopen=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }if test $ac_cv_func_dlopen = yes; thenlt_cv_dlopen="dlopen"else{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }if test "${ac_cv_lib_dl_dlopen+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_check_lib_save_LIBS=$LIBSLIBS="-ldl $LIBS"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar dlopen ();intmain (){return dlopen ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_lib_dl_dlopen=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_lib_dl_dlopen=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLIBS=$ac_check_lib_save_LIBSfi{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }if test $ac_cv_lib_dl_dlopen = yes; thenlt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"else{ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }if test "${ac_cv_lib_svld_dlopen+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_check_lib_save_LIBS=$LIBSLIBS="-lsvld $LIBS"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar dlopen ();intmain (){return dlopen ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_lib_svld_dlopen=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_lib_svld_dlopen=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLIBS=$ac_check_lib_save_LIBSfi{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }if test $ac_cv_lib_svld_dlopen = yes; thenlt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"else{ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }if test "${ac_cv_lib_dld_dld_link+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseac_check_lib_save_LIBS=$LIBSLIBS="-ldld $LIBS"cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar dld_link ();intmain (){return dld_link ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_lib_dld_dld_link=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_lib_dld_dld_link=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extLIBS=$ac_check_lib_save_LIBSfi{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }if test $ac_cv_lib_dld_dld_link = yes; thenlt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"fifififififi;;esacif test "x$lt_cv_dlopen" != xno; thenenable_dlopen=yeselseenable_dlopen=noficase $lt_cv_dlopen indlopen)save_CPPFLAGS="$CPPFLAGS"test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"save_LDFLAGS="$LDFLAGS"wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"save_LIBS="$LIBS"LIBS="$lt_cv_dlopen_libs $LIBS"{ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }if test "${lt_cv_dlopen_self+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; then :lt_cv_dlopen_self=crosselselt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2lt_status=$lt_dlunknowncat > conftest.$ac_ext <<_LT_EOF#line 10499 "configure"#include "confdefs.h"#if HAVE_DLFCN_H#include <dlfcn.h>#endif#include <stdio.h>#ifdef RTLD_GLOBAL# define LT_DLGLOBAL RTLD_GLOBAL#else# ifdef DL_GLOBAL# define LT_DLGLOBAL DL_GLOBAL# else# define LT_DLGLOBAL 0# endif#endif/* We may have to define LT_DLLAZY_OR_NOW in the command line if wefind out it does not work in some platform. */#ifndef LT_DLLAZY_OR_NOW# ifdef RTLD_LAZY# define LT_DLLAZY_OR_NOW RTLD_LAZY# else# ifdef DL_LAZY# define LT_DLLAZY_OR_NOW DL_LAZY# else# ifdef RTLD_NOW# define LT_DLLAZY_OR_NOW RTLD_NOW# else# ifdef DL_NOW# define LT_DLLAZY_OR_NOW DL_NOW# else# define LT_DLLAZY_OR_NOW 0# endif# endif# endif# endif#endif#ifdef __cplusplusextern "C" void exit (int);#endifvoid fnord() { int i=42;}int main (){void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);int status = $lt_dlunknown;if (self){if (dlsym (self,"fnord")) status = $lt_dlno_uscore;else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;/* dlclose (self); */}elseputs (dlerror ());exit (status);}_LT_EOFif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5(eval $ac_link) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then(./conftest; exit; ) >&5 2>/dev/nulllt_status=$?case x$lt_status inx$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;esacelse :# compilation failedlt_cv_dlopen_self=nofifirm -fr conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }if test "x$lt_cv_dlopen_self" = xyes; thenwl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"{ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }if test "${lt_cv_dlopen_self_static+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; then :lt_cv_dlopen_self_static=crosselselt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2lt_status=$lt_dlunknowncat > conftest.$ac_ext <<_LT_EOF#line 10599 "configure"#include "confdefs.h"#if HAVE_DLFCN_H#include <dlfcn.h>#endif#include <stdio.h>#ifdef RTLD_GLOBAL# define LT_DLGLOBAL RTLD_GLOBAL#else# ifdef DL_GLOBAL# define LT_DLGLOBAL DL_GLOBAL# else# define LT_DLGLOBAL 0# endif#endif/* We may have to define LT_DLLAZY_OR_NOW in the command line if wefind out it does not work in some platform. */#ifndef LT_DLLAZY_OR_NOW# ifdef RTLD_LAZY# define LT_DLLAZY_OR_NOW RTLD_LAZY# else# ifdef DL_LAZY# define LT_DLLAZY_OR_NOW DL_LAZY# else# ifdef RTLD_NOW# define LT_DLLAZY_OR_NOW RTLD_NOW# else# ifdef DL_NOW# define LT_DLLAZY_OR_NOW DL_NOW# else# define LT_DLLAZY_OR_NOW 0# endif# endif# endif# endif#endif#ifdef __cplusplusextern "C" void exit (int);#endifvoid fnord() { int i=42;}int main (){void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);int status = $lt_dlunknown;if (self){if (dlsym (self,"fnord")) status = $lt_dlno_uscore;else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;/* dlclose (self); */}elseputs (dlerror ());exit (status);}_LT_EOFif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5(eval $ac_link) 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then(./conftest; exit; ) >&5 2>/dev/nulllt_status=$?case x$lt_status inx$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;esacelse :# compilation failedlt_cv_dlopen_self_static=nofifirm -fr conftest*fi{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }fiCPPFLAGS="$save_CPPFLAGS"LDFLAGS="$save_LDFLAGS"LIBS="$save_LIBS";;esaccase $lt_cv_dlopen_self inyes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;*) enable_dlopen_self=unknown ;;esaccase $lt_cv_dlopen_self_static inyes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;*) enable_dlopen_self_static=unknown ;;esacfistriplib=old_striplib={ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; thentest -z "$old_striplib" && old_striplib="$STRIP --strip-debug"test -z "$striplib" && striplib="$STRIP --strip-unneeded"{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }else# FIXME - insert some real tests, host_os isn't really good enoughcase $host_os indarwin*)if test -n "$STRIP" ; thenstriplib="$STRIP -x"old_striplib="$STRIP -S"{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }fi;;*){ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; };;esacfi# Report which library types will actually be built{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }{ echo "$as_me:$LINENO: result: $can_build_shared" >&5echo "${ECHO_T}$can_build_shared" >&6; }{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }test "$can_build_shared" = "no" && enable_shared=no# On AIX, shared libraries and static libraries use the same namespace, and# are all built from PIC.case $host_os inaix3*)test "$enable_shared" = yes && enable_static=noif test -n "$RANLIB"; thenarchive_cmds="$archive_cmds~\$RANLIB \$lib"postinstall_cmds='$RANLIB $lib'fi;;aix[4-9]*)if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; thentest "$enable_shared" = yes && enable_static=nofi;;esac{ echo "$as_me:$LINENO: result: $enable_shared" >&5echo "${ECHO_T}$enable_shared" >&6; }{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }# Make sure either enable_shared or enable_static is yes.test "$enable_shared" = yes || enable_static=yes{ echo "$as_me:$LINENO: result: $enable_static" >&5echo "${ECHO_T}$enable_static" >&6; }fiac_ext=cac_cpp='$CPP $CPPFLAGS'ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'ac_compiler_gnu=$ac_cv_c_compiler_gnuCC="$lt_save_CC"ac_config_commands="$ac_config_commands libtool"# Only expand once:LTVERSION="2:0:0"# Find a good install program. We prefer a C program (faster),# so one script is as good as another. But avoid the broken or# incompatible versions:# SysV /etc/install, /usr/sbin/install# SunOS /usr/etc/install# IRIX /sbin/install# AIX /bin/install# AmigaOS /C/install, which installs bootblocks on floppy discs# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag# AFS /usr/afsws/bin/install, which mishandles nonexistent args# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"# OS/2's system install, which has a completely different semantic# ./install, which can be erroneously created by make from ./install.sh.{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }if test -z "$INSTALL"; thenif test "${ac_cv_path_install+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseas_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.# Account for people who put trailing slashes in PATH elements.case $as_dir/ in./ | .// | /cC/* | \/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \/usr/ucb/* ) ;;*)# OSF1 and SCO ODT 3.0 have their own names for install.# Don't use installbsd from OSF since it installs stuff as root# by default.for ac_prog in ginstall scoinst install; dofor ac_exec_ext in '' $ac_executable_extensions; doif { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; thenif test $ac_prog = install &&grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then# AIX install. It has an incompatible calling convention.:elif test $ac_prog = install &&grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then# program-specific install script used by HP pwplus--don't use.:elseac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"break 3fifidonedone;;esacdoneIFS=$as_save_IFSfiif test "${ac_cv_path_install+set}" = set; thenINSTALL=$ac_cv_path_installelse# As a last resort, use the slow shell script. Don't cache a# value for INSTALL within a source directory, because that will# break other packages using the cache if that directory is# removed, or if the value is a relative name.INSTALL=$ac_install_shfifi{ echo "$as_me:$LINENO: result: $INSTALL" >&5echo "${ECHO_T}$INSTALL" >&6; }# Use test -z because SunOS4 sh mishandles braces in ${var-val}.# It thinks the first close brace ends the variable substitution.test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.make <<\_ACEOFSHELL = /bin/shall:@echo '@@@%%%=$(MAKE)=@@@%%%'_ACEOF# GNU make sometimes prints "make[1]: Entering...", which would confuse us.case `${MAKE-make} -f conftest.make 2>/dev/null` in*@@@%%%=?*=@@@%%%*)eval ac_cv_prog_make_${ac_make}_set=yes;;*)eval ac_cv_prog_make_${ac_make}_set=no;;esacrm -f conftest.makefiif eval test \$ac_cv_prog_make_${ac_make}_set = yes; then{ echo "$as_me:$LINENO: result: yes" >&5echo "${ECHO_T}yes" >&6; }SET_MAKE=else{ echo "$as_me:$LINENO: result: no" >&5echo "${ECHO_T}no" >&6; }SET_MAKE="MAKE=${MAKE-make}"fi{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }if test "${ac_cv_header_stdc+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <float.h>intmain (){;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_header_stdc=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_header_stdc=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extif test $ac_cv_header_stdc = yes; then# SunOS 4.x string.h does not declare mem*, contrary to ANSI.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <string.h>_ACEOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |$EGREP "memchr" >/dev/null 2>&1; then:elseac_cv_header_stdc=nofirm -f -r conftest*fiif test $ac_cv_header_stdc = yes; then# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <stdlib.h>_ACEOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |$EGREP "free" >/dev/null 2>&1; then:elseac_cv_header_stdc=nofirm -f -r conftest*fiif test $ac_cv_header_stdc = yes; then# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.if test "$cross_compiling" = yes; then:elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <ctype.h>#include <stdlib.h>#if ((' ' & 0x0FF) == 0x020)# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))#else# define ISLOWER(c) \(('a' <= (c) && (c) <= 'i') \|| ('j' <= (c) && (c) <= 'r') \|| ('s' <= (c) && (c) <= 'z'))# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))#endif#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))intmain (){int i;for (i = 0; i < 256; i++)if (XOR (islower (i), ISLOWER (i))|| toupper (i) != TOUPPER (i))return 2;return 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; then:elseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )ac_cv_header_stdc=nofirm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfififi{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5echo "${ECHO_T}$ac_cv_header_stdc" >&6; }if test $ac_cv_header_stdc = yes; thencat >>confdefs.h <<\_ACEOF#define STDC_HEADERS 1_ACEOFfifor ac_header in stdlib.h string.h strings.h sys/time.h unistd.h sys/times.hdoas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then{ echo "$as_me:$LINENO: checking for $ac_header" >&5echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6fiac_res=`eval echo '${'$as_ac_Header'}'`{ echo "$as_me:$LINENO: result: $ac_res" >&5echo "${ECHO_T}$ac_res" >&6; }else# Is the header compilable?{ echo "$as_me:$LINENO: checking $ac_header usability" >&5echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_default#include <$ac_header>_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_header_compiler=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_header_compiler=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_ext{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5echo "${ECHO_T}$ac_header_compiler" >&6; }# Is the header present?{ echo "$as_me:$LINENO: checking $ac_header presence" >&5echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <$ac_header>_ACEOFif { (ac_try="$ac_cpp conftest.$ac_ext"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } >/dev/null && {test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||test ! -s conftest.err}; thenac_header_preproc=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_header_preproc=nofirm -f conftest.err conftest.$ac_ext{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5echo "${ECHO_T}$ac_header_preproc" >&6; }# So? What about this header?case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag inyes:no: ){ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}ac_header_preproc=yes;;no:yes:* ){ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;};;esac{ echo "$as_me:$LINENO: checking for $ac_header" >&5echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseeval "$as_ac_Header=\$ac_header_preproc"fiac_res=`eval echo '${'$as_ac_Header'}'`{ echo "$as_me:$LINENO: result: $ac_res" >&5echo "${ECHO_T}$ac_res" >&6; }fiif test `eval echo '${'$as_ac_Header'}'` = yes; thencat >>confdefs.h <<_ACEOF#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1_ACEOFfidone{ echo "$as_me:$LINENO: checking for int" >&5echo $ECHO_N "checking for int... $ECHO_C" >&6; }if test "${ac_cv_type_int+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_new_;intmain (){if ((ac__type_new_ *) 0)return 0;if (sizeof (ac__type_new_))return 0;;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_type_int=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_type_int=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5echo "${ECHO_T}$ac_cv_type_int" >&6; }# The cast to long int works around a bug in the HP C Compiler# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.# This bug is HP SR number 8606223364.{ echo "$as_me:$LINENO: checking size of int" >&5echo $ECHO_N "checking size of int... $ECHO_C" >&6; }if test "${ac_cv_sizeof_int+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; then# Depending upon the size, compute the lo and hi bounds.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_lo=0 ac_mid=0while :; docat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=$ac_mid; breakelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo=`expr $ac_mid + 1`if test $ac_lo -le $ac_mid; thenac_lo= ac_hi=breakfiac_mid=`expr 2 '*' $ac_mid + 1`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=-1 ac_mid=-1while :; docat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_lo=$ac_mid; breakelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_hi=`expr '(' $ac_mid ')' - 1`if test $ac_mid -le $ac_hi; thenac_lo= ac_hi=breakfiac_mid=`expr 2 '*' $ac_mid`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo= ac_hi=firm -f core conftest.err conftest.$ac_objext conftest.$ac_extfirm -f core conftest.err conftest.$ac_objext conftest.$ac_ext# Binary search between lo and hi bounds.while test "x$ac_lo" != "x$ac_hi"; doac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=$ac_midelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo=`expr '(' $ac_mid ')' + 1`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdonecase $ac_lo in?*) ac_cv_sizeof_int=$ac_lo;;'') if test "$ac_cv_type_int" = yes; then{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)See \`config.log' for more details." >&5echo "$as_me: error: cannot compute sizeof (int)See \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }elseac_cv_sizeof_int=0fi ;;esacelsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef int ac__type_sizeof_;static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }#include <stdio.h>#include <stdlib.h>intmain (){FILE *f = fopen ("conftest.val", "w");if (! f)return 1;if (((long int) (sizeof (ac__type_sizeof_))) < 0){long int i = longval ();if (i != ((long int) (sizeof (ac__type_sizeof_))))return 1;fprintf (f, "%ld\n", i);}else{unsigned long int i = ulongval ();if (i != ((long int) (sizeof (ac__type_sizeof_))))return 1;fprintf (f, "%lu\n", i);}return ferror (f) || fclose (f) != 0;;return 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; thenac_cv_sizeof_int=`cat conftest.val`elseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )if test "$ac_cv_type_int" = yes; then{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int)See \`config.log' for more details." >&5echo "$as_me: error: cannot compute sizeof (int)See \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }elseac_cv_sizeof_int=0fifirm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfirm -f conftest.valfi{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }cat >>confdefs.h <<_ACEOF#define SIZEOF_INT $ac_cv_sizeof_int_ACEOF{ echo "$as_me:$LINENO: checking for short" >&5echo $ECHO_N "checking for short... $ECHO_C" >&6; }if test "${ac_cv_type_short+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_new_;intmain (){if ((ac__type_new_ *) 0)return 0;if (sizeof (ac__type_new_))return 0;;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_type_short=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_type_short=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5echo "${ECHO_T}$ac_cv_type_short" >&6; }# The cast to long int works around a bug in the HP C Compiler# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.# This bug is HP SR number 8606223364.{ echo "$as_me:$LINENO: checking size of short" >&5echo $ECHO_N "checking size of short... $ECHO_C" >&6; }if test "${ac_cv_sizeof_short+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; then# Depending upon the size, compute the lo and hi bounds.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_lo=0 ac_mid=0while :; docat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=$ac_mid; breakelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo=`expr $ac_mid + 1`if test $ac_lo -le $ac_mid; thenac_lo= ac_hi=breakfiac_mid=`expr 2 '*' $ac_mid + 1`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=-1 ac_mid=-1while :; docat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_lo=$ac_mid; breakelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_hi=`expr '(' $ac_mid ')' - 1`if test $ac_mid -le $ac_hi; thenac_lo= ac_hi=breakfiac_mid=`expr 2 '*' $ac_mid`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo= ac_hi=firm -f core conftest.err conftest.$ac_objext conftest.$ac_extfirm -f core conftest.err conftest.$ac_objext conftest.$ac_ext# Binary search between lo and hi bounds.while test "x$ac_lo" != "x$ac_hi"; doac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=$ac_midelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo=`expr '(' $ac_mid ')' + 1`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdonecase $ac_lo in?*) ac_cv_sizeof_short=$ac_lo;;'') if test "$ac_cv_type_short" = yes; then{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short)See \`config.log' for more details." >&5echo "$as_me: error: cannot compute sizeof (short)See \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }elseac_cv_sizeof_short=0fi ;;esacelsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef short ac__type_sizeof_;static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }#include <stdio.h>#include <stdlib.h>intmain (){FILE *f = fopen ("conftest.val", "w");if (! f)return 1;if (((long int) (sizeof (ac__type_sizeof_))) < 0){long int i = longval ();if (i != ((long int) (sizeof (ac__type_sizeof_))))return 1;fprintf (f, "%ld\n", i);}else{unsigned long int i = ulongval ();if (i != ((long int) (sizeof (ac__type_sizeof_))))return 1;fprintf (f, "%lu\n", i);}return ferror (f) || fclose (f) != 0;;return 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; thenac_cv_sizeof_short=`cat conftest.val`elseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )if test "$ac_cv_type_short" = yes; then{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short)See \`config.log' for more details." >&5echo "$as_me: error: cannot compute sizeof (short)See \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }elseac_cv_sizeof_short=0fifirm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfirm -f conftest.valfi{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }cat >>confdefs.h <<_ACEOF#define SIZEOF_SHORT $ac_cv_sizeof_short_ACEOF{ echo "$as_me:$LINENO: checking for long" >&5echo $ECHO_N "checking for long... $ECHO_C" >&6; }if test "${ac_cv_type_long+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_new_;intmain (){if ((ac__type_new_ *) 0)return 0;if (sizeof (ac__type_new_))return 0;;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_type_long=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_type_long=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5echo "${ECHO_T}$ac_cv_type_long" >&6; }# The cast to long int works around a bug in the HP C Compiler# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.# This bug is HP SR number 8606223364.{ echo "$as_me:$LINENO: checking size of long" >&5echo $ECHO_N "checking size of long... $ECHO_C" >&6; }if test "${ac_cv_sizeof_long+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; then# Depending upon the size, compute the lo and hi bounds.cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_lo=0 ac_mid=0while :; docat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=$ac_mid; breakelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo=`expr $ac_mid + 1`if test $ac_lo -le $ac_mid; thenac_lo= ac_hi=breakfiac_mid=`expr 2 '*' $ac_mid + 1`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=-1 ac_mid=-1while :; docat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_lo=$ac_mid; breakelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_hi=`expr '(' $ac_mid ')' - 1`if test $ac_mid -le $ac_hi; thenac_lo= ac_hi=breakfiac_mid=`expr 2 '*' $ac_mid`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdoneelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo= ac_hi=firm -f core conftest.err conftest.$ac_objext conftest.$ac_extfirm -f core conftest.err conftest.$ac_objext conftest.$ac_ext# Binary search between lo and hi bounds.while test "x$ac_lo" != "x$ac_hi"; doac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`cat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_sizeof_;intmain (){static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];test_array [0] = 0;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_hi=$ac_midelseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_lo=`expr '(' $ac_mid ')' + 1`firm -f core conftest.err conftest.$ac_objext conftest.$ac_extdonecase $ac_lo in?*) ac_cv_sizeof_long=$ac_lo;;'') if test "$ac_cv_type_long" = yes; then{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long)See \`config.log' for more details." >&5echo "$as_me: error: cannot compute sizeof (long)See \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }elseac_cv_sizeof_long=0fi ;;esacelsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaulttypedef long ac__type_sizeof_;static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }#include <stdio.h>#include <stdlib.h>intmain (){FILE *f = fopen ("conftest.val", "w");if (! f)return 1;if (((long int) (sizeof (ac__type_sizeof_))) < 0){long int i = longval ();if (i != ((long int) (sizeof (ac__type_sizeof_))))return 1;fprintf (f, "%ld\n", i);}else{unsigned long int i = ulongval ();if (i != ((long int) (sizeof (ac__type_sizeof_))))return 1;fprintf (f, "%lu\n", i);}return ferror (f) || fclose (f) != 0;;return 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; thenac_cv_sizeof_long=`cat conftest.val`elseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )if test "$ac_cv_type_long" = yes; then{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long)See \`config.log' for more details." >&5echo "$as_me: error: cannot compute sizeof (long)See \`config.log' for more details." >&2;}{ (exit 77); exit 77; }; }elseac_cv_sizeof_long=0fifirm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfirm -f conftest.valfi{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }cat >>confdefs.h <<_ACEOF#define SIZEOF_LONG $ac_cv_sizeof_long_ACEOF{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }if test "${ac_cv_c_const+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */intmain (){/* FIXME: Include the comments suggested by Paul. */#ifndef __cplusplus/* Ultrix mips cc rejects this. */typedef int charset[2];const charset cs;/* SunOS 4.1.1 cc rejects this. */char const *const *pcpcc;char **ppc;/* NEC SVR4.0.2 mips cc rejects this. */struct point {int x, y;};static struct point const zero = {0,0};/* AIX XL C 1.02.0.0 rejects this.It does not let you subtract one const X* pointer from another inan arm of an if-expression whose if-part is not a constantexpression */const char *g = "string";pcpcc = &g + (g ? g-g : 0);/* HPUX 7.0 cc rejects these. */++pcpcc;ppc = (char**) pcpcc;pcpcc = (char const *const *) ppc;{ /* SCO 3.2v4 cc rejects this. */char *t;char const *s = 0 ? (char *) 0 : (char const *) 0;*t++ = 0;if (s) return 0;}{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */int x[] = {25, 17};const int *foo = &x[0];++foo;}{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */typedef const int *iptr;iptr p = 0;++p;}{ /* AIX XL C 1.02.0.0 rejects this saying"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */struct s { int j; const int *ap[3]; };struct s *b; b->j = 5;}{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */const int foo = 10;if (!foo) return 0;}return !cs[0] && !zero.x;#endif;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_c_const=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_c_const=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5echo "${ECHO_T}$ac_cv_c_const" >&6; }if test $ac_cv_c_const = no; thencat >>confdefs.h <<\_ACEOF#define const_ACEOFfi{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }if test "${ac_cv_header_time+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <sys/types.h>#include <sys/time.h>#include <time.h>intmain (){if ((struct tm *) 0)return 0;;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thenac_cv_header_time=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_header_time=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5echo "${ECHO_T}$ac_cv_header_time" >&6; }if test $ac_cv_header_time = yes; thencat >>confdefs.h <<\_ACEOF#define TIME_WITH_SYS_TIME 1_ACEOFfi# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works# for constant arguments. Useless!{ echo "$as_me:$LINENO: checking for working alloca.h" >&5echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }if test "${ac_cv_working_alloca_h+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <alloca.h>intmain (){char *p = (char *) alloca (2 * sizeof (int));if (p) return 0;;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_working_alloca_h=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_working_alloca_h=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }if test $ac_cv_working_alloca_h = yes; thencat >>confdefs.h <<\_ACEOF#define HAVE_ALLOCA_H 1_ACEOFfi{ echo "$as_me:$LINENO: checking for alloca" >&5echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }if test "${ac_cv_func_alloca_works+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#ifdef __GNUC__# define alloca __builtin_alloca#else# ifdef _MSC_VER# include <malloc.h># define alloca _alloca# else# ifdef HAVE_ALLOCA_H# include <alloca.h># else# ifdef _AIX#pragma alloca# else# ifndef alloca /* predefined by HP cc +Olibcalls */char *alloca ();# endif# endif# endif# endif#endifintmain (){char *p = (char *) alloca (1);if (p) return 0;;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; thenac_cv_func_alloca_works=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5ac_cv_func_alloca_works=nofirm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }if test $ac_cv_func_alloca_works = yes; thencat >>confdefs.h <<\_ACEOF#define HAVE_ALLOCA 1_ACEOFelse# The SVR3 libPW and SVR4 libucb both contain incompatible functions# that cause trouble. Some versions do not even contain alloca or# contain a buggy version. If you still want to use their alloca,# use ar to extract alloca.o from them instead of compiling alloca.c.ALLOCA=\${LIBOBJDIR}alloca.$ac_objextcat >>confdefs.h <<\_ACEOF#define C_ALLOCA 1_ACEOF{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }if test "${ac_cv_os_cray+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#if defined CRAY && ! defined CRAY2webecray#elsewenotbecray#endif_ACEOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |$EGREP "webecray" >/dev/null 2>&1; thenac_cv_os_cray=yeselseac_cv_os_cray=nofirm -f -r conftest*fi{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5echo "${ECHO_T}$ac_cv_os_cray" >&6; }if test $ac_cv_os_cray = yes; thenfor ac_func in _getb67 GETB67 getb67; doas_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`{ echo "$as_me:$LINENO: checking for $ac_func" >&5echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. *//* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.For example, HP-UX 11i <limits.h> declares gettimeofday. */#define $ac_func innocuous_$ac_func/* System header to define __stub macros and hopefully few prototypes,which can conflict with char $ac_func (); below.Prefer <limits.h> to <assert.h> if __STDC__ is defined, since<limits.h> exists even on freestanding compilers. */#ifdef __STDC__# include <limits.h>#else# include <assert.h>#endif#undef $ac_func/* Override any GCC internal prototype to avoid an error.Use char because int might match the return type of a GCCbuiltin and then its argument prototype would still apply. */#ifdef __cplusplusextern "C"#endifchar $ac_func ();/* The GNU C library defines this for functions which it implementsto always fail with ENOSYS. Some functions are actually namedsomething starting with __ and the normal name is an alias. */#if defined __stub_$ac_func || defined __stub___$ac_funcchoke me#endifintmain (){return $ac_func ();;return 0;}_ACEOFrm -f conftest.$ac_objext conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest$ac_exeext &&$as_test_x conftest$ac_exeext; theneval "$as_ac_var=yes"elseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5eval "$as_ac_var=no"firm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \conftest$ac_exeext conftest.$ac_extfiac_res=`eval echo '${'$as_ac_var'}'`{ echo "$as_me:$LINENO: result: $ac_res" >&5echo "${ECHO_T}$ac_res" >&6; }if test `eval echo '${'$as_ac_var'}'` = yes; thencat >>confdefs.h <<_ACEOF#define CRAY_STACKSEG_END $ac_func_ACEOFbreakfidonefi{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }if test "${ac_cv_c_stack_direction+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; thenac_cv_c_stack_direction=0elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaultintfind_stack_direction (){static char *addr = 0;auto char dummy;if (addr == 0){addr = &dummy;return find_stack_direction ();}elsereturn (&dummy > addr) ? 1 : -1;}intmain (){return find_stack_direction () < 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; thenac_cv_c_stack_direction=1elseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )ac_cv_c_stack_direction=-1firm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfifi{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }cat >>confdefs.h <<_ACEOF#define STACK_DIRECTION $ac_cv_c_stack_direction_ACEOFfi{ echo "$as_me:$LINENO: checking for working memcmp" >&5echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; }if test "${ac_cv_func_memcmp_working+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elseif test "$cross_compiling" = yes; thenac_cv_func_memcmp_working=noelsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */$ac_includes_defaultintmain (){/* Some versions of memcmp are not 8-bit clean. */char c0 = '\100', c1 = '\200', c2 = '\201';if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)return 1;/* The Next x86 OpenStep bug shows up only when comparing 16 bytesor more and with at least one buffer not starting on a 4-byte boundary.William Lewis provided this test program. */{char foo[21];char bar[21];int i;for (i = 0; i < 4; i++){char *a = foo + i;char *b = bar + i;strcpy (a, "--------01111111");strcpy (b, "--------10000000");if (memcmp (a, b, 16) >= 0)return 1;}return 0;};return 0;}_ACEOFrm -f conftest$ac_exeextif { (ac_try="$ac_link"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_link") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && { ac_try='./conftest$ac_exeext'{ (case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_try") 2>&5ac_status=$?echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); }; }; thenac_cv_func_memcmp_working=yeselseecho "$as_me: program exited with status $ac_status" >&5echo "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5( exit $ac_status )ac_cv_func_memcmp_working=nofirm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_extfifi{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; }test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in*" memcmp.$ac_objext "* ) ;;*) LIBOBJS="$LIBOBJS memcmp.$ac_objext";;esac{ echo "$as_me:$LINENO: checking for prototypes" >&5echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; }if test "${cv_have_prototypes+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */int foo(int x) { return 0; }intmain (){return foo(10);;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thencv_have_prototypes=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5cv_have_prototypes=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $cv_have_prototypes" >&5echo "${ECHO_T}$cv_have_prototypes" >&6; }if test "$cv_have_prototypes" = yes; thencat >>confdefs.h <<\_ACEOF#define HAVE_PROTOTYPES 1_ACEOFfi{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; }if test "${cv_stdarg+set}" = set; thenecho $ECHO_N "(cached) $ECHO_C" >&6elsecat >conftest.$ac_ext <<_ACEOF/* confdefs.h. */_ACEOFcat confdefs.h >>conftest.$ac_extcat >>conftest.$ac_ext <<_ACEOF/* end confdefs.h. */#include <stdarg.h>int foo(int x, ...) {va_list va;va_start(va, x);va_arg(va, int);va_arg(va, char *);va_arg(va, double);return 0;}intmain (){return foo(10, "", 3.14);;return 0;}_ACEOFrm -f conftest.$ac_objextif { (ac_try="$ac_compile"case "(($ac_try" in*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;*) ac_try_echo=$ac_try;;esaceval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5(eval "$ac_compile") 2>conftest.er1ac_status=$?grep -v '^ *+' conftest.er1 >conftest.errrm -f conftest.er1cat conftest.err >&5echo "$as_me:$LINENO: \$? = $ac_status" >&5(exit $ac_status); } && {test -z "$ac_c_werror_flag" ||test ! -s conftest.err} && test -s conftest.$ac_objext; thencv_stdarg=yeselseecho "$as_me: failed program was:" >&5sed 's/^/| /' conftest.$ac_ext >&5cv_stdarg=nofirm -f core conftest.err conftest.$ac_objext conftest.$ac_extfi{ echo "$as_me:$LINENO: result: $cv_stdarg" >&5echo "${ECHO_T}$cv_stdarg" >&6; }if test "$cv_stdarg" = yes; thencat >>confdefs.h <<\_ACEOF#define HAVE_STDARG_PROTOTYPES 1_ACEOFfiac_config_files="$ac_config_files Makefile onig-config sample/Makefile"ac_config_commands="$ac_config_commands default"cat >confcache <<\_ACEOF# This file is a shell script that caches the results of configure# tests run on this system so they can be shared between configure# scripts and configure runs, see configure's option --config-cache.# It is not useful on other systems. If it contains results you don't# want to keep, you may remove or edit it.## config.status only pays attention to the cache file if you give it# the --recheck option to rerun configure.## `ac_cv_env_foo' variables (set or unset) will be overridden when# loading this file, other *unset* `ac_cv_foo' will be assigned the# following values._ACEOF# The following way of writing the cache mishandles newlines in values,# but we know of no workaround that is simple, portable, and efficient.# So, we kill variables containing newlines.# Ultrix sh set writes to stderr and can't be redirected directly,# and sets the high bit in the cache file unless we assign to the vars.(for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; doeval ac_val=\$$ac_varcase $ac_val in #(*${as_nl}*)case $ac_var in #(*_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;esaccase $ac_var in #(_ | IFS | as_nl) ;; #(*) $as_unset $ac_var ;;esac ;;esacdone(set) 2>&1 |case $as_nl`(ac_space=' '; set) 2>&1` in #(*${as_nl}ac_space=\ *)# `set' does not quote correctly, so add quotes (double-quote# substitution turns \\\\ into \\, and sed turns \\ into \).sed -n \"s/'/'\\\\''/g;s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p";; #(*)# `set' quotes correctly as required by POSIX, so do not add quotes.sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p";;esac |sort) |sed '/^ac_cv_env_/b endt clear:clears/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/t ends/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/:end' >>confcacheif diff "$cache_file" confcache >/dev/null 2>&1; then :; elseif test -w "$cache_file"; thentest "x$cache_file" != "x/dev/null" &&{ echo "$as_me:$LINENO: updating cache $cache_file" >&5echo "$as_me: updating cache $cache_file" >&6;}cat confcache >$cache_fileelse{ echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5echo "$as_me: not updating unwritable cache $cache_file" >&6;}fifirm -f confcachetest "x$prefix" = xNONE && prefix=$ac_default_prefix# Let make expand exec_prefix.test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'DEFS=-DHAVE_CONFIG_Hac_libobjs=ac_ltlibobjs=for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue# 1. Remove the extension, and $U if already installed.ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'ac_i=`echo "$ac_i" | sed "$ac_script"`# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR# will be set to the directory where LIBOBJS objects are built.ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'doneLIBOBJS=$ac_libobjsLTLIBOBJS=$ac_ltlibobjsif test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then{ { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.Usually this means the macro was only invoked conditionally." >&5echo "$as_me: error: conditional \"AMDEP\" was never defined.Usually this means the macro was only invoked conditionally." >&2;}{ (exit 1); exit 1; }; }fiif test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then{ { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.Usually this means the macro was only invoked conditionally." >&5echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.Usually this means the macro was only invoked conditionally." >&2;}{ (exit 1); exit 1; }; }fi: ${CONFIG_STATUS=./config.status}ac_clean_files_save=$ac_clean_filesac_clean_files="$ac_clean_files $CONFIG_STATUS"{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5echo "$as_me: creating $CONFIG_STATUS" >&6;}cat >$CONFIG_STATUS <<_ACEOF#! $SHELL# Generated by $as_me.# Run this file to recreate the current configuration.# Compiler output produced by configure, useful for debugging# configure, is in config.log if it exists.debug=falseac_cs_recheck=falseac_cs_silent=falseSHELL=\${CONFIG_SHELL-$SHELL}_ACEOFcat >>$CONFIG_STATUS <<\_ACEOF## --------------------- #### M4sh Initialization. #### --------------------- ### Be more Bourne compatibleDUALCASE=1; export DUALCASE # for MKS shif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; thenemulate shNULLCMD=:# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which# is contrary to our usage. Disable this feature.alias -g '${1+"$@"}'='"$@"'setopt NO_GLOB_SUBSTelsecase `(set -o) 2>/dev/null` in*posix*) set -o posix ;;esacfi# PATH needs CR# Avoid depending upon Character Ranges.as_cr_letters='abcdefghijklmnopqrstuvwxyz'as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'as_cr_Letters=$as_cr_letters$as_cr_LETTERSas_cr_digits='0123456789'as_cr_alnum=$as_cr_Letters$as_cr_digits# The user is always right.if test "${PATH_SEPARATOR+set}" != set; thenecho "#! /bin/sh" >conf$$.shecho "exit 0" >>conf$$.shchmod +x conf$$.shif (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; thenPATH_SEPARATOR=';'elsePATH_SEPARATOR=:firm -f conf$$.shfi# Support unset when possible.if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; thenas_unset=unsetelseas_unset=falsefi# IFS# We need space, tab and new line, in precisely that order. Quoting is# there to prevent editors from complaining about space-tab.# (If _AS_PATH_WALK were called with IFS unset, it would disable word# splitting by setting IFS to empty value.)as_nl=''IFS=" "" $as_nl"# Find who we are. Look in the path if we contain no directory separator.case $0 in*[\\/]* ) as_myself=$0 ;;*) as_save_IFS=$IFS; IFS=$PATH_SEPARATORfor as_dir in $PATHdoIFS=$as_save_IFStest -z "$as_dir" && as_dir=.test -r "$as_dir/$0" && as_myself=$as_dir/$0 && breakdoneIFS=$as_save_IFS;;esac# We did not find ourselves, most probably we were run as `sh COMMAND'# in which case we are not to be found in the path.if test "x$as_myself" = x; thenas_myself=$0fiif test ! -f "$as_myself"; thenecho "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2{ (exit 1); exit 1; }fi# Work around bugs in pre-3.0 UWIN ksh.for as_var in ENV MAIL MAILPATHdo ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_vardonePS1='$ 'PS2='> 'PS4='+ '# NLS nuisances.for as_var in \LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \LC_TELEPHONE LC_TIMEdoif (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); theneval $as_var=C; export $as_varelse($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_varfidone# Required to use basename.if expr a : '\(a\)' >/dev/null 2>&1 &&test "X`expr 00001 : '.*\(...\)'`" = X001; thenas_expr=exprelseas_expr=falsefiif (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; thenas_basename=basenameelseas_basename=falsefi# Name of the executable.as_me=`$as_basename -- "$0" ||$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \X"$0" : 'X\(//\)$' \| \X"$0" : 'X\(/\)' \| . 2>/dev/null ||echo X/"$0" |sed '/^.*\/\([^/][^/]*\)\/*$/{s//\1/q}/^X\/\(\/\/\)$/{s//\1/q}/^X\/\(\/\).*/{s//\1/q}s/.*/./; q'`# CDPATH.$as_unset CDPATHas_lineno_1=$LINENOas_lineno_2=$LINENOtest "x$as_lineno_1" != "x$as_lineno_2" &&test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {# Create $as_me.lineno as a copy of $as_myself, but with $LINENO# uniformly replaced by the line number. The first 'sed' inserts a# line-number line after each line using $LINENO; the second 'sed'# does the real work. The second script uses 'N' to pair each# line-number line with the line containing $LINENO, and appends# trailing '-' during substitution so that $LINENO is not a special# case at line end.# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the# scripts with optimization help from Paolo Bonzini. Blame Lee# E. McMahon (1931-1989) for sed's syntax. :-)sed -n 'p/[$]LINENO/=' <$as_myself |sed 's/[$]LINENO.*/&-/t linenob:linenoN:loops/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/t loops/-\n.*//' >$as_me.lineno &&chmod +x "$as_me.lineno" ||{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2{ (exit 1); exit 1; }; }# Don't try to exec as it changes $[0], causing all sort of problems# (the dirname of $[0] is not the place where we might find the# original and so on. Autoconf is especially sensitive to this).. "./$as_me.lineno"# Exit status is that of the last command.exit}if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; thenas_dirname=dirnameelseas_dirname=falsefiECHO_C= ECHO_N= ECHO_T=case `echo -n x` in-n*)case `echo 'x\c'` in*c*) ECHO_T=' ';; # ECHO_T is single tab character.*) ECHO_C='\c';;esac;;*)ECHO_N='-n';;esacif expr a : '\(a\)' >/dev/null 2>&1 &&test "X`expr 00001 : '.*\(...\)'`" = X001; thenas_expr=exprelseas_expr=falsefirm -f conf$$ conf$$.exe conf$$.fileif test -d conf$$.dir; thenrm -f conf$$.dir/conf$$.fileelserm -f conf$$.dirmkdir conf$$.dirfiecho >conf$$.fileif ln -s conf$$.file conf$$ 2>/dev/null; thenas_ln_s='ln -s'# ... but there are two gotchas:# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.# In both cases, we have to default to `cp -p'.ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||as_ln_s='cp -p'elif ln conf$$.file conf$$ 2>/dev/null; thenas_ln_s=lnelseas_ln_s='cp -p'firm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.filermdir conf$$.dir 2>/dev/nullif mkdir -p . 2>/dev/null; thenas_mkdir_p=:elsetest -d ./-p && rmdir ./-pas_mkdir_p=falsefiif test -x / >/dev/null 2>&1; thenas_test_x='test -x'elseif ls -dL / >/dev/null 2>&1; thenas_ls_L_option=Lelseas_ls_L_option=fias_test_x='eval sh -c '\''if test -d "$1"; thentest -d "$1/.";elsecase $1 in-*)set "./$1";;esac;case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in???[sx]*):;;*)false;;esac;fi'\'' sh'fias_executable_p=$as_test_x# Sed expression to map a string onto a valid CPP name.as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"# Sed expression to map a string onto a valid variable name.as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"exec 6>&1# Save the log message, to keep $[0] and so on meaningful, and to# report actual input values of CONFIG_FILES etc. instead of their# values after options handling.ac_log="This file was extended by onig $as_me 5.9.2, which wasgenerated by GNU Autoconf 2.61. Invocation command line wasCONFIG_FILES = $CONFIG_FILESCONFIG_HEADERS = $CONFIG_HEADERSCONFIG_LINKS = $CONFIG_LINKSCONFIG_COMMANDS = $CONFIG_COMMANDS$ $0 $@on `(hostname || uname -n) 2>/dev/null | sed 1q`"_ACEOFcat >>$CONFIG_STATUS <<_ACEOF# Files that config.status was made for.config_files="$ac_config_files"config_headers="$ac_config_headers"config_commands="$ac_config_commands"_ACEOFcat >>$CONFIG_STATUS <<\_ACEOFac_cs_usage="\\`$as_me' instantiates files from templates according to thecurrent configuration.Usage: $0 [OPTIONS] [FILE]...-h, --help print this help, then exit-V, --version print version number and configuration settings, then exit-q, --quiet do not print progress messages-d, --debug don't remove temporary files--recheck update $as_me by reconfiguring in the same conditions--file=FILE[:TEMPLATE]instantiate the configuration file FILE--header=FILE[:TEMPLATE]instantiate the configuration header FILEConfiguration files:$config_filesConfiguration headers:$config_headersConfiguration commands:$config_commandsReport bugs to <bug-autoconf@gnu.org>."_ACEOFcat >>$CONFIG_STATUS <<_ACEOFac_cs_version="\\onig config.status 5.9.2configured by $0, generated by GNU Autoconf 2.61,with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"Copyright (C) 2006 Free Software Foundation, Inc.This config.status script is free software; the Free Software Foundationgives unlimited permission to copy, distribute and modify it."ac_pwd='$ac_pwd'srcdir='$srcdir'INSTALL='$INSTALL'MKDIR_P='$MKDIR_P'_ACEOFcat >>$CONFIG_STATUS <<\_ACEOF# If no file are specified by the user, then we need to provide default# value. By we need to know if files were specified by the user.ac_need_defaults=:while test $# != 0docase $1 in--*=*)ac_option=`expr "X$1" : 'X\([^=]*\)='`ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`ac_shift=:;;*)ac_option=$1ac_optarg=$2ac_shift=shift;;esaccase $ac_option in# Handling of the options.-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)ac_cs_recheck=: ;;--version | --versio | --versi | --vers | --ver | --ve | --v | -V )echo "$ac_cs_version"; exit ;;--debug | --debu | --deb | --de | --d | -d )debug=: ;;--file | --fil | --fi | --f )$ac_shiftCONFIG_FILES="$CONFIG_FILES $ac_optarg"ac_need_defaults=false;;--header | --heade | --head | --hea )$ac_shiftCONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"ac_need_defaults=false;;--he | --h)# Conflict between --help and --header{ echo "$as_me: error: ambiguous option: $1Try \`$0 --help' for more information." >&2{ (exit 1); exit 1; }; };;--help | --hel | -h )echo "$ac_cs_usage"; exit ;;-q | -quiet | --quiet | --quie | --qui | --qu | --q \| -silent | --silent | --silen | --sile | --sil | --si | --s)ac_cs_silent=: ;;# This is an error.-*) { echo "$as_me: error: unrecognized option: $1Try \`$0 --help' for more information." >&2{ (exit 1); exit 1; }; } ;;*) ac_config_targets="$ac_config_targets $1"ac_need_defaults=false ;;esacshiftdoneac_configure_extra_args=if $ac_cs_silent; thenexec 6>/dev/nullac_configure_extra_args="$ac_configure_extra_args --silent"fi_ACEOFcat >>$CONFIG_STATUS <<_ACEOFif \$ac_cs_recheck; thenecho "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6CONFIG_SHELL=$SHELLexport CONFIG_SHELLexec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursionfi_ACEOFcat >>$CONFIG_STATUS <<\_ACEOFexec 5>>config.log{echosed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX## Running $as_me. ##_ASBOXecho "$ac_log"} >&5_ACEOFcat >>$CONFIG_STATUS <<_ACEOF## INIT-COMMANDS#AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"# The HP-UX ksh and POSIX shell print the target directory to stdout# if CDPATH is set.(unset CDPATH) >/dev/null 2>&1 && unset CDPATHsed_quote_subst='$sed_quote_subst'double_quote_subst='$double_quote_subst'delay_variable_subst='$delay_variable_subst'macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'LTCC='$LTCC'LTCFLAGS='$LTCFLAGS'compiler='$compiler_DEFAULT'# Quote evaled strings.for var in SED \GREP \EGREP \FGREP \LD \NM \LN_S \lt_SP2NL \lt_NL2SP \reload_flag \deplibs_check_method \file_magic_cmd \AR \AR_FLAGS \STRIP \RANLIB \CC \CFLAGS \compiler \lt_cv_sys_global_symbol_pipe \lt_cv_sys_global_symbol_to_cdecl \lt_cv_sys_global_symbol_to_c_name_address \lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \SHELL \ECHO \lt_prog_compiler_no_builtin_flag \lt_prog_compiler_wl \lt_prog_compiler_pic \lt_prog_compiler_static \lt_cv_prog_compiler_c_o \need_locks \DSYMUTIL \NMEDIT \LIPO \OTOOL \OTOOL64 \shrext_cmds \export_dynamic_flag_spec \whole_archive_flag_spec \compiler_needs_object \with_gnu_ld \allow_undefined_flag \no_undefined_flag \hardcode_libdir_flag_spec \hardcode_libdir_flag_spec_ld \hardcode_libdir_separator \fix_srcfile_path \exclude_expsyms \include_expsyms \file_list_spec \variables_saved_for_relink \libname_spec \library_names_spec \soname_spec \finish_eval \old_striplib \striplib; docase \`eval \\\\\$ECHO "X\\\\\$\$var"\` in*[\\\\\\\`\\"\\\$]*)eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"";;*)eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"";;esacdone# Double-quote double-evaled strings.for var in reload_cmds \old_postinstall_cmds \old_postuninstall_cmds \old_archive_cmds \extract_expsyms_cmds \old_archive_from_new_cmds \old_archive_from_expsyms_cmds \archive_cmds \archive_expsym_cmds \module_cmds \module_expsym_cmds \export_symbols_cmds \prelink_cmds \postinstall_cmds \postuninstall_cmds \finish_cmds \sys_lib_search_path_spec \sys_lib_dlsearch_path_spec; docase \`eval \\\\\$ECHO "X\\\\\$\$var"\` in*[\\\\\\\`\\"\\\$]*)eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"";;*)eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"";;esacdone# Fix-up fallback echo if it was mangled by the above quoting rules.case \$lt_ECHO in*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`;;esacac_aux_dir='$ac_aux_dir'xsi_shell='$xsi_shell'lt_shell_append='$lt_shell_append'# See if we are running on zsh, and set the options which allow our# commands through without removal of \ escapes INIT.if test -n "\${ZSH_VERSION+set}" ; thensetopt NO_GLOB_SUBSTfiPACKAGE='$PACKAGE'VERSION='$VERSION'TIMESTAMP='$TIMESTAMP'RM='$RM'ofile='$ofile'_ACEOFcat >>$CONFIG_STATUS <<\_ACEOF# Handling of arguments.for ac_config_target in $ac_config_targetsdocase $ac_config_target in"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;"onig-config") CONFIG_FILES="$CONFIG_FILES onig-config" ;;"sample/Makefile") CONFIG_FILES="$CONFIG_FILES sample/Makefile" ;;"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5echo "$as_me: error: invalid argument: $ac_config_target" >&2;}{ (exit 1); exit 1; }; };;esacdone# If the user did not use the arguments to specify the items to instantiate,# then the envvar interface is used. Set only those that are not.# We use the long form for the default assignment because of an extremely# bizarre bug on SunOS 4.1.3.if $ac_need_defaults; thentest "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_filestest "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headerstest "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commandsfi# Have a temporary directory for convenience. Make it in the build tree# simply because there is no reason against having it here, and in addition,# creating and moving files from /tmp can sometimes cause problems.# Hook for its removal unless debugging.# Note that there is a small window in which the directory will not be cleaned:# after its creation but before its name has been assigned to `$tmp'.$debug ||{tmp=trap 'exit_status=$?{ test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status' 0trap '{ (exit 1); exit 1; }' 1 2 13 15}# Create a (secure) tmp directory for tmp files.{tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&test -n "$tmp" && test -d "$tmp"} ||{tmp=./conf$$-$RANDOM(umask 077 && mkdir "$tmp")} ||{echo "$me: cannot create a temporary directory in ." >&2{ (exit 1); exit 1; }}## Set up the sed scripts for CONFIG_FILES section.## No need to generate the scripts if there are no CONFIG_FILES.# This happens for instance when ./config.status config.hif test -n "$CONFIG_FILES"; then_ACEOFac_delim='%!_!# 'for ac_last_try in false false false false false :; docat >conf$$subs.sed <<_ACEOFSHELL!$SHELL$ac_delimPATH_SEPARATOR!$PATH_SEPARATOR$ac_delimPACKAGE_NAME!$PACKAGE_NAME$ac_delimPACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delimPACKAGE_VERSION!$PACKAGE_VERSION$ac_delimPACKAGE_STRING!$PACKAGE_STRING$ac_delimPACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delimexec_prefix!$exec_prefix$ac_delimprefix!$prefix$ac_delimprogram_transform_name!$program_transform_name$ac_delimbindir!$bindir$ac_delimsbindir!$sbindir$ac_delimlibexecdir!$libexecdir$ac_delimdatarootdir!$datarootdir$ac_delimdatadir!$datadir$ac_delimsysconfdir!$sysconfdir$ac_delimsharedstatedir!$sharedstatedir$ac_delimlocalstatedir!$localstatedir$ac_delimincludedir!$includedir$ac_delimoldincludedir!$oldincludedir$ac_delimdocdir!$docdir$ac_deliminfodir!$infodir$ac_delimhtmldir!$htmldir$ac_delimdvidir!$dvidir$ac_delimpdfdir!$pdfdir$ac_delimpsdir!$psdir$ac_delimlibdir!$libdir$ac_delimlocaledir!$localedir$ac_delimmandir!$mandir$ac_delimDEFS!$DEFS$ac_delimECHO_C!$ECHO_C$ac_delimECHO_N!$ECHO_N$ac_delimECHO_T!$ECHO_T$ac_delimLIBS!$LIBS$ac_delimbuild_alias!$build_alias$ac_delimhost_alias!$host_alias$ac_delimtarget_alias!$target_alias$ac_delimINSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delimINSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delimINSTALL_DATA!$INSTALL_DATA$ac_delimam__isrc!$am__isrc$ac_delimCYGPATH_W!$CYGPATH_W$ac_delimPACKAGE!$PACKAGE$ac_delimVERSION!$VERSION$ac_delimACLOCAL!$ACLOCAL$ac_delimAUTOCONF!$AUTOCONF$ac_delimAUTOMAKE!$AUTOMAKE$ac_delimAUTOHEADER!$AUTOHEADER$ac_delimMAKEINFO!$MAKEINFO$ac_deliminstall_sh!$install_sh$ac_delimSTRIP!$STRIP$ac_delimINSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delimmkdir_p!$mkdir_p$ac_delimAWK!$AWK$ac_delimSET_MAKE!$SET_MAKE$ac_delimam__leading_dot!$am__leading_dot$ac_delimAMTAR!$AMTAR$ac_delimam__tar!$am__tar$ac_delimam__untar!$am__untar$ac_delimRUBYDIR!$RUBYDIR$ac_delimSTATISTICS!$STATISTICS$ac_delimCC!$CC$ac_delimCFLAGS!$CFLAGS$ac_delimLDFLAGS!$LDFLAGS$ac_delimCPPFLAGS!$CPPFLAGS$ac_delimac_ct_CC!$ac_ct_CC$ac_delimEXEEXT!$EXEEXT$ac_delimOBJEXT!$OBJEXT$ac_delimDEPDIR!$DEPDIR$ac_delimam__include!$am__include$ac_delimam__quote!$am__quote$ac_delimAMDEP_TRUE!$AMDEP_TRUE$ac_delimAMDEP_FALSE!$AMDEP_FALSE$ac_delimAMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delimCCDEPMODE!$CCDEPMODE$ac_delimam__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delimam__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delimLIBTOOL!$LIBTOOL$ac_delimbuild!$build$ac_delimbuild_cpu!$build_cpu$ac_delimbuild_vendor!$build_vendor$ac_delimbuild_os!$build_os$ac_delimhost!$host$ac_delimhost_cpu!$host_cpu$ac_delimhost_vendor!$host_vendor$ac_delimhost_os!$host_os$ac_delimSED!$SED$ac_delimGREP!$GREP$ac_delimEGREP!$EGREP$ac_delimFGREP!$FGREP$ac_delimLD!$LD$ac_delimDUMPBIN!$DUMPBIN$ac_delimac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delimNM!$NM$ac_delimLN_S!$LN_S$ac_delimAR!$AR$ac_delimRANLIB!$RANLIB$ac_delim_ACEOFif test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; thenbreakelif $ac_last_try; then{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}{ (exit 1); exit 1; }; }elseac_delim="$ac_delim!$ac_delim _$ac_delim!! "fidoneac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`if test -n "$ac_eof"; thenac_eof=`echo "$ac_eof" | sort -nru | sed 1q`ac_eof=`expr $ac_eof + 1`ficat >>$CONFIG_STATUS <<_ACEOFcat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof/@[a-zA-Z_][a-zA-Z_0-9]*@/!b_ACEOFsed 's/[,\\&]/\\&/g; s/@/@|#_!!_#|/gs/^/s,@/; s/!/@,|#_!!_#|/:nt ns/'"$ac_delim"'$/,g/; ts/$/\\/; pN; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n' >>$CONFIG_STATUS <conf$$subs.sedrm -f conf$$subs.sedcat >>$CONFIG_STATUS <<_ACEOFCEOF$ac_eof_ACEOFac_delim='%!_!# 'for ac_last_try in false false false false false :; docat >conf$$subs.sed <<_ACEOFlt_ECHO!$lt_ECHO$ac_delimDSYMUTIL!$DSYMUTIL$ac_delimNMEDIT!$NMEDIT$ac_delimLIPO!$LIPO$ac_delimOTOOL!$OTOOL$ac_delimOTOOL64!$OTOOL64$ac_delimCPP!$CPP$ac_delimLTVERSION!$LTVERSION$ac_delimALLOCA!$ALLOCA$ac_delimLIBOBJS!$LIBOBJS$ac_delimLTLIBOBJS!$LTLIBOBJS$ac_delim_ACEOFif test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 11; thenbreakelif $ac_last_try; then{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}{ (exit 1); exit 1; }; }elseac_delim="$ac_delim!$ac_delim _$ac_delim!! "fidoneac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`if test -n "$ac_eof"; thenac_eof=`echo "$ac_eof" | sort -nru | sed 1q`ac_eof=`expr $ac_eof + 1`ficat >>$CONFIG_STATUS <<_ACEOFcat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end_ACEOFsed 's/[,\\&]/\\&/g; s/@/@|#_!!_#|/gs/^/s,@/; s/!/@,|#_!!_#|/:nt ns/'"$ac_delim"'$/,g/; ts/$/\\/; pN; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n' >>$CONFIG_STATUS <conf$$subs.sedrm -f conf$$subs.sedcat >>$CONFIG_STATUS <<_ACEOF:ends/|#_!!_#|//gCEOF$ac_eof_ACEOF# VPATH may cause trouble with some makes, so we remove $(srcdir),# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and# trailing colons and then remove the whole line if VPATH becomes empty# (actually we leave an empty line to preserve line numbers).if test "x$srcdir" = x.; thenac_vpsub='/^[ ]*VPATH[ ]*=/{s/:*\$(srcdir):*/:/s/:*\${srcdir}:*/:/s/:*@srcdir@:*/:/s/^\([^=]*=[ ]*\):*/\1/s/:*$//s/^[^=]*=[ ]*$//}'ficat >>$CONFIG_STATUS <<\_ACEOFfi # test -n "$CONFIG_FILES"for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDSdocase $ac_tag in:[FHLC]) ac_mode=$ac_tag; continue;;esaccase $ac_mode$ac_tag in:[FHL]*:*);;:L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5echo "$as_me: error: Invalid tag $ac_tag." >&2;}{ (exit 1); exit 1; }; };;:[FH]-) ac_tag=-:-;;:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;esacac_save_IFS=$IFSIFS=:set x $ac_tagIFS=$ac_save_IFSshiftac_file=$1shiftcase $ac_mode in:L) ac_source=$1;;:[FH])ac_file_inputs=for ac_fdocase $ac_f in-) ac_f="$tmp/stdin";;*) # Look for the file first in the build tree, then in the source tree# (if the path is not absolute). The absolute path cannot be DOS-style,# because $ac_f cannot contain `:'.test -f "$ac_f" ||case $ac_f in[\\/$]*) false;;*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;esac ||{ { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5echo "$as_me: error: cannot find input file: $ac_f" >&2;}{ (exit 1); exit 1; }; };;esacac_file_inputs="$ac_file_inputs $ac_f"done# Let's still pretend it is `configure' which instantiates (i.e., don't# use $as_me), people would be surprised to read:# /* config.h. Generated by config.status. */configure_input="Generated from "`IFS=:echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."if test x"$ac_file" != x-; thenconfigure_input="$ac_file. $configure_input"{ echo "$as_me:$LINENO: creating $ac_file" >&5echo "$as_me: creating $ac_file" >&6;}ficase $ac_tag in*:-:* | *:-) cat >"$tmp/stdin";;esac;;esacac_dir=`$as_dirname -- "$ac_file" ||$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$ac_file" : 'X\(//\)[^/]' \| \X"$ac_file" : 'X\(//\)$' \| \X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||echo X"$ac_file" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`{ as_dir="$ac_dir"case $as_dir in #(-*) as_dir=./$as_dir;;esactest -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {as_dirs=while :; docase $as_dir in #(*\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(*) as_qdir=$as_dir;;esacas_dirs="'$as_qdir' $as_dirs"as_dir=`$as_dirname -- "$as_dir" ||$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$as_dir" : 'X\(//\)[^/]' \| \X"$as_dir" : 'X\(//\)$' \| \X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||echo X"$as_dir" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`test -d "$as_dir" && breakdonetest -z "$as_dirs" || eval "mkdir $as_dirs"} || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5echo "$as_me: error: cannot create directory $as_dir" >&2;}{ (exit 1); exit 1; }; }; }ac_builddir=.case "$ac_dir" in.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;*)ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`# A ".." for each directory in $ac_dir_suffix.ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`case $ac_top_builddir_sub in"") ac_top_builddir_sub=. ac_top_build_prefix= ;;*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;esac ;;esacac_abs_top_builddir=$ac_pwdac_abs_builddir=$ac_pwd$ac_dir_suffix# for backward compatibility:ac_top_builddir=$ac_top_build_prefixcase $srcdir in.) # We are building in place.ac_srcdir=.ac_top_srcdir=$ac_top_builddir_subac_abs_top_srcdir=$ac_pwd ;;[\\/]* | ?:[\\/]* ) # Absolute name.ac_srcdir=$srcdir$ac_dir_suffix;ac_top_srcdir=$srcdirac_abs_top_srcdir=$srcdir ;;*) # Relative name.ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffixac_top_srcdir=$ac_top_build_prefix$srcdirac_abs_top_srcdir=$ac_pwd/$srcdir ;;esacac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffixcase $ac_mode in:F)## CONFIG_FILE#case $INSTALL in[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;esacac_MKDIR_P=$MKDIR_Pcase $MKDIR_P in[\\/$]* | ?:[\\/]* ) ;;*/*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;esac_ACEOFcat >>$CONFIG_STATUS <<\_ACEOF# If the template does not know about datarootdir, expand it.# FIXME: This hack should be removed a few years after 2.60.ac_datarootdir_hack=; ac_datarootdir_seen=case `sed -n '/datarootdir/ {pq}/@datadir@/p/@docdir@/p/@infodir@/p/@localedir@/p/@mandir@/p' $ac_file_inputs` in*datarootdir*) ac_datarootdir_seen=yes;;*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*){ echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}_ACEOFcat >>$CONFIG_STATUS <<_ACEOFac_datarootdir_hack='s&@datadir@&$datadir&gs&@docdir@&$docdir&gs&@infodir@&$infodir&gs&@localedir@&$localedir&gs&@mandir@&$mandir&gs&\\\${datarootdir}&$datarootdir&g' ;;esac_ACEOF# Neutralize VPATH when `$srcdir' = `.'.# Shell code in configure.ac might set extrasub.# FIXME: do we really want to maintain this feature?cat >>$CONFIG_STATUS <<_ACEOFsed "$ac_vpsub$extrasub_ACEOFcat >>$CONFIG_STATUS <<\_ACEOF:t/@[a-zA-Z_][a-zA-Z_0-9]*@/!bs&@configure_input@&$configure_input&;t ts&@top_builddir@&$ac_top_builddir_sub&;t ts&@srcdir@&$ac_srcdir&;t ts&@abs_srcdir@&$ac_abs_srcdir&;t ts&@top_srcdir@&$ac_top_srcdir&;t ts&@abs_top_srcdir@&$ac_abs_top_srcdir&;t ts&@builddir@&$ac_builddir&;t ts&@abs_builddir@&$ac_abs_builddir&;t ts&@abs_top_builddir@&$ac_abs_top_builddir&;t ts&@INSTALL@&$ac_INSTALL&;t ts&@MKDIR_P@&$ac_MKDIR_P&;t t$ac_datarootdir_hack" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/outtest -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&{ echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'which seems to be undefined. Please make sure it is defined." >&5echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'which seems to be undefined. Please make sure it is defined." >&2;}rm -f "$tmp/stdin"case $ac_file in-) cat "$tmp/out"; rm -f "$tmp/out";;*) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;esac;;:H)## CONFIG_HEADER#_ACEOF# Transform confdefs.h into a sed script `conftest.defines', that# substitutes the proper values into config.h.in to produce config.h.rm -f conftest.defines conftest.tail# First, append a space to every undef/define line, to ease matching.echo 's/$/ /' >conftest.defines# Then, protect against being on the right side of a sed subst, or in# an unquoted here document, in config.status. If some macros were# called several times there might be several #defines for the same# symbol, which is useless. But do not sort them, since the last# AC_DEFINE must be honored.ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where# NAME is the cpp macro being defined, VALUE is the value it is being given.# PARAMS is the parameter list in the macro definition--in most cases, it's# just an empty string.ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'ac_dB='\\)[ (].*,\\1define\\2'ac_dC=' 'ac_dD=' ,'uniq confdefs.h |sed -n 't rset:rsets/^[ ]*#[ ]*define[ ][ ]*//t okd:oks/[\\&,]/\\&/gs/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/ps/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p' >>conftest.defines# Remove the space that was appended to ease matching.# Then replace #undef with comments. This is necessary, for# example, in the case of _POSIX_SOURCE, which is predefined and required# on some systems where configure will not decide to define it.# (The regexp can be short, since the line contains either #define or #undef.)echo 's/ $//s,^[ #]*u.*,/* & */,' >>conftest.defines# Break up conftest.defines:ac_max_sed_lines=50# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"# et cetera.ac_in='$ac_file_inputs'ac_out='"$tmp/out1"'ac_nxt='"$tmp/out2"'while :do# Write a here document:cat >>$CONFIG_STATUS <<_ACEOF# First, check the format of the line:cat >"\$tmp/defines.sed" <<\\CEOF/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b defb:def_ACEOFsed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUSecho 'CEOFsed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUSac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_insed 1,${ac_max_sed_lines}d conftest.defines >conftest.tailgrep . conftest.tail >/dev/null || breakrm -f conftest.definesmv conftest.tail conftest.definesdonerm -f conftest.defines conftest.tailecho "ac_result=$ac_in" >>$CONFIG_STATUScat >>$CONFIG_STATUS <<\_ACEOFif test x"$ac_file" != x-; thenecho "/* $configure_input */" >"$tmp/config.h"cat "$ac_result" >>"$tmp/config.h"if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5echo "$as_me: $ac_file is unchanged" >&6;}elserm -f $ac_filemv "$tmp/config.h" $ac_filefielseecho "/* $configure_input */"cat "$ac_result"firm -f "$tmp/out12"# Compute $ac_file's index in $config_headers._am_stamp_count=1for _am_header in $config_headers :; docase $_am_header in$ac_file | $ac_file:* )break ;;* )_am_stamp_count=`expr $_am_stamp_count + 1` ;;esacdoneecho "timestamp for $ac_file" >`$as_dirname -- $ac_file ||$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X$ac_file : 'X\(//\)[^/]' \| \X$ac_file : 'X\(//\)$' \| \X$ac_file : 'X\(/\)' \| . 2>/dev/null ||echo X$ac_file |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`/stamp-h$_am_stamp_count;;:C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5echo "$as_me: executing $ac_file commands" >&6;};;esaccase $ac_file$ac_mode in"depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do# Strip MF so we end up with the name of the file.mf=`echo "$mf" | sed -e 's/:.*$//'`# Check whether this is an Automake generated Makefile or not.# We used to match only the files named `Makefile.in', but# some people rename them; so instead we look at the file content.# Grep'ing the first line is not enough: some people post-process# each Makefile.in and add a new line on top of each file to say so.# Grep'ing the whole file is not good either: AIX grep has a line# limit of 2048, but all sed's we know have understand at least 4000.if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; thendirpart=`$as_dirname -- "$mf" ||$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$mf" : 'X\(//\)[^/]' \| \X"$mf" : 'X\(//\)$' \| \X"$mf" : 'X\(/\)' \| . 2>/dev/null ||echo X"$mf" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`elsecontinuefi# Extract the definition of DEPDIR, am__include, and am__quote# from the Makefile without running `make'.DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`test -z "$DEPDIR" && continueam__include=`sed -n 's/^am__include = //p' < "$mf"`test -z "am__include" && continueam__quote=`sed -n 's/^am__quote = //p' < "$mf"`# When using ansi2knr, U may be empty or an underscore; expand itU=`sed -n 's/^U = //p' < "$mf"`# Find all dependency output files, they are included files with# $(DEPDIR) in their names. We invoke sed twice because it is the# simplest approach to changing $(DEPDIR) to its actual value in the# expansion.for file in `sed -n "s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do# Make sure the directory exists.test -f "$dirpart/$file" && continuefdir=`$as_dirname -- "$file" ||$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$file" : 'X\(//\)[^/]' \| \X"$file" : 'X\(//\)$' \| \X"$file" : 'X\(/\)' \| . 2>/dev/null ||echo X"$file" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`{ as_dir=$dirpart/$fdircase $as_dir in #(-*) as_dir=./$as_dir;;esactest -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {as_dirs=while :; docase $as_dir in #(*\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(*) as_qdir=$as_dir;;esacas_dirs="'$as_qdir' $as_dirs"as_dir=`$as_dirname -- "$as_dir" ||$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$as_dir" : 'X\(//\)[^/]' \| \X"$as_dir" : 'X\(//\)$' \| \X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||echo X"$as_dir" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`test -d "$as_dir" && breakdonetest -z "$as_dirs" || eval "mkdir $as_dirs"} || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5echo "$as_me: error: cannot create directory $as_dir" >&2;}{ (exit 1); exit 1; }; }; }# echo "creating $dirpart/$file"echo '# dummy' > "$dirpart/$file"donedone;;"libtool":C)# See if we are running on zsh, and set the options which allow our# commands through without removal of \ escapes.if test -n "${ZSH_VERSION+set}" ; thensetopt NO_GLOB_SUBSTficfgfile="${ofile}T"trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15$RM -f "$cfgfile"cat <<_LT_EOF >> "$cfgfile"#! $SHELL# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:# NOTE: Changes made to this file will be lost: look at ltmain.sh.## Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,# 2006, 2007, 2008 Free Software Foundation, Inc.# Written by Gordon Matzigkeit, 1996## This file is part of GNU Libtool.## GNU Libtool is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as# published by the Free Software Foundation; either version 2 of# the License, or (at your option) any later version.## As a special exception to the GNU General Public License,# if you distribute this file as part of a program or library that# is built using GNU Libtool, you may include this file under the# same distribution terms that you use for the rest of that program.## GNU Libtool 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 General Public License for more details.## You should have received a copy of the GNU General Public License# along with GNU Libtool; see the file COPYING. If not, a copy# can be downloaded from http://www.gnu.org/licenses/gpl.html, or# obtained by writing to the Free Software Foundation, Inc.,# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.# The names of the tagged configurations supported by this script.available_tags=""# ### BEGIN LIBTOOL CONFIG# Which release of libtool.m4 was used?macro_version=$macro_versionmacro_revision=$macro_revision# Whether or not to build shared libraries.build_libtool_libs=$enable_shared# Whether or not to build static libraries.build_old_libs=$enable_static# What type of objects to build.pic_mode=$pic_mode# Whether or not to optimize for fast installation.fast_install=$enable_fast_install# The host system.host_alias=$host_aliashost=$hosthost_os=$host_os# The build system.build_alias=$build_aliasbuild=$buildbuild_os=$build_os# A sed program that does not truncate output.SED=$lt_SED# Sed that helps us avoid accidentally triggering echo(1) options like -n.Xsed="\$SED -e 1s/^X//"# A grep program that handles long lines.GREP=$lt_GREP# An ERE matcher.EGREP=$lt_EGREP# A literal string matcher.FGREP=$lt_FGREP# A BSD- or MS-compatible name lister.NM=$lt_NM# Whether we need soft or hard links.LN_S=$lt_LN_S# What is the maximum length of a command?max_cmd_len=$max_cmd_len# Object file suffix (normally "o").objext=$ac_objext# Executable file suffix (normally "").exeext=$exeext# whether the shell understands "unset".lt_unset=$lt_unset# turn spaces into newlines.SP2NL=$lt_lt_SP2NL# turn newlines into spaces.NL2SP=$lt_lt_NL2SP# How to create reloadable object files.reload_flag=$lt_reload_flagreload_cmds=$lt_reload_cmds# Method to check whether dependent libraries are shared objects.deplibs_check_method=$lt_deplibs_check_method# Command to use when deplibs_check_method == "file_magic".file_magic_cmd=$lt_file_magic_cmd# The archiver.AR=$lt_ARAR_FLAGS=$lt_AR_FLAGS# A symbol stripping program.STRIP=$lt_STRIP# Commands used to install an old-style archive.RANLIB=$lt_RANLIBold_postinstall_cmds=$lt_old_postinstall_cmdsold_postuninstall_cmds=$lt_old_postuninstall_cmds# A C compiler.LTCC=$lt_CC# LTCC compiler flags.LTCFLAGS=$lt_CFLAGS# Take the output of nm and produce a listing of raw symbols and C names.global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe# Transform the output of nm in a proper C declaration.global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl# Transform the output of nm in a C name address pair.global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address# Transform the output of nm in a C name address pair when lib prefix is needed.global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix# The name of the directory that contains temporary libtool files.objdir=$objdir# Shell to use when invoking shell scripts.SHELL=$lt_SHELL# An echo program that does not interpret backslashes.ECHO=$lt_ECHO# Used to examine libraries when file_magic_cmd begins with "file".MAGIC_CMD=$MAGIC_CMD# Must we lock files when doing compilation?need_locks=$lt_need_locks# Tool to manipulate archived DWARF debug symbol files on Mac OS X.DSYMUTIL=$lt_DSYMUTIL# Tool to change global to local symbols on Mac OS X.NMEDIT=$lt_NMEDIT# Tool to manipulate fat objects and archives on Mac OS X.LIPO=$lt_LIPO# ldd/readelf like tool for Mach-O binaries on Mac OS X.OTOOL=$lt_OTOOL# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.OTOOL64=$lt_OTOOL64# Old archive suffix (normally "a").libext=$libext# Shared library suffix (normally ".so").shrext_cmds=$lt_shrext_cmds# The commands to extract the exported symbol list from a shared archive.extract_expsyms_cmds=$lt_extract_expsyms_cmds# Variables whose values should be saved in libtool wrapper scripts and# restored at link time.variables_saved_for_relink=$lt_variables_saved_for_relink# Do we need the "lib" prefix for modules?need_lib_prefix=$need_lib_prefix# Do we need a version for libraries?need_version=$need_version# Library versioning type.version_type=$version_type# Shared library runtime path variable.runpath_var=$runpath_var# Shared library path variable.shlibpath_var=$shlibpath_var# Is shlibpath searched before the hard-coded library search path?shlibpath_overrides_runpath=$shlibpath_overrides_runpath# Format of library name prefix.libname_spec=$lt_libname_spec# List of archive names. First name is the real one, the rest are links.# The last name is the one that the linker finds with -lNAMElibrary_names_spec=$lt_library_names_spec# The coded name of the library, if different from the real name.soname_spec=$lt_soname_spec# Command to use after installation of a shared archive.postinstall_cmds=$lt_postinstall_cmds# Command to use after uninstallation of a shared archive.postuninstall_cmds=$lt_postuninstall_cmds# Commands used to finish a libtool library installation in a directory.finish_cmds=$lt_finish_cmds# As "finish_cmds", except a single script fragment to be evaled but# not shown.finish_eval=$lt_finish_eval# Whether we should hardcode library paths into libraries.hardcode_into_libs=$hardcode_into_libs# Compile-time system search path for libraries.sys_lib_search_path_spec=$lt_sys_lib_search_path_spec# Run-time system search path for libraries.sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec# Whether dlopen is supported.dlopen_support=$enable_dlopen# Whether dlopen of programs is supported.dlopen_self=$enable_dlopen_self# Whether dlopen of statically linked programs is supported.dlopen_self_static=$enable_dlopen_self_static# Commands to strip libraries.old_striplib=$lt_old_striplibstriplib=$lt_striplib# The linker used to build libraries.LD=$lt_LD# Commands used to build an old-style archive.old_archive_cmds=$lt_old_archive_cmds# A language specific compiler.CC=$lt_compiler# Is the compiler the GNU compiler?with_gcc=$GCC# Compiler flag to turn off builtin functions.no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag# How to pass a linker flag through the compiler.wl=$lt_lt_prog_compiler_wl# Additional compiler flags for building library objects.pic_flag=$lt_lt_prog_compiler_pic# Compiler flag to prevent dynamic linking.link_static_flag=$lt_lt_prog_compiler_static# Does compiler simultaneously support -c and -o options?compiler_c_o=$lt_lt_cv_prog_compiler_c_o# Whether or not to add -lc for building shared libraries.build_libtool_need_lc=$archive_cmds_need_lc# Whether or not to disallow shared libs when runtime libs are static.allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes# Compiler flag to allow reflexive dlopens.export_dynamic_flag_spec=$lt_export_dynamic_flag_spec# Compiler flag to generate shared objects directly from archives.whole_archive_flag_spec=$lt_whole_archive_flag_spec# Whether the compiler copes with passing no objects directly.compiler_needs_object=$lt_compiler_needs_object# Create an old-style archive from a shared archive.old_archive_from_new_cmds=$lt_old_archive_from_new_cmds# Create a temporary old-style archive to link instead of a shared archive.old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds# Commands used to build a shared archive.archive_cmds=$lt_archive_cmdsarchive_expsym_cmds=$lt_archive_expsym_cmds# Commands used to build a loadable module if different from building# a shared archive.module_cmds=$lt_module_cmdsmodule_expsym_cmds=$lt_module_expsym_cmds# Whether we are building with GNU ld or not.with_gnu_ld=$lt_with_gnu_ld# Flag that allows shared libraries with undefined symbols to be built.allow_undefined_flag=$lt_allow_undefined_flag# Flag that enforces no undefined symbols.no_undefined_flag=$lt_no_undefined_flag# Flag to hardcode \$libdir into a binary during linking.# This must work even if \$libdir does not existhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec# If ld is used when linking, flag to hardcode \$libdir into a binary# during linking. This must work even if \$libdir does not exist.hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld# Whether we need a single "-rpath" flag with a separated argument.hardcode_libdir_separator=$lt_hardcode_libdir_separator# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes# DIR into the resulting binary.hardcode_direct=$hardcode_direct# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes# DIR into the resulting binary and the resulting library dependency is# "absolute",i.e impossible to change by setting \${shlibpath_var} if the# library is relocated.hardcode_direct_absolute=$hardcode_direct_absolute# Set to "yes" if using the -LDIR flag during linking hardcodes DIR# into the resulting binary.hardcode_minus_L=$hardcode_minus_L# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR# into the resulting binary.hardcode_shlibpath_var=$hardcode_shlibpath_var# Set to "yes" if building a shared library automatically hardcodes DIR# into the library and all subsequent libraries and executables linked# against it.hardcode_automatic=$hardcode_automatic# Set to yes if linker adds runtime paths of dependent libraries# to runtime path list.inherit_rpath=$inherit_rpath# Whether libtool must link a program against all its dependency libraries.link_all_deplibs=$link_all_deplibs# Fix the shell variable \$srcfile for the compiler.fix_srcfile_path=$lt_fix_srcfile_path# Set to "yes" if exported symbols are required.always_export_symbols=$always_export_symbols# The commands to list exported symbols.export_symbols_cmds=$lt_export_symbols_cmds# Symbols that should not be listed in the preloaded symbols.exclude_expsyms=$lt_exclude_expsyms# Symbols that must always be exported.include_expsyms=$lt_include_expsyms# Commands necessary for linking programs (against libraries) with templates.prelink_cmds=$lt_prelink_cmds# Specify filename containing input files.file_list_spec=$lt_file_list_spec# How to hardcode a shared library path into an executable.hardcode_action=$hardcode_action# ### END LIBTOOL CONFIG_LT_EOFcase $host_os inaix3*)cat <<\_LT_EOF >> "$cfgfile"# AIX sometimes has problems with the GCC collect2 program. For some# reason, if we set the COLLECT_NAMES environment variable, the problems# vanish in a puff of smoke.if test "X${COLLECT_NAMES+set}" != Xset; thenCOLLECT_NAMES=export COLLECT_NAMESfi_LT_EOF;;esacltmain="$ac_aux_dir/ltmain.sh"# We use sed instead of cat because bash on DJGPP gets confused if# if finds mixed CR/LF and LF-only lines. Since sed operates in# text mode, it properly converts lines to CR/LF. This bash problem# is reportedly fixed, but why not run on old versions too?sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \|| (rm -f "$cfgfile"; exit 1)case $xsi_shell inyes)cat << \_LT_EOF >> "$cfgfile"# func_dirname file append nondir_replacement# Compute the dirname of FILE. If nonempty, add APPEND to the result,# otherwise set result to NONDIR_REPLACEMENT.func_dirname (){case ${1} in*/*) func_dirname_result="${1%/*}${2}" ;;* ) func_dirname_result="${3}" ;;esac}# func_basename filefunc_basename (){func_basename_result="${1##*/}"}# func_dirname_and_basename file append nondir_replacement# perform func_basename and func_dirname in a single function# call:# dirname: Compute the dirname of FILE. If nonempty,# add APPEND to the result, otherwise set result# to NONDIR_REPLACEMENT.# value returned in "$func_dirname_result"# basename: Compute filename of FILE.# value retuned in "$func_basename_result"# Implementation must be kept synchronized with func_dirname# and func_basename. For efficiency, we do not delegate to# those functions but instead duplicate the functionality here.func_dirname_and_basename (){case ${1} in*/*) func_dirname_result="${1%/*}${2}" ;;* ) func_dirname_result="${3}" ;;esacfunc_basename_result="${1##*/}"}# func_stripname prefix suffix name# strip PREFIX and SUFFIX off of NAME.# PREFIX and SUFFIX must not contain globbing or regex special# characters, hashes, percent signs, but SUFFIX may contain a leading# dot (in which case that matches only a dot).func_stripname (){# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are# positional parameters, so assign one to ordinary parameter first.func_stripname_result=${3}func_stripname_result=${func_stripname_result#"${1}"}func_stripname_result=${func_stripname_result%"${2}"}}# func_opt_splitfunc_opt_split (){func_opt_split_opt=${1%%=*}func_opt_split_arg=${1#*=}}# func_lo2o objectfunc_lo2o (){case ${1} in*.lo) func_lo2o_result=${1%.lo}.${objext} ;;*) func_lo2o_result=${1} ;;esac}# func_xform libobj-or-sourcefunc_xform (){func_xform_result=${1%.*}.lo}# func_arith arithmetic-term...func_arith (){func_arith_result=$(( $* ))}# func_len string# STRING may not start with a hyphen.func_len (){func_len_result=${#1}}_LT_EOF;;*) # Bourne compatible functions.cat << \_LT_EOF >> "$cfgfile"# func_dirname file append nondir_replacement# Compute the dirname of FILE. If nonempty, add APPEND to the result,# otherwise set result to NONDIR_REPLACEMENT.func_dirname (){# Extract subdirectory from the argument.func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`if test "X$func_dirname_result" = "X${1}"; thenfunc_dirname_result="${3}"elsefunc_dirname_result="$func_dirname_result${2}"fi}# func_basename filefunc_basename (){func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`}# func_stripname prefix suffix name# strip PREFIX and SUFFIX off of NAME.# PREFIX and SUFFIX must not contain globbing or regex special# characters, hashes, percent signs, but SUFFIX may contain a leading# dot (in which case that matches only a dot).# func_strip_suffix prefix namefunc_stripname (){case ${2} in.*) func_stripname_result=`$ECHO "X${3}" \| $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;*) func_stripname_result=`$ECHO "X${3}" \| $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;esac}# sed scripts:my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'my_sed_long_arg='1s/^-[^=]*=//'# func_opt_splitfunc_opt_split (){func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`}# func_lo2o objectfunc_lo2o (){func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`}# func_xform libobj-or-sourcefunc_xform (){func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`}# func_arith arithmetic-term...func_arith (){func_arith_result=`expr "$@"`}# func_len string# STRING may not start with a hyphen.func_len (){func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`}_LT_EOFesaccase $lt_shell_append inyes)cat << \_LT_EOF >> "$cfgfile"# func_append var value# Append VALUE to the end of shell variable VAR.func_append (){eval "$1+=\$2"}_LT_EOF;;*)cat << \_LT_EOF >> "$cfgfile"# func_append var value# Append VALUE to the end of shell variable VAR.func_append (){eval "$1=\$$1\$2"}_LT_EOF;;esacsed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \|| (rm -f "$cfgfile"; exit 1)mv -f "$cfgfile" "$ofile" ||(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")chmod +x "$ofile";;"default":C) chmod +x onig-config ;;esacdone # for ac_tag{ (exit 0); exit 0; }_ACEOFchmod +x $CONFIG_STATUSac_clean_files=$ac_clean_files_save# configure is writing to config.log, and then calls config.status.# config.status does its own redirection, appending to config.log.# Unfortunately, on DOS this fails, as config.log is still kept open# by configure, so config.status won't be able to write to it; its# output is simply discarded. So we exec the FD to /dev/null,# effectively closing config.log, so it can be properly (re)opened and# appended to by config.status. When coming back to configure, we# need to make the FD available again.if test "$no_create" != yes; thenac_cs_success=:ac_config_status_args=test "$silent" = yes &&ac_config_status_args="$ac_config_status_args --quiet"exec 5>/dev/null$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=falseexec 5>>config.log# Use ||, not &&, to avoid exiting from the if with $? = 1, which# would make configure fail if this is the last instruction.$ac_cs_success || { (exit 1); exit 1; }fi
dnl Process this file with autoconf to produce a configure script.AC_INIT(onig, 5.9.2)AM_INIT_AUTOMAKEAC_CONFIG_HEADER(config.h)dnl default value for RUBYDIRRUBYDIR=".."AC_ARG_WITH(rubydir,[ --with-rubydir=RUBYDIR specify value for RUBYDIR (default ..)],[ RUBYDIR=$withval ])AC_SUBST(RUBYDIR)dnl default value for STATISTICSSTATISTICS=""AC_ARG_WITH(statistics,[ --with-statistics take matching time statistical data],[ STATISTICS=-DONIG_DEBUG_STATISTICS ])AC_SUBST(STATISTICS)dnl check for COMBINATION_EXPLOSIONAC_ARG_ENABLE(combination-explosion-check,[ --enable-combination-explosion-check enable combination explosion check],[comb_expl_check=$enableval])if test $comb_expl_check = yes; thenAC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check])fidnl check for CRNL_AS_LINE_TERMINATORAC_ARG_ENABLE(crnl-as-line-terminator,[ --enable-crnl-as-line-terminator enable CR+NL as line terminator],[crnl_as_line_terminator=$enableval])if test $crnl_as_line_terminator = yes; thenAC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator])fidnl Checks for programs.AC_PROG_CCAM_PROG_LIBTOOLLTVERSION="2:0:0"AC_SUBST(LTVERSION)AC_PROG_INSTALLAC_PROG_MAKE_SETdnl Checks for libraries.dnl Checks for header files.AC_HEADER_STDCAC_CHECK_HEADERS(stdlib.h string.h strings.h sys/time.h unistd.h sys/times.h)dnl Checks for typedefs, structures, and compiler characteristics.AC_CHECK_SIZEOF(int, 4)AC_CHECK_SIZEOF(short, 2)AC_CHECK_SIZEOF(long, 4)AC_C_CONSTAC_HEADER_TIMEdnl Checks for library functions.AC_FUNC_ALLOCAAC_FUNC_MEMCMPAC_CACHE_CHECK(for prototypes, cv_have_prototypes,[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],cv_have_prototypes=yes,cv_have_prototypes=no)])if test "$cv_have_prototypes" = yes; thenAC_DEFINE(HAVE_PROTOTYPES,1,[Define if compilerr supports prototypes])fiAC_CACHE_CHECK(for variable length prototypes and stdarg.h, cv_stdarg,[AC_TRY_COMPILE([#include <stdarg.h>int foo(int x, ...) {va_list va;va_start(va, x);va_arg(va, int);va_arg(va, char *);va_arg(va, double);return 0;}], [return foo(10, "", 3.14);],cv_stdarg=yes,cv_stdarg=no)])if test "$cv_stdarg" = yes; thenAC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])fiAC_OUTPUT([Makefile onig-config sample/Makefile], [chmod +x onig-config])
#! /bin/sh# depcomp - compile a program generating dependencies as side-effectsscriptversion=2006-10-15.18# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software# Foundation, Inc.# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.# This program 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 General Public License for more details.# You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA# 02110-1301, USA.# As a special exception to the GNU General Public License, if you# distribute this file as part of a program that contains a# configuration script generated by Autoconf, you may include it under# the same distribution terms that you use for the rest of that program.# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.case $1 in'')echo "$0: No command. Try \`$0 --help' for more information." 1>&2exit 1;;;-h | --h*)cat <<\EOFUsage: depcomp [--help] [--version] PROGRAM [ARGS]Run PROGRAMS ARGS to compile a file, generating dependenciesas side-effects.Environment variables:depmode Dependency tracking mode.source Source file read by `PROGRAMS ARGS'.object Object file output by `PROGRAMS ARGS'.DEPDIR directory where to store dependencies.depfile Dependency file to output.tmpdepfile Temporary file to use when outputing dependencies.libtool Whether libtool is used (yes/no).Report bugs to <bug-automake@gnu.org>.EOFexit $?;;-v | --v*)echo "depcomp $scriptversion"exit $?;;esacif test -z "$depmode" || test -z "$source" || test -z "$object"; thenecho "depcomp: Variables source, object and depmode must be set" 1>&2exit 1fi# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.depfile=${depfile-`echo "$object" |sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}rm -f "$tmpdepfile"# Some modes work just like other modes, but use different flags. We# parameterize here, but still list the modes in the big case below,# to make depend.m4 easier to write. Note that we *cannot* use a case# here, because this file can only contain one case statement.if test "$depmode" = hp; then# HP compiler uses -M and no extra arg.gccflag=-Mdepmode=gccfiif test "$depmode" = dashXmstdout; then# This is just like dashmstdout with a different argument.dashmflag=-xMdepmode=dashmstdoutficase "$depmode" ingcc3)## gcc 3 implements dependency tracking that does exactly what## we want. Yay! Note: for some reason libtool 1.4 doesn't like## it if -MD -MP comes after the -MF stuff. Hmm.## Unfortunately, FreeBSD c89 acceptance of flags depends upon## the command line argument order; so add the flags where they## appear in depend2.am. Note that the slowdown incurred here## affects only configure: in makefiles, %FASTDEP% shortcuts this.for argdocase $arg in-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;*) set fnord "$@" "$arg" ;;esacshift # fnordshift # $argdone"$@"stat=$?if test $stat -eq 0; then :elserm -f "$tmpdepfile"exit $statfimv "$tmpdepfile" "$depfile";;gcc)## There are various ways to get dependency output from gcc. Here's## why we pick this rather obscure method:## - Don't want to use -MD because we'd like the dependencies to end## up in a subdir. Having to rename by hand is ugly.## (We might end up doing this anyway to support other compilers.)## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like## -MM, not -M (despite what the docs say).## - Using -M directly means running the compiler twice (even worse## than renaming).if test -z "$gccflag"; thengccflag=-MD,fi"$@" -Wp,"$gccflag$tmpdepfile"stat=$?if test $stat -eq 0; then :elserm -f "$tmpdepfile"exit $statfirm -f "$depfile"echo "$object : \\" > "$depfile"alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz## The second -e expression handles DOS-style file names with drive letters.sed -e 's/^[^:]*: / /' \-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"## This next piece of magic avoids the `deleted header file' problem.## The problem is that when a header file which appears in a .P file## is deleted, the dependency causes make to die (because there is## typically no way to rebuild the header). We avoid this by adding## dummy dependencies for each header file. Too bad gcc doesn't do## this for us directly.tr ' ' '' < "$tmpdepfile" |## Some versions of gcc put a space before the `:'. On the theory## that the space means something, we add a space to the output as## well.## Some versions of the HPUX 10.20 sed can't process this invocation## correctly. Breaking it into two sed invocations is a workaround.sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"rm -f "$tmpdepfile";;hp)# This case exists only to let depend.m4 do its work. It works by# looking at the text of this script. This case will never be run,# since it is checked for above.exit 1;;sgi)if test "$libtool" = yes; then"$@" "-Wp,-MDupdate,$tmpdepfile"else"$@" -MDupdate "$tmpdepfile"fistat=$?if test $stat -eq 0; then :elserm -f "$tmpdepfile"exit $statfirm -f "$depfile"if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other filesecho "$object : \\" > "$depfile"# Clip off the initial element (the dependent). Don't try to be# clever and replace this with sed code, as IRIX sed won't handle# lines with more than a fixed number of characters (4096 in# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;# the IRIX cc adds comments like `#:fec' to the end of the# dependency line.tr ' ' '' < "$tmpdepfile" \| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \tr '' ' ' >> $depfileecho >> $depfile# The second pass generates a dummy entry for each header file.tr ' ' '' < "$tmpdepfile" \| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \>> $depfileelse# The sourcefile does not contain any dependencies, so just# store a dummy comment line, to avoid errors with the Makefile# "include basename.Plo" scheme.echo "#dummy" > "$depfile"firm -f "$tmpdepfile";;aix)# The C for AIX Compiler uses -M and outputs the dependencies# in a .u file. In older versions, this file always lives in the# current directory. Also, the AIX compiler puts `$object:' at the# start of each line; $object doesn't have directory information.# Version 6 uses the directory in both cases.stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`tmpdepfile="$stripped.u"if test "$libtool" = yes; then"$@" -Wc,-Melse"$@" -Mfistat=$?if test -f "$tmpdepfile"; then :elsestripped=`echo "$stripped" | sed 's,^.*/,,'`tmpdepfile="$stripped.u"fiif test $stat -eq 0; then :elserm -f "$tmpdepfile"exit $statfiif test -f "$tmpdepfile"; thenoutname="$stripped.o"# Each line is of the form `foo.o: dependent.h'.# Do two passes, one to just change these to# `$object: dependent.h' and one to simply `dependent.h:'.sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"else# The sourcefile does not contain any dependencies, so just# store a dummy comment line, to avoid errors with the Makefile# "include basename.Plo" scheme.echo "#dummy" > "$depfile"firm -f "$tmpdepfile";;icc)# Intel's C compiler understands `-MD -MF file'. However on# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c# ICC 7.0 will fill foo.d with something like# foo.o: sub/foo.c# foo.o: sub/foo.h# which is wrong. We want:# sub/foo.o: sub/foo.c# sub/foo.o: sub/foo.h# sub/foo.c:# sub/foo.h:# ICC 7.1 will output# foo.o: sub/foo.c sub/foo.h# and will wrap long lines using \ :# foo.o: sub/foo.c ... \# sub/foo.h ... \# ..."$@" -MD -MF "$tmpdepfile"stat=$?if test $stat -eq 0; then :elserm -f "$tmpdepfile"exit $statfirm -f "$depfile"# Each line is of the form `foo.o: dependent.h',# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.# Do two passes, one to just change these to# `$object: dependent.h' and one to simply `dependent.h:'.sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"# Some versions of the HPUX 10.20 sed can't process this invocation# correctly. Breaking it into two sed invocations is a workaround.sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |sed -e 's/$/ :/' >> "$depfile"rm -f "$tmpdepfile";;hp2)# The "hp" stanza above does not work with aCC (C++) and HP's ia64# compilers, which have integrated preprocessors. The correct option# to use with these is +Maked; it writes dependencies to a file named# 'foo.d', which lands next to the object file, wherever that# happens to be.# Much of this is similar to the tru64 case; see comments there.dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`test "x$dir" = "x$object" && dir=base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`if test "$libtool" = yes; thentmpdepfile1=$dir$base.dtmpdepfile2=$dir.libs/$base.d"$@" -Wc,+Makedelsetmpdepfile1=$dir$base.dtmpdepfile2=$dir$base.d"$@" +Makedfistat=$?if test $stat -eq 0; then :elserm -f "$tmpdepfile1" "$tmpdepfile2"exit $statfifor tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"dotest -f "$tmpdepfile" && breakdoneif test -f "$tmpdepfile"; thensed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"# Add `dependent.h:' lines.sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"elseecho "#dummy" > "$depfile"firm -f "$tmpdepfile" "$tmpdepfile2";;tru64)# The Tru64 compiler uses -MD to generate dependencies as a side# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put# dependencies in `foo.d' instead, so we check for that too.# Subdirectories are respected.dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`test "x$dir" = "x$object" && dir=base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`if test "$libtool" = yes; then# With Tru64 cc, shared objects can also be used to make a# static library. This mechanism is used in libtool 1.4 series to# handle both shared and static libraries in a single compilation.# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.## With libtool 1.5 this exception was removed, and libtool now# generates 2 separate objects for the 2 libraries. These two# compilations output dependencies in $dir.libs/$base.o.d and# in $dir$base.o.d. We have to check for both files, because# one of the two compilations can be disabled. We should prefer# $dir$base.o.d over $dir.libs/$base.o.d because the latter is# automatically cleaned when .libs/ is deleted, while ignoring# the former would cause a distcleancheck panic.tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4tmpdepfile2=$dir$base.o.d # libtool 1.5tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504"$@" -Wc,-MDelsetmpdepfile1=$dir$base.o.dtmpdepfile2=$dir$base.dtmpdepfile3=$dir$base.dtmpdepfile4=$dir$base.d"$@" -MDfistat=$?if test $stat -eq 0; then :elserm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"exit $statfifor tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"dotest -f "$tmpdepfile" && breakdoneif test -f "$tmpdepfile"; thensed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"# That's a tab and a space in the [].sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"elseecho "#dummy" > "$depfile"firm -f "$tmpdepfile";;#nosideeffect)# This comment above is used by automake to tell side-effect# dependency tracking mechanisms from slower ones.dashmstdout)# Important note: in order to support this mode, a compiler *must*# always write the preprocessed file to stdout, regardless of -o."$@" || exit $?# Remove the call to Libtool.if test "$libtool" = yes; thenwhile test $1 != '--mode=compile'; doshiftdoneshiftfi# Remove `-o $object'.IFS=" "for argdocase $arg in-o)shift;;$object)shift;;*)set fnord "$@" "$arg"shift # fnordshift # $arg;;esacdonetest -z "$dashmflag" && dashmflag=-M# Require at least two characters before searching for `:'# in the target name. This is to cope with DOS-style filenames:# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise."$@" $dashmflag |sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"rm -f "$depfile"cat < "$tmpdepfile" > "$depfile"tr ' ' '' < "$tmpdepfile" | \## Some versions of the HPUX 10.20 sed can't process this invocation## correctly. Breaking it into two sed invocations is a workaround.sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"rm -f "$tmpdepfile";;dashXmstdout)# This case only exists to satisfy depend.m4. It is never actually# run, as this mode is specially recognized in the preamble.exit 1;;makedepend)"$@" || exit $?# Remove any Libtool callif test "$libtool" = yes; thenwhile test $1 != '--mode=compile'; doshiftdoneshiftfi# X makedependshiftcleared=nofor arg in "$@"; docase $cleared inno)set ""; shiftcleared=yes ;;esaccase "$arg" in-D*|-I*)set fnord "$@" "$arg"; shift ;;# Strip any option that makedepend may not understand. Remove# the object too, otherwise makedepend will parse it as a source file.-*|$object);;*)set fnord "$@" "$arg"; shift ;;esacdoneobj_suffix="`echo $object | sed 's/^.*\././'`"touch "$tmpdepfile"${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"rm -f "$depfile"cat < "$tmpdepfile" > "$depfile"sed '1,2d' "$tmpdepfile" | tr ' ' '' | \## Some versions of the HPUX 10.20 sed can't process this invocation## correctly. Breaking it into two sed invocations is a workaround.sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"rm -f "$tmpdepfile" "$tmpdepfile".bak;;cpp)# Important note: in order to support this mode, a compiler *must*# always write the preprocessed file to stdout."$@" || exit $?# Remove the call to Libtool.if test "$libtool" = yes; thenwhile test $1 != '--mode=compile'; doshiftdoneshiftfi# Remove `-o $object'.IFS=" "for argdocase $arg in-o)shift;;$object)shift;;*)set fnord "$@" "$arg"shift # fnordshift # $arg;;esacdone"$@" -E |sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |sed '$ s: \\$::' > "$tmpdepfile"rm -f "$depfile"echo "$object : \\" > "$depfile"cat < "$tmpdepfile" >> "$depfile"sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"rm -f "$tmpdepfile";;msvisualcpp)# Important note: in order to support this mode, a compiler *must*# always write the preprocessed file to stdout, regardless of -o,# because we must use -o when running libtool."$@" || exit $?IFS=" "for argdocase "$arg" in"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")set fnord "$@"shiftshift;;*)set fnord "$@" "$arg"shiftshift;;esacdone"$@" -E |sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"rm -f "$depfile"echo "$object : \\" > "$depfile". "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"echo " " >> "$depfile". "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"rm -f "$tmpdepfile";;none)exec "$@";;*)echo "Unknown depmode $depmode" 1>&2exit 1;;esacexit 0# Local Variables:# mode: shell-script# sh-indentation: 2# eval: (add-hook 'write-file-hooks 'time-stamp)# time-stamp-start: "scriptversion="# time-stamp-format: "%:y-%02m-%02d.%02H"# time-stamp-end: "$"# End:
Oniguruma API Version 5.9.2 2008/02/19#include <oniguruma.h># int onig_init(void)Initialize library.You don't have to call it explicitly, because it is called in onig_new().# int onig_error_code_to_str(UChar* err_buf, int err_code, ...)Get error message string.If this function is used for onig_new(),don't call this after the pattern argument of onig_new() is freed.normal return: error message string lengtharguments1 err_buf: error message string buffer.(required size: ONIG_MAX_ERROR_MESSAGE_LEN)2 err_code: error code returned by other API functions.3 err_info (optional): error info returned by onig_new().# void onig_set_warn_func(OnigWarnFunc func)Set warning function.WARNING:'[', '-', ']' in character class without escape.']' in pattern without escape.arguments1 func: function pointer. void (*func)(char* warning_message)# void onig_set_verb_warn_func(OnigWarnFunc func)Set verbose warning function.WARNING:redundant nested repeat operator.arguments1 func: function pointer. void (*func)(char* warning_message)# int onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,OnigErrorInfo* err_info)Create a regex object.normal return: ONIG_NORMALarguments1 reg: return regex object's address.2 pattern: regex pattern string.3 pattern_end: terminate address of pattern. (pattern + pattern length)4 option: compile time options.ONIG_OPTION_NONE no optionONIG_OPTION_SINGLELINE '^' -> '\A', '$' -> '\Z'ONIG_OPTION_MULTILINE '.' match with newlineONIG_OPTION_IGNORECASE ambiguity match onONIG_OPTION_EXTEND extended pattern formONIG_OPTION_FIND_LONGEST find longest matchONIG_OPTION_FIND_NOT_EMPTY ignore empty matchONIG_OPTION_NEGATE_SINGLELINEclear ONIG_OPTION_SINGLELINE which is enabled onONIG_SYNTAX_POSIX_BASIC, ONIG_SYNTAX_POSIX_EXTENDED,ONIG_SYNTAX_PERL, ONIG_SYNTAX_PERL_NG, ONIG_SYNTAX_JAVAONIG_OPTION_DONT_CAPTURE_GROUP only named group captured.ONIG_OPTION_CAPTURE_GROUP named and no-named group captured.5 enc: character encoding.ONIG_ENCODING_ASCII ASCIIONIG_ENCODING_ISO_8859_1 ISO 8859-1ONIG_ENCODING_ISO_8859_2 ISO 8859-2ONIG_ENCODING_ISO_8859_3 ISO 8859-3ONIG_ENCODING_ISO_8859_4 ISO 8859-4ONIG_ENCODING_ISO_8859_5 ISO 8859-5ONIG_ENCODING_ISO_8859_6 ISO 8859-6ONIG_ENCODING_ISO_8859_7 ISO 8859-7ONIG_ENCODING_ISO_8859_8 ISO 8859-8ONIG_ENCODING_ISO_8859_9 ISO 8859-9ONIG_ENCODING_ISO_8859_10 ISO 8859-10ONIG_ENCODING_ISO_8859_11 ISO 8859-11ONIG_ENCODING_ISO_8859_13 ISO 8859-13ONIG_ENCODING_ISO_8859_14 ISO 8859-14ONIG_ENCODING_ISO_8859_15 ISO 8859-15ONIG_ENCODING_ISO_8859_16 ISO 8859-16ONIG_ENCODING_UTF8 UTF-8ONIG_ENCODING_UTF16_BE UTF-16BEONIG_ENCODING_UTF16_LE UTF-16LEONIG_ENCODING_UTF32_BE UTF-32BEONIG_ENCODING_UTF32_LE UTF-32LEONIG_ENCODING_EUC_JP EUC-JPONIG_ENCODING_EUC_TW EUC-TWONIG_ENCODING_EUC_KR EUC-KRONIG_ENCODING_EUC_CN EUC-CNONIG_ENCODING_SJIS Shift_JISONIG_ENCODING_KOI8_R KOI8-RONIG_ENCODING_CP1251 CP1251ONIG_ENCODING_BIG5 Big5ONIG_ENCODING_GB18030 GB18030or any OnigEncodingType data address defined by user.6 syntax: address of pattern syntax definition.ONIG_SYNTAX_ASIS plain textONIG_SYNTAX_POSIX_BASIC POSIX Basic REONIG_SYNTAX_POSIX_EXTENDED POSIX Extended REONIG_SYNTAX_EMACS EmacsONIG_SYNTAX_GREP grepONIG_SYNTAX_GNU_REGEX GNU regexONIG_SYNTAX_JAVA Java (Sun java.util.regex)ONIG_SYNTAX_PERL PerlONIG_SYNTAX_PERL_NG Perl + named groupONIG_SYNTAX_RUBY RubyONIG_SYNTAX_DEFAULT default (== Ruby)onig_set_default_syntax()or any OnigSyntaxType data address defined by user.7 err_info: address for return optional error info.Use this value as 3rd argument of onig_error_code_to_str().# int onig_new_without_alloc(regex_t* reg, const UChar* pattern,const UChar* pattern_end,OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,OnigErrorInfo* err_info)Create a regex object.reg object area is not allocated in this function.normal return: ONIG_NORMAL# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,OnigCompileInfo* ci, OnigErrorInfo* einfo)Create a regex object.This function is deluxe version of onig_new().normal return: ONIG_NORMALarguments1 reg: return address of regex object.2 pattern: regex pattern string.3 pattern_end: terminate address of pattern. (pattern + pattern length)4 ci: compile time info.ci->num_of_elements: number of elements in ci. (current version: 5)ci->pattern_enc: pattern string character encoding.ci->target_enc: target string character encoding.ci->syntax: address of pattern syntax definition.ci->option: compile time option.ci->case_fold_flag: character matching case fold bit flag forONIG_OPTION_IGNORECASE mode.ONIGENC_CASE_FOLD_MIN: minimumONIGENC_CASE_FOLD_DEFAULT: minimumonig_set_default_case_fold_flag()5 err_info: address for return optional error info.Use this value as 3rd argument of onig_error_code_to_str().Different character encoding combination is allowed forthe following cases only.pattern_enc: ASCII, ISO_8859_1target_enc: UTF16_BE, UTF16_LE, UTF32_BE, UTF32_LEpattern_enc: UTF16_BE/LEtarget_enc: UTF16_LE/BEpattern_enc: UTF32_BE/LEtarget_enc: UTF32_LE/BE# void onig_free(regex_t* reg)Free memory used by regex object.arguments1 reg: regex object.# void onig_free_body(regex_t* reg)Free memory used by regex object. (Except reg oneself.)arguments1 reg: regex object.# int onig_search(regex_t* reg, const UChar* str, const UChar* end, const UChar* start,const UChar* range, OnigRegion* region, OnigOptionType option)Search string and return search result and matching region.normal return: match position offset (i.e. p - str >= 0)not found: ONIG_MISMATCH (< 0)arguments1 reg: regex object2 str: target string3 end: terminate address of target string4 start: search start address of target string5 range: search terminate address of target stringin forward search (start <= searched string < range)in backward search (range <= searched string <= start)6 region: address for return group match range info (NULL is allowed)7 option: search time optionONIG_OPTION_NOTBOL string head(str) isn't considered as begin of lineONIG_OPTION_NOTEOL string end (end) isn't considered as end of lineONIG_OPTION_POSIX_REGION region argument is regmatch_t[] of POSIX API.# int onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at,OnigRegion* region, OnigOptionType option)Match string and return result and matching region.normal return: match length (>= 0)not match: ONIG_MISMATCH ( < 0)arguments1 reg: regex object2 str: target string3 end: terminate address of target string4 at: match address of target string5 region: address for return group match range info (NULL is allowed)6 option: search time optionONIG_OPTION_NOTBOL string head(str) isn't considered as begin of lineONIG_OPTION_NOTEOL string end (end) isn't considered as end of lineONIG_OPTION_POSIX_REGION region argument is regmatch_t[] type of POSIX API.# OnigRegion* onig_region_new(void)Create a region.# void onig_region_free(OnigRegion* region, int free_self)Free memory used by region.arguments1 region: target region2 free_self: [1: free all, 0: free memory used in region but not self]# void onig_region_copy(OnigRegion* to, OnigRegion* from)Copy contents of region.arguments1 to: target region2 from: source region# void onig_region_clear(OnigRegion* region)Clear contents of region.arguments1 region: target region# int onig_region_resize(OnigRegion* region, int n)Resize group range area of region.normal return: ONIG_NORMALarguments1 region: target region2 n: new size# int onig_name_to_group_numbers(regex_t* reg, const UChar* name, const UChar* name_end,int** num_list)Return the group number list of the name.Named subexp is defined by (?<name>....).normal return: number of groups for the name.(ex. /(?<x>..)(?<x>..)/ ==> 2)name not found: -1arguments1 reg: regex object.2 name: group name.3 name_end: terminate address of group name.4 num_list: return list of group number.# int onig_name_to_backref_number(regex_t* reg, const UChar* name, const UChar* name_end,OnigRegion *region)Return the group number corresponding to the named backref (\k<name>).If two or more regions for the groups of the name are effective,the greatest number in it is obtained.normal return: group number.arguments1 reg: regex object.2 name: group name.3 name_end: terminate address of group name.4 region: search/match result region.# int onig_foreach_name(regex_t* reg,int (*func)(const UChar*, const UChar*, int,int*,regex_t*,void*),void* arg)Iterate function call for all names.normal return: 0error: func's return value.arguments1 reg: regex object.2 func: callback function.func(name, name_end, <number of groups>, <group number's list>,reg, arg);if func does not return 0, then iteration is stopped.3 arg: argument for func.# int onig_number_of_names(regex_t* reg)Return the number of names defined in the pattern.Multiple definitions of one name is counted as one.arguments1 reg: regex object.# OnigEncoding onig_get_encoding(regex_t* reg)# OnigOptionType onig_get_options(regex_t* reg)# OnigCaseFoldType onig_get_case_fold_flag(regex_t* reg)# OnigSyntaxType* onig_get_syntax(regex_t* reg)Return a value of the regex object.arguments1 reg: regex object.# int onig_number_of_captures(regex_t* reg)Return the number of capture group in the pattern.arguments1 reg: regex object.# int onig_number_of_capture_histories(regex_t* reg)Return the number of capture history defined in the pattern.You can't use capture history if ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORYis disabled in the pattern syntax.(disabled in the default syntax)arguments1 reg: regex object.# OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region)Return the root node of capture history data tree.This value is undefined if matching has faild.arguments1 region: matching result.# int onig_capture_tree_traverse(OnigRegion* region, int at,int(*func)(int,int,int,int,int,void*), void* arg)Traverse and callback in capture history data tree.normal return: 0error: callback func's return value.arguments1 region: match region data.2 at: callback position.ONIG_TRAVERSE_CALLBACK_AT_FIRST: callback first, then traverse childs.ONIG_TRAVERSE_CALLBACK_AT_LAST: traverse childs first, then callback.ONIG_TRAVERSE_CALLBACK_AT_BOTH: callback first, then traverse childs,and at last callback again.3 func: callback function.if func does not return 0, then traverse is stopped.int func(int group, int beg, int end, int level, int at,void* arg)group: group numberbeg: capture start positionend: capture end positionlevel: nest level (from 0)at: callback positionONIG_TRAVERSE_CALLBACK_AT_FIRSTONIG_TRAVERSE_CALLBACK_AT_LASTarg: optional callback argument4 arg; optional callback argument.# int onig_noname_group_capture_is_active(regex_t* reg)Return noname group capture activity.active: 1inactive: 0arguments1 reg: regex object.if option ONIG_OPTION_DONT_CAPTURE_GROUP == ON--> inactiveif the regex pattern have named groupand syntax ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP == ONand option ONIG_OPTION_CAPTURE_GROUP == OFF--> inactiveelse --> active# UChar* onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s)Return previous character head address.arguments1 enc: character encoding2 start: string address3 s: target address of string# UChar* onigenc_get_left_adjust_char_head(OnigEncoding enc,const UChar* start, const UChar* s)Return left-adjusted head address of a character.arguments1 enc: character encoding2 start: string address3 s: target address of string# UChar* onigenc_get_right_adjust_char_head(OnigEncoding enc,const UChar* start, const UChar* s)Return right-adjusted head address of a character.arguments1 enc: character encoding2 start: string address3 s: target address of string# int onigenc_strlen(OnigEncoding enc, const UChar* s, const UChar* end)# int onigenc_strlen_null(OnigEncoding enc, const UChar* s)Return number of characters in the string.# int onigenc_str_bytelen_null(OnigEncoding enc, const UChar* s)Return number of bytes in the string.# int onig_set_default_syntax(OnigSyntaxType* syntax)Set default syntax.arguments1 syntax: address of pattern syntax definition.# void onig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from)Copy syntax.arguments1 to: destination address.2 from: source address.# unsigned int onig_get_syntax_op(OnigSyntaxType* syntax)# unsigned int onig_get_syntax_op2(OnigSyntaxType* syntax)# unsigned int onig_get_syntax_behavior(OnigSyntaxType* syntax)# OnigOptionType onig_get_syntax_options(OnigSyntaxType* syntax)# void onig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op)# void onig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2)# void onig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior)# void onig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options)Get/Set elements of the syntax.arguments1 syntax: syntax2 op, op2, behavior, options: value of element.# void onig_copy_encoding(OnigEncoding to, OnigOnigEncoding from)Copy encoding.arguments1 to: destination address.2 from: source address.# int onig_set_meta_char(OnigSyntaxType* syntax, unsigned int what,OnigCodePoint code)Set a variable meta character to the code point value.Except for an escape character, this meta characters specificationis not work, if ONIG_SYN_OP_VARIABLE_META_CHARACTERS is not effectiveby the syntax. (Build-in syntaxes are not effective.)normal return: ONIG_NORMALarguments1 syntax: target syntax2 what: specifies which meta character it is.ONIG_META_CHAR_ESCAPEONIG_META_CHAR_ANYCHARONIG_META_CHAR_ANYTIMEONIG_META_CHAR_ZERO_OR_ONE_TIMEONIG_META_CHAR_ONE_OR_MORE_TIMEONIG_META_CHAR_ANYCHAR_ANYTIME3 code: meta character or ONIG_INEFFECTIVE_META_CHAR.# OnigCaseFoldType onig_get_default_case_fold_flag()Get default case fold flag.# int onig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag)Set default case fold flag.1 case_fold_flag: case fold flag# unsigned int onig_get_match_stack_limit_size(void)Return the maximum number of stack size.(default: 0 == unlimited)# int onig_set_match_stack_limit_size(unsigned int size)Set the maximum number of stack size.(size = 0: unlimited)normal return: ONIG_NORMAL# int onig_end(void)The use of this library is finished.normal return: ONIG_NORMALIt is not allowed to use regex objects which createdbefore onig_end() call.# const char* onig_version(void)Return version string. (ex. "5.0.3")// END
FAQ 2006/11/141. Lognest matchYou can execute longest match by using ONIG_OPTION_FIND_LONGEST optionin onig_new().2. Thread safeIn order to make thread safe, which of (A) or (B) must be done.(A) Oniguruma LayerDefine the macro below in oniguruma/regint.h.USE_MULTI_THREAD_SYSTEMTHREAD_ATOMIC_STARTTHREAD_ATOMIC_ENDTHREAD_PASSTHREAD_SYSTEM_INITTHREAD_SYSTEM_END(B) Application LayerThe plural threads should not do simultaneously that makingnew regexp objects or re-compiling objects or freeing objects,even if these objects are differ.3. Mailing listThere is no mailing list about Oniguruma.// END
Oniguruma Regular Expressions Version 5.9.1 2007/09/05syntax: ONIG_SYNTAX_RUBY (default)1. Syntax elements\ escape (enable or disable meta character meaning)| alternation(...) group[...] character class2. Characters\t horizontal tab (0x09)\v vertical tab (0x0B)\n newline (0x0A)\r return (0x0D)\b back space (0x08)\f form feed (0x0C)\a bell (0x07)\e escape (0x1B)\nnn octal char (encoded byte value)\xHH hexadecimal char (encoded byte value)\x{7HHHHHHH} wide hexadecimal char (character code point value)\cx control char (character code point value)\C-x control char (character code point value)\M-x meta (x|0x80) (character code point value)\M-\C-x meta control char (character code point value)(* \b is effective in character class [...] only)3. Character types. any character (except newline)\w word characterNot Unicode:alphanumeric, "_" and multibyte char.Unicode:General_Category -- (Letter|Mark|Number|Connector_Punctuation)\W non word char\s whitespace charNot Unicode:\t, \n, \v, \f, \r, \x20Unicode:0009, 000A, 000B, 000C, 000D, 0085(NEL),General_Category -- Line_Separator-- Paragraph_Separator-- Space_Separator\S non whitespace char\d decimal digit charUnicode: General_Category -- Decimal_Number\D non decimal digit char\h hexadecimal digit char [0-9a-fA-F]\H non hexadecimal digit charCharacter Property* \p{property-name}* \p{^property-name} (negative)* \P{property-name} (negative)property-name:+ works on all encodingsAlnum, Alpha, Blank, Cntrl, Digit, Graph, Lower,Print, Punct, Space, Upper, XDigit, Word, ASCII,+ works on EUC_JP, Shift_JISHiragana, Katakana+ works on UTF8, UTF16, UTF32Any, Assigned, C, Cc, Cf, Cn, Co, Cs, L, Ll, Lm, Lo, Lt, Lu,M, Mc, Me, Mn, N, Nd, Nl, No, P, Pc, Pd, Pe, Pf, Pi, Po, Ps,S, Sc, Sk, Sm, So, Z, Zl, Zp, Zs,Arabic, Armenian, Bengali, Bopomofo, Braille, Buginese,Buhid, Canadian_Aboriginal, Cherokee, Common, Coptic,Cypriot, Cyrillic, Deseret, Devanagari, Ethiopic, Georgian,Glagolitic, Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul,Hanunoo, Hebrew, Hiragana, Inherited, Kannada, Katakana,Kharoshthi, Khmer, Lao, Latin, Limbu, Linear_B, Malayalam,Mongolian, Myanmar, New_Tai_Lue, Ogham, Old_Italic, Old_Persian,Oriya, Osmanya, Runic, Shavian, Sinhala, Syloti_Nagri, Syriac,Tagalog, Tagbanwa, Tai_Le, Tamil, Telugu, Thaana, Thai, Tibetan,Tifinagh, Ugaritic, Yi4. Quantifiergreedy? 1 or 0 times* 0 or more times+ 1 or more times{n,m} at least n but not more than m times{n,} at least n times{,n} at least 0 but not more than n times ({0,n}){n} n timesreluctant?? 1 or 0 times*? 0 or more times+? 1 or more times{n,m}? at least n but not more than m times{n,}? at least n times{,n}? at least 0 but not more than n times (== {0,n}?)possessive (greedy and does not backtrack after repeated)?+ 1 or 0 times*+ 0 or more times++ 1 or more times({n,m}+, {n,}+, {n}+ are possessive op. in ONIG_SYNTAX_JAVA only)ex. /a*+/ === /(?>a*)/5. Anchors^ beginning of the line$ end of the line\b word boundary\B not word boundary\A beginning of string\Z end of string, or before newline at the end\z end of string\G matching start position6. Character class^... negative class (lowest precedence operator)x-y range from x to y[...] set (character class in character class)..&&.. intersection (low precedence at the next of ^)ex. [a-w&&[^c-g]z] ==> ([a-w] AND ([^c-g] OR z)) ==> [abh-w]* If you want to use '[', '-', ']' as a normal characterin a character class, you should escape these characters by '\'.POSIX bracket ([:xxxxx:], negate [:^xxxxx:])Not Unicode Case:alnum alphabet or digit charalpha alphabetascii code value: [0 - 127]blank \t, \x20cntrldigit 0-9graph include all of multibyte encoded characterslowerprint include all of multibyte encoded characterspunctspace \t, \n, \v, \f, \r, \x20upperxdigit 0-9, a-f, A-Fword alphanumeric, "_" and multibyte charactersUnicode Case:alnum Letter | Mark | Decimal_Numberalpha Letter | Markascii 0000 - 007Fblank Space_Separator | 0009cntrl Control | Format | Unassigned | Private_Use | Surrogatedigit Decimal_Numbergraph [[:^space:]] && ^Control && ^Unassigned && ^Surrogatelower Lowercase_Letterprint [[:graph:]] | [[:space:]]punct Connector_Punctuation | Dash_Punctuation | Close_Punctuation |Final_Punctuation | Initial_Punctuation | Other_Punctuation |Open_Punctuationspace Space_Separator | Line_Separator | Paragraph_Separator |0009 | 000A | 000B | 000C | 000D | 0085upper Uppercase_Letterxdigit 0030 - 0039 | 0041 - 0046 | 0061 - 0066(0-9, a-f, A-F)word Letter | Mark | Decimal_Number | Connector_Punctuation7. Extended groups(?#...) comment(?imx-imx) option on/offi: ignore casem: multi-line (dot(.) match newline)x: extended form(?imx-imx:subexp) option on/off for subexp(?:subexp) not captured group(subexp) captured group(?=subexp) look-ahead(?!subexp) negative look-ahead(?<=subexp) look-behind(?<!subexp) negative look-behindSubexp of look-behind must be fixed character length.But different character length is allowed in top levelalternatives only.ex. (?<=a|bc) is OK. (?<=aaa(?:b|cd)) is not allowed.In negative-look-behind, captured group isn't allowed,but shy group(?:) is allowed.(?>subexp) atomic groupdon't backtrack in subexp.(?<name>subexp), (?'name'subexp)define named group(All characters of the name must be a word character.)Not only a name but a number is assigned like a capturedgroup.Assigning the same name as two or more subexps is allowed.In this case, a subexp call can not be performed althoughthe back reference is possible.8. Back reference\n back reference by group number (n >= 1)\k<n> back reference by group number (n >= 1)\k'n' back reference by group number (n >= 1)\k<-n> back reference by relative group number (n >= 1)\k'-n' back reference by relative group number (n >= 1)\k<name> back reference by group name\k'name' back reference by group nameIn the back reference by the multiplex definition name,a subexp with a large number is referred to preferentially.(When not matched, a group of the small number is referred to.)* Back reference by group number is forbidden if named group is definedin the pattern and ONIG_OPTION_CAPTURE_GROUP is not setted.back reference with nest levellevel: 0, 1, 2, ...\k<n+level> (n >= 1)\k<n-level> (n >= 1)\k'n+level' (n >= 1)\k'n-level' (n >= 1)\k<name+level>\k<name-level>\k'name+level'\k'name-level'Destinate relative nest level from back reference position.ex 1./\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("reer")ex 2.r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED)(?<element> \g<stag> \g<content>* \g<etag> ){0}(?<stag> < \g<name> \s* > ){0}(?<name> [a-zA-Z_:]+ ){0}(?<content> [^<&]+ (\g<element> | [^<&]+)* ){0}(?<etag> </ \k<name+1> >){0}\g<element>__REGEXP__p r.match('<foo>f<bar>bbb</bar>f</foo>').captures9. Subexp call ("Tanaka Akira special")\g<name> call by group name\g'name' call by group name\g<n> call by group number (n >= 1)\g'n' call by group number (n >= 1)\g<-n> call by relative group number (n >= 1)\g'-n' call by relative group number (n >= 1)* left-most recursive call is not allowed.ex. (?<name>a|\g<name>b) => error(?<name>a|b\g<name>c) => OK* Call by group number is forbidden if named group is defined in the patternand ONIG_OPTION_CAPTURE_GROUP is not setted.* If the option status of called group is different from calling positionthen the group's option is effective.ex. (?-i:\g<name>)(?i:(?<name>a)){0} match to "A"10. Captured groupBehavior of the no-named group (...) changes with the following conditions.(But named group is not changed.)case 1. /.../ (named group is not used, no option)(...) is treated as a captured group.case 2. /.../g (named group is not used, 'g' option)(...) is treated as a no-captured group (?:...).case 3. /..(?<name>..)../ (named group is used, no option)(...) is treated as a no-captured group (?:...).numbered-backref/call is not allowed.case 4. /..(?<name>..)../G (named group is used, 'G' option)(...) is treated as a captured group.numbered-backref/call is allowed.whereg: ONIG_OPTION_DONT_CAPTURE_GROUPG: ONIG_OPTION_CAPTURE_GROUP('g' and 'G' options are argued in ruby-dev ML)-----------------------------A-1. Syntax depend options+ ONIG_SYNTAX_RUBY(?m): dot(.) match newline+ ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA(?s): dot(.) match newline(?m): ^ match after newline, $ match before newlineA-2. Original extensions+ hexadecimal digit char type \h, \H+ named group (?<name>...), (?'name'...)+ named backref \k<name>+ subexp call \g<name>, \g<group-num>A-3. Lacked features compare with perl 5.8.0+ \N{name}+ \l,\u,\L,\U, \X, \C+ (?{code})+ (??{code})+ (?(condition)yes-pat|no-pat)* \Q...\EThis is effective on ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA.A-4. Differences with Japanized GNU regex(version 0.12) of Ruby 1.8+ add character property (\p{property}, \P{property})+ add hexadecimal digit char type (\h, \H)+ add look-behind(?<=fixed-char-length-pattern), (?<!fixed-char-length-pattern)+ add possessive quantifier. ?+, *+, +++ add operations in character class. [], &&('[' must be escaped as an usual char in character class.)+ add named group and subexp call.+ octal or hexadecimal number sequence can be treated asa multibyte code char in character class if multibyte encodingis specified.(ex. [\xa1\xa2], [\xa1\xa7-\xa4\xa1])+ allow the range of single byte char and multibyte char in characterclass.ex. /[a-<<any EUC-JP character>>]/ in EUC-JP encoding.+ effect range of isolated option is to next ')'.ex. (?:(?i)a|b) is interpreted as (?:(?i:a|b)), not (?:(?i:a)|b).+ isolated option is not transparent to previous pattern.ex. a(?i)* is a syntax error pattern.+ allowed incompleted left brace as an usual string.ex. /{/, /({)/, /a{2,3/ etc...+ negative POSIX bracket [:^xxxx:] is supported.+ POSIX bracket [:ascii:] is added.+ repeat of look-ahead is not allowed.ex. /(?=a)*/, /(?!b){5}/+ Ignore case option is effective to numbered character.ex. /\x61/i =~ "A"+ In the range quantifier, the number of the minimum is omissible./a{,n}/ == /a{0,n}/The simultanious abbreviation of the number of times of the minimumand the maximum is not allowed. (/a{,}/)+ /a{n}?/ is not a non-greedy operator./a{n}?/ == /(?:a{n})?/+ invalid back reference is checked and cause error./\1/, /(a)\2/+ Zero-length match in infinite repeat stops the repeat,then changes of the capture group status are checked as stop condition./(?:()|())*\1\2/ =~ ""/(?:\1a|())*/ =~ "a"A-5. Disabled functions by default syntax+ capture history(?@...) and (?@<name>...)ex. /(?@a)*/.match("aaa") ==> [<0-1>, <1-2>, <2-3>]see sample/listcap.c file.A-6. Problems+ Invalid encoding byte sequence is not checked.ex. UTF-8* Invalid first byte is treated as a character././u =~ "\xa3"* Incomplete byte sequence is not checked./\w+/ =~ "a\xf3\x8ec"// END
/**********************************************************************ascii.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static intascii_is_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 128)return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);elsereturn FALSE;}OnigEncodingType OnigEncodingASCII = {onigenc_single_byte_mbc_enc_len,"US-ASCII", /* name */1, /* max byte length */1, /* min byte length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,onigenc_ascii_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,ascii_is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************big5.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static const int EncLen_BIG5[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1};static intbig5_mbc_enc_len(const UChar* p){return EncLen_BIG5[*p];}static OnigCodePointbig5_mbc_to_code(const UChar* p, const UChar* end){return onigenc_mbn_mbc_to_code(ONIG_ENCODING_BIG5, p, end);}static intbig5_code_to_mbc(OnigCodePoint code, UChar *buf){return onigenc_mb2_code_to_mbc(ONIG_ENCODING_BIG5, code, buf);}static intbig5_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,UChar* lower){return onigenc_mbn_mbc_case_fold(ONIG_ENCODING_BIG5, flag,pp, end, lower);}#if 0static intbig5_is_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_BIG5, flag, pp, end);}#endifstatic intbig5_is_code_ctype(OnigCodePoint code, unsigned int ctype){return onigenc_mb2_is_code_ctype(ONIG_ENCODING_BIG5, code, ctype);}static const char BIG5_CAN_BE_TRAIL_TABLE[256] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0};#define BIG5_ISMB_FIRST(byte) (EncLen_BIG5[byte] > 1)#define BIG5_ISMB_TRAIL(byte) BIG5_CAN_BE_TRAIL_TABLE[(byte)]static UChar*big5_left_adjust_char_head(const UChar* start, const UChar* s){const UChar *p;int len;if (s <= start) return (UChar* )s;p = s;if (BIG5_ISMB_TRAIL(*p)) {while (p > start) {if (! BIG5_ISMB_FIRST(*--p)) {p++;break;}}}len = enclen(ONIG_ENCODING_BIG5, p);if (p + len > s) return (UChar* )p;p += len;return (UChar* )(p + ((s - p) & ~1));}static intbig5_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED){const UChar c = *s;return (BIG5_ISMB_TRAIL(c) ? FALSE : TRUE);}OnigEncodingType OnigEncodingBIG5 = {big5_mbc_enc_len,"Big5", /* name */2, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,big5_mbc_to_code,onigenc_mb2_code_to_mbclen,big5_code_to_mbc,big5_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,big5_is_code_ctype,onigenc_not_support_get_ctype_code_range,big5_left_adjust_char_head,big5_is_allowed_reverse_match};
/**********************************************************************cp1251.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_CP1251_TO_LOWER_CASE(c) EncCP1251_ToLowerCaseTable[c]#define ENC_IS_CP1251_CTYPE(code,ctype) \((EncCP1251_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncCP1251_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\220', '\203', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\232', '\213', '\234', '\235', '\236', '\237','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\242', '\242', '\274', '\244', '\264', '\246', '\247','\270', '\251', '\272', '\253', '\254', '\255', '\256', '\277','\260', '\261', '\263', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\276', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncCP1251_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x428c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x34a2, 0x34a2, 0x01a0, 0x30e2, 0x01a0, 0x01a0, 0x01a0, 0x01a0,0x0000, 0x01a0, 0x34a2, 0x01a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x30e2, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x01a0,0x0008, 0x0000, 0x30e2, 0x01a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x0280, 0x34a2, 0x30e2, 0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x01a0,0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x01a0, 0x01a0, 0x01a0, 0x34a2,0x01a0, 0x01a0, 0x34a2, 0x30e2, 0x30e2, 0x31e2, 0x01a0, 0x01a0,0x30e2, 0x0000, 0x30e2, 0x01a0, 0x30e2, 0x34a2, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static intcp1251_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;*lower = ENC_CP1251_TO_LOWER_CASE(*p);(*pp)++;return 1;}static intcp1251_is_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_CP1251_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xb8, 0xa8 },{ 0xe0, 0xc0 },{ 0xe1, 0xc1 },{ 0xe2, 0xc2 },{ 0xe3, 0xc3 },{ 0xe4, 0xc4 },{ 0xe5, 0xc5 },{ 0xe6, 0xc6 },{ 0xe7, 0xc7 },{ 0xe8, 0xc8 },{ 0xe9, 0xc9 },{ 0xea, 0xca },{ 0xeb, 0xcb },{ 0xec, 0xcc },{ 0xed, 0xcd },{ 0xee, 0xce },{ 0xef, 0xcf },{ 0xf0, 0xd0 },{ 0xf1, 0xd1 },{ 0xf2, 0xd2 },{ 0xf3, 0xd3 },{ 0xf4, 0xd4 },{ 0xf5, 0xd5 },{ 0xf6, 0xd6 },{ 0xf7, 0xd7 },{ 0xf8, 0xd8 },{ 0xf9, 0xd9 },{ 0xfa, 0xda },{ 0xfb, 0xdb },{ 0xfc, 0xdc },{ 0xfd, 0xdd },{ 0xfe, 0xde },{ 0xff, 0xdf }};static intcp1251_apply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, f, arg);}static intcp1251_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, p, end, items);}OnigEncodingType OnigEncodingCP1251 = {onigenc_single_byte_mbc_enc_len,"CP1251", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,cp1251_mbc_case_fold,cp1251_apply_all_case_fold,cp1251_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,cp1251_is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************euc_jp.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"#define eucjp_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)static const int EncLen_EUCJP[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1};static intmbc_enc_len(const UChar* p){return EncLen_EUCJP[*p];}static OnigCodePointmbc_to_code(const UChar* p, const UChar* end){int c, i, len;OnigCodePoint n;len = enclen(ONIG_ENCODING_EUC_JP, p);n = (OnigCodePoint )*p++;if (len == 1) return n;for (i = 1; i < len; i++) {if (p >= end) break;c = *p++;n <<= 8; n += c;}return n;}static intcode_to_mbclen(OnigCodePoint code){if (ONIGENC_IS_CODE_ASCII(code)) return 1;else if ((code & 0xff0000) != 0) return 3;else if ((code & 0xff00) != 0) return 2;elsereturn ONIGERR_INVALID_CODE_POINT_VALUE;}#if 0static intcode_to_mbc_first(OnigCodePoint code){int first;if ((code & 0xff0000) != 0) {first = (code >> 16) & 0xff;}else if ((code & 0xff00) != 0) {first = (code >> 8) & 0xff;}else {return (int )code;}return first;}#endifstatic intcode_to_mbc(OnigCodePoint code, UChar *buf){UChar *p = buf;if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff));if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));*p++ = (UChar )(code & 0xff);#if 1if (enclen(ONIG_ENCODING_EUC_JP, buf) != (p - buf))return ONIGERR_INVALID_CODE_POINT_VALUE;#endifreturn p - buf;}static intmbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){int len;const UChar* p = *pp;if (ONIGENC_IS_MBC_ASCII(p)) {*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);(*pp)++;return 1;}else {int i;len = enclen(ONIG_ENCODING_EUC_JP, p);for (i = 0; i < len; i++) {*lower++ = *p++;}(*pp) += len;return len; /* return byte length of converted char to lower */}}static UChar*left_adjust_char_head(const UChar* start, const UChar* s){/* In this encodingmb-trail bytes doesn't mix with single bytes.*/const UChar *p;int len;if (s <= start) return (UChar* )s;p = s;while (!eucjp_islead(*p) && p > start) p--;len = enclen(ONIG_ENCODING_EUC_JP, p);if (p + len > s) return (UChar* )p;p += len;return (UChar* )(p + ((s - p) & ~1));}static intis_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED){const UChar c = *s;if (c <= 0x7e || c == 0x8e || c == 0x8f)return TRUE;elsereturn FALSE;}static int PropertyInited = 0;static const OnigCodePoint** PropertyList;static int PropertyListNum;static int PropertyListSize;static hash_table_type* PropertyNameTable;static const OnigCodePoint CR_Hiragana[] = {1,0xa4a1, 0xa4f3}; /* CR_Hiragana */static const OnigCodePoint CR_Katakana[] = {3,0xa5a1, 0xa5f6,0xaaa6, 0xaaaf,0xaab1, 0xaadd}; /* CR_Katakana */static intinit_property_list(void){int r;PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);PropertyInited = 1;end:return r;}static intproperty_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end){hash_data_type ctype;PROPERTY_LIST_INIT_CHECK;if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {return onigenc_minimum_property_name_to_ctype(enc, p, end);}return (int )ctype;}static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (ctype <= ONIGENC_MAX_STD_CTYPE) {if (code < 128)return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);else {if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {return (code_to_mbclen(code) > 1 ? TRUE : FALSE);}}}else {PROPERTY_LIST_INIT_CHECK;ctype -= (ONIGENC_MAX_STD_CTYPE + 1);if (ctype >= (unsigned int )PropertyListNum)return ONIGERR_TYPE_BUG;return onig_is_in_code_range((UChar* )PropertyList[ctype], code);}return FALSE;}static intget_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,const OnigCodePoint* ranges[]){if (ctype <= ONIGENC_MAX_STD_CTYPE) {return ONIG_NO_SUPPORT_CONFIG;}else {*sb_out = 0x80;PROPERTY_LIST_INIT_CHECK;ctype -= (ONIGENC_MAX_STD_CTYPE + 1);if (ctype >= (OnigCtype )PropertyListNum)return ONIGERR_TYPE_BUG;*ranges = PropertyList[ctype];return 0;}}OnigEncodingType OnigEncodingEUC_JP = {mbc_enc_len,"EUC-JP", /* name */3, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,mbc_to_code,code_to_mbclen,code_to_mbc,mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,property_name_to_ctype,is_code_ctype,get_ctype_code_range,left_adjust_char_head,is_allowed_reverse_match};
/**********************************************************************euc_kr.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static const int EncLen_EUCKR[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1};static inteuckr_mbc_enc_len(const UChar* p){return EncLen_EUCKR[*p];}static OnigCodePointeuckr_mbc_to_code(const UChar* p, const UChar* end){return onigenc_mbn_mbc_to_code(ONIG_ENCODING_EUC_KR, p, end);}static inteuckr_code_to_mbc(OnigCodePoint code, UChar *buf){return onigenc_mb2_code_to_mbc(ONIG_ENCODING_EUC_KR, code, buf);}static inteuckr_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,UChar* lower){return onigenc_mbn_mbc_case_fold(ONIG_ENCODING_EUC_KR, flag,pp, end, lower);}#if 0static inteuckr_is_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_EUC_KR, flag, pp, end);}#endifstatic inteuckr_is_code_ctype(OnigCodePoint code, unsigned int ctype){return onigenc_mb2_is_code_ctype(ONIG_ENCODING_EUC_KR, code, ctype);}#define euckr_islead(c) ((c) < 0xa1 || (c) == 0xff)static UChar*euckr_left_adjust_char_head(const UChar* start, const UChar* s){/* Assumed in this encoding,mb-trail bytes don't mix with single bytes.*/const UChar *p;int len;if (s <= start) return (UChar* )s;p = s;while (!euckr_islead(*p) && p > start) p--;len = enclen(ONIG_ENCODING_EUC_KR, p);if (p + len > s) return (UChar* )p;p += len;return (UChar* )(p + ((s - p) & ~1));}static inteuckr_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED){const UChar c = *s;if (c <= 0x7e) return TRUE;else return FALSE;}OnigEncodingType OnigEncodingEUC_KR = {euckr_mbc_enc_len,"EUC-KR", /* name */2, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,euckr_mbc_to_code,onigenc_mb2_code_to_mbclen,euckr_code_to_mbc,euckr_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,euckr_is_code_ctype,onigenc_not_support_get_ctype_code_range,euckr_left_adjust_char_head,euckr_is_allowed_reverse_match};/* Same with OnigEncodingEUC_KR except the name */OnigEncodingType OnigEncodingEUC_CN = {euckr_mbc_enc_len,"EUC-CN", /* name */2, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,euckr_mbc_to_code,onigenc_mb2_code_to_mbclen,euckr_code_to_mbc,euckr_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,euckr_is_code_ctype,onigenc_not_support_get_ctype_code_range,euckr_left_adjust_char_head,euckr_is_allowed_reverse_match};
/**********************************************************************euc_tw.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static const int EncLen_EUCTW[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1};static inteuctw_mbc_enc_len(const UChar* p){return EncLen_EUCTW[*p];}static OnigCodePointeuctw_mbc_to_code(const UChar* p, const UChar* end){return onigenc_mbn_mbc_to_code(ONIG_ENCODING_EUC_TW, p, end);}static inteuctw_code_to_mbc(OnigCodePoint code, UChar *buf){return onigenc_mb4_code_to_mbc(ONIG_ENCODING_EUC_TW, code, buf);}static inteuctw_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,UChar* lower){return onigenc_mbn_mbc_case_fold(ONIG_ENCODING_EUC_TW, flag,pp, end, lower);}static inteuctw_is_code_ctype(OnigCodePoint code, unsigned int ctype){return onigenc_mb4_is_code_ctype(ONIG_ENCODING_EUC_TW, code, ctype);}#define euctw_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1)static UChar*euctw_left_adjust_char_head(const UChar* start, const UChar* s){/* Assumed in this encoding,mb-trail bytes don't mix with single bytes.*/const UChar *p;int len;if (s <= start) return (UChar* )s;p = s;while (!euctw_islead(*p) && p > start) p--;len = enclen(ONIG_ENCODING_EUC_TW, p);if (p + len > s) return (UChar* )p;p += len;return (UChar* )(p + ((s - p) & ~1));}static inteuctw_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED){const UChar c = *s;if (c <= 0x7e) return TRUE;else return FALSE;}OnigEncodingType OnigEncodingEUC_TW = {euctw_mbc_enc_len,"EUC-TW", /* name */4, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,euctw_mbc_to_code,onigenc_mb4_code_to_mbclen,euctw_code_to_mbc,euctw_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,euctw_is_code_ctype,onigenc_not_support_get_ctype_code_range,euctw_left_adjust_char_head,euctw_is_allowed_reverse_match};
/**********************************************************************gb18030.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2005-2007 KUBO Takehiro <kubo AT jiubao DOT org>* K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#if 1#define DEBUG_GB18030(arg)#else#define DEBUG_GB18030(arg) printf arg#endifenum {C1, /* one-byte char */C2, /* one-byte or second of two-byte char */C4, /* one-byte or second or fourth of four-byte char */CM /* first of two- or four-byte char or second of two-byte char */};static const char GB18030_MAP[] = {C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1,C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C1, C1, C1, C1, C1, C1,C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2,C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C2, C1,C2, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM,CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, CM, C1};static intgb18030_mbc_enc_len(const UChar* p){if (GB18030_MAP[*p] != CM)return 1;p++;if (GB18030_MAP[*p] == C4)return 4;if (GB18030_MAP[*p] == C1)return 1; /* illegal sequence */return 2;}static OnigCodePointgb18030_mbc_to_code(const UChar* p, const UChar* end){return onigenc_mbn_mbc_to_code(ONIG_ENCODING_GB18030, p, end);}static intgb18030_code_to_mbc(OnigCodePoint code, UChar *buf){return onigenc_mb4_code_to_mbc(ONIG_ENCODING_GB18030, code, buf);}static intgb18030_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,UChar* lower){return onigenc_mbn_mbc_case_fold(ONIG_ENCODING_GB18030, flag,pp, end, lower);}#if 0static intgb18030_is_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_GB18030, flag, pp, end);}#endifstatic intgb18030_is_code_ctype(OnigCodePoint code, unsigned int ctype){return onigenc_mb4_is_code_ctype(ONIG_ENCODING_GB18030, code, ctype);}enum state {S_START,S_one_C2,S_one_C4,S_one_CM,S_odd_CM_one_CX,S_even_CM_one_CX,/* CMC4 : pair of "CM C4" */S_one_CMC4,S_odd_CMC4,S_one_C4_odd_CMC4,S_even_CMC4,S_one_C4_even_CMC4,S_odd_CM_odd_CMC4,S_even_CM_odd_CMC4,S_odd_CM_even_CMC4,S_even_CM_even_CMC4,/* C4CM : pair of "C4 CM" */S_odd_C4CM,S_one_CM_odd_C4CM,S_even_C4CM,S_one_CM_even_C4CM,S_even_CM_odd_C4CM,S_odd_CM_odd_C4CM,S_even_CM_even_C4CM,S_odd_CM_even_C4CM,};static UChar*gb18030_left_adjust_char_head(const UChar* start, const UChar* s){const UChar *p;enum state state = S_START;DEBUG_GB18030(("----------------\n"));for (p = s; p >= start; p--) {DEBUG_GB18030(("state %d --(%02x)-->\n", state, *p));switch (state) {case S_START:switch (GB18030_MAP[*p]) {case C1:return (UChar *)s;case C2:state = S_one_C2; /* C2 */break;case C4:state = S_one_C4; /* C4 */break;case CM:state = S_one_CM; /* CM */break;}break;case S_one_C2: /* C2 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)s;case CM:state = S_odd_CM_one_CX; /* CM C2 */break;}break;case S_one_C4: /* C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)s;case CM:state = S_one_CMC4;break;}break;case S_one_CM: /* CM */switch (GB18030_MAP[*p]) {case C1:case C2:return (UChar *)s;case C4:state = S_odd_C4CM;break;case CM:state = S_odd_CM_one_CX; /* CM CM */break;}break;case S_odd_CM_one_CX: /* CM C2 */ /* CM CM */ /* CM CM CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 1);case CM:state = S_even_CM_one_CX;break;}break;case S_even_CM_one_CX: /* CM CM C2 */ /* CM CM CM */ /* CM CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)s;case CM:state = S_odd_CM_one_CX;break;}break;case S_one_CMC4: /* CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:return (UChar *)(s - 1);case C4:state = S_one_C4_odd_CMC4; /* C4 CM C4 */break;case CM:state = S_even_CM_one_CX; /* CM CM C4 */break;}break;case S_odd_CMC4: /* CM C4 CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:return (UChar *)(s - 1);case C4:state = S_one_C4_odd_CMC4;break;case CM:state = S_odd_CM_odd_CMC4;break;}break;case S_one_C4_odd_CMC4: /* C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 1);case CM:state = S_even_CMC4; /* CM C4 CM C4 */break;}break;case S_even_CMC4: /* CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:return (UChar *)(s - 3);case C4:state = S_one_C4_even_CMC4;break;case CM:state = S_odd_CM_even_CMC4;break;}break;case S_one_C4_even_CMC4: /* C4 CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 3);case CM:state = S_odd_CMC4;break;}break;case S_odd_CM_odd_CMC4: /* CM CM C4 CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 3);case CM:state = S_even_CM_odd_CMC4;break;}break;case S_even_CM_odd_CMC4: /* CM CM CM C4 CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 1);case CM:state = S_odd_CM_odd_CMC4;break;}break;case S_odd_CM_even_CMC4: /* CM CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 1);case CM:state = S_even_CM_even_CMC4;break;}break;case S_even_CM_even_CMC4: /* CM CM CM C4 CM C4 */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 3);case CM:state = S_odd_CM_even_CMC4;break;}break;case S_odd_C4CM: /* C4 CM */ /* C4 CM C4 CM C4 CM*/switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)s;case CM:state = S_one_CM_odd_C4CM; /* CM C4 CM */break;}break;case S_one_CM_odd_C4CM: /* CM C4 CM */ /* CM C4 CM C4 CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:return (UChar *)(s - 2); /* |CM C4 CM */case C4:state = S_even_C4CM;break;case CM:state = S_even_CM_odd_C4CM;break;}break;case S_even_C4CM: /* C4 CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 2); /* C4|CM C4 CM */case CM:state = S_one_CM_even_C4CM;break;}break;case S_one_CM_even_C4CM: /* CM C4 CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:return (UChar *)(s - 0); /*|CM C4 CM C4|CM */case C4:state = S_odd_C4CM;break;case CM:state = S_even_CM_even_C4CM;break;}break;case S_even_CM_odd_C4CM: /* CM CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 0); /* |CM CM|C4|CM */case CM:state = S_odd_CM_odd_C4CM;break;}break;case S_odd_CM_odd_C4CM: /* CM CM CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 2); /* |CM CM|CM C4 CM */case CM:state = S_even_CM_odd_C4CM;break;}break;case S_even_CM_even_C4CM: /* CM CM C4 CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 2); /* |CM CM|C4|CM C4 CM */case CM:state = S_odd_CM_even_C4CM;break;}break;case S_odd_CM_even_C4CM: /* CM CM CM C4 CM C4 CM */switch (GB18030_MAP[*p]) {case C1:case C2:case C4:return (UChar *)(s - 0); /* |CM CM|CM C4 CM C4|CM */case CM:state = S_even_CM_even_C4CM;break;}break;}}DEBUG_GB18030(("state %d\n", state));switch (state) {case S_START: return (UChar *)(s - 0);case S_one_C2: return (UChar *)(s - 0);case S_one_C4: return (UChar *)(s - 0);case S_one_CM: return (UChar *)(s - 0);case S_odd_CM_one_CX: return (UChar *)(s - 1);case S_even_CM_one_CX: return (UChar *)(s - 0);case S_one_CMC4: return (UChar *)(s - 1);case S_odd_CMC4: return (UChar *)(s - 1);case S_one_C4_odd_CMC4: return (UChar *)(s - 1);case S_even_CMC4: return (UChar *)(s - 3);case S_one_C4_even_CMC4: return (UChar *)(s - 3);case S_odd_CM_odd_CMC4: return (UChar *)(s - 3);case S_even_CM_odd_CMC4: return (UChar *)(s - 1);case S_odd_CM_even_CMC4: return (UChar *)(s - 1);case S_even_CM_even_CMC4: return (UChar *)(s - 3);case S_odd_C4CM: return (UChar *)(s - 0);case S_one_CM_odd_C4CM: return (UChar *)(s - 2);case S_even_C4CM: return (UChar *)(s - 2);case S_one_CM_even_C4CM: return (UChar *)(s - 0);case S_even_CM_odd_C4CM: return (UChar *)(s - 0);case S_odd_CM_odd_C4CM: return (UChar *)(s - 2);case S_even_CM_even_C4CM: return (UChar *)(s - 2);case S_odd_CM_even_C4CM: return (UChar *)(s - 0);}return (UChar* )s; /* never come here. (escape warning) */}static intgb18030_is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED){return GB18030_MAP[*s] == C1 ? TRUE : FALSE;}OnigEncodingType OnigEncodingGB18030 = {gb18030_mbc_enc_len,"GB18030", /* name */4, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,gb18030_mbc_to_code,onigenc_mb4_code_to_mbclen,gb18030_code_to_mbc,gb18030_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,gb18030_is_code_ctype,onigenc_not_support_get_ctype_code_range,gb18030_left_adjust_char_head,gb18030_is_allowed_reverse_match};
/**********************************************************************iso8859_1.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_IS_ISO_8859_1_CTYPE(code,ctype) \((EncISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const unsigned short EncISO_8859_1_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag ARG_UNUSED,const OnigUChar* p, const OnigUChar* end,OnigCaseFoldCodeItem items[]){if (0x41 <= *p && *p <= 0x5a) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p + 0x20);if (*p == 0x53 && end > p + 1&& (*(p+1) == 0x53 || *(p+1) == 0x73)) { /* SS */items[1].byte_len = 2;items[1].code_len = 1;items[1].code[0] = (OnigCodePoint )0xdf;return 2;}elsereturn 1;}else if (0x61 <= *p && *p <= 0x7a) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p - 0x20);if (*p == 0x73 && end > p + 1&& (*(p+1) == 0x73 || *(p+1) == 0x53)) { /* ss */items[1].byte_len = 2;items[1].code_len = 1;items[1].code[0] = (OnigCodePoint )0xdf;return 2;}elsereturn 1;}else if (0xc0 <= *p && *p <= 0xcf) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p + 0x20);return 1;}else if (0xd0 <= *p && *p <= 0xdf) {if (*p == 0xdf) {items[0].byte_len = 1;items[0].code_len = 2;items[0].code[0] = (OnigCodePoint )'s';items[0].code[1] = (OnigCodePoint )'s';items[1].byte_len = 1;items[1].code_len = 2;items[1].code[0] = (OnigCodePoint )'S';items[1].code[1] = (OnigCodePoint )'S';items[2].byte_len = 1;items[2].code_len = 2;items[2].code[0] = (OnigCodePoint )'s';items[2].code[1] = (OnigCodePoint )'S';items[3].byte_len = 1;items[3].code_len = 2;items[3].code[0] = (OnigCodePoint )'S';items[3].code[1] = (OnigCodePoint )'s';return 4;}else if (*p != 0xd7) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p + 0x20);return 1;}}else if (0xe0 <= *p && *p <= 0xef) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p - 0x20);return 1;}else if (0xf0 <= *p && *p <= 0xfe) {if (*p != 0xf7) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p - 0x20);return 1;}}return 0;}static intmbc_case_fold(OnigCaseFoldType flag, const UChar** pp,const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ONIGENC_ISO_8859_1_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_1_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xdf, 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */if (*p >= 0xaa && *p <= 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_1_CTYPE(code, ctype);elsereturn FALSE;}OnigEncodingType OnigEncodingISO_8859_1 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-1", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_10.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_10_TO_LOWER_CASE(c) EncISO_8859_10_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_10_CTYPE(code,ctype) \((EncISO_8859_10_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_10_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\261', '\262', '\263', '\264', '\265', '\266', '\247','\270', '\271', '\272', '\273', '\274', '\255', '\276', '\277','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_10_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2,0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x01a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x01a0, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_10_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_10_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {return TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_10_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xb1 },{ 0xa2, 0xb2 },{ 0xa3, 0xb3 },{ 0xa4, 0xb4 },{ 0xa5, 0xb5 },{ 0xa6, 0xb6 },{ 0xa8, 0xb8 },{ 0xa9, 0xb9 },{ 0xaa, 0xba },{ 0xab, 0xbb },{ 0xac, 0xbc },{ 0xae, 0xbe },{ 0xaf, 0xbf },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd7, 0xf7 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_10 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-10", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_11.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_IS_ISO_8859_11_CTYPE(code,ctype) \((EncISO_8859_11_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const unsigned short EncISO_8859_11_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000};static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_11_CTYPE(code, ctype);elsereturn FALSE;}OnigEncodingType OnigEncodingISO_8859_11 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-11", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,onigenc_ascii_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_13.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_13_TO_LOWER_CASE(c) EncISO_8859_13_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_13_CTYPE(code,ctype) \((EncISO_8859_13_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_13_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\270', '\251', '\272', '\253', '\254', '\255', '\256', '\277','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_13_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,0x34a2, 0x00a0, 0x34a2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x01a0, 0x30e2, 0x00a0, 0x01a0,0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x01a0};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_13_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_13_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xdf, 0xb5 are lower case letter, but can't convert. */if (*p == 0xb5)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_13_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_13 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-13", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_14.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_14_TO_LOWER_CASE(c) EncISO_8859_14_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_14_CTYPE(code,ctype) \((EncISO_8859_14_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_14_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\242', '\242', '\243', '\245', '\245', '\253', '\247','\270', '\251', '\272', '\253', '\274', '\255', '\256', '\377','\261', '\261', '\263', '\263', '\265', '\265', '\266', '\271','\270', '\271', '\272', '\277', '\274', '\276', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_14_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x30e2, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x00a0,0x34a2, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x01a0, 0x00a0, 0x34a2,0x34a2, 0x30e2, 0x34a2, 0x30e2, 0x34a2, 0x30e2, 0x00a0, 0x34a2,0x30e2, 0x30e2, 0x30e2, 0x34a2, 0x30e2, 0x34a2, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_14_TO_LOWER_CASE(*p);(*pp)++;return 1; /* return byte length of converted char to lower */}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_14_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {return TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_14_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xa2 },{ 0xa4, 0xa5 },{ 0xa6, 0xab },{ 0xa8, 0xb8 },{ 0xaa, 0xba },{ 0xac, 0xbc },{ 0xaf, 0xff },{ 0xb0, 0xb1 },{ 0xb2, 0xb3 },{ 0xb4, 0xb5 },{ 0xb7, 0xb9 },{ 0xbb, 0xbf },{ 0xbd, 0xbe },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd7, 0xf7 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_14 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-14", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_15.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_15_TO_LOWER_CASE(c) EncISO_8859_15_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_15_CTYPE(code,ctype) \((EncISO_8859_15_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_15_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\250', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\270', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\275', '\275', '\377', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_15_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0,0x30e2, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x34a2, 0x30e2, 0x00a0, 0x01a0,0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x34a2, 0x30e2, 0x34a2, 0x01a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_15_TO_LOWER_CASE(*p);(*pp)++;return 1; /* return byte length of converted char to lower */}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_15_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xdf etc.. are lower case letter, but can't convert. */if (*p == 0xaa || *p == 0xb5 || *p == 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_15_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa6, 0xa8 },{ 0xb4, 0xb8 },{ 0xbc, 0xbd },{ 0xbe, 0xff },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_15 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-15", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_16.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_16_TO_LOWER_CASE(c) EncISO_8859_16_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_16_CTYPE(code,ctype) \((EncISO_8859_16_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_16_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\242', '\242', '\263', '\245', '\245', '\250', '\247','\250', '\251', '\272', '\253', '\256', '\255', '\256', '\277','\260', '\261', '\271', '\263', '\270', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\275', '\275', '\377', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_16_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x30e2, 0x34a2, 0x00a0, 0x01a0, 0x34a2, 0x00a0,0x30e2, 0x00a0, 0x34a2, 0x01a0, 0x34a2, 0x01a0, 0x30e2, 0x34a2,0x00a0, 0x00a0, 0x34a2, 0x30e2, 0x34a2, 0x01a0, 0x00a0, 0x01a0,0x30e2, 0x30e2, 0x30e2, 0x01a0, 0x34a2, 0x30e2, 0x34a2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_16_TO_LOWER_CASE(*p);(*pp)++;return 1; /* return byte length of converted char to lower */}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_16_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {return TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_16_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xa2 },{ 0xa3, 0xb3 },{ 0xa6, 0xa8 },{ 0xaa, 0xba },{ 0xac, 0xae },{ 0xaf, 0xbf },{ 0xb2, 0xb9 },{ 0xb4, 0xb8 },{ 0xbc, 0xbd },{ 0xbe, 0xff },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd7, 0xf7 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_16 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-16", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_2.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_2_TO_LOWER_CASE(c) EncISO_8859_2_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_2_CTYPE(code,ctype) \((EncISO_8859_2_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_2_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\261', '\242', '\263', '\244', '\265', '\266', '\247','\250', '\271', '\272', '\273', '\274', '\255', '\276', '\277','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_2_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x00a0, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0,0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2,0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x00a0,0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_2_TO_LOWER_CASE(*p);(*pp)++;return 1; /* return byte length of converted char to lower */}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_2_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {return TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xb1 },{ 0xa3, 0xb3 },{ 0xa5, 0xb5 },{ 0xa6, 0xb6 },{ 0xa9, 0xb9 },{ 0xaa, 0xba },{ 0xab, 0xbb },{ 0xac, 0xbc },{ 0xae, 0xbe },{ 0xaf, 0xbf },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_2_CTYPE(code, ctype);elsereturn FALSE;}OnigEncodingType OnigEncodingISO_8859_2 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-2", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_3.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_3_TO_LOWER_CASE(c) EncISO_8859_3_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_3_CTYPE(code,ctype) \((EncISO_8859_3_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_3_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\261', '\242', '\243', '\244', '\245', '\266', '\247','\250', '\271', '\272', '\273', '\274', '\255', '\256', '\277','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\340', '\341', '\342', '\303', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\320', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_3_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x00a0, 0x00a0, 0x00a0, 0x0000, 0x34a2, 0x00a0,0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x0000, 0x34a2,0x00a0, 0x30e2, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x30e2, 0x01a0,0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x11a0, 0x0000, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x0000, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x0000, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0};static intmbc_case_fold(OnigCaseFoldType flag, const UChar** pp,const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_3_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_3_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */if (*p == 0xb5)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_3_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xb1 },{ 0xa6, 0xb6 },{ 0xa9, 0xb9 },{ 0xaa, 0xba },{ 0xab, 0xbb },{ 0xac, 0xbc },{ 0xaf, 0xbf },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_3 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-3", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_4.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_4_TO_LOWER_CASE(c) EncISO_8859_4_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_4_CTYPE(code,ctype) \((EncISO_8859_4_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_4_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\261', '\242', '\263', '\244', '\265', '\266', '\247','\250', '\271', '\272', '\273', '\274', '\255', '\276', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\277', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_4_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x30e2, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x00a0,0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x00a0,0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x00a0,0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x34a2, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_4_TO_LOWER_CASE(*p);(*pp)++;return 1; /* return byte length of converted char to lower */}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_4_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {if (*p == 0xa2)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_4_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xb1 },{ 0xa3, 0xb3 },{ 0xa5, 0xb5 },{ 0xa6, 0xb6 },{ 0xa9, 0xb9 },{ 0xaa, 0xba },{ 0xab, 0xbb },{ 0xac, 0xbc },{ 0xae, 0xbe },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_4 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-4", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_5.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_5_TO_LOWER_CASE(c) EncISO_8859_5_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_5_CTYPE(code,ctype) \((EncISO_8859_5_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_5_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\255', '\376', '\377','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_5_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2};static intmbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;*lower = ENC_ISO_8859_5_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;(*pp)++;v = (EncISO_8859_5_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_5_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa1, 0xf1 },{ 0xa2, 0xf2 },{ 0xa3, 0xf3 },{ 0xa4, 0xf4 },{ 0xa5, 0xf5 },{ 0xa6, 0xf6 },{ 0xa7, 0xf7 },{ 0xa8, 0xf8 },{ 0xa9, 0xf9 },{ 0xaa, 0xfa },{ 0xab, 0xfb },{ 0xac, 0xfc },{ 0xae, 0xfe },{ 0xaf, 0xff },{ 0xb0, 0xd0 },{ 0xb1, 0xd1 },{ 0xb2, 0xd2 },{ 0xb3, 0xd3 },{ 0xb4, 0xd4 },{ 0xb5, 0xd5 },{ 0xb6, 0xd6 },{ 0xb7, 0xd7 },{ 0xb8, 0xd8 },{ 0xb9, 0xd9 },{ 0xba, 0xda },{ 0xbb, 0xdb },{ 0xbc, 0xdc },{ 0xbd, 0xdd },{ 0xbe, 0xde },{ 0xbf, 0xdf },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end,OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_5 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-5", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_6.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_IS_ISO_8859_6_CTYPE(code,ctype) \((EncISO_8859_6_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const unsigned short EncISO_8859_6_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x0000, 0x0000, 0x0000, 0x00a0, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x01a0, 0x01a0, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x01a0, 0x0000, 0x0000, 0x0000, 0x01a0,0x0000, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_6_CTYPE(code, ctype);elsereturn FALSE;}OnigEncodingType OnigEncodingISO_8859_6 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-6", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,onigenc_ascii_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_7.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_7_TO_LOWER_CASE(c) EncISO_8859_7_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_7_CTYPE(code,ctype) \((EncISO_8859_7_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_7_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\334', '\267','\335', '\336', '\337', '\273', '\374', '\275', '\375', '\376','\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\322', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\334', '\335', '\336', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_7_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x01a0, 0x01a0, 0x00a0, 0x0000, 0x0000, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x0000, 0x01a0, 0x00a0, 0x01a0, 0x0000, 0x01a0,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x00a0, 0x34a2, 0x01a0,0x34a2, 0x34a2, 0x34a2, 0x01a0, 0x34a2, 0x10a0, 0x34a2, 0x34a2,0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x0000, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x0000};static intmbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;*lower = ENC_ISO_8859_7_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){int v;const UChar* p = *pp;(*pp)++;v = (EncISO_8859_7_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {if (*p == 0xc0 || *p == 0xe0)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_7_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xb6, 0xdc },{ 0xb8, 0xdd },{ 0xb9, 0xde },{ 0xba, 0xdf },{ 0xbc, 0xfc },{ 0xbe, 0xfd },{ 0xbf, 0xfe },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd7, 0xf7 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_7 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-7", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_8.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_IS_ISO_8859_8_CTYPE(code,ctype) \((EncISO_8859_8_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const unsigned short EncISO_8859_8_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x0000, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,0x00a0, 0x10a0, 0x00a0, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_8_CTYPE(code, ctype);elsereturn FALSE;}OnigEncodingType OnigEncodingISO_8859_8 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-8", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,onigenc_ascii_mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************iso8859_9.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_ISO_8859_9_TO_LOWER_CASE(c) EncISO_8859_9_ToLowerCaseTable[c]#define ENC_IS_ISO_8859_9_CTYPE(code,ctype) \((EncISO_8859_9_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncISO_8859_9_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\335', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};static const unsigned short EncISO_8859_9_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};static intmbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {*lower++ = 's';*lower = 's';(*pp)++;return 2;}*lower = ENC_ISO_8859_9_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {(*pp)++;return TRUE;}(*pp)++;v = (EncISO_8859_9_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xdf etc.. are lower case letter, but can't convert. */if (*p >= 0xaa && *p <= 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}#endifstatic intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_ISO_8859_9_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe }};static intapply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, f, arg);}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1,flag, p, end, items);}OnigEncodingType OnigEncodingISO_8859_9 = {onigenc_single_byte_mbc_enc_len,"ISO-8859-9", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,mbc_case_fold,apply_all_case_fold,get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************koi8.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_KOI8_TO_LOWER_CASE(c) EncKOI8_ToLowerCaseTable[c]#define ENC_IS_KOI8_CTYPE(code,ctype) \((EncKOI8_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncKOI8_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337'};static const unsigned short EncKOI8_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2};static intkoi8_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;*lower = ENC_KOI8_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intkoi8_is_mbc_ambiguous(OnigAmbigType flag, const OnigUChar** pp, const OnigUChar* end){const OnigUChar* p = *pp;(*pp)++;if (((flag & ONIGENC_CASE_FOLD_ASCII_CASE) != 0 &&ONIGENC_IS_MBC_ASCII(p)) ||((flag & ONIGENC_CASE_FOLD_NONASCII_CASE) != 0 &&!ONIGENC_IS_MBC_ASCII(p))) {int v = (EncKOI8_CtypeTable[*p] &(BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));return (v != 0 ? TRUE : FALSE);}return FALSE;}#endifstatic intkoi8_is_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_KOI8_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd7, 0xf7 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe },{ 0xdf, 0xff },{ 0xe0, 0xc0 },{ 0xe1, 0xc1 },{ 0xe2, 0xc2 },{ 0xe3, 0xc3 },{ 0xe4, 0xc4 },{ 0xe5, 0xc5 },{ 0xe6, 0xc6 },{ 0xe7, 0xc7 },{ 0xe8, 0xc8 },{ 0xe9, 0xc9 },{ 0xea, 0xca },{ 0xeb, 0xcb },{ 0xec, 0xcc },{ 0xed, 0xcd },{ 0xee, 0xce },{ 0xef, 0xcf },{ 0xf0, 0xd0 },{ 0xf1, 0xd1 },{ 0xf2, 0xd2 },{ 0xf3, 0xd3 },{ 0xf4, 0xd4 },{ 0xf5, 0xd5 },{ 0xf6, 0xd6 },{ 0xf7, 0xd7 },{ 0xf8, 0xd8 },{ 0xf9, 0xd9 },{ 0xfa, 0xda },{ 0xfb, 0xdb },{ 0xfc, 0xdc },{ 0xfe, 0xde },{ 0xff, 0xdf }};static intkoi8_apply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, f, arg);}static intkoi8_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, p, end, items);}OnigEncodingType OnigEncodingKOI8 = {onigenc_single_byte_mbc_enc_len,"KOI8", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,koi8_mbc_case_fold,koi8_apply_all_case_fold,koi8_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,koi8_is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************koi8_r.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define ENC_KOI8_R_TO_LOWER_CASE(c) EncKOI8_R_ToLowerCaseTable[c]#define ENC_IS_KOI8_R_CTYPE(code,ctype) \((EncKOI8_R_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)static const UChar EncKOI8_R_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\243', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337'};static const unsigned short EncKOI8_R_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x0284, 0x00a0, 0x00a0, 0x10a0, 0x01a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x30e2, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2};static intkoi8_r_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;*lower = ENC_KOI8_R_TO_LOWER_CASE(*p);(*pp)++;return 1;}#if 0static intkoi8_r_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){int v;const UChar* p = *pp;(*pp)++;v = (EncKOI8_R_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));return (v != 0 ? TRUE : FALSE);}#endifstatic intkoi8_r_is_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 256)return ENC_IS_KOI8_R_CTYPE(code, ctype);elsereturn FALSE;}static const OnigPairCaseFoldCodes CaseFoldMap[] = {{ 0xa3, 0xb3 },{ 0xc0, 0xe0 },{ 0xc1, 0xe1 },{ 0xc2, 0xe2 },{ 0xc3, 0xe3 },{ 0xc4, 0xe4 },{ 0xc5, 0xe5 },{ 0xc6, 0xe6 },{ 0xc7, 0xe7 },{ 0xc8, 0xe8 },{ 0xc9, 0xe9 },{ 0xca, 0xea },{ 0xcb, 0xeb },{ 0xcc, 0xec },{ 0xcd, 0xed },{ 0xce, 0xee },{ 0xcf, 0xef },{ 0xd0, 0xf0 },{ 0xd1, 0xf1 },{ 0xd2, 0xf2 },{ 0xd3, 0xf3 },{ 0xd4, 0xf4 },{ 0xd5, 0xf5 },{ 0xd6, 0xf6 },{ 0xd7, 0xf7 },{ 0xd8, 0xf8 },{ 0xd9, 0xf9 },{ 0xda, 0xfa },{ 0xdb, 0xfb },{ 0xdc, 0xfc },{ 0xdd, 0xfd },{ 0xde, 0xfe },{ 0xdf, 0xff }};static intkoi8_r_apply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){return onigenc_apply_all_case_fold_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, f, arg);}static intkoi8_r_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_get_case_fold_codes_by_str_with_map(sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 0,flag, p, end, items);}OnigEncodingType OnigEncodingKOI8_R = {onigenc_single_byte_mbc_enc_len,"KOI8-R", /* name */1, /* max enc length */1, /* min enc length */onigenc_is_mbc_newline_0x0a,onigenc_single_byte_mbc_to_code,onigenc_single_byte_code_to_mbclen,onigenc_single_byte_code_to_mbc,koi8_r_mbc_case_fold,koi8_r_apply_all_case_fold,koi8_r_get_case_fold_codes_by_str,onigenc_minimum_property_name_to_ctype,koi8_r_is_code_ctype,onigenc_not_support_get_ctype_code_range,onigenc_single_byte_left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
/**********************************************************************mktable.c**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include <stdlib.h>#include <stdio.h>#include <locale.h>#define __USE_ISOC99#include <ctype.h>#include "regenc.h"#define ASCII 0#define UNICODE_ISO_8859_1 1#define ISO_8859_1 2#define ISO_8859_2 3#define ISO_8859_3 4#define ISO_8859_4 5#define ISO_8859_5 6#define ISO_8859_6 7#define ISO_8859_7 8#define ISO_8859_8 9#define ISO_8859_9 10#define ISO_8859_10 11#define ISO_8859_11 12#define ISO_8859_13 13#define ISO_8859_14 14#define ISO_8859_15 15#define ISO_8859_16 16#define KOI8 17#define KOI8_R 18typedef struct {int num;char* name;} ENC_INFO;static ENC_INFO Info[] = {{ ASCII, "ASCII" },{ UNICODE_ISO_8859_1, "UNICODE_ISO_8859_1" },{ ISO_8859_1, "ISO_8859_1" },{ ISO_8859_2, "ISO_8859_2" },{ ISO_8859_3, "ISO_8859_3" },{ ISO_8859_4, "ISO_8859_4" },{ ISO_8859_5, "ISO_8859_5" },{ ISO_8859_6, "ISO_8859_6" },{ ISO_8859_7, "ISO_8859_7" },{ ISO_8859_8, "ISO_8859_8" },{ ISO_8859_9, "ISO_8859_9" },{ ISO_8859_10, "ISO_8859_10" },{ ISO_8859_11, "ISO_8859_11" },{ ISO_8859_13, "ISO_8859_13" },{ ISO_8859_14, "ISO_8859_14" },{ ISO_8859_15, "ISO_8859_15" },{ ISO_8859_16, "ISO_8859_16" },{ KOI8, "KOI8" },{ KOI8_R, "KOI8_R" }};static int IsAlpha(int enc, int c){if (enc == ASCII)return isalpha(c);if (c >= 0x41 && c <= 0x5a) return 1;if (c >= 0x61 && c <= 0x7a) return 1;switch (enc) {case UNICODE_ISO_8859_1:case ISO_8859_1:case ISO_8859_9:if (c == 0xaa) return 1;if (c == 0xb5) return 1;if (c == 0xba) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xff) return 1;break;case ISO_8859_2:if (c == 0xa1 || c == 0xa3) return 1;if (c == 0xa5 || c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c >= 0xae && c <= 0xaf) return 1;if (c == 0xb1 || c == 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbc) return 1;if (c >= 0xbe && c <= 0xbf) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_3:if (c == 0xa1) return 1;if (c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c == 0xaf) return 1;if (c == 0xb1) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbc) return 1;if (c == 0xbf) return 1;if (c >= 0xc0 && c <= 0xc2) return 1;if (c >= 0xc4 && c <= 0xcf) return 1;if (c >= 0xd1 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xe2) return 1;if (c >= 0xe4 && c <= 0xef) return 1;if (c >= 0xf1 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_4:if (c >= 0xa1 && c <= 0xa3) return 1;if (c == 0xa5 || c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c == 0xae) return 1;if (c == 0xb1 || c == 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbf) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_5:if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1;if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1;break;case ISO_8859_6:if (c >= 0xc1 && c <= 0xda) return 1;if (c >= 0xe0 && c <= 0xf2) return 1;break;case ISO_8859_7:if (c == 0xb6) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c == 0xbc) return 1;if (c >= 0xbe && c <= 0xbf) return 1;if (c == 0xc0) return 1;if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1;if (c >= 0xdc && c <= 0xfe) return 1;break;case ISO_8859_8:if (c == 0xb5) return 1;if (c >= 0xe0 && c <= 0xfa) return 1;break;case ISO_8859_10:if (c >= 0xa1 && c <= 0xa6) return 1;if (c >= 0xa8 && c <= 0xac) return 1;if (c == 0xae || c == 0xaf) return 1;if (c >= 0xb1 && c <= 0xb6) return 1;if (c >= 0xb8 && c <= 0xbc) return 1;if (c >= 0xbe && c <= 0xff) return 1;break;case ISO_8859_11:if (c >= 0xa1 && c <= 0xda) return 1;if (c >= 0xdf && c <= 0xfb) return 1;break;case ISO_8859_13:if (c == 0xa8) return 1;if (c == 0xaa) return 1;if (c == 0xaf) return 1;if (c == 0xb5) return 1;if (c == 0xb8) return 1;if (c == 0xba) return 1;if (c >= 0xbf && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_14:if (c == 0xa1 || c == 0xa2) return 1;if (c == 0xa4 || c == 0xa5) return 1;if (c == 0xa6 || c == 0xa8) return 1;if (c >= 0xaa && c <= 0xac) return 1;if (c >= 0xaf && c <= 0xb5) return 1;if (c >= 0xb7 && c <= 0xff) return 1;break;case ISO_8859_15:if (c == 0xaa) return 1;if (c == 0xb5) return 1;if (c == 0xba) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xff) return 1;if (c == 0xa6) return 1;if (c == 0xa8) return 1;if (c == 0xb4) return 1;if (c == 0xb8) return 1;if (c == 0xbc) return 1;if (c == 0xbd) return 1;if (c == 0xbe) return 1;break;case ISO_8859_16:if (c == 0xa1) return 1;if (c == 0xa2) return 1;if (c == 0xa3) return 1;if (c == 0xa6) return 1;if (c == 0xa8) return 1;if (c == 0xaa) return 1;if (c == 0xac) return 1;if (c == 0xae) return 1;if (c == 0xaf) return 1;if (c == 0xb2) return 1;if (c == 0xb3) return 1;if (c == 0xb4) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c == 0xbc) return 1;if (c == 0xbd) return 1;if (c == 0xbe) return 1;if (c == 0xbf) return 1;if (c >= 0xc0 && c <= 0xde) return 1;if (c >= 0xdf && c <= 0xff) return 1;break;case KOI8_R:if (c == 0xa3 || c == 0xb3) return 1;/* fall */case KOI8:if (c >= 0xc0 && c <= 0xff) return 1;break;default:exit(-1);}return 0;}static int IsBlank(int enc, int c){if (enc == ASCII)return isblank(c);if (c == 0x09 || c == 0x20) return 1;switch (enc) {case UNICODE_ISO_8859_1:case ISO_8859_1:case ISO_8859_2:case ISO_8859_3:case ISO_8859_4:case ISO_8859_5:case ISO_8859_6:case ISO_8859_7:case ISO_8859_8:case ISO_8859_9:case ISO_8859_10:case ISO_8859_11:case ISO_8859_13:case ISO_8859_14:case ISO_8859_15:case ISO_8859_16:case KOI8:if (c == 0xa0) return 1;break;case KOI8_R:if (c == 0x9a) return 1;break;default:exit(-1);}return 0;}static int IsCntrl(int enc, int c){if (enc == ASCII)return iscntrl(c);if (c >= 0x00 && c <= 0x1F) return 1;switch (enc) {case UNICODE_ISO_8859_1:if (c == 0xad) return 1;/* fall */case ISO_8859_1:case ISO_8859_2:case ISO_8859_3:case ISO_8859_4:case ISO_8859_5:case ISO_8859_6:case ISO_8859_7:case ISO_8859_8:case ISO_8859_9:case ISO_8859_10:case ISO_8859_11:case ISO_8859_13:case ISO_8859_14:case ISO_8859_15:case ISO_8859_16:case KOI8:if (c >= 0x7f && c <= 0x9F) return 1;break;case KOI8_R:if (c == 0x7f) return 1;break;default:exit(-1);}return 0;}static int IsDigit(int enc ARG_UNUSED, int c){if (c >= 0x30 && c <= 0x39) return 1;return 0;}static int IsGraph(int enc, int c){if (enc == ASCII)return isgraph(c);if (c >= 0x21 && c <= 0x7e) return 1;switch (enc) {case UNICODE_ISO_8859_1:case ISO_8859_1:case ISO_8859_2:case ISO_8859_4:case ISO_8859_5:case ISO_8859_9:case ISO_8859_10:case ISO_8859_13:case ISO_8859_14:case ISO_8859_15:case ISO_8859_16:if (c >= 0xa1 && c <= 0xff) return 1;break;case ISO_8859_3:if (c >= 0xa1) {if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 ||c == 0xe3 || c == 0xf0)return 0;elsereturn 1;}break;case ISO_8859_6:if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf)return 1;if (c >= 0xc1 && c <= 0xda) return 1;if (c >= 0xe0 && c <= 0xf2) return 1;break;case ISO_8859_7:if (c >= 0xa1 && c <= 0xfe &&c != 0xa4 && c != 0xa5 && c != 0xaa &&c != 0xae && c != 0xd2) return 1;break;case ISO_8859_8:if (c >= 0xa2 && c <= 0xfa) {if (c >= 0xbf && c <= 0xde) return 0;return 1;}break;case ISO_8859_11:if (c >= 0xa1 && c <= 0xda) return 1;if (c >= 0xdf && c <= 0xfb) return 1;break;case KOI8:if (c >= 0xc0 && c <= 0xff) return 1;break;case KOI8_R:if (c >= 0x80 && c <= 0xff && c != 0x9a) return 1;break;default:exit(-1);}return 0;}static int IsLower(int enc, int c){if (enc == ASCII)return islower(c);if (c >= 0x61 && c <= 0x7a) return 1;switch (enc) {case UNICODE_ISO_8859_1:case ISO_8859_1:case ISO_8859_9:if (c == 0xaa) return 1;if (c == 0xb5) return 1;if (c == 0xba) return 1;if (c >= 0xdf && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xff) return 1;break;case ISO_8859_2:if (c == 0xb1 || c == 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbc) return 1;if (c >= 0xbe && c <= 0xbf) return 1;if (c >= 0xdf && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_3:if (c == 0xb1) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbc) return 1;if (c == 0xbf) return 1;if (c == 0xdf) return 1;if (c >= 0xe0 && c <= 0xe2) return 1;if (c >= 0xe4 && c <= 0xef) return 1;if (c >= 0xf1 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_4:if (c == 0xa2) return 1;if (c == 0xb1 || c == 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbc) return 1;if (c >= 0xbe && c <= 0xbf) return 1;if (c == 0xdf) return 1;if (c >= 0xe0 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_5:if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1;break;case ISO_8859_6:break;case ISO_8859_7:if (c == 0xc0) return 1;if (c >= 0xdc && c <= 0xfe) return 1;break;case ISO_8859_8:if (c == 0xb5) return 1;break;case ISO_8859_10:if (c >= 0xb1 && c <= 0xb6) return 1;if (c >= 0xb8 && c <= 0xbc) return 1;if (c == 0xbe || c == 0xbf) return 1;if (c >= 0xdf && c <= 0xff) return 1;break;case ISO_8859_11:break;case ISO_8859_13:if (c == 0xb5) return 1;if (c == 0xb8) return 1;if (c == 0xba) return 1;if (c == 0xbf) return 1;if (c >= 0xdf && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_14:if (c == 0xa2) return 1;if (c == 0xa5) return 1;if (c == 0xab) return 1;if (c == 0xb1 || c == 0xb3 || c == 0xb5) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c == 0xbc) return 1;if (c == 0xbe || c == 0xbf) return 1;if (c >= 0xdf && c <= 0xff) return 1;break;case ISO_8859_15:if (c == 0xaa) return 1;if (c == 0xb5) return 1;if (c == 0xba) return 1;if (c >= 0xdf && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xff) return 1;if (c == 0xa8) return 1;if (c == 0xb8) return 1;if (c == 0xbd) return 1;break;case ISO_8859_16:if (c == 0xa2) return 1;if (c == 0xa8) return 1;if (c == 0xae) return 1;if (c == 0xb3) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c == 0xbd) return 1;if (c == 0xbf) return 1;if (c >= 0xdf && c <= 0xff) return 1;break;case KOI8_R:if (c == 0xa3) return 1;/* fall */case KOI8:if (c >= 0xc0 && c <= 0xdf) return 1;break;default:exit(-1);}return 0;}static int IsPrint(int enc, int c){if (enc == ASCII)return isprint(c);if (c >= 0x20 && c <= 0x7e) return 1;switch (enc) {case UNICODE_ISO_8859_1:if (c >= 0x09 && c <= 0x0d) return 1;if (c == 0x85) return 1;/* fall */case ISO_8859_1:case ISO_8859_2:case ISO_8859_4:case ISO_8859_5:case ISO_8859_9:case ISO_8859_10:case ISO_8859_13:case ISO_8859_14:case ISO_8859_15:case ISO_8859_16:if (c >= 0xa0 && c <= 0xff) return 1;break;case ISO_8859_3:if (c >= 0xa0) {if (c == 0xa5 || c == 0xae || c == 0xbe || c == 0xc3 || c == 0xd0 ||c == 0xe3 || c == 0xf0)return 0;elsereturn 1;}break;case ISO_8859_6:if (c == 0xa0) return 1;if (c == 0xa4 || c == 0xac || c == 0xad || c == 0xbb || c == 0xbf)return 1;if (c >= 0xc1 && c <= 0xda) return 1;if (c >= 0xe0 && c <= 0xf2) return 1;break;case ISO_8859_7:if (c >= 0xa0 && c <= 0xfe &&c != 0xa4 && c != 0xa5 && c != 0xaa &&c != 0xae && c != 0xd2) return 1;break;case ISO_8859_8:if (c >= 0xa0 && c <= 0xfa) {if (c >= 0xbf && c <= 0xde) return 0;if (c == 0xa1) return 0;return 1;}break;case ISO_8859_11:if (c >= 0xa0 && c <= 0xda) return 1;if (c >= 0xdf && c <= 0xfb) return 1;break;case KOI8:if (c == 0xa0) return 1;if (c >= 0xc0 && c <= 0xff) return 1;break;case KOI8_R:if (c >= 0x80 && c <= 0xff) return 1;break;default:exit(-1);}return 0;}static int IsPunct(int enc, int c){if (enc == ASCII)return ispunct(c);if (enc == UNICODE_ISO_8859_1) {if (c == 0x24 || c == 0x2b || c == 0x5e || c == 0x60 ||c == 0x7c || c == 0x7e) return 1;if (c >= 0x3c && c <= 0x3e) return 1;}if (c >= 0x21 && c <= 0x2f) return 1;if (c >= 0x3a && c <= 0x40) return 1;if (c >= 0x5b && c <= 0x60) return 1;if (c >= 0x7b && c <= 0x7e) return 1;switch (enc) {case ISO_8859_1:case ISO_8859_9:case ISO_8859_15:if (c == 0xad) return 1;/* fall */case UNICODE_ISO_8859_1:if (c == 0xa1) return 1;if (c == 0xab) return 1;if (c == 0xb7) return 1;if (c == 0xbb) return 1;if (c == 0xbf) return 1;break;case ISO_8859_2:case ISO_8859_4:case ISO_8859_5:case ISO_8859_14:if (c == 0xad) return 1;break;case ISO_8859_3:case ISO_8859_10:if (c == 0xad) return 1;if (c == 0xb7) return 1;if (c == 0xbd) return 1;break;case ISO_8859_6:if (c == 0xac) return 1;if (c == 0xad) return 1;if (c == 0xbb) return 1;if (c == 0xbf) return 1;break;case ISO_8859_7:if (c == 0xa1 || c == 0xa2) return 1;if (c == 0xab) return 1;if (c == 0xaf) return 1;if (c == 0xad) return 1;if (c == 0xb7 || c == 0xbb) return 1;break;case ISO_8859_8:if (c == 0xab) return 1;if (c == 0xad) return 1;if (c == 0xb7) return 1;if (c == 0xbb) return 1;if (c == 0xdf) return 1;break;case ISO_8859_13:if (c == 0xa1 || c == 0xa5) return 1;if (c == 0xab || c == 0xad) return 1;if (c == 0xb4 || c == 0xb7) return 1;if (c == 0xbb) return 1;if (c == 0xff) return 1;break;case ISO_8859_16:if (c == 0xa5) return 1;if (c == 0xab) return 1;if (c == 0xad) return 1;if (c == 0xb5) return 1;if (c == 0xb7) return 1;if (c == 0xbb) return 1;break;case KOI8_R:if (c == 0x9e) return 1;break;case ISO_8859_11:case KOI8:break;default:exit(-1);}return 0;}static int IsSpace(int enc, int c){if (enc == ASCII)return isspace(c);if (c >= 0x09 && c <= 0x0d) return 1;if (c == 0x20) return 1;switch (enc) {case UNICODE_ISO_8859_1:if (c == 0x85) return 1;/* fall */case ISO_8859_1:case ISO_8859_2:case ISO_8859_3:case ISO_8859_4:case ISO_8859_5:case ISO_8859_6:case ISO_8859_7:case ISO_8859_8:case ISO_8859_9:case ISO_8859_10:case ISO_8859_11:case ISO_8859_13:case ISO_8859_14:case ISO_8859_15:case ISO_8859_16:case KOI8:if (c == 0xa0) return 1;break;case KOI8_R:if (c == 0x9a) return 1;break;default:exit(-1);}return 0;}static int IsUpper(int enc, int c){if (enc == ASCII)return isupper(c);if (c >= 0x41 && c <= 0x5a) return 1;switch (enc) {case UNICODE_ISO_8859_1:case ISO_8859_1:case ISO_8859_9:if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xde) return 1;break;case ISO_8859_2:if (c == 0xa1 || c == 0xa3) return 1;if (c == 0xa5 || c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c >= 0xae && c <= 0xaf) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xde) return 1;break;case ISO_8859_3:if (c == 0xa1) return 1;if (c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c == 0xaf) return 1;if (c >= 0xc0 && c <= 0xc2) return 1;if (c >= 0xc4 && c <= 0xcf) return 1;if (c >= 0xd1 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xde) return 1;break;case ISO_8859_4:if (c == 0xa1 || c == 0xa3) return 1;if (c == 0xa5 || c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c == 0xae) return 1;if (c == 0xbd) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xde) return 1;break;case ISO_8859_5:if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1;break;case ISO_8859_6:break;case ISO_8859_7:if (c == 0xb6) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c == 0xbc) return 1;if (c >= 0xbe && c <= 0xbf) return 1;if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1;break;case ISO_8859_8:case ISO_8859_11:break;case ISO_8859_10:if (c >= 0xa1 && c <= 0xa6) return 1;if (c >= 0xa8 && c <= 0xac) return 1;if (c == 0xae || c == 0xaf) return 1;if (c >= 0xc0 && c <= 0xde) return 1;break;case ISO_8859_13:if (c == 0xa8) return 1;if (c == 0xaa) return 1;if (c == 0xaf) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xde) return 1;break;case ISO_8859_14:if (c == 0xa1) return 1;if (c == 0xa4 || c == 0xa6) return 1;if (c == 0xa8) return 1;if (c == 0xaa || c == 0xac) return 1;if (c == 0xaf || c == 0xb0) return 1;if (c == 0xb2 || c == 0xb4 || c == 0xb7) return 1;if (c == 0xbb || c == 0xbd) return 1;if (c >= 0xc0 && c <= 0xde) return 1;break;case ISO_8859_15:if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xde) return 1;if (c == 0xa6) return 1;if (c == 0xb4) return 1;if (c == 0xbc) return 1;if (c == 0xbe) return 1;break;case ISO_8859_16:if (c == 0xa1) return 1;if (c == 0xa3) return 1;if (c == 0xa6) return 1;if (c == 0xaa) return 1;if (c == 0xac) return 1;if (c == 0xaf) return 1;if (c == 0xb2) return 1;if (c == 0xb4) return 1;if (c == 0xbc) return 1;if (c == 0xbe) return 1;if (c >= 0xc0 && c <= 0xde) return 1;break;case KOI8_R:if (c == 0xb3) return 1;/* fall */case KOI8:if (c >= 0xe0 && c <= 0xff) return 1;break;default:exit(-1);}return 0;}static int IsXDigit(int enc, int c){if (enc == ASCII)return isxdigit(c);if (c >= 0x30 && c <= 0x39) return 1;if (c >= 0x41 && c <= 0x46) return 1;if (c >= 0x61 && c <= 0x66) return 1;return 0;}static int IsWord(int enc, int c){if (enc == ASCII) {return (isalpha(c) || isdigit(c) || c == 0x5f);}if (c >= 0x30 && c <= 0x39) return 1;if (c >= 0x41 && c <= 0x5a) return 1;if (c == 0x5f) return 1;if (c >= 0x61 && c <= 0x7a) return 1;switch (enc) {case UNICODE_ISO_8859_1:case ISO_8859_1:case ISO_8859_9:if (c == 0xaa) return 1;if (c >= 0xb2 && c <= 0xb3) return 1;if (c == 0xb5) return 1;if (c >= 0xb9 && c <= 0xba) return 1;if (c >= 0xbc && c <= 0xbe) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xff) return 1;break;case ISO_8859_2:if (c == 0xa1 || c == 0xa3) return 1;if (c == 0xa5 || c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c >= 0xae && c <= 0xaf) return 1;if (c == 0xb1 || c == 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbc) return 1;if (c >= 0xbe && c <= 0xbf) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_3:if (c == 0xa1) return 1;if (c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c == 0xaf) return 1;if (c >= 0xb1 && c <= 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbd) return 1;if (c == 0xbf) return 1;if (c >= 0xc0 && c <= 0xc2) return 1;if (c >= 0xc4 && c <= 0xcf) return 1;if (c >= 0xd1 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xe2) return 1;if (c >= 0xe4 && c <= 0xef) return 1;if (c >= 0xf1 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_4:if (c >= 0xa1 && c <= 0xa3) return 1;if (c == 0xa5 || c == 0xa6) return 1;if (c >= 0xa9 && c <= 0xac) return 1;if (c == 0xae) return 1;if (c == 0xb1 || c == 0xb3) return 1;if (c == 0xb5 || c == 0xb6) return 1;if (c >= 0xb9 && c <= 0xbf) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_5:if (c >= 0xa1 && c <= 0xcf && c != 0xad) return 1;if (c >= 0xd0 && c <= 0xff && c != 0xf0 && c != 0xfd) return 1;break;case ISO_8859_6:if (c >= 0xc1 && c <= 0xda) return 1;if (c >= 0xe0 && c <= 0xea) return 1;if (c >= 0xeb && c <= 0xf2) return 1;break;case ISO_8859_7:if (c == 0xb2 || c == 0xb3) return 1;if (c == 0xb6) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c >= 0xbc && c <= 0xbf) return 1;if (c == 0xc0) return 1;if (c >= 0xc1 && c <= 0xdb && c != 0xd2) return 1;if (c >= 0xdc && c <= 0xfe) return 1;break;case ISO_8859_8:if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) return 1;if (c >= 0xbc && c <= 0xbe) return 1;if (c >= 0xe0 && c <= 0xfa) return 1;break;case ISO_8859_10:if (c >= 0xa1 && c <= 0xff) {if (c != 0xa7 && c != 0xad && c != 0xb0 && c != 0xb7 && c != 0xbd)return 1;}break;case ISO_8859_11:if (c >= 0xa1 && c <= 0xda) return 1;if (c >= 0xdf && c <= 0xfb) return 1;break;case ISO_8859_13:if (c == 0xa8) return 1;if (c == 0xaa) return 1;if (c == 0xaf) return 1;if (c == 0xb2 || c == 0xb3 || c == 0xb5 || c == 0xb9) return 1;if (c >= 0xbc && c <= 0xbe) return 1;if (c == 0xb8) return 1;if (c == 0xba) return 1;if (c >= 0xbf && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xfe) return 1;break;case ISO_8859_14:if (c >= 0xa1 && c <= 0xff) {if (c == 0xa3 || c == 0xa7 || c == 0xa9 || c == 0xad || c == 0xae ||c == 0xb6) return 0;return 1;}break;case ISO_8859_15:if (c == 0xaa) return 1;if (c >= 0xb2 && c <= 0xb3) return 1;if (c == 0xb5) return 1;if (c >= 0xb9 && c <= 0xba) return 1;if (c >= 0xbc && c <= 0xbe) return 1;if (c >= 0xc0 && c <= 0xd6) return 1;if (c >= 0xd8 && c <= 0xf6) return 1;if (c >= 0xf8 && c <= 0xff) return 1;if (c == 0xa6) return 1;if (c == 0xa8) return 1;if (c == 0xb4) return 1;if (c == 0xb8) return 1;break;case ISO_8859_16:if (c == 0xa1) return 1;if (c == 0xa2) return 1;if (c == 0xa3) return 1;if (c == 0xa6) return 1;if (c == 0xa8) return 1;if (c == 0xaa) return 1;if (c == 0xac) return 1;if (c == 0xae) return 1;if (c == 0xaf) return 1;if (c == 0xb2) return 1;if (c == 0xb3) return 1;if (c == 0xb4) return 1;if (c >= 0xb8 && c <= 0xba) return 1;if (c == 0xbc) return 1;if (c == 0xbd) return 1;if (c == 0xbe) return 1;if (c == 0xbf) return 1;if (c >= 0xc0 && c <= 0xde) return 1;if (c >= 0xdf && c <= 0xff) return 1;break;case KOI8_R:if (c == 0x9d) return 1;if (c == 0xa3 || c == 0xb3) return 1;/* fall */case KOI8:if (c >= 0xc0 && c <= 0xff) return 1;break;default:exit(-1);}return 0;}static int IsAscii(int enc ARG_UNUSED, int c){if (c >= 0x00 && c <= 0x7f) return 1;return 0;}static int IsNewline(int enc ARG_UNUSED, int c){if (c == 0x0a) return 1;return 0;}static int exec(FILE* fp, ENC_INFO* einfo){#define NCOL 8int c, val, enc;enc = einfo->num;fprintf(fp, "static const unsigned short Enc%s_CtypeTable[256] = {\n",einfo->name);for (c = 0; c < 256; c++) {val = 0;if (IsNewline(enc, c)) val |= BIT_CTYPE_NEWLINE;if (IsAlpha (enc, c)) val |= (BIT_CTYPE_ALPHA | BIT_CTYPE_ALNUM);if (IsBlank (enc, c)) val |= BIT_CTYPE_BLANK;if (IsCntrl (enc, c)) val |= BIT_CTYPE_CNTRL;if (IsDigit (enc, c)) val |= (BIT_CTYPE_DIGIT | BIT_CTYPE_ALNUM);if (IsGraph (enc, c)) val |= BIT_CTYPE_GRAPH;if (IsLower (enc, c)) val |= BIT_CTYPE_LOWER;if (IsPrint (enc, c)) val |= BIT_CTYPE_PRINT;if (IsPunct (enc, c)) val |= BIT_CTYPE_PUNCT;if (IsSpace (enc, c)) val |= BIT_CTYPE_SPACE;if (IsUpper (enc, c)) val |= BIT_CTYPE_UPPER;if (IsXDigit(enc, c)) val |= BIT_CTYPE_XDIGIT;if (IsWord (enc, c)) val |= BIT_CTYPE_WORD;if (IsAscii (enc, c)) val |= BIT_CTYPE_ASCII;if (c % NCOL == 0) fputs(" ", fp);fprintf(fp, "0x%04x", val);if (c != 255) fputs(",", fp);if (c != 0 && c % NCOL == (NCOL-1))fputs("\n", fp);elsefputs(" ", fp);}fprintf(fp, "};\n");return 0;}extern int main(int argc ARG_UNUSED, char* argv[] ARG_UNUSED){int i;FILE* fp = stdout;setlocale(LC_ALL, "C");/* setlocale(LC_ALL, "POSIX"); *//* setlocale(LC_ALL, "en_GB.iso88591"); *//* setlocale(LC_ALL, "de_BE.iso88591"); *//* setlocale(LC_ALL, "fr_FR.iso88591"); */for (i = 0; i < (int )(sizeof(Info)/sizeof(ENC_INFO)); i++) {exec(fp, &Info[i]);}return 0;}
/**********************************************************************sjis.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"static const int EncLen_SJIS[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1};static const char SJIS_CAN_BE_TRAIL_TABLE[256] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0};#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1)#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]static intmbc_enc_len(const UChar* p){return EncLen_SJIS[*p];}static intcode_to_mbclen(OnigCodePoint code){if (code < 256) {if (EncLen_SJIS[(int )code] == 1)return 1;elsereturn 0;}else if (code <= 0xffff) {return 2;}elsereturn ONIGERR_INVALID_CODE_POINT_VALUE;}static OnigCodePointmbc_to_code(const UChar* p, const UChar* end){int c, i, len;OnigCodePoint n;len = enclen(ONIG_ENCODING_SJIS, p);c = *p++;n = c;if (len == 1) return n;for (i = 1; i < len; i++) {if (p >= end) break;c = *p++;n <<= 8; n += c;}return n;}static intcode_to_mbc(OnigCodePoint code, UChar *buf){UChar *p = buf;if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));*p++ = (UChar )(code & 0xff);#if 0if (enclen(ONIG_ENCODING_SJIS, buf) != (p - buf))return REGERR_INVALID_CODE_POINT_VALUE;#endifreturn p - buf;}static intmbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower){const UChar* p = *pp;if (ONIGENC_IS_MBC_ASCII(p)) {*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);(*pp)++;return 1;}else {int i;int len = enclen(ONIG_ENCODING_SJIS, p);for (i = 0; i < len; i++) {*lower++ = *p++;}(*pp) += len;return len; /* return byte length of converted char to lower */}}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_SJIS, flag, pp, end);}#endif#if 0static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (code < 128)return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);else {if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {return (code_to_mbclen(code) > 1 ? TRUE : FALSE);}}return FALSE;}#endifstatic UChar*left_adjust_char_head(const UChar* start, const UChar* s){const UChar *p;int len;if (s <= start) return (UChar* )s;p = s;if (SJIS_ISMB_TRAIL(*p)) {while (p > start) {if (! SJIS_ISMB_FIRST(*--p)) {p++;break;}}}len = enclen(ONIG_ENCODING_SJIS, p);if (p + len > s) return (UChar* )p;p += len;return (UChar* )(p + ((s - p) & ~1));}static intis_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED){const UChar c = *s;return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE);}static int PropertyInited = 0;static const OnigCodePoint** PropertyList;static int PropertyListNum;static int PropertyListSize;static hash_table_type* PropertyNameTable;static const OnigCodePoint CR_Hiragana[] = {1,0x829f, 0x82f1}; /* CR_Hiragana */static const OnigCodePoint CR_Katakana[] = {4,0x00a6, 0x00af,0x00b1, 0x00dd,0x8340, 0x837e,0x8380, 0x8396,}; /* CR_Katakana */static intinit_property_list(void){int r;PROPERTY_LIST_ADD_PROP("Hiragana", CR_Hiragana);PROPERTY_LIST_ADD_PROP("Katakana", CR_Katakana);PropertyInited = 1;end:return r;}static intproperty_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end){hash_data_type ctype;PROPERTY_LIST_INIT_CHECK;if (onig_st_lookup_strend(PropertyNameTable, p, end, &ctype) == 0) {return onigenc_minimum_property_name_to_ctype(enc, p, end);}return (int )ctype;}static intis_code_ctype(OnigCodePoint code, unsigned int ctype){if (ctype <= ONIGENC_MAX_STD_CTYPE) {if (code < 128)return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);else {if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {return (code_to_mbclen(code) > 1 ? TRUE : FALSE);}}}else {PROPERTY_LIST_INIT_CHECK;ctype -= (ONIGENC_MAX_STD_CTYPE + 1);if (ctype >= (unsigned int )PropertyListNum)return ONIGERR_TYPE_BUG;return onig_is_in_code_range((UChar* )PropertyList[ctype], code);}return FALSE;}static intget_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,const OnigCodePoint* ranges[]){if (ctype <= ONIGENC_MAX_STD_CTYPE) {return ONIG_NO_SUPPORT_CONFIG;}else {*sb_out = 0x80;PROPERTY_LIST_INIT_CHECK;ctype -= (ONIGENC_MAX_STD_CTYPE + 1);if (ctype >= (OnigCtype )PropertyListNum)return ONIGERR_TYPE_BUG;*ranges = PropertyList[ctype];return 0;}}OnigEncodingType OnigEncodingSJIS = {mbc_enc_len,"Shift_JIS", /* name */2, /* max byte length */1, /* min byte length */onigenc_is_mbc_newline_0x0a,mbc_to_code,code_to_mbclen,code_to_mbc,mbc_case_fold,onigenc_ascii_apply_all_case_fold,onigenc_ascii_get_case_fold_codes_by_str,property_name_to_ctype,is_code_ctype,get_ctype_code_range,left_adjust_char_head,is_allowed_reverse_match};
/**********************************************************************unicode.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code,ctype) \((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)#if 0#define ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(code,cbit) \((EncUNICODE_ISO_8859_1_CtypeTable[code] & (cbit)) != 0)#endifstatic const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x428c, 0x4289, 0x4288, 0x4288, 0x4288, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0288, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x30e2, 0x01a0, 0x00a0, 0x00a8, 0x00a0, 0x00a0,0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,0x00a0, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x01a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0,0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0,0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2};/* 'NEWLINE' */static const OnigCodePoint CR_NEWLINE[] = {1,0x000a, 0x000a}; /* CR_NEWLINE *//* 'Alpha': [[:Alpha:]] */static const OnigCodePoint CR_Alpha[] = {418,0x0041, 0x005a,0x0061, 0x007a,0x00aa, 0x00aa,0x00b5, 0x00b5,0x00ba, 0x00ba,0x00c0, 0x00d6,0x00d8, 0x00f6,0x00f8, 0x0241,0x0250, 0x02c1,0x02c6, 0x02d1,0x02e0, 0x02e4,0x02ee, 0x02ee,0x0300, 0x036f,0x037a, 0x037a,0x0386, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x03f5,0x03f7, 0x0481,0x0483, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x0559,0x0561, 0x0587,0x0591, 0x05b9,0x05bb, 0x05bd,0x05bf, 0x05bf,0x05c1, 0x05c2,0x05c4, 0x05c5,0x05c7, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f2,0x0610, 0x0615,0x0621, 0x063a,0x0640, 0x065e,0x066e, 0x06d3,0x06d5, 0x06dc,0x06de, 0x06e8,0x06ea, 0x06ef,0x06fa, 0x06fc,0x06ff, 0x06ff,0x0710, 0x074a,0x074d, 0x076d,0x0780, 0x07b1,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0963,0x097d, 0x097d,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09f0, 0x09f1,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a70, 0x0a74,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b71, 0x0b71,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df3,0x0e01, 0x0e3a,0x0e40, 0x0e4e,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0edc, 0x0edd,0x0f00, 0x0f00,0x0f18, 0x0f19,0x0f35, 0x0f35,0x0f37, 0x0f37,0x0f39, 0x0f39,0x0f3e, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f84,0x0f86, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fc6, 0x0fc6,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1050, 0x1059,0x10a0, 0x10c5,0x10d0, 0x10fa,0x10fc, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x135f,0x1380, 0x138f,0x13a0, 0x13f4,0x1401, 0x166c,0x166f, 0x1676,0x1681, 0x169a,0x16a0, 0x16ea,0x1700, 0x170c,0x170e, 0x1714,0x1720, 0x1734,0x1740, 0x1753,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773,0x1780, 0x17b3,0x17b6, 0x17d3,0x17d7, 0x17d7,0x17dc, 0x17dd,0x180b, 0x180d,0x1820, 0x1877,0x1880, 0x18a9,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1950, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19b0, 0x19c9,0x1a00, 0x1a1b,0x1d00, 0x1dc3,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fbc,0x1fbe, 0x1fbe,0x1fc2, 0x1fc4,0x1fc6, 0x1fcc,0x1fd0, 0x1fd3,0x1fd6, 0x1fdb,0x1fe0, 0x1fec,0x1ff2, 0x1ff4,0x1ff6, 0x1ffc,0x2071, 0x2071,0x207f, 0x207f,0x2090, 0x2094,0x20d0, 0x20eb,0x2102, 0x2102,0x2107, 0x2107,0x210a, 0x2113,0x2115, 0x2115,0x2119, 0x211d,0x2124, 0x2124,0x2126, 0x2126,0x2128, 0x2128,0x212a, 0x212d,0x212f, 0x2131,0x2133, 0x2139,0x213c, 0x213f,0x2145, 0x2149,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2ce4,0x2d00, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x3005, 0x3006,0x302a, 0x302f,0x3031, 0x3035,0x303b, 0x303c,0x3041, 0x3096,0x3099, 0x309a,0x309d, 0x309f,0x30a1, 0x30fa,0x30fc, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x31a0, 0x31b7,0x31f0, 0x31ff,0x3400, 0x4db5,0x4e00, 0x9fbb,0xa000, 0xa48c,0xa800, 0xa827,0xac00, 0xd7a3,0xf900, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb28,0xfb2a, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3d,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfb,0xfe00, 0xfe0f,0xfe20, 0xfe23,0xfe70, 0xfe74,0xfe76, 0xfefc,0xff21, 0xff3a,0xff41, 0xff5a,0xff66, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10300, 0x1031e,0x10330, 0x10349,0x10380, 0x1039d,0x103a0, 0x103c3,0x103c8, 0x103cf,0x10400, 0x1049d,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a3f,0x1d165, 0x1d169,0x1d16d, 0x1d172,0x1d17b, 0x1d182,0x1d185, 0x1d18b,0x1d1aa, 0x1d1ad,0x1d242, 0x1d244,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d6c0,0x1d6c2, 0x1d6da,0x1d6dc, 0x1d6fa,0x1d6fc, 0x1d714,0x1d716, 0x1d734,0x1d736, 0x1d74e,0x1d750, 0x1d76e,0x1d770, 0x1d788,0x1d78a, 0x1d7a8,0x1d7aa, 0x1d7c2,0x1d7c4, 0x1d7c9,0x20000, 0x2a6d6,0x2f800, 0x2fa1d,0xe0100, 0xe01ef}; /* CR_Alpha *//* 'Blank': [[:Blank:]] */static const OnigCodePoint CR_Blank[] = {9,0x0009, 0x0009,0x0020, 0x0020,0x00a0, 0x00a0,0x1680, 0x1680,0x180e, 0x180e,0x2000, 0x200a,0x202f, 0x202f,0x205f, 0x205f,0x3000, 0x3000}; /* CR_Blank *//* 'Cntrl': [[:Cntrl:]] */static const OnigCodePoint CR_Cntrl[] = {19,0x0000, 0x001f,0x007f, 0x009f,0x00ad, 0x00ad,0x0600, 0x0603,0x06dd, 0x06dd,0x070f, 0x070f,0x17b4, 0x17b5,0x200b, 0x200f,0x202a, 0x202e,0x2060, 0x2063,0x206a, 0x206f,0xd800, 0xf8ff,0xfeff, 0xfeff,0xfff9, 0xfffb,0x1d173, 0x1d17a,0xe0001, 0xe0001,0xe0020, 0xe007f,0xf0000, 0xffffd,0x100000, 0x10fffd}; /* CR_Cntrl *//* 'Digit': [[:Digit:]] */static const OnigCodePoint CR_Digit[] = {23,0x0030, 0x0039,0x0660, 0x0669,0x06f0, 0x06f9,0x0966, 0x096f,0x09e6, 0x09ef,0x0a66, 0x0a6f,0x0ae6, 0x0aef,0x0b66, 0x0b6f,0x0be6, 0x0bef,0x0c66, 0x0c6f,0x0ce6, 0x0cef,0x0d66, 0x0d6f,0x0e50, 0x0e59,0x0ed0, 0x0ed9,0x0f20, 0x0f29,0x1040, 0x1049,0x17e0, 0x17e9,0x1810, 0x1819,0x1946, 0x194f,0x19d0, 0x19d9,0xff10, 0xff19,0x104a0, 0x104a9,0x1d7ce, 0x1d7ff}; /* CR_Digit *//* 'Graph': [[:Graph:]] */static const OnigCodePoint CR_Graph[] = {424,0x0021, 0x007e,0x00a1, 0x0241,0x0250, 0x036f,0x0374, 0x0375,0x037a, 0x037a,0x037e, 0x037e,0x0384, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x055f,0x0561, 0x0587,0x0589, 0x058a,0x0591, 0x05b9,0x05bb, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f4,0x0600, 0x0603,0x060b, 0x0615,0x061b, 0x061b,0x061e, 0x061f,0x0621, 0x063a,0x0640, 0x065e,0x0660, 0x070d,0x070f, 0x074a,0x074d, 0x076d,0x0780, 0x07b1,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0970,0x097d, 0x097d,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09e6, 0x09fa,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a66, 0x0a74,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0ae6, 0x0aef,0x0af1, 0x0af1,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b66, 0x0b71,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0be6, 0x0bfa,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c66, 0x0c6f,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0ce6, 0x0cef,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d66, 0x0d6f,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df4,0x0e01, 0x0e3a,0x0e3f, 0x0e5b,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0ed0, 0x0ed9,0x0edc, 0x0edd,0x0f00, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fbe, 0x0fcc,0x0fcf, 0x0fd1,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1040, 0x1059,0x10a0, 0x10c5,0x10d0, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x137c,0x1380, 0x1399,0x13a0, 0x13f4,0x1401, 0x1676,0x1681, 0x169c,0x16a0, 0x16f0,0x1700, 0x170c,0x170e, 0x1714,0x1720, 0x1736,0x1740, 0x1753,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773,0x1780, 0x17dd,0x17e0, 0x17e9,0x17f0, 0x17f9,0x1800, 0x180d,0x1810, 0x1819,0x1820, 0x1877,0x1880, 0x18a9,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1940, 0x1940,0x1944, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19b0, 0x19c9,0x19d0, 0x19d9,0x19de, 0x1a1b,0x1a1e, 0x1a1f,0x1d00, 0x1dc3,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fc4,0x1fc6, 0x1fd3,0x1fd6, 0x1fdb,0x1fdd, 0x1fef,0x1ff2, 0x1ff4,0x1ff6, 0x1ffe,0x200b, 0x2027,0x202a, 0x202e,0x2030, 0x205e,0x2060, 0x2063,0x206a, 0x2071,0x2074, 0x208e,0x2090, 0x2094,0x20a0, 0x20b5,0x20d0, 0x20eb,0x2100, 0x214c,0x2153, 0x2183,0x2190, 0x23db,0x2400, 0x2426,0x2440, 0x244a,0x2460, 0x269c,0x26a0, 0x26b1,0x2701, 0x2704,0x2706, 0x2709,0x270c, 0x2727,0x2729, 0x274b,0x274d, 0x274d,0x274f, 0x2752,0x2756, 0x2756,0x2758, 0x275e,0x2761, 0x2794,0x2798, 0x27af,0x27b1, 0x27be,0x27c0, 0x27c6,0x27d0, 0x27eb,0x27f0, 0x2b13,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2cea,0x2cf9, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x2e00, 0x2e17,0x2e1c, 0x2e1d,0x2e80, 0x2e99,0x2e9b, 0x2ef3,0x2f00, 0x2fd5,0x2ff0, 0x2ffb,0x3001, 0x303f,0x3041, 0x3096,0x3099, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x3190, 0x31b7,0x31c0, 0x31cf,0x31f0, 0x321e,0x3220, 0x3243,0x3250, 0x32fe,0x3300, 0x4db5,0x4dc0, 0x9fbb,0xa000, 0xa48c,0xa490, 0xa4c6,0xa700, 0xa716,0xa800, 0xa82b,0xac00, 0xd7a3,0xe000, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3f,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfd,0xfe00, 0xfe19,0xfe20, 0xfe23,0xfe30, 0xfe52,0xfe54, 0xfe66,0xfe68, 0xfe6b,0xfe70, 0xfe74,0xfe76, 0xfefc,0xfeff, 0xfeff,0xff01, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0xffe0, 0xffe6,0xffe8, 0xffee,0xfff9, 0xfffd,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10100, 0x10102,0x10107, 0x10133,0x10137, 0x1018a,0x10300, 0x1031e,0x10320, 0x10323,0x10330, 0x1034a,0x10380, 0x1039d,0x1039f, 0x103c3,0x103c8, 0x103d5,0x10400, 0x1049d,0x104a0, 0x104a9,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a47,0x10a50, 0x10a58,0x1d000, 0x1d0f5,0x1d100, 0x1d126,0x1d12a, 0x1d1dd,0x1d200, 0x1d245,0x1d300, 0x1d356,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d7c9,0x1d7ce, 0x1d7ff,0x20000, 0x2a6d6,0x2f800, 0x2fa1d,0xe0001, 0xe0001,0xe0020, 0xe007f,0xe0100, 0xe01ef,0xf0000, 0xffffd,0x100000, 0x10fffd}; /* CR_Graph *//* 'Lower': [[:Lower:]] */static const OnigCodePoint CR_Lower[] = {480,0x0061, 0x007a,0x00aa, 0x00aa,0x00b5, 0x00b5,0x00ba, 0x00ba,0x00df, 0x00f6,0x00f8, 0x00ff,0x0101, 0x0101,0x0103, 0x0103,0x0105, 0x0105,0x0107, 0x0107,0x0109, 0x0109,0x010b, 0x010b,0x010d, 0x010d,0x010f, 0x010f,0x0111, 0x0111,0x0113, 0x0113,0x0115, 0x0115,0x0117, 0x0117,0x0119, 0x0119,0x011b, 0x011b,0x011d, 0x011d,0x011f, 0x011f,0x0121, 0x0121,0x0123, 0x0123,0x0125, 0x0125,0x0127, 0x0127,0x0129, 0x0129,0x012b, 0x012b,0x012d, 0x012d,0x012f, 0x012f,0x0131, 0x0131,0x0133, 0x0133,0x0135, 0x0135,0x0137, 0x0138,0x013a, 0x013a,0x013c, 0x013c,0x013e, 0x013e,0x0140, 0x0140,0x0142, 0x0142,0x0144, 0x0144,0x0146, 0x0146,0x0148, 0x0149,0x014b, 0x014b,0x014d, 0x014d,0x014f, 0x014f,0x0151, 0x0151,0x0153, 0x0153,0x0155, 0x0155,0x0157, 0x0157,0x0159, 0x0159,0x015b, 0x015b,0x015d, 0x015d,0x015f, 0x015f,0x0161, 0x0161,0x0163, 0x0163,0x0165, 0x0165,0x0167, 0x0167,0x0169, 0x0169,0x016b, 0x016b,0x016d, 0x016d,0x016f, 0x016f,0x0171, 0x0171,0x0173, 0x0173,0x0175, 0x0175,0x0177, 0x0177,0x017a, 0x017a,0x017c, 0x017c,0x017e, 0x0180,0x0183, 0x0183,0x0185, 0x0185,0x0188, 0x0188,0x018c, 0x018d,0x0192, 0x0192,0x0195, 0x0195,0x0199, 0x019b,0x019e, 0x019e,0x01a1, 0x01a1,0x01a3, 0x01a3,0x01a5, 0x01a5,0x01a8, 0x01a8,0x01aa, 0x01ab,0x01ad, 0x01ad,0x01b0, 0x01b0,0x01b4, 0x01b4,0x01b6, 0x01b6,0x01b9, 0x01ba,0x01bd, 0x01bf,0x01c6, 0x01c6,0x01c9, 0x01c9,0x01cc, 0x01cc,0x01ce, 0x01ce,0x01d0, 0x01d0,0x01d2, 0x01d2,0x01d4, 0x01d4,0x01d6, 0x01d6,0x01d8, 0x01d8,0x01da, 0x01da,0x01dc, 0x01dd,0x01df, 0x01df,0x01e1, 0x01e1,0x01e3, 0x01e3,0x01e5, 0x01e5,0x01e7, 0x01e7,0x01e9, 0x01e9,0x01eb, 0x01eb,0x01ed, 0x01ed,0x01ef, 0x01f0,0x01f3, 0x01f3,0x01f5, 0x01f5,0x01f9, 0x01f9,0x01fb, 0x01fb,0x01fd, 0x01fd,0x01ff, 0x01ff,0x0201, 0x0201,0x0203, 0x0203,0x0205, 0x0205,0x0207, 0x0207,0x0209, 0x0209,0x020b, 0x020b,0x020d, 0x020d,0x020f, 0x020f,0x0211, 0x0211,0x0213, 0x0213,0x0215, 0x0215,0x0217, 0x0217,0x0219, 0x0219,0x021b, 0x021b,0x021d, 0x021d,0x021f, 0x021f,0x0221, 0x0221,0x0223, 0x0223,0x0225, 0x0225,0x0227, 0x0227,0x0229, 0x0229,0x022b, 0x022b,0x022d, 0x022d,0x022f, 0x022f,0x0231, 0x0231,0x0233, 0x0239,0x023c, 0x023c,0x023f, 0x0240,0x0250, 0x02af,0x0390, 0x0390,0x03ac, 0x03ce,0x03d0, 0x03d1,0x03d5, 0x03d7,0x03d9, 0x03d9,0x03db, 0x03db,0x03dd, 0x03dd,0x03df, 0x03df,0x03e1, 0x03e1,0x03e3, 0x03e3,0x03e5, 0x03e5,0x03e7, 0x03e7,0x03e9, 0x03e9,0x03eb, 0x03eb,0x03ed, 0x03ed,0x03ef, 0x03f3,0x03f5, 0x03f5,0x03f8, 0x03f8,0x03fb, 0x03fc,0x0430, 0x045f,0x0461, 0x0461,0x0463, 0x0463,0x0465, 0x0465,0x0467, 0x0467,0x0469, 0x0469,0x046b, 0x046b,0x046d, 0x046d,0x046f, 0x046f,0x0471, 0x0471,0x0473, 0x0473,0x0475, 0x0475,0x0477, 0x0477,0x0479, 0x0479,0x047b, 0x047b,0x047d, 0x047d,0x047f, 0x047f,0x0481, 0x0481,0x048b, 0x048b,0x048d, 0x048d,0x048f, 0x048f,0x0491, 0x0491,0x0493, 0x0493,0x0495, 0x0495,0x0497, 0x0497,0x0499, 0x0499,0x049b, 0x049b,0x049d, 0x049d,0x049f, 0x049f,0x04a1, 0x04a1,0x04a3, 0x04a3,0x04a5, 0x04a5,0x04a7, 0x04a7,0x04a9, 0x04a9,0x04ab, 0x04ab,0x04ad, 0x04ad,0x04af, 0x04af,0x04b1, 0x04b1,0x04b3, 0x04b3,0x04b5, 0x04b5,0x04b7, 0x04b7,0x04b9, 0x04b9,0x04bb, 0x04bb,0x04bd, 0x04bd,0x04bf, 0x04bf,0x04c2, 0x04c2,0x04c4, 0x04c4,0x04c6, 0x04c6,0x04c8, 0x04c8,0x04ca, 0x04ca,0x04cc, 0x04cc,0x04ce, 0x04ce,0x04d1, 0x04d1,0x04d3, 0x04d3,0x04d5, 0x04d5,0x04d7, 0x04d7,0x04d9, 0x04d9,0x04db, 0x04db,0x04dd, 0x04dd,0x04df, 0x04df,0x04e1, 0x04e1,0x04e3, 0x04e3,0x04e5, 0x04e5,0x04e7, 0x04e7,0x04e9, 0x04e9,0x04eb, 0x04eb,0x04ed, 0x04ed,0x04ef, 0x04ef,0x04f1, 0x04f1,0x04f3, 0x04f3,0x04f5, 0x04f5,0x04f7, 0x04f7,0x04f9, 0x04f9,0x0501, 0x0501,0x0503, 0x0503,0x0505, 0x0505,0x0507, 0x0507,0x0509, 0x0509,0x050b, 0x050b,0x050d, 0x050d,0x050f, 0x050f,0x0561, 0x0587,0x1d00, 0x1d2b,0x1d62, 0x1d77,0x1d79, 0x1d9a,0x1e01, 0x1e01,0x1e03, 0x1e03,0x1e05, 0x1e05,0x1e07, 0x1e07,0x1e09, 0x1e09,0x1e0b, 0x1e0b,0x1e0d, 0x1e0d,0x1e0f, 0x1e0f,0x1e11, 0x1e11,0x1e13, 0x1e13,0x1e15, 0x1e15,0x1e17, 0x1e17,0x1e19, 0x1e19,0x1e1b, 0x1e1b,0x1e1d, 0x1e1d,0x1e1f, 0x1e1f,0x1e21, 0x1e21,0x1e23, 0x1e23,0x1e25, 0x1e25,0x1e27, 0x1e27,0x1e29, 0x1e29,0x1e2b, 0x1e2b,0x1e2d, 0x1e2d,0x1e2f, 0x1e2f,0x1e31, 0x1e31,0x1e33, 0x1e33,0x1e35, 0x1e35,0x1e37, 0x1e37,0x1e39, 0x1e39,0x1e3b, 0x1e3b,0x1e3d, 0x1e3d,0x1e3f, 0x1e3f,0x1e41, 0x1e41,0x1e43, 0x1e43,0x1e45, 0x1e45,0x1e47, 0x1e47,0x1e49, 0x1e49,0x1e4b, 0x1e4b,0x1e4d, 0x1e4d,0x1e4f, 0x1e4f,0x1e51, 0x1e51,0x1e53, 0x1e53,0x1e55, 0x1e55,0x1e57, 0x1e57,0x1e59, 0x1e59,0x1e5b, 0x1e5b,0x1e5d, 0x1e5d,0x1e5f, 0x1e5f,0x1e61, 0x1e61,0x1e63, 0x1e63,0x1e65, 0x1e65,0x1e67, 0x1e67,0x1e69, 0x1e69,0x1e6b, 0x1e6b,0x1e6d, 0x1e6d,0x1e6f, 0x1e6f,0x1e71, 0x1e71,0x1e73, 0x1e73,0x1e75, 0x1e75,0x1e77, 0x1e77,0x1e79, 0x1e79,0x1e7b, 0x1e7b,0x1e7d, 0x1e7d,0x1e7f, 0x1e7f,0x1e81, 0x1e81,0x1e83, 0x1e83,0x1e85, 0x1e85,0x1e87, 0x1e87,0x1e89, 0x1e89,0x1e8b, 0x1e8b,0x1e8d, 0x1e8d,0x1e8f, 0x1e8f,0x1e91, 0x1e91,0x1e93, 0x1e93,0x1e95, 0x1e9b,0x1ea1, 0x1ea1,0x1ea3, 0x1ea3,0x1ea5, 0x1ea5,0x1ea7, 0x1ea7,0x1ea9, 0x1ea9,0x1eab, 0x1eab,0x1ead, 0x1ead,0x1eaf, 0x1eaf,0x1eb1, 0x1eb1,0x1eb3, 0x1eb3,0x1eb5, 0x1eb5,0x1eb7, 0x1eb7,0x1eb9, 0x1eb9,0x1ebb, 0x1ebb,0x1ebd, 0x1ebd,0x1ebf, 0x1ebf,0x1ec1, 0x1ec1,0x1ec3, 0x1ec3,0x1ec5, 0x1ec5,0x1ec7, 0x1ec7,0x1ec9, 0x1ec9,0x1ecb, 0x1ecb,0x1ecd, 0x1ecd,0x1ecf, 0x1ecf,0x1ed1, 0x1ed1,0x1ed3, 0x1ed3,0x1ed5, 0x1ed5,0x1ed7, 0x1ed7,0x1ed9, 0x1ed9,0x1edb, 0x1edb,0x1edd, 0x1edd,0x1edf, 0x1edf,0x1ee1, 0x1ee1,0x1ee3, 0x1ee3,0x1ee5, 0x1ee5,0x1ee7, 0x1ee7,0x1ee9, 0x1ee9,0x1eeb, 0x1eeb,0x1eed, 0x1eed,0x1eef, 0x1eef,0x1ef1, 0x1ef1,0x1ef3, 0x1ef3,0x1ef5, 0x1ef5,0x1ef7, 0x1ef7,0x1ef9, 0x1ef9,0x1f00, 0x1f07,0x1f10, 0x1f15,0x1f20, 0x1f27,0x1f30, 0x1f37,0x1f40, 0x1f45,0x1f50, 0x1f57,0x1f60, 0x1f67,0x1f70, 0x1f7d,0x1f80, 0x1f87,0x1f90, 0x1f97,0x1fa0, 0x1fa7,0x1fb0, 0x1fb4,0x1fb6, 0x1fb7,0x1fbe, 0x1fbe,0x1fc2, 0x1fc4,0x1fc6, 0x1fc7,0x1fd0, 0x1fd3,0x1fd6, 0x1fd7,0x1fe0, 0x1fe7,0x1ff2, 0x1ff4,0x1ff6, 0x1ff7,0x2071, 0x2071,0x207f, 0x207f,0x210a, 0x210a,0x210e, 0x210f,0x2113, 0x2113,0x212f, 0x212f,0x2134, 0x2134,0x2139, 0x2139,0x213c, 0x213d,0x2146, 0x2149,0x2c30, 0x2c5e,0x2c81, 0x2c81,0x2c83, 0x2c83,0x2c85, 0x2c85,0x2c87, 0x2c87,0x2c89, 0x2c89,0x2c8b, 0x2c8b,0x2c8d, 0x2c8d,0x2c8f, 0x2c8f,0x2c91, 0x2c91,0x2c93, 0x2c93,0x2c95, 0x2c95,0x2c97, 0x2c97,0x2c99, 0x2c99,0x2c9b, 0x2c9b,0x2c9d, 0x2c9d,0x2c9f, 0x2c9f,0x2ca1, 0x2ca1,0x2ca3, 0x2ca3,0x2ca5, 0x2ca5,0x2ca7, 0x2ca7,0x2ca9, 0x2ca9,0x2cab, 0x2cab,0x2cad, 0x2cad,0x2caf, 0x2caf,0x2cb1, 0x2cb1,0x2cb3, 0x2cb3,0x2cb5, 0x2cb5,0x2cb7, 0x2cb7,0x2cb9, 0x2cb9,0x2cbb, 0x2cbb,0x2cbd, 0x2cbd,0x2cbf, 0x2cbf,0x2cc1, 0x2cc1,0x2cc3, 0x2cc3,0x2cc5, 0x2cc5,0x2cc7, 0x2cc7,0x2cc9, 0x2cc9,0x2ccb, 0x2ccb,0x2ccd, 0x2ccd,0x2ccf, 0x2ccf,0x2cd1, 0x2cd1,0x2cd3, 0x2cd3,0x2cd5, 0x2cd5,0x2cd7, 0x2cd7,0x2cd9, 0x2cd9,0x2cdb, 0x2cdb,0x2cdd, 0x2cdd,0x2cdf, 0x2cdf,0x2ce1, 0x2ce1,0x2ce3, 0x2ce4,0x2d00, 0x2d25,0xfb00, 0xfb06,0xfb13, 0xfb17,0xff41, 0xff5a,0x10428, 0x1044f,0x1d41a, 0x1d433,0x1d44e, 0x1d454,0x1d456, 0x1d467,0x1d482, 0x1d49b,0x1d4b6, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d4cf,0x1d4ea, 0x1d503,0x1d51e, 0x1d537,0x1d552, 0x1d56b,0x1d586, 0x1d59f,0x1d5ba, 0x1d5d3,0x1d5ee, 0x1d607,0x1d622, 0x1d63b,0x1d656, 0x1d66f,0x1d68a, 0x1d6a5,0x1d6c2, 0x1d6da,0x1d6dc, 0x1d6e1,0x1d6fc, 0x1d714,0x1d716, 0x1d71b,0x1d736, 0x1d74e,0x1d750, 0x1d755,0x1d770, 0x1d788,0x1d78a, 0x1d78f,0x1d7aa, 0x1d7c2,0x1d7c4, 0x1d7c9}; /* CR_Lower *//* 'Print': [[:Print:]] */static const OnigCodePoint CR_Print[] = {423,0x0009, 0x000d,0x0020, 0x007e,0x0085, 0x0085,0x00a0, 0x0241,0x0250, 0x036f,0x0374, 0x0375,0x037a, 0x037a,0x037e, 0x037e,0x0384, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x055f,0x0561, 0x0587,0x0589, 0x058a,0x0591, 0x05b9,0x05bb, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f4,0x0600, 0x0603,0x060b, 0x0615,0x061b, 0x061b,0x061e, 0x061f,0x0621, 0x063a,0x0640, 0x065e,0x0660, 0x070d,0x070f, 0x074a,0x074d, 0x076d,0x0780, 0x07b1,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0970,0x097d, 0x097d,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09e6, 0x09fa,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a66, 0x0a74,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0ae6, 0x0aef,0x0af1, 0x0af1,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b66, 0x0b71,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0be6, 0x0bfa,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c66, 0x0c6f,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0ce6, 0x0cef,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d66, 0x0d6f,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df4,0x0e01, 0x0e3a,0x0e3f, 0x0e5b,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0ed0, 0x0ed9,0x0edc, 0x0edd,0x0f00, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fbe, 0x0fcc,0x0fcf, 0x0fd1,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1040, 0x1059,0x10a0, 0x10c5,0x10d0, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x137c,0x1380, 0x1399,0x13a0, 0x13f4,0x1401, 0x1676,0x1680, 0x169c,0x16a0, 0x16f0,0x1700, 0x170c,0x170e, 0x1714,0x1720, 0x1736,0x1740, 0x1753,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773,0x1780, 0x17dd,0x17e0, 0x17e9,0x17f0, 0x17f9,0x1800, 0x180e,0x1810, 0x1819,0x1820, 0x1877,0x1880, 0x18a9,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1940, 0x1940,0x1944, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19b0, 0x19c9,0x19d0, 0x19d9,0x19de, 0x1a1b,0x1a1e, 0x1a1f,0x1d00, 0x1dc3,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fc4,0x1fc6, 0x1fd3,0x1fd6, 0x1fdb,0x1fdd, 0x1fef,0x1ff2, 0x1ff4,0x1ff6, 0x1ffe,0x2000, 0x2063,0x206a, 0x2071,0x2074, 0x208e,0x2090, 0x2094,0x20a0, 0x20b5,0x20d0, 0x20eb,0x2100, 0x214c,0x2153, 0x2183,0x2190, 0x23db,0x2400, 0x2426,0x2440, 0x244a,0x2460, 0x269c,0x26a0, 0x26b1,0x2701, 0x2704,0x2706, 0x2709,0x270c, 0x2727,0x2729, 0x274b,0x274d, 0x274d,0x274f, 0x2752,0x2756, 0x2756,0x2758, 0x275e,0x2761, 0x2794,0x2798, 0x27af,0x27b1, 0x27be,0x27c0, 0x27c6,0x27d0, 0x27eb,0x27f0, 0x2b13,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2cea,0x2cf9, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x2e00, 0x2e17,0x2e1c, 0x2e1d,0x2e80, 0x2e99,0x2e9b, 0x2ef3,0x2f00, 0x2fd5,0x2ff0, 0x2ffb,0x3000, 0x303f,0x3041, 0x3096,0x3099, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x3190, 0x31b7,0x31c0, 0x31cf,0x31f0, 0x321e,0x3220, 0x3243,0x3250, 0x32fe,0x3300, 0x4db5,0x4dc0, 0x9fbb,0xa000, 0xa48c,0xa490, 0xa4c6,0xa700, 0xa716,0xa800, 0xa82b,0xac00, 0xd7a3,0xe000, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3f,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfd,0xfe00, 0xfe19,0xfe20, 0xfe23,0xfe30, 0xfe52,0xfe54, 0xfe66,0xfe68, 0xfe6b,0xfe70, 0xfe74,0xfe76, 0xfefc,0xfeff, 0xfeff,0xff01, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0xffe0, 0xffe6,0xffe8, 0xffee,0xfff9, 0xfffd,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10100, 0x10102,0x10107, 0x10133,0x10137, 0x1018a,0x10300, 0x1031e,0x10320, 0x10323,0x10330, 0x1034a,0x10380, 0x1039d,0x1039f, 0x103c3,0x103c8, 0x103d5,0x10400, 0x1049d,0x104a0, 0x104a9,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a47,0x10a50, 0x10a58,0x1d000, 0x1d0f5,0x1d100, 0x1d126,0x1d12a, 0x1d1dd,0x1d200, 0x1d245,0x1d300, 0x1d356,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d7c9,0x1d7ce, 0x1d7ff,0x20000, 0x2a6d6,0x2f800, 0x2fa1d,0xe0001, 0xe0001,0xe0020, 0xe007f,0xe0100, 0xe01ef,0xf0000, 0xffffd,0x100000, 0x10fffd}; /* CR_Print *//* 'Punct': [[:Punct:]] */static const OnigCodePoint CR_Punct[] = {96,0x0021, 0x0023,0x0025, 0x002a,0x002c, 0x002f,0x003a, 0x003b,0x003f, 0x0040,0x005b, 0x005d,0x005f, 0x005f,0x007b, 0x007b,0x007d, 0x007d,0x00a1, 0x00a1,0x00ab, 0x00ab,0x00b7, 0x00b7,0x00bb, 0x00bb,0x00bf, 0x00bf,0x037e, 0x037e,0x0387, 0x0387,0x055a, 0x055f,0x0589, 0x058a,0x05be, 0x05be,0x05c0, 0x05c0,0x05c3, 0x05c3,0x05c6, 0x05c6,0x05f3, 0x05f4,0x060c, 0x060d,0x061b, 0x061b,0x061e, 0x061f,0x066a, 0x066d,0x06d4, 0x06d4,0x0700, 0x070d,0x0964, 0x0965,0x0970, 0x0970,0x0df4, 0x0df4,0x0e4f, 0x0e4f,0x0e5a, 0x0e5b,0x0f04, 0x0f12,0x0f3a, 0x0f3d,0x0f85, 0x0f85,0x0fd0, 0x0fd1,0x104a, 0x104f,0x10fb, 0x10fb,0x1361, 0x1368,0x166d, 0x166e,0x169b, 0x169c,0x16eb, 0x16ed,0x1735, 0x1736,0x17d4, 0x17d6,0x17d8, 0x17da,0x1800, 0x180a,0x1944, 0x1945,0x19de, 0x19df,0x1a1e, 0x1a1f,0x2010, 0x2027,0x2030, 0x2043,0x2045, 0x2051,0x2053, 0x205e,0x207d, 0x207e,0x208d, 0x208e,0x2329, 0x232a,0x23b4, 0x23b6,0x2768, 0x2775,0x27c5, 0x27c6,0x27e6, 0x27eb,0x2983, 0x2998,0x29d8, 0x29db,0x29fc, 0x29fd,0x2cf9, 0x2cfc,0x2cfe, 0x2cff,0x2e00, 0x2e17,0x2e1c, 0x2e1d,0x3001, 0x3003,0x3008, 0x3011,0x3014, 0x301f,0x3030, 0x3030,0x303d, 0x303d,0x30a0, 0x30a0,0x30fb, 0x30fb,0xfd3e, 0xfd3f,0xfe10, 0xfe19,0xfe30, 0xfe52,0xfe54, 0xfe61,0xfe63, 0xfe63,0xfe68, 0xfe68,0xfe6a, 0xfe6b,0xff01, 0xff03,0xff05, 0xff0a,0xff0c, 0xff0f,0xff1a, 0xff1b,0xff1f, 0xff20,0xff3b, 0xff3d,0xff3f, 0xff3f,0xff5b, 0xff5b,0xff5d, 0xff5d,0xff5f, 0xff65,0x10100, 0x10101,0x1039f, 0x1039f,0x10a50, 0x10a58}; /* CR_Punct *//* 'Space': [[:Space:]] */static const OnigCodePoint CR_Space[] = {11,0x0009, 0x000d,0x0020, 0x0020,0x0085, 0x0085,0x00a0, 0x00a0,0x1680, 0x1680,0x180e, 0x180e,0x2000, 0x200a,0x2028, 0x2029,0x202f, 0x202f,0x205f, 0x205f,0x3000, 0x3000}; /* CR_Space *//* 'Upper': [[:Upper:]] */static const OnigCodePoint CR_Upper[] = {476,0x0041, 0x005a,0x00c0, 0x00d6,0x00d8, 0x00de,0x0100, 0x0100,0x0102, 0x0102,0x0104, 0x0104,0x0106, 0x0106,0x0108, 0x0108,0x010a, 0x010a,0x010c, 0x010c,0x010e, 0x010e,0x0110, 0x0110,0x0112, 0x0112,0x0114, 0x0114,0x0116, 0x0116,0x0118, 0x0118,0x011a, 0x011a,0x011c, 0x011c,0x011e, 0x011e,0x0120, 0x0120,0x0122, 0x0122,0x0124, 0x0124,0x0126, 0x0126,0x0128, 0x0128,0x012a, 0x012a,0x012c, 0x012c,0x012e, 0x012e,0x0130, 0x0130,0x0132, 0x0132,0x0134, 0x0134,0x0136, 0x0136,0x0139, 0x0139,0x013b, 0x013b,0x013d, 0x013d,0x013f, 0x013f,0x0141, 0x0141,0x0143, 0x0143,0x0145, 0x0145,0x0147, 0x0147,0x014a, 0x014a,0x014c, 0x014c,0x014e, 0x014e,0x0150, 0x0150,0x0152, 0x0152,0x0154, 0x0154,0x0156, 0x0156,0x0158, 0x0158,0x015a, 0x015a,0x015c, 0x015c,0x015e, 0x015e,0x0160, 0x0160,0x0162, 0x0162,0x0164, 0x0164,0x0166, 0x0166,0x0168, 0x0168,0x016a, 0x016a,0x016c, 0x016c,0x016e, 0x016e,0x0170, 0x0170,0x0172, 0x0172,0x0174, 0x0174,0x0176, 0x0176,0x0178, 0x0179,0x017b, 0x017b,0x017d, 0x017d,0x0181, 0x0182,0x0184, 0x0184,0x0186, 0x0187,0x0189, 0x018b,0x018e, 0x0191,0x0193, 0x0194,0x0196, 0x0198,0x019c, 0x019d,0x019f, 0x01a0,0x01a2, 0x01a2,0x01a4, 0x01a4,0x01a6, 0x01a7,0x01a9, 0x01a9,0x01ac, 0x01ac,0x01ae, 0x01af,0x01b1, 0x01b3,0x01b5, 0x01b5,0x01b7, 0x01b8,0x01bc, 0x01bc,0x01c4, 0x01c4,0x01c7, 0x01c7,0x01ca, 0x01ca,0x01cd, 0x01cd,0x01cf, 0x01cf,0x01d1, 0x01d1,0x01d3, 0x01d3,0x01d5, 0x01d5,0x01d7, 0x01d7,0x01d9, 0x01d9,0x01db, 0x01db,0x01de, 0x01de,0x01e0, 0x01e0,0x01e2, 0x01e2,0x01e4, 0x01e4,0x01e6, 0x01e6,0x01e8, 0x01e8,0x01ea, 0x01ea,0x01ec, 0x01ec,0x01ee, 0x01ee,0x01f1, 0x01f1,0x01f4, 0x01f4,0x01f6, 0x01f8,0x01fa, 0x01fa,0x01fc, 0x01fc,0x01fe, 0x01fe,0x0200, 0x0200,0x0202, 0x0202,0x0204, 0x0204,0x0206, 0x0206,0x0208, 0x0208,0x020a, 0x020a,0x020c, 0x020c,0x020e, 0x020e,0x0210, 0x0210,0x0212, 0x0212,0x0214, 0x0214,0x0216, 0x0216,0x0218, 0x0218,0x021a, 0x021a,0x021c, 0x021c,0x021e, 0x021e,0x0220, 0x0220,0x0222, 0x0222,0x0224, 0x0224,0x0226, 0x0226,0x0228, 0x0228,0x022a, 0x022a,0x022c, 0x022c,0x022e, 0x022e,0x0230, 0x0230,0x0232, 0x0232,0x023a, 0x023b,0x023d, 0x023e,0x0241, 0x0241,0x0386, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x038f,0x0391, 0x03a1,0x03a3, 0x03ab,0x03d2, 0x03d4,0x03d8, 0x03d8,0x03da, 0x03da,0x03dc, 0x03dc,0x03de, 0x03de,0x03e0, 0x03e0,0x03e2, 0x03e2,0x03e4, 0x03e4,0x03e6, 0x03e6,0x03e8, 0x03e8,0x03ea, 0x03ea,0x03ec, 0x03ec,0x03ee, 0x03ee,0x03f4, 0x03f4,0x03f7, 0x03f7,0x03f9, 0x03fa,0x03fd, 0x042f,0x0460, 0x0460,0x0462, 0x0462,0x0464, 0x0464,0x0466, 0x0466,0x0468, 0x0468,0x046a, 0x046a,0x046c, 0x046c,0x046e, 0x046e,0x0470, 0x0470,0x0472, 0x0472,0x0474, 0x0474,0x0476, 0x0476,0x0478, 0x0478,0x047a, 0x047a,0x047c, 0x047c,0x047e, 0x047e,0x0480, 0x0480,0x048a, 0x048a,0x048c, 0x048c,0x048e, 0x048e,0x0490, 0x0490,0x0492, 0x0492,0x0494, 0x0494,0x0496, 0x0496,0x0498, 0x0498,0x049a, 0x049a,0x049c, 0x049c,0x049e, 0x049e,0x04a0, 0x04a0,0x04a2, 0x04a2,0x04a4, 0x04a4,0x04a6, 0x04a6,0x04a8, 0x04a8,0x04aa, 0x04aa,0x04ac, 0x04ac,0x04ae, 0x04ae,0x04b0, 0x04b0,0x04b2, 0x04b2,0x04b4, 0x04b4,0x04b6, 0x04b6,0x04b8, 0x04b8,0x04ba, 0x04ba,0x04bc, 0x04bc,0x04be, 0x04be,0x04c0, 0x04c1,0x04c3, 0x04c3,0x04c5, 0x04c5,0x04c7, 0x04c7,0x04c9, 0x04c9,0x04cb, 0x04cb,0x04cd, 0x04cd,0x04d0, 0x04d0,0x04d2, 0x04d2,0x04d4, 0x04d4,0x04d6, 0x04d6,0x04d8, 0x04d8,0x04da, 0x04da,0x04dc, 0x04dc,0x04de, 0x04de,0x04e0, 0x04e0,0x04e2, 0x04e2,0x04e4, 0x04e4,0x04e6, 0x04e6,0x04e8, 0x04e8,0x04ea, 0x04ea,0x04ec, 0x04ec,0x04ee, 0x04ee,0x04f0, 0x04f0,0x04f2, 0x04f2,0x04f4, 0x04f4,0x04f6, 0x04f6,0x04f8, 0x04f8,0x0500, 0x0500,0x0502, 0x0502,0x0504, 0x0504,0x0506, 0x0506,0x0508, 0x0508,0x050a, 0x050a,0x050c, 0x050c,0x050e, 0x050e,0x0531, 0x0556,0x10a0, 0x10c5,0x1e00, 0x1e00,0x1e02, 0x1e02,0x1e04, 0x1e04,0x1e06, 0x1e06,0x1e08, 0x1e08,0x1e0a, 0x1e0a,0x1e0c, 0x1e0c,0x1e0e, 0x1e0e,0x1e10, 0x1e10,0x1e12, 0x1e12,0x1e14, 0x1e14,0x1e16, 0x1e16,0x1e18, 0x1e18,0x1e1a, 0x1e1a,0x1e1c, 0x1e1c,0x1e1e, 0x1e1e,0x1e20, 0x1e20,0x1e22, 0x1e22,0x1e24, 0x1e24,0x1e26, 0x1e26,0x1e28, 0x1e28,0x1e2a, 0x1e2a,0x1e2c, 0x1e2c,0x1e2e, 0x1e2e,0x1e30, 0x1e30,0x1e32, 0x1e32,0x1e34, 0x1e34,0x1e36, 0x1e36,0x1e38, 0x1e38,0x1e3a, 0x1e3a,0x1e3c, 0x1e3c,0x1e3e, 0x1e3e,0x1e40, 0x1e40,0x1e42, 0x1e42,0x1e44, 0x1e44,0x1e46, 0x1e46,0x1e48, 0x1e48,0x1e4a, 0x1e4a,0x1e4c, 0x1e4c,0x1e4e, 0x1e4e,0x1e50, 0x1e50,0x1e52, 0x1e52,0x1e54, 0x1e54,0x1e56, 0x1e56,0x1e58, 0x1e58,0x1e5a, 0x1e5a,0x1e5c, 0x1e5c,0x1e5e, 0x1e5e,0x1e60, 0x1e60,0x1e62, 0x1e62,0x1e64, 0x1e64,0x1e66, 0x1e66,0x1e68, 0x1e68,0x1e6a, 0x1e6a,0x1e6c, 0x1e6c,0x1e6e, 0x1e6e,0x1e70, 0x1e70,0x1e72, 0x1e72,0x1e74, 0x1e74,0x1e76, 0x1e76,0x1e78, 0x1e78,0x1e7a, 0x1e7a,0x1e7c, 0x1e7c,0x1e7e, 0x1e7e,0x1e80, 0x1e80,0x1e82, 0x1e82,0x1e84, 0x1e84,0x1e86, 0x1e86,0x1e88, 0x1e88,0x1e8a, 0x1e8a,0x1e8c, 0x1e8c,0x1e8e, 0x1e8e,0x1e90, 0x1e90,0x1e92, 0x1e92,0x1e94, 0x1e94,0x1ea0, 0x1ea0,0x1ea2, 0x1ea2,0x1ea4, 0x1ea4,0x1ea6, 0x1ea6,0x1ea8, 0x1ea8,0x1eaa, 0x1eaa,0x1eac, 0x1eac,0x1eae, 0x1eae,0x1eb0, 0x1eb0,0x1eb2, 0x1eb2,0x1eb4, 0x1eb4,0x1eb6, 0x1eb6,0x1eb8, 0x1eb8,0x1eba, 0x1eba,0x1ebc, 0x1ebc,0x1ebe, 0x1ebe,0x1ec0, 0x1ec0,0x1ec2, 0x1ec2,0x1ec4, 0x1ec4,0x1ec6, 0x1ec6,0x1ec8, 0x1ec8,0x1eca, 0x1eca,0x1ecc, 0x1ecc,0x1ece, 0x1ece,0x1ed0, 0x1ed0,0x1ed2, 0x1ed2,0x1ed4, 0x1ed4,0x1ed6, 0x1ed6,0x1ed8, 0x1ed8,0x1eda, 0x1eda,0x1edc, 0x1edc,0x1ede, 0x1ede,0x1ee0, 0x1ee0,0x1ee2, 0x1ee2,0x1ee4, 0x1ee4,0x1ee6, 0x1ee6,0x1ee8, 0x1ee8,0x1eea, 0x1eea,0x1eec, 0x1eec,0x1eee, 0x1eee,0x1ef0, 0x1ef0,0x1ef2, 0x1ef2,0x1ef4, 0x1ef4,0x1ef6, 0x1ef6,0x1ef8, 0x1ef8,0x1f08, 0x1f0f,0x1f18, 0x1f1d,0x1f28, 0x1f2f,0x1f38, 0x1f3f,0x1f48, 0x1f4d,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f5f,0x1f68, 0x1f6f,0x1fb8, 0x1fbb,0x1fc8, 0x1fcb,0x1fd8, 0x1fdb,0x1fe8, 0x1fec,0x1ff8, 0x1ffb,0x2102, 0x2102,0x2107, 0x2107,0x210b, 0x210d,0x2110, 0x2112,0x2115, 0x2115,0x2119, 0x211d,0x2124, 0x2124,0x2126, 0x2126,0x2128, 0x2128,0x212a, 0x212d,0x2130, 0x2131,0x2133, 0x2133,0x213e, 0x213f,0x2145, 0x2145,0x2c00, 0x2c2e,0x2c80, 0x2c80,0x2c82, 0x2c82,0x2c84, 0x2c84,0x2c86, 0x2c86,0x2c88, 0x2c88,0x2c8a, 0x2c8a,0x2c8c, 0x2c8c,0x2c8e, 0x2c8e,0x2c90, 0x2c90,0x2c92, 0x2c92,0x2c94, 0x2c94,0x2c96, 0x2c96,0x2c98, 0x2c98,0x2c9a, 0x2c9a,0x2c9c, 0x2c9c,0x2c9e, 0x2c9e,0x2ca0, 0x2ca0,0x2ca2, 0x2ca2,0x2ca4, 0x2ca4,0x2ca6, 0x2ca6,0x2ca8, 0x2ca8,0x2caa, 0x2caa,0x2cac, 0x2cac,0x2cae, 0x2cae,0x2cb0, 0x2cb0,0x2cb2, 0x2cb2,0x2cb4, 0x2cb4,0x2cb6, 0x2cb6,0x2cb8, 0x2cb8,0x2cba, 0x2cba,0x2cbc, 0x2cbc,0x2cbe, 0x2cbe,0x2cc0, 0x2cc0,0x2cc2, 0x2cc2,0x2cc4, 0x2cc4,0x2cc6, 0x2cc6,0x2cc8, 0x2cc8,0x2cca, 0x2cca,0x2ccc, 0x2ccc,0x2cce, 0x2cce,0x2cd0, 0x2cd0,0x2cd2, 0x2cd2,0x2cd4, 0x2cd4,0x2cd6, 0x2cd6,0x2cd8, 0x2cd8,0x2cda, 0x2cda,0x2cdc, 0x2cdc,0x2cde, 0x2cde,0x2ce0, 0x2ce0,0x2ce2, 0x2ce2,0xff21, 0xff3a,0x10400, 0x10427,0x1d400, 0x1d419,0x1d434, 0x1d44d,0x1d468, 0x1d481,0x1d49c, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b5,0x1d4d0, 0x1d4e9,0x1d504, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d538, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d56c, 0x1d585,0x1d5a0, 0x1d5b9,0x1d5d4, 0x1d5ed,0x1d608, 0x1d621,0x1d63c, 0x1d655,0x1d670, 0x1d689,0x1d6a8, 0x1d6c0,0x1d6e2, 0x1d6fa,0x1d71c, 0x1d734,0x1d756, 0x1d76e,0x1d790, 0x1d7a8}; /* CR_Upper *//* 'XDigit': [[:XDigit:]] */static const OnigCodePoint CR_XDigit[] = {3,0x0030, 0x0039,0x0041, 0x0046,0x0061, 0x0066}; /* CR_XDigit *//* 'Word': [[:Word:]] */static const OnigCodePoint CR_Word[] = {464,0x0030, 0x0039,0x0041, 0x005a,0x005f, 0x005f,0x0061, 0x007a,0x00aa, 0x00aa,0x00b2, 0x00b3,0x00b5, 0x00b5,0x00b9, 0x00ba,0x00bc, 0x00be,0x00c0, 0x00d6,0x00d8, 0x00f6,0x00f8, 0x0241,0x0250, 0x02c1,0x02c6, 0x02d1,0x02e0, 0x02e4,0x02ee, 0x02ee,0x0300, 0x036f,0x037a, 0x037a,0x0386, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x03f5,0x03f7, 0x0481,0x0483, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x0559,0x0561, 0x0587,0x0591, 0x05b9,0x05bb, 0x05bd,0x05bf, 0x05bf,0x05c1, 0x05c2,0x05c4, 0x05c5,0x05c7, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f2,0x0610, 0x0615,0x0621, 0x063a,0x0640, 0x065e,0x0660, 0x0669,0x066e, 0x06d3,0x06d5, 0x06dc,0x06de, 0x06e8,0x06ea, 0x06fc,0x06ff, 0x06ff,0x0710, 0x074a,0x074d, 0x076d,0x0780, 0x07b1,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0963,0x0966, 0x096f,0x097d, 0x097d,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09e6, 0x09f1,0x09f4, 0x09f9,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a66, 0x0a74,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0ae6, 0x0aef,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b66, 0x0b6f,0x0b71, 0x0b71,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0be6, 0x0bf2,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c66, 0x0c6f,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0ce6, 0x0cef,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d66, 0x0d6f,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df3,0x0e01, 0x0e3a,0x0e40, 0x0e4e,0x0e50, 0x0e59,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0ed0, 0x0ed9,0x0edc, 0x0edd,0x0f00, 0x0f00,0x0f18, 0x0f19,0x0f20, 0x0f33,0x0f35, 0x0f35,0x0f37, 0x0f37,0x0f39, 0x0f39,0x0f3e, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f84,0x0f86, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fc6, 0x0fc6,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1040, 0x1049,0x1050, 0x1059,0x10a0, 0x10c5,0x10d0, 0x10fa,0x10fc, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x135f,0x1369, 0x137c,0x1380, 0x138f,0x13a0, 0x13f4,0x1401, 0x166c,0x166f, 0x1676,0x1681, 0x169a,0x16a0, 0x16ea,0x16ee, 0x16f0,0x1700, 0x170c,0x170e, 0x1714,0x1720, 0x1734,0x1740, 0x1753,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773,0x1780, 0x17b3,0x17b6, 0x17d3,0x17d7, 0x17d7,0x17dc, 0x17dd,0x17e0, 0x17e9,0x17f0, 0x17f9,0x180b, 0x180d,0x1810, 0x1819,0x1820, 0x1877,0x1880, 0x18a9,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1946, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19b0, 0x19c9,0x19d0, 0x19d9,0x1a00, 0x1a1b,0x1d00, 0x1dc3,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fbc,0x1fbe, 0x1fbe,0x1fc2, 0x1fc4,0x1fc6, 0x1fcc,0x1fd0, 0x1fd3,0x1fd6, 0x1fdb,0x1fe0, 0x1fec,0x1ff2, 0x1ff4,0x1ff6, 0x1ffc,0x203f, 0x2040,0x2054, 0x2054,0x2070, 0x2071,0x2074, 0x2079,0x207f, 0x2089,0x2090, 0x2094,0x20d0, 0x20eb,0x2102, 0x2102,0x2107, 0x2107,0x210a, 0x2113,0x2115, 0x2115,0x2119, 0x211d,0x2124, 0x2124,0x2126, 0x2126,0x2128, 0x2128,0x212a, 0x212d,0x212f, 0x2131,0x2133, 0x2139,0x213c, 0x213f,0x2145, 0x2149,0x2153, 0x2183,0x2460, 0x249b,0x24ea, 0x24ff,0x2776, 0x2793,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2ce4,0x2cfd, 0x2cfd,0x2d00, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x3005, 0x3007,0x3021, 0x302f,0x3031, 0x3035,0x3038, 0x303c,0x3041, 0x3096,0x3099, 0x309a,0x309d, 0x309f,0x30a1, 0x30fa,0x30fc, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x3192, 0x3195,0x31a0, 0x31b7,0x31f0, 0x31ff,0x3220, 0x3229,0x3251, 0x325f,0x3280, 0x3289,0x32b1, 0x32bf,0x3400, 0x4db5,0x4e00, 0x9fbb,0xa000, 0xa48c,0xa800, 0xa827,0xac00, 0xd7a3,0xf900, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb28,0xfb2a, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3d,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfb,0xfe00, 0xfe0f,0xfe20, 0xfe23,0xfe33, 0xfe34,0xfe4d, 0xfe4f,0xfe70, 0xfe74,0xfe76, 0xfefc,0xff10, 0xff19,0xff21, 0xff3a,0xff3f, 0xff3f,0xff41, 0xff5a,0xff66, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10107, 0x10133,0x10140, 0x10178,0x1018a, 0x1018a,0x10300, 0x1031e,0x10320, 0x10323,0x10330, 0x1034a,0x10380, 0x1039d,0x103a0, 0x103c3,0x103c8, 0x103cf,0x103d1, 0x103d5,0x10400, 0x1049d,0x104a0, 0x104a9,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a47,0x1d165, 0x1d169,0x1d16d, 0x1d172,0x1d17b, 0x1d182,0x1d185, 0x1d18b,0x1d1aa, 0x1d1ad,0x1d242, 0x1d244,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d6c0,0x1d6c2, 0x1d6da,0x1d6dc, 0x1d6fa,0x1d6fc, 0x1d714,0x1d716, 0x1d734,0x1d736, 0x1d74e,0x1d750, 0x1d76e,0x1d770, 0x1d788,0x1d78a, 0x1d7a8,0x1d7aa, 0x1d7c2,0x1d7c4, 0x1d7c9,0x1d7ce, 0x1d7ff,0x20000, 0x2a6d6,0x2f800, 0x2fa1d,0xe0100, 0xe01ef}; /* CR_Word *//* 'Alnum': [[:Alnum:]] */static const OnigCodePoint CR_Alnum[] = {436,0x0030, 0x0039,0x0041, 0x005a,0x0061, 0x007a,0x00aa, 0x00aa,0x00b5, 0x00b5,0x00ba, 0x00ba,0x00c0, 0x00d6,0x00d8, 0x00f6,0x00f8, 0x0241,0x0250, 0x02c1,0x02c6, 0x02d1,0x02e0, 0x02e4,0x02ee, 0x02ee,0x0300, 0x036f,0x037a, 0x037a,0x0386, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x03f5,0x03f7, 0x0481,0x0483, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x0559,0x0561, 0x0587,0x0591, 0x05b9,0x05bb, 0x05bd,0x05bf, 0x05bf,0x05c1, 0x05c2,0x05c4, 0x05c5,0x05c7, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f2,0x0610, 0x0615,0x0621, 0x063a,0x0640, 0x065e,0x0660, 0x0669,0x066e, 0x06d3,0x06d5, 0x06dc,0x06de, 0x06e8,0x06ea, 0x06fc,0x06ff, 0x06ff,0x0710, 0x074a,0x074d, 0x076d,0x0780, 0x07b1,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0963,0x0966, 0x096f,0x097d, 0x097d,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09e6, 0x09f1,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a66, 0x0a74,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0ae6, 0x0aef,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b66, 0x0b6f,0x0b71, 0x0b71,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0be6, 0x0bef,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c66, 0x0c6f,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0ce6, 0x0cef,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d66, 0x0d6f,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df3,0x0e01, 0x0e3a,0x0e40, 0x0e4e,0x0e50, 0x0e59,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0ed0, 0x0ed9,0x0edc, 0x0edd,0x0f00, 0x0f00,0x0f18, 0x0f19,0x0f20, 0x0f29,0x0f35, 0x0f35,0x0f37, 0x0f37,0x0f39, 0x0f39,0x0f3e, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f84,0x0f86, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fc6, 0x0fc6,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1040, 0x1049,0x1050, 0x1059,0x10a0, 0x10c5,0x10d0, 0x10fa,0x10fc, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x135f,0x1380, 0x138f,0x13a0, 0x13f4,0x1401, 0x166c,0x166f, 0x1676,0x1681, 0x169a,0x16a0, 0x16ea,0x1700, 0x170c,0x170e, 0x1714,0x1720, 0x1734,0x1740, 0x1753,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773,0x1780, 0x17b3,0x17b6, 0x17d3,0x17d7, 0x17d7,0x17dc, 0x17dd,0x17e0, 0x17e9,0x180b, 0x180d,0x1810, 0x1819,0x1820, 0x1877,0x1880, 0x18a9,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1946, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19b0, 0x19c9,0x19d0, 0x19d9,0x1a00, 0x1a1b,0x1d00, 0x1dc3,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fbc,0x1fbe, 0x1fbe,0x1fc2, 0x1fc4,0x1fc6, 0x1fcc,0x1fd0, 0x1fd3,0x1fd6, 0x1fdb,0x1fe0, 0x1fec,0x1ff2, 0x1ff4,0x1ff6, 0x1ffc,0x2071, 0x2071,0x207f, 0x207f,0x2090, 0x2094,0x20d0, 0x20eb,0x2102, 0x2102,0x2107, 0x2107,0x210a, 0x2113,0x2115, 0x2115,0x2119, 0x211d,0x2124, 0x2124,0x2126, 0x2126,0x2128, 0x2128,0x212a, 0x212d,0x212f, 0x2131,0x2133, 0x2139,0x213c, 0x213f,0x2145, 0x2149,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2ce4,0x2d00, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x3005, 0x3006,0x302a, 0x302f,0x3031, 0x3035,0x303b, 0x303c,0x3041, 0x3096,0x3099, 0x309a,0x309d, 0x309f,0x30a1, 0x30fa,0x30fc, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x31a0, 0x31b7,0x31f0, 0x31ff,0x3400, 0x4db5,0x4e00, 0x9fbb,0xa000, 0xa48c,0xa800, 0xa827,0xac00, 0xd7a3,0xf900, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb28,0xfb2a, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3d,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfb,0xfe00, 0xfe0f,0xfe20, 0xfe23,0xfe70, 0xfe74,0xfe76, 0xfefc,0xff10, 0xff19,0xff21, 0xff3a,0xff41, 0xff5a,0xff66, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10300, 0x1031e,0x10330, 0x10349,0x10380, 0x1039d,0x103a0, 0x103c3,0x103c8, 0x103cf,0x10400, 0x1049d,0x104a0, 0x104a9,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a3f,0x1d165, 0x1d169,0x1d16d, 0x1d172,0x1d17b, 0x1d182,0x1d185, 0x1d18b,0x1d1aa, 0x1d1ad,0x1d242, 0x1d244,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d6c0,0x1d6c2, 0x1d6da,0x1d6dc, 0x1d6fa,0x1d6fc, 0x1d714,0x1d716, 0x1d734,0x1d736, 0x1d74e,0x1d750, 0x1d76e,0x1d770, 0x1d788,0x1d78a, 0x1d7a8,0x1d7aa, 0x1d7c2,0x1d7c4, 0x1d7c9,0x1d7ce, 0x1d7ff,0x20000, 0x2a6d6,0x2f800, 0x2fa1d,0xe0100, 0xe01ef}; /* CR_Alnum *//* 'ASCII': [[:ASCII:]] */static const OnigCodePoint CR_ASCII[] = {1,0x0000, 0x007f}; /* CR_ASCII */#ifdef USE_UNICODE_PROPERTIES/* 'Any': - */static const OnigCodePoint CR_Any[] = {1,0x0000, 0x10ffff}; /* CR_Any *//* 'Assigned': - */static const OnigCodePoint CR_Assigned[] = {420,0x0000, 0x0241,0x0250, 0x036f,0x0374, 0x0375,0x037a, 0x037a,0x037e, 0x037e,0x0384, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x055f,0x0561, 0x0587,0x0589, 0x058a,0x0591, 0x05b9,0x05bb, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f4,0x0600, 0x0603,0x060b, 0x0615,0x061b, 0x061b,0x061e, 0x061f,0x0621, 0x063a,0x0640, 0x065e,0x0660, 0x070d,0x070f, 0x074a,0x074d, 0x076d,0x0780, 0x07b1,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0970,0x097d, 0x097d,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09e6, 0x09fa,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a66, 0x0a74,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0ae6, 0x0aef,0x0af1, 0x0af1,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b66, 0x0b71,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0be6, 0x0bfa,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c66, 0x0c6f,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0ce6, 0x0cef,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d66, 0x0d6f,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df4,0x0e01, 0x0e3a,0x0e3f, 0x0e5b,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0ed0, 0x0ed9,0x0edc, 0x0edd,0x0f00, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fbe, 0x0fcc,0x0fcf, 0x0fd1,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1040, 0x1059,0x10a0, 0x10c5,0x10d0, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x137c,0x1380, 0x1399,0x13a0, 0x13f4,0x1401, 0x1676,0x1680, 0x169c,0x16a0, 0x16f0,0x1700, 0x170c,0x170e, 0x1714,0x1720, 0x1736,0x1740, 0x1753,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773,0x1780, 0x17dd,0x17e0, 0x17e9,0x17f0, 0x17f9,0x1800, 0x180e,0x1810, 0x1819,0x1820, 0x1877,0x1880, 0x18a9,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1940, 0x1940,0x1944, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19b0, 0x19c9,0x19d0, 0x19d9,0x19de, 0x1a1b,0x1a1e, 0x1a1f,0x1d00, 0x1dc3,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fc4,0x1fc6, 0x1fd3,0x1fd6, 0x1fdb,0x1fdd, 0x1fef,0x1ff2, 0x1ff4,0x1ff6, 0x1ffe,0x2000, 0x2063,0x206a, 0x2071,0x2074, 0x208e,0x2090, 0x2094,0x20a0, 0x20b5,0x20d0, 0x20eb,0x2100, 0x214c,0x2153, 0x2183,0x2190, 0x23db,0x2400, 0x2426,0x2440, 0x244a,0x2460, 0x269c,0x26a0, 0x26b1,0x2701, 0x2704,0x2706, 0x2709,0x270c, 0x2727,0x2729, 0x274b,0x274d, 0x274d,0x274f, 0x2752,0x2756, 0x2756,0x2758, 0x275e,0x2761, 0x2794,0x2798, 0x27af,0x27b1, 0x27be,0x27c0, 0x27c6,0x27d0, 0x27eb,0x27f0, 0x2b13,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2cea,0x2cf9, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x2e00, 0x2e17,0x2e1c, 0x2e1d,0x2e80, 0x2e99,0x2e9b, 0x2ef3,0x2f00, 0x2fd5,0x2ff0, 0x2ffb,0x3000, 0x303f,0x3041, 0x3096,0x3099, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x3190, 0x31b7,0x31c0, 0x31cf,0x31f0, 0x321e,0x3220, 0x3243,0x3250, 0x32fe,0x3300, 0x4db5,0x4dc0, 0x9fbb,0xa000, 0xa48c,0xa490, 0xa4c6,0xa700, 0xa716,0xa800, 0xa82b,0xac00, 0xd7a3,0xd800, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3f,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfd,0xfe00, 0xfe19,0xfe20, 0xfe23,0xfe30, 0xfe52,0xfe54, 0xfe66,0xfe68, 0xfe6b,0xfe70, 0xfe74,0xfe76, 0xfefc,0xfeff, 0xfeff,0xff01, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0xffe0, 0xffe6,0xffe8, 0xffee,0xfff9, 0xfffd,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10100, 0x10102,0x10107, 0x10133,0x10137, 0x1018a,0x10300, 0x1031e,0x10320, 0x10323,0x10330, 0x1034a,0x10380, 0x1039d,0x1039f, 0x103c3,0x103c8, 0x103d5,0x10400, 0x1049d,0x104a0, 0x104a9,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a47,0x10a50, 0x10a58,0x1d000, 0x1d0f5,0x1d100, 0x1d126,0x1d12a, 0x1d1dd,0x1d200, 0x1d245,0x1d300, 0x1d356,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d7c9,0x1d7ce, 0x1d7ff,0x20000, 0x2a6d6,0x2f800, 0x2fa1d,0xe0001, 0xe0001,0xe0020, 0xe007f,0xe0100, 0xe01ef,0xf0000, 0xffffd,0x100000, 0x10fffd}; /* CR_Assigned *//* 'C': Major Category */static const OnigCodePoint CR_C[] = {422,0x0000, 0x001f,0x007f, 0x009f,0x00ad, 0x00ad,0x0242, 0x024f,0x0370, 0x0373,0x0376, 0x0379,0x037b, 0x037d,0x037f, 0x0383,0x038b, 0x038b,0x038d, 0x038d,0x03a2, 0x03a2,0x03cf, 0x03cf,0x0487, 0x0487,0x04cf, 0x04cf,0x04fa, 0x04ff,0x0510, 0x0530,0x0557, 0x0558,0x0560, 0x0560,0x0588, 0x0588,0x058b, 0x0590,0x05ba, 0x05ba,0x05c8, 0x05cf,0x05eb, 0x05ef,0x05f5, 0x060a,0x0616, 0x061a,0x061c, 0x061d,0x0620, 0x0620,0x063b, 0x063f,0x065f, 0x065f,0x06dd, 0x06dd,0x070e, 0x070f,0x074b, 0x074c,0x076e, 0x077f,0x07b2, 0x0900,0x093a, 0x093b,0x094e, 0x094f,0x0955, 0x0957,0x0971, 0x097c,0x097e, 0x0980,0x0984, 0x0984,0x098d, 0x098e,0x0991, 0x0992,0x09a9, 0x09a9,0x09b1, 0x09b1,0x09b3, 0x09b5,0x09ba, 0x09bb,0x09c5, 0x09c6,0x09c9, 0x09ca,0x09cf, 0x09d6,0x09d8, 0x09db,0x09de, 0x09de,0x09e4, 0x09e5,0x09fb, 0x0a00,0x0a04, 0x0a04,0x0a0b, 0x0a0e,0x0a11, 0x0a12,0x0a29, 0x0a29,0x0a31, 0x0a31,0x0a34, 0x0a34,0x0a37, 0x0a37,0x0a3a, 0x0a3b,0x0a3d, 0x0a3d,0x0a43, 0x0a46,0x0a49, 0x0a4a,0x0a4e, 0x0a58,0x0a5d, 0x0a5d,0x0a5f, 0x0a65,0x0a75, 0x0a80,0x0a84, 0x0a84,0x0a8e, 0x0a8e,0x0a92, 0x0a92,0x0aa9, 0x0aa9,0x0ab1, 0x0ab1,0x0ab4, 0x0ab4,0x0aba, 0x0abb,0x0ac6, 0x0ac6,0x0aca, 0x0aca,0x0ace, 0x0acf,0x0ad1, 0x0adf,0x0ae4, 0x0ae5,0x0af0, 0x0af0,0x0af2, 0x0b00,0x0b04, 0x0b04,0x0b0d, 0x0b0e,0x0b11, 0x0b12,0x0b29, 0x0b29,0x0b31, 0x0b31,0x0b34, 0x0b34,0x0b3a, 0x0b3b,0x0b44, 0x0b46,0x0b49, 0x0b4a,0x0b4e, 0x0b55,0x0b58, 0x0b5b,0x0b5e, 0x0b5e,0x0b62, 0x0b65,0x0b72, 0x0b81,0x0b84, 0x0b84,0x0b8b, 0x0b8d,0x0b91, 0x0b91,0x0b96, 0x0b98,0x0b9b, 0x0b9b,0x0b9d, 0x0b9d,0x0ba0, 0x0ba2,0x0ba5, 0x0ba7,0x0bab, 0x0bad,0x0bba, 0x0bbd,0x0bc3, 0x0bc5,0x0bc9, 0x0bc9,0x0bce, 0x0bd6,0x0bd8, 0x0be5,0x0bfb, 0x0c00,0x0c04, 0x0c04,0x0c0d, 0x0c0d,0x0c11, 0x0c11,0x0c29, 0x0c29,0x0c34, 0x0c34,0x0c3a, 0x0c3d,0x0c45, 0x0c45,0x0c49, 0x0c49,0x0c4e, 0x0c54,0x0c57, 0x0c5f,0x0c62, 0x0c65,0x0c70, 0x0c81,0x0c84, 0x0c84,0x0c8d, 0x0c8d,0x0c91, 0x0c91,0x0ca9, 0x0ca9,0x0cb4, 0x0cb4,0x0cba, 0x0cbb,0x0cc5, 0x0cc5,0x0cc9, 0x0cc9,0x0cce, 0x0cd4,0x0cd7, 0x0cdd,0x0cdf, 0x0cdf,0x0ce2, 0x0ce5,0x0cf0, 0x0d01,0x0d04, 0x0d04,0x0d0d, 0x0d0d,0x0d11, 0x0d11,0x0d29, 0x0d29,0x0d3a, 0x0d3d,0x0d44, 0x0d45,0x0d49, 0x0d49,0x0d4e, 0x0d56,0x0d58, 0x0d5f,0x0d62, 0x0d65,0x0d70, 0x0d81,0x0d84, 0x0d84,0x0d97, 0x0d99,0x0db2, 0x0db2,0x0dbc, 0x0dbc,0x0dbe, 0x0dbf,0x0dc7, 0x0dc9,0x0dcb, 0x0dce,0x0dd5, 0x0dd5,0x0dd7, 0x0dd7,0x0de0, 0x0df1,0x0df5, 0x0e00,0x0e3b, 0x0e3e,0x0e5c, 0x0e80,0x0e83, 0x0e83,0x0e85, 0x0e86,0x0e89, 0x0e89,0x0e8b, 0x0e8c,0x0e8e, 0x0e93,0x0e98, 0x0e98,0x0ea0, 0x0ea0,0x0ea4, 0x0ea4,0x0ea6, 0x0ea6,0x0ea8, 0x0ea9,0x0eac, 0x0eac,0x0eba, 0x0eba,0x0ebe, 0x0ebf,0x0ec5, 0x0ec5,0x0ec7, 0x0ec7,0x0ece, 0x0ecf,0x0eda, 0x0edb,0x0ede, 0x0eff,0x0f48, 0x0f48,0x0f6b, 0x0f70,0x0f8c, 0x0f8f,0x0f98, 0x0f98,0x0fbd, 0x0fbd,0x0fcd, 0x0fce,0x0fd2, 0x0fff,0x1022, 0x1022,0x1028, 0x1028,0x102b, 0x102b,0x1033, 0x1035,0x103a, 0x103f,0x105a, 0x109f,0x10c6, 0x10cf,0x10fd, 0x10ff,0x115a, 0x115e,0x11a3, 0x11a7,0x11fa, 0x11ff,0x1249, 0x1249,0x124e, 0x124f,0x1257, 0x1257,0x1259, 0x1259,0x125e, 0x125f,0x1289, 0x1289,0x128e, 0x128f,0x12b1, 0x12b1,0x12b6, 0x12b7,0x12bf, 0x12bf,0x12c1, 0x12c1,0x12c6, 0x12c7,0x12d7, 0x12d7,0x1311, 0x1311,0x1316, 0x1317,0x135b, 0x135e,0x137d, 0x137f,0x139a, 0x139f,0x13f5, 0x1400,0x1677, 0x167f,0x169d, 0x169f,0x16f1, 0x16ff,0x170d, 0x170d,0x1715, 0x171f,0x1737, 0x173f,0x1754, 0x175f,0x176d, 0x176d,0x1771, 0x1771,0x1774, 0x177f,0x17b4, 0x17b5,0x17de, 0x17df,0x17ea, 0x17ef,0x17fa, 0x17ff,0x180f, 0x180f,0x181a, 0x181f,0x1878, 0x187f,0x18aa, 0x18ff,0x191d, 0x191f,0x192c, 0x192f,0x193c, 0x193f,0x1941, 0x1943,0x196e, 0x196f,0x1975, 0x197f,0x19aa, 0x19af,0x19ca, 0x19cf,0x19da, 0x19dd,0x1a1c, 0x1a1d,0x1a20, 0x1cff,0x1dc4, 0x1dff,0x1e9c, 0x1e9f,0x1efa, 0x1eff,0x1f16, 0x1f17,0x1f1e, 0x1f1f,0x1f46, 0x1f47,0x1f4e, 0x1f4f,0x1f58, 0x1f58,0x1f5a, 0x1f5a,0x1f5c, 0x1f5c,0x1f5e, 0x1f5e,0x1f7e, 0x1f7f,0x1fb5, 0x1fb5,0x1fc5, 0x1fc5,0x1fd4, 0x1fd5,0x1fdc, 0x1fdc,0x1ff0, 0x1ff1,0x1ff5, 0x1ff5,0x1fff, 0x1fff,0x200b, 0x200f,0x202a, 0x202e,0x2060, 0x206f,0x2072, 0x2073,0x208f, 0x208f,0x2095, 0x209f,0x20b6, 0x20cf,0x20ec, 0x20ff,0x214d, 0x2152,0x2184, 0x218f,0x23dc, 0x23ff,0x2427, 0x243f,0x244b, 0x245f,0x269d, 0x269f,0x26b2, 0x2700,0x2705, 0x2705,0x270a, 0x270b,0x2728, 0x2728,0x274c, 0x274c,0x274e, 0x274e,0x2753, 0x2755,0x2757, 0x2757,0x275f, 0x2760,0x2795, 0x2797,0x27b0, 0x27b0,0x27bf, 0x27bf,0x27c7, 0x27cf,0x27ec, 0x27ef,0x2b14, 0x2bff,0x2c2f, 0x2c2f,0x2c5f, 0x2c7f,0x2ceb, 0x2cf8,0x2d26, 0x2d2f,0x2d66, 0x2d6e,0x2d70, 0x2d7f,0x2d97, 0x2d9f,0x2da7, 0x2da7,0x2daf, 0x2daf,0x2db7, 0x2db7,0x2dbf, 0x2dbf,0x2dc7, 0x2dc7,0x2dcf, 0x2dcf,0x2dd7, 0x2dd7,0x2ddf, 0x2dff,0x2e18, 0x2e1b,0x2e1e, 0x2e7f,0x2e9a, 0x2e9a,0x2ef4, 0x2eff,0x2fd6, 0x2fef,0x2ffc, 0x2fff,0x3040, 0x3040,0x3097, 0x3098,0x3100, 0x3104,0x312d, 0x3130,0x318f, 0x318f,0x31b8, 0x31bf,0x31d0, 0x31ef,0x321f, 0x321f,0x3244, 0x324f,0x32ff, 0x32ff,0x4db6, 0x4dbf,0x9fbc, 0x9fff,0xa48d, 0xa48f,0xa4c7, 0xa6ff,0xa717, 0xa7ff,0xa82c, 0xabff,0xd7a4, 0xf8ff,0xfa2e, 0xfa2f,0xfa6b, 0xfa6f,0xfada, 0xfaff,0xfb07, 0xfb12,0xfb18, 0xfb1c,0xfb37, 0xfb37,0xfb3d, 0xfb3d,0xfb3f, 0xfb3f,0xfb42, 0xfb42,0xfb45, 0xfb45,0xfbb2, 0xfbd2,0xfd40, 0xfd4f,0xfd90, 0xfd91,0xfdc8, 0xfdef,0xfdfe, 0xfdff,0xfe1a, 0xfe1f,0xfe24, 0xfe2f,0xfe53, 0xfe53,0xfe67, 0xfe67,0xfe6c, 0xfe6f,0xfe75, 0xfe75,0xfefd, 0xff00,0xffbf, 0xffc1,0xffc8, 0xffc9,0xffd0, 0xffd1,0xffd8, 0xffd9,0xffdd, 0xffdf,0xffe7, 0xffe7,0xffef, 0xfffb,0xfffe, 0xffff,0x1000c, 0x1000c,0x10027, 0x10027,0x1003b, 0x1003b,0x1003e, 0x1003e,0x1004e, 0x1004f,0x1005e, 0x1007f,0x100fb, 0x100ff,0x10103, 0x10106,0x10134, 0x10136,0x1018b, 0x102ff,0x1031f, 0x1031f,0x10324, 0x1032f,0x1034b, 0x1037f,0x1039e, 0x1039e,0x103c4, 0x103c7,0x103d6, 0x103ff,0x1049e, 0x1049f,0x104aa, 0x107ff,0x10806, 0x10807,0x10809, 0x10809,0x10836, 0x10836,0x10839, 0x1083b,0x1083d, 0x1083e,0x10840, 0x109ff,0x10a04, 0x10a04,0x10a07, 0x10a0b,0x10a14, 0x10a14,0x10a18, 0x10a18,0x10a34, 0x10a37,0x10a3b, 0x10a3e,0x10a48, 0x10a4f,0x10a59, 0x1cfff,0x1d0f6, 0x1d0ff,0x1d127, 0x1d129,0x1d173, 0x1d17a,0x1d1de, 0x1d1ff,0x1d246, 0x1d2ff,0x1d357, 0x1d3ff,0x1d455, 0x1d455,0x1d49d, 0x1d49d,0x1d4a0, 0x1d4a1,0x1d4a3, 0x1d4a4,0x1d4a7, 0x1d4a8,0x1d4ad, 0x1d4ad,0x1d4ba, 0x1d4ba,0x1d4bc, 0x1d4bc,0x1d4c4, 0x1d4c4,0x1d506, 0x1d506,0x1d50b, 0x1d50c,0x1d515, 0x1d515,0x1d51d, 0x1d51d,0x1d53a, 0x1d53a,0x1d53f, 0x1d53f,0x1d545, 0x1d545,0x1d547, 0x1d549,0x1d551, 0x1d551,0x1d6a6, 0x1d6a7,0x1d7ca, 0x1d7cd,0x1d800, 0x1ffff,0x2a6d7, 0x2f7ff,0x2fa1e, 0xe00ff,0xe01f0, 0x10ffff}; /* CR_C *//* 'Cc': General Category */static const OnigCodePoint CR_Cc[] = {2,0x0000, 0x001f,0x007f, 0x009f}; /* CR_Cc *//* 'Cf': General Category */static const OnigCodePoint CR_Cf[] = {14,0x00ad, 0x00ad,0x0600, 0x0603,0x06dd, 0x06dd,0x070f, 0x070f,0x17b4, 0x17b5,0x200b, 0x200f,0x202a, 0x202e,0x2060, 0x2063,0x206a, 0x206f,0xfeff, 0xfeff,0xfff9, 0xfffb,0x1d173, 0x1d17a,0xe0001, 0xe0001,0xe0020, 0xe007f}; /* CR_Cf *//* 'Cn': General Category */static const OnigCodePoint CR_Cn[] = {420,0x0242, 0x024f,0x0370, 0x0373,0x0376, 0x0379,0x037b, 0x037d,0x037f, 0x0383,0x038b, 0x038b,0x038d, 0x038d,0x03a2, 0x03a2,0x03cf, 0x03cf,0x0487, 0x0487,0x04cf, 0x04cf,0x04fa, 0x04ff,0x0510, 0x0530,0x0557, 0x0558,0x0560, 0x0560,0x0588, 0x0588,0x058b, 0x0590,0x05ba, 0x05ba,0x05c8, 0x05cf,0x05eb, 0x05ef,0x05f5, 0x05ff,0x0604, 0x060a,0x0616, 0x061a,0x061c, 0x061d,0x0620, 0x0620,0x063b, 0x063f,0x065f, 0x065f,0x070e, 0x070e,0x074b, 0x074c,0x076e, 0x077f,0x07b2, 0x0900,0x093a, 0x093b,0x094e, 0x094f,0x0955, 0x0957,0x0971, 0x097c,0x097e, 0x0980,0x0984, 0x0984,0x098d, 0x098e,0x0991, 0x0992,0x09a9, 0x09a9,0x09b1, 0x09b1,0x09b3, 0x09b5,0x09ba, 0x09bb,0x09c5, 0x09c6,0x09c9, 0x09ca,0x09cf, 0x09d6,0x09d8, 0x09db,0x09de, 0x09de,0x09e4, 0x09e5,0x09fb, 0x0a00,0x0a04, 0x0a04,0x0a0b, 0x0a0e,0x0a11, 0x0a12,0x0a29, 0x0a29,0x0a31, 0x0a31,0x0a34, 0x0a34,0x0a37, 0x0a37,0x0a3a, 0x0a3b,0x0a3d, 0x0a3d,0x0a43, 0x0a46,0x0a49, 0x0a4a,0x0a4e, 0x0a58,0x0a5d, 0x0a5d,0x0a5f, 0x0a65,0x0a75, 0x0a80,0x0a84, 0x0a84,0x0a8e, 0x0a8e,0x0a92, 0x0a92,0x0aa9, 0x0aa9,0x0ab1, 0x0ab1,0x0ab4, 0x0ab4,0x0aba, 0x0abb,0x0ac6, 0x0ac6,0x0aca, 0x0aca,0x0ace, 0x0acf,0x0ad1, 0x0adf,0x0ae4, 0x0ae5,0x0af0, 0x0af0,0x0af2, 0x0b00,0x0b04, 0x0b04,0x0b0d, 0x0b0e,0x0b11, 0x0b12,0x0b29, 0x0b29,0x0b31, 0x0b31,0x0b34, 0x0b34,0x0b3a, 0x0b3b,0x0b44, 0x0b46,0x0b49, 0x0b4a,0x0b4e, 0x0b55,0x0b58, 0x0b5b,0x0b5e, 0x0b5e,0x0b62, 0x0b65,0x0b72, 0x0b81,0x0b84, 0x0b84,0x0b8b, 0x0b8d,0x0b91, 0x0b91,0x0b96, 0x0b98,0x0b9b, 0x0b9b,0x0b9d, 0x0b9d,0x0ba0, 0x0ba2,0x0ba5, 0x0ba7,0x0bab, 0x0bad,0x0bba, 0x0bbd,0x0bc3, 0x0bc5,0x0bc9, 0x0bc9,0x0bce, 0x0bd6,0x0bd8, 0x0be5,0x0bfb, 0x0c00,0x0c04, 0x0c04,0x0c0d, 0x0c0d,0x0c11, 0x0c11,0x0c29, 0x0c29,0x0c34, 0x0c34,0x0c3a, 0x0c3d,0x0c45, 0x0c45,0x0c49, 0x0c49,0x0c4e, 0x0c54,0x0c57, 0x0c5f,0x0c62, 0x0c65,0x0c70, 0x0c81,0x0c84, 0x0c84,0x0c8d, 0x0c8d,0x0c91, 0x0c91,0x0ca9, 0x0ca9,0x0cb4, 0x0cb4,0x0cba, 0x0cbb,0x0cc5, 0x0cc5,0x0cc9, 0x0cc9,0x0cce, 0x0cd4,0x0cd7, 0x0cdd,0x0cdf, 0x0cdf,0x0ce2, 0x0ce5,0x0cf0, 0x0d01,0x0d04, 0x0d04,0x0d0d, 0x0d0d,0x0d11, 0x0d11,0x0d29, 0x0d29,0x0d3a, 0x0d3d,0x0d44, 0x0d45,0x0d49, 0x0d49,0x0d4e, 0x0d56,0x0d58, 0x0d5f,0x0d62, 0x0d65,0x0d70, 0x0d81,0x0d84, 0x0d84,0x0d97, 0x0d99,0x0db2, 0x0db2,0x0dbc, 0x0dbc,0x0dbe, 0x0dbf,0x0dc7, 0x0dc9,0x0dcb, 0x0dce,0x0dd5, 0x0dd5,0x0dd7, 0x0dd7,0x0de0, 0x0df1,0x0df5, 0x0e00,0x0e3b, 0x0e3e,0x0e5c, 0x0e80,0x0e83, 0x0e83,0x0e85, 0x0e86,0x0e89, 0x0e89,0x0e8b, 0x0e8c,0x0e8e, 0x0e93,0x0e98, 0x0e98,0x0ea0, 0x0ea0,0x0ea4, 0x0ea4,0x0ea6, 0x0ea6,0x0ea8, 0x0ea9,0x0eac, 0x0eac,0x0eba, 0x0eba,0x0ebe, 0x0ebf,0x0ec5, 0x0ec5,0x0ec7, 0x0ec7,0x0ece, 0x0ecf,0x0eda, 0x0edb,0x0ede, 0x0eff,0x0f48, 0x0f48,0x0f6b, 0x0f70,0x0f8c, 0x0f8f,0x0f98, 0x0f98,0x0fbd, 0x0fbd,0x0fcd, 0x0fce,0x0fd2, 0x0fff,0x1022, 0x1022,0x1028, 0x1028,0x102b, 0x102b,0x1033, 0x1035,0x103a, 0x103f,0x105a, 0x109f,0x10c6, 0x10cf,0x10fd, 0x10ff,0x115a, 0x115e,0x11a3, 0x11a7,0x11fa, 0x11ff,0x1249, 0x1249,0x124e, 0x124f,0x1257, 0x1257,0x1259, 0x1259,0x125e, 0x125f,0x1289, 0x1289,0x128e, 0x128f,0x12b1, 0x12b1,0x12b6, 0x12b7,0x12bf, 0x12bf,0x12c1, 0x12c1,0x12c6, 0x12c7,0x12d7, 0x12d7,0x1311, 0x1311,0x1316, 0x1317,0x135b, 0x135e,0x137d, 0x137f,0x139a, 0x139f,0x13f5, 0x1400,0x1677, 0x167f,0x169d, 0x169f,0x16f1, 0x16ff,0x170d, 0x170d,0x1715, 0x171f,0x1737, 0x173f,0x1754, 0x175f,0x176d, 0x176d,0x1771, 0x1771,0x1774, 0x177f,0x17de, 0x17df,0x17ea, 0x17ef,0x17fa, 0x17ff,0x180f, 0x180f,0x181a, 0x181f,0x1878, 0x187f,0x18aa, 0x18ff,0x191d, 0x191f,0x192c, 0x192f,0x193c, 0x193f,0x1941, 0x1943,0x196e, 0x196f,0x1975, 0x197f,0x19aa, 0x19af,0x19ca, 0x19cf,0x19da, 0x19dd,0x1a1c, 0x1a1d,0x1a20, 0x1cff,0x1dc4, 0x1dff,0x1e9c, 0x1e9f,0x1efa, 0x1eff,0x1f16, 0x1f17,0x1f1e, 0x1f1f,0x1f46, 0x1f47,0x1f4e, 0x1f4f,0x1f58, 0x1f58,0x1f5a, 0x1f5a,0x1f5c, 0x1f5c,0x1f5e, 0x1f5e,0x1f7e, 0x1f7f,0x1fb5, 0x1fb5,0x1fc5, 0x1fc5,0x1fd4, 0x1fd5,0x1fdc, 0x1fdc,0x1ff0, 0x1ff1,0x1ff5, 0x1ff5,0x1fff, 0x1fff,0x2064, 0x2069,0x2072, 0x2073,0x208f, 0x208f,0x2095, 0x209f,0x20b6, 0x20cf,0x20ec, 0x20ff,0x214d, 0x2152,0x2184, 0x218f,0x23dc, 0x23ff,0x2427, 0x243f,0x244b, 0x245f,0x269d, 0x269f,0x26b2, 0x2700,0x2705, 0x2705,0x270a, 0x270b,0x2728, 0x2728,0x274c, 0x274c,0x274e, 0x274e,0x2753, 0x2755,0x2757, 0x2757,0x275f, 0x2760,0x2795, 0x2797,0x27b0, 0x27b0,0x27bf, 0x27bf,0x27c7, 0x27cf,0x27ec, 0x27ef,0x2b14, 0x2bff,0x2c2f, 0x2c2f,0x2c5f, 0x2c7f,0x2ceb, 0x2cf8,0x2d26, 0x2d2f,0x2d66, 0x2d6e,0x2d70, 0x2d7f,0x2d97, 0x2d9f,0x2da7, 0x2da7,0x2daf, 0x2daf,0x2db7, 0x2db7,0x2dbf, 0x2dbf,0x2dc7, 0x2dc7,0x2dcf, 0x2dcf,0x2dd7, 0x2dd7,0x2ddf, 0x2dff,0x2e18, 0x2e1b,0x2e1e, 0x2e7f,0x2e9a, 0x2e9a,0x2ef4, 0x2eff,0x2fd6, 0x2fef,0x2ffc, 0x2fff,0x3040, 0x3040,0x3097, 0x3098,0x3100, 0x3104,0x312d, 0x3130,0x318f, 0x318f,0x31b8, 0x31bf,0x31d0, 0x31ef,0x321f, 0x321f,0x3244, 0x324f,0x32ff, 0x32ff,0x4db6, 0x4dbf,0x9fbc, 0x9fff,0xa48d, 0xa48f,0xa4c7, 0xa6ff,0xa717, 0xa7ff,0xa82c, 0xabff,0xd7a4, 0xd7ff,0xfa2e, 0xfa2f,0xfa6b, 0xfa6f,0xfada, 0xfaff,0xfb07, 0xfb12,0xfb18, 0xfb1c,0xfb37, 0xfb37,0xfb3d, 0xfb3d,0xfb3f, 0xfb3f,0xfb42, 0xfb42,0xfb45, 0xfb45,0xfbb2, 0xfbd2,0xfd40, 0xfd4f,0xfd90, 0xfd91,0xfdc8, 0xfdef,0xfdfe, 0xfdff,0xfe1a, 0xfe1f,0xfe24, 0xfe2f,0xfe53, 0xfe53,0xfe67, 0xfe67,0xfe6c, 0xfe6f,0xfe75, 0xfe75,0xfefd, 0xfefe,0xff00, 0xff00,0xffbf, 0xffc1,0xffc8, 0xffc9,0xffd0, 0xffd1,0xffd8, 0xffd9,0xffdd, 0xffdf,0xffe7, 0xffe7,0xffef, 0xfff8,0xfffe, 0xffff,0x1000c, 0x1000c,0x10027, 0x10027,0x1003b, 0x1003b,0x1003e, 0x1003e,0x1004e, 0x1004f,0x1005e, 0x1007f,0x100fb, 0x100ff,0x10103, 0x10106,0x10134, 0x10136,0x1018b, 0x102ff,0x1031f, 0x1031f,0x10324, 0x1032f,0x1034b, 0x1037f,0x1039e, 0x1039e,0x103c4, 0x103c7,0x103d6, 0x103ff,0x1049e, 0x1049f,0x104aa, 0x107ff,0x10806, 0x10807,0x10809, 0x10809,0x10836, 0x10836,0x10839, 0x1083b,0x1083d, 0x1083e,0x10840, 0x109ff,0x10a04, 0x10a04,0x10a07, 0x10a0b,0x10a14, 0x10a14,0x10a18, 0x10a18,0x10a34, 0x10a37,0x10a3b, 0x10a3e,0x10a48, 0x10a4f,0x10a59, 0x1cfff,0x1d0f6, 0x1d0ff,0x1d127, 0x1d129,0x1d1de, 0x1d1ff,0x1d246, 0x1d2ff,0x1d357, 0x1d3ff,0x1d455, 0x1d455,0x1d49d, 0x1d49d,0x1d4a0, 0x1d4a1,0x1d4a3, 0x1d4a4,0x1d4a7, 0x1d4a8,0x1d4ad, 0x1d4ad,0x1d4ba, 0x1d4ba,0x1d4bc, 0x1d4bc,0x1d4c4, 0x1d4c4,0x1d506, 0x1d506,0x1d50b, 0x1d50c,0x1d515, 0x1d515,0x1d51d, 0x1d51d,0x1d53a, 0x1d53a,0x1d53f, 0x1d53f,0x1d545, 0x1d545,0x1d547, 0x1d549,0x1d551, 0x1d551,0x1d6a6, 0x1d6a7,0x1d7ca, 0x1d7cd,0x1d800, 0x1ffff,0x2a6d7, 0x2f7ff,0x2fa1e, 0xe0000,0xe0002, 0xe001f,0xe0080, 0xe00ff,0xe01f0, 0xeffff,0xffffe, 0xfffff,0x10fffe, 0x10ffff}; /* CR_Cn *//* 'Co': General Category */static const OnigCodePoint CR_Co[] = {3,0xe000, 0xf8ff,0xf0000, 0xffffd,0x100000, 0x10fffd}; /* CR_Co *//* 'Cs': General Category */static const OnigCodePoint CR_Cs[] = {1,0xd800, 0xdfff}; /* CR_Cs *//* 'L': Major Category */static const OnigCodePoint CR_L[] = {347,0x0041, 0x005a,0x0061, 0x007a,0x00aa, 0x00aa,0x00b5, 0x00b5,0x00ba, 0x00ba,0x00c0, 0x00d6,0x00d8, 0x00f6,0x00f8, 0x0241,0x0250, 0x02c1,0x02c6, 0x02d1,0x02e0, 0x02e4,0x02ee, 0x02ee,0x037a, 0x037a,0x0386, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x03f5,0x03f7, 0x0481,0x048a, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x0531, 0x0556,0x0559, 0x0559,0x0561, 0x0587,0x05d0, 0x05ea,0x05f0, 0x05f2,0x0621, 0x063a,0x0640, 0x064a,0x066e, 0x066f,0x0671, 0x06d3,0x06d5, 0x06d5,0x06e5, 0x06e6,0x06ee, 0x06ef,0x06fa, 0x06fc,0x06ff, 0x06ff,0x0710, 0x0710,0x0712, 0x072f,0x074d, 0x076d,0x0780, 0x07a5,0x07b1, 0x07b1,0x0904, 0x0939,0x093d, 0x093d,0x0950, 0x0950,0x0958, 0x0961,0x097d, 0x097d,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bd, 0x09bd,0x09ce, 0x09ce,0x09dc, 0x09dd,0x09df, 0x09e1,0x09f0, 0x09f1,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a72, 0x0a74,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abd, 0x0abd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae1,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3d, 0x0b3d,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b71, 0x0b71,0x0b83, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c60, 0x0c61,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbd, 0x0cbd,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d60, 0x0d61,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0e01, 0x0e30,0x0e32, 0x0e33,0x0e40, 0x0e46,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb0,0x0eb2, 0x0eb3,0x0ebd, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0edc, 0x0edd,0x0f00, 0x0f00,0x0f40, 0x0f47,0x0f49, 0x0f6a,0x0f88, 0x0f8b,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x1050, 0x1055,0x10a0, 0x10c5,0x10d0, 0x10fa,0x10fc, 0x10fc,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x1380, 0x138f,0x13a0, 0x13f4,0x1401, 0x166c,0x166f, 0x1676,0x1681, 0x169a,0x16a0, 0x16ea,0x1700, 0x170c,0x170e, 0x1711,0x1720, 0x1731,0x1740, 0x1751,0x1760, 0x176c,0x176e, 0x1770,0x1780, 0x17b3,0x17d7, 0x17d7,0x17dc, 0x17dc,0x1820, 0x1877,0x1880, 0x18a8,0x1900, 0x191c,0x1950, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19c1, 0x19c7,0x1a00, 0x1a16,0x1d00, 0x1dbf,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fbc,0x1fbe, 0x1fbe,0x1fc2, 0x1fc4,0x1fc6, 0x1fcc,0x1fd0, 0x1fd3,0x1fd6, 0x1fdb,0x1fe0, 0x1fec,0x1ff2, 0x1ff4,0x1ff6, 0x1ffc,0x2071, 0x2071,0x207f, 0x207f,0x2090, 0x2094,0x2102, 0x2102,0x2107, 0x2107,0x210a, 0x2113,0x2115, 0x2115,0x2119, 0x211d,0x2124, 0x2124,0x2126, 0x2126,0x2128, 0x2128,0x212a, 0x212d,0x212f, 0x2131,0x2133, 0x2139,0x213c, 0x213f,0x2145, 0x2149,0x2c00, 0x2c2e,0x2c30, 0x2c5e,0x2c80, 0x2ce4,0x2d00, 0x2d25,0x2d30, 0x2d65,0x2d6f, 0x2d6f,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x3005, 0x3006,0x3031, 0x3035,0x303b, 0x303c,0x3041, 0x3096,0x309d, 0x309f,0x30a1, 0x30fa,0x30fc, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x31a0, 0x31b7,0x31f0, 0x31ff,0x3400, 0x4db5,0x4e00, 0x9fbb,0xa000, 0xa48c,0xa800, 0xa801,0xa803, 0xa805,0xa807, 0xa80a,0xa80c, 0xa822,0xac00, 0xd7a3,0xf900, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb00, 0xfb06,0xfb13, 0xfb17,0xfb1d, 0xfb1d,0xfb1f, 0xfb28,0xfb2a, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3d,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfb,0xfe70, 0xfe74,0xfe76, 0xfefc,0xff21, 0xff3a,0xff41, 0xff5a,0xff66, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10300, 0x1031e,0x10330, 0x10349,0x10380, 0x1039d,0x103a0, 0x103c3,0x103c8, 0x103cf,0x10400, 0x1049d,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a00,0x10a10, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d6c0,0x1d6c2, 0x1d6da,0x1d6dc, 0x1d6fa,0x1d6fc, 0x1d714,0x1d716, 0x1d734,0x1d736, 0x1d74e,0x1d750, 0x1d76e,0x1d770, 0x1d788,0x1d78a, 0x1d7a8,0x1d7aa, 0x1d7c2,0x1d7c4, 0x1d7c9,0x20000, 0x2a6d6,0x2f800, 0x2fa1d}; /* CR_L *//* 'Ll': General Category */static const OnigCodePoint CR_Ll[] = {480,0x0061, 0x007a,0x00aa, 0x00aa,0x00b5, 0x00b5,0x00ba, 0x00ba,0x00df, 0x00f6,0x00f8, 0x00ff,0x0101, 0x0101,0x0103, 0x0103,0x0105, 0x0105,0x0107, 0x0107,0x0109, 0x0109,0x010b, 0x010b,0x010d, 0x010d,0x010f, 0x010f,0x0111, 0x0111,0x0113, 0x0113,0x0115, 0x0115,0x0117, 0x0117,0x0119, 0x0119,0x011b, 0x011b,0x011d, 0x011d,0x011f, 0x011f,0x0121, 0x0121,0x0123, 0x0123,0x0125, 0x0125,0x0127, 0x0127,0x0129, 0x0129,0x012b, 0x012b,0x012d, 0x012d,0x012f, 0x012f,0x0131, 0x0131,0x0133, 0x0133,0x0135, 0x0135,0x0137, 0x0138,0x013a, 0x013a,0x013c, 0x013c,0x013e, 0x013e,0x0140, 0x0140,0x0142, 0x0142,0x0144, 0x0144,0x0146, 0x0146,0x0148, 0x0149,0x014b, 0x014b,0x014d, 0x014d,0x014f, 0x014f,0x0151, 0x0151,0x0153, 0x0153,0x0155, 0x0155,0x0157, 0x0157,0x0159, 0x0159,0x015b, 0x015b,0x015d, 0x015d,0x015f, 0x015f,0x0161, 0x0161,0x0163, 0x0163,0x0165, 0x0165,0x0167, 0x0167,0x0169, 0x0169,0x016b, 0x016b,0x016d, 0x016d,0x016f, 0x016f,0x0171, 0x0171,0x0173, 0x0173,0x0175, 0x0175,0x0177, 0x0177,0x017a, 0x017a,0x017c, 0x017c,0x017e, 0x0180,0x0183, 0x0183,0x0185, 0x0185,0x0188, 0x0188,0x018c, 0x018d,0x0192, 0x0192,0x0195, 0x0195,0x0199, 0x019b,0x019e, 0x019e,0x01a1, 0x01a1,0x01a3, 0x01a3,0x01a5, 0x01a5,0x01a8, 0x01a8,0x01aa, 0x01ab,0x01ad, 0x01ad,0x01b0, 0x01b0,0x01b4, 0x01b4,0x01b6, 0x01b6,0x01b9, 0x01ba,0x01bd, 0x01bf,0x01c6, 0x01c6,0x01c9, 0x01c9,0x01cc, 0x01cc,0x01ce, 0x01ce,0x01d0, 0x01d0,0x01d2, 0x01d2,0x01d4, 0x01d4,0x01d6, 0x01d6,0x01d8, 0x01d8,0x01da, 0x01da,0x01dc, 0x01dd,0x01df, 0x01df,0x01e1, 0x01e1,0x01e3, 0x01e3,0x01e5, 0x01e5,0x01e7, 0x01e7,0x01e9, 0x01e9,0x01eb, 0x01eb,0x01ed, 0x01ed,0x01ef, 0x01f0,0x01f3, 0x01f3,0x01f5, 0x01f5,0x01f9, 0x01f9,0x01fb, 0x01fb,0x01fd, 0x01fd,0x01ff, 0x01ff,0x0201, 0x0201,0x0203, 0x0203,0x0205, 0x0205,0x0207, 0x0207,0x0209, 0x0209,0x020b, 0x020b,0x020d, 0x020d,0x020f, 0x020f,0x0211, 0x0211,0x0213, 0x0213,0x0215, 0x0215,0x0217, 0x0217,0x0219, 0x0219,0x021b, 0x021b,0x021d, 0x021d,0x021f, 0x021f,0x0221, 0x0221,0x0223, 0x0223,0x0225, 0x0225,0x0227, 0x0227,0x0229, 0x0229,0x022b, 0x022b,0x022d, 0x022d,0x022f, 0x022f,0x0231, 0x0231,0x0233, 0x0239,0x023c, 0x023c,0x023f, 0x0240,0x0250, 0x02af,0x0390, 0x0390,0x03ac, 0x03ce,0x03d0, 0x03d1,0x03d5, 0x03d7,0x03d9, 0x03d9,0x03db, 0x03db,0x03dd, 0x03dd,0x03df, 0x03df,0x03e1, 0x03e1,0x03e3, 0x03e3,0x03e5, 0x03e5,0x03e7, 0x03e7,0x03e9, 0x03e9,0x03eb, 0x03eb,0x03ed, 0x03ed,0x03ef, 0x03f3,0x03f5, 0x03f5,0x03f8, 0x03f8,0x03fb, 0x03fc,0x0430, 0x045f,0x0461, 0x0461,0x0463, 0x0463,0x0465, 0x0465,0x0467, 0x0467,0x0469, 0x0469,0x046b, 0x046b,0x046d, 0x046d,0x046f, 0x046f,0x0471, 0x0471,0x0473, 0x0473,0x0475, 0x0475,0x0477, 0x0477,0x0479, 0x0479,0x047b, 0x047b,0x047d, 0x047d,0x047f, 0x047f,0x0481, 0x0481,0x048b, 0x048b,0x048d, 0x048d,0x048f, 0x048f,0x0491, 0x0491,0x0493, 0x0493,0x0495, 0x0495,0x0497, 0x0497,0x0499, 0x0499,0x049b, 0x049b,0x049d, 0x049d,0x049f, 0x049f,0x04a1, 0x04a1,0x04a3, 0x04a3,0x04a5, 0x04a5,0x04a7, 0x04a7,0x04a9, 0x04a9,0x04ab, 0x04ab,0x04ad, 0x04ad,0x04af, 0x04af,0x04b1, 0x04b1,0x04b3, 0x04b3,0x04b5, 0x04b5,0x04b7, 0x04b7,0x04b9, 0x04b9,0x04bb, 0x04bb,0x04bd, 0x04bd,0x04bf, 0x04bf,0x04c2, 0x04c2,0x04c4, 0x04c4,0x04c6, 0x04c6,0x04c8, 0x04c8,0x04ca, 0x04ca,0x04cc, 0x04cc,0x04ce, 0x04ce,0x04d1, 0x04d1,0x04d3, 0x04d3,0x04d5, 0x04d5,0x04d7, 0x04d7,0x04d9, 0x04d9,0x04db, 0x04db,0x04dd, 0x04dd,0x04df, 0x04df,0x04e1, 0x04e1,0x04e3, 0x04e3,0x04e5, 0x04e5,0x04e7, 0x04e7,0x04e9, 0x04e9,0x04eb, 0x04eb,0x04ed, 0x04ed,0x04ef, 0x04ef,0x04f1, 0x04f1,0x04f3, 0x04f3,0x04f5, 0x04f5,0x04f7, 0x04f7,0x04f9, 0x04f9,0x0501, 0x0501,0x0503, 0x0503,0x0505, 0x0505,0x0507, 0x0507,0x0509, 0x0509,0x050b, 0x050b,0x050d, 0x050d,0x050f, 0x050f,0x0561, 0x0587,0x1d00, 0x1d2b,0x1d62, 0x1d77,0x1d79, 0x1d9a,0x1e01, 0x1e01,0x1e03, 0x1e03,0x1e05, 0x1e05,0x1e07, 0x1e07,0x1e09, 0x1e09,0x1e0b, 0x1e0b,0x1e0d, 0x1e0d,0x1e0f, 0x1e0f,0x1e11, 0x1e11,0x1e13, 0x1e13,0x1e15, 0x1e15,0x1e17, 0x1e17,0x1e19, 0x1e19,0x1e1b, 0x1e1b,0x1e1d, 0x1e1d,0x1e1f, 0x1e1f,0x1e21, 0x1e21,0x1e23, 0x1e23,0x1e25, 0x1e25,0x1e27, 0x1e27,0x1e29, 0x1e29,0x1e2b, 0x1e2b,0x1e2d, 0x1e2d,0x1e2f, 0x1e2f,0x1e31, 0x1e31,0x1e33, 0x1e33,0x1e35, 0x1e35,0x1e37, 0x1e37,0x1e39, 0x1e39,0x1e3b, 0x1e3b,0x1e3d, 0x1e3d,0x1e3f, 0x1e3f,0x1e41, 0x1e41,0x1e43, 0x1e43,0x1e45, 0x1e45,0x1e47, 0x1e47,0x1e49, 0x1e49,0x1e4b, 0x1e4b,0x1e4d, 0x1e4d,0x1e4f, 0x1e4f,0x1e51, 0x1e51,0x1e53, 0x1e53,0x1e55, 0x1e55,0x1e57, 0x1e57,0x1e59, 0x1e59,0x1e5b, 0x1e5b,0x1e5d, 0x1e5d,0x1e5f, 0x1e5f,0x1e61, 0x1e61,0x1e63, 0x1e63,0x1e65, 0x1e65,0x1e67, 0x1e67,0x1e69, 0x1e69,0x1e6b, 0x1e6b,0x1e6d, 0x1e6d,0x1e6f, 0x1e6f,0x1e71, 0x1e71,0x1e73, 0x1e73,0x1e75, 0x1e75,0x1e77, 0x1e77,0x1e79, 0x1e79,0x1e7b, 0x1e7b,0x1e7d, 0x1e7d,0x1e7f, 0x1e7f,0x1e81, 0x1e81,0x1e83, 0x1e83,0x1e85, 0x1e85,0x1e87, 0x1e87,0x1e89, 0x1e89,0x1e8b, 0x1e8b,0x1e8d, 0x1e8d,0x1e8f, 0x1e8f,0x1e91, 0x1e91,0x1e93, 0x1e93,0x1e95, 0x1e9b,0x1ea1, 0x1ea1,0x1ea3, 0x1ea3,0x1ea5, 0x1ea5,0x1ea7, 0x1ea7,0x1ea9, 0x1ea9,0x1eab, 0x1eab,0x1ead, 0x1ead,0x1eaf, 0x1eaf,0x1eb1, 0x1eb1,0x1eb3, 0x1eb3,0x1eb5, 0x1eb5,0x1eb7, 0x1eb7,0x1eb9, 0x1eb9,0x1ebb, 0x1ebb,0x1ebd, 0x1ebd,0x1ebf, 0x1ebf,0x1ec1, 0x1ec1,0x1ec3, 0x1ec3,0x1ec5, 0x1ec5,0x1ec7, 0x1ec7,0x1ec9, 0x1ec9,0x1ecb, 0x1ecb,0x1ecd, 0x1ecd,0x1ecf, 0x1ecf,0x1ed1, 0x1ed1,0x1ed3, 0x1ed3,0x1ed5, 0x1ed5,0x1ed7, 0x1ed7,0x1ed9, 0x1ed9,0x1edb, 0x1edb,0x1edd, 0x1edd,0x1edf, 0x1edf,0x1ee1, 0x1ee1,0x1ee3, 0x1ee3,0x1ee5, 0x1ee5,0x1ee7, 0x1ee7,0x1ee9, 0x1ee9,0x1eeb, 0x1eeb,0x1eed, 0x1eed,0x1eef, 0x1eef,0x1ef1, 0x1ef1,0x1ef3, 0x1ef3,0x1ef5, 0x1ef5,0x1ef7, 0x1ef7,0x1ef9, 0x1ef9,0x1f00, 0x1f07,0x1f10, 0x1f15,0x1f20, 0x1f27,0x1f30, 0x1f37,0x1f40, 0x1f45,0x1f50, 0x1f57,0x1f60, 0x1f67,0x1f70, 0x1f7d,0x1f80, 0x1f87,0x1f90, 0x1f97,0x1fa0, 0x1fa7,0x1fb0, 0x1fb4,0x1fb6, 0x1fb7,0x1fbe, 0x1fbe,0x1fc2, 0x1fc4,0x1fc6, 0x1fc7,0x1fd0, 0x1fd3,0x1fd6, 0x1fd7,0x1fe0, 0x1fe7,0x1ff2, 0x1ff4,0x1ff6, 0x1ff7,0x2071, 0x2071,0x207f, 0x207f,0x210a, 0x210a,0x210e, 0x210f,0x2113, 0x2113,0x212f, 0x212f,0x2134, 0x2134,0x2139, 0x2139,0x213c, 0x213d,0x2146, 0x2149,0x2c30, 0x2c5e,0x2c81, 0x2c81,0x2c83, 0x2c83,0x2c85, 0x2c85,0x2c87, 0x2c87,0x2c89, 0x2c89,0x2c8b, 0x2c8b,0x2c8d, 0x2c8d,0x2c8f, 0x2c8f,0x2c91, 0x2c91,0x2c93, 0x2c93,0x2c95, 0x2c95,0x2c97, 0x2c97,0x2c99, 0x2c99,0x2c9b, 0x2c9b,0x2c9d, 0x2c9d,0x2c9f, 0x2c9f,0x2ca1, 0x2ca1,0x2ca3, 0x2ca3,0x2ca5, 0x2ca5,0x2ca7, 0x2ca7,0x2ca9, 0x2ca9,0x2cab, 0x2cab,0x2cad, 0x2cad,0x2caf, 0x2caf,0x2cb1, 0x2cb1,0x2cb3, 0x2cb3,0x2cb5, 0x2cb5,0x2cb7, 0x2cb7,0x2cb9, 0x2cb9,0x2cbb, 0x2cbb,0x2cbd, 0x2cbd,0x2cbf, 0x2cbf,0x2cc1, 0x2cc1,0x2cc3, 0x2cc3,0x2cc5, 0x2cc5,0x2cc7, 0x2cc7,0x2cc9, 0x2cc9,0x2ccb, 0x2ccb,0x2ccd, 0x2ccd,0x2ccf, 0x2ccf,0x2cd1, 0x2cd1,0x2cd3, 0x2cd3,0x2cd5, 0x2cd5,0x2cd7, 0x2cd7,0x2cd9, 0x2cd9,0x2cdb, 0x2cdb,0x2cdd, 0x2cdd,0x2cdf, 0x2cdf,0x2ce1, 0x2ce1,0x2ce3, 0x2ce4,0x2d00, 0x2d25,0xfb00, 0xfb06,0xfb13, 0xfb17,0xff41, 0xff5a,0x10428, 0x1044f,0x1d41a, 0x1d433,0x1d44e, 0x1d454,0x1d456, 0x1d467,0x1d482, 0x1d49b,0x1d4b6, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d4cf,0x1d4ea, 0x1d503,0x1d51e, 0x1d537,0x1d552, 0x1d56b,0x1d586, 0x1d59f,0x1d5ba, 0x1d5d3,0x1d5ee, 0x1d607,0x1d622, 0x1d63b,0x1d656, 0x1d66f,0x1d68a, 0x1d6a5,0x1d6c2, 0x1d6da,0x1d6dc, 0x1d6e1,0x1d6fc, 0x1d714,0x1d716, 0x1d71b,0x1d736, 0x1d74e,0x1d750, 0x1d755,0x1d770, 0x1d788,0x1d78a, 0x1d78f,0x1d7aa, 0x1d7c2,0x1d7c4, 0x1d7c9}; /* CR_Ll *//* 'Lm': General Category */static const OnigCodePoint CR_Lm[] = {26,0x02b0, 0x02c1,0x02c6, 0x02d1,0x02e0, 0x02e4,0x02ee, 0x02ee,0x037a, 0x037a,0x0559, 0x0559,0x0640, 0x0640,0x06e5, 0x06e6,0x0e46, 0x0e46,0x0ec6, 0x0ec6,0x10fc, 0x10fc,0x17d7, 0x17d7,0x1843, 0x1843,0x1d2c, 0x1d61,0x1d78, 0x1d78,0x1d9b, 0x1dbf,0x2090, 0x2094,0x2d6f, 0x2d6f,0x3005, 0x3005,0x3031, 0x3035,0x303b, 0x303b,0x309d, 0x309e,0x30fc, 0x30fe,0xa015, 0xa015,0xff70, 0xff70,0xff9e, 0xff9f}; /* CR_Lm *//* 'Lo': General Category */static const OnigCodePoint CR_Lo[] = {245,0x01bb, 0x01bb,0x01c0, 0x01c3,0x05d0, 0x05ea,0x05f0, 0x05f2,0x0621, 0x063a,0x0641, 0x064a,0x066e, 0x066f,0x0671, 0x06d3,0x06d5, 0x06d5,0x06ee, 0x06ef,0x06fa, 0x06fc,0x06ff, 0x06ff,0x0710, 0x0710,0x0712, 0x072f,0x074d, 0x076d,0x0780, 0x07a5,0x07b1, 0x07b1,0x0904, 0x0939,0x093d, 0x093d,0x0950, 0x0950,0x0958, 0x0961,0x097d, 0x097d,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bd, 0x09bd,0x09ce, 0x09ce,0x09dc, 0x09dd,0x09df, 0x09e1,0x09f0, 0x09f1,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a72, 0x0a74,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abd, 0x0abd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae1,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3d, 0x0b3d,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b71, 0x0b71,0x0b83, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c60, 0x0c61,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbd, 0x0cbd,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d60, 0x0d61,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0e01, 0x0e30,0x0e32, 0x0e33,0x0e40, 0x0e45,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb0,0x0eb2, 0x0eb3,0x0ebd, 0x0ebd,0x0ec0, 0x0ec4,0x0edc, 0x0edd,0x0f00, 0x0f00,0x0f40, 0x0f47,0x0f49, 0x0f6a,0x0f88, 0x0f8b,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x1050, 0x1055,0x10d0, 0x10fa,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x1380, 0x138f,0x13a0, 0x13f4,0x1401, 0x166c,0x166f, 0x1676,0x1681, 0x169a,0x16a0, 0x16ea,0x1700, 0x170c,0x170e, 0x1711,0x1720, 0x1731,0x1740, 0x1751,0x1760, 0x176c,0x176e, 0x1770,0x1780, 0x17b3,0x17dc, 0x17dc,0x1820, 0x1842,0x1844, 0x1877,0x1880, 0x18a8,0x1900, 0x191c,0x1950, 0x196d,0x1970, 0x1974,0x1980, 0x19a9,0x19c1, 0x19c7,0x1a00, 0x1a16,0x2135, 0x2138,0x2d30, 0x2d65,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde,0x3006, 0x3006,0x303c, 0x303c,0x3041, 0x3096,0x309f, 0x309f,0x30a1, 0x30fa,0x30ff, 0x30ff,0x3105, 0x312c,0x3131, 0x318e,0x31a0, 0x31b7,0x31f0, 0x31ff,0x3400, 0x4db5,0x4e00, 0x9fbb,0xa000, 0xa014,0xa016, 0xa48c,0xa800, 0xa801,0xa803, 0xa805,0xa807, 0xa80a,0xa80c, 0xa822,0xac00, 0xd7a3,0xf900, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0xfb1d, 0xfb1d,0xfb1f, 0xfb28,0xfb2a, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfbb1,0xfbd3, 0xfd3d,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfb,0xfe70, 0xfe74,0xfe76, 0xfefc,0xff66, 0xff6f,0xff71, 0xff9d,0xffa0, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa,0x10300, 0x1031e,0x10330, 0x10349,0x10380, 0x1039d,0x103a0, 0x103c3,0x103c8, 0x103cf,0x10450, 0x1049d,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f,0x10a00, 0x10a00,0x10a10, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x20000, 0x2a6d6,0x2f800, 0x2fa1d}; /* CR_Lo *//* 'Lt': General Category */static const OnigCodePoint CR_Lt[] = {10,0x01c5, 0x01c5,0x01c8, 0x01c8,0x01cb, 0x01cb,0x01f2, 0x01f2,0x1f88, 0x1f8f,0x1f98, 0x1f9f,0x1fa8, 0x1faf,0x1fbc, 0x1fbc,0x1fcc, 0x1fcc,0x1ffc, 0x1ffc}; /* CR_Lt *//* 'Lu': General Category */static const OnigCodePoint CR_Lu[] = {476,0x0041, 0x005a,0x00c0, 0x00d6,0x00d8, 0x00de,0x0100, 0x0100,0x0102, 0x0102,0x0104, 0x0104,0x0106, 0x0106,0x0108, 0x0108,0x010a, 0x010a,0x010c, 0x010c,0x010e, 0x010e,0x0110, 0x0110,0x0112, 0x0112,0x0114, 0x0114,0x0116, 0x0116,0x0118, 0x0118,0x011a, 0x011a,0x011c, 0x011c,0x011e, 0x011e,0x0120, 0x0120,0x0122, 0x0122,0x0124, 0x0124,0x0126, 0x0126,0x0128, 0x0128,0x012a, 0x012a,0x012c, 0x012c,0x012e, 0x012e,0x0130, 0x0130,0x0132, 0x0132,0x0134, 0x0134,0x0136, 0x0136,0x0139, 0x0139,0x013b, 0x013b,0x013d, 0x013d,0x013f, 0x013f,0x0141, 0x0141,0x0143, 0x0143,0x0145, 0x0145,0x0147, 0x0147,0x014a, 0x014a,0x014c, 0x014c,0x014e, 0x014e,0x0150, 0x0150,0x0152, 0x0152,0x0154, 0x0154,0x0156, 0x0156,0x0158, 0x0158,0x015a, 0x015a,0x015c, 0x015c,0x015e, 0x015e,0x0160, 0x0160,0x0162, 0x0162,0x0164, 0x0164,0x0166, 0x0166,0x0168, 0x0168,0x016a, 0x016a,0x016c, 0x016c,0x016e, 0x016e,0x0170, 0x0170,0x0172, 0x0172,0x0174, 0x0174,0x0176, 0x0176,0x0178, 0x0179,0x017b, 0x017b,0x017d, 0x017d,0x0181, 0x0182,0x0184, 0x0184,0x0186, 0x0187,0x0189, 0x018b,0x018e, 0x0191,0x0193, 0x0194,0x0196, 0x0198,0x019c, 0x019d,0x019f, 0x01a0,0x01a2, 0x01a2,0x01a4, 0x01a4,0x01a6, 0x01a7,0x01a9, 0x01a9,0x01ac, 0x01ac,0x01ae, 0x01af,0x01b1, 0x01b3,0x01b5, 0x01b5,0x01b7, 0x01b8,0x01bc, 0x01bc,0x01c4, 0x01c4,0x01c7, 0x01c7,0x01ca, 0x01ca,0x01cd, 0x01cd,0x01cf, 0x01cf,0x01d1, 0x01d1,0x01d3, 0x01d3,0x01d5, 0x01d5,0x01d7, 0x01d7,0x01d9, 0x01d9,0x01db, 0x01db,0x01de, 0x01de,0x01e0, 0x01e0,0x01e2, 0x01e2,0x01e4, 0x01e4,0x01e6, 0x01e6,0x01e8, 0x01e8,0x01ea, 0x01ea,0x01ec, 0x01ec,0x01ee, 0x01ee,0x01f1, 0x01f1,0x01f4, 0x01f4,0x01f6, 0x01f8,0x01fa, 0x01fa,0x01fc, 0x01fc,0x01fe, 0x01fe,0x0200, 0x0200,0x0202, 0x0202,0x0204, 0x0204,0x0206, 0x0206,0x0208, 0x0208,0x020a, 0x020a,0x020c, 0x020c,0x020e, 0x020e,0x0210, 0x0210,0x0212, 0x0212,0x0214, 0x0214,0x0216, 0x0216,0x0218, 0x0218,0x021a, 0x021a,0x021c, 0x021c,0x021e, 0x021e,0x0220, 0x0220,0x0222, 0x0222,0x0224, 0x0224,0x0226, 0x0226,0x0228, 0x0228,0x022a, 0x022a,0x022c, 0x022c,0x022e, 0x022e,0x0230, 0x0230,0x0232, 0x0232,0x023a, 0x023b,0x023d, 0x023e,0x0241, 0x0241,0x0386, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x038f,0x0391, 0x03a1,0x03a3, 0x03ab,0x03d2, 0x03d4,0x03d8, 0x03d8,0x03da, 0x03da,0x03dc, 0x03dc,0x03de, 0x03de,0x03e0, 0x03e0,0x03e2, 0x03e2,0x03e4, 0x03e4,0x03e6, 0x03e6,0x03e8, 0x03e8,0x03ea, 0x03ea,0x03ec, 0x03ec,0x03ee, 0x03ee,0x03f4, 0x03f4,0x03f7, 0x03f7,0x03f9, 0x03fa,0x03fd, 0x042f,0x0460, 0x0460,0x0462, 0x0462,0x0464, 0x0464,0x0466, 0x0466,0x0468, 0x0468,0x046a, 0x046a,0x046c, 0x046c,0x046e, 0x046e,0x0470, 0x0470,0x0472, 0x0472,0x0474, 0x0474,0x0476, 0x0476,0x0478, 0x0478,0x047a, 0x047a,0x047c, 0x047c,0x047e, 0x047e,0x0480, 0x0480,0x048a, 0x048a,0x048c, 0x048c,0x048e, 0x048e,0x0490, 0x0490,0x0492, 0x0492,0x0494, 0x0494,0x0496, 0x0496,0x0498, 0x0498,0x049a, 0x049a,0x049c, 0x049c,0x049e, 0x049e,0x04a0, 0x04a0,0x04a2, 0x04a2,0x04a4, 0x04a4,0x04a6, 0x04a6,0x04a8, 0x04a8,0x04aa, 0x04aa,0x04ac, 0x04ac,0x04ae, 0x04ae,0x04b0, 0x04b0,0x04b2, 0x04b2,0x04b4, 0x04b4,0x04b6, 0x04b6,0x04b8, 0x04b8,0x04ba, 0x04ba,0x04bc, 0x04bc,0x04be, 0x04be,0x04c0, 0x04c1,0x04c3, 0x04c3,0x04c5, 0x04c5,0x04c7, 0x04c7,0x04c9, 0x04c9,0x04cb, 0x04cb,0x04cd, 0x04cd,0x04d0, 0x04d0,0x04d2, 0x04d2,0x04d4, 0x04d4,0x04d6, 0x04d6,0x04d8, 0x04d8,0x04da, 0x04da,0x04dc, 0x04dc,0x04de, 0x04de,0x04e0, 0x04e0,0x04e2, 0x04e2,0x04e4, 0x04e4,0x04e6, 0x04e6,0x04e8, 0x04e8,0x04ea, 0x04ea,0x04ec, 0x04ec,0x04ee, 0x04ee,0x04f0, 0x04f0,0x04f2, 0x04f2,0x04f4, 0x04f4,0x04f6, 0x04f6,0x04f8, 0x04f8,0x0500, 0x0500,0x0502, 0x0502,0x0504, 0x0504,0x0506, 0x0506,0x0508, 0x0508,0x050a, 0x050a,0x050c, 0x050c,0x050e, 0x050e,0x0531, 0x0556,0x10a0, 0x10c5,0x1e00, 0x1e00,0x1e02, 0x1e02,0x1e04, 0x1e04,0x1e06, 0x1e06,0x1e08, 0x1e08,0x1e0a, 0x1e0a,0x1e0c, 0x1e0c,0x1e0e, 0x1e0e,0x1e10, 0x1e10,0x1e12, 0x1e12,0x1e14, 0x1e14,0x1e16, 0x1e16,0x1e18, 0x1e18,0x1e1a, 0x1e1a,0x1e1c, 0x1e1c,0x1e1e, 0x1e1e,0x1e20, 0x1e20,0x1e22, 0x1e22,0x1e24, 0x1e24,0x1e26, 0x1e26,0x1e28, 0x1e28,0x1e2a, 0x1e2a,0x1e2c, 0x1e2c,0x1e2e, 0x1e2e,0x1e30, 0x1e30,0x1e32, 0x1e32,0x1e34, 0x1e34,0x1e36, 0x1e36,0x1e38, 0x1e38,0x1e3a, 0x1e3a,0x1e3c, 0x1e3c,0x1e3e, 0x1e3e,0x1e40, 0x1e40,0x1e42, 0x1e42,0x1e44, 0x1e44,0x1e46, 0x1e46,0x1e48, 0x1e48,0x1e4a, 0x1e4a,0x1e4c, 0x1e4c,0x1e4e, 0x1e4e,0x1e50, 0x1e50,0x1e52, 0x1e52,0x1e54, 0x1e54,0x1e56, 0x1e56,0x1e58, 0x1e58,0x1e5a, 0x1e5a,0x1e5c, 0x1e5c,0x1e5e, 0x1e5e,0x1e60, 0x1e60,0x1e62, 0x1e62,0x1e64, 0x1e64,0x1e66, 0x1e66,0x1e68, 0x1e68,0x1e6a, 0x1e6a,0x1e6c, 0x1e6c,0x1e6e, 0x1e6e,0x1e70, 0x1e70,0x1e72, 0x1e72,0x1e74, 0x1e74,0x1e76, 0x1e76,0x1e78, 0x1e78,0x1e7a, 0x1e7a,0x1e7c, 0x1e7c,0x1e7e, 0x1e7e,0x1e80, 0x1e80,0x1e82, 0x1e82,0x1e84, 0x1e84,0x1e86, 0x1e86,0x1e88, 0x1e88,0x1e8a, 0x1e8a,0x1e8c, 0x1e8c,0x1e8e, 0x1e8e,0x1e90, 0x1e90,0x1e92, 0x1e92,0x1e94, 0x1e94,0x1ea0, 0x1ea0,0x1ea2, 0x1ea2,0x1ea4, 0x1ea4,0x1ea6, 0x1ea6,0x1ea8, 0x1ea8,0x1eaa, 0x1eaa,0x1eac, 0x1eac,0x1eae, 0x1eae,0x1eb0, 0x1eb0,0x1eb2, 0x1eb2,0x1eb4, 0x1eb4,0x1eb6, 0x1eb6,0x1eb8, 0x1eb8,0x1eba, 0x1eba,0x1ebc, 0x1ebc,0x1ebe, 0x1ebe,0x1ec0, 0x1ec0,0x1ec2, 0x1ec2,0x1ec4, 0x1ec4,0x1ec6, 0x1ec6,0x1ec8, 0x1ec8,0x1eca, 0x1eca,0x1ecc, 0x1ecc,0x1ece, 0x1ece,0x1ed0, 0x1ed0,0x1ed2, 0x1ed2,0x1ed4, 0x1ed4,0x1ed6, 0x1ed6,0x1ed8, 0x1ed8,0x1eda, 0x1eda,0x1edc, 0x1edc,0x1ede, 0x1ede,0x1ee0, 0x1ee0,0x1ee2, 0x1ee2,0x1ee4, 0x1ee4,0x1ee6, 0x1ee6,0x1ee8, 0x1ee8,0x1eea, 0x1eea,0x1eec, 0x1eec,0x1eee, 0x1eee,0x1ef0, 0x1ef0,0x1ef2, 0x1ef2,0x1ef4, 0x1ef4,0x1ef6, 0x1ef6,0x1ef8, 0x1ef8,0x1f08, 0x1f0f,0x1f18, 0x1f1d,0x1f28, 0x1f2f,0x1f38, 0x1f3f,0x1f48, 0x1f4d,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f5f,0x1f68, 0x1f6f,0x1fb8, 0x1fbb,0x1fc8, 0x1fcb,0x1fd8, 0x1fdb,0x1fe8, 0x1fec,0x1ff8, 0x1ffb,0x2102, 0x2102,0x2107, 0x2107,0x210b, 0x210d,0x2110, 0x2112,0x2115, 0x2115,0x2119, 0x211d,0x2124, 0x2124,0x2126, 0x2126,0x2128, 0x2128,0x212a, 0x212d,0x2130, 0x2131,0x2133, 0x2133,0x213e, 0x213f,0x2145, 0x2145,0x2c00, 0x2c2e,0x2c80, 0x2c80,0x2c82, 0x2c82,0x2c84, 0x2c84,0x2c86, 0x2c86,0x2c88, 0x2c88,0x2c8a, 0x2c8a,0x2c8c, 0x2c8c,0x2c8e, 0x2c8e,0x2c90, 0x2c90,0x2c92, 0x2c92,0x2c94, 0x2c94,0x2c96, 0x2c96,0x2c98, 0x2c98,0x2c9a, 0x2c9a,0x2c9c, 0x2c9c,0x2c9e, 0x2c9e,0x2ca0, 0x2ca0,0x2ca2, 0x2ca2,0x2ca4, 0x2ca4,0x2ca6, 0x2ca6,0x2ca8, 0x2ca8,0x2caa, 0x2caa,0x2cac, 0x2cac,0x2cae, 0x2cae,0x2cb0, 0x2cb0,0x2cb2, 0x2cb2,0x2cb4, 0x2cb4,0x2cb6, 0x2cb6,0x2cb8, 0x2cb8,0x2cba, 0x2cba,0x2cbc, 0x2cbc,0x2cbe, 0x2cbe,0x2cc0, 0x2cc0,0x2cc2, 0x2cc2,0x2cc4, 0x2cc4,0x2cc6, 0x2cc6,0x2cc8, 0x2cc8,0x2cca, 0x2cca,0x2ccc, 0x2ccc,0x2cce, 0x2cce,0x2cd0, 0x2cd0,0x2cd2, 0x2cd2,0x2cd4, 0x2cd4,0x2cd6, 0x2cd6,0x2cd8, 0x2cd8,0x2cda, 0x2cda,0x2cdc, 0x2cdc,0x2cde, 0x2cde,0x2ce0, 0x2ce0,0x2ce2, 0x2ce2,0xff21, 0xff3a,0x10400, 0x10427,0x1d400, 0x1d419,0x1d434, 0x1d44d,0x1d468, 0x1d481,0x1d49c, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b5,0x1d4d0, 0x1d4e9,0x1d504, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d538, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d56c, 0x1d585,0x1d5a0, 0x1d5b9,0x1d5d4, 0x1d5ed,0x1d608, 0x1d621,0x1d63c, 0x1d655,0x1d670, 0x1d689,0x1d6a8, 0x1d6c0,0x1d6e2, 0x1d6fa,0x1d71c, 0x1d734,0x1d756, 0x1d76e,0x1d790, 0x1d7a8}; /* CR_Lu *//* 'M': Major Category */static const OnigCodePoint CR_M[] = {133,0x0300, 0x036f,0x0483, 0x0486,0x0488, 0x0489,0x0591, 0x05b9,0x05bb, 0x05bd,0x05bf, 0x05bf,0x05c1, 0x05c2,0x05c4, 0x05c5,0x05c7, 0x05c7,0x0610, 0x0615,0x064b, 0x065e,0x0670, 0x0670,0x06d6, 0x06dc,0x06de, 0x06e4,0x06e7, 0x06e8,0x06ea, 0x06ed,0x0711, 0x0711,0x0730, 0x074a,0x07a6, 0x07b0,0x0901, 0x0903,0x093c, 0x093c,0x093e, 0x094d,0x0951, 0x0954,0x0962, 0x0963,0x0981, 0x0983,0x09bc, 0x09bc,0x09be, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09cd,0x09d7, 0x09d7,0x09e2, 0x09e3,0x0a01, 0x0a03,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a70, 0x0a71,0x0a81, 0x0a83,0x0abc, 0x0abc,0x0abe, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ae2, 0x0ae3,0x0b01, 0x0b03,0x0b3c, 0x0b3c,0x0b3e, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b82, 0x0b82,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0c01, 0x0c03,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c82, 0x0c83,0x0cbc, 0x0cbc,0x0cbe, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0d02, 0x0d03,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d82, 0x0d83,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df3,0x0e31, 0x0e31,0x0e34, 0x0e3a,0x0e47, 0x0e4e,0x0eb1, 0x0eb1,0x0eb4, 0x0eb9,0x0ebb, 0x0ebc,0x0ec8, 0x0ecd,0x0f18, 0x0f19,0x0f35, 0x0f35,0x0f37, 0x0f37,0x0f39, 0x0f39,0x0f3e, 0x0f3f,0x0f71, 0x0f84,0x0f86, 0x0f87,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fc6, 0x0fc6,0x102c, 0x1032,0x1036, 0x1039,0x1056, 0x1059,0x135f, 0x135f,0x1712, 0x1714,0x1732, 0x1734,0x1752, 0x1753,0x1772, 0x1773,0x17b6, 0x17d3,0x17dd, 0x17dd,0x180b, 0x180d,0x18a9, 0x18a9,0x1920, 0x192b,0x1930, 0x193b,0x19b0, 0x19c0,0x19c8, 0x19c9,0x1a17, 0x1a1b,0x1dc0, 0x1dc3,0x20d0, 0x20eb,0x302a, 0x302f,0x3099, 0x309a,0xa802, 0xa802,0xa806, 0xa806,0xa80b, 0xa80b,0xa823, 0xa827,0xfb1e, 0xfb1e,0xfe00, 0xfe0f,0xfe20, 0xfe23,0x10a01, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a0f,0x10a38, 0x10a3a,0x10a3f, 0x10a3f,0x1d165, 0x1d169,0x1d16d, 0x1d172,0x1d17b, 0x1d182,0x1d185, 0x1d18b,0x1d1aa, 0x1d1ad,0x1d242, 0x1d244,0xe0100, 0xe01ef}; /* CR_M *//* 'Mc': General Category */static const OnigCodePoint CR_Mc[] = {63,0x0903, 0x0903,0x093e, 0x0940,0x0949, 0x094c,0x0982, 0x0983,0x09be, 0x09c0,0x09c7, 0x09c8,0x09cb, 0x09cc,0x09d7, 0x09d7,0x0a03, 0x0a03,0x0a3e, 0x0a40,0x0a83, 0x0a83,0x0abe, 0x0ac0,0x0ac9, 0x0ac9,0x0acb, 0x0acc,0x0b02, 0x0b03,0x0b3e, 0x0b3e,0x0b40, 0x0b40,0x0b47, 0x0b48,0x0b4b, 0x0b4c,0x0b57, 0x0b57,0x0bbe, 0x0bbf,0x0bc1, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcc,0x0bd7, 0x0bd7,0x0c01, 0x0c03,0x0c41, 0x0c44,0x0c82, 0x0c83,0x0cbe, 0x0cbe,0x0cc0, 0x0cc4,0x0cc7, 0x0cc8,0x0cca, 0x0ccb,0x0cd5, 0x0cd6,0x0d02, 0x0d03,0x0d3e, 0x0d40,0x0d46, 0x0d48,0x0d4a, 0x0d4c,0x0d57, 0x0d57,0x0d82, 0x0d83,0x0dcf, 0x0dd1,0x0dd8, 0x0ddf,0x0df2, 0x0df3,0x0f3e, 0x0f3f,0x0f7f, 0x0f7f,0x102c, 0x102c,0x1031, 0x1031,0x1038, 0x1038,0x1056, 0x1057,0x17b6, 0x17b6,0x17be, 0x17c5,0x17c7, 0x17c8,0x1923, 0x1926,0x1929, 0x192b,0x1930, 0x1931,0x1933, 0x1938,0x19b0, 0x19c0,0x19c8, 0x19c9,0x1a19, 0x1a1b,0xa802, 0xa802,0xa823, 0xa824,0xa827, 0xa827,0x1d165, 0x1d166,0x1d16d, 0x1d172}; /* CR_Mc *//* 'Me': General Category */static const OnigCodePoint CR_Me[] = {4,0x0488, 0x0489,0x06de, 0x06de,0x20dd, 0x20e0,0x20e2, 0x20e4}; /* CR_Me *//* 'Mn': General Category */static const OnigCodePoint CR_Mn[] = {124,0x0300, 0x036f,0x0483, 0x0486,0x0591, 0x05b9,0x05bb, 0x05bd,0x05bf, 0x05bf,0x05c1, 0x05c2,0x05c4, 0x05c5,0x05c7, 0x05c7,0x0610, 0x0615,0x064b, 0x065e,0x0670, 0x0670,0x06d6, 0x06dc,0x06df, 0x06e4,0x06e7, 0x06e8,0x06ea, 0x06ed,0x0711, 0x0711,0x0730, 0x074a,0x07a6, 0x07b0,0x0901, 0x0902,0x093c, 0x093c,0x0941, 0x0948,0x094d, 0x094d,0x0951, 0x0954,0x0962, 0x0963,0x0981, 0x0981,0x09bc, 0x09bc,0x09c1, 0x09c4,0x09cd, 0x09cd,0x09e2, 0x09e3,0x0a01, 0x0a02,0x0a3c, 0x0a3c,0x0a41, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a70, 0x0a71,0x0a81, 0x0a82,0x0abc, 0x0abc,0x0ac1, 0x0ac5,0x0ac7, 0x0ac8,0x0acd, 0x0acd,0x0ae2, 0x0ae3,0x0b01, 0x0b01,0x0b3c, 0x0b3c,0x0b3f, 0x0b3f,0x0b41, 0x0b43,0x0b4d, 0x0b4d,0x0b56, 0x0b56,0x0b82, 0x0b82,0x0bc0, 0x0bc0,0x0bcd, 0x0bcd,0x0c3e, 0x0c40,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0cbc, 0x0cbc,0x0cbf, 0x0cbf,0x0cc6, 0x0cc6,0x0ccc, 0x0ccd,0x0d41, 0x0d43,0x0d4d, 0x0d4d,0x0dca, 0x0dca,0x0dd2, 0x0dd4,0x0dd6, 0x0dd6,0x0e31, 0x0e31,0x0e34, 0x0e3a,0x0e47, 0x0e4e,0x0eb1, 0x0eb1,0x0eb4, 0x0eb9,0x0ebb, 0x0ebc,0x0ec8, 0x0ecd,0x0f18, 0x0f19,0x0f35, 0x0f35,0x0f37, 0x0f37,0x0f39, 0x0f39,0x0f71, 0x0f7e,0x0f80, 0x0f84,0x0f86, 0x0f87,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fc6, 0x0fc6,0x102d, 0x1030,0x1032, 0x1032,0x1036, 0x1037,0x1039, 0x1039,0x1058, 0x1059,0x135f, 0x135f,0x1712, 0x1714,0x1732, 0x1734,0x1752, 0x1753,0x1772, 0x1773,0x17b7, 0x17bd,0x17c6, 0x17c6,0x17c9, 0x17d3,0x17dd, 0x17dd,0x180b, 0x180d,0x18a9, 0x18a9,0x1920, 0x1922,0x1927, 0x1928,0x1932, 0x1932,0x1939, 0x193b,0x1a17, 0x1a18,0x1dc0, 0x1dc3,0x20d0, 0x20dc,0x20e1, 0x20e1,0x20e5, 0x20eb,0x302a, 0x302f,0x3099, 0x309a,0xa806, 0xa806,0xa80b, 0xa80b,0xa825, 0xa826,0xfb1e, 0xfb1e,0xfe00, 0xfe0f,0xfe20, 0xfe23,0x10a01, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a0f,0x10a38, 0x10a3a,0x10a3f, 0x10a3f,0x1d167, 0x1d169,0x1d17b, 0x1d182,0x1d185, 0x1d18b,0x1d1aa, 0x1d1ad,0x1d242, 0x1d244,0xe0100, 0xe01ef}; /* CR_Mn *//* 'N': Major Category */static const OnigCodePoint CR_N[] = {53,0x0030, 0x0039,0x00b2, 0x00b3,0x00b9, 0x00b9,0x00bc, 0x00be,0x0660, 0x0669,0x06f0, 0x06f9,0x0966, 0x096f,0x09e6, 0x09ef,0x09f4, 0x09f9,0x0a66, 0x0a6f,0x0ae6, 0x0aef,0x0b66, 0x0b6f,0x0be6, 0x0bf2,0x0c66, 0x0c6f,0x0ce6, 0x0cef,0x0d66, 0x0d6f,0x0e50, 0x0e59,0x0ed0, 0x0ed9,0x0f20, 0x0f33,0x1040, 0x1049,0x1369, 0x137c,0x16ee, 0x16f0,0x17e0, 0x17e9,0x17f0, 0x17f9,0x1810, 0x1819,0x1946, 0x194f,0x19d0, 0x19d9,0x2070, 0x2070,0x2074, 0x2079,0x2080, 0x2089,0x2153, 0x2183,0x2460, 0x249b,0x24ea, 0x24ff,0x2776, 0x2793,0x2cfd, 0x2cfd,0x3007, 0x3007,0x3021, 0x3029,0x3038, 0x303a,0x3192, 0x3195,0x3220, 0x3229,0x3251, 0x325f,0x3280, 0x3289,0x32b1, 0x32bf,0xff10, 0xff19,0x10107, 0x10133,0x10140, 0x10178,0x1018a, 0x1018a,0x10320, 0x10323,0x1034a, 0x1034a,0x103d1, 0x103d5,0x104a0, 0x104a9,0x10a40, 0x10a47,0x1d7ce, 0x1d7ff}; /* CR_N *//* 'Nd': General Category */static const OnigCodePoint CR_Nd[] = {23,0x0030, 0x0039,0x0660, 0x0669,0x06f0, 0x06f9,0x0966, 0x096f,0x09e6, 0x09ef,0x0a66, 0x0a6f,0x0ae6, 0x0aef,0x0b66, 0x0b6f,0x0be6, 0x0bef,0x0c66, 0x0c6f,0x0ce6, 0x0cef,0x0d66, 0x0d6f,0x0e50, 0x0e59,0x0ed0, 0x0ed9,0x0f20, 0x0f29,0x1040, 0x1049,0x17e0, 0x17e9,0x1810, 0x1819,0x1946, 0x194f,0x19d0, 0x19d9,0xff10, 0xff19,0x104a0, 0x104a9,0x1d7ce, 0x1d7ff}; /* CR_Nd *//* 'Nl': General Category */static const OnigCodePoint CR_Nl[] = {8,0x16ee, 0x16f0,0x2160, 0x2183,0x3007, 0x3007,0x3021, 0x3029,0x3038, 0x303a,0x10140, 0x10174,0x1034a, 0x1034a,0x103d1, 0x103d5}; /* CR_Nl *//* 'No': General Category */static const OnigCodePoint CR_No[] = {26,0x00b2, 0x00b3,0x00b9, 0x00b9,0x00bc, 0x00be,0x09f4, 0x09f9,0x0bf0, 0x0bf2,0x0f2a, 0x0f33,0x1369, 0x137c,0x17f0, 0x17f9,0x2070, 0x2070,0x2074, 0x2079,0x2080, 0x2089,0x2153, 0x215f,0x2460, 0x249b,0x24ea, 0x24ff,0x2776, 0x2793,0x2cfd, 0x2cfd,0x3192, 0x3195,0x3220, 0x3229,0x3251, 0x325f,0x3280, 0x3289,0x32b1, 0x32bf,0x10107, 0x10133,0x10175, 0x10178,0x1018a, 0x1018a,0x10320, 0x10323,0x10a40, 0x10a47}; /* CR_No *//* 'P': Major Category */static const OnigCodePoint CR_P[] = {96,0x0021, 0x0023,0x0025, 0x002a,0x002c, 0x002f,0x003a, 0x003b,0x003f, 0x0040,0x005b, 0x005d,0x005f, 0x005f,0x007b, 0x007b,0x007d, 0x007d,0x00a1, 0x00a1,0x00ab, 0x00ab,0x00b7, 0x00b7,0x00bb, 0x00bb,0x00bf, 0x00bf,0x037e, 0x037e,0x0387, 0x0387,0x055a, 0x055f,0x0589, 0x058a,0x05be, 0x05be,0x05c0, 0x05c0,0x05c3, 0x05c3,0x05c6, 0x05c6,0x05f3, 0x05f4,0x060c, 0x060d,0x061b, 0x061b,0x061e, 0x061f,0x066a, 0x066d,0x06d4, 0x06d4,0x0700, 0x070d,0x0964, 0x0965,0x0970, 0x0970,0x0df4, 0x0df4,0x0e4f, 0x0e4f,0x0e5a, 0x0e5b,0x0f04, 0x0f12,0x0f3a, 0x0f3d,0x0f85, 0x0f85,0x0fd0, 0x0fd1,0x104a, 0x104f,0x10fb, 0x10fb,0x1361, 0x1368,0x166d, 0x166e,0x169b, 0x169c,0x16eb, 0x16ed,0x1735, 0x1736,0x17d4, 0x17d6,0x17d8, 0x17da,0x1800, 0x180a,0x1944, 0x1945,0x19de, 0x19df,0x1a1e, 0x1a1f,0x2010, 0x2027,0x2030, 0x2043,0x2045, 0x2051,0x2053, 0x205e,0x207d, 0x207e,0x208d, 0x208e,0x2329, 0x232a,0x23b4, 0x23b6,0x2768, 0x2775,0x27c5, 0x27c6,0x27e6, 0x27eb,0x2983, 0x2998,0x29d8, 0x29db,0x29fc, 0x29fd,0x2cf9, 0x2cfc,0x2cfe, 0x2cff,0x2e00, 0x2e17,0x2e1c, 0x2e1d,0x3001, 0x3003,0x3008, 0x3011,0x3014, 0x301f,0x3030, 0x3030,0x303d, 0x303d,0x30a0, 0x30a0,0x30fb, 0x30fb,0xfd3e, 0xfd3f,0xfe10, 0xfe19,0xfe30, 0xfe52,0xfe54, 0xfe61,0xfe63, 0xfe63,0xfe68, 0xfe68,0xfe6a, 0xfe6b,0xff01, 0xff03,0xff05, 0xff0a,0xff0c, 0xff0f,0xff1a, 0xff1b,0xff1f, 0xff20,0xff3b, 0xff3d,0xff3f, 0xff3f,0xff5b, 0xff5b,0xff5d, 0xff5d,0xff5f, 0xff65,0x10100, 0x10101,0x1039f, 0x1039f,0x10a50, 0x10a58}; /* CR_P *//* 'Pc': General Category */static const OnigCodePoint CR_Pc[] = {6,0x005f, 0x005f,0x203f, 0x2040,0x2054, 0x2054,0xfe33, 0xfe34,0xfe4d, 0xfe4f,0xff3f, 0xff3f}; /* CR_Pc *//* 'Pd': General Category */static const OnigCodePoint CR_Pd[] = {12,0x002d, 0x002d,0x058a, 0x058a,0x1806, 0x1806,0x2010, 0x2015,0x2e17, 0x2e17,0x301c, 0x301c,0x3030, 0x3030,0x30a0, 0x30a0,0xfe31, 0xfe32,0xfe58, 0xfe58,0xfe63, 0xfe63,0xff0d, 0xff0d}; /* CR_Pd *//* 'Pe': General Category */static const OnigCodePoint CR_Pe[] = {65,0x0029, 0x0029,0x005d, 0x005d,0x007d, 0x007d,0x0f3b, 0x0f3b,0x0f3d, 0x0f3d,0x169c, 0x169c,0x2046, 0x2046,0x207e, 0x207e,0x208e, 0x208e,0x232a, 0x232a,0x23b5, 0x23b5,0x2769, 0x2769,0x276b, 0x276b,0x276d, 0x276d,0x276f, 0x276f,0x2771, 0x2771,0x2773, 0x2773,0x2775, 0x2775,0x27c6, 0x27c6,0x27e7, 0x27e7,0x27e9, 0x27e9,0x27eb, 0x27eb,0x2984, 0x2984,0x2986, 0x2986,0x2988, 0x2988,0x298a, 0x298a,0x298c, 0x298c,0x298e, 0x298e,0x2990, 0x2990,0x2992, 0x2992,0x2994, 0x2994,0x2996, 0x2996,0x2998, 0x2998,0x29d9, 0x29d9,0x29db, 0x29db,0x29fd, 0x29fd,0x3009, 0x3009,0x300b, 0x300b,0x300d, 0x300d,0x300f, 0x300f,0x3011, 0x3011,0x3015, 0x3015,0x3017, 0x3017,0x3019, 0x3019,0x301b, 0x301b,0x301e, 0x301f,0xfd3f, 0xfd3f,0xfe18, 0xfe18,0xfe36, 0xfe36,0xfe38, 0xfe38,0xfe3a, 0xfe3a,0xfe3c, 0xfe3c,0xfe3e, 0xfe3e,0xfe40, 0xfe40,0xfe42, 0xfe42,0xfe44, 0xfe44,0xfe48, 0xfe48,0xfe5a, 0xfe5a,0xfe5c, 0xfe5c,0xfe5e, 0xfe5e,0xff09, 0xff09,0xff3d, 0xff3d,0xff5d, 0xff5d,0xff60, 0xff60,0xff63, 0xff63}; /* CR_Pe *//* 'Pf': General Category */static const OnigCodePoint CR_Pf[] = {9,0x00bb, 0x00bb,0x2019, 0x2019,0x201d, 0x201d,0x203a, 0x203a,0x2e03, 0x2e03,0x2e05, 0x2e05,0x2e0a, 0x2e0a,0x2e0d, 0x2e0d,0x2e1d, 0x2e1d}; /* CR_Pf *//* 'Pi': General Category */static const OnigCodePoint CR_Pi[] = {10,0x00ab, 0x00ab,0x2018, 0x2018,0x201b, 0x201c,0x201f, 0x201f,0x2039, 0x2039,0x2e02, 0x2e02,0x2e04, 0x2e04,0x2e09, 0x2e09,0x2e0c, 0x2e0c,0x2e1c, 0x2e1c}; /* CR_Pi *//* 'Po': General Category */static const OnigCodePoint CR_Po[] = {88,0x0021, 0x0023,0x0025, 0x0027,0x002a, 0x002a,0x002c, 0x002c,0x002e, 0x002f,0x003a, 0x003b,0x003f, 0x0040,0x005c, 0x005c,0x00a1, 0x00a1,0x00b7, 0x00b7,0x00bf, 0x00bf,0x037e, 0x037e,0x0387, 0x0387,0x055a, 0x055f,0x0589, 0x0589,0x05be, 0x05be,0x05c0, 0x05c0,0x05c3, 0x05c3,0x05c6, 0x05c6,0x05f3, 0x05f4,0x060c, 0x060d,0x061b, 0x061b,0x061e, 0x061f,0x066a, 0x066d,0x06d4, 0x06d4,0x0700, 0x070d,0x0964, 0x0965,0x0970, 0x0970,0x0df4, 0x0df4,0x0e4f, 0x0e4f,0x0e5a, 0x0e5b,0x0f04, 0x0f12,0x0f85, 0x0f85,0x0fd0, 0x0fd1,0x104a, 0x104f,0x10fb, 0x10fb,0x1361, 0x1368,0x166d, 0x166e,0x16eb, 0x16ed,0x1735, 0x1736,0x17d4, 0x17d6,0x17d8, 0x17da,0x1800, 0x1805,0x1807, 0x180a,0x1944, 0x1945,0x19de, 0x19df,0x1a1e, 0x1a1f,0x2016, 0x2017,0x2020, 0x2027,0x2030, 0x2038,0x203b, 0x203e,0x2041, 0x2043,0x2047, 0x2051,0x2053, 0x2053,0x2055, 0x205e,0x23b6, 0x23b6,0x2cf9, 0x2cfc,0x2cfe, 0x2cff,0x2e00, 0x2e01,0x2e06, 0x2e08,0x2e0b, 0x2e0b,0x2e0e, 0x2e16,0x3001, 0x3003,0x303d, 0x303d,0x30fb, 0x30fb,0xfe10, 0xfe16,0xfe19, 0xfe19,0xfe30, 0xfe30,0xfe45, 0xfe46,0xfe49, 0xfe4c,0xfe50, 0xfe52,0xfe54, 0xfe57,0xfe5f, 0xfe61,0xfe68, 0xfe68,0xfe6a, 0xfe6b,0xff01, 0xff03,0xff05, 0xff07,0xff0a, 0xff0a,0xff0c, 0xff0c,0xff0e, 0xff0f,0xff1a, 0xff1b,0xff1f, 0xff20,0xff3c, 0xff3c,0xff61, 0xff61,0xff64, 0xff65,0x10100, 0x10101,0x1039f, 0x1039f,0x10a50, 0x10a58}; /* CR_Po *//* 'Ps': General Category */static const OnigCodePoint CR_Ps[] = {67,0x0028, 0x0028,0x005b, 0x005b,0x007b, 0x007b,0x0f3a, 0x0f3a,0x0f3c, 0x0f3c,0x169b, 0x169b,0x201a, 0x201a,0x201e, 0x201e,0x2045, 0x2045,0x207d, 0x207d,0x208d, 0x208d,0x2329, 0x2329,0x23b4, 0x23b4,0x2768, 0x2768,0x276a, 0x276a,0x276c, 0x276c,0x276e, 0x276e,0x2770, 0x2770,0x2772, 0x2772,0x2774, 0x2774,0x27c5, 0x27c5,0x27e6, 0x27e6,0x27e8, 0x27e8,0x27ea, 0x27ea,0x2983, 0x2983,0x2985, 0x2985,0x2987, 0x2987,0x2989, 0x2989,0x298b, 0x298b,0x298d, 0x298d,0x298f, 0x298f,0x2991, 0x2991,0x2993, 0x2993,0x2995, 0x2995,0x2997, 0x2997,0x29d8, 0x29d8,0x29da, 0x29da,0x29fc, 0x29fc,0x3008, 0x3008,0x300a, 0x300a,0x300c, 0x300c,0x300e, 0x300e,0x3010, 0x3010,0x3014, 0x3014,0x3016, 0x3016,0x3018, 0x3018,0x301a, 0x301a,0x301d, 0x301d,0xfd3e, 0xfd3e,0xfe17, 0xfe17,0xfe35, 0xfe35,0xfe37, 0xfe37,0xfe39, 0xfe39,0xfe3b, 0xfe3b,0xfe3d, 0xfe3d,0xfe3f, 0xfe3f,0xfe41, 0xfe41,0xfe43, 0xfe43,0xfe47, 0xfe47,0xfe59, 0xfe59,0xfe5b, 0xfe5b,0xfe5d, 0xfe5d,0xff08, 0xff08,0xff3b, 0xff3b,0xff5b, 0xff5b,0xff5f, 0xff5f,0xff62, 0xff62}; /* CR_Ps *//* 'S': Major Category */static const OnigCodePoint CR_S[] = {162,0x0024, 0x0024,0x002b, 0x002b,0x003c, 0x003e,0x005e, 0x005e,0x0060, 0x0060,0x007c, 0x007c,0x007e, 0x007e,0x00a2, 0x00a9,0x00ac, 0x00ac,0x00ae, 0x00b1,0x00b4, 0x00b4,0x00b6, 0x00b6,0x00b8, 0x00b8,0x00d7, 0x00d7,0x00f7, 0x00f7,0x02c2, 0x02c5,0x02d2, 0x02df,0x02e5, 0x02ed,0x02ef, 0x02ff,0x0374, 0x0375,0x0384, 0x0385,0x03f6, 0x03f6,0x0482, 0x0482,0x060b, 0x060b,0x060e, 0x060f,0x06e9, 0x06e9,0x06fd, 0x06fe,0x09f2, 0x09f3,0x09fa, 0x09fa,0x0af1, 0x0af1,0x0b70, 0x0b70,0x0bf3, 0x0bfa,0x0e3f, 0x0e3f,0x0f01, 0x0f03,0x0f13, 0x0f17,0x0f1a, 0x0f1f,0x0f34, 0x0f34,0x0f36, 0x0f36,0x0f38, 0x0f38,0x0fbe, 0x0fc5,0x0fc7, 0x0fcc,0x0fcf, 0x0fcf,0x1360, 0x1360,0x1390, 0x1399,0x17db, 0x17db,0x1940, 0x1940,0x19e0, 0x19ff,0x1fbd, 0x1fbd,0x1fbf, 0x1fc1,0x1fcd, 0x1fcf,0x1fdd, 0x1fdf,0x1fed, 0x1fef,0x1ffd, 0x1ffe,0x2044, 0x2044,0x2052, 0x2052,0x207a, 0x207c,0x208a, 0x208c,0x20a0, 0x20b5,0x2100, 0x2101,0x2103, 0x2106,0x2108, 0x2109,0x2114, 0x2114,0x2116, 0x2118,0x211e, 0x2123,0x2125, 0x2125,0x2127, 0x2127,0x2129, 0x2129,0x212e, 0x212e,0x2132, 0x2132,0x213a, 0x213b,0x2140, 0x2144,0x214a, 0x214c,0x2190, 0x2328,0x232b, 0x23b3,0x23b7, 0x23db,0x2400, 0x2426,0x2440, 0x244a,0x249c, 0x24e9,0x2500, 0x269c,0x26a0, 0x26b1,0x2701, 0x2704,0x2706, 0x2709,0x270c, 0x2727,0x2729, 0x274b,0x274d, 0x274d,0x274f, 0x2752,0x2756, 0x2756,0x2758, 0x275e,0x2761, 0x2767,0x2794, 0x2794,0x2798, 0x27af,0x27b1, 0x27be,0x27c0, 0x27c4,0x27d0, 0x27e5,0x27f0, 0x2982,0x2999, 0x29d7,0x29dc, 0x29fb,0x29fe, 0x2b13,0x2ce5, 0x2cea,0x2e80, 0x2e99,0x2e9b, 0x2ef3,0x2f00, 0x2fd5,0x2ff0, 0x2ffb,0x3004, 0x3004,0x3012, 0x3013,0x3020, 0x3020,0x3036, 0x3037,0x303e, 0x303f,0x309b, 0x309c,0x3190, 0x3191,0x3196, 0x319f,0x31c0, 0x31cf,0x3200, 0x321e,0x322a, 0x3243,0x3250, 0x3250,0x3260, 0x327f,0x328a, 0x32b0,0x32c0, 0x32fe,0x3300, 0x33ff,0x4dc0, 0x4dff,0xa490, 0xa4c6,0xa700, 0xa716,0xa828, 0xa82b,0xfb29, 0xfb29,0xfdfc, 0xfdfd,0xfe62, 0xfe62,0xfe64, 0xfe66,0xfe69, 0xfe69,0xff04, 0xff04,0xff0b, 0xff0b,0xff1c, 0xff1e,0xff3e, 0xff3e,0xff40, 0xff40,0xff5c, 0xff5c,0xff5e, 0xff5e,0xffe0, 0xffe6,0xffe8, 0xffee,0xfffc, 0xfffd,0x10102, 0x10102,0x10137, 0x1013f,0x10179, 0x10189,0x103d0, 0x103d0,0x1d000, 0x1d0f5,0x1d100, 0x1d126,0x1d12a, 0x1d164,0x1d16a, 0x1d16c,0x1d183, 0x1d184,0x1d18c, 0x1d1a9,0x1d1ae, 0x1d1dd,0x1d200, 0x1d241,0x1d245, 0x1d245,0x1d300, 0x1d356,0x1d6c1, 0x1d6c1,0x1d6db, 0x1d6db,0x1d6fb, 0x1d6fb,0x1d715, 0x1d715,0x1d735, 0x1d735,0x1d74f, 0x1d74f,0x1d76f, 0x1d76f,0x1d789, 0x1d789,0x1d7a9, 0x1d7a9,0x1d7c3, 0x1d7c3}; /* CR_S *//* 'Sc': General Category */static const OnigCodePoint CR_Sc[] = {14,0x0024, 0x0024,0x00a2, 0x00a5,0x060b, 0x060b,0x09f2, 0x09f3,0x0af1, 0x0af1,0x0bf9, 0x0bf9,0x0e3f, 0x0e3f,0x17db, 0x17db,0x20a0, 0x20b5,0xfdfc, 0xfdfc,0xfe69, 0xfe69,0xff04, 0xff04,0xffe0, 0xffe1,0xffe5, 0xffe6}; /* CR_Sc *//* 'Sk': General Category */static const OnigCodePoint CR_Sk[] = {23,0x005e, 0x005e,0x0060, 0x0060,0x00a8, 0x00a8,0x00af, 0x00af,0x00b4, 0x00b4,0x00b8, 0x00b8,0x02c2, 0x02c5,0x02d2, 0x02df,0x02e5, 0x02ed,0x02ef, 0x02ff,0x0374, 0x0375,0x0384, 0x0385,0x1fbd, 0x1fbd,0x1fbf, 0x1fc1,0x1fcd, 0x1fcf,0x1fdd, 0x1fdf,0x1fed, 0x1fef,0x1ffd, 0x1ffe,0x309b, 0x309c,0xa700, 0xa716,0xff3e, 0xff3e,0xff40, 0xff40,0xffe3, 0xffe3}; /* CR_Sk *//* 'Sm': General Category */static const OnigCodePoint CR_Sm[] = {59,0x002b, 0x002b,0x003c, 0x003e,0x007c, 0x007c,0x007e, 0x007e,0x00ac, 0x00ac,0x00b1, 0x00b1,0x00d7, 0x00d7,0x00f7, 0x00f7,0x03f6, 0x03f6,0x2044, 0x2044,0x2052, 0x2052,0x207a, 0x207c,0x208a, 0x208c,0x2140, 0x2144,0x214b, 0x214b,0x2190, 0x2194,0x219a, 0x219b,0x21a0, 0x21a0,0x21a3, 0x21a3,0x21a6, 0x21a6,0x21ae, 0x21ae,0x21ce, 0x21cf,0x21d2, 0x21d2,0x21d4, 0x21d4,0x21f4, 0x22ff,0x2308, 0x230b,0x2320, 0x2321,0x237c, 0x237c,0x239b, 0x23b3,0x25b7, 0x25b7,0x25c1, 0x25c1,0x25f8, 0x25ff,0x266f, 0x266f,0x27c0, 0x27c4,0x27d0, 0x27e5,0x27f0, 0x27ff,0x2900, 0x2982,0x2999, 0x29d7,0x29dc, 0x29fb,0x29fe, 0x2aff,0xfb29, 0xfb29,0xfe62, 0xfe62,0xfe64, 0xfe66,0xff0b, 0xff0b,0xff1c, 0xff1e,0xff5c, 0xff5c,0xff5e, 0xff5e,0xffe2, 0xffe2,0xffe9, 0xffec,0x1d6c1, 0x1d6c1,0x1d6db, 0x1d6db,0x1d6fb, 0x1d6fb,0x1d715, 0x1d715,0x1d735, 0x1d735,0x1d74f, 0x1d74f,0x1d76f, 0x1d76f,0x1d789, 0x1d789,0x1d7a9, 0x1d7a9,0x1d7c3, 0x1d7c3}; /* CR_Sm *//* 'So': General Category */static const OnigCodePoint CR_So[] = {120,0x00a6, 0x00a7,0x00a9, 0x00a9,0x00ae, 0x00ae,0x00b0, 0x00b0,0x00b6, 0x00b6,0x0482, 0x0482,0x060e, 0x060f,0x06e9, 0x06e9,0x06fd, 0x06fe,0x09fa, 0x09fa,0x0b70, 0x0b70,0x0bf3, 0x0bf8,0x0bfa, 0x0bfa,0x0f01, 0x0f03,0x0f13, 0x0f17,0x0f1a, 0x0f1f,0x0f34, 0x0f34,0x0f36, 0x0f36,0x0f38, 0x0f38,0x0fbe, 0x0fc5,0x0fc7, 0x0fcc,0x0fcf, 0x0fcf,0x1360, 0x1360,0x1390, 0x1399,0x1940, 0x1940,0x19e0, 0x19ff,0x2100, 0x2101,0x2103, 0x2106,0x2108, 0x2109,0x2114, 0x2114,0x2116, 0x2118,0x211e, 0x2123,0x2125, 0x2125,0x2127, 0x2127,0x2129, 0x2129,0x212e, 0x212e,0x2132, 0x2132,0x213a, 0x213b,0x214a, 0x214a,0x214c, 0x214c,0x2195, 0x2199,0x219c, 0x219f,0x21a1, 0x21a2,0x21a4, 0x21a5,0x21a7, 0x21ad,0x21af, 0x21cd,0x21d0, 0x21d1,0x21d3, 0x21d3,0x21d5, 0x21f3,0x2300, 0x2307,0x230c, 0x231f,0x2322, 0x2328,0x232b, 0x237b,0x237d, 0x239a,0x23b7, 0x23db,0x2400, 0x2426,0x2440, 0x244a,0x249c, 0x24e9,0x2500, 0x25b6,0x25b8, 0x25c0,0x25c2, 0x25f7,0x2600, 0x266e,0x2670, 0x269c,0x26a0, 0x26b1,0x2701, 0x2704,0x2706, 0x2709,0x270c, 0x2727,0x2729, 0x274b,0x274d, 0x274d,0x274f, 0x2752,0x2756, 0x2756,0x2758, 0x275e,0x2761, 0x2767,0x2794, 0x2794,0x2798, 0x27af,0x27b1, 0x27be,0x2800, 0x28ff,0x2b00, 0x2b13,0x2ce5, 0x2cea,0x2e80, 0x2e99,0x2e9b, 0x2ef3,0x2f00, 0x2fd5,0x2ff0, 0x2ffb,0x3004, 0x3004,0x3012, 0x3013,0x3020, 0x3020,0x3036, 0x3037,0x303e, 0x303f,0x3190, 0x3191,0x3196, 0x319f,0x31c0, 0x31cf,0x3200, 0x321e,0x322a, 0x3243,0x3250, 0x3250,0x3260, 0x327f,0x328a, 0x32b0,0x32c0, 0x32fe,0x3300, 0x33ff,0x4dc0, 0x4dff,0xa490, 0xa4c6,0xa828, 0xa82b,0xfdfd, 0xfdfd,0xffe4, 0xffe4,0xffe8, 0xffe8,0xffed, 0xffee,0xfffc, 0xfffd,0x10102, 0x10102,0x10137, 0x1013f,0x10179, 0x10189,0x103d0, 0x103d0,0x1d000, 0x1d0f5,0x1d100, 0x1d126,0x1d12a, 0x1d164,0x1d16a, 0x1d16c,0x1d183, 0x1d184,0x1d18c, 0x1d1a9,0x1d1ae, 0x1d1dd,0x1d200, 0x1d241,0x1d245, 0x1d245,0x1d300, 0x1d356}; /* CR_So *//* 'Z': Major Category */static const OnigCodePoint CR_Z[] = {9,0x0020, 0x0020,0x00a0, 0x00a0,0x1680, 0x1680,0x180e, 0x180e,0x2000, 0x200a,0x2028, 0x2029,0x202f, 0x202f,0x205f, 0x205f,0x3000, 0x3000}; /* CR_Z *//* 'Zl': General Category */static const OnigCodePoint CR_Zl[] = {1,0x2028, 0x2028}; /* CR_Zl *//* 'Zp': General Category */static const OnigCodePoint CR_Zp[] = {1,0x2029, 0x2029}; /* CR_Zp *//* 'Zs': General Category */static const OnigCodePoint CR_Zs[] = {8,0x0020, 0x0020,0x00a0, 0x00a0,0x1680, 0x1680,0x180e, 0x180e,0x2000, 0x200a,0x202f, 0x202f,0x205f, 0x205f,0x3000, 0x3000}; /* CR_Zs *//* 'Arabic': Script */static const OnigCodePoint CR_Arabic[] = {17,0x060b, 0x060b,0x060d, 0x0615,0x061e, 0x061e,0x0621, 0x063a,0x0641, 0x064a,0x0656, 0x065e,0x066a, 0x066f,0x0671, 0x06dc,0x06de, 0x06ff,0x0750, 0x076d,0xfb50, 0xfbb1,0xfbd3, 0xfd3d,0xfd50, 0xfd8f,0xfd92, 0xfdc7,0xfdf0, 0xfdfc,0xfe70, 0xfe74,0xfe76, 0xfefc}; /* CR_Arabic *//* 'Armenian': Script */static const OnigCodePoint CR_Armenian[] = {5,0x0531, 0x0556,0x0559, 0x055f,0x0561, 0x0587,0x058a, 0x058a,0xfb13, 0xfb17}; /* CR_Armenian *//* 'Bengali': Script */static const OnigCodePoint CR_Bengali[] = {14,0x0981, 0x0983,0x0985, 0x098c,0x098f, 0x0990,0x0993, 0x09a8,0x09aa, 0x09b0,0x09b2, 0x09b2,0x09b6, 0x09b9,0x09bc, 0x09c4,0x09c7, 0x09c8,0x09cb, 0x09ce,0x09d7, 0x09d7,0x09dc, 0x09dd,0x09df, 0x09e3,0x09e6, 0x09fa}; /* CR_Bengali *//* 'Bopomofo': Script */static const OnigCodePoint CR_Bopomofo[] = {2,0x3105, 0x312c,0x31a0, 0x31b7}; /* CR_Bopomofo *//* 'Braille': Script */static const OnigCodePoint CR_Braille[] = {1,0x2800, 0x28ff}; /* CR_Braille *//* 'Buginese': Script */static const OnigCodePoint CR_Buginese[] = {2,0x1a00, 0x1a1b,0x1a1e, 0x1a1f}; /* CR_Buginese *//* 'Buhid': Script */static const OnigCodePoint CR_Buhid[] = {1,0x1740, 0x1753}; /* CR_Buhid *//* 'Canadian_Aboriginal': Script */static const OnigCodePoint CR_Canadian_Aboriginal[] = {1,0x1401, 0x1676}; /* CR_Canadian_Aboriginal *//* 'Cherokee': Script */static const OnigCodePoint CR_Cherokee[] = {1,0x13a0, 0x13f4}; /* CR_Cherokee *//* 'Common': Script */static const OnigCodePoint CR_Common[] = {126,0x0000, 0x0040,0x005b, 0x0060,0x007b, 0x00a9,0x00ab, 0x00b9,0x00bb, 0x00bf,0x00d7, 0x00d7,0x00f7, 0x00f7,0x02b9, 0x02df,0x02e5, 0x02ff,0x037e, 0x037e,0x0387, 0x0387,0x0589, 0x0589,0x0600, 0x0603,0x060c, 0x060c,0x061b, 0x061b,0x061f, 0x061f,0x0640, 0x0640,0x0660, 0x0669,0x06dd, 0x06dd,0x0964, 0x0965,0x0970, 0x0970,0x0e3f, 0x0e3f,0x10fb, 0x10fb,0x16eb, 0x16ed,0x1735, 0x1736,0x2000, 0x200b,0x200e, 0x2063,0x206a, 0x2070,0x2074, 0x207e,0x2080, 0x208e,0x20a0, 0x20b5,0x2100, 0x2125,0x2127, 0x2129,0x212c, 0x214c,0x2153, 0x2183,0x2190, 0x23db,0x2400, 0x2426,0x2440, 0x244a,0x2460, 0x269c,0x26a0, 0x26b1,0x2701, 0x2704,0x2706, 0x2709,0x270c, 0x2727,0x2729, 0x274b,0x274d, 0x274d,0x274f, 0x2752,0x2756, 0x2756,0x2758, 0x275e,0x2761, 0x2794,0x2798, 0x27af,0x27b1, 0x27be,0x27c0, 0x27c6,0x27d0, 0x27eb,0x27f0, 0x27ff,0x2900, 0x2b13,0x2e00, 0x2e17,0x2e1c, 0x2e1d,0x2ff0, 0x2ffb,0x3000, 0x3004,0x3006, 0x3006,0x3008, 0x3020,0x3030, 0x3037,0x303c, 0x303f,0x309b, 0x309c,0x30a0, 0x30a0,0x30fb, 0x30fc,0x3190, 0x319f,0x31c0, 0x31cf,0x3220, 0x3243,0x3250, 0x325f,0x327e, 0x32fe,0x3300, 0x33ff,0x4dc0, 0x4dff,0xa700, 0xa716,0xe000, 0xf8ff,0xfd3e, 0xfd3f,0xfdfd, 0xfdfd,0xfe10, 0xfe19,0xfe30, 0xfe52,0xfe54, 0xfe66,0xfe68, 0xfe6b,0xfeff, 0xfeff,0xff01, 0xff20,0xff3b, 0xff40,0xff5b, 0xff65,0xff70, 0xff70,0xff9e, 0xff9f,0xffe0, 0xffe6,0xffe8, 0xffee,0xfff9, 0xfffd,0x10100, 0x10102,0x10107, 0x10133,0x10137, 0x1013f,0x1d000, 0x1d0f5,0x1d100, 0x1d126,0x1d12a, 0x1d166,0x1d16a, 0x1d17a,0x1d183, 0x1d184,0x1d18c, 0x1d1a9,0x1d1ae, 0x1d1dd,0x1d300, 0x1d356,0x1d400, 0x1d454,0x1d456, 0x1d49c,0x1d49e, 0x1d49f,0x1d4a2, 0x1d4a2,0x1d4a5, 0x1d4a6,0x1d4a9, 0x1d4ac,0x1d4ae, 0x1d4b9,0x1d4bb, 0x1d4bb,0x1d4bd, 0x1d4c3,0x1d4c5, 0x1d505,0x1d507, 0x1d50a,0x1d50d, 0x1d514,0x1d516, 0x1d51c,0x1d51e, 0x1d539,0x1d53b, 0x1d53e,0x1d540, 0x1d544,0x1d546, 0x1d546,0x1d54a, 0x1d550,0x1d552, 0x1d6a5,0x1d6a8, 0x1d7c9,0x1d7ce, 0x1d7ff,0xe0001, 0xe0001,0xe0020, 0xe007f,0xf0000, 0xffffd,0x100000, 0x10fffd}; /* CR_Common *//* 'Coptic': Script */static const OnigCodePoint CR_Coptic[] = {3,0x03e2, 0x03ef,0x2c80, 0x2cea,0x2cf9, 0x2cff}; /* CR_Coptic *//* 'Cypriot': Script */static const OnigCodePoint CR_Cypriot[] = {6,0x10800, 0x10805,0x10808, 0x10808,0x1080a, 0x10835,0x10837, 0x10838,0x1083c, 0x1083c,0x1083f, 0x1083f}; /* CR_Cypriot *//* 'Cyrillic': Script */static const OnigCodePoint CR_Cyrillic[] = {6,0x0400, 0x0486,0x0488, 0x04ce,0x04d0, 0x04f9,0x0500, 0x050f,0x1d2b, 0x1d2b,0x1d78, 0x1d78}; /* CR_Cyrillic *//* 'Deseret': Script */static const OnigCodePoint CR_Deseret[] = {1,0x10400, 0x1044f}; /* CR_Deseret *//* 'Devanagari': Script */static const OnigCodePoint CR_Devanagari[] = {6,0x0901, 0x0939,0x093c, 0x094d,0x0950, 0x0954,0x0958, 0x0963,0x0966, 0x096f,0x097d, 0x097d}; /* CR_Devanagari *//* 'Ethiopic': Script */static const OnigCodePoint CR_Ethiopic[] = {27,0x1200, 0x1248,0x124a, 0x124d,0x1250, 0x1256,0x1258, 0x1258,0x125a, 0x125d,0x1260, 0x1288,0x128a, 0x128d,0x1290, 0x12b0,0x12b2, 0x12b5,0x12b8, 0x12be,0x12c0, 0x12c0,0x12c2, 0x12c5,0x12c8, 0x12d6,0x12d8, 0x1310,0x1312, 0x1315,0x1318, 0x135a,0x135f, 0x137c,0x1380, 0x1399,0x2d80, 0x2d96,0x2da0, 0x2da6,0x2da8, 0x2dae,0x2db0, 0x2db6,0x2db8, 0x2dbe,0x2dc0, 0x2dc6,0x2dc8, 0x2dce,0x2dd0, 0x2dd6,0x2dd8, 0x2dde}; /* CR_Ethiopic *//* 'Georgian': Script */static const OnigCodePoint CR_Georgian[] = {4,0x10a0, 0x10c5,0x10d0, 0x10fa,0x10fc, 0x10fc,0x2d00, 0x2d25}; /* CR_Georgian *//* 'Glagolitic': Script */static const OnigCodePoint CR_Glagolitic[] = {2,0x2c00, 0x2c2e,0x2c30, 0x2c5e}; /* CR_Glagolitic *//* 'Gothic': Script */static const OnigCodePoint CR_Gothic[] = {1,0x10330, 0x1034a}; /* CR_Gothic *//* 'Greek': Script */static const OnigCodePoint CR_Greek[] = {31,0x0374, 0x0375,0x037a, 0x037a,0x0384, 0x0386,0x0388, 0x038a,0x038c, 0x038c,0x038e, 0x03a1,0x03a3, 0x03ce,0x03d0, 0x03e1,0x03f0, 0x03ff,0x1d26, 0x1d2a,0x1d5d, 0x1d61,0x1d66, 0x1d6a,0x1f00, 0x1f15,0x1f18, 0x1f1d,0x1f20, 0x1f45,0x1f48, 0x1f4d,0x1f50, 0x1f57,0x1f59, 0x1f59,0x1f5b, 0x1f5b,0x1f5d, 0x1f5d,0x1f5f, 0x1f7d,0x1f80, 0x1fb4,0x1fb6, 0x1fc4,0x1fc6, 0x1fd3,0x1fd6, 0x1fdb,0x1fdd, 0x1fef,0x1ff2, 0x1ff4,0x1ff6, 0x1ffe,0x2126, 0x2126,0x10140, 0x1018a,0x1d200, 0x1d245}; /* CR_Greek *//* 'Gujarati': Script */static const OnigCodePoint CR_Gujarati[] = {14,0x0a81, 0x0a83,0x0a85, 0x0a8d,0x0a8f, 0x0a91,0x0a93, 0x0aa8,0x0aaa, 0x0ab0,0x0ab2, 0x0ab3,0x0ab5, 0x0ab9,0x0abc, 0x0ac5,0x0ac7, 0x0ac9,0x0acb, 0x0acd,0x0ad0, 0x0ad0,0x0ae0, 0x0ae3,0x0ae6, 0x0aef,0x0af1, 0x0af1}; /* CR_Gujarati *//* 'Gurmukhi': Script */static const OnigCodePoint CR_Gurmukhi[] = {15,0x0a01, 0x0a03,0x0a05, 0x0a0a,0x0a0f, 0x0a10,0x0a13, 0x0a28,0x0a2a, 0x0a30,0x0a32, 0x0a33,0x0a35, 0x0a36,0x0a38, 0x0a39,0x0a3c, 0x0a3c,0x0a3e, 0x0a42,0x0a47, 0x0a48,0x0a4b, 0x0a4d,0x0a59, 0x0a5c,0x0a5e, 0x0a5e,0x0a66, 0x0a74}; /* CR_Gurmukhi *//* 'Han': Script */static const OnigCodePoint CR_Han[] = {14,0x2e80, 0x2e99,0x2e9b, 0x2ef3,0x2f00, 0x2fd5,0x3005, 0x3005,0x3007, 0x3007,0x3021, 0x3029,0x3038, 0x303b,0x3400, 0x4db5,0x4e00, 0x9fbb,0xf900, 0xfa2d,0xfa30, 0xfa6a,0xfa70, 0xfad9,0x20000, 0x2a6d6,0x2f800, 0x2fa1d}; /* CR_Han *//* 'Hangul': Script */static const OnigCodePoint CR_Hangul[] = {12,0x1100, 0x1159,0x115f, 0x11a2,0x11a8, 0x11f9,0x3131, 0x318e,0x3200, 0x321e,0x3260, 0x327d,0xac00, 0xd7a3,0xffa0, 0xffbe,0xffc2, 0xffc7,0xffca, 0xffcf,0xffd2, 0xffd7,0xffda, 0xffdc}; /* CR_Hangul *//* 'Hanunoo': Script */static const OnigCodePoint CR_Hanunoo[] = {1,0x1720, 0x1734}; /* CR_Hanunoo *//* 'Hebrew': Script */static const OnigCodePoint CR_Hebrew[] = {10,0x0591, 0x05b9,0x05bb, 0x05c7,0x05d0, 0x05ea,0x05f0, 0x05f4,0xfb1d, 0xfb36,0xfb38, 0xfb3c,0xfb3e, 0xfb3e,0xfb40, 0xfb41,0xfb43, 0xfb44,0xfb46, 0xfb4f}; /* CR_Hebrew *//* 'Hiragana': Script */static const OnigCodePoint CR_Hiragana[] = {2,0x3041, 0x3096,0x309d, 0x309f}; /* CR_Hiragana *//* 'Inherited': Script */static const OnigCodePoint CR_Inherited[] = {15,0x0300, 0x036f,0x064b, 0x0655,0x0670, 0x0670,0x1dc0, 0x1dc3,0x200c, 0x200d,0x20d0, 0x20eb,0x302a, 0x302f,0x3099, 0x309a,0xfe00, 0xfe0f,0xfe20, 0xfe23,0x1d167, 0x1d169,0x1d17b, 0x1d182,0x1d185, 0x1d18b,0x1d1aa, 0x1d1ad,0xe0100, 0xe01ef}; /* CR_Inherited *//* 'Kannada': Script */static const OnigCodePoint CR_Kannada[] = {13,0x0c82, 0x0c83,0x0c85, 0x0c8c,0x0c8e, 0x0c90,0x0c92, 0x0ca8,0x0caa, 0x0cb3,0x0cb5, 0x0cb9,0x0cbc, 0x0cc4,0x0cc6, 0x0cc8,0x0cca, 0x0ccd,0x0cd5, 0x0cd6,0x0cde, 0x0cde,0x0ce0, 0x0ce1,0x0ce6, 0x0cef}; /* CR_Kannada *//* 'Katakana': Script */static const OnigCodePoint CR_Katakana[] = {5,0x30a1, 0x30fa,0x30fd, 0x30ff,0x31f0, 0x31ff,0xff66, 0xff6f,0xff71, 0xff9d}; /* CR_Katakana *//* 'Kharoshthi': Script */static const OnigCodePoint CR_Kharoshthi[] = {8,0x10a00, 0x10a03,0x10a05, 0x10a06,0x10a0c, 0x10a13,0x10a15, 0x10a17,0x10a19, 0x10a33,0x10a38, 0x10a3a,0x10a3f, 0x10a47,0x10a50, 0x10a58}; /* CR_Kharoshthi *//* 'Khmer': Script */static const OnigCodePoint CR_Khmer[] = {4,0x1780, 0x17dd,0x17e0, 0x17e9,0x17f0, 0x17f9,0x19e0, 0x19ff}; /* CR_Khmer *//* 'Lao': Script */static const OnigCodePoint CR_Lao[] = {18,0x0e81, 0x0e82,0x0e84, 0x0e84,0x0e87, 0x0e88,0x0e8a, 0x0e8a,0x0e8d, 0x0e8d,0x0e94, 0x0e97,0x0e99, 0x0e9f,0x0ea1, 0x0ea3,0x0ea5, 0x0ea5,0x0ea7, 0x0ea7,0x0eaa, 0x0eab,0x0ead, 0x0eb9,0x0ebb, 0x0ebd,0x0ec0, 0x0ec4,0x0ec6, 0x0ec6,0x0ec8, 0x0ecd,0x0ed0, 0x0ed9,0x0edc, 0x0edd}; /* CR_Lao *//* 'Latin': Script */static const OnigCodePoint CR_Latin[] = {23,0x0041, 0x005a,0x0061, 0x007a,0x00aa, 0x00aa,0x00ba, 0x00ba,0x00c0, 0x00d6,0x00d8, 0x00f6,0x00f8, 0x0241,0x0250, 0x02b8,0x02e0, 0x02e4,0x1d00, 0x1d25,0x1d2c, 0x1d5c,0x1d62, 0x1d65,0x1d6b, 0x1d77,0x1d79, 0x1dbf,0x1e00, 0x1e9b,0x1ea0, 0x1ef9,0x2071, 0x2071,0x207f, 0x207f,0x2090, 0x2094,0x212a, 0x212b,0xfb00, 0xfb06,0xff21, 0xff3a,0xff41, 0xff5a}; /* CR_Latin *//* 'Limbu': Script */static const OnigCodePoint CR_Limbu[] = {5,0x1900, 0x191c,0x1920, 0x192b,0x1930, 0x193b,0x1940, 0x1940,0x1944, 0x194f}; /* CR_Limbu *//* 'Linear_B': Script */static const OnigCodePoint CR_Linear_B[] = {7,0x10000, 0x1000b,0x1000d, 0x10026,0x10028, 0x1003a,0x1003c, 0x1003d,0x1003f, 0x1004d,0x10050, 0x1005d,0x10080, 0x100fa}; /* CR_Linear_B *//* 'Malayalam': Script */static const OnigCodePoint CR_Malayalam[] = {11,0x0d02, 0x0d03,0x0d05, 0x0d0c,0x0d0e, 0x0d10,0x0d12, 0x0d28,0x0d2a, 0x0d39,0x0d3e, 0x0d43,0x0d46, 0x0d48,0x0d4a, 0x0d4d,0x0d57, 0x0d57,0x0d60, 0x0d61,0x0d66, 0x0d6f}; /* CR_Malayalam *//* 'Mongolian': Script */static const OnigCodePoint CR_Mongolian[] = {4,0x1800, 0x180e,0x1810, 0x1819,0x1820, 0x1877,0x1880, 0x18a9}; /* CR_Mongolian *//* 'Myanmar': Script */static const OnigCodePoint CR_Myanmar[] = {6,0x1000, 0x1021,0x1023, 0x1027,0x1029, 0x102a,0x102c, 0x1032,0x1036, 0x1039,0x1040, 0x1059}; /* CR_Myanmar *//* 'New_Tai_Lue': Script */static const OnigCodePoint CR_New_Tai_Lue[] = {4,0x1980, 0x19a9,0x19b0, 0x19c9,0x19d0, 0x19d9,0x19de, 0x19df}; /* CR_New_Tai_Lue *//* 'Ogham': Script */static const OnigCodePoint CR_Ogham[] = {1,0x1680, 0x169c}; /* CR_Ogham *//* 'Old_Italic': Script */static const OnigCodePoint CR_Old_Italic[] = {2,0x10300, 0x1031e,0x10320, 0x10323}; /* CR_Old_Italic *//* 'Old_Persian': Script */static const OnigCodePoint CR_Old_Persian[] = {2,0x103a0, 0x103c3,0x103c8, 0x103d5}; /* CR_Old_Persian *//* 'Oriya': Script */static const OnigCodePoint CR_Oriya[] = {14,0x0b01, 0x0b03,0x0b05, 0x0b0c,0x0b0f, 0x0b10,0x0b13, 0x0b28,0x0b2a, 0x0b30,0x0b32, 0x0b33,0x0b35, 0x0b39,0x0b3c, 0x0b43,0x0b47, 0x0b48,0x0b4b, 0x0b4d,0x0b56, 0x0b57,0x0b5c, 0x0b5d,0x0b5f, 0x0b61,0x0b66, 0x0b71}; /* CR_Oriya *//* 'Osmanya': Script */static const OnigCodePoint CR_Osmanya[] = {2,0x10480, 0x1049d,0x104a0, 0x104a9}; /* CR_Osmanya *//* 'Runic': Script */static const OnigCodePoint CR_Runic[] = {2,0x16a0, 0x16ea,0x16ee, 0x16f0}; /* CR_Runic *//* 'Shavian': Script */static const OnigCodePoint CR_Shavian[] = {1,0x10450, 0x1047f}; /* CR_Shavian *//* 'Sinhala': Script */static const OnigCodePoint CR_Sinhala[] = {11,0x0d82, 0x0d83,0x0d85, 0x0d96,0x0d9a, 0x0db1,0x0db3, 0x0dbb,0x0dbd, 0x0dbd,0x0dc0, 0x0dc6,0x0dca, 0x0dca,0x0dcf, 0x0dd4,0x0dd6, 0x0dd6,0x0dd8, 0x0ddf,0x0df2, 0x0df4}; /* CR_Sinhala *//* 'Syloti_Nagri': Script */static const OnigCodePoint CR_Syloti_Nagri[] = {1,0xa800, 0xa82b}; /* CR_Syloti_Nagri *//* 'Syriac': Script */static const OnigCodePoint CR_Syriac[] = {3,0x0700, 0x070d,0x070f, 0x074a,0x074d, 0x074f}; /* CR_Syriac *//* 'Tagalog': Script */static const OnigCodePoint CR_Tagalog[] = {2,0x1700, 0x170c,0x170e, 0x1714}; /* CR_Tagalog *//* 'Tagbanwa': Script */static const OnigCodePoint CR_Tagbanwa[] = {3,0x1760, 0x176c,0x176e, 0x1770,0x1772, 0x1773}; /* CR_Tagbanwa *//* 'Tai_Le': Script */static const OnigCodePoint CR_Tai_Le[] = {2,0x1950, 0x196d,0x1970, 0x1974}; /* CR_Tai_Le *//* 'Tamil': Script */static const OnigCodePoint CR_Tamil[] = {15,0x0b82, 0x0b83,0x0b85, 0x0b8a,0x0b8e, 0x0b90,0x0b92, 0x0b95,0x0b99, 0x0b9a,0x0b9c, 0x0b9c,0x0b9e, 0x0b9f,0x0ba3, 0x0ba4,0x0ba8, 0x0baa,0x0bae, 0x0bb9,0x0bbe, 0x0bc2,0x0bc6, 0x0bc8,0x0bca, 0x0bcd,0x0bd7, 0x0bd7,0x0be6, 0x0bfa}; /* CR_Tamil *//* 'Telugu': Script */static const OnigCodePoint CR_Telugu[] = {12,0x0c01, 0x0c03,0x0c05, 0x0c0c,0x0c0e, 0x0c10,0x0c12, 0x0c28,0x0c2a, 0x0c33,0x0c35, 0x0c39,0x0c3e, 0x0c44,0x0c46, 0x0c48,0x0c4a, 0x0c4d,0x0c55, 0x0c56,0x0c60, 0x0c61,0x0c66, 0x0c6f}; /* CR_Telugu *//* 'Thaana': Script */static const OnigCodePoint CR_Thaana[] = {1,0x0780, 0x07b1}; /* CR_Thaana *//* 'Thai': Script */static const OnigCodePoint CR_Thai[] = {2,0x0e01, 0x0e3a,0x0e40, 0x0e5b}; /* CR_Thai *//* 'Tibetan': Script */static const OnigCodePoint CR_Tibetan[] = {7,0x0f00, 0x0f47,0x0f49, 0x0f6a,0x0f71, 0x0f8b,0x0f90, 0x0f97,0x0f99, 0x0fbc,0x0fbe, 0x0fcc,0x0fcf, 0x0fd1}; /* CR_Tibetan *//* 'Tifinagh': Script */static const OnigCodePoint CR_Tifinagh[] = {2,0x2d30, 0x2d65,0x2d6f, 0x2d6f}; /* CR_Tifinagh *//* 'Ugaritic': Script */static const OnigCodePoint CR_Ugaritic[] = {2,0x10380, 0x1039d,0x1039f, 0x1039f}; /* CR_Ugaritic *//* 'Yi': Script */static const OnigCodePoint CR_Yi[] = {2,0xa000, 0xa48c,0xa490, 0xa4c6}; /* CR_Yi */#endif /* USE_UNICODE_PROPERTIES */typedef struct {int n;OnigCodePoint code[3];} CodePointList3;typedef struct {OnigCodePoint from;CodePointList3 to;} CaseFold_11_Type;typedef struct {OnigCodePoint from;CodePointList3 to;} CaseUnfold_11_Type;typedef struct {int n;OnigCodePoint code[2];} CodePointList2;typedef struct {OnigCodePoint from[2];CodePointList2 to;} CaseUnfold_12_Type;typedef struct {OnigCodePoint from[3];CodePointList2 to;} CaseUnfold_13_Type;static const CaseFold_11_Type CaseFold[] = {{ 0x0041, {1, {0x0061}}},{ 0x0042, {1, {0x0062}}},{ 0x0043, {1, {0x0063}}},{ 0x0044, {1, {0x0064}}},{ 0x0045, {1, {0x0065}}},{ 0x0046, {1, {0x0066}}},{ 0x0047, {1, {0x0067}}},{ 0x0048, {1, {0x0068}}},{ 0x004a, {1, {0x006a}}},{ 0x004b, {1, {0x006b}}},{ 0x004c, {1, {0x006c}}},{ 0x004d, {1, {0x006d}}},{ 0x004e, {1, {0x006e}}},{ 0x004f, {1, {0x006f}}},{ 0x0050, {1, {0x0070}}},{ 0x0051, {1, {0x0071}}},{ 0x0052, {1, {0x0072}}},{ 0x0053, {1, {0x0073}}},{ 0x0054, {1, {0x0074}}},{ 0x0055, {1, {0x0075}}},{ 0x0056, {1, {0x0076}}},{ 0x0057, {1, {0x0077}}},{ 0x0058, {1, {0x0078}}},{ 0x0059, {1, {0x0079}}},{ 0x005a, {1, {0x007a}}},{ 0x00b5, {1, {0x03bc}}},{ 0x00c0, {1, {0x00e0}}},{ 0x00c1, {1, {0x00e1}}},{ 0x00c2, {1, {0x00e2}}},{ 0x00c3, {1, {0x00e3}}},{ 0x00c4, {1, {0x00e4}}},{ 0x00c5, {1, {0x00e5}}},{ 0x00c6, {1, {0x00e6}}},{ 0x00c7, {1, {0x00e7}}},{ 0x00c8, {1, {0x00e8}}},{ 0x00c9, {1, {0x00e9}}},{ 0x00ca, {1, {0x00ea}}},{ 0x00cb, {1, {0x00eb}}},{ 0x00cc, {1, {0x00ec}}},{ 0x00cd, {1, {0x00ed}}},{ 0x00ce, {1, {0x00ee}}},{ 0x00cf, {1, {0x00ef}}},{ 0x00d0, {1, {0x00f0}}},{ 0x00d1, {1, {0x00f1}}},{ 0x00d2, {1, {0x00f2}}},{ 0x00d3, {1, {0x00f3}}},{ 0x00d4, {1, {0x00f4}}},{ 0x00d5, {1, {0x00f5}}},{ 0x00d6, {1, {0x00f6}}},{ 0x00d8, {1, {0x00f8}}},{ 0x00d9, {1, {0x00f9}}},{ 0x00da, {1, {0x00fa}}},{ 0x00db, {1, {0x00fb}}},{ 0x00dc, {1, {0x00fc}}},{ 0x00dd, {1, {0x00fd}}},{ 0x00de, {1, {0x00fe}}},{ 0x00df, {2, {0x0073, 0x0073}}},{ 0x0100, {1, {0x0101}}},{ 0x0102, {1, {0x0103}}},{ 0x0104, {1, {0x0105}}},{ 0x0106, {1, {0x0107}}},{ 0x0108, {1, {0x0109}}},{ 0x010a, {1, {0x010b}}},{ 0x010c, {1, {0x010d}}},{ 0x010e, {1, {0x010f}}},{ 0x0110, {1, {0x0111}}},{ 0x0112, {1, {0x0113}}},{ 0x0114, {1, {0x0115}}},{ 0x0116, {1, {0x0117}}},{ 0x0118, {1, {0x0119}}},{ 0x011a, {1, {0x011b}}},{ 0x011c, {1, {0x011d}}},{ 0x011e, {1, {0x011f}}},{ 0x0120, {1, {0x0121}}},{ 0x0122, {1, {0x0123}}},{ 0x0124, {1, {0x0125}}},{ 0x0126, {1, {0x0127}}},{ 0x0128, {1, {0x0129}}},{ 0x012a, {1, {0x012b}}},{ 0x012c, {1, {0x012d}}},{ 0x012e, {1, {0x012f}}},{ 0x0132, {1, {0x0133}}},{ 0x0134, {1, {0x0135}}},{ 0x0136, {1, {0x0137}}},{ 0x0139, {1, {0x013a}}},{ 0x013b, {1, {0x013c}}},{ 0x013d, {1, {0x013e}}},{ 0x013f, {1, {0x0140}}},{ 0x0141, {1, {0x0142}}},{ 0x0143, {1, {0x0144}}},{ 0x0145, {1, {0x0146}}},{ 0x0147, {1, {0x0148}}},{ 0x0149, {2, {0x02bc, 0x006e}}},{ 0x014a, {1, {0x014b}}},{ 0x014c, {1, {0x014d}}},{ 0x014e, {1, {0x014f}}},{ 0x0150, {1, {0x0151}}},{ 0x0152, {1, {0x0153}}},{ 0x0154, {1, {0x0155}}},{ 0x0156, {1, {0x0157}}},{ 0x0158, {1, {0x0159}}},{ 0x015a, {1, {0x015b}}},{ 0x015c, {1, {0x015d}}},{ 0x015e, {1, {0x015f}}},{ 0x0160, {1, {0x0161}}},{ 0x0162, {1, {0x0163}}},{ 0x0164, {1, {0x0165}}},{ 0x0166, {1, {0x0167}}},{ 0x0168, {1, {0x0169}}},{ 0x016a, {1, {0x016b}}},{ 0x016c, {1, {0x016d}}},{ 0x016e, {1, {0x016f}}},{ 0x0170, {1, {0x0171}}},{ 0x0172, {1, {0x0173}}},{ 0x0174, {1, {0x0175}}},{ 0x0176, {1, {0x0177}}},{ 0x0178, {1, {0x00ff}}},{ 0x0179, {1, {0x017a}}},{ 0x017b, {1, {0x017c}}},{ 0x017d, {1, {0x017e}}},{ 0x017f, {1, {0x0073}}},{ 0x0181, {1, {0x0253}}},{ 0x0182, {1, {0x0183}}},{ 0x0184, {1, {0x0185}}},{ 0x0186, {1, {0x0254}}},{ 0x0187, {1, {0x0188}}},{ 0x0189, {1, {0x0256}}},{ 0x018a, {1, {0x0257}}},{ 0x018b, {1, {0x018c}}},{ 0x018e, {1, {0x01dd}}},{ 0x018f, {1, {0x0259}}},{ 0x0190, {1, {0x025b}}},{ 0x0191, {1, {0x0192}}},{ 0x0193, {1, {0x0260}}},{ 0x0194, {1, {0x0263}}},{ 0x0196, {1, {0x0269}}},{ 0x0197, {1, {0x0268}}},{ 0x0198, {1, {0x0199}}},{ 0x019c, {1, {0x026f}}},{ 0x019d, {1, {0x0272}}},{ 0x019f, {1, {0x0275}}},{ 0x01a0, {1, {0x01a1}}},{ 0x01a2, {1, {0x01a3}}},{ 0x01a4, {1, {0x01a5}}},{ 0x01a6, {1, {0x0280}}},{ 0x01a7, {1, {0x01a8}}},{ 0x01a9, {1, {0x0283}}},{ 0x01ac, {1, {0x01ad}}},{ 0x01ae, {1, {0x0288}}},{ 0x01af, {1, {0x01b0}}},{ 0x01b1, {1, {0x028a}}},{ 0x01b2, {1, {0x028b}}},{ 0x01b3, {1, {0x01b4}}},{ 0x01b5, {1, {0x01b6}}},{ 0x01b7, {1, {0x0292}}},{ 0x01b8, {1, {0x01b9}}},{ 0x01bc, {1, {0x01bd}}},{ 0x01c4, {1, {0x01c6}}},{ 0x01c5, {1, {0x01c6}}},{ 0x01c7, {1, {0x01c9}}},{ 0x01c8, {1, {0x01c9}}},{ 0x01ca, {1, {0x01cc}}},{ 0x01cb, {1, {0x01cc}}},{ 0x01cd, {1, {0x01ce}}},{ 0x01cf, {1, {0x01d0}}},{ 0x01d1, {1, {0x01d2}}},{ 0x01d3, {1, {0x01d4}}},{ 0x01d5, {1, {0x01d6}}},{ 0x01d7, {1, {0x01d8}}},{ 0x01d9, {1, {0x01da}}},{ 0x01db, {1, {0x01dc}}},{ 0x01de, {1, {0x01df}}},{ 0x01e0, {1, {0x01e1}}},{ 0x01e2, {1, {0x01e3}}},{ 0x01e4, {1, {0x01e5}}},{ 0x01e6, {1, {0x01e7}}},{ 0x01e8, {1, {0x01e9}}},{ 0x01ea, {1, {0x01eb}}},{ 0x01ec, {1, {0x01ed}}},{ 0x01ee, {1, {0x01ef}}},{ 0x01f0, {2, {0x006a, 0x030c}}},{ 0x01f1, {1, {0x01f3}}},{ 0x01f2, {1, {0x01f3}}},{ 0x01f4, {1, {0x01f5}}},{ 0x01f6, {1, {0x0195}}},{ 0x01f7, {1, {0x01bf}}},{ 0x01f8, {1, {0x01f9}}},{ 0x01fa, {1, {0x01fb}}},{ 0x01fc, {1, {0x01fd}}},{ 0x01fe, {1, {0x01ff}}},{ 0x0200, {1, {0x0201}}},{ 0x0202, {1, {0x0203}}},{ 0x0204, {1, {0x0205}}},{ 0x0206, {1, {0x0207}}},{ 0x0208, {1, {0x0209}}},{ 0x020a, {1, {0x020b}}},{ 0x020c, {1, {0x020d}}},{ 0x020e, {1, {0x020f}}},{ 0x0210, {1, {0x0211}}},{ 0x0212, {1, {0x0213}}},{ 0x0214, {1, {0x0215}}},{ 0x0216, {1, {0x0217}}},{ 0x0218, {1, {0x0219}}},{ 0x021a, {1, {0x021b}}},{ 0x021c, {1, {0x021d}}},{ 0x021e, {1, {0x021f}}},{ 0x0220, {1, {0x019e}}},{ 0x0222, {1, {0x0223}}},{ 0x0224, {1, {0x0225}}},{ 0x0226, {1, {0x0227}}},{ 0x0228, {1, {0x0229}}},{ 0x022a, {1, {0x022b}}},{ 0x022c, {1, {0x022d}}},{ 0x022e, {1, {0x022f}}},{ 0x0230, {1, {0x0231}}},{ 0x0232, {1, {0x0233}}},{ 0x023b, {1, {0x023c}}},{ 0x023d, {1, {0x019a}}},{ 0x0241, {1, {0x0294}}},{ 0x0345, {1, {0x03b9}}},{ 0x0386, {1, {0x03ac}}},{ 0x0388, {1, {0x03ad}}},{ 0x0389, {1, {0x03ae}}},{ 0x038a, {1, {0x03af}}},{ 0x038c, {1, {0x03cc}}},{ 0x038e, {1, {0x03cd}}},{ 0x038f, {1, {0x03ce}}},{ 0x0390, {3, {0x03b9, 0x0308, 0x0301}}},{ 0x0391, {1, {0x03b1}}},{ 0x0392, {1, {0x03b2}}},{ 0x0393, {1, {0x03b3}}},{ 0x0394, {1, {0x03b4}}},{ 0x0395, {1, {0x03b5}}},{ 0x0396, {1, {0x03b6}}},{ 0x0397, {1, {0x03b7}}},{ 0x0398, {1, {0x03b8}}},{ 0x0399, {1, {0x03b9}}},{ 0x039a, {1, {0x03ba}}},{ 0x039b, {1, {0x03bb}}},{ 0x039c, {1, {0x03bc}}},{ 0x039d, {1, {0x03bd}}},{ 0x039e, {1, {0x03be}}},{ 0x039f, {1, {0x03bf}}},{ 0x03a0, {1, {0x03c0}}},{ 0x03a1, {1, {0x03c1}}},{ 0x03a3, {1, {0x03c3}}},{ 0x03a4, {1, {0x03c4}}},{ 0x03a5, {1, {0x03c5}}},{ 0x03a6, {1, {0x03c6}}},{ 0x03a7, {1, {0x03c7}}},{ 0x03a8, {1, {0x03c8}}},{ 0x03a9, {1, {0x03c9}}},{ 0x03aa, {1, {0x03ca}}},{ 0x03ab, {1, {0x03cb}}},{ 0x03b0, {3, {0x03c5, 0x0308, 0x0301}}},{ 0x03c2, {1, {0x03c3}}},{ 0x03d0, {1, {0x03b2}}},{ 0x03d1, {1, {0x03b8}}},{ 0x03d5, {1, {0x03c6}}},{ 0x03d6, {1, {0x03c0}}},{ 0x03d8, {1, {0x03d9}}},{ 0x03da, {1, {0x03db}}},{ 0x03dc, {1, {0x03dd}}},{ 0x03de, {1, {0x03df}}},{ 0x03e0, {1, {0x03e1}}},{ 0x03e2, {1, {0x03e3}}},{ 0x03e4, {1, {0x03e5}}},{ 0x03e6, {1, {0x03e7}}},{ 0x03e8, {1, {0x03e9}}},{ 0x03ea, {1, {0x03eb}}},{ 0x03ec, {1, {0x03ed}}},{ 0x03ee, {1, {0x03ef}}},{ 0x03f0, {1, {0x03ba}}},{ 0x03f1, {1, {0x03c1}}},{ 0x03f4, {1, {0x03b8}}},{ 0x03f5, {1, {0x03b5}}},{ 0x03f7, {1, {0x03f8}}},{ 0x03f9, {1, {0x03f2}}},{ 0x03fa, {1, {0x03fb}}},{ 0x0400, {1, {0x0450}}},{ 0x0401, {1, {0x0451}}},{ 0x0402, {1, {0x0452}}},{ 0x0403, {1, {0x0453}}},{ 0x0404, {1, {0x0454}}},{ 0x0405, {1, {0x0455}}},{ 0x0406, {1, {0x0456}}},{ 0x0407, {1, {0x0457}}},{ 0x0408, {1, {0x0458}}},{ 0x0409, {1, {0x0459}}},{ 0x040a, {1, {0x045a}}},{ 0x040b, {1, {0x045b}}},{ 0x040c, {1, {0x045c}}},{ 0x040d, {1, {0x045d}}},{ 0x040e, {1, {0x045e}}},{ 0x040f, {1, {0x045f}}},{ 0x0410, {1, {0x0430}}},{ 0x0411, {1, {0x0431}}},{ 0x0412, {1, {0x0432}}},{ 0x0413, {1, {0x0433}}},{ 0x0414, {1, {0x0434}}},{ 0x0415, {1, {0x0435}}},{ 0x0416, {1, {0x0436}}},{ 0x0417, {1, {0x0437}}},{ 0x0418, {1, {0x0438}}},{ 0x0419, {1, {0x0439}}},{ 0x041a, {1, {0x043a}}},{ 0x041b, {1, {0x043b}}},{ 0x041c, {1, {0x043c}}},{ 0x041d, {1, {0x043d}}},{ 0x041e, {1, {0x043e}}},{ 0x041f, {1, {0x043f}}},{ 0x0420, {1, {0x0440}}},{ 0x0421, {1, {0x0441}}},{ 0x0422, {1, {0x0442}}},{ 0x0423, {1, {0x0443}}},{ 0x0424, {1, {0x0444}}},{ 0x0425, {1, {0x0445}}},{ 0x0426, {1, {0x0446}}},{ 0x0427, {1, {0x0447}}},{ 0x0428, {1, {0x0448}}},{ 0x0429, {1, {0x0449}}},{ 0x042a, {1, {0x044a}}},{ 0x042b, {1, {0x044b}}},{ 0x042c, {1, {0x044c}}},{ 0x042d, {1, {0x044d}}},{ 0x042e, {1, {0x044e}}},{ 0x042f, {1, {0x044f}}},{ 0x0460, {1, {0x0461}}},{ 0x0462, {1, {0x0463}}},{ 0x0464, {1, {0x0465}}},{ 0x0466, {1, {0x0467}}},{ 0x0468, {1, {0x0469}}},{ 0x046a, {1, {0x046b}}},{ 0x046c, {1, {0x046d}}},{ 0x046e, {1, {0x046f}}},{ 0x0470, {1, {0x0471}}},{ 0x0472, {1, {0x0473}}},{ 0x0474, {1, {0x0475}}},{ 0x0476, {1, {0x0477}}},{ 0x0478, {1, {0x0479}}},{ 0x047a, {1, {0x047b}}},{ 0x047c, {1, {0x047d}}},{ 0x047e, {1, {0x047f}}},{ 0x0480, {1, {0x0481}}},{ 0x048a, {1, {0x048b}}},{ 0x048c, {1, {0x048d}}},{ 0x048e, {1, {0x048f}}},{ 0x0490, {1, {0x0491}}},{ 0x0492, {1, {0x0493}}},{ 0x0494, {1, {0x0495}}},{ 0x0496, {1, {0x0497}}},{ 0x0498, {1, {0x0499}}},{ 0x049a, {1, {0x049b}}},{ 0x049c, {1, {0x049d}}},{ 0x049e, {1, {0x049f}}},{ 0x04a0, {1, {0x04a1}}},{ 0x04a2, {1, {0x04a3}}},{ 0x04a4, {1, {0x04a5}}},{ 0x04a6, {1, {0x04a7}}},{ 0x04a8, {1, {0x04a9}}},{ 0x04aa, {1, {0x04ab}}},{ 0x04ac, {1, {0x04ad}}},{ 0x04ae, {1, {0x04af}}},{ 0x04b0, {1, {0x04b1}}},{ 0x04b2, {1, {0x04b3}}},{ 0x04b4, {1, {0x04b5}}},{ 0x04b6, {1, {0x04b7}}},{ 0x04b8, {1, {0x04b9}}},{ 0x04ba, {1, {0x04bb}}},{ 0x04bc, {1, {0x04bd}}},{ 0x04be, {1, {0x04bf}}},{ 0x04c1, {1, {0x04c2}}},{ 0x04c3, {1, {0x04c4}}},{ 0x04c5, {1, {0x04c6}}},{ 0x04c7, {1, {0x04c8}}},{ 0x04c9, {1, {0x04ca}}},{ 0x04cb, {1, {0x04cc}}},{ 0x04cd, {1, {0x04ce}}},{ 0x04d0, {1, {0x04d1}}},{ 0x04d2, {1, {0x04d3}}},{ 0x04d4, {1, {0x04d5}}},{ 0x04d6, {1, {0x04d7}}},{ 0x04d8, {1, {0x04d9}}},{ 0x04da, {1, {0x04db}}},{ 0x04dc, {1, {0x04dd}}},{ 0x04de, {1, {0x04df}}},{ 0x04e0, {1, {0x04e1}}},{ 0x04e2, {1, {0x04e3}}},{ 0x04e4, {1, {0x04e5}}},{ 0x04e6, {1, {0x04e7}}},{ 0x04e8, {1, {0x04e9}}},{ 0x04ea, {1, {0x04eb}}},{ 0x04ec, {1, {0x04ed}}},{ 0x04ee, {1, {0x04ef}}},{ 0x04f0, {1, {0x04f1}}},{ 0x04f2, {1, {0x04f3}}},{ 0x04f4, {1, {0x04f5}}},{ 0x04f6, {1, {0x04f7}}},{ 0x04f8, {1, {0x04f9}}},{ 0x0500, {1, {0x0501}}},{ 0x0502, {1, {0x0503}}},{ 0x0504, {1, {0x0505}}},{ 0x0506, {1, {0x0507}}},{ 0x0508, {1, {0x0509}}},{ 0x050a, {1, {0x050b}}},{ 0x050c, {1, {0x050d}}},{ 0x050e, {1, {0x050f}}},{ 0x0531, {1, {0x0561}}},{ 0x0532, {1, {0x0562}}},{ 0x0533, {1, {0x0563}}},{ 0x0534, {1, {0x0564}}},{ 0x0535, {1, {0x0565}}},{ 0x0536, {1, {0x0566}}},{ 0x0537, {1, {0x0567}}},{ 0x0538, {1, {0x0568}}},{ 0x0539, {1, {0x0569}}},{ 0x053a, {1, {0x056a}}},{ 0x053b, {1, {0x056b}}},{ 0x053c, {1, {0x056c}}},{ 0x053d, {1, {0x056d}}},{ 0x053e, {1, {0x056e}}},{ 0x053f, {1, {0x056f}}},{ 0x0540, {1, {0x0570}}},{ 0x0541, {1, {0x0571}}},{ 0x0542, {1, {0x0572}}},{ 0x0543, {1, {0x0573}}},{ 0x0544, {1, {0x0574}}},{ 0x0545, {1, {0x0575}}},{ 0x0546, {1, {0x0576}}},{ 0x0547, {1, {0x0577}}},{ 0x0548, {1, {0x0578}}},{ 0x0549, {1, {0x0579}}},{ 0x054a, {1, {0x057a}}},{ 0x054b, {1, {0x057b}}},{ 0x054c, {1, {0x057c}}},{ 0x054d, {1, {0x057d}}},{ 0x054e, {1, {0x057e}}},{ 0x054f, {1, {0x057f}}},{ 0x0550, {1, {0x0580}}},{ 0x0551, {1, {0x0581}}},{ 0x0552, {1, {0x0582}}},{ 0x0553, {1, {0x0583}}},{ 0x0554, {1, {0x0584}}},{ 0x0555, {1, {0x0585}}},{ 0x0556, {1, {0x0586}}},{ 0x0587, {2, {0x0565, 0x0582}}},{ 0x10a0, {1, {0x2d00}}},{ 0x10a1, {1, {0x2d01}}},{ 0x10a2, {1, {0x2d02}}},{ 0x10a3, {1, {0x2d03}}},{ 0x10a4, {1, {0x2d04}}},{ 0x10a5, {1, {0x2d05}}},{ 0x10a6, {1, {0x2d06}}},{ 0x10a7, {1, {0x2d07}}},{ 0x10a8, {1, {0x2d08}}},{ 0x10a9, {1, {0x2d09}}},{ 0x10aa, {1, {0x2d0a}}},{ 0x10ab, {1, {0x2d0b}}},{ 0x10ac, {1, {0x2d0c}}},{ 0x10ad, {1, {0x2d0d}}},{ 0x10ae, {1, {0x2d0e}}},{ 0x10af, {1, {0x2d0f}}},{ 0x10b0, {1, {0x2d10}}},{ 0x10b1, {1, {0x2d11}}},{ 0x10b2, {1, {0x2d12}}},{ 0x10b3, {1, {0x2d13}}},{ 0x10b4, {1, {0x2d14}}},{ 0x10b5, {1, {0x2d15}}},{ 0x10b6, {1, {0x2d16}}},{ 0x10b7, {1, {0x2d17}}},{ 0x10b8, {1, {0x2d18}}},{ 0x10b9, {1, {0x2d19}}},{ 0x10ba, {1, {0x2d1a}}},{ 0x10bb, {1, {0x2d1b}}},{ 0x10bc, {1, {0x2d1c}}},{ 0x10bd, {1, {0x2d1d}}},{ 0x10be, {1, {0x2d1e}}},{ 0x10bf, {1, {0x2d1f}}},{ 0x10c0, {1, {0x2d20}}},{ 0x10c1, {1, {0x2d21}}},{ 0x10c2, {1, {0x2d22}}},{ 0x10c3, {1, {0x2d23}}},{ 0x10c4, {1, {0x2d24}}},{ 0x10c5, {1, {0x2d25}}},{ 0x1e00, {1, {0x1e01}}},{ 0x1e02, {1, {0x1e03}}},{ 0x1e04, {1, {0x1e05}}},{ 0x1e06, {1, {0x1e07}}},{ 0x1e08, {1, {0x1e09}}},{ 0x1e0a, {1, {0x1e0b}}},{ 0x1e0c, {1, {0x1e0d}}},{ 0x1e0e, {1, {0x1e0f}}},{ 0x1e10, {1, {0x1e11}}},{ 0x1e12, {1, {0x1e13}}},{ 0x1e14, {1, {0x1e15}}},{ 0x1e16, {1, {0x1e17}}},{ 0x1e18, {1, {0x1e19}}},{ 0x1e1a, {1, {0x1e1b}}},{ 0x1e1c, {1, {0x1e1d}}},{ 0x1e1e, {1, {0x1e1f}}},{ 0x1e20, {1, {0x1e21}}},{ 0x1e22, {1, {0x1e23}}},{ 0x1e24, {1, {0x1e25}}},{ 0x1e26, {1, {0x1e27}}},{ 0x1e28, {1, {0x1e29}}},{ 0x1e2a, {1, {0x1e2b}}},{ 0x1e2c, {1, {0x1e2d}}},{ 0x1e2e, {1, {0x1e2f}}},{ 0x1e30, {1, {0x1e31}}},{ 0x1e32, {1, {0x1e33}}},{ 0x1e34, {1, {0x1e35}}},{ 0x1e36, {1, {0x1e37}}},{ 0x1e38, {1, {0x1e39}}},{ 0x1e3a, {1, {0x1e3b}}},{ 0x1e3c, {1, {0x1e3d}}},{ 0x1e3e, {1, {0x1e3f}}},{ 0x1e40, {1, {0x1e41}}},{ 0x1e42, {1, {0x1e43}}},{ 0x1e44, {1, {0x1e45}}},{ 0x1e46, {1, {0x1e47}}},{ 0x1e48, {1, {0x1e49}}},{ 0x1e4a, {1, {0x1e4b}}},{ 0x1e4c, {1, {0x1e4d}}},{ 0x1e4e, {1, {0x1e4f}}},{ 0x1e50, {1, {0x1e51}}},{ 0x1e52, {1, {0x1e53}}},{ 0x1e54, {1, {0x1e55}}},{ 0x1e56, {1, {0x1e57}}},{ 0x1e58, {1, {0x1e59}}},{ 0x1e5a, {1, {0x1e5b}}},{ 0x1e5c, {1, {0x1e5d}}},{ 0x1e5e, {1, {0x1e5f}}},{ 0x1e60, {1, {0x1e61}}},{ 0x1e62, {1, {0x1e63}}},{ 0x1e64, {1, {0x1e65}}},{ 0x1e66, {1, {0x1e67}}},{ 0x1e68, {1, {0x1e69}}},{ 0x1e6a, {1, {0x1e6b}}},{ 0x1e6c, {1, {0x1e6d}}},{ 0x1e6e, {1, {0x1e6f}}},{ 0x1e70, {1, {0x1e71}}},{ 0x1e72, {1, {0x1e73}}},{ 0x1e74, {1, {0x1e75}}},{ 0x1e76, {1, {0x1e77}}},{ 0x1e78, {1, {0x1e79}}},{ 0x1e7a, {1, {0x1e7b}}},{ 0x1e7c, {1, {0x1e7d}}},{ 0x1e7e, {1, {0x1e7f}}},{ 0x1e80, {1, {0x1e81}}},{ 0x1e82, {1, {0x1e83}}},{ 0x1e84, {1, {0x1e85}}},{ 0x1e86, {1, {0x1e87}}},{ 0x1e88, {1, {0x1e89}}},{ 0x1e8a, {1, {0x1e8b}}},{ 0x1e8c, {1, {0x1e8d}}},{ 0x1e8e, {1, {0x1e8f}}},{ 0x1e90, {1, {0x1e91}}},{ 0x1e92, {1, {0x1e93}}},{ 0x1e94, {1, {0x1e95}}},{ 0x1e96, {2, {0x0068, 0x0331}}},{ 0x1e97, {2, {0x0074, 0x0308}}},{ 0x1e98, {2, {0x0077, 0x030a}}},{ 0x1e99, {2, {0x0079, 0x030a}}},{ 0x1e9a, {2, {0x0061, 0x02be}}},{ 0x1e9b, {1, {0x1e61}}},{ 0x1ea0, {1, {0x1ea1}}},{ 0x1ea2, {1, {0x1ea3}}},{ 0x1ea4, {1, {0x1ea5}}},{ 0x1ea6, {1, {0x1ea7}}},{ 0x1ea8, {1, {0x1ea9}}},{ 0x1eaa, {1, {0x1eab}}},{ 0x1eac, {1, {0x1ead}}},{ 0x1eae, {1, {0x1eaf}}},{ 0x1eb0, {1, {0x1eb1}}},{ 0x1eb2, {1, {0x1eb3}}},{ 0x1eb4, {1, {0x1eb5}}},{ 0x1eb6, {1, {0x1eb7}}},{ 0x1eb8, {1, {0x1eb9}}},{ 0x1eba, {1, {0x1ebb}}},{ 0x1ebc, {1, {0x1ebd}}},{ 0x1ebe, {1, {0x1ebf}}},{ 0x1ec0, {1, {0x1ec1}}},{ 0x1ec2, {1, {0x1ec3}}},{ 0x1ec4, {1, {0x1ec5}}},{ 0x1ec6, {1, {0x1ec7}}},{ 0x1ec8, {1, {0x1ec9}}},{ 0x1eca, {1, {0x1ecb}}},{ 0x1ecc, {1, {0x1ecd}}},{ 0x1ece, {1, {0x1ecf}}},{ 0x1ed0, {1, {0x1ed1}}},{ 0x1ed2, {1, {0x1ed3}}},{ 0x1ed4, {1, {0x1ed5}}},{ 0x1ed6, {1, {0x1ed7}}},{ 0x1ed8, {1, {0x1ed9}}},{ 0x1eda, {1, {0x1edb}}},{ 0x1edc, {1, {0x1edd}}},{ 0x1ede, {1, {0x1edf}}},{ 0x1ee0, {1, {0x1ee1}}},{ 0x1ee2, {1, {0x1ee3}}},{ 0x1ee4, {1, {0x1ee5}}},{ 0x1ee6, {1, {0x1ee7}}},{ 0x1ee8, {1, {0x1ee9}}},{ 0x1eea, {1, {0x1eeb}}},{ 0x1eec, {1, {0x1eed}}},{ 0x1eee, {1, {0x1eef}}},{ 0x1ef0, {1, {0x1ef1}}},{ 0x1ef2, {1, {0x1ef3}}},{ 0x1ef4, {1, {0x1ef5}}},{ 0x1ef6, {1, {0x1ef7}}},{ 0x1ef8, {1, {0x1ef9}}},{ 0x1f08, {1, {0x1f00}}},{ 0x1f09, {1, {0x1f01}}},{ 0x1f0a, {1, {0x1f02}}},{ 0x1f0b, {1, {0x1f03}}},{ 0x1f0c, {1, {0x1f04}}},{ 0x1f0d, {1, {0x1f05}}},{ 0x1f0e, {1, {0x1f06}}},{ 0x1f0f, {1, {0x1f07}}},{ 0x1f18, {1, {0x1f10}}},{ 0x1f19, {1, {0x1f11}}},{ 0x1f1a, {1, {0x1f12}}},{ 0x1f1b, {1, {0x1f13}}},{ 0x1f1c, {1, {0x1f14}}},{ 0x1f1d, {1, {0x1f15}}},{ 0x1f28, {1, {0x1f20}}},{ 0x1f29, {1, {0x1f21}}},{ 0x1f2a, {1, {0x1f22}}},{ 0x1f2b, {1, {0x1f23}}},{ 0x1f2c, {1, {0x1f24}}},{ 0x1f2d, {1, {0x1f25}}},{ 0x1f2e, {1, {0x1f26}}},{ 0x1f2f, {1, {0x1f27}}},{ 0x1f38, {1, {0x1f30}}},{ 0x1f39, {1, {0x1f31}}},{ 0x1f3a, {1, {0x1f32}}},{ 0x1f3b, {1, {0x1f33}}},{ 0x1f3c, {1, {0x1f34}}},{ 0x1f3d, {1, {0x1f35}}},{ 0x1f3e, {1, {0x1f36}}},{ 0x1f3f, {1, {0x1f37}}},{ 0x1f48, {1, {0x1f40}}},{ 0x1f49, {1, {0x1f41}}},{ 0x1f4a, {1, {0x1f42}}},{ 0x1f4b, {1, {0x1f43}}},{ 0x1f4c, {1, {0x1f44}}},{ 0x1f4d, {1, {0x1f45}}},{ 0x1f50, {2, {0x03c5, 0x0313}}},{ 0x1f52, {3, {0x03c5, 0x0313, 0x0300}}},{ 0x1f54, {3, {0x03c5, 0x0313, 0x0301}}},{ 0x1f56, {3, {0x03c5, 0x0313, 0x0342}}},{ 0x1f59, {1, {0x1f51}}},{ 0x1f5b, {1, {0x1f53}}},{ 0x1f5d, {1, {0x1f55}}},{ 0x1f5f, {1, {0x1f57}}},{ 0x1f68, {1, {0x1f60}}},{ 0x1f69, {1, {0x1f61}}},{ 0x1f6a, {1, {0x1f62}}},{ 0x1f6b, {1, {0x1f63}}},{ 0x1f6c, {1, {0x1f64}}},{ 0x1f6d, {1, {0x1f65}}},{ 0x1f6e, {1, {0x1f66}}},{ 0x1f6f, {1, {0x1f67}}},{ 0x1f80, {2, {0x1f00, 0x03b9}}},{ 0x1f81, {2, {0x1f01, 0x03b9}}},{ 0x1f82, {2, {0x1f02, 0x03b9}}},{ 0x1f83, {2, {0x1f03, 0x03b9}}},{ 0x1f84, {2, {0x1f04, 0x03b9}}},{ 0x1f85, {2, {0x1f05, 0x03b9}}},{ 0x1f86, {2, {0x1f06, 0x03b9}}},{ 0x1f87, {2, {0x1f07, 0x03b9}}},{ 0x1f88, {2, {0x1f00, 0x03b9}}},{ 0x1f89, {2, {0x1f01, 0x03b9}}},{ 0x1f8a, {2, {0x1f02, 0x03b9}}},{ 0x1f8b, {2, {0x1f03, 0x03b9}}},{ 0x1f8c, {2, {0x1f04, 0x03b9}}},{ 0x1f8d, {2, {0x1f05, 0x03b9}}},{ 0x1f8e, {2, {0x1f06, 0x03b9}}},{ 0x1f8f, {2, {0x1f07, 0x03b9}}},{ 0x1f90, {2, {0x1f20, 0x03b9}}},{ 0x1f91, {2, {0x1f21, 0x03b9}}},{ 0x1f92, {2, {0x1f22, 0x03b9}}},{ 0x1f93, {2, {0x1f23, 0x03b9}}},{ 0x1f94, {2, {0x1f24, 0x03b9}}},{ 0x1f95, {2, {0x1f25, 0x03b9}}},{ 0x1f96, {2, {0x1f26, 0x03b9}}},{ 0x1f97, {2, {0x1f27, 0x03b9}}},{ 0x1f98, {2, {0x1f20, 0x03b9}}},{ 0x1f99, {2, {0x1f21, 0x03b9}}},{ 0x1f9a, {2, {0x1f22, 0x03b9}}},{ 0x1f9b, {2, {0x1f23, 0x03b9}}},{ 0x1f9c, {2, {0x1f24, 0x03b9}}},{ 0x1f9d, {2, {0x1f25, 0x03b9}}},{ 0x1f9e, {2, {0x1f26, 0x03b9}}},{ 0x1f9f, {2, {0x1f27, 0x03b9}}},{ 0x1fa0, {2, {0x1f60, 0x03b9}}},{ 0x1fa1, {2, {0x1f61, 0x03b9}}},{ 0x1fa2, {2, {0x1f62, 0x03b9}}},{ 0x1fa3, {2, {0x1f63, 0x03b9}}},{ 0x1fa4, {2, {0x1f64, 0x03b9}}},{ 0x1fa5, {2, {0x1f65, 0x03b9}}},{ 0x1fa6, {2, {0x1f66, 0x03b9}}},{ 0x1fa7, {2, {0x1f67, 0x03b9}}},{ 0x1fa8, {2, {0x1f60, 0x03b9}}},{ 0x1fa9, {2, {0x1f61, 0x03b9}}},{ 0x1faa, {2, {0x1f62, 0x03b9}}},{ 0x1fab, {2, {0x1f63, 0x03b9}}},{ 0x1fac, {2, {0x1f64, 0x03b9}}},{ 0x1fad, {2, {0x1f65, 0x03b9}}},{ 0x1fae, {2, {0x1f66, 0x03b9}}},{ 0x1faf, {2, {0x1f67, 0x03b9}}},{ 0x1fb2, {2, {0x1f70, 0x03b9}}},{ 0x1fb3, {2, {0x03b1, 0x03b9}}},{ 0x1fb4, {2, {0x03ac, 0x03b9}}},{ 0x1fb6, {2, {0x03b1, 0x0342}}},{ 0x1fb7, {3, {0x03b1, 0x0342, 0x03b9}}},{ 0x1fb8, {1, {0x1fb0}}},{ 0x1fb9, {1, {0x1fb1}}},{ 0x1fba, {1, {0x1f70}}},{ 0x1fbb, {1, {0x1f71}}},{ 0x1fbc, {2, {0x03b1, 0x03b9}}},{ 0x1fbe, {1, {0x03b9}}},{ 0x1fc2, {2, {0x1f74, 0x03b9}}},{ 0x1fc3, {2, {0x03b7, 0x03b9}}},{ 0x1fc4, {2, {0x03ae, 0x03b9}}},{ 0x1fc6, {2, {0x03b7, 0x0342}}},{ 0x1fc7, {3, {0x03b7, 0x0342, 0x03b9}}},{ 0x1fc8, {1, {0x1f72}}},{ 0x1fc9, {1, {0x1f73}}},{ 0x1fca, {1, {0x1f74}}},{ 0x1fcb, {1, {0x1f75}}},{ 0x1fcc, {2, {0x03b7, 0x03b9}}},{ 0x1fd2, {3, {0x03b9, 0x0308, 0x0300}}},{ 0x1fd3, {3, {0x03b9, 0x0308, 0x0301}}},{ 0x1fd6, {2, {0x03b9, 0x0342}}},{ 0x1fd7, {3, {0x03b9, 0x0308, 0x0342}}},{ 0x1fd8, {1, {0x1fd0}}},{ 0x1fd9, {1, {0x1fd1}}},{ 0x1fda, {1, {0x1f76}}},{ 0x1fdb, {1, {0x1f77}}},{ 0x1fe2, {3, {0x03c5, 0x0308, 0x0300}}},{ 0x1fe3, {3, {0x03c5, 0x0308, 0x0301}}},{ 0x1fe4, {2, {0x03c1, 0x0313}}},{ 0x1fe6, {2, {0x03c5, 0x0342}}},{ 0x1fe7, {3, {0x03c5, 0x0308, 0x0342}}},{ 0x1fe8, {1, {0x1fe0}}},{ 0x1fe9, {1, {0x1fe1}}},{ 0x1fea, {1, {0x1f7a}}},{ 0x1feb, {1, {0x1f7b}}},{ 0x1fec, {1, {0x1fe5}}},{ 0x1ff2, {2, {0x1f7c, 0x03b9}}},{ 0x1ff3, {2, {0x03c9, 0x03b9}}},{ 0x1ff4, {2, {0x03ce, 0x03b9}}},{ 0x1ff6, {2, {0x03c9, 0x0342}}},{ 0x1ff7, {3, {0x03c9, 0x0342, 0x03b9}}},{ 0x1ff8, {1, {0x1f78}}},{ 0x1ff9, {1, {0x1f79}}},{ 0x1ffa, {1, {0x1f7c}}},{ 0x1ffb, {1, {0x1f7d}}},{ 0x1ffc, {2, {0x03c9, 0x03b9}}},{ 0x2126, {1, {0x03c9}}},{ 0x212a, {1, {0x006b}}},{ 0x212b, {1, {0x00e5}}},{ 0x2160, {1, {0x2170}}},{ 0x2161, {1, {0x2171}}},{ 0x2162, {1, {0x2172}}},{ 0x2163, {1, {0x2173}}},{ 0x2164, {1, {0x2174}}},{ 0x2165, {1, {0x2175}}},{ 0x2166, {1, {0x2176}}},{ 0x2167, {1, {0x2177}}},{ 0x2168, {1, {0x2178}}},{ 0x2169, {1, {0x2179}}},{ 0x216a, {1, {0x217a}}},{ 0x216b, {1, {0x217b}}},{ 0x216c, {1, {0x217c}}},{ 0x216d, {1, {0x217d}}},{ 0x216e, {1, {0x217e}}},{ 0x216f, {1, {0x217f}}},{ 0x24b6, {1, {0x24d0}}},{ 0x24b7, {1, {0x24d1}}},{ 0x24b8, {1, {0x24d2}}},{ 0x24b9, {1, {0x24d3}}},{ 0x24ba, {1, {0x24d4}}},{ 0x24bb, {1, {0x24d5}}},{ 0x24bc, {1, {0x24d6}}},{ 0x24bd, {1, {0x24d7}}},{ 0x24be, {1, {0x24d8}}},{ 0x24bf, {1, {0x24d9}}},{ 0x24c0, {1, {0x24da}}},{ 0x24c1, {1, {0x24db}}},{ 0x24c2, {1, {0x24dc}}},{ 0x24c3, {1, {0x24dd}}},{ 0x24c4, {1, {0x24de}}},{ 0x24c5, {1, {0x24df}}},{ 0x24c6, {1, {0x24e0}}},{ 0x24c7, {1, {0x24e1}}},{ 0x24c8, {1, {0x24e2}}},{ 0x24c9, {1, {0x24e3}}},{ 0x24ca, {1, {0x24e4}}},{ 0x24cb, {1, {0x24e5}}},{ 0x24cc, {1, {0x24e6}}},{ 0x24cd, {1, {0x24e7}}},{ 0x24ce, {1, {0x24e8}}},{ 0x24cf, {1, {0x24e9}}},{ 0x2c00, {1, {0x2c30}}},{ 0x2c01, {1, {0x2c31}}},{ 0x2c02, {1, {0x2c32}}},{ 0x2c03, {1, {0x2c33}}},{ 0x2c04, {1, {0x2c34}}},{ 0x2c05, {1, {0x2c35}}},{ 0x2c06, {1, {0x2c36}}},{ 0x2c07, {1, {0x2c37}}},{ 0x2c08, {1, {0x2c38}}},{ 0x2c09, {1, {0x2c39}}},{ 0x2c0a, {1, {0x2c3a}}},{ 0x2c0b, {1, {0x2c3b}}},{ 0x2c0c, {1, {0x2c3c}}},{ 0x2c0d, {1, {0x2c3d}}},{ 0x2c0e, {1, {0x2c3e}}},{ 0x2c0f, {1, {0x2c3f}}},{ 0x2c10, {1, {0x2c40}}},{ 0x2c11, {1, {0x2c41}}},{ 0x2c12, {1, {0x2c42}}},{ 0x2c13, {1, {0x2c43}}},{ 0x2c14, {1, {0x2c44}}},{ 0x2c15, {1, {0x2c45}}},{ 0x2c16, {1, {0x2c46}}},{ 0x2c17, {1, {0x2c47}}},{ 0x2c18, {1, {0x2c48}}},{ 0x2c19, {1, {0x2c49}}},{ 0x2c1a, {1, {0x2c4a}}},{ 0x2c1b, {1, {0x2c4b}}},{ 0x2c1c, {1, {0x2c4c}}},{ 0x2c1d, {1, {0x2c4d}}},{ 0x2c1e, {1, {0x2c4e}}},{ 0x2c1f, {1, {0x2c4f}}},{ 0x2c20, {1, {0x2c50}}},{ 0x2c21, {1, {0x2c51}}},{ 0x2c22, {1, {0x2c52}}},{ 0x2c23, {1, {0x2c53}}},{ 0x2c24, {1, {0x2c54}}},{ 0x2c25, {1, {0x2c55}}},{ 0x2c26, {1, {0x2c56}}},{ 0x2c27, {1, {0x2c57}}},{ 0x2c28, {1, {0x2c58}}},{ 0x2c29, {1, {0x2c59}}},{ 0x2c2a, {1, {0x2c5a}}},{ 0x2c2b, {1, {0x2c5b}}},{ 0x2c2c, {1, {0x2c5c}}},{ 0x2c2d, {1, {0x2c5d}}},{ 0x2c2e, {1, {0x2c5e}}},{ 0x2c80, {1, {0x2c81}}},{ 0x2c82, {1, {0x2c83}}},{ 0x2c84, {1, {0x2c85}}},{ 0x2c86, {1, {0x2c87}}},{ 0x2c88, {1, {0x2c89}}},{ 0x2c8a, {1, {0x2c8b}}},{ 0x2c8c, {1, {0x2c8d}}},{ 0x2c8e, {1, {0x2c8f}}},{ 0x2c90, {1, {0x2c91}}},{ 0x2c92, {1, {0x2c93}}},{ 0x2c94, {1, {0x2c95}}},{ 0x2c96, {1, {0x2c97}}},{ 0x2c98, {1, {0x2c99}}},{ 0x2c9a, {1, {0x2c9b}}},{ 0x2c9c, {1, {0x2c9d}}},{ 0x2c9e, {1, {0x2c9f}}},{ 0x2ca0, {1, {0x2ca1}}},{ 0x2ca2, {1, {0x2ca3}}},{ 0x2ca4, {1, {0x2ca5}}},{ 0x2ca6, {1, {0x2ca7}}},{ 0x2ca8, {1, {0x2ca9}}},{ 0x2caa, {1, {0x2cab}}},{ 0x2cac, {1, {0x2cad}}},{ 0x2cae, {1, {0x2caf}}},{ 0x2cb0, {1, {0x2cb1}}},{ 0x2cb2, {1, {0x2cb3}}},{ 0x2cb4, {1, {0x2cb5}}},{ 0x2cb6, {1, {0x2cb7}}},{ 0x2cb8, {1, {0x2cb9}}},{ 0x2cba, {1, {0x2cbb}}},{ 0x2cbc, {1, {0x2cbd}}},{ 0x2cbe, {1, {0x2cbf}}},{ 0x2cc0, {1, {0x2cc1}}},{ 0x2cc2, {1, {0x2cc3}}},{ 0x2cc4, {1, {0x2cc5}}},{ 0x2cc6, {1, {0x2cc7}}},{ 0x2cc8, {1, {0x2cc9}}},{ 0x2cca, {1, {0x2ccb}}},{ 0x2ccc, {1, {0x2ccd}}},{ 0x2cce, {1, {0x2ccf}}},{ 0x2cd0, {1, {0x2cd1}}},{ 0x2cd2, {1, {0x2cd3}}},{ 0x2cd4, {1, {0x2cd5}}},{ 0x2cd6, {1, {0x2cd7}}},{ 0x2cd8, {1, {0x2cd9}}},{ 0x2cda, {1, {0x2cdb}}},{ 0x2cdc, {1, {0x2cdd}}},{ 0x2cde, {1, {0x2cdf}}},{ 0x2ce0, {1, {0x2ce1}}},{ 0x2ce2, {1, {0x2ce3}}},{ 0xfb00, {2, {0x0066, 0x0066}}},{ 0xfb01, {2, {0x0066, 0x0069}}},{ 0xfb02, {2, {0x0066, 0x006c}}},{ 0xfb03, {3, {0x0066, 0x0066, 0x0069}}},{ 0xfb04, {3, {0x0066, 0x0066, 0x006c}}},{ 0xfb05, {2, {0x0073, 0x0074}}},{ 0xfb06, {2, {0x0073, 0x0074}}},{ 0xfb13, {2, {0x0574, 0x0576}}},{ 0xfb14, {2, {0x0574, 0x0565}}},{ 0xfb15, {2, {0x0574, 0x056b}}},{ 0xfb16, {2, {0x057e, 0x0576}}},{ 0xfb17, {2, {0x0574, 0x056d}}},{ 0xff21, {1, {0xff41}}},{ 0xff22, {1, {0xff42}}},{ 0xff23, {1, {0xff43}}},{ 0xff24, {1, {0xff44}}},{ 0xff25, {1, {0xff45}}},{ 0xff26, {1, {0xff46}}},{ 0xff27, {1, {0xff47}}},{ 0xff28, {1, {0xff48}}},{ 0xff29, {1, {0xff49}}},{ 0xff2a, {1, {0xff4a}}},{ 0xff2b, {1, {0xff4b}}},{ 0xff2c, {1, {0xff4c}}},{ 0xff2d, {1, {0xff4d}}},{ 0xff2e, {1, {0xff4e}}},{ 0xff2f, {1, {0xff4f}}},{ 0xff30, {1, {0xff50}}},{ 0xff31, {1, {0xff51}}},{ 0xff32, {1, {0xff52}}},{ 0xff33, {1, {0xff53}}},{ 0xff34, {1, {0xff54}}},{ 0xff35, {1, {0xff55}}},{ 0xff36, {1, {0xff56}}},{ 0xff37, {1, {0xff57}}},{ 0xff38, {1, {0xff58}}},{ 0xff39, {1, {0xff59}}},{ 0xff3a, {1, {0xff5a}}},{ 0x10400, {1, {0x10428}}},{ 0x10401, {1, {0x10429}}},{ 0x10402, {1, {0x1042a}}},{ 0x10403, {1, {0x1042b}}},{ 0x10404, {1, {0x1042c}}},{ 0x10405, {1, {0x1042d}}},{ 0x10406, {1, {0x1042e}}},{ 0x10407, {1, {0x1042f}}},{ 0x10408, {1, {0x10430}}},{ 0x10409, {1, {0x10431}}},{ 0x1040a, {1, {0x10432}}},{ 0x1040b, {1, {0x10433}}},{ 0x1040c, {1, {0x10434}}},{ 0x1040d, {1, {0x10435}}},{ 0x1040e, {1, {0x10436}}},{ 0x1040f, {1, {0x10437}}},{ 0x10410, {1, {0x10438}}},{ 0x10411, {1, {0x10439}}},{ 0x10412, {1, {0x1043a}}},{ 0x10413, {1, {0x1043b}}},{ 0x10414, {1, {0x1043c}}},{ 0x10415, {1, {0x1043d}}},{ 0x10416, {1, {0x1043e}}},{ 0x10417, {1, {0x1043f}}},{ 0x10418, {1, {0x10440}}},{ 0x10419, {1, {0x10441}}},{ 0x1041a, {1, {0x10442}}},{ 0x1041b, {1, {0x10443}}},{ 0x1041c, {1, {0x10444}}},{ 0x1041d, {1, {0x10445}}},{ 0x1041e, {1, {0x10446}}},{ 0x1041f, {1, {0x10447}}},{ 0x10420, {1, {0x10448}}},{ 0x10421, {1, {0x10449}}},{ 0x10422, {1, {0x1044a}}},{ 0x10423, {1, {0x1044b}}},{ 0x10424, {1, {0x1044c}}},{ 0x10425, {1, {0x1044d}}},{ 0x10426, {1, {0x1044e}}},{ 0x10427, {1, {0x1044f}}}};static const CaseFold_11_Type CaseFold_Locale[] = {{ 0x0049, {1, {0x0069}}},{ 0x0130, {2, {0x0069, 0x0307}}}};static const CaseUnfold_11_Type CaseUnfold_11[] = {{ 0x0061, {1, {0x0041 }}},{ 0x0062, {1, {0x0042 }}},{ 0x0063, {1, {0x0043 }}},{ 0x0064, {1, {0x0044 }}},{ 0x0065, {1, {0x0045 }}},{ 0x0066, {1, {0x0046 }}},{ 0x0067, {1, {0x0047 }}},{ 0x0068, {1, {0x0048 }}},{ 0x006a, {1, {0x004a }}},{ 0x006b, {2, {0x212a, 0x004b }}},{ 0x006c, {1, {0x004c }}},{ 0x006d, {1, {0x004d }}},{ 0x006e, {1, {0x004e }}},{ 0x006f, {1, {0x004f }}},{ 0x0070, {1, {0x0050 }}},{ 0x0071, {1, {0x0051 }}},{ 0x0072, {1, {0x0052 }}},{ 0x0073, {2, {0x0053, 0x017f }}},{ 0x0074, {1, {0x0054 }}},{ 0x0075, {1, {0x0055 }}},{ 0x0076, {1, {0x0056 }}},{ 0x0077, {1, {0x0057 }}},{ 0x0078, {1, {0x0058 }}},{ 0x0079, {1, {0x0059 }}},{ 0x007a, {1, {0x005a }}},{ 0x00e0, {1, {0x00c0 }}},{ 0x00e1, {1, {0x00c1 }}},{ 0x00e2, {1, {0x00c2 }}},{ 0x00e3, {1, {0x00c3 }}},{ 0x00e4, {1, {0x00c4 }}},{ 0x00e5, {2, {0x212b, 0x00c5 }}},{ 0x00e6, {1, {0x00c6 }}},{ 0x00e7, {1, {0x00c7 }}},{ 0x00e8, {1, {0x00c8 }}},{ 0x00e9, {1, {0x00c9 }}},{ 0x00ea, {1, {0x00ca }}},{ 0x00eb, {1, {0x00cb }}},{ 0x00ec, {1, {0x00cc }}},{ 0x00ed, {1, {0x00cd }}},{ 0x00ee, {1, {0x00ce }}},{ 0x00ef, {1, {0x00cf }}},{ 0x00f0, {1, {0x00d0 }}},{ 0x00f1, {1, {0x00d1 }}},{ 0x00f2, {1, {0x00d2 }}},{ 0x00f3, {1, {0x00d3 }}},{ 0x00f4, {1, {0x00d4 }}},{ 0x00f5, {1, {0x00d5 }}},{ 0x00f6, {1, {0x00d6 }}},{ 0x00f8, {1, {0x00d8 }}},{ 0x00f9, {1, {0x00d9 }}},{ 0x00fa, {1, {0x00da }}},{ 0x00fb, {1, {0x00db }}},{ 0x00fc, {1, {0x00dc }}},{ 0x00fd, {1, {0x00dd }}},{ 0x00fe, {1, {0x00de }}},{ 0x00ff, {1, {0x0178 }}},{ 0x0101, {1, {0x0100 }}},{ 0x0103, {1, {0x0102 }}},{ 0x0105, {1, {0x0104 }}},{ 0x0107, {1, {0x0106 }}},{ 0x0109, {1, {0x0108 }}},{ 0x010b, {1, {0x010a }}},{ 0x010d, {1, {0x010c }}},{ 0x010f, {1, {0x010e }}},{ 0x0111, {1, {0x0110 }}},{ 0x0113, {1, {0x0112 }}},{ 0x0115, {1, {0x0114 }}},{ 0x0117, {1, {0x0116 }}},{ 0x0119, {1, {0x0118 }}},{ 0x011b, {1, {0x011a }}},{ 0x011d, {1, {0x011c }}},{ 0x011f, {1, {0x011e }}},{ 0x0121, {1, {0x0120 }}},{ 0x0123, {1, {0x0122 }}},{ 0x0125, {1, {0x0124 }}},{ 0x0127, {1, {0x0126 }}},{ 0x0129, {1, {0x0128 }}},{ 0x012b, {1, {0x012a }}},{ 0x012d, {1, {0x012c }}},{ 0x012f, {1, {0x012e }}},{ 0x0133, {1, {0x0132 }}},{ 0x0135, {1, {0x0134 }}},{ 0x0137, {1, {0x0136 }}},{ 0x013a, {1, {0x0139 }}},{ 0x013c, {1, {0x013b }}},{ 0x013e, {1, {0x013d }}},{ 0x0140, {1, {0x013f }}},{ 0x0142, {1, {0x0141 }}},{ 0x0144, {1, {0x0143 }}},{ 0x0146, {1, {0x0145 }}},{ 0x0148, {1, {0x0147 }}},{ 0x014b, {1, {0x014a }}},{ 0x014d, {1, {0x014c }}},{ 0x014f, {1, {0x014e }}},{ 0x0151, {1, {0x0150 }}},{ 0x0153, {1, {0x0152 }}},{ 0x0155, {1, {0x0154 }}},{ 0x0157, {1, {0x0156 }}},{ 0x0159, {1, {0x0158 }}},{ 0x015b, {1, {0x015a }}},{ 0x015d, {1, {0x015c }}},{ 0x015f, {1, {0x015e }}},{ 0x0161, {1, {0x0160 }}},{ 0x0163, {1, {0x0162 }}},{ 0x0165, {1, {0x0164 }}},{ 0x0167, {1, {0x0166 }}},{ 0x0169, {1, {0x0168 }}},{ 0x016b, {1, {0x016a }}},{ 0x016d, {1, {0x016c }}},{ 0x016f, {1, {0x016e }}},{ 0x0171, {1, {0x0170 }}},{ 0x0173, {1, {0x0172 }}},{ 0x0175, {1, {0x0174 }}},{ 0x0177, {1, {0x0176 }}},{ 0x017a, {1, {0x0179 }}},{ 0x017c, {1, {0x017b }}},{ 0x017e, {1, {0x017d }}},{ 0x0183, {1, {0x0182 }}},{ 0x0185, {1, {0x0184 }}},{ 0x0188, {1, {0x0187 }}},{ 0x018c, {1, {0x018b }}},{ 0x0192, {1, {0x0191 }}},{ 0x0195, {1, {0x01f6 }}},{ 0x0199, {1, {0x0198 }}},{ 0x019a, {1, {0x023d }}},{ 0x019e, {1, {0x0220 }}},{ 0x01a1, {1, {0x01a0 }}},{ 0x01a3, {1, {0x01a2 }}},{ 0x01a5, {1, {0x01a4 }}},{ 0x01a8, {1, {0x01a7 }}},{ 0x01ad, {1, {0x01ac }}},{ 0x01b0, {1, {0x01af }}},{ 0x01b4, {1, {0x01b3 }}},{ 0x01b6, {1, {0x01b5 }}},{ 0x01b9, {1, {0x01b8 }}},{ 0x01bd, {1, {0x01bc }}},{ 0x01bf, {1, {0x01f7 }}},{ 0x01c6, {2, {0x01c4, 0x01c5 }}},{ 0x01c9, {2, {0x01c7, 0x01c8 }}},{ 0x01cc, {2, {0x01ca, 0x01cb }}},{ 0x01ce, {1, {0x01cd }}},{ 0x01d0, {1, {0x01cf }}},{ 0x01d2, {1, {0x01d1 }}},{ 0x01d4, {1, {0x01d3 }}},{ 0x01d6, {1, {0x01d5 }}},{ 0x01d8, {1, {0x01d7 }}},{ 0x01da, {1, {0x01d9 }}},{ 0x01dc, {1, {0x01db }}},{ 0x01dd, {1, {0x018e }}},{ 0x01df, {1, {0x01de }}},{ 0x01e1, {1, {0x01e0 }}},{ 0x01e3, {1, {0x01e2 }}},{ 0x01e5, {1, {0x01e4 }}},{ 0x01e7, {1, {0x01e6 }}},{ 0x01e9, {1, {0x01e8 }}},{ 0x01eb, {1, {0x01ea }}},{ 0x01ed, {1, {0x01ec }}},{ 0x01ef, {1, {0x01ee }}},{ 0x01f3, {2, {0x01f1, 0x01f2 }}},{ 0x01f5, {1, {0x01f4 }}},{ 0x01f9, {1, {0x01f8 }}},{ 0x01fb, {1, {0x01fa }}},{ 0x01fd, {1, {0x01fc }}},{ 0x01ff, {1, {0x01fe }}},{ 0x0201, {1, {0x0200 }}},{ 0x0203, {1, {0x0202 }}},{ 0x0205, {1, {0x0204 }}},{ 0x0207, {1, {0x0206 }}},{ 0x0209, {1, {0x0208 }}},{ 0x020b, {1, {0x020a }}},{ 0x020d, {1, {0x020c }}},{ 0x020f, {1, {0x020e }}},{ 0x0211, {1, {0x0210 }}},{ 0x0213, {1, {0x0212 }}},{ 0x0215, {1, {0x0214 }}},{ 0x0217, {1, {0x0216 }}},{ 0x0219, {1, {0x0218 }}},{ 0x021b, {1, {0x021a }}},{ 0x021d, {1, {0x021c }}},{ 0x021f, {1, {0x021e }}},{ 0x0223, {1, {0x0222 }}},{ 0x0225, {1, {0x0224 }}},{ 0x0227, {1, {0x0226 }}},{ 0x0229, {1, {0x0228 }}},{ 0x022b, {1, {0x022a }}},{ 0x022d, {1, {0x022c }}},{ 0x022f, {1, {0x022e }}},{ 0x0231, {1, {0x0230 }}},{ 0x0233, {1, {0x0232 }}},{ 0x023c, {1, {0x023b }}},{ 0x0253, {1, {0x0181 }}},{ 0x0254, {1, {0x0186 }}},{ 0x0256, {1, {0x0189 }}},{ 0x0257, {1, {0x018a }}},{ 0x0259, {1, {0x018f }}},{ 0x025b, {1, {0x0190 }}},{ 0x0260, {1, {0x0193 }}},{ 0x0263, {1, {0x0194 }}},{ 0x0268, {1, {0x0197 }}},{ 0x0269, {1, {0x0196 }}},{ 0x026f, {1, {0x019c }}},{ 0x0272, {1, {0x019d }}},{ 0x0275, {1, {0x019f }}},{ 0x0280, {1, {0x01a6 }}},{ 0x0283, {1, {0x01a9 }}},{ 0x0288, {1, {0x01ae }}},{ 0x028a, {1, {0x01b1 }}},{ 0x028b, {1, {0x01b2 }}},{ 0x0292, {1, {0x01b7 }}},{ 0x0294, {1, {0x0241 }}},{ 0x03ac, {1, {0x0386 }}},{ 0x03ad, {1, {0x0388 }}},{ 0x03ae, {1, {0x0389 }}},{ 0x03af, {1, {0x038a }}},{ 0x03b1, {1, {0x0391 }}},{ 0x03b2, {2, {0x0392, 0x03d0 }}},{ 0x03b3, {1, {0x0393 }}},{ 0x03b4, {1, {0x0394 }}},{ 0x03b5, {2, {0x03f5, 0x0395 }}},{ 0x03b6, {1, {0x0396 }}},{ 0x03b7, {1, {0x0397 }}},{ 0x03b8, {3, {0x03f4, 0x0398, 0x03d1 }}},{ 0x03b9, {3, {0x1fbe, 0x0399, 0x0345 }}},{ 0x03ba, {2, {0x03f0, 0x039a }}},{ 0x03bb, {1, {0x039b }}},{ 0x03bc, {2, {0x00b5, 0x039c }}},{ 0x03bd, {1, {0x039d }}},{ 0x03be, {1, {0x039e }}},{ 0x03bf, {1, {0x039f }}},{ 0x03c0, {2, {0x03a0, 0x03d6 }}},{ 0x03c1, {2, {0x03f1, 0x03a1 }}},{ 0x03c3, {2, {0x03a3, 0x03c2 }}},{ 0x03c4, {1, {0x03a4 }}},{ 0x03c5, {1, {0x03a5 }}},{ 0x03c6, {2, {0x03a6, 0x03d5 }}},{ 0x03c7, {1, {0x03a7 }}},{ 0x03c8, {1, {0x03a8 }}},{ 0x03c9, {2, {0x03a9, 0x2126 }}},{ 0x03ca, {1, {0x03aa }}},{ 0x03cb, {1, {0x03ab }}},{ 0x03cc, {1, {0x038c }}},{ 0x03cd, {1, {0x038e }}},{ 0x03ce, {1, {0x038f }}},{ 0x03d9, {1, {0x03d8 }}},{ 0x03db, {1, {0x03da }}},{ 0x03dd, {1, {0x03dc }}},{ 0x03df, {1, {0x03de }}},{ 0x03e1, {1, {0x03e0 }}},{ 0x03e3, {1, {0x03e2 }}},{ 0x03e5, {1, {0x03e4 }}},{ 0x03e7, {1, {0x03e6 }}},{ 0x03e9, {1, {0x03e8 }}},{ 0x03eb, {1, {0x03ea }}},{ 0x03ed, {1, {0x03ec }}},{ 0x03ef, {1, {0x03ee }}},{ 0x03f2, {1, {0x03f9 }}},{ 0x03f8, {1, {0x03f7 }}},{ 0x03fb, {1, {0x03fa }}},{ 0x0430, {1, {0x0410 }}},{ 0x0431, {1, {0x0411 }}},{ 0x0432, {1, {0x0412 }}},{ 0x0433, {1, {0x0413 }}},{ 0x0434, {1, {0x0414 }}},{ 0x0435, {1, {0x0415 }}},{ 0x0436, {1, {0x0416 }}},{ 0x0437, {1, {0x0417 }}},{ 0x0438, {1, {0x0418 }}},{ 0x0439, {1, {0x0419 }}},{ 0x043a, {1, {0x041a }}},{ 0x043b, {1, {0x041b }}},{ 0x043c, {1, {0x041c }}},{ 0x043d, {1, {0x041d }}},{ 0x043e, {1, {0x041e }}},{ 0x043f, {1, {0x041f }}},{ 0x0440, {1, {0x0420 }}},{ 0x0441, {1, {0x0421 }}},{ 0x0442, {1, {0x0422 }}},{ 0x0443, {1, {0x0423 }}},{ 0x0444, {1, {0x0424 }}},{ 0x0445, {1, {0x0425 }}},{ 0x0446, {1, {0x0426 }}},{ 0x0447, {1, {0x0427 }}},{ 0x0448, {1, {0x0428 }}},{ 0x0449, {1, {0x0429 }}},{ 0x044a, {1, {0x042a }}},{ 0x044b, {1, {0x042b }}},{ 0x044c, {1, {0x042c }}},{ 0x044d, {1, {0x042d }}},{ 0x044e, {1, {0x042e }}},{ 0x044f, {1, {0x042f }}},{ 0x0450, {1, {0x0400 }}},{ 0x0451, {1, {0x0401 }}},{ 0x0452, {1, {0x0402 }}},{ 0x0453, {1, {0x0403 }}},{ 0x0454, {1, {0x0404 }}},{ 0x0455, {1, {0x0405 }}},{ 0x0456, {1, {0x0406 }}},{ 0x0457, {1, {0x0407 }}},{ 0x0458, {1, {0x0408 }}},{ 0x0459, {1, {0x0409 }}},{ 0x045a, {1, {0x040a }}},{ 0x045b, {1, {0x040b }}},{ 0x045c, {1, {0x040c }}},{ 0x045d, {1, {0x040d }}},{ 0x045e, {1, {0x040e }}},{ 0x045f, {1, {0x040f }}},{ 0x0461, {1, {0x0460 }}},{ 0x0463, {1, {0x0462 }}},{ 0x0465, {1, {0x0464 }}},{ 0x0467, {1, {0x0466 }}},{ 0x0469, {1, {0x0468 }}},{ 0x046b, {1, {0x046a }}},{ 0x046d, {1, {0x046c }}},{ 0x046f, {1, {0x046e }}},{ 0x0471, {1, {0x0470 }}},{ 0x0473, {1, {0x0472 }}},{ 0x0475, {1, {0x0474 }}},{ 0x0477, {1, {0x0476 }}},{ 0x0479, {1, {0x0478 }}},{ 0x047b, {1, {0x047a }}},{ 0x047d, {1, {0x047c }}},{ 0x047f, {1, {0x047e }}},{ 0x0481, {1, {0x0480 }}},{ 0x048b, {1, {0x048a }}},{ 0x048d, {1, {0x048c }}},{ 0x048f, {1, {0x048e }}},{ 0x0491, {1, {0x0490 }}},{ 0x0493, {1, {0x0492 }}},{ 0x0495, {1, {0x0494 }}},{ 0x0497, {1, {0x0496 }}},{ 0x0499, {1, {0x0498 }}},{ 0x049b, {1, {0x049a }}},{ 0x049d, {1, {0x049c }}},{ 0x049f, {1, {0x049e }}},{ 0x04a1, {1, {0x04a0 }}},{ 0x04a3, {1, {0x04a2 }}},{ 0x04a5, {1, {0x04a4 }}},{ 0x04a7, {1, {0x04a6 }}},{ 0x04a9, {1, {0x04a8 }}},{ 0x04ab, {1, {0x04aa }}},{ 0x04ad, {1, {0x04ac }}},{ 0x04af, {1, {0x04ae }}},{ 0x04b1, {1, {0x04b0 }}},{ 0x04b3, {1, {0x04b2 }}},{ 0x04b5, {1, {0x04b4 }}},{ 0x04b7, {1, {0x04b6 }}},{ 0x04b9, {1, {0x04b8 }}},{ 0x04bb, {1, {0x04ba }}},{ 0x04bd, {1, {0x04bc }}},{ 0x04bf, {1, {0x04be }}},{ 0x04c2, {1, {0x04c1 }}},{ 0x04c4, {1, {0x04c3 }}},{ 0x04c6, {1, {0x04c5 }}},{ 0x04c8, {1, {0x04c7 }}},{ 0x04ca, {1, {0x04c9 }}},{ 0x04cc, {1, {0x04cb }}},{ 0x04ce, {1, {0x04cd }}},{ 0x04d1, {1, {0x04d0 }}},{ 0x04d3, {1, {0x04d2 }}},{ 0x04d5, {1, {0x04d4 }}},{ 0x04d7, {1, {0x04d6 }}},{ 0x04d9, {1, {0x04d8 }}},{ 0x04db, {1, {0x04da }}},{ 0x04dd, {1, {0x04dc }}},{ 0x04df, {1, {0x04de }}},{ 0x04e1, {1, {0x04e0 }}},{ 0x04e3, {1, {0x04e2 }}},{ 0x04e5, {1, {0x04e4 }}},{ 0x04e7, {1, {0x04e6 }}},{ 0x04e9, {1, {0x04e8 }}},{ 0x04eb, {1, {0x04ea }}},{ 0x04ed, {1, {0x04ec }}},{ 0x04ef, {1, {0x04ee }}},{ 0x04f1, {1, {0x04f0 }}},{ 0x04f3, {1, {0x04f2 }}},{ 0x04f5, {1, {0x04f4 }}},{ 0x04f7, {1, {0x04f6 }}},{ 0x04f9, {1, {0x04f8 }}},{ 0x0501, {1, {0x0500 }}},{ 0x0503, {1, {0x0502 }}},{ 0x0505, {1, {0x0504 }}},{ 0x0507, {1, {0x0506 }}},{ 0x0509, {1, {0x0508 }}},{ 0x050b, {1, {0x050a }}},{ 0x050d, {1, {0x050c }}},{ 0x050f, {1, {0x050e }}},{ 0x0561, {1, {0x0531 }}},{ 0x0562, {1, {0x0532 }}},{ 0x0563, {1, {0x0533 }}},{ 0x0564, {1, {0x0534 }}},{ 0x0565, {1, {0x0535 }}},{ 0x0566, {1, {0x0536 }}},{ 0x0567, {1, {0x0537 }}},{ 0x0568, {1, {0x0538 }}},{ 0x0569, {1, {0x0539 }}},{ 0x056a, {1, {0x053a }}},{ 0x056b, {1, {0x053b }}},{ 0x056c, {1, {0x053c }}},{ 0x056d, {1, {0x053d }}},{ 0x056e, {1, {0x053e }}},{ 0x056f, {1, {0x053f }}},{ 0x0570, {1, {0x0540 }}},{ 0x0571, {1, {0x0541 }}},{ 0x0572, {1, {0x0542 }}},{ 0x0573, {1, {0x0543 }}},{ 0x0574, {1, {0x0544 }}},{ 0x0575, {1, {0x0545 }}},{ 0x0576, {1, {0x0546 }}},{ 0x0577, {1, {0x0547 }}},{ 0x0578, {1, {0x0548 }}},{ 0x0579, {1, {0x0549 }}},{ 0x057a, {1, {0x054a }}},{ 0x057b, {1, {0x054b }}},{ 0x057c, {1, {0x054c }}},{ 0x057d, {1, {0x054d }}},{ 0x057e, {1, {0x054e }}},{ 0x057f, {1, {0x054f }}},{ 0x0580, {1, {0x0550 }}},{ 0x0581, {1, {0x0551 }}},{ 0x0582, {1, {0x0552 }}},{ 0x0583, {1, {0x0553 }}},{ 0x0584, {1, {0x0554 }}},{ 0x0585, {1, {0x0555 }}},{ 0x0586, {1, {0x0556 }}},{ 0x1e01, {1, {0x1e00 }}},{ 0x1e03, {1, {0x1e02 }}},{ 0x1e05, {1, {0x1e04 }}},{ 0x1e07, {1, {0x1e06 }}},{ 0x1e09, {1, {0x1e08 }}},{ 0x1e0b, {1, {0x1e0a }}},{ 0x1e0d, {1, {0x1e0c }}},{ 0x1e0f, {1, {0x1e0e }}},{ 0x1e11, {1, {0x1e10 }}},{ 0x1e13, {1, {0x1e12 }}},{ 0x1e15, {1, {0x1e14 }}},{ 0x1e17, {1, {0x1e16 }}},{ 0x1e19, {1, {0x1e18 }}},{ 0x1e1b, {1, {0x1e1a }}},{ 0x1e1d, {1, {0x1e1c }}},{ 0x1e1f, {1, {0x1e1e }}},{ 0x1e21, {1, {0x1e20 }}},{ 0x1e23, {1, {0x1e22 }}},{ 0x1e25, {1, {0x1e24 }}},{ 0x1e27, {1, {0x1e26 }}},{ 0x1e29, {1, {0x1e28 }}},{ 0x1e2b, {1, {0x1e2a }}},{ 0x1e2d, {1, {0x1e2c }}},{ 0x1e2f, {1, {0x1e2e }}},{ 0x1e31, {1, {0x1e30 }}},{ 0x1e33, {1, {0x1e32 }}},{ 0x1e35, {1, {0x1e34 }}},{ 0x1e37, {1, {0x1e36 }}},{ 0x1e39, {1, {0x1e38 }}},{ 0x1e3b, {1, {0x1e3a }}},{ 0x1e3d, {1, {0x1e3c }}},{ 0x1e3f, {1, {0x1e3e }}},{ 0x1e41, {1, {0x1e40 }}},{ 0x1e43, {1, {0x1e42 }}},{ 0x1e45, {1, {0x1e44 }}},{ 0x1e47, {1, {0x1e46 }}},{ 0x1e49, {1, {0x1e48 }}},{ 0x1e4b, {1, {0x1e4a }}},{ 0x1e4d, {1, {0x1e4c }}},{ 0x1e4f, {1, {0x1e4e }}},{ 0x1e51, {1, {0x1e50 }}},{ 0x1e53, {1, {0x1e52 }}},{ 0x1e55, {1, {0x1e54 }}},{ 0x1e57, {1, {0x1e56 }}},{ 0x1e59, {1, {0x1e58 }}},{ 0x1e5b, {1, {0x1e5a }}},{ 0x1e5d, {1, {0x1e5c }}},{ 0x1e5f, {1, {0x1e5e }}},{ 0x1e61, {2, {0x1e9b, 0x1e60 }}},{ 0x1e63, {1, {0x1e62 }}},{ 0x1e65, {1, {0x1e64 }}},{ 0x1e67, {1, {0x1e66 }}},{ 0x1e69, {1, {0x1e68 }}},{ 0x1e6b, {1, {0x1e6a }}},{ 0x1e6d, {1, {0x1e6c }}},{ 0x1e6f, {1, {0x1e6e }}},{ 0x1e71, {1, {0x1e70 }}},{ 0x1e73, {1, {0x1e72 }}},{ 0x1e75, {1, {0x1e74 }}},{ 0x1e77, {1, {0x1e76 }}},{ 0x1e79, {1, {0x1e78 }}},{ 0x1e7b, {1, {0x1e7a }}},{ 0x1e7d, {1, {0x1e7c }}},{ 0x1e7f, {1, {0x1e7e }}},{ 0x1e81, {1, {0x1e80 }}},{ 0x1e83, {1, {0x1e82 }}},{ 0x1e85, {1, {0x1e84 }}},{ 0x1e87, {1, {0x1e86 }}},{ 0x1e89, {1, {0x1e88 }}},{ 0x1e8b, {1, {0x1e8a }}},{ 0x1e8d, {1, {0x1e8c }}},{ 0x1e8f, {1, {0x1e8e }}},{ 0x1e91, {1, {0x1e90 }}},{ 0x1e93, {1, {0x1e92 }}},{ 0x1e95, {1, {0x1e94 }}},{ 0x1ea1, {1, {0x1ea0 }}},{ 0x1ea3, {1, {0x1ea2 }}},{ 0x1ea5, {1, {0x1ea4 }}},{ 0x1ea7, {1, {0x1ea6 }}},{ 0x1ea9, {1, {0x1ea8 }}},{ 0x1eab, {1, {0x1eaa }}},{ 0x1ead, {1, {0x1eac }}},{ 0x1eaf, {1, {0x1eae }}},{ 0x1eb1, {1, {0x1eb0 }}},{ 0x1eb3, {1, {0x1eb2 }}},{ 0x1eb5, {1, {0x1eb4 }}},{ 0x1eb7, {1, {0x1eb6 }}},{ 0x1eb9, {1, {0x1eb8 }}},{ 0x1ebb, {1, {0x1eba }}},{ 0x1ebd, {1, {0x1ebc }}},{ 0x1ebf, {1, {0x1ebe }}},{ 0x1ec1, {1, {0x1ec0 }}},{ 0x1ec3, {1, {0x1ec2 }}},{ 0x1ec5, {1, {0x1ec4 }}},{ 0x1ec7, {1, {0x1ec6 }}},{ 0x1ec9, {1, {0x1ec8 }}},{ 0x1ecb, {1, {0x1eca }}},{ 0x1ecd, {1, {0x1ecc }}},{ 0x1ecf, {1, {0x1ece }}},{ 0x1ed1, {1, {0x1ed0 }}},{ 0x1ed3, {1, {0x1ed2 }}},{ 0x1ed5, {1, {0x1ed4 }}},{ 0x1ed7, {1, {0x1ed6 }}},{ 0x1ed9, {1, {0x1ed8 }}},{ 0x1edb, {1, {0x1eda }}},{ 0x1edd, {1, {0x1edc }}},{ 0x1edf, {1, {0x1ede }}},{ 0x1ee1, {1, {0x1ee0 }}},{ 0x1ee3, {1, {0x1ee2 }}},{ 0x1ee5, {1, {0x1ee4 }}},{ 0x1ee7, {1, {0x1ee6 }}},{ 0x1ee9, {1, {0x1ee8 }}},{ 0x1eeb, {1, {0x1eea }}},{ 0x1eed, {1, {0x1eec }}},{ 0x1eef, {1, {0x1eee }}},{ 0x1ef1, {1, {0x1ef0 }}},{ 0x1ef3, {1, {0x1ef2 }}},{ 0x1ef5, {1, {0x1ef4 }}},{ 0x1ef7, {1, {0x1ef6 }}},{ 0x1ef9, {1, {0x1ef8 }}},{ 0x1f00, {1, {0x1f08 }}},{ 0x1f01, {1, {0x1f09 }}},{ 0x1f02, {1, {0x1f0a }}},{ 0x1f03, {1, {0x1f0b }}},{ 0x1f04, {1, {0x1f0c }}},{ 0x1f05, {1, {0x1f0d }}},{ 0x1f06, {1, {0x1f0e }}},{ 0x1f07, {1, {0x1f0f }}},{ 0x1f10, {1, {0x1f18 }}},{ 0x1f11, {1, {0x1f19 }}},{ 0x1f12, {1, {0x1f1a }}},{ 0x1f13, {1, {0x1f1b }}},{ 0x1f14, {1, {0x1f1c }}},{ 0x1f15, {1, {0x1f1d }}},{ 0x1f20, {1, {0x1f28 }}},{ 0x1f21, {1, {0x1f29 }}},{ 0x1f22, {1, {0x1f2a }}},{ 0x1f23, {1, {0x1f2b }}},{ 0x1f24, {1, {0x1f2c }}},{ 0x1f25, {1, {0x1f2d }}},{ 0x1f26, {1, {0x1f2e }}},{ 0x1f27, {1, {0x1f2f }}},{ 0x1f30, {1, {0x1f38 }}},{ 0x1f31, {1, {0x1f39 }}},{ 0x1f32, {1, {0x1f3a }}},{ 0x1f33, {1, {0x1f3b }}},{ 0x1f34, {1, {0x1f3c }}},{ 0x1f35, {1, {0x1f3d }}},{ 0x1f36, {1, {0x1f3e }}},{ 0x1f37, {1, {0x1f3f }}},{ 0x1f40, {1, {0x1f48 }}},{ 0x1f41, {1, {0x1f49 }}},{ 0x1f42, {1, {0x1f4a }}},{ 0x1f43, {1, {0x1f4b }}},{ 0x1f44, {1, {0x1f4c }}},{ 0x1f45, {1, {0x1f4d }}},{ 0x1f51, {1, {0x1f59 }}},{ 0x1f53, {1, {0x1f5b }}},{ 0x1f55, {1, {0x1f5d }}},{ 0x1f57, {1, {0x1f5f }}},{ 0x1f60, {1, {0x1f68 }}},{ 0x1f61, {1, {0x1f69 }}},{ 0x1f62, {1, {0x1f6a }}},{ 0x1f63, {1, {0x1f6b }}},{ 0x1f64, {1, {0x1f6c }}},{ 0x1f65, {1, {0x1f6d }}},{ 0x1f66, {1, {0x1f6e }}},{ 0x1f67, {1, {0x1f6f }}},{ 0x1f70, {1, {0x1fba }}},{ 0x1f71, {1, {0x1fbb }}},{ 0x1f72, {1, {0x1fc8 }}},{ 0x1f73, {1, {0x1fc9 }}},{ 0x1f74, {1, {0x1fca }}},{ 0x1f75, {1, {0x1fcb }}},{ 0x1f76, {1, {0x1fda }}},{ 0x1f77, {1, {0x1fdb }}},{ 0x1f78, {1, {0x1ff8 }}},{ 0x1f79, {1, {0x1ff9 }}},{ 0x1f7a, {1, {0x1fea }}},{ 0x1f7b, {1, {0x1feb }}},{ 0x1f7c, {1, {0x1ffa }}},{ 0x1f7d, {1, {0x1ffb }}},{ 0x1fb0, {1, {0x1fb8 }}},{ 0x1fb1, {1, {0x1fb9 }}},{ 0x1fd0, {1, {0x1fd8 }}},{ 0x1fd1, {1, {0x1fd9 }}},{ 0x1fe0, {1, {0x1fe8 }}},{ 0x1fe1, {1, {0x1fe9 }}},{ 0x1fe5, {1, {0x1fec }}},{ 0x2170, {1, {0x2160 }}},{ 0x2171, {1, {0x2161 }}},{ 0x2172, {1, {0x2162 }}},{ 0x2173, {1, {0x2163 }}},{ 0x2174, {1, {0x2164 }}},{ 0x2175, {1, {0x2165 }}},{ 0x2176, {1, {0x2166 }}},{ 0x2177, {1, {0x2167 }}},{ 0x2178, {1, {0x2168 }}},{ 0x2179, {1, {0x2169 }}},{ 0x217a, {1, {0x216a }}},{ 0x217b, {1, {0x216b }}},{ 0x217c, {1, {0x216c }}},{ 0x217d, {1, {0x216d }}},{ 0x217e, {1, {0x216e }}},{ 0x217f, {1, {0x216f }}},{ 0x24d0, {1, {0x24b6 }}},{ 0x24d1, {1, {0x24b7 }}},{ 0x24d2, {1, {0x24b8 }}},{ 0x24d3, {1, {0x24b9 }}},{ 0x24d4, {1, {0x24ba }}},{ 0x24d5, {1, {0x24bb }}},{ 0x24d6, {1, {0x24bc }}},{ 0x24d7, {1, {0x24bd }}},{ 0x24d8, {1, {0x24be }}},{ 0x24d9, {1, {0x24bf }}},{ 0x24da, {1, {0x24c0 }}},{ 0x24db, {1, {0x24c1 }}},{ 0x24dc, {1, {0x24c2 }}},{ 0x24dd, {1, {0x24c3 }}},{ 0x24de, {1, {0x24c4 }}},{ 0x24df, {1, {0x24c5 }}},{ 0x24e0, {1, {0x24c6 }}},{ 0x24e1, {1, {0x24c7 }}},{ 0x24e2, {1, {0x24c8 }}},{ 0x24e3, {1, {0x24c9 }}},{ 0x24e4, {1, {0x24ca }}},{ 0x24e5, {1, {0x24cb }}},{ 0x24e6, {1, {0x24cc }}},{ 0x24e7, {1, {0x24cd }}},{ 0x24e8, {1, {0x24ce }}},{ 0x24e9, {1, {0x24cf }}},{ 0x2c30, {1, {0x2c00 }}},{ 0x2c31, {1, {0x2c01 }}},{ 0x2c32, {1, {0x2c02 }}},{ 0x2c33, {1, {0x2c03 }}},{ 0x2c34, {1, {0x2c04 }}},{ 0x2c35, {1, {0x2c05 }}},{ 0x2c36, {1, {0x2c06 }}},{ 0x2c37, {1, {0x2c07 }}},{ 0x2c38, {1, {0x2c08 }}},{ 0x2c39, {1, {0x2c09 }}},{ 0x2c3a, {1, {0x2c0a }}},{ 0x2c3b, {1, {0x2c0b }}},{ 0x2c3c, {1, {0x2c0c }}},{ 0x2c3d, {1, {0x2c0d }}},{ 0x2c3e, {1, {0x2c0e }}},{ 0x2c3f, {1, {0x2c0f }}},{ 0x2c40, {1, {0x2c10 }}},{ 0x2c41, {1, {0x2c11 }}},{ 0x2c42, {1, {0x2c12 }}},{ 0x2c43, {1, {0x2c13 }}},{ 0x2c44, {1, {0x2c14 }}},{ 0x2c45, {1, {0x2c15 }}},{ 0x2c46, {1, {0x2c16 }}},{ 0x2c47, {1, {0x2c17 }}},{ 0x2c48, {1, {0x2c18 }}},{ 0x2c49, {1, {0x2c19 }}},{ 0x2c4a, {1, {0x2c1a }}},{ 0x2c4b, {1, {0x2c1b }}},{ 0x2c4c, {1, {0x2c1c }}},{ 0x2c4d, {1, {0x2c1d }}},{ 0x2c4e, {1, {0x2c1e }}},{ 0x2c4f, {1, {0x2c1f }}},{ 0x2c50, {1, {0x2c20 }}},{ 0x2c51, {1, {0x2c21 }}},{ 0x2c52, {1, {0x2c22 }}},{ 0x2c53, {1, {0x2c23 }}},{ 0x2c54, {1, {0x2c24 }}},{ 0x2c55, {1, {0x2c25 }}},{ 0x2c56, {1, {0x2c26 }}},{ 0x2c57, {1, {0x2c27 }}},{ 0x2c58, {1, {0x2c28 }}},{ 0x2c59, {1, {0x2c29 }}},{ 0x2c5a, {1, {0x2c2a }}},{ 0x2c5b, {1, {0x2c2b }}},{ 0x2c5c, {1, {0x2c2c }}},{ 0x2c5d, {1, {0x2c2d }}},{ 0x2c5e, {1, {0x2c2e }}},{ 0x2c81, {1, {0x2c80 }}},{ 0x2c83, {1, {0x2c82 }}},{ 0x2c85, {1, {0x2c84 }}},{ 0x2c87, {1, {0x2c86 }}},{ 0x2c89, {1, {0x2c88 }}},{ 0x2c8b, {1, {0x2c8a }}},{ 0x2c8d, {1, {0x2c8c }}},{ 0x2c8f, {1, {0x2c8e }}},{ 0x2c91, {1, {0x2c90 }}},{ 0x2c93, {1, {0x2c92 }}},{ 0x2c95, {1, {0x2c94 }}},{ 0x2c97, {1, {0x2c96 }}},{ 0x2c99, {1, {0x2c98 }}},{ 0x2c9b, {1, {0x2c9a }}},{ 0x2c9d, {1, {0x2c9c }}},{ 0x2c9f, {1, {0x2c9e }}},{ 0x2ca1, {1, {0x2ca0 }}},{ 0x2ca3, {1, {0x2ca2 }}},{ 0x2ca5, {1, {0x2ca4 }}},{ 0x2ca7, {1, {0x2ca6 }}},{ 0x2ca9, {1, {0x2ca8 }}},{ 0x2cab, {1, {0x2caa }}},{ 0x2cad, {1, {0x2cac }}},{ 0x2caf, {1, {0x2cae }}},{ 0x2cb1, {1, {0x2cb0 }}},{ 0x2cb3, {1, {0x2cb2 }}},{ 0x2cb5, {1, {0x2cb4 }}},{ 0x2cb7, {1, {0x2cb6 }}},{ 0x2cb9, {1, {0x2cb8 }}},{ 0x2cbb, {1, {0x2cba }}},{ 0x2cbd, {1, {0x2cbc }}},{ 0x2cbf, {1, {0x2cbe }}},{ 0x2cc1, {1, {0x2cc0 }}},{ 0x2cc3, {1, {0x2cc2 }}},{ 0x2cc5, {1, {0x2cc4 }}},{ 0x2cc7, {1, {0x2cc6 }}},{ 0x2cc9, {1, {0x2cc8 }}},{ 0x2ccb, {1, {0x2cca }}},{ 0x2ccd, {1, {0x2ccc }}},{ 0x2ccf, {1, {0x2cce }}},{ 0x2cd1, {1, {0x2cd0 }}},{ 0x2cd3, {1, {0x2cd2 }}},{ 0x2cd5, {1, {0x2cd4 }}},{ 0x2cd7, {1, {0x2cd6 }}},{ 0x2cd9, {1, {0x2cd8 }}},{ 0x2cdb, {1, {0x2cda }}},{ 0x2cdd, {1, {0x2cdc }}},{ 0x2cdf, {1, {0x2cde }}},{ 0x2ce1, {1, {0x2ce0 }}},{ 0x2ce3, {1, {0x2ce2 }}},{ 0x2d00, {1, {0x10a0 }}},{ 0x2d01, {1, {0x10a1 }}},{ 0x2d02, {1, {0x10a2 }}},{ 0x2d03, {1, {0x10a3 }}},{ 0x2d04, {1, {0x10a4 }}},{ 0x2d05, {1, {0x10a5 }}},{ 0x2d06, {1, {0x10a6 }}},{ 0x2d07, {1, {0x10a7 }}},{ 0x2d08, {1, {0x10a8 }}},{ 0x2d09, {1, {0x10a9 }}},{ 0x2d0a, {1, {0x10aa }}},{ 0x2d0b, {1, {0x10ab }}},{ 0x2d0c, {1, {0x10ac }}},{ 0x2d0d, {1, {0x10ad }}},{ 0x2d0e, {1, {0x10ae }}},{ 0x2d0f, {1, {0x10af }}},{ 0x2d10, {1, {0x10b0 }}},{ 0x2d11, {1, {0x10b1 }}},{ 0x2d12, {1, {0x10b2 }}},{ 0x2d13, {1, {0x10b3 }}},{ 0x2d14, {1, {0x10b4 }}},{ 0x2d15, {1, {0x10b5 }}},{ 0x2d16, {1, {0x10b6 }}},{ 0x2d17, {1, {0x10b7 }}},{ 0x2d18, {1, {0x10b8 }}},{ 0x2d19, {1, {0x10b9 }}},{ 0x2d1a, {1, {0x10ba }}},{ 0x2d1b, {1, {0x10bb }}},{ 0x2d1c, {1, {0x10bc }}},{ 0x2d1d, {1, {0x10bd }}},{ 0x2d1e, {1, {0x10be }}},{ 0x2d1f, {1, {0x10bf }}},{ 0x2d20, {1, {0x10c0 }}},{ 0x2d21, {1, {0x10c1 }}},{ 0x2d22, {1, {0x10c2 }}},{ 0x2d23, {1, {0x10c3 }}},{ 0x2d24, {1, {0x10c4 }}},{ 0x2d25, {1, {0x10c5 }}},{ 0xff41, {1, {0xff21 }}},{ 0xff42, {1, {0xff22 }}},{ 0xff43, {1, {0xff23 }}},{ 0xff44, {1, {0xff24 }}},{ 0xff45, {1, {0xff25 }}},{ 0xff46, {1, {0xff26 }}},{ 0xff47, {1, {0xff27 }}},{ 0xff48, {1, {0xff28 }}},{ 0xff49, {1, {0xff29 }}},{ 0xff4a, {1, {0xff2a }}},{ 0xff4b, {1, {0xff2b }}},{ 0xff4c, {1, {0xff2c }}},{ 0xff4d, {1, {0xff2d }}},{ 0xff4e, {1, {0xff2e }}},{ 0xff4f, {1, {0xff2f }}},{ 0xff50, {1, {0xff30 }}},{ 0xff51, {1, {0xff31 }}},{ 0xff52, {1, {0xff32 }}},{ 0xff53, {1, {0xff33 }}},{ 0xff54, {1, {0xff34 }}},{ 0xff55, {1, {0xff35 }}},{ 0xff56, {1, {0xff36 }}},{ 0xff57, {1, {0xff37 }}},{ 0xff58, {1, {0xff38 }}},{ 0xff59, {1, {0xff39 }}},{ 0xff5a, {1, {0xff3a }}},{ 0x10428, {1, {0x10400 }}},{ 0x10429, {1, {0x10401 }}},{ 0x1042a, {1, {0x10402 }}},{ 0x1042b, {1, {0x10403 }}},{ 0x1042c, {1, {0x10404 }}},{ 0x1042d, {1, {0x10405 }}},{ 0x1042e, {1, {0x10406 }}},{ 0x1042f, {1, {0x10407 }}},{ 0x10430, {1, {0x10408 }}},{ 0x10431, {1, {0x10409 }}},{ 0x10432, {1, {0x1040a }}},{ 0x10433, {1, {0x1040b }}},{ 0x10434, {1, {0x1040c }}},{ 0x10435, {1, {0x1040d }}},{ 0x10436, {1, {0x1040e }}},{ 0x10437, {1, {0x1040f }}},{ 0x10438, {1, {0x10410 }}},{ 0x10439, {1, {0x10411 }}},{ 0x1043a, {1, {0x10412 }}},{ 0x1043b, {1, {0x10413 }}},{ 0x1043c, {1, {0x10414 }}},{ 0x1043d, {1, {0x10415 }}},{ 0x1043e, {1, {0x10416 }}},{ 0x1043f, {1, {0x10417 }}},{ 0x10440, {1, {0x10418 }}},{ 0x10441, {1, {0x10419 }}},{ 0x10442, {1, {0x1041a }}},{ 0x10443, {1, {0x1041b }}},{ 0x10444, {1, {0x1041c }}},{ 0x10445, {1, {0x1041d }}},{ 0x10446, {1, {0x1041e }}},{ 0x10447, {1, {0x1041f }}},{ 0x10448, {1, {0x10420 }}},{ 0x10449, {1, {0x10421 }}},{ 0x1044a, {1, {0x10422 }}},{ 0x1044b, {1, {0x10423 }}},{ 0x1044c, {1, {0x10424 }}},{ 0x1044d, {1, {0x10425 }}},{ 0x1044e, {1, {0x10426 }}},{ 0x1044f, {1, {0x10427 }}}};static const CaseUnfold_11_Type CaseUnfold_11_Locale[] = {{ 0x0069, {1, {0x0049 }}}};static const CaseUnfold_12_Type CaseUnfold_12[] = {{ {0x0061, 0x02be}, {1, {0x1e9a }}},{ {0x0066, 0x0066}, {1, {0xfb00 }}},{ {0x0066, 0x0069}, {1, {0xfb01 }}},{ {0x0066, 0x006c}, {1, {0xfb02 }}},{ {0x0068, 0x0331}, {1, {0x1e96 }}},{ {0x006a, 0x030c}, {1, {0x01f0 }}},{ {0x0073, 0x0073}, {1, {0x00df }}},{ {0x0073, 0x0074}, {2, {0xfb05, 0xfb06 }}},{ {0x0074, 0x0308}, {1, {0x1e97 }}},{ {0x0077, 0x030a}, {1, {0x1e98 }}},{ {0x0079, 0x030a}, {1, {0x1e99 }}},{ {0x02bc, 0x006e}, {1, {0x0149 }}},{ {0x03ac, 0x03b9}, {1, {0x1fb4 }}},{ {0x03ae, 0x03b9}, {1, {0x1fc4 }}},{ {0x03b1, 0x0342}, {1, {0x1fb6 }}},{ {0x03b1, 0x03b9}, {2, {0x1fb3, 0x1fbc }}},{ {0x03b7, 0x0342}, {1, {0x1fc6 }}},{ {0x03b7, 0x03b9}, {2, {0x1fc3, 0x1fcc }}},{ {0x03b9, 0x0342}, {1, {0x1fd6 }}},{ {0x03c1, 0x0313}, {1, {0x1fe4 }}},{ {0x03c5, 0x0313}, {1, {0x1f50 }}},{ {0x03c5, 0x0342}, {1, {0x1fe6 }}},{ {0x03c9, 0x0342}, {1, {0x1ff6 }}},{ {0x03c9, 0x03b9}, {2, {0x1ff3, 0x1ffc }}},{ {0x03ce, 0x03b9}, {1, {0x1ff4 }}},{ {0x0565, 0x0582}, {1, {0x0587 }}},{ {0x0574, 0x0565}, {1, {0xfb14 }}},{ {0x0574, 0x056b}, {1, {0xfb15 }}},{ {0x0574, 0x056d}, {1, {0xfb17 }}},{ {0x0574, 0x0576}, {1, {0xfb13 }}},{ {0x057e, 0x0576}, {1, {0xfb16 }}},{ {0x1f00, 0x03b9}, {2, {0x1f88, 0x1f80 }}},{ {0x1f01, 0x03b9}, {2, {0x1f81, 0x1f89 }}},{ {0x1f02, 0x03b9}, {2, {0x1f82, 0x1f8a }}},{ {0x1f03, 0x03b9}, {2, {0x1f83, 0x1f8b }}},{ {0x1f04, 0x03b9}, {2, {0x1f84, 0x1f8c }}},{ {0x1f05, 0x03b9}, {2, {0x1f85, 0x1f8d }}},{ {0x1f06, 0x03b9}, {2, {0x1f86, 0x1f8e }}},{ {0x1f07, 0x03b9}, {2, {0x1f87, 0x1f8f }}},{ {0x1f20, 0x03b9}, {2, {0x1f90, 0x1f98 }}},{ {0x1f21, 0x03b9}, {2, {0x1f91, 0x1f99 }}},{ {0x1f22, 0x03b9}, {2, {0x1f92, 0x1f9a }}},{ {0x1f23, 0x03b9}, {2, {0x1f93, 0x1f9b }}},{ {0x1f24, 0x03b9}, {2, {0x1f94, 0x1f9c }}},{ {0x1f25, 0x03b9}, {2, {0x1f95, 0x1f9d }}},{ {0x1f26, 0x03b9}, {2, {0x1f96, 0x1f9e }}},{ {0x1f27, 0x03b9}, {2, {0x1f97, 0x1f9f }}},{ {0x1f60, 0x03b9}, {2, {0x1fa0, 0x1fa8 }}},{ {0x1f61, 0x03b9}, {2, {0x1fa1, 0x1fa9 }}},{ {0x1f62, 0x03b9}, {2, {0x1fa2, 0x1faa }}},{ {0x1f63, 0x03b9}, {2, {0x1fa3, 0x1fab }}},{ {0x1f64, 0x03b9}, {2, {0x1fa4, 0x1fac }}},{ {0x1f65, 0x03b9}, {2, {0x1fa5, 0x1fad }}},{ {0x1f66, 0x03b9}, {2, {0x1fa6, 0x1fae }}},{ {0x1f67, 0x03b9}, {2, {0x1fa7, 0x1faf }}},{ {0x1f70, 0x03b9}, {1, {0x1fb2 }}},{ {0x1f74, 0x03b9}, {1, {0x1fc2 }}},{ {0x1f7c, 0x03b9}, {1, {0x1ff2 }}}};static const CaseUnfold_12_Type CaseUnfold_12_Locale[] = {{ {0x0069, 0x0307}, {1, {0x0130 }}}};static const CaseUnfold_13_Type CaseUnfold_13[] = {{ {0x0066, 0x0066, 0x0069}, {1, {0xfb03 }}},{ {0x0066, 0x0066, 0x006c}, {1, {0xfb04 }}},{ {0x03b1, 0x0342, 0x03b9}, {1, {0x1fb7 }}},{ {0x03b7, 0x0342, 0x03b9}, {1, {0x1fc7 }}},{ {0x03b9, 0x0308, 0x0300}, {1, {0x1fd2 }}},{ {0x03b9, 0x0308, 0x0301}, {2, {0x0390, 0x1fd3 }}},{ {0x03b9, 0x0308, 0x0342}, {1, {0x1fd7 }}},{ {0x03c5, 0x0308, 0x0300}, {1, {0x1fe2 }}},{ {0x03c5, 0x0308, 0x0301}, {2, {0x03b0, 0x1fe3 }}},{ {0x03c5, 0x0308, 0x0342}, {1, {0x1fe7 }}},{ {0x03c5, 0x0313, 0x0300}, {1, {0x1f52 }}},{ {0x03c5, 0x0313, 0x0301}, {1, {0x1f54 }}},{ {0x03c5, 0x0313, 0x0342}, {1, {0x1f56 }}},{ {0x03c9, 0x0342, 0x03b9}, {1, {0x1ff7 }}}};static PosixBracketEntryType HashEntryData[] = {{ (UChar* )"NEWLINE", 0, 7 },{ (UChar* )"Alpha", 1, 5 },{ (UChar* )"Blank", 2, 5 },{ (UChar* )"Cntrl", 3, 5 },{ (UChar* )"Digit", 4, 5 },{ (UChar* )"Graph", 5, 5 },{ (UChar* )"Lower", 6, 5 },{ (UChar* )"Print", 7, 5 },{ (UChar* )"Punct", 8, 5 },{ (UChar* )"Space", 9, 5 },{ (UChar* )"Upper", 10, 5 },{ (UChar* )"XDigit", 11, 6 },{ (UChar* )"Word", 12, 4 },{ (UChar* )"Alnum", 13, 5 },{ (UChar* )"ASCII", 14, 5 },#ifdef USE_UNICODE_PROPERTIES{ (UChar* )"Any", 15, 3 },{ (UChar* )"Assigned", 16, 8 },{ (UChar* )"C", 17, 1 },{ (UChar* )"Cc", 18, 2 },{ (UChar* )"Cf", 19, 2 },{ (UChar* )"Cn", 20, 2 },{ (UChar* )"Co", 21, 2 },{ (UChar* )"Cs", 22, 2 },{ (UChar* )"L", 23, 1 },{ (UChar* )"Ll", 24, 2 },{ (UChar* )"Lm", 25, 2 },{ (UChar* )"Lo", 26, 2 },{ (UChar* )"Lt", 27, 2 },{ (UChar* )"Lu", 28, 2 },{ (UChar* )"M", 29, 1 },{ (UChar* )"Mc", 30, 2 },{ (UChar* )"Me", 31, 2 },{ (UChar* )"Mn", 32, 2 },{ (UChar* )"N", 33, 1 },{ (UChar* )"Nd", 34, 2 },{ (UChar* )"Nl", 35, 2 },{ (UChar* )"No", 36, 2 },{ (UChar* )"P", 37, 1 },{ (UChar* )"Pc", 38, 2 },{ (UChar* )"Pd", 39, 2 },{ (UChar* )"Pe", 40, 2 },{ (UChar* )"Pf", 41, 2 },{ (UChar* )"Pi", 42, 2 },{ (UChar* )"Po", 43, 2 },{ (UChar* )"Ps", 44, 2 },{ (UChar* )"S", 45, 1 },{ (UChar* )"Sc", 46, 2 },{ (UChar* )"Sk", 47, 2 },{ (UChar* )"Sm", 48, 2 },{ (UChar* )"So", 49, 2 },{ (UChar* )"Z", 50, 1 },{ (UChar* )"Zl", 51, 2 },{ (UChar* )"Zp", 52, 2 },{ (UChar* )"Zs", 53, 2 },{ (UChar* )"Arabic", 54, 6 },{ (UChar* )"Armenian", 55, 8 },{ (UChar* )"Bengali", 56, 7 },{ (UChar* )"Bopomofo", 57, 8 },{ (UChar* )"Braille", 58, 7 },{ (UChar* )"Buginese", 59, 8 },{ (UChar* )"Buhid", 60, 5 },{ (UChar* )"Canadian_Aboriginal", 61, 19 },{ (UChar* )"Cherokee", 62, 8 },{ (UChar* )"Common", 63, 6 },{ (UChar* )"Coptic", 64, 6 },{ (UChar* )"Cypriot", 65, 7 },{ (UChar* )"Cyrillic", 66, 8 },{ (UChar* )"Deseret", 67, 7 },{ (UChar* )"Devanagari", 68, 10 },{ (UChar* )"Ethiopic", 69, 8 },{ (UChar* )"Georgian", 70, 8 },{ (UChar* )"Glagolitic", 71, 10 },{ (UChar* )"Gothic", 72, 6 },{ (UChar* )"Greek", 73, 5 },{ (UChar* )"Gujarati", 74, 8 },{ (UChar* )"Gurmukhi", 75, 8 },{ (UChar* )"Han", 76, 3 },{ (UChar* )"Hangul", 77, 6 },{ (UChar* )"Hanunoo", 78, 7 },{ (UChar* )"Hebrew", 79, 6 },{ (UChar* )"Hiragana", 80, 8 },{ (UChar* )"Inherited", 81, 9 },{ (UChar* )"Kannada", 82, 7 },{ (UChar* )"Katakana", 83, 8 },{ (UChar* )"Kharoshthi", 84, 10 },{ (UChar* )"Khmer", 85, 5 },{ (UChar* )"Lao", 86, 3 },{ (UChar* )"Latin", 87, 5 },{ (UChar* )"Limbu", 88, 5 },{ (UChar* )"Linear_B", 89, 8 },{ (UChar* )"Malayalam", 90, 9 },{ (UChar* )"Mongolian", 91, 9 },{ (UChar* )"Myanmar", 92, 7 },{ (UChar* )"New_Tai_Lue", 93, 11 },{ (UChar* )"Ogham", 94, 5 },{ (UChar* )"Old_Italic", 95, 10 },{ (UChar* )"Old_Persian", 96, 11 },{ (UChar* )"Oriya", 97, 5 },{ (UChar* )"Osmanya", 98, 7 },{ (UChar* )"Runic", 99, 5 },{ (UChar* )"Shavian", 100, 7 },{ (UChar* )"Sinhala", 101, 7 },{ (UChar* )"Syloti_Nagri", 102, 12 },{ (UChar* )"Syriac", 103, 6 },{ (UChar* )"Tagalog", 104, 7 },{ (UChar* )"Tagbanwa", 105, 8 },{ (UChar* )"Tai_Le", 106, 6 },{ (UChar* )"Tamil", 107, 5 },{ (UChar* )"Telugu", 108, 6 },{ (UChar* )"Thaana", 109, 6 },{ (UChar* )"Thai", 110, 4 },{ (UChar* )"Tibetan", 111, 7 },{ (UChar* )"Tifinagh", 112, 8 },{ (UChar* )"Ugaritic", 113, 8 },{ (UChar* )"Yi", 114, 2 },#endif /* USE_UNICODE_PROPERTIES */{ (UChar* )NULL, -1, 0 }};#ifdef USE_UNICODE_PROPERTIES#define CODE_RANGES_NUM 115#else#define CODE_RANGES_NUM 15#endifstatic const OnigCodePoint* CodeRanges[CODE_RANGES_NUM];static int CodeRangeTableInited = 0;static void init_code_range_array(void) {THREAD_ATOMIC_START;CodeRanges[0] = CR_NEWLINE;CodeRanges[1] = CR_Alpha;CodeRanges[2] = CR_Blank;CodeRanges[3] = CR_Cntrl;CodeRanges[4] = CR_Digit;CodeRanges[5] = CR_Graph;CodeRanges[6] = CR_Lower;CodeRanges[7] = CR_Print;CodeRanges[8] = CR_Punct;CodeRanges[9] = CR_Space;CodeRanges[10] = CR_Upper;CodeRanges[11] = CR_XDigit;CodeRanges[12] = CR_Word;CodeRanges[13] = CR_Alnum;CodeRanges[14] = CR_ASCII;#ifdef USE_UNICODE_PROPERTIESCodeRanges[15] = CR_Any;CodeRanges[16] = CR_Assigned;CodeRanges[17] = CR_C;CodeRanges[18] = CR_Cc;CodeRanges[19] = CR_Cf;CodeRanges[20] = CR_Cn;CodeRanges[21] = CR_Co;CodeRanges[22] = CR_Cs;CodeRanges[23] = CR_L;CodeRanges[24] = CR_Ll;CodeRanges[25] = CR_Lm;CodeRanges[26] = CR_Lo;CodeRanges[27] = CR_Lt;CodeRanges[28] = CR_Lu;CodeRanges[29] = CR_M;CodeRanges[30] = CR_Mc;CodeRanges[31] = CR_Me;CodeRanges[32] = CR_Mn;CodeRanges[33] = CR_N;CodeRanges[34] = CR_Nd;CodeRanges[35] = CR_Nl;CodeRanges[36] = CR_No;CodeRanges[37] = CR_P;CodeRanges[38] = CR_Pc;CodeRanges[39] = CR_Pd;CodeRanges[40] = CR_Pe;CodeRanges[41] = CR_Pf;CodeRanges[42] = CR_Pi;CodeRanges[43] = CR_Po;CodeRanges[44] = CR_Ps;CodeRanges[45] = CR_S;CodeRanges[46] = CR_Sc;CodeRanges[47] = CR_Sk;CodeRanges[48] = CR_Sm;CodeRanges[49] = CR_So;CodeRanges[50] = CR_Z;CodeRanges[51] = CR_Zl;CodeRanges[52] = CR_Zp;CodeRanges[53] = CR_Zs;CodeRanges[54] = CR_Arabic;CodeRanges[55] = CR_Armenian;CodeRanges[56] = CR_Bengali;CodeRanges[57] = CR_Bopomofo;CodeRanges[58] = CR_Braille;CodeRanges[59] = CR_Buginese;CodeRanges[60] = CR_Buhid;CodeRanges[61] = CR_Canadian_Aboriginal;CodeRanges[62] = CR_Cherokee;CodeRanges[63] = CR_Common;CodeRanges[64] = CR_Coptic;CodeRanges[65] = CR_Cypriot;CodeRanges[66] = CR_Cyrillic;CodeRanges[67] = CR_Deseret;CodeRanges[68] = CR_Devanagari;CodeRanges[69] = CR_Ethiopic;CodeRanges[70] = CR_Georgian;CodeRanges[71] = CR_Glagolitic;CodeRanges[72] = CR_Gothic;CodeRanges[73] = CR_Greek;CodeRanges[74] = CR_Gujarati;CodeRanges[75] = CR_Gurmukhi;CodeRanges[76] = CR_Han;CodeRanges[77] = CR_Hangul;CodeRanges[78] = CR_Hanunoo;CodeRanges[79] = CR_Hebrew;CodeRanges[80] = CR_Hiragana;CodeRanges[81] = CR_Inherited;CodeRanges[82] = CR_Kannada;CodeRanges[83] = CR_Katakana;CodeRanges[84] = CR_Kharoshthi;CodeRanges[85] = CR_Khmer;CodeRanges[86] = CR_Lao;CodeRanges[87] = CR_Latin;CodeRanges[88] = CR_Limbu;CodeRanges[89] = CR_Linear_B;CodeRanges[90] = CR_Malayalam;CodeRanges[91] = CR_Mongolian;CodeRanges[92] = CR_Myanmar;CodeRanges[93] = CR_New_Tai_Lue;CodeRanges[94] = CR_Ogham;CodeRanges[95] = CR_Old_Italic;CodeRanges[96] = CR_Old_Persian;CodeRanges[97] = CR_Oriya;CodeRanges[98] = CR_Osmanya;CodeRanges[99] = CR_Runic;CodeRanges[100] = CR_Shavian;CodeRanges[101] = CR_Sinhala;CodeRanges[102] = CR_Syloti_Nagri;CodeRanges[103] = CR_Syriac;CodeRanges[104] = CR_Tagalog;CodeRanges[105] = CR_Tagbanwa;CodeRanges[106] = CR_Tai_Le;CodeRanges[107] = CR_Tamil;CodeRanges[108] = CR_Telugu;CodeRanges[109] = CR_Thaana;CodeRanges[110] = CR_Thai;CodeRanges[111] = CR_Tibetan;CodeRanges[112] = CR_Tifinagh;CodeRanges[113] = CR_Ugaritic;CodeRanges[114] = CR_Yi;#endif /* USE_UNICODE_PROPERTIES */CodeRangeTableInited = 1;THREAD_ATOMIC_END;}extern intonigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype){if (#ifdef USE_UNICODE_PROPERTIESctype <= ONIGENC_MAX_STD_CTYPE &&#endifcode < 256) {return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype);}if (ctype >= CODE_RANGES_NUM) {return ONIGERR_TYPE_BUG;}if (CodeRangeTableInited == 0) init_code_range_array();return onig_is_in_code_range((UChar* )CodeRanges[ctype], code);}extern intonigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]){if (ctype >= CODE_RANGES_NUM) {return ONIGERR_TYPE_BUG;}if (CodeRangeTableInited == 0) init_code_range_array();*ranges = CodeRanges[ctype];return 0;}extern intonigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,const OnigCodePoint* ranges[]){*sb_out = 0x00;return onigenc_unicode_ctype_code_range(ctype, ranges);}#include "st.h"#define PROPERTY_NAME_MAX_SIZE 20static st_table* NameCtypeTable;static int NameTableInited = 0;static int init_name_ctype_table(void){PosixBracketEntryType *pb;THREAD_ATOMIC_START;NameCtypeTable = onig_st_init_strend_table_with_size(100);if (ONIG_IS_NULL(NameCtypeTable)) return ONIGERR_MEMORY;for (pb = HashEntryData; ONIG_IS_NOT_NULL(pb->name); pb++) {onig_st_insert_strend(NameCtypeTable, pb->name, pb->name + pb->len,(st_data_t )pb->ctype);}NameTableInited = 1;THREAD_ATOMIC_END;return 0;}extern intonigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end){int len;hash_data_type ctype;UChar buf[PROPERTY_NAME_MAX_SIZE];UChar *p;OnigCodePoint code;p = name;len = 0;while (p < end) {code = ONIGENC_MBC_TO_CODE(enc, p, end);if (code >= 0x80)return ONIGERR_INVALID_CHAR_PROPERTY_NAME;buf[len++] = (UChar )code;if (len >= PROPERTY_NAME_MAX_SIZE)return ONIGERR_INVALID_CHAR_PROPERTY_NAME;p += enclen(enc, p);}buf[len] = 0;if (NameTableInited == 0) init_name_ctype_table();if (onig_st_lookup_strend(NameCtypeTable, buf, buf + len, &ctype) == 0) {return ONIGERR_INVALID_CHAR_PROPERTY_NAME;}return (int )ctype;}static intcode2_cmp(OnigCodePoint* x, OnigCodePoint* y){if (x[0] == y[0] && x[1] == y[1]) return 0;return 1;}static intcode2_hash(OnigCodePoint* x){return (int )(x[0] + x[1]);}static struct st_hash_type type_code2_hash = {code2_cmp,code2_hash,};static intcode3_cmp(OnigCodePoint* x, OnigCodePoint* y){if (x[0] == y[0] && x[1] == y[1] && x[2] == y[2]) return 0;return 1;}static intcode3_hash(OnigCodePoint* x){return (int )(x[0] + x[1] + x[2]);}static struct st_hash_type type_code3_hash = {code3_cmp,code3_hash,};static st_table* FoldTable; /* fold-1, fold-2, fold-3 */static st_table* Unfold1Table;static st_table* Unfold2Table;static st_table* Unfold3Table;static int CaseFoldInited = 0;static int init_case_fold_table(void){const CaseFold_11_Type *p;const CaseUnfold_11_Type *p1;const CaseUnfold_12_Type *p2;const CaseUnfold_13_Type *p3;int i;THREAD_ATOMIC_START;FoldTable = st_init_numtable_with_size(1200);if (ONIG_IS_NULL(FoldTable)) return ONIGERR_MEMORY;for (i = 0; i < (int )(sizeof(CaseFold)/sizeof(CaseFold_11_Type)); i++) {p = &CaseFold[i];st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));}for (i = 0; i < (int )(sizeof(CaseFold_Locale)/sizeof(CaseFold_11_Type));i++) {p = &CaseFold_Locale[i];st_add_direct(FoldTable, (st_data_t )p->from, (st_data_t )&(p->to));}Unfold1Table = st_init_numtable_with_size(1000);if (ONIG_IS_NULL(Unfold1Table)) return ONIGERR_MEMORY;for (i = 0; i < (int )(sizeof(CaseUnfold_11)/sizeof(CaseUnfold_11_Type));i++) {p1 = &CaseUnfold_11[i];st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));}for (i = 0;i < (int )(sizeof(CaseUnfold_11_Locale)/sizeof(CaseUnfold_11_Type));i++) {p1 = &CaseUnfold_11_Locale[i];st_add_direct(Unfold1Table, (st_data_t )p1->from, (st_data_t )&(p1->to));}Unfold2Table = st_init_table_with_size(&type_code2_hash, 200);if (ONIG_IS_NULL(Unfold2Table)) return ONIGERR_MEMORY;for (i = 0; i < (int )(sizeof(CaseUnfold_12)/sizeof(CaseUnfold_12_Type));i++) {p2 = &CaseUnfold_12[i];st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));}for (i = 0;i < (int )(sizeof(CaseUnfold_12_Locale)/sizeof(CaseUnfold_12_Type));i++) {p2 = &CaseUnfold_12_Locale[i];st_add_direct(Unfold2Table, (st_data_t )p2->from, (st_data_t )(&p2->to));}Unfold3Table = st_init_table_with_size(&type_code3_hash, 30);if (ONIG_IS_NULL(Unfold3Table)) return ONIGERR_MEMORY;for (i = 0; i < (int )(sizeof(CaseUnfold_13)/sizeof(CaseUnfold_13_Type));i++) {p3 = &CaseUnfold_13[i];st_add_direct(Unfold3Table, (st_data_t )p3->from, (st_data_t )(&p3->to));}CaseFoldInited = 1;THREAD_ATOMIC_END;return 0;}extern intonigenc_unicode_mbc_case_fold(OnigEncoding enc,OnigCaseFoldType flag ARG_UNUSED, const UChar** pp, const UChar* end,UChar* fold){CodePointList3 *to;OnigCodePoint code;int i, len, rlen;const UChar *p = *pp;if (CaseFoldInited == 0) init_case_fold_table();code = ONIGENC_MBC_TO_CODE(enc, p, end);len = enclen(enc, p);*pp += len;#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (code == 0x0049) {return ONIGENC_CODE_TO_MBC(enc, 0x0131, fold);}else if (code == 0x0130) {return ONIGENC_CODE_TO_MBC(enc, 0x0069, fold);}}#endifif (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {if (to->n == 1) {return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold);}#if 0/* NO NEEDS TO CHECK */else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {#elseelse {#endifrlen = 0;for (i = 0; i < to->n; i++) {len = ONIGENC_CODE_TO_MBC(enc, to->code[i], fold);fold += len;rlen += len;}return rlen;}}for (i = 0; i < len; i++) {*fold++ = *p++;}return len;}extern intonigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){const CaseUnfold_11_Type* p11;OnigCodePoint code;int i, j, k, r;/* if (CaseFoldInited == 0) init_case_fold_table(); */for (i = 0; i < (int )(sizeof(CaseUnfold_11)/sizeof(CaseUnfold_11_Type));i++) {p11 = &CaseUnfold_11[i];for (j = 0; j < p11->to.n; j++) {code = p11->from;r = (*f)(p11->to.code[j], &code, 1, arg);if (r != 0) return r;code = p11->to.code[j];r = (*f)(p11->from, &code, 1, arg);if (r != 0) return r;for (k = 0; k < j; k++) {r = (*f)(p11->to.code[j], (OnigCodePoint* )(&p11->to.code[k]), 1, arg);if (r != 0) return r;r = (*f)(p11->to.code[k], (OnigCodePoint* )(&p11->to.code[j]), 1, arg);if (r != 0) return r;}}}#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {code = 0x0131;r = (*f)(0x0049, &code, 1, arg);if (r != 0) return r;code = 0x0049;r = (*f)(0x0131, &code, 1, arg);if (r != 0) return r;code = 0x0130;r = (*f)(0x0069, &code, 1, arg);if (r != 0) return r;code = 0x0069;r = (*f)(0x0130, &code, 1, arg);if (r != 0) return r;}else {#endiffor (i = 0;i < (int )(sizeof(CaseUnfold_11_Locale)/sizeof(CaseUnfold_11_Type));i++) {p11 = &CaseUnfold_11_Locale[i];for (j = 0; j < p11->to.n; j++) {code = p11->from;r = (*f)(p11->to.code[j], &code, 1, arg);if (r != 0) return r;code = p11->to.code[j];r = (*f)(p11->from, &code, 1, arg);if (r != 0) return r;for (k = 0; k < j; k++) {r = (*f)(p11->to.code[j], (OnigCodePoint* )(&p11->to.code[k]),1, arg);if (r != 0) return r;r = (*f)(p11->to.code[k], (OnigCodePoint* )(&p11->to.code[j]),1, arg);if (r != 0) return r;}}}#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI}#endifif ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {for (i = 0; i < (int )(sizeof(CaseUnfold_12)/sizeof(CaseUnfold_12_Type));i++) {for (j = 0; j < CaseUnfold_12[i].to.n; j++) {r = (*f)(CaseUnfold_12[i].to.code[j],(OnigCodePoint* )CaseUnfold_12[i].from, 2, arg);if (r != 0) return r;for (k = 0; k < CaseUnfold_12[i].to.n; k++) {if (k == j) continue;r = (*f)(CaseUnfold_12[i].to.code[j],(OnigCodePoint* )(&CaseUnfold_12[i].to.code[k]), 1, arg);if (r != 0) return r;}}}#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) == 0) {#endiffor (i = 0;i < (int )(sizeof(CaseUnfold_12_Locale)/sizeof(CaseUnfold_12_Type));i++) {for (j = 0; j < CaseUnfold_12_Locale[i].to.n; j++) {r = (*f)(CaseUnfold_12_Locale[i].to.code[j],(OnigCodePoint* )CaseUnfold_12_Locale[i].from, 2, arg);if (r != 0) return r;for (k = 0; k < CaseUnfold_12_Locale[i].to.n; k++) {if (k == j) continue;r = (*f)(CaseUnfold_12_Locale[i].to.code[j],(OnigCodePoint* )(&CaseUnfold_12_Locale[i].to.code[k]),1, arg);if (r != 0) return r;}}}#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI}#endiffor (i = 0; i < (int )(sizeof(CaseUnfold_13)/sizeof(CaseUnfold_13_Type));i++) {for (j = 0; j < CaseUnfold_13[i].to.n; j++) {r = (*f)(CaseUnfold_13[i].to.code[j],(OnigCodePoint* )CaseUnfold_13[i].from, 3, arg);if (r != 0) return r;for (k = 0; k < CaseUnfold_13[i].to.n; k++) {if (k == j) continue;r = (*f)(CaseUnfold_13[i].to.code[j],(OnigCodePoint* )(&CaseUnfold_13[i].to.code[k]), 1, arg);if (r != 0) return r;}}}}return 0;}extern intonigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end,OnigCaseFoldCodeItem items[]){int n, i, j, k, len;OnigCodePoint code, codes[3];CodePointList3 *to, *z3;CodePointList2 *z2;if (CaseFoldInited == 0) init_case_fold_table();n = 0;code = ONIGENC_MBC_TO_CODE(enc, p, end);len = enclen(enc, p);#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (code == 0x0049) {items[0].byte_len = len;items[0].code_len = 1;items[0].code[0] = 0x0131;return 1;}else if (code == 0x0130) {items[0].byte_len = len;items[0].code_len = 1;items[0].code[0] = 0x0069;return 1;}else if (code == 0x0131) {items[0].byte_len = len;items[0].code_len = 1;items[0].code[0] = 0x0049;return 1;}else if (code == 0x0069) {items[0].byte_len = len;items[0].code_len = 1;items[0].code[0] = 0x0130;return 1;}}#endifif (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {if (to->n == 1) {OnigCodePoint orig_code = code;items[0].byte_len = len;items[0].code_len = 1;items[0].code[0] = to->code[0];n++;code = to->code[0];if (onig_st_lookup(Unfold1Table, (st_data_t )code, (void* )&to) != 0) {for (i = 0; i < to->n; i++) {if (to->code[i] != orig_code) {items[n].byte_len = len;items[n].code_len = 1;items[n].code[0] = to->code[i];n++;}}}}else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {OnigCodePoint cs[3][4];int fn, ncs[3];for (fn = 0; fn < to->n; fn++) {cs[fn][0] = to->code[fn];if (onig_st_lookup(Unfold1Table, (st_data_t )cs[fn][0],(void* )&z3) != 0) {for (i = 0; i < z3->n; i++) {cs[fn][i+1] = z3->code[i];}ncs[fn] = z3->n + 1;}elsencs[fn] = 1;}if (fn == 2) {for (i = 0; i < ncs[0]; i++) {for (j = 0; j < ncs[1]; j++) {items[n].byte_len = len;items[n].code_len = 2;items[n].code[0] = cs[0][i];items[n].code[1] = cs[1][j];n++;}}if (onig_st_lookup(Unfold2Table, (st_data_t )to->code,(void* )&z2) != 0) {for (i = 0; i < z2->n; i++) {if (z2->code[i] == code) continue;items[n].byte_len = len;items[n].code_len = 1;items[n].code[0] = z2->code[i];n++;}}}else {for (i = 0; i < ncs[0]; i++) {for (j = 0; j < ncs[1]; j++) {for (k = 0; k < ncs[2]; k++) {items[n].byte_len = len;items[n].code_len = 3;items[n].code[0] = cs[0][i];items[n].code[1] = cs[1][j];items[n].code[2] = cs[2][k];n++;}}}if (onig_st_lookup(Unfold3Table, (st_data_t )to->code,(void* )&z2) != 0) {for (i = 0; i < z2->n; i++) {if (z2->code[i] == code) continue;items[n].byte_len = len;items[n].code_len = 1;items[n].code[0] = z2->code[i];n++;}}}/* multi char folded code is not head of another folded multi char */flag = 0; /* DISABLE_CASE_FOLD_MULTI_CHAR(flag); */}}else {if (onig_st_lookup(Unfold1Table, (st_data_t )code, (void* )&to) != 0) {for (i = 0; i < to->n; i++) {items[n].byte_len = len;items[n].code_len = 1;items[n].code[0] = to->code[i];n++;}}}if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {p += len;if (p < end) {int clen;codes[0] = code;code = ONIGENC_MBC_TO_CODE(enc, p, end);if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0&& to->n == 1) {codes[1] = to->code[0];}elsecodes[1] = code;clen = enclen(enc, p);len += clen;if (onig_st_lookup(Unfold2Table, (st_data_t )codes, (void* )&z2) != 0) {for (i = 0; i < z2->n; i++) {items[n].byte_len = len;items[n].code_len = 1;items[n].code[0] = z2->code[i];n++;}}p += clen;if (p < end) {code = ONIGENC_MBC_TO_CODE(enc, p, end);if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0&& to->n == 1) {codes[2] = to->code[0];}elsecodes[2] = code;clen = enclen(enc, p);len += clen;if (onig_st_lookup(Unfold3Table, (st_data_t )codes,(void* )&z2) != 0) {for (i = 0; i < z2->n; i++) {items[n].byte_len = len;items[n].code_len = 1;items[n].code[0] = z2->code[i];n++;}}}}}return n;}
/**********************************************************************utf16_be.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static const int EncLen_UTF16[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};static intutf16be_mbc_enc_len(const UChar* p){return EncLen_UTF16[*p];}static intutf16be_is_mbc_newline(const UChar* p, const UChar* end){if (p + 1 < end) {if (*(p+1) == 0x0a && *p == 0x00)return 1;#ifdef USE_UNICODE_ALL_LINE_TERMINATORSif ((#ifndef USE_CRNL_AS_LINE_TERMINATOR*(p+1) == 0x0d ||#endif*(p+1) == 0x85) && *p == 0x00)return 1;if (*p == 0x20 && (*(p+1) == 0x29 || *(p+1) == 0x28))return 1;#endif}return 0;}static OnigCodePointutf16be_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED){OnigCodePoint code;if (UTF16_IS_SURROGATE_FIRST(*p)) {code = ((((p[0] - 0xd8) << 2) + ((p[1] & 0xc0) >> 6) + 1) << 16)+ ((((p[1] & 0x3f) << 2) + (p[2] - 0xdc)) << 8)+ p[3];}else {code = p[0] * 256 + p[1];}return code;}static intutf16be_code_to_mbclen(OnigCodePoint code){return (code > 0xffff ? 4 : 2);}static intutf16be_code_to_mbc(OnigCodePoint code, UChar *buf){UChar* p = buf;if (code > 0xffff) {unsigned int plane, high;plane = (code >> 16) - 1;*p++ = (plane >> 2) + 0xd8;high = (code & 0xff00) >> 8;*p++ = ((plane & 0x03) << 6) + (high >> 2);*p++ = (high & 0x03) + 0xdc;*p = (UChar )(code & 0xff);return 4;}else {*p++ = (UChar )((code & 0xff00) >> 8);*p++ = (UChar )(code & 0xff);return 2;}}static intutf16be_mbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end, UChar* fold){const UChar* p = *pp;if (ONIGENC_IS_ASCII_CODE(*(p+1)) && *p == 0) {p++;#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (*p == 0x49) {*fold++ = 0x01;*fold = 0x31;(*pp) += 2;return 2;}}#endif*fold++ = 0;*fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);*pp += 2;return 2;}elsereturn onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF16_BE, flag,pp, end, fold);}#if 0static intutf16be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){const UChar* p = *pp;(*pp) += EncLen_UTF16[*p];if (*p == 0) {int c, v;p++;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {return TRUE;}c = *p;v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,(BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */if (c >= 0xaa && c <= 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}return FALSE;}#endifstatic UChar*utf16be_left_adjust_char_head(const UChar* start, const UChar* s){if (s <= start) return (UChar* )s;if ((s - start) % 2 == 1) {s--;}if (UTF16_IS_SURROGATE_SECOND(*s) && s > start + 1)s -= 2;return (UChar* )s;}static intutf16be_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF16_BE,flag, p, end, items);}OnigEncodingType OnigEncodingUTF16_BE = {utf16be_mbc_enc_len,"UTF-16BE", /* name */4, /* max byte length */2, /* min byte length */utf16be_is_mbc_newline,utf16be_mbc_to_code,utf16be_code_to_mbclen,utf16be_code_to_mbc,utf16be_mbc_case_fold,onigenc_unicode_apply_all_case_fold,utf16be_get_case_fold_codes_by_str,onigenc_unicode_property_name_to_ctype,onigenc_unicode_is_code_ctype,onigenc_utf16_32_get_ctype_code_range,utf16be_left_adjust_char_head,onigenc_always_false_is_allowed_reverse_match};
/**********************************************************************utf16_le.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static const int EncLen_UTF16[] = {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};static intutf16le_code_to_mbclen(OnigCodePoint code){return (code > 0xffff ? 4 : 2);}static intutf16le_mbc_enc_len(const UChar* p){return EncLen_UTF16[*(p+1)];}static intutf16le_is_mbc_newline(const UChar* p, const UChar* end){if (p + 1 < end) {if (*p == 0x0a && *(p+1) == 0x00)return 1;#ifdef USE_UNICODE_ALL_LINE_TERMINATORSif ((#ifndef USE_CRNL_AS_LINE_TERMINATOR*p == 0x0d ||#endif*p == 0x85) && *(p+1) == 0x00)return 1;if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28))return 1;#endif}return 0;}static OnigCodePointutf16le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED){OnigCodePoint code;UChar c0 = *p;UChar c1 = *(p+1);if (UTF16_IS_SURROGATE_FIRST(c1)) {code = ((((c1 - 0xd8) << 2) + ((c0 & 0xc0) >> 6) + 1) << 16)+ ((((c0 & 0x3f) << 2) + (p[3] - 0xdc)) << 8)+ p[2];}else {code = c1 * 256 + p[0];}return code;}static intutf16le_code_to_mbc(OnigCodePoint code, UChar *buf){UChar* p = buf;if (code > 0xffff) {unsigned int plane, high;plane = (code >> 16) - 1;high = (code & 0xff00) >> 8;*p++ = ((plane & 0x03) << 6) + (high >> 2);*p++ = (plane >> 2) + 0xd8;*p++ = (UChar )(code & 0xff);*p = (high & 0x03) + 0xdc;return 4;}else {*p++ = (UChar )(code & 0xff);*p++ = (UChar )((code & 0xff00) >> 8);return 2;}}static intutf16le_mbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end, UChar* fold){const UChar* p = *pp;if (ONIGENC_IS_ASCII_CODE(*p) && *(p+1) == 0) {#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (*p == 0x49) {*fold++ = 0x31;*fold = 0x01;(*pp) += 2;return 2;}}#endif*fold++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);*fold = 0;*pp += 2;return 2;}elsereturn onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF16_LE, flag, pp, end,fold);}#if 0static intutf16le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp,const UChar* end){const UChar* p = *pp;(*pp) += EncLen_UTF16[*(p+1)];if (*(p+1) == 0) {int c, v;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {return TRUE;}c = *p;v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,(BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */if (c >= 0xaa && c <= 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}return FALSE;}#endifstatic UChar*utf16le_left_adjust_char_head(const UChar* start, const UChar* s){if (s <= start) return (UChar* )s;if ((s - start) % 2 == 1) {s--;}if (UTF16_IS_SURROGATE_SECOND(*(s+1)) && s > start + 1)s -= 2;return (UChar* )s;}static intutf16le_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF16_LE,flag, p, end, items);}OnigEncodingType OnigEncodingUTF16_LE = {utf16le_mbc_enc_len,"UTF-16LE", /* name */4, /* max byte length */2, /* min byte length */utf16le_is_mbc_newline,utf16le_mbc_to_code,utf16le_code_to_mbclen,utf16le_code_to_mbc,utf16le_mbc_case_fold,onigenc_unicode_apply_all_case_fold,utf16le_get_case_fold_codes_by_str,onigenc_unicode_property_name_to_ctype,onigenc_unicode_is_code_ctype,onigenc_utf16_32_get_ctype_code_range,utf16le_left_adjust_char_head,onigenc_always_false_is_allowed_reverse_match};
/**********************************************************************utf32_be.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static intutf32be_mbc_enc_len(const UChar* p ARG_UNUSED){return 4;}static intutf32be_is_mbc_newline(const UChar* p, const UChar* end){if (p + 3 < end) {if (*(p+3) == 0x0a && *(p+2) == 0 && *(p+1) == 0 && *p == 0)return 1;#ifdef USE_UNICODE_ALL_LINE_TERMINATORSif ((#ifndef USE_CRNL_AS_LINE_TERMINATOR*(p+3) == 0x0d ||#endif*(p+3) == 0x85)&& *(p+2) == 0 && *(p+1) == 0 && *p == 0x00)return 1;if (*(p+2) == 0x20 && (*(p+3) == 0x29 || *(p+3) == 0x28)&& *(p+1) == 0 && *p == 0)return 1;#endif}return 0;}static OnigCodePointutf32be_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED){return (OnigCodePoint )(((p[0] * 256 + p[1]) * 256 + p[2]) * 256 + p[3]);}static intutf32be_code_to_mbclen(OnigCodePoint code ARG_UNUSED){return 4;}static intutf32be_code_to_mbc(OnigCodePoint code, UChar *buf){UChar* p = buf;*p++ = (UChar )((code & 0xff000000) >>24);*p++ = (UChar )((code & 0xff0000) >>16);*p++ = (UChar )((code & 0xff00) >> 8);*p++ = (UChar ) (code & 0xff);return 4;}static intutf32be_mbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end, UChar* fold){const UChar* p = *pp;if (ONIGENC_IS_ASCII_CODE(*(p+3)) && *(p+2) == 0 && *(p+1) == 0 && *p == 0) {*fold++ = 0;*fold++ = 0;#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (*(p+3) == 0x49) {*fold++ = 0x01;*fold = 0x31;(*pp) += 4;return 4;}}#endif*fold++ = 0;*fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*(p+3));*pp += 4;return 4;}elsereturn onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_BE, flag, pp, end,fold);}#if 0static intutf32be_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){const UChar* p = *pp;(*pp) += 4;if (*(p+2) == 0 && *(p+1) == 0 && *p == 0) {int c, v;p += 3;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {return TRUE;}c = *p;v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,(BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */if (c >= 0xaa && c <= 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}return FALSE;}#endifstatic UChar*utf32be_left_adjust_char_head(const UChar* start, const UChar* s){int rem;if (s <= start) return (UChar* )s;rem = (s - start) % 4;return (UChar* )(s - rem);}static intutf32be_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF32_BE,flag, p, end, items);}OnigEncodingType OnigEncodingUTF32_BE = {utf32be_mbc_enc_len,"UTF-32BE", /* name */4, /* max byte length */4, /* min byte length */utf32be_is_mbc_newline,utf32be_mbc_to_code,utf32be_code_to_mbclen,utf32be_code_to_mbc,utf32be_mbc_case_fold,onigenc_unicode_apply_all_case_fold,utf32be_get_case_fold_codes_by_str,onigenc_unicode_property_name_to_ctype,onigenc_unicode_is_code_ctype,onigenc_utf16_32_get_ctype_code_range,utf32be_left_adjust_char_head,onigenc_always_false_is_allowed_reverse_match};
/**********************************************************************utf32_le.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"static intutf32le_mbc_enc_len(const UChar* p ARG_UNUSED){return 4;}static intutf32le_is_mbc_newline(const UChar* p, const UChar* end){if (p + 3 < end) {if (*p == 0x0a && *(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0)return 1;#ifdef USE_UNICODE_ALL_LINE_TERMINATORSif ((#ifndef USE_CRNL_AS_LINE_TERMINATOR*p == 0x0d ||#endif*p == 0x85)&& *(p+1) == 0x00 && (p+2) == 0x00 && *(p+3) == 0x00)return 1;if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28)&& *(p+2) == 0x00 && *(p+3) == 0x00)return 1;#endif}return 0;}static OnigCodePointutf32le_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED){return (OnigCodePoint )(((p[3] * 256 + p[2]) * 256 + p[1]) * 256 + p[0]);}static intutf32le_code_to_mbclen(OnigCodePoint code ARG_UNUSED){return 4;}static intutf32le_code_to_mbc(OnigCodePoint code, UChar *buf){UChar* p = buf;*p++ = (UChar ) (code & 0xff);*p++ = (UChar )((code & 0xff00) >> 8);*p++ = (UChar )((code & 0xff0000) >>16);*p++ = (UChar )((code & 0xff000000) >>24);return 4;}static intutf32le_mbc_case_fold(OnigCaseFoldType flag,const UChar** pp, const UChar* end, UChar* fold){const UChar* p = *pp;if (ONIGENC_IS_ASCII_CODE(*p) && *(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) {#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (*p == 0x49) {*fold++ = 0x31;*fold++ = 0x01;}}else {#endif*fold++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);*fold++ = 0;#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI}#endif*fold++ = 0;*fold = 0;*pp += 4;return 4;}elsereturn onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_LE, flag, pp, end,fold);}#if 0static intutf32le_is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){const UChar* p = *pp;(*pp) += 4;if (*(p+1) == 0 && *(p+2) == 0 && *(p+3) == 0) {int c, v;if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {return TRUE;}c = *p;v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,(BIT_CTYPE_UPPER | BIT_CTYPE_LOWER));if ((v | BIT_CTYPE_LOWER) != 0) {/* 0xaa, 0xb5, 0xba are lower case letter, but can't convert. */if (c >= 0xaa && c <= 0xba)return FALSE;elsereturn TRUE;}return (v != 0 ? TRUE : FALSE);}return FALSE;}#endifstatic UChar*utf32le_left_adjust_char_head(const UChar* start, const UChar* s){int rem;if (s <= start) return (UChar* )s;rem = (s - start) % 4;return (UChar* )(s - rem);}static intutf32le_get_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF32_LE,flag, p, end, items);}OnigEncodingType OnigEncodingUTF32_LE = {utf32le_mbc_enc_len,"UTF-32LE", /* name */4, /* max byte length */4, /* min byte length */utf32le_is_mbc_newline,utf32le_mbc_to_code,utf32le_code_to_mbclen,utf32le_code_to_mbc,utf32le_mbc_case_fold,onigenc_unicode_apply_all_case_fold,utf32le_get_case_fold_codes_by_str,onigenc_unicode_property_name_to_ctype,onigenc_unicode_is_code_ctype,onigenc_utf16_32_get_ctype_code_range,utf32le_left_adjust_char_head,onigenc_always_false_is_allowed_reverse_match};
/**********************************************************************utf8.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regenc.h"#define USE_INVALID_CODE_SCHEME#ifdef USE_INVALID_CODE_SCHEME/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */#define INVALID_CODE_FE 0xfffffffe#define INVALID_CODE_FF 0xffffffff#define VALID_CODE_LIMIT 0x7fffffff#endif#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80)static const int EncLen_UTF8[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1};static intmbc_enc_len(const UChar* p){return EncLen_UTF8[*p];}static intis_mbc_newline(const UChar* p, const UChar* end){if (p < end) {if (*p == 0x0a) return 1;#ifdef USE_UNICODE_ALL_LINE_TERMINATORS#ifndef USE_CRNL_AS_LINE_TERMINATORif (*p == 0x0d) return 1;#endifif (p + 1 < end) {if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */return 1;if (p + 2 < end) {if ((*(p+2) == 0xa8 || *(p+2) == 0xa9)&& *(p+1) == 0x80 && *p == 0xe2) /* U+2028, U+2029 */return 1;}}#endif}return 0;}static OnigCodePointmbc_to_code(const UChar* p, const UChar* end ARG_UNUSED){int c, len;OnigCodePoint n;len = enclen(ONIG_ENCODING_UTF8, p);c = *p++;if (len > 1) {len--;n = c & ((1 << (6 - len)) - 1);while (len--) {c = *p++;n = (n << 6) | (c & ((1 << 6) - 1));}return n;}else {#ifdef USE_INVALID_CODE_SCHEMEif (c > 0xfd) {return ((c == 0xfe) ? INVALID_CODE_FE : INVALID_CODE_FF);}#endifreturn (OnigCodePoint )c;}}static intcode_to_mbclen(OnigCodePoint code){if ((code & 0xffffff80) == 0) return 1;else if ((code & 0xfffff800) == 0) return 2;else if ((code & 0xffff0000) == 0) return 3;else if ((code & 0xffe00000) == 0) return 4;else if ((code & 0xfc000000) == 0) return 5;else if ((code & 0x80000000) == 0) return 6;#ifdef USE_INVALID_CODE_SCHEMEelse if (code == INVALID_CODE_FE) return 1;else if (code == INVALID_CODE_FF) return 1;#endifelsereturn ONIGERR_INVALID_CODE_POINT_VALUE;}static intcode_to_mbc(OnigCodePoint code, UChar *buf){#define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80)#define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80)if ((code & 0xffffff80) == 0) {*buf = (UChar )code;return 1;}else {UChar *p = buf;if ((code & 0xfffff800) == 0) {*p++ = (UChar )(((code>>6)& 0x1f) | 0xc0);}else if ((code & 0xffff0000) == 0) {*p++ = (UChar )(((code>>12) & 0x0f) | 0xe0);*p++ = UTF8_TRAILS(code, 6);}else if ((code & 0xffe00000) == 0) {*p++ = (UChar )(((code>>18) & 0x07) | 0xf0);*p++ = UTF8_TRAILS(code, 12);*p++ = UTF8_TRAILS(code, 6);}else if ((code & 0xfc000000) == 0) {*p++ = (UChar )(((code>>24) & 0x03) | 0xf8);*p++ = UTF8_TRAILS(code, 18);*p++ = UTF8_TRAILS(code, 12);*p++ = UTF8_TRAILS(code, 6);}else if ((code & 0x80000000) == 0) {*p++ = (UChar )(((code>>30) & 0x01) | 0xfc);*p++ = UTF8_TRAILS(code, 24);*p++ = UTF8_TRAILS(code, 18);*p++ = UTF8_TRAILS(code, 12);*p++ = UTF8_TRAILS(code, 6);}#ifdef USE_INVALID_CODE_SCHEMEelse if (code == INVALID_CODE_FE) {*p = 0xfe;return 1;}else if (code == INVALID_CODE_FF) {*p = 0xff;return 1;}#endifelse {return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;}*p++ = UTF8_TRAIL0(code);return p - buf;}}static intmbc_case_fold(OnigCaseFoldType flag, const UChar** pp,const UChar* end, UChar* fold){const UChar* p = *pp;if (ONIGENC_IS_MBC_ASCII(p)) {#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERIif ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {if (*p == 0x49) {*fold++ = 0xc4;*fold = 0xb1;(*pp)++;return 2;}}#endif*fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);(*pp)++;return 1; /* return byte length of converted char to lower */}else {return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF8, flag,pp, end, fold);}}#if 0static intis_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end){const UChar* p = *pp;if (ONIGENC_IS_MBC_ASCII(p)) {(*pp)++;return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);}else {(*pp) += enclen(ONIG_ENCODING_UTF8, p);if (*p == 0xc3) {int c = *(p + 1);if (c >= 0x80) {if (c <= (UChar )0x9e) { /* upper */if (c == (UChar )0x97) return FALSE;return TRUE;}else if (c >= (UChar )0xa0 && c <= (UChar )0xbe) { /* lower */if (c == (UChar )'\267') return FALSE;return TRUE;}else if (c == (UChar )0x9f &&(flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {return TRUE;}}}}return FALSE;}#endifstatic intget_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out,const OnigCodePoint* ranges[]){*sb_out = 0x80;return onigenc_unicode_ctype_code_range(ctype, ranges);}static UChar*left_adjust_char_head(const UChar* start, const UChar* s){const UChar *p;if (s <= start) return (UChar* )s;p = s;while (!utf8_islead(*p) && p > start) p--;return (UChar* )p;}static intget_case_fold_codes_by_str(OnigCaseFoldType flag,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF8,flag, p, end, items);}OnigEncodingType OnigEncodingUTF8 = {mbc_enc_len,"UTF-8", /* name */6, /* max byte length */1, /* min byte length */is_mbc_newline,mbc_to_code,code_to_mbclen,code_to_mbc,mbc_case_fold,onigenc_unicode_apply_all_case_fold,get_case_fold_codes_by_str,onigenc_unicode_property_name_to_ctype,onigenc_unicode_is_code_ctype,get_ctype_code_range,left_adjust_char_head,onigenc_always_true_is_allowed_reverse_match};
<html><head><meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=x-sjis"><title>Oniguruma</title></head><body BGCOLOR="#ffffff" VLINK="#808040" TEXT="#696969"><h1>Oniguruma</h1> (<a href="index_ja.html">Japanese</a>)<p>(c) K.Kosako, updated at: 2010/01/09</p><dl><font color="orange"><dt><b>What's new</b></font><ul><li>2010/01/09: Version 5.9.2 released.</li><li>2007/08/16: Version 4.7.1 released.</li><li>2007/06/20: Version 2.5.9 released.</li><li>2007/06/20: Maintainer of 2.x was changed.</li></ul></dl><hr><p>Oniguruma is a regular expressions library.<br>The characteristics of this library is that different character encoding<br>for every regular expression object can be specified.<br>(supported APIs: GNU regex, POSIX and Oniguruma native)</p><dl><dt><b>Supported character encodings:</b><br>ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,<br>EUC-JP, EUC-TW, EUC-KR, EUC-CN,<br>Shift_JIS, Big5, GB18030, KOI8-R, CP1251,<br>ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,<br>ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,<br>ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16<br><font color="orange">(GB18030 encoding was contributed by KUBO Takehiro)<br>(CP1251 encoding was contributed by Byte)</font></p></dl><hr><dt><b>License:</b> BSD license.<dl><dt><b>Platform:</b><ul><li> Unix (include Mac OS X)<li> Cygwin<li> Win32</ul><br><dt><b>Download:</b><ul><li> <a href="archive/onig-5.9.2.tar.gz">Latest release version 5.9.2</a> (2010/01/09) <a href="HISTORY_5X.txt">Change Log</a><li> <a href="archive/onig-5.9.1.tar.gz">5.9.1</a> (2007/12/22)<li> <a href="archive/onig-4.7.1.tar.gz">Latest release version 4.7.1</a> (2007/08/16) <a href="HISTORY_4X.txt">Change Log</a><li> <a href="archive/onig-4.7.0.tar.gz">4.7.0</a> (2007/06/18)<li> <a href="archive/onigd2_5_9.tar.gz">Latest release version 2.5.9</a> (2007/06/20) <a href="HISTORY_2X.txt">Change Log</a></ul><br><font color="red">Maintainer of 2.x was changed to Hannes Wyss <hwyss AT ywesee.com>.<br>About 2.x, please contact him.<br></font>* 5.x supports Unicode Property/Script.<br>* 2.x supports Ruby1.6/1.8.<br><br><dt><b>Documents:</b> (version 5.9.2)<ul><li> <a href="doc/RE.txt">Regular Expressions</a><a href="doc/RE.ja.txt">(Japanese: EUC-JP)</a><li> <a href="doc/API.txt">Oniguruma API</a><a href="doc/API.ja.txt">(Japanese: EUC-JP)</a></ul><br><dt><b>Sample Programs:</b><ul><li><a href="sample/simple.c">example of the minimum</a><li><a href="sample/sql.c">example of the variable syntax and meta character (SQL-like pattern match)</a></ul><br><dt><b>Site Links:</b><ul><li> <a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/">FreeBSD ports</a><li> <a href="http://www.softantenna.com/lib/1953/index.html">SoftAntenna > Lib > Oniguruma</a> (Japanese page)</ul><br><dt><b>Links:</b><ul><li> <a href="http://homepage3.nifty.com/k-takata/mysoft/bregonig.html">bregonig.dll (Win32)</a> (Japanese page)<li> <a href="http://www.halbiz.com/osaru/cnregex.html">cnRegex 4D Plugin (Mac OS X)</a> (Japanese page)<li> <a href="http://kmaebashi.com/">crowbar</a> (Japanese page)<li> <a href="http://oniguruma5.darwinports.com">Darwin Ports (Mac OS X)</a><li> <a href="http://homepage2.nifty.com/Km/onig.htm">Delphi interface (Win32)</a> (Japanese page)<li> <a href="http://pyxis-project.net/ensemble/">Ensemble (Mac OS X)</a> (Japanese page)<li> <a href="http://www.srcw.net/FaEdit/">FaEdit (Win32)</a> (Japanese page)<li> <a href="http://www.tom.sfc.keio.ac.jp/~sakai/d/?date=20050209">GHC patch</a> Masahiro Sakai (Japanese Blog)<li> <a href="http://www.gyazsquare.com/gyazmail/index.php">GyazMail (Mac OS X)</a><li> <a href="http://www5d.biglobe.ne.jp/~f-taste/knt3/jcref3.html">J-cref v3</a> (Japanese page)<li> <a href="http://www.artman21.net/">Jedit X (Mac OS X)</a><li> <a href="http://www.chitora.jp/lhaz.html">Lhaz (Win32)</a> (Japanese page)<li> <a href="http://limechat.net/">LimeChat</a> (Japanese page)<li> <a href="http://medb.enhiro.com/">meDB</a> (Japanese page)<li> <a href="http://monaos.org/">Mona OS</a><li> <a href="http://mongoose.jp/">mongoose</a> (Japanese page)<li> <a href="http://www.irori.org/tool/mregexp.html">mregexp</a> (Japanese page)<li> <a href="http://ochusha.sourceforge.jp/">Ochusha</a> (Japanese page)<li> <a href="http://www8.ocn.ne.jp/%7esonoisa/OgreKit/index.html">OgreKit (Mac OS X)</a> Regular Expression Framework for Cocoa (Japanese page)<li> <a href="http://www.kanetaka.net/4dapi/wiki4d.dll/4dcgi/wiki.cgi?plugins-oniguruma">OnigRegexp</a> (Japanese page)<li> <a href="http://rubyforge.org/projects/oniguruma">Oniguruma for Ruby</a><li> <a href="http://openspace.timedia.co.jp/~yasuyuki/wiliki/wiliki.cgi?Oniguruma-mysqld&l=jp">Oniguruma-mysqld</a><li> <a href="http://www.void.in/wiki/OnigPP">OnigPP</a> (Japanese page)<li> <a href="http://www.kt.rim.or.jp/~kbk/sed/index.html">Onigsed (Win32)</a> (Japanese page)<li> <a href="http://glozer.net/code.html#oregexp">oregexp</a> Erlang binding<li> <a href="http://www.kt.rim.or.jp/~kbk/yagrep/index.html">yagrep (Win32)</a> (Japanese page)<li> <a href="http://www.php.gr.jp/">Japan PHP User Group</a> PHP 5.0 mb_ereg (Japanese page)<li> <a href="http://yatsu.info/wiki/Pufui/">Pufui (Mac OS X)</a> (Japanese page)<li> <a href="http://ultrapop.jp/?q2ch">q2ch</a> (Japanese page)<li> <a href="http://search.cpan.org/~andya/re-engine-Oniguruma">re-engine-Oniguruma</a><li> <a href="http://harumune.s56.xrea.com/assari/index.php?RSSTyping">RSSTyping</a> (Japanese page)<li> <a href="http://tobysoft.net/wiki/index.php?Ruby%2Fruby-win32-oniguruma">ruby-win32-oniguruma</a> (Japanese page)<li> <a href="http://quux.s74.xrea.com/">SevenFour (Mac OS X)</a> (Japanese page)<li> <a href="http://storklab.cyber-ninja.jp/">Stork Lab. Products (Mac OS X)</a> (Japanese page)<li> <a href="http://sourceforge.jp/projects/ttssh2/">TeraTerm (Win32)</a><li> <a href="http://www8.ocn.ne.jp/~sonoisa/TiddlyWikiPod/">TiddlyWikiPod (Mac OS X)</a><li> <a href="http://www.cyanworks.net/mac.html">TunesTEXT (Mac OS X)</a><li> <a href="http://sourceforge.jp/projects/frogger/">XML parser</a><li> <a href="http://www.yokkasoft.net/">YokkaSoft (Win32)</a> (Japanese page)<li> <a href="http://www.hi-ho.ne.jp/kuze/tool.htm">Zed (Win32)</a> (Japanese page)</ul><br><dt><b>References:</b><ul><li> <a href="http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=%C0%B5%B5%AC%C9%BD%B8%BD">Ruby Reference Manual Regexp</a> (Japanese page)<li> <a href="http://www.perl.com/doc/manual/html/pod/perlre.html">Perl regular expressions</a><li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html">java.util.regex.Pattern (J2SE 1.4.2)</a><li> <a href="http://www.opengroup.org/onlinepubs/007908799/xbd/re.html">The Open Group</a><li> <a href="http://regex.info/">Mastering Regular Expressions</a><li> <a href="http://www.unicode.org/">Unicode Home Page</a><li> <a href="http://www.kt.rim.or.jp/~kbk/regex/regex.html">Regular expressions memo</a> (Japanese page)<li> <a href="http://www.din.or.jp/~ohzaki/regex.htm">Regular expressions technique</a> (Japanese page)</ul><br></dl><p>and I'm thankful to Akinori MUSHA.</p><hr><dl><dt><b>Other Libraries:</b><ul><li> <a href="http://www.boost.org/libs/regex/doc/">Boost.Regex</a><li> <a href="http://arglist.com/regex/">A copy of Henry Spencer's</a><li> <a href="http://directory.fsf.org/regex.html">GNU regex</a><li> <a href="http://www.pcre.org/">PCRE</a><li> <a href="http://re2c.org/">re2c</a><li> <a href="http://tiny-rex.sourceforge.net/">T-Rex</a><li> <a href="http://laurikari.net/tre/">TRE</a><li> <a href="http://svn.codehaus.org/jruby/joni/">Joni (Java)</a><li> <a href="http://jregex.sourceforge.net/">JRegex (Java)</a><li> <a href="http://www.cacas.org/java/gnu/regexp/">gnu.regexp for Java</a><li> <a href="http://jakarta.apache.org/regexp/index.html">Jakarta Project Regexp</a><li> <a href="http://jakarta.apache.org/oro/">Jakarta Project ORO</a><li> <a href="http://sourceforge.jp/projects/onig4j/">Oniguruma for Java</a></ul></dl></body></html>
<html><head><meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=utf-8"><title>鬼車</title></head><body BGCOLOR="#ffffff" VLINK="#808040" TEXT="#696969"><h1>鬼車</h1><p>(c) K.Kosako, 最終更新: 2010/01/09</p><dl><font color="orange"><dt><b>更新情報</b></font><ul><li>2010/01/09: Version 5.9.2 リリース</li><li>2007/08/16: Version 4.7.1 リリース</li><li>2007/06/20: Version 2.5.9 リリース</li><li>2007/06/20: 2.xの保守担当者を変更</li></ul></dl><hr><p>鬼車は正規表現ライブラリである。<br>このライブラリの特徴は、それぞれの正規表現オブジェクトごとに異なる文字エンコーディングを指定できること。<br>(API: GNU regex, POSIX and Oniguruma native)</p><dl><dt><b>対応している文字エンコーディング:</b><br>ASCII, UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE,<br>EUC-JP, EUC-TW, EUC-KR, EUC-CN,<br>Shift_JIS, Big5, GB18030, KOI8-R, CP1251,<br>ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5,<br>ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10,<br>ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16<br><font color="orange">(GB18030は、KUBO Takehiro氏提供)<br>(CP1251は、Byte氏提供)</font></p></dl><hr><dt><b>ライセンス:</b>BSDライセンス<dl><dt><b>プラットフォーム:</b><ul><li> Unix (Mac OS Xを含む)<li> Cygwin<li> Win32</ul><br><dt><b>ダウンロード:</b><ul><li> <a href="archive/onig-5.9.2.tar.gz">5.9.2 最新版</a> (2010/01/09) <a href="HISTORY_5X.txt">更新履歴</a><li> <a href="archive/onig-5.9.1.tar.gz">5.9.1</a> (2007/12/22)<li> <a href="archive/onig-4.7.1.tar.gz">4.7.1 最新版</a> (2007/08/16) <a href="HISTORY_4X.txt">更新履歴</a><li> <a href="archive/onig-4.7.0.tar.gz">4.7.0</a> (2007/06/18)<li> <a href="archive/onigd2_5_9.tar.gz">2.5.9 最新版</a> (2007/06/20) <a href="HISTORY_2X.txt">更新履歴</a></ul><br><font color="red">2.xの保守担当は、Hannes Wyss <hwyss AT ywesee.com>に交替しました。<br>2.xについては、彼に連絡してください。<br></font>* 5.xはUnicode Property/Scriptを提供<br>* 2.xはRuby1.6/1.8組込みライブラリとして動作する。 (2006年末で保守を終了)<br><br><dt><b>ドキュメント:</b> (version 5.9.2)<ul><li> <a href="doc/RE.txt">正規表現</a><a href="doc/RE.ja.txt">(日本語: EUC-JP)</a><li> <a href="doc/API.txt">鬼車API</a><a href="doc/API.ja.txt">(日本語: EUC-JP)</a></ul><br><dt><b>サンプルプログラム:</b><ul><li><a href="sample/simple.c">最小使用例</a><li><a href="sample/sql.c">可変文法と可変メタ文字機能使用例(SQL-like pattern match)</a></ul><br><dt><b>サイト:</b><ul><li> <a href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/">FreeBSD ports</a><li> <a href="http://www.softantenna.com/lib/1953/index.html">SoftAntenna > Lib > Oniguruma</a> (日本語)</ul><br><dt><b>リンク:</b><ul><li> <a href="http://homepage3.nifty.com/k-takata/mysoft/bregonig.html">bregonig.dll (Win32)</a> (日本語)<li> <a href="http://www.halbiz.com/osaru/cnregex.html">cnRegex 4D Plugin (Mac OS X)</a> (日本語)<li> <a href="http://kmaebashi.com/">crowbar</a> (日本語)<li> <a href="http://oniguruma5.darwinports.com">Darwin Ports (Mac OS X)</a><li> <a href="http://homepage2.nifty.com/Km/onig.htm">Delphi interface (Win32)</a> (日本語)<li> <a href="http://pyxis-project.net/ensemble/">Ensemble (Mac OS X)</a> (日本語)<li> <a href="http://www.srcw.net/FaEdit/">FaEdit (Win32)</a> (日本語)<li> <a href="http://www.tom.sfc.keio.ac.jp/~sakai/d/?date=20050209">GHC patch</a> Masahiro Sakai (Japanese Blog)<li> <a href="http://www.gyazsquare.com/gyazmail/index.php">GyazMail (Mac OS X)</a><li> <a href="http://www5d.biglobe.ne.jp/~f-taste/knt3/jcref3.html">J-cref v3</a> (日本語)<li> <a href="http://www.artman21.net/">Jedit X (Mac OS X)</a><li> <a href="http://www.chitora.jp/lhaz.html">Lhaz (Win32)</a> (日本語)<li> <a href="http://limechat.net/">LimeChat</a> (日本語)<li> <a href="http://medb.enhiro.com/">meDB</a> (日本語)<li> <a href="http://monaos.org/">Mona OS</a><li> <a href="http://mongoose.jp/">mongoose</a> (日本語)<li> <a href="http://www.irori.org/tool/mregexp.html">mregexp</a> (日本語)<li> <a href="http://ochusha.sourceforge.jp/">おちゅ〜しゃ</a> (日本語)<li> <a href="http://www8.ocn.ne.jp/%7esonoisa/OgreKit/index.html">OgreKit (Mac OS X)</a> Regular Expression Framework for Cocoa (日本語)<li> <a href="http://www.kanetaka.net/4dapi/wiki4d.dll/4dcgi/wiki.cgi?plugins-oniguruma">OnigRegexp</a> (日本語)<li> <a href="http://rubyforge.org/projects/oniguruma">Oniguruma for Ruby</a><li> <a href="http://openspace.timedia.co.jp/~yasuyuki/wiliki/wiliki.cgi?Oniguruma-mysqld&l=jp">Oniguruma-mysqld</a><li> <a href="http://www.void.in/wiki/OnigPP">OnigPP</a> (日本語)<li> <a href="http://www.kt.rim.or.jp/~kbk/sed/index.html">Onigsed (Win32)</a> (日本語)<li> <a href="http://glozer.net/code.html#oregexp">oregexp</a> Erlang binding<li> <a href="http://www.kt.rim.or.jp/~kbk/yagrep/index.html">yagrep (Win32)</a> (日本語)<li> <a href="http://www.php.gr.jp/">日本PHPユーザ会</a> PHP 5.0 mb_ereg (日本語)<li> <a href="http://yatsu.info/wiki/Pufui/">Pufui (Mac OS X)</a> (日本語)<li> <a href="http://ultrapop.jp/?q2ch">q2ch</a> (日本語)<li> <a href="http://search.cpan.org/~andya/re-engine-Oniguruma">re-engine-Oniguruma</a><li> <a href="http://harumune.s56.xrea.com/assari/index.php?RSSTyping">RSSTyping</a> (日本語)<li> <a href="http://tobysoft.net/wiki/index.php?Ruby%2Fruby-win32-oniguruma">ruby-win32-oniguruma</a> (日本語)<li> <a href="http://quux.s74.xrea.com/">SevenFour (Mac OS X)</a> (日本語)<li> <a href="http://storklab.cyber-ninja.jp/">Stork Lab. Products (Mac OS X)</a> (日本語)<li> <a href="http://sourceforge.jp/projects/ttssh2/">TeraTerm (Win32)</a><li> <a href="http://www8.ocn.ne.jp/~sonoisa/TiddlyWikiPod/">TiddlyWikiPod (Mac OS X)</a><li> <a href="http://www.cyanworks.net/mac.html">TunesTEXT (Mac OS X)</a><li> <a href="http://sourceforge.jp/projects/frogger/">XML parser</a><li> <a href="http://www.yokkasoft.net/">YokkaSoft (Win32)</a> (日本語)<li> <a href="http://www.hi-ho.ne.jp/kuze/tool.htm">Zed (Win32)</a> (日本語)</ul><br><dt><b>参考資料:</b><ul><li> <a href="http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=%C0%B5%B5%AC%C9%BD%B8%BD">Rubyリファレンスマニュアル</a> (日本語)<li> <a href="http://www.perl.com/doc/manual/html/pod/perlre.html">Perl regular expressions</a><li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html">java.util.regex.Pattern (J2SE 1.4.2)</a><li> <a href="http://www.opengroup.org/onlinepubs/007908799/xbd/re.html">The Open Group</a><li> <a href="http://regex.info/">Mastering Regular Expressions</a><li> <a href="http://www.unicode.org/">Unicode Home Page</a><li> <a href="http://www.kt.rim.or.jp/~kbk/regex/regex.html">正規表現メモ</a> (日本語)<li> <a href="http://www.din.or.jp/~ohzaki/regex.htm">Perl正規表現雑技</a> (日本語)</ul><br></dl><p>and I'm thankful to Akinori MUSHA.</p><hr><dl><dt><b>他のライブラリ:</b><ul><li> <a href="http://www.boost.org/libs/regex/doc/">Boost.Regex</a><li> <a href="http://arglist.com/regex/">A copy of Henry Spencer's</a><li> <a href="http://directory.fsf.org/regex.html">GNU regex</a><li> <a href="http://www.pcre.org/">PCRE</a><li> <a href="http://re2c.org/">re2c</a><li> <a href="http://tiny-rex.sourceforge.net/">T-Rex</a><li> <a href="http://laurikari.net/tre/">TRE</a><li> <a href="http://svn.codehaus.org/jruby/joni/">Joni (Java)</a><li> <a href="http://jregex.sourceforge.net/">JRegex (Java)</a><li> <a href="http://www.cacas.org/java/gnu/regexp/">gnu.regexp for Java</a><li> <a href="http://jakarta.apache.org/regexp/index.html">Jakarta Project Regexp</a><li> <a href="http://jakarta.apache.org/oro/">Jakarta Project ORO</a><li> <a href="http://sourceforge.jp/projects/onig4j/">Oniguruma for Java</a></ul></dl><hr><a href="../">ホームにもどる</a></body></html>
#!/bin/sh# install - install a program, script, or datafilescriptversion=2006-10-14.15# This originates from X11R5 (mit/util/scripts/install.sh), which was# later released in X11R6 (xc/config/util/install.sh) with the# following copyright and license.## Copyright (C) 1994 X Consortium## Permission is hereby granted, free of charge, to any person obtaining a copy# of this software and associated documentation files (the "Software"), to# deal in the Software without restriction, including without limitation the# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or# sell copies of the Software, and to permit persons to whom the Software is# furnished to do so, subject to the following conditions:## The above copyright notice and this permission notice shall be included in# all copies or substantial portions of the Software.## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.## Except as contained in this notice, the name of the X Consortium shall not# be used in advertising or otherwise to promote the sale, use or other deal-# ings in this Software without prior written authorization from the X Consor-# tium.### FSF changes to this file are in the public domain.## Calling this script install-sh is preferred over install.sh, to prevent# `make' implicit rules from creating a file called install from it# when there is no Makefile.## This script is compatible with the BSD install script, but was written# from scratch.nl=''IFS=" "" $nl"# set DOITPROG to echo to test this script# Don't use :- since 4.3BSD and earlier shells don't like it.doit="${DOITPROG-}"if test -z "$doit"; thendoit_exec=execelsedoit_exec=$doitfi# Put in absolute file names if you don't have them in your path;# or use environment vars.mvprog="${MVPROG-mv}"cpprog="${CPPROG-cp}"chmodprog="${CHMODPROG-chmod}"chownprog="${CHOWNPROG-chown}"chgrpprog="${CHGRPPROG-chgrp}"stripprog="${STRIPPROG-strip}"rmprog="${RMPROG-rm}"mkdirprog="${MKDIRPROG-mkdir}"posix_glob=posix_mkdir=# Desired mode of installed file.mode=0755chmodcmd=$chmodprogchowncmd=chgrpcmd=stripcmd=rmcmd="$rmprog -f"mvcmd="$mvprog"src=dst=dir_arg=dstarg=no_target_directory=usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILEor: $0 [OPTION]... SRCFILES... DIRECTORYor: $0 [OPTION]... -t DIRECTORY SRCFILES...or: $0 [OPTION]... -d DIRECTORIES...In the 1st form, copy SRCFILE to DSTFILE.In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.In the 4th, create DIRECTORIES.Options:-c (ignored)-d create directories instead of installing files.-g GROUP $chgrpprog installed files to GROUP.-m MODE $chmodprog installed files to MODE.-o USER $chownprog installed files to USER.-s $stripprog installed files.-t DIRECTORY install into DIRECTORY.-T report an error if DSTFILE is a directory.--help display this help and exit.--version display version info and exit.Environment variables override the default commands:CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG"while test $# -ne 0; docase $1 in-c) shiftcontinue;;-d) dir_arg=trueshiftcontinue;;-g) chgrpcmd="$chgrpprog $2"shiftshiftcontinue;;--help) echo "$usage"; exit $?;;-m) mode=$2shiftshiftcase $mode in*' '* | *' '* | *''* | *'*'* | *'?'* | *'['*)echo "$0: invalid mode: $mode" >&2exit 1;;esaccontinue;;-o) chowncmd="$chownprog $2"shiftshiftcontinue;;-s) stripcmd=$stripprogshiftcontinue;;-t) dstarg=$2shiftshiftcontinue;;-T) no_target_directory=trueshiftcontinue;;--version) echo "$0 $scriptversion"; exit $?;;--) shiftbreak;;-*) echo "$0: invalid option: $1" >&2exit 1;;*) break;;esacdoneif test $# -ne 0 && test -z "$dir_arg$dstarg"; then# When -d is used, all remaining arguments are directories to create.# When -t is used, the destination is already specified.# Otherwise, the last argument is the destination. Remove it from $@.for argdoif test -n "$dstarg"; then# $@ is not empty: it contains at least $arg.set fnord "$@" "$dstarg"shift # fnordfishift # argdstarg=$argdonefiif test $# -eq 0; thenif test -z "$dir_arg"; thenecho "$0: no input file specified." >&2exit 1fi# It's OK to call `install-sh -d' without argument.# This can happen when creating conditional directories.exit 0fiif test -z "$dir_arg"; thentrap '(exit $?); exit' 1 2 13 15# Set umask so as not to create temps with too-generous modes.# However, 'strip' requires both read and write access to temps.case $mode in# Optimize common cases.*644) cp_umask=133;;*755) cp_umask=22;;*[0-7])if test -z "$stripcmd"; thenu_plus_rw=elseu_plus_rw='% 200'ficp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;*)if test -z "$stripcmd"; thenu_plus_rw=elseu_plus_rw=,u+rwficp_umask=$mode$u_plus_rw;;esacfifor srcdo# Protect names starting with `-'.case $src in-*) src=./$src ;;esacif test -n "$dir_arg"; thendst=$srcdstdir=$dsttest -d "$dstdir"dstdir_status=$?else# Waiting for this to be detected by the "$cpprog $src $dsttmp" command# might cause directories to be created, which would be especially bad# if $src (and thus $dsttmp) contains '*'.if test ! -f "$src" && test ! -d "$src"; thenecho "$0: $src does not exist." >&2exit 1fiif test -z "$dstarg"; thenecho "$0: no destination specified." >&2exit 1fidst=$dstarg# Protect names starting with `-'.case $dst in-*) dst=./$dst ;;esac# If destination is a directory, append the input filename; won't work# if double slashes aren't ignored.if test -d "$dst"; thenif test -n "$no_target_directory"; thenecho "$0: $dstarg: Is a directory" >&2exit 1fidstdir=$dstdst=$dstdir/`basename "$src"`dstdir_status=0else# Prefer dirname, but fall back on a substitute if dirname fails.dstdir=`(dirname "$dst") 2>/dev/null ||expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \X"$dst" : 'X\(//\)[^/]' \| \X"$dst" : 'X\(//\)$' \| \X"$dst" : 'X\(/\)' \| . 2>/dev/null ||echo X"$dst" |sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{s//\1/q}/^X\(\/\/\)[^/].*/{s//\1/q}/^X\(\/\/\)$/{s//\1/q}/^X\(\/\).*/{s//\1/q}s/.*/./; q'`test -d "$dstdir"dstdir_status=$?fifiobsolete_mkdir_used=falseif test $dstdir_status != 0; thencase $posix_mkdir in'')# Create intermediate dirs using mode 755 as modified by the umask.# This is like FreeBSD 'install' as of 1997-10-28.umask=`umask`case $stripcmd.$umask in# Optimize common cases.*[2367][2367]) mkdir_umask=$umask;;.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;*[0-7])mkdir_umask=`expr $umask + 22 \- $umask % 100 % 40 + $umask % 20 \- $umask % 10 % 4 + $umask % 2`;;*) mkdir_umask=$umask,go-w;;esac# With -d, create the new directory with the user-specified mode.# Otherwise, rely on $mkdir_umask.if test -n "$dir_arg"; thenmkdir_mode=-m$modeelsemkdir_mode=fiposix_mkdir=falsecase $umask in*[123567][0-7][0-7])# POSIX mkdir -p sets u+wx bits regardless of umask, which# is incompatible with FreeBSD 'install' when (umask & 300) != 0.;;*)tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0if (umask $mkdir_umask &&exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1thenif test -z "$dir_arg" || {# Check for POSIX incompatibilities with -m.# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or# other-writeable bit of parent directory when it shouldn't.# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.ls_ld_tmpdir=`ls -ld "$tmpdir"`case $ls_ld_tmpdir ind????-?r-*) different_mode=700;;d????-?--*) different_mode=755;;*) false;;esac &&$mkdirprog -m$different_mode -p -- "$tmpdir" && {ls_ld_tmpdir_1=`ls -ld "$tmpdir"`test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"}}then posix_mkdir=:firmdir "$tmpdir/d" "$tmpdir"else# Remove any dirs left behind by ancient mkdir implementations.rmdir ./$mkdir_mode ./-p ./-- 2>/dev/nullfitrap '' 0;;esac;;esacif$posix_mkdir && (umask $mkdir_umask &&$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir")then :else# The umask is ridiculous, or mkdir does not conform to POSIX,# or it failed possibly due to a race condition. Create the# directory the slow way, step by step, checking for races as we go.case $dstdir in/*) prefix=/ ;;-*) prefix=./ ;;*) prefix= ;;esaccase $posix_glob in'')if (set -f) 2>/dev/null; thenposix_glob=trueelseposix_glob=falsefi ;;esacoIFS=$IFSIFS=/$posix_glob && set -fset fnord $dstdirshift$posix_glob && set +fIFS=$oIFSprefixes=for ddotest -z "$d" && continueprefix=$prefix$dif test -d "$prefix"; thenprefixes=elseif $posix_mkdir; then(umask=$mkdir_umask &&$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break# Don't fail if two instances are running concurrently.test -d "$prefix" || exit 1elsecase $prefix in*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;*) qprefix=$prefix;;esacprefixes="$prefixes '$qprefix'"fifiprefix=$prefix/doneif test -n "$prefixes"; then# Don't fail if two instances are running concurrently.(umask $mkdir_umask &&eval "\$doit_exec \$mkdirprog $prefixes") ||test -d "$dstdir" || exit 1obsolete_mkdir_used=truefififiif test -n "$dir_arg"; then{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1else# Make a couple of temp file names in the proper directory.dsttmp=$dstdir/_inst.$$_rmtmp=$dstdir/_rm.$$_# Trap to clean up those temp files at exit.trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0# Copy the file name to the temp name.(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&# and set any options; do chmod last to preserve setuid bits.## If any of these fail, we abort the whole thing. If we want to# ignore errors from any of these, just make sure not to ignore# errors from the above "$doit $cpprog $src $dsttmp" command.#{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&# Now rename the file to the real destination.{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \|| {# The rename failed, perhaps because mv can't rename something else# to itself, or perhaps because mv is so ancient that it does not# support -f.# Now remove or move aside any old file at destination location.# We try this two ways since rm can't unlink itself on some# systems and the destination file might be busy for other# reasons. In this case, the final cleanup might fail but the new# file should still install successfully.{if test -f "$dst"; then$doit $rmcmd -f "$dst" 2>/dev/null \|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\|| {echo "$0: cannot unlink or rename $dst" >&2(exit 1); exit 1}else:fi} &&# Now rename the file to the real destination.$doit $mvcmd "$dsttmp" "$dst"}} || exit 1trap '' 0fidone# Local variables:# eval: (add-hook 'write-file-hooks 'time-stamp)# time-stamp-start: "scriptversion="# time-stamp-format: "%:y-%02m-%02d.%02H"# time-stamp-end: "$"# End:
# Generated from ltmain.m4sh.# ltmain.sh (GNU libtool) 2.2.4# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.# This is free software; see the source for copying conditions. There is NO# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.# GNU Libtool is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.## As a special exception to the GNU General Public License,# if you distribute this file as part of a program or library that# is built using GNU Libtool, you may include this file under the# same distribution terms that you use for the rest of that program.## GNU Libtool 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# General Public License for more details.## You should have received a copy of the GNU General Public License# along with GNU Libtool; see the file COPYING. If not, a copy# can be downloaded from http://www.gnu.org/licenses/gpl.html,# or obtained by writing to the Free Software Foundation, Inc.,# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.# Usage: $progname [OPTION]... [MODE-ARG]...## Provide generalized library-building support services.## --config show all configuration variables# --debug enable verbose shell tracing# -n, --dry-run display commands without modifying any files# --features display basic configuration information and exit# --mode=MODE use operation mode MODE# --preserve-dup-deps don't remove duplicate dependency libraries# --quiet, --silent don't print informational messages# --tag=TAG use configuration variables from tag TAG# -v, --verbose print informational messages (default)# --version print version information# -h, --help print short or long help message## MODE must be one of the following:## clean remove files from the build directory# compile compile a source file into a libtool object# execute automatically set library path, then run a program# finish complete the installation of libtool libraries# install install libraries or executables# link create a library or an executable# uninstall remove libraries from an installed directory## MODE-ARGS vary depending on the MODE.# Try `$progname --help --mode=MODE' for a more detailed description of MODE.## When reporting a bug, please describe a test case to reproduce it and# include the following information:## host-triplet: $host# shell: $SHELL# compiler: $LTCC# compiler flags: $LTCFLAGS# linker: $LD (gnu? $with_gnu_ld)# $progname: (GNU libtool) 2.2.4# automake: $automake_version# autoconf: $autoconf_version## Report bugs to <bug-libtool@gnu.org>.PROGRAM=ltmain.shPACKAGE=libtoolVERSION=2.2.4TIMESTAMP=""package_revision=1.2976# Be Bourne compatibleif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; thenemulate shNULLCMD=:# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which# is contrary to our usage. Disable this feature.alias -g '${1+"$@"}'='"$@"'setopt NO_GLOB_SUBSTelsecase `(set -o) 2>/dev/null` in *posix*) set -o posix;; esacfiBIN_SH=xpg4; export BIN_SH # for Tru64DUALCASE=1; export DUALCASE # for MKS sh# NLS nuisances: We save the old values to restore during execute mode.# Only set LANG and LC_ALL to C if already set.# These must not be set unconditionally because not all systems understand# e.g. LANG=C (notably SCO).lt_user_locale=lt_safe_locale=for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGESdoeval "if test \"\${$lt_var+set}\" = set; thensave_$lt_var=\$$lt_var$lt_var=Cexport $lt_varlt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"fi"done$lt_unset CDPATH: ${CP="cp -f"}: ${ECHO="echo"}: ${EGREP="/usr/bin/grep -E"}: ${FGREP="/usr/bin/grep -F"}: ${GREP="/usr/bin/grep"}: ${LN_S="ln -s"}: ${MAKE="make"}: ${MKDIR="mkdir"}: ${MV="mv -f"}: ${RM="rm -f"}: ${SED="/opt/local/bin/gsed"}: ${SHELL="${CONFIG_SHELL-/bin/sh}"}: ${Xsed="$SED -e 1s/^X//"}# Global variables:EXIT_SUCCESS=0EXIT_FAILURE=1EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.exit_status=$EXIT_SUCCESS# Make sure IFS has a sensible defaultlt_nl=''IFS=" $lt_nl"dirname="s,/[^/]*$,,"basename="s,^.*/,,"# func_dirname_and_basename file append nondir_replacement# perform func_basename and func_dirname in a single function# call:# dirname: Compute the dirname of FILE. If nonempty,# add APPEND to the result, otherwise set result# to NONDIR_REPLACEMENT.# value returned in "$func_dirname_result"# basename: Compute filename of FILE.# value retuned in "$func_basename_result"# Implementation must be kept synchronized with func_dirname# and func_basename. For efficiency, we do not delegate to# those functions but instead duplicate the functionality here.func_dirname_and_basename (){# Extract subdirectory from the argument.func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`if test "X$func_dirname_result" = "X${1}"; thenfunc_dirname_result="${3}"elsefunc_dirname_result="$func_dirname_result${2}"fifunc_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`}# Generated shell functions inserted here.# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh# is ksh but when the shell is invoked as "sh" and the current value of# the _XPG environment variable is not equal to 1 (one), the special# positional parameter $0, within a function call, is the name of the# function.progpath="$0"# The name of this program:# In the unlikely event $progname began with a '-', it would play havoc with# func_echo (imagine progname=-n), so we prepend ./ in that case:func_dirname_and_basename "$progpath"progname=$func_basename_resultcase $progname in-*) progname=./$progname ;;esac# Make sure we have an absolute path for reexecution:case $progpath in[\\/]*|[A-Za-z]:\\*) ;;*[\\/]*)progdir=$func_dirname_resultprogdir=`cd "$progdir" && pwd`progpath="$progdir/$progname";;*)save_IFS="$IFS"IFS=:for progdir in $PATH; doIFS="$save_IFS"test -x "$progdir/$progname" && breakdoneIFS="$save_IFS"test -n "$progdir" || progdir=`pwd`progpath="$progdir/$progname";;esac# Sed substitution that helps us do robust quoting. It backslashifies# metacharacters that are still active within double-quoted strings.Xsed="${SED}"' -e 1s/^X//'sed_quote_subst='s/\([`"$\\]\)/\\\1/g'# Same as above, but do not quote variable references.double_quote_subst='s/\(["`\\]\)/\\\1/g'# Re-`\' parameter expansions in output of double_quote_subst that were# `\'-ed in input to the same. If an odd number of `\' preceded a '$'# in input to double_quote_subst, that '$' was protected from expansion.# Since each input `\' is now two `\'s, look for any number of runs of# four `\'s followed by two `\'s and then a '$'. `\' that '$'.bs='\\'bs2='\\\\'bs4='\\\\\\\\'dollar='\$'sed_double_backslash="\s/$bs4/&\\/gs/^$bs2$dollar/$bs&/s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/gs/\n//g"# Standard options:opt_dry_run=falseopt_help=falseopt_quiet=falseopt_verbose=falseopt_warning=:# func_echo arg...# Echo program name prefixed message, along with the current mode# name if it has been set yet.func_echo (){$ECHO "$progname${mode+: }$mode: $*"}# func_verbose arg...# Echo program name prefixed message in verbose mode only.func_verbose (){$opt_verbose && func_echo ${1+"$@"}# A bug in bash halts the script if the last line of a function# fails when set -e is in force, so we need another command to# work around that::}# func_error arg...# Echo program name prefixed message to standard error.func_error (){$ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2}# func_warning arg...# Echo program name prefixed warning message to standard error.func_warning (){$opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2# bash bug again::}# func_fatal_error arg...# Echo program name prefixed message to standard error, and exit.func_fatal_error (){func_error ${1+"$@"}exit $EXIT_FAILURE}# func_fatal_help arg...# Echo program name prefixed message to standard error, followed by# a help hint, and exit.func_fatal_help (){func_error ${1+"$@"}func_fatal_error "$help"}help="Try \`$progname --help' for more information." ## default# func_grep expression filename# Check whether EXPRESSION matches any line of FILENAME, without output.func_grep (){$GREP "$1" "$2" >/dev/null 2>&1}# func_mkdir_p directory-path# Make sure the entire path to DIRECTORY-PATH is available.func_mkdir_p (){my_directory_path="$1"my_dir_list=if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then# Protect directory names starting with `-'case $my_directory_path in-*) my_directory_path="./$my_directory_path" ;;esac# While some portion of DIR does not yet exist...while test ! -d "$my_directory_path"; do# ...make a list in topmost first order. Use a colon delimited# list incase some portion of path contains whitespace.my_dir_list="$my_directory_path:$my_dir_list"# If the last portion added has no slash in it, the list is donecase $my_directory_path in */*) ;; *) break ;; esac# ...otherwise throw away the child directory and loopmy_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`donemy_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`save_mkdir_p_IFS="$IFS"; IFS=':'for my_dir in $my_dir_list; doIFS="$save_mkdir_p_IFS"# mkdir can fail with a `File exist' error if two processes# try to create one of the directories concurrently. Don't# stop in that case!$MKDIR "$my_dir" 2>/dev/null || :doneIFS="$save_mkdir_p_IFS"# Bail out if we (or some other process) failed to create a directory.test -d "$my_directory_path" || \func_fatal_error "Failed to create \`$1'"fi}# func_mktempdir [string]# Make a temporary directory that won't clash with other running# libtool processes, and avoids race conditions if possible. If# given, STRING is the basename for that directory.func_mktempdir (){my_template="${TMPDIR-/tmp}/${1-$progname}"if test "$opt_dry_run" = ":"; then# Return a directory name, but don't create it in dry-run modemy_tmpdir="${my_template}-$$"else# If mktemp works, use that first and foremostmy_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`if test ! -d "$my_tmpdir"; then# Failing that, at least try and use $RANDOM to avoid a racemy_tmpdir="${my_template}-${RANDOM-0}$$"save_mktempdir_umask=`umask`umask 0077$MKDIR "$my_tmpdir"umask $save_mktempdir_umaskfi# If we're not in dry-run mode, bomb out on failuretest -d "$my_tmpdir" || \func_fatal_error "cannot create temporary directory \`$my_tmpdir'"fi$ECHO "X$my_tmpdir" | $Xsed}# func_quote_for_eval arg# Aesthetically quote ARG to be evaled later.# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT# is double-quoted, suitable for a subsequent eval, whereas# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters# which are still active within double quotes backslashified.func_quote_for_eval (){case $1 in*[\\\`\"\$]*)func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;*)func_quote_for_eval_unquoted_result="$1" ;;esaccase $func_quote_for_eval_unquoted_result in# Double-quote args containing shell metacharacters to delay# word splitting, command substitution and and variable# expansion for a subsequent eval.# Many Bourne shells cannot handle close brackets correctly# in scan sets, so we specify it separately.*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"";;*)func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"esac}# func_quote_for_expand arg# Aesthetically quote ARG to be evaled later; same as above,# but do not quote variable references.func_quote_for_expand (){case $1 in*[\\\`\"]*)my_arg=`$ECHO "X$1" | $Xsed \-e "$double_quote_subst" -e "$sed_double_backslash"` ;;*)my_arg="$1" ;;esaccase $my_arg in# Double-quote args containing shell metacharacters to delay# word splitting and command substitution for a subsequent eval.# Many Bourne shells cannot handle close brackets correctly# in scan sets, so we specify it separately.*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")my_arg="\"$my_arg\"";;esacfunc_quote_for_expand_result="$my_arg"}# func_show_eval cmd [fail_exp]# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP# is given, then evaluate it.func_show_eval (){my_cmd="$1"my_fail_exp="${2-:}"${opt_silent-false} || {func_quote_for_expand "$my_cmd"eval "func_echo $func_quote_for_expand_result"}if ${opt_dry_run-false}; then :; elseeval "$my_cmd"my_status=$?if test "$my_status" -eq 0; then :; elseeval "(exit $my_status); $my_fail_exp"fifi}# func_show_eval_locale cmd [fail_exp]# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP# is given, then evaluate it. Use the saved locale for evaluation.func_show_eval_locale (){my_cmd="$1"my_fail_exp="${2-:}"${opt_silent-false} || {func_quote_for_expand "$my_cmd"eval "func_echo $func_quote_for_expand_result"}if ${opt_dry_run-false}; then :; elseeval "$lt_user_locale$my_cmd"my_status=$?eval "$lt_safe_locale"if test "$my_status" -eq 0; then :; elseeval "(exit $my_status); $my_fail_exp"fifi}# func_version# Echo version message to standard output and exit.func_version (){$SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {s/^# //s/^# *$//s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/p}' < "$progpath"exit $?}# func_usage# Echo short help message to standard output and exit.func_usage (){$SED -n '/^# Usage:/,/# -h/ {s/^# //s/^# *$//s/\$progname/'$progname'/p}' < "$progpath"$ECHO$ECHO "run \`$progname --help | more' for full usage"exit $?}# func_help# Echo long help message to standard output and exit.func_help (){$SED -n '/^# Usage:/,/# Report bugs to/ {s/^# //s/^# *$//s*\$progname*'$progname'*s*\$host*'"$host"'*s*\$SHELL*'"$SHELL"'*s*\$LTCC*'"$LTCC"'*s*\$LTCFLAGS*'"$LTCFLAGS"'*s*\$LD*'"$LD"'*s/\$with_gnu_ld/'"$with_gnu_ld"'/s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/p}' < "$progpath"exit $?}# func_missing_arg argname# Echo program name prefixed message to standard error and set global# exit_cmd.func_missing_arg (){func_error "missing argument for $1"exit_cmd=exit}exit_cmd=:# Check that we have a working $ECHO.if test "X$1" = X--no-reexec; then# Discard the --no-reexec flag, and continue.shiftelif test "X$1" = X--fallback-echo; then# Avoid inline document here, it may be left over:elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then# Yippee, $ECHO works!:else# Restart under the correct shell, and then maybe $ECHO will work.exec $SHELL "$progpath" --no-reexec ${1+"$@"}fiif test "X$1" = X--fallback-echo; then# used as fallback echoshiftcat <<EOF$*EOFexit $EXIT_SUCCESSfimagic="%%%MAGIC variable%%%"magic_exe="%%%MAGIC EXE variable%%%"# Global variables.# $mode is unsetnonopt=execute_dlfiles=preserve_args=lo2o="s/\\.lo\$/.${objext}/"o2lo="s/\\.${objext}\$/.lo/"extracted_archives=extracted_serial=0opt_dry_run=falseopt_duplicate_deps=falseopt_silent=falseopt_debug=:# If this variable is set in any of the actions, the command in it# will be execed at the end. This prevents here-documents from being# left over by shells.exec_cmd=# func_fatal_configuration arg...# Echo program name prefixed message to standard error, followed by# a configuration failure hint, and exit.func_fatal_configuration (){func_error ${1+"$@"}func_error "See the $PACKAGE documentation for more information."func_fatal_error "Fatal configuration error."}# func_config# Display the configuration for all the tags in this script.func_config (){re_begincf='^# ### BEGIN LIBTOOL're_endcf='^# ### END LIBTOOL'# Default configuration.$SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"# Now print the configurations for the tags.for tagname in $taglist; do$SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"doneexit $?}# func_features# Display the features supported by this script.func_features (){$ECHO "host: $host"if test "$build_libtool_libs" = yes; then$ECHO "enable shared libraries"else$ECHO "disable shared libraries"fiif test "$build_old_libs" = yes; then$ECHO "enable static libraries"else$ECHO "disable static libraries"fiexit $?}# func_enable_tag tagname# Verify that TAGNAME is valid, and either flag an error and exit, or# enable the TAGNAME tag. We also add TAGNAME to the global $taglist# variable here.func_enable_tag (){# Global variable:tagname="$1"re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"sed_extractcf="/$re_begincf/,/$re_endcf/p"# Validate tagname.case $tagname in*[!-_A-Za-z0-9,/]*)func_fatal_error "invalid tag name: $tagname";;esac# Don't test for the "default" C tag, as we know it's# there but not specially marked.case $tagname inCC) ;;*)if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; thentaglist="$taglist $tagname"# Evaluate the configuration. Be careful to quote the path# and the sed script, to avoid splitting on whitespace, but# also don't use non-portable quotes within backquotes within# quotes we have to do it in 2 steps:extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`eval "$extractedcf"elsefunc_error "ignoring unknown tag $tagname"fi;;esac}# Parse options once, thoroughly. This comes as soon as possible in# the script to make things like `libtool --version' happen quickly.{# Shorthand for --mode=foo, only valid as the first argumentcase $1 inclean|clea|cle|cl)shift; set dummy --mode clean ${1+"$@"}; shift;;compile|compil|compi|comp|com|co|c)shift; set dummy --mode compile ${1+"$@"}; shift;;execute|execut|execu|exec|exe|ex|e)shift; set dummy --mode execute ${1+"$@"}; shift;;finish|finis|fini|fin|fi|f)shift; set dummy --mode finish ${1+"$@"}; shift;;install|instal|insta|inst|ins|in|i)shift; set dummy --mode install ${1+"$@"}; shift;;link|lin|li|l)shift; set dummy --mode link ${1+"$@"}; shift;;uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)shift; set dummy --mode uninstall ${1+"$@"}; shift;;esac# Parse non-mode specific arguments:while test "$#" -gt 0; doopt="$1"shiftcase $opt in--config) func_config ;;--debug) preserve_args="$preserve_args $opt"func_echo "enabling shell trace mode"opt_debug='set -x'$opt_debug;;-dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && breakexecute_dlfiles="$execute_dlfiles $1"shift;;--dry-run | -n) opt_dry_run=: ;;--features) func_features ;;--finish) mode="finish" ;;--mode) test "$#" -eq 0 && func_missing_arg "$opt" && breakcase $1 in# Valid mode arguments:clean) ;;compile) ;;execute) ;;finish) ;;install) ;;link) ;;relink) ;;uninstall) ;;# Catch anything else as an error*) func_error "invalid argument for $opt"exit_cmd=exitbreak;;esacmode="$1"shift;;--preserve-dup-deps)opt_duplicate_deps=: ;;--quiet|--silent) preserve_args="$preserve_args $opt"opt_silent=:;;--verbose| -v) preserve_args="$preserve_args $opt"opt_silent=false;;--tag) test "$#" -eq 0 && func_missing_arg "$opt" && breakpreserve_args="$preserve_args $opt $1"func_enable_tag "$1" # tagname is set hereshift;;# Separate optargs to long options:-dlopen=*|--mode=*|--tag=*)func_opt_split "$opt"set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}shift;;-\?|-h) func_usage ;;--help) opt_help=: ;;--version) func_version ;;-*) func_fatal_help "unrecognized option \`$opt'" ;;*) nonopt="$opt"break;;esacdonecase $host in*cygwin* | *mingw* | *pw32*)# don't eliminate duplications in $postdeps and $predepsopt_duplicate_compiler_generated_deps=:;;*)opt_duplicate_compiler_generated_deps=$opt_duplicate_deps;;esac# Having warned about all mis-specified options, bail out if# anything was wrong.$exit_cmd $EXIT_FAILURE}# func_check_version_match# Ensure that we are using m4 macros, and libtool script from the same# release of libtool.func_check_version_match (){if test "$package_revision" != "$macro_revision"; thenif test "$VERSION" != "$macro_version"; thenif test -z "$macro_version"; thencat >&2 <<_LT_EOF$progname: Version mismatch error. This is $PACKAGE $VERSION, but the$progname: definition of this LT_INIT comes from an older release.$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION$progname: and run autoconf again._LT_EOFelsecat >&2 <<_LT_EOF$progname: Version mismatch error. This is $PACKAGE $VERSION, but the$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION$progname: and run autoconf again._LT_EOFfielsecat >&2 <<_LT_EOF$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,$progname: but the definition of this LT_INIT comes from revision $macro_revision.$progname: You should recreate aclocal.m4 with macros from revision $package_revision$progname: of $PACKAGE $VERSION and run autoconf again._LT_EOFfiexit $EXIT_MISMATCHfi}## ----------- #### Main. #### ----------- ##$opt_help || {# Sanity checks first:func_check_version_matchif test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; thenfunc_fatal_configuration "not configured to build any kind of library"fitest -z "$mode" && func_fatal_error "error: you must specify a MODE."# Darwin suckseval std_shrext=\"$shrext_cmds\"# Only execute mode is allowed to have -dlopen flags.if test -n "$execute_dlfiles" && test "$mode" != execute; thenfunc_error "unrecognized option \`-dlopen'"$ECHO "$help" 1>&2exit $EXIT_FAILUREfi# Change the help message to a mode-specific one.generic_help="$help"help="Try \`$progname --help --mode=$mode' for more information."}# func_lalib_p file# True iff FILE is a libtool `.la' library or `.lo' object file.# This function is only a basic sanity check; it will hardly flush out# determined imposters.func_lalib_p (){$SED -e 4q "$1" 2>/dev/null \| $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1}# func_lalib_unsafe_p file# True iff FILE is a libtool `.la' library or `.lo' object file.# This function implements the same check as func_lalib_p without# resorting to external programs. To this end, it redirects stdin and# closes it afterwards, without saving the original file descriptor.# As a safety measure, use it only where a negative result would be# fatal anyway. Works if `file' does not exist.func_lalib_unsafe_p (){lalib_p=noif test -r "$1" && exec 5<&0 <"$1"; thenfor lalib_p_l in 1 2 3 4doread lalib_p_linecase "$lalib_p_line" in\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;esacdoneexec 0<&5 5<&-fitest "$lalib_p" = yes}# func_ltwrapper_script_p file# True iff FILE is a libtool wrapper script# This function is only a basic sanity check; it will hardly flush out# determined imposters.func_ltwrapper_script_p (){func_lalib_p "$1"}# func_ltwrapper_executable_p file# True iff FILE is a libtool wrapper executable# This function is only a basic sanity check; it will hardly flush out# determined imposters.func_ltwrapper_executable_p (){func_ltwrapper_exec_suffix=case $1 in*.exe) ;;*) func_ltwrapper_exec_suffix=.exe ;;esac$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1}# func_ltwrapper_scriptname file# Assumes file is an ltwrapper_executable# uses $file to determine the appropriate filename for a# temporary ltwrapper_script.func_ltwrapper_scriptname (){func_ltwrapper_scriptname_result=""if func_ltwrapper_executable_p "$1"; thenfunc_dirname_and_basename "$1" "" "."func_stripname '' '.exe' "$func_basename_result"func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"fi}# func_ltwrapper_p file# True iff FILE is a libtool wrapper script or wrapper executable# This function is only a basic sanity check; it will hardly flush out# determined imposters.func_ltwrapper_p (){func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"}# func_execute_cmds commands fail_cmd# Execute tilde-delimited COMMANDS.# If FAIL_CMD is given, eval that upon failure.# FAIL_CMD may read-access the current command in variable CMD!func_execute_cmds (){$opt_debugsave_ifs=$IFS; IFS='~'for cmd in $1; doIFS=$save_ifseval cmd=\"$cmd\"func_show_eval "$cmd" "${2-:}"doneIFS=$save_ifs}# func_source file# Source FILE, adding directory component if necessary.# Note that it is not necessary on cygwin/mingw to append a dot to# FILE even if both FILE and FILE.exe exist: automatic-append-.exe# behavior happens only for exec(3), not for open(2)! Also, sourcing# `FILE.' does not work on cygwin managed mounts.func_source (){$opt_debugcase $1 in*/* | *\\*) . "$1" ;;*) . "./$1" ;;esac}# func_infer_tag arg# Infer tagged configuration to use if any are available and# if one wasn't chosen via the "--tag" command line option.# Only attempt this if the compiler in the base compile# command doesn't match the default compiler.# arg is usually of the form 'gcc ...'func_infer_tag (){$opt_debugif test -n "$available_tags" && test -z "$tagname"; thenCC_quoted=for arg in $CC; dofunc_quote_for_eval "$arg"CC_quoted="$CC_quoted $func_quote_for_eval_result"donecase $@ in# Blanks in the command may have been stripped by the calling shell,# but not from the CC environment variable when configure was run." $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;# Blanks at the start of $base_compile will cause this to fail# if we don't check for them as well.*)for z in $available_tags; doif $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then# Evaluate the configuration.eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"CC_quoted=for arg in $CC; do# Double-quote args containing other shell metacharacters.func_quote_for_eval "$arg"CC_quoted="$CC_quoted $func_quote_for_eval_result"donecase "$@ " in" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)# The compiler in the base compile command matches# the one in the tagged configuration.# Assume this is the tagged configuration we want.tagname=$zbreak;;esacfidone# If $tagname still isn't set, then no tagged configuration# was found and let the user know that the "--tag" command# line option must be used.if test -z "$tagname"; thenfunc_echo "unable to infer tagged configuration"func_fatal_error "specify a tag with \`--tag'"# else# func_verbose "using $tagname tagged configuration"fi;;esacfi}# func_write_libtool_object output_name pic_name nonpic_name# Create a libtool object file (analogous to a ".la" file),# but don't create it if we're doing a dry run.func_write_libtool_object (){write_libobj=${1}if test "$build_libtool_libs" = yes; thenwrite_lobj=\'${2}\'elsewrite_lobj=nonefiif test "$build_old_libs" = yes; thenwrite_oldobj=\'${3}\'elsewrite_oldobj=nonefi$opt_dry_run || {cat >${write_libobj}T <<EOF# $write_libobj - a libtool object file# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION## Please DO NOT delete this file!# It is necessary for linking the library.# Name of the PIC object.pic_object=$write_lobj# Name of the non-PIC objectnon_pic_object=$write_oldobjEOF$MV "${write_libobj}T" "${write_libobj}"}}# func_mode_compile arg...func_mode_compile (){$opt_debug# Get the compilation command and the source file.base_compile=srcfile="$nonopt" # always keep a non-empty value in "srcfile"suppress_opt=yessuppress_output=arg_mode=normallibobj=later=pie_flag=for argdocase $arg_mode inarg )# do not "continue". Instead, add this to base_compilelastarg="$arg"arg_mode=normal;;target )libobj="$arg"arg_mode=normalcontinue;;normal )# Accept any command-line options.case $arg in-o)test -n "$libobj" && \func_fatal_error "you cannot specify \`-o' more than once"arg_mode=targetcontinue;;-pie | -fpie | -fPIE)pie_flag="$pie_flag $arg"continue;;-shared | -static | -prefer-pic | -prefer-non-pic)later="$later $arg"continue;;-no-suppress)suppress_opt=nocontinue;;-Xcompiler)arg_mode=arg # the next one goes into the "base_compile" arg listcontinue # The current "srcfile" will either be retained or;; # replaced later. I would guess that would be a bug.-Wc,*)func_stripname '-Wc,' '' "$arg"args=$func_stripname_resultlastarg=save_ifs="$IFS"; IFS=','for arg in $args; doIFS="$save_ifs"func_quote_for_eval "$arg"lastarg="$lastarg $func_quote_for_eval_result"doneIFS="$save_ifs"func_stripname ' ' '' "$lastarg"lastarg=$func_stripname_result# Add the arguments to base_compile.base_compile="$base_compile $lastarg"continue;;*)# Accept the current argument as the source file.# The previous "srcfile" becomes the current argument.#lastarg="$srcfile"srcfile="$arg";;esac # case $arg;;esac # case $arg_mode# Aesthetically quote the previous argument.func_quote_for_eval "$lastarg"base_compile="$base_compile $func_quote_for_eval_result"done # for argcase $arg_mode inarg)func_fatal_error "you must specify an argument for -Xcompile";;target)func_fatal_error "you must specify a target with \`-o'";;*)# Get the name of the library object.test -z "$libobj" && {func_basename "$srcfile"libobj="$func_basename_result"};;esac# Recognize several different file suffixes.# If the user specifies -o file.o, it is replaced with file.locase $libobj in*.[cCFSifmso] | \*.ada | *.adb | *.ads | *.asm | \*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \*.[fF][09]? | *.for | *.java | *.obj | *.sx)func_xform "$libobj"libobj=$func_xform_result;;esaccase $libobj in*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;*)func_fatal_error "cannot determine name of library object from \`$libobj'";;esacfunc_infer_tag $base_compilefor arg in $later; docase $arg in-shared)test "$build_libtool_libs" != yes && \func_fatal_configuration "can not build a shared library"build_old_libs=nocontinue;;-static)build_libtool_libs=nobuild_old_libs=yescontinue;;-prefer-pic)pic_mode=yescontinue;;-prefer-non-pic)pic_mode=nocontinue;;esacdonefunc_quote_for_eval "$libobj"test "X$libobj" != "X$func_quote_for_eval_result" \&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \&& func_warning "libobj name \`$libobj' may not contain shell special characters."func_dirname_and_basename "$obj" "/" ""objname="$func_basename_result"xdir="$func_dirname_result"lobj=${xdir}$objdir/$objnametest -z "$base_compile" && \func_fatal_help "you must specify a compilation command"# Delete any leftover library objects.if test "$build_old_libs" = yes; thenremovelist="$obj $lobj $libobj ${libobj}T"elseremovelist="$lobj $libobj ${libobj}T"fi# On Cygwin there's no "real" PIC flag so we must build both object typescase $host_os incygwin* | mingw* | pw32* | os2*)pic_mode=default;;esacif test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then# non-PIC code in shared libraries is not supportedpic_mode=defaultfi# Calculate the filename of the output object if compiler does# not support -o with -cif test "$compiler_c_o" = no; thenoutput_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}lockfile="$output_obj.lock"elseoutput_obj=need_locks=nolockfile=fi# Lock this critical section if it is needed# We use this script file to make the link, it avoids creating a new fileif test "$need_locks" = yes; thenuntil $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; dofunc_echo "Waiting for $lockfile to be removed"sleep 2doneelif test "$need_locks" = warn; thenif test -f "$lockfile"; then$ECHO "\*** ERROR, $lockfile exists and contains:`cat $lockfile 2>/dev/null`This indicates that another process is trying to use the sametemporary object file, and libtool could not work around it becauseyour compiler does not support \`-c' and \`-o' together. If yourepeat this compilation, it may succeed, by chance, but you had betteravoid parallel builds (make -j) in this platform, or get a bettercompiler."$opt_dry_run || $RM $removelistexit $EXIT_FAILUREfiremovelist="$removelist $output_obj"$ECHO "$srcfile" > "$lockfile"fi$opt_dry_run || $RM $removelistremovelist="$removelist $lockfile"trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15if test -n "$fix_srcfile_path"; theneval srcfile=\"$fix_srcfile_path\"fifunc_quote_for_eval "$srcfile"qsrcfile=$func_quote_for_eval_result# Only build a PIC object if we are building libtool libraries.if test "$build_libtool_libs" = yes; then# Without this assignment, base_compile gets emptied.fbsd_hideous_sh_bug=$base_compileif test "$pic_mode" != no; thencommand="$base_compile $qsrcfile $pic_flag"else# Don't build PIC codecommand="$base_compile $qsrcfile"fifunc_mkdir_p "$xdir$objdir"if test -z "$output_obj"; then# Place PIC objects in $objdircommand="$command -o $lobj"fifunc_show_eval_locale "$command" \'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'if test "$need_locks" = warn &&test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then$ECHO "\*** ERROR, $lockfile contains:`cat $lockfile 2>/dev/null`but it should contain:$srcfileThis indicates that another process is trying to use the sametemporary object file, and libtool could not work around it becauseyour compiler does not support \`-c' and \`-o' together. If yourepeat this compilation, it may succeed, by chance, but you had betteravoid parallel builds (make -j) in this platform, or get a bettercompiler."$opt_dry_run || $RM $removelistexit $EXIT_FAILUREfi# Just move the object if needed, then go on to compile the next oneif test -n "$output_obj" && test "X$output_obj" != "X$lobj"; thenfunc_show_eval '$MV "$output_obj" "$lobj"' \'error=$?; $opt_dry_run || $RM $removelist; exit $error'fi# Allow error messages only from the first compilation.if test "$suppress_opt" = yes; thensuppress_output=' >/dev/null 2>&1'fifi# Only build a position-dependent object if we build old libraries.if test "$build_old_libs" = yes; thenif test "$pic_mode" != yes; then# Don't build PIC codecommand="$base_compile $qsrcfile$pie_flag"elsecommand="$base_compile $qsrcfile $pic_flag"fiif test "$compiler_c_o" = yes; thencommand="$command -o $obj"fi# Suppress compiler output if we already did a PIC compilation.command="$command$suppress_output"func_show_eval_locale "$command" \'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'if test "$need_locks" = warn &&test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then$ECHO "\*** ERROR, $lockfile contains:`cat $lockfile 2>/dev/null`but it should contain:$srcfileThis indicates that another process is trying to use the sametemporary object file, and libtool could not work around it becauseyour compiler does not support \`-c' and \`-o' together. If yourepeat this compilation, it may succeed, by chance, but you had betteravoid parallel builds (make -j) in this platform, or get a bettercompiler."$opt_dry_run || $RM $removelistexit $EXIT_FAILUREfi# Just move the object if neededif test -n "$output_obj" && test "X$output_obj" != "X$obj"; thenfunc_show_eval '$MV "$output_obj" "$obj"' \'error=$?; $opt_dry_run || $RM $removelist; exit $error'fifi$opt_dry_run || {func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"# Unlock the critical section if it was lockedif test "$need_locks" != no; thenremovelist=$lockfile$RM "$lockfile"fi}exit $EXIT_SUCCESS}$opt_help || {test "$mode" = compile && func_mode_compile ${1+"$@"}}func_mode_help (){# We need to display help for each of the modes.case $mode in"")# Generic help is extracted from the usage comments# at the start of this file.func_help;;clean)$ECHO \"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...Remove files from the build directory.RM is the name of the program to use to delete files associated with each FILE(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passedto RM.If FILE is a libtool library, object or program, all the files associatedwith it are deleted. Otherwise, only FILE itself is deleted using RM.";;compile)$ECHO \"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILECompile a source file into a libtool library object.This mode accepts the following additional options:-o OUTPUT-FILE set the output file name to OUTPUT-FILE-no-suppress do not suppress compiler output for multiple passes-prefer-pic try to building PIC objects only-prefer-non-pic try to building non-PIC objects only-shared do not build a \`.o' file suitable for static linking-static only build a \`.o' file suitable for static linkingCOMPILE-COMMAND is a command to be used in creating a \`standard' object filefrom the given SOURCEFILE.The output file name is determined by removing the directory component fromSOURCEFILE, then substituting the C source code suffix \`.c' with thelibrary object suffix, \`.lo'.";;execute)$ECHO \"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...Automatically set library path, then run a program.This mode accepts the following additional options:-dlopen FILE add the directory containing FILE to the library pathThis mode sets the library path environment variable according to \`-dlopen'flags.If any of the ARGS are libtool executable wrappers, then they are translatedinto their corresponding uninstalled binary, and any of their required librarydirectories are added to the library path.Then, COMMAND is executed, with ARGS as arguments.";;finish)$ECHO \"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...Complete the installation of libtool libraries.Each LIBDIR is a directory that contains libtool libraries.The commands that this mode executes may require superuser privileges. Usethe \`--dry-run' option if you just want to see what would be executed.";;install)$ECHO \"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...Install executables or libraries.INSTALL-COMMAND is the installation command. The first component should beeither the \`install' or \`cp' program.The following components of INSTALL-COMMAND are treated specially:-inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installationThe rest of the components are interpreted as arguments to that command (onlyBSD-compatible install options are recognized).";;link)$ECHO \"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...Link object files or libraries together to form another library, or tocreate an executable program.LINK-COMMAND is a command using the C compiler that you would use to createa program from several object files.The following components of LINK-COMMAND are treated specially:-all-static do not do any dynamic linking at all-avoid-version do not add a version suffix if possible-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)-export-symbols SYMFILEtry to export only the symbols listed in SYMFILE-export-symbols-regex REGEXtry to export only the symbols matching REGEX-LLIBDIR search LIBDIR for required installed libraries-lNAME OUTPUT-FILE requires the installed library libNAME-module build a library that can dlopened-no-fast-install disable the fast-install mode-no-install link a not-installable executable-no-undefined declare that a library does not refer to external symbols-o OUTPUT-FILE create OUTPUT-FILE from the specified objects-objectlist FILE Use a list of object files found in FILE to specify objects-precious-files-regex REGEXdon't remove output files matching REGEX-release RELEASE specify package release information-rpath LIBDIR the created library will eventually be installed in LIBDIR-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries-shared only do dynamic linking of libtool libraries-shrext SUFFIX override the standard shared library file extension-static do not do any dynamic linking of uninstalled libtool libraries-static-libtool-libsdo not do any dynamic linking of libtool libraries-version-info CURRENT[:REVISION[:AGE]]specify library version info [each variable defaults to 0]-weak LIBNAME declare that the target provides the LIBNAME interfaceAll other options (arguments beginning with \`-') are ignored.Every other argument is treated as a filename. Files ending in \`.la' aretreated as uninstalled libtool libraries, other files are standard or libraryobject files.If the OUTPUT-FILE ends in \`.la', then a libtool library is created,only library objects (\`.lo' files) may be specified, and \`-rpath' isrequired, except when creating a convenience library.If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is createdusing \`ar' and \`ranlib', or on Windows using \`lib'.If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object fileis created, otherwise an executable program is created.";;uninstall)$ECHO \"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...Remove libraries from an installation directory.RM is the name of the program to use to delete files associated with each FILE(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passedto RM.If FILE is a libtool library, all the files associated with it are deleted.Otherwise, only FILE itself is deleted using RM.";;*)func_fatal_help "invalid operation mode \`$mode'";;esac$ECHO$ECHO "Try \`$progname --help' for more information about other modes."exit $?}# Now that we've collected a possible --mode arg, show help if necessary$opt_help && func_mode_help# func_mode_execute arg...func_mode_execute (){$opt_debug# The first argument is the command name.cmd="$nonopt"test -z "$cmd" && \func_fatal_help "you must specify a COMMAND"# Handle -dlopen flags immediately.for file in $execute_dlfiles; dotest -f "$file" \|| func_fatal_help "\`$file' is not a file"dir=case $file in*.la)# Check to see that this really is a libtool archive.func_lalib_unsafe_p "$file" \|| func_fatal_help "\`$lib' is not a valid libtool archive"# Read the libtool library.dlname=library_names=func_source "$file"# Skip this library if it cannot be dlopened.if test -z "$dlname"; then# Warn if it was a shared library.test -n "$library_names" && \func_warning "\`$file' was not linked with \`-export-dynamic'"continuefifunc_dirname "$file" "" "."dir="$func_dirname_result"if test -f "$dir/$objdir/$dlname"; thendir="$dir/$objdir"elseif test ! -f "$dir/$dlname"; thenfunc_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"fifi;;*.lo)# Just add the directory containing the .lo file.func_dirname "$file" "" "."dir="$func_dirname_result";;*)func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"continue;;esac# Get the absolute pathname.absdir=`cd "$dir" && pwd`test -n "$absdir" && dir="$absdir"# Now add the directory to shlibpath_var.if eval "test -z \"\$$shlibpath_var\""; theneval "$shlibpath_var=\"\$dir\""elseeval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""fidone# This variable tells wrapper scripts just to set shlibpath_var# rather than running their programs.libtool_execute_magic="$magic"# Check if any of the arguments is a wrapper script.args=for filedocase $file in-*) ;;*)# Do a test to see if this is really a libtool program.if func_ltwrapper_script_p "$file"; thenfunc_source "$file"# Transform arg to wrapped name.file="$progdir/$program"elif func_ltwrapper_executable_p "$file"; thenfunc_ltwrapper_scriptname "$file"func_source "$func_ltwrapper_scriptname_result"# Transform arg to wrapped name.file="$progdir/$program"fi;;esac# Quote arguments (to preserve shell metacharacters).func_quote_for_eval "$file"args="$args $func_quote_for_eval_result"doneif test "X$opt_dry_run" = Xfalse; thenif test -n "$shlibpath_var"; then# Export the shlibpath_var.eval "export $shlibpath_var"fi# Restore saved environment variablesfor lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGESdoeval "if test \"\${save_$lt_var+set}\" = set; then$lt_var=\$save_$lt_var; export $lt_varelse$lt_unset $lt_varfi"done# Now prepare to actually exec the command.exec_cmd="\$cmd$args"else# Display what would be done.if test -n "$shlibpath_var"; theneval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""$ECHO "export $shlibpath_var"fi$ECHO "$cmd$args"exit $EXIT_SUCCESSfi}test "$mode" = execute && func_mode_execute ${1+"$@"}# func_mode_finish arg...func_mode_finish (){$opt_debuglibdirs="$nonopt"admincmds=if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; thenfor dirdolibdirs="$libdirs $dir"donefor libdir in $libdirs; doif test -n "$finish_cmds"; then# Do each command in the finish commands.func_execute_cmds "$finish_cmds" 'admincmds="$admincmds'"$cmd"'"'fiif test -n "$finish_eval"; then# Do the single finish_eval.eval cmds=\"$finish_eval\"$opt_dry_run || eval "$cmds" || admincmds="$admincmds$cmds"fidonefi# Exit here if they wanted silent mode.$opt_silent && exit $EXIT_SUCCESS$ECHO "X----------------------------------------------------------------------" | $Xsed$ECHO "Libraries have been installed in:"for libdir in $libdirs; do$ECHO " $libdir"done$ECHO$ECHO "If you ever happen to want to link against installed libraries"$ECHO "in a given directory, LIBDIR, you must either use libtool, and"$ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"$ECHO "flag during linking and do at least one of the following:"if test -n "$shlibpath_var"; then$ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"$ECHO " during execution"fiif test -n "$runpath_var"; then$ECHO " - add LIBDIR to the \`$runpath_var' environment variable"$ECHO " during linking"fiif test -n "$hardcode_libdir_flag_spec"; thenlibdir=LIBDIReval flag=\"$hardcode_libdir_flag_spec\"$ECHO " - use the \`$flag' linker flag"fiif test -n "$admincmds"; then$ECHO " - have your system administrator run these commands:$admincmds"fiif test -f /etc/ld.so.conf; then$ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"fi$ECHO$ECHO "See any operating system documentation about shared libraries for"case $host insolaris2.[6789]|solaris2.1[0-9])$ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"$ECHO "pages.";;*)$ECHO "more information, such as the ld(1) and ld.so(8) manual pages.";;esac$ECHO "X----------------------------------------------------------------------" | $Xsedexit $EXIT_SUCCESS}test "$mode" = finish && func_mode_finish ${1+"$@"}# func_mode_install arg...func_mode_install (){$opt_debug# There may be an optional sh(1) argument at the beginning of# install_prog (especially on Windows NT).if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||# Allow the use of GNU shtool's install command.$ECHO "X$nonopt" | $GREP shtool >/dev/null; then# Aesthetically quote it.func_quote_for_eval "$nonopt"install_prog="$func_quote_for_eval_result "arg=$1shiftelseinstall_prog=arg=$nonoptfi# The real first argument should be the name of the installation program.# Aesthetically quote it.func_quote_for_eval "$arg"install_prog="$install_prog$func_quote_for_eval_result"# We need to accept at least all the BSD install flags.dest=files=opts=prev=install_type=isdir=nostripme=for argdoif test -n "$dest"; thenfiles="$files $dest"dest=$argcontinueficase $arg in-d) isdir=yes ;;-f)case " $install_prog " in*[\\\ /]cp\ *) ;;*) prev=$arg ;;esac;;-g | -m | -o)prev=$arg;;-s)stripme=" -s"continue;;-*);;*)# If the previous option needed an argument, then skip it.if test -n "$prev"; thenprev=elsedest=$argcontinuefi;;esac# Aesthetically quote the argument.func_quote_for_eval "$arg"install_prog="$install_prog $func_quote_for_eval_result"donetest -z "$install_prog" && \func_fatal_help "you must specify an install program"test -n "$prev" && \func_fatal_help "the \`$prev' option requires an argument"if test -z "$files"; thenif test -z "$dest"; thenfunc_fatal_help "no file or destination specified"elsefunc_fatal_help "you must specify a destination"fifi# Strip any trailing slash from the destination.func_stripname '' '/' "$dest"dest=$func_stripname_result# Check to see that the destination is a directory.test -d "$dest" && isdir=yesif test "$isdir" = yes; thendestdir="$dest"destname=elsefunc_dirname_and_basename "$dest" "" "."destdir="$func_dirname_result"destname="$func_basename_result"# Not a directory, so check to see that there is only one file specified.set dummy $files; shifttest "$#" -gt 1 && \func_fatal_help "\`$dest' is not a directory"ficase $destdir in[\\/]* | [A-Za-z]:[\\/]*) ;;*)for file in $files; docase $file in*.lo) ;;*)func_fatal_help "\`$destdir' must be an absolute directory name";;esacdone;;esac# This variable tells wrapper scripts just to set variables rather# than running their programs.libtool_install_magic="$magic"staticlibs=future_libdirs=current_libdirs=for file in $files; do# Do each installation.case $file in*.$libext)# Do the static libraries later.staticlibs="$staticlibs $file";;*.la)# Check to see that this really is a libtool archive.func_lalib_unsafe_p "$file" \|| func_fatal_help "\`$file' is not a valid libtool archive"library_names=old_library=relink_command=func_source "$file"# Add the libdir to current_libdirs if it is the destination.if test "X$destdir" = "X$libdir"; thencase "$current_libdirs " in*" $libdir "*) ;;*) current_libdirs="$current_libdirs $libdir" ;;esacelse# Note the libdir as a future libdir.case "$future_libdirs " in*" $libdir "*) ;;*) future_libdirs="$future_libdirs $libdir" ;;esacfifunc_dirname "$file" "/" ""dir="$func_dirname_result"dir="$dir$objdir"if test -n "$relink_command"; then# Determine the prefix the user has applied to our future dir.inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`# Don't allow the user to place us outside of our expected# location b/c this prevents finding dependent libraries that# are installed to the same prefix.# At present, this check doesn't affect windows .dll's that# are installed into $libdir/../bin (currently, that works fine)# but it's something to keep an eye on.test "$inst_prefix_dir" = "$destdir" && \func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"if test -n "$inst_prefix_dir"; then# Stick the inst_prefix_dir data into the link command.relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`elserelink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`fifunc_warning "relinking \`$file'"func_show_eval "$relink_command" \'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'fi# See the names of the shared library.set dummy $library_names; shiftif test -n "$1"; thenrealname="$1"shiftsrcname="$realname"test -n "$relink_command" && srcname="$realname"T# Install the shared library and build the symlinks.func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \'exit $?'tstripme="$stripme"case $host_os incygwin* | mingw* | pw32*)case $realname in*.dll.a)tstripme="";;esac;;esacif test -n "$tstripme" && test -n "$striplib"; thenfunc_show_eval "$striplib $destdir/$realname" 'exit $?'fiif test "$#" -gt 0; then# Delete the old symlinks, and create new ones.# Try `ln -sf' first, because the `ln' binary might depend on# the symlink we replace! Solaris /bin/ln does not understand -f,# so we also need to try rm && ln -s.for linknamedotest "$linkname" != "$realname" \&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"donefi# Do each command in the postinstall commands.lib="$destdir/$realname"func_execute_cmds "$postinstall_cmds" 'exit $?'fi# Install the pseudo-library for information purposes.func_basename "$file"name="$func_basename_result"instname="$dir/$name"ifunc_show_eval "$install_prog $instname $destdir/$name" 'exit $?'# Maybe install the static library, too.test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library";;*.lo)# Install (i.e. copy) a libtool object.# Figure out destination file name, if it wasn't already specified.if test -n "$destname"; thendestfile="$destdir/$destname"elsefunc_basename "$file"destfile="$func_basename_result"destfile="$destdir/$destfile"fi# Deduce the name of the destination old-style object file.case $destfile in*.lo)func_lo2o "$destfile"staticdest=$func_lo2o_result;;*.$objext)staticdest="$destfile"destfile=;;*)func_fatal_help "cannot copy a libtool object to \`$destfile'";;esac# Install the libtool object if requested.test -n "$destfile" && \func_show_eval "$install_prog $file $destfile" 'exit $?'# Install the old object if enabled.if test "$build_old_libs" = yes; then# Deduce the name of the old-style object file.func_lo2o "$file"staticobj=$func_lo2o_resultfunc_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'fiexit $EXIT_SUCCESS;;*)# Figure out destination file name, if it wasn't already specified.if test -n "$destname"; thendestfile="$destdir/$destname"elsefunc_basename "$file"destfile="$func_basename_result"destfile="$destdir/$destfile"fi# If the file is missing, and there is a .exe on the end, strip it# because it is most likely a libtool script we actually want to# installstripped_ext=""case $file in*.exe)if test ! -f "$file"; thenfunc_stripname '' '.exe' "$file"file=$func_stripname_resultstripped_ext=".exe"fi;;esac# Do a test to see if this is really a libtool program.case $host in*cygwin*|*mingw*)if func_ltwrapper_executable_p "$file"; thenfunc_ltwrapper_scriptname "$file"wrapper=$func_ltwrapper_scriptname_resultelsefunc_stripname '' '.exe' "$file"wrapper=$func_stripname_resultfi;;*)wrapper=$file;;esacif func_ltwrapper_script_p "$wrapper"; thennotinst_deplibs=relink_command=func_source "$wrapper"# Check the variables that should have been set.test -z "$generated_by_libtool_version" && \func_fatal_error "invalid libtool wrapper script \`$wrapper'"finalize=yesfor lib in $notinst_deplibs; do# Check to see that each library is installed.libdir=if test -f "$lib"; thenfunc_source "$lib"filibfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting testif test -n "$libdir" && test ! -f "$libfile"; thenfunc_warning "\`$lib' has not been installed in \`$libdir'"finalize=nofidonerelink_command=func_source "$wrapper"outputname=if test "$fast_install" = no && test -n "$relink_command"; then$opt_dry_run || {if test "$finalize" = yes; thentmpdir=`func_mktempdir`func_basename "$file$stripped_ext"file="$func_basename_result"outputname="$tmpdir/$file"# Replace the output file specification.relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`$opt_silent || {func_quote_for_expand "$relink_command"eval "func_echo $func_quote_for_expand_result"}if eval "$relink_command"; then :elsefunc_error "error: relink \`$file' with the above command before installing it"$opt_dry_run || ${RM}r "$tmpdir"continuefifile="$outputname"elsefunc_warning "cannot relink \`$file'"fi}else# Install the binary that we compiled earlier.file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`fifi# remove .exe since cygwin /usr/bin/install will append another# one anywaycase $install_prog,$host in*/usr/bin/install*,*cygwin*)case $file:$destfile in*.exe:*.exe)# this is ok;;*.exe:*)destfile=$destfile.exe;;*:*.exe)func_stripname '' '.exe' "$destfile"destfile=$func_stripname_result;;esac;;esacfunc_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'$opt_dry_run || if test -n "$outputname"; then${RM}r "$tmpdir"fi;;esacdonefor file in $staticlibs; dofunc_basename "$file"name="$func_basename_result"# Set up the ranlib parameters.oldlib="$destdir/$name"func_show_eval "$install_prog \$file \$oldlib" 'exit $?'if test -n "$stripme" && test -n "$old_striplib"; thenfunc_show_eval "$old_striplib $oldlib" 'exit $?'fi# Do each command in the postinstall commands.func_execute_cmds "$old_postinstall_cmds" 'exit $?'donetest -n "$future_libdirs" && \func_warning "remember to run \`$progname --finish$future_libdirs'"if test -n "$current_libdirs"; then# Maybe just do a dry run.$opt_dry_run && current_libdirs=" -n$current_libdirs"exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'elseexit $EXIT_SUCCESSfi}test "$mode" = install && func_mode_install ${1+"$@"}# func_generate_dlsyms outputname originator pic_p# Extract symbols from dlprefiles and create ${outputname}S.o with# a dlpreopen symbol table.func_generate_dlsyms (){$opt_debugmy_outputname="$1"my_originator="$2"my_pic_p="${3-no}"my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`my_dlsyms=if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; thenif test -n "$NM" && test -n "$global_symbol_pipe"; thenmy_dlsyms="${my_outputname}S.c"elsefunc_error "not configured to extract global symbols from dlpreopened files"fifiif test -n "$my_dlsyms"; thencase $my_dlsyms in"") ;;*.c)# Discover the nlist of each of the dlfiles.nlist="$output_objdir/${my_outputname}.nm"func_show_eval "$RM $nlist ${nlist}S ${nlist}T"# Parse the name list into a source file.func_verbose "creating $output_objdir/$my_dlsyms"$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. *//* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */#ifdef __cplusplusextern \"C\" {#endif/* External symbol declarations for the compiler. */\"if test "$dlself" = yes; thenfunc_verbose "generating symbol list for \`$output'"$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"# Add our own program objects to the symbol list.progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`for progfile in $progfiles; dofunc_verbose "extracting global C symbols from \`$progfile'"$opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"doneif test -n "$exclude_expsyms"; then$opt_dry_run || {eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'eval '$MV "$nlist"T "$nlist"'}fiif test -n "$export_symbols_regex"; then$opt_dry_run || {eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'eval '$MV "$nlist"T "$nlist"'}fi# Prepare the list of exported symbolsif test -z "$export_symbols"; thenexport_symbols="$output_objdir/$outputname.exp"$opt_dry_run || {$RM $export_symbolseval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'case $host in*cygwin* | *mingw* )eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"';;esac}else$opt_dry_run || {eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'eval '$MV "$nlist"T "$nlist"'case $host in*cygwin | *mingw* )eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'eval 'cat "$nlist" >> "$output_objdir/$outputname.def"';;esac}fififor dlprefile in $dlprefiles; dofunc_verbose "extracting global C symbols from \`$dlprefile'"func_basename "$dlprefile"name="$func_basename_result"$opt_dry_run || {eval '$ECHO ": $name " >> "$nlist"'eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"}done$opt_dry_run || {# Make sure we have at least an empty file.test -f "$nlist" || : > "$nlist"if test -n "$exclude_expsyms"; then$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T$MV "$nlist"T "$nlist"fi# Try sorting and uniquifying the output.if $GREP -v "^: " < "$nlist" |if sort -k 3 </dev/null >/dev/null 2>&1; thensort -k 3elsesort +2fi |uniq > "$nlist"S; then:else$GREP -v "^: " < "$nlist" > "$nlist"Sfiif test -f "$nlist"S; theneval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'else$ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"fi$ECHO >> "$output_objdir/$my_dlsyms" "\/* The mapping between symbol names and symbols. */typedef struct {const char *name;void *address;} lt_dlsymlist;"case $host in*cygwin* | *mingw* )$ECHO >> "$output_objdir/$my_dlsyms" "\/* DATA imports from DLLs on WIN32 con't be const, becauseruntime relocations are performed -- see ld's documentationon pseudo-relocs. */"lt_dlsym_const= ;;*osf5*)echo >> "$output_objdir/$my_dlsyms" "\/* This system does not cope well with relocations in const data */"lt_dlsym_const= ;;*)lt_dlsym_const=const ;;esac$ECHO >> "$output_objdir/$my_dlsyms" "\extern $lt_dlsym_const lt_dlsymlistlt_${my_prefix}_LTX_preloaded_symbols[];$lt_dlsym_const lt_dlsymlistlt_${my_prefix}_LTX_preloaded_symbols[] ={\{ \"$my_originator\", (void *) 0 },"case $need_lib_prefix inno)eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms";;*)eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms";;esac$ECHO >> "$output_objdir/$my_dlsyms" "\{0, (void *) 0}};/* This works around a problem in FreeBSD linker */#ifdef FREEBSD_WORKAROUNDstatic const void *lt_preloaded_setup() {return lt_${my_prefix}_LTX_preloaded_symbols;}#endif#ifdef __cplusplus}#endif\"} # !$opt_dry_runpic_flag_for_symtable=case "$compile_command " in*" -static "*) ;;*)case $host in# compiling the symbol table file with pic_flag works around# a FreeBSD bug that causes programs to crash when -lm is# linked before any other PIC object. But we must not use# pic_flag when linking with -static. The problem exists in# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;*-*-hpux*)pic_flag_for_symtable=" $pic_flag" ;;*)if test "X$my_pic_p" != Xno; thenpic_flag_for_symtable=" $pic_flag"fi;;esac;;esacsymtab_cflags=for arg in $LTCFLAGS; docase $arg in-pie | -fpie | -fPIE) ;;*) symtab_cflags="$symtab_cflags $arg" ;;esacdone# Now compile the dynamic symbol file.func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'# Clean up the generated files.func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'# Transform the symbol file into the correct name.symfileobj="$output_objdir/${my_outputname}S.$objext"case $host in*cygwin* | *mingw* )if test -f "$output_objdir/$my_outputname.def"; thencompile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`elsecompile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`fi;;*)compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`;;esac;;*)func_fatal_error "unknown suffix for \`$my_dlsyms'";;esacelse# We keep going just in case the user didn't refer to# lt_preloaded_symbols. The linker will fail if global_symbol_pipe# really was required.# Nullify the symbol file.compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`fi}# func_win32_libid arg# return the library type of file 'arg'## Need a lot of goo to handle *both* DLLs and import libs# Has to be a shell function in order to 'eat' the argument# that is supplied when $file_magic_command is called.func_win32_libid (){$opt_debugwin32_libid_type="unknown"win32_fileres=`file -L $1 2>/dev/null`case $win32_fileres in*ar\ archive\ import\ library*) # definitely importwin32_libid_type="x86 archive import";;*ar\ archive*) # could be an import, or staticif eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |$EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; thenwin32_nmres=`eval $NM -f posix -A $1 |$SED -n -e '1,100{/ I /{s,.*,import,pq}}'`case $win32_nmres inimport*) win32_libid_type="x86 archive import";;*) win32_libid_type="x86 archive static";;esacfi;;*DLL*)win32_libid_type="x86 DLL";;*executable*) # but shell scripts are "executable" too...case $win32_fileres in*MS\ Windows\ PE\ Intel*)win32_libid_type="x86 DLL";;esac;;esac$ECHO "$win32_libid_type"}# func_extract_an_archive dir oldlibfunc_extract_an_archive (){$opt_debugf_ex_an_ar_dir="$1"; shiftf_ex_an_ar_oldlib="$1"func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then:elsefunc_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"fi}# func_extract_archives gentop oldlib ...func_extract_archives (){$opt_debugmy_gentop="$1"; shiftmy_oldlibs=${1+"$@"}my_oldobjs=""my_xlib=""my_xabs=""my_xdir=""for my_xlib in $my_oldlibs; do# Extract the objects.case $my_xlib in[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;*) my_xabs=`pwd`"/$my_xlib" ;;esacfunc_basename "$my_xlib"my_xlib="$func_basename_result"my_xlib_u=$my_xlibwhile :; docase " $extracted_archives " in*" $my_xlib_u "*)func_arith $extracted_serial + 1extracted_serial=$func_arith_resultmy_xlib_u=lt$extracted_serial-$my_xlib ;;*) break ;;esacdoneextracted_archives="$extracted_archives $my_xlib_u"my_xdir="$my_gentop/$my_xlib_u"func_mkdir_p "$my_xdir"case $host in*-darwin*)func_verbose "Extracting $my_xabs"# Do not bother doing anything if just a dry run$opt_dry_run || {darwin_orig_dir=`pwd`cd $my_xdir || exit $?darwin_archive=$my_xabsdarwin_curdir=`pwd`darwin_base_archive=`basename "$darwin_archive"`darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`if test -n "$darwin_arches"; thendarwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`darwin_arch=func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"for darwin_arch in $darwin_arches ; dofunc_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"$LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"func_extract_an_archive "`pwd`" "${darwin_base_archive}"cd "$darwin_curdir"$RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"done # $darwin_arches## Okay now we've a bunch of thin objects, gotta fatten them up :)darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`darwin_file=darwin_files=for darwin_file in $darwin_filelist; dodarwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`$LIPO -create -output "$darwin_file" $darwin_filesdone # $darwin_filelist$RM -rf unfat-$$cd "$darwin_orig_dir"elsecd $darwin_orig_dirfunc_extract_an_archive "$my_xdir" "$my_xabs"fi # $darwin_arches} # !$opt_dry_run;;*)func_extract_an_archive "$my_xdir" "$my_xabs";;esacmy_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`donefunc_extract_archives_result="$my_oldobjs"}# func_emit_wrapper arg## emit a libtool wrapper script on stdout# don't directly open a file because we may want to# incorporate the script contents within a cygwin/mingw# wrapper executable. Must ONLY be called from within# func_mode_link because it depends on a number of variable# set therein.## arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR# variable will take. If 'yes', then the emitted script# will assume that the directory in which it is stored is# the '.lib' directory. This is a cygwin/mingw-specific# behavior.func_emit_wrapper (){func_emit_wrapper_arg1=noif test -n "$1" ; thenfunc_emit_wrapper_arg1=$1fi$ECHO "\#! $SHELL# $output - temporary wrapper script for $objdir/$outputname# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION## The $output program cannot be directly executed until all the libtool# libraries that it depends on are installed.## This wrapper script should never be moved out of the build directory.# If it is, it will not operate correctly.# Sed substitution that helps us do robust quoting. It backslashifies# metacharacters that are still active within double-quoted strings.Xsed='${SED} -e 1s/^X//'sed_quote_subst='$sed_quote_subst'# Be Bourne compatibleif test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; thenemulate shNULLCMD=:# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which# is contrary to our usage. Disable this feature.alias -g '\${1+\"\$@\"}'='\"\$@\"'setopt NO_GLOB_SUBSTelsecase \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esacfiBIN_SH=xpg4; export BIN_SH # for Tru64DUALCASE=1; export DUALCASE # for MKS sh# The HP-UX ksh and POSIX shell print the target directory to stdout# if CDPATH is set.(unset CDPATH) >/dev/null 2>&1 && unset CDPATHrelink_command=\"$relink_command\"# This environment variable determines our operation mode.if test \"\$libtool_install_magic\" = \"$magic\"; then# install mode needs the following variables:generated_by_libtool_version='$macro_version'notinst_deplibs='$notinst_deplibs'else# When we are sourced in execute mode, \$file and \$ECHO are already set.if test \"\$libtool_execute_magic\" != \"$magic\"; thenECHO=\"$qecho\"file=\"\$0\"# Make sure echo works.if test \"X\$1\" = X--no-reexec; then# Discard the --no-reexec flag, and continue.shiftelif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then# Yippee, \$ECHO works!:else# Restart under the correct shell, and then maybe \$ECHO will work.exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}fifi\"$ECHO "\# Find the directory that this script lives in.thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`test \"x\$thisdir\" = \"x\$file\" && thisdir=.# Follow symbolic links until we get to the real thisdir.file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`while test -n \"\$file\"; dodestdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`# If there was a directory component, then change thisdir.if test \"x\$destdir\" != \"x\$file\"; thencase \"\$destdir\" in[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;*) thisdir=\"\$thisdir/\$destdir\" ;;esacfifile=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`done# Usually 'no', except on cygwin/mingw when embedded into# the cwrapper.WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then# special case for '.'if test \"\$thisdir\" = \".\"; thenthisdir=\`pwd\`fi# remove .libs from thisdircase \"\$thisdir\" in*[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;$objdir ) thisdir=. ;;esacfi# Try to get the absolute directory name.absdir=\`cd \"\$thisdir\" && pwd\`test -n \"\$absdir\" && thisdir=\"\$absdir\""if test "$fast_install" = yes; then$ECHO "\program=lt-'$outputname'$exeextprogdir=\"\$thisdir/$objdir\"if test ! -f \"\$progdir/\$program\" ||{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\test \"X\$file\" != \"X\$progdir/\$program\"; }; thenfile=\"\$\$-\$program\"if test ! -d \"\$progdir\"; then$MKDIR \"\$progdir\"else$RM \"\$progdir/\$file\"fi"$ECHO "\# relink executable if necessaryif test -n \"\$relink_command\"; thenif relink_command_output=\`eval \$relink_command 2>&1\`; then :else$ECHO \"\$relink_command_output\" >&2$RM \"\$progdir/\$file\"exit 1fifi$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||{ $RM \"\$progdir/\$program\";$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }$RM \"\$progdir/\$file\"fi"else$ECHO "\program='$outputname'progdir=\"\$thisdir/$objdir\""fi$ECHO "\if test -f \"\$progdir/\$program\"; then"# Export our shlibpath_var if we have one.if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then$ECHO "\# Add our own library path to $shlibpath_var$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"# Some systems cannot cope with colon-terminated $shlibpath_var# The second colon is a workaround for a bug in BeOS R4 sed$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`export $shlibpath_var"fi# fixup the dll searchpath if we need to.if test -n "$dllsearchpath"; then$ECHO "\# Add the dll search path components to the executable PATHPATH=$dllsearchpath:\$PATH"fi$ECHO "\if test \"\$libtool_execute_magic\" != \"$magic\"; then# Run the actual program with our arguments."case $host in# Backslashes separate directories on plain windows*-*-mingw | *-*-os2*)$ECHO "\exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}";;*)$ECHO "\exec \"\$progdir/\$program\" \${1+\"\$@\"}";;esac$ECHO "\\$ECHO \"\$0: cannot exec \$program \$*\" 1>&2exit 1fielse# The program doesn't exist.\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2\$ECHO \"This script is just a wrapper for \$program.\" 1>&2$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2exit 1fifi\"}# end: func_emit_wrapper# func_emit_cwrapperexe_src# emit the source code for a wrapper executable on stdout# Must ONLY be called from within func_mode_link because# it depends on a number of variable set therein.func_emit_cwrapperexe_src (){cat <<EOF/* $cwrappersource - temporary wrapper executable for $objdir/$outputnameGenerated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSIONThe $output program cannot be directly executed until all the libtoollibraries that it depends on are installed.This wrapper executable should never be moved out of the build directory.If it is, it will not operate correctly.Currently, it simply execs the wrapper *script* "$SHELL $output",but could eventually absorb all of the scripts functionality andexec $objdir/$outputname directly.*/EOFcat <<"EOF"#include <stdio.h>#include <stdlib.h>#ifdef _MSC_VER# include <direct.h># include <process.h># include <io.h># define setmode _setmode#else# include <unistd.h># include <stdint.h># ifdef __CYGWIN__# include <io.h># endif#endif#include <malloc.h>#include <stdarg.h>#include <assert.h>#include <string.h>#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <sys/stat.h>#if defined(PATH_MAX)# define LT_PATHMAX PATH_MAX#elif defined(MAXPATHLEN)# define LT_PATHMAX MAXPATHLEN#else# define LT_PATHMAX 1024#endif#ifndef S_IXOTH# define S_IXOTH 0#endif#ifndef S_IXGRP# define S_IXGRP 0#endif#ifdef _MSC_VER# define S_IXUSR _S_IEXEC# define stat _stat# ifndef _INTPTR_T_DEFINED# define intptr_t int# endif#endif#ifndef DIR_SEPARATOR# define DIR_SEPARATOR '/'# define PATH_SEPARATOR ':'#endif#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \defined (__OS2__)# define HAVE_DOS_BASED_FILE_SYSTEM# define FOPEN_WB "wb"# ifndef DIR_SEPARATOR_2# define DIR_SEPARATOR_2 '\\'# endif# ifndef PATH_SEPARATOR_2# define PATH_SEPARATOR_2 ';'# endif#endif#ifndef DIR_SEPARATOR_2# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)#else /* DIR_SEPARATOR_2 */# define IS_DIR_SEPARATOR(ch) \(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))#endif /* DIR_SEPARATOR_2 */#ifndef PATH_SEPARATOR_2# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)#else /* PATH_SEPARATOR_2 */# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)#endif /* PATH_SEPARATOR_2 */#ifdef __CYGWIN__# define FOPEN_WB "wb"#endif#ifndef FOPEN_WB# define FOPEN_WB "w"#endif#ifndef _O_BINARY# define _O_BINARY 0#endif#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))#define XFREE(stale) do { \if (stale) { free ((void *) stale); stale = 0; } \} while (0)#undef LTWRAPPER_DEBUGPRINTF#if defined DEBUGWRAPPER# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf argsstatic voidltwrapper_debugprintf (const char *fmt, ...){va_list args;va_start (args, fmt);(void) vfprintf (stderr, fmt, args);va_end (args);}#else# define LTWRAPPER_DEBUGPRINTF(args)#endifconst char *program_name = NULL;void *xmalloc (size_t num);char *xstrdup (const char *string);const char *base_name (const char *name);char *find_executable (const char *wrapper);char *chase_symlinks (const char *pathspec);int make_executable (const char *path);int check_executable (const char *path);char *strendzap (char *str, const char *pat);void lt_fatal (const char *message, ...);static const char *script_text =EOFfunc_emit_wrapper yes |$SED -e 's/\([\\"]\)/\\\1/g' \-e 's/^/ "/' -e 's/$/\\n"/'echo ";"cat <<EOFconst char * MAGIC_EXE = "$magic_exe";intmain (int argc, char *argv[]){char **newargz;char *tmp_pathspec;char *actual_cwrapper_path;char *shwrapper_name;intptr_t rval = 127;FILE *shwrapper;const char *dumpscript_opt = "--lt-dump-script";int i;program_name = (char *) xstrdup (base_name (argv[0]));LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));/* very simple arg parsing; don't want to rely on getopt */for (i = 1; i < argc; i++){if (strcmp (argv[i], dumpscript_opt) == 0){EOFcase "$host" in*mingw* | *cygwin* )# make stdout use "unix" line endingsecho " setmode(1,_O_BINARY);";;esaccat <<EOFprintf ("%s", script_text);return 0;}}newargz = XMALLOC (char *, argc + 2);EOFif test -n "$TARGETSHELL" ; then# no path translation at alllt_newargv0=$TARGETSHELLelsecase "$host" in*mingw* )# awkward: cmd appends spaces to resultlt_sed_strip_trailing_spaces="s/[ ]*\$//"lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL`case $lt_newargv0 in*.exe | *.EXE) ;;*) lt_newargv0=$lt_newargv0.exe ;;esac;;* ) lt_newargv0=$SHELL ;;esacficat <<EOFnewargz[0] = (char *) xstrdup ("$lt_newargv0");EOFcat <<"EOF"tmp_pathspec = find_executable (argv[0]);if (tmp_pathspec == NULL)lt_fatal ("Couldn't find %s", argv[0]);LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",tmp_pathspec));actual_cwrapper_path = chase_symlinks (tmp_pathspec);LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",actual_cwrapper_path));XFREE (tmp_pathspec);shwrapper_name = (char *) xstrdup (base_name (actual_cwrapper_path));strendzap (actual_cwrapper_path, shwrapper_name);/* shwrapper_name transforms */strendzap (shwrapper_name, ".exe");tmp_pathspec = XMALLOC (char, (strlen (shwrapper_name) +strlen ("_ltshwrapperTMP") + 1));strcpy (tmp_pathspec, shwrapper_name);strcat (tmp_pathspec, "_ltshwrapperTMP");XFREE (shwrapper_name);shwrapper_name = tmp_pathspec;tmp_pathspec = 0;LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n",shwrapper_name));EOFcat <<EOFnewargz[1] =XMALLOC (char, (strlen (actual_cwrapper_path) +strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1));strcpy (newargz[1], actual_cwrapper_path);strcat (newargz[1], "$objdir");strcat (newargz[1], "/");strcat (newargz[1], shwrapper_name);EOFcase $host_os inmingw*)cat <<"EOF"{char* p;while ((p = strchr (newargz[1], '\\')) != NULL){*p = '/';}}EOF;;esaccat <<"EOF"XFREE (shwrapper_name);XFREE (actual_cwrapper_path);/* always write in binary mode */if ((shwrapper = fopen (newargz[1], FOPEN_WB)) == 0){lt_fatal ("Could not open %s for writing", newargz[1]);}fprintf (shwrapper, "%s", script_text);fclose (shwrapper);make_executable (newargz[1]);for (i = 1; i < argc; i++)newargz[i + 1] = xstrdup (argv[i]);newargz[argc + 1] = NULL;for (i = 0; i < argc + 1; i++){LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, newargz[i]));}EOFcase $host_os inmingw*)cat <<EOF/* execv doesn't actually work on mingw as expected on unix */rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz);if (rval == -1){/* failed to start process */LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"$lt_newargv0\": errno = %d\n", errno));return 127;}return rval;}EOF;;*)cat <<EOFexecv ("$lt_newargv0", newargz);return rval; /* =127, but avoids unused variable warning */}EOF;;esaccat <<"EOF"void *xmalloc (size_t num){void *p = (void *) malloc (num);if (!p)lt_fatal ("Memory exhausted");return p;}char *xstrdup (const char *string){return string ? strcpy ((char *) xmalloc (strlen (string) + 1),string) : NULL;}const char *base_name (const char *name){const char *base;#if defined (HAVE_DOS_BASED_FILE_SYSTEM)/* Skip over the disk name in MSDOS pathnames. */if (isalpha ((unsigned char) name[0]) && name[1] == ':')name += 2;#endiffor (base = name; *name; name++)if (IS_DIR_SEPARATOR (*name))base = name + 1;return base;}intcheck_executable (const char *path){struct stat st;LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",path ? (*path ? path : "EMPTY!") : "NULL!"));if ((!path) || (!*path))return 0;if ((stat (path, &st) >= 0)&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))return 1;elsereturn 0;}intmake_executable (const char *path){int rval = 0;struct stat st;LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",path ? (*path ? path : "EMPTY!") : "NULL!"));if ((!path) || (!*path))return 0;if (stat (path, &st) >= 0){rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);}return rval;}/* Searches for the full path of the wrapper. Returnsnewly allocated full path name if found, NULL otherwiseDoes not chase symlinks, even on platforms that support them.*/char *find_executable (const char *wrapper){int has_slash = 0;const char *p;const char *p_next;/* static buffer for getcwd */char tmp[LT_PATHMAX + 1];int tmp_len;char *concat_name;LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));if ((wrapper == NULL) || (*wrapper == '\0'))return NULL;/* Absolute path? */#if defined (HAVE_DOS_BASED_FILE_SYSTEM)if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':'){concat_name = xstrdup (wrapper);if (check_executable (concat_name))return concat_name;XFREE (concat_name);}else{#endifif (IS_DIR_SEPARATOR (wrapper[0])){concat_name = xstrdup (wrapper);if (check_executable (concat_name))return concat_name;XFREE (concat_name);}#if defined (HAVE_DOS_BASED_FILE_SYSTEM)}#endiffor (p = wrapper; *p; p++)if (*p == '/'){has_slash = 1;break;}if (!has_slash){/* no slashes; search PATH */const char *path = getenv ("PATH");if (path != NULL){for (p = path; *p; p = p_next){const char *q;size_t p_len;for (q = p; *q; q++)if (IS_PATH_SEPARATOR (*q))break;p_len = q - p;p_next = (*q == '\0' ? q : q + 1);if (p_len == 0){/* empty path: current directory */if (getcwd (tmp, LT_PATHMAX) == NULL)lt_fatal ("getcwd failed");tmp_len = strlen (tmp);concat_name =XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);memcpy (concat_name, tmp, tmp_len);concat_name[tmp_len] = '/';strcpy (concat_name + tmp_len + 1, wrapper);}else{concat_name =XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);memcpy (concat_name, p, p_len);concat_name[p_len] = '/';strcpy (concat_name + p_len + 1, wrapper);}if (check_executable (concat_name))return concat_name;XFREE (concat_name);}}/* not found in PATH; assume curdir */}/* Relative path | not found in path: prepend cwd */if (getcwd (tmp, LT_PATHMAX) == NULL)lt_fatal ("getcwd failed");tmp_len = strlen (tmp);concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);memcpy (concat_name, tmp, tmp_len);concat_name[tmp_len] = '/';strcpy (concat_name + tmp_len + 1, wrapper);if (check_executable (concat_name))return concat_name;XFREE (concat_name);return NULL;}char *chase_symlinks (const char *pathspec){#ifndef S_ISLNKreturn xstrdup (pathspec);#elsechar buf[LT_PATHMAX];struct stat s;char *tmp_pathspec = xstrdup (pathspec);char *p;int has_symlinks = 0;while (strlen (tmp_pathspec) && !has_symlinks){LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",tmp_pathspec));if (lstat (tmp_pathspec, &s) == 0){if (S_ISLNK (s.st_mode) != 0){has_symlinks = 1;break;}/* search backwards for last DIR_SEPARATOR */p = tmp_pathspec + strlen (tmp_pathspec) - 1;while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))p--;if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))){/* no more DIR_SEPARATORS left */break;}*p = '\0';}else{char *errstr = strerror (errno);lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);}}XFREE (tmp_pathspec);if (!has_symlinks){return xstrdup (pathspec);}tmp_pathspec = realpath (pathspec, buf);if (tmp_pathspec == 0){lt_fatal ("Could not follow symlinks for %s", pathspec);}return xstrdup (tmp_pathspec);#endif}char *strendzap (char *str, const char *pat){size_t len, patlen;assert (str != NULL);assert (pat != NULL);len = strlen (str);patlen = strlen (pat);if (patlen <= len){str += len - patlen;if (strcmp (str, pat) == 0)*str = '\0';}return str;}static voidlt_error_core (int exit_status, const char *mode,const char *message, va_list ap){fprintf (stderr, "%s: %s: ", program_name, mode);vfprintf (stderr, message, ap);fprintf (stderr, ".\n");if (exit_status >= 0)exit (exit_status);}voidlt_fatal (const char *message, ...){va_list ap;va_start (ap, message);lt_error_core (EXIT_FAILURE, "FATAL", message, ap);va_end (ap);}EOF}# end: func_emit_cwrapperexe_src# func_mode_link arg...func_mode_link (){$opt_debugcase $host in*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)# It is impossible to link a dll without this setting, and# we shouldn't force the makefile maintainer to figure out# which system we are compiling for in order to pass an extra# flag for every libtool invocation.# allow_undefined=no# FIXME: Unfortunately, there are problems with the above when trying# to make a dll which has undefined symbols, in which case not# even a static library is built. For now, we need to specify# -no-undefined on the libtool link line when we can be certain# that all symbols are satisfied, otherwise we get a static library.allow_undefined=yes;;*)allow_undefined=yes;;esaclibtool_args=$nonoptbase_compile="$nonopt $@"compile_command=$nonoptfinalize_command=$nonoptcompile_rpath=finalize_rpath=compile_shlibpath=finalize_shlibpath=convenience=old_convenience=deplibs=old_deplibs=compiler_flags=linker_flags=dllsearchpath=lib_search_path=`pwd`inst_prefix_dir=new_inherited_linker_flags=avoid_version=nodlfiles=dlprefiles=dlself=noexport_dynamic=noexport_symbols=export_symbols_regex=generated=libobjs=ltlibs=module=nono_install=noobjs=non_pic_objects=precious_files_regex=prefer_static_libs=nopreload=noprev=prevarg=release=rpath=xrpath=perm_rpath=temp_rpath=thread_safe=novinfo=vinfo_number=noweak_libs=single_module="${wl}-single_module"func_infer_tag $base_compile# We need to know -static, to get the right output filenames.for argdocase $arg in-shared)test "$build_libtool_libs" != yes && \func_fatal_configuration "can not build a shared library"build_old_libs=nobreak;;-all-static | -static | -static-libtool-libs)case $arg in-all-static)if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; thenfunc_warning "complete static linking is impossible in this configuration"fiif test -n "$link_static_flag"; thendlopen_self=$dlopen_self_staticfiprefer_static_libs=yes;;-static)if test -z "$pic_flag" && test -n "$link_static_flag"; thendlopen_self=$dlopen_self_staticfiprefer_static_libs=built;;-static-libtool-libs)if test -z "$pic_flag" && test -n "$link_static_flag"; thendlopen_self=$dlopen_self_staticfiprefer_static_libs=yes;;esacbuild_libtool_libs=nobuild_old_libs=yesbreak;;esacdone# See if our shared archives depend on static archives.test -n "$old_archive_from_new_cmds" && build_old_libs=yes# Go through the arguments, transforming them on the way.while test "$#" -gt 0; doarg="$1"shiftfunc_quote_for_eval "$arg"qarg=$func_quote_for_eval_unquoted_resultfunc_append libtool_args " $func_quote_for_eval_result"# If the previous option needs an argument, assign it.if test -n "$prev"; thencase $prev inoutput)func_append compile_command " @OUTPUT@"func_append finalize_command " @OUTPUT@";;esaccase $prev indlfiles|dlprefiles)if test "$preload" = no; then# Add the symbol object into the linking commands.func_append compile_command " @SYMFILE@"func_append finalize_command " @SYMFILE@"preload=yesficase $arg in*.la | *.lo) ;; # We handle these cases below.force)if test "$dlself" = no; thendlself=needlessexport_dynamic=yesfiprev=continue;;self)if test "$prev" = dlprefiles; thendlself=yeselif test "$prev" = dlfiles && test "$dlopen_self" != yes; thendlself=yeselsedlself=needlessexport_dynamic=yesfiprev=continue;;*)if test "$prev" = dlfiles; thendlfiles="$dlfiles $arg"elsedlprefiles="$dlprefiles $arg"fiprev=continue;;esac;;expsyms)export_symbols="$arg"test -f "$arg" \|| func_fatal_error "symbol file \`$arg' does not exist"prev=continue;;expsyms_regex)export_symbols_regex="$arg"prev=continue;;framework)case $host in*-*-darwin*)case "$deplibs " in*" $qarg.ltframework "*) ;;*) deplibs="$deplibs $qarg.ltframework" # this is fixed later;;esac;;esacprev=continue;;inst_prefix)inst_prefix_dir="$arg"prev=continue;;objectlist)if test -f "$arg"; thensave_arg=$argmoreargs=for fil in `cat "$save_arg"`do# moreargs="$moreargs $fil"arg=$fil# A libtool-controlled object.# Check to see that this really is a libtool object.if func_lalib_unsafe_p "$arg"; thenpic_object=non_pic_object=# Read the .lo filefunc_source "$arg"if test -z "$pic_object" ||test -z "$non_pic_object" ||test "$pic_object" = none &&test "$non_pic_object" = none; thenfunc_fatal_error "cannot find name of object for \`$arg'"fi# Extract subdirectory from the argument.func_dirname "$arg" "/" ""xdir="$func_dirname_result"if test "$pic_object" != none; then# Prepend the subdirectory the object is found in.pic_object="$xdir$pic_object"if test "$prev" = dlfiles; thenif test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; thendlfiles="$dlfiles $pic_object"prev=continueelse# If libtool objects are unsupported, then we need to preload.prev=dlprefilesfifi# CHECK ME: I think I busted this. -Ossamaif test "$prev" = dlprefiles; then# Preload the old-style object.dlprefiles="$dlprefiles $pic_object"prev=fi# A PIC object.func_append libobjs " $pic_object"arg="$pic_object"fi# Non-PIC object.if test "$non_pic_object" != none; then# Prepend the subdirectory the object is found in.non_pic_object="$xdir$non_pic_object"# A standard non-PIC objectfunc_append non_pic_objects " $non_pic_object"if test -z "$pic_object" || test "$pic_object" = none ; thenarg="$non_pic_object"fielse# If the PIC object exists, use it instead.# $xdir was prepended to $pic_object above.non_pic_object="$pic_object"func_append non_pic_objects " $non_pic_object"fielse# Only an error if not doing a dry-run.if $opt_dry_run; then# Extract subdirectory from the argument.func_dirname "$arg" "/" ""xdir="$func_dirname_result"func_lo2o "$arg"pic_object=$xdir$objdir/$func_lo2o_resultnon_pic_object=$xdir$func_lo2o_resultfunc_append libobjs " $pic_object"func_append non_pic_objects " $non_pic_object"elsefunc_fatal_error "\`$arg' is not a valid libtool object"fifidoneelsefunc_fatal_error "link input file \`$arg' does not exist"fiarg=$save_argprev=continue;;precious_regex)precious_files_regex="$arg"prev=continue;;release)release="-$arg"prev=continue;;rpath | xrpath)# We need an absolute path.case $arg in[\\/]* | [A-Za-z]:[\\/]*) ;;*)func_fatal_error "only absolute run-paths are allowed";;esacif test "$prev" = rpath; thencase "$rpath " in*" $arg "*) ;;*) rpath="$rpath $arg" ;;esacelsecase "$xrpath " in*" $arg "*) ;;*) xrpath="$xrpath $arg" ;;esacfiprev=continue;;shrext)shrext_cmds="$arg"prev=continue;;weak)weak_libs="$weak_libs $arg"prev=continue;;xcclinker)linker_flags="$linker_flags $qarg"compiler_flags="$compiler_flags $qarg"prev=func_append compile_command " $qarg"func_append finalize_command " $qarg"continue;;xcompiler)compiler_flags="$compiler_flags $qarg"prev=func_append compile_command " $qarg"func_append finalize_command " $qarg"continue;;xlinker)linker_flags="$linker_flags $qarg"compiler_flags="$compiler_flags $wl$qarg"prev=func_append compile_command " $wl$qarg"func_append finalize_command " $wl$qarg"continue;;*)eval "$prev=\"\$arg\""prev=continue;;esacfi # test -n "$prev"prevarg="$arg"case $arg in-all-static)if test -n "$link_static_flag"; then# See comment for -static flag below, for more details.func_append compile_command " $link_static_flag"func_append finalize_command " $link_static_flag"ficontinue;;-allow-undefined)# FIXME: remove this flag sometime in the future.func_fatal_error "\`-allow-undefined' must not be used because it is the default";;-avoid-version)avoid_version=yescontinue;;-dlopen)prev=dlfilescontinue;;-dlpreopen)prev=dlprefilescontinue;;-export-dynamic)export_dynamic=yescontinue;;-export-symbols | -export-symbols-regex)if test -n "$export_symbols" || test -n "$export_symbols_regex"; thenfunc_fatal_error "more than one -exported-symbols argument is not allowed"fiif test "X$arg" = "X-export-symbols"; thenprev=expsymselseprev=expsyms_regexficontinue;;-framework)prev=frameworkcontinue;;-inst-prefix-dir)prev=inst_prefixcontinue;;# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*# so, if we see these flags be careful not to treat them like -L-L[A-Z][A-Z]*:*)case $with_gcc/$host inno/*-*-irix* | /*-*-irix*)func_append compile_command " $arg"func_append finalize_command " $arg";;esaccontinue;;-L*)func_stripname '-L' '' "$arg"dir=$func_stripname_result# We need an absolute path.case $dir in[\\/]* | [A-Za-z]:[\\/]*) ;;*)absdir=`cd "$dir" && pwd`test -z "$absdir" && \func_fatal_error "cannot determine absolute directory name of \`$dir'"dir="$absdir";;esaccase "$deplibs " in*" -L$dir "*) ;;*)deplibs="$deplibs -L$dir"lib_search_path="$lib_search_path $dir";;esaccase $host in*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`case :$dllsearchpath: in*":$dir:"*) ;;*) dllsearchpath="$dllsearchpath:$dir";;esaccase :$dllsearchpath: in*":$testbindir:"*) ;;*) dllsearchpath="$dllsearchpath:$testbindir";;esac;;esaccontinue;;-l*)if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; thencase $host in*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)# These systems don't actually have a C or math library (as such)continue;;*-*-os2*)# These systems don't actually have a C library (as such)test "X$arg" = "X-lc" && continue;;*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)# Do not include libc due to us having libc/libc_r.test "X$arg" = "X-lc" && continue;;*-*-rhapsody* | *-*-darwin1.[012])# Rhapsody C and math libraries are in the System frameworkdeplibs="$deplibs System.ltframework"continue;;*-*-sco3.2v5* | *-*-sco5v6*)# Causes problems with __ctypetest "X$arg" = "X-lc" && continue;;*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)# Compiler inserts libc in the correct place for threads to worktest "X$arg" = "X-lc" && continue;;esacelif test "X$arg" = "X-lc_r"; thencase $host in*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)# Do not include libc_r directly, use -pthread flag.continue;;esacfideplibs="$deplibs $arg"continue;;-module)module=yescontinue;;# Tru64 UNIX uses -model [arg] to determine the layout of C++# classes, name mangling, and exception handling.# Darwin uses the -arch flag to determine output architecture.-model|-arch|-isysroot)compiler_flags="$compiler_flags $arg"func_append compile_command " $arg"func_append finalize_command " $arg"prev=xcompilercontinue;;-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)compiler_flags="$compiler_flags $arg"func_append compile_command " $arg"func_append finalize_command " $arg"case "$new_inherited_linker_flags " in*" $arg "*) ;;* ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;esaccontinue;;-multi_module)single_module="${wl}-multi_module"continue;;-no-fast-install)fast_install=nocontinue;;-no-install)case $host in*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)# The PATH hackery in wrapper scripts is required on Windows# and Darwin in order for the loader to find any dlls it needs.func_warning "\`-no-install' is ignored for $host"func_warning "assuming \`-no-fast-install' instead"fast_install=no;;*) no_install=yes ;;esaccontinue;;-no-undefined)allow_undefined=nocontinue;;-objectlist)prev=objectlistcontinue;;-o) prev=output ;;-precious-files-regex)prev=precious_regexcontinue;;-release)prev=releasecontinue;;-rpath)prev=rpathcontinue;;-R)prev=xrpathcontinue;;-R*)func_stripname '-R' '' "$arg"dir=$func_stripname_result# We need an absolute path.case $dir in[\\/]* | [A-Za-z]:[\\/]*) ;;*)func_fatal_error "only absolute run-paths are allowed";;esaccase "$xrpath " in*" $dir "*) ;;*) xrpath="$xrpath $dir" ;;esaccontinue;;-shared)# The effects of -shared are defined in a previous loop.continue;;-shrext)prev=shrextcontinue;;-static | -static-libtool-libs)# The effects of -static are defined in a previous loop.# We used to do the same as -all-static on platforms that# didn't have a PIC flag, but the assumption that the effects# would be equivalent was wrong. It would break on at least# Digital Unix and AIX.continue;;-thread-safe)thread_safe=yescontinue;;-version-info)prev=vinfocontinue;;-version-number)prev=vinfovinfo_number=yescontinue;;-weak)prev=weakcontinue;;-Wc,*)func_stripname '-Wc,' '' "$arg"args=$func_stripname_resultarg=save_ifs="$IFS"; IFS=','for flag in $args; doIFS="$save_ifs"func_quote_for_eval "$flag"arg="$arg $wl$func_quote_for_eval_result"compiler_flags="$compiler_flags $func_quote_for_eval_result"doneIFS="$save_ifs"func_stripname ' ' '' "$arg"arg=$func_stripname_result;;-Wl,*)func_stripname '-Wl,' '' "$arg"args=$func_stripname_resultarg=save_ifs="$IFS"; IFS=','for flag in $args; doIFS="$save_ifs"func_quote_for_eval "$flag"arg="$arg $wl$func_quote_for_eval_result"compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"linker_flags="$linker_flags $func_quote_for_eval_result"doneIFS="$save_ifs"func_stripname ' ' '' "$arg"arg=$func_stripname_result;;-Xcompiler)prev=xcompilercontinue;;-Xlinker)prev=xlinkercontinue;;-XCClinker)prev=xcclinkercontinue;;# -msg_* for osf cc-msg_*)func_quote_for_eval "$arg"arg="$func_quote_for_eval_result";;# -64, -mips[0-9] enable 64-bit mode on the SGI compiler# -r[0-9][0-9]* specifies the processor on the SGI compiler# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler# +DA*, +DD* enable 64-bit mode on the HP compiler# -q* pass through compiler args for the IBM compiler# -m*, -t[45]*, -txscale* pass through architecture-specific# compiler args for GCC# -F/path gives path to uninstalled frameworks, gcc on darwin# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC# @file GCC response files-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)func_quote_for_eval "$arg"arg="$func_quote_for_eval_result"func_append compile_command " $arg"func_append finalize_command " $arg"compiler_flags="$compiler_flags $arg"continue;;# Some other compiler flag.-* | +*)func_quote_for_eval "$arg"arg="$func_quote_for_eval_result";;*.$objext)# A standard object.objs="$objs $arg";;*.lo)# A libtool-controlled object.# Check to see that this really is a libtool object.if func_lalib_unsafe_p "$arg"; thenpic_object=non_pic_object=# Read the .lo filefunc_source "$arg"if test -z "$pic_object" ||test -z "$non_pic_object" ||test "$pic_object" = none &&test "$non_pic_object" = none; thenfunc_fatal_error "cannot find name of object for \`$arg'"fi# Extract subdirectory from the argument.func_dirname "$arg" "/" ""xdir="$func_dirname_result"if test "$pic_object" != none; then# Prepend the subdirectory the object is found in.pic_object="$xdir$pic_object"if test "$prev" = dlfiles; thenif test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; thendlfiles="$dlfiles $pic_object"prev=continueelse# If libtool objects are unsupported, then we need to preload.prev=dlprefilesfifi# CHECK ME: I think I busted this. -Ossamaif test "$prev" = dlprefiles; then# Preload the old-style object.dlprefiles="$dlprefiles $pic_object"prev=fi# A PIC object.func_append libobjs " $pic_object"arg="$pic_object"fi# Non-PIC object.if test "$non_pic_object" != none; then# Prepend the subdirectory the object is found in.non_pic_object="$xdir$non_pic_object"# A standard non-PIC objectfunc_append non_pic_objects " $non_pic_object"if test -z "$pic_object" || test "$pic_object" = none ; thenarg="$non_pic_object"fielse# If the PIC object exists, use it instead.# $xdir was prepended to $pic_object above.non_pic_object="$pic_object"func_append non_pic_objects " $non_pic_object"fielse# Only an error if not doing a dry-run.if $opt_dry_run; then# Extract subdirectory from the argument.func_dirname "$arg" "/" ""xdir="$func_dirname_result"func_lo2o "$arg"pic_object=$xdir$objdir/$func_lo2o_resultnon_pic_object=$xdir$func_lo2o_resultfunc_append libobjs " $pic_object"func_append non_pic_objects " $non_pic_object"elsefunc_fatal_error "\`$arg' is not a valid libtool object"fifi;;*.$libext)# An archive.deplibs="$deplibs $arg"old_deplibs="$old_deplibs $arg"continue;;*.la)# A libtool-controlled library.if test "$prev" = dlfiles; then# This library was specified with -dlopen.dlfiles="$dlfiles $arg"prev=elif test "$prev" = dlprefiles; then# The library was specified with -dlpreopen.dlprefiles="$dlprefiles $arg"prev=elsedeplibs="$deplibs $arg"ficontinue;;# Some other compiler argument.*)# Unknown arguments in both finalize_command and compile_command need# to be aesthetically quoted because they are evaled later.func_quote_for_eval "$arg"arg="$func_quote_for_eval_result";;esac # arg# Now actually substitute the argument into the commands.if test -n "$arg"; thenfunc_append compile_command " $arg"func_append finalize_command " $arg"fidone # argument parsing looptest -n "$prev" && \func_fatal_help "the \`$prevarg' option requires an argument"if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; theneval arg=\"$export_dynamic_flag_spec\"func_append compile_command " $arg"func_append finalize_command " $arg"fioldlibs=# calculate the name of the file, without its directoryfunc_basename "$output"outputname="$func_basename_result"libobjs_save="$libobjs"if test -n "$shlibpath_var"; then# get the directories listed in $shlibpath_vareval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`elseshlib_search_path=fieval sys_lib_search_path=\"$sys_lib_search_path_spec\"eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"func_dirname "$output" "/" ""output_objdir="$func_dirname_result$objdir"# Create the object directory.func_mkdir_p "$output_objdir"# Determine the type of outputcase $output in"")func_fatal_help "you must specify an output file";;*.$libext) linkmode=oldlib ;;*.lo | *.$objext) linkmode=obj ;;*.la) linkmode=lib ;;*) linkmode=prog ;; # Anything else should be a program.esacspecialdeplibs=libs=# Find all interdependent deplibs by searching for libraries# that are linked more than once (e.g. -la -lb -la)for deplib in $deplibs; doif $opt_duplicate_deps ; thencase "$libs " in*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;esacfilibs="$libs $deplib"doneif test "$linkmode" = lib; thenlibs="$predeps $libs $compiler_lib_search_path $postdeps"# Compute libraries that are listed more than once in $predeps# $postdeps and mark them as special (i.e., whose duplicates are# not to be eliminated).pre_post_deps=if $opt_duplicate_compiler_generated_deps; thenfor pre_post_dep in $predeps $postdeps; docase "$pre_post_deps " in*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;esacpre_post_deps="$pre_post_deps $pre_post_dep"donefipre_post_deps=fideplibs=newdependency_libs=newlib_search_path=need_relink=no # whether we're linking any uninstalled libtool librariesnotinst_deplibs= # not-installed libtool librariesnotinst_path= # paths that contain not-installed libtool librariescase $linkmode inlib)passes="conv dlpreopen link"for file in $dlfiles $dlprefiles; docase $file in*.la) ;;*)func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file";;esacdone;;prog)compile_deplibs=finalize_deplibs=alldeplibs=nonewdlfiles=newdlprefiles=passes="conv scan dlopen dlpreopen link";;*) passes="conv";;esacfor pass in $passes; do# The preopen pass in lib mode reverses $deplibs; put it back here# so that -L comes before libs that need it for instance...if test "$linkmode,$pass" = "lib,link"; then## FIXME: Find the place where the list is rebuilt in the wrong## order, and fix it there properlytmp_deplibs=for deplib in $deplibs; dotmp_deplibs="$deplib $tmp_deplibs"donedeplibs="$tmp_deplibs"fiif test "$linkmode,$pass" = "lib,link" ||test "$linkmode,$pass" = "prog,scan"; thenlibs="$deplibs"deplibs=fiif test "$linkmode" = prog; thencase $pass indlopen) libs="$dlfiles" ;;dlpreopen) libs="$dlprefiles" ;;link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;esacfiif test "$linkmode,$pass" = "lib,dlpreopen"; then# Collect and forward deplibs of preopened libtool libsfor lib in $dlprefiles; do# Ignore non-libtool-libsdependency_libs=case $lib in*.la) func_source "$lib" ;;esac# Collect preopened libtool deplibs, except any this library# has declared as weak libsfor deplib in $dependency_libs; dodeplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`case " $weak_libs " in*" $deplib_base "*) ;;*) deplibs="$deplibs $deplib" ;;esacdonedonelibs="$dlprefiles"fiif test "$pass" = dlopen; then# Collect dlpreopened librariessave_deplibs="$deplibs"deplibs=fifor deplib in $libs; dolib=found=nocase $deplib in-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)if test "$linkmode,$pass" = "prog,link"; thencompile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"elsecompiler_flags="$compiler_flags $deplib"if test "$linkmode" = lib ; thencase "$new_inherited_linker_flags " in*" $deplib "*) ;;* ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;esacfificontinue;;-l*)if test "$linkmode" != lib && test "$linkmode" != prog; thenfunc_warning "\`-l' is ignored for archives/objects"continuefifunc_stripname '-l' '' "$deplib"name=$func_stripname_resultif test "$linkmode" = lib; thensearchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"elsesearchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"fifor searchdir in $searchdirs; dofor search_ext in .la $std_shrext .so .a; do# Search the libtool librarylib="$searchdir/lib${name}${search_ext}"if test -f "$lib"; thenif test "$search_ext" = ".la"; thenfound=yeselsefound=nofibreak 2fidonedoneif test "$found" != yes; then# deplib doesn't seem to be a libtool libraryif test "$linkmode,$pass" = "prog,link"; thencompile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"elsedeplibs="$deplib $deplibs"test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"ficontinueelse # deplib is a libtool library# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,# We need to do some special things here, and not later.if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; thencase " $predeps $postdeps " in*" $deplib "*)if func_lalib_p "$lib"; thenlibrary_names=old_library=func_source "$lib"for l in $old_library $library_names; doll="$l"doneif test "X$ll" = "X$old_library" ; then # only static version availablefound=nofunc_dirname "$lib" "" "."ladir="$func_dirname_result"lib=$ladir/$old_libraryif test "$linkmode,$pass" = "prog,link"; thencompile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"elsedeplibs="$deplib $deplibs"test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"ficontinuefifi;;*) ;;esacfifi;; # -l*.ltframework)if test "$linkmode,$pass" = "prog,link"; thencompile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"elsedeplibs="$deplib $deplibs"if test "$linkmode" = lib ; thencase "$new_inherited_linker_flags " in*" $deplib "*) ;;* ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;esacfificontinue;;-L*)case $linkmode inlib)deplibs="$deplib $deplibs"test "$pass" = conv && continuenewdependency_libs="$deplib $newdependency_libs"func_stripname '-L' '' "$deplib"newlib_search_path="$newlib_search_path $func_stripname_result";;prog)if test "$pass" = conv; thendeplibs="$deplib $deplibs"continuefiif test "$pass" = scan; thendeplibs="$deplib $deplibs"elsecompile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"fifunc_stripname '-L' '' "$deplib"newlib_search_path="$newlib_search_path $func_stripname_result";;*)func_warning "\`-L' is ignored for archives/objects";;esac # linkmodecontinue;; # -L-R*)if test "$pass" = link; thenfunc_stripname '-R' '' "$deplib"dir=$func_stripname_result# Make sure the xrpath contains only unique directories.case "$xrpath " in*" $dir "*) ;;*) xrpath="$xrpath $dir" ;;esacfideplibs="$deplib $deplibs"continue;;*.la) lib="$deplib" ;;*.$libext)if test "$pass" = conv; thendeplibs="$deplib $deplibs"continueficase $linkmode inlib)# Linking convenience modules into shared libraries is allowed,# but linking other static libraries is non-portable.case " $dlpreconveniencelibs " in*" $deplib "*) ;;*)valid_a_lib=nocase $deplibs_check_method inmatch_pattern*)set dummy $deplibs_check_method; shiftmatch_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \| $EGREP "$match_pattern_regex" > /dev/null; thenvalid_a_lib=yesfi;;pass_all)valid_a_lib=yes;;esacif test "$valid_a_lib" != yes; then$ECHO$ECHO "*** Warning: Trying to link with static lib archive $deplib."$ECHO "*** I have the capability to make that library automatically link in when"$ECHO "*** you link to this library. But I can only do this if you have a"$ECHO "*** shared version of the library, which you do not appear to have"$ECHO "*** because the file extensions .$libext of this argument makes me believe"$ECHO "*** that it is just a static archive that I should not use here."else$ECHO$ECHO "*** Warning: Linking the shared library $output against the"$ECHO "*** static library $deplib is not portable!"deplibs="$deplib $deplibs"fi;;esaccontinue;;prog)if test "$pass" != link; thendeplibs="$deplib $deplibs"elsecompile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"ficontinue;;esac # linkmode;; # *.$libext*.lo | *.$objext)if test "$pass" = conv; thendeplibs="$deplib $deplibs"elif test "$linkmode" = prog; thenif test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then# If there is no dlopen support or we're linking statically,# we need to preload.newdlprefiles="$newdlprefiles $deplib"compile_deplibs="$deplib $compile_deplibs"finalize_deplibs="$deplib $finalize_deplibs"elsenewdlfiles="$newdlfiles $deplib"fificontinue;;%DEPLIBS%)alldeplibs=yescontinue;;esac # case $deplibif test "$found" = yes || test -f "$lib"; then :elsefunc_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"fi# Check to see that this really is a libtool archive.func_lalib_unsafe_p "$lib" \|| func_fatal_error "\`$lib' is not a valid libtool archive"func_dirname "$lib" "" "."ladir="$func_dirname_result"dlname=dlopen=dlpreopen=libdir=library_names=old_library=inherited_linker_flags=# If the library was installed with an old release of libtool,# it will not redefine variables installed, or shouldnotlinkinstalled=yesshouldnotlink=noavoidtemprpath=# Read the .la filefunc_source "$lib"# Convert "-framework foo" to "foo.ltframework"if test -n "$inherited_linker_flags"; thentmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; docase " $new_inherited_linker_flags " in*" $tmp_inherited_linker_flag "*) ;;*) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;esacdonefidependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`if test "$linkmode,$pass" = "lib,link" ||test "$linkmode,$pass" = "prog,scan" ||{ test "$linkmode" != prog && test "$linkmode" != lib; }; thentest -n "$dlopen" && dlfiles="$dlfiles $dlopen"test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"fiif test "$pass" = conv; then# Only check for convenience librariesdeplibs="$lib $deplibs"if test -z "$libdir"; thenif test -z "$old_library"; thenfunc_fatal_error "cannot find name of link library for \`$lib'"fi# It is a libtool convenience library, so add in its objects.convenience="$convenience $ladir/$objdir/$old_library"old_convenience="$old_convenience $ladir/$objdir/$old_library"elif test "$linkmode" != prog && test "$linkmode" != lib; thenfunc_fatal_error "\`$lib' is not a convenience library"fitmp_libs=for deplib in $dependency_libs; dodeplibs="$deplib $deplibs"if $opt_duplicate_deps ; thencase "$tmp_libs " in*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;esacfitmp_libs="$tmp_libs $deplib"donecontinuefi # $pass = conv# Get the name of the library we link against.linklib=for l in $old_library $library_names; dolinklib="$l"doneif test -z "$linklib"; thenfunc_fatal_error "cannot find name of link library for \`$lib'"fi# This library was specified with -dlopen.if test "$pass" = dlopen; thenif test -z "$libdir"; thenfunc_fatal_error "cannot -dlopen a convenience library: \`$lib'"fiif test -z "$dlname" ||test "$dlopen_support" != yes ||test "$build_libtool_libs" = no; then# If there is no dlname, no dlopen support or we're linking# statically, we need to preload. We also need to preload any# dependent libraries so libltdl's deplib preloader doesn't# bomb out in the load deplibs phase.dlprefiles="$dlprefiles $lib $dependency_libs"elsenewdlfiles="$newdlfiles $lib"ficontinuefi # $pass = dlopen# We need an absolute path.case $ladir in[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;*)abs_ladir=`cd "$ladir" && pwd`if test -z "$abs_ladir"; thenfunc_warning "cannot determine absolute directory name of \`$ladir'"func_warning "passing it literally to the linker, although it might fail"abs_ladir="$ladir"fi;;esacfunc_basename "$lib"laname="$func_basename_result"# Find the relevant object directory and library name.if test "X$installed" = Xyes; thenif test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; thenfunc_warning "library \`$lib' was moved."dir="$ladir"absdir="$abs_ladir"libdir="$abs_ladir"elsedir="$libdir"absdir="$libdir"fitest "X$hardcode_automatic" = Xyes && avoidtemprpath=yeselseif test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; thendir="$ladir"absdir="$abs_ladir"# Remove this search path laternotinst_path="$notinst_path $abs_ladir"elsedir="$ladir/$objdir"absdir="$abs_ladir/$objdir"# Remove this search path laternotinst_path="$notinst_path $abs_ladir"fifi # $installed = yesfunc_stripname 'lib' '.la' "$laname"name=$func_stripname_result# This library was specified with -dlpreopen.if test "$pass" = dlpreopen; thenif test -z "$libdir" && test "$linkmode" = prog; thenfunc_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"fi# Prefer using a static library (so that no silly _DYNAMIC symbols# are required to link).if test -n "$old_library"; thennewdlprefiles="$newdlprefiles $dir/$old_library"# Keep a list of preopened convenience libraries to check# that they are being used correctly in the link pass.test -z "$libdir" && \dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"# Otherwise, use the dlname, so that lt_dlopen finds it.elif test -n "$dlname"; thennewdlprefiles="$newdlprefiles $dir/$dlname"elsenewdlprefiles="$newdlprefiles $dir/$linklib"fifi # $pass = dlpreopenif test -z "$libdir"; then# Link the convenience libraryif test "$linkmode" = lib; thendeplibs="$dir/$old_library $deplibs"elif test "$linkmode,$pass" = "prog,link"; thencompile_deplibs="$dir/$old_library $compile_deplibs"finalize_deplibs="$dir/$old_library $finalize_deplibs"elsedeplibs="$lib $deplibs" # used for prog,scan passficontinuefiif test "$linkmode" = prog && test "$pass" != link; thennewlib_search_path="$newlib_search_path $ladir"deplibs="$lib $deplibs"linkalldeplibs=noif test "$link_all_deplibs" != no || test -z "$library_names" ||test "$build_libtool_libs" = no; thenlinkalldeplibs=yesfitmp_libs=for deplib in $dependency_libs; docase $deplib in-L*) func_stripname '-L' '' "$deplib"newlib_search_path="$newlib_search_path $func_stripname_result";;esac# Need to link against all dependency_libs?if test "$linkalldeplibs" = yes; thendeplibs="$deplib $deplibs"else# Need to hardcode shared library paths# or/and link against static librariesnewdependency_libs="$deplib $newdependency_libs"fiif $opt_duplicate_deps ; thencase "$tmp_libs " in*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;esacfitmp_libs="$tmp_libs $deplib"done # for deplibcontinuefi # $linkmode = prog...if test "$linkmode,$pass" = "prog,link"; thenif test -n "$library_names" &&{ { test "$prefer_static_libs" = no ||test "$prefer_static_libs,$installed" = "built,yes"; } ||test -z "$old_library"; }; then# We need to hardcode the library pathif test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then# Make sure the rpath contains only unique directories.case "$temp_rpath:" in*"$absdir:"*) ;;*) temp_rpath="$temp_rpath$absdir:" ;;esacfi# Hardcode the library path.# Skip directories that are in the system default run-time# search path.case " $sys_lib_dlsearch_path " in*" $absdir "*) ;;*)case "$compile_rpath " in*" $absdir "*) ;;*) compile_rpath="$compile_rpath $absdir"esac;;esaccase " $sys_lib_dlsearch_path " in*" $libdir "*) ;;*)case "$finalize_rpath " in*" $libdir "*) ;;*) finalize_rpath="$finalize_rpath $libdir"esac;;esacfi # $linkmode,$pass = prog,link...if test "$alldeplibs" = yes &&{ test "$deplibs_check_method" = pass_all ||{ test "$build_libtool_libs" = yes &&test -n "$library_names"; }; }; then# We only need to search for static librariescontinuefifilink_static=no # Whether the deplib will be linked staticallyuse_static_libs=$prefer_static_libsif test "$use_static_libs" = built && test "$installed" = yes; thenuse_static_libs=nofiif test -n "$library_names" &&{ test "$use_static_libs" = no || test -z "$old_library"; }; thencase $host in*cygwin* | *mingw*)# No point in relinking DLLs because paths are not encodednotinst_deplibs="$notinst_deplibs $lib"need_relink=no;;*)if test "$installed" = no; thennotinst_deplibs="$notinst_deplibs $lib"need_relink=yesfi;;esac# This is a shared library# Warn about portability, can't link against -module's on some# systems (darwin). Don't bleat about dlopened modules though!dlopenmodule=""for dlpremoduletest in $dlprefiles; doif test "X$dlpremoduletest" = "X$lib"; thendlopenmodule="$dlpremoduletest"breakfidoneif test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then$ECHOif test "$linkmode" = prog; then$ECHO "*** Warning: Linking the executable $output against the loadable module"else$ECHO "*** Warning: Linking the shared library $output against the loadable module"fi$ECHO "*** $linklib is not portable!"fiif test "$linkmode" = lib &&test "$hardcode_into_libs" = yes; then# Hardcode the library path.# Skip directories that are in the system default run-time# search path.case " $sys_lib_dlsearch_path " in*" $absdir "*) ;;*)case "$compile_rpath " in*" $absdir "*) ;;*) compile_rpath="$compile_rpath $absdir"esac;;esaccase " $sys_lib_dlsearch_path " in*" $libdir "*) ;;*)case "$finalize_rpath " in*" $libdir "*) ;;*) finalize_rpath="$finalize_rpath $libdir"esac;;esacfiif test -n "$old_archive_from_expsyms_cmds"; then# figure out the sonameset dummy $library_namesshiftrealname="$1"shiftlibname=`eval "\\$ECHO \"$libname_spec\""`# use dlname if we got it. it's perfectly good, no?if test -n "$dlname"; thensoname="$dlname"elif test -n "$soname_spec"; then# bleh windowscase $host in*cygwin* | mingw*)func_arith $current - $agemajor=$func_arith_resultversuffix="-$major";;esaceval soname=\"$soname_spec\"elsesoname="$realname"fi# Make a new name for the extract_expsyms_cmds to usesoroot="$soname"func_basename "$soroot"soname="$func_basename_result"func_stripname 'lib' '.dll' "$soname"newlib=libimp-$func_stripname_result.a# If the library has no export list, then create one nowif test -f "$output_objdir/$soname-def"; then :elsefunc_verbose "extracting exported symbol list from \`$soname'"func_execute_cmds "$extract_expsyms_cmds" 'exit $?'fi# Create $newlibif test -f "$output_objdir/$newlib"; then :; elsefunc_verbose "generating import library for \`$soname'"func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'fi# make sure the library variables are pointing to the new librarydir=$output_objdirlinklib=$newlibfi # test -n "$old_archive_from_expsyms_cmds"if test "$linkmode" = prog || test "$mode" != relink; thenadd_shlibpath=add_dir=add=lib_linked=yescase $hardcode_action inimmediate | unsupported)if test "$hardcode_direct" = no; thenadd="$dir/$linklib"case $host in*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;*-*-sysv4*uw2*) add_dir="-L$dir" ;;*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \*-*-unixware7*) add_dir="-L$dir" ;;*-*-darwin* )# if the lib is a (non-dlopened) module then we can not# link against it, someone is ignoring the earlier warningsif /usr/bin/file -L $add 2> /dev/null |$GREP ": [^:]* bundle" >/dev/null ; thenif test "X$dlopenmodule" != "X$lib"; then$ECHO "*** Warning: lib $linklib is a module, not a shared library"if test -z "$old_library" ; then$ECHO$ECHO "*** And there doesn't seem to be a static archive available"$ECHO "*** The link will probably fail, sorry"elseadd="$dir/$old_library"fielif test -n "$old_library"; thenadd="$dir/$old_library"fifiesacelif test "$hardcode_minus_L" = no; thencase $host in*-*-sunos*) add_shlibpath="$dir" ;;esacadd_dir="-L$dir"add="-l$name"elif test "$hardcode_shlibpath_var" = no; thenadd_shlibpath="$dir"add="-l$name"elselib_linked=nofi;;relink)if test "$hardcode_direct" = yes &&test "$hardcode_direct_absolute" = no; thenadd="$dir/$linklib"elif test "$hardcode_minus_L" = yes; thenadd_dir="-L$dir"# Try looking first in the location we're being installed to.if test -n "$inst_prefix_dir"; thencase $libdir in[\\/]*)add_dir="$add_dir -L$inst_prefix_dir$libdir";;esacfiadd="-l$name"elif test "$hardcode_shlibpath_var" = yes; thenadd_shlibpath="$dir"add="-l$name"elselib_linked=nofi;;*) lib_linked=no ;;esacif test "$lib_linked" != yes; thenfunc_fatal_configuration "unsupported hardcode properties"fiif test -n "$add_shlibpath"; thencase :$compile_shlibpath: in*":$add_shlibpath:"*) ;;*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;esacfiif test "$linkmode" = prog; thentest -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"test -n "$add" && compile_deplibs="$add $compile_deplibs"elsetest -n "$add_dir" && deplibs="$add_dir $deplibs"test -n "$add" && deplibs="$add $deplibs"if test "$hardcode_direct" != yes &&test "$hardcode_minus_L" != yes &&test "$hardcode_shlibpath_var" = yes; thencase :$finalize_shlibpath: in*":$libdir:"*) ;;*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;esacfififiif test "$linkmode" = prog || test "$mode" = relink; thenadd_shlibpath=add_dir=add=# Finalize command for both is simple: just hardcode it.if test "$hardcode_direct" = yes &&test "$hardcode_direct_absolute" = no; thenadd="$libdir/$linklib"elif test "$hardcode_minus_L" = yes; thenadd_dir="-L$libdir"add="-l$name"elif test "$hardcode_shlibpath_var" = yes; thencase :$finalize_shlibpath: in*":$libdir:"*) ;;*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;esacadd="-l$name"elif test "$hardcode_automatic" = yes; thenif test -n "$inst_prefix_dir" &&test -f "$inst_prefix_dir$libdir/$linklib" ; thenadd="$inst_prefix_dir$libdir/$linklib"elseadd="$libdir/$linklib"fielse# We cannot seem to hardcode it, guess we'll fake it.add_dir="-L$libdir"# Try looking first in the location we're being installed to.if test -n "$inst_prefix_dir"; thencase $libdir in[\\/]*)add_dir="$add_dir -L$inst_prefix_dir$libdir";;esacfiadd="-l$name"fiif test "$linkmode" = prog; thentest -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"test -n "$add" && finalize_deplibs="$add $finalize_deplibs"elsetest -n "$add_dir" && deplibs="$add_dir $deplibs"test -n "$add" && deplibs="$add $deplibs"fifielif test "$linkmode" = prog; then# Here we assume that one of hardcode_direct or hardcode_minus_L# is not unsupported. This is valid on all known static and# shared platforms.if test "$hardcode_direct" != unsupported; thentest -n "$old_library" && linklib="$old_library"compile_deplibs="$dir/$linklib $compile_deplibs"finalize_deplibs="$dir/$linklib $finalize_deplibs"elsecompile_deplibs="-l$name -L$dir $compile_deplibs"finalize_deplibs="-l$name -L$dir $finalize_deplibs"fielif test "$build_libtool_libs" = yes; then# Not a shared libraryif test "$deplibs_check_method" != pass_all; then# We're trying link a shared library against a static one# but the system doesn't support it.# Just print a warning and add the library to dependency_libs so# that the program can be linked against the static library.$ECHO$ECHO "*** Warning: This system can not link to static lib archive $lib."$ECHO "*** I have the capability to make that library automatically link in when"$ECHO "*** you link to this library. But I can only do this if you have a"$ECHO "*** shared version of the library, which you do not appear to have."if test "$module" = yes; then$ECHO "*** But as you try to build a module library, libtool will still create "$ECHO "*** a static module, that should work as long as the dlopening application"$ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."if test -z "$global_symbol_pipe"; then$ECHO$ECHO "*** However, this would only work if libtool was able to extract symbol"$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"$ECHO "*** not find such a program. So, this module is probably useless."$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."fiif test "$build_old_libs" = no; thenbuild_libtool_libs=modulebuild_old_libs=yeselsebuild_libtool_libs=nofifielsedeplibs="$dir/$old_library $deplibs"link_static=yesfifi # link shared/static library?if test "$linkmode" = lib; thenif test -n "$dependency_libs" &&{ test "$hardcode_into_libs" != yes ||test "$build_old_libs" = yes ||test "$link_static" = yes; }; then# Extract -R from dependency_libstemp_deplibs=for libdir in $dependency_libs; docase $libdir in-R*) func_stripname '-R' '' "$libdir"temp_xrpath=$func_stripname_resultcase " $xrpath " in*" $temp_xrpath "*) ;;*) xrpath="$xrpath $temp_xrpath";;esac;;*) temp_deplibs="$temp_deplibs $libdir";;esacdonedependency_libs="$temp_deplibs"finewlib_search_path="$newlib_search_path $absdir"# Link against this librarytest "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"# ... and its dependency_libstmp_libs=for deplib in $dependency_libs; donewdependency_libs="$deplib $newdependency_libs"if $opt_duplicate_deps ; thencase "$tmp_libs " in*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;esacfitmp_libs="$tmp_libs $deplib"doneif test "$link_all_deplibs" != no; then# Add the search paths of all dependency librariesfor deplib in $dependency_libs; docase $deplib in-L*) path="$deplib" ;;*.la)func_dirname "$deplib" "" "."dir="$func_dirname_result"# We need an absolute path.case $dir in[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;*)absdir=`cd "$dir" && pwd`if test -z "$absdir"; thenfunc_warning "cannot determine absolute directory name of \`$dir'"absdir="$dir"fi;;esacif $GREP "^installed=no" $deplib > /dev/null; thencase $host in*-*-darwin*)depdepl=eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`if test -n "$deplibrary_names" ; thenfor tmp in $deplibrary_names ; dodepdepl=$tmpdoneif test -f "$absdir/$objdir/$depdepl" ; thendepdepl="$absdir/$objdir/$depdepl"darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`if test -z "$darwin_install_name"; thendarwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`ficompiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"path=fifi;;*)path="-L$absdir/$objdir";;esacelseeval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`test -z "$libdir" && \func_fatal_error "\`$deplib' is not a valid libtool archive"test "$absdir" != "$libdir" && \func_warning "\`$deplib' seems to be moved"path="-L$absdir"fi;;esaccase " $deplibs " in*" $path "*) ;;*) deplibs="$path $deplibs" ;;esacdonefi # link_all_deplibs != nofi # linkmode = libdone # for deplib in $libsif test "$pass" = link; thenif test "$linkmode" = "prog"; thencompile_deplibs="$new_inherited_linker_flags $compile_deplibs"finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"elsecompiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`fifidependency_libs="$newdependency_libs"if test "$pass" = dlpreopen; then# Link the dlpreopened libraries before other librariesfor deplib in $save_deplibs; dodeplibs="$deplib $deplibs"donefiif test "$pass" != dlopen; thenif test "$pass" != conv; then# Make sure lib_search_path contains only unique directories.lib_search_path=for dir in $newlib_search_path; docase "$lib_search_path " in*" $dir "*) ;;*) lib_search_path="$lib_search_path $dir" ;;esacdonenewlib_search_path=fiif test "$linkmode,$pass" != "prog,link"; thenvars="deplibs"elsevars="compile_deplibs finalize_deplibs"fifor var in $vars dependency_libs; do# Add libraries to $var in reverse ordereval tmp_libs=\"\$$var\"new_libs=for deplib in $tmp_libs; do# FIXME: Pedantically, this is the right thing to do, so# that some nasty dependency loop isn't accidentally# broken:#new_libs="$deplib $new_libs"# Pragmatically, this seems to cause very few problems in# practice:case $deplib in-L*) new_libs="$deplib $new_libs" ;;-R*) ;;*)# And here is the reason: when a library appears more# than once as an explicit dependence of a library, or# is implicitly linked in more than once by the# compiler, it is considered special, and multiple# occurrences thereof are not removed. Compare this# with having the same library being listed as a# dependency of multiple other libraries: in this case,# we know (pedantically, we assume) the library does not# need to be listed more than once, so we keep only the# last copy. This is not always right, but it is rare# enough that we require users that really mean to play# such unportable linking tricks to link the library# using -Wl,-lname, so that libtool does not consider it# for duplicate removal.case " $specialdeplibs " in*" $deplib "*) new_libs="$deplib $new_libs" ;;*)case " $new_libs " in*" $deplib "*) ;;*) new_libs="$deplib $new_libs" ;;esac;;esac;;esacdonetmp_libs=for deplib in $new_libs; docase $deplib in-L*)case " $tmp_libs " in*" $deplib "*) ;;*) tmp_libs="$tmp_libs $deplib" ;;esac;;*) tmp_libs="$tmp_libs $deplib" ;;esacdoneeval $var=\"$tmp_libs\"done # for varfi# Last step: remove runtime libs from dependency_libs# (they stay in deplibs)tmp_libs=for i in $dependency_libs ; docase " $predeps $postdeps $compiler_lib_search_path " in*" $i "*)i="";;esacif test -n "$i" ; thentmp_libs="$tmp_libs $i"fidonedependency_libs=$tmp_libsdone # for passif test "$linkmode" = prog; thendlfiles="$newdlfiles"fiif test "$linkmode" = prog || test "$linkmode" = lib; thendlprefiles="$newdlprefiles"ficase $linkmode inoldlib)if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; thenfunc_warning "\`-dlopen' is ignored for archives"ficase " $deplibs" in*\ -l* | *\ -L*)func_warning "\`-l' and \`-L' are ignored for archives" ;;esactest -n "$rpath" && \func_warning "\`-rpath' is ignored for archives"test -n "$xrpath" && \func_warning "\`-R' is ignored for archives"test -n "$vinfo" && \func_warning "\`-version-info/-version-number' is ignored for archives"test -n "$release" && \func_warning "\`-release' is ignored for archives"test -n "$export_symbols$export_symbols_regex" && \func_warning "\`-export-symbols' is ignored for archives"# Now set the variables for building old libraries.build_libtool_libs=nooldlibs="$output"objs="$objs$old_deplibs";;lib)# Make sure we only generate libraries of the form `libNAME.la'.case $outputname inlib*)func_stripname 'lib' '.la' "$outputname"name=$func_stripname_resulteval shared_ext=\"$shrext_cmds\"eval libname=\"$libname_spec\";;*)test "$module" = no && \func_fatal_help "libtool library \`$output' must begin with \`lib'"if test "$need_lib_prefix" != no; then# Add the "lib" prefix for modules if requiredfunc_stripname '' '.la' "$outputname"name=$func_stripname_resulteval shared_ext=\"$shrext_cmds\"eval libname=\"$libname_spec\"elsefunc_stripname '' '.la' "$outputname"libname=$func_stripname_resultfi;;esacif test -n "$objs"; thenif test "$deplibs_check_method" != pass_all; thenfunc_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"else$ECHO$ECHO "*** Warning: Linking the shared library $output against the non-libtool"$ECHO "*** objects $objs is not portable!"libobjs="$libobjs $objs"fifitest "$dlself" != no && \func_warning "\`-dlopen self' is ignored for libtool libraries"set dummy $rpathshifttest "$#" -gt 1 && \func_warning "ignoring multiple \`-rpath's for a libtool library"install_libdir="$1"oldlibs=if test -z "$rpath"; thenif test "$build_libtool_libs" = yes; then# Building a libtool convenience library.# Some compilers have problems with a `.al' extension so# convenience libraries should have the same extension an# archive normally would.oldlibs="$output_objdir/$libname.$libext $oldlibs"build_libtool_libs=conveniencebuild_old_libs=yesfitest -n "$vinfo" && \func_warning "\`-version-info/-version-number' is ignored for convenience libraries"test -n "$release" && \func_warning "\`-release' is ignored for convenience libraries"else# Parse the version information argument.save_ifs="$IFS"; IFS=':'set dummy $vinfo 0 0 0shiftIFS="$save_ifs"test -n "$7" && \func_fatal_help "too many parameters to \`-version-info'"# convert absolute version numbers to libtool ages# this retains compatibility with .la files and attempts# to make the code below a bit more comprehensiblecase $vinfo_number inyes)number_major="$1"number_minor="$2"number_revision="$3"## There are really only two kinds -- those that# use the current revision as the major version# and those that subtract age and use age as# a minor version. But, then there is irix# which has an extra 1 added just for fun#case $version_type indarwin|linux|osf|windows|none)func_arith $number_major + $number_minorcurrent=$func_arith_resultage="$number_minor"revision="$number_revision";;freebsd-aout|freebsd-elf|sunos)current="$number_major"revision="$number_minor"age="0";;irix|nonstopux)func_arith $number_major + $number_minorcurrent=$func_arith_resultage="$number_minor"revision="$number_minor"lt_irix_increment=no;;esac;;no)current="$1"revision="$2"age="$3";;esac# Check that each of the things are valid numbers.case $current in0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;*)func_error "CURRENT \`$current' must be a nonnegative integer"func_fatal_error "\`$vinfo' is not valid version information";;esaccase $revision in0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;*)func_error "REVISION \`$revision' must be a nonnegative integer"func_fatal_error "\`$vinfo' is not valid version information";;esaccase $age in0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;*)func_error "AGE \`$age' must be a nonnegative integer"func_fatal_error "\`$vinfo' is not valid version information";;esacif test "$age" -gt "$current"; thenfunc_error "AGE \`$age' is greater than the current interface number \`$current'"func_fatal_error "\`$vinfo' is not valid version information"fi# Calculate the version variables.major=versuffix=verstring=case $version_type innone) ;;darwin)# Like Linux, but with the current version available in# verstring for coding it into the library headerfunc_arith $current - $agemajor=.$func_arith_resultversuffix="$major.$age.$revision"# Darwin ld doesn't like 0 for these options...func_arith $current + 1minor_current=$func_arith_resultxlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"verstring="-compatibility_version $minor_current -current_version $minor_current.$revision";;freebsd-aout)major=".$current"versuffix=".$current.$revision";;;freebsd-elf)major=".$current"versuffix=".$current";;irix | nonstopux)if test "X$lt_irix_increment" = "Xno"; thenfunc_arith $current - $ageelsefunc_arith $current - $age + 1fimajor=$func_arith_resultcase $version_type innonstopux) verstring_prefix=nonstopux ;;*) verstring_prefix=sgi ;;esacverstring="$verstring_prefix$major.$revision"# Add in all the interfaces that we are compatible with.loop=$revisionwhile test "$loop" -ne 0; dofunc_arith $revision - $loopiface=$func_arith_resultfunc_arith $loop - 1loop=$func_arith_resultverstring="$verstring_prefix$major.$iface:$verstring"done# Before this point, $major must not contain `.'.major=.$majorversuffix="$major.$revision";;linux)func_arith $current - $agemajor=.$func_arith_resultversuffix="$major.$age.$revision";;osf)func_arith $current - $agemajor=.$func_arith_resultversuffix=".$current.$age.$revision"verstring="$current.$age.$revision"# Add in all the interfaces that we are compatible with.loop=$agewhile test "$loop" -ne 0; dofunc_arith $current - $loopiface=$func_arith_resultfunc_arith $loop - 1loop=$func_arith_resultverstring="$verstring:${iface}.0"done# Make executables depend on our current version.verstring="$verstring:${current}.0";;qnx)major=".$current"versuffix=".$current";;sunos)major=".$current"versuffix=".$current.$revision";;windows)# Use '-' rather than '.', since we only want one# extension on DOS 8.3 filesystems.func_arith $current - $agemajor=$func_arith_resultversuffix="-$major";;*)func_fatal_configuration "unknown library version type \`$version_type'";;esac# Clear the version info if we defaulted, and they specified a release.if test -z "$vinfo" && test -n "$release"; thenmajor=case $version_type indarwin)# we can't check for "0.0" in archive_cmds due to quoting# problems, so we reset it completelyverstring=;;*)verstring="0.0";;esacif test "$need_version" = no; thenversuffix=elseversuffix=".0.0"fifi# Remove version info from name if versioning should be avoidedif test "$avoid_version" = yes && test "$need_version" = no; thenmajor=versuffix=verstring=""fi# Check to see if the archive will have undefined symbols.if test "$allow_undefined" = yes; thenif test "$allow_undefined_flag" = unsupported; thenfunc_warning "undefined symbols not allowed in $host shared libraries"build_libtool_libs=nobuild_old_libs=yesfielse# Don't allow undefined symbols.allow_undefined_flag="$no_undefined_flag"fififunc_generate_dlsyms "$libname" "$libname" "yes"libobjs="$libobjs $symfileobj"test "X$libobjs" = "X " && libobjs=if test "$mode" != relink; then# Remove our outputs, but don't remove object files since they# may have been created when compiling PIC objects.removelist=tempremovelist=`$ECHO "$output_objdir/*"`for p in $tempremovelist; docase $p in*.$objext);;$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)if test "X$precious_files_regex" != "X"; thenif $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1thencontinuefifiremovelist="$removelist $p";;*) ;;esacdonetest -n "$removelist" && \func_show_eval "${RM}r \$removelist"fi# Now set the variables for building old libraries.if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; thenoldlibs="$oldlibs $output_objdir/$libname.$libext"# Transform .lo files to .o files.oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`fi# Eliminate all temporary directories.#for path in $notinst_path; do# lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`# deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`# dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`#doneif test -n "$xrpath"; then# If the user specified any rpath flags, then add them.temp_xrpath=for libdir in $xrpath; dotemp_xrpath="$temp_xrpath -R$libdir"case "$finalize_rpath " in*" $libdir "*) ;;*) finalize_rpath="$finalize_rpath $libdir" ;;esacdoneif test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; thendependency_libs="$temp_xrpath $dependency_libs"fifi# Make sure dlfiles contains only unique files that won't be dlpreopenedold_dlfiles="$dlfiles"dlfiles=for lib in $old_dlfiles; docase " $dlprefiles $dlfiles " in*" $lib "*) ;;*) dlfiles="$dlfiles $lib" ;;esacdone# Make sure dlprefiles contains only unique filesold_dlprefiles="$dlprefiles"dlprefiles=for lib in $old_dlprefiles; docase "$dlprefiles " in*" $lib "*) ;;*) dlprefiles="$dlprefiles $lib" ;;esacdoneif test "$build_libtool_libs" = yes; thenif test -n "$rpath"; thencase $host in*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)# these systems don't actually have a c library (as such)!;;*-*-rhapsody* | *-*-darwin1.[012])# Rhapsody C library is in the System frameworkdeplibs="$deplibs System.ltframework";;*-*-netbsd*)# Don't link with libc until the a.out ld.so is fixed.;;*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)# Do not include libc due to us having libc/libc_r.;;*-*-sco3.2v5* | *-*-sco5v6*)# Causes problems with __ctype;;*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)# Compiler inserts libc in the correct place for threads to work;;*)# Add libc to deplibs on all other systems if necessary.if test "$build_libtool_need_lc" = "yes"; thendeplibs="$deplibs -lc"fi;;esacfi# Transform deplibs into only deplibs that can be linked in shared.name_save=$namelibname_save=$libnamerelease_save=$releaseversuffix_save=$versuffixmajor_save=$major# I'm not sure if I'm treating the release correctly. I think# release should show up in the -l (ie -lgmp5) so we don't want to# add it in twice. Is that correct?release=""versuffix=""major=""newdeplibs=droppeddeps=nocase $deplibs_check_method inpass_all)# Don't check for shared/static. Everything works.# This might be a little naive. We might want to check# whether the library exists or not. But this is on# osf3 & osf4 and I'm not really sure... Just# implementing what was already the behavior.newdeplibs=$deplibs;;test_compile)# This code stresses the "libraries are programs" paradigm to its# limits. Maybe even breaks it. We compile a program, linking it# against the deplibs as a proxy for the library. Then we can check# whether they linked in statically or dynamically with ldd.$opt_dry_run || $RM conftest.ccat > conftest.c <<EOFint main() { return 0; }EOF$opt_dry_run || $RM conftestif $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; thenldd_output=`ldd conftest`for i in $deplibs; docase $i in-l*)func_stripname -l '' "$i"name=$func_stripname_resultif test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; thencase " $predeps $postdeps " in*" $i "*)newdeplibs="$newdeplibs $i"i="";;esacfiif test -n "$i" ; thenlibname=`eval "\\$ECHO \"$libname_spec\""`deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`set dummy $deplib_matches; shiftdeplib_match=$1if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; thennewdeplibs="$newdeplibs $i"elsedroppeddeps=yes$ECHO$ECHO "*** Warning: dynamic linker does not accept needed library $i."$ECHO "*** I have the capability to make that library automatically link in when"$ECHO "*** you link to this library. But I can only do this if you have a"$ECHO "*** shared version of the library, which I believe you do not have"$ECHO "*** because a test_compile did reveal that the linker did not use it for"$ECHO "*** its dynamic dependency list that programs get resolved with at runtime."fifi;;*)newdeplibs="$newdeplibs $i";;esacdoneelse# Error occurred in the first compile. Let's try to salvage# the situation: Compile a separate program for each library.for i in $deplibs; docase $i in-l*)func_stripname -l '' "$i"name=$func_stripname_result$opt_dry_run || $RM conftestif $LTCC $LTCFLAGS -o conftest conftest.c $i; thenldd_output=`ldd conftest`if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; thencase " $predeps $postdeps " in*" $i "*)newdeplibs="$newdeplibs $i"i="";;esacfiif test -n "$i" ; thenlibname=`eval "\\$ECHO \"$libname_spec\""`deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`set dummy $deplib_matches; shiftdeplib_match=$1if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; thennewdeplibs="$newdeplibs $i"elsedroppeddeps=yes$ECHO$ECHO "*** Warning: dynamic linker does not accept needed library $i."$ECHO "*** I have the capability to make that library automatically link in when"$ECHO "*** you link to this library. But I can only do this if you have a"$ECHO "*** shared version of the library, which you do not appear to have"$ECHO "*** because a test_compile did reveal that the linker did not use this one"$ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."fifielsedroppeddeps=yes$ECHO$ECHO "*** Warning! Library $i is needed by this library but I was not able to"$ECHO "*** make it link in! You will probably need to install it or some"$ECHO "*** library that it depends on before this library will be fully"$ECHO "*** functional. Installing it before continuing would be even better."fi;;*)newdeplibs="$newdeplibs $i";;esacdonefi;;file_magic*)set dummy $deplibs_check_method; shiftfile_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`for a_deplib in $deplibs; docase $a_deplib in-l*)func_stripname -l '' "$a_deplib"name=$func_stripname_resultif test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; thencase " $predeps $postdeps " in*" $a_deplib "*)newdeplibs="$newdeplibs $a_deplib"a_deplib="";;esacfiif test -n "$a_deplib" ; thenlibname=`eval "\\$ECHO \"$libname_spec\""`for i in $lib_search_path $sys_lib_search_path $shlib_search_path; dopotential_libs=`ls $i/$libname[.-]* 2>/dev/null`for potent_lib in $potential_libs; do# Follow soft links.if ls -lLd "$potent_lib" 2>/dev/null |$GREP " -> " >/dev/null; thencontinuefi# The statement above tries to avoid entering an# endless loop below, in case of cyclic links.# We might still enter an endless loop, since a link# loop can be closed while we follow links,# but so what?potlib="$potent_lib"while test -h "$potlib" 2>/dev/null; dopotliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`case $potliblink in[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;esacdoneif eval $file_magic_cmd \"\$potlib\" 2>/dev/null |$SED -e 10q |$EGREP "$file_magic_regex" > /dev/null; thennewdeplibs="$newdeplibs $a_deplib"a_deplib=""break 2fidonedonefiif test -n "$a_deplib" ; thendroppeddeps=yes$ECHO$ECHO "*** Warning: linker path does not have real file for library $a_deplib."$ECHO "*** I have the capability to make that library automatically link in when"$ECHO "*** you link to this library. But I can only do this if you have a"$ECHO "*** shared version of the library, which you do not appear to have"$ECHO "*** because I did check the linker path looking for a file starting"if test -z "$potlib" ; then$ECHO "*** with $libname but no candidates were found. (...for file magic test)"else$ECHO "*** with $libname and none of the candidates passed a file format test"$ECHO "*** using a file magic. Last file checked: $potlib"fifi;;*)# Add a -L argument.newdeplibs="$newdeplibs $a_deplib";;esacdone # Gone through all deplibs.;;match_pattern*)set dummy $deplibs_check_method; shiftmatch_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`for a_deplib in $deplibs; docase $a_deplib in-l*)func_stripname -l '' "$a_deplib"name=$func_stripname_resultif test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; thencase " $predeps $postdeps " in*" $a_deplib "*)newdeplibs="$newdeplibs $a_deplib"a_deplib="";;esacfiif test -n "$a_deplib" ; thenlibname=`eval "\\$ECHO \"$libname_spec\""`for i in $lib_search_path $sys_lib_search_path $shlib_search_path; dopotential_libs=`ls $i/$libname[.-]* 2>/dev/null`for potent_lib in $potential_libs; dopotlib="$potent_lib" # see symlink-check above in file_magic testif eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \$EGREP "$match_pattern_regex" > /dev/null; thennewdeplibs="$newdeplibs $a_deplib"a_deplib=""break 2fidonedonefiif test -n "$a_deplib" ; thendroppeddeps=yes$ECHO$ECHO "*** Warning: linker path does not have real file for library $a_deplib."$ECHO "*** I have the capability to make that library automatically link in when"$ECHO "*** you link to this library. But I can only do this if you have a"$ECHO "*** shared version of the library, which you do not appear to have"$ECHO "*** because I did check the linker path looking for a file starting"if test -z "$potlib" ; then$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"else$ECHO "*** with $libname and none of the candidates passed a file format test"$ECHO "*** using a regex pattern. Last file checked: $potlib"fifi;;*)# Add a -L argument.newdeplibs="$newdeplibs $a_deplib";;esacdone # Gone through all deplibs.;;none | unknown | *)newdeplibs=""tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \-e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; thenfor i in $predeps $postdeps ; do# can't use Xsed below, because $i might contain '/'tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`donefiif $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |$GREP . >/dev/null; then$ECHOif test "X$deplibs_check_method" = "Xnone"; then$ECHO "*** Warning: inter-library dependencies are not supported in this platform."else$ECHO "*** Warning: inter-library dependencies are not known to be supported."fi$ECHO "*** All declared inter-library dependencies are being dropped."droppeddeps=yesfi;;esacversuffix=$versuffix_savemajor=$major_saverelease=$release_savelibname=$libname_savename=$name_savecase $host in*-*-rhapsody* | *-*-darwin1.[012])# On Rhapsody replace the C library with the System frameworknewdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`;;esacif test "$droppeddeps" = yes; thenif test "$module" = yes; then$ECHO$ECHO "*** Warning: libtool could not satisfy all declared inter-library"$ECHO "*** dependencies of module $libname. Therefore, libtool will create"$ECHO "*** a static module, that should work as long as the dlopening"$ECHO "*** application is linked with the -dlopen flag."if test -z "$global_symbol_pipe"; then$ECHO$ECHO "*** However, this would only work if libtool was able to extract symbol"$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"$ECHO "*** not find such a program. So, this module is probably useless."$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."fiif test "$build_old_libs" = no; thenoldlibs="$output_objdir/$libname.$libext"build_libtool_libs=modulebuild_old_libs=yeselsebuild_libtool_libs=nofielse$ECHO "*** The inter-library dependencies that have been dropped here will be"$ECHO "*** automatically added whenever a program is linked with this library"$ECHO "*** or is declared to -dlopen it."if test "$allow_undefined" = no; then$ECHO$ECHO "*** Since this library must not contain undefined symbols,"$ECHO "*** because either the platform does not support them or"$ECHO "*** it was explicitly requested with -no-undefined,"$ECHO "*** libtool will only create a static version of it."if test "$build_old_libs" = no; thenoldlibs="$output_objdir/$libname.$libext"build_libtool_libs=modulebuild_old_libs=yeselsebuild_libtool_libs=nofifififi# Done checking deplibs!deplibs=$newdeplibsfi# Time to change all our "foo.ltframework" stuff back to "-framework foo"case $host in*-*-darwin*)newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`;;esac# move library search paths that coincide with paths to not yet# installed libraries to the beginning of the library search listnew_libs=for path in $notinst_path; docase " $new_libs " in*" -L$path/$objdir "*) ;;*)case " $deplibs " in*" -L$path/$objdir "*)new_libs="$new_libs -L$path/$objdir" ;;esac;;esacdonefor deplib in $deplibs; docase $deplib in-L*)case " $new_libs " in*" $deplib "*) ;;*) new_libs="$new_libs $deplib" ;;esac;;*) new_libs="$new_libs $deplib" ;;esacdonedeplibs="$new_libs"# All the library-specific variables (install_libdir is set above).library_names=old_library=dlname=# Test again, we may have decided not to build it any moreif test "$build_libtool_libs" = yes; thenif test "$hardcode_into_libs" = yes; then# Hardcode the library pathshardcode_libdirs=dep_rpath=rpath="$finalize_rpath"test "$mode" != relink && rpath="$compile_rpath$rpath"for libdir in $rpath; doif test -n "$hardcode_libdir_flag_spec"; thenif test -n "$hardcode_libdir_separator"; thenif test -z "$hardcode_libdirs"; thenhardcode_libdirs="$libdir"else# Just accumulate the unique libdirs.case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*);;*)hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir";;esacfielseeval flag=\"$hardcode_libdir_flag_spec\"dep_rpath="$dep_rpath $flag"fielif test -n "$runpath_var"; thencase "$perm_rpath " in*" $libdir "*) ;;*) perm_rpath="$perm_rpath $libdir" ;;esacfidone# Substitute the hardcoded libdirs into the rpath.if test -n "$hardcode_libdir_separator" &&test -n "$hardcode_libdirs"; thenlibdir="$hardcode_libdirs"if test -n "$hardcode_libdir_flag_spec_ld"; theneval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"elseeval dep_rpath=\"$hardcode_libdir_flag_spec\"fifiif test -n "$runpath_var" && test -n "$perm_rpath"; then# We should set the runpath_var.rpath=for dir in $perm_rpath; dorpath="$rpath$dir:"doneeval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"fitest -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"fishlibpath="$finalize_shlibpath"test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"if test -n "$shlibpath"; theneval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"fi# Get the real and link names of the library.eval shared_ext=\"$shrext_cmds\"eval library_names=\"$library_names_spec\"set dummy $library_namesshiftrealname="$1"shiftif test -n "$soname_spec"; theneval soname=\"$soname_spec\"elsesoname="$realname"fiif test -z "$dlname"; thendlname=$sonamefilib="$output_objdir/$realname"linknames=for linkdolinknames="$linknames $link"done# Use standard objects if they are pictest -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`test "X$libobjs" = "X " && libobjs=delfiles=if test -n "$export_symbols" && test -n "$include_expsyms"; then$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"export_symbols="$output_objdir/$libname.uexp"delfiles="$delfiles $export_symbols"fiorig_export_symbols=case $host_os incygwin* | mingw*)if test -n "$export_symbols" && test -z "$export_symbols_regex"; then# exporting using user supplied symfileif test "x`$SED 1q $export_symbols`" != xEXPORTS; then# and it's NOT already a .def file. Must figure out# which of the given symbols are data symbols and tag# them as such. So, trigger use of export_symbols_cmds.# export_symbols gets reassigned inside the "prepare# the list of exported symbols" if statement, so the# include_expsyms logic still works.orig_export_symbols="$export_symbols"export_symbols=always_export_symbols=yesfifi;;esac# Prepare the list of exported symbolsif test -z "$export_symbols"; thenif test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; thenfunc_verbose "generating symbol list for \`$libname.la'"export_symbols="$output_objdir/$libname.exp"$opt_dry_run || $RM $export_symbolscmds=$export_symbols_cmdssave_ifs="$IFS"; IFS='~'for cmd in $cmds; doIFS="$save_ifs"eval cmd=\"$cmd\"func_len " $cmd"len=$func_len_resultif test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; thenfunc_show_eval "$cmd" 'exit $?'skipped_export=falseelse# The command line is too long to execute in one step.func_verbose "using reloadable object file for export list..."skipped_export=:# Break out early, otherwise skipped_export may be# set to false by a later but shorter cmd.breakfidoneIFS="$save_ifs"if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; thenfunc_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'func_show_eval '$MV "${export_symbols}T" "$export_symbols"'fififiif test -n "$export_symbols" && test -n "$include_expsyms"; thentmp_export_symbols="$export_symbols"test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"$opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'fiif test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then# The given exports_symbols file has to be filtered, so filter it.func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"# FIXME: $output_objdir/$libname.filter potentially contains lots of# 's' commands which not all seds can handle. GNU sed should be fine# though. Also, the filter scales superlinearly with the number of# global variables. join(1) would be nice here, but unfortunately# isn't a blessed tool.$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filterdelfiles="$delfiles $export_symbols $output_objdir/$libname.filter"export_symbols=$output_objdir/$libname.def$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbolsfitmp_deplibs=for test_deplib in $deplibs; docase " $convenience " in*" $test_deplib "*) ;;*)tmp_deplibs="$tmp_deplibs $test_deplib";;esacdonedeplibs="$tmp_deplibs"if test -n "$convenience"; thenif test -n "$whole_archive_flag_spec" &&test "$compiler_needs_object" = yes &&test -z "$libobjs"; then# extract the archives, so we have objects to list.# TODO: could optimize this to just extract one archive.whole_archive_flag_spec=fiif test -n "$whole_archive_flag_spec"; thensave_libobjs=$libobjseval libobjs=\"\$libobjs $whole_archive_flag_spec\"test "X$libobjs" = "X " && libobjs=elsegentop="$output_objdir/${outputname}x"generated="$generated $gentop"func_extract_archives $gentop $conveniencelibobjs="$libobjs $func_extract_archives_result"test "X$libobjs" = "X " && libobjs=fifiif test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; theneval flag=\"$thread_safe_flag_spec\"linker_flags="$linker_flags $flag"fi# Make a backup of the uninstalled library when relinkingif test "$mode" = relink; then$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?fi# Do each of the archive commands.if test "$module" = yes && test -n "$module_cmds" ; thenif test -n "$export_symbols" && test -n "$module_expsym_cmds"; theneval test_cmds=\"$module_expsym_cmds\"cmds=$module_expsym_cmdselseeval test_cmds=\"$module_cmds\"cmds=$module_cmdsfielseif test -n "$export_symbols" && test -n "$archive_expsym_cmds"; theneval test_cmds=\"$archive_expsym_cmds\"cmds=$archive_expsym_cmdselseeval test_cmds=\"$archive_cmds\"cmds=$archive_cmdsfifiif test "X$skipped_export" != "X:" &&func_len " $test_cmds" &&len=$func_len_result &&test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then:else# The command line is too long to link in one step, link piecewise# or, if using GNU ld and skipped_export is not :, use a linker# script.# Save the value of $output and $libobjs because we want to# use them later. If we have whole_archive_flag_spec, we# want to use save_libobjs as it was before# whole_archive_flag_spec was expanded, because we can't# assume the linker understands whole_archive_flag_spec.# This may have to be revisited, in case too many# convenience libraries get linked in and end up exceeding# the spec.if test -z "$convenience" || test -z "$whole_archive_flag_spec"; thensave_libobjs=$libobjsfisave_output=$outputoutput_la=`$ECHO "X$output" | $Xsed -e "$basename"`# Clear the reloadable object creation command queue and# initialize k to one.test_cmds=concat_cmds=objlist=last_robj=k=1if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; thenoutput=${output_objdir}/${output_la}.lnkscriptfunc_verbose "creating GNU ld script: $output"$ECHO 'INPUT (' > $outputfor obj in $save_libobjsdo$ECHO "$obj" >> $outputdone$ECHO ')' >> $outputdelfiles="$delfiles $output"elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; thenoutput=${output_objdir}/${output_la}.lnkfunc_verbose "creating linker input file list: $output": > $outputset x $save_libobjsshiftfirstobj=if test "$compiler_needs_object" = yes; thenfirstobj="$1 "shiftfifor objdo$ECHO "$obj" >> $outputdonedelfiles="$delfiles $output"output=$firstobj\"$file_list_spec$output\"elseif test -n "$save_libobjs"; thenfunc_verbose "creating reloadable object files..."output=$output_objdir/$output_la-${k}.$objexteval test_cmds=\"$reload_cmds\"func_len " $test_cmds"len0=$func_len_resultlen=$len0# Loop over the list of objects to be linked.for obj in $save_libobjsdofunc_len " $obj"func_arith $len + $func_len_resultlen=$func_arith_resultif test "X$objlist" = X ||test "$len" -lt "$max_cmd_len"; thenfunc_append objlist " $obj"else# The command $test_cmds is almost too long, add a# command to the queue.if test "$k" -eq 1 ; then# The first file doesn't have a previous command to add.eval concat_cmds=\"$reload_cmds $objlist $last_robj\"else# All subsequent reloadable object files will link in# the last one created.eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"filast_robj=$output_objdir/$output_la-${k}.$objextfunc_arith $k + 1k=$func_arith_resultoutput=$output_objdir/$output_la-${k}.$objextobjlist=$objfunc_len " $last_robj"func_arith $len0 + $func_len_resultlen=$func_arith_resultfidone# Handle the remaining objects by creating one last# reloadable object file. All subsequent reloadable object# files will link in the last one created.test -z "$concat_cmds" || concat_cmds=$concat_cmds~eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"if test -n "$last_robj"; theneval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"fidelfiles="$delfiles $output"elseoutput=fiif ${skipped_export-false}; thenfunc_verbose "generating symbol list for \`$libname.la'"export_symbols="$output_objdir/$libname.exp"$opt_dry_run || $RM $export_symbolslibobjs=$output# Append the command to create the export file.test -z "$concat_cmds" || concat_cmds=$concat_cmds~eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"if test -n "$last_robj"; theneval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"fifitest -n "$save_libobjs" &&func_verbose "creating a temporary reloadable object file: $output"# Loop through the commands generated above and execute them.save_ifs="$IFS"; IFS='~'for cmd in $concat_cmds; doIFS="$save_ifs"$opt_silent || {func_quote_for_expand "$cmd"eval "func_echo $func_quote_for_expand_result"}$opt_dry_run || eval "$cmd" || {lt_exit=$?# Restore the uninstalled library and exitif test "$mode" = relink; then( cd "$output_objdir" && \$RM "${realname}T" && \$MV "${realname}U" "$realname" )fiexit $lt_exit}doneIFS="$save_ifs"if test -n "$export_symbols_regex" && ${skipped_export-false}; thenfunc_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'func_show_eval '$MV "${export_symbols}T" "$export_symbols"'fifiif ${skipped_export-false}; thenif test -n "$export_symbols" && test -n "$include_expsyms"; thentmp_export_symbols="$export_symbols"test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"$opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'fiif test -n "$orig_export_symbols"; then# The given exports_symbols file has to be filtered, so filter it.func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"# FIXME: $output_objdir/$libname.filter potentially contains lots of# 's' commands which not all seds can handle. GNU sed should be fine# though. Also, the filter scales superlinearly with the number of# global variables. join(1) would be nice here, but unfortunately# isn't a blessed tool.$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filterdelfiles="$delfiles $export_symbols $output_objdir/$libname.filter"export_symbols=$output_objdir/$libname.def$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbolsfifilibobjs=$output# Restore the value of output.output=$save_outputif test -n "$convenience" && test -n "$whole_archive_flag_spec"; theneval libobjs=\"\$libobjs $whole_archive_flag_spec\"test "X$libobjs" = "X " && libobjs=fi# Expand the library linking commands again to reset the# value of $libobjs for piecewise linking.# Do each of the archive commands.if test "$module" = yes && test -n "$module_cmds" ; thenif test -n "$export_symbols" && test -n "$module_expsym_cmds"; thencmds=$module_expsym_cmdselsecmds=$module_cmdsfielseif test -n "$export_symbols" && test -n "$archive_expsym_cmds"; thencmds=$archive_expsym_cmdselsecmds=$archive_cmdsfififiif test -n "$delfiles"; then# Append the command to remove temporary files to $cmds.eval cmds=\"\$cmds~\$RM $delfiles\"fi# Add any objects from preloaded convenience librariesif test -n "$dlprefiles"; thengentop="$output_objdir/${outputname}x"generated="$generated $gentop"func_extract_archives $gentop $dlprefileslibobjs="$libobjs $func_extract_archives_result"test "X$libobjs" = "X " && libobjs=fisave_ifs="$IFS"; IFS='~'for cmd in $cmds; doIFS="$save_ifs"eval cmd=\"$cmd\"$opt_silent || {func_quote_for_expand "$cmd"eval "func_echo $func_quote_for_expand_result"}$opt_dry_run || eval "$cmd" || {lt_exit=$?# Restore the uninstalled library and exitif test "$mode" = relink; then( cd "$output_objdir" && \$RM "${realname}T" && \$MV "${realname}U" "$realname" )fiexit $lt_exit}doneIFS="$save_ifs"# Restore the uninstalled library and exitif test "$mode" = relink; then$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?if test -n "$convenience"; thenif test -z "$whole_archive_flag_spec"; thenfunc_show_eval '${RM}r "$gentop"'fifiexit $EXIT_SUCCESSfi# Create links to the real library.for linkname in $linknames; doif test "$realname" != "$linkname"; thenfunc_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'fidone# If -module or -export-dynamic was specified, set the dlname.if test "$module" = yes || test "$export_dynamic" = yes; then# On all known operating systems, these are identical.dlname="$soname"fifi;;obj)if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; thenfunc_warning "\`-dlopen' is ignored for objects"ficase " $deplibs" in*\ -l* | *\ -L*)func_warning "\`-l' and \`-L' are ignored for objects" ;;esactest -n "$rpath" && \func_warning "\`-rpath' is ignored for objects"test -n "$xrpath" && \func_warning "\`-R' is ignored for objects"test -n "$vinfo" && \func_warning "\`-version-info' is ignored for objects"test -n "$release" && \func_warning "\`-release' is ignored for objects"case $output in*.lo)test -n "$objs$old_deplibs" && \func_fatal_error "cannot build library object \`$output' from non-libtool objects"libobj=$outputfunc_lo2o "$libobj"obj=$func_lo2o_result;;*)libobj=obj="$output";;esac# Delete the old objects.$opt_dry_run || $RM $obj $libobj# Objects from convenience libraries. This assumes# single-version convenience libraries. Whenever we create# different ones for PIC/non-PIC, this we'll have to duplicate# the extraction.reload_conv_objs=gentop=# reload_cmds runs $LD directly, so let us get rid of# -Wl from whole_archive_flag_spec and hope we can get by with# turning comma into space..wl=if test -n "$convenience"; thenif test -n "$whole_archive_flag_spec"; theneval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`elsegentop="$output_objdir/${obj}x"generated="$generated $gentop"func_extract_archives $gentop $conveniencereload_conv_objs="$reload_objs $func_extract_archives_result"fifi# Create the old-style object.reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting testoutput="$obj"func_execute_cmds "$reload_cmds" 'exit $?'# Exit if we aren't doing a library object file.if test -z "$libobj"; thenif test -n "$gentop"; thenfunc_show_eval '${RM}r "$gentop"'fiexit $EXIT_SUCCESSfiif test "$build_libtool_libs" != yes; thenif test -n "$gentop"; thenfunc_show_eval '${RM}r "$gentop"'fi# Create an invalid libtool object if no PIC, so that we don't# accidentally link it into a program.# $show "echo timestamp > $libobj"# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?exit $EXIT_SUCCESSfiif test -n "$pic_flag" || test "$pic_mode" != default; then# Only do commands if we really have different PIC objects.reload_objs="$libobjs $reload_conv_objs"output="$libobj"func_execute_cmds "$reload_cmds" 'exit $?'fiif test -n "$gentop"; thenfunc_show_eval '${RM}r "$gentop"'fiexit $EXIT_SUCCESS;;prog)case $host in*cygwin*) func_stripname '' '.exe' "$output"output=$func_stripname_result.exe;;esactest -n "$vinfo" && \func_warning "\`-version-info' is ignored for programs"test -n "$release" && \func_warning "\`-release' is ignored for programs"test "$preload" = yes \&& test "$dlopen_support" = unknown \&& test "$dlopen_self" = unknown \&& test "$dlopen_self_static" = unknown && \func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."case $host in*-*-rhapsody* | *-*-darwin1.[012])# On Rhapsody replace the C library is the System frameworkcompile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`;;esaccase $host in*-*-darwin*)# Don't allow lazy linking, it breaks C++ global constructors# But is supposedly fixed on 10.4 or later (yay!).if test "$tagname" = CXX ; thencase ${MACOSX_DEPLOYMENT_TARGET-10.0} in10.[0123])compile_command="$compile_command ${wl}-bind_at_load"finalize_command="$finalize_command ${wl}-bind_at_load";;esacfi# Time to change all our "foo.ltframework" stuff back to "-framework foo"compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`;;esac# move library search paths that coincide with paths to not yet# installed libraries to the beginning of the library search listnew_libs=for path in $notinst_path; docase " $new_libs " in*" -L$path/$objdir "*) ;;*)case " $compile_deplibs " in*" -L$path/$objdir "*)new_libs="$new_libs -L$path/$objdir" ;;esac;;esacdonefor deplib in $compile_deplibs; docase $deplib in-L*)case " $new_libs " in*" $deplib "*) ;;*) new_libs="$new_libs $deplib" ;;esac;;*) new_libs="$new_libs $deplib" ;;esacdonecompile_deplibs="$new_libs"compile_command="$compile_command $compile_deplibs"finalize_command="$finalize_command $finalize_deplibs"if test -n "$rpath$xrpath"; then# If the user specified any rpath flags, then add them.for libdir in $rpath $xrpath; do# This is the magic to use -rpath.case "$finalize_rpath " in*" $libdir "*) ;;*) finalize_rpath="$finalize_rpath $libdir" ;;esacdonefi# Now hardcode the library pathsrpath=hardcode_libdirs=for libdir in $compile_rpath $finalize_rpath; doif test -n "$hardcode_libdir_flag_spec"; thenif test -n "$hardcode_libdir_separator"; thenif test -z "$hardcode_libdirs"; thenhardcode_libdirs="$libdir"else# Just accumulate the unique libdirs.case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*);;*)hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir";;esacfielseeval flag=\"$hardcode_libdir_flag_spec\"rpath="$rpath $flag"fielif test -n "$runpath_var"; thencase "$perm_rpath " in*" $libdir "*) ;;*) perm_rpath="$perm_rpath $libdir" ;;esacficase $host in*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`case :$dllsearchpath: in*":$libdir:"*) ;;*) dllsearchpath="$dllsearchpath:$libdir";;esaccase :$dllsearchpath: in*":$testbindir:"*) ;;*) dllsearchpath="$dllsearchpath:$testbindir";;esac;;esacdone# Substitute the hardcoded libdirs into the rpath.if test -n "$hardcode_libdir_separator" &&test -n "$hardcode_libdirs"; thenlibdir="$hardcode_libdirs"eval rpath=\" $hardcode_libdir_flag_spec\"ficompile_rpath="$rpath"rpath=hardcode_libdirs=for libdir in $finalize_rpath; doif test -n "$hardcode_libdir_flag_spec"; thenif test -n "$hardcode_libdir_separator"; thenif test -z "$hardcode_libdirs"; thenhardcode_libdirs="$libdir"else# Just accumulate the unique libdirs.case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*);;*)hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir";;esacfielseeval flag=\"$hardcode_libdir_flag_spec\"rpath="$rpath $flag"fielif test -n "$runpath_var"; thencase "$finalize_perm_rpath " in*" $libdir "*) ;;*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;esacfidone# Substitute the hardcoded libdirs into the rpath.if test -n "$hardcode_libdir_separator" &&test -n "$hardcode_libdirs"; thenlibdir="$hardcode_libdirs"eval rpath=\" $hardcode_libdir_flag_spec\"fifinalize_rpath="$rpath"if test -n "$libobjs" && test "$build_old_libs" = yes; then# Transform all the library objects into standard objects.compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`fifunc_generate_dlsyms "$outputname" "@PROGRAM@" "no"# template prelinking stepif test -n "$prelink_cmds"; thenfunc_execute_cmds "$prelink_cmds" 'exit $?'fiwrappers_required=yescase $host in*cygwin* | *mingw* )if test "$build_libtool_libs" != yes; thenwrappers_required=nofi;;*)if test "$need_relink" = no || test "$build_libtool_libs" != yes; thenwrappers_required=nofi;;esacif test "$wrappers_required" = no; then# Replace the output file specification.compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`link_command="$compile_command$compile_rpath"# We have no uninstalled library dependencies, so finalize right now.exit_status=0func_show_eval "$link_command" 'exit_status=$?'# Delete the generated files.if test -f "$output_objdir/${outputname}S.${objext}"; thenfunc_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'fiexit $exit_statusfiif test -n "$compile_shlibpath$finalize_shlibpath"; thencompile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"fiif test -n "$finalize_shlibpath"; thenfinalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"ficompile_var=finalize_var=if test -n "$runpath_var"; thenif test -n "$perm_rpath"; then# We should set the runpath_var.rpath=for dir in $perm_rpath; dorpath="$rpath$dir:"donecompile_var="$runpath_var=\"$rpath\$$runpath_var\" "fiif test -n "$finalize_perm_rpath"; then# We should set the runpath_var.rpath=for dir in $finalize_perm_rpath; dorpath="$rpath$dir:"donefinalize_var="$runpath_var=\"$rpath\$$runpath_var\" "fifiif test "$no_install" = yes; then# We don't need to create a wrapper script.link_command="$compile_var$compile_command$compile_rpath"# Replace the output file specification.link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`# Delete the old output file.$opt_dry_run || $RM $output# Link the executable and exitfunc_show_eval "$link_command" 'exit $?'exit $EXIT_SUCCESSfiif test "$hardcode_action" = relink; then# Fast installation is not supportedlink_command="$compile_var$compile_command$compile_rpath"relink_command="$finalize_var$finalize_command$finalize_rpath"func_warning "this platform does not like uninstalled shared libraries"func_warning "\`$output' will be relinked during installation"elseif test "$fast_install" != no; thenlink_command="$finalize_var$compile_command$finalize_rpath"if test "$fast_install" = yes; thenrelink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`else# fast_install is set to needlessrelink_command=fielselink_command="$compile_var$compile_command$compile_rpath"relink_command="$finalize_var$finalize_command$finalize_rpath"fifi# Replace the output file specification.link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`# Delete the old output files.$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputnamefunc_show_eval "$link_command" 'exit $?'# Now create the wrapper script.func_verbose "creating $output"# Quote the relink command for shipping.if test -n "$relink_command"; then# Preserve any variables that may affect compiler behaviorfor var in $variables_saved_for_relink; doif eval test -z \"\${$var+set}\"; thenrelink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"elif eval var_value=\$$var; test -z "$var_value"; thenrelink_command="$var=; export $var; $relink_command"elsefunc_quote_for_eval "$var_value"relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"fidonerelink_command="(cd `pwd`; $relink_command)"relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`fi# Quote $ECHO for shipping.if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; thencase $progpath in[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;esacqecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`elseqecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`fi# Only actually do things if not in dry run mode.$opt_dry_run || {# win32 will think the script is a binary if it has# a .exe suffix, so we strip it off here.case $output in*.exe) func_stripname '' '.exe' "$output"output=$func_stripname_result ;;esac# test for cygwin because mv fails w/o .exe extensionscase $host in*cygwin*)exeext=.exefunc_stripname '' '.exe' "$outputname"outputname=$func_stripname_result ;;*) exeext= ;;esaccase $host in*cygwin* | *mingw* )func_dirname_and_basename "$output" "" "."output_name=$func_basename_resultoutput_path=$func_dirname_resultcwrappersource="$output_path/$objdir/lt-$output_name.c"cwrapper="$output_path/$output_name.exe"$RM $cwrappersource $cwrappertrap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15func_emit_cwrapperexe_src > $cwrappersource# we should really use a build-platform specific compiler# here, but OTOH, the wrappers (shell script and this C one)# are only useful if you want to execute the "real" binary.# Since the "real" binary is built for $host, then this# wrapper might as well be built for $host, too.$opt_dry_run || {$LTCC $LTCFLAGS -o $cwrapper $cwrappersource$STRIP $cwrapper}# Now, create the wrapper script for func_source use:func_ltwrapper_scriptname $cwrapper$RM $func_ltwrapper_scriptname_resulttrap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15$opt_dry_run || {# note: this script will not be executed, so do not chmod.if test "x$build" = "x$host" ; then$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_resultelsefunc_emit_wrapper no > $func_ltwrapper_scriptname_resultfi};;* )$RM $outputtrap "$RM $output; exit $EXIT_FAILURE" 1 2 15func_emit_wrapper no > $outputchmod +x $output;;esac}exit $EXIT_SUCCESS;;esac# See if we need to build an old-fashioned archive.for oldlib in $oldlibs; doif test "$build_libtool_libs" = convenience; thenoldobjs="$libobjs_save $symfileobj"addlibs="$convenience"build_libtool_libs=noelseif test "$build_libtool_libs" = module; thenoldobjs="$libobjs_save"build_libtool_libs=noelseoldobjs="$old_deplibs $non_pic_objects"if test "$preload" = yes && test -f "$symfileobj"; thenoldobjs="$oldobjs $symfileobj"fifiaddlibs="$old_convenience"fiif test -n "$addlibs"; thengentop="$output_objdir/${outputname}x"generated="$generated $gentop"func_extract_archives $gentop $addlibsoldobjs="$oldobjs $func_extract_archives_result"fi# Do each command in the archive commands.if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; thencmds=$old_archive_from_new_cmdselse# Add any objects from preloaded convenience librariesif test -n "$dlprefiles"; thengentop="$output_objdir/${outputname}x"generated="$generated $gentop"func_extract_archives $gentop $dlprefilesoldobjs="$oldobjs $func_extract_archives_result"fi# POSIX demands no paths to be encoded in archives. We have# to avoid creating archives with duplicate basenames if we# might have to extract them afterwards, e.g., when creating a# static archive out of a convenience library, or when linking# the entirety of a libtool archive into another (currently# not supported by libtool).if (for obj in $oldobjsdofunc_basename "$obj"$ECHO "$func_basename_result"done | sort | sort -uc >/dev/null 2>&1); then:else$ECHO "copying selected object files to avoid basename conflicts..."gentop="$output_objdir/${outputname}x"generated="$generated $gentop"func_mkdir_p "$gentop"save_oldobjs=$oldobjsoldobjs=counter=1for obj in $save_oldobjsdofunc_basename "$obj"objbase="$func_basename_result"case " $oldobjs " in" ") oldobjs=$obj ;;*[\ /]"$objbase "*)while :; do# Make sure we don't pick an alternate name that also# overlaps.newobj=lt$counter-$objbasefunc_arith $counter + 1counter=$func_arith_resultcase " $oldobjs " in*[\ /]"$newobj "*) ;;*) if test ! -f "$gentop/$newobj"; then break; fi ;;esacdonefunc_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"oldobjs="$oldobjs $gentop/$newobj";;*) oldobjs="$oldobjs $obj" ;;esacdonefieval cmds=\"$old_archive_cmds\"func_len " $cmds"len=$func_len_resultif test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; thencmds=$old_archive_cmdselse# the command line is too long to link in one step, link in partsfunc_verbose "using piecewise archive linking..."save_RANLIB=$RANLIBRANLIB=:objlist=concat_cmds=save_oldobjs=$oldobjsoldobjs=# Is there a better way of finding the last object in the list?for obj in $save_oldobjsdolast_oldobj=$objdoneeval test_cmds=\"$old_archive_cmds\"func_len " $test_cmds"len0=$func_len_resultlen=$len0for obj in $save_oldobjsdofunc_len " $obj"func_arith $len + $func_len_resultlen=$func_arith_resultfunc_append objlist " $obj"if test "$len" -lt "$max_cmd_len"; then:else# the above command should be used before it gets too longoldobjs=$objlistif test "$obj" = "$last_oldobj" ; thenRANLIB=$save_RANLIBfitest -z "$concat_cmds" || concat_cmds=$concat_cmds~eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"objlist=len=$len0fidoneRANLIB=$save_RANLIBoldobjs=$objlistif test "X$oldobjs" = "X" ; theneval cmds=\"\$concat_cmds\"elseeval cmds=\"\$concat_cmds~\$old_archive_cmds\"fifififunc_execute_cmds "$cmds" 'exit $?'donetest -n "$generated" && \func_show_eval "${RM}r$generated"# Now create the libtool archive.case $output in*.la)old_library=test "$build_old_libs" = yes && old_library="$libname.$libext"func_verbose "creating $output"# Preserve any variables that may affect compiler behaviorfor var in $variables_saved_for_relink; doif eval test -z \"\${$var+set}\"; thenrelink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"elif eval var_value=\$$var; test -z "$var_value"; thenrelink_command="$var=; export $var; $relink_command"elsefunc_quote_for_eval "$var_value"relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"fidone# Quote the link command for shipping.relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`if test "$hardcode_automatic" = yes ; thenrelink_command=fi# Only create the output if not a dry run.$opt_dry_run || {for installed in no yes; doif test "$installed" = yes; thenif test -z "$install_libdir"; thenbreakfioutput="$output_objdir/$outputname"i# Replace all uninstalled libtool libraries with the installed onesnewdependency_libs=for deplib in $dependency_libs; docase $deplib in*.la)func_basename "$deplib"name="$func_basename_result"eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`test -z "$libdir" && \func_fatal_error "\`$deplib' is not a valid libtool archive"newdependency_libs="$newdependency_libs $libdir/$name";;*) newdependency_libs="$newdependency_libs $deplib" ;;esacdonedependency_libs="$newdependency_libs"newdlfiles=for lib in $dlfiles; docase $lib in*.la)func_basename "$lib"name="$func_basename_result"eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`test -z "$libdir" && \func_fatal_error "\`$lib' is not a valid libtool archive"newdlfiles="$newdlfiles $libdir/$name";;*) newdlfiles="$newdlfiles $lib" ;;esacdonedlfiles="$newdlfiles"newdlprefiles=for lib in $dlprefiles; docase $lib in*.la)# Only pass preopened files to the pseudo-archive (for# eventual linking with the app. that links it) if we# didn't already link the preopened objects directly into# the library:func_basename "$lib"name="$func_basename_result"eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`test -z "$libdir" && \func_fatal_error "\`$lib' is not a valid libtool archive"newdlprefiles="$newdlprefiles $libdir/$name";;esacdonedlprefiles="$newdlprefiles"elsenewdlfiles=for lib in $dlfiles; docase $lib in[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;*) abs=`pwd`"/$lib" ;;esacnewdlfiles="$newdlfiles $abs"donedlfiles="$newdlfiles"newdlprefiles=for lib in $dlprefiles; docase $lib in[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;*) abs=`pwd`"/$lib" ;;esacnewdlprefiles="$newdlprefiles $abs"donedlprefiles="$newdlprefiles"fi$RM $output# place dlname in correct position for cygwintdlname=$dlnamecase $host,$output,$installed,$module,$dlname in*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;esac$ECHO > $output "\# $outputname - a libtool library file# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION## Please DO NOT delete this file!# It is necessary for linking the library.# The name that we can dlopen(3).dlname='$tdlname'# Names of this library.library_names='$library_names'# The name of the static archive.old_library='$old_library'# Linker flags that can not go in dependency_libs.inherited_linker_flags='$new_inherited_linker_flags'# Libraries that this one depends upon.dependency_libs='$dependency_libs'# Names of additional weak libraries provided by this libraryweak_library_names='$weak_libs'# Version information for $libname.current=$currentage=$agerevision=$revision# Is this an already installed library?installed=$installed# Should we warn about portability when linking against -modules?shouldnotlink=$module# Files to dlopen/dlpreopendlopen='$dlfiles'dlpreopen='$dlprefiles'# Directory that this library needs to be installed in:libdir='$install_libdir'"if test "$installed" = no && test "$need_relink" = yes; then$ECHO >> $output "\relink_command=\"$relink_command\""fidone}# Do a symbolic link so that the libtool archive can be found in# LD_LIBRARY_PATH before the program is installed.func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?';;esacexit $EXIT_SUCCESS}{ test "$mode" = link || test "$mode" = relink; } &&func_mode_link ${1+"$@"}# func_mode_uninstall arg...func_mode_uninstall (){$opt_debugRM="$nonopt"files=rmforce=exit_status=0# This variable tells wrapper scripts just to set variables rather# than running their programs.libtool_install_magic="$magic"for argdocase $arg in-f) RM="$RM $arg"; rmforce=yes ;;-*) RM="$RM $arg" ;;*) files="$files $arg" ;;esacdonetest -z "$RM" && \func_fatal_help "you must specify an RM program"rmdirs=origobjdir="$objdir"for file in $files; dofunc_dirname "$file" "" "."dir="$func_dirname_result"if test "X$dir" = X.; thenobjdir="$origobjdir"elseobjdir="$dir/$origobjdir"fifunc_basename "$file"name="$func_basename_result"test "$mode" = uninstall && objdir="$dir"# Remember objdir for removal later, being careful to avoid duplicatesif test "$mode" = clean; thencase " $rmdirs " in*" $objdir "*) ;;*) rmdirs="$rmdirs $objdir" ;;esacfi# Don't error if the file doesn't exist and rm -f was used.if { test -L "$file"; } >/dev/null 2>&1 ||{ test -h "$file"; } >/dev/null 2>&1 ||test -f "$file"; then:elif test -d "$file"; thenexit_status=1continueelif test "$rmforce" = yes; thencontinuefirmfiles="$file"case $name in*.la)# Possibly a libtool archive, so verify it.if func_lalib_p "$file"; thenfunc_source $dir/$name# Delete the libtool libraries and symlinks.for n in $library_names; dormfiles="$rmfiles $objdir/$n"donetest -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"case "$mode" inclean)case " $library_names " in# " " in the beginning catches empty $dlname*" $dlname "*) ;;*) rmfiles="$rmfiles $objdir/$dlname" ;;esactest -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i";;uninstall)if test -n "$library_names"; then# Do each command in the postuninstall commands.func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'fiif test -n "$old_library"; then# Do each command in the old_postuninstall commands.func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'fi# FIXME: should reinstall the best remaining shared library.;;esacfi;;*.lo)# Possibly a libtool object, so verify it.if func_lalib_p "$file"; then# Read the .lo filefunc_source $dir/$name# Add PIC object to the list of files to remove.if test -n "$pic_object" &&test "$pic_object" != none; thenrmfiles="$rmfiles $dir/$pic_object"fi# Add non-PIC object to the list of files to remove.if test -n "$non_pic_object" &&test "$non_pic_object" != none; thenrmfiles="$rmfiles $dir/$non_pic_object"fifi;;*)if test "$mode" = clean ; thennoexename=$namecase $file in*.exe)func_stripname '' '.exe' "$file"file=$func_stripname_resultfunc_stripname '' '.exe' "$name"noexename=$func_stripname_result# $file with .exe has already been added to rmfiles,# add $file without .exermfiles="$rmfiles $file";;esac# Do a test to see if this is a libtool program.if func_ltwrapper_p "$file"; thenif func_ltwrapper_executable_p "$file"; thenfunc_ltwrapper_scriptname "$file"relink_command=func_source $func_ltwrapper_scriptname_resultrmfiles="$rmfiles $func_ltwrapper_scriptname_result"elserelink_command=func_source $dir/$noexenamefi# note $name still contains .exe if it was in $file originally# as does the version of $file that was added into $rmfilesrmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"if test "$fast_install" = yes && test -n "$relink_command"; thenrmfiles="$rmfiles $objdir/lt-$name"fiif test "X$noexename" != "X$name" ; thenrmfiles="$rmfiles $objdir/lt-${noexename}.c"fififi;;esacfunc_show_eval "$RM $rmfiles" 'exit_status=1'doneobjdir="$origobjdir"# Try to remove the ${objdir}s in the directories where we deleted filesfor dir in $rmdirs; doif test -d "$dir"; thenfunc_show_eval "rmdir $dir >/dev/null 2>&1"fidoneexit $exit_status}{ test "$mode" = uninstall || test "$mode" = clean; } &&func_mode_uninstall ${1+"$@"}test -z "$mode" && {help="$generic_help"func_fatal_help "you must specify a MODE"}test -z "$exec_cmd" && \func_fatal_help "invalid operation mode \`$mode'"if test -n "$exec_cmd"; theneval exec "$exec_cmd"exit $EXIT_FAILUREfiexit $exit_status# The TAGs below are defined such that we never get into a situation# in which we disable both kinds of libraries. Given conflicting# choices, we go for a static library, that is the most portable,# since we can't tell whether shared libraries were disabled because# the user asked for that or because the platform doesn't support# them. This is particularly important on AIX, because we don't# support having both static and shared libraries enabled at the same# time on that platform, so we default to a shared-only configuration.# If a disable-shared tag is given, we'll fallback to a static-only# configuration. But we'll never go from static-only to shared-only.# ### BEGIN LIBTOOL TAG CONFIG: disable-sharedbuild_libtool_libs=nobuild_old_libs=yes# ### END LIBTOOL TAG CONFIG: disable-shared# ### BEGIN LIBTOOL TAG CONFIG: disable-staticbuild_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`# ### END LIBTOOL TAG CONFIG: disable-static# Local Variables:# mode:shell-script# sh-indentation:2# End:# vi:sw=2
#! /bin/sh# Common stub for a few missing GNU programs while installing.scriptversion=2006-05-10.23# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006# Free Software Foundation, Inc.# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.# This program 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 General Public License for more details.# You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA# 02110-1301, USA.# As a special exception to the GNU General Public License, if you# distribute this file as part of a program that contains a# configuration script generated by Autoconf, you may include it under# the same distribution terms that you use for the rest of that program.if test $# -eq 0; thenecho 1>&2 "Try \`$0 --help' for more information"exit 1firun=:sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'sed_minuso='s/.* -o \([^ ]*\).*/\1/p'# In the cases where this matters, `missing' is being run in the# srcdir already.if test -f configure.ac; thenconfigure_ac=configure.acelseconfigure_ac=configure.infimsg="missing on your system"case $1 in--run)# Try to run requested program, and just exit if it succeeds.run=shift"$@" && exit 0# Exit code 63 means version mismatch. This often happens# when the user try to use an ancient version of a tool on# a file that requires a minimum version. In this case we# we should proceed has if the program had been absent, or# if --run hadn't been passed.if test $? = 63; thenrun=:msg="probably too old"fi;;-h|--h|--he|--hel|--help)echo "\$0 [OPTION]... PROGRAM [ARGUMENT]...Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return anerror status if there is no known handling for PROGRAM.Options:-h, --help display this help and exit-v, --version output version information and exit--run try to run the given command, and emulate it if it failsSupported PROGRAM values:aclocal touch file \`aclocal.m4'autoconf touch file \`configure'autoheader touch file \`config.h.in'autom4te touch the output file, or create a stub oneautomake touch all \`Makefile.in' filesbison create \`y.tab.[ch]', if possible, from existing .[ch]flex create \`lex.yy.c', if possible, from existing .chelp2man touch the output filelex create \`lex.yy.c', if possible, from existing .cmakeinfo touch the output filetar try tar, gnutar, gtar, then tar without non-portable flagsyacc create \`y.tab.[ch]', if possible, from existing .[ch]Send bug reports to <bug-automake@gnu.org>."exit $?;;-v|--v|--ve|--ver|--vers|--versi|--versio|--version)echo "missing $scriptversion (GNU Automake)"exit $?;;-*)echo 1>&2 "$0: Unknown \`$1' option"echo 1>&2 "Try \`$0 --help' for more information"exit 1;;esac# Now exit if we have it, but it failed. Also exit now if we# don't have it and --version was passed (most likely to detect# the program).case $1 inlex|yacc)# Not GNU programs, they don't have --version.;;tar)if test -n "$run"; thenecho 1>&2 "ERROR: \`tar' requires --run"exit 1elif test "x$2" = "x--version" || test "x$2" = "x--help"; thenexit 1fi;;*)if test -z "$run" && ($1 --version) > /dev/null 2>&1; then# We have it, but it failed.exit 1elif test "x$2" = "x--version" || test "x$2" = "x--help"; then# Could not run --version or --help. This is probably someone# running `$TOOL --version' or `$TOOL --help' to check whether# $TOOL exists and not knowing $TOOL uses missing.exit 1fi;;esac# If it does not exist, or fails to run (possibly an outdated version),# try to emulate it.case $1 inaclocal*)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified \`acinclude.m4' or \`${configure_ac}'. You might wantto install the \`Automake' and \`Perl' packages. Grab them fromany GNU archive site."touch aclocal.m4;;autoconf)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified \`${configure_ac}'. You might want to install the\`Autoconf' and \`GNU m4' packages. Grab them from any GNUarchive site."touch configure;;autoheader)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified \`acconfig.h' or \`${configure_ac}'. You might wantto install the \`Autoconf' and \`GNU m4' packages. Grab themfrom any GNU archive site."files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`test -z "$files" && files="config.h"touch_files=for f in $files; docase $f in*:*) touch_files="$touch_files "`echo "$f" |sed -e 's/^[^:]*://' -e 's/:.*//'`;;*) touch_files="$touch_files $f.in";;esacdonetouch $touch_files;;automake*)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.You might want to install the \`Automake' and \`Perl' packages.Grab them from any GNU archive site."find . -type f -name Makefile.am -print |sed 's/\.am$/.in/' |while read f; do touch "$f"; done;;autom4te)echo 1>&2 "\WARNING: \`$1' is needed, but is $msg.You might have modified some files without having theproper tools for further handling them.You can get \`$1' as part of \`Autoconf' from any GNUarchive site."file=`echo "$*" | sed -n "$sed_output"`test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`if test -f "$file"; thentouch $fileelsetest -z "$file" || exec >$fileecho "#! /bin/sh"echo "# Created by GNU Automake missing as a replacement of"echo "# $ $@"echo "exit 0"chmod +x $fileexit 1fi;;bison|yacc)echo 1>&2 "\WARNING: \`$1' $msg. You should only need it ifyou modified a \`.y' file. You may need the \`Bison' packagein order for those modifications to take effect. You can get\`Bison' from any GNU archive site."rm -f y.tab.c y.tab.hif test $# -ne 1; theneval LASTARG="\${$#}"case $LASTARG in*.y)SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`if test -f "$SRCFILE"; thencp "$SRCFILE" y.tab.cfiSRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`if test -f "$SRCFILE"; thencp "$SRCFILE" y.tab.hfi;;esacfiif test ! -f y.tab.h; thenecho >y.tab.hfiif test ! -f y.tab.c; thenecho 'main() { return 0; }' >y.tab.cfi;;lex|flex)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified a \`.l' file. You may need the \`Flex' packagein order for those modifications to take effect. You can get\`Flex' from any GNU archive site."rm -f lex.yy.cif test $# -ne 1; theneval LASTARG="\${$#}"case $LASTARG in*.l)SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`if test -f "$SRCFILE"; thencp "$SRCFILE" lex.yy.cfi;;esacfiif test ! -f lex.yy.c; thenecho 'main() { return 0; }' >lex.yy.cfi;;help2man)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified a dependency of a manual page. You may need the\`Help2man' package in order for those modifications to takeeffect. You can get \`Help2man' from any GNU archive site."file=`echo "$*" | sed -n "$sed_output"`test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`if test -f "$file"; thentouch $fileelsetest -z "$file" || exec >$fileecho ".ab help2man is required to generate this page"exit 1fi;;makeinfo)echo 1>&2 "\WARNING: \`$1' is $msg. You should only need it ifyou modified a \`.texi' or \`.texinfo' file, or any other fileindirectly affecting the aspect of the manual. The spuriouscall might also be the consequence of using a buggy \`make' (AIX,DU, IRIX). You might want to install the \`Texinfo' package orthe \`GNU make' package. Grab either from any GNU archive site."# The file to touch is that specified with -o ...file=`echo "$*" | sed -n "$sed_output"`test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`if test -z "$file"; then# ... or it is the one specified with @setfilename ...infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`file=`sed -n '/^@setfilename/{s/.* \([^ ]*\) *$/\1/pq}' $infile`# ... or it is derived from the source name (dir/f.texi becomes f.info)test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.infofi# If the file does not exist, the user really needs makeinfo;# let's fail without touching anything.test -f $file || exit 1touch $file;;tar)shift# We have already tried tar in the generic part.# Look for gnutar/gtar before invocation to avoid ugly error# messages.if (gnutar --version > /dev/null 2>&1); thengnutar "$@" && exit 0fiif (gtar --version > /dev/null 2>&1); thengtar "$@" && exit 0fifirstarg="$1"if shift; thencase $firstarg in*o*)firstarg=`echo "$firstarg" | sed s/o//`tar "$firstarg" "$@" && exit 0;;esaccase $firstarg in*h*)firstarg=`echo "$firstarg" | sed s/h//`tar "$firstarg" "$@" && exit 0;;esacfiecho 1>&2 "\WARNING: I can't seem to be able to run \`tar' with the given arguments.You may want to install GNU tar or Free paxutils, or check thecommand line arguments."exit 1;;*)echo 1>&2 "\WARNING: \`$1' is needed, and is $msg.You might have modified some files without having theproper tools for further handling them. Check the \`README' file,it often tells you about the needed prerequisites for installingthis package. You may also peek at any GNU archive site, in casesome other package would contain this missing \`$1' program."exit 1;;esacexit 0# Local variables:# eval: (add-hook 'write-file-hooks 'time-stamp)# time-stamp-start: "scriptversion="# time-stamp-format: "%:y-%02m-%02d.%02H"# time-stamp-end: "$"# End:
#!/bin/sh# Copyright (C) 2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp)ONIG_VERSION=5.9.2show_usage(){cat <<EOFUsage: onig-config [OPTION]Values for OPTION are:--prefix[=DIR] change prefix to DIR--prefix print prefix--exec-prefix[=DIR] change exec_prefix to DIR--exec-prefix print exec_prefix--cflags print C compiler flags--libs print library information--version print oniguruma version--help print this helpEOFexit 1}if test $# -eq 0; thenshow_usagefiprefix=/usr/localexec_prefix=${prefix}is_set_exec_prefix=nowhile test $# -gt 0; docase "$1" in-*=*) val=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`;;*) val=;;esaccase $1 in--prefix=*)prefix=$valif test $is_set_exec_prefix = no ; thenexec_prefix=$valfi;;--prefix)echo $prefix;;--exec-prefix=*)exec_prefix=$valis_set_exec_prefix=yes;;--exec-prefix)echo $exec_prefix;;--cflags)if test ${prefix}/include != /usr/include ; thenshow_includedir=-I${prefix}/includefiecho $show_includedir;;--libs)echo -L${exec_prefix}/lib -lonig;;--version)echo $ONIG_VERSION;;*)show_usage;;esacshiftdone# END
#!/bin/sh# Copyright (C) 2006 K.Kosako (sndgk393 AT ybb DOT ne DOT jp)ONIG_VERSION=@PACKAGE_VERSION@show_usage(){cat <<EOFUsage: onig-config [OPTION]Values for OPTION are:--prefix[=DIR] change prefix to DIR--prefix print prefix--exec-prefix[=DIR] change exec_prefix to DIR--exec-prefix print exec_prefix--cflags print C compiler flags--libs print library information--version print oniguruma version--help print this helpEOFexit 1}if test $# -eq 0; thenshow_usagefiprefix=@prefix@exec_prefix=@exec_prefix@is_set_exec_prefix=nowhile test $# -gt 0; docase "$1" in-*=*) val=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`;;*) val=;;esaccase $1 in--prefix=*)prefix=$valif test $is_set_exec_prefix = no ; thenexec_prefix=$valfi;;--prefix)echo $prefix;;--exec-prefix=*)exec_prefix=$valis_set_exec_prefix=yes;;--exec-prefix)echo $exec_prefix;;--cflags)if test @includedir@ != /usr/include ; thenshow_includedir=-I@includedir@fiecho $show_includedir;;--libs)echo -L@libdir@ -lonig;;--version)echo $ONIG_VERSION;;*)show_usage;;esacshiftdone# END
#ifndef ONIGGNU_H#define ONIGGNU_H/**********************************************************************oniggnu.h - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "oniguruma.h"#ifdef __cplusplusextern "C" {#endif#define RE_MBCTYPE_ASCII 0#define RE_MBCTYPE_EUC 1#define RE_MBCTYPE_SJIS 2#define RE_MBCTYPE_UTF8 3/* GNU regex options */#ifndef RE_NREGS#define RE_NREGS ONIG_NREGION#endif#define RE_OPTION_IGNORECASE ONIG_OPTION_IGNORECASE#define RE_OPTION_EXTENDED ONIG_OPTION_EXTEND#define RE_OPTION_MULTILINE ONIG_OPTION_MULTILINE#define RE_OPTION_SINGLELINE ONIG_OPTION_SINGLELINE#define RE_OPTION_LONGEST ONIG_OPTION_FIND_LONGEST#define RE_OPTION_POSIXLINE (RE_OPTION_MULTILINE|RE_OPTION_SINGLELINE)#define RE_OPTION_FIND_NOT_EMPTY ONIG_OPTION_FIND_NOT_EMPTY#define RE_OPTION_NEGATE_SINGLELINE ONIG_OPTION_NEGATE_SINGLELINE#define RE_OPTION_DONT_CAPTURE_GROUP ONIG_OPTION_DONT_CAPTURE_GROUP#define RE_OPTION_CAPTURE_GROUP ONIG_OPTION_CAPTURE_GROUPONIG_EXTERNvoid re_mbcinit P_((int));ONIG_EXTERNint re_compile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf));ONIG_EXTERNint re_recompile_pattern P_((const char*, int, struct re_pattern_buffer*, char* err_buf));ONIG_EXTERNvoid re_free_pattern P_((struct re_pattern_buffer*));ONIG_EXTERNint re_adjust_startpos P_((struct re_pattern_buffer*, const char*, int, int, int));ONIG_EXTERNint re_search P_((struct re_pattern_buffer*, const char*, int, int, int, struct re_registers*));ONIG_EXTERNint re_match P_((struct re_pattern_buffer*, const char *, int, int, struct re_registers*));ONIG_EXTERNvoid re_set_casetable P_((const char*));ONIG_EXTERNvoid re_free_registers P_((struct re_registers*));ONIG_EXTERNint re_alloc_pattern P_((struct re_pattern_buffer**)); /* added */#ifdef __cplusplus}#endif#endif /* ONIGGNU_H */
#ifndef ONIGPOSIX_H#define ONIGPOSIX_H/**********************************************************************onigposix.h - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2005 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include <stdlib.h>#ifdef __cplusplusextern "C" {#endif/* options */#define REG_ICASE (1<<0)#define REG_NEWLINE (1<<1)#define REG_NOTBOL (1<<2)#define REG_NOTEOL (1<<3)#define REG_EXTENDED (1<<4) /* if not setted, Basic Onigular Expression */#define REG_NOSUB (1<<5)/* POSIX error codes */#define REG_NOMATCH 1#define REG_BADPAT 2#define REG_ECOLLATE 3#define REG_ECTYPE 4#define REG_EESCAPE 5#define REG_ESUBREG 6#define REG_EBRACK 7#define REG_EPAREN 8#define REG_EBRACE 9#define REG_BADBR 10#define REG_ERANGE 11#define REG_ESPACE 12#define REG_BADRPT 13/* extended error codes */#define REG_EONIG_INTERNAL 14#define REG_EONIG_BADWC 15#define REG_EONIG_BADARG 16#define REG_EONIG_THREAD 17/* character encodings (for reg_set_encoding()) */#define REG_POSIX_ENCODING_ASCII 0#define REG_POSIX_ENCODING_EUC_JP 1#define REG_POSIX_ENCODING_SJIS 2#define REG_POSIX_ENCODING_UTF8 3#define REG_POSIX_ENCODING_UTF16_BE 4#define REG_POSIX_ENCODING_UTF16_LE 5typedef int regoff_t;typedef struct {regoff_t rm_so;regoff_t rm_eo;} regmatch_t;/* POSIX regex_t */typedef struct {void* onig; /* Oniguruma regex_t* */size_t re_nsub;int comp_options;} regex_t;#ifndef P_#if defined(__STDC__) || defined(_WIN32)# define P_(args) args#else# define P_(args) ()#endif#endif#ifndef ONIG_EXTERN#if defined(_WIN32) && !defined(__GNUC__)#if defined(EXPORT)#define ONIG_EXTERN extern __declspec(dllexport)#else#define ONIG_EXTERN extern __declspec(dllimport)#endif#endif#endif#ifndef ONIG_EXTERN#define ONIG_EXTERN extern#endif#ifndef ONIGURUMA_Htypedef unsigned int OnigOptionType;/* syntax */typedef struct {unsigned int op;unsigned int op2;unsigned int behavior;OnigOptionType options; /* default option */} OnigSyntaxType;ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;/* predefined syntaxes (see regsyntax.c) */#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)/* default syntax */#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntaxONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;ONIG_EXTERN int onig_set_default_syntax P_((OnigSyntaxType* syntax));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 */ONIG_EXTERN int regcomp P_((regex_t* reg, const char* pat, int options));ONIG_EXTERN int regexec P_((regex_t* reg, const char* str, size_t nmatch, regmatch_t* matches, int options));ONIG_EXTERN void regfree P_((regex_t* reg));ONIG_EXTERN size_t regerror P_((int code, const regex_t* reg, char* buf, size_t size));/* extended API */ONIG_EXTERN void reg_set_encoding P_((int enc));ONIG_EXTERN int reg_name_to_group_numbers P_((regex_t* reg, const unsigned char* name, const unsigned char* name_end, int** nums));ONIG_EXTERN int reg_foreach_name P_((regex_t* reg, int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*), void* arg));ONIG_EXTERN int reg_number_of_names P_((regex_t* reg));#ifdef __cplusplus}#endif#endif /* ONIGPOSIX_H */
#ifndef ONIGURUMA_H#define ONIGURUMA_H/**********************************************************************oniguruma.h - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#ifdef __cplusplusextern "C" {#endif#define ONIGURUMA#define ONIGURUMA_VERSION_MAJOR 5#define ONIGURUMA_VERSION_MINOR 9#define ONIGURUMA_VERSION_TEENY 2#ifdef __cplusplus# ifndef HAVE_PROTOTYPES# define HAVE_PROTOTYPES 1# endif# ifndef HAVE_STDARG_PROTOTYPES# define HAVE_STDARG_PROTOTYPES 1# endif#endif/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4# ifndef HAVE_STDARG_PROTOTYPES# define HAVE_STDARG_PROTOTYPES 1# endif#endif#ifdef HAVE_STDARG_H# ifndef HAVE_STDARG_PROTOTYPES# define HAVE_STDARG_PROTOTYPES 1# endif#endif#ifndef P_#if defined(__STDC__) || defined(_WIN32)# define P_(args) args#else# define P_(args) ()#endif#endif#ifndef PV_#ifdef HAVE_STDARG_PROTOTYPES# define PV_(args) args#else# define PV_(args) ()#endif#endif#ifndef ONIG_EXTERN#if defined(_WIN32) && !defined(__GNUC__)#if defined(EXPORT) || defined(RUBY_EXPORT)#define ONIG_EXTERN extern __declspec(dllexport)#else#define ONIG_EXTERN extern __declspec(dllimport)#endif#endif#endif#ifndef ONIG_EXTERN#define ONIG_EXTERN extern#endif/* PART: character encoding */#ifndef ONIG_ESCAPE_UCHAR_COLLISION#define UChar OnigUChar#endiftypedef unsigned char OnigUChar;typedef unsigned long OnigCodePoint;typedef unsigned int OnigCtype;typedef unsigned int OnigDistance;#define ONIG_INFINITE_DISTANCE ~((OnigDistance )0)typedef unsigned int OnigCaseFoldType; /* case fold flag */ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;/* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA (1<<1) *//* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH (1<<2) */#define ONIGENC_CASE_FOLD_TURKISH_AZERI (1<<20)#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR (1<<30)#define ONIGENC_CASE_FOLD_MIN INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR#define ONIGENC_CASE_FOLD_DEFAULT OnigDefaultCaseFoldFlag#define ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN 3#define ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM 13/* 13 => Unicode:0x1ffc *//* code range */#define ONIGENC_CODE_RANGE_NUM(range) ((int )range[0])#define ONIGENC_CODE_RANGE_FROM(range,i) range[((i)*2) + 1]#define ONIGENC_CODE_RANGE_TO(range,i) range[((i)*2) + 2]typedef struct {int byte_len; /* argument(original) character(s) byte length */int code_len; /* number of code */OnigCodePoint code[ONIGENC_MAX_COMP_CASE_FOLD_CODE_LEN];} OnigCaseFoldCodeItem;typedef struct {OnigCodePoint esc;OnigCodePoint anychar;OnigCodePoint anytime;OnigCodePoint zero_or_one_time;OnigCodePoint one_or_more_time;OnigCodePoint anychar_anytime;} OnigMetaCharTableType;typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);typedef struct OnigEncodingTypeST {int (*mbc_enc_len)(const OnigUChar* p);const char* name;int max_enc_len;int min_enc_len;int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end);OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end);int (*code_to_mbclen)(OnigCodePoint code);int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf);int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to);int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg);int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[]);int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype);int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]);OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p);int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end);} OnigEncodingType;typedef OnigEncodingType* OnigEncoding;ONIG_EXTERN OnigEncodingType OnigEncodingASCII;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_1;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_2;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_3;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_4;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_5;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_6;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_7;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_8;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_9;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_10;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_11;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_13;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_14;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_15;ONIG_EXTERN OnigEncodingType OnigEncodingISO_8859_16;ONIG_EXTERN OnigEncodingType OnigEncodingUTF8;ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_BE;ONIG_EXTERN OnigEncodingType OnigEncodingUTF16_LE;ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_BE;ONIG_EXTERN OnigEncodingType OnigEncodingUTF32_LE;ONIG_EXTERN OnigEncodingType OnigEncodingEUC_JP;ONIG_EXTERN OnigEncodingType OnigEncodingEUC_TW;ONIG_EXTERN OnigEncodingType OnigEncodingEUC_KR;ONIG_EXTERN OnigEncodingType OnigEncodingEUC_CN;ONIG_EXTERN OnigEncodingType OnigEncodingSJIS;ONIG_EXTERN OnigEncodingType OnigEncodingKOI8;ONIG_EXTERN OnigEncodingType OnigEncodingKOI8_R;ONIG_EXTERN OnigEncodingType OnigEncodingCP1251;ONIG_EXTERN OnigEncodingType OnigEncodingBIG5;ONIG_EXTERN OnigEncodingType OnigEncodingGB18030;#define ONIG_ENCODING_ASCII (&OnigEncodingASCII)#define ONIG_ENCODING_ISO_8859_1 (&OnigEncodingISO_8859_1)#define ONIG_ENCODING_ISO_8859_2 (&OnigEncodingISO_8859_2)#define ONIG_ENCODING_ISO_8859_3 (&OnigEncodingISO_8859_3)#define ONIG_ENCODING_ISO_8859_4 (&OnigEncodingISO_8859_4)#define ONIG_ENCODING_ISO_8859_5 (&OnigEncodingISO_8859_5)#define ONIG_ENCODING_ISO_8859_6 (&OnigEncodingISO_8859_6)#define ONIG_ENCODING_ISO_8859_7 (&OnigEncodingISO_8859_7)#define ONIG_ENCODING_ISO_8859_8 (&OnigEncodingISO_8859_8)#define ONIG_ENCODING_ISO_8859_9 (&OnigEncodingISO_8859_9)#define ONIG_ENCODING_ISO_8859_10 (&OnigEncodingISO_8859_10)#define ONIG_ENCODING_ISO_8859_11 (&OnigEncodingISO_8859_11)#define ONIG_ENCODING_ISO_8859_13 (&OnigEncodingISO_8859_13)#define ONIG_ENCODING_ISO_8859_14 (&OnigEncodingISO_8859_14)#define ONIG_ENCODING_ISO_8859_15 (&OnigEncodingISO_8859_15)#define ONIG_ENCODING_ISO_8859_16 (&OnigEncodingISO_8859_16)#define ONIG_ENCODING_UTF8 (&OnigEncodingUTF8)#define ONIG_ENCODING_UTF16_BE (&OnigEncodingUTF16_BE)#define ONIG_ENCODING_UTF16_LE (&OnigEncodingUTF16_LE)#define ONIG_ENCODING_UTF32_BE (&OnigEncodingUTF32_BE)#define ONIG_ENCODING_UTF32_LE (&OnigEncodingUTF32_LE)#define ONIG_ENCODING_EUC_JP (&OnigEncodingEUC_JP)#define ONIG_ENCODING_EUC_TW (&OnigEncodingEUC_TW)#define ONIG_ENCODING_EUC_KR (&OnigEncodingEUC_KR)#define ONIG_ENCODING_EUC_CN (&OnigEncodingEUC_CN)#define ONIG_ENCODING_SJIS (&OnigEncodingSJIS)#define ONIG_ENCODING_KOI8 (&OnigEncodingKOI8)#define ONIG_ENCODING_KOI8_R (&OnigEncodingKOI8_R)#define ONIG_ENCODING_CP1251 (&OnigEncodingCP1251)#define ONIG_ENCODING_BIG5 (&OnigEncodingBIG5)#define ONIG_ENCODING_GB18030 (&OnigEncodingGB18030)#define ONIG_ENCODING_UNDEF ((OnigEncoding )0)/* work size */#define ONIGENC_CODE_TO_MBC_MAXLEN 7#define ONIGENC_MBC_CASE_FOLD_MAXLEN 18/* 18: 6(max-byte) * 3(case-fold chars) *//* character types */#define ONIGENC_CTYPE_NEWLINE 0#define ONIGENC_CTYPE_ALPHA 1#define ONIGENC_CTYPE_BLANK 2#define ONIGENC_CTYPE_CNTRL 3#define ONIGENC_CTYPE_DIGIT 4#define ONIGENC_CTYPE_GRAPH 5#define ONIGENC_CTYPE_LOWER 6#define ONIGENC_CTYPE_PRINT 7#define ONIGENC_CTYPE_PUNCT 8#define ONIGENC_CTYPE_SPACE 9#define ONIGENC_CTYPE_UPPER 10#define ONIGENC_CTYPE_XDIGIT 11#define ONIGENC_CTYPE_WORD 12#define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */#define ONIGENC_CTYPE_ASCII 14#define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII#define onig_enc_len(enc,p,end) ONIGENC_MBC_ENC_LEN(enc,p)#define ONIGENC_IS_UNDEF(enc) ((enc) == ONIG_ENCODING_UNDEF)#define ONIGENC_IS_SINGLEBYTE(enc) (ONIGENC_MBC_MAXLEN(enc) == 1)#define ONIGENC_IS_MBC_HEAD(enc,p) (ONIGENC_MBC_ENC_LEN(enc,p) != 1)#define ONIGENC_IS_MBC_ASCII(p) (*(p) < 128)#define ONIGENC_IS_CODE_ASCII(code) ((code) < 128)#define ONIGENC_IS_MBC_WORD(enc,s,end) \ONIGENC_IS_CODE_WORD(enc,ONIGENC_MBC_TO_CODE(enc,s,end))#define ONIGENC_NAME(enc) ((enc)->name)#define ONIGENC_MBC_CASE_FOLD(enc,flag,pp,end,buf) \(enc)->mbc_case_fold(flag,(const OnigUChar** )pp,end,buf)#define ONIGENC_IS_ALLOWED_REVERSE_MATCH(enc,s,end) \(enc)->is_allowed_reverse_match(s,end)#define ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc,start,s) \(enc)->left_adjust_char_head(start, s)#define ONIGENC_APPLY_ALL_CASE_FOLD(enc,case_fold_flag,f,arg) \(enc)->apply_all_case_fold(case_fold_flag,f,arg)#define ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc,case_fold_flag,p,end,acs) \(enc)->get_case_fold_codes_by_str(case_fold_flag,p,end,acs)#define ONIGENC_STEP_BACK(enc,start,s,n) \onigenc_step_back((enc),(start),(s),(n))#define ONIGENC_MBC_ENC_LEN(enc,p) (enc)->mbc_enc_len(p)#define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len)#define ONIGENC_MBC_MAXLEN_DIST(enc) ONIGENC_MBC_MAXLEN(enc)#define ONIGENC_MBC_MINLEN(enc) ((enc)->min_enc_len)#define ONIGENC_IS_MBC_NEWLINE(enc,p,end) (enc)->is_mbc_newline((p),(end))#define ONIGENC_MBC_TO_CODE(enc,p,end) (enc)->mbc_to_code((p),(end))#define ONIGENC_CODE_TO_MBCLEN(enc,code) (enc)->code_to_mbclen(code)#define ONIGENC_CODE_TO_MBC(enc,code,buf) (enc)->code_to_mbc(code,buf)#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc,p,end) \(enc)->property_name_to_ctype(enc,p,end)#define ONIGENC_IS_CODE_CTYPE(enc,code,ctype) (enc)->is_code_ctype(code,ctype)#define ONIGENC_IS_CODE_NEWLINE(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_NEWLINE)#define ONIGENC_IS_CODE_GRAPH(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_GRAPH)#define ONIGENC_IS_CODE_PRINT(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PRINT)#define ONIGENC_IS_CODE_ALNUM(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALNUM)#define ONIGENC_IS_CODE_ALPHA(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_ALPHA)#define ONIGENC_IS_CODE_LOWER(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_LOWER)#define ONIGENC_IS_CODE_UPPER(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_UPPER)#define ONIGENC_IS_CODE_CNTRL(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_CNTRL)#define ONIGENC_IS_CODE_PUNCT(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_PUNCT)#define ONIGENC_IS_CODE_SPACE(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_SPACE)#define ONIGENC_IS_CODE_BLANK(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_BLANK)#define ONIGENC_IS_CODE_DIGIT(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT)#define ONIGENC_IS_CODE_XDIGIT(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_XDIGIT)#define ONIGENC_IS_CODE_WORD(enc,code) \ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_WORD)#define ONIGENC_GET_CTYPE_CODE_RANGE(enc,ctype,sbout,ranges) \(enc)->get_ctype_code_range(ctype,sbout,ranges)ONIG_EXTERNOnigUChar* onigenc_step_back P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, int n));/* encoding API */ONIG_EXTERNint onigenc_init P_((void));ONIG_EXTERNint onigenc_set_default_encoding P_((OnigEncoding enc));ONIG_EXTERNOnigEncoding onigenc_get_default_encoding P_((void));ONIG_EXTERNvoid onigenc_set_default_caseconv_table P_((const OnigUChar* table));ONIG_EXTERNOnigUChar* onigenc_get_right_adjust_char_head_with_prev P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s, const OnigUChar** prev));ONIG_EXTERNOnigUChar* onigenc_get_prev_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));ONIG_EXTERNOnigUChar* onigenc_get_left_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));ONIG_EXTERNOnigUChar* onigenc_get_right_adjust_char_head P_((OnigEncoding enc, const OnigUChar* start, const OnigUChar* s));ONIG_EXTERNint onigenc_strlen P_((OnigEncoding enc, const OnigUChar* p, const OnigUChar* end));ONIG_EXTERNint onigenc_strlen_null P_((OnigEncoding enc, const OnigUChar* p));ONIG_EXTERNint onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));/* PART: regular expression *//* config parameters */#define ONIG_NREGION 10#define ONIG_MAX_BACKREF_NUM 1000#define ONIG_MAX_REPEAT_NUM 100000#define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000/* constants */#define ONIG_MAX_ERROR_MESSAGE_LEN 90typedef unsigned int OnigOptionType;#define ONIG_OPTION_DEFAULT ONIG_OPTION_NONE/* options */#define ONIG_OPTION_NONE 0U#define ONIG_OPTION_IGNORECASE 1U#define ONIG_OPTION_EXTEND (ONIG_OPTION_IGNORECASE << 1)#define ONIG_OPTION_MULTILINE (ONIG_OPTION_EXTEND << 1)#define ONIG_OPTION_SINGLELINE (ONIG_OPTION_MULTILINE << 1)#define ONIG_OPTION_FIND_LONGEST (ONIG_OPTION_SINGLELINE << 1)#define ONIG_OPTION_FIND_NOT_EMPTY (ONIG_OPTION_FIND_LONGEST << 1)#define ONIG_OPTION_NEGATE_SINGLELINE (ONIG_OPTION_FIND_NOT_EMPTY << 1)#define ONIG_OPTION_DONT_CAPTURE_GROUP (ONIG_OPTION_NEGATE_SINGLELINE << 1)#define ONIG_OPTION_CAPTURE_GROUP (ONIG_OPTION_DONT_CAPTURE_GROUP << 1)/* options (search time) */#define ONIG_OPTION_NOTBOL (ONIG_OPTION_CAPTURE_GROUP << 1)#define ONIG_OPTION_NOTEOL (ONIG_OPTION_NOTBOL << 1)#define ONIG_OPTION_POSIX_REGION (ONIG_OPTION_NOTEOL << 1)#define ONIG_OPTION_MAXBIT ONIG_OPTION_POSIX_REGION /* limit */#define ONIG_OPTION_ON(options,regopt) ((options) |= (regopt))#define ONIG_OPTION_OFF(options,regopt) ((options) &= ~(regopt))#define ONIG_IS_OPTION_ON(options,option) ((options) & (option))/* syntax */typedef struct {unsigned int op;unsigned int op2;unsigned int behavior;OnigOptionType options; /* default option */OnigMetaCharTableType meta_char_table;} OnigSyntaxType;ONIG_EXTERN OnigSyntaxType OnigSyntaxASIS;ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixBasic;ONIG_EXTERN OnigSyntaxType OnigSyntaxPosixExtended;ONIG_EXTERN OnigSyntaxType OnigSyntaxEmacs;ONIG_EXTERN OnigSyntaxType OnigSyntaxGrep;ONIG_EXTERN OnigSyntaxType OnigSyntaxGnuRegex;ONIG_EXTERN OnigSyntaxType OnigSyntaxJava;ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl;ONIG_EXTERN OnigSyntaxType OnigSyntaxPerl_NG;ONIG_EXTERN OnigSyntaxType OnigSyntaxRuby;/* predefined syntaxes (see regsyntax.c) */#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)#define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)/* default syntax */ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;#define ONIG_SYNTAX_DEFAULT OnigDefaultSyntax/* syntax (operators) */#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS (1U<<0)#define ONIG_SYN_OP_DOT_ANYCHAR (1U<<1) /* . */#define ONIG_SYN_OP_ASTERISK_ZERO_INF (1U<<2) /* * */#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF (1U<<3)#define ONIG_SYN_OP_PLUS_ONE_INF (1U<<4) /* + */#define ONIG_SYN_OP_ESC_PLUS_ONE_INF (1U<<5)#define ONIG_SYN_OP_QMARK_ZERO_ONE (1U<<6) /* ? */#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE (1U<<7)#define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */#define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */#define ONIG_SYN_OP_VBAR_ALT (1U<<10) /* | */#define ONIG_SYN_OP_ESC_VBAR_ALT (1U<<11) /* \| */#define ONIG_SYN_OP_LPAREN_SUBEXP (1U<<12) /* (...) */#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP (1U<<13) /* \(...\) */#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR (1U<<14) /* \A, \Z, \z */#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR (1U<<15) /* \G */#define ONIG_SYN_OP_DECIMAL_BACKREF (1U<<16) /* \num */#define ONIG_SYN_OP_BRACKET_CC (1U<<17) /* [...] */#define ONIG_SYN_OP_ESC_W_WORD (1U<<18) /* \w, \W */#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END (1U<<19) /* \<. \> */#define ONIG_SYN_OP_ESC_B_WORD_BOUND (1U<<20) /* \b, \B */#define ONIG_SYN_OP_ESC_S_WHITE_SPACE (1U<<21) /* \s, \S */#define ONIG_SYN_OP_ESC_D_DIGIT (1U<<22) /* \d, \D */#define ONIG_SYN_OP_LINE_ANCHOR (1U<<23) /* ^, $ */#define ONIG_SYN_OP_POSIX_BRACKET (1U<<24) /* [:xxxx:] */#define ONIG_SYN_OP_QMARK_NON_GREEDY (1U<<25) /* ??,*?,+?,{n,m}? */#define ONIG_SYN_OP_ESC_CONTROL_CHARS (1U<<26) /* \n,\r,\t,\a ... */#define ONIG_SYN_OP_ESC_C_CONTROL (1U<<27) /* \cx */#define ONIG_SYN_OP_ESC_OCTAL3 (1U<<28) /* \OOO */#define ONIG_SYN_OP_ESC_X_HEX2 (1U<<29) /* \xHH */#define ONIG_SYN_OP_ESC_X_BRACE_HEX8 (1U<<30) /* \x{7HHHHHHH} */#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE (1U<<0) /* \Q...\E */#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT (1U<<1) /* (?...) */#define ONIG_SYN_OP2_OPTION_PERL (1U<<2) /* (?imsx),(?-imsx) */#define ONIG_SYN_OP2_OPTION_RUBY (1U<<3) /* (?imx), (?-imx) */#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT (1U<<4) /* ?+,*+,++ */#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL (1U<<5) /* {n,m}+ */#define ONIG_SYN_OP2_CCLASS_SET_OP (1U<<6) /* [...&&..[..]..] */#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP (1U<<7) /* (?<name>...) */#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF (1U<<8) /* \k<name> */#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL (1U<<9) /* \g<name>, \g<n> */#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY (1U<<10) /* (?@..),(?@<x>..) */#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL (1U<<11) /* \C-x */#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META (1U<<12) /* \M-x */#define ONIG_SYN_OP2_ESC_V_VTAB (1U<<13) /* \v as VTAB */#define ONIG_SYN_OP2_ESC_U_HEX4 (1U<<14) /* \uHHHH */#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR (1U<<15) /* \`, \' */#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY (1U<<16) /* \p{...}, \P{...} */#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT (1U<<17) /* \p{^..}, \P{^..} *//* #define ONIG_SYN_OP2_CHAR_PROPERTY_PREFIX_IS (1U<<18) */#define ONIG_SYN_OP2_ESC_H_XDIGIT (1U<<19) /* \h, \H */#define ONIG_SYN_OP2_INEFFECTIVE_ESCAPE (1U<<20) /* \ *//* syntax (behavior) */#define ONIG_SYN_CONTEXT_INDEP_ANCHORS (1U<<31) /* not implemented */#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS (1U<<0) /* ?, *, +, {n,m} */#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS (1U<<1) /* error or ignore */#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP (1U<<2) /* ...)... */#define ONIG_SYN_ALLOW_INVALID_INTERVAL (1U<<3) /* {??? */#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV (1U<<4) /* {,n} => {0,n} */#define ONIG_SYN_STRICT_CHECK_BACKREF (1U<<5) /* /(\1)/,/\1()/ ..*/#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND (1U<<6) /* (?<=a|bc) */#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP (1U<<7) /* see doc/RE */#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME (1U<<8) /* (?<x>)(?<x>) */#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY (1U<<9) /* a{n}?=(?:a{n})? *//* syntax (behavior) in char class [...] */#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC (1U<<20) /* [^...] */#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC (1U<<21) /* [..\w..] etc.. */#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC (1U<<22)#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC (1U<<23) /* [0-9-a]=[0-9\-a] *//* syntax (behavior) warning */#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED (1U<<24) /* [,-,] */#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT (1U<<25) /* (?:a*)+ *//* meta character specifiers (onig_set_meta_char()) */#define ONIG_META_CHAR_ESCAPE 0#define ONIG_META_CHAR_ANYCHAR 1#define ONIG_META_CHAR_ANYTIME 2#define ONIG_META_CHAR_ZERO_OR_ONE_TIME 3#define ONIG_META_CHAR_ONE_OR_MORE_TIME 4#define ONIG_META_CHAR_ANYCHAR_ANYTIME 5#define ONIG_INEFFECTIVE_META_CHAR 0/* error codes */#define ONIG_IS_PATTERN_ERROR(ecode) ((ecode) <= -100 && (ecode) > -1000)/* normal return */#define ONIG_NORMAL 0#define ONIG_MISMATCH -1#define ONIG_NO_SUPPORT_CONFIG -2/* internal error */#define ONIGERR_MEMORY -5#define ONIGERR_TYPE_BUG -6#define ONIGERR_PARSER_BUG -11#define ONIGERR_STACK_BUG -12#define ONIGERR_UNDEFINED_BYTECODE -13#define ONIGERR_UNEXPECTED_BYTECODE -14#define ONIGERR_MATCH_STACK_LIMIT_OVER -15#define ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED -21#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22/* general error */#define ONIGERR_INVALID_ARGUMENT -30/* syntax error */#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101#define ONIGERR_EMPTY_CHAR_CLASS -102#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS -103#define ONIGERR_END_PATTERN_AT_ESCAPE -104#define ONIGERR_END_PATTERN_AT_META -105#define ONIGERR_END_PATTERN_AT_CONTROL -106#define ONIGERR_META_CODE_SYNTAX -108#define ONIGERR_CONTROL_CODE_SYNTAX -109#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE -110#define ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE -111#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS -112#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED -113#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID -114#define ONIGERR_NESTED_REPEAT_OPERATOR -115#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS -116#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS -117#define ONIGERR_END_PATTERN_IN_GROUP -118#define ONIGERR_UNDEFINED_GROUP_OPTION -119#define ONIGERR_INVALID_POSIX_BRACKET_TYPE -121#define ONIGERR_INVALID_LOOK_BEHIND_PATTERN -122#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN -123/* values error (syntax error) */#define ONIGERR_TOO_BIG_NUMBER -200#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE -201#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE -202#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS -203#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE -204#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES -205#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING -206#define ONIGERR_TOO_BIG_BACKREF_NUMBER -207#define ONIGERR_INVALID_BACKREF -208#define ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED -209#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE -212#define ONIGERR_EMPTY_GROUP_NAME -214#define ONIGERR_INVALID_GROUP_NAME -215#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME -216#define ONIGERR_UNDEFINED_NAME_REFERENCE -217#define ONIGERR_UNDEFINED_GROUP_REFERENCE -218#define ONIGERR_MULTIPLEX_DEFINED_NAME -219#define ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL -220#define ONIGERR_NEVER_ENDING_RECURSION -221#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222#define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223#define ONIGERR_INVALID_CODE_POINT_VALUE -400#define ONIGERR_INVALID_WIDE_CHAR_VALUE -400#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401#define ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION -402#define ONIGERR_INVALID_COMBINATION_OF_OPTIONS -403/* errors related to thread */#define ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT -1001/* must be smaller than BIT_STATUS_BITS_NUM (unsigned int * 8) */#define ONIG_MAX_CAPTURE_HISTORY_GROUP 31#define ONIG_IS_CAPTURE_HISTORY_GROUP(r, i) \((i) <= ONIG_MAX_CAPTURE_HISTORY_GROUP && (r)->list && (r)->list[i])typedef struct OnigCaptureTreeNodeStruct {int group; /* group number */int beg;int end;int allocated;int num_childs;struct OnigCaptureTreeNodeStruct** childs;} OnigCaptureTreeNode;/* match result region type */struct re_registers {int allocated;int num_regs;int* beg;int* end;/* extended */OnigCaptureTreeNode* history_root; /* capture history tree root */};/* capture tree traverse */#define ONIG_TRAVERSE_CALLBACK_AT_FIRST 1#define ONIG_TRAVERSE_CALLBACK_AT_LAST 2#define ONIG_TRAVERSE_CALLBACK_AT_BOTH \( ONIG_TRAVERSE_CALLBACK_AT_FIRST | ONIG_TRAVERSE_CALLBACK_AT_LAST )#define ONIG_REGION_NOTPOS -1typedef struct re_registers OnigRegion;typedef struct {OnigEncoding enc;OnigUChar* par;OnigUChar* par_end;} OnigErrorInfo;typedef struct {int lower;int upper;} OnigRepeatRange;typedef void (*OnigWarnFunc) P_((const char* s));extern void onig_null_warn P_((const char* s));#define ONIG_NULL_WARN onig_null_warn#define ONIG_CHAR_TABLE_SIZE 256/* regex_t state */#define ONIG_STATE_NORMAL 0#define ONIG_STATE_SEARCHING 1#define ONIG_STATE_COMPILING -1#define ONIG_STATE_MODIFY -2#define ONIG_STATE(reg) \((reg)->state > 0 ? ONIG_STATE_SEARCHING : (reg)->state)typedef struct re_pattern_buffer {/* common members of BBuf(bytes-buffer) */unsigned char* p; /* compiled pattern */unsigned int used; /* used space for p */unsigned int alloc; /* allocated space for p */int state; /* normal, searching, compiling */int num_mem; /* used memory(...) num counted from 1 */int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */int num_null_check; /* OP_NULL_CHECK_START/END id counter */int num_comb_exp_check; /* combination explosion check */int num_call; /* number of subexp call */unsigned int capture_history; /* (?@...) flag (1-31) */unsigned int bt_mem_start; /* need backtrack flag */unsigned int bt_mem_end; /* need backtrack flag */int stack_pop_level;int repeat_range_alloc;OnigRepeatRange* repeat_range;OnigEncoding enc;OnigOptionType options;OnigSyntaxType* syntax;OnigCaseFoldType case_fold_flag;void* name_table;/* optimization info (string search, char-map and anchors) */int optimize; /* optimize flag */int threshold_len; /* search str-length for apply optimize */int anchor; /* BEGIN_BUF, BEGIN_POS, (SEMI_)END_BUF */OnigDistance anchor_dmin; /* (SEMI_)END_BUF anchor distance */OnigDistance anchor_dmax; /* (SEMI_)END_BUF anchor distance */int sub_anchor; /* start-anchor for exact or map */unsigned char *exact;unsigned char *exact_end;unsigned char map[ONIG_CHAR_TABLE_SIZE]; /* used as BM skip or char-map */int *int_map; /* BM skip for exact_len > 255 */int *int_map_backward; /* BM skip for backward search */OnigDistance dmin; /* min-distance of exact or map */OnigDistance dmax; /* max-distance of exact or map *//* regex_t link chain */struct re_pattern_buffer* chain; /* escape compile-conflict */} OnigRegexType;typedef OnigRegexType* OnigRegex;#ifndef ONIG_ESCAPE_REGEX_T_COLLISIONtypedef OnigRegexType regex_t;#endiftypedef struct {int num_of_elements;OnigEncoding pattern_enc;OnigEncoding target_enc;OnigSyntaxType* syntax;OnigOptionType option;OnigCaseFoldType case_fold_flag;} OnigCompileInfo;/* Oniguruma Native API */ONIG_EXTERNint onig_init P_((void));ONIG_EXTERNint onig_error_code_to_str (OnigUChar* s, int err_code, ...);ONIG_EXTERNvoid onig_set_warn_func P_((OnigWarnFunc f));ONIG_EXTERNvoid onig_set_verb_warn_func P_((OnigWarnFunc f));ONIG_EXTERNint onig_new P_((OnigRegex*, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));ONIG_EXTERNint onig_reg_init P_((regex_t* reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, OnigSyntaxType* syntax));int onig_new_without_alloc P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));ONIG_EXTERNint onig_new_deluxe P_((OnigRegex* reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));ONIG_EXTERNvoid onig_free P_((OnigRegex));ONIG_EXTERNvoid onig_free_body P_((OnigRegex));ONIG_EXTERNint onig_recompile P_((OnigRegex, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax, OnigErrorInfo* einfo));ONIG_EXTERNint onig_recompile_deluxe P_((OnigRegex reg, const OnigUChar* pattern, const OnigUChar* pattern_end, OnigCompileInfo* ci, OnigErrorInfo* einfo));ONIG_EXTERNint onig_search P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegion* region, OnigOptionType option));ONIG_EXTERNint onig_match P_((OnigRegex, const OnigUChar* str, const OnigUChar* end, const OnigUChar* at, OnigRegion* region, OnigOptionType option));ONIG_EXTERNOnigRegion* onig_region_new P_((void));ONIG_EXTERNvoid onig_region_init P_((OnigRegion* region));ONIG_EXTERNvoid onig_region_free P_((OnigRegion* region, int free_self));ONIG_EXTERNvoid onig_region_copy P_((OnigRegion* to, OnigRegion* from));ONIG_EXTERNvoid onig_region_clear P_((OnigRegion* region));ONIG_EXTERNint onig_region_resize P_((OnigRegion* region, int n));ONIG_EXTERNint onig_region_set P_((OnigRegion* region, int at, int beg, int end));ONIG_EXTERNint onig_name_to_group_numbers P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, int** nums));ONIG_EXTERNint onig_name_to_backref_number P_((OnigRegex reg, const OnigUChar* name, const OnigUChar* name_end, OnigRegion *region));ONIG_EXTERNint onig_foreach_name P_((OnigRegex reg, int (*func)(const OnigUChar*, const OnigUChar*,int,int*,OnigRegex,void*), void* arg));ONIG_EXTERNint onig_number_of_names P_((OnigRegex reg));ONIG_EXTERNint onig_number_of_captures P_((OnigRegex reg));ONIG_EXTERNint onig_number_of_capture_histories P_((OnigRegex reg));ONIG_EXTERNOnigCaptureTreeNode* onig_get_capture_tree P_((OnigRegion* region));ONIG_EXTERNint onig_capture_tree_traverse P_((OnigRegion* region, int at, int(*callback_func)(int,int,int,int,int,void*), void* arg));ONIG_EXTERNint onig_noname_group_capture_is_active P_((OnigRegex reg));ONIG_EXTERNOnigEncoding onig_get_encoding P_((OnigRegex reg));ONIG_EXTERNOnigOptionType onig_get_options P_((OnigRegex reg));ONIG_EXTERNOnigCaseFoldType onig_get_case_fold_flag P_((OnigRegex reg));ONIG_EXTERNOnigSyntaxType* onig_get_syntax P_((OnigRegex reg));ONIG_EXTERNint onig_set_default_syntax P_((OnigSyntaxType* syntax));ONIG_EXTERNvoid onig_copy_syntax P_((OnigSyntaxType* to, OnigSyntaxType* from));ONIG_EXTERNunsigned int onig_get_syntax_op P_((OnigSyntaxType* syntax));ONIG_EXTERNunsigned int onig_get_syntax_op2 P_((OnigSyntaxType* syntax));ONIG_EXTERNunsigned int onig_get_syntax_behavior P_((OnigSyntaxType* syntax));ONIG_EXTERNOnigOptionType onig_get_syntax_options P_((OnigSyntaxType* syntax));ONIG_EXTERNvoid onig_set_syntax_op P_((OnigSyntaxType* syntax, unsigned int op));ONIG_EXTERNvoid onig_set_syntax_op2 P_((OnigSyntaxType* syntax, unsigned int op2));ONIG_EXTERNvoid onig_set_syntax_behavior P_((OnigSyntaxType* syntax, unsigned int behavior));ONIG_EXTERNvoid onig_set_syntax_options P_((OnigSyntaxType* syntax, OnigOptionType options));ONIG_EXTERNint onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code));ONIG_EXTERNvoid onig_copy_encoding P_((OnigEncoding to, OnigEncoding from));ONIG_EXTERNOnigCaseFoldType onig_get_default_case_fold_flag P_((void));ONIG_EXTERNint onig_set_default_case_fold_flag P_((OnigCaseFoldType case_fold_flag));ONIG_EXTERNunsigned int onig_get_match_stack_limit_size P_((void));ONIG_EXTERNint onig_set_match_stack_limit_size P_((unsigned int size));ONIG_EXTERNint onig_end P_((void));ONIG_EXTERNconst char* onig_version P_((void));ONIG_EXTERNconst char* onig_copyright P_((void));#ifdef __cplusplus}#endif#endif /* ONIGURUMA_H */
/**********************************************************************regcomp.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regparse.h"OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN;extern OnigCaseFoldTypeonig_get_default_case_fold_flag(void){return OnigDefaultCaseFoldFlag;}extern intonig_set_default_case_fold_flag(OnigCaseFoldType case_fold_flag){OnigDefaultCaseFoldFlag = case_fold_flag;return 0;}#ifndef PLATFORM_UNALIGNED_WORD_ACCESSstatic unsigned char PadBuf[WORD_ALIGNMENT_SIZE];#endifstatic UChar*str_dup(UChar* s, UChar* end){int len = end - s;if (len > 0) {UChar* r = (UChar* )xmalloc(len + 1);CHECK_NULL_RETURN(r);xmemcpy(r, s, len);r[len] = (UChar )0;return r;}else return NULL;}static voidswap_node(Node* a, Node* b){Node c;c = *a; *a = *b; *b = c;if (NTYPE(a) == NT_STR) {StrNode* sn = NSTR(a);if (sn->capa == 0) {int len = sn->end - sn->s;sn->s = sn->buf;sn->end = sn->s + len;}}if (NTYPE(b) == NT_STR) {StrNode* sn = NSTR(b);if (sn->capa == 0) {int len = sn->end - sn->s;sn->s = sn->buf;sn->end = sn->s + len;}}}static OnigDistancedistance_add(OnigDistance d1, OnigDistance d2){if (d1 == ONIG_INFINITE_DISTANCE || d2 == ONIG_INFINITE_DISTANCE)return ONIG_INFINITE_DISTANCE;else {if (d1 <= ONIG_INFINITE_DISTANCE - d2) return d1 + d2;else return ONIG_INFINITE_DISTANCE;}}static OnigDistancedistance_multiply(OnigDistance d, int m){if (m == 0) return 0;if (d < ONIG_INFINITE_DISTANCE / m)return d * m;elsereturn ONIG_INFINITE_DISTANCE;}static intbitset_is_empty(BitSetRef bs){int i;for (i = 0; i < (int )BITSET_SIZE; i++) {if (bs[i] != 0) return 0;}return 1;}#ifdef ONIG_DEBUGstatic intbitset_on_num(BitSetRef bs){int i, n;n = 0;for (i = 0; i < SINGLE_BYTE_SIZE; i++) {if (BITSET_AT(bs, i)) n++;}return n;}#endifextern intonig_bbuf_init(BBuf* buf, int size){if (size <= 0) {size = 0;buf->p = NULL;}else {buf->p = (UChar* )xmalloc(size);if (IS_NULL(buf->p)) return(ONIGERR_MEMORY);}buf->alloc = size;buf->used = 0;return 0;}#ifdef USE_SUBEXP_CALLstatic intunset_addr_list_init(UnsetAddrList* uslist, int size){UnsetAddr* p;p = (UnsetAddr* )xmalloc(sizeof(UnsetAddr)* size);CHECK_NULL_RETURN_MEMERR(p);uslist->num = 0;uslist->alloc = size;uslist->us = p;return 0;}static voidunset_addr_list_end(UnsetAddrList* uslist){if (IS_NOT_NULL(uslist->us))xfree(uslist->us);}static intunset_addr_list_add(UnsetAddrList* uslist, int offset, struct _Node* node){UnsetAddr* p;int size;if (uslist->num >= uslist->alloc) {size = uslist->alloc * 2;p = (UnsetAddr* )xrealloc(uslist->us, sizeof(UnsetAddr) * size);CHECK_NULL_RETURN_MEMERR(p);uslist->alloc = size;uslist->us = p;}uslist->us[uslist->num].offset = offset;uslist->us[uslist->num].target = node;uslist->num++;return 0;}#endif /* USE_SUBEXP_CALL */static intadd_opcode(regex_t* reg, int opcode){BBUF_ADD1(reg, opcode);return 0;}#ifdef USE_COMBINATION_EXPLOSION_CHECKstatic intadd_state_check_num(regex_t* reg, int num){StateCheckNumType n = (StateCheckNumType )num;BBUF_ADD(reg, &n, SIZE_STATE_CHECK_NUM);return 0;}#endifstatic intadd_rel_addr(regex_t* reg, int addr){RelAddrType ra = (RelAddrType )addr;BBUF_ADD(reg, &ra, SIZE_RELADDR);return 0;}static intadd_abs_addr(regex_t* reg, int addr){AbsAddrType ra = (AbsAddrType )addr;BBUF_ADD(reg, &ra, SIZE_ABSADDR);return 0;}static intadd_length(regex_t* reg, int len){LengthType l = (LengthType )len;BBUF_ADD(reg, &l, SIZE_LENGTH);return 0;}static intadd_mem_num(regex_t* reg, int num){MemNumType n = (MemNumType )num;BBUF_ADD(reg, &n, SIZE_MEMNUM);return 0;}static intadd_pointer(regex_t* reg, void* addr){PointerType ptr = (PointerType )addr;BBUF_ADD(reg, &ptr, SIZE_POINTER);return 0;}static intadd_option(regex_t* reg, OnigOptionType option){BBUF_ADD(reg, &option, SIZE_OPTION);return 0;}static intadd_opcode_rel_addr(regex_t* reg, int opcode, int addr){int r;r = add_opcode(reg, opcode);if (r) return r;r = add_rel_addr(reg, addr);return r;}static intadd_bytes(regex_t* reg, UChar* bytes, int len){BBUF_ADD(reg, bytes, len);return 0;}static intadd_bitset(regex_t* reg, BitSetRef bs){BBUF_ADD(reg, bs, SIZE_BITSET);return 0;}static intadd_opcode_option(regex_t* reg, int opcode, OnigOptionType option){int r;r = add_opcode(reg, opcode);if (r) return r;r = add_option(reg, option);return r;}static int compile_length_tree(Node* node, regex_t* reg);static int compile_tree(Node* node, regex_t* reg);#define IS_NEED_STR_LEN_OP_EXACT(op) \((op) == OP_EXACTN || (op) == OP_EXACTMB2N ||\(op) == OP_EXACTMB3N || (op) == OP_EXACTMBN || (op) == OP_EXACTN_IC)static intselect_str_opcode(int mb_len, int str_len, int ignore_case){int op;if (ignore_case) {switch (str_len) {case 1: op = OP_EXACT1_IC; break;default: op = OP_EXACTN_IC; break;}}else {switch (mb_len) {case 1:switch (str_len) {case 1: op = OP_EXACT1; break;case 2: op = OP_EXACT2; break;case 3: op = OP_EXACT3; break;case 4: op = OP_EXACT4; break;case 5: op = OP_EXACT5; break;default: op = OP_EXACTN; break;}break;case 2:switch (str_len) {case 1: op = OP_EXACTMB2N1; break;case 2: op = OP_EXACTMB2N2; break;case 3: op = OP_EXACTMB2N3; break;default: op = OP_EXACTMB2N; break;}break;case 3:op = OP_EXACTMB3N;break;default:op = OP_EXACTMBN;break;}}return op;}static intcompile_tree_empty_check(Node* node, regex_t* reg, int empty_info){int r;int saved_num_null_check = reg->num_null_check;if (empty_info != 0) {r = add_opcode(reg, OP_NULL_CHECK_START);if (r) return r;r = add_mem_num(reg, reg->num_null_check); /* NULL CHECK ID */if (r) return r;reg->num_null_check++;}r = compile_tree(node, reg);if (r) return r;if (empty_info != 0) {if (empty_info == NQ_TARGET_IS_EMPTY)r = add_opcode(reg, OP_NULL_CHECK_END);else if (empty_info == NQ_TARGET_IS_EMPTY_MEM)r = add_opcode(reg, OP_NULL_CHECK_END_MEMST);else if (empty_info == NQ_TARGET_IS_EMPTY_REC)r = add_opcode(reg, OP_NULL_CHECK_END_MEMST_PUSH);if (r) return r;r = add_mem_num(reg, saved_num_null_check); /* NULL CHECK ID */}return r;}#ifdef USE_SUBEXP_CALLstatic intcompile_call(CallNode* node, regex_t* reg){int r;r = add_opcode(reg, OP_CALL);if (r) return r;r = unset_addr_list_add(node->unset_addr_list, BBUF_GET_OFFSET_POS(reg),node->target);if (r) return r;r = add_abs_addr(reg, 0 /*dummy addr.*/);return r;}#endifstatic intcompile_tree_n_times(Node* node, int n, regex_t* reg){int i, r;for (i = 0; i < n; i++) {r = compile_tree(node, reg);if (r) return r;}return 0;}static intadd_compile_string_length(UChar* s ARG_UNUSED, int mb_len, int str_len,regex_t* reg ARG_UNUSED, int ignore_case){int len;int op = select_str_opcode(mb_len, str_len, ignore_case);len = SIZE_OPCODE;if (op == OP_EXACTMBN) len += SIZE_LENGTH;if (IS_NEED_STR_LEN_OP_EXACT(op))len += SIZE_LENGTH;len += mb_len * str_len;return len;}static intadd_compile_string(UChar* s, int mb_len, int str_len,regex_t* reg, int ignore_case){int op = select_str_opcode(mb_len, str_len, ignore_case);add_opcode(reg, op);if (op == OP_EXACTMBN)add_length(reg, mb_len);if (IS_NEED_STR_LEN_OP_EXACT(op)) {if (op == OP_EXACTN_IC)add_length(reg, mb_len * str_len);elseadd_length(reg, str_len);}add_bytes(reg, s, mb_len * str_len);return 0;}static intcompile_length_string_node(Node* node, regex_t* reg){int rlen, r, len, prev_len, slen, ambig;OnigEncoding enc = reg->enc;UChar *p, *prev;StrNode* sn;sn = NSTR(node);if (sn->end <= sn->s)return 0;ambig = NSTRING_IS_AMBIG(node);p = prev = sn->s;prev_len = enclen(enc, p);p += prev_len;slen = 1;rlen = 0;for (; p < sn->end; ) {len = enclen(enc, p);if (len == prev_len) {slen++;}else {r = add_compile_string_length(prev, prev_len, slen, reg, ambig);rlen += r;prev = p;slen = 1;prev_len = len;}p += len;}r = add_compile_string_length(prev, prev_len, slen, reg, ambig);rlen += r;return rlen;}static intcompile_length_string_raw_node(StrNode* sn, regex_t* reg){if (sn->end <= sn->s)return 0;return add_compile_string_length(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0);}static intcompile_string_node(Node* node, regex_t* reg){int r, len, prev_len, slen, ambig;OnigEncoding enc = reg->enc;UChar *p, *prev, *end;StrNode* sn;sn = NSTR(node);if (sn->end <= sn->s)return 0;end = sn->end;ambig = NSTRING_IS_AMBIG(node);p = prev = sn->s;prev_len = enclen(enc, p);p += prev_len;slen = 1;for (; p < end; ) {len = enclen(enc, p);if (len == prev_len) {slen++;}else {r = add_compile_string(prev, prev_len, slen, reg, ambig);if (r) return r;prev = p;slen = 1;prev_len = len;}p += len;}return add_compile_string(prev, prev_len, slen, reg, ambig);}static intcompile_string_raw_node(StrNode* sn, regex_t* reg){if (sn->end <= sn->s)return 0;return add_compile_string(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0);}static intadd_multi_byte_cclass(BBuf* mbuf, regex_t* reg){#ifdef PLATFORM_UNALIGNED_WORD_ACCESSadd_length(reg, mbuf->used);return add_bytes(reg, mbuf->p, mbuf->used);#elseint r, pad_size;UChar* p = BBUF_GET_ADD_ADDRESS(reg) + SIZE_LENGTH;GET_ALIGNMENT_PAD_SIZE(p, pad_size);add_length(reg, mbuf->used + (WORD_ALIGNMENT_SIZE - 1));if (pad_size != 0) add_bytes(reg, PadBuf, pad_size);r = add_bytes(reg, mbuf->p, mbuf->used);/* padding for return value from compile_length_cclass_node() to be fix. */pad_size = (WORD_ALIGNMENT_SIZE - 1) - pad_size;if (pad_size != 0) add_bytes(reg, PadBuf, pad_size);return r;#endif}static intcompile_length_cclass_node(CClassNode* cc, regex_t* reg){int len;if (IS_NCCLASS_SHARE(cc)) {len = SIZE_OPCODE + SIZE_POINTER;return len;}if (IS_NULL(cc->mbuf)) {len = SIZE_OPCODE + SIZE_BITSET;}else {if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) {len = SIZE_OPCODE;}else {len = SIZE_OPCODE + SIZE_BITSET;}#ifdef PLATFORM_UNALIGNED_WORD_ACCESSlen += SIZE_LENGTH + cc->mbuf->used;#elselen += SIZE_LENGTH + cc->mbuf->used + (WORD_ALIGNMENT_SIZE - 1);#endif}return len;}static intcompile_cclass_node(CClassNode* cc, regex_t* reg){int r;if (IS_NCCLASS_SHARE(cc)) {add_opcode(reg, OP_CCLASS_NODE);r = add_pointer(reg, cc);return r;}if (IS_NULL(cc->mbuf)) {if (IS_NCCLASS_NOT(cc))add_opcode(reg, OP_CCLASS_NOT);elseadd_opcode(reg, OP_CCLASS);r = add_bitset(reg, cc->bs);}else {if (ONIGENC_MBC_MINLEN(reg->enc) > 1 || bitset_is_empty(cc->bs)) {if (IS_NCCLASS_NOT(cc))add_opcode(reg, OP_CCLASS_MB_NOT);elseadd_opcode(reg, OP_CCLASS_MB);r = add_multi_byte_cclass(cc->mbuf, reg);}else {if (IS_NCCLASS_NOT(cc))add_opcode(reg, OP_CCLASS_MIX_NOT);elseadd_opcode(reg, OP_CCLASS_MIX);r = add_bitset(reg, cc->bs);if (r) return r;r = add_multi_byte_cclass(cc->mbuf, reg);}}return r;}static intentry_repeat_range(regex_t* reg, int id, int lower, int upper){#define REPEAT_RANGE_ALLOC 4OnigRepeatRange* p;if (reg->repeat_range_alloc == 0) {p = (OnigRepeatRange* )xmalloc(sizeof(OnigRepeatRange) * REPEAT_RANGE_ALLOC);CHECK_NULL_RETURN_MEMERR(p);reg->repeat_range = p;reg->repeat_range_alloc = REPEAT_RANGE_ALLOC;}else if (reg->repeat_range_alloc <= id) {int n;n = reg->repeat_range_alloc + REPEAT_RANGE_ALLOC;p = (OnigRepeatRange* )xrealloc(reg->repeat_range,sizeof(OnigRepeatRange) * n);CHECK_NULL_RETURN_MEMERR(p);reg->repeat_range = p;reg->repeat_range_alloc = n;}else {p = reg->repeat_range;}p[id].lower = lower;p[id].upper = (IS_REPEAT_INFINITE(upper) ? 0x7fffffff : upper);return 0;}static intcompile_range_repeat_node(QtfrNode* qn, int target_len, int empty_info,regex_t* reg){int r;int num_repeat = reg->num_repeat;r = add_opcode(reg, qn->greedy ? OP_REPEAT : OP_REPEAT_NG);if (r) return r;r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */reg->num_repeat++;if (r) return r;r = add_rel_addr(reg, target_len + SIZE_OP_REPEAT_INC);if (r) return r;r = entry_repeat_range(reg, num_repeat, qn->lower, qn->upper);if (r) return r;r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;if (#ifdef USE_SUBEXP_CALLreg->num_call > 0 ||#endifIS_QUANTIFIER_IN_REPEAT(qn)) {r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC_SG : OP_REPEAT_INC_NG_SG);}else {r = add_opcode(reg, qn->greedy ? OP_REPEAT_INC : OP_REPEAT_INC_NG);}if (r) return r;r = add_mem_num(reg, num_repeat); /* OP_REPEAT ID */return r;}static intis_anychar_star_quantifier(QtfrNode* qn){if (qn->greedy && IS_REPEAT_INFINITE(qn->upper) &&NTYPE(qn->target) == NT_CANY)return 1;elsereturn 0;}#define QUANTIFIER_EXPAND_LIMIT_SIZE 50#define CKN_ON (ckn > 0)#ifdef USE_COMBINATION_EXPLOSION_CHECKstatic intcompile_length_quantifier_node(QtfrNode* qn, regex_t* reg){int len, mod_tlen, cklen;int ckn;int infinite = IS_REPEAT_INFINITE(qn->upper);int empty_info = qn->target_empty_info;int tlen = compile_length_tree(qn->target, reg);if (tlen < 0) return tlen;ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0);cklen = (CKN_ON ? SIZE_STATE_CHECK_NUM: 0);/* anychar repeat */if (NTYPE(qn->target) == NT_CANY) {if (qn->greedy && infinite) {if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON)return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen;elsereturn SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen;}}if (empty_info != 0)mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);elsemod_tlen = tlen;if (infinite && qn->lower <= 1) {if (qn->greedy) {if (qn->lower == 1)len = SIZE_OP_JUMP;elselen = 0;len += SIZE_OP_PUSH + cklen + mod_tlen + SIZE_OP_JUMP;}else {if (qn->lower == 0)len = SIZE_OP_JUMP;elselen = 0;len += mod_tlen + SIZE_OP_PUSH + cklen;}}else if (qn->upper == 0) {if (qn->is_refered != 0) /* /(?<n>..){0}/ */len = SIZE_OP_JUMP + tlen;elselen = 0;}else if (qn->upper == 1 && qn->greedy) {if (qn->lower == 0) {if (CKN_ON) {len = SIZE_OP_STATE_CHECK_PUSH + tlen;}else {len = SIZE_OP_PUSH + tlen;}}else {len = tlen;}}else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */len = SIZE_OP_PUSH + cklen + SIZE_OP_JUMP + tlen;}else {len = SIZE_OP_REPEAT_INC+ mod_tlen + SIZE_OPCODE + SIZE_RELADDR + SIZE_MEMNUM;if (CKN_ON)len += SIZE_OP_STATE_CHECK;}return len;}static intcompile_quantifier_node(QtfrNode* qn, regex_t* reg){int r, mod_tlen;int ckn;int infinite = IS_REPEAT_INFINITE(qn->upper);int empty_info = qn->target_empty_info;int tlen = compile_length_tree(qn->target, reg);if (tlen < 0) return tlen;ckn = ((reg->num_comb_exp_check > 0) ? qn->comb_exp_check_num : 0);if (is_anychar_star_quantifier(qn)) {r = compile_tree_n_times(qn->target, qn->lower, reg);if (r) return r;if (IS_NOT_NULL(qn->next_head_exact) && !CKN_ON) {if (IS_MULTILINE(reg->options))r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT);elser = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT);if (r) return r;if (CKN_ON) {r = add_state_check_num(reg, ckn);if (r) return r;}return add_bytes(reg, NSTR(qn->next_head_exact)->s, 1);}else {if (IS_MULTILINE(reg->options)) {r = add_opcode(reg, (CKN_ON ?OP_STATE_CHECK_ANYCHAR_ML_STAR: OP_ANYCHAR_ML_STAR));}else {r = add_opcode(reg, (CKN_ON ?OP_STATE_CHECK_ANYCHAR_STAR: OP_ANYCHAR_STAR));}if (r) return r;if (CKN_ON)r = add_state_check_num(reg, ckn);return r;}}if (empty_info != 0)mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);elsemod_tlen = tlen;if (infinite && qn->lower <= 1) {if (qn->greedy) {if (qn->lower == 1) {r = add_opcode_rel_addr(reg, OP_JUMP,(CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH));if (r) return r;}if (CKN_ON) {r = add_opcode(reg, OP_STATE_CHECK_PUSH);if (r) return r;r = add_state_check_num(reg, ckn);if (r) return r;r = add_rel_addr(reg, mod_tlen + SIZE_OP_JUMP);}else {r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP);}if (r) return r;r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP,-(mod_tlen + (int )SIZE_OP_JUMP+ (int )(CKN_ON ? SIZE_OP_STATE_CHECK_PUSH : SIZE_OP_PUSH)));}else {if (qn->lower == 0) {r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen);if (r) return r;}r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;if (CKN_ON) {r = add_opcode(reg, OP_STATE_CHECK_PUSH_OR_JUMP);if (r) return r;r = add_state_check_num(reg, ckn);if (r) return r;r = add_rel_addr(reg,-(mod_tlen + (int )SIZE_OP_STATE_CHECK_PUSH_OR_JUMP));}elser = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int )SIZE_OP_PUSH));}}else if (qn->upper == 0) {if (qn->is_refered != 0) { /* /(?<n>..){0}/ */r = add_opcode_rel_addr(reg, OP_JUMP, tlen);if (r) return r;r = compile_tree(qn->target, reg);}elser = 0;}else if (qn->upper == 1 && qn->greedy) {if (qn->lower == 0) {if (CKN_ON) {r = add_opcode(reg, OP_STATE_CHECK_PUSH);if (r) return r;r = add_state_check_num(reg, ckn);if (r) return r;r = add_rel_addr(reg, tlen);}else {r = add_opcode_rel_addr(reg, OP_PUSH, tlen);}if (r) return r;}r = compile_tree(qn->target, reg);}else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */if (CKN_ON) {r = add_opcode(reg, OP_STATE_CHECK_PUSH);if (r) return r;r = add_state_check_num(reg, ckn);if (r) return r;r = add_rel_addr(reg, SIZE_OP_JUMP);}else {r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP);}if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP, tlen);if (r) return r;r = compile_tree(qn->target, reg);}else {r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg);if (CKN_ON) {if (r) return r;r = add_opcode(reg, OP_STATE_CHECK);if (r) return r;r = add_state_check_num(reg, ckn);}}return r;}#else /* USE_COMBINATION_EXPLOSION_CHECK */static intcompile_length_quantifier_node(QtfrNode* qn, regex_t* reg){int len, mod_tlen;int infinite = IS_REPEAT_INFINITE(qn->upper);int empty_info = qn->target_empty_info;int tlen = compile_length_tree(qn->target, reg);if (tlen < 0) return tlen;/* anychar repeat */if (NTYPE(qn->target) == NT_CANY) {if (qn->greedy && infinite) {if (IS_NOT_NULL(qn->next_head_exact))return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower;elsereturn SIZE_OP_ANYCHAR_STAR + tlen * qn->lower;}}if (empty_info != 0)mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);elsemod_tlen = tlen;if (infinite &&(qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) {len = SIZE_OP_JUMP;}else {len = tlen * qn->lower;}if (qn->greedy) {if (IS_NOT_NULL(qn->head_exact))len += SIZE_OP_PUSH_OR_JUMP_EXACT1 + mod_tlen + SIZE_OP_JUMP;else if (IS_NOT_NULL(qn->next_head_exact))len += SIZE_OP_PUSH_IF_PEEK_NEXT + mod_tlen + SIZE_OP_JUMP;elselen += SIZE_OP_PUSH + mod_tlen + SIZE_OP_JUMP;}elselen += SIZE_OP_JUMP + mod_tlen + SIZE_OP_PUSH;}else if (qn->upper == 0 && qn->is_refered != 0) { /* /(?<n>..){0}/ */len = SIZE_OP_JUMP + tlen;}else if (!infinite && qn->greedy &&(qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper<= QUANTIFIER_EXPAND_LIMIT_SIZE)) {len = tlen * qn->lower;len += (SIZE_OP_PUSH + tlen) * (qn->upper - qn->lower);}else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */len = SIZE_OP_PUSH + SIZE_OP_JUMP + tlen;}else {len = SIZE_OP_REPEAT_INC+ mod_tlen + SIZE_OPCODE + SIZE_RELADDR + SIZE_MEMNUM;}return len;}static intcompile_quantifier_node(QtfrNode* qn, regex_t* reg){int i, r, mod_tlen;int infinite = IS_REPEAT_INFINITE(qn->upper);int empty_info = qn->target_empty_info;int tlen = compile_length_tree(qn->target, reg);if (tlen < 0) return tlen;if (is_anychar_star_quantifier(qn)) {r = compile_tree_n_times(qn->target, qn->lower, reg);if (r) return r;if (IS_NOT_NULL(qn->next_head_exact)) {if (IS_MULTILINE(reg->options))r = add_opcode(reg, OP_ANYCHAR_ML_STAR_PEEK_NEXT);elser = add_opcode(reg, OP_ANYCHAR_STAR_PEEK_NEXT);if (r) return r;return add_bytes(reg, NSTR(qn->next_head_exact)->s, 1);}else {if (IS_MULTILINE(reg->options))return add_opcode(reg, OP_ANYCHAR_ML_STAR);elsereturn add_opcode(reg, OP_ANYCHAR_STAR);}}if (empty_info != 0)mod_tlen = tlen + (SIZE_OP_NULL_CHECK_START + SIZE_OP_NULL_CHECK_END);elsemod_tlen = tlen;if (infinite &&(qn->lower <= 1 || tlen * qn->lower <= QUANTIFIER_EXPAND_LIMIT_SIZE)) {if (qn->lower == 1 && tlen > QUANTIFIER_EXPAND_LIMIT_SIZE) {if (qn->greedy) {if (IS_NOT_NULL(qn->head_exact))r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_OR_JUMP_EXACT1);else if (IS_NOT_NULL(qn->next_head_exact))r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH_IF_PEEK_NEXT);elser = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_PUSH);}else {r = add_opcode_rel_addr(reg, OP_JUMP, SIZE_OP_JUMP);}if (r) return r;}else {r = compile_tree_n_times(qn->target, qn->lower, reg);if (r) return r;}if (qn->greedy) {if (IS_NOT_NULL(qn->head_exact)) {r = add_opcode_rel_addr(reg, OP_PUSH_OR_JUMP_EXACT1,mod_tlen + SIZE_OP_JUMP);if (r) return r;add_bytes(reg, NSTR(qn->head_exact)->s, 1);r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP,-(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_OR_JUMP_EXACT1));}else if (IS_NOT_NULL(qn->next_head_exact)) {r = add_opcode_rel_addr(reg, OP_PUSH_IF_PEEK_NEXT,mod_tlen + SIZE_OP_JUMP);if (r) return r;add_bytes(reg, NSTR(qn->next_head_exact)->s, 1);r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP,-(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH_IF_PEEK_NEXT));}else {r = add_opcode_rel_addr(reg, OP_PUSH, mod_tlen + SIZE_OP_JUMP);if (r) return r;r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP,-(mod_tlen + (int )SIZE_OP_JUMP + (int )SIZE_OP_PUSH));}}else {r = add_opcode_rel_addr(reg, OP_JUMP, mod_tlen);if (r) return r;r = compile_tree_empty_check(qn->target, reg, empty_info);if (r) return r;r = add_opcode_rel_addr(reg, OP_PUSH, -(mod_tlen + (int )SIZE_OP_PUSH));}}else if (qn->upper == 0 && qn->is_refered != 0) { /* /(?<n>..){0}/ */r = add_opcode_rel_addr(reg, OP_JUMP, tlen);if (r) return r;r = compile_tree(qn->target, reg);}else if (!infinite && qn->greedy &&(qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper<= QUANTIFIER_EXPAND_LIMIT_SIZE)) {int n = qn->upper - qn->lower;r = compile_tree_n_times(qn->target, qn->lower, reg);if (r) return r;for (i = 0; i < n; i++) {r = add_opcode_rel_addr(reg, OP_PUSH,(n - i) * tlen + (n - i - 1) * SIZE_OP_PUSH);if (r) return r;r = compile_tree(qn->target, reg);if (r) return r;}}else if (!qn->greedy && qn->upper == 1 && qn->lower == 0) { /* '??' */r = add_opcode_rel_addr(reg, OP_PUSH, SIZE_OP_JUMP);if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP, tlen);if (r) return r;r = compile_tree(qn->target, reg);}else {r = compile_range_repeat_node(qn, mod_tlen, empty_info, reg);}return r;}#endif /* USE_COMBINATION_EXPLOSION_CHECK */static intcompile_length_option_node(EncloseNode* node, regex_t* reg){int tlen;OnigOptionType prev = reg->options;reg->options = node->option;tlen = compile_length_tree(node->target, reg);reg->options = prev;if (tlen < 0) return tlen;if (IS_DYNAMIC_OPTION(prev ^ node->option)) {return SIZE_OP_SET_OPTION_PUSH + SIZE_OP_SET_OPTION + SIZE_OP_FAIL+ tlen + SIZE_OP_SET_OPTION;}elsereturn tlen;}static intcompile_option_node(EncloseNode* node, regex_t* reg){int r;OnigOptionType prev = reg->options;if (IS_DYNAMIC_OPTION(prev ^ node->option)) {r = add_opcode_option(reg, OP_SET_OPTION_PUSH, node->option);if (r) return r;r = add_opcode_option(reg, OP_SET_OPTION, prev);if (r) return r;r = add_opcode(reg, OP_FAIL);if (r) return r;}reg->options = node->option;r = compile_tree(node->target, reg);reg->options = prev;if (IS_DYNAMIC_OPTION(prev ^ node->option)) {if (r) return r;r = add_opcode_option(reg, OP_SET_OPTION, prev);}return r;}static intcompile_length_enclose_node(EncloseNode* node, regex_t* reg){int len;int tlen;if (node->type == ENCLOSE_OPTION)return compile_length_option_node(node, reg);if (node->target) {tlen = compile_length_tree(node->target, reg);if (tlen < 0) return tlen;}elsetlen = 0;switch (node->type) {case ENCLOSE_MEMORY:#ifdef USE_SUBEXP_CALLif (IS_ENCLOSE_CALLED(node)) {len = SIZE_OP_MEMORY_START_PUSH + tlen+ SIZE_OP_CALL + SIZE_OP_JUMP + SIZE_OP_RETURN;if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))len += (IS_ENCLOSE_RECURSION(node)? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_PUSH);elselen += (IS_ENCLOSE_RECURSION(node)? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END);}else#endif{if (BIT_STATUS_AT(reg->bt_mem_start, node->regnum))len = SIZE_OP_MEMORY_START_PUSH;elselen = SIZE_OP_MEMORY_START;len += tlen + (BIT_STATUS_AT(reg->bt_mem_end, node->regnum)? SIZE_OP_MEMORY_END_PUSH : SIZE_OP_MEMORY_END);}break;case ENCLOSE_STOP_BACKTRACK:if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) {QtfrNode* qn = NQTFR(node->target);tlen = compile_length_tree(qn->target, reg);if (tlen < 0) return tlen;len = tlen * qn->lower+ SIZE_OP_PUSH + tlen + SIZE_OP_POP + SIZE_OP_JUMP;}else {len = SIZE_OP_PUSH_STOP_BT + tlen + SIZE_OP_POP_STOP_BT;}break;default:return ONIGERR_TYPE_BUG;break;}return len;}static int get_char_length_tree(Node* node, regex_t* reg, int* len);static intcompile_enclose_node(EncloseNode* node, regex_t* reg){int r, len;if (node->type == ENCLOSE_OPTION)return compile_option_node(node, reg);switch (node->type) {case ENCLOSE_MEMORY:#ifdef USE_SUBEXP_CALLif (IS_ENCLOSE_CALLED(node)) {r = add_opcode(reg, OP_CALL);if (r) return r;node->call_addr = BBUF_GET_OFFSET_POS(reg) + SIZE_ABSADDR + SIZE_OP_JUMP;node->state |= NST_ADDR_FIXED;r = add_abs_addr(reg, (int )node->call_addr);if (r) return r;len = compile_length_tree(node->target, reg);len += (SIZE_OP_MEMORY_START_PUSH + SIZE_OP_RETURN);if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))len += (IS_ENCLOSE_RECURSION(node)? SIZE_OP_MEMORY_END_PUSH_REC : SIZE_OP_MEMORY_END_PUSH);elselen += (IS_ENCLOSE_RECURSION(node)? SIZE_OP_MEMORY_END_REC : SIZE_OP_MEMORY_END);r = add_opcode_rel_addr(reg, OP_JUMP, len);if (r) return r;}#endifif (BIT_STATUS_AT(reg->bt_mem_start, node->regnum))r = add_opcode(reg, OP_MEMORY_START_PUSH);elser = add_opcode(reg, OP_MEMORY_START);if (r) return r;r = add_mem_num(reg, node->regnum);if (r) return r;r = compile_tree(node->target, reg);if (r) return r;#ifdef USE_SUBEXP_CALLif (IS_ENCLOSE_CALLED(node)) {if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))r = add_opcode(reg, (IS_ENCLOSE_RECURSION(node)? OP_MEMORY_END_PUSH_REC : OP_MEMORY_END_PUSH));elser = add_opcode(reg, (IS_ENCLOSE_RECURSION(node)? OP_MEMORY_END_REC : OP_MEMORY_END));if (r) return r;r = add_mem_num(reg, node->regnum);if (r) return r;r = add_opcode(reg, OP_RETURN);}else#endif{if (BIT_STATUS_AT(reg->bt_mem_end, node->regnum))r = add_opcode(reg, OP_MEMORY_END_PUSH);elser = add_opcode(reg, OP_MEMORY_END);if (r) return r;r = add_mem_num(reg, node->regnum);}break;case ENCLOSE_STOP_BACKTRACK:if (IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(node)) {QtfrNode* qn = NQTFR(node->target);r = compile_tree_n_times(qn->target, qn->lower, reg);if (r) return r;len = compile_length_tree(qn->target, reg);if (len < 0) return len;r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_POP + SIZE_OP_JUMP);if (r) return r;r = compile_tree(qn->target, reg);if (r) return r;r = add_opcode(reg, OP_POP);if (r) return r;r = add_opcode_rel_addr(reg, OP_JUMP,-((int )SIZE_OP_PUSH + len + (int )SIZE_OP_POP + (int )SIZE_OP_JUMP));}else {r = add_opcode(reg, OP_PUSH_STOP_BT);if (r) return r;r = compile_tree(node->target, reg);if (r) return r;r = add_opcode(reg, OP_POP_STOP_BT);}break;default:return ONIGERR_TYPE_BUG;break;}return r;}static intcompile_length_anchor_node(AnchorNode* node, regex_t* reg){int len;int tlen = 0;if (node->target) {tlen = compile_length_tree(node->target, reg);if (tlen < 0) return tlen;}switch (node->type) {case ANCHOR_PREC_READ:len = SIZE_OP_PUSH_POS + tlen + SIZE_OP_POP_POS;break;case ANCHOR_PREC_READ_NOT:len = SIZE_OP_PUSH_POS_NOT + tlen + SIZE_OP_FAIL_POS;break;case ANCHOR_LOOK_BEHIND:len = SIZE_OP_LOOK_BEHIND + tlen;break;case ANCHOR_LOOK_BEHIND_NOT:len = SIZE_OP_PUSH_LOOK_BEHIND_NOT + tlen + SIZE_OP_FAIL_LOOK_BEHIND_NOT;break;default:len = SIZE_OPCODE;break;}return len;}static intcompile_anchor_node(AnchorNode* node, regex_t* reg){int r, len;switch (node->type) {case ANCHOR_BEGIN_BUF: r = add_opcode(reg, OP_BEGIN_BUF); break;case ANCHOR_END_BUF: r = add_opcode(reg, OP_END_BUF); break;case ANCHOR_BEGIN_LINE: r = add_opcode(reg, OP_BEGIN_LINE); break;case ANCHOR_END_LINE: r = add_opcode(reg, OP_END_LINE); break;case ANCHOR_SEMI_END_BUF: r = add_opcode(reg, OP_SEMI_END_BUF); break;case ANCHOR_BEGIN_POSITION: r = add_opcode(reg, OP_BEGIN_POSITION); break;case ANCHOR_WORD_BOUND: r = add_opcode(reg, OP_WORD_BOUND); break;case ANCHOR_NOT_WORD_BOUND: r = add_opcode(reg, OP_NOT_WORD_BOUND); break;#ifdef USE_WORD_BEGIN_ENDcase ANCHOR_WORD_BEGIN: r = add_opcode(reg, OP_WORD_BEGIN); break;case ANCHOR_WORD_END: r = add_opcode(reg, OP_WORD_END); break;#endifcase ANCHOR_PREC_READ:r = add_opcode(reg, OP_PUSH_POS);if (r) return r;r = compile_tree(node->target, reg);if (r) return r;r = add_opcode(reg, OP_POP_POS);break;case ANCHOR_PREC_READ_NOT:len = compile_length_tree(node->target, reg);if (len < 0) return len;r = add_opcode_rel_addr(reg, OP_PUSH_POS_NOT, len + SIZE_OP_FAIL_POS);if (r) return r;r = compile_tree(node->target, reg);if (r) return r;r = add_opcode(reg, OP_FAIL_POS);break;case ANCHOR_LOOK_BEHIND:{int n;r = add_opcode(reg, OP_LOOK_BEHIND);if (r) return r;if (node->char_len < 0) {r = get_char_length_tree(node->target, reg, &n);if (r) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;}elsen = node->char_len;r = add_length(reg, n);if (r) return r;r = compile_tree(node->target, reg);}break;case ANCHOR_LOOK_BEHIND_NOT:{int n;len = compile_length_tree(node->target, reg);r = add_opcode_rel_addr(reg, OP_PUSH_LOOK_BEHIND_NOT,len + SIZE_OP_FAIL_LOOK_BEHIND_NOT);if (r) return r;if (node->char_len < 0) {r = get_char_length_tree(node->target, reg, &n);if (r) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;}elsen = node->char_len;r = add_length(reg, n);if (r) return r;r = compile_tree(node->target, reg);if (r) return r;r = add_opcode(reg, OP_FAIL_LOOK_BEHIND_NOT);}break;default:return ONIGERR_TYPE_BUG;break;}return r;}static intcompile_length_tree(Node* node, regex_t* reg){int len, type, r;type = NTYPE(node);switch (type) {case NT_LIST:len = 0;do {r = compile_length_tree(NCAR(node), reg);if (r < 0) return r;len += r;} while (IS_NOT_NULL(node = NCDR(node)));r = len;break;case NT_ALT:{int n;n = r = 0;do {r += compile_length_tree(NCAR(node), reg);n++;} while (IS_NOT_NULL(node = NCDR(node)));r += (SIZE_OP_PUSH + SIZE_OP_JUMP) * (n - 1);}break;case NT_STR:if (NSTRING_IS_RAW(node))r = compile_length_string_raw_node(NSTR(node), reg);elser = compile_length_string_node(node, reg);break;case NT_CCLASS:r = compile_length_cclass_node(NCCLASS(node), reg);break;case NT_CTYPE:case NT_CANY:r = SIZE_OPCODE;break;case NT_BREF:{BRefNode* br = NBREF(node);#ifdef USE_BACKREF_WITH_LEVELif (IS_BACKREF_NEST_LEVEL(br)) {r = SIZE_OPCODE + SIZE_OPTION + SIZE_LENGTH +SIZE_LENGTH + (SIZE_MEMNUM * br->back_num);}else#endifif (br->back_num == 1) {r = ((!IS_IGNORECASE(reg->options) && br->back_static[0] <= 2)? SIZE_OPCODE : (SIZE_OPCODE + SIZE_MEMNUM));}else {r = SIZE_OPCODE + SIZE_LENGTH + (SIZE_MEMNUM * br->back_num);}}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:r = SIZE_OP_CALL;break;#endifcase NT_QTFR:r = compile_length_quantifier_node(NQTFR(node), reg);break;case NT_ENCLOSE:r = compile_length_enclose_node(NENCLOSE(node), reg);break;case NT_ANCHOR:r = compile_length_anchor_node(NANCHOR(node), reg);break;default:return ONIGERR_TYPE_BUG;break;}return r;}static intcompile_tree(Node* node, regex_t* reg){int n, type, len, pos, r = 0;type = NTYPE(node);switch (type) {case NT_LIST:do {r = compile_tree(NCAR(node), reg);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_ALT:{Node* x = node;len = 0;do {len += compile_length_tree(NCAR(x), reg);if (NCDR(x) != NULL) {len += SIZE_OP_PUSH + SIZE_OP_JUMP;}} while (IS_NOT_NULL(x = NCDR(x)));pos = reg->used + len; /* goal position */do {len = compile_length_tree(NCAR(node), reg);if (IS_NOT_NULL(NCDR(node))) {r = add_opcode_rel_addr(reg, OP_PUSH, len + SIZE_OP_JUMP);if (r) break;}r = compile_tree(NCAR(node), reg);if (r) break;if (IS_NOT_NULL(NCDR(node))) {len = pos - (reg->used + SIZE_OP_JUMP);r = add_opcode_rel_addr(reg, OP_JUMP, len);if (r) break;}} while (IS_NOT_NULL(node = NCDR(node)));}break;case NT_STR:if (NSTRING_IS_RAW(node))r = compile_string_raw_node(NSTR(node), reg);elser = compile_string_node(node, reg);break;case NT_CCLASS:r = compile_cclass_node(NCCLASS(node), reg);break;case NT_CTYPE:{int op;switch (NCTYPE(node)->ctype) {case ONIGENC_CTYPE_WORD:if (NCTYPE(node)->not != 0) op = OP_NOT_WORD;else op = OP_WORD;break;default:return ONIGERR_TYPE_BUG;break;}r = add_opcode(reg, op);}break;case NT_CANY:if (IS_MULTILINE(reg->options))r = add_opcode(reg, OP_ANYCHAR_ML);elser = add_opcode(reg, OP_ANYCHAR);break;case NT_BREF:{BRefNode* br = NBREF(node);#ifdef USE_BACKREF_WITH_LEVELif (IS_BACKREF_NEST_LEVEL(br)) {r = add_opcode(reg, OP_BACKREF_WITH_LEVEL);if (r) return r;r = add_option(reg, (reg->options & ONIG_OPTION_IGNORECASE));if (r) return r;r = add_length(reg, br->nest_level);if (r) return r;goto add_bacref_mems;}else#endifif (br->back_num == 1) {n = br->back_static[0];if (IS_IGNORECASE(reg->options)) {r = add_opcode(reg, OP_BACKREFN_IC);if (r) return r;r = add_mem_num(reg, n);}else {switch (n) {case 1: r = add_opcode(reg, OP_BACKREF1); break;case 2: r = add_opcode(reg, OP_BACKREF2); break;default:r = add_opcode(reg, OP_BACKREFN);if (r) return r;r = add_mem_num(reg, n);break;}}}else {int i;int* p;if (IS_IGNORECASE(reg->options)) {r = add_opcode(reg, OP_BACKREF_MULTI_IC);}else {r = add_opcode(reg, OP_BACKREF_MULTI);}if (r) return r;#ifdef USE_BACKREF_WITH_LEVELadd_bacref_mems:#endifr = add_length(reg, br->back_num);if (r) return r;p = BACKREFS_P(br);for (i = br->back_num - 1; i >= 0; i--) {r = add_mem_num(reg, p[i]);if (r) return r;}}}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:r = compile_call(NCALL(node), reg);break;#endifcase NT_QTFR:r = compile_quantifier_node(NQTFR(node), reg);break;case NT_ENCLOSE:r = compile_enclose_node(NENCLOSE(node), reg);break;case NT_ANCHOR:r = compile_anchor_node(NANCHOR(node), reg);break;default:#ifdef ONIG_DEBUGfprintf(stderr, "compile_tree: undefined node type %d\n", NTYPE(node));#endifbreak;}return r;}#ifdef USE_NAMED_GROUPstatic intnoname_disable_map(Node** plink, GroupNumRemap* map, int* counter){int r = 0;Node* node = *plink;switch (NTYPE(node)) {case NT_LIST:case NT_ALT:do {r = noname_disable_map(&(NCAR(node)), map, counter);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:{Node** ptarget = &(NQTFR(node)->target);Node* old = *ptarget;r = noname_disable_map(ptarget, map, counter);if (*ptarget != old && NTYPE(*ptarget) == NT_QTFR) {onig_reduce_nested_quantifier(node, *ptarget);}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);if (en->type == ENCLOSE_MEMORY) {if (IS_ENCLOSE_NAMED_GROUP(en)) {(*counter)++;map[en->regnum].new_val = *counter;en->regnum = *counter;r = noname_disable_map(&(en->target), map, counter);}else {*plink = en->target;en->target = NULL_NODE;onig_node_free(node);r = noname_disable_map(plink, map, counter);}}elser = noname_disable_map(&(en->target), map, counter);}break;default:break;}return r;}static intrenumber_node_backref(Node* node, GroupNumRemap* map){int i, pos, n, old_num;int *backs;BRefNode* bn = NBREF(node);if (! IS_BACKREF_NAME_REF(bn))return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;old_num = bn->back_num;if (IS_NULL(bn->back_dynamic))backs = bn->back_static;elsebacks = bn->back_dynamic;for (i = 0, pos = 0; i < old_num; i++) {n = map[backs[i]].new_val;if (n > 0) {backs[pos] = n;pos++;}}bn->back_num = pos;return 0;}static intrenumber_by_map(Node* node, GroupNumRemap* map){int r = 0;switch (NTYPE(node)) {case NT_LIST:case NT_ALT:do {r = renumber_by_map(NCAR(node), map);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:r = renumber_by_map(NQTFR(node)->target, map);break;case NT_ENCLOSE:r = renumber_by_map(NENCLOSE(node)->target, map);break;case NT_BREF:r = renumber_node_backref(node, map);break;default:break;}return r;}static intnumbered_ref_check(Node* node){int r = 0;switch (NTYPE(node)) {case NT_LIST:case NT_ALT:do {r = numbered_ref_check(NCAR(node));} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:r = numbered_ref_check(NQTFR(node)->target);break;case NT_ENCLOSE:r = numbered_ref_check(NENCLOSE(node)->target);break;case NT_BREF:if (! IS_BACKREF_NAME_REF(NBREF(node)))return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;break;default:break;}return r;}static intdisable_noname_group_capture(Node** root, regex_t* reg, ScanEnv* env){int r, i, pos, counter;BitStatusType loc;GroupNumRemap* map;map = (GroupNumRemap* )xalloca(sizeof(GroupNumRemap) * (env->num_mem + 1));CHECK_NULL_RETURN_MEMERR(map);for (i = 1; i <= env->num_mem; i++) {map[i].new_val = 0;}counter = 0;r = noname_disable_map(root, map, &counter);if (r != 0) return r;r = renumber_by_map(*root, map);if (r != 0) return r;for (i = 1, pos = 1; i <= env->num_mem; i++) {if (map[i].new_val > 0) {SCANENV_MEM_NODES(env)[pos] = SCANENV_MEM_NODES(env)[i];pos++;}}loc = env->capture_history;BIT_STATUS_CLEAR(env->capture_history);for (i = 1; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) {if (BIT_STATUS_AT(loc, i)) {BIT_STATUS_ON_AT_SIMPLE(env->capture_history, map[i].new_val);}}env->num_mem = env->num_named;reg->num_mem = env->num_named;return onig_renumber_name_table(reg, map);}#endif /* USE_NAMED_GROUP */#ifdef USE_SUBEXP_CALLstatic intunset_addr_list_fix(UnsetAddrList* uslist, regex_t* reg){int i, offset;EncloseNode* en;AbsAddrType addr;for (i = 0; i < uslist->num; i++) {en = NENCLOSE(uslist->us[i].target);if (! IS_ENCLOSE_ADDR_FIXED(en)) return ONIGERR_PARSER_BUG;addr = en->call_addr;offset = uslist->us[i].offset;BBUF_WRITE(reg, offset, &addr, SIZE_ABSADDR);}return 0;}#endif#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEATstatic intquantifiers_memory_node_info(Node* node){int r = 0;switch (NTYPE(node)) {case NT_LIST:case NT_ALT:{int v;do {v = quantifiers_memory_node_info(NCAR(node));if (v > r) r = v;} while (v >= 0 && IS_NOT_NULL(node = NCDR(node)));}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:if (IS_CALL_RECURSION(NCALL(node))) {return NQ_TARGET_IS_EMPTY_REC; /* tiny version */}elser = quantifiers_memory_node_info(NCALL(node)->target);break;#endifcase NT_QTFR:{QtfrNode* qn = NQTFR(node);if (qn->upper != 0) {r = quantifiers_memory_node_info(qn->target);}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_MEMORY:return NQ_TARGET_IS_EMPTY_MEM;break;case ENCLOSE_OPTION:case ENCLOSE_STOP_BACKTRACK:r = quantifiers_memory_node_info(en->target);break;default:break;}}break;case NT_BREF:case NT_STR:case NT_CTYPE:case NT_CCLASS:case NT_CANY:case NT_ANCHOR:default:break;}return r;}#endif /* USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT */static intget_min_match_length(Node* node, OnigDistance *min, ScanEnv* env){OnigDistance tmin;int r = 0;*min = 0;switch (NTYPE(node)) {case NT_BREF:{int i;int* backs;Node** nodes = SCANENV_MEM_NODES(env);BRefNode* br = NBREF(node);if (br->state & NST_RECURSION) break;backs = BACKREFS_P(br);if (backs[0] > env->num_mem) return ONIGERR_INVALID_BACKREF;r = get_min_match_length(nodes[backs[0]], min, env);if (r != 0) break;for (i = 1; i < br->back_num; i++) {if (backs[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;r = get_min_match_length(nodes[backs[i]], &tmin, env);if (r != 0) break;if (*min > tmin) *min = tmin;}}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:if (IS_CALL_RECURSION(NCALL(node))) {EncloseNode* en = NENCLOSE(NCALL(node)->target);if (IS_ENCLOSE_MIN_FIXED(en))*min = en->min_len;}elser = get_min_match_length(NCALL(node)->target, min, env);break;#endifcase NT_LIST:do {r = get_min_match_length(NCAR(node), &tmin, env);if (r == 0) *min += tmin;} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_ALT:{Node *x, *y;y = node;do {x = NCAR(y);r = get_min_match_length(x, &tmin, env);if (r != 0) break;if (y == node) *min = tmin;else if (*min > tmin) *min = tmin;} while (r == 0 && IS_NOT_NULL(y = NCDR(y)));}break;case NT_STR:{StrNode* sn = NSTR(node);*min = sn->end - sn->s;}break;case NT_CTYPE:*min = 1;break;case NT_CCLASS:case NT_CANY:*min = 1;break;case NT_QTFR:{QtfrNode* qn = NQTFR(node);if (qn->lower > 0) {r = get_min_match_length(qn->target, min, env);if (r == 0)*min = distance_multiply(*min, qn->lower);}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_MEMORY:#ifdef USE_SUBEXP_CALLif (IS_ENCLOSE_MIN_FIXED(en))*min = en->min_len;else {r = get_min_match_length(en->target, min, env);if (r == 0) {en->min_len = *min;SET_ENCLOSE_STATUS(node, NST_MIN_FIXED);}}break;#endifcase ENCLOSE_OPTION:case ENCLOSE_STOP_BACKTRACK:r = get_min_match_length(en->target, min, env);break;}}break;case NT_ANCHOR:default:break;}return r;}static intget_max_match_length(Node* node, OnigDistance *max, ScanEnv* env){OnigDistance tmax;int r = 0;*max = 0;switch (NTYPE(node)) {case NT_LIST:do {r = get_max_match_length(NCAR(node), &tmax, env);if (r == 0)*max = distance_add(*max, tmax);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_ALT:do {r = get_max_match_length(NCAR(node), &tmax, env);if (r == 0 && *max < tmax) *max = tmax;} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_STR:{StrNode* sn = NSTR(node);*max = sn->end - sn->s;}break;case NT_CTYPE:*max = ONIGENC_MBC_MAXLEN_DIST(env->enc);break;case NT_CCLASS:case NT_CANY:*max = ONIGENC_MBC_MAXLEN_DIST(env->enc);break;case NT_BREF:{int i;int* backs;Node** nodes = SCANENV_MEM_NODES(env);BRefNode* br = NBREF(node);if (br->state & NST_RECURSION) {*max = ONIG_INFINITE_DISTANCE;break;}backs = BACKREFS_P(br);for (i = 0; i < br->back_num; i++) {if (backs[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;r = get_max_match_length(nodes[backs[i]], &tmax, env);if (r != 0) break;if (*max < tmax) *max = tmax;}}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:if (! IS_CALL_RECURSION(NCALL(node)))r = get_max_match_length(NCALL(node)->target, max, env);else*max = ONIG_INFINITE_DISTANCE;break;#endifcase NT_QTFR:{QtfrNode* qn = NQTFR(node);if (qn->upper != 0) {r = get_max_match_length(qn->target, max, env);if (r == 0 && *max != 0) {if (! IS_REPEAT_INFINITE(qn->upper))*max = distance_multiply(*max, qn->upper);else*max = ONIG_INFINITE_DISTANCE;}}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_MEMORY:#ifdef USE_SUBEXP_CALLif (IS_ENCLOSE_MAX_FIXED(en))*max = en->max_len;else {r = get_max_match_length(en->target, max, env);if (r == 0) {en->max_len = *max;SET_ENCLOSE_STATUS(node, NST_MAX_FIXED);}}break;#endifcase ENCLOSE_OPTION:case ENCLOSE_STOP_BACKTRACK:r = get_max_match_length(en->target, max, env);break;}}break;case NT_ANCHOR:default:break;}return r;}#define GET_CHAR_LEN_VARLEN -1#define GET_CHAR_LEN_TOP_ALT_VARLEN -2/* fixed size pattern node only */static intget_char_length_tree1(Node* node, regex_t* reg, int* len, int level){int tlen;int r = 0;level++;*len = 0;switch (NTYPE(node)) {case NT_LIST:do {r = get_char_length_tree1(NCAR(node), reg, &tlen, level);if (r == 0)*len = distance_add(*len, tlen);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_ALT:{int tlen2;int varlen = 0;r = get_char_length_tree1(NCAR(node), reg, &tlen, level);while (r == 0 && IS_NOT_NULL(node = NCDR(node))) {r = get_char_length_tree1(NCAR(node), reg, &tlen2, level);if (r == 0) {if (tlen != tlen2)varlen = 1;}}if (r == 0) {if (varlen != 0) {if (level == 1)r = GET_CHAR_LEN_TOP_ALT_VARLEN;elser = GET_CHAR_LEN_VARLEN;}else*len = tlen;}}break;case NT_STR:{StrNode* sn = NSTR(node);UChar *s = sn->s;while (s < sn->end) {s += enclen(reg->enc, s);(*len)++;}}break;case NT_QTFR:{QtfrNode* qn = NQTFR(node);if (qn->lower == qn->upper) {r = get_char_length_tree1(qn->target, reg, &tlen, level);if (r == 0)*len = distance_multiply(tlen, qn->lower);}elser = GET_CHAR_LEN_VARLEN;}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:if (! IS_CALL_RECURSION(NCALL(node)))r = get_char_length_tree1(NCALL(node)->target, reg, len, level);elser = GET_CHAR_LEN_VARLEN;break;#endifcase NT_CTYPE:*len = 1;break;case NT_CCLASS:case NT_CANY:*len = 1;break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_MEMORY:#ifdef USE_SUBEXP_CALLif (IS_ENCLOSE_CLEN_FIXED(en))*len = en->char_len;else {r = get_char_length_tree1(en->target, reg, len, level);if (r == 0) {en->char_len = *len;SET_ENCLOSE_STATUS(node, NST_CLEN_FIXED);}}break;#endifcase ENCLOSE_OPTION:case ENCLOSE_STOP_BACKTRACK:r = get_char_length_tree1(en->target, reg, len, level);break;default:break;}}break;case NT_ANCHOR:break;default:r = GET_CHAR_LEN_VARLEN;break;}return r;}static intget_char_length_tree(Node* node, regex_t* reg, int* len){return get_char_length_tree1(node, reg, len, 0);}/* x is not included y ==> 1 : 0 */static intis_not_included(Node* x, Node* y, regex_t* reg){int i, len;OnigCodePoint code;UChar *p, c;int ytype;retry:ytype = NTYPE(y);switch (NTYPE(x)) {case NT_CTYPE:{switch (ytype) {case NT_CTYPE:if (NCTYPE(y)->ctype == NCTYPE(x)->ctype &&NCTYPE(y)->not != NCTYPE(x)->not)return 1;elsereturn 0;break;case NT_CCLASS:swap:{Node* tmp;tmp = x; x = y; y = tmp;goto retry;}break;case NT_STR:goto swap;break;default:break;}}break;case NT_CCLASS:{CClassNode* xc = NCCLASS(x);switch (ytype) {case NT_CTYPE:switch (NCTYPE(y)->ctype) {case ONIGENC_CTYPE_WORD:if (NCTYPE(y)->not == 0) {if (IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) {for (i = 0; i < SINGLE_BYTE_SIZE; i++) {if (BITSET_AT(xc->bs, i)) {if (IS_CODE_SB_WORD(reg->enc, i)) return 0;}}return 1;}return 0;}else {for (i = 0; i < SINGLE_BYTE_SIZE; i++) {if (! IS_CODE_SB_WORD(reg->enc, i)) {if (!IS_NCCLASS_NOT(xc)) {if (BITSET_AT(xc->bs, i))return 0;}else {if (! BITSET_AT(xc->bs, i))return 0;}}}return 1;}break;default:break;}break;case NT_CCLASS:{int v;CClassNode* yc = NCCLASS(y);for (i = 0; i < SINGLE_BYTE_SIZE; i++) {v = BITSET_AT(xc->bs, i);if ((v != 0 && !IS_NCCLASS_NOT(xc)) ||(v == 0 && IS_NCCLASS_NOT(xc))) {v = BITSET_AT(yc->bs, i);if ((v != 0 && !IS_NCCLASS_NOT(yc)) ||(v == 0 && IS_NCCLASS_NOT(yc)))return 0;}}if ((IS_NULL(xc->mbuf) && !IS_NCCLASS_NOT(xc)) ||(IS_NULL(yc->mbuf) && !IS_NCCLASS_NOT(yc)))return 1;return 0;}break;case NT_STR:goto swap;break;default:break;}}break;case NT_STR:{StrNode* xs = NSTR(x);if (NSTRING_LEN(x) == 0)break;c = *(xs->s);switch (ytype) {case NT_CTYPE:switch (NCTYPE(y)->ctype) {case ONIGENC_CTYPE_WORD:if (ONIGENC_IS_MBC_WORD(reg->enc, xs->s, xs->end))return NCTYPE(y)->not;elsereturn !(NCTYPE(y)->not);break;default:break;}break;case NT_CCLASS:{CClassNode* cc = NCCLASS(y);code = ONIGENC_MBC_TO_CODE(reg->enc, xs->s,xs->s + ONIGENC_MBC_MAXLEN(reg->enc));return (onig_is_code_in_cc(reg->enc, code, cc) != 0 ? 0 : 1);}break;case NT_STR:{UChar *q;StrNode* ys = NSTR(y);len = NSTRING_LEN(x);if (len > NSTRING_LEN(y)) len = NSTRING_LEN(y);if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) {/* tiny version */return 0;}else {for (i = 0, p = ys->s, q = xs->s; i < len; i++, p++, q++) {if (*p != *q) return 1;}}}break;default:break;}}break;default:break;}return 0;}static Node*get_head_value_node(Node* node, int exact, regex_t* reg){Node* n = NULL_NODE;switch (NTYPE(node)) {case NT_BREF:case NT_ALT:case NT_CANY:#ifdef USE_SUBEXP_CALLcase NT_CALL:#endifbreak;case NT_CTYPE:case NT_CCLASS:if (exact == 0) {n = node;}break;case NT_LIST:n = get_head_value_node(NCAR(node), exact, reg);break;case NT_STR:{StrNode* sn = NSTR(node);if (sn->end <= sn->s)break;if (exact != 0 &&!NSTRING_IS_RAW(node) && IS_IGNORECASE(reg->options)) {}else {n = node;}}break;case NT_QTFR:{QtfrNode* qn = NQTFR(node);if (qn->lower > 0) {if (IS_NOT_NULL(qn->head_exact))n = qn->head_exact;elsen = get_head_value_node(qn->target, exact, reg);}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_OPTION:{OnigOptionType options = reg->options;reg->options = NENCLOSE(node)->option;n = get_head_value_node(NENCLOSE(node)->target, exact, reg);reg->options = options;}break;case ENCLOSE_MEMORY:case ENCLOSE_STOP_BACKTRACK:n = get_head_value_node(en->target, exact, reg);break;}}break;case NT_ANCHOR:if (NANCHOR(node)->type == ANCHOR_PREC_READ)n = get_head_value_node(NANCHOR(node)->target, exact, reg);break;default:break;}return n;}static intcheck_type_tree(Node* node, int type_mask, int enclose_mask, int anchor_mask){int type, r = 0;type = NTYPE(node);if ((NTYPE2BIT(type) & type_mask) == 0)return 1;switch (type) {case NT_LIST:case NT_ALT:do {r = check_type_tree(NCAR(node), type_mask, enclose_mask,anchor_mask);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:r = check_type_tree(NQTFR(node)->target, type_mask, enclose_mask,anchor_mask);break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);if ((en->type & enclose_mask) == 0)return 1;r = check_type_tree(en->target, type_mask, enclose_mask, anchor_mask);}break;case NT_ANCHOR:type = NANCHOR(node)->type;if ((type & anchor_mask) == 0)return 1;if (NANCHOR(node)->target)r = check_type_tree(NANCHOR(node)->target,type_mask, enclose_mask, anchor_mask);break;default:break;}return r;}#ifdef USE_SUBEXP_CALL#define RECURSION_EXIST 1#define RECURSION_INFINITE 2static intsubexp_inf_recursive_check(Node* node, ScanEnv* env, int head){int type;int r = 0;type = NTYPE(node);switch (type) {case NT_LIST:{Node *x;OnigDistance min;int ret;x = node;do {ret = subexp_inf_recursive_check(NCAR(x), env, head);if (ret < 0 || ret == RECURSION_INFINITE) return ret;r |= ret;if (head) {ret = get_min_match_length(NCAR(x), &min, env);if (ret != 0) return ret;if (min != 0) head = 0;}} while (IS_NOT_NULL(x = NCDR(x)));}break;case NT_ALT:{int ret;r = RECURSION_EXIST;do {ret = subexp_inf_recursive_check(NCAR(node), env, head);if (ret < 0 || ret == RECURSION_INFINITE) return ret;r &= ret;} while (IS_NOT_NULL(node = NCDR(node)));}break;case NT_QTFR:r = subexp_inf_recursive_check(NQTFR(node)->target, env, head);if (r == RECURSION_EXIST) {if (NQTFR(node)->lower == 0) r = 0;}break;case NT_ANCHOR:{AnchorNode* an = NANCHOR(node);switch (an->type) {case ANCHOR_PREC_READ:case ANCHOR_PREC_READ_NOT:case ANCHOR_LOOK_BEHIND:case ANCHOR_LOOK_BEHIND_NOT:r = subexp_inf_recursive_check(an->target, env, head);break;}}break;case NT_CALL:r = subexp_inf_recursive_check(NCALL(node)->target, env, head);break;case NT_ENCLOSE:if (IS_ENCLOSE_MARK2(NENCLOSE(node)))return 0;else if (IS_ENCLOSE_MARK1(NENCLOSE(node)))return (head == 0 ? RECURSION_EXIST : RECURSION_INFINITE);else {SET_ENCLOSE_STATUS(node, NST_MARK2);r = subexp_inf_recursive_check(NENCLOSE(node)->target, env, head);CLEAR_ENCLOSE_STATUS(node, NST_MARK2);}break;default:break;}return r;}static intsubexp_inf_recursive_check_trav(Node* node, ScanEnv* env){int type;int r = 0;type = NTYPE(node);switch (type) {case NT_LIST:case NT_ALT:do {r = subexp_inf_recursive_check_trav(NCAR(node), env);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:r = subexp_inf_recursive_check_trav(NQTFR(node)->target, env);break;case NT_ANCHOR:{AnchorNode* an = NANCHOR(node);switch (an->type) {case ANCHOR_PREC_READ:case ANCHOR_PREC_READ_NOT:case ANCHOR_LOOK_BEHIND:case ANCHOR_LOOK_BEHIND_NOT:r = subexp_inf_recursive_check_trav(an->target, env);break;}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);if (IS_ENCLOSE_RECURSION(en)) {SET_ENCLOSE_STATUS(node, NST_MARK1);r = subexp_inf_recursive_check(en->target, env, 1);if (r > 0) return ONIGERR_NEVER_ENDING_RECURSION;CLEAR_ENCLOSE_STATUS(node, NST_MARK1);}r = subexp_inf_recursive_check_trav(en->target, env);}break;default:break;}return r;}static intsubexp_recursive_check(Node* node){int r = 0;switch (NTYPE(node)) {case NT_LIST:case NT_ALT:do {r |= subexp_recursive_check(NCAR(node));} while (IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:r = subexp_recursive_check(NQTFR(node)->target);break;case NT_ANCHOR:{AnchorNode* an = NANCHOR(node);switch (an->type) {case ANCHOR_PREC_READ:case ANCHOR_PREC_READ_NOT:case ANCHOR_LOOK_BEHIND:case ANCHOR_LOOK_BEHIND_NOT:r = subexp_recursive_check(an->target);break;}}break;case NT_CALL:r = subexp_recursive_check(NCALL(node)->target);if (r != 0) SET_CALL_RECURSION(node);break;case NT_ENCLOSE:if (IS_ENCLOSE_MARK2(NENCLOSE(node)))return 0;else if (IS_ENCLOSE_MARK1(NENCLOSE(node)))return 1; /* recursion */else {SET_ENCLOSE_STATUS(node, NST_MARK2);r = subexp_recursive_check(NENCLOSE(node)->target);CLEAR_ENCLOSE_STATUS(node, NST_MARK2);}break;default:break;}return r;}static intsubexp_recursive_check_trav(Node* node, ScanEnv* env){#define FOUND_CALLED_NODE 1int type;int r = 0;type = NTYPE(node);switch (type) {case NT_LIST:case NT_ALT:{int ret;do {ret = subexp_recursive_check_trav(NCAR(node), env);if (ret == FOUND_CALLED_NODE) r = FOUND_CALLED_NODE;else if (ret < 0) return ret;} while (IS_NOT_NULL(node = NCDR(node)));}break;case NT_QTFR:r = subexp_recursive_check_trav(NQTFR(node)->target, env);if (NQTFR(node)->upper == 0) {if (r == FOUND_CALLED_NODE)NQTFR(node)->is_refered = 1;}break;case NT_ANCHOR:{AnchorNode* an = NANCHOR(node);switch (an->type) {case ANCHOR_PREC_READ:case ANCHOR_PREC_READ_NOT:case ANCHOR_LOOK_BEHIND:case ANCHOR_LOOK_BEHIND_NOT:r = subexp_recursive_check_trav(an->target, env);break;}}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);if (! IS_ENCLOSE_RECURSION(en)) {if (IS_ENCLOSE_CALLED(en)) {SET_ENCLOSE_STATUS(node, NST_MARK1);r = subexp_recursive_check(en->target);if (r != 0) SET_ENCLOSE_STATUS(node, NST_RECURSION);CLEAR_ENCLOSE_STATUS(node, NST_MARK1);}}r = subexp_recursive_check_trav(en->target, env);if (IS_ENCLOSE_CALLED(en))r |= FOUND_CALLED_NODE;}break;default:break;}return r;}static intsetup_subexp_call(Node* node, ScanEnv* env){int type;int r = 0;type = NTYPE(node);switch (type) {case NT_LIST:do {r = setup_subexp_call(NCAR(node), env);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_ALT:do {r = setup_subexp_call(NCAR(node), env);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_QTFR:r = setup_subexp_call(NQTFR(node)->target, env);break;case NT_ENCLOSE:r = setup_subexp_call(NENCLOSE(node)->target, env);break;case NT_CALL:{CallNode* cn = NCALL(node);Node** nodes = SCANENV_MEM_NODES(env);if (cn->group_num != 0) {int gnum = cn->group_num;#ifdef USE_NAMED_GROUPif (env->num_named > 0 &&IS_SYNTAX_BV(env->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&!ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_CAPTURE_GROUP)) {return ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED;}#endifif (gnum > env->num_mem) {onig_scan_env_set_error_string(env,ONIGERR_UNDEFINED_GROUP_REFERENCE, cn->name, cn->name_end);return ONIGERR_UNDEFINED_GROUP_REFERENCE;}#ifdef USE_NAMED_GROUPset_call_attr:#endifcn->target = nodes[cn->group_num];if (IS_NULL(cn->target)) {onig_scan_env_set_error_string(env,ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end);return ONIGERR_UNDEFINED_NAME_REFERENCE;}SET_ENCLOSE_STATUS(cn->target, NST_CALLED);BIT_STATUS_ON_AT(env->bt_mem_start, cn->group_num);cn->unset_addr_list = env->unset_addr_list;}#ifdef USE_NAMED_GROUPelse {int *refs;int n = onig_name_to_group_numbers(env->reg, cn->name, cn->name_end,&refs);if (n <= 0) {onig_scan_env_set_error_string(env,ONIGERR_UNDEFINED_NAME_REFERENCE, cn->name, cn->name_end);return ONIGERR_UNDEFINED_NAME_REFERENCE;}else if (n > 1) {onig_scan_env_set_error_string(env,ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, cn->name, cn->name_end);return ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL;}else {cn->group_num = refs[0];goto set_call_attr;}}#endif}break;case NT_ANCHOR:{AnchorNode* an = NANCHOR(node);switch (an->type) {case ANCHOR_PREC_READ:case ANCHOR_PREC_READ_NOT:case ANCHOR_LOOK_BEHIND:case ANCHOR_LOOK_BEHIND_NOT:r = setup_subexp_call(an->target, env);break;}}break;default:break;}return r;}#endif/* divide different length alternatives in look-behind.(?<=A|B) ==> (?<=A)|(?<=B)(?<!A|B) ==> (?<!A)(?<!B)*/static intdivide_look_behind_alternatives(Node* node){Node *head, *np, *insert_node;AnchorNode* an = NANCHOR(node);int anc_type = an->type;head = an->target;np = NCAR(head);swap_node(node, head);NCAR(node) = head;NANCHOR(head)->target = np;np = node;while ((np = NCDR(np)) != NULL_NODE) {insert_node = onig_node_new_anchor(anc_type);CHECK_NULL_RETURN_MEMERR(insert_node);NANCHOR(insert_node)->target = NCAR(np);NCAR(np) = insert_node;}if (anc_type == ANCHOR_LOOK_BEHIND_NOT) {np = node;do {SET_NTYPE(np, NT_LIST); /* alt -> list */} while ((np = NCDR(np)) != NULL_NODE);}return 0;}static intsetup_look_behind(Node* node, regex_t* reg, ScanEnv* env){int r, len;AnchorNode* an = NANCHOR(node);r = get_char_length_tree(an->target, reg, &len);if (r == 0)an->char_len = len;else if (r == GET_CHAR_LEN_VARLEN)r = ONIGERR_INVALID_LOOK_BEHIND_PATTERN;else if (r == GET_CHAR_LEN_TOP_ALT_VARLEN) {if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND))r = divide_look_behind_alternatives(node);elser = ONIGERR_INVALID_LOOK_BEHIND_PATTERN;}return r;}static intnext_setup(Node* node, Node* next_node, regex_t* reg){int type;retry:type = NTYPE(node);if (type == NT_QTFR) {QtfrNode* qn = NQTFR(node);if (qn->greedy && IS_REPEAT_INFINITE(qn->upper)) {#ifdef USE_QTFR_PEEK_NEXTNode* n = get_head_value_node(next_node, 1, reg);/* '\0': for UTF-16BE etc... */if (IS_NOT_NULL(n) && NSTR(n)->s[0] != '\0') {qn->next_head_exact = n;}#endif/* automatic posseivation a*b ==> (?>a*)b */if (qn->lower <= 1) {int ttype = NTYPE(qn->target);if (IS_NODE_TYPE_SIMPLE(ttype)) {Node *x, *y;x = get_head_value_node(qn->target, 0, reg);if (IS_NOT_NULL(x)) {y = get_head_value_node(next_node, 0, reg);if (IS_NOT_NULL(y) && is_not_included(x, y, reg)) {Node* en = onig_node_new_enclose(ENCLOSE_STOP_BACKTRACK);CHECK_NULL_RETURN_MEMERR(en);SET_ENCLOSE_STATUS(en, NST_STOP_BT_SIMPLE_REPEAT);swap_node(node, en);NENCLOSE(node)->target = en;}}}}}}else if (type == NT_ENCLOSE) {EncloseNode* en = NENCLOSE(node);if (en->type == ENCLOSE_MEMORY) {node = en->target;goto retry;}}return 0;}static intupdate_string_node_case_fold(regex_t* reg, Node *node){UChar *p, *q, *end, buf[ONIGENC_MBC_CASE_FOLD_MAXLEN];UChar *sbuf, *ebuf, *sp;int r, i, len, sbuf_size;StrNode* sn = NSTR(node);end = sn->end;sbuf_size = (end - sn->s) * 2;sbuf = (UChar* )xmalloc(sbuf_size);CHECK_NULL_RETURN_MEMERR(sbuf);ebuf = sbuf + sbuf_size;sp = sbuf;p = sn->s;while (p < end) {len = ONIGENC_MBC_CASE_FOLD(reg->enc, reg->case_fold_flag, &p, end, buf);q = buf;for (i = 0; i < len; i++) {if (sp >= ebuf) {sbuf = (UChar* )xrealloc(sbuf, sbuf_size * 2);CHECK_NULL_RETURN_MEMERR(sbuf);sp = sbuf + sbuf_size;sbuf_size *= 2;ebuf = sbuf + sbuf_size;}*sp++ = buf[i];}}r = onig_node_str_set(node, sbuf, sp);if (r != 0) {xfree(sbuf);return r;}xfree(sbuf);return 0;}static intexpand_case_fold_make_rem_string(Node** rnode, UChar *s, UChar *end,regex_t* reg){int r;Node *node;node = onig_node_new_str(s, end);if (IS_NULL(node)) return ONIGERR_MEMORY;r = update_string_node_case_fold(reg, node);if (r != 0) {onig_node_free(node);return r;}NSTRING_SET_AMBIG(node);NSTRING_SET_DONT_GET_OPT_INFO(node);*rnode = node;return 0;}static intexpand_case_fold_string_alt(int item_num, OnigCaseFoldCodeItem items[],UChar *p, int slen, UChar *end,regex_t* reg, Node **rnode){int r, i, j, len, varlen;Node *anode, *var_anode, *snode, *xnode, *an;UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];*rnode = var_anode = NULL_NODE;varlen = 0;for (i = 0; i < item_num; i++) {if (items[i].byte_len != slen) {varlen = 1;break;}}if (varlen != 0) {*rnode = var_anode = onig_node_new_alt(NULL_NODE, NULL_NODE);if (IS_NULL(var_anode)) return ONIGERR_MEMORY;xnode = onig_node_new_list(NULL, NULL);if (IS_NULL(xnode)) goto mem_err;NCAR(var_anode) = xnode;anode = onig_node_new_alt(NULL_NODE, NULL_NODE);if (IS_NULL(anode)) goto mem_err;NCAR(xnode) = anode;}else {*rnode = anode = onig_node_new_alt(NULL_NODE, NULL_NODE);if (IS_NULL(anode)) return ONIGERR_MEMORY;}snode = onig_node_new_str(p, p + slen);if (IS_NULL(snode)) goto mem_err;NCAR(anode) = snode;for (i = 0; i < item_num; i++) {snode = onig_node_new_str(NULL, NULL);if (IS_NULL(snode)) goto mem_err;for (j = 0; j < items[i].code_len; j++) {len = ONIGENC_CODE_TO_MBC(reg->enc, items[i].code[j], buf);if (len < 0) {r = len;goto mem_err2;}r = onig_node_str_cat(snode, buf, buf + len);if (r != 0) goto mem_err2;}an = onig_node_new_alt(NULL_NODE, NULL_NODE);if (IS_NULL(an)) {goto mem_err2;}if (items[i].byte_len != slen) {Node *rem;UChar *q = p + items[i].byte_len;if (q < end) {r = expand_case_fold_make_rem_string(&rem, q, end, reg);if (r != 0) {onig_node_free(an);goto mem_err2;}xnode = onig_node_list_add(NULL_NODE, snode);if (IS_NULL(xnode)) {onig_node_free(an);onig_node_free(rem);goto mem_err2;}if (IS_NULL(onig_node_list_add(xnode, rem))) {onig_node_free(an);onig_node_free(xnode);onig_node_free(rem);goto mem_err;}NCAR(an) = xnode;}else {NCAR(an) = snode;}NCDR(var_anode) = an;var_anode = an;}else {NCAR(an) = snode;NCDR(anode) = an;anode = an;}}return varlen;mem_err2:onig_node_free(snode);mem_err:onig_node_free(*rnode);return ONIGERR_MEMORY;}static intexpand_case_fold_string(Node* node, regex_t* reg){#define THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION 8int r, n, len, alt_num;UChar *start, *end, *p;Node *top_root, *root, *snode, *prev_node;OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM];StrNode* sn = NSTR(node);if (NSTRING_IS_AMBIG(node)) return 0;start = sn->s;end = sn->end;if (start >= end) return 0;r = 0;top_root = root = prev_node = snode = NULL_NODE;alt_num = 1;p = start;while (p < end) {n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(reg->enc, reg->case_fold_flag,p, end, items);if (n < 0) {r = n;goto err;}len = enclen(reg->enc, p);if (n == 0) {if (IS_NULL(snode)) {if (IS_NULL(root) && IS_NOT_NULL(prev_node)) {top_root = root = onig_node_list_add(NULL_NODE, prev_node);if (IS_NULL(root)) {onig_node_free(prev_node);goto mem_err;}}prev_node = snode = onig_node_new_str(NULL, NULL);if (IS_NULL(snode)) goto mem_err;if (IS_NOT_NULL(root)) {if (IS_NULL(onig_node_list_add(root, snode))) {onig_node_free(snode);goto mem_err;}}}r = onig_node_str_cat(snode, p, p + len);if (r != 0) goto err;}else {alt_num *= (n + 1);if (alt_num > THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION) break;if (IS_NULL(root) && IS_NOT_NULL(prev_node)) {top_root = root = onig_node_list_add(NULL_NODE, prev_node);if (IS_NULL(root)) {onig_node_free(prev_node);goto mem_err;}}r = expand_case_fold_string_alt(n, items, p, len, end, reg, &prev_node);if (r < 0) goto mem_err;if (r == 1) {if (IS_NULL(root)) {top_root = prev_node;}else {if (IS_NULL(onig_node_list_add(root, prev_node))) {onig_node_free(prev_node);goto mem_err;}}root = NCAR(prev_node);}else { /* r == 0 */if (IS_NOT_NULL(root)) {if (IS_NULL(onig_node_list_add(root, prev_node))) {onig_node_free(prev_node);goto mem_err;}}}snode = NULL_NODE;}p += len;}if (p < end) {Node *srem;r = expand_case_fold_make_rem_string(&srem, p, end, reg);if (r != 0) goto mem_err;if (IS_NOT_NULL(prev_node) && IS_NULL(root)) {top_root = root = onig_node_list_add(NULL_NODE, prev_node);if (IS_NULL(root)) {onig_node_free(srem);onig_node_free(prev_node);goto mem_err;}}if (IS_NULL(root)) {prev_node = srem;}else {if (IS_NULL(onig_node_list_add(root, srem))) {onig_node_free(srem);goto mem_err;}}}/* ending */top_root = (IS_NOT_NULL(top_root) ? top_root : prev_node);swap_node(node, top_root);onig_node_free(top_root);return 0;mem_err:r = ONIGERR_MEMORY;err:onig_node_free(top_root);return r;}#ifdef USE_COMBINATION_EXPLOSION_CHECK#define CEC_THRES_NUM_BIG_REPEAT 512#define CEC_INFINITE_NUM 0x7fffffff#define CEC_IN_INFINITE_REPEAT (1<<0)#define CEC_IN_FINITE_REPEAT (1<<1)#define CEC_CONT_BIG_REPEAT (1<<2)static intsetup_comb_exp_check(Node* node, int state, ScanEnv* env){int type;int r = state;type = NTYPE(node);switch (type) {case NT_LIST:{Node* prev = NULL_NODE;do {r = setup_comb_exp_check(NCAR(node), r, env);prev = NCAR(node);} while (r >= 0 && IS_NOT_NULL(node = NCDR(node)));}break;case NT_ALT:{int ret;do {ret = setup_comb_exp_check(NCAR(node), state, env);r |= ret;} while (ret >= 0 && IS_NOT_NULL(node = NCDR(node)));}break;case NT_QTFR:{int child_state = state;int add_state = 0;QtfrNode* qn = NQTFR(node);Node* target = qn->target;int var_num;if (! IS_REPEAT_INFINITE(qn->upper)) {if (qn->upper > 1) {/* {0,1}, {1,1} are allowed */child_state |= CEC_IN_FINITE_REPEAT;/* check (a*){n,m}, (a+){n,m} => (a*){n,n}, (a+){n,n} */if (env->backrefed_mem == 0) {if (NTYPE(qn->target) == NT_ENCLOSE) {EncloseNode* en = NENCLOSE(qn->target);if (en->type == ENCLOSE_MEMORY) {if (NTYPE(en->target) == NT_QTFR) {QtfrNode* q = NQTFR(en->target);if (IS_REPEAT_INFINITE(q->upper)&& q->greedy == qn->greedy) {qn->upper = (qn->lower == 0 ? 1 : qn->lower);if (qn->upper == 1)child_state = state;}}}}}}}if (state & CEC_IN_FINITE_REPEAT) {qn->comb_exp_check_num = -1;}else {if (IS_REPEAT_INFINITE(qn->upper)) {var_num = CEC_INFINITE_NUM;child_state |= CEC_IN_INFINITE_REPEAT;}else {var_num = qn->upper - qn->lower;}if (var_num >= CEC_THRES_NUM_BIG_REPEAT)add_state |= CEC_CONT_BIG_REPEAT;if (((state & CEC_IN_INFINITE_REPEAT) != 0 && var_num != 0) ||((state & CEC_CONT_BIG_REPEAT) != 0 &&var_num >= CEC_THRES_NUM_BIG_REPEAT)) {if (qn->comb_exp_check_num == 0) {env->num_comb_exp_check++;qn->comb_exp_check_num = env->num_comb_exp_check;if (env->curr_max_regnum > env->comb_exp_max_regnum)env->comb_exp_max_regnum = env->curr_max_regnum;}}}r = setup_comb_exp_check(target, child_state, env);r |= add_state;}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_MEMORY:{if (env->curr_max_regnum < en->regnum)env->curr_max_regnum = en->regnum;r = setup_comb_exp_check(en->target, state, env);}break;default:r = setup_comb_exp_check(en->target, state, env);break;}}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:if (IS_CALL_RECURSION(NCALL(node)))env->has_recursion = 1;elser = setup_comb_exp_check(NCALL(node)->target, state, env);break;#endifdefault:break;}return r;}#endif#define IN_ALT (1<<0)#define IN_NOT (1<<1)#define IN_REPEAT (1<<2)#define IN_VAR_REPEAT (1<<3)/* setup_tree does the following work.1. check empty loop. (set qn->target_empty_info)2. expand ignore-case in char class.3. set memory status bit flags. (reg->mem_stats)4. set qn->head_exact for [push, exact] -> [push_or_jump_exact1, exact].5. find invalid patterns in look-behind.6. expand repeated string.*/static intsetup_tree(Node* node, regex_t* reg, int state, ScanEnv* env){int type;int r = 0;type = NTYPE(node);switch (type) {case NT_LIST:{Node* prev = NULL_NODE;do {r = setup_tree(NCAR(node), reg, state, env);if (IS_NOT_NULL(prev) && r == 0) {r = next_setup(prev, NCAR(node), reg);}prev = NCAR(node);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));}break;case NT_ALT:do {r = setup_tree(NCAR(node), reg, (state | IN_ALT), env);} while (r == 0 && IS_NOT_NULL(node = NCDR(node)));break;case NT_CCLASS:break;case NT_STR:if (IS_IGNORECASE(reg->options) && !NSTRING_IS_RAW(node)) {r = expand_case_fold_string(node, reg);}break;case NT_CTYPE:case NT_CANY:break;#ifdef USE_SUBEXP_CALLcase NT_CALL:break;#endifcase NT_BREF:{int i;int* p;Node** nodes = SCANENV_MEM_NODES(env);BRefNode* br = NBREF(node);p = BACKREFS_P(br);for (i = 0; i < br->back_num; i++) {if (p[i] > env->num_mem) return ONIGERR_INVALID_BACKREF;BIT_STATUS_ON_AT(env->backrefed_mem, p[i]);BIT_STATUS_ON_AT(env->bt_mem_start, p[i]);#ifdef USE_BACKREF_WITH_LEVELif (IS_BACKREF_NEST_LEVEL(br)) {BIT_STATUS_ON_AT(env->bt_mem_end, p[i]);}#endifSET_ENCLOSE_STATUS(nodes[p[i]], NST_MEM_BACKREFED);}}break;case NT_QTFR:{OnigDistance d;QtfrNode* qn = NQTFR(node);Node* target = qn->target;if ((state & IN_REPEAT) != 0) {qn->state |= NST_IN_REPEAT;}if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) {r = get_min_match_length(target, &d, env);if (r) break;if (d == 0) {qn->target_empty_info = NQ_TARGET_IS_EMPTY;#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEATr = quantifiers_memory_node_info(target);if (r < 0) break;if (r > 0) {qn->target_empty_info = r;}#endif#if 0r = get_max_match_length(target, &d, env);if (r == 0 && d == 0) {/* ()* ==> ()?, ()+ ==> () */qn->upper = 1;if (qn->lower > 1) qn->lower = 1;if (NTYPE(target) == NT_STR) {qn->upper = qn->lower = 0; /* /(?:)+/ ==> // */}}#endif}}state |= IN_REPEAT;if (qn->lower != qn->upper)state |= IN_VAR_REPEAT;r = setup_tree(target, reg, state, env);if (r) break;/* expand string */#define EXPAND_STRING_MAX_LENGTH 100if (NTYPE(target) == NT_STR) {if (!IS_REPEAT_INFINITE(qn->lower) && qn->lower == qn->upper &&qn->lower > 1 && qn->lower <= EXPAND_STRING_MAX_LENGTH) {int len = NSTRING_LEN(target);StrNode* sn = NSTR(target);if (len * qn->lower <= EXPAND_STRING_MAX_LENGTH) {int i, n = qn->lower;onig_node_conv_to_str_node(node, NSTR(target)->flag);for (i = 0; i < n; i++) {r = onig_node_str_cat(node, sn->s, sn->end);if (r) break;}onig_node_free(target);break; /* break case NT_QTFR: */}}}#ifdef USE_OP_PUSH_OR_JUMP_EXACTif (qn->greedy && (qn->target_empty_info != 0)) {if (NTYPE(target) == NT_QTFR) {QtfrNode* tqn = NQTFR(target);if (IS_NOT_NULL(tqn->head_exact)) {qn->head_exact = tqn->head_exact;tqn->head_exact = NULL;}}else {qn->head_exact = get_head_value_node(qn->target, 1, reg);}}#endif}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_OPTION:{OnigOptionType options = reg->options;reg->options = NENCLOSE(node)->option;r = setup_tree(NENCLOSE(node)->target, reg, state, env);reg->options = options;}break;case ENCLOSE_MEMORY:if ((state & (IN_ALT | IN_NOT | IN_VAR_REPEAT)) != 0) {BIT_STATUS_ON_AT(env->bt_mem_start, en->regnum);/* SET_ENCLOSE_STATUS(node, NST_MEM_IN_ALT_NOT); */}r = setup_tree(en->target, reg, state, env);break;case ENCLOSE_STOP_BACKTRACK:{Node* target = en->target;r = setup_tree(target, reg, state, env);if (NTYPE(target) == NT_QTFR) {QtfrNode* tqn = NQTFR(target);if (IS_REPEAT_INFINITE(tqn->upper) && tqn->lower <= 1 &&tqn->greedy != 0) { /* (?>a*), a*+ etc... */int qtype = NTYPE(tqn->target);if (IS_NODE_TYPE_SIMPLE(qtype))SET_ENCLOSE_STATUS(node, NST_STOP_BT_SIMPLE_REPEAT);}}}break;}}break;case NT_ANCHOR:{AnchorNode* an = NANCHOR(node);switch (an->type) {case ANCHOR_PREC_READ:r = setup_tree(an->target, reg, state, env);break;case ANCHOR_PREC_READ_NOT:r = setup_tree(an->target, reg, (state | IN_NOT), env);break;/* allowed node types in look-behind */#define ALLOWED_TYPE_IN_LB \( BIT_NT_LIST | BIT_NT_ALT | BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE | \BIT_NT_CANY | BIT_NT_ANCHOR | BIT_NT_ENCLOSE | BIT_NT_QTFR | BIT_NT_CALL )#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY )#define ALLOWED_ENCLOSE_IN_LB_NOT 0#define ALLOWED_ANCHOR_IN_LB \( ANCHOR_LOOK_BEHIND | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION )#define ALLOWED_ANCHOR_IN_LB_NOT \( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION )case ANCHOR_LOOK_BEHIND:{r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB,ALLOWED_ENCLOSE_IN_LB, ALLOWED_ANCHOR_IN_LB);if (r < 0) return r;if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;r = setup_look_behind(node, reg, env);if (r != 0) return r;r = setup_tree(an->target, reg, state, env);}break;case ANCHOR_LOOK_BEHIND_NOT:{r = check_type_tree(an->target, ALLOWED_TYPE_IN_LB,ALLOWED_ENCLOSE_IN_LB_NOT, ALLOWED_ANCHOR_IN_LB_NOT);if (r < 0) return r;if (r > 0) return ONIGERR_INVALID_LOOK_BEHIND_PATTERN;r = setup_look_behind(node, reg, env);if (r != 0) return r;r = setup_tree(an->target, reg, (state | IN_NOT), env);}break;}}break;default:break;}return r;}/* set skip map for Boyer-Moor search */static intset_bm_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,UChar skip[], int** int_skip){int i, len;len = end - s;if (len < ONIG_CHAR_TABLE_SIZE) {for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) skip[i] = len;for (i = 0; i < len - 1; i++)skip[s[i]] = len - 1 - i;}else {if (IS_NULL(*int_skip)) {*int_skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE);if (IS_NULL(*int_skip)) return ONIGERR_MEMORY;}for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) (*int_skip)[i] = len;for (i = 0; i < len - 1; i++)(*int_skip)[s[i]] = len - 1 - i;}return 0;}#define OPT_EXACT_MAXLEN 24typedef struct {OnigDistance min; /* min byte length */OnigDistance max; /* max byte length */} MinMaxLen;typedef struct {MinMaxLen mmd;OnigEncoding enc;OnigOptionType options;OnigCaseFoldType case_fold_flag;ScanEnv* scan_env;} OptEnv;typedef struct {int left_anchor;int right_anchor;} OptAncInfo;typedef struct {MinMaxLen mmd; /* info position */OptAncInfo anc;int reach_end;int ignore_case;int len;UChar s[OPT_EXACT_MAXLEN];} OptExactInfo;typedef struct {MinMaxLen mmd; /* info position */OptAncInfo anc;int value; /* weighted value */UChar map[ONIG_CHAR_TABLE_SIZE];} OptMapInfo;typedef struct {MinMaxLen len;OptAncInfo anc;OptExactInfo exb; /* boundary */OptExactInfo exm; /* middle */OptExactInfo expr; /* prec read (?=...) */OptMapInfo map; /* boundary */} NodeOptInfo;static intmap_position_value(OnigEncoding enc, int i){static const short int ByteValTable[] = {5, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 10, 1, 1,1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,12, 4, 7, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5,5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 5, 5, 5,5, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 1};if (i < (int )(sizeof(ByteValTable)/sizeof(ByteValTable[0]))) {if (i == 0 && ONIGENC_MBC_MINLEN(enc) > 1)return 20;elsereturn (int )ByteValTable[i];}elsereturn 4; /* Take it easy. */}static intdistance_value(MinMaxLen* mm){/* 1000 / (min-max-dist + 1) */static const short int dist_vals[] = {1000, 500, 333, 250, 200, 167, 143, 125, 111, 100,91, 83, 77, 71, 67, 63, 59, 56, 53, 50,48, 45, 43, 42, 40, 38, 37, 36, 34, 33,32, 31, 30, 29, 29, 28, 27, 26, 26, 25,24, 24, 23, 23, 22, 22, 21, 21, 20, 20,20, 19, 19, 19, 18, 18, 18, 17, 17, 17,16, 16, 16, 16, 15, 15, 15, 15, 14, 14,14, 14, 14, 14, 13, 13, 13, 13, 13, 13,12, 12, 12, 12, 12, 12, 11, 11, 11, 11,11, 11, 11, 11, 11, 10, 10, 10, 10, 10};int d;if (mm->max == ONIG_INFINITE_DISTANCE) return 0;d = mm->max - mm->min;if (d < (int )(sizeof(dist_vals)/sizeof(dist_vals[0])))/* return dist_vals[d] * 16 / (mm->min + 12); */return (int )dist_vals[d];elsereturn 1;}static intcomp_distance_value(MinMaxLen* d1, MinMaxLen* d2, int v1, int v2){if (v2 <= 0) return -1;if (v1 <= 0) return 1;v1 *= distance_value(d1);v2 *= distance_value(d2);if (v2 > v1) return 1;if (v2 < v1) return -1;if (d2->min < d1->min) return 1;if (d2->min > d1->min) return -1;return 0;}static intis_equal_mml(MinMaxLen* a, MinMaxLen* b){return (a->min == b->min && a->max == b->max) ? 1 : 0;}static voidset_mml(MinMaxLen* mml, OnigDistance min, OnigDistance max){mml->min = min;mml->max = max;}static voidclear_mml(MinMaxLen* mml){mml->min = mml->max = 0;}static voidcopy_mml(MinMaxLen* to, MinMaxLen* from){to->min = from->min;to->max = from->max;}static voidadd_mml(MinMaxLen* to, MinMaxLen* from){to->min = distance_add(to->min, from->min);to->max = distance_add(to->max, from->max);}#if 0static voidadd_len_mml(MinMaxLen* to, OnigDistance len){to->min = distance_add(to->min, len);to->max = distance_add(to->max, len);}#endifstatic voidalt_merge_mml(MinMaxLen* to, MinMaxLen* from){if (to->min > from->min) to->min = from->min;if (to->max < from->max) to->max = from->max;}static voidcopy_opt_env(OptEnv* to, OptEnv* from){*to = *from;}static voidclear_opt_anc_info(OptAncInfo* anc){anc->left_anchor = 0;anc->right_anchor = 0;}static voidcopy_opt_anc_info(OptAncInfo* to, OptAncInfo* from){*to = *from;}static voidconcat_opt_anc_info(OptAncInfo* to, OptAncInfo* left, OptAncInfo* right,OnigDistance left_len, OnigDistance right_len){clear_opt_anc_info(to);to->left_anchor = left->left_anchor;if (left_len == 0) {to->left_anchor |= right->left_anchor;}to->right_anchor = right->right_anchor;if (right_len == 0) {to->right_anchor |= left->right_anchor;}}static intis_left_anchor(int anc){if (anc == ANCHOR_END_BUF || anc == ANCHOR_SEMI_END_BUF ||anc == ANCHOR_END_LINE || anc == ANCHOR_PREC_READ ||anc == ANCHOR_PREC_READ_NOT)return 0;return 1;}static intis_set_opt_anc_info(OptAncInfo* to, int anc){if ((to->left_anchor & anc) != 0) return 1;return ((to->right_anchor & anc) != 0 ? 1 : 0);}static voidadd_opt_anc_info(OptAncInfo* to, int anc){if (is_left_anchor(anc))to->left_anchor |= anc;elseto->right_anchor |= anc;}static voidremove_opt_anc_info(OptAncInfo* to, int anc){if (is_left_anchor(anc))to->left_anchor &= ~anc;elseto->right_anchor &= ~anc;}static voidalt_merge_opt_anc_info(OptAncInfo* to, OptAncInfo* add){to->left_anchor &= add->left_anchor;to->right_anchor &= add->right_anchor;}static intis_full_opt_exact_info(OptExactInfo* ex){return (ex->len >= OPT_EXACT_MAXLEN ? 1 : 0);}static voidclear_opt_exact_info(OptExactInfo* ex){clear_mml(&ex->mmd);clear_opt_anc_info(&ex->anc);ex->reach_end = 0;ex->ignore_case = 0;ex->len = 0;ex->s[0] = '\0';}static voidcopy_opt_exact_info(OptExactInfo* to, OptExactInfo* from){*to = *from;}static voidconcat_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OnigEncoding enc){int i, j, len;UChar *p, *end;OptAncInfo tanc;if (! to->ignore_case && add->ignore_case) {if (to->len >= add->len) return ; /* avoid */to->ignore_case = 1;}p = add->s;end = p + add->len;for (i = to->len; p < end; ) {len = enclen(enc, p);if (i + len > OPT_EXACT_MAXLEN) break;for (j = 0; j < len && p < end; j++)to->s[i++] = *p++;}to->len = i;to->reach_end = (p == end ? add->reach_end : 0);concat_opt_anc_info(&tanc, &to->anc, &add->anc, 1, 1);if (! to->reach_end) tanc.right_anchor = 0;copy_opt_anc_info(&to->anc, &tanc);}static voidconcat_opt_exact_info_str(OptExactInfo* to, UChar* s, UChar* end,int raw ARG_UNUSED, OnigEncoding enc){int i, j, len;UChar *p;for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) {len = enclen(enc, p);if (i + len > OPT_EXACT_MAXLEN) break;for (j = 0; j < len && p < end; j++)to->s[i++] = *p++;}to->len = i;}static voidalt_merge_opt_exact_info(OptExactInfo* to, OptExactInfo* add, OptEnv* env){int i, j, len;if (add->len == 0 || to->len == 0) {clear_opt_exact_info(to);return ;}if (! is_equal_mml(&to->mmd, &add->mmd)) {clear_opt_exact_info(to);return ;}for (i = 0; i < to->len && i < add->len; ) {if (to->s[i] != add->s[i]) break;len = enclen(env->enc, to->s + i);for (j = 1; j < len; j++) {if (to->s[i+j] != add->s[i+j]) break;}if (j < len) break;i += len;}if (! add->reach_end || i < add->len || i < to->len) {to->reach_end = 0;}to->len = i;to->ignore_case |= add->ignore_case;alt_merge_opt_anc_info(&to->anc, &add->anc);if (! to->reach_end) to->anc.right_anchor = 0;}static voidselect_opt_exact_info(OnigEncoding enc, OptExactInfo* now, OptExactInfo* alt){int v1, v2;v1 = now->len;v2 = alt->len;if (v2 == 0) {return ;}else if (v1 == 0) {copy_opt_exact_info(now, alt);return ;}else if (v1 <= 2 && v2 <= 2) {/* ByteValTable[x] is big value --> low price */v2 = map_position_value(enc, now->s[0]);v1 = map_position_value(enc, alt->s[0]);if (now->len > 1) v1 += 5;if (alt->len > 1) v2 += 5;}if (now->ignore_case == 0) v1 *= 2;if (alt->ignore_case == 0) v2 *= 2;if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0)copy_opt_exact_info(now, alt);}static voidclear_opt_map_info(OptMapInfo* map){static const OptMapInfo clean_info = {{0, 0}, {0, 0}, 0,{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};xmemcpy(map, &clean_info, sizeof(OptMapInfo));}static voidcopy_opt_map_info(OptMapInfo* to, OptMapInfo* from){*to = *from;}static voidadd_char_opt_map_info(OptMapInfo* map, UChar c, OnigEncoding enc){if (map->map[c] == 0) {map->map[c] = 1;map->value += map_position_value(enc, c);}}static intadd_char_amb_opt_map_info(OptMapInfo* map, UChar* p, UChar* end,OnigEncoding enc, OnigCaseFoldType case_fold_flag){OnigCaseFoldCodeItem items[ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM];UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];int i, n;add_char_opt_map_info(map, p[0], enc);case_fold_flag = DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag);n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, case_fold_flag, p, end, items);if (n < 0) return n;for (i = 0; i < n; i++) {ONIGENC_CODE_TO_MBC(enc, items[i].code[0], buf);add_char_opt_map_info(map, buf[0], enc);}return 0;}static voidselect_opt_map_info(OptMapInfo* now, OptMapInfo* alt){static int z = 1<<15; /* 32768: something big value */int v1, v2;if (alt->value == 0) return ;if (now->value == 0) {copy_opt_map_info(now, alt);return ;}v1 = z / now->value;v2 = z / alt->value;if (comp_distance_value(&now->mmd, &alt->mmd, v1, v2) > 0)copy_opt_map_info(now, alt);}static intcomp_opt_exact_or_map_info(OptExactInfo* e, OptMapInfo* m){#define COMP_EM_BASE 20int ve, vm;if (m->value <= 0) return -1;ve = COMP_EM_BASE * e->len * (e->ignore_case ? 1 : 2);vm = COMP_EM_BASE * 5 * 2 / m->value;return comp_distance_value(&e->mmd, &m->mmd, ve, vm);}static voidalt_merge_opt_map_info(OnigEncoding enc, OptMapInfo* to, OptMapInfo* add){int i, val;/* if (! is_equal_mml(&to->mmd, &add->mmd)) return ; */if (to->value == 0) return ;if (add->value == 0 || to->mmd.max < add->mmd.min) {clear_opt_map_info(to);return ;}alt_merge_mml(&to->mmd, &add->mmd);val = 0;for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) {if (add->map[i])to->map[i] = 1;if (to->map[i])val += map_position_value(enc, i);}to->value = val;alt_merge_opt_anc_info(&to->anc, &add->anc);}static voidset_bound_node_opt_info(NodeOptInfo* opt, MinMaxLen* mmd){copy_mml(&(opt->exb.mmd), mmd);copy_mml(&(opt->expr.mmd), mmd);copy_mml(&(opt->map.mmd), mmd);}static voidclear_node_opt_info(NodeOptInfo* opt){clear_mml(&opt->len);clear_opt_anc_info(&opt->anc);clear_opt_exact_info(&opt->exb);clear_opt_exact_info(&opt->exm);clear_opt_exact_info(&opt->expr);clear_opt_map_info(&opt->map);}static voidcopy_node_opt_info(NodeOptInfo* to, NodeOptInfo* from){*to = *from;}static voidconcat_left_node_opt_info(OnigEncoding enc, NodeOptInfo* to, NodeOptInfo* add){int exb_reach, exm_reach;OptAncInfo tanc;concat_opt_anc_info(&tanc, &to->anc, &add->anc, to->len.max, add->len.max);copy_opt_anc_info(&to->anc, &tanc);if (add->exb.len > 0 && to->len.max == 0) {concat_opt_anc_info(&tanc, &to->anc, &add->exb.anc,to->len.max, add->len.max);copy_opt_anc_info(&add->exb.anc, &tanc);}if (add->map.value > 0 && to->len.max == 0) {if (add->map.mmd.max == 0)add->map.anc.left_anchor |= to->anc.left_anchor;}exb_reach = to->exb.reach_end;exm_reach = to->exm.reach_end;if (add->len.max != 0)to->exb.reach_end = to->exm.reach_end = 0;if (add->exb.len > 0) {if (exb_reach) {concat_opt_exact_info(&to->exb, &add->exb, enc);clear_opt_exact_info(&add->exb);}else if (exm_reach) {concat_opt_exact_info(&to->exm, &add->exb, enc);clear_opt_exact_info(&add->exb);}}select_opt_exact_info(enc, &to->exm, &add->exb);select_opt_exact_info(enc, &to->exm, &add->exm);if (to->expr.len > 0) {if (add->len.max > 0) {if (to->expr.len > (int )add->len.max)to->expr.len = add->len.max;if (to->expr.mmd.max == 0)select_opt_exact_info(enc, &to->exb, &to->expr);elseselect_opt_exact_info(enc, &to->exm, &to->expr);}}else if (add->expr.len > 0) {copy_opt_exact_info(&to->expr, &add->expr);}select_opt_map_info(&to->map, &add->map);add_mml(&to->len, &add->len);}static voidalt_merge_node_opt_info(NodeOptInfo* to, NodeOptInfo* add, OptEnv* env){alt_merge_opt_anc_info (&to->anc, &add->anc);alt_merge_opt_exact_info(&to->exb, &add->exb, env);alt_merge_opt_exact_info(&to->exm, &add->exm, env);alt_merge_opt_exact_info(&to->expr, &add->expr, env);alt_merge_opt_map_info(env->enc, &to->map, &add->map);alt_merge_mml(&to->len, &add->len);}#define MAX_NODE_OPT_INFO_REF_COUNT 5static intoptimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env){int type;int r = 0;clear_node_opt_info(opt);set_bound_node_opt_info(opt, &env->mmd);type = NTYPE(node);switch (type) {case NT_LIST:{OptEnv nenv;NodeOptInfo nopt;Node* nd = node;copy_opt_env(&nenv, env);do {r = optimize_node_left(NCAR(nd), &nopt, &nenv);if (r == 0) {add_mml(&nenv.mmd, &nopt.len);concat_left_node_opt_info(env->enc, opt, &nopt);}} while (r == 0 && IS_NOT_NULL(nd = NCDR(nd)));}break;case NT_ALT:{NodeOptInfo nopt;Node* nd = node;do {r = optimize_node_left(NCAR(nd), &nopt, env);if (r == 0) {if (nd == node) copy_node_opt_info(opt, &nopt);else alt_merge_node_opt_info(opt, &nopt, env);}} while ((r == 0) && IS_NOT_NULL(nd = NCDR(nd)));}break;case NT_STR:{StrNode* sn = NSTR(node);int slen = sn->end - sn->s;int is_raw = NSTRING_IS_RAW(node);if (! NSTRING_IS_AMBIG(node)) {concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,NSTRING_IS_RAW(node), env->enc);if (slen > 0) {add_char_opt_map_info(&opt->map, *(sn->s), env->enc);}set_mml(&opt->len, slen, slen);}else {int max;if (NSTRING_IS_DONT_GET_OPT_INFO(node)) {int n = onigenc_strlen(env->enc, sn->s, sn->end);max = ONIGENC_MBC_MAXLEN_DIST(env->enc) * n;}else {concat_opt_exact_info_str(&opt->exb, sn->s, sn->end,is_raw, env->enc);opt->exb.ignore_case = 1;if (slen > 0) {r = add_char_amb_opt_map_info(&opt->map, sn->s, sn->end,env->enc, env->case_fold_flag);if (r != 0) break;}max = slen;}set_mml(&opt->len, slen, max);}if (opt->exb.len == slen)opt->exb.reach_end = 1;}break;case NT_CCLASS:{int i, z;CClassNode* cc = NCCLASS(node);/* no need to check ignore case. (setted in setup_tree()) */if (IS_NOT_NULL(cc->mbuf) || IS_NCCLASS_NOT(cc)) {OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc);set_mml(&opt->len, min, max);}else {for (i = 0; i < SINGLE_BYTE_SIZE; i++) {z = BITSET_AT(cc->bs, i);if ((z && !IS_NCCLASS_NOT(cc)) || (!z && IS_NCCLASS_NOT(cc))) {add_char_opt_map_info(&opt->map, (UChar )i, env->enc);}}set_mml(&opt->len, 1, 1);}}break;case NT_CTYPE:{int i, min, max;max = ONIGENC_MBC_MAXLEN_DIST(env->enc);if (max == 1) {min = 1;switch (NCTYPE(node)->ctype) {case ONIGENC_CTYPE_WORD:if (NCTYPE(node)->not != 0) {for (i = 0; i < SINGLE_BYTE_SIZE; i++) {if (! ONIGENC_IS_CODE_WORD(env->enc, i)) {add_char_opt_map_info(&opt->map, (UChar )i, env->enc);}}}else {for (i = 0; i < SINGLE_BYTE_SIZE; i++) {if (ONIGENC_IS_CODE_WORD(env->enc, i)) {add_char_opt_map_info(&opt->map, (UChar )i, env->enc);}}}break;}}else {min = ONIGENC_MBC_MINLEN(env->enc);}set_mml(&opt->len, min, max);}break;case NT_CANY:{OnigDistance min = ONIGENC_MBC_MINLEN(env->enc);OnigDistance max = ONIGENC_MBC_MAXLEN_DIST(env->enc);set_mml(&opt->len, min, max);}break;case NT_ANCHOR:switch (NANCHOR(node)->type) {case ANCHOR_BEGIN_BUF:case ANCHOR_BEGIN_POSITION:case ANCHOR_BEGIN_LINE:case ANCHOR_END_BUF:case ANCHOR_SEMI_END_BUF:case ANCHOR_END_LINE:add_opt_anc_info(&opt->anc, NANCHOR(node)->type);break;case ANCHOR_PREC_READ:{NodeOptInfo nopt;r = optimize_node_left(NANCHOR(node)->target, &nopt, env);if (r == 0) {if (nopt.exb.len > 0)copy_opt_exact_info(&opt->expr, &nopt.exb);else if (nopt.exm.len > 0)copy_opt_exact_info(&opt->expr, &nopt.exm);opt->expr.reach_end = 0;if (nopt.map.value > 0)copy_opt_map_info(&opt->map, &nopt.map);}}break;case ANCHOR_PREC_READ_NOT:case ANCHOR_LOOK_BEHIND: /* Sorry, I can't make use of it. */case ANCHOR_LOOK_BEHIND_NOT:break;}break;case NT_BREF:{int i;int* backs;OnigDistance min, max, tmin, tmax;Node** nodes = SCANENV_MEM_NODES(env->scan_env);BRefNode* br = NBREF(node);if (br->state & NST_RECURSION) {set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE);break;}backs = BACKREFS_P(br);r = get_min_match_length(nodes[backs[0]], &min, env->scan_env);if (r != 0) break;r = get_max_match_length(nodes[backs[0]], &max, env->scan_env);if (r != 0) break;for (i = 1; i < br->back_num; i++) {r = get_min_match_length(nodes[backs[i]], &tmin, env->scan_env);if (r != 0) break;r = get_max_match_length(nodes[backs[i]], &tmax, env->scan_env);if (r != 0) break;if (min > tmin) min = tmin;if (max < tmax) max = tmax;}if (r == 0) set_mml(&opt->len, min, max);}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:if (IS_CALL_RECURSION(NCALL(node)))set_mml(&opt->len, 0, ONIG_INFINITE_DISTANCE);else {OnigOptionType save = env->options;env->options = NENCLOSE(NCALL(node)->target)->option;r = optimize_node_left(NCALL(node)->target, opt, env);env->options = save;}break;#endifcase NT_QTFR:{int i;OnigDistance min, max;NodeOptInfo nopt;QtfrNode* qn = NQTFR(node);r = optimize_node_left(qn->target, &nopt, env);if (r) break;if (qn->lower == 0 && IS_REPEAT_INFINITE(qn->upper)) {if (env->mmd.max == 0 &&NTYPE(qn->target) == NT_CANY && qn->greedy) {if (IS_MULTILINE(env->options))add_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_ML);elseadd_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR);}}else {if (qn->lower > 0) {copy_node_opt_info(opt, &nopt);if (nopt.exb.len > 0) {if (nopt.exb.reach_end) {for (i = 2; i <= qn->lower &&! is_full_opt_exact_info(&opt->exb); i++) {concat_opt_exact_info(&opt->exb, &nopt.exb, env->enc);}if (i < qn->lower) {opt->exb.reach_end = 0;}}}if (qn->lower != qn->upper) {opt->exb.reach_end = 0;opt->exm.reach_end = 0;}if (qn->lower > 1)opt->exm.reach_end = 0;}}min = distance_multiply(nopt.len.min, qn->lower);if (IS_REPEAT_INFINITE(qn->upper))max = (nopt.len.max > 0 ? ONIG_INFINITE_DISTANCE : 0);elsemax = distance_multiply(nopt.len.max, qn->upper);set_mml(&opt->len, min, max);}break;case NT_ENCLOSE:{EncloseNode* en = NENCLOSE(node);switch (en->type) {case ENCLOSE_OPTION:{OnigOptionType save = env->options;env->options = en->option;r = optimize_node_left(en->target, opt, env);env->options = save;}break;case ENCLOSE_MEMORY:#ifdef USE_SUBEXP_CALLen->opt_count++;if (en->opt_count > MAX_NODE_OPT_INFO_REF_COUNT) {OnigDistance min, max;min = 0;max = ONIG_INFINITE_DISTANCE;if (IS_ENCLOSE_MIN_FIXED(en)) min = en->min_len;if (IS_ENCLOSE_MAX_FIXED(en)) max = en->max_len;set_mml(&opt->len, min, max);}else#endif{r = optimize_node_left(en->target, opt, env);if (is_set_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK)) {if (BIT_STATUS_AT(env->scan_env->backrefed_mem, en->regnum))remove_opt_anc_info(&opt->anc, ANCHOR_ANYCHAR_STAR_MASK);}}break;case ENCLOSE_STOP_BACKTRACK:r = optimize_node_left(en->target, opt, env);break;}}break;default:#ifdef ONIG_DEBUGfprintf(stderr, "optimize_node_left: undefined node type %d\n",NTYPE(node));#endifr = ONIGERR_TYPE_BUG;break;}return r;}static intset_optimize_exact_info(regex_t* reg, OptExactInfo* e){int r;if (e->len == 0) return 0;if (e->ignore_case) {reg->exact = (UChar* )xmalloc(e->len);CHECK_NULL_RETURN_MEMERR(reg->exact);xmemcpy(reg->exact, e->s, e->len);reg->exact_end = reg->exact + e->len;reg->optimize = ONIG_OPTIMIZE_EXACT_IC;}else {int allow_reverse;reg->exact = str_dup(e->s, e->s + e->len);CHECK_NULL_RETURN_MEMERR(reg->exact);reg->exact_end = reg->exact + e->len;allow_reverse =ONIGENC_IS_ALLOWED_REVERSE_MATCH(reg->enc, reg->exact, reg->exact_end);if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {r = set_bm_skip(reg->exact, reg->exact_end, reg->enc,reg->map, &(reg->int_map));if (r) return r;reg->optimize = (allow_reverse != 0? ONIG_OPTIMIZE_EXACT_BM : ONIG_OPTIMIZE_EXACT_BM_NOT_REV);}else {reg->optimize = ONIG_OPTIMIZE_EXACT;}}reg->dmin = e->mmd.min;reg->dmax = e->mmd.max;if (reg->dmin != ONIG_INFINITE_DISTANCE) {reg->threshold_len = reg->dmin + (reg->exact_end - reg->exact);}return 0;}static voidset_optimize_map_info(regex_t* reg, OptMapInfo* m){int i;for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)reg->map[i] = m->map[i];reg->optimize = ONIG_OPTIMIZE_MAP;reg->dmin = m->mmd.min;reg->dmax = m->mmd.max;if (reg->dmin != ONIG_INFINITE_DISTANCE) {reg->threshold_len = reg->dmin + 1;}}static voidset_sub_anchor(regex_t* reg, OptAncInfo* anc){reg->sub_anchor |= anc->left_anchor & ANCHOR_BEGIN_LINE;reg->sub_anchor |= anc->right_anchor & ANCHOR_END_LINE;}#ifdef ONIG_DEBUGstatic void print_optimize_info(FILE* f, regex_t* reg);#endifstatic intset_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env){int r;NodeOptInfo opt;OptEnv env;env.enc = reg->enc;env.options = reg->options;env.case_fold_flag = reg->case_fold_flag;env.scan_env = scan_env;clear_mml(&env.mmd);r = optimize_node_left(node, &opt, &env);if (r) return r;reg->anchor = opt.anc.left_anchor & (ANCHOR_BEGIN_BUF |ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML);reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF);if (reg->anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)) {reg->anchor_dmin = opt.len.min;reg->anchor_dmax = opt.len.max;}if (opt.exb.len > 0 || opt.exm.len > 0) {select_opt_exact_info(reg->enc, &opt.exb, &opt.exm);if (opt.map.value > 0 &&comp_opt_exact_or_map_info(&opt.exb, &opt.map) > 0) {goto set_map;}else {r = set_optimize_exact_info(reg, &opt.exb);set_sub_anchor(reg, &opt.exb.anc);}}else if (opt.map.value > 0) {set_map:set_optimize_map_info(reg, &opt.map);set_sub_anchor(reg, &opt.map.anc);}else {reg->sub_anchor |= opt.anc.left_anchor & ANCHOR_BEGIN_LINE;if (opt.len.max == 0)reg->sub_anchor |= opt.anc.right_anchor & ANCHOR_END_LINE;}#if defined(ONIG_DEBUG_COMPILE) || defined(ONIG_DEBUG_MATCH)print_optimize_info(stderr, reg);#endifreturn r;}static voidclear_optimize_info(regex_t* reg){reg->optimize = ONIG_OPTIMIZE_NONE;reg->anchor = 0;reg->anchor_dmin = 0;reg->anchor_dmax = 0;reg->sub_anchor = 0;reg->exact_end = (UChar* )NULL;reg->threshold_len = 0;if (IS_NOT_NULL(reg->exact)) {xfree(reg->exact);reg->exact = (UChar* )NULL;}}#ifdef ONIG_DEBUGstatic void print_enc_string(FILE* fp, OnigEncoding enc,const UChar *s, const UChar *end){fprintf(fp, "\nPATTERN: /");if (ONIGENC_MBC_MINLEN(enc) > 1) {const UChar *p;OnigCodePoint code;p = s;while (p < end) {code = ONIGENC_MBC_TO_CODE(enc, p, end);if (code >= 0x80) {fprintf(fp, " 0x%04x ", (int )code);}else {fputc((int )code, fp);}p += enclen(enc, p);}}else {while (s < end) {fputc((int )*s, fp);s++;}}fprintf(fp, "/\n");}static voidprint_distance_range(FILE* f, OnigDistance a, OnigDistance b){if (a == ONIG_INFINITE_DISTANCE)fputs("inf", f);elsefprintf(f, "(%u)", a);fputs("-", f);if (b == ONIG_INFINITE_DISTANCE)fputs("inf", f);elsefprintf(f, "(%u)", b);}static voidprint_anchor(FILE* f, int anchor){int q = 0;fprintf(f, "[");if (anchor & ANCHOR_BEGIN_BUF) {fprintf(f, "begin-buf");q = 1;}if (anchor & ANCHOR_BEGIN_LINE) {if (q) fprintf(f, ", ");q = 1;fprintf(f, "begin-line");}if (anchor & ANCHOR_BEGIN_POSITION) {if (q) fprintf(f, ", ");q = 1;fprintf(f, "begin-pos");}if (anchor & ANCHOR_END_BUF) {if (q) fprintf(f, ", ");q = 1;fprintf(f, "end-buf");}if (anchor & ANCHOR_SEMI_END_BUF) {if (q) fprintf(f, ", ");q = 1;fprintf(f, "semi-end-buf");}if (anchor & ANCHOR_END_LINE) {if (q) fprintf(f, ", ");q = 1;fprintf(f, "end-line");}if (anchor & ANCHOR_ANYCHAR_STAR) {if (q) fprintf(f, ", ");q = 1;fprintf(f, "anychar-star");}if (anchor & ANCHOR_ANYCHAR_STAR_ML) {if (q) fprintf(f, ", ");fprintf(f, "anychar-star-pl");}fprintf(f, "]");}static voidprint_optimize_info(FILE* f, regex_t* reg){static const char* on[] = { "NONE", "EXACT", "EXACT_BM", "EXACT_BM_NOT_REV","EXACT_IC", "MAP" };fprintf(f, "optimize: %s\n", on[reg->optimize]);fprintf(f, " anchor: "); print_anchor(f, reg->anchor);if ((reg->anchor & ANCHOR_END_BUF_MASK) != 0)print_distance_range(f, reg->anchor_dmin, reg->anchor_dmax);fprintf(f, "\n");if (reg->optimize) {fprintf(f, " sub anchor: "); print_anchor(f, reg->sub_anchor);fprintf(f, "\n");}fprintf(f, "\n");if (reg->exact) {UChar *p;fprintf(f, "exact: [");for (p = reg->exact; p < reg->exact_end; p++) {fputc(*p, f);}fprintf(f, "]: length: %d\n", (reg->exact_end - reg->exact));}else if (reg->optimize & ONIG_OPTIMIZE_MAP) {int c, i, n = 0;for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)if (reg->map[i]) n++;fprintf(f, "map: n=%d\n", n);if (n > 0) {c = 0;fputc('[', f);for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) {if (reg->map[i] != 0) {if (c > 0) fputs(", ", f);c++;if (ONIGENC_MBC_MAXLEN(reg->enc) == 1 &&ONIGENC_IS_CODE_PRINT(reg->enc, (OnigCodePoint )i))fputc(i, f);elsefprintf(f, "%d", i);}}fprintf(f, "]\n");}}}#endif /* ONIG_DEBUG */extern voidonig_free_body(regex_t* reg){if (IS_NOT_NULL(reg)) {if (IS_NOT_NULL(reg->p)) xfree(reg->p);if (IS_NOT_NULL(reg->exact)) xfree(reg->exact);if (IS_NOT_NULL(reg->int_map)) xfree(reg->int_map);if (IS_NOT_NULL(reg->int_map_backward)) xfree(reg->int_map_backward);if (IS_NOT_NULL(reg->repeat_range)) xfree(reg->repeat_range);if (IS_NOT_NULL(reg->chain)) onig_free(reg->chain);#ifdef USE_NAMED_GROUPonig_names_free(reg);#endif}}extern voidonig_free(regex_t* reg){if (IS_NOT_NULL(reg)) {onig_free_body(reg);xfree(reg);}}#define REGEX_TRANSFER(to,from) do {\(to)->state = ONIG_STATE_MODIFY;\onig_free_body(to);\xmemcpy(to, from, sizeof(regex_t));\xfree(from);\} while (0)extern voidonig_transfer(regex_t* to, regex_t* from){THREAD_ATOMIC_START;REGEX_TRANSFER(to, from);THREAD_ATOMIC_END;}#define REGEX_CHAIN_HEAD(reg) do {\while (IS_NOT_NULL((reg)->chain)) {\(reg) = (reg)->chain;\}\} while (0)extern voidonig_chain_link_add(regex_t* to, regex_t* add){THREAD_ATOMIC_START;REGEX_CHAIN_HEAD(to);to->chain = add;THREAD_ATOMIC_END;}extern voidonig_chain_reduce(regex_t* reg){regex_t *head, *prev;prev = reg;head = prev->chain;if (IS_NOT_NULL(head)) {reg->state = ONIG_STATE_MODIFY;while (IS_NOT_NULL(head->chain)) {prev = head;head = head->chain;}prev->chain = (regex_t* )NULL;REGEX_TRANSFER(reg, head);}}#ifdef ONIG_DEBUGstatic void print_compiled_byte_code_list P_((FILE* f, regex_t* reg));#endif#ifdef ONIG_DEBUG_PARSE_TREEstatic void print_tree P_((FILE* f, Node* node));#endifextern intonig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,OnigErrorInfo* einfo){#define COMPILE_INIT_SIZE 20int r, init_size;Node* root;ScanEnv scan_env;#ifdef USE_SUBEXP_CALLUnsetAddrList uslist;#endifif (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;reg->state = ONIG_STATE_COMPILING;#ifdef ONIG_DEBUGprint_enc_string(stderr, reg->enc, pattern, pattern_end);#endifif (reg->alloc == 0) {init_size = (pattern_end - pattern) * 2;if (init_size <= 0) init_size = COMPILE_INIT_SIZE;r = BBUF_INIT(reg, init_size);if (r != 0) goto end;}elsereg->used = 0;reg->num_mem = 0;reg->num_repeat = 0;reg->num_null_check = 0;reg->repeat_range_alloc = 0;reg->repeat_range = (OnigRepeatRange* )NULL;#ifdef USE_COMBINATION_EXPLOSION_CHECKreg->num_comb_exp_check = 0;#endifr = onig_parse_make_tree(&root, pattern, pattern_end, reg, &scan_env);if (r != 0) goto err;#ifdef USE_NAMED_GROUP/* mixed use named group and no-named group */if (scan_env.num_named > 0 &&IS_SYNTAX_BV(scan_env.syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&!ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) {if (scan_env.num_named != scan_env.num_mem)r = disable_noname_group_capture(&root, reg, &scan_env);elser = numbered_ref_check(root);if (r != 0) goto err;}#endif#ifdef USE_SUBEXP_CALLif (scan_env.num_call > 0) {r = unset_addr_list_init(&uslist, scan_env.num_call);if (r != 0) goto err;scan_env.unset_addr_list = &uslist;r = setup_subexp_call(root, &scan_env);if (r != 0) goto err_unset;r = subexp_recursive_check_trav(root, &scan_env);if (r < 0) goto err_unset;r = subexp_inf_recursive_check_trav(root, &scan_env);if (r != 0) goto err_unset;reg->num_call = scan_env.num_call;}elsereg->num_call = 0;#endifr = setup_tree(root, reg, 0, &scan_env);if (r != 0) goto err_unset;#ifdef ONIG_DEBUG_PARSE_TREEprint_tree(stderr, root);#endifreg->capture_history = scan_env.capture_history;reg->bt_mem_start = scan_env.bt_mem_start;reg->bt_mem_start |= reg->capture_history;if (IS_FIND_CONDITION(reg->options))BIT_STATUS_ON_ALL(reg->bt_mem_end);else {reg->bt_mem_end = scan_env.bt_mem_end;reg->bt_mem_end |= reg->capture_history;}#ifdef USE_COMBINATION_EXPLOSION_CHECKif (scan_env.backrefed_mem == 0#ifdef USE_SUBEXP_CALL|| scan_env.num_call == 0#endif) {setup_comb_exp_check(root, 0, &scan_env);#ifdef USE_SUBEXP_CALLif (scan_env.has_recursion != 0) {scan_env.num_comb_exp_check = 0;}else#endifif (scan_env.comb_exp_max_regnum > 0) {int i;for (i = 1; i <= scan_env.comb_exp_max_regnum; i++) {if (BIT_STATUS_AT(scan_env.backrefed_mem, i) != 0) {scan_env.num_comb_exp_check = 0;break;}}}}reg->num_comb_exp_check = scan_env.num_comb_exp_check;#endifclear_optimize_info(reg);#ifndef ONIG_DONT_OPTIMIZEr = set_optimize_info_from_tree(root, reg, &scan_env);if (r != 0) goto err_unset;#endifif (IS_NOT_NULL(scan_env.mem_nodes_dynamic)) {xfree(scan_env.mem_nodes_dynamic);scan_env.mem_nodes_dynamic = (Node** )NULL;}r = compile_tree(root, reg);if (r == 0) {r = add_opcode(reg, OP_END);#ifdef USE_SUBEXP_CALLif (scan_env.num_call > 0) {r = unset_addr_list_fix(&uslist, reg);unset_addr_list_end(&uslist);if (r) goto err;}#endifif ((reg->num_repeat != 0) || (reg->bt_mem_end != 0))reg->stack_pop_level = STACK_POP_LEVEL_ALL;else {if (reg->bt_mem_start != 0)reg->stack_pop_level = STACK_POP_LEVEL_MEM_START;elsereg->stack_pop_level = STACK_POP_LEVEL_FREE;}}#ifdef USE_SUBEXP_CALLelse if (scan_env.num_call > 0) {unset_addr_list_end(&uslist);}#endifonig_node_free(root);#ifdef ONIG_DEBUG_COMPILE#ifdef USE_NAMED_GROUPonig_print_names(stderr, reg);#endifprint_compiled_byte_code_list(stderr, reg);#endifend:reg->state = ONIG_STATE_NORMAL;return r;err_unset:#ifdef USE_SUBEXP_CALLif (scan_env.num_call > 0) {unset_addr_list_end(&uslist);}#endiferr:if (IS_NOT_NULL(scan_env.error)) {if (IS_NOT_NULL(einfo)) {einfo->enc = scan_env.enc;einfo->par = scan_env.error;einfo->par_end = scan_env.error_end;}}onig_node_free(root);if (IS_NOT_NULL(scan_env.mem_nodes_dynamic))xfree(scan_env.mem_nodes_dynamic);return r;}#ifdef USE_RECOMPILE_APIextern intonig_recompile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,OnigErrorInfo* einfo){int r;regex_t *new_reg;r = onig_new(&new_reg, pattern, pattern_end, option, enc, syntax, einfo);if (r) return r;if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) {onig_transfer(reg, new_reg);}else {onig_chain_link_add(reg, new_reg);}return 0;}#endifstatic int onig_inited = 0;extern intonig_reg_init(regex_t* reg, OnigOptionType option,OnigCaseFoldType case_fold_flag,OnigEncoding enc, OnigSyntaxType* syntax){if (! onig_inited)onig_init();if (IS_NULL(reg))return ONIGERR_INVALID_ARGUMENT;if (ONIGENC_IS_UNDEF(enc))return ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED;if ((option & (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP))== (ONIG_OPTION_DONT_CAPTURE_GROUP|ONIG_OPTION_CAPTURE_GROUP)) {return ONIGERR_INVALID_COMBINATION_OF_OPTIONS;}(reg)->state = ONIG_STATE_MODIFY;if ((option & ONIG_OPTION_NEGATE_SINGLELINE) != 0) {option |= syntax->options;option &= ~ONIG_OPTION_SINGLELINE;}elseoption |= syntax->options;(reg)->enc = enc;(reg)->options = option;(reg)->syntax = syntax;(reg)->optimize = 0;(reg)->exact = (UChar* )NULL;(reg)->int_map = (int* )NULL;(reg)->int_map_backward = (int* )NULL;(reg)->chain = (regex_t* )NULL;(reg)->p = (UChar* )NULL;(reg)->alloc = 0;(reg)->used = 0;(reg)->name_table = (void* )NULL;(reg)->case_fold_flag = case_fold_flag;return 0;}extern intonig_new_without_alloc(regex_t* reg, const UChar* pattern,const UChar* pattern_end, OnigOptionType option, OnigEncoding enc,OnigSyntaxType* syntax, OnigErrorInfo* einfo){int r;r = onig_reg_init(reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);if (r) return r;r = onig_compile(reg, pattern, pattern_end, einfo);return r;}extern intonig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,OnigOptionType option, OnigEncoding enc, OnigSyntaxType* syntax,OnigErrorInfo* einfo){int r;*reg = (regex_t* )xmalloc(sizeof(regex_t));if (IS_NULL(*reg)) return ONIGERR_MEMORY;r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);if (r) goto err;r = onig_compile(*reg, pattern, pattern_end, einfo);if (r) {err:onig_free(*reg);*reg = NULL;}return r;}extern intonig_init(void){if (onig_inited != 0)return 0;THREAD_SYSTEM_INIT;THREAD_ATOMIC_START;onig_inited = 1;onigenc_init();/* onigenc_set_default_caseconv_table((UChar* )0); */#ifdef ONIG_DEBUG_STATISTICSonig_statistics_init();#endifTHREAD_ATOMIC_END;return 0;}extern intonig_end(void){THREAD_ATOMIC_START;#ifdef ONIG_DEBUG_STATISTICSonig_print_statistics(stderr);#endif#ifdef USE_SHARED_CCLASS_TABLEonig_free_shared_cclass_table();#endif#ifdef USE_PARSE_TREE_NODE_RECYCLEonig_free_node_list();#endifonig_inited = 0;THREAD_ATOMIC_END;THREAD_SYSTEM_END;return 0;}extern intonig_is_in_code_range(const UChar* p, OnigCodePoint code){OnigCodePoint n, *data;OnigCodePoint low, high, x;GET_CODE_POINT(n, p);data = (OnigCodePoint* )p;data++;for (low = 0, high = n; low < high; ) {x = (low + high) >> 1;if (code > data[x * 2 + 1])low = x + 1;elsehigh = x;}return ((low < n && code >= data[low * 2]) ? 1 : 0);}extern intonig_is_code_in_cc_len(int elen, OnigCodePoint code, CClassNode* cc){int found;if (elen > 1 || (code >= SINGLE_BYTE_SIZE)) {if (IS_NULL(cc->mbuf)) {found = 0;}else {found = (onig_is_in_code_range(cc->mbuf->p, code) != 0 ? 1 : 0);}}else {found = (BITSET_AT(cc->bs, code) == 0 ? 0 : 1);}if (IS_NCCLASS_NOT(cc))return !found;elsereturn found;}extern intonig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc){int len;if (ONIGENC_MBC_MINLEN(enc) > 1) {len = 2;}else {len = ONIGENC_CODE_TO_MBCLEN(enc, code);}return onig_is_code_in_cc_len(len, code, cc);}#ifdef ONIG_DEBUG/* arguments type */#define ARG_SPECIAL -1#define ARG_NON 0#define ARG_RELADDR 1#define ARG_ABSADDR 2#define ARG_LENGTH 3#define ARG_MEMNUM 4#define ARG_OPTION 5#define ARG_STATE_CHECK 6OnigOpInfoType OnigOpInfo[] = {{ OP_FINISH, "finish", ARG_NON },{ OP_END, "end", ARG_NON },{ OP_EXACT1, "exact1", ARG_SPECIAL },{ OP_EXACT2, "exact2", ARG_SPECIAL },{ OP_EXACT3, "exact3", ARG_SPECIAL },{ OP_EXACT4, "exact4", ARG_SPECIAL },{ OP_EXACT5, "exact5", ARG_SPECIAL },{ OP_EXACTN, "exactn", ARG_SPECIAL },{ OP_EXACTMB2N1, "exactmb2-n1", ARG_SPECIAL },{ OP_EXACTMB2N2, "exactmb2-n2", ARG_SPECIAL },{ OP_EXACTMB2N3, "exactmb2-n3", ARG_SPECIAL },{ OP_EXACTMB2N, "exactmb2-n", ARG_SPECIAL },{ OP_EXACTMB3N, "exactmb3n" , ARG_SPECIAL },{ OP_EXACTMBN, "exactmbn", ARG_SPECIAL },{ OP_EXACT1_IC, "exact1-ic", ARG_SPECIAL },{ OP_EXACTN_IC, "exactn-ic", ARG_SPECIAL },{ OP_CCLASS, "cclass", ARG_SPECIAL },{ OP_CCLASS_MB, "cclass-mb", ARG_SPECIAL },{ OP_CCLASS_MIX, "cclass-mix", ARG_SPECIAL },{ OP_CCLASS_NOT, "cclass-not", ARG_SPECIAL },{ OP_CCLASS_MB_NOT, "cclass-mb-not", ARG_SPECIAL },{ OP_CCLASS_MIX_NOT, "cclass-mix-not", ARG_SPECIAL },{ OP_CCLASS_NODE, "cclass-node", ARG_SPECIAL },{ OP_ANYCHAR, "anychar", ARG_NON },{ OP_ANYCHAR_ML, "anychar-ml", ARG_NON },{ OP_ANYCHAR_STAR, "anychar*", ARG_NON },{ OP_ANYCHAR_ML_STAR, "anychar-ml*", ARG_NON },{ OP_ANYCHAR_STAR_PEEK_NEXT, "anychar*-peek-next", ARG_SPECIAL },{ OP_ANYCHAR_ML_STAR_PEEK_NEXT, "anychar-ml*-peek-next", ARG_SPECIAL },{ OP_WORD, "word", ARG_NON },{ OP_NOT_WORD, "not-word", ARG_NON },{ OP_WORD_BOUND, "word-bound", ARG_NON },{ OP_NOT_WORD_BOUND, "not-word-bound", ARG_NON },{ OP_WORD_BEGIN, "word-begin", ARG_NON },{ OP_WORD_END, "word-end", ARG_NON },{ OP_BEGIN_BUF, "begin-buf", ARG_NON },{ OP_END_BUF, "end-buf", ARG_NON },{ OP_BEGIN_LINE, "begin-line", ARG_NON },{ OP_END_LINE, "end-line", ARG_NON },{ OP_SEMI_END_BUF, "semi-end-buf", ARG_NON },{ OP_BEGIN_POSITION, "begin-position", ARG_NON },{ OP_BACKREF1, "backref1", ARG_NON },{ OP_BACKREF2, "backref2", ARG_NON },{ OP_BACKREFN, "backrefn", ARG_MEMNUM },{ OP_BACKREFN_IC, "backrefn-ic", ARG_SPECIAL },{ OP_BACKREF_MULTI, "backref_multi", ARG_SPECIAL },{ OP_BACKREF_MULTI_IC, "backref_multi-ic", ARG_SPECIAL },{ OP_BACKREF_WITH_LEVEL, "backref_at_level", ARG_SPECIAL },{ OP_MEMORY_START_PUSH, "mem-start-push", ARG_MEMNUM },{ OP_MEMORY_START, "mem-start", ARG_MEMNUM },{ OP_MEMORY_END_PUSH, "mem-end-push", ARG_MEMNUM },{ OP_MEMORY_END_PUSH_REC, "mem-end-push-rec", ARG_MEMNUM },{ OP_MEMORY_END, "mem-end", ARG_MEMNUM },{ OP_MEMORY_END_REC, "mem-end-rec", ARG_MEMNUM },{ OP_SET_OPTION_PUSH, "set-option-push", ARG_OPTION },{ OP_SET_OPTION, "set-option", ARG_OPTION },{ OP_FAIL, "fail", ARG_NON },{ OP_JUMP, "jump", ARG_RELADDR },{ OP_PUSH, "push", ARG_RELADDR },{ OP_POP, "pop", ARG_NON },{ OP_PUSH_OR_JUMP_EXACT1, "push-or-jump-e1", ARG_SPECIAL },{ OP_PUSH_IF_PEEK_NEXT, "push-if-peek-next", ARG_SPECIAL },{ OP_REPEAT, "repeat", ARG_SPECIAL },{ OP_REPEAT_NG, "repeat-ng", ARG_SPECIAL },{ OP_REPEAT_INC, "repeat-inc", ARG_MEMNUM },{ OP_REPEAT_INC_NG, "repeat-inc-ng", ARG_MEMNUM },{ OP_REPEAT_INC_SG, "repeat-inc-sg", ARG_MEMNUM },{ OP_REPEAT_INC_NG_SG, "repeat-inc-ng-sg", ARG_MEMNUM },{ OP_NULL_CHECK_START, "null-check-start", ARG_MEMNUM },{ OP_NULL_CHECK_END, "null-check-end", ARG_MEMNUM },{ OP_NULL_CHECK_END_MEMST,"null-check-end-memst", ARG_MEMNUM },{ OP_NULL_CHECK_END_MEMST_PUSH,"null-check-end-memst-push", ARG_MEMNUM },{ OP_PUSH_POS, "push-pos", ARG_NON },{ OP_POP_POS, "pop-pos", ARG_NON },{ OP_PUSH_POS_NOT, "push-pos-not", ARG_RELADDR },{ OP_FAIL_POS, "fail-pos", ARG_NON },{ OP_PUSH_STOP_BT, "push-stop-bt", ARG_NON },{ OP_POP_STOP_BT, "pop-stop-bt", ARG_NON },{ OP_LOOK_BEHIND, "look-behind", ARG_SPECIAL },{ OP_PUSH_LOOK_BEHIND_NOT, "push-look-behind-not", ARG_SPECIAL },{ OP_FAIL_LOOK_BEHIND_NOT, "fail-look-behind-not", ARG_NON },{ OP_CALL, "call", ARG_ABSADDR },{ OP_RETURN, "return", ARG_NON },{ OP_STATE_CHECK_PUSH, "state-check-push", ARG_SPECIAL },{ OP_STATE_CHECK_PUSH_OR_JUMP, "state-check-push-or-jump", ARG_SPECIAL },{ OP_STATE_CHECK, "state-check", ARG_STATE_CHECK },{ OP_STATE_CHECK_ANYCHAR_STAR, "state-check-anychar*", ARG_STATE_CHECK },{ OP_STATE_CHECK_ANYCHAR_ML_STAR,"state-check-anychar-ml*", ARG_STATE_CHECK },{ -1, "", ARG_NON }};static char*op2name(int opcode){int i;for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {if (opcode == OnigOpInfo[i].opcode)return OnigOpInfo[i].name;}return "";}static intop2arg_type(int opcode){int i;for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {if (opcode == OnigOpInfo[i].opcode)return OnigOpInfo[i].arg_type;}return ARG_SPECIAL;}static voidIndent(FILE* f, int indent){int i;for (i = 0; i < indent; i++) putc(' ', f);}static voidp_string(FILE* f, int len, UChar* s){fputs(":", f);while (len-- > 0) { fputc(*s++, f); }}static voidp_len_string(FILE* f, LengthType len, int mb_len, UChar* s){int x = len * mb_len;fprintf(f, ":%d:", len);while (x-- > 0) { fputc(*s++, f); }}extern voidonig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp,OnigEncoding enc){int i, n, arg_type;RelAddrType addr;LengthType len;MemNumType mem;StateCheckNumType scn;OnigCodePoint code;UChar *q;fprintf(f, "[%s", op2name(*bp));arg_type = op2arg_type(*bp);if (arg_type != ARG_SPECIAL) {bp++;switch (arg_type) {case ARG_NON:break;case ARG_RELADDR:GET_RELADDR_INC(addr, bp);fprintf(f, ":(%d)", addr);break;case ARG_ABSADDR:GET_ABSADDR_INC(addr, bp);fprintf(f, ":(%d)", addr);break;case ARG_LENGTH:GET_LENGTH_INC(len, bp);fprintf(f, ":%d", len);break;case ARG_MEMNUM:mem = *((MemNumType* )bp);bp += SIZE_MEMNUM;fprintf(f, ":%d", mem);break;case ARG_OPTION:{OnigOptionType option = *((OnigOptionType* )bp);bp += SIZE_OPTION;fprintf(f, ":%d", option);}break;case ARG_STATE_CHECK:scn = *((StateCheckNumType* )bp);bp += SIZE_STATE_CHECK_NUM;fprintf(f, ":%d", scn);break;}}else {switch (*bp++) {case OP_EXACT1:case OP_ANYCHAR_STAR_PEEK_NEXT:case OP_ANYCHAR_ML_STAR_PEEK_NEXT:p_string(f, 1, bp++); break;case OP_EXACT2:p_string(f, 2, bp); bp += 2; break;case OP_EXACT3:p_string(f, 3, bp); bp += 3; break;case OP_EXACT4:p_string(f, 4, bp); bp += 4; break;case OP_EXACT5:p_string(f, 5, bp); bp += 5; break;case OP_EXACTN:GET_LENGTH_INC(len, bp);p_len_string(f, len, 1, bp);bp += len;break;case OP_EXACTMB2N1:p_string(f, 2, bp); bp += 2; break;case OP_EXACTMB2N2:p_string(f, 4, bp); bp += 4; break;case OP_EXACTMB2N3:p_string(f, 6, bp); bp += 6; break;case OP_EXACTMB2N:GET_LENGTH_INC(len, bp);p_len_string(f, len, 2, bp);bp += len * 2;break;case OP_EXACTMB3N:GET_LENGTH_INC(len, bp);p_len_string(f, len, 3, bp);bp += len * 3;break;case OP_EXACTMBN:{int mb_len;GET_LENGTH_INC(mb_len, bp);GET_LENGTH_INC(len, bp);fprintf(f, ":%d:%d:", mb_len, len);n = len * mb_len;while (n-- > 0) { fputc(*bp++, f); }}break;case OP_EXACT1_IC:len = enclen(enc, bp);p_string(f, len, bp);bp += len;break;case OP_EXACTN_IC:GET_LENGTH_INC(len, bp);p_len_string(f, len, 1, bp);bp += len;break;case OP_CCLASS:n = bitset_on_num((BitSetRef )bp);bp += SIZE_BITSET;fprintf(f, ":%d", n);break;case OP_CCLASS_NOT:n = bitset_on_num((BitSetRef )bp);bp += SIZE_BITSET;fprintf(f, ":%d", n);break;case OP_CCLASS_MB:case OP_CCLASS_MB_NOT:GET_LENGTH_INC(len, bp);q = bp;#ifndef PLATFORM_UNALIGNED_WORD_ACCESSALIGNMENT_RIGHT(q);#endifGET_CODE_POINT(code, q);bp += len;fprintf(f, ":%d:%d", (int )code, len);break;case OP_CCLASS_MIX:case OP_CCLASS_MIX_NOT:n = bitset_on_num((BitSetRef )bp);bp += SIZE_BITSET;GET_LENGTH_INC(len, bp);q = bp;#ifndef PLATFORM_UNALIGNED_WORD_ACCESSALIGNMENT_RIGHT(q);#endifGET_CODE_POINT(code, q);bp += len;fprintf(f, ":%d:%d:%d", n, (int )code, len);break;case OP_CCLASS_NODE:{CClassNode *cc;GET_POINTER_INC(cc, bp);n = bitset_on_num(cc->bs);fprintf(f, ":%u:%d", (unsigned int )cc, n);}break;case OP_BACKREFN_IC:mem = *((MemNumType* )bp);bp += SIZE_MEMNUM;fprintf(f, ":%d", mem);break;case OP_BACKREF_MULTI_IC:case OP_BACKREF_MULTI:fputs(" ", f);GET_LENGTH_INC(len, bp);for (i = 0; i < len; i++) {GET_MEMNUM_INC(mem, bp);if (i > 0) fputs(", ", f);fprintf(f, "%d", mem);}break;case OP_BACKREF_WITH_LEVEL:{OnigOptionType option;LengthType level;GET_OPTION_INC(option, bp);fprintf(f, ":%d", option);GET_LENGTH_INC(level, bp);fprintf(f, ":%d", level);fputs(" ", f);GET_LENGTH_INC(len, bp);for (i = 0; i < len; i++) {GET_MEMNUM_INC(mem, bp);if (i > 0) fputs(", ", f);fprintf(f, "%d", mem);}}break;case OP_REPEAT:case OP_REPEAT_NG:{mem = *((MemNumType* )bp);bp += SIZE_MEMNUM;addr = *((RelAddrType* )bp);bp += SIZE_RELADDR;fprintf(f, ":%d:%d", mem, addr);}break;case OP_PUSH_OR_JUMP_EXACT1:case OP_PUSH_IF_PEEK_NEXT:addr = *((RelAddrType* )bp);bp += SIZE_RELADDR;fprintf(f, ":(%d)", addr);p_string(f, 1, bp);bp += 1;break;case OP_LOOK_BEHIND:GET_LENGTH_INC(len, bp);fprintf(f, ":%d", len);break;case OP_PUSH_LOOK_BEHIND_NOT:GET_RELADDR_INC(addr, bp);GET_LENGTH_INC(len, bp);fprintf(f, ":%d:(%d)", len, addr);break;case OP_STATE_CHECK_PUSH:case OP_STATE_CHECK_PUSH_OR_JUMP:scn = *((StateCheckNumType* )bp);bp += SIZE_STATE_CHECK_NUM;addr = *((RelAddrType* )bp);bp += SIZE_RELADDR;fprintf(f, ":%d:(%d)", scn, addr);break;default:fprintf(stderr, "onig_print_compiled_byte_code: undefined code %d\n",*--bp);}}fputs("]", f);if (nextp) *nextp = bp;}static voidprint_compiled_byte_code_list(FILE* f, regex_t* reg){int ncode;UChar* bp = reg->p;UChar* end = reg->p + reg->used;fprintf(f, "code length: %d\n", reg->used);ncode = 0;while (bp < end) {ncode++;if (bp > reg->p) {if (ncode % 5 == 0)fprintf(f, "\n");elsefputs(" ", f);}onig_print_compiled_byte_code(f, bp, &bp, reg->enc);}fprintf(f, "\n");}static voidprint_indent_tree(FILE* f, Node* node, int indent){int i, type;int add = 3;UChar* p;Indent(f, indent);if (IS_NULL(node)) {fprintf(f, "ERROR: null node!!!\n");exit (0);}type = NTYPE(node);switch (type) {case NT_LIST:case NT_ALT:if (NTYPE(node) == NT_LIST)fprintf(f, "<list:%x>\n", (int )node);elsefprintf(f, "<alt:%x>\n", (int )node);print_indent_tree(f, NCAR(node), indent + add);while (IS_NOT_NULL(node = NCDR(node))) {if (NTYPE(node) != type) {fprintf(f, "ERROR: list/alt right is not a cons. %d\n", NTYPE(node));exit(0);}print_indent_tree(f, NCAR(node), indent + add);}break;case NT_STR:fprintf(f, "<string%s:%x>",(NSTRING_IS_RAW(node) ? "-raw" : ""), (int )node);for (p = NSTR(node)->s; p < NSTR(node)->end; p++) {if (*p >= 0x20 && *p < 0x7f)fputc(*p, f);else {fprintf(f, " 0x%02x", *p);}}break;case NT_CCLASS:fprintf(f, "<cclass:%x>", (int )node);if (IS_NCCLASS_NOT(NCCLASS(node))) fputs(" not", f);if (NCCLASS(node)->mbuf) {BBuf* bbuf = NCCLASS(node)->mbuf;for (i = 0; i < bbuf->used; i++) {if (i > 0) fprintf(f, ",");fprintf(f, "%0x", bbuf->p[i]);}}break;case NT_CTYPE:fprintf(f, "<ctype:%x> ", (int )node);switch (NCTYPE(node)->ctype) {case ONIGENC_CTYPE_WORD:if (NCTYPE(node)->not != 0)fputs("not word", f);elsefputs("word", f);break;default:fprintf(f, "ERROR: undefined ctype.\n");exit(0);}break;case NT_CANY:fprintf(f, "<anychar:%x>", (int )node);break;case NT_ANCHOR:fprintf(f, "<anchor:%x> ", (int )node);switch (NANCHOR(node)->type) {case ANCHOR_BEGIN_BUF: fputs("begin buf", f); break;case ANCHOR_END_BUF: fputs("end buf", f); break;case ANCHOR_BEGIN_LINE: fputs("begin line", f); break;case ANCHOR_END_LINE: fputs("end line", f); break;case ANCHOR_SEMI_END_BUF: fputs("semi end buf", f); break;case ANCHOR_BEGIN_POSITION: fputs("begin position", f); break;case ANCHOR_WORD_BOUND: fputs("word bound", f); break;case ANCHOR_NOT_WORD_BOUND: fputs("not word bound", f); break;#ifdef USE_WORD_BEGIN_ENDcase ANCHOR_WORD_BEGIN: fputs("word begin", f); break;case ANCHOR_WORD_END: fputs("word end", f); break;#endifcase ANCHOR_PREC_READ: fputs("prec read", f); break;case ANCHOR_PREC_READ_NOT: fputs("prec read not", f); break;case ANCHOR_LOOK_BEHIND: fputs("look_behind", f); break;case ANCHOR_LOOK_BEHIND_NOT: fputs("look_behind_not",f); break;default:fprintf(f, "ERROR: undefined anchor type.\n");break;}break;case NT_BREF:{int* p;BRefNode* br = NBREF(node);p = BACKREFS_P(br);fprintf(f, "<backref:%x>", (int )node);for (i = 0; i < br->back_num; i++) {if (i > 0) fputs(", ", f);fprintf(f, "%d", p[i]);}}break;#ifdef USE_SUBEXP_CALLcase NT_CALL:{CallNode* cn = NCALL(node);fprintf(f, "<call:%x>", (int )node);p_string(f, cn->name_end - cn->name, cn->name);}break;#endifcase NT_QTFR:fprintf(f, "<quantifier:%x>{%d,%d}%s\n", (int )node,NQTFR(node)->lower, NQTFR(node)->upper,(NQTFR(node)->greedy ? "" : "?"));print_indent_tree(f, NQTFR(node)->target, indent + add);break;case NT_ENCLOSE:fprintf(f, "<enclose:%x> ", (int )node);switch (NENCLOSE(node)->type) {case ENCLOSE_OPTION:fprintf(f, "option:%d\n", NENCLOSE(node)->option);print_indent_tree(f, NENCLOSE(node)->target, indent + add);break;case ENCLOSE_MEMORY:fprintf(f, "memory:%d", NENCLOSE(node)->regnum);break;case ENCLOSE_STOP_BACKTRACK:fprintf(f, "stop-bt");break;default:break;}fprintf(f, "\n");print_indent_tree(f, NENCLOSE(node)->target, indent + add);break;default:fprintf(f, "print_indent_tree: undefined node type %d\n", NTYPE(node));break;}if (type != NT_LIST && type != NT_ALT && type != NT_QTFR &&type != NT_ENCLOSE)fprintf(f, "\n");fflush(f);}#endif /* ONIG_DEBUG */#ifdef ONIG_DEBUG_PARSE_TREEstatic voidprint_tree(FILE* f, Node* node){print_indent_tree(f, node, 0);}#endif
/**********************************************************************regenc.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT;extern intonigenc_init(void){return 0;}extern OnigEncodingonigenc_get_default_encoding(void){return OnigEncDefaultCharEncoding;}extern intonigenc_set_default_encoding(OnigEncoding enc){OnigEncDefaultCharEncoding = enc;return 0;}extern UChar*onigenc_get_right_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s){UChar* p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s);if (p < s) {p += enclen(enc, p);}return p;}extern UChar*onigenc_get_right_adjust_char_head_with_prev(OnigEncoding enc,const UChar* start, const UChar* s, const UChar** prev){UChar* p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s);if (p < s) {if (prev) *prev = (const UChar* )p;p += enclen(enc, p);}else {if (prev) *prev = (const UChar* )NULL; /* Sorry */}return p;}extern UChar*onigenc_get_prev_char_head(OnigEncoding enc, const UChar* start, const UChar* s){if (s <= start)return (UChar* )NULL;return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1);}extern UChar*onigenc_step_back(OnigEncoding enc, const UChar* start, const UChar* s, int n){while (ONIG_IS_NOT_NULL(s) && n-- > 0) {if (s <= start)return (UChar* )NULL;s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s - 1);}return (UChar* )s;}extern UChar*onigenc_step(OnigEncoding enc, const UChar* p, const UChar* end, int n){UChar* q = (UChar* )p;while (n-- > 0) {q += ONIGENC_MBC_ENC_LEN(enc, q);}return (q <= end ? q : NULL);}extern intonigenc_strlen(OnigEncoding enc, const UChar* p, const UChar* end){int n = 0;UChar* q = (UChar* )p;while (q < end) {q += ONIGENC_MBC_ENC_LEN(enc, q);n++;}return n;}extern intonigenc_strlen_null(OnigEncoding enc, const UChar* s){int n = 0;UChar* p = (UChar* )s;while (1) {if (*p == '\0') {UChar* q;int len = ONIGENC_MBC_MINLEN(enc);if (len == 1) return n;q = p + 1;while (len > 1) {if (*q != '\0') break;q++;len--;}if (len == 1) return n;}p += ONIGENC_MBC_ENC_LEN(enc, p);n++;}}extern intonigenc_str_bytelen_null(OnigEncoding enc, const UChar* s){UChar* start = (UChar* )s;UChar* p = (UChar* )s;while (1) {if (*p == '\0') {UChar* q;int len = ONIGENC_MBC_MINLEN(enc);if (len == 1) return (int )(p - start);q = p + 1;while (len > 1) {if (*q != '\0') break;q++;len--;}if (len == 1) return (int )(p - start);}p += ONIGENC_MBC_ENC_LEN(enc, p);}}const UChar OnigEncAsciiToLowerCaseTable[] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',};#ifdef USE_UPPER_CASE_TABLEconst UChar OnigEncAsciiToUpperCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\101', '\102', '\103', '\104', '\105', '\106', '\107','\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117','\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127','\130', '\131', '\132', '\133', '\134', '\135', '\136', '\137','\140', '\101', '\102', '\103', '\104', '\105', '\106', '\107','\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117','\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127','\130', '\131', '\132', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',};#endifconst unsigned short OnigEncAsciiCtypeTable[256] = {0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};const UChar OnigEncISO_8859_1_ToLowerCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137','\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147','\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157','\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167','\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337','\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347','\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357','\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367','\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'};#ifdef USE_UPPER_CASE_TABLEconst UChar OnigEncISO_8859_1_ToUpperCaseTable[256] = {'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007','\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017','\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027','\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037','\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047','\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057','\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067','\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077','\100', '\101', '\102', '\103', '\104', '\105', '\106', '\107','\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117','\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127','\130', '\131', '\132', '\133', '\134', '\135', '\136', '\137','\140', '\101', '\102', '\103', '\104', '\105', '\106', '\107','\110', '\111', '\112', '\113', '\114', '\115', '\116', '\117','\120', '\121', '\122', '\123', '\124', '\125', '\126', '\127','\130', '\131', '\132', '\173', '\174', '\175', '\176', '\177','\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207','\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217','\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227','\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237','\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247','\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257','\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267','\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337','\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307','\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317','\320', '\321', '\322', '\323', '\324', '\325', '\326', '\367','\330', '\331', '\332', '\333', '\334', '\335', '\336', '\377',};#endifextern voidonigenc_set_default_caseconv_table(const UChar* table ARG_UNUSED){/* nothing *//* obsoleted. */}extern UChar*onigenc_get_left_adjust_char_head(OnigEncoding enc, const UChar* start, const UChar* s){return ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, start, s);}const OnigPairCaseFoldCodes OnigAsciiLowerMap[] = {{ 0x41, 0x61 },{ 0x42, 0x62 },{ 0x43, 0x63 },{ 0x44, 0x64 },{ 0x45, 0x65 },{ 0x46, 0x66 },{ 0x47, 0x67 },{ 0x48, 0x68 },{ 0x49, 0x69 },{ 0x4a, 0x6a },{ 0x4b, 0x6b },{ 0x4c, 0x6c },{ 0x4d, 0x6d },{ 0x4e, 0x6e },{ 0x4f, 0x6f },{ 0x50, 0x70 },{ 0x51, 0x71 },{ 0x52, 0x72 },{ 0x53, 0x73 },{ 0x54, 0x74 },{ 0x55, 0x75 },{ 0x56, 0x76 },{ 0x57, 0x77 },{ 0x58, 0x78 },{ 0x59, 0x79 },{ 0x5a, 0x7a }};extern intonigenc_ascii_apply_all_case_fold(OnigCaseFoldType flag ARG_UNUSED,OnigApplyAllCaseFoldFunc f, void* arg){OnigCodePoint code;int i, r;for (i = 0;i < (int )(sizeof(OnigAsciiLowerMap)/sizeof(OnigPairCaseFoldCodes));i++) {code = OnigAsciiLowerMap[i].to;r = (*f)(OnigAsciiLowerMap[i].from, &code, 1, arg);if (r != 0) return r;code = OnigAsciiLowerMap[i].from;r = (*f)(OnigAsciiLowerMap[i].to, &code, 1, arg);if (r != 0) return r;}return 0;}extern intonigenc_ascii_get_case_fold_codes_by_str(OnigCaseFoldType flag ARG_UNUSED,const OnigUChar* p, const OnigUChar* end ARG_UNUSED,OnigCaseFoldCodeItem items[]){if (0x41 <= *p && *p <= 0x5a) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p + 0x20);return 1;}else if (0x61 <= *p && *p <= 0x7a) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p - 0x20);return 1;}elsereturn 0;}static intss_apply_all_case_fold(OnigCaseFoldType flag ARG_UNUSED,OnigApplyAllCaseFoldFunc f, void* arg){static OnigCodePoint ss[] = { 0x73, 0x73 };return (*f)((OnigCodePoint )0xdf, ss, 2, arg);}extern intonigenc_apply_all_case_fold_with_map(int map_size,const OnigPairCaseFoldCodes map[],int ess_tsett_flag, OnigCaseFoldType flag,OnigApplyAllCaseFoldFunc f, void* arg){OnigCodePoint code;int i, r;r = onigenc_ascii_apply_all_case_fold(flag, f, arg);if (r != 0) return r;for (i = 0; i < map_size; i++) {code = map[i].to;r = (*f)(map[i].from, &code, 1, arg);if (r != 0) return r;code = map[i].from;r = (*f)(map[i].to, &code, 1, arg);if (r != 0) return r;}if (ess_tsett_flag != 0)return ss_apply_all_case_fold(flag, f, arg);return 0;}extern intonigenc_get_case_fold_codes_by_str_with_map(int map_size,const OnigPairCaseFoldCodes map[],int ess_tsett_flag, OnigCaseFoldType flag ARG_UNUSED,const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]){if (0x41 <= *p && *p <= 0x5a) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p + 0x20);if (*p == 0x53 && ess_tsett_flag != 0 && end > p + 1&& (*(p+1) == 0x53 || *(p+1) == 0x73)) {/* SS */items[1].byte_len = 2;items[1].code_len = 1;items[1].code[0] = (OnigCodePoint )0xdf;return 2;}elsereturn 1;}else if (0x61 <= *p && *p <= 0x7a) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = (OnigCodePoint )(*p - 0x20);if (*p == 0x73 && ess_tsett_flag != 0 && end > p + 1&& (*(p+1) == 0x73 || *(p+1) == 0x53)) {/* ss */items[1].byte_len = 2;items[1].code_len = 1;items[1].code[0] = (OnigCodePoint )0xdf;return 2;}elsereturn 1;}else if (*p == 0xdf && ess_tsett_flag != 0) {items[0].byte_len = 1;items[0].code_len = 2;items[0].code[0] = (OnigCodePoint )'s';items[0].code[1] = (OnigCodePoint )'s';items[1].byte_len = 1;items[1].code_len = 2;items[1].code[0] = (OnigCodePoint )'S';items[1].code[1] = (OnigCodePoint )'S';items[2].byte_len = 1;items[2].code_len = 2;items[2].code[0] = (OnigCodePoint )'s';items[2].code[1] = (OnigCodePoint )'S';items[3].byte_len = 1;items[3].code_len = 2;items[3].code[0] = (OnigCodePoint )'S';items[3].code[1] = (OnigCodePoint )'s';return 4;}else {int i;for (i = 0; i < map_size; i++) {if (*p == map[i].from) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = map[i].to;return 1;}else if (*p == map[i].to) {items[0].byte_len = 1;items[0].code_len = 1;items[0].code[0] = map[i].from;return 1;}}}return 0;}extern intonigenc_not_support_get_ctype_code_range(OnigCtype ctype ARG_UNUSED,OnigCodePoint* sb_out ARG_UNUSED,const OnigCodePoint* ranges[] ARG_UNUSED){return ONIG_NO_SUPPORT_CONFIG;}extern intonigenc_is_mbc_newline_0x0a(const UChar* p, const UChar* end){if (p < end) {if (*p == 0x0a) return 1;}return 0;}/* for single byte encodings */extern intonigenc_ascii_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, const UChar** p,const UChar*end ARG_UNUSED, UChar* lower){*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(**p);(*p)++;return 1; /* return byte length of converted char to lower */}#if 0extern intonigenc_ascii_is_mbc_ambiguous(OnigCaseFoldType flag,const UChar** pp, const UChar* end){const UChar* p = *pp;(*pp)++;return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);}#endifextern intonigenc_single_byte_mbc_enc_len(const UChar* p ARG_UNUSED){return 1;}extern OnigCodePointonigenc_single_byte_mbc_to_code(const UChar* p, const UChar* end ARG_UNUSED){return (OnigCodePoint )(*p);}extern intonigenc_single_byte_code_to_mbclen(OnigCodePoint code ARG_UNUSED){return (code < 0x100 ? 1 : ONIGERR_INVALID_CODE_POINT_VALUE);}extern intonigenc_single_byte_code_to_mbc(OnigCodePoint code, UChar *buf){*buf = (UChar )(code & 0xff);return 1;}extern UChar*onigenc_single_byte_left_adjust_char_head(const UChar* start ARG_UNUSED,const UChar* s){return (UChar* )s;}extern intonigenc_always_true_is_allowed_reverse_match(const UChar* s ARG_UNUSED,const UChar* end ARG_UNUSED){return TRUE;}extern intonigenc_always_false_is_allowed_reverse_match(const UChar* s ARG_UNUSED,const UChar* end ARG_UNUSED){return FALSE;}extern OnigCodePointonigenc_mbn_mbc_to_code(OnigEncoding enc, const UChar* p, const UChar* end){int c, i, len;OnigCodePoint n;len = enclen(enc, p);n = (OnigCodePoint )(*p++);if (len == 1) return n;for (i = 1; i < len; i++) {if (p >= end) break;c = *p++;n <<= 8; n += c;}return n;}extern intonigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED,const UChar** pp, const UChar* end ARG_UNUSED,UChar* lower){int len;const UChar *p = *pp;if (ONIGENC_IS_MBC_ASCII(p)) {*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);(*pp)++;return 1;}else {int i;len = enclen(enc, p);for (i = 0; i < len; i++) {*lower++ = *p++;}(*pp) += len;return len; /* return byte length of converted to lower char */}}#if 0extern intonigenc_mbn_is_mbc_ambiguous(OnigEncoding enc, OnigCaseFoldType flag,const UChar** pp, const UChar* end){const UChar* p = *pp;if (ONIGENC_IS_MBC_ASCII(p)) {(*pp)++;return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);}(*pp) += enclen(enc, p);return FALSE;}#endifextern intonigenc_mb2_code_to_mbclen(OnigCodePoint code){if ((code & 0xff00) != 0) return 2;else return 1;}extern intonigenc_mb4_code_to_mbclen(OnigCodePoint code){if ((code & 0xff000000) != 0) return 4;else if ((code & 0xff0000) != 0) return 3;else if ((code & 0xff00) != 0) return 2;else return 1;}extern intonigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf){UChar *p = buf;if ((code & 0xff00) != 0) {*p++ = (UChar )((code >> 8) & 0xff);}*p++ = (UChar )(code & 0xff);#if 1if (enclen(enc, buf) != (p - buf))return ONIGERR_INVALID_CODE_POINT_VALUE;#endifreturn p - buf;}extern intonigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf){UChar *p = buf;if ((code & 0xff000000) != 0) {*p++ = (UChar )((code >> 24) & 0xff);}if ((code & 0xff0000) != 0 || p != buf) {*p++ = (UChar )((code >> 16) & 0xff);}if ((code & 0xff00) != 0 || p != buf) {*p++ = (UChar )((code >> 8) & 0xff);}*p++ = (UChar )(code & 0xff);#if 1if (enclen(enc, buf) != (p - buf))return ONIGERR_INVALID_CODE_POINT_VALUE;#endifreturn p - buf;}extern intonigenc_minimum_property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end){static PosixBracketEntryType PBS[] = {{ (UChar* )"Alnum", ONIGENC_CTYPE_ALNUM, 5 },{ (UChar* )"Alpha", ONIGENC_CTYPE_ALPHA, 5 },{ (UChar* )"Blank", ONIGENC_CTYPE_BLANK, 5 },{ (UChar* )"Cntrl", ONIGENC_CTYPE_CNTRL, 5 },{ (UChar* )"Digit", ONIGENC_CTYPE_DIGIT, 5 },{ (UChar* )"Graph", ONIGENC_CTYPE_GRAPH, 5 },{ (UChar* )"Lower", ONIGENC_CTYPE_LOWER, 5 },{ (UChar* )"Print", ONIGENC_CTYPE_PRINT, 5 },{ (UChar* )"Punct", ONIGENC_CTYPE_PUNCT, 5 },{ (UChar* )"Space", ONIGENC_CTYPE_SPACE, 5 },{ (UChar* )"Upper", ONIGENC_CTYPE_UPPER, 5 },{ (UChar* )"XDigit", ONIGENC_CTYPE_XDIGIT, 6 },{ (UChar* )"ASCII", ONIGENC_CTYPE_ASCII, 5 },{ (UChar* )"Word", ONIGENC_CTYPE_WORD, 4 },{ (UChar* )NULL, -1, 0 }};PosixBracketEntryType *pb;int len;len = onigenc_strlen(enc, p, end);for (pb = PBS; IS_NOT_NULL(pb->name); pb++) {if (len == pb->len &&onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0)return pb->ctype;}return ONIGERR_INVALID_CHAR_PROPERTY_NAME;}extern intonigenc_mb2_is_code_ctype(OnigEncoding enc, OnigCodePoint code,unsigned int ctype){if (code < 128)return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);else {if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {return (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE);}}return FALSE;}extern intonigenc_mb4_is_code_ctype(OnigEncoding enc, OnigCodePoint code,unsigned int ctype){if (code < 128)return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);else {if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {return (ONIGENC_CODE_TO_MBCLEN(enc, code) > 1 ? TRUE : FALSE);}}return FALSE;}extern intonigenc_with_ascii_strncmp(OnigEncoding enc, const UChar* p, const UChar* end,const UChar* sascii /* ascii */, int n){int x, c;while (n-- > 0) {if (p >= end) return (int )(*sascii);c = (int )ONIGENC_MBC_TO_CODE(enc, p, end);x = *sascii - c;if (x) return x;sascii++;p += enclen(enc, p);}return 0;}/* Property management */static intresize_property_list(int new_size, const OnigCodePoint*** plist, int* psize){int size;const OnigCodePoint **list = *plist;size = sizeof(OnigCodePoint*) * new_size;if (IS_NULL(list)) {list = (const OnigCodePoint** )xmalloc(size);}else {list = (const OnigCodePoint** )xrealloc((void* )list, size);}if (IS_NULL(list)) return ONIGERR_MEMORY;*plist = list;*psize = new_size;return 0;}extern intonigenc_property_list_add_property(UChar* name, const OnigCodePoint* prop,hash_table_type **table, const OnigCodePoint*** plist, int *pnum,int *psize){#define PROP_INIT_SIZE 16int r;if (*psize <= *pnum) {int new_size = (*psize == 0 ? PROP_INIT_SIZE : *psize * 2);r = resize_property_list(new_size, plist, psize);if (r != 0) return r;}(*plist)[*pnum] = prop;if (ONIG_IS_NULL(*table)) {*table = onig_st_init_strend_table_with_size(PROP_INIT_SIZE);if (ONIG_IS_NULL(*table)) return ONIGERR_MEMORY;}*pnum = *pnum + 1;onig_st_insert_strend(*table, name, name + strlen((char* )name),(hash_data_type )(*pnum + ONIGENC_MAX_STD_CTYPE));return 0;}extern intonigenc_property_list_init(int (*f)(void)){int r;THREAD_ATOMIC_START;r = f();THREAD_ATOMIC_END;return r;}
#ifndef REGENC_H#define REGENC_H/**********************************************************************regenc.h - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#ifndef PACKAGE/* PACKAGE is defined in config.h */#include "config.h"#endif#ifdef ONIG_ESCAPE_UCHAR_COLLISION#undef ONIG_ESCAPE_UCHAR_COLLISION#endif#include "oniguruma.h"typedef struct {OnigCodePoint from;OnigCodePoint to;} OnigPairCaseFoldCodes;#ifndef NULL#define NULL ((void* )0)#endif#ifndef TRUE#define TRUE 1#endif#ifndef FALSE#define FALSE 0#endif#ifndef ARG_UNUSED#if defined(__GNUC__)# define ARG_UNUSED __attribute__ ((unused))#else# define ARG_UNUSED#endif#endif#define ONIG_IS_NULL(p) (((void*)(p)) == (void*)0)#define ONIG_IS_NOT_NULL(p) (((void*)(p)) != (void*)0)#define ONIG_CHECK_NULL_RETURN(p) if (ONIG_IS_NULL(p)) return NULL#define ONIG_CHECK_NULL_RETURN_VAL(p,val) if (ONIG_IS_NULL(p)) return (val)#define enclen(enc,p) ONIGENC_MBC_ENC_LEN(enc,p)/* character types bit flag */#define BIT_CTYPE_NEWLINE (1<< ONIGENC_CTYPE_NEWLINE)#define BIT_CTYPE_ALPHA (1<< ONIGENC_CTYPE_ALPHA)#define BIT_CTYPE_BLANK (1<< ONIGENC_CTYPE_BLANK)#define BIT_CTYPE_CNTRL (1<< ONIGENC_CTYPE_CNTRL)#define BIT_CTYPE_DIGIT (1<< ONIGENC_CTYPE_DIGIT)#define BIT_CTYPE_GRAPH (1<< ONIGENC_CTYPE_GRAPH)#define BIT_CTYPE_LOWER (1<< ONIGENC_CTYPE_LOWER)#define BIT_CTYPE_PRINT (1<< ONIGENC_CTYPE_PRINT)#define BIT_CTYPE_PUNCT (1<< ONIGENC_CTYPE_PUNCT)#define BIT_CTYPE_SPACE (1<< ONIGENC_CTYPE_SPACE)#define BIT_CTYPE_UPPER (1<< ONIGENC_CTYPE_UPPER)#define BIT_CTYPE_XDIGIT (1<< ONIGENC_CTYPE_XDIGIT)#define BIT_CTYPE_WORD (1<< ONIGENC_CTYPE_WORD)#define BIT_CTYPE_ALNUM (1<< ONIGENC_CTYPE_ALNUM)#define BIT_CTYPE_ASCII (1<< ONIGENC_CTYPE_ASCII)#define CTYPE_TO_BIT(ctype) (1<<(ctype))#define CTYPE_IS_WORD_GRAPH_PRINT(ctype) \((ctype) == ONIGENC_CTYPE_WORD || (ctype) == ONIGENC_CTYPE_GRAPH ||\(ctype) == ONIGENC_CTYPE_PRINT)typedef struct {UChar *name;int ctype;short int len;} PosixBracketEntryType;/* #define USE_CRNL_AS_LINE_TERMINATOR */#define USE_UNICODE_PROPERTIES/* #define USE_UNICODE_CASE_FOLD_TURKISH_AZERI *//* #define USE_UNICODE_ALL_LINE_TERMINATORS */ /* see Unicode.org UTF#18 */#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII/* for encoding system implementation (internal) */ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[]));ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end));/* methods for single byte encoding */ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p));ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end));ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code));ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf));ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s));ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end));ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end));/* methods for multi byte encoding */ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code));ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code));ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));/* in enc/unicode.c */ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[]));ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[]));ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold));ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));#define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \OnigEncISO_8859_1_ToLowerCaseTable[c]#define ONIGENC_ISO_8859_1_TO_UPPER_CASE(c) \OnigEncISO_8859_1_ToUpperCaseTable[c]ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[];ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[];ONIG_EXTERN intonigenc_with_ascii_strncmp P_((OnigEncoding enc, const UChar* p, const UChar* end, const UChar* sascii /* ascii */, int n));ONIG_EXTERN UChar*onigenc_step P_((OnigEncoding enc, const UChar* p, const UChar* end, int n));/* defined in regexec.c, but used in enc/xxx.c */extern int onig_is_in_code_range P_((const UChar* p, OnigCodePoint code));ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[];ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[];ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[];#define ONIGENC_IS_ASCII_CODE(code) ((code) < 0x80)#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) OnigEncAsciiToLowerCaseTable[c]#define ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) OnigEncAsciiToUpperCaseTable[c]#define ONIGENC_IS_ASCII_CODE_CTYPE(code,ctype) \((OnigEncAsciiCtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)#define ONIGENC_IS_ASCII_CODE_CASE_AMBIG(code) \(ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_UPPER) ||\ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER))#endif /* REGENC_H */
/**********************************************************************regerror.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"#include <stdio.h> /* for vsnprintf() */#ifdef HAVE_STDARG_PROTOTYPES#include <stdarg.h>#define va_init_list(a,b) va_start(a,b)#else#include <varargs.h>#define va_init_list(a,b) va_start(a)#endifextern UChar*onig_error_code_to_format(int code){char *p;if (code >= 0) return (UChar* )0;switch (code) {case ONIG_MISMATCH:p = "mismatch"; break;case ONIG_NO_SUPPORT_CONFIG:p = "no support in this configuration"; break;case ONIGERR_MEMORY:p = "fail to memory allocation"; break;case ONIGERR_MATCH_STACK_LIMIT_OVER:p = "match-stack limit over"; break;case ONIGERR_TYPE_BUG:p = "undefined type (bug)"; break;case ONIGERR_PARSER_BUG:p = "internal parser error (bug)"; break;case ONIGERR_STACK_BUG:p = "stack error (bug)"; break;case ONIGERR_UNDEFINED_BYTECODE:p = "undefined bytecode (bug)"; break;case ONIGERR_UNEXPECTED_BYTECODE:p = "unexpected bytecode (bug)"; break;case ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED:p = "default multibyte-encoding is not setted"; break;case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR:p = "can't convert to wide-char on specified multibyte-encoding"; break;case ONIGERR_INVALID_ARGUMENT:p = "invalid argument"; break;case ONIGERR_END_PATTERN_AT_LEFT_BRACE:p = "end pattern at left brace"; break;case ONIGERR_END_PATTERN_AT_LEFT_BRACKET:p = "end pattern at left bracket"; break;case ONIGERR_EMPTY_CHAR_CLASS:p = "empty char-class"; break;case ONIGERR_PREMATURE_END_OF_CHAR_CLASS:p = "premature end of char-class"; break;case ONIGERR_END_PATTERN_AT_ESCAPE:p = "end pattern at escape"; break;case ONIGERR_END_PATTERN_AT_META:p = "end pattern at meta"; break;case ONIGERR_END_PATTERN_AT_CONTROL:p = "end pattern at control"; break;case ONIGERR_META_CODE_SYNTAX:p = "invalid meta-code syntax"; break;case ONIGERR_CONTROL_CODE_SYNTAX:p = "invalid control-code syntax"; break;case ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE:p = "char-class value at end of range"; break;case ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE:p = "char-class value at start of range"; break;case ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS:p = "unmatched range specifier in char-class"; break;case ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED:p = "target of repeat operator is not specified"; break;case ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID:p = "target of repeat operator is invalid"; break;case ONIGERR_NESTED_REPEAT_OPERATOR:p = "nested repeat operator"; break;case ONIGERR_UNMATCHED_CLOSE_PARENTHESIS:p = "unmatched close parenthesis"; break;case ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS:p = "end pattern with unmatched parenthesis"; break;case ONIGERR_END_PATTERN_IN_GROUP:p = "end pattern in group"; break;case ONIGERR_UNDEFINED_GROUP_OPTION:p = "undefined group option"; break;case ONIGERR_INVALID_POSIX_BRACKET_TYPE:p = "invalid POSIX bracket type"; break;case ONIGERR_INVALID_LOOK_BEHIND_PATTERN:p = "invalid pattern in look-behind"; break;case ONIGERR_INVALID_REPEAT_RANGE_PATTERN:p = "invalid repeat range {lower,upper}"; break;case ONIGERR_TOO_BIG_NUMBER:p = "too big number"; break;case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE:p = "too big number for repeat range"; break;case ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE:p = "upper is smaller than lower in repeat range"; break;case ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS:p = "empty range in char class"; break;case ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE:p = "mismatch multibyte code length in char-class range"; break;case ONIGERR_TOO_MANY_MULTI_BYTE_RANGES:p = "too many multibyte code ranges are specified"; break;case ONIGERR_TOO_SHORT_MULTI_BYTE_STRING:p = "too short multibyte code string"; break;case ONIGERR_TOO_BIG_BACKREF_NUMBER:p = "too big backref number"; break;case ONIGERR_INVALID_BACKREF:#ifdef USE_NAMED_GROUPp = "invalid backref number/name"; break;#elsep = "invalid backref number"; break;#endifcase ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED:p = "numbered backref/call is not allowed. (use name)"; break;case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE:p = "too big wide-char value"; break;case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE:p = "too long wide-char value"; break;case ONIGERR_INVALID_CODE_POINT_VALUE:p = "invalid code point value"; break;case ONIGERR_EMPTY_GROUP_NAME:p = "group name is empty"; break;case ONIGERR_INVALID_GROUP_NAME:p = "invalid group name <%n>"; break;case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:#ifdef USE_NAMED_GROUPp = "invalid char in group name <%n>"; break;#elsep = "invalid char in group number <%n>"; break;#endifcase ONIGERR_UNDEFINED_NAME_REFERENCE:p = "undefined name <%n> reference"; break;case ONIGERR_UNDEFINED_GROUP_REFERENCE:p = "undefined group <%n> reference"; break;case ONIGERR_MULTIPLEX_DEFINED_NAME:p = "multiplex defined name <%n>"; break;case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:p = "multiplex definition name <%n> call"; break;case ONIGERR_NEVER_ENDING_RECURSION:p = "never ending recursion"; break;case ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY:p = "group number is too big for capture history"; break;case ONIGERR_INVALID_CHAR_PROPERTY_NAME:p = "invalid character property name {%n}"; break;case ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION:p = "not supported encoding combination"; break;case ONIGERR_INVALID_COMBINATION_OF_OPTIONS:p = "invalid combination of options"; break;case ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT:p = "over thread pass limit count"; break;default:p = "undefined error code"; break;}return (UChar* )p;}static void sprint_byte(char* s, unsigned int v){sprintf(s, "%02x", (v & 0377));}static void sprint_byte_with_x(char* s, unsigned int v){sprintf(s, "\\x%02x", (v & 0377));}static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,UChar buf[], int buf_size, int *is_over){int len;UChar *p;OnigCodePoint code;if (ONIGENC_MBC_MINLEN(enc) > 1) {p = s;len = 0;while (p < end) {code = ONIGENC_MBC_TO_CODE(enc, p, end);if (code >= 0x80) {if (code > 0xffff && len + 10 <= buf_size) {sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 24));sprint_byte((char*)(&(buf[len+4])), (unsigned int)(code >> 16));sprint_byte((char*)(&(buf[len+6])), (unsigned int)(code >> 8));sprint_byte((char*)(&(buf[len+8])), (unsigned int)code);len += 10;}else if (len + 6 <= buf_size) {sprint_byte_with_x((char*)(&(buf[len])), (unsigned int)(code >> 8));sprint_byte((char*)(&(buf[len+4])), (unsigned int)code);len += 6;}else {break;}}else {buf[len++] = (UChar )code;}p += enclen(enc, p);if (len >= buf_size) break;}*is_over = ((p < end) ? 1 : 0);}else {len = MIN((end - s), buf_size);xmemcpy(buf, s, (size_t )len);*is_over = ((buf_size < (end - s)) ? 1 : 0);}return len;}/* for ONIG_MAX_ERROR_MESSAGE_LEN */#define MAX_ERROR_PAR_LEN 30extern int#ifdef HAVE_STDARG_PROTOTYPESonig_error_code_to_str(UChar* s, int code, ...)#elseonig_error_code_to_str(s, code, va_alist)UChar* s;int code;va_dcl#endif{UChar *p, *q;OnigErrorInfo* einfo;int len, is_over;UChar parbuf[MAX_ERROR_PAR_LEN];va_list vargs;va_init_list(vargs, code);switch (code) {case ONIGERR_UNDEFINED_NAME_REFERENCE:case ONIGERR_UNDEFINED_GROUP_REFERENCE:case ONIGERR_MULTIPLEX_DEFINED_NAME:case ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL:case ONIGERR_INVALID_GROUP_NAME:case ONIGERR_INVALID_CHAR_IN_GROUP_NAME:case ONIGERR_INVALID_CHAR_PROPERTY_NAME:einfo = va_arg(vargs, OnigErrorInfo*);len = to_ascii(einfo->enc, einfo->par, einfo->par_end,parbuf, MAX_ERROR_PAR_LEN - 3, &is_over);q = onig_error_code_to_format(code);p = s;while (*q != '\0') {if (*q == '%') {q++;if (*q == 'n') { /* '%n': name */xmemcpy(p, parbuf, len);p += len;if (is_over != 0) {xmemcpy(p, "...", 3);p += 3;}q++;}elsegoto normal_char;}else {normal_char:*p++ = *q++;}}*p = '\0';len = p - s;break;default:q = onig_error_code_to_format(code);len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q);xmemcpy(s, q, len);s[len] = '\0';break;}va_end(vargs);return len;}void#ifdef HAVE_STDARG_PROTOTYPESonig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,UChar* pat, UChar* pat_end, const UChar *fmt, ...)#elseonig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)UChar buf[];int bufsize;OnigEncoding enc;UChar* pat;UChar* pat_end;const UChar *fmt;va_dcl#endif{int n, need, len;UChar *p, *s, *bp;UChar bs[6];va_list args;va_init_list(args, fmt);n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);va_end(args);need = (pat_end - pat) * 4 + 4;if (n + need < bufsize) {strcat((char* )buf, ": /");s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf);p = pat;while (p < pat_end) {if (*p == '\\') {*s++ = *p++;len = enclen(enc, p);while (len-- > 0) *s++ = *p++;}else if (*p == '/') {*s++ = (unsigned char )'\\';*s++ = *p++;}else if (ONIGENC_IS_MBC_HEAD(enc, p)) {len = enclen(enc, p);if (ONIGENC_MBC_MINLEN(enc) == 1) {while (len-- > 0) *s++ = *p++;}else { /* for UTF16 */int blen;while (len-- > 0) {sprint_byte_with_x((char* )bs, (unsigned int )(*p++));blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);bp = bs;while (blen-- > 0) *s++ = *bp++;}}}else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&!ONIGENC_IS_CODE_SPACE(enc, *p)) {sprint_byte_with_x((char* )bs, (unsigned int )(*p++));len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);bp = bs;while (len-- > 0) *s++ = *bp++;}else {*s++ = *p++;}}*s++ = '/';*s = '\0';}}
/**********************************************************************regexec.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"#define USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE#ifdef USE_CRNL_AS_LINE_TERMINATOR#define ONIGENC_IS_MBC_CRNL(enc,p,end) \(ONIGENC_MBC_TO_CODE(enc,p,end) == 13 && \ONIGENC_IS_MBC_NEWLINE(enc,(p+enclen(enc,p)),end))#endif#ifdef USE_CAPTURE_HISTORYstatic void history_tree_free(OnigCaptureTreeNode* node);static voidhistory_tree_clear(OnigCaptureTreeNode* node){int i;if (IS_NOT_NULL(node)) {for (i = 0; i < node->num_childs; i++) {if (IS_NOT_NULL(node->childs[i])) {history_tree_free(node->childs[i]);}}for (i = 0; i < node->allocated; i++) {node->childs[i] = (OnigCaptureTreeNode* )0;}node->num_childs = 0;node->beg = ONIG_REGION_NOTPOS;node->end = ONIG_REGION_NOTPOS;node->group = -1;}}static voidhistory_tree_free(OnigCaptureTreeNode* node){history_tree_clear(node);xfree(node);}static voidhistory_root_free(OnigRegion* r){if (IS_NOT_NULL(r->history_root)) {history_tree_free(r->history_root);r->history_root = (OnigCaptureTreeNode* )0;}}static OnigCaptureTreeNode*history_node_new(void){OnigCaptureTreeNode* node;node = (OnigCaptureTreeNode* )xmalloc(sizeof(OnigCaptureTreeNode));CHECK_NULL_RETURN(node);node->childs = (OnigCaptureTreeNode** )0;node->allocated = 0;node->num_childs = 0;node->group = -1;node->beg = ONIG_REGION_NOTPOS;node->end = ONIG_REGION_NOTPOS;return node;}static inthistory_tree_add_child(OnigCaptureTreeNode* parent, OnigCaptureTreeNode* child){#define HISTORY_TREE_INIT_ALLOC_SIZE 8if (parent->num_childs >= parent->allocated) {int n, i;if (IS_NULL(parent->childs)) {n = HISTORY_TREE_INIT_ALLOC_SIZE;parent->childs =(OnigCaptureTreeNode** )xmalloc(sizeof(OnigCaptureTreeNode*) * n);}else {n = parent->allocated * 2;parent->childs =(OnigCaptureTreeNode** )xrealloc(parent->childs,sizeof(OnigCaptureTreeNode*) * n);}CHECK_NULL_RETURN_MEMERR(parent->childs);for (i = parent->allocated; i < n; i++) {parent->childs[i] = (OnigCaptureTreeNode* )0;}parent->allocated = n;}parent->childs[parent->num_childs] = child;parent->num_childs++;return 0;}static OnigCaptureTreeNode*history_tree_clone(OnigCaptureTreeNode* node){int i;OnigCaptureTreeNode *clone, *child;clone = history_node_new();CHECK_NULL_RETURN(clone);clone->beg = node->beg;clone->end = node->end;for (i = 0; i < node->num_childs; i++) {child = history_tree_clone(node->childs[i]);if (IS_NULL(child)) {history_tree_free(clone);return (OnigCaptureTreeNode* )0;}history_tree_add_child(clone, child);}return clone;}extern OnigCaptureTreeNode*onig_get_capture_tree(OnigRegion* region){return region->history_root;}#endif /* USE_CAPTURE_HISTORY */extern voidonig_region_clear(OnigRegion* region){int i;for (i = 0; i < region->num_regs; i++) {region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;}#ifdef USE_CAPTURE_HISTORYhistory_root_free(region);#endif}extern intonig_region_resize(OnigRegion* region, int n){region->num_regs = n;if (n < ONIG_NREGION)n = ONIG_NREGION;if (region->allocated == 0) {region->beg = (int* )xmalloc(n * sizeof(int));region->end = (int* )xmalloc(n * sizeof(int));if (region->beg == 0 || region->end == 0)return ONIGERR_MEMORY;region->allocated = n;}else if (region->allocated < n) {region->beg = (int* )xrealloc(region->beg, n * sizeof(int));region->end = (int* )xrealloc(region->end, n * sizeof(int));if (region->beg == 0 || region->end == 0)return ONIGERR_MEMORY;region->allocated = n;}return 0;}static intonig_region_resize_clear(OnigRegion* region, int n){int r;r = onig_region_resize(region, n);if (r != 0) return r;onig_region_clear(region);return 0;}extern intonig_region_set(OnigRegion* region, int at, int beg, int end){if (at < 0) return ONIGERR_INVALID_ARGUMENT;if (at >= region->allocated) {int r = onig_region_resize(region, at + 1);if (r < 0) return r;}region->beg[at] = beg;region->end[at] = end;return 0;}extern voidonig_region_init(OnigRegion* region){region->num_regs = 0;region->allocated = 0;region->beg = (int* )0;region->end = (int* )0;region->history_root = (OnigCaptureTreeNode* )0;}extern OnigRegion*onig_region_new(void){OnigRegion* r;r = (OnigRegion* )xmalloc(sizeof(OnigRegion));onig_region_init(r);return r;}extern voidonig_region_free(OnigRegion* r, int free_self){if (r) {if (r->allocated > 0) {if (r->beg) xfree(r->beg);if (r->end) xfree(r->end);r->allocated = 0;}#ifdef USE_CAPTURE_HISTORYhistory_root_free(r);#endifif (free_self) xfree(r);}}extern voidonig_region_copy(OnigRegion* to, OnigRegion* from){#define RREGC_SIZE (sizeof(int) * from->num_regs)int i;if (to == from) return;if (to->allocated == 0) {if (from->num_regs > 0) {to->beg = (int* )xmalloc(RREGC_SIZE);to->end = (int* )xmalloc(RREGC_SIZE);to->allocated = from->num_regs;}}else if (to->allocated < from->num_regs) {to->beg = (int* )xrealloc(to->beg, RREGC_SIZE);to->end = (int* )xrealloc(to->end, RREGC_SIZE);to->allocated = from->num_regs;}for (i = 0; i < from->num_regs; i++) {to->beg[i] = from->beg[i];to->end[i] = from->end[i];}to->num_regs = from->num_regs;#ifdef USE_CAPTURE_HISTORYhistory_root_free(to);if (IS_NOT_NULL(from->history_root)) {to->history_root = history_tree_clone(from->history_root);}#endif}/** stack **/#define INVALID_STACK_INDEX -1/* stack type *//* used by normal-POP */#define STK_ALT 0x0001#define STK_LOOK_BEHIND_NOT 0x0002#define STK_POS_NOT 0x0003/* handled by normal-POP */#define STK_MEM_START 0x0100#define STK_MEM_END 0x8200#define STK_REPEAT_INC 0x0300#define STK_STATE_CHECK_MARK 0x1000/* avoided by normal-POP */#define STK_NULL_CHECK_START 0x3000#define STK_NULL_CHECK_END 0x5000 /* for recursive call */#define STK_MEM_END_MARK 0x8400#define STK_POS 0x0500 /* used when POP-POS */#define STK_STOP_BT 0x0600 /* mark for "(?>...)" */#define STK_REPEAT 0x0700#define STK_CALL_FRAME 0x0800#define STK_RETURN 0x0900#define STK_VOID 0x0a00 /* for fill a blank *//* stack type check mask */#define STK_MASK_POP_USED 0x00ff#define STK_MASK_TO_VOID_TARGET 0x10ff#define STK_MASK_MEM_END_OR_MARK 0x8000 /* MEM_END or MEM_END_MARK */#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start) do {\(msa).stack_p = (void* )0;\(msa).options = (arg_option);\(msa).region = (arg_region);\(msa).start = (arg_start);\(msa).best_len = ONIG_MISMATCH;\} while(0)#else#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start) do {\(msa).stack_p = (void* )0;\(msa).options = (arg_option);\(msa).region = (arg_region);\(msa).start = (arg_start);\} while(0)#endif#ifdef USE_COMBINATION_EXPLOSION_CHECK#define STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE 16#define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num) do { \if ((state_num) > 0 && str_len >= STATE_CHECK_STRING_THRESHOLD_LEN) {\unsigned int size = (unsigned int )(((str_len) + 1) * (state_num) + 7) >> 3;\offset = ((offset) * (state_num)) >> 3;\if (size > 0 && offset < size && size < STATE_CHECK_BUFF_MAX_SIZE) {\if (size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) \(msa).state_check_buff = (void* )xmalloc(size);\else \(msa).state_check_buff = (void* )xalloca(size);\xmemset(((char* )((msa).state_check_buff)+(offset)), 0, \(size_t )(size - (offset))); \(msa).state_check_buff_size = size;\}\else {\(msa).state_check_buff = (void* )0;\(msa).state_check_buff_size = 0;\}\}\else {\(msa).state_check_buff = (void* )0;\(msa).state_check_buff_size = 0;\}\} while(0)#define MATCH_ARG_FREE(msa) do {\if ((msa).stack_p) xfree((msa).stack_p);\if ((msa).state_check_buff_size >= STATE_CHECK_BUFF_MALLOC_THRESHOLD_SIZE) { \if ((msa).state_check_buff) xfree((msa).state_check_buff);\}\} while(0)#else#define STATE_CHECK_BUFF_INIT(msa, str_len, offset, state_num)#define MATCH_ARG_FREE(msa) if ((msa).stack_p) xfree((msa).stack_p)#endif#define STACK_INIT(alloc_addr, ptr_num, stack_num) do {\if (msa->stack_p) {\alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num));\stk_alloc = (OnigStackType* )(msa->stack_p);\stk_base = stk_alloc;\stk = stk_base;\stk_end = stk_base + msa->stack_n;\}\else {\alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num)\+ sizeof(OnigStackType) * (stack_num));\stk_alloc = (OnigStackType* )(alloc_addr + sizeof(char*) * (ptr_num));\stk_base = stk_alloc;\stk = stk_base;\stk_end = stk_base + (stack_num);\}\} while(0)#define STACK_SAVE do{\if (stk_base != stk_alloc) {\msa->stack_p = stk_base;\msa->stack_n = stk_end - stk_base;\};\} while(0)static unsigned int MatchStackLimitSize = DEFAULT_MATCH_STACK_LIMIT_SIZE;extern unsigned intonig_get_match_stack_limit_size(void){return MatchStackLimitSize;}extern intonig_set_match_stack_limit_size(unsigned int size){MatchStackLimitSize = size;return 0;}static intstack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,OnigStackType** arg_stk, OnigStackType* stk_alloc, OnigMatchArg* msa){unsigned int n;OnigStackType *x, *stk_base, *stk_end, *stk;stk_base = *arg_stk_base;stk_end = *arg_stk_end;stk = *arg_stk;n = stk_end - stk_base;if (stk_base == stk_alloc && IS_NULL(msa->stack_p)) {x = (OnigStackType* )xmalloc(sizeof(OnigStackType) * n * 2);if (IS_NULL(x)) {STACK_SAVE;return ONIGERR_MEMORY;}xmemcpy(x, stk_base, n * sizeof(OnigStackType));n *= 2;}else {n *= 2;if (MatchStackLimitSize != 0 && n > MatchStackLimitSize) {if ((unsigned int )(stk_end - stk_base) == MatchStackLimitSize)return ONIGERR_MATCH_STACK_LIMIT_OVER;elsen = MatchStackLimitSize;}x = (OnigStackType* )xrealloc(stk_base, sizeof(OnigStackType) * n);if (IS_NULL(x)) {STACK_SAVE;return ONIGERR_MEMORY;}}*arg_stk = x + (stk - stk_base);*arg_stk_base = x;*arg_stk_end = x + n;return 0;}#define STACK_ENSURE(n) do {\if (stk_end - stk < (n)) {\int r = stack_double(&stk_base, &stk_end, &stk, stk_alloc, msa);\if (r != 0) { STACK_SAVE; return r; } \}\} while(0)#define STACK_AT(index) (stk_base + (index))#define GET_STACK_INDEX(stk) ((stk) - stk_base)#define STACK_PUSH_TYPE(stack_type) do {\STACK_ENSURE(1);\stk->type = (stack_type);\STACK_INC;\} while(0)#define IS_TO_VOID_TARGET(stk) (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0)#ifdef USE_COMBINATION_EXPLOSION_CHECK#define STATE_CHECK_POS(s,snum) \(((s) - str) * num_comb_exp_check + ((snum) - 1))#define STATE_CHECK_VAL(v,snum) do {\if (state_check_buff != NULL) {\int x = STATE_CHECK_POS(s,snum);\(v) = state_check_buff[x/8] & (1<<(x%8));\}\else (v) = 0;\} while(0)#define ELSE_IF_STATE_CHECK_MARK(stk) \else if ((stk)->type == STK_STATE_CHECK_MARK) { \int x = STATE_CHECK_POS(stk->u.state.pstr, stk->u.state.state_check);\state_check_buff[x/8] |= (1<<(x%8)); \}#define STACK_PUSH(stack_type,pat,s,sprev) do {\STACK_ENSURE(1);\stk->type = (stack_type);\stk->u.state.pcode = (pat);\stk->u.state.pstr = (s);\stk->u.state.pstr_prev = (sprev);\stk->u.state.state_check = 0;\STACK_INC;\} while(0)#define STACK_PUSH_ENSURED(stack_type,pat) do {\stk->type = (stack_type);\stk->u.state.pcode = (pat);\stk->u.state.state_check = 0;\STACK_INC;\} while(0)#define STACK_PUSH_ALT_WITH_STATE_CHECK(pat,s,sprev,snum) do {\STACK_ENSURE(1);\stk->type = STK_ALT;\stk->u.state.pcode = (pat);\stk->u.state.pstr = (s);\stk->u.state.pstr_prev = (sprev);\stk->u.state.state_check = ((state_check_buff != NULL) ? (snum) : 0);\STACK_INC;\} while(0)#define STACK_PUSH_STATE_CHECK(s,snum) do {\if (state_check_buff != NULL) {\STACK_ENSURE(1);\stk->type = STK_STATE_CHECK_MARK;\stk->u.state.pstr = (s);\stk->u.state.state_check = (snum);\STACK_INC;\}\} while(0)#else /* USE_COMBINATION_EXPLOSION_CHECK */#define ELSE_IF_STATE_CHECK_MARK(stk)#define STACK_PUSH(stack_type,pat,s,sprev) do {\STACK_ENSURE(1);\stk->type = (stack_type);\stk->u.state.pcode = (pat);\stk->u.state.pstr = (s);\stk->u.state.pstr_prev = (sprev);\STACK_INC;\} while(0)#define STACK_PUSH_ENSURED(stack_type,pat) do {\stk->type = (stack_type);\stk->u.state.pcode = (pat);\STACK_INC;\} while(0)#endif /* USE_COMBINATION_EXPLOSION_CHECK */#define STACK_PUSH_ALT(pat,s,sprev) STACK_PUSH(STK_ALT,pat,s,sprev)#define STACK_PUSH_POS(s,sprev) STACK_PUSH(STK_POS,NULL_UCHARP,s,sprev)#define STACK_PUSH_POS_NOT(pat,s,sprev) STACK_PUSH(STK_POS_NOT,pat,s,sprev)#define STACK_PUSH_STOP_BT STACK_PUSH_TYPE(STK_STOP_BT)#define STACK_PUSH_LOOK_BEHIND_NOT(pat,s,sprev) \STACK_PUSH(STK_LOOK_BEHIND_NOT,pat,s,sprev)#define STACK_PUSH_REPEAT(id, pat) do {\STACK_ENSURE(1);\stk->type = STK_REPEAT;\stk->u.repeat.num = (id);\stk->u.repeat.pcode = (pat);\stk->u.repeat.count = 0;\STACK_INC;\} while(0)#define STACK_PUSH_REPEAT_INC(sindex) do {\STACK_ENSURE(1);\stk->type = STK_REPEAT_INC;\stk->u.repeat_inc.si = (sindex);\STACK_INC;\} while(0)#define STACK_PUSH_MEM_START(mnum, s) do {\STACK_ENSURE(1);\stk->type = STK_MEM_START;\stk->u.mem.num = (mnum);\stk->u.mem.pstr = (s);\stk->u.mem.start = mem_start_stk[mnum];\stk->u.mem.end = mem_end_stk[mnum];\mem_start_stk[mnum] = GET_STACK_INDEX(stk);\mem_end_stk[mnum] = INVALID_STACK_INDEX;\STACK_INC;\} while(0)#define STACK_PUSH_MEM_END(mnum, s) do {\STACK_ENSURE(1);\stk->type = STK_MEM_END;\stk->u.mem.num = (mnum);\stk->u.mem.pstr = (s);\stk->u.mem.start = mem_start_stk[mnum];\stk->u.mem.end = mem_end_stk[mnum];\mem_end_stk[mnum] = GET_STACK_INDEX(stk);\STACK_INC;\} while(0)#define STACK_PUSH_MEM_END_MARK(mnum) do {\STACK_ENSURE(1);\stk->type = STK_MEM_END_MARK;\stk->u.mem.num = (mnum);\STACK_INC;\} while(0)#define STACK_GET_MEM_START(mnum, k) do {\int level = 0;\k = stk;\while (k > stk_base) {\k--;\if ((k->type & STK_MASK_MEM_END_OR_MARK) != 0 \&& k->u.mem.num == (mnum)) {\level++;\}\else if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\if (level == 0) break;\level--;\}\}\} while(0)#define STACK_GET_MEM_RANGE(k, mnum, start, end) do {\int level = 0;\while (k < stk) {\if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\if (level == 0) (start) = k->u.mem.pstr;\level++;\}\else if (k->type == STK_MEM_END && k->u.mem.num == (mnum)) {\level--;\if (level == 0) {\(end) = k->u.mem.pstr;\break;\}\}\k++;\}\} while(0)#define STACK_PUSH_NULL_CHECK_START(cnum, s) do {\STACK_ENSURE(1);\stk->type = STK_NULL_CHECK_START;\stk->u.null_check.num = (cnum);\stk->u.null_check.pstr = (s);\STACK_INC;\} while(0)#define STACK_PUSH_NULL_CHECK_END(cnum) do {\STACK_ENSURE(1);\stk->type = STK_NULL_CHECK_END;\stk->u.null_check.num = (cnum);\STACK_INC;\} while(0)#define STACK_PUSH_CALL_FRAME(pat) do {\STACK_ENSURE(1);\stk->type = STK_CALL_FRAME;\stk->u.call_frame.ret_addr = (pat);\STACK_INC;\} while(0)#define STACK_PUSH_RETURN do {\STACK_ENSURE(1);\stk->type = STK_RETURN;\STACK_INC;\} while(0)#ifdef ONIG_DEBUG#define STACK_BASE_CHECK(p, at) \if ((p) < stk_base) {\fprintf(stderr, "at %s\n", at);\goto stack_error;\}#else#define STACK_BASE_CHECK(p, at)#endif#define STACK_POP_ONE do {\stk--;\STACK_BASE_CHECK(stk, "STACK_POP_ONE"); \} while(0)#define STACK_POP do {\switch (pop_level) {\case STACK_POP_LEVEL_FREE:\while (1) {\stk--;\STACK_BASE_CHECK(stk, "STACK_POP"); \if ((stk->type & STK_MASK_POP_USED) != 0) break;\ELSE_IF_STATE_CHECK_MARK(stk);\}\break;\case STACK_POP_LEVEL_MEM_START:\while (1) {\stk--;\STACK_BASE_CHECK(stk, "STACK_POP 2"); \if ((stk->type & STK_MASK_POP_USED) != 0) break;\else if (stk->type == STK_MEM_START) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\ELSE_IF_STATE_CHECK_MARK(stk);\}\break;\default:\while (1) {\stk--;\STACK_BASE_CHECK(stk, "STACK_POP 3"); \if ((stk->type & STK_MASK_POP_USED) != 0) break;\else if (stk->type == STK_MEM_START) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\else if (stk->type == STK_REPEAT_INC) {\STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\}\else if (stk->type == STK_MEM_END) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\ELSE_IF_STATE_CHECK_MARK(stk);\}\break;\}\} while(0)#define STACK_POP_TIL_POS_NOT do {\while (1) {\stk--;\STACK_BASE_CHECK(stk, "STACK_POP_TIL_POS_NOT"); \if (stk->type == STK_POS_NOT) break;\else if (stk->type == STK_MEM_START) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\else if (stk->type == STK_REPEAT_INC) {\STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\}\else if (stk->type == STK_MEM_END) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\ELSE_IF_STATE_CHECK_MARK(stk);\}\} while(0)#define STACK_POP_TIL_LOOK_BEHIND_NOT do {\while (1) {\stk--;\STACK_BASE_CHECK(stk, "STACK_POP_TIL_LOOK_BEHIND_NOT"); \if (stk->type == STK_LOOK_BEHIND_NOT) break;\else if (stk->type == STK_MEM_START) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\else if (stk->type == STK_REPEAT_INC) {\STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\}\else if (stk->type == STK_MEM_END) {\mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\}\ELSE_IF_STATE_CHECK_MARK(stk);\}\} while(0)#define STACK_POS_END(k) do {\k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_POS_END"); \if (IS_TO_VOID_TARGET(k)) {\k->type = STK_VOID;\}\else if (k->type == STK_POS) {\k->type = STK_VOID;\break;\}\}\} while(0)#define STACK_STOP_BT_END do {\OnigStackType *k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_STOP_BT_END"); \if (IS_TO_VOID_TARGET(k)) {\k->type = STK_VOID;\}\else if (k->type == STK_STOP_BT) {\k->type = STK_VOID;\break;\}\}\} while(0)#define STACK_NULL_CHECK(isnull,id,s) do {\OnigStackType* k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_NULL_CHECK"); \if (k->type == STK_NULL_CHECK_START) {\if (k->u.null_check.num == (id)) {\(isnull) = (k->u.null_check.pstr == (s));\break;\}\}\}\} while(0)#define STACK_NULL_CHECK_REC(isnull,id,s) do {\int level = 0;\OnigStackType* k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_NULL_CHECK_REC"); \if (k->type == STK_NULL_CHECK_START) {\if (k->u.null_check.num == (id)) {\if (level == 0) {\(isnull) = (k->u.null_check.pstr == (s));\break;\}\else level--;\}\}\else if (k->type == STK_NULL_CHECK_END) {\level++;\}\}\} while(0)#define STACK_NULL_CHECK_MEMST(isnull,id,s,reg) do {\OnigStackType* k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST"); \if (k->type == STK_NULL_CHECK_START) {\if (k->u.null_check.num == (id)) {\if (k->u.null_check.pstr != (s)) {\(isnull) = 0;\break;\}\else {\UChar* endp;\(isnull) = 1;\while (k < stk) {\if (k->type == STK_MEM_START) {\if (k->u.mem.end == INVALID_STACK_INDEX) {\(isnull) = 0; break;\}\if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num))\endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\else\endp = (UChar* )k->u.mem.end;\if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\(isnull) = 0; break;\}\else if (endp != s) {\(isnull) = -1; /* empty, but position changed */ \}\}\k++;\}\break;\}\}\}\}\} while(0)#define STACK_NULL_CHECK_MEMST_REC(isnull,id,s,reg) do {\int level = 0;\OnigStackType* k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_NULL_CHECK_MEMST_REC"); \if (k->type == STK_NULL_CHECK_START) {\if (k->u.null_check.num == (id)) {\if (level == 0) {\if (k->u.null_check.pstr != (s)) {\(isnull) = 0;\break;\}\else {\UChar* endp;\(isnull) = 1;\while (k < stk) {\if (k->type == STK_MEM_START) {\if (k->u.mem.end == INVALID_STACK_INDEX) {\(isnull) = 0; break;\}\if (BIT_STATUS_AT(reg->bt_mem_end, k->u.mem.num))\endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\else\endp = (UChar* )k->u.mem.end;\if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\(isnull) = 0; break;\}\else if (endp != s) {\(isnull) = -1; /* empty, but position changed */ \}\}\k++;\}\break;\}\}\else {\level--;\}\}\}\else if (k->type == STK_NULL_CHECK_END) {\if (k->u.null_check.num == (id)) level++;\}\}\} while(0)#define STACK_GET_REPEAT(id, k) do {\int level = 0;\k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_GET_REPEAT"); \if (k->type == STK_REPEAT) {\if (level == 0) {\if (k->u.repeat.num == (id)) {\break;\}\}\}\else if (k->type == STK_CALL_FRAME) level--;\else if (k->type == STK_RETURN) level++;\}\} while(0)#define STACK_RETURN(addr) do {\int level = 0;\OnigStackType* k = stk;\while (1) {\k--;\STACK_BASE_CHECK(k, "STACK_RETURN"); \if (k->type == STK_CALL_FRAME) {\if (level == 0) {\(addr) = k->u.call_frame.ret_addr;\break;\}\else level--;\}\else if (k->type == STK_RETURN)\level++;\}\} while(0)#define STRING_CMP(s1,s2,len) do {\while (len-- > 0) {\if (*s1++ != *s2++) goto fail;\}\} while(0)#define STRING_CMP_IC(case_fold_flag,s1,ps2,len) do {\if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len) == 0) \goto fail; \} while(0)static int string_cmp_ic(OnigEncoding enc, int case_fold_flag,UChar* s1, UChar** ps2, int mblen){UChar buf1[ONIGENC_MBC_CASE_FOLD_MAXLEN];UChar buf2[ONIGENC_MBC_CASE_FOLD_MAXLEN];UChar *p1, *p2, *end1, *s2, *end2;int len1, len2;s2 = *ps2;end1 = s1 + mblen;end2 = s2 + mblen;while (s1 < end1) {len1 = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &s1, end1, buf1);len2 = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &s2, end2, buf2);if (len1 != len2) return 0;p1 = buf1;p2 = buf2;while (len1-- > 0) {if (*p1 != *p2) return 0;p1++;p2++;}}*ps2 = s2;return 1;}#define STRING_CMP_VALUE(s1,s2,len,is_fail) do {\is_fail = 0;\while (len-- > 0) {\if (*s1++ != *s2++) {\is_fail = 1; break;\}\}\} while(0)#define STRING_CMP_VALUE_IC(case_fold_flag,s1,ps2,len,is_fail) do {\if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len) == 0) \is_fail = 1; \else \is_fail = 0; \} while(0)#define IS_EMPTY_STR (str == end)#define ON_STR_BEGIN(s) ((s) == str)#define ON_STR_END(s) ((s) == end)#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE#define DATA_ENSURE_CHECK1 (s < right_range)#define DATA_ENSURE_CHECK(n) (s + (n) <= right_range)#define DATA_ENSURE(n) if (s + (n) > right_range) goto fail#else#define DATA_ENSURE_CHECK1 (s < end)#define DATA_ENSURE_CHECK(n) (s + (n) <= end)#define DATA_ENSURE(n) if (s + (n) > end) goto fail#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE */#ifdef USE_CAPTURE_HISTORYstatic intmake_capture_history_tree(OnigCaptureTreeNode* node, OnigStackType** kp,OnigStackType* stk_top, UChar* str, regex_t* reg){int n, r;OnigCaptureTreeNode* child;OnigStackType* k = *kp;while (k < stk_top) {if (k->type == STK_MEM_START) {n = k->u.mem.num;if (n <= ONIG_MAX_CAPTURE_HISTORY_GROUP &&BIT_STATUS_AT(reg->capture_history, n) != 0) {child = history_node_new();CHECK_NULL_RETURN_MEMERR(child);child->group = n;child->beg = (int )(k->u.mem.pstr - str);r = history_tree_add_child(node, child);if (r != 0) return r;*kp = (k + 1);r = make_capture_history_tree(child, kp, stk_top, str, reg);if (r != 0) return r;k = *kp;child->end = (int )(k->u.mem.pstr - str);}}else if (k->type == STK_MEM_END) {if (k->u.mem.num == node->group) {node->end = (int )(k->u.mem.pstr - str);*kp = k;return 0;}}k++;}return 1; /* 1: root node ending. */}#endif#ifdef USE_BACKREF_WITH_LEVELstatic int mem_is_in_memp(int mem, int num, UChar* memp){int i;MemNumType m;for (i = 0; i < num; i++) {GET_MEMNUM_INC(m, memp);if (mem == (int )m) return 1;}return 0;}static int backref_match_at_nested_level(regex_t* reg, OnigStackType* top, OnigStackType* stk_base, int ignore_case, int case_fold_flag, int nest, int mem_num, UChar* memp, UChar** s, const UChar* send){UChar *ss, *p, *pstart, *pend = NULL_UCHARP;int level;OnigStackType* k;level = 0;k = top;k--;while (k >= stk_base) {if (k->type == STK_CALL_FRAME) {level--;}else if (k->type == STK_RETURN) {level++;}else if (level == nest) {if (k->type == STK_MEM_START) {if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {pstart = k->u.mem.pstr;if (pend != NULL_UCHARP) {if (pend - pstart > send - *s) return 0; /* or goto next_mem; */p = pstart;ss = *s;if (ignore_case != 0) {if (string_cmp_ic(reg->enc, case_fold_flag,pstart, &ss, (int )(pend - pstart)) == 0)return 0; /* or goto next_mem; */}else {while (p < pend) {if (*p++ != *ss++) return 0; /* or goto next_mem; */}}*s = ss;return 1;}}}else if (k->type == STK_MEM_END) {if (mem_is_in_memp(k->u.mem.num, mem_num, memp)) {pend = k->u.mem.pstr;}}}k--;}return 0;}#endif /* USE_BACKREF_WITH_LEVEL */#ifdef ONIG_DEBUG_STATISTICS#define USE_TIMEOFDAY#ifdef USE_TIMEOFDAY#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endifstatic struct timeval ts, te;#define GETTIME(t) gettimeofday(&(t), (struct timezone* )0)#define TIMEDIFF(te,ts) (((te).tv_usec - (ts).tv_usec) + \(((te).tv_sec - (ts).tv_sec)*1000000))#else#ifdef HAVE_SYS_TIMES_H#include <sys/times.h>#endifstatic struct tms ts, te;#define GETTIME(t) times(&(t))#define TIMEDIFF(te,ts) ((te).tms_utime - (ts).tms_utime)#endifstatic int OpCounter[256];static int OpPrevCounter[256];static unsigned long OpTime[256];static int OpCurr = OP_FINISH;static int OpPrevTarget = OP_FAIL;static int MaxStackDepth = 0;#define MOP_IN(opcode) do {\if (opcode == OpPrevTarget) OpPrevCounter[OpCurr]++;\OpCurr = opcode;\OpCounter[opcode]++;\GETTIME(ts);\} while(0)#define MOP_OUT do {\GETTIME(te);\OpTime[OpCurr] += TIMEDIFF(te, ts);\} while(0)extern voidonig_statistics_init(void){int i;for (i = 0; i < 256; i++) {OpCounter[i] = OpPrevCounter[i] = 0; OpTime[i] = 0;}MaxStackDepth = 0;}extern voidonig_print_statistics(FILE* f){int i;fprintf(f, " count prev time\n");for (i = 0; OnigOpInfo[i].opcode >= 0; i++) {fprintf(f, "%8d: %8d: %10ld: %s\n",OpCounter[i], OpPrevCounter[i], OpTime[i], OnigOpInfo[i].name);}fprintf(f, "\nmax stack depth: %d\n", MaxStackDepth);}#define STACK_INC do {\stk++;\if (stk - stk_base > MaxStackDepth) \MaxStackDepth = stk - stk_base;\} while(0)#else#define STACK_INC stk++#define MOP_IN(opcode)#define MOP_OUT#endif/* matching region of POSIX API */typedef int regoff_t;typedef struct {regoff_t rm_so;regoff_t rm_eo;} posix_regmatch_t;/* match data(str - end) from position (sstart). *//* if sstart == str then set sprev to NULL. */static intmatch_at(regex_t* reg, const UChar* str, const UChar* end,#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGEconst UChar* right_range,#endifconst UChar* sstart, UChar* sprev, OnigMatchArg* msa){static UChar FinishCode[] = { OP_FINISH };int i, n, num_mem, best_len, pop_level;LengthType tlen, tlen2;MemNumType mem;RelAddrType addr;OnigOptionType option = reg->options;OnigEncoding encode = reg->enc;OnigCaseFoldType case_fold_flag = reg->case_fold_flag;UChar *s, *q, *sbegin;UChar *p = reg->p;char *alloca_base;OnigStackType *stk_alloc, *stk_base, *stk, *stk_end;OnigStackType *stkp; /* used as any purpose. */OnigStackIndex si;OnigStackIndex *repeat_stk;OnigStackIndex *mem_start_stk, *mem_end_stk;#ifdef USE_COMBINATION_EXPLOSION_CHECKint scv;unsigned char* state_check_buff = msa->state_check_buff;int num_comb_exp_check = reg->num_comb_exp_check;#endifn = reg->num_repeat + reg->num_mem * 2;STACK_INIT(alloca_base, n, INIT_MATCH_STACK_SIZE);pop_level = reg->stack_pop_level;num_mem = reg->num_mem;repeat_stk = (OnigStackIndex* )alloca_base;mem_start_stk = (OnigStackIndex* )(repeat_stk + reg->num_repeat);mem_end_stk = mem_start_stk + num_mem;mem_start_stk--; /* for index start from 1,mem_start_stk[1]..mem_start_stk[num_mem] */mem_end_stk--; /* for index start from 1,mem_end_stk[1]..mem_end_stk[num_mem] */for (i = 1; i <= num_mem; i++) {mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX;}#ifdef ONIG_DEBUG_MATCHfprintf(stderr, "match_at: str: %d, end: %d, start: %d, sprev: %d\n",(int )str, (int )end, (int )sstart, (int )sprev);fprintf(stderr, "size: %d, start offset: %d\n",(int )(end - str), (int )(sstart - str));#endifSTACK_PUSH_ENSURED(STK_ALT, FinishCode); /* bottom stack */best_len = ONIG_MISMATCH;s = (UChar* )sstart;while (1) {#ifdef ONIG_DEBUG_MATCH{UChar *q, *bp, buf[50];int len;fprintf(stderr, "%4d> \"", (int )(s - str));bp = buf;for (i = 0, q = s; i < 7 && q < end; i++) {len = enclen(encode, q);while (len-- > 0) *bp++ = *q++;}if (q < end) { xmemcpy(bp, "...\"", 4); bp += 4; }else { xmemcpy(bp, "\"", 1); bp += 1; }*bp = 0;fputs((char* )buf, stderr);for (i = 0; i < 20 - (bp - buf); i++) fputc(' ', stderr);onig_print_compiled_byte_code(stderr, p, NULL, encode);fprintf(stderr, "\n");}#endifsbegin = s;switch (*p++) {case OP_END: MOP_IN(OP_END);n = s - sstart;if (n > best_len) {OnigRegion* region;#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGEif (IS_FIND_LONGEST(option)) {if (n > msa->best_len) {msa->best_len = n;msa->best_s = (UChar* )sstart;}elsegoto end_best_len;}#endifbest_len = n;region = msa->region;if (region) {#ifdef USE_POSIX_API_REGION_OPTIONif (IS_POSIX_REGION(msa->options)) {posix_regmatch_t* rmt = (posix_regmatch_t* )region;rmt[0].rm_so = sstart - str;rmt[0].rm_eo = s - str;for (i = 1; i <= num_mem; i++) {if (mem_end_stk[i] != INVALID_STACK_INDEX) {if (BIT_STATUS_AT(reg->bt_mem_start, i))rmt[i].rm_so = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;elsermt[i].rm_so = (UChar* )((void* )(mem_start_stk[i])) - str;rmt[i].rm_eo = (BIT_STATUS_AT(reg->bt_mem_end, i)? STACK_AT(mem_end_stk[i])->u.mem.pstr: (UChar* )((void* )mem_end_stk[i])) - str;}else {rmt[i].rm_so = rmt[i].rm_eo = ONIG_REGION_NOTPOS;}}}else {#endif /* USE_POSIX_API_REGION_OPTION */region->beg[0] = sstart - str;region->end[0] = s - str;for (i = 1; i <= num_mem; i++) {if (mem_end_stk[i] != INVALID_STACK_INDEX) {if (BIT_STATUS_AT(reg->bt_mem_start, i))region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;elseregion->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str;region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i)? STACK_AT(mem_end_stk[i])->u.mem.pstr: (UChar* )((void* )mem_end_stk[i])) - str;}else {region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;}}#ifdef USE_CAPTURE_HISTORYif (reg->capture_history != 0) {int r;OnigCaptureTreeNode* node;if (IS_NULL(region->history_root)) {region->history_root = node = history_node_new();CHECK_NULL_RETURN_MEMERR(node);}else {node = region->history_root;history_tree_clear(node);}node->group = 0;node->beg = sstart - str;node->end = s - str;stkp = stk_base;r = make_capture_history_tree(region->history_root, &stkp,stk, (UChar* )str, reg);if (r < 0) {best_len = r; /* error code */goto finish;}}#endif /* USE_CAPTURE_HISTORY */#ifdef USE_POSIX_API_REGION_OPTION} /* else IS_POSIX_REGION() */#endif} /* if (region) */} /* n > best_len */#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGEend_best_len:#endifMOP_OUT;if (IS_FIND_CONDITION(option)) {if (IS_FIND_NOT_EMPTY(option) && s == sstart) {best_len = ONIG_MISMATCH;goto fail; /* for retry */}if (IS_FIND_LONGEST(option) && DATA_ENSURE_CHECK1) {goto fail; /* for retry */}}/* default behavior: return first-matching result. */goto finish;break;case OP_EXACT1: MOP_IN(OP_EXACT1);#if 0DATA_ENSURE(1);if (*p != *s) goto fail;p++; s++;#endifif (*p != *s++) goto fail;DATA_ENSURE(0);p++;MOP_OUT;break;case OP_EXACT1_IC: MOP_IN(OP_EXACT1_IC);{int len;UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];DATA_ENSURE(1);len = ONIGENC_MBC_CASE_FOLD(encode,/* DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag), */case_fold_flag,&s, end, lowbuf);DATA_ENSURE(0);q = lowbuf;while (len-- > 0) {if (*p != *q) {goto fail;}p++; q++;}}MOP_OUT;break;case OP_EXACT2: MOP_IN(OP_EXACT2);DATA_ENSURE(2);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;sprev = s;p++; s++;MOP_OUT;continue;break;case OP_EXACT3: MOP_IN(OP_EXACT3);DATA_ENSURE(3);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;sprev = s;p++; s++;MOP_OUT;continue;break;case OP_EXACT4: MOP_IN(OP_EXACT4);DATA_ENSURE(4);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;sprev = s;p++; s++;MOP_OUT;continue;break;case OP_EXACT5: MOP_IN(OP_EXACT5);DATA_ENSURE(5);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;sprev = s;p++; s++;MOP_OUT;continue;break;case OP_EXACTN: MOP_IN(OP_EXACTN);GET_LENGTH_INC(tlen, p);DATA_ENSURE(tlen);while (tlen-- > 0) {if (*p++ != *s++) goto fail;}sprev = s - 1;MOP_OUT;continue;break;case OP_EXACTN_IC: MOP_IN(OP_EXACTN_IC);{int len;UChar *q, *endp, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];GET_LENGTH_INC(tlen, p);endp = p + tlen;while (p < endp) {sprev = s;DATA_ENSURE(1);len = ONIGENC_MBC_CASE_FOLD(encode,/* DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag), */case_fold_flag,&s, end, lowbuf);DATA_ENSURE(0);q = lowbuf;while (len-- > 0) {if (*p != *q) goto fail;p++; q++;}}}MOP_OUT;continue;break;case OP_EXACTMB2N1: MOP_IN(OP_EXACTMB2N1);DATA_ENSURE(2);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;MOP_OUT;break;case OP_EXACTMB2N2: MOP_IN(OP_EXACTMB2N2);DATA_ENSURE(4);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;sprev = s;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;MOP_OUT;continue;break;case OP_EXACTMB2N3: MOP_IN(OP_EXACTMB2N3);DATA_ENSURE(6);if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;sprev = s;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;MOP_OUT;continue;break;case OP_EXACTMB2N: MOP_IN(OP_EXACTMB2N);GET_LENGTH_INC(tlen, p);DATA_ENSURE(tlen * 2);while (tlen-- > 0) {if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;}sprev = s - 2;MOP_OUT;continue;break;case OP_EXACTMB3N: MOP_IN(OP_EXACTMB3N);GET_LENGTH_INC(tlen, p);DATA_ENSURE(tlen * 3);while (tlen-- > 0) {if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;if (*p != *s) goto fail;p++; s++;}sprev = s - 3;MOP_OUT;continue;break;case OP_EXACTMBN: MOP_IN(OP_EXACTMBN);GET_LENGTH_INC(tlen, p); /* mb-len */GET_LENGTH_INC(tlen2, p); /* string len */tlen2 *= tlen;DATA_ENSURE(tlen2);while (tlen2-- > 0) {if (*p != *s) goto fail;p++; s++;}sprev = s - tlen;MOP_OUT;continue;break;case OP_CCLASS: MOP_IN(OP_CCLASS);DATA_ENSURE(1);if (BITSET_AT(((BitSetRef )p), *s) == 0) goto fail;p += SIZE_BITSET;s += enclen(encode, s); /* OP_CCLASS can match mb-code. \D, \S */MOP_OUT;break;case OP_CCLASS_MB: MOP_IN(OP_CCLASS_MB);if (! ONIGENC_IS_MBC_HEAD(encode, s)) goto fail;cclass_mb:GET_LENGTH_INC(tlen, p);{OnigCodePoint code;UChar *ss;int mb_len;DATA_ENSURE(1);mb_len = enclen(encode, s);DATA_ENSURE(mb_len);ss = s;s += mb_len;code = ONIGENC_MBC_TO_CODE(encode, ss, s);#ifdef PLATFORM_UNALIGNED_WORD_ACCESSif (! onig_is_in_code_range(p, code)) goto fail;#elseq = p;ALIGNMENT_RIGHT(q);if (! onig_is_in_code_range(q, code)) goto fail;#endif}p += tlen;MOP_OUT;break;case OP_CCLASS_MIX: MOP_IN(OP_CCLASS_MIX);DATA_ENSURE(1);if (ONIGENC_IS_MBC_HEAD(encode, s)) {p += SIZE_BITSET;goto cclass_mb;}else {if (BITSET_AT(((BitSetRef )p), *s) == 0)goto fail;p += SIZE_BITSET;GET_LENGTH_INC(tlen, p);p += tlen;s++;}MOP_OUT;break;case OP_CCLASS_NOT: MOP_IN(OP_CCLASS_NOT);DATA_ENSURE(1);if (BITSET_AT(((BitSetRef )p), *s) != 0) goto fail;p += SIZE_BITSET;s += enclen(encode, s);MOP_OUT;break;case OP_CCLASS_MB_NOT: MOP_IN(OP_CCLASS_MB_NOT);DATA_ENSURE(1);if (! ONIGENC_IS_MBC_HEAD(encode, s)) {s++;GET_LENGTH_INC(tlen, p);p += tlen;goto cc_mb_not_success;}cclass_mb_not:GET_LENGTH_INC(tlen, p);{OnigCodePoint code;UChar *ss;int mb_len = enclen(encode, s);if (! DATA_ENSURE_CHECK(mb_len)) {DATA_ENSURE(1);s = (UChar* )end;p += tlen;goto cc_mb_not_success;}ss = s;s += mb_len;code = ONIGENC_MBC_TO_CODE(encode, ss, s);#ifdef PLATFORM_UNALIGNED_WORD_ACCESSif (onig_is_in_code_range(p, code)) goto fail;#elseq = p;ALIGNMENT_RIGHT(q);if (onig_is_in_code_range(q, code)) goto fail;#endif}p += tlen;cc_mb_not_success:MOP_OUT;break;case OP_CCLASS_MIX_NOT: MOP_IN(OP_CCLASS_MIX_NOT);DATA_ENSURE(1);if (ONIGENC_IS_MBC_HEAD(encode, s)) {p += SIZE_BITSET;goto cclass_mb_not;}else {if (BITSET_AT(((BitSetRef )p), *s) != 0)goto fail;p += SIZE_BITSET;GET_LENGTH_INC(tlen, p);p += tlen;s++;}MOP_OUT;break;case OP_CCLASS_NODE: MOP_IN(OP_CCLASS_NODE);{OnigCodePoint code;void *node;int mb_len;UChar *ss;DATA_ENSURE(1);GET_POINTER_INC(node, p);mb_len = enclen(encode, s);ss = s;s += mb_len;DATA_ENSURE(0);code = ONIGENC_MBC_TO_CODE(encode, ss, s);if (onig_is_code_in_cc_len(mb_len, code, node) == 0) goto fail;}MOP_OUT;break;case OP_ANYCHAR: MOP_IN(OP_ANYCHAR);DATA_ENSURE(1);n = enclen(encode, s);DATA_ENSURE(n);if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;s += n;MOP_OUT;break;case OP_ANYCHAR_ML: MOP_IN(OP_ANYCHAR_ML);DATA_ENSURE(1);n = enclen(encode, s);DATA_ENSURE(n);s += n;MOP_OUT;break;case OP_ANYCHAR_STAR: MOP_IN(OP_ANYCHAR_STAR);while (DATA_ENSURE_CHECK1) {STACK_PUSH_ALT(p, s, sprev);n = enclen(encode, s);DATA_ENSURE(n);if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;sprev = s;s += n;}MOP_OUT;break;case OP_ANYCHAR_ML_STAR: MOP_IN(OP_ANYCHAR_ML_STAR);while (DATA_ENSURE_CHECK1) {STACK_PUSH_ALT(p, s, sprev);n = enclen(encode, s);if (n > 1) {DATA_ENSURE(n);sprev = s;s += n;}else {sprev = s;s++;}}MOP_OUT;break;case OP_ANYCHAR_STAR_PEEK_NEXT: MOP_IN(OP_ANYCHAR_STAR_PEEK_NEXT);while (DATA_ENSURE_CHECK1) {if (*p == *s) {STACK_PUSH_ALT(p + 1, s, sprev);}n = enclen(encode, s);DATA_ENSURE(n);if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;sprev = s;s += n;}p++;MOP_OUT;break;case OP_ANYCHAR_ML_STAR_PEEK_NEXT:MOP_IN(OP_ANYCHAR_ML_STAR_PEEK_NEXT);while (DATA_ENSURE_CHECK1) {if (*p == *s) {STACK_PUSH_ALT(p + 1, s, sprev);}n = enclen(encode, s);if (n > 1) {DATA_ENSURE(n);sprev = s;s += n;}else {sprev = s;s++;}}p++;MOP_OUT;break;#ifdef USE_COMBINATION_EXPLOSION_CHECKcase OP_STATE_CHECK_ANYCHAR_STAR: MOP_IN(OP_STATE_CHECK_ANYCHAR_STAR);GET_STATE_CHECK_NUM_INC(mem, p);while (DATA_ENSURE_CHECK1) {STATE_CHECK_VAL(scv, mem);if (scv) goto fail;STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem);n = enclen(encode, s);DATA_ENSURE(n);if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) goto fail;sprev = s;s += n;}MOP_OUT;break;case OP_STATE_CHECK_ANYCHAR_ML_STAR:MOP_IN(OP_STATE_CHECK_ANYCHAR_ML_STAR);GET_STATE_CHECK_NUM_INC(mem, p);while (DATA_ENSURE_CHECK1) {STATE_CHECK_VAL(scv, mem);if (scv) goto fail;STACK_PUSH_ALT_WITH_STATE_CHECK(p, s, sprev, mem);n = enclen(encode, s);if (n > 1) {DATA_ENSURE(n);sprev = s;s += n;}else {sprev = s;s++;}}MOP_OUT;break;#endif /* USE_COMBINATION_EXPLOSION_CHECK */case OP_WORD: MOP_IN(OP_WORD);DATA_ENSURE(1);if (! ONIGENC_IS_MBC_WORD(encode, s, end))goto fail;s += enclen(encode, s);MOP_OUT;break;case OP_NOT_WORD: MOP_IN(OP_NOT_WORD);DATA_ENSURE(1);if (ONIGENC_IS_MBC_WORD(encode, s, end))goto fail;s += enclen(encode, s);MOP_OUT;break;case OP_WORD_BOUND: MOP_IN(OP_WORD_BOUND);if (ON_STR_BEGIN(s)) {DATA_ENSURE(1);if (! ONIGENC_IS_MBC_WORD(encode, s, end))goto fail;}else if (ON_STR_END(s)) {if (! ONIGENC_IS_MBC_WORD(encode, sprev, end))goto fail;}else {if (ONIGENC_IS_MBC_WORD(encode, s, end)== ONIGENC_IS_MBC_WORD(encode, sprev, end))goto fail;}MOP_OUT;continue;break;case OP_NOT_WORD_BOUND: MOP_IN(OP_NOT_WORD_BOUND);if (ON_STR_BEGIN(s)) {if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end))goto fail;}else if (ON_STR_END(s)) {if (ONIGENC_IS_MBC_WORD(encode, sprev, end))goto fail;}else {if (ONIGENC_IS_MBC_WORD(encode, s, end)!= ONIGENC_IS_MBC_WORD(encode, sprev, end))goto fail;}MOP_OUT;continue;break;#ifdef USE_WORD_BEGIN_ENDcase OP_WORD_BEGIN: MOP_IN(OP_WORD_BEGIN);if (DATA_ENSURE_CHECK1 && ONIGENC_IS_MBC_WORD(encode, s, end)) {if (ON_STR_BEGIN(s) || !ONIGENC_IS_MBC_WORD(encode, sprev, end)) {MOP_OUT;continue;}}goto fail;break;case OP_WORD_END: MOP_IN(OP_WORD_END);if (!ON_STR_BEGIN(s) && ONIGENC_IS_MBC_WORD(encode, sprev, end)) {if (ON_STR_END(s) || !ONIGENC_IS_MBC_WORD(encode, s, end)) {MOP_OUT;continue;}}goto fail;break;#endifcase OP_BEGIN_BUF: MOP_IN(OP_BEGIN_BUF);if (! ON_STR_BEGIN(s)) goto fail;MOP_OUT;continue;break;case OP_END_BUF: MOP_IN(OP_END_BUF);if (! ON_STR_END(s)) goto fail;MOP_OUT;continue;break;case OP_BEGIN_LINE: MOP_IN(OP_BEGIN_LINE);if (ON_STR_BEGIN(s)) {if (IS_NOTBOL(msa->options)) goto fail;MOP_OUT;continue;}else if (ONIGENC_IS_MBC_NEWLINE(encode, sprev, end) && !ON_STR_END(s)) {MOP_OUT;continue;}goto fail;break;case OP_END_LINE: MOP_IN(OP_END_LINE);if (ON_STR_END(s)) {#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINEif (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)) {#endifif (IS_NOTEOL(msa->options)) goto fail;MOP_OUT;continue;#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE}#endif}else if (ONIGENC_IS_MBC_NEWLINE(encode, s, end)) {MOP_OUT;continue;}#ifdef USE_CRNL_AS_LINE_TERMINATORelse if (ONIGENC_IS_MBC_CRNL(encode, s, end)) {MOP_OUT;continue;}#endifgoto fail;break;case OP_SEMI_END_BUF: MOP_IN(OP_SEMI_END_BUF);if (ON_STR_END(s)) {#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINEif (IS_EMPTY_STR || !ONIGENC_IS_MBC_NEWLINE(encode, sprev, end)) {#endifif (IS_NOTEOL(msa->options)) goto fail;MOP_OUT;continue;#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE}#endif}else if (ONIGENC_IS_MBC_NEWLINE(encode, s, end) &&ON_STR_END(s + enclen(encode, s))) {MOP_OUT;continue;}#ifdef USE_CRNL_AS_LINE_TERMINATORelse if (ONIGENC_IS_MBC_CRNL(encode, s, end)) {UChar* ss = s + enclen(encode, s);ss += enclen(encode, ss);if (ON_STR_END(ss)) {MOP_OUT;continue;}}#endifgoto fail;break;case OP_BEGIN_POSITION: MOP_IN(OP_BEGIN_POSITION);if (s != msa->start)goto fail;MOP_OUT;continue;break;case OP_MEMORY_START_PUSH: MOP_IN(OP_MEMORY_START_PUSH);GET_MEMNUM_INC(mem, p);STACK_PUSH_MEM_START(mem, s);MOP_OUT;continue;break;case OP_MEMORY_START: MOP_IN(OP_MEMORY_START);GET_MEMNUM_INC(mem, p);mem_start_stk[mem] = (OnigStackIndex )((void* )s);MOP_OUT;continue;break;case OP_MEMORY_END_PUSH: MOP_IN(OP_MEMORY_END_PUSH);GET_MEMNUM_INC(mem, p);STACK_PUSH_MEM_END(mem, s);MOP_OUT;continue;break;case OP_MEMORY_END: MOP_IN(OP_MEMORY_END);GET_MEMNUM_INC(mem, p);mem_end_stk[mem] = (OnigStackIndex )((void* )s);MOP_OUT;continue;break;#ifdef USE_SUBEXP_CALLcase OP_MEMORY_END_PUSH_REC: MOP_IN(OP_MEMORY_END_PUSH_REC);GET_MEMNUM_INC(mem, p);STACK_GET_MEM_START(mem, stkp); /* should be before push mem-end. */STACK_PUSH_MEM_END(mem, s);mem_start_stk[mem] = GET_STACK_INDEX(stkp);MOP_OUT;continue;break;case OP_MEMORY_END_REC: MOP_IN(OP_MEMORY_END_REC);GET_MEMNUM_INC(mem, p);mem_end_stk[mem] = (OnigStackIndex )((void* )s);STACK_GET_MEM_START(mem, stkp);if (BIT_STATUS_AT(reg->bt_mem_start, mem))mem_start_stk[mem] = GET_STACK_INDEX(stkp);elsemem_start_stk[mem] = (OnigStackIndex )((void* )stkp->u.mem.pstr);STACK_PUSH_MEM_END_MARK(mem);MOP_OUT;continue;break;#endifcase OP_BACKREF1: MOP_IN(OP_BACKREF1);mem = 1;goto backref;break;case OP_BACKREF2: MOP_IN(OP_BACKREF2);mem = 2;goto backref;break;case OP_BACKREFN: MOP_IN(OP_BACKREFN);GET_MEMNUM_INC(mem, p);backref:{int len;UChar *pstart, *pend;/* if you want to remove following line,you should check in parse and compile time. */if (mem > num_mem) goto fail;if (mem_end_stk[mem] == INVALID_STACK_INDEX) goto fail;if (mem_start_stk[mem] == INVALID_STACK_INDEX) goto fail;if (BIT_STATUS_AT(reg->bt_mem_start, mem))pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;elsepstart = (UChar* )((void* )mem_start_stk[mem]);pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)? STACK_AT(mem_end_stk[mem])->u.mem.pstr: (UChar* )((void* )mem_end_stk[mem]));n = pend - pstart;DATA_ENSURE(n);sprev = s;STRING_CMP(pstart, s, n);while (sprev + (len = enclen(encode, sprev)) < s)sprev += len;MOP_OUT;continue;}break;case OP_BACKREFN_IC: MOP_IN(OP_BACKREFN_IC);GET_MEMNUM_INC(mem, p);{int len;UChar *pstart, *pend;/* if you want to remove following line,you should check in parse and compile time. */if (mem > num_mem) goto fail;if (mem_end_stk[mem] == INVALID_STACK_INDEX) goto fail;if (mem_start_stk[mem] == INVALID_STACK_INDEX) goto fail;if (BIT_STATUS_AT(reg->bt_mem_start, mem))pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;elsepstart = (UChar* )((void* )mem_start_stk[mem]);pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)? STACK_AT(mem_end_stk[mem])->u.mem.pstr: (UChar* )((void* )mem_end_stk[mem]));n = pend - pstart;DATA_ENSURE(n);sprev = s;STRING_CMP_IC(case_fold_flag, pstart, &s, n);while (sprev + (len = enclen(encode, sprev)) < s)sprev += len;MOP_OUT;continue;}break;case OP_BACKREF_MULTI: MOP_IN(OP_BACKREF_MULTI);{int len, is_fail;UChar *pstart, *pend, *swork;GET_LENGTH_INC(tlen, p);for (i = 0; i < tlen; i++) {GET_MEMNUM_INC(mem, p);if (mem_end_stk[mem] == INVALID_STACK_INDEX) continue;if (mem_start_stk[mem] == INVALID_STACK_INDEX) continue;if (BIT_STATUS_AT(reg->bt_mem_start, mem))pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;elsepstart = (UChar* )((void* )mem_start_stk[mem]);pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)? STACK_AT(mem_end_stk[mem])->u.mem.pstr: (UChar* )((void* )mem_end_stk[mem]));n = pend - pstart;DATA_ENSURE(n);sprev = s;swork = s;STRING_CMP_VALUE(pstart, swork, n, is_fail);if (is_fail) continue;s = swork;while (sprev + (len = enclen(encode, sprev)) < s)sprev += len;p += (SIZE_MEMNUM * (tlen - i - 1));break; /* success */}if (i == tlen) goto fail;MOP_OUT;continue;}break;case OP_BACKREF_MULTI_IC: MOP_IN(OP_BACKREF_MULTI_IC);{int len, is_fail;UChar *pstart, *pend, *swork;GET_LENGTH_INC(tlen, p);for (i = 0; i < tlen; i++) {GET_MEMNUM_INC(mem, p);if (mem_end_stk[mem] == INVALID_STACK_INDEX) continue;if (mem_start_stk[mem] == INVALID_STACK_INDEX) continue;if (BIT_STATUS_AT(reg->bt_mem_start, mem))pstart = STACK_AT(mem_start_stk[mem])->u.mem.pstr;elsepstart = (UChar* )((void* )mem_start_stk[mem]);pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)? STACK_AT(mem_end_stk[mem])->u.mem.pstr: (UChar* )((void* )mem_end_stk[mem]));n = pend - pstart;DATA_ENSURE(n);sprev = s;swork = s;STRING_CMP_VALUE_IC(case_fold_flag, pstart, &swork, n, is_fail);if (is_fail) continue;s = swork;while (sprev + (len = enclen(encode, sprev)) < s)sprev += len;p += (SIZE_MEMNUM * (tlen - i - 1));break; /* success */}if (i == tlen) goto fail;MOP_OUT;continue;}break;#ifdef USE_BACKREF_WITH_LEVELcase OP_BACKREF_WITH_LEVEL:{int len;OnigOptionType ic;LengthType level;GET_OPTION_INC(ic, p);GET_LENGTH_INC(level, p);GET_LENGTH_INC(tlen, p);sprev = s;if (backref_match_at_nested_level(reg, stk, stk_base, ic, case_fold_flag, (int )level, (int )tlen, p, &s, end)) {while (sprev + (len = enclen(encode, sprev)) < s)sprev += len;p += (SIZE_MEMNUM * tlen);}elsegoto fail;MOP_OUT;continue;}break;#endif#if 0 /* no need: IS_DYNAMIC_OPTION() == 0 */case OP_SET_OPTION_PUSH: MOP_IN(OP_SET_OPTION_PUSH);GET_OPTION_INC(option, p);STACK_PUSH_ALT(p, s, sprev);p += SIZE_OP_SET_OPTION + SIZE_OP_FAIL;MOP_OUT;continue;break;case OP_SET_OPTION: MOP_IN(OP_SET_OPTION);GET_OPTION_INC(option, p);MOP_OUT;continue;break;#endifcase OP_NULL_CHECK_START: MOP_IN(OP_NULL_CHECK_START);GET_MEMNUM_INC(mem, p); /* mem: null check id */STACK_PUSH_NULL_CHECK_START(mem, s);MOP_OUT;continue;break;case OP_NULL_CHECK_END: MOP_IN(OP_NULL_CHECK_END);{int isnull;GET_MEMNUM_INC(mem, p); /* mem: null check id */STACK_NULL_CHECK(isnull, mem, s);if (isnull) {#ifdef ONIG_DEBUG_MATCHfprintf(stderr, "NULL_CHECK_END: skip id:%d, s:%d\n",(int )mem, (int )s);#endifnull_check_found:/* empty loop founded, skip next instruction */switch (*p++) {case OP_JUMP:case OP_PUSH:p += SIZE_RELADDR;break;case OP_REPEAT_INC:case OP_REPEAT_INC_NG:case OP_REPEAT_INC_SG:case OP_REPEAT_INC_NG_SG:p += SIZE_MEMNUM;break;default:goto unexpected_bytecode_error;break;}}}MOP_OUT;continue;break;#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEATcase OP_NULL_CHECK_END_MEMST: MOP_IN(OP_NULL_CHECK_END_MEMST);{int isnull;GET_MEMNUM_INC(mem, p); /* mem: null check id */STACK_NULL_CHECK_MEMST(isnull, mem, s, reg);if (isnull) {#ifdef ONIG_DEBUG_MATCHfprintf(stderr, "NULL_CHECK_END_MEMST: skip id:%d, s:%d\n",(int )mem, (int )s);#endifif (isnull == -1) goto fail;goto null_check_found;}}MOP_OUT;continue;break;#endif#ifdef USE_SUBEXP_CALLcase OP_NULL_CHECK_END_MEMST_PUSH:MOP_IN(OP_NULL_CHECK_END_MEMST_PUSH);{int isnull;GET_MEMNUM_INC(mem, p); /* mem: null check id */#ifdef USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEATSTACK_NULL_CHECK_MEMST_REC(isnull, mem, s, reg);#elseSTACK_NULL_CHECK_REC(isnull, mem, s);#endifif (isnull) {#ifdef ONIG_DEBUG_MATCHfprintf(stderr, "NULL_CHECK_END_MEMST_PUSH: skip id:%d, s:%d\n",(int )mem, (int )s);#endifif (isnull == -1) goto fail;goto null_check_found;}else {STACK_PUSH_NULL_CHECK_END(mem);}}MOP_OUT;continue;break;#endifcase OP_JUMP: MOP_IN(OP_JUMP);GET_RELADDR_INC(addr, p);p += addr;MOP_OUT;CHECK_INTERRUPT_IN_MATCH_AT;continue;break;case OP_PUSH: MOP_IN(OP_PUSH);GET_RELADDR_INC(addr, p);STACK_PUSH_ALT(p + addr, s, sprev);MOP_OUT;continue;break;#ifdef USE_COMBINATION_EXPLOSION_CHECKcase OP_STATE_CHECK_PUSH: MOP_IN(OP_STATE_CHECK_PUSH);GET_STATE_CHECK_NUM_INC(mem, p);STATE_CHECK_VAL(scv, mem);if (scv) goto fail;GET_RELADDR_INC(addr, p);STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem);MOP_OUT;continue;break;case OP_STATE_CHECK_PUSH_OR_JUMP: MOP_IN(OP_STATE_CHECK_PUSH_OR_JUMP);GET_STATE_CHECK_NUM_INC(mem, p);GET_RELADDR_INC(addr, p);STATE_CHECK_VAL(scv, mem);if (scv) {p += addr;}else {STACK_PUSH_ALT_WITH_STATE_CHECK(p + addr, s, sprev, mem);}MOP_OUT;continue;break;case OP_STATE_CHECK: MOP_IN(OP_STATE_CHECK);GET_STATE_CHECK_NUM_INC(mem, p);STATE_CHECK_VAL(scv, mem);if (scv) goto fail;STACK_PUSH_STATE_CHECK(s, mem);MOP_OUT;continue;break;#endif /* USE_COMBINATION_EXPLOSION_CHECK */case OP_POP: MOP_IN(OP_POP);STACK_POP_ONE;MOP_OUT;continue;break;case OP_PUSH_OR_JUMP_EXACT1: MOP_IN(OP_PUSH_OR_JUMP_EXACT1);GET_RELADDR_INC(addr, p);if (*p == *s && DATA_ENSURE_CHECK1) {p++;STACK_PUSH_ALT(p + addr, s, sprev);MOP_OUT;continue;}p += (addr + 1);MOP_OUT;continue;break;case OP_PUSH_IF_PEEK_NEXT: MOP_IN(OP_PUSH_IF_PEEK_NEXT);GET_RELADDR_INC(addr, p);if (*p == *s) {p++;STACK_PUSH_ALT(p + addr, s, sprev);MOP_OUT;continue;}p++;MOP_OUT;continue;break;case OP_REPEAT: MOP_IN(OP_REPEAT);{GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */GET_RELADDR_INC(addr, p);STACK_ENSURE(1);repeat_stk[mem] = GET_STACK_INDEX(stk);STACK_PUSH_REPEAT(mem, p);if (reg->repeat_range[mem].lower == 0) {STACK_PUSH_ALT(p + addr, s, sprev);}}MOP_OUT;continue;break;case OP_REPEAT_NG: MOP_IN(OP_REPEAT_NG);{GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */GET_RELADDR_INC(addr, p);STACK_ENSURE(1);repeat_stk[mem] = GET_STACK_INDEX(stk);STACK_PUSH_REPEAT(mem, p);if (reg->repeat_range[mem].lower == 0) {STACK_PUSH_ALT(p, s, sprev);p += addr;}}MOP_OUT;continue;break;case OP_REPEAT_INC: MOP_IN(OP_REPEAT_INC);GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */si = repeat_stk[mem];stkp = STACK_AT(si);repeat_inc:stkp->u.repeat.count++;if (stkp->u.repeat.count >= reg->repeat_range[mem].upper) {/* end of repeat. Nothing to do. */}else if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {STACK_PUSH_ALT(p, s, sprev);p = STACK_AT(si)->u.repeat.pcode; /* Don't use stkp after PUSH. */}else {p = stkp->u.repeat.pcode;}STACK_PUSH_REPEAT_INC(si);MOP_OUT;CHECK_INTERRUPT_IN_MATCH_AT;continue;break;case OP_REPEAT_INC_SG: MOP_IN(OP_REPEAT_INC_SG);GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */STACK_GET_REPEAT(mem, stkp);si = GET_STACK_INDEX(stkp);goto repeat_inc;break;case OP_REPEAT_INC_NG: MOP_IN(OP_REPEAT_INC_NG);GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */si = repeat_stk[mem];stkp = STACK_AT(si);repeat_inc_ng:stkp->u.repeat.count++;if (stkp->u.repeat.count < reg->repeat_range[mem].upper) {if (stkp->u.repeat.count >= reg->repeat_range[mem].lower) {UChar* pcode = stkp->u.repeat.pcode;STACK_PUSH_REPEAT_INC(si);STACK_PUSH_ALT(pcode, s, sprev);}else {p = stkp->u.repeat.pcode;STACK_PUSH_REPEAT_INC(si);}}else if (stkp->u.repeat.count == reg->repeat_range[mem].upper) {STACK_PUSH_REPEAT_INC(si);}MOP_OUT;CHECK_INTERRUPT_IN_MATCH_AT;continue;break;case OP_REPEAT_INC_NG_SG: MOP_IN(OP_REPEAT_INC_NG_SG);GET_MEMNUM_INC(mem, p); /* mem: OP_REPEAT ID */STACK_GET_REPEAT(mem, stkp);si = GET_STACK_INDEX(stkp);goto repeat_inc_ng;break;case OP_PUSH_POS: MOP_IN(OP_PUSH_POS);STACK_PUSH_POS(s, sprev);MOP_OUT;continue;break;case OP_POP_POS: MOP_IN(OP_POP_POS);{STACK_POS_END(stkp);s = stkp->u.state.pstr;sprev = stkp->u.state.pstr_prev;}MOP_OUT;continue;break;case OP_PUSH_POS_NOT: MOP_IN(OP_PUSH_POS_NOT);GET_RELADDR_INC(addr, p);STACK_PUSH_POS_NOT(p + addr, s, sprev);MOP_OUT;continue;break;case OP_FAIL_POS: MOP_IN(OP_FAIL_POS);STACK_POP_TIL_POS_NOT;goto fail;break;case OP_PUSH_STOP_BT: MOP_IN(OP_PUSH_STOP_BT);STACK_PUSH_STOP_BT;MOP_OUT;continue;break;case OP_POP_STOP_BT: MOP_IN(OP_POP_STOP_BT);STACK_STOP_BT_END;MOP_OUT;continue;break;case OP_LOOK_BEHIND: MOP_IN(OP_LOOK_BEHIND);GET_LENGTH_INC(tlen, p);s = (UChar* )ONIGENC_STEP_BACK(encode, str, s, (int )tlen);if (IS_NULL(s)) goto fail;sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s);MOP_OUT;continue;break;case OP_PUSH_LOOK_BEHIND_NOT: MOP_IN(OP_PUSH_LOOK_BEHIND_NOT);GET_RELADDR_INC(addr, p);GET_LENGTH_INC(tlen, p);q = (UChar* )ONIGENC_STEP_BACK(encode, str, s, (int )tlen);if (IS_NULL(q)) {/* too short case -> success. ex. /(?<!XXX)a/.match("a")If you want to change to fail, replace following line. */p += addr;/* goto fail; */}else {STACK_PUSH_LOOK_BEHIND_NOT(p + addr, s, sprev);s = q;sprev = (UChar* )onigenc_get_prev_char_head(encode, str, s);}MOP_OUT;continue;break;case OP_FAIL_LOOK_BEHIND_NOT: MOP_IN(OP_FAIL_LOOK_BEHIND_NOT);STACK_POP_TIL_LOOK_BEHIND_NOT;goto fail;break;#ifdef USE_SUBEXP_CALLcase OP_CALL: MOP_IN(OP_CALL);GET_ABSADDR_INC(addr, p);STACK_PUSH_CALL_FRAME(p);p = reg->p + addr;MOP_OUT;continue;break;case OP_RETURN: MOP_IN(OP_RETURN);STACK_RETURN(p);STACK_PUSH_RETURN;MOP_OUT;continue;break;#endifcase OP_FINISH:goto finish;break;fail:MOP_OUT;/* fall */case OP_FAIL: MOP_IN(OP_FAIL);STACK_POP;p = stk->u.state.pcode;s = stk->u.state.pstr;sprev = stk->u.state.pstr_prev;#ifdef USE_COMBINATION_EXPLOSION_CHECKif (stk->u.state.state_check != 0) {stk->type = STK_STATE_CHECK_MARK;stk++;}#endifMOP_OUT;continue;break;default:goto bytecode_error;} /* end of switch */sprev = sbegin;} /* end of while(1) */finish:STACK_SAVE;return best_len;#ifdef ONIG_DEBUGstack_error:STACK_SAVE;return ONIGERR_STACK_BUG;#endifbytecode_error:STACK_SAVE;return ONIGERR_UNDEFINED_BYTECODE;unexpected_bytecode_error:STACK_SAVE;return ONIGERR_UNEXPECTED_BYTECODE;}static UChar*slow_search(OnigEncoding enc, UChar* target, UChar* target_end,const UChar* text, const UChar* text_end, UChar* text_range){UChar *t, *p, *s, *end;end = (UChar* )text_end;end -= target_end - target - 1;if (end > text_range)end = text_range;s = (UChar* )text;while (s < end) {if (*s == *target) {p = s + 1;t = target + 1;while (t < target_end) {if (*t != *p++)break;t++;}if (t == target_end)return s;}s += enclen(enc, s);}return (UChar* )NULL;}static intstr_lower_case_match(OnigEncoding enc, int case_fold_flag,const UChar* t, const UChar* tend,const UChar* p, const UChar* end){int lowlen;UChar *q, lowbuf[ONIGENC_MBC_CASE_FOLD_MAXLEN];while (t < tend) {lowlen = ONIGENC_MBC_CASE_FOLD(enc, case_fold_flag, &p, end, lowbuf);q = lowbuf;while (lowlen > 0) {if (*t++ != *q++) return 0;lowlen--;}}return 1;}static UChar*slow_search_ic(OnigEncoding enc, int case_fold_flag,UChar* target, UChar* target_end,const UChar* text, const UChar* text_end, UChar* text_range){UChar *s, *end;end = (UChar* )text_end;end -= target_end - target - 1;if (end > text_range)end = text_range;s = (UChar* )text;while (s < end) {if (str_lower_case_match(enc, case_fold_flag, target, target_end,s, text_end))return s;s += enclen(enc, s);}return (UChar* )NULL;}static UChar*slow_search_backward(OnigEncoding enc, UChar* target, UChar* target_end,const UChar* text, const UChar* adjust_text,const UChar* text_end, const UChar* text_start){UChar *t, *p, *s;s = (UChar* )text_end;s -= (target_end - target);if (s > text_start)s = (UChar* )text_start;elses = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s);while (s >= text) {if (*s == *target) {p = s + 1;t = target + 1;while (t < target_end) {if (*t != *p++)break;t++;}if (t == target_end)return s;}s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s);}return (UChar* )NULL;}static UChar*slow_search_backward_ic(OnigEncoding enc, int case_fold_flag,UChar* target, UChar* target_end,const UChar* text, const UChar* adjust_text,const UChar* text_end, const UChar* text_start){UChar *s;s = (UChar* )text_end;s -= (target_end - target);if (s > text_start)s = (UChar* )text_start;elses = ONIGENC_LEFT_ADJUST_CHAR_HEAD(enc, adjust_text, s);while (s >= text) {if (str_lower_case_match(enc, case_fold_flag,target, target_end, s, text_end))return s;s = (UChar* )onigenc_get_prev_char_head(enc, adjust_text, s);}return (UChar* )NULL;}static UChar*bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,const UChar* text, const UChar* text_end,const UChar* text_range){const UChar *s, *se, *t, *p, *end;const UChar *tail;int skip, tlen1;#ifdef ONIG_DEBUG_SEARCHfprintf(stderr, "bm_search_notrev: text: %d, text_end: %d, text_range: %d\n",(int )text, (int )text_end, (int )text_range);#endiftail = target_end - 1;tlen1 = tail - target;end = text_range;if (end + tlen1 > text_end)end = text_end - tlen1;s = text;if (IS_NULL(reg->int_map)) {while (s < end) {p = se = s + tlen1;t = tail;while (*p == *t) {if (t == target) return (UChar* )s;p--; t--;}skip = reg->map[*se];t = s;do {s += enclen(reg->enc, s);} while ((s - t) < skip && s < end);}}else {while (s < end) {p = se = s + tlen1;t = tail;while (*p == *t) {if (t == target) return (UChar* )s;p--; t--;}skip = reg->int_map[*se];t = s;do {s += enclen(reg->enc, s);} while ((s - t) < skip && s < end);}}return (UChar* )NULL;}static UChar*bm_search(regex_t* reg, const UChar* target, const UChar* target_end,const UChar* text, const UChar* text_end, const UChar* text_range){const UChar *s, *t, *p, *end;const UChar *tail;end = text_range + (target_end - target) - 1;if (end > text_end)end = text_end;tail = target_end - 1;s = text + (target_end - target) - 1;if (IS_NULL(reg->int_map)) {while (s < end) {p = s;t = tail;while (*p == *t) {if (t == target) return (UChar* )p;p--; t--;}s += reg->map[*s];}}else { /* see int_map[] */while (s < end) {p = s;t = tail;while (*p == *t) {if (t == target) return (UChar* )p;p--; t--;}s += reg->int_map[*s];}}return (UChar* )NULL;}static intset_bm_backward_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,int** skip){int i, len;if (IS_NULL(*skip)) {*skip = (int* )xmalloc(sizeof(int) * ONIG_CHAR_TABLE_SIZE);if (IS_NULL(*skip)) return ONIGERR_MEMORY;}len = end - s;for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)(*skip)[i] = len;for (i = len - 1; i > 0; i--)(*skip)[s[i]] = i;return 0;}static UChar*bm_search_backward(regex_t* reg, const UChar* target, const UChar* target_end,const UChar* text, const UChar* adjust_text,const UChar* text_end, const UChar* text_start){const UChar *s, *t, *p;s = text_end - (target_end - target);if (text_start < s)s = text_start;elses = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s);while (s >= text) {p = s;t = target;while (t < target_end && *p == *t) {p++; t++;}if (t == target_end)return (UChar* )s;s -= reg->int_map_backward[*s];s = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, adjust_text, s);}return (UChar* )NULL;}static UChar*map_search(OnigEncoding enc, UChar map[],const UChar* text, const UChar* text_range){const UChar *s = text;while (s < text_range) {if (map[*s]) return (UChar* )s;s += enclen(enc, s);}return (UChar* )NULL;}static UChar*map_search_backward(OnigEncoding enc, UChar map[],const UChar* text, const UChar* adjust_text,const UChar* text_start){const UChar *s = text_start;while (s >= text) {if (map[*s]) return (UChar* )s;s = onigenc_get_prev_char_head(enc, adjust_text, s);}return (UChar* )NULL;}extern intonig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, OnigRegion* region,OnigOptionType option){int r;UChar *prev;OnigMatchArg msa;#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)start:THREAD_ATOMIC_START;if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {ONIG_STATE_INC(reg);if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {onig_chain_reduce(reg);ONIG_STATE_INC(reg);}}else {int n;THREAD_ATOMIC_END;n = 0;while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) {if (++n > THREAD_PASS_LIMIT_COUNT)return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;THREAD_PASS;}goto start;}THREAD_ATOMIC_END;#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */MATCH_ARG_INIT(msa, option, region, at);#ifdef USE_COMBINATION_EXPLOSION_CHECK{int offset = at - str;STATE_CHECK_BUFF_INIT(msa, end - str, offset, reg->num_comb_exp_check);}#endifif (region#ifdef USE_POSIX_API_REGION_OPTION&& !IS_POSIX_REGION(option)#endif) {r = onig_region_resize_clear(region, reg->num_mem + 1);}elser = 0;if (r == 0) {prev = (UChar* )onigenc_get_prev_char_head(reg->enc, str, at);r = match_at(reg, str, end,#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGEend,#endifat, prev, &msa);}MATCH_ARG_FREE(msa);ONIG_STATE_DEC_THREAD(reg);return r;}static intforward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,UChar* range, UChar** low, UChar** high, UChar** low_prev){UChar *p, *pprev = (UChar* )NULL;#ifdef ONIG_DEBUG_SEARCHfprintf(stderr, "forward_search_range: str: %d, end: %d, s: %d, range: %d\n",(int )str, (int )end, (int )s, (int )range);#endifp = s;if (reg->dmin > 0) {if (ONIGENC_IS_SINGLEBYTE(reg->enc)) {p += reg->dmin;}else {UChar *q = p + reg->dmin;while (p < q) p += enclen(reg->enc, p);}}retry:switch (reg->optimize) {case ONIG_OPTIMIZE_EXACT:p = slow_search(reg->enc, reg->exact, reg->exact_end, p, end, range);break;case ONIG_OPTIMIZE_EXACT_IC:p = slow_search_ic(reg->enc, reg->case_fold_flag,reg->exact, reg->exact_end, p, end, range);break;case ONIG_OPTIMIZE_EXACT_BM:p = bm_search(reg, reg->exact, reg->exact_end, p, end, range);break;case ONIG_OPTIMIZE_EXACT_BM_NOT_REV:p = bm_search_notrev(reg, reg->exact, reg->exact_end, p, end, range);break;case ONIG_OPTIMIZE_MAP:p = map_search(reg->enc, reg->map, p, range);break;}if (p && p < range) {if (p - reg->dmin < s) {retry_gate:pprev = p;p += enclen(reg->enc, p);goto retry;}if (reg->sub_anchor) {UChar* prev;switch (reg->sub_anchor) {case ANCHOR_BEGIN_LINE:if (!ON_STR_BEGIN(p)) {prev = onigenc_get_prev_char_head(reg->enc,(pprev ? pprev : str), p);if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end))goto retry_gate;}break;case ANCHOR_END_LINE:if (ON_STR_END(p)) {#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINEprev = (UChar* )onigenc_get_prev_char_head(reg->enc,(pprev ? pprev : str), p);if (prev && ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end))goto retry_gate;#endif}else if (! ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)#ifdef USE_CRNL_AS_LINE_TERMINATOR&& ! ONIGENC_IS_MBC_CRNL(reg->enc, p, end)#endif)goto retry_gate;break;}}if (reg->dmax == 0) {*low = p;if (low_prev) {if (*low > s)*low_prev = onigenc_get_prev_char_head(reg->enc, s, p);else*low_prev = onigenc_get_prev_char_head(reg->enc,(pprev ? pprev : str), p);}}else {if (reg->dmax != ONIG_INFINITE_DISTANCE) {*low = p - reg->dmax;if (*low > s) {*low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,*low, (const UChar** )low_prev);if (low_prev && IS_NULL(*low_prev))*low_prev = onigenc_get_prev_char_head(reg->enc,(pprev ? pprev : s), *low);}else {if (low_prev)*low_prev = onigenc_get_prev_char_head(reg->enc,(pprev ? pprev : str), *low);}}}/* no needs to adjust *high, *high is used as range check only */*high = p - reg->dmin;#ifdef ONIG_DEBUG_SEARCHfprintf(stderr,"forward_search_range success: low: %d, high: %d, dmin: %d, dmax: %d\n",(int )(*low - str), (int )(*high - str), reg->dmin, reg->dmax);#endifreturn 1; /* success */}return 0; /* fail */}static int set_bm_backward_skip P_((UChar* s, UChar* end, OnigEncoding enc,int** skip));#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD 100static intbackward_search_range(regex_t* reg, const UChar* str, const UChar* end,UChar* s, const UChar* range, UChar* adjrange,UChar** low, UChar** high){int r;UChar *p;range += reg->dmin;p = s;retry:switch (reg->optimize) {case ONIG_OPTIMIZE_EXACT:exact_method:p = slow_search_backward(reg->enc, reg->exact, reg->exact_end,range, adjrange, end, p);break;case ONIG_OPTIMIZE_EXACT_IC:p = slow_search_backward_ic(reg->enc, reg->case_fold_flag,reg->exact, reg->exact_end,range, adjrange, end, p);break;case ONIG_OPTIMIZE_EXACT_BM:case ONIG_OPTIMIZE_EXACT_BM_NOT_REV:if (IS_NULL(reg->int_map_backward)) {if (s - range < BM_BACKWARD_SEARCH_LENGTH_THRESHOLD)goto exact_method;r = set_bm_backward_skip(reg->exact, reg->exact_end, reg->enc,&(reg->int_map_backward));if (r) return r;}p = bm_search_backward(reg, reg->exact, reg->exact_end, range, adjrange,end, p);break;case ONIG_OPTIMIZE_MAP:p = map_search_backward(reg->enc, reg->map, range, adjrange, p);break;}if (p) {if (reg->sub_anchor) {UChar* prev;switch (reg->sub_anchor) {case ANCHOR_BEGIN_LINE:if (!ON_STR_BEGIN(p)) {prev = onigenc_get_prev_char_head(reg->enc, str, p);if (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) {p = prev;goto retry;}}break;case ANCHOR_END_LINE:if (ON_STR_END(p)) {#ifndef USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINEprev = onigenc_get_prev_char_head(reg->enc, adjrange, p);if (IS_NULL(prev)) goto fail;if (ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end)) {p = prev;goto retry;}#endif}else if (! ONIGENC_IS_MBC_NEWLINE(reg->enc, p, end)#ifdef USE_CRNL_AS_LINE_TERMINATOR&& ! ONIGENC_IS_MBC_CRNL(reg->enc, p, end)#endif) {p = onigenc_get_prev_char_head(reg->enc, adjrange, p);if (IS_NULL(p)) goto fail;goto retry;}break;}}/* no needs to adjust *high, *high is used as range check only */if (reg->dmax != ONIG_INFINITE_DISTANCE) {*low = p - reg->dmax;*high = p - reg->dmin;*high = onigenc_get_right_adjust_char_head(reg->enc, adjrange, *high);}#ifdef ONIG_DEBUG_SEARCHfprintf(stderr, "backward_search_range: low: %d, high: %d\n",(int )(*low - str), (int )(*high - str));#endifreturn 1; /* success */}fail:#ifdef ONIG_DEBUG_SEARCHfprintf(stderr, "backward_search_range: fail.\n");#endifreturn 0; /* fail */}extern intonig_search(regex_t* reg, const UChar* str, const UChar* end,const UChar* start, const UChar* range, OnigRegion* region, OnigOptionType option){int r;UChar *s, *prev;OnigMatchArg msa;const UChar *orig_start = start;#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGEconst UChar *orig_range = range;#endif#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)start:THREAD_ATOMIC_START;if (ONIG_STATE(reg) >= ONIG_STATE_NORMAL) {ONIG_STATE_INC(reg);if (IS_NOT_NULL(reg->chain) && ONIG_STATE(reg) == ONIG_STATE_NORMAL) {onig_chain_reduce(reg);ONIG_STATE_INC(reg);}}else {int n;THREAD_ATOMIC_END;n = 0;while (ONIG_STATE(reg) < ONIG_STATE_NORMAL) {if (++n > THREAD_PASS_LIMIT_COUNT)return ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT;THREAD_PASS;}goto start;}THREAD_ATOMIC_END;#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */#ifdef ONIG_DEBUG_SEARCHfprintf(stderr,"onig_search (entry point): str: %d, end: %d, start: %d, range: %d\n",(int )str, (int )(end - str), (int )(start - str), (int )(range - str));#endifif (region#ifdef USE_POSIX_API_REGION_OPTION&& !IS_POSIX_REGION(option)#endif) {r = onig_region_resize_clear(region, reg->num_mem + 1);if (r) goto finish_no_msa;}if (start > end || start < str) goto mismatch_no_msa;#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE#define MATCH_AND_RETURN_CHECK(upper_range) \r = match_at(reg, str, end, (upper_range), s, prev, &msa); \if (r != ONIG_MISMATCH) {\if (r >= 0) {\if (! IS_FIND_LONGEST(reg->options)) {\goto match;\}\}\else goto finish; /* error */ \}#else#define MATCH_AND_RETURN_CHECK(upper_range) \r = match_at(reg, str, end, (upper_range), s, prev, &msa); \if (r != ONIG_MISMATCH) {\if (r >= 0) {\goto match;\}\else goto finish; /* error */ \}#endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */#else#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE#define MATCH_AND_RETURN_CHECK(none) \r = match_at(reg, str, end, s, prev, &msa);\if (r != ONIG_MISMATCH) {\if (r >= 0) {\if (! IS_FIND_LONGEST(reg->options)) {\goto match;\}\}\else goto finish; /* error */ \}#else#define MATCH_AND_RETURN_CHECK(none) \r = match_at(reg, str, end, s, prev, &msa);\if (r != ONIG_MISMATCH) {\if (r >= 0) {\goto match;\}\else goto finish; /* error */ \}#endif /* USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE */#endif /* USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE *//* anchor optimize: resume search range */if (reg->anchor != 0 && str < end) {UChar *min_semi_end, *max_semi_end;if (reg->anchor & ANCHOR_BEGIN_POSITION) {/* search start-position only */begin_position:if (range > start)range = start + 1;elserange = start;}else if (reg->anchor & ANCHOR_BEGIN_BUF) {/* search str-position only */if (range > start) {if (start != str) goto mismatch_no_msa;range = str + 1;}else {if (range <= str) {start = str;range = str;}elsegoto mismatch_no_msa;}}else if (reg->anchor & ANCHOR_END_BUF) {min_semi_end = max_semi_end = (UChar* )end;end_buf:if ((OnigDistance )(max_semi_end - str) < reg->anchor_dmin)goto mismatch_no_msa;if (range > start) {if ((OnigDistance )(min_semi_end - start) > reg->anchor_dmax) {start = min_semi_end - reg->anchor_dmax;if (start < end)start = onigenc_get_right_adjust_char_head(reg->enc, str, start);else { /* match with empty at end */start = onigenc_get_prev_char_head(reg->enc, str, end);}}if ((OnigDistance )(max_semi_end - (range - 1)) < reg->anchor_dmin) {range = max_semi_end - reg->anchor_dmin + 1;}if (start >= range) goto mismatch_no_msa;}else {if ((OnigDistance )(min_semi_end - range) > reg->anchor_dmax) {range = min_semi_end - reg->anchor_dmax;}if ((OnigDistance )(max_semi_end - start) < reg->anchor_dmin) {start = max_semi_end - reg->anchor_dmin;start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, start);}if (range > start) goto mismatch_no_msa;}}else if (reg->anchor & ANCHOR_SEMI_END_BUF) {UChar* pre_end = ONIGENC_STEP_BACK(reg->enc, str, end, 1);max_semi_end = (UChar* )end;if (ONIGENC_IS_MBC_NEWLINE(reg->enc, pre_end, end)) {min_semi_end = pre_end;#ifdef USE_CRNL_AS_LINE_TERMINATORpre_end = ONIGENC_STEP_BACK(reg->enc, str, pre_end, 1);if (IS_NOT_NULL(pre_end) &&ONIGENC_IS_MBC_CRNL(reg->enc, pre_end, end)) {min_semi_end = pre_end;}#endifif (min_semi_end > str && start <= min_semi_end) {goto end_buf;}}else {min_semi_end = (UChar* )end;goto end_buf;}}else if ((reg->anchor & ANCHOR_ANYCHAR_STAR_ML)) {goto begin_position;}}else if (str == end) { /* empty string */static const UChar* address_for_empty_string = (UChar* )"";#ifdef ONIG_DEBUG_SEARCHfprintf(stderr, "onig_search: empty string.\n");#endifif (reg->threshold_len == 0) {start = end = str = address_for_empty_string;s = (UChar* )start;prev = (UChar* )NULL;MATCH_ARG_INIT(msa, option, region, start);#ifdef USE_COMBINATION_EXPLOSION_CHECKmsa.state_check_buff = (void* )0;msa.state_check_buff_size = 0; /* NO NEED, for valgrind */#endifMATCH_AND_RETURN_CHECK(end);goto mismatch;}goto mismatch_no_msa;}#ifdef ONIG_DEBUG_SEARCHfprintf(stderr, "onig_search(apply anchor): end: %d, start: %d, range: %d\n",(int )(end - str), (int )(start - str), (int )(range - str));#endifMATCH_ARG_INIT(msa, option, region, orig_start);#ifdef USE_COMBINATION_EXPLOSION_CHECK{int offset = (MIN(start, range) - str);STATE_CHECK_BUFF_INIT(msa, end - str, offset, reg->num_comb_exp_check);}#endifs = (UChar* )start;if (range > start) { /* forward search */if (s > str)prev = onigenc_get_prev_char_head(reg->enc, str, s);elseprev = (UChar* )NULL;if (reg->optimize != ONIG_OPTIMIZE_NONE) {UChar *sch_range, *low, *high, *low_prev;sch_range = (UChar* )range;if (reg->dmax != 0) {if (reg->dmax == ONIG_INFINITE_DISTANCE)sch_range = (UChar* )end;else {sch_range += reg->dmax;if (sch_range > end) sch_range = (UChar* )end;}}if ((end - start) < reg->threshold_len)goto mismatch;if (reg->dmax != ONIG_INFINITE_DISTANCE) {do {if (! forward_search_range(reg, str, end, s, sch_range,&low, &high, &low_prev)) goto mismatch;if (s < low) {s = low;prev = low_prev;}while (s <= high) {MATCH_AND_RETURN_CHECK(orig_range);prev = s;s += enclen(reg->enc, s);}} while (s < range);goto mismatch;}else { /* check only. */if (! forward_search_range(reg, str, end, s, sch_range,&low, &high, (UChar** )NULL)) goto mismatch;if ((reg->anchor & ANCHOR_ANYCHAR_STAR) != 0) {do {MATCH_AND_RETURN_CHECK(orig_range);prev = s;s += enclen(reg->enc, s);while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) && s < range) {prev = s;s += enclen(reg->enc, s);}} while (s < range);goto mismatch;}}}do {MATCH_AND_RETURN_CHECK(orig_range);prev = s;s += enclen(reg->enc, s);} while (s < range);if (s == range) { /* because empty match with /$/. */MATCH_AND_RETURN_CHECK(orig_range);}}else { /* backward search */#ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGEif (orig_start < end)orig_start += enclen(reg->enc, orig_start); /* is upper range */#endifif (reg->optimize != ONIG_OPTIMIZE_NONE) {UChar *low, *high, *adjrange, *sch_start;if (range < end)adjrange = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, str, range);elseadjrange = (UChar* )end;if (reg->dmax != ONIG_INFINITE_DISTANCE &&(end - range) >= reg->threshold_len) {do {sch_start = s + reg->dmax;if (sch_start > end) sch_start = (UChar* )end;if (backward_search_range(reg, str, end, sch_start, range, adjrange,&low, &high) <= 0)goto mismatch;if (s > high)s = high;while (s >= low) {prev = onigenc_get_prev_char_head(reg->enc, str, s);MATCH_AND_RETURN_CHECK(orig_start);s = prev;}} while (s >= range);goto mismatch;}else { /* check only. */if ((end - range) < reg->threshold_len) goto mismatch;sch_start = s;if (reg->dmax != 0) {if (reg->dmax == ONIG_INFINITE_DISTANCE)sch_start = (UChar* )end;else {sch_start += reg->dmax;if (sch_start > end) sch_start = (UChar* )end;elsesch_start = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc,start, sch_start);}}if (backward_search_range(reg, str, end, sch_start, range, adjrange,&low, &high) <= 0) goto mismatch;}}do {prev = onigenc_get_prev_char_head(reg->enc, str, s);MATCH_AND_RETURN_CHECK(orig_start);s = prev;} while (s >= range);}mismatch:#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGEif (IS_FIND_LONGEST(reg->options)) {if (msa.best_len >= 0) {s = msa.best_s;goto match;}}#endifr = ONIG_MISMATCH;finish:MATCH_ARG_FREE(msa);ONIG_STATE_DEC_THREAD(reg);/* If result is mismatch and no FIND_NOT_EMPTY option,then the region is not setted in match_at(). */if (IS_FIND_NOT_EMPTY(reg->options) && region#ifdef USE_POSIX_API_REGION_OPTION&& !IS_POSIX_REGION(option)#endif) {onig_region_clear(region);}#ifdef ONIG_DEBUGif (r != ONIG_MISMATCH)fprintf(stderr, "onig_search: error %d\n", r);#endifreturn r;mismatch_no_msa:r = ONIG_MISMATCH;finish_no_msa:ONIG_STATE_DEC_THREAD(reg);#ifdef ONIG_DEBUGif (r != ONIG_MISMATCH)fprintf(stderr, "onig_search: error %d\n", r);#endifreturn r;match:ONIG_STATE_DEC_THREAD(reg);MATCH_ARG_FREE(msa);return s - str;}extern OnigEncodingonig_get_encoding(regex_t* reg){return reg->enc;}extern OnigOptionTypeonig_get_options(regex_t* reg){return reg->options;}extern OnigCaseFoldTypeonig_get_case_fold_flag(regex_t* reg){return reg->case_fold_flag;}extern OnigSyntaxType*onig_get_syntax(regex_t* reg){return reg->syntax;}extern intonig_number_of_captures(regex_t* reg){return reg->num_mem;}extern intonig_number_of_capture_histories(regex_t* reg){#ifdef USE_CAPTURE_HISTORYint i, n;n = 0;for (i = 0; i <= ONIG_MAX_CAPTURE_HISTORY_GROUP; i++) {if (BIT_STATUS_AT(reg->capture_history, i) != 0)n++;}return n;#elsereturn 0;#endif}extern voidonig_copy_encoding(OnigEncoding to, OnigEncoding from){*to = *from;}
/**********************************************************************regext.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"static voidconv_ext0be32(const UChar* s, const UChar* end, UChar* conv){while (s < end) {*conv++ = '\0';*conv++ = '\0';*conv++ = '\0';*conv++ = *s++;}}static voidconv_ext0le32(const UChar* s, const UChar* end, UChar* conv){while (s < end) {*conv++ = *s++;*conv++ = '\0';*conv++ = '\0';*conv++ = '\0';}}static voidconv_ext0be(const UChar* s, const UChar* end, UChar* conv){while (s < end) {*conv++ = '\0';*conv++ = *s++;}}static voidconv_ext0le(const UChar* s, const UChar* end, UChar* conv){while (s < end) {*conv++ = *s++;*conv++ = '\0';}}static voidconv_swap4bytes(const UChar* s, const UChar* end, UChar* conv){while (s < end) {*conv++ = s[3];*conv++ = s[2];*conv++ = s[1];*conv++ = s[0];s += 4;}}static voidconv_swap2bytes(const UChar* s, const UChar* end, UChar* conv){while (s < end) {*conv++ = s[1];*conv++ = s[0];s += 2;}}static intconv_encoding(OnigEncoding from, OnigEncoding to, const UChar* s, const UChar* end,UChar** conv, UChar** conv_end){int len = end - s;if (to == ONIG_ENCODING_UTF16_BE) {if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) {*conv = (UChar* )xmalloc(len * 2);CHECK_NULL_RETURN_MEMERR(*conv);*conv_end = *conv + (len * 2);conv_ext0be(s, end, *conv);return 0;}else if (from == ONIG_ENCODING_UTF16_LE) {swap16:*conv = (UChar* )xmalloc(len);CHECK_NULL_RETURN_MEMERR(*conv);*conv_end = *conv + len;conv_swap2bytes(s, end, *conv);return 0;}}else if (to == ONIG_ENCODING_UTF16_LE) {if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) {*conv = (UChar* )xmalloc(len * 2);CHECK_NULL_RETURN_MEMERR(*conv);*conv_end = *conv + (len * 2);conv_ext0le(s, end, *conv);return 0;}else if (from == ONIG_ENCODING_UTF16_BE) {goto swap16;}}if (to == ONIG_ENCODING_UTF32_BE) {if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) {*conv = (UChar* )xmalloc(len * 4);CHECK_NULL_RETURN_MEMERR(*conv);*conv_end = *conv + (len * 4);conv_ext0be32(s, end, *conv);return 0;}else if (from == ONIG_ENCODING_UTF32_LE) {swap32:*conv = (UChar* )xmalloc(len);CHECK_NULL_RETURN_MEMERR(*conv);*conv_end = *conv + len;conv_swap4bytes(s, end, *conv);return 0;}}else if (to == ONIG_ENCODING_UTF32_LE) {if (from == ONIG_ENCODING_ASCII || from == ONIG_ENCODING_ISO_8859_1) {*conv = (UChar* )xmalloc(len * 4);CHECK_NULL_RETURN_MEMERR(*conv);*conv_end = *conv + (len * 4);conv_ext0le32(s, end, *conv);return 0;}else if (from == ONIG_ENCODING_UTF32_BE) {goto swap32;}}return ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION;}extern intonig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,OnigCompileInfo* ci, OnigErrorInfo* einfo){int r;UChar *cpat, *cpat_end;if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;if (ci->pattern_enc != ci->target_enc) {r = conv_encoding(ci->pattern_enc, ci->target_enc, pattern, pattern_end,&cpat, &cpat_end);if (r) return r;}else {cpat = (UChar* )pattern;cpat_end = (UChar* )pattern_end;}*reg = (regex_t* )xmalloc(sizeof(regex_t));if (IS_NULL(*reg)) {r = ONIGERR_MEMORY;goto err2;}r = onig_reg_init(*reg, ci->option, ci->case_fold_flag, ci->target_enc,ci->syntax);if (r) goto err;r = onig_compile(*reg, cpat, cpat_end, einfo);if (r) {err:onig_free(*reg);*reg = NULL;}err2:if (cpat != pattern) xfree(cpat);return r;}#ifdef USE_RECOMPILE_APIextern intonig_recompile_deluxe(regex_t* reg, const UChar* pattern, const UChar* pattern_end,OnigCompileInfo* ci, OnigErrorInfo* einfo){int r;regex_t *new_reg;r = onig_new_deluxe(&new_reg, pattern, pattern_end, ci, einfo);if (r) return r;if (ONIG_STATE(reg) == ONIG_STATE_NORMAL) {onig_transfer(reg, new_reg);}else {onig_chain_link_add(reg, new_reg);}return 0;}#endif
/**********************************************************************reggnu.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"#ifndef ONIGGNU_H#include "oniggnu.h"#endifextern voidre_free_registers(OnigRegion* r){/* 0: don't free self */onig_region_free(r, 0);}extern intre_adjust_startpos(regex_t* reg, const char* string, int size,int startpos, int range){if (startpos > 0 && ONIGENC_MBC_MAXLEN(reg->enc) != 1 && startpos < size) {UChar *p;UChar *s = (UChar* )string + startpos;if (range > 0) {p = onigenc_get_right_adjust_char_head(reg->enc, (UChar* )string, s);}else {p = ONIGENC_LEFT_ADJUST_CHAR_HEAD(reg->enc, (UChar* )string, s);}return p - (UChar* )string;}return startpos;}extern intre_match(regex_t* reg, const char* str, int size, int pos,struct re_registers* regs){return onig_match(reg, (UChar* )str, (UChar* )(str + size),(UChar* )(str + pos), regs, ONIG_OPTION_NONE);}extern intre_search(regex_t* bufp, const char* string, int size, int startpos, int range,struct re_registers* regs){return onig_search(bufp, (UChar* )string, (UChar* )(string + size),(UChar* )(string + startpos),(UChar* )(string + startpos + range),regs, ONIG_OPTION_NONE);}extern intre_compile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf){int r;OnigErrorInfo einfo;r = onig_compile(reg, (UChar* )pattern, (UChar* )(pattern + size), &einfo);if (r != ONIG_NORMAL) {if (IS_NOT_NULL(ebuf))(void )onig_error_code_to_str((UChar* )ebuf, r, &einfo);}return r;}#ifdef USE_RECOMPILE_APIextern intre_recompile_pattern(const char* pattern, int size, regex_t* reg, char* ebuf){int r;OnigErrorInfo einfo;OnigEncoding enc;/* I think encoding and options should be arguments of this function.But this is adapted to present re.c. (2002/11/29)*/enc = OnigEncDefaultCharEncoding;r = onig_recompile(reg, (UChar* )pattern, (UChar* )(pattern + size),reg->options, enc, OnigDefaultSyntax, &einfo);if (r != ONIG_NORMAL) {if (IS_NOT_NULL(ebuf))(void )onig_error_code_to_str((UChar* )ebuf, r, &einfo);}return r;}#endifextern voidre_free_pattern(regex_t* reg){onig_free(reg);}extern intre_alloc_pattern(regex_t** reg){*reg = (regex_t* )xmalloc(sizeof(regex_t));if (IS_NULL(*reg)) return ONIGERR_MEMORY;return onig_reg_init(*reg, ONIG_OPTION_DEFAULT,ONIGENC_CASE_FOLD_DEFAULT,OnigEncDefaultCharEncoding,OnigDefaultSyntax);}extern voidre_set_casetable(const char* table){onigenc_set_default_caseconv_table((UChar* )table);}extern voidre_mbcinit(int mb_code){OnigEncoding enc;switch (mb_code) {case RE_MBCTYPE_ASCII:enc = ONIG_ENCODING_ASCII;break;case RE_MBCTYPE_EUC:enc = ONIG_ENCODING_EUC_JP;break;case RE_MBCTYPE_SJIS:enc = ONIG_ENCODING_SJIS;break;case RE_MBCTYPE_UTF8:enc = ONIG_ENCODING_UTF8;break;default:return ;break;}onigenc_set_default_encoding(enc);}
#ifndef REGINT_H#define REGINT_H/**********************************************************************regint.h - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*//* for debug *//* #define ONIG_DEBUG_PARSE_TREE *//* #define ONIG_DEBUG_COMPILE *//* #define ONIG_DEBUG_SEARCH *//* #define ONIG_DEBUG_MATCH *//* #define ONIG_DONT_OPTIMIZE *//* for byte-code statistical data. *//* #define ONIG_DEBUG_STATISTICS */#if defined(ONIG_DEBUG_PARSE_TREE) || defined(ONIG_DEBUG_MATCH) || \defined(ONIG_DEBUG_SEARCH) || defined(ONIG_DEBUG_COMPILE) || \defined(ONIG_DEBUG_STATISTICS)#ifndef ONIG_DEBUG#define ONIG_DEBUG#endif#endif#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \(defined(__ppc__) && defined(__APPLE__)) || \defined(__x86_64) || defined(__x86_64__) || \defined(__mc68020__)#define PLATFORM_UNALIGNED_WORD_ACCESS#endif/* config *//* spec. config */#define USE_NAMED_GROUP#define USE_SUBEXP_CALL#define USE_BACKREF_WITH_LEVEL /* \k<name+n>, \k<name-n> */#define USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR/* #define USE_RECOMPILE_API *//* !!! moved to regenc.h. */ /* #define USE_CRNL_AS_LINE_TERMINATOR *//* internal config */#define USE_PARSE_TREE_NODE_RECYCLE#define USE_OP_PUSH_OR_JUMP_EXACT#define USE_QTFR_PEEK_NEXT#define USE_ST_LIBRARY#define USE_SHARED_CCLASS_TABLE#define INIT_MATCH_STACK_SIZE 160#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */#if defined(__GNUC__)# define ARG_UNUSED __attribute__ ((unused))#else# define ARG_UNUSED#endif/* *//* escape other system UChar definition */#include "config.h"#ifdef ONIG_ESCAPE_UCHAR_COLLISION#undef ONIG_ESCAPE_UCHAR_COLLISION#endif#define USE_WORD_BEGIN_END /* "\<", "\>" */#define USE_CAPTURE_HISTORY#define USE_VARIABLE_META_CHARS#define USE_POSIX_API_REGION_OPTION#define USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE/* #define USE_COMBINATION_EXPLOSION_CHECK */ /* (X*)* *//* #define USE_MULTI_THREAD_SYSTEM */#define THREAD_SYSTEM_INIT /* depend on thread system */#define THREAD_SYSTEM_END /* depend on thread system */#define THREAD_ATOMIC_START /* depend on thread system */#define THREAD_ATOMIC_END /* depend on thread system */#define THREAD_PASS /* depend on thread system */#define xmalloc malloc#define xrealloc realloc#define xcalloc calloc#define xfree free#define CHECK_INTERRUPT_IN_MATCH_AT#define st_init_table onig_st_init_table#define st_init_table_with_size onig_st_init_table_with_size#define st_init_numtable onig_st_init_numtable#define st_init_numtable_with_size onig_st_init_numtable_with_size#define st_init_strtable onig_st_init_strtable#define st_init_strtable_with_size onig_st_init_strtable_with_size#define st_delete onig_st_delete#define st_delete_safe onig_st_delete_safe#define st_insert onig_st_insert#define st_lookup onig_st_lookup#define st_foreach onig_st_foreach#define st_add_direct onig_st_add_direct#define st_free_table onig_st_free_table#define st_cleanup_safe onig_st_cleanup_safe#define st_copy onig_st_copy#define st_nothing_key_clone onig_st_nothing_key_clone#define st_nothing_key_free onig_st_nothing_key_free/* */#define onig_st_is_member st_is_member#define STATE_CHECK_STRING_THRESHOLD_LEN 7#define STATE_CHECK_BUFF_MAX_SIZE 0x4000#define THREAD_PASS_LIMIT_COUNT 8#define xmemset memset#define xmemcpy memcpy#define xmemmove memmove#if defined(_WIN32) && !defined(__GNUC__)#define xalloca _alloca#define xvsnprintf _vsnprintf#else#define xalloca alloca#define xvsnprintf vsnprintf#endif#if defined(USE_RECOMPILE_API) && defined(USE_MULTI_THREAD_SYSTEM)#define ONIG_STATE_INC(reg) (reg)->state++#define ONIG_STATE_DEC(reg) (reg)->state--#define ONIG_STATE_INC_THREAD(reg) do {\THREAD_ATOMIC_START;\(reg)->state++;\THREAD_ATOMIC_END;\} while(0)#define ONIG_STATE_DEC_THREAD(reg) do {\THREAD_ATOMIC_START;\(reg)->state--;\THREAD_ATOMIC_END;\} while(0)#else#define ONIG_STATE_INC(reg) /* Nothing */#define ONIG_STATE_DEC(reg) /* Nothing */#define ONIG_STATE_INC_THREAD(reg) /* Nothing */#define ONIG_STATE_DEC_THREAD(reg) /* Nothing */#endif /* USE_RECOMPILE_API && USE_MULTI_THREAD_SYSTEM */#ifdef HAVE_STDLIB_H#include <stdlib.h>#endif#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)#include <alloca.h>#endif#ifdef HAVE_STRING_H# include <string.h>#else# include <strings.h>#endif#include <ctype.h>#ifdef HAVE_SYS_TYPES_H#ifndef __BORLANDC__#include <sys/types.h>#endif#endif#ifdef __BORLANDC__#include <malloc.h>#endif#ifdef ONIG_DEBUG# include <stdio.h>#endif#include "regenc.h"#ifdef MIN#undef MIN#endif#ifdef MAX#undef MAX#endif#define MIN(a,b) (((a)>(b))?(b):(a))#define MAX(a,b) (((a)<(b))?(b):(a))#define IS_NULL(p) (((void*)(p)) == (void*)0)#define IS_NOT_NULL(p) (((void*)(p)) != (void*)0)#define CHECK_NULL_RETURN(p) if (IS_NULL(p)) return NULL#define CHECK_NULL_RETURN_MEMERR(p) if (IS_NULL(p)) return ONIGERR_MEMORY#define NULL_UCHARP ((UChar* )0)#ifdef PLATFORM_UNALIGNED_WORD_ACCESS#define PLATFORM_GET_INC(val,p,type) do{\val = *(type* )p;\(p) += sizeof(type);\} while(0)#else#define PLATFORM_GET_INC(val,p,type) do{\xmemcpy(&val, (p), sizeof(type));\(p) += sizeof(type);\} while(0)/* sizeof(OnigCodePoint) */#define WORD_ALIGNMENT_SIZE SIZEOF_LONG#define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\(pad_size) = WORD_ALIGNMENT_SIZE \- ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\} while (0)#define ALIGNMENT_RIGHT(addr) do {\(addr) += (WORD_ALIGNMENT_SIZE - 1);\(addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\} while (0)#endif /* PLATFORM_UNALIGNED_WORD_ACCESS *//* stack pop level */#define STACK_POP_LEVEL_FREE 0#define STACK_POP_LEVEL_MEM_START 1#define STACK_POP_LEVEL_ALL 2/* optimize flags */#define ONIG_OPTIMIZE_NONE 0#define ONIG_OPTIMIZE_EXACT 1 /* Slow Search */#define ONIG_OPTIMIZE_EXACT_BM 2 /* Boyer Moore Search */#define ONIG_OPTIMIZE_EXACT_BM_NOT_REV 3 /* BM (but not simple match) */#define ONIG_OPTIMIZE_EXACT_IC 4 /* Slow Search (ignore case) */#define ONIG_OPTIMIZE_MAP 5 /* char map *//* bit status */typedef unsigned int BitStatusType;#define BIT_STATUS_BITS_NUM (sizeof(BitStatusType) * 8)#define BIT_STATUS_CLEAR(stats) (stats) = 0#define BIT_STATUS_ON_ALL(stats) (stats) = ~((BitStatusType )0)#define BIT_STATUS_AT(stats,n) \((n) < (int )BIT_STATUS_BITS_NUM ? ((stats) & (1 << n)) : ((stats) & 1))#define BIT_STATUS_ON_AT(stats,n) do {\if ((n) < (int )BIT_STATUS_BITS_NUM) \(stats) |= (1 << (n));\else\(stats) |= 1;\} while (0)#define BIT_STATUS_ON_AT_SIMPLE(stats,n) do {\if ((n) < (int )BIT_STATUS_BITS_NUM)\(stats) |= (1 << (n));\} while (0)#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1)#define DIGITVAL(code) ((code) - '0')#define ODIGITVAL(code) DIGITVAL(code)#define XDIGITVAL(enc,code) \(ONIGENC_IS_CODE_DIGIT(enc,code) ? DIGITVAL(code) \: (ONIGENC_IS_CODE_UPPER(enc,code) ? (code) - 'A' + 10 : (code) - 'a' + 10))#define IS_SINGLELINE(option) ((option) & ONIG_OPTION_SINGLELINE)#define IS_MULTILINE(option) ((option) & ONIG_OPTION_MULTILINE)#define IS_IGNORECASE(option) ((option) & ONIG_OPTION_IGNORECASE)#define IS_EXTEND(option) ((option) & ONIG_OPTION_EXTEND)#define IS_FIND_LONGEST(option) ((option) & ONIG_OPTION_FIND_LONGEST)#define IS_FIND_NOT_EMPTY(option) ((option) & ONIG_OPTION_FIND_NOT_EMPTY)#define IS_FIND_CONDITION(option) ((option) & \(ONIG_OPTION_FIND_LONGEST | ONIG_OPTION_FIND_NOT_EMPTY))#define IS_NOTBOL(option) ((option) & ONIG_OPTION_NOTBOL)#define IS_NOTEOL(option) ((option) & ONIG_OPTION_NOTEOL)#define IS_POSIX_REGION(option) ((option) & ONIG_OPTION_POSIX_REGION)/* OP_SET_OPTION is required for these options.#define IS_DYNAMIC_OPTION(option) \(((option) & (ONIG_OPTION_MULTILINE | ONIG_OPTION_IGNORECASE)) != 0)*//* ignore-case and multibyte status are included in compiled code. */#define IS_DYNAMIC_OPTION(option) 0#define DISABLE_CASE_FOLD_MULTI_CHAR(case_fold_flag) \((case_fold_flag) & ~INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR)#define REPEAT_INFINITE -1#define IS_REPEAT_INFINITE(n) ((n) == REPEAT_INFINITE)/* bitset */#define BITS_PER_BYTE 8#define SINGLE_BYTE_SIZE (1 << BITS_PER_BYTE)#define BITS_IN_ROOM (sizeof(Bits) * BITS_PER_BYTE)#define BITSET_SIZE (SINGLE_BYTE_SIZE / BITS_IN_ROOM)#ifdef PLATFORM_UNALIGNED_WORD_ACCESStypedef unsigned int Bits;#elsetypedef unsigned char Bits;#endiftypedef Bits BitSet[BITSET_SIZE];typedef Bits* BitSetRef;#define SIZE_BITSET sizeof(BitSet)#define BITSET_CLEAR(bs) do {\int i;\for (i = 0; i < (int )BITSET_SIZE; i++) { (bs)[i] = 0; } \} while (0)#define BS_ROOM(bs,pos) (bs)[pos / BITS_IN_ROOM]#define BS_BIT(pos) (1 << (pos % BITS_IN_ROOM))#define BITSET_AT(bs, pos) (BS_ROOM(bs,pos) & BS_BIT(pos))#define BITSET_SET_BIT(bs, pos) BS_ROOM(bs,pos) |= BS_BIT(pos)#define BITSET_CLEAR_BIT(bs, pos) BS_ROOM(bs,pos) &= ~(BS_BIT(pos))#define BITSET_INVERT_BIT(bs, pos) BS_ROOM(bs,pos) ^= BS_BIT(pos)/* bytes buffer */typedef struct _BBuf {UChar* p;unsigned int used;unsigned int alloc;} BBuf;#define BBUF_INIT(buf,size) onig_bbuf_init((BBuf* )(buf), (size))#define BBUF_SIZE_INC(buf,inc) do{\(buf)->alloc += (inc);\(buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\} while (0)#define BBUF_EXPAND(buf,low) do{\do { (buf)->alloc *= 2; } while ((buf)->alloc < (unsigned int )low);\(buf)->p = (UChar* )xrealloc((buf)->p, (buf)->alloc);\if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\} while (0)#define BBUF_ENSURE_SIZE(buf,size) do{\unsigned int new_alloc = (buf)->alloc;\while (new_alloc < (unsigned int )(size)) { new_alloc *= 2; }\if ((buf)->alloc != new_alloc) {\(buf)->p = (UChar* )xrealloc((buf)->p, new_alloc);\if (IS_NULL((buf)->p)) return(ONIGERR_MEMORY);\(buf)->alloc = new_alloc;\}\} while (0)#define BBUF_WRITE(buf,pos,bytes,n) do{\int used = (pos) + (n);\if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\xmemcpy((buf)->p + (pos), (bytes), (n));\if ((buf)->used < (unsigned int )used) (buf)->used = used;\} while (0)#define BBUF_WRITE1(buf,pos,byte) do{\int used = (pos) + 1;\if ((buf)->alloc < (unsigned int )used) BBUF_EXPAND((buf),used);\(buf)->p[(pos)] = (byte);\if ((buf)->used < (unsigned int )used) (buf)->used = used;\} while (0)#define BBUF_ADD(buf,bytes,n) BBUF_WRITE((buf),(buf)->used,(bytes),(n))#define BBUF_ADD1(buf,byte) BBUF_WRITE1((buf),(buf)->used,(byte))#define BBUF_GET_ADD_ADDRESS(buf) ((buf)->p + (buf)->used)#define BBUF_GET_OFFSET_POS(buf) ((buf)->used)/* from < to */#define BBUF_MOVE_RIGHT(buf,from,to,n) do {\if ((unsigned int )((to)+(n)) > (buf)->alloc) BBUF_EXPAND((buf),(to) + (n));\xmemmove((buf)->p + (to), (buf)->p + (from), (n));\if ((unsigned int )((to)+(n)) > (buf)->used) (buf)->used = (to) + (n);\} while (0)/* from > to */#define BBUF_MOVE_LEFT(buf,from,to,n) do {\xmemmove((buf)->p + (to), (buf)->p + (from), (n));\} while (0)/* from > to */#define BBUF_MOVE_LEFT_REDUCE(buf,from,to) do {\xmemmove((buf)->p + (to), (buf)->p + (from), (buf)->used - (from));\(buf)->used -= (from - to);\} while (0)#define BBUF_INSERT(buf,pos,bytes,n) do {\if (pos >= (buf)->used) {\BBUF_WRITE(buf,pos,bytes,n);\}\else {\BBUF_MOVE_RIGHT((buf),(pos),(pos) + (n),((buf)->used - (pos)));\xmemcpy((buf)->p + (pos), (bytes), (n));\}\} while (0)#define BBUF_GET_BYTE(buf, pos) (buf)->p[(pos)]#define ANCHOR_BEGIN_BUF (1<<0)#define ANCHOR_BEGIN_LINE (1<<1)#define ANCHOR_BEGIN_POSITION (1<<2)#define ANCHOR_END_BUF (1<<3)#define ANCHOR_SEMI_END_BUF (1<<4)#define ANCHOR_END_LINE (1<<5)#define ANCHOR_WORD_BOUND (1<<6)#define ANCHOR_NOT_WORD_BOUND (1<<7)#define ANCHOR_WORD_BEGIN (1<<8)#define ANCHOR_WORD_END (1<<9)#define ANCHOR_PREC_READ (1<<10)#define ANCHOR_PREC_READ_NOT (1<<11)#define ANCHOR_LOOK_BEHIND (1<<12)#define ANCHOR_LOOK_BEHIND_NOT (1<<13)#define ANCHOR_ANYCHAR_STAR (1<<14) /* ".*" optimize info */#define ANCHOR_ANYCHAR_STAR_ML (1<<15) /* ".*" optimize info (multi-line) *//* operation code */enum OpCode {OP_FINISH = 0, /* matching process terminator (no more alternative) */OP_END = 1, /* pattern code terminator (success end) */OP_EXACT1 = 2, /* single byte, N = 1 */OP_EXACT2, /* single byte, N = 2 */OP_EXACT3, /* single byte, N = 3 */OP_EXACT4, /* single byte, N = 4 */OP_EXACT5, /* single byte, N = 5 */OP_EXACTN, /* single byte */OP_EXACTMB2N1, /* mb-length = 2 N = 1 */OP_EXACTMB2N2, /* mb-length = 2 N = 2 */OP_EXACTMB2N3, /* mb-length = 2 N = 3 */OP_EXACTMB2N, /* mb-length = 2 */OP_EXACTMB3N, /* mb-length = 3 */OP_EXACTMBN, /* other length */OP_EXACT1_IC, /* single byte, N = 1, ignore case */OP_EXACTN_IC, /* single byte, ignore case */OP_CCLASS,OP_CCLASS_MB,OP_CCLASS_MIX,OP_CCLASS_NOT,OP_CCLASS_MB_NOT,OP_CCLASS_MIX_NOT,OP_CCLASS_NODE, /* pointer to CClassNode node */OP_ANYCHAR, /* "." */OP_ANYCHAR_ML, /* "." multi-line */OP_ANYCHAR_STAR, /* ".*" */OP_ANYCHAR_ML_STAR, /* ".*" multi-line */OP_ANYCHAR_STAR_PEEK_NEXT,OP_ANYCHAR_ML_STAR_PEEK_NEXT,OP_WORD,OP_NOT_WORD,OP_WORD_BOUND,OP_NOT_WORD_BOUND,OP_WORD_BEGIN,OP_WORD_END,OP_BEGIN_BUF,OP_END_BUF,OP_BEGIN_LINE,OP_END_LINE,OP_SEMI_END_BUF,OP_BEGIN_POSITION,OP_BACKREF1,OP_BACKREF2,OP_BACKREFN,OP_BACKREFN_IC,OP_BACKREF_MULTI,OP_BACKREF_MULTI_IC,OP_BACKREF_WITH_LEVEL, /* \k<xxx+n>, \k<xxx-n> */OP_MEMORY_START,OP_MEMORY_START_PUSH, /* push back-tracker to stack */OP_MEMORY_END_PUSH, /* push back-tracker to stack */OP_MEMORY_END_PUSH_REC, /* push back-tracker to stack */OP_MEMORY_END,OP_MEMORY_END_REC, /* push marker to stack */OP_FAIL, /* pop stack and move */OP_JUMP,OP_PUSH,OP_POP,OP_PUSH_OR_JUMP_EXACT1, /* if match exact then push, else jump. */OP_PUSH_IF_PEEK_NEXT, /* if match exact then push, else none. */OP_REPEAT, /* {n,m} */OP_REPEAT_NG, /* {n,m}? (non greedy) */OP_REPEAT_INC,OP_REPEAT_INC_NG, /* non greedy */OP_REPEAT_INC_SG, /* search and get in stack */OP_REPEAT_INC_NG_SG, /* search and get in stack (non greedy) */OP_NULL_CHECK_START, /* null loop checker start */OP_NULL_CHECK_END, /* null loop checker end */OP_NULL_CHECK_END_MEMST, /* null loop checker end (with capture status) */OP_NULL_CHECK_END_MEMST_PUSH, /* with capture status and push check-end */OP_PUSH_POS, /* (?=...) start */OP_POP_POS, /* (?=...) end */OP_PUSH_POS_NOT, /* (?!...) start */OP_FAIL_POS, /* (?!...) end */OP_PUSH_STOP_BT, /* (?>...) start */OP_POP_STOP_BT, /* (?>...) end */OP_LOOK_BEHIND, /* (?<=...) start (no needs end opcode) */OP_PUSH_LOOK_BEHIND_NOT, /* (?<!...) start */OP_FAIL_LOOK_BEHIND_NOT, /* (?<!...) end */OP_CALL, /* \g<name> */OP_RETURN,OP_STATE_CHECK_PUSH, /* combination explosion check and push */OP_STATE_CHECK_PUSH_OR_JUMP, /* check ok -> push, else jump */OP_STATE_CHECK, /* check only */OP_STATE_CHECK_ANYCHAR_STAR,OP_STATE_CHECK_ANYCHAR_ML_STAR,/* no need: IS_DYNAMIC_OPTION() == 0 */OP_SET_OPTION_PUSH, /* set option and push recover option */OP_SET_OPTION /* set option */};typedef int RelAddrType;typedef int AbsAddrType;typedef int LengthType;typedef int RepeatNumType;typedef short int MemNumType;typedef short int StateCheckNumType;typedef void* PointerType;#define SIZE_OPCODE 1#define SIZE_RELADDR sizeof(RelAddrType)#define SIZE_ABSADDR sizeof(AbsAddrType)#define SIZE_LENGTH sizeof(LengthType)#define SIZE_MEMNUM sizeof(MemNumType)#define SIZE_STATE_CHECK_NUM sizeof(StateCheckNumType)#define SIZE_REPEATNUM sizeof(RepeatNumType)#define SIZE_OPTION sizeof(OnigOptionType)#define SIZE_CODE_POINT sizeof(OnigCodePoint)#define SIZE_POINTER sizeof(PointerType)#define GET_RELADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, RelAddrType)#define GET_ABSADDR_INC(addr,p) PLATFORM_GET_INC(addr, p, AbsAddrType)#define GET_LENGTH_INC(len,p) PLATFORM_GET_INC(len, p, LengthType)#define GET_MEMNUM_INC(num,p) PLATFORM_GET_INC(num, p, MemNumType)#define GET_REPEATNUM_INC(num,p) PLATFORM_GET_INC(num, p, RepeatNumType)#define GET_OPTION_INC(option,p) PLATFORM_GET_INC(option, p, OnigOptionType)#define GET_POINTER_INC(ptr,p) PLATFORM_GET_INC(ptr, p, PointerType)#define GET_STATE_CHECK_NUM_INC(num,p) PLATFORM_GET_INC(num, p, StateCheckNumType)/* code point's address must be aligned address. */#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p))#define GET_BYTE_INC(byte,p) do{\byte = *(p);\(p)++;\} while(0)/* op-code + arg size */#define SIZE_OP_ANYCHAR_STAR SIZE_OPCODE#define SIZE_OP_ANYCHAR_STAR_PEEK_NEXT (SIZE_OPCODE + 1)#define SIZE_OP_JUMP (SIZE_OPCODE + SIZE_RELADDR)#define SIZE_OP_PUSH (SIZE_OPCODE + SIZE_RELADDR)#define SIZE_OP_POP SIZE_OPCODE#define SIZE_OP_PUSH_OR_JUMP_EXACT1 (SIZE_OPCODE + SIZE_RELADDR + 1)#define SIZE_OP_PUSH_IF_PEEK_NEXT (SIZE_OPCODE + SIZE_RELADDR + 1)#define SIZE_OP_REPEAT_INC (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_REPEAT_INC_NG (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_PUSH_POS SIZE_OPCODE#define SIZE_OP_PUSH_POS_NOT (SIZE_OPCODE + SIZE_RELADDR)#define SIZE_OP_POP_POS SIZE_OPCODE#define SIZE_OP_FAIL_POS SIZE_OPCODE#define SIZE_OP_SET_OPTION (SIZE_OPCODE + SIZE_OPTION)#define SIZE_OP_SET_OPTION_PUSH (SIZE_OPCODE + SIZE_OPTION)#define SIZE_OP_FAIL SIZE_OPCODE#define SIZE_OP_MEMORY_START (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_MEMORY_START_PUSH (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_MEMORY_END_PUSH (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_MEMORY_END_PUSH_REC (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_MEMORY_END (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_MEMORY_END_REC (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_PUSH_STOP_BT SIZE_OPCODE#define SIZE_OP_POP_STOP_BT SIZE_OPCODE#define SIZE_OP_NULL_CHECK_START (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_NULL_CHECK_END (SIZE_OPCODE + SIZE_MEMNUM)#define SIZE_OP_LOOK_BEHIND (SIZE_OPCODE + SIZE_LENGTH)#define SIZE_OP_PUSH_LOOK_BEHIND_NOT (SIZE_OPCODE + SIZE_RELADDR + SIZE_LENGTH)#define SIZE_OP_FAIL_LOOK_BEHIND_NOT SIZE_OPCODE#define SIZE_OP_CALL (SIZE_OPCODE + SIZE_ABSADDR)#define SIZE_OP_RETURN SIZE_OPCODE#ifdef USE_COMBINATION_EXPLOSION_CHECK#define SIZE_OP_STATE_CHECK (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)#define SIZE_OP_STATE_CHECK_PUSH (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)#define SIZE_OP_STATE_CHECK_PUSH_OR_JUMP (SIZE_OPCODE + SIZE_STATE_CHECK_NUM + SIZE_RELADDR)#define SIZE_OP_STATE_CHECK_ANYCHAR_STAR (SIZE_OPCODE + SIZE_STATE_CHECK_NUM)#endif#define MC_ESC(syn) (syn)->meta_char_table.esc#define MC_ANYCHAR(syn) (syn)->meta_char_table.anychar#define MC_ANYTIME(syn) (syn)->meta_char_table.anytime#define MC_ZERO_OR_ONE_TIME(syn) (syn)->meta_char_table.zero_or_one_time#define MC_ONE_OR_MORE_TIME(syn) (syn)->meta_char_table.one_or_more_time#define MC_ANYCHAR_ANYTIME(syn) (syn)->meta_char_table.anychar_anytime#define IS_MC_ESC_CODE(code, syn) \((code) == MC_ESC(syn) && \!IS_SYNTAX_OP2((syn), ONIG_SYN_OP2_INEFFECTIVE_ESCAPE))#define SYN_POSIX_COMMON_OP \( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_POSIX_BRACKET | \ONIG_SYN_OP_DECIMAL_BACKREF | \ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_ASTERISK_ZERO_INF | \ONIG_SYN_OP_LINE_ANCHOR | \ONIG_SYN_OP_ESC_CONTROL_CHARS )#define SYN_GNU_REGEX_OP \( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | \ONIG_SYN_OP_POSIX_BRACKET | ONIG_SYN_OP_DECIMAL_BACKREF | \ONIG_SYN_OP_BRACE_INTERVAL | ONIG_SYN_OP_LPAREN_SUBEXP | \ONIG_SYN_OP_VBAR_ALT | \ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF | \ONIG_SYN_OP_QMARK_ZERO_ONE | \ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR | ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR | \ONIG_SYN_OP_ESC_W_WORD | \ONIG_SYN_OP_ESC_B_WORD_BOUND | ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | \ONIG_SYN_OP_ESC_S_WHITE_SPACE | ONIG_SYN_OP_ESC_D_DIGIT | \ONIG_SYN_OP_LINE_ANCHOR )#define SYN_GNU_REGEX_BV \( ONIG_SYN_CONTEXT_INDEP_ANCHORS | ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | \ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS | ONIG_SYN_ALLOW_INVALID_INTERVAL | \ONIG_SYN_BACKSLASH_ESCAPE_IN_CC | ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC )#define NCCLASS_FLAGS(cc) ((cc)->flags)#define NCCLASS_FLAG_SET(cc,flag) (NCCLASS_FLAGS(cc) |= (flag))#define NCCLASS_FLAG_CLEAR(cc,flag) (NCCLASS_FLAGS(cc) &= ~(flag))#define IS_NCCLASS_FLAG_ON(cc,flag) ((NCCLASS_FLAGS(cc) & (flag)) != 0)/* cclass node */#define FLAG_NCCLASS_NOT (1<<0)#define FLAG_NCCLASS_SHARE (1<<1)#define NCCLASS_SET_NOT(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_NOT)#define NCCLASS_SET_SHARE(nd) NCCLASS_FLAG_SET(nd, FLAG_NCCLASS_SHARE)#define NCCLASS_CLEAR_NOT(nd) NCCLASS_FLAG_CLEAR(nd, FLAG_NCCLASS_NOT)#define IS_NCCLASS_NOT(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_NOT)#define IS_NCCLASS_SHARE(nd) IS_NCCLASS_FLAG_ON(nd, FLAG_NCCLASS_SHARE)typedef struct {int type;/* struct _Node* next; *//* unsigned int flags; */} NodeBase;typedef struct {NodeBase base;unsigned int flags;BitSet bs;BBuf* mbuf; /* multi-byte info or NULL */} CClassNode;typedef long OnigStackIndex;typedef struct _OnigStackType {unsigned int type;union {struct {UChar *pcode; /* byte code position */UChar *pstr; /* string position */UChar *pstr_prev; /* previous char position of pstr */#ifdef USE_COMBINATION_EXPLOSION_CHECKunsigned int state_check;#endif} state;struct {int count; /* for OP_REPEAT_INC, OP_REPEAT_INC_NG */UChar *pcode; /* byte code position (head of repeated target) */int num; /* repeat id */} repeat;struct {OnigStackIndex si; /* index of stack */} repeat_inc;struct {int num; /* memory num */UChar *pstr; /* start/end position *//* Following information is setted, if this stack type is MEM-START */OnigStackIndex start; /* prev. info (for backtrack "(...)*" ) */OnigStackIndex end; /* prev. info (for backtrack "(...)*" ) */} mem;struct {int num; /* null check id */UChar *pstr; /* start position */} null_check;#ifdef USE_SUBEXP_CALLstruct {UChar *ret_addr; /* byte code position */int num; /* null check id */UChar *pstr; /* string position */} call_frame;#endif} u;} OnigStackType;typedef struct {void* stack_p;int stack_n;OnigOptionType options;OnigRegion* region;const UChar* start; /* search start position (for \G: BEGIN_POSITION) */#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGEint best_len; /* for ONIG_OPTION_FIND_LONGEST */UChar* best_s;#endif#ifdef USE_COMBINATION_EXPLOSION_CHECKvoid* state_check_buff;int state_check_buff_size;#endif} OnigMatchArg;#define IS_CODE_SB_WORD(enc,code) \(ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code))#ifdef ONIG_DEBUGtypedef struct {short int opcode;char* name;short int arg_type;} OnigOpInfoType;extern OnigOpInfoType OnigOpInfo[];extern void onig_print_compiled_byte_code P_((FILE* f, UChar* bp, UChar** nextp, OnigEncoding enc));#ifdef ONIG_DEBUG_STATISTICSextern void onig_statistics_init P_((void));extern void onig_print_statistics P_((FILE* f));#endif#endifextern UChar* onig_error_code_to_format P_((int code));extern void onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));extern int onig_bbuf_init P_((BBuf* buf, int size));extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo));extern void onig_chain_reduce P_((regex_t* reg));extern void onig_chain_link_add P_((regex_t* to, regex_t* add));extern void onig_transfer P_((regex_t* to, regex_t* from));extern int onig_is_code_in_cc P_((OnigEncoding enc, OnigCodePoint code, CClassNode* cc));extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, CClassNode* cc));/* strend hash */typedef void hash_table_type;typedef unsigned long hash_data_type;extern hash_table_type* onig_st_init_strend_table_with_size P_((int size));extern int onig_st_lookup_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type *value));extern int onig_st_insert_strend P_((hash_table_type* table, const UChar* str_key, const UChar* end_key, hash_data_type value));/* encoding property management */#define PROPERTY_LIST_ADD_PROP(Name, CR) \r = onigenc_property_list_add_property((UChar* )Name, CR,\&PropertyNameTable, &PropertyList, &PropertyListNum,\&PropertyListSize);\if (r != 0) goto end#define PROPERTY_LIST_INIT_CHECK \if (PropertyInited == 0) {\int r = onigenc_property_list_init(init_property_list);\if (r != 0) return r;\}extern int onigenc_property_list_add_property P_((UChar* name, const OnigCodePoint* prop, hash_table_type **table, const OnigCodePoint*** plist, int *pnum, int *psize));typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));#endif /* REGINT_H */
/**********************************************************************regparse.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regparse.h"#include "st.h"#define WARN_BUFSIZE 256#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASSOnigSyntaxType OnigSyntaxRuby = {(( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |ONIG_SYN_OP_ESC_C_CONTROL )& ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ), ( ONIG_SYN_OP2_QMARK_GROUP_EFFECT |ONIG_SYN_OP2_OPTION_RUBY |ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP | ONIG_SYN_OP2_ESC_K_NAMED_BACKREF |ONIG_SYN_OP2_ESC_G_SUBEXP_CALL |ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY |ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT |ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT |ONIG_SYN_OP2_CCLASS_SET_OP | ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL |ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META | ONIG_SYN_OP2_ESC_V_VTAB |ONIG_SYN_OP2_ESC_H_XDIGIT ), ( SYN_GNU_REGEX_BV |ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV |ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND |ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP |ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME |ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY |ONIG_SYN_WARN_CC_OP_NOT_ESCAPED |ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT ), ONIG_OPTION_NONE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType* OnigDefaultSyntax = ONIG_SYNTAX_RUBY;extern void onig_null_warn(const char* s ARG_UNUSED) { }#ifdef DEFAULT_WARN_FUNCTIONstatic OnigWarnFunc onig_warn = (OnigWarnFunc )DEFAULT_WARN_FUNCTION;#elsestatic OnigWarnFunc onig_warn = onig_null_warn;#endif#ifdef DEFAULT_VERB_WARN_FUNCTIONstatic OnigWarnFunc onig_verb_warn = (OnigWarnFunc )DEFAULT_VERB_WARN_FUNCTION;#elsestatic OnigWarnFunc onig_verb_warn = onig_null_warn;#endifextern void onig_set_warn_func(OnigWarnFunc f){onig_warn = f;}extern void onig_set_verb_warn_func(OnigWarnFunc f){onig_verb_warn = f;}static voidbbuf_free(BBuf* bbuf){if (IS_NOT_NULL(bbuf)) {if (IS_NOT_NULL(bbuf->p)) xfree(bbuf->p);xfree(bbuf);}}static intbbuf_clone(BBuf** rto, BBuf* from){int r;BBuf *to;*rto = to = (BBuf* )xmalloc(sizeof(BBuf));CHECK_NULL_RETURN_MEMERR(to);r = BBUF_INIT(to, from->alloc);if (r != 0) return r;to->used = from->used;xmemcpy(to->p, from->p, from->used);return 0;}#define BACKREF_REL_TO_ABS(rel_no, env) \((env)->num_mem + 1 + (rel_no))#define ONOFF(v,f,negative) (negative) ? ((v) &= ~(f)) : ((v) |= (f))#define MBCODE_START_POS(enc) \(OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80)#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \add_code_range_to_buf(pbuf, MBCODE_START_POS(enc), ~((OnigCodePoint )0))#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) do {\if (! ONIGENC_IS_SINGLEBYTE(enc)) {\r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\if (r) return r;\}\} while (0)#define BITSET_IS_EMPTY(bs,empty) do {\int i;\empty = 1;\for (i = 0; i < (int )BITSET_SIZE; i++) {\if ((bs)[i] != 0) {\empty = 0; break;\}\}\} while (0)static voidbitset_set_range(BitSetRef bs, int from, int to){int i;for (i = from; i <= to && i < SINGLE_BYTE_SIZE; i++) {BITSET_SET_BIT(bs, i);}}#if 0static voidbitset_set_all(BitSetRef bs){int i;for (i = 0; i < BITSET_SIZE; i++) { bs[i] = ~((Bits )0); }}#endifstatic voidbitset_invert(BitSetRef bs){int i;for (i = 0; i < (int )BITSET_SIZE; i++) { bs[i] = ~(bs[i]); }}static voidbitset_invert_to(BitSetRef from, BitSetRef to){int i;for (i = 0; i < (int )BITSET_SIZE; i++) { to[i] = ~(from[i]); }}static voidbitset_and(BitSetRef dest, BitSetRef bs){int i;for (i = 0; i < (int )BITSET_SIZE; i++) { dest[i] &= bs[i]; }}static voidbitset_or(BitSetRef dest, BitSetRef bs){int i;for (i = 0; i < (int )BITSET_SIZE; i++) { dest[i] |= bs[i]; }}static voidbitset_copy(BitSetRef dest, BitSetRef bs){int i;for (i = 0; i < (int )BITSET_SIZE; i++) { dest[i] = bs[i]; }}extern intonig_strncmp(const UChar* s1, const UChar* s2, int n){int x;while (n-- > 0) {x = *s2++ - *s1++;if (x) return x;}return 0;}extern voidonig_strcpy(UChar* dest, const UChar* src, const UChar* end){int len = end - src;if (len > 0) {xmemcpy(dest, src, len);dest[len] = (UChar )0;}}#ifdef USE_NAMED_GROUPstatic UChar*strdup_with_null(OnigEncoding enc, UChar* s, UChar* end){int slen, term_len, i;UChar *r;slen = end - s;term_len = ONIGENC_MBC_MINLEN(enc);r = (UChar* )xmalloc(slen + term_len);CHECK_NULL_RETURN(r);xmemcpy(r, s, slen);for (i = 0; i < term_len; i++)r[slen + i] = (UChar )0;return r;}#endif/* scan pattern methods */#define PEND_VALUE 0#define PFETCH_READY UChar* pfetch_prev#define PEND (p < end ? 0 : 1)#define PUNFETCH p = pfetch_prev#define PINC do { \pfetch_prev = p; \p += ONIGENC_MBC_ENC_LEN(enc, p); \} while (0)#define PFETCH(c) do { \c = ONIGENC_MBC_TO_CODE(enc, p, end); \pfetch_prev = p; \p += ONIGENC_MBC_ENC_LEN(enc, p); \} while (0)#define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)#define PPEEK_IS(c) (PPEEK == (OnigCodePoint )c)static UChar*strcat_capa(UChar* dest, UChar* dest_end, const UChar* src, const UChar* src_end,int capa){UChar* r;if (dest)r = (UChar* )xrealloc(dest, capa + 1);elser = (UChar* )xmalloc(capa + 1);CHECK_NULL_RETURN(r);onig_strcpy(r + (dest_end - dest), src, src_end);return r;}/* dest on static area */static UChar*strcat_capa_from_static(UChar* dest, UChar* dest_end,const UChar* src, const UChar* src_end, int capa){UChar* r;r = (UChar* )xmalloc(capa + 1);CHECK_NULL_RETURN(r);onig_strcpy(r, dest, dest_end);onig_strcpy(r + (dest_end - dest), src, src_end);return r;}#ifdef USE_ST_LIBRARYtypedef struct {UChar* s;UChar* end;} st_str_end_key;static intstr_end_cmp(st_str_end_key* x, st_str_end_key* y){UChar *p, *q;int c;if ((x->end - x->s) != (y->end - y->s))return 1;p = x->s;q = y->s;while (p < x->end) {c = (int )*p - (int )*q;if (c != 0) return c;p++; q++;}return 0;}static intstr_end_hash(st_str_end_key* x){UChar *p;int val = 0;p = x->s;while (p < x->end) {val = val * 997 + (int )*p++;}return val + (val >> 5);}extern hash_table_type*onig_st_init_strend_table_with_size(int size){static struct st_hash_type hashType = {str_end_cmp,str_end_hash,};return (hash_table_type* )onig_st_init_table_with_size(&hashType, size);}extern intonig_st_lookup_strend(hash_table_type* table, const UChar* str_key,const UChar* end_key, hash_data_type *value){st_str_end_key key;key.s = (UChar* )str_key;key.end = (UChar* )end_key;return onig_st_lookup(table, (st_data_t )(&key), value);}extern intonig_st_insert_strend(hash_table_type* table, const UChar* str_key,const UChar* end_key, hash_data_type value){st_str_end_key* key;int result;key = (st_str_end_key* )xmalloc(sizeof(st_str_end_key));key->s = (UChar* )str_key;key->end = (UChar* )end_key;result = onig_st_insert(table, (st_data_t )key, value);if (result) {xfree(key);}return result;}#endif /* USE_ST_LIBRARY */#ifdef USE_NAMED_GROUP#define INIT_NAME_BACKREFS_ALLOC_NUM 8typedef struct {UChar* name;int name_len; /* byte length */int back_num; /* number of backrefs */int back_alloc;int back_ref1;int* back_refs;} NameEntry;#ifdef USE_ST_LIBRARYtypedef st_table NameTable;typedef st_data_t HashDataType; /* 1.6 st.h doesn't define st_data_t type */#define NAMEBUF_SIZE 24#define NAMEBUF_SIZE_1 25#ifdef ONIG_DEBUGstatic inti_print_name_entry(UChar* key, NameEntry* e, void* arg){int i;FILE* fp = (FILE* )arg;fprintf(fp, "%s: ", e->name);if (e->back_num == 0)fputs("-", fp);else if (e->back_num == 1)fprintf(fp, "%d", e->back_ref1);else {for (i = 0; i < e->back_num; i++) {if (i > 0) fprintf(fp, ", ");fprintf(fp, "%d", e->back_refs[i]);}}fputs("\n", fp);return ST_CONTINUE;}extern intonig_print_names(FILE* fp, regex_t* reg){NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) {fprintf(fp, "name table\n");onig_st_foreach(t, i_print_name_entry, (HashDataType )fp);fputs("\n", fp);}return 0;}#endif /* ONIG_DEBUG */static inti_free_name_entry(UChar* key, NameEntry* e, void* arg ARG_UNUSED){xfree(e->name);if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);xfree(key);xfree(e);return ST_DELETE;}static intnames_clear(regex_t* reg){NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) {onig_st_foreach(t, i_free_name_entry, 0);}return 0;}extern intonig_names_free(regex_t* reg){int r;NameTable* t;r = names_clear(reg);if (r) return r;t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) onig_st_free_table(t);reg->name_table = (void* )NULL;return 0;}static NameEntry*name_find(regex_t* reg, const UChar* name, const UChar* name_end){NameEntry* e;NameTable* t = (NameTable* )reg->name_table;e = (NameEntry* )NULL;if (IS_NOT_NULL(t)) {onig_st_lookup_strend(t, name, name_end, (HashDataType* )((void* )(&e)));}return e;}typedef struct {int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*);regex_t* reg;void* arg;int ret;OnigEncoding enc;} INamesArg;static inti_names(UChar* key ARG_UNUSED, NameEntry* e, INamesArg* arg){int r = (*(arg->func))(e->name,e->name + e->name_len,e->back_num,(e->back_num > 1 ? e->back_refs : &(e->back_ref1)),arg->reg, arg->arg);if (r != 0) {arg->ret = r;return ST_STOP;}return ST_CONTINUE;}extern intonig_foreach_name(regex_t* reg,int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg){INamesArg narg;NameTable* t = (NameTable* )reg->name_table;narg.ret = 0;if (IS_NOT_NULL(t)) {narg.func = func;narg.reg = reg;narg.arg = arg;narg.enc = reg->enc; /* should be pattern encoding. */onig_st_foreach(t, i_names, (HashDataType )&narg);}return narg.ret;}static inti_renumber_name(UChar* key ARG_UNUSED, NameEntry* e, GroupNumRemap* map){int i;if (e->back_num > 1) {for (i = 0; i < e->back_num; i++) {e->back_refs[i] = map[e->back_refs[i]].new_val;}}else if (e->back_num == 1) {e->back_ref1 = map[e->back_ref1].new_val;}return ST_CONTINUE;}extern intonig_renumber_name_table(regex_t* reg, GroupNumRemap* map){NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) {onig_st_foreach(t, i_renumber_name, (HashDataType )map);}return 0;}extern intonig_number_of_names(regex_t* reg){NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t))return t->num_entries;elsereturn 0;}#else /* USE_ST_LIBRARY */#define INIT_NAMES_ALLOC_NUM 8typedef struct {NameEntry* e;int num;int alloc;} NameTable;#ifdef ONIG_DEBUGextern intonig_print_names(FILE* fp, regex_t* reg){int i, j;NameEntry* e;NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t) && t->num > 0) {fprintf(fp, "name table\n");for (i = 0; i < t->num; i++) {e = &(t->e[i]);fprintf(fp, "%s: ", e->name);if (e->back_num == 0) {fputs("-", fp);}else if (e->back_num == 1) {fprintf(fp, "%d", e->back_ref1);}else {for (j = 0; j < e->back_num; j++) {if (j > 0) fprintf(fp, ", ");fprintf(fp, "%d", e->back_refs[j]);}}fputs("\n", fp);}fputs("\n", fp);}return 0;}#endifstatic intnames_clear(regex_t* reg){int i;NameEntry* e;NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) {for (i = 0; i < t->num; i++) {e = &(t->e[i]);if (IS_NOT_NULL(e->name)) {xfree(e->name);e->name = NULL;e->name_len = 0;e->back_num = 0;e->back_alloc = 0;if (IS_NOT_NULL(e->back_refs)) xfree(e->back_refs);e->back_refs = (int* )NULL;}}if (IS_NOT_NULL(t->e)) {xfree(t->e);t->e = NULL;}t->num = 0;}return 0;}extern intonig_names_free(regex_t* reg){int r;NameTable* t;r = names_clear(reg);if (r) return r;t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) xfree(t);reg->name_table = NULL;return 0;}static NameEntry*name_find(regex_t* reg, UChar* name, UChar* name_end){int i, len;NameEntry* e;NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) {len = name_end - name;for (i = 0; i < t->num; i++) {e = &(t->e[i]);if (len == e->name_len && onig_strncmp(name, e->name, len) == 0)return e;}}return (NameEntry* )NULL;}extern intonig_foreach_name(regex_t* reg,int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg){int i, r;NameEntry* e;NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t)) {for (i = 0; i < t->num; i++) {e = &(t->e[i]);r = (*func)(e->name, e->name + e->name_len, e->back_num,(e->back_num > 1 ? e->back_refs : &(e->back_ref1)),reg, arg);if (r != 0) return r;}}return 0;}extern intonig_number_of_names(regex_t* reg){NameTable* t = (NameTable* )reg->name_table;if (IS_NOT_NULL(t))return t->num;elsereturn 0;}#endif /* else USE_ST_LIBRARY */static intname_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env){int alloc;NameEntry* e;NameTable* t = (NameTable* )reg->name_table;if (name_end - name <= 0)return ONIGERR_EMPTY_GROUP_NAME;e = name_find(reg, name, name_end);if (IS_NULL(e)) {#ifdef USE_ST_LIBRARYif (IS_NULL(t)) {t = onig_st_init_strend_table_with_size(5);reg->name_table = (void* )t;}e = (NameEntry* )xmalloc(sizeof(NameEntry));CHECK_NULL_RETURN_MEMERR(e);e->name = strdup_with_null(reg->enc, name, name_end);if (IS_NULL(e->name)) {xfree(e); return ONIGERR_MEMORY;}onig_st_insert_strend(t, e->name, (e->name + (name_end - name)),(HashDataType )e);e->name_len = name_end - name;e->back_num = 0;e->back_alloc = 0;e->back_refs = (int* )NULL;#elseif (IS_NULL(t)) {alloc = INIT_NAMES_ALLOC_NUM;t = (NameTable* )xmalloc(sizeof(NameTable));CHECK_NULL_RETURN_MEMERR(t);t->e = NULL;t->alloc = 0;t->num = 0;t->e = (NameEntry* )xmalloc(sizeof(NameEntry) * alloc);if (IS_NULL(t->e)) {xfree(t);return ONIGERR_MEMORY;}t->alloc = alloc;reg->name_table = t;goto clear;}else if (t->num == t->alloc) {int i;alloc = t->alloc * 2;t->e = (NameEntry* )xrealloc(t->e, sizeof(NameEntry) * alloc);CHECK_NULL_RETURN_MEMERR(t->e);t->alloc = alloc;clear:for (i = t->num; i < t->alloc; i++) {t->e[i].name = NULL;t->e[i].name_len = 0;t->e[i].back_num = 0;t->e[i].back_alloc = 0;t->e[i].back_refs = (int* )NULL;}}e = &(t->e[t->num]);t->num++;e->name = strdup_with_null(reg->enc, name, name_end);if (IS_NULL(e->name)) return ONIGERR_MEMORY;e->name_len = name_end - name;#endif}if (e->back_num >= 1 &&! IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME)) {onig_scan_env_set_error_string(env, ONIGERR_MULTIPLEX_DEFINED_NAME,name, name_end);return ONIGERR_MULTIPLEX_DEFINED_NAME;}e->back_num++;if (e->back_num == 1) {e->back_ref1 = backref;}else {if (e->back_num == 2) {alloc = INIT_NAME_BACKREFS_ALLOC_NUM;e->back_refs = (int* )xmalloc(sizeof(int) * alloc);CHECK_NULL_RETURN_MEMERR(e->back_refs);e->back_alloc = alloc;e->back_refs[0] = e->back_ref1;e->back_refs[1] = backref;}else {if (e->back_num > e->back_alloc) {alloc = e->back_alloc * 2;e->back_refs = (int* )xrealloc(e->back_refs, sizeof(int) * alloc);CHECK_NULL_RETURN_MEMERR(e->back_refs);e->back_alloc = alloc;}e->back_refs[e->back_num - 1] = backref;}}return 0;}extern intonig_name_to_group_numbers(regex_t* reg, const UChar* name,const UChar* name_end, int** nums){NameEntry* e = name_find(reg, name, name_end);if (IS_NULL(e)) return ONIGERR_UNDEFINED_NAME_REFERENCE;switch (e->back_num) {case 0:break;case 1:*nums = &(e->back_ref1);break;default:*nums = e->back_refs;break;}return e->back_num;}extern intonig_name_to_backref_number(regex_t* reg, const UChar* name,const UChar* name_end, OnigRegion *region){int i, n, *nums;n = onig_name_to_group_numbers(reg, name, name_end, &nums);if (n < 0)return n;else if (n == 0)return ONIGERR_PARSER_BUG;else if (n == 1)return nums[0];else {if (IS_NOT_NULL(region)) {for (i = n - 1; i >= 0; i--) {if (region->beg[nums[i]] != ONIG_REGION_NOTPOS)return nums[i];}}return nums[n - 1];}}#else /* USE_NAMED_GROUP */extern intonig_name_to_group_numbers(regex_t* reg, const UChar* name,const UChar* name_end, int** nums){return ONIG_NO_SUPPORT_CONFIG;}extern intonig_name_to_backref_number(regex_t* reg, const UChar* name,const UChar* name_end, OnigRegion* region){return ONIG_NO_SUPPORT_CONFIG;}extern intonig_foreach_name(regex_t* reg,int (*func)(const UChar*, const UChar*,int,int*,regex_t*,void*), void* arg){return ONIG_NO_SUPPORT_CONFIG;}extern intonig_number_of_names(regex_t* reg){return 0;}#endif /* else USE_NAMED_GROUP */extern intonig_noname_group_capture_is_active(regex_t* reg){if (ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_DONT_CAPTURE_GROUP))return 0;#ifdef USE_NAMED_GROUPif (onig_number_of_names(reg) > 0 &&IS_SYNTAX_BV(reg->syntax, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP) &&!ONIG_IS_OPTION_ON(reg->options, ONIG_OPTION_CAPTURE_GROUP)) {return 0;}#endifreturn 1;}#define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16static voidscan_env_clear(ScanEnv* env){int i;BIT_STATUS_CLEAR(env->capture_history);BIT_STATUS_CLEAR(env->bt_mem_start);BIT_STATUS_CLEAR(env->bt_mem_end);BIT_STATUS_CLEAR(env->backrefed_mem);env->error = (UChar* )NULL;env->error_end = (UChar* )NULL;env->num_call = 0;env->num_mem = 0;#ifdef USE_NAMED_GROUPenv->num_named = 0;#endifenv->mem_alloc = 0;env->mem_nodes_dynamic = (Node** )NULL;for (i = 0; i < SCANENV_MEMNODES_SIZE; i++)env->mem_nodes_static[i] = NULL_NODE;#ifdef USE_COMBINATION_EXPLOSION_CHECKenv->num_comb_exp_check = 0;env->comb_exp_max_regnum = 0;env->curr_max_regnum = 0;env->has_recursion = 0;#endif}static intscan_env_add_mem_entry(ScanEnv* env){int i, need, alloc;Node** p;need = env->num_mem + 1;if (need >= SCANENV_MEMNODES_SIZE) {if (env->mem_alloc <= need) {if (IS_NULL(env->mem_nodes_dynamic)) {alloc = INIT_SCANENV_MEMNODES_ALLOC_SIZE;p = (Node** )xmalloc(sizeof(Node*) * alloc);xmemcpy(p, env->mem_nodes_static,sizeof(Node*) * SCANENV_MEMNODES_SIZE);}else {alloc = env->mem_alloc * 2;p = (Node** )xrealloc(env->mem_nodes_dynamic, sizeof(Node*) * alloc);}CHECK_NULL_RETURN_MEMERR(p);for (i = env->num_mem + 1; i < alloc; i++)p[i] = NULL_NODE;env->mem_nodes_dynamic = p;env->mem_alloc = alloc;}}env->num_mem++;return env->num_mem;}static intscan_env_set_mem_node(ScanEnv* env, int num, Node* node){if (env->num_mem >= num)SCANENV_MEM_NODES(env)[num] = node;elsereturn ONIGERR_PARSER_BUG;return 0;}#ifdef USE_PARSE_TREE_NODE_RECYCLEtypedef struct _FreeNode {struct _FreeNode* next;} FreeNode;static FreeNode* FreeNodeList = (FreeNode* )NULL;#endifextern voidonig_node_free(Node* node){start:if (IS_NULL(node)) return ;switch (NTYPE(node)) {case NT_STR:if (NSTR(node)->capa != 0 &&IS_NOT_NULL(NSTR(node)->s) && NSTR(node)->s != NSTR(node)->buf) {xfree(NSTR(node)->s);}break;case NT_LIST:case NT_ALT:onig_node_free(NCAR(node));{Node* next_node = NCDR(node);#ifdef USE_PARSE_TREE_NODE_RECYCLE{FreeNode* n = (FreeNode* )node;THREAD_ATOMIC_START;n->next = FreeNodeList;FreeNodeList = n;THREAD_ATOMIC_END;}#elsexfree(node);#endifnode = next_node;goto start;}break;case NT_CCLASS:{CClassNode* cc = NCCLASS(node);if (IS_NCCLASS_SHARE(cc)) return ;if (cc->mbuf)bbuf_free(cc->mbuf);}break;case NT_QTFR:if (NQTFR(node)->target)onig_node_free(NQTFR(node)->target);break;case NT_ENCLOSE:if (NENCLOSE(node)->target)onig_node_free(NENCLOSE(node)->target);break;case NT_BREF:if (IS_NOT_NULL(NBREF(node)->back_dynamic))xfree(NBREF(node)->back_dynamic);break;case NT_ANCHOR:if (NANCHOR(node)->target)onig_node_free(NANCHOR(node)->target);break;}#ifdef USE_PARSE_TREE_NODE_RECYCLE{FreeNode* n = (FreeNode* )node;THREAD_ATOMIC_START;n->next = FreeNodeList;FreeNodeList = n;THREAD_ATOMIC_END;}#elsexfree(node);#endif}#ifdef USE_PARSE_TREE_NODE_RECYCLEextern intonig_free_node_list(void){FreeNode* n;/* THREAD_ATOMIC_START; */while (IS_NOT_NULL(FreeNodeList)) {n = FreeNodeList;FreeNodeList = FreeNodeList->next;xfree(n);}/* THREAD_ATOMIC_END; */return 0;}#endifstatic Node*node_new(void){Node* node;#ifdef USE_PARSE_TREE_NODE_RECYCLETHREAD_ATOMIC_START;if (IS_NOT_NULL(FreeNodeList)) {node = (Node* )FreeNodeList;FreeNodeList = FreeNodeList->next;THREAD_ATOMIC_END;return node;}THREAD_ATOMIC_END;#endifnode = (Node* )xmalloc(sizeof(Node));/* xmemset(node, 0, sizeof(Node)); */return node;}static voidinitialize_cclass(CClassNode* cc){BITSET_CLEAR(cc->bs);/* cc->base.flags = 0; */cc->flags = 0;cc->mbuf = NULL;}static Node*node_new_cclass(void){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_CCLASS);initialize_cclass(NCCLASS(node));return node;}static Node*node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out,const OnigCodePoint ranges[]){int n, i;CClassNode* cc;OnigCodePoint j;Node* node = node_new_cclass();CHECK_NULL_RETURN(node);cc = NCCLASS(node);if (not != 0) NCCLASS_SET_NOT(cc);BITSET_CLEAR(cc->bs);if (sb_out > 0 && IS_NOT_NULL(ranges)) {n = ONIGENC_CODE_RANGE_NUM(ranges);for (i = 0; i < n; i++) {for (j = ONIGENC_CODE_RANGE_FROM(ranges, i);j <= (OnigCodePoint )ONIGENC_CODE_RANGE_TO(ranges, i); j++) {if (j >= sb_out) goto sb_end;BITSET_SET_BIT(cc->bs, j);}}}sb_end:if (IS_NULL(ranges)) {is_null:cc->mbuf = NULL;}else {BBuf* bbuf;n = ONIGENC_CODE_RANGE_NUM(ranges);if (n == 0) goto is_null;bbuf = (BBuf* )xmalloc(sizeof(BBuf));CHECK_NULL_RETURN(bbuf);bbuf->alloc = n + 1;bbuf->used = n + 1;bbuf->p = (UChar* )((void* )ranges);cc->mbuf = bbuf;}return node;}static Node*node_new_ctype(int type, int not){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_CTYPE);NCTYPE(node)->ctype = type;NCTYPE(node)->not = not;return node;}static Node*node_new_anychar(void){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_CANY);return node;}static Node*node_new_list(Node* left, Node* right){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_LIST);NCAR(node) = left;NCDR(node) = right;return node;}extern Node*onig_node_new_list(Node* left, Node* right){return node_new_list(left, right);}extern Node*onig_node_list_add(Node* list, Node* x){Node *n;n = onig_node_new_list(x, NULL);if (IS_NULL(n)) return NULL_NODE;if (IS_NOT_NULL(list)) {while (IS_NOT_NULL(NCDR(list)))list = NCDR(list);NCDR(list) = n;}return n;}extern Node*onig_node_new_alt(Node* left, Node* right){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_ALT);NCAR(node) = left;NCDR(node) = right;return node;}extern Node*onig_node_new_anchor(int type){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_ANCHOR);NANCHOR(node)->type = type;NANCHOR(node)->target = NULL;NANCHOR(node)->char_len = -1;return node;}static Node*node_new_backref(int back_num, int* backrefs, int by_name,#ifdef USE_BACKREF_WITH_LEVELint exist_level, int nest_level,#endifScanEnv* env){int i;Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_BREF);NBREF(node)->state = 0;NBREF(node)->back_num = back_num;NBREF(node)->back_dynamic = (int* )NULL;if (by_name != 0)NBREF(node)->state |= NST_NAME_REF;#ifdef USE_BACKREF_WITH_LEVELif (exist_level != 0) {NBREF(node)->state |= NST_NEST_LEVEL;NBREF(node)->nest_level = nest_level;}#endiffor (i = 0; i < back_num; i++) {if (backrefs[i] <= env->num_mem &&IS_NULL(SCANENV_MEM_NODES(env)[backrefs[i]])) {NBREF(node)->state |= NST_RECURSION; /* /...(\1).../ */break;}}if (back_num <= NODE_BACKREFS_SIZE) {for (i = 0; i < back_num; i++)NBREF(node)->back_static[i] = backrefs[i];}else {int* p = (int* )xmalloc(sizeof(int) * back_num);if (IS_NULL(p)) {onig_node_free(node);return NULL;}NBREF(node)->back_dynamic = p;for (i = 0; i < back_num; i++)p[i] = backrefs[i];}return node;}#ifdef USE_SUBEXP_CALLstatic Node*node_new_call(UChar* name, UChar* name_end, int gnum){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_CALL);NCALL(node)->state = 0;NCALL(node)->target = NULL_NODE;NCALL(node)->name = name;NCALL(node)->name_end = name_end;NCALL(node)->group_num = gnum; /* call by number if gnum != 0 */return node;}#endifstatic Node*node_new_quantifier(int lower, int upper, int by_number){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_QTFR);NQTFR(node)->state = 0;NQTFR(node)->target = NULL;NQTFR(node)->lower = lower;NQTFR(node)->upper = upper;NQTFR(node)->greedy = 1;NQTFR(node)->target_empty_info = NQ_TARGET_ISNOT_EMPTY;NQTFR(node)->head_exact = NULL_NODE;NQTFR(node)->next_head_exact = NULL_NODE;NQTFR(node)->is_refered = 0;if (by_number != 0)NQTFR(node)->state |= NST_BY_NUMBER;#ifdef USE_COMBINATION_EXPLOSION_CHECKNQTFR(node)->comb_exp_check_num = 0;#endifreturn node;}static Node*node_new_enclose(int type){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_ENCLOSE);NENCLOSE(node)->type = type;NENCLOSE(node)->state = 0;NENCLOSE(node)->regnum = 0;NENCLOSE(node)->option = 0;NENCLOSE(node)->target = NULL;NENCLOSE(node)->call_addr = -1;NENCLOSE(node)->opt_count = 0;return node;}extern Node*onig_node_new_enclose(int type){return node_new_enclose(type);}static Node*node_new_enclose_memory(OnigOptionType option, int is_named){Node* node = node_new_enclose(ENCLOSE_MEMORY);CHECK_NULL_RETURN(node);if (is_named != 0)SET_ENCLOSE_STATUS(node, NST_NAMED_GROUP);#ifdef USE_SUBEXP_CALLNENCLOSE(node)->option = option;#endifreturn node;}static Node*node_new_option(OnigOptionType option){Node* node = node_new_enclose(ENCLOSE_OPTION);CHECK_NULL_RETURN(node);NENCLOSE(node)->option = option;return node;}extern intonig_node_str_cat(Node* node, const UChar* s, const UChar* end){int addlen = end - s;if (addlen > 0) {int len = NSTR(node)->end - NSTR(node)->s;if (NSTR(node)->capa > 0 || (len + addlen > NODE_STR_BUF_SIZE - 1)) {UChar* p;int capa = len + addlen + NODE_STR_MARGIN;if (capa <= NSTR(node)->capa) {onig_strcpy(NSTR(node)->s + len, s, end);}else {if (NSTR(node)->s == NSTR(node)->buf)p = strcat_capa_from_static(NSTR(node)->s, NSTR(node)->end,s, end, capa);elsep = strcat_capa(NSTR(node)->s, NSTR(node)->end, s, end, capa);CHECK_NULL_RETURN_MEMERR(p);NSTR(node)->s = p;NSTR(node)->capa = capa;}}else {onig_strcpy(NSTR(node)->s + len, s, end);}NSTR(node)->end = NSTR(node)->s + len + addlen;}return 0;}extern intonig_node_str_set(Node* node, const UChar* s, const UChar* end){onig_node_str_clear(node);return onig_node_str_cat(node, s, end);}static intnode_str_cat_char(Node* node, UChar c){UChar s[1];s[0] = c;return onig_node_str_cat(node, s, s + 1);}extern voidonig_node_conv_to_str_node(Node* node, int flag){SET_NTYPE(node, NT_STR);NSTR(node)->flag = flag;NSTR(node)->capa = 0;NSTR(node)->s = NSTR(node)->buf;NSTR(node)->end = NSTR(node)->buf;}extern voidonig_node_str_clear(Node* node){if (NSTR(node)->capa != 0 &&IS_NOT_NULL(NSTR(node)->s) && NSTR(node)->s != NSTR(node)->buf) {xfree(NSTR(node)->s);}NSTR(node)->capa = 0;NSTR(node)->flag = 0;NSTR(node)->s = NSTR(node)->buf;NSTR(node)->end = NSTR(node)->buf;}static Node*node_new_str(const UChar* s, const UChar* end){Node* node = node_new();CHECK_NULL_RETURN(node);SET_NTYPE(node, NT_STR);NSTR(node)->capa = 0;NSTR(node)->flag = 0;NSTR(node)->s = NSTR(node)->buf;NSTR(node)->end = NSTR(node)->buf;if (onig_node_str_cat(node, s, end)) {onig_node_free(node);return NULL;}return node;}extern Node*onig_node_new_str(const UChar* s, const UChar* end){return node_new_str(s, end);}static Node*node_new_str_raw(UChar* s, UChar* end){Node* node = node_new_str(s, end);NSTRING_SET_RAW(node);return node;}static Node*node_new_empty(void){return node_new_str(NULL, NULL);}static Node*node_new_str_raw_char(UChar c){UChar p[1];p[0] = c;return node_new_str_raw(p, p + 1);}static Node*str_node_split_last_char(StrNode* sn, OnigEncoding enc){const UChar *p;Node* n = NULL_NODE;if (sn->end > sn->s) {p = onigenc_get_prev_char_head(enc, sn->s, sn->end);if (p && p > sn->s) { /* can be splitted. */n = node_new_str(p, sn->end);if ((sn->flag & NSTR_RAW) != 0)NSTRING_SET_RAW(n);sn->end = (UChar* )p;}}return n;}static intstr_node_can_be_split(StrNode* sn, OnigEncoding enc){if (sn->end > sn->s) {return ((enclen(enc, sn->s) < sn->end - sn->s) ? 1 : 0);}return 0;}#ifdef USE_PAD_TO_SHORT_BYTE_CHARstatic intnode_str_head_pad(StrNode* sn, int num, UChar val){UChar buf[NODE_STR_BUF_SIZE];int i, len;len = sn->end - sn->s;onig_strcpy(buf, sn->s, sn->end);onig_strcpy(&(sn->s[num]), buf, buf + len);sn->end += num;for (i = 0; i < num; i++) {sn->s[i] = val;}}#endifextern intonig_scan_unsigned_number(UChar** src, const UChar* end, OnigEncoding enc){unsigned int num, val;OnigCodePoint c;UChar* p = *src;PFETCH_READY;num = 0;while (!PEND) {PFETCH(c);if (ONIGENC_IS_CODE_DIGIT(enc, c)) {val = (unsigned int )DIGITVAL(c);if ((INT_MAX_LIMIT - val) / 10UL < num)return -1; /* overflow */num = num * 10 + val;}else {PUNFETCH;break;}}*src = p;return num;}static intscan_unsigned_hexadecimal_number(UChar** src, UChar* end, int maxlen,OnigEncoding enc){OnigCodePoint c;unsigned int num, val;UChar* p = *src;PFETCH_READY;num = 0;while (!PEND && maxlen-- != 0) {PFETCH(c);if (ONIGENC_IS_CODE_XDIGIT(enc, c)) {val = (unsigned int )XDIGITVAL(enc,c);if ((INT_MAX_LIMIT - val) / 16UL < num)return -1; /* overflow */num = (num << 4) + XDIGITVAL(enc,c);}else {PUNFETCH;break;}}*src = p;return num;}static intscan_unsigned_octal_number(UChar** src, UChar* end, int maxlen,OnigEncoding enc){OnigCodePoint c;unsigned int num, val;UChar* p = *src;PFETCH_READY;num = 0;while (!PEND && maxlen-- != 0) {PFETCH(c);if (ONIGENC_IS_CODE_DIGIT(enc, c) && c < '8') {val = ODIGITVAL(c);if ((INT_MAX_LIMIT - val) / 8UL < num)return -1; /* overflow */num = (num << 3) + val;}else {PUNFETCH;break;}}*src = p;return num;}#define BBUF_WRITE_CODE_POINT(bbuf,pos,code) \BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT)/* data format:[n][from-1][to-1][from-2][to-2] ... [from-n][to-n](all data size is OnigCodePoint)*/static intnew_code_range(BBuf** pbuf){#define INIT_MULTI_BYTE_RANGE_SIZE (SIZE_CODE_POINT * 5)int r;OnigCodePoint n;BBuf* bbuf;bbuf = *pbuf = (BBuf* )xmalloc(sizeof(BBuf));CHECK_NULL_RETURN_MEMERR(*pbuf);r = BBUF_INIT(*pbuf, INIT_MULTI_BYTE_RANGE_SIZE);if (r) return r;n = 0;BBUF_WRITE_CODE_POINT(bbuf, 0, n);return 0;}static intadd_code_range_to_buf(BBuf** pbuf, OnigCodePoint from, OnigCodePoint to){int r, inc_n, pos;int low, high, bound, x;OnigCodePoint n, *data;BBuf* bbuf;if (from > to) {n = from; from = to; to = n;}if (IS_NULL(*pbuf)) {r = new_code_range(pbuf);if (r) return r;bbuf = *pbuf;n = 0;}else {bbuf = *pbuf;GET_CODE_POINT(n, bbuf->p);}data = (OnigCodePoint* )(bbuf->p);data++;for (low = 0, bound = n; low < bound; ) {x = (low + bound) >> 1;if (from > data[x*2 + 1])low = x + 1;elsebound = x;}for (high = low, bound = n; high < bound; ) {x = (high + bound) >> 1;if (to >= data[x*2] - 1)high = x + 1;elsebound = x;}inc_n = low + 1 - high;if (n + inc_n > ONIG_MAX_MULTI_BYTE_RANGES_NUM)return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES;if (inc_n != 1) {if (from > data[low*2])from = data[low*2];if (to < data[(high - 1)*2 + 1])to = data[(high - 1)*2 + 1];}if (inc_n != 0 && (OnigCodePoint )high < n) {int from_pos = SIZE_CODE_POINT * (1 + high * 2);int to_pos = SIZE_CODE_POINT * (1 + (low + 1) * 2);int size = (n - high) * 2 * SIZE_CODE_POINT;if (inc_n > 0) {BBUF_MOVE_RIGHT(bbuf, from_pos, to_pos, size);}else {BBUF_MOVE_LEFT_REDUCE(bbuf, from_pos, to_pos);}}pos = SIZE_CODE_POINT * (1 + low * 2);BBUF_ENSURE_SIZE(bbuf, pos + SIZE_CODE_POINT * 2);BBUF_WRITE_CODE_POINT(bbuf, pos, from);BBUF_WRITE_CODE_POINT(bbuf, pos + SIZE_CODE_POINT, to);n += inc_n;BBUF_WRITE_CODE_POINT(bbuf, 0, n);return 0;}static intadd_code_range(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePoint to){if (from > to) {if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))return 0;elsereturn ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;}return add_code_range_to_buf(pbuf, from, to);}static intnot_code_range_buf(OnigEncoding enc, BBuf* bbuf, BBuf** pbuf){int r, i, n;OnigCodePoint pre, from, *data, to = 0;*pbuf = (BBuf* )NULL;if (IS_NULL(bbuf)) {set_all:return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf);}data = (OnigCodePoint* )(bbuf->p);GET_CODE_POINT(n, data);data++;if (n <= 0) goto set_all;r = 0;pre = MBCODE_START_POS(enc);for (i = 0; i < n; i++) {from = data[i*2];to = data[i*2+1];if (pre <= from - 1) {r = add_code_range_to_buf(pbuf, pre, from - 1);if (r != 0) return r;}if (to == ~((OnigCodePoint )0)) break;pre = to + 1;}if (to < ~((OnigCodePoint )0)) {r = add_code_range_to_buf(pbuf, to + 1, ~((OnigCodePoint )0));}return r;}#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2) do {\BBuf *tbuf; \int tnot; \tnot = not1; not1 = not2; not2 = tnot; \tbuf = bbuf1; bbuf1 = bbuf2; bbuf2 = tbuf; \} while (0)static intor_code_range_buf(OnigEncoding enc, BBuf* bbuf1, int not1,BBuf* bbuf2, int not2, BBuf** pbuf){int r;OnigCodePoint i, n1, *data1;OnigCodePoint from, to;*pbuf = (BBuf* )NULL;if (IS_NULL(bbuf1) && IS_NULL(bbuf2)) {if (not1 != 0 || not2 != 0)return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf);return 0;}r = 0;if (IS_NULL(bbuf2))SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2);if (IS_NULL(bbuf1)) {if (not1 != 0) {return SET_ALL_MULTI_BYTE_RANGE(enc, pbuf);}else {if (not2 == 0) {return bbuf_clone(pbuf, bbuf2);}else {return not_code_range_buf(enc, bbuf2, pbuf);}}}if (not1 != 0)SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2);data1 = (OnigCodePoint* )(bbuf1->p);GET_CODE_POINT(n1, data1);data1++;if (not2 == 0 && not1 == 0) { /* 1 OR 2 */r = bbuf_clone(pbuf, bbuf2);}else if (not1 == 0) { /* 1 OR (not 2) */r = not_code_range_buf(enc, bbuf2, pbuf);}if (r != 0) return r;for (i = 0; i < n1; i++) {from = data1[i*2];to = data1[i*2+1];r = add_code_range_to_buf(pbuf, from, to);if (r != 0) return r;}return 0;}static intand_code_range1(BBuf** pbuf, OnigCodePoint from1, OnigCodePoint to1,OnigCodePoint* data, int n){int i, r;OnigCodePoint from2, to2;for (i = 0; i < n; i++) {from2 = data[i*2];to2 = data[i*2+1];if (from2 < from1) {if (to2 < from1) continue;else {from1 = to2 + 1;}}else if (from2 <= to1) {if (to2 < to1) {if (from1 <= from2 - 1) {r = add_code_range_to_buf(pbuf, from1, from2-1);if (r != 0) return r;}from1 = to2 + 1;}else {to1 = from2 - 1;}}else {from1 = from2;}if (from1 > to1) break;}if (from1 <= to1) {r = add_code_range_to_buf(pbuf, from1, to1);if (r != 0) return r;}return 0;}static intand_code_range_buf(BBuf* bbuf1, int not1, BBuf* bbuf2, int not2, BBuf** pbuf){int r;OnigCodePoint i, j, n1, n2, *data1, *data2;OnigCodePoint from, to, from1, to1, from2, to2;*pbuf = (BBuf* )NULL;if (IS_NULL(bbuf1)) {if (not1 != 0 && IS_NOT_NULL(bbuf2)) /* not1 != 0 -> not2 == 0 */return bbuf_clone(pbuf, bbuf2);return 0;}else if (IS_NULL(bbuf2)) {if (not2 != 0)return bbuf_clone(pbuf, bbuf1);return 0;}if (not1 != 0)SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2);data1 = (OnigCodePoint* )(bbuf1->p);data2 = (OnigCodePoint* )(bbuf2->p);GET_CODE_POINT(n1, data1);GET_CODE_POINT(n2, data2);data1++;data2++;if (not2 == 0 && not1 == 0) { /* 1 AND 2 */for (i = 0; i < n1; i++) {from1 = data1[i*2];to1 = data1[i*2+1];for (j = 0; j < n2; j++) {from2 = data2[j*2];to2 = data2[j*2+1];if (from2 > to1) break;if (to2 < from1) continue;from = MAX(from1, from2);to = MIN(to1, to2);r = add_code_range_to_buf(pbuf, from, to);if (r != 0) return r;}}}else if (not1 == 0) { /* 1 AND (not 2) */for (i = 0; i < n1; i++) {from1 = data1[i*2];to1 = data1[i*2+1];r = and_code_range1(pbuf, from1, to1, data2, n2);if (r != 0) return r;}}return 0;}static intand_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc){int r, not1, not2;BBuf *buf1, *buf2, *pbuf;BitSetRef bsr1, bsr2;BitSet bs1, bs2;not1 = IS_NCCLASS_NOT(dest);bsr1 = dest->bs;buf1 = dest->mbuf;not2 = IS_NCCLASS_NOT(cc);bsr2 = cc->bs;buf2 = cc->mbuf;if (not1 != 0) {bitset_invert_to(bsr1, bs1);bsr1 = bs1;}if (not2 != 0) {bitset_invert_to(bsr2, bs2);bsr2 = bs2;}bitset_and(bsr1, bsr2);if (bsr1 != dest->bs) {bitset_copy(dest->bs, bsr1);bsr1 = dest->bs;}if (not1 != 0) {bitset_invert(dest->bs);}if (! ONIGENC_IS_SINGLEBYTE(enc)) {if (not1 != 0 && not2 != 0) {r = or_code_range_buf(enc, buf1, 0, buf2, 0, &pbuf);}else {r = and_code_range_buf(buf1, not1, buf2, not2, &pbuf);if (r == 0 && not1 != 0) {BBuf *tbuf;r = not_code_range_buf(enc, pbuf, &tbuf);if (r != 0) {bbuf_free(pbuf);return r;}bbuf_free(pbuf);pbuf = tbuf;}}if (r != 0) return r;dest->mbuf = pbuf;bbuf_free(buf1);return r;}return 0;}static intor_cclass(CClassNode* dest, CClassNode* cc, OnigEncoding enc){int r, not1, not2;BBuf *buf1, *buf2, *pbuf;BitSetRef bsr1, bsr2;BitSet bs1, bs2;not1 = IS_NCCLASS_NOT(dest);bsr1 = dest->bs;buf1 = dest->mbuf;not2 = IS_NCCLASS_NOT(cc);bsr2 = cc->bs;buf2 = cc->mbuf;if (not1 != 0) {bitset_invert_to(bsr1, bs1);bsr1 = bs1;}if (not2 != 0) {bitset_invert_to(bsr2, bs2);bsr2 = bs2;}bitset_or(bsr1, bsr2);if (bsr1 != dest->bs) {bitset_copy(dest->bs, bsr1);bsr1 = dest->bs;}if (not1 != 0) {bitset_invert(dest->bs);}if (! ONIGENC_IS_SINGLEBYTE(enc)) {if (not1 != 0 && not2 != 0) {r = and_code_range_buf(buf1, 0, buf2, 0, &pbuf);}else {r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf);if (r == 0 && not1 != 0) {BBuf *tbuf;r = not_code_range_buf(enc, pbuf, &tbuf);if (r != 0) {bbuf_free(pbuf);return r;}bbuf_free(pbuf);pbuf = tbuf;}}if (r != 0) return r;dest->mbuf = pbuf;bbuf_free(buf1);return r;}elsereturn 0;}static intconv_backslash_value(int c, ScanEnv* env){if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_CONTROL_CHARS)) {switch (c) {case 'n': return '\n';case 't': return '\t';case 'r': return '\r';case 'f': return '\f';case 'a': return '\007';case 'b': return '\010';case 'e': return '\033';case 'v':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_V_VTAB))return '\v';break;default:break;}}return c;}static intis_invalid_quantifier_target(Node* node){switch (NTYPE(node)) {case NT_ANCHOR:return 1;break;case NT_ENCLOSE:/* allow enclosed elements *//* return is_invalid_quantifier_target(NENCLOSE(node)->target); */break;case NT_LIST:do {if (! is_invalid_quantifier_target(NCAR(node))) return 0;} while (IS_NOT_NULL(node = NCDR(node)));return 0;break;case NT_ALT:do {if (is_invalid_quantifier_target(NCAR(node))) return 1;} while (IS_NOT_NULL(node = NCDR(node)));break;default:break;}return 0;}/* ?:0, *:1, +:2, ??:3, *?:4, +?:5 */static intpopular_quantifier_num(QtfrNode* q){if (q->greedy) {if (q->lower == 0) {if (q->upper == 1) return 0;else if (IS_REPEAT_INFINITE(q->upper)) return 1;}else if (q->lower == 1) {if (IS_REPEAT_INFINITE(q->upper)) return 2;}}else {if (q->lower == 0) {if (q->upper == 1) return 3;else if (IS_REPEAT_INFINITE(q->upper)) return 4;}else if (q->lower == 1) {if (IS_REPEAT_INFINITE(q->upper)) return 5;}}return -1;}enum ReduceType {RQ_ASIS = 0, /* as is */RQ_DEL = 1, /* delete parent */RQ_A, /* to '*' */RQ_AQ, /* to '*?' */RQ_QQ, /* to '??' */RQ_P_QQ, /* to '+)??' */RQ_PQ_Q /* to '+?)?' */};static enum ReduceType ReduceTypeTable[6][6] = {{RQ_DEL, RQ_A, RQ_A, RQ_QQ, RQ_AQ, RQ_ASIS}, /* '?' */{RQ_DEL, RQ_DEL, RQ_DEL, RQ_P_QQ, RQ_P_QQ, RQ_DEL}, /* '*' */{RQ_A, RQ_A, RQ_DEL, RQ_ASIS, RQ_P_QQ, RQ_DEL}, /* '+' */{RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL, RQ_AQ, RQ_AQ}, /* '??' */{RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL, RQ_DEL}, /* '*?' */{RQ_ASIS, RQ_PQ_Q, RQ_DEL, RQ_AQ, RQ_AQ, RQ_DEL} /* '+?' */};extern voidonig_reduce_nested_quantifier(Node* pnode, Node* cnode){int pnum, cnum;QtfrNode *p, *c;p = NQTFR(pnode);c = NQTFR(cnode);pnum = popular_quantifier_num(p);cnum = popular_quantifier_num(c);if (pnum < 0 || cnum < 0) return ;switch(ReduceTypeTable[cnum][pnum]) {case RQ_DEL:*pnode = *cnode;break;case RQ_A:p->target = c->target;p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 1;break;case RQ_AQ:p->target = c->target;p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 0;break;case RQ_QQ:p->target = c->target;p->lower = 0; p->upper = 1; p->greedy = 0;break;case RQ_P_QQ:p->target = cnode;p->lower = 0; p->upper = 1; p->greedy = 0;c->lower = 1; c->upper = REPEAT_INFINITE; c->greedy = 1;return ;break;case RQ_PQ_Q:p->target = cnode;p->lower = 0; p->upper = 1; p->greedy = 1;c->lower = 1; c->upper = REPEAT_INFINITE; c->greedy = 0;return ;break;case RQ_ASIS:p->target = cnode;return ;break;}c->target = NULL_NODE;onig_node_free(cnode);}enum TokenSyms {TK_EOT = 0, /* end of token */TK_RAW_BYTE = 1,TK_CHAR,TK_STRING,TK_CODE_POINT,TK_ANYCHAR,TK_CHAR_TYPE,TK_BACKREF,TK_CALL,TK_ANCHOR,TK_OP_REPEAT,TK_INTERVAL,TK_ANYCHAR_ANYTIME, /* SQL '%' == .* */TK_ALT,TK_SUBEXP_OPEN,TK_SUBEXP_CLOSE,TK_CC_OPEN,TK_QUOTE_OPEN,TK_CHAR_PROPERTY, /* \p{...}, \P{...} *//* in cc */TK_CC_CLOSE,TK_CC_RANGE,TK_POSIX_BRACKET_OPEN,TK_CC_AND, /* && */TK_CC_CC_OPEN /* [ */};typedef struct {enum TokenSyms type;int escaped;int base; /* is number: 8, 16 (used in [....]) */UChar* backp;union {UChar* s;int c;OnigCodePoint code;int anchor;int subtype;struct {int lower;int upper;int greedy;int possessive;} repeat;struct {int num;int ref1;int* refs;int by_name;#ifdef USE_BACKREF_WITH_LEVELint exist_level;int level; /* \k<name+n> */#endif} backref;struct {UChar* name;UChar* name_end;int gnum;} call;struct {int ctype;int not;} prop;} u;} OnigToken;static intfetch_range_quantifier(UChar** src, UChar* end, OnigToken* tok, ScanEnv* env){int low, up, syn_allow, non_low = 0;int r = 0;OnigCodePoint c;OnigEncoding enc = env->enc;UChar* p = *src;PFETCH_READY;syn_allow = IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INVALID_INTERVAL);if (PEND) {if (syn_allow)return 1; /* "....{" : OK! */elsereturn ONIGERR_END_PATTERN_AT_LEFT_BRACE; /* "....{" syntax error */}if (! syn_allow) {c = PPEEK;if (c == ')' || c == '(' || c == '|') {return ONIGERR_END_PATTERN_AT_LEFT_BRACE;}}low = onig_scan_unsigned_number(&p, end, env->enc);if (low < 0) return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;if (low > ONIG_MAX_REPEAT_NUM)return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;if (p == *src) { /* can't read low */if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV)) {/* allow {,n} as {0,n} */low = 0;non_low = 1;}elsegoto invalid;}if (PEND) goto invalid;PFETCH(c);if (c == ',') {UChar* prev = p;up = onig_scan_unsigned_number(&p, end, env->enc);if (up < 0) return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;if (up > ONIG_MAX_REPEAT_NUM)return ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE;if (p == prev) {if (non_low != 0)goto invalid;up = REPEAT_INFINITE; /* {n,} : {n,infinite} */}}else {if (non_low != 0)goto invalid;PUNFETCH;up = low; /* {n} : exact n times */r = 2; /* fixed */}if (PEND) goto invalid;PFETCH(c);if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) {if (c != MC_ESC(env->syntax)) goto invalid;PFETCH(c);}if (c != '}') goto invalid;if (!IS_REPEAT_INFINITE(up) && low > up) {return ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE;}tok->type = TK_INTERVAL;tok->u.repeat.lower = low;tok->u.repeat.upper = up;*src = p;return r; /* 0: normal {n,m}, 2: fixed {n} */invalid:if (syn_allow)return 1; /* OK */elsereturn ONIGERR_INVALID_REPEAT_RANGE_PATTERN;}/* \M-, \C-, \c, or \... */static intfetch_escaped_value(UChar** src, UChar* end, ScanEnv* env){int v;OnigCodePoint c;OnigEncoding enc = env->enc;UChar* p = *src;PFETCH_READY;if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;PFETCH(c);switch (c) {case 'M':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META)) {if (PEND) return ONIGERR_END_PATTERN_AT_META;PFETCH(c);if (c != '-') return ONIGERR_META_CODE_SYNTAX;if (PEND) return ONIGERR_END_PATTERN_AT_META;PFETCH(c);if (c == MC_ESC(env->syntax)) {v = fetch_escaped_value(&p, end, env);if (v < 0) return v;c = (OnigCodePoint )v;}c = ((c & 0xff) | 0x80);}elsegoto backslash;break;case 'C':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL)) {if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL;PFETCH(c);if (c != '-') return ONIGERR_CONTROL_CODE_SYNTAX;goto control;}elsegoto backslash;case 'c':if (IS_SYNTAX_OP(env->syntax, ONIG_SYN_OP_ESC_C_CONTROL)) {control:if (PEND) return ONIGERR_END_PATTERN_AT_CONTROL;PFETCH(c);if (c == '?') {c = 0177;}else {if (c == MC_ESC(env->syntax)) {v = fetch_escaped_value(&p, end, env);if (v < 0) return v;c = (OnigCodePoint )v;}c &= 0x9f;}break;}/* fall through */default:{backslash:c = conv_backslash_value(c, env);}break;}*src = p;return c;}static int fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env);static OnigCodePointget_name_end_code_point(OnigCodePoint start){switch (start) {case '<': return (OnigCodePoint )'>'; break;case '\'': return (OnigCodePoint )'\''; break;default:break;}return (OnigCodePoint )0;}#ifdef USE_NAMED_GROUP#ifdef USE_BACKREF_WITH_LEVEL/*\k<name+n>, \k<name-n>\k<num+n>, \k<num-n>\k<-num+n>, \k<-num-n>*/static intfetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,UChar** rname_end, ScanEnv* env,int* rback_num, int* rlevel){int r, sign, is_num, exist_level;OnigCodePoint end_code;OnigCodePoint c = 0;OnigEncoding enc = env->enc;UChar *name_end;UChar *pnum_head;UChar *p = *src;PFETCH_READY;*rback_num = 0;is_num = exist_level = 0;sign = 1;pnum_head = *src;end_code = get_name_end_code_point(start_code);name_end = end;r = 0;if (PEND) {return ONIGERR_EMPTY_GROUP_NAME;}else {PFETCH(c);if (c == end_code)return ONIGERR_EMPTY_GROUP_NAME;if (ONIGENC_IS_CODE_DIGIT(enc, c)) {is_num = 1;}else if (c == '-') {is_num = 2;sign = -1;pnum_head = p;}else if (!ONIGENC_IS_CODE_WORD(enc, c)) {r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;}}while (!PEND) {name_end = p;PFETCH(c);if (c == end_code || c == ')' || c == '+' || c == '-') {if (is_num == 2) r = ONIGERR_INVALID_GROUP_NAME;break;}if (is_num != 0) {if (ONIGENC_IS_CODE_DIGIT(enc, c)) {is_num = 1;}else {r = ONIGERR_INVALID_GROUP_NAME;is_num = 0;}}else if (!ONIGENC_IS_CODE_WORD(enc, c)) {r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;}}if (r == 0 && c != end_code) {if (c == '+' || c == '-') {int level;int flag = (c == '-' ? -1 : 1);PFETCH(c);if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto err;PUNFETCH;level = onig_scan_unsigned_number(&p, end, enc);if (level < 0) return ONIGERR_TOO_BIG_NUMBER;*rlevel = (level * flag);exist_level = 1;PFETCH(c);if (c == end_code)goto end;}err:r = ONIGERR_INVALID_GROUP_NAME;name_end = end;}end:if (r == 0) {if (is_num != 0) {*rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;else if (*rback_num == 0) goto err;*rback_num *= sign;}*rname_end = name_end;*src = p;return (exist_level ? 1 : 0);}else {onig_scan_env_set_error_string(env, r, *src, name_end);return r;}}#endif /* USE_BACKREF_WITH_LEVEL *//*def: 0 -> define name (don't allow number name)1 -> reference name (allow number name)*/static intfetch_name(OnigCodePoint start_code, UChar** src, UChar* end,UChar** rname_end, ScanEnv* env, int* rback_num, int ref){int r, is_num, sign;OnigCodePoint end_code;OnigCodePoint c = 0;OnigEncoding enc = env->enc;UChar *name_end;UChar *pnum_head;UChar *p = *src;PFETCH_READY;*rback_num = 0;end_code = get_name_end_code_point(start_code);name_end = end;pnum_head = *src;r = 0;is_num = 0;sign = 1;if (PEND) {return ONIGERR_EMPTY_GROUP_NAME;}else {PFETCH(c);if (c == end_code)return ONIGERR_EMPTY_GROUP_NAME;if (ONIGENC_IS_CODE_DIGIT(enc, c)) {if (ref == 1)is_num = 1;else {r = ONIGERR_INVALID_GROUP_NAME;is_num = 0;}}else if (c == '-') {if (ref == 1) {is_num = 2;sign = -1;pnum_head = p;}else {r = ONIGERR_INVALID_GROUP_NAME;is_num = 0;}}else if (!ONIGENC_IS_CODE_WORD(enc, c)) {r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;}}if (r == 0) {while (!PEND) {name_end = p;PFETCH(c);if (c == end_code || c == ')') {if (is_num == 2) r = ONIGERR_INVALID_GROUP_NAME;break;}if (is_num != 0) {if (ONIGENC_IS_CODE_DIGIT(enc, c)) {is_num = 1;}else {if (!ONIGENC_IS_CODE_WORD(enc, c))r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;elser = ONIGERR_INVALID_GROUP_NAME;is_num = 0;}}else {if (!ONIGENC_IS_CODE_WORD(enc, c)) {r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;}}}if (c != end_code) {r = ONIGERR_INVALID_GROUP_NAME;name_end = end;}if (is_num != 0) {*rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;else if (*rback_num == 0) {r = ONIGERR_INVALID_GROUP_NAME;goto err;}*rback_num *= sign;}*rname_end = name_end;*src = p;return 0;}else {while (!PEND) {name_end = p;PFETCH(c);if (c == end_code || c == ')')break;}if (PEND)name_end = end;err:onig_scan_env_set_error_string(env, r, *src, name_end);return r;}}#elsestatic intfetch_name(OnigCodePoint start_code, UChar** src, UChar* end,UChar** rname_end, ScanEnv* env, int* rback_num, int ref){int r, is_num, sign;OnigCodePoint end_code;OnigCodePoint c = 0;UChar *name_end;OnigEncoding enc = env->enc;UChar *pnum_head;UChar *p = *src;PFETCH_READY;*rback_num = 0;end_code = get_name_end_code_point(start_code);*rname_end = name_end = end;r = 0;pnum_head = *src;is_num = 0;sign = 1;if (PEND) {return ONIGERR_EMPTY_GROUP_NAME;}else {PFETCH(c);if (c == end_code)return ONIGERR_EMPTY_GROUP_NAME;if (ONIGENC_IS_CODE_DIGIT(enc, c)) {is_num = 1;}else if (c == '-') {is_num = 2;sign = -1;pnum_head = p;}else {r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;}}while (!PEND) {name_end = p;PFETCH(c);if (c == end_code || c == ')') break;if (! ONIGENC_IS_CODE_DIGIT(enc, c))r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME;}if (r == 0 && c != end_code) {r = ONIGERR_INVALID_GROUP_NAME;name_end = end;}if (r == 0) {*rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;else if (*rback_num == 0) {r = ONIGERR_INVALID_GROUP_NAME;goto err;}*rback_num *= sign;*rname_end = name_end;*src = p;return 0;}else {err:onig_scan_env_set_error_string(env, r, *src, name_end);return r;}}#endif /* USE_NAMED_GROUP */static voidCC_ESC_WARN(ScanEnv* env, UChar *c){if (onig_warn == onig_null_warn) return ;if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED) &&IS_SYNTAX_BV(env->syntax, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC)) {UChar buf[WARN_BUFSIZE];onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,env->pattern, env->pattern_end,(UChar* )"character class has '%s' without escape", c);(*onig_warn)((char* )buf);}}static voidCLOSE_BRACKET_WITHOUT_ESC_WARN(ScanEnv* env, UChar* c){if (onig_warn == onig_null_warn) return ;if (IS_SYNTAX_BV((env)->syntax, ONIG_SYN_WARN_CC_OP_NOT_ESCAPED)) {UChar buf[WARN_BUFSIZE];onig_snprintf_with_pattern(buf, WARN_BUFSIZE, (env)->enc,(env)->pattern, (env)->pattern_end,(UChar* )"regular expression has '%s' without escape", c);(*onig_warn)((char* )buf);}}static UChar*find_str_position(OnigCodePoint s[], int n, UChar* from, UChar* to,UChar **next, OnigEncoding enc){int i;OnigCodePoint x;UChar *q;UChar *p = from;while (p < to) {x = ONIGENC_MBC_TO_CODE(enc, p, to);q = p + enclen(enc, p);if (x == s[0]) {for (i = 1; i < n && q < to; i++) {x = ONIGENC_MBC_TO_CODE(enc, q, to);if (x != s[i]) break;q += enclen(enc, q);}if (i >= n) {if (IS_NOT_NULL(next))*next = q;return p;}}p = q;}return NULL_UCHARP;}static intstr_exist_check_with_esc(OnigCodePoint s[], int n, UChar* from, UChar* to,OnigCodePoint bad, OnigEncoding enc, OnigSyntaxType* syn){int i, in_esc;OnigCodePoint x;UChar *q;UChar *p = from;in_esc = 0;while (p < to) {if (in_esc) {in_esc = 0;p += enclen(enc, p);}else {x = ONIGENC_MBC_TO_CODE(enc, p, to);q = p + enclen(enc, p);if (x == s[0]) {for (i = 1; i < n && q < to; i++) {x = ONIGENC_MBC_TO_CODE(enc, q, to);if (x != s[i]) break;q += enclen(enc, q);}if (i >= n) return 1;p += enclen(enc, p);}else {x = ONIGENC_MBC_TO_CODE(enc, p, to);if (x == bad) return 0;else if (x == MC_ESC(syn)) in_esc = 1;p = q;}}}return 0;}static intfetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env){int num;OnigCodePoint c, c2;OnigSyntaxType* syn = env->syntax;OnigEncoding enc = env->enc;UChar* prev;UChar* p = *src;PFETCH_READY;if (PEND) {tok->type = TK_EOT;return tok->type;}PFETCH(c);tok->type = TK_CHAR;tok->base = 0;tok->u.c = c;tok->escaped = 0;if (c == ']') {tok->type = TK_CC_CLOSE;}else if (c == '-') {tok->type = TK_CC_RANGE;}else if (c == MC_ESC(syn)) {if (! IS_SYNTAX_BV(syn, ONIG_SYN_BACKSLASH_ESCAPE_IN_CC))goto end;if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;PFETCH(c);tok->escaped = 1;tok->u.c = c;switch (c) {case 'w':tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_WORD;tok->u.prop.not = 0;break;case 'W':tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_WORD;tok->u.prop.not = 1;break;case 'd':tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;tok->u.prop.not = 0;break;case 'D':tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;tok->u.prop.not = 1;break;case 's':tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;tok->u.prop.not = 0;break;case 'S':tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;tok->u.prop.not = 1;break;case 'h':if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;tok->u.prop.not = 0;break;case 'H':if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;tok->u.prop.not = 1;break;case 'p':case 'P':c2 = PPEEK;if (c2 == '{' &&IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {PINC;tok->type = TK_CHAR_PROPERTY;tok->u.prop.not = (c == 'P' ? 1 : 0);if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {PFETCH(c2);if (c2 == '^') {tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0);}elsePUNFETCH;}}break;case 'x':if (PEND) break;prev = p;if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) {PINC;num = scan_unsigned_hexadecimal_number(&p, end, 8, enc);if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;if (!PEND) {c2 = PPEEK;if (ONIGENC_IS_CODE_XDIGIT(enc, c2))return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;}if (p > prev + enclen(enc, prev) && !PEND && (PPEEK_IS('}'))) {PINC;tok->type = TK_CODE_POINT;tok->base = 16;tok->u.code = (OnigCodePoint )num;}else {/* can't read nothing or invalid format */p = prev;}}else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) {num = scan_unsigned_hexadecimal_number(&p, end, 2, enc);if (num < 0) return ONIGERR_TOO_BIG_NUMBER;if (p == prev) { /* can't read nothing. */num = 0; /* but, it's not error */}tok->type = TK_RAW_BYTE;tok->base = 16;tok->u.c = num;}break;case 'u':if (PEND) break;prev = p;if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) {num = scan_unsigned_hexadecimal_number(&p, end, 4, enc);if (num < 0) return ONIGERR_TOO_BIG_NUMBER;if (p == prev) { /* can't read nothing. */num = 0; /* but, it's not error */}tok->type = TK_CODE_POINT;tok->base = 16;tok->u.code = (OnigCodePoint )num;}break;case '0':case '1': case '2': case '3': case '4': case '5': case '6': case '7':if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {PUNFETCH;prev = p;num = scan_unsigned_octal_number(&p, end, 3, enc);if (num < 0) return ONIGERR_TOO_BIG_NUMBER;if (p == prev) { /* can't read nothing. */num = 0; /* but, it's not error */}tok->type = TK_RAW_BYTE;tok->base = 8;tok->u.c = num;}break;default:PUNFETCH;num = fetch_escaped_value(&p, end, env);if (num < 0) return num;if (tok->u.c != num) {tok->u.code = (OnigCodePoint )num;tok->type = TK_CODE_POINT;}break;}}else if (c == '[') {if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_POSIX_BRACKET) && (PPEEK_IS(':'))) {OnigCodePoint send[] = { (OnigCodePoint )':', (OnigCodePoint )']' };tok->backp = p; /* point at '[' is readed */PINC;if (str_exist_check_with_esc(send, 2, p, end,(OnigCodePoint )']', enc, syn)) {tok->type = TK_POSIX_BRACKET_OPEN;}else {PUNFETCH;goto cc_in_cc;}}else {cc_in_cc:if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP)) {tok->type = TK_CC_CC_OPEN;}else {CC_ESC_WARN(env, (UChar* )"[");}}}else if (c == '&') {if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_CCLASS_SET_OP) &&!PEND && (PPEEK_IS('&'))) {PINC;tok->type = TK_CC_AND;}}end:*src = p;return tok->type;}static intfetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env){int r, num;OnigCodePoint c;OnigEncoding enc = env->enc;OnigSyntaxType* syn = env->syntax;UChar* prev;UChar* p = *src;PFETCH_READY;start:if (PEND) {tok->type = TK_EOT;return tok->type;}tok->type = TK_STRING;tok->base = 0;tok->backp = p;PFETCH(c);if (IS_MC_ESC_CODE(c, syn)) {if (PEND) return ONIGERR_END_PATTERN_AT_ESCAPE;tok->backp = p;PFETCH(c);tok->u.c = c;tok->escaped = 1;switch (c) {case '*':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF)) break;tok->type = TK_OP_REPEAT;tok->u.repeat.lower = 0;tok->u.repeat.upper = REPEAT_INFINITE;goto greedy_check;break;case '+':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_PLUS_ONE_INF)) break;tok->type = TK_OP_REPEAT;tok->u.repeat.lower = 1;tok->u.repeat.upper = REPEAT_INFINITE;goto greedy_check;break;case '?':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_QMARK_ZERO_ONE)) break;tok->type = TK_OP_REPEAT;tok->u.repeat.lower = 0;tok->u.repeat.upper = 1;greedy_check:if (!PEND && PPEEK_IS('?') &&IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_NON_GREEDY)) {PFETCH(c);tok->u.repeat.greedy = 0;tok->u.repeat.possessive = 0;}else {possessive_check:if (!PEND && PPEEK_IS('+') &&((IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT) &&tok->type != TK_INTERVAL) ||(IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL) &&tok->type == TK_INTERVAL))) {PFETCH(c);tok->u.repeat.greedy = 1;tok->u.repeat.possessive = 1;}else {tok->u.repeat.greedy = 1;tok->u.repeat.possessive = 0;}}break;case '{':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_BRACE_INTERVAL)) break;r = fetch_range_quantifier(&p, end, tok, env);if (r < 0) return r; /* error */if (r == 0) goto greedy_check;else if (r == 2) { /* {n} */if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY))goto possessive_check;goto greedy_check;}/* r == 1 : normal char */break;case '|':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_VBAR_ALT)) break;tok->type = TK_ALT;break;case '(':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) break;tok->type = TK_SUBEXP_OPEN;break;case ')':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LPAREN_SUBEXP)) break;tok->type = TK_SUBEXP_CLOSE;break;case 'w':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_WORD;tok->u.prop.not = 0;break;case 'W':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_W_WORD)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_WORD;tok->u.prop.not = 1;break;case 'b':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) break;tok->type = TK_ANCHOR;tok->u.anchor = ANCHOR_WORD_BOUND;break;case 'B':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_B_WORD_BOUND)) break;tok->type = TK_ANCHOR;tok->u.anchor = ANCHOR_NOT_WORD_BOUND;break;#ifdef USE_WORD_BEGIN_ENDcase '<':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) break;tok->type = TK_ANCHOR;tok->u.anchor = ANCHOR_WORD_BEGIN;break;case '>':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END)) break;tok->type = TK_ANCHOR;tok->u.anchor = ANCHOR_WORD_END;break;#endifcase 's':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;tok->u.prop.not = 0;break;case 'S':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_S_WHITE_SPACE)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_SPACE;tok->u.prop.not = 1;break;case 'd':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;tok->u.prop.not = 0;break;case 'D':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_D_DIGIT)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_DIGIT;tok->u.prop.not = 1;break;case 'h':if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;tok->u.prop.not = 0;break;case 'H':if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_H_XDIGIT)) break;tok->type = TK_CHAR_TYPE;tok->u.prop.ctype = ONIGENC_CTYPE_XDIGIT;tok->u.prop.not = 1;break;case 'A':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break;begin_buf:tok->type = TK_ANCHOR;tok->u.subtype = ANCHOR_BEGIN_BUF;break;case 'Z':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break;tok->type = TK_ANCHOR;tok->u.subtype = ANCHOR_SEMI_END_BUF;break;case 'z':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR)) break;end_buf:tok->type = TK_ANCHOR;tok->u.subtype = ANCHOR_END_BUF;break;case 'G':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR)) break;tok->type = TK_ANCHOR;tok->u.subtype = ANCHOR_BEGIN_POSITION;break;case '`':if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) break;goto begin_buf;break;case '\'':if (! IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR)) break;goto end_buf;break;case 'x':if (PEND) break;prev = p;if (PPEEK_IS('{') && IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_BRACE_HEX8)) {PINC;num = scan_unsigned_hexadecimal_number(&p, end, 8, enc);if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;if (!PEND) {if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK))return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;}if ((p > prev + enclen(enc, prev)) && !PEND && PPEEK_IS('}')) {PINC;tok->type = TK_CODE_POINT;tok->u.code = (OnigCodePoint )num;}else {/* can't read nothing or invalid format */p = prev;}}else if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_X_HEX2)) {num = scan_unsigned_hexadecimal_number(&p, end, 2, enc);if (num < 0) return ONIGERR_TOO_BIG_NUMBER;if (p == prev) { /* can't read nothing. */num = 0; /* but, it's not error */}tok->type = TK_RAW_BYTE;tok->base = 16;tok->u.c = num;}break;case 'u':if (PEND) break;prev = p;if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_U_HEX4)) {num = scan_unsigned_hexadecimal_number(&p, end, 4, enc);if (num < 0) return ONIGERR_TOO_BIG_NUMBER;if (p == prev) { /* can't read nothing. */num = 0; /* but, it's not error */}tok->type = TK_CODE_POINT;tok->base = 16;tok->u.code = (OnigCodePoint )num;}break;case '1': case '2': case '3': case '4':case '5': case '6': case '7': case '8': case '9':PUNFETCH;prev = p;num = onig_scan_unsigned_number(&p, end, enc);if (num < 0 || num > ONIG_MAX_BACKREF_NUM) {goto skip_backref;}if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_DECIMAL_BACKREF) &&(num <= env->num_mem || num <= 9)) { /* This spec. from GNU regex */if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) {if (num > env->num_mem || IS_NULL(SCANENV_MEM_NODES(env)[num]))return ONIGERR_INVALID_BACKREF;}tok->type = TK_BACKREF;tok->u.backref.num = 1;tok->u.backref.ref1 = num;tok->u.backref.by_name = 0;#ifdef USE_BACKREF_WITH_LEVELtok->u.backref.exist_level = 0;#endifbreak;}skip_backref:if (c == '8' || c == '9') {/* normal char */p = prev; PINC;break;}p = prev;/* fall through */case '0':if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {prev = p;num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);if (num < 0) return ONIGERR_TOO_BIG_NUMBER;if (p == prev) { /* can't read nothing. */num = 0; /* but, it's not error */}tok->type = TK_RAW_BYTE;tok->base = 8;tok->u.c = num;}else if (c != '0') {PINC;}break;#ifdef USE_NAMED_GROUPcase 'k':if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF)) {PFETCH(c);if (c == '<' || c == '\'') {UChar* name_end;int* backs;int back_num;prev = p;#ifdef USE_BACKREF_WITH_LEVELname_end = NULL_UCHARP; /* no need. escape gcc warning. */r = fetch_name_with_level((OnigCodePoint )c, &p, end, &name_end,env, &back_num, &tok->u.backref.level);if (r == 1) tok->u.backref.exist_level = 1;else tok->u.backref.exist_level = 0;#elser = fetch_name(&p, end, &name_end, env, &back_num, 1);#endifif (r < 0) return r;if (back_num != 0) {if (back_num < 0) {back_num = BACKREF_REL_TO_ABS(back_num, env);if (back_num <= 0)return ONIGERR_INVALID_BACKREF;}if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) {if (back_num > env->num_mem ||IS_NULL(SCANENV_MEM_NODES(env)[back_num]))return ONIGERR_INVALID_BACKREF;}tok->type = TK_BACKREF;tok->u.backref.by_name = 0;tok->u.backref.num = 1;tok->u.backref.ref1 = back_num;}else {num = onig_name_to_group_numbers(env->reg, prev, name_end, &backs);if (num <= 0) {onig_scan_env_set_error_string(env,ONIGERR_UNDEFINED_NAME_REFERENCE, prev, name_end);return ONIGERR_UNDEFINED_NAME_REFERENCE;}if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) {int i;for (i = 0; i < num; i++) {if (backs[i] > env->num_mem ||IS_NULL(SCANENV_MEM_NODES(env)[backs[i]]))return ONIGERR_INVALID_BACKREF;}}tok->type = TK_BACKREF;tok->u.backref.by_name = 1;if (num == 1) {tok->u.backref.num = 1;tok->u.backref.ref1 = backs[0];}else {tok->u.backref.num = num;tok->u.backref.refs = backs;}}}elsePUNFETCH;}break;#endif#ifdef USE_SUBEXP_CALLcase 'g':if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL)) {PFETCH(c);if (c == '<' || c == '\'') {int gnum;UChar* name_end;prev = p;r = fetch_name((OnigCodePoint )c, &p, end, &name_end, env, &gnum, 1);if (r < 0) return r;tok->type = TK_CALL;tok->u.call.name = prev;tok->u.call.name_end = name_end;tok->u.call.gnum = gnum;}elsePUNFETCH;}break;#endifcase 'Q':if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE)) {tok->type = TK_QUOTE_OPEN;}break;case 'p':case 'P':if (PPEEK_IS('{') &&IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY)) {PINC;tok->type = TK_CHAR_PROPERTY;tok->u.prop.not = (c == 'P' ? 1 : 0);if (IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT)) {PFETCH(c);if (c == '^') {tok->u.prop.not = (tok->u.prop.not == 0 ? 1 : 0);}elsePUNFETCH;}}break;default:PUNFETCH;num = fetch_escaped_value(&p, end, env);if (num < 0) return num;/* set_raw: */if (tok->u.c != num) {tok->type = TK_CODE_POINT;tok->u.code = (OnigCodePoint )num;}else { /* string */p = tok->backp + enclen(enc, tok->backp);}break;}}else {tok->u.c = c;tok->escaped = 0;#ifdef USE_VARIABLE_META_CHARSif ((c != ONIG_INEFFECTIVE_META_CHAR) &&IS_SYNTAX_OP(syn, ONIG_SYN_OP_VARIABLE_META_CHARACTERS)) {if (c == MC_ANYCHAR(syn))goto any_char;else if (c == MC_ANYTIME(syn))goto anytime;else if (c == MC_ZERO_OR_ONE_TIME(syn))goto zero_or_one_time;else if (c == MC_ONE_OR_MORE_TIME(syn))goto one_or_more_time;else if (c == MC_ANYCHAR_ANYTIME(syn)) {tok->type = TK_ANYCHAR_ANYTIME;goto out;}}#endifswitch (c) {case '.':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_DOT_ANYCHAR)) break;#ifdef USE_VARIABLE_META_CHARSany_char:#endiftok->type = TK_ANYCHAR;break;case '*':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_ASTERISK_ZERO_INF)) break;#ifdef USE_VARIABLE_META_CHARSanytime:#endiftok->type = TK_OP_REPEAT;tok->u.repeat.lower = 0;tok->u.repeat.upper = REPEAT_INFINITE;goto greedy_check;break;case '+':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_PLUS_ONE_INF)) break;#ifdef USE_VARIABLE_META_CHARSone_or_more_time:#endiftok->type = TK_OP_REPEAT;tok->u.repeat.lower = 1;tok->u.repeat.upper = REPEAT_INFINITE;goto greedy_check;break;case '?':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_QMARK_ZERO_ONE)) break;#ifdef USE_VARIABLE_META_CHARSzero_or_one_time:#endiftok->type = TK_OP_REPEAT;tok->u.repeat.lower = 0;tok->u.repeat.upper = 1;goto greedy_check;break;case '{':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACE_INTERVAL)) break;r = fetch_range_quantifier(&p, end, tok, env);if (r < 0) return r; /* error */if (r == 0) goto greedy_check;else if (r == 2) { /* {n} */if (IS_SYNTAX_BV(syn, ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY))goto possessive_check;goto greedy_check;}/* r == 1 : normal char */break;case '|':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_VBAR_ALT)) break;tok->type = TK_ALT;break;case '(':if (PPEEK_IS('?') &&IS_SYNTAX_OP2(syn, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) {PINC;if (PPEEK_IS('#')) {PFETCH(c);while (1) {if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;PFETCH(c);if (c == MC_ESC(syn)) {if (!PEND) PFETCH(c);}else {if (c == ')') break;}}goto start;}PUNFETCH;}if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break;tok->type = TK_SUBEXP_OPEN;break;case ')':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LPAREN_SUBEXP)) break;tok->type = TK_SUBEXP_CLOSE;break;case '^':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break;tok->type = TK_ANCHOR;tok->u.subtype = (IS_SINGLELINE(env->option)? ANCHOR_BEGIN_BUF : ANCHOR_BEGIN_LINE);break;case '$':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_LINE_ANCHOR)) break;tok->type = TK_ANCHOR;tok->u.subtype = (IS_SINGLELINE(env->option)? ANCHOR_SEMI_END_BUF : ANCHOR_END_LINE);break;case '[':if (! IS_SYNTAX_OP(syn, ONIG_SYN_OP_BRACKET_CC)) break;tok->type = TK_CC_OPEN;break;case ']':if (*src > env->pattern) /* /].../ is allowed. */CLOSE_BRACKET_WITHOUT_ESC_WARN(env, (UChar* )"]");break;case '#':if (IS_EXTEND(env->option)) {while (!PEND) {PFETCH(c);if (ONIGENC_IS_CODE_NEWLINE(enc, c))break;}goto start;break;}break;case ' ': case '\t': case '\n': case '\r': case '\f':if (IS_EXTEND(env->option))goto start;break;default:/* string */break;}}#ifdef USE_VARIABLE_META_CHARSout:#endif*src = p;return tok->type;}static intadd_ctype_to_cc_by_range(CClassNode* cc, int ctype ARG_UNUSED, int not,OnigEncoding enc ARG_UNUSED,OnigCodePoint sb_out, const OnigCodePoint mbr[]){int i, r;OnigCodePoint j;int n = ONIGENC_CODE_RANGE_NUM(mbr);if (not == 0) {for (i = 0; i < n; i++) {for (j = ONIGENC_CODE_RANGE_FROM(mbr, i);j <= ONIGENC_CODE_RANGE_TO(mbr, i); j++) {if (j >= sb_out) {if (j == ONIGENC_CODE_RANGE_TO(mbr, i)) i++;else if (j > ONIGENC_CODE_RANGE_FROM(mbr, i)) {r = add_code_range_to_buf(&(cc->mbuf), j,ONIGENC_CODE_RANGE_TO(mbr, i));if (r != 0) return r;i++;}goto sb_end;}BITSET_SET_BIT(cc->bs, j);}}sb_end:for ( ; i < n; i++) {r = add_code_range_to_buf(&(cc->mbuf),ONIGENC_CODE_RANGE_FROM(mbr, i),ONIGENC_CODE_RANGE_TO(mbr, i));if (r != 0) return r;}}else {OnigCodePoint prev = 0;for (i = 0; i < n; i++) {for (j = prev;j < ONIGENC_CODE_RANGE_FROM(mbr, i); j++) {if (j >= sb_out) {goto sb_end2;}BITSET_SET_BIT(cc->bs, j);}prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1;}for (j = prev; j < sb_out; j++) {BITSET_SET_BIT(cc->bs, j);}sb_end2:prev = sb_out;for (i = 0; i < n; i++) {if (prev < ONIGENC_CODE_RANGE_FROM(mbr, i)) {r = add_code_range_to_buf(&(cc->mbuf), prev,ONIGENC_CODE_RANGE_FROM(mbr, i) - 1);if (r != 0) return r;}prev = ONIGENC_CODE_RANGE_TO(mbr, i) + 1;}if (prev < 0x7fffffff) {r = add_code_range_to_buf(&(cc->mbuf), prev, 0x7fffffff);if (r != 0) return r;}}return 0;}static intadd_ctype_to_cc(CClassNode* cc, int ctype, int not, ScanEnv* env){int c, r;const OnigCodePoint *ranges;OnigCodePoint sb_out;OnigEncoding enc = env->enc;r = ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, &sb_out, &ranges);if (r == 0) {return add_ctype_to_cc_by_range(cc, ctype, not, env->enc, sb_out, ranges);}else if (r != ONIG_NO_SUPPORT_CONFIG) {return r;}r = 0;switch (ctype) {case ONIGENC_CTYPE_ALPHA:case ONIGENC_CTYPE_BLANK:case ONIGENC_CTYPE_CNTRL:case ONIGENC_CTYPE_DIGIT:case ONIGENC_CTYPE_LOWER:case ONIGENC_CTYPE_PUNCT:case ONIGENC_CTYPE_SPACE:case ONIGENC_CTYPE_UPPER:case ONIGENC_CTYPE_XDIGIT:case ONIGENC_CTYPE_ASCII:case ONIGENC_CTYPE_ALNUM:if (not != 0) {for (c = 0; c < SINGLE_BYTE_SIZE; c++) {if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))BITSET_SET_BIT(cc->bs, c);}ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);}else {for (c = 0; c < SINGLE_BYTE_SIZE; c++) {if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))BITSET_SET_BIT(cc->bs, c);}}break;case ONIGENC_CTYPE_GRAPH:case ONIGENC_CTYPE_PRINT:if (not != 0) {for (c = 0; c < SINGLE_BYTE_SIZE; c++) {if (! ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))BITSET_SET_BIT(cc->bs, c);}}else {for (c = 0; c < SINGLE_BYTE_SIZE; c++) {if (ONIGENC_IS_CODE_CTYPE(enc, (OnigCodePoint )c, ctype))BITSET_SET_BIT(cc->bs, c);}ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);}break;case ONIGENC_CTYPE_WORD:if (not == 0) {for (c = 0; c < SINGLE_BYTE_SIZE; c++) {if (IS_CODE_SB_WORD(enc, c)) BITSET_SET_BIT(cc->bs, c);}ADD_ALL_MULTI_BYTE_RANGE(enc, cc->mbuf);}else {for (c = 0; c < SINGLE_BYTE_SIZE; c++) {if ((ONIGENC_CODE_TO_MBCLEN(enc, c) > 0) /* check invalid code point */&& ! ONIGENC_IS_CODE_WORD(enc, c))BITSET_SET_BIT(cc->bs, c);}}break;default:return ONIGERR_PARSER_BUG;break;}return r;}static intparse_posix_bracket(CClassNode* cc, UChar** src, UChar* end, ScanEnv* env){#define POSIX_BRACKET_CHECK_LIMIT_LENGTH 20#define POSIX_BRACKET_NAME_MIN_LEN 4static PosixBracketEntryType PBS[] = {{ (UChar* )"alnum", ONIGENC_CTYPE_ALNUM, 5 },{ (UChar* )"alpha", ONIGENC_CTYPE_ALPHA, 5 },{ (UChar* )"blank", ONIGENC_CTYPE_BLANK, 5 },{ (UChar* )"cntrl", ONIGENC_CTYPE_CNTRL, 5 },{ (UChar* )"digit", ONIGENC_CTYPE_DIGIT, 5 },{ (UChar* )"graph", ONIGENC_CTYPE_GRAPH, 5 },{ (UChar* )"lower", ONIGENC_CTYPE_LOWER, 5 },{ (UChar* )"print", ONIGENC_CTYPE_PRINT, 5 },{ (UChar* )"punct", ONIGENC_CTYPE_PUNCT, 5 },{ (UChar* )"space", ONIGENC_CTYPE_SPACE, 5 },{ (UChar* )"upper", ONIGENC_CTYPE_UPPER, 5 },{ (UChar* )"xdigit", ONIGENC_CTYPE_XDIGIT, 6 },{ (UChar* )"ascii", ONIGENC_CTYPE_ASCII, 5 },{ (UChar* )"word", ONIGENC_CTYPE_WORD, 4 },{ (UChar* )NULL, -1, 0 }};PosixBracketEntryType *pb;int not, i, r;OnigCodePoint c;OnigEncoding enc = env->enc;UChar *p = *src;PFETCH_READY;if (PPEEK_IS('^')) {PINC;not = 1;}elsenot = 0;if (onigenc_strlen(enc, p, end) < POSIX_BRACKET_NAME_MIN_LEN + 3)goto not_posix_bracket;for (pb = PBS; IS_NOT_NULL(pb->name); pb++) {if (onigenc_with_ascii_strncmp(enc, p, end, pb->name, pb->len) == 0) {p = (UChar* )onigenc_step(enc, p, end, pb->len);if (onigenc_with_ascii_strncmp(enc, p, end, (UChar* )":]", 2) != 0)return ONIGERR_INVALID_POSIX_BRACKET_TYPE;r = add_ctype_to_cc(cc, pb->ctype, not, env);if (r != 0) return r;PINC; PINC;*src = p;return 0;}}not_posix_bracket:c = 0;i = 0;while (!PEND && ((c = PPEEK) != ':') && c != ']') {PINC;if (++i > POSIX_BRACKET_CHECK_LIMIT_LENGTH) break;}if (c == ':' && ! PEND) {PINC;if (! PEND) {PFETCH(c);if (c == ']')return ONIGERR_INVALID_POSIX_BRACKET_TYPE;}}return 1; /* 1: is not POSIX bracket, but no error. */}static intfetch_char_property_to_ctype(UChar** src, UChar* end, ScanEnv* env){int r;OnigCodePoint c;OnigEncoding enc = env->enc;UChar *prev, *start, *p = *src;PFETCH_READY;r = 0;start = prev = p;while (!PEND) {prev = p;PFETCH(c);if (c == '}') {r = ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, start, prev);if (r < 0) break;*src = p;return r;}else if (c == '(' || c == ')' || c == '{' || c == '|') {r = ONIGERR_INVALID_CHAR_PROPERTY_NAME;break;}}onig_scan_env_set_error_string(env, r, *src, prev);return r;}static intparse_char_property(Node** np, OnigToken* tok, UChar** src, UChar* end,ScanEnv* env){int r, ctype;CClassNode* cc;ctype = fetch_char_property_to_ctype(src, end, env);if (ctype < 0) return ctype;*np = node_new_cclass();CHECK_NULL_RETURN_MEMERR(*np);cc = NCCLASS(*np);r = add_ctype_to_cc(cc, ctype, 0, env);if (r != 0) return r;if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);return 0;}enum CCSTATE {CCS_VALUE,CCS_RANGE,CCS_COMPLETE,CCS_START};enum CCVALTYPE {CCV_SB,CCV_CODE_POINT,CCV_CLASS};static intnext_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,enum CCSTATE* state, ScanEnv* env){int r;if (*state == CCS_RANGE)return ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE;if (*state == CCS_VALUE && *type != CCV_CLASS) {if (*type == CCV_SB)BITSET_SET_BIT(cc->bs, (int )(*vs));else if (*type == CCV_CODE_POINT) {r = add_code_range(&(cc->mbuf), env, *vs, *vs);if (r < 0) return r;}}*state = CCS_VALUE;*type = CCV_CLASS;return 0;}static intnext_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v,int* vs_israw, int v_israw,enum CCVALTYPE intype, enum CCVALTYPE* type,enum CCSTATE* state, ScanEnv* env){int r;switch (*state) {case CCS_VALUE:if (*type == CCV_SB)BITSET_SET_BIT(cc->bs, (int )(*vs));else if (*type == CCV_CODE_POINT) {r = add_code_range(&(cc->mbuf), env, *vs, *vs);if (r < 0) return r;}break;case CCS_RANGE:if (intype == *type) {if (intype == CCV_SB) {if (*vs > 0xff || v > 0xff)return ONIGERR_INVALID_CODE_POINT_VALUE;if (*vs > v) {if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))goto ccs_range_end;elsereturn ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;}bitset_set_range(cc->bs, (int )*vs, (int )v);}else {r = add_code_range(&(cc->mbuf), env, *vs, v);if (r < 0) return r;}}else {#if 0if (intype == CCV_CODE_POINT && *type == CCV_SB) {#endifif (*vs > v) {if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC))goto ccs_range_end;elsereturn ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS;}bitset_set_range(cc->bs, (int )*vs, (int )(v < 0xff ? v : 0xff));r = add_code_range(&(cc->mbuf), env, (OnigCodePoint )*vs, v);if (r < 0) return r;#if 0}elsereturn ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE;#endif}ccs_range_end:*state = CCS_COMPLETE;break;case CCS_COMPLETE:case CCS_START:*state = CCS_VALUE;break;default:break;}*vs_israw = v_israw;*vs = v;*type = intype;return 0;}static intcode_exist_check(OnigCodePoint c, UChar* from, UChar* end, int ignore_escaped,ScanEnv* env){int in_esc;OnigCodePoint code;OnigEncoding enc = env->enc;UChar* p = from;PFETCH_READY;in_esc = 0;while (! PEND) {if (ignore_escaped && in_esc) {in_esc = 0;}else {PFETCH(code);if (code == c) return 1;if (code == MC_ESC(env->syntax)) in_esc = 1;}}return 0;}static intparse_char_class(Node** np, OnigToken* tok, UChar** src, UChar* end,ScanEnv* env){int r, neg, len, fetched, and_start;OnigCodePoint v, vs;UChar *p;Node* node;CClassNode *cc, *prev_cc;CClassNode work_cc;enum CCSTATE state;enum CCVALTYPE val_type, in_type;int val_israw, in_israw;prev_cc = (CClassNode* )NULL;*np = NULL_NODE;r = fetch_token_in_cc(tok, src, end, env);if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) {neg = 1;r = fetch_token_in_cc(tok, src, end, env);}else {neg = 0;}if (r < 0) return r;if (r == TK_CC_CLOSE) {if (! code_exist_check((OnigCodePoint )']',*src, env->pattern_end, 1, env))return ONIGERR_EMPTY_CHAR_CLASS;CC_ESC_WARN(env, (UChar* )"]");r = tok->type = TK_CHAR; /* allow []...] */}*np = node = node_new_cclass();CHECK_NULL_RETURN_MEMERR(node);cc = NCCLASS(node);and_start = 0;state = CCS_START;p = *src;while (r != TK_CC_CLOSE) {fetched = 0;switch (r) {case TK_CHAR:len = ONIGENC_CODE_TO_MBCLEN(env->enc, tok->u.c);if (len > 1) {in_type = CCV_CODE_POINT;}else if (len < 0) {r = len;goto err;}else {sb_char:in_type = CCV_SB;}v = (OnigCodePoint )tok->u.c;in_israw = 0;goto val_entry2;break;case TK_RAW_BYTE:/* tok->base != 0 : octal or hexadec. */if (! ONIGENC_IS_SINGLEBYTE(env->enc) && tok->base != 0) {UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];UChar* bufe = buf + ONIGENC_CODE_TO_MBC_MAXLEN;UChar* psave = p;int i, base = tok->base;buf[0] = tok->u.c;for (i = 1; i < ONIGENC_MBC_MAXLEN(env->enc); i++) {r = fetch_token_in_cc(tok, &p, end, env);if (r < 0) goto err;if (r != TK_RAW_BYTE || tok->base != base) {fetched = 1;break;}buf[i] = tok->u.c;}if (i < ONIGENC_MBC_MINLEN(env->enc)) {r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;goto err;}len = enclen(env->enc, buf);if (i < len) {r = ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;goto err;}else if (i > len) { /* fetch back */p = psave;for (i = 1; i < len; i++) {r = fetch_token_in_cc(tok, &p, end, env);}fetched = 0;}if (i == 1) {v = (OnigCodePoint )buf[0];goto raw_single;}else {v = ONIGENC_MBC_TO_CODE(env->enc, buf, bufe);in_type = CCV_CODE_POINT;}}else {v = (OnigCodePoint )tok->u.c;raw_single:in_type = CCV_SB;}in_israw = 1;goto val_entry2;break;case TK_CODE_POINT:v = tok->u.code;in_israw = 1;val_entry:len = ONIGENC_CODE_TO_MBCLEN(env->enc, v);if (len < 0) {r = len;goto err;}in_type = (len == 1 ? CCV_SB : CCV_CODE_POINT);val_entry2:r = next_state_val(cc, &vs, v, &val_israw, in_israw, in_type, &val_type,&state, env);if (r != 0) goto err;break;case TK_POSIX_BRACKET_OPEN:r = parse_posix_bracket(cc, &p, end, env);if (r < 0) goto err;if (r == 1) { /* is not POSIX bracket */CC_ESC_WARN(env, (UChar* )"[");p = tok->backp;v = (OnigCodePoint )tok->u.c;in_israw = 0;goto val_entry;}goto next_class;break;case TK_CHAR_TYPE:r = add_ctype_to_cc(cc, tok->u.prop.ctype, tok->u.prop.not, env);if (r != 0) return r;next_class:r = next_state_class(cc, &vs, &val_type, &state, env);if (r != 0) goto err;break;case TK_CHAR_PROPERTY:{int ctype;ctype = fetch_char_property_to_ctype(&p, end, env);if (ctype < 0) return ctype;r = add_ctype_to_cc(cc, ctype, tok->u.prop.not, env);if (r != 0) return r;goto next_class;}break;case TK_CC_RANGE:if (state == CCS_VALUE) {r = fetch_token_in_cc(tok, &p, end, env);if (r < 0) goto err;fetched = 1;if (r == TK_CC_CLOSE) { /* allow [x-] */range_end_val:v = (OnigCodePoint )'-';in_israw = 0;goto val_entry;}else if (r == TK_CC_AND) {CC_ESC_WARN(env, (UChar* )"-");goto range_end_val;}state = CCS_RANGE;}else if (state == CCS_START) {/* [-xa] is allowed */v = (OnigCodePoint )tok->u.c;in_israw = 0;r = fetch_token_in_cc(tok, &p, end, env);if (r < 0) goto err;fetched = 1;/* [--x] or [a&&-x] is warned. */if (r == TK_CC_RANGE || and_start != 0)CC_ESC_WARN(env, (UChar* )"-");goto val_entry;}else if (state == CCS_RANGE) {CC_ESC_WARN(env, (UChar* )"-");goto sb_char; /* [!--x] is allowed */}else { /* CCS_COMPLETE */r = fetch_token_in_cc(tok, &p, end, env);if (r < 0) goto err;fetched = 1;if (r == TK_CC_CLOSE) goto range_end_val; /* allow [a-b-] */else if (r == TK_CC_AND) {CC_ESC_WARN(env, (UChar* )"-");goto range_end_val;}if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC)) {CC_ESC_WARN(env, (UChar* )"-");goto sb_char; /* [0-9-a] is allowed as [0-9\-a] */}r = ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS;goto err;}break;case TK_CC_CC_OPEN: /* [ */{Node *anode;CClassNode* acc;r = parse_char_class(&anode, tok, &p, end, env);if (r != 0) goto cc_open_err;acc = NCCLASS(anode);r = or_cclass(cc, acc, env->enc);onig_node_free(anode);cc_open_err:if (r != 0) goto err;}break;case TK_CC_AND: /* && */{if (state == CCS_VALUE) {r = next_state_val(cc, &vs, 0, &val_israw, 0, val_type,&val_type, &state, env);if (r != 0) goto err;}/* initialize local variables */and_start = 1;state = CCS_START;if (IS_NOT_NULL(prev_cc)) {r = and_cclass(prev_cc, cc, env->enc);if (r != 0) goto err;bbuf_free(cc->mbuf);}else {prev_cc = cc;cc = &work_cc;}initialize_cclass(cc);}break;case TK_EOT:r = ONIGERR_PREMATURE_END_OF_CHAR_CLASS;goto err;break;default:r = ONIGERR_PARSER_BUG;goto err;break;}if (fetched)r = tok->type;else {r = fetch_token_in_cc(tok, &p, end, env);if (r < 0) goto err;}}if (state == CCS_VALUE) {r = next_state_val(cc, &vs, 0, &val_israw, 0, val_type,&val_type, &state, env);if (r != 0) goto err;}if (IS_NOT_NULL(prev_cc)) {r = and_cclass(prev_cc, cc, env->enc);if (r != 0) goto err;bbuf_free(cc->mbuf);cc = prev_cc;}if (neg != 0)NCCLASS_SET_NOT(cc);elseNCCLASS_CLEAR_NOT(cc);if (IS_NCCLASS_NOT(cc) &&IS_SYNTAX_BV(env->syntax, ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC)) {int is_empty;is_empty = (IS_NULL(cc->mbuf) ? 1 : 0);if (is_empty != 0)BITSET_IS_EMPTY(cc->bs, is_empty);if (is_empty == 0) {#define NEWLINE_CODE 0x0aif (ONIGENC_IS_CODE_NEWLINE(env->enc, NEWLINE_CODE)) {if (ONIGENC_CODE_TO_MBCLEN(env->enc, NEWLINE_CODE) == 1)BITSET_SET_BIT(cc->bs, NEWLINE_CODE);elseadd_code_range(&(cc->mbuf), env, NEWLINE_CODE, NEWLINE_CODE);}}}*src = p;return 0;err:if (cc != NCCLASS(*np))bbuf_free(cc->mbuf);onig_node_free(*np);return r;}static int parse_subexp(Node** top, OnigToken* tok, int term,UChar** src, UChar* end, ScanEnv* env);static intparse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,ScanEnv* env){int r, num;Node *target;OnigOptionType option;OnigCodePoint c;OnigEncoding enc = env->enc;#ifdef USE_NAMED_GROUPint list_capture;#endifUChar* p = *src;PFETCH_READY;*np = NULL;if (PEND) return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS;option = env->option;if (PPEEK_IS('?') &&IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_GROUP_EFFECT)) {PINC;if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;PFETCH(c);switch (c) {case ':': /* (?:...) grouping only */group:r = fetch_token(tok, &p, end, env);if (r < 0) return r;r = parse_subexp(np, tok, term, &p, end, env);if (r < 0) return r;*src = p;return 1; /* group */break;case '=':*np = onig_node_new_anchor(ANCHOR_PREC_READ);break;case '!': /* preceding read */*np = onig_node_new_anchor(ANCHOR_PREC_READ_NOT);break;case '>': /* (?>...) stop backtrack */*np = node_new_enclose(ENCLOSE_STOP_BACKTRACK);break;#ifdef USE_NAMED_GROUPcase '\'':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {goto named_group1;}elsereturn ONIGERR_UNDEFINED_GROUP_OPTION;break;#endifcase '<': /* look behind (?<=...), (?<!...) */PFETCH(c);if (c == '=')*np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND);else if (c == '!')*np = onig_node_new_anchor(ANCHOR_LOOK_BEHIND_NOT);#ifdef USE_NAMED_GROUPelse {if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {UChar *name;UChar *name_end;PUNFETCH;c = '<';named_group1:list_capture = 0;named_group2:name = p;r = fetch_name((OnigCodePoint )c, &p, end, &name_end, env, &num, 0);if (r < 0) return r;num = scan_env_add_mem_entry(env);if (num < 0) return num;if (list_capture != 0 && num >= (int )BIT_STATUS_BITS_NUM)return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY;r = name_add(env->reg, name, name_end, num, env);if (r != 0) return r;*np = node_new_enclose_memory(env->option, 1);CHECK_NULL_RETURN_MEMERR(*np);NENCLOSE(*np)->regnum = num;if (list_capture != 0)BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num);env->num_named++;}else {return ONIGERR_UNDEFINED_GROUP_OPTION;}}#elseelse {return ONIGERR_UNDEFINED_GROUP_OPTION;}#endifbreak;case '@':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY)) {#ifdef USE_NAMED_GROUPif (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP)) {PFETCH(c);if (c == '<' || c == '\'') {list_capture = 1;goto named_group2; /* (?@<name>...) */}PUNFETCH;}#endif*np = node_new_enclose_memory(env->option, 0);CHECK_NULL_RETURN_MEMERR(*np);num = scan_env_add_mem_entry(env);if (num < 0) {onig_node_free(*np);return num;}else if (num >= (int )BIT_STATUS_BITS_NUM) {onig_node_free(*np);return ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY;}NENCLOSE(*np)->regnum = num;BIT_STATUS_ON_AT_SIMPLE(env->capture_history, num);}else {return ONIGERR_UNDEFINED_GROUP_OPTION;}break;#ifdef USE_POSIXLINE_OPTIONcase 'p':#endifcase '-': case 'i': case 'm': case 's': case 'x':{int neg = 0;while (1) {switch (c) {case ':':case ')':break;case '-': neg = 1; break;case 'x': ONOFF(option, ONIG_OPTION_EXTEND, neg); break;case 'i': ONOFF(option, ONIG_OPTION_IGNORECASE, neg); break;case 's':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) {ONOFF(option, ONIG_OPTION_MULTILINE, neg);}elsereturn ONIGERR_UNDEFINED_GROUP_OPTION;break;case 'm':if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_PERL)) {ONOFF(option, ONIG_OPTION_SINGLELINE, (neg == 0 ? 1 : 0));}else if (IS_SYNTAX_OP2(env->syntax, ONIG_SYN_OP2_OPTION_RUBY)) {ONOFF(option, ONIG_OPTION_MULTILINE, neg);}elsereturn ONIGERR_UNDEFINED_GROUP_OPTION;break;#ifdef USE_POSIXLINE_OPTIONcase 'p':ONOFF(option, ONIG_OPTION_MULTILINE|ONIG_OPTION_SINGLELINE, neg);break;#endifdefault:return ONIGERR_UNDEFINED_GROUP_OPTION;}if (c == ')') {*np = node_new_option(option);CHECK_NULL_RETURN_MEMERR(*np);*src = p;return 2; /* option only */}else if (c == ':') {OnigOptionType prev = env->option;env->option = option;r = fetch_token(tok, &p, end, env);if (r < 0) return r;r = parse_subexp(&target, tok, term, &p, end, env);env->option = prev;if (r < 0) return r;*np = node_new_option(option);CHECK_NULL_RETURN_MEMERR(*np);NENCLOSE(*np)->target = target;*src = p;return 0;}if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;PFETCH(c);}}break;default:return ONIGERR_UNDEFINED_GROUP_OPTION;}}else {if (ONIG_IS_OPTION_ON(env->option, ONIG_OPTION_DONT_CAPTURE_GROUP))goto group;*np = node_new_enclose_memory(env->option, 0);CHECK_NULL_RETURN_MEMERR(*np);num = scan_env_add_mem_entry(env);if (num < 0) return num;NENCLOSE(*np)->regnum = num;}CHECK_NULL_RETURN_MEMERR(*np);r = fetch_token(tok, &p, end, env);if (r < 0) return r;r = parse_subexp(&target, tok, term, &p, end, env);if (r < 0) return r;if (NTYPE(*np) == NT_ANCHOR)NANCHOR(*np)->target = target;else {NENCLOSE(*np)->target = target;if (NENCLOSE(*np)->type == ENCLOSE_MEMORY) {/* Don't move this to previous of parse_subexp() */r = scan_env_set_mem_node(env, NENCLOSE(*np)->regnum, *np);if (r != 0) return r;}}*src = p;return 0;}static const char* PopularQStr[] = {"?", "*", "+", "??", "*?", "+?"};static const char* ReduceQStr[] = {"", "", "*", "*?", "??", "+ and ??", "+? and ?"};static intset_quantifier(Node* qnode, Node* target, int group, ScanEnv* env){QtfrNode* qn;qn = NQTFR(qnode);if (qn->lower == 1 && qn->upper == 1) {return 1;}switch (NTYPE(target)) {case NT_STR:if (! group) {StrNode* sn = NSTR(target);if (str_node_can_be_split(sn, env->enc)) {Node* n = str_node_split_last_char(sn, env->enc);if (IS_NOT_NULL(n)) {qn->target = n;return 2;}}}break;case NT_QTFR:{ /* check redundant double repeat. *//* verbose warn (?:.?)? etc... but not warn (.?)? etc... */QtfrNode* qnt = NQTFR(target);int nestq_num = popular_quantifier_num(qn);int targetq_num = popular_quantifier_num(qnt);#ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATORif (!IS_QUANTIFIER_BY_NUMBER(qn) && !IS_QUANTIFIER_BY_NUMBER(qnt) &&IS_SYNTAX_BV(env->syntax, ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT)) {UChar buf[WARN_BUFSIZE];switch(ReduceTypeTable[targetq_num][nestq_num]) {case RQ_ASIS:break;case RQ_DEL:if (onig_verb_warn != onig_null_warn) {onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,env->pattern, env->pattern_end,(UChar* )"redundant nested repeat operator");(*onig_verb_warn)((char* )buf);}goto warn_exit;break;default:if (onig_verb_warn != onig_null_warn) {onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,env->pattern, env->pattern_end,(UChar* )"nested repeat operator %s and %s was replaced with '%s'",PopularQStr[targetq_num], PopularQStr[nestq_num],ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);(*onig_verb_warn)((char* )buf);}goto warn_exit;break;}}warn_exit:#endifif (targetq_num >= 0) {if (nestq_num >= 0) {onig_reduce_nested_quantifier(qnode, target);goto q_exit;}else if (targetq_num == 1 || targetq_num == 2) { /* * or + *//* (?:a*){n,m}, (?:a+){n,m} => (?:a*){n,n}, (?:a+){n,n} */if (! IS_REPEAT_INFINITE(qn->upper) && qn->upper > 1 && qn->greedy) {qn->upper = (qn->lower == 0 ? 1 : qn->lower);}}}}break;default:break;}qn->target = target;q_exit:return 0;}#ifdef USE_SHARED_CCLASS_TABLE#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS 8/* for ctype node hash table */typedef struct {OnigEncoding enc;int not;int type;} type_cclass_key;static int type_cclass_cmp(type_cclass_key* x, type_cclass_key* y){if (x->type != y->type) return 1;if (x->enc != y->enc) return 1;if (x->not != y->not) return 1;return 0;}static int type_cclass_hash(type_cclass_key* key){int i, val;UChar *p;val = 0;p = (UChar* )&(key->enc);for (i = 0; i < (int )sizeof(key->enc); i++) {val = val * 997 + (int )*p++;}p = (UChar* )(&key->type);for (i = 0; i < (int )sizeof(key->type); i++) {val = val * 997 + (int )*p++;}val += key->not;return val + (val >> 5);}static struct st_hash_type type_type_cclass_hash = {type_cclass_cmp,type_cclass_hash,};static st_table* OnigTypeCClassTable;static inti_free_shared_class(type_cclass_key* key, Node* node, void* arg ARG_UNUSED){if (IS_NOT_NULL(node)) {CClassNode* cc = NCCLASS(node);if (IS_NOT_NULL(cc->mbuf)) xfree(cc->mbuf);xfree(node);}if (IS_NOT_NULL(key)) xfree(key);return ST_DELETE;}extern intonig_free_shared_cclass_table(void){if (IS_NOT_NULL(OnigTypeCClassTable)) {onig_st_foreach(OnigTypeCClassTable, i_free_shared_class, 0);onig_st_free_table(OnigTypeCClassTable);OnigTypeCClassTable = NULL;}return 0;}#endif /* USE_SHARED_CCLASS_TABLE */#ifndef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASSstatic intclear_not_flag_cclass(CClassNode* cc, OnigEncoding enc){BBuf *tbuf;int r;if (IS_NCCLASS_NOT(cc)) {bitset_invert(cc->bs);if (! ONIGENC_IS_SINGLEBYTE(enc)) {r = not_code_range_buf(enc, cc->mbuf, &tbuf);if (r != 0) return r;bbuf_free(cc->mbuf);cc->mbuf = tbuf;}NCCLASS_CLEAR_NOT(cc);}return 0;}#endif /* CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS */typedef struct {ScanEnv* env;CClassNode* cc;Node* alt_root;Node** ptail;} IApplyCaseFoldArg;static inti_apply_case_fold(OnigCodePoint from, OnigCodePoint to[],int to_len, void* arg){IApplyCaseFoldArg* iarg;ScanEnv* env;CClassNode* cc;BitSetRef bs;iarg = (IApplyCaseFoldArg* )arg;env = iarg->env;cc = iarg->cc;bs = cc->bs;if (to_len == 1) {int is_in = onig_is_code_in_cc(env->enc, from, cc);#ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASSif ((is_in != 0 && !IS_NCCLASS_NOT(cc)) ||(is_in == 0 && IS_NCCLASS_NOT(cc))) {if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) {add_code_range(&(cc->mbuf), env, *to, *to);}else {BITSET_SET_BIT(bs, *to);}}#elseif (is_in != 0) {if (ONIGENC_MBC_MINLEN(env->enc) > 1 || *to >= SINGLE_BYTE_SIZE) {if (IS_NCCLASS_NOT(cc)) clear_not_flag_cclass(cc, env->enc);add_code_range(&(cc->mbuf), env, *to, *to);}else {if (IS_NCCLASS_NOT(cc)) {BITSET_CLEAR_BIT(bs, *to);}elseBITSET_SET_BIT(bs, *to);}}#endif /* CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS */}else {int r, i, len;UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];Node *snode = NULL_NODE;if (onig_is_code_in_cc(env->enc, from, cc)#ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS&& !IS_NCCLASS_NOT(cc)#endif) {for (i = 0; i < to_len; i++) {len = ONIGENC_CODE_TO_MBC(env->enc, to[i], buf);if (i == 0) {snode = onig_node_new_str(buf, buf + len);CHECK_NULL_RETURN_MEMERR(snode);/* char-class expanded multi-char onlycompare with string folded at match time. */NSTRING_SET_AMBIG(snode);}else {r = onig_node_str_cat(snode, buf, buf + len);if (r < 0) {onig_node_free(snode);return r;}}}*(iarg->ptail) = onig_node_new_alt(snode, NULL_NODE);CHECK_NULL_RETURN_MEMERR(*(iarg->ptail));iarg->ptail = &(NCDR((*(iarg->ptail))));}}return 0;}static intparse_exp(Node** np, OnigToken* tok, int term,UChar** src, UChar* end, ScanEnv* env){int r, len, group = 0;Node* qn;Node** targetp;*np = NULL;if (tok->type == (enum TokenSyms )term)goto end_of_token;switch (tok->type) {case TK_ALT:case TK_EOT:end_of_token:*np = node_new_empty();return tok->type;break;case TK_SUBEXP_OPEN:r = parse_enclose(np, tok, TK_SUBEXP_CLOSE, src, end, env);if (r < 0) return r;if (r == 1) group = 1;else if (r == 2) { /* option only */Node* target;OnigOptionType prev = env->option;env->option = NENCLOSE(*np)->option;r = fetch_token(tok, src, end, env);if (r < 0) return r;r = parse_subexp(&target, tok, term, src, end, env);env->option = prev;if (r < 0) return r;NENCLOSE(*np)->target = target;return tok->type;}break;case TK_SUBEXP_CLOSE:if (! IS_SYNTAX_BV(env->syntax, ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP))return ONIGERR_UNMATCHED_CLOSE_PARENTHESIS;if (tok->escaped) goto tk_raw_byte;else goto tk_byte;break;case TK_STRING:tk_byte:{*np = node_new_str(tok->backp, *src);CHECK_NULL_RETURN_MEMERR(*np);while (1) {r = fetch_token(tok, src, end, env);if (r < 0) return r;if (r != TK_STRING) break;r = onig_node_str_cat(*np, tok->backp, *src);if (r < 0) return r;}string_end:targetp = np;goto repeat;}break;case TK_RAW_BYTE:tk_raw_byte:{*np = node_new_str_raw_char((UChar )tok->u.c);CHECK_NULL_RETURN_MEMERR(*np);len = 1;while (1) {if (len >= ONIGENC_MBC_MINLEN(env->enc)) {if (len == enclen(env->enc, NSTR(*np)->s)) {r = fetch_token(tok, src, end, env);NSTRING_CLEAR_RAW(*np);goto string_end;}}r = fetch_token(tok, src, end, env);if (r < 0) return r;if (r != TK_RAW_BYTE) {/* Don't use this, it is wrong for little endian encodings. */#ifdef USE_PAD_TO_SHORT_BYTE_CHARint rem;if (len < ONIGENC_MBC_MINLEN(env->enc)) {rem = ONIGENC_MBC_MINLEN(env->enc) - len;(void )node_str_head_pad(NSTR(*np), rem, (UChar )0);if (len + rem == enclen(env->enc, NSTR(*np)->s)) {NSTRING_CLEAR_RAW(*np);goto string_end;}}#endifreturn ONIGERR_TOO_SHORT_MULTI_BYTE_STRING;}r = node_str_cat_char(*np, (UChar )tok->u.c);if (r < 0) return r;len++;}}break;case TK_CODE_POINT:{UChar buf[ONIGENC_CODE_TO_MBC_MAXLEN];int num = ONIGENC_CODE_TO_MBC(env->enc, tok->u.code, buf);if (num < 0) return num;#ifdef NUMBERED_CHAR_IS_NOT_CASE_AMBIG*np = node_new_str_raw(buf, buf + num);#else*np = node_new_str(buf, buf + num);#endifCHECK_NULL_RETURN_MEMERR(*np);}break;case TK_QUOTE_OPEN:{OnigCodePoint end_op[2];UChar *qstart, *qend, *nextp;end_op[0] = (OnigCodePoint )MC_ESC(env->syntax);end_op[1] = (OnigCodePoint )'E';qstart = *src;qend = find_str_position(end_op, 2, qstart, end, &nextp, env->enc);if (IS_NULL(qend)) {nextp = qend = end;}*np = node_new_str(qstart, qend);CHECK_NULL_RETURN_MEMERR(*np);*src = nextp;}break;case TK_CHAR_TYPE:{switch (tok->u.prop.ctype) {case ONIGENC_CTYPE_WORD:*np = node_new_ctype(tok->u.prop.ctype, tok->u.prop.not);CHECK_NULL_RETURN_MEMERR(*np);break;case ONIGENC_CTYPE_SPACE:case ONIGENC_CTYPE_DIGIT:case ONIGENC_CTYPE_XDIGIT:{CClassNode* cc;#ifdef USE_SHARED_CCLASS_TABLEconst OnigCodePoint *mbr;OnigCodePoint sb_out;r = ONIGENC_GET_CTYPE_CODE_RANGE(env->enc, tok->u.prop.ctype,&sb_out, &mbr);if (r == 0 &&ONIGENC_CODE_RANGE_NUM(mbr)>= THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS) {type_cclass_key key;type_cclass_key* new_key;key.enc = env->enc;key.not = tok->u.prop.not;key.type = tok->u.prop.ctype;THREAD_ATOMIC_START;if (IS_NULL(OnigTypeCClassTable)) {OnigTypeCClassTable= onig_st_init_table_with_size(&type_type_cclass_hash, 10);if (IS_NULL(OnigTypeCClassTable)) {THREAD_ATOMIC_END;return ONIGERR_MEMORY;}}else {if (onig_st_lookup(OnigTypeCClassTable, (st_data_t )&key,(st_data_t* )np)) {THREAD_ATOMIC_END;break;}}*np = node_new_cclass_by_codepoint_range(tok->u.prop.not,sb_out, mbr);if (IS_NULL(*np)) {THREAD_ATOMIC_END;return ONIGERR_MEMORY;}cc = NCCLASS(*np);NCCLASS_SET_SHARE(cc);new_key = (type_cclass_key* )xmalloc(sizeof(type_cclass_key));xmemcpy(new_key, &key, sizeof(type_cclass_key));onig_st_add_direct(OnigTypeCClassTable, (st_data_t )new_key,(st_data_t )*np);THREAD_ATOMIC_END;}else {#endif*np = node_new_cclass();CHECK_NULL_RETURN_MEMERR(*np);cc = NCCLASS(*np);add_ctype_to_cc(cc, tok->u.prop.ctype, 0, env);if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);#ifdef USE_SHARED_CCLASS_TABLE}#endif}break;default:return ONIGERR_PARSER_BUG;break;}}break;case TK_CHAR_PROPERTY:r = parse_char_property(np, tok, src, end, env);if (r != 0) return r;break;case TK_CC_OPEN:{CClassNode* cc;r = parse_char_class(np, tok, src, end, env);if (r != 0) return r;cc = NCCLASS(*np);if (IS_IGNORECASE(env->option)) {IApplyCaseFoldArg iarg;iarg.env = env;iarg.cc = cc;iarg.alt_root = NULL_NODE;iarg.ptail = &(iarg.alt_root);r = ONIGENC_APPLY_ALL_CASE_FOLD(env->enc, env->case_fold_flag,i_apply_case_fold, &iarg);if (r != 0) {onig_node_free(iarg.alt_root);return r;}if (IS_NOT_NULL(iarg.alt_root)) {Node* work = onig_node_new_alt(*np, iarg.alt_root);if (IS_NULL(work)) {onig_node_free(iarg.alt_root);return ONIGERR_MEMORY;}*np = work;}}}break;case TK_ANYCHAR:*np = node_new_anychar();CHECK_NULL_RETURN_MEMERR(*np);break;case TK_ANYCHAR_ANYTIME:*np = node_new_anychar();CHECK_NULL_RETURN_MEMERR(*np);qn = node_new_quantifier(0, REPEAT_INFINITE, 0);CHECK_NULL_RETURN_MEMERR(qn);NQTFR(qn)->target = *np;*np = qn;break;case TK_BACKREF:len = tok->u.backref.num;*np = node_new_backref(len,(len > 1 ? tok->u.backref.refs : &(tok->u.backref.ref1)),tok->u.backref.by_name,#ifdef USE_BACKREF_WITH_LEVELtok->u.backref.exist_level,tok->u.backref.level,#endifenv);CHECK_NULL_RETURN_MEMERR(*np);break;#ifdef USE_SUBEXP_CALLcase TK_CALL:{int gnum = tok->u.call.gnum;if (gnum < 0) {gnum = BACKREF_REL_TO_ABS(gnum, env);if (gnum <= 0)return ONIGERR_INVALID_BACKREF;}*np = node_new_call(tok->u.call.name, tok->u.call.name_end, gnum);CHECK_NULL_RETURN_MEMERR(*np);env->num_call++;}break;#endifcase TK_ANCHOR:*np = onig_node_new_anchor(tok->u.anchor);break;case TK_OP_REPEAT:case TK_INTERVAL:if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) {if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS))return ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED;else*np = node_new_empty();}else {goto tk_byte;}break;default:return ONIGERR_PARSER_BUG;break;}{targetp = np;re_entry:r = fetch_token(tok, src, end, env);if (r < 0) return r;repeat:if (r == TK_OP_REPEAT || r == TK_INTERVAL) {if (is_invalid_quantifier_target(*targetp))return ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID;qn = node_new_quantifier(tok->u.repeat.lower, tok->u.repeat.upper,(r == TK_INTERVAL ? 1 : 0));CHECK_NULL_RETURN_MEMERR(qn);NQTFR(qn)->greedy = tok->u.repeat.greedy;r = set_quantifier(qn, *targetp, group, env);if (r < 0) {onig_node_free(qn);return r;}if (tok->u.repeat.possessive != 0) {Node* en;en = node_new_enclose(ENCLOSE_STOP_BACKTRACK);if (IS_NULL(en)) {onig_node_free(qn);return ONIGERR_MEMORY;}NENCLOSE(en)->target = qn;qn = en;}if (r == 0) {*targetp = qn;}else if (r == 1) {onig_node_free(qn);}else if (r == 2) { /* split case: /abc+/ */Node *tmp;*targetp = node_new_list(*targetp, NULL);if (IS_NULL(*targetp)) {onig_node_free(qn);return ONIGERR_MEMORY;}tmp = NCDR(*targetp) = node_new_list(qn, NULL);if (IS_NULL(tmp)) {onig_node_free(qn);return ONIGERR_MEMORY;}targetp = &(NCAR(tmp));}goto re_entry;}}return r;}static intparse_branch(Node** top, OnigToken* tok, int term,UChar** src, UChar* end, ScanEnv* env){int r;Node *node, **headp;*top = NULL;r = parse_exp(&node, tok, term, src, end, env);if (r < 0) return r;if (r == TK_EOT || r == term || r == TK_ALT) {*top = node;}else {*top = node_new_list(node, NULL);headp = &(NCDR(*top));while (r != TK_EOT && r != term && r != TK_ALT) {r = parse_exp(&node, tok, term, src, end, env);if (r < 0) return r;if (NTYPE(node) == NT_LIST) {*headp = node;while (IS_NOT_NULL(NCDR(node))) node = NCDR(node);headp = &(NCDR(node));}else {*headp = node_new_list(node, NULL);headp = &(NCDR(*headp));}}}return r;}/* term_tok: TK_EOT or TK_SUBEXP_CLOSE */static intparse_subexp(Node** top, OnigToken* tok, int term,UChar** src, UChar* end, ScanEnv* env){int r;Node *node, **headp;*top = NULL;r = parse_branch(&node, tok, term, src, end, env);if (r < 0) {onig_node_free(node);return r;}if (r == term) {*top = node;}else if (r == TK_ALT) {*top = onig_node_new_alt(node, NULL);headp = &(NCDR(*top));while (r == TK_ALT) {r = fetch_token(tok, src, end, env);if (r < 0) return r;r = parse_branch(&node, tok, term, src, end, env);if (r < 0) return r;*headp = onig_node_new_alt(node, NULL);headp = &(NCDR(*headp));}if (tok->type != (enum TokenSyms )term)goto err;}else {err:if (term == TK_SUBEXP_CLOSE)return ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS;elsereturn ONIGERR_PARSER_BUG;}return r;}static intparse_regexp(Node** top, UChar** src, UChar* end, ScanEnv* env){int r;OnigToken tok;r = fetch_token(&tok, src, end, env);if (r < 0) return r;r = parse_subexp(top, &tok, TK_EOT, src, end, env);if (r < 0) return r;return 0;}extern intonig_parse_make_tree(Node** root, const UChar* pattern, const UChar* end,regex_t* reg, ScanEnv* env){int r;UChar* p;#ifdef USE_NAMED_GROUPnames_clear(reg);#endifscan_env_clear(env);env->option = reg->options;env->case_fold_flag = reg->case_fold_flag;env->enc = reg->enc;env->syntax = reg->syntax;env->pattern = (UChar* )pattern;env->pattern_end = (UChar* )end;env->reg = reg;*root = NULL;p = (UChar* )pattern;r = parse_regexp(root, &p, (UChar* )end, env);reg->num_mem = env->num_mem;return r;}extern voidonig_scan_env_set_error_string(ScanEnv* env, int ecode ARG_UNUSED,UChar* arg, UChar* arg_end){env->error = arg;env->error_end = arg_end;}
#ifndef REGPARSE_H#define REGPARSE_H/**********************************************************************regparse.h - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"/* node type */#define NT_STR 0#define NT_CCLASS 1#define NT_CTYPE 2#define NT_CANY 3#define NT_BREF 4#define NT_QTFR 5#define NT_ENCLOSE 6#define NT_ANCHOR 7#define NT_LIST 8#define NT_ALT 9#define NT_CALL 10/* node type bit */#define NTYPE2BIT(type) (1<<(type))#define BIT_NT_STR NTYPE2BIT(NT_STR)#define BIT_NT_CCLASS NTYPE2BIT(NT_CCLASS)#define BIT_NT_CTYPE NTYPE2BIT(NT_CTYPE)#define BIT_NT_CANY NTYPE2BIT(NT_CANY)#define BIT_NT_BREF NTYPE2BIT(NT_BREF)#define BIT_NT_QTFR NTYPE2BIT(NT_QTFR)#define BIT_NT_ENCLOSE NTYPE2BIT(NT_ENCLOSE)#define BIT_NT_ANCHOR NTYPE2BIT(NT_ANCHOR)#define BIT_NT_LIST NTYPE2BIT(NT_LIST)#define BIT_NT_ALT NTYPE2BIT(NT_ALT)#define BIT_NT_CALL NTYPE2BIT(NT_CALL)#define IS_NODE_TYPE_SIMPLE(type) \((NTYPE2BIT(type) & (BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE |\BIT_NT_CANY | BIT_NT_BREF)) != 0)#define NTYPE(node) ((node)->u.base.type)#define SET_NTYPE(node, ntype) (node)->u.base.type = (ntype)#define NSTR(node) (&((node)->u.str))#define NCCLASS(node) (&((node)->u.cclass))#define NCTYPE(node) (&((node)->u.ctype))#define NBREF(node) (&((node)->u.bref))#define NQTFR(node) (&((node)->u.qtfr))#define NENCLOSE(node) (&((node)->u.enclose))#define NANCHOR(node) (&((node)->u.anchor))#define NCONS(node) (&((node)->u.cons))#define NCALL(node) (&((node)->u.call))#define NCAR(node) (NCONS(node)->car)#define NCDR(node) (NCONS(node)->cdr)#define ANCHOR_ANYCHAR_STAR_MASK (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML)#define ANCHOR_END_BUF_MASK (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)#define ENCLOSE_MEMORY (1<<0)#define ENCLOSE_OPTION (1<<1)#define ENCLOSE_STOP_BACKTRACK (1<<2)#define NODE_STR_MARGIN 16#define NODE_STR_BUF_SIZE 24 /* sizeof(CClassNode) - sizeof(int)*4 */#define NODE_BACKREFS_SIZE 6#define NSTR_RAW (1<<0) /* by backslashed number */#define NSTR_AMBIG (1<<1)#define NSTR_DONT_GET_OPT_INFO (1<<2)#define NSTRING_LEN(node) ((node)->u.str.end - (node)->u.str.s)#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG#define NSTRING_SET_DONT_GET_OPT_INFO(node) \(node)->u.str.flag |= NSTR_DONT_GET_OPT_INFO#define NSTRING_IS_RAW(node) (((node)->u.str.flag & NSTR_RAW) != 0)#define NSTRING_IS_AMBIG(node) (((node)->u.str.flag & NSTR_AMBIG) != 0)#define NSTRING_IS_DONT_GET_OPT_INFO(node) \(((node)->u.str.flag & NSTR_DONT_GET_OPT_INFO) != 0)#define BACKREFS_P(br) \(IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static);#define NQ_TARGET_ISNOT_EMPTY 0#define NQ_TARGET_IS_EMPTY 1#define NQ_TARGET_IS_EMPTY_MEM 2#define NQ_TARGET_IS_EMPTY_REC 3/* status bits */#define NST_MIN_FIXED (1<<0)#define NST_MAX_FIXED (1<<1)#define NST_CLEN_FIXED (1<<2)#define NST_MARK1 (1<<3)#define NST_MARK2 (1<<4)#define NST_MEM_BACKREFED (1<<5)#define NST_STOP_BT_SIMPLE_REPEAT (1<<6)#define NST_RECURSION (1<<7)#define NST_CALLED (1<<8)#define NST_ADDR_FIXED (1<<9)#define NST_NAMED_GROUP (1<<10)#define NST_NAME_REF (1<<11)#define NST_IN_REPEAT (1<<12) /* STK_REPEAT is nested in stack. */#define NST_NEST_LEVEL (1<<13)#define NST_BY_NUMBER (1<<14) /* {n,m} */#define SET_ENCLOSE_STATUS(node,f) (node)->u.enclose.state |= (f)#define CLEAR_ENCLOSE_STATUS(node,f) (node)->u.enclose.state &= ~(f)#define IS_ENCLOSE_CALLED(en) (((en)->state & NST_CALLED) != 0)#define IS_ENCLOSE_ADDR_FIXED(en) (((en)->state & NST_ADDR_FIXED) != 0)#define IS_ENCLOSE_RECURSION(en) (((en)->state & NST_RECURSION) != 0)#define IS_ENCLOSE_MARK1(en) (((en)->state & NST_MARK1) != 0)#define IS_ENCLOSE_MARK2(en) (((en)->state & NST_MARK2) != 0)#define IS_ENCLOSE_MIN_FIXED(en) (((en)->state & NST_MIN_FIXED) != 0)#define IS_ENCLOSE_MAX_FIXED(en) (((en)->state & NST_MAX_FIXED) != 0)#define IS_ENCLOSE_CLEN_FIXED(en) (((en)->state & NST_CLEN_FIXED) != 0)#define IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT(en) \(((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0)#define IS_ENCLOSE_NAMED_GROUP(en) (((en)->state & NST_NAMED_GROUP) != 0)#define SET_CALL_RECURSION(node) (node)->u.call.state |= NST_RECURSION#define IS_CALL_RECURSION(cn) (((cn)->state & NST_RECURSION) != 0)#define IS_CALL_NAME_REF(cn) (((cn)->state & NST_NAME_REF) != 0)#define IS_BACKREF_NAME_REF(bn) (((bn)->state & NST_NAME_REF) != 0)#define IS_BACKREF_NEST_LEVEL(bn) (((bn)->state & NST_NEST_LEVEL) != 0)#define IS_QUANTIFIER_IN_REPEAT(qn) (((qn)->state & NST_IN_REPEAT) != 0)#define IS_QUANTIFIER_BY_NUMBER(qn) (((qn)->state & NST_BY_NUMBER) != 0)#define CALLNODE_REFNUM_UNDEF -1typedef struct {NodeBase base;UChar* s;UChar* end;unsigned int flag;int capa; /* (allocated size - 1) or 0: use buf[] */UChar buf[NODE_STR_BUF_SIZE];} StrNode;typedef struct {NodeBase base;int state;struct _Node* target;int lower;int upper;int greedy;int target_empty_info;struct _Node* head_exact;struct _Node* next_head_exact;int is_refered; /* include called node. don't eliminate even if {0} */#ifdef USE_COMBINATION_EXPLOSION_CHECKint comb_exp_check_num; /* 1,2,3...: check, 0: no check */#endif} QtfrNode;typedef struct {NodeBase base;int state;int type;int regnum;OnigOptionType option;struct _Node* target;AbsAddrType call_addr;/* for multiple call reference */OnigDistance min_len; /* min length (byte) */OnigDistance max_len; /* max length (byte) */int char_len; /* character length */int opt_count; /* referenced count in optimize_node_left() */} EncloseNode;#ifdef USE_SUBEXP_CALLtypedef struct {int offset;struct _Node* target;} UnsetAddr;typedef struct {int num;int alloc;UnsetAddr* us;} UnsetAddrList;typedef struct {NodeBase base;int state;int group_num;UChar* name;UChar* name_end;struct _Node* target; /* EncloseNode : ENCLOSE_MEMORY */UnsetAddrList* unset_addr_list;} CallNode;#endiftypedef struct {NodeBase base;int state;int back_num;int back_static[NODE_BACKREFS_SIZE];int* back_dynamic;int nest_level;} BRefNode;typedef struct {NodeBase base;int type;struct _Node* target;int char_len;} AnchorNode;typedef struct {NodeBase base;struct _Node* car;struct _Node* cdr;} ConsAltNode;typedef struct {NodeBase base;int ctype;int not;} CtypeNode;typedef struct _Node {union {NodeBase base;StrNode str;CClassNode cclass;QtfrNode qtfr;EncloseNode enclose;BRefNode bref;AnchorNode anchor;ConsAltNode cons;CtypeNode ctype;#ifdef USE_SUBEXP_CALLCallNode call;#endif} u;} Node;#define NULL_NODE ((Node* )0)#define SCANENV_MEMNODES_SIZE 8#define SCANENV_MEM_NODES(senv) \(IS_NOT_NULL((senv)->mem_nodes_dynamic) ? \(senv)->mem_nodes_dynamic : (senv)->mem_nodes_static)typedef struct {OnigOptionType option;OnigCaseFoldType case_fold_flag;OnigEncoding enc;OnigSyntaxType* syntax;BitStatusType capture_history;BitStatusType bt_mem_start;BitStatusType bt_mem_end;BitStatusType backrefed_mem;UChar* pattern;UChar* pattern_end;UChar* error;UChar* error_end;regex_t* reg; /* for reg->names only */int num_call;#ifdef USE_SUBEXP_CALLUnsetAddrList* unset_addr_list;#endifint num_mem;#ifdef USE_NAMED_GROUPint num_named;#endifint mem_alloc;Node* mem_nodes_static[SCANENV_MEMNODES_SIZE];Node** mem_nodes_dynamic;#ifdef USE_COMBINATION_EXPLOSION_CHECKint num_comb_exp_check;int comb_exp_max_regnum;int curr_max_regnum;int has_recursion;#endif} ScanEnv;#define IS_SYNTAX_OP(syn, opm) (((syn)->op & (opm)) != 0)#define IS_SYNTAX_OP2(syn, opm) (((syn)->op2 & (opm)) != 0)#define IS_SYNTAX_BV(syn, bvm) (((syn)->behavior & (bvm)) != 0)#ifdef USE_NAMED_GROUPtypedef struct {int new_val;} GroupNumRemap;extern int onig_renumber_name_table P_((regex_t* reg, GroupNumRemap* map));#endifextern int onig_strncmp P_((const UChar* s1, const UChar* s2, int n));extern void onig_strcpy P_((UChar* dest, const UChar* src, const UChar* end));extern void onig_scan_env_set_error_string P_((ScanEnv* env, int ecode, UChar* arg, UChar* arg_end));extern int onig_scan_unsigned_number P_((UChar** src, const UChar* end, OnigEncoding enc));extern void onig_reduce_nested_quantifier P_((Node* pnode, Node* cnode));extern void onig_node_conv_to_str_node P_((Node* node, int raw));extern int onig_node_str_cat P_((Node* node, const UChar* s, const UChar* end));extern int onig_node_str_set P_((Node* node, const UChar* s, const UChar* end));extern void onig_node_free P_((Node* node));extern Node* onig_node_new_enclose P_((int type));extern Node* onig_node_new_anchor P_((int type));extern Node* onig_node_new_str P_((const UChar* s, const UChar* end));extern Node* onig_node_new_list P_((Node* left, Node* right));extern Node* onig_node_list_add P_((Node* list, Node* x));extern Node* onig_node_new_alt P_((Node* left, Node* right));extern void onig_node_str_clear P_((Node* node));extern int onig_free_node_list P_((void));extern int onig_names_free P_((regex_t* reg));extern int onig_parse_make_tree P_((Node** root, const UChar* pattern, const UChar* end, regex_t* reg, ScanEnv* env));extern int onig_free_shared_cclass_table P_((void));#ifdef ONIG_DEBUG#ifdef USE_NAMED_GROUPextern int onig_print_names(FILE*, regex_t*);#endif#endif#endif /* REGPARSE_H */
/**********************************************************************regposerr.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "config.h"#include "onigposix.h"#ifdef HAVE_STRING_H# include <string.h>#else# include <strings.h>#endif#if defined(__GNUC__)# define ARG_UNUSED __attribute__ ((unused))#else# define ARG_UNUSED#endifstatic char* ESTRING[] = {NULL,"failed to match", /* REG_NOMATCH */"Invalid regular expression", /* REG_BADPAT */"invalid collating element referenced", /* REG_ECOLLATE */"invalid character class type referenced", /* REG_ECTYPE */"bad backslash-escape sequence", /* REG_EESCAPE */"invalid back reference number", /* REG_ESUBREG */"imbalanced [ and ]", /* REG_EBRACK */"imbalanced ( and )", /* REG_EPAREN */"imbalanced { and }", /* REG_EBRACE */"invalid repeat range {n,m}", /* REG_BADBR */"invalid range", /* REG_ERANGE */"Out of memory", /* REG_ESPACE */"? * + not preceded by valid regular expression", /* REG_BADRPT *//* Extended errors */"internal error", /* REG_EONIG_INTERNAL */"invalid wide char value", /* REG_EONIG_BADWC */"invalid argument", /* REG_EONIG_BADARG */"multi-thread error" /* REG_EONIG_THREAD */};#include <stdio.h>extern size_tregerror(int posix_ecode, const regex_t* reg ARG_UNUSED, char* buf,size_t size){char* s;char tbuf[35];size_t len;if (posix_ecode > 0&& posix_ecode < (int )(sizeof(ESTRING) / sizeof(ESTRING[0]))) {s = ESTRING[posix_ecode];}else if (posix_ecode == 0) {s = "";}else {sprintf(tbuf, "undefined error code (%d)", posix_ecode);s = tbuf;}len = strlen(s) + 1; /* use strlen() because s is ascii encoding. */if (buf != NULL && size > 0) {strncpy(buf, s, size - 1);buf[size - 1] = '\0';}return len;}
/**********************************************************************regposix.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#define regex_t onig_regex_t#include "regint.h"#undef regex_t#include "onigposix.h"#define ONIG_C(reg) ((onig_regex_t* )((reg)->onig))#define PONIG_C(reg) ((onig_regex_t** )(&(reg)->onig))/* #define ENC_STRING_LEN(enc,s,len) len = strlen(s) */#define ENC_STRING_LEN(enc,s,len) do { \if (ONIGENC_MBC_MINLEN(enc) == 1) { \UChar* tmps = (UChar* )(s); \while (*tmps != 0) tmps++; \len = tmps - (UChar* )(s); \} \else { \len = onigenc_str_bytelen_null(enc, (UChar* )s); \} \} while(0)typedef struct {int onig_err;int posix_err;} O2PERR;static intonig2posix_error_code(int code){static const O2PERR o2p[] = {{ ONIG_MISMATCH, REG_NOMATCH },{ ONIG_NO_SUPPORT_CONFIG, REG_EONIG_INTERNAL },{ ONIGERR_MEMORY, REG_ESPACE },{ ONIGERR_MATCH_STACK_LIMIT_OVER, REG_EONIG_INTERNAL },{ ONIGERR_TYPE_BUG, REG_EONIG_INTERNAL },{ ONIGERR_PARSER_BUG, REG_EONIG_INTERNAL },{ ONIGERR_STACK_BUG, REG_EONIG_INTERNAL },{ ONIGERR_UNDEFINED_BYTECODE, REG_EONIG_INTERNAL },{ ONIGERR_UNEXPECTED_BYTECODE, REG_EONIG_INTERNAL },{ ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED, REG_EONIG_BADARG },{ ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR, REG_EONIG_BADARG },{ ONIGERR_INVALID_ARGUMENT, REG_EONIG_BADARG },{ ONIGERR_END_PATTERN_AT_LEFT_BRACE, REG_EBRACE },{ ONIGERR_END_PATTERN_AT_LEFT_BRACKET, REG_EBRACK },{ ONIGERR_EMPTY_CHAR_CLASS, REG_ECTYPE },{ ONIGERR_PREMATURE_END_OF_CHAR_CLASS, REG_ECTYPE },{ ONIGERR_END_PATTERN_AT_ESCAPE, REG_EESCAPE },{ ONIGERR_END_PATTERN_AT_META, REG_EESCAPE },{ ONIGERR_END_PATTERN_AT_CONTROL, REG_EESCAPE },{ ONIGERR_META_CODE_SYNTAX, REG_BADPAT },{ ONIGERR_CONTROL_CODE_SYNTAX, REG_BADPAT },{ ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE, REG_ECTYPE },{ ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE, REG_ECTYPE },{ ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS, REG_ECTYPE },{ ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED, REG_BADRPT },{ ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID, REG_BADRPT },{ ONIGERR_NESTED_REPEAT_OPERATOR, REG_BADRPT },{ ONIGERR_UNMATCHED_CLOSE_PARENTHESIS, REG_EPAREN },{ ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS, REG_EPAREN },{ ONIGERR_END_PATTERN_IN_GROUP, REG_BADPAT },{ ONIGERR_UNDEFINED_GROUP_OPTION, REG_BADPAT },{ ONIGERR_INVALID_POSIX_BRACKET_TYPE, REG_BADPAT },{ ONIGERR_INVALID_LOOK_BEHIND_PATTERN, REG_BADPAT },{ ONIGERR_INVALID_REPEAT_RANGE_PATTERN, REG_BADPAT },{ ONIGERR_TOO_BIG_NUMBER, REG_BADPAT },{ ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE, REG_BADBR },{ ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE, REG_BADBR },{ ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS, REG_ECTYPE },{ ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE, REG_ECTYPE },{ ONIGERR_TOO_MANY_MULTI_BYTE_RANGES, REG_ECTYPE },{ ONIGERR_TOO_SHORT_MULTI_BYTE_STRING, REG_BADPAT },{ ONIGERR_TOO_BIG_BACKREF_NUMBER, REG_ESUBREG },{ ONIGERR_INVALID_BACKREF, REG_ESUBREG },{ ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, REG_BADPAT },{ ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, REG_EONIG_BADWC },{ ONIGERR_TOO_LONG_WIDE_CHAR_VALUE, REG_EONIG_BADWC },{ ONIGERR_INVALID_CODE_POINT_VALUE, REG_EONIG_BADWC },{ ONIGERR_EMPTY_GROUP_NAME, REG_BADPAT },{ ONIGERR_INVALID_GROUP_NAME, REG_BADPAT },{ ONIGERR_INVALID_CHAR_IN_GROUP_NAME, REG_BADPAT },{ ONIGERR_UNDEFINED_NAME_REFERENCE, REG_BADPAT },{ ONIGERR_UNDEFINED_GROUP_REFERENCE, REG_BADPAT },{ ONIGERR_MULTIPLEX_DEFINED_NAME, REG_BADPAT },{ ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, REG_BADPAT },{ ONIGERR_NEVER_ENDING_RECURSION, REG_BADPAT },{ ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, REG_BADPAT },{ ONIGERR_INVALID_CHAR_PROPERTY_NAME, REG_BADPAT },{ ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION, REG_EONIG_BADARG },{ ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT, REG_EONIG_THREAD }};int i;if (code >= 0) return 0;for (i = 0; i < (int )(sizeof(o2p) / sizeof(o2p[0])); i++) {if (code == o2p[i].onig_err)return o2p[i].posix_err;}return REG_EONIG_INTERNAL; /* but, unknown error code */}extern intregcomp(regex_t* reg, const char* pattern, int posix_options){int r, len;OnigSyntaxType* syntax = OnigDefaultSyntax;OnigOptionType options;if ((posix_options & REG_EXTENDED) == 0)syntax = ONIG_SYNTAX_POSIX_BASIC;options = syntax->options;if ((posix_options & REG_ICASE) != 0)ONIG_OPTION_ON(options, ONIG_OPTION_IGNORECASE);if ((posix_options & REG_NEWLINE) != 0) {ONIG_OPTION_ON( options, ONIG_OPTION_NEGATE_SINGLELINE);ONIG_OPTION_OFF(options, ONIG_OPTION_SINGLELINE);}reg->comp_options = posix_options;ENC_STRING_LEN(OnigEncDefaultCharEncoding, pattern, len);r = onig_new(PONIG_C(reg), (UChar* )pattern, (UChar* )(pattern + len),options, OnigEncDefaultCharEncoding, syntax,(OnigErrorInfo* )NULL);if (r != ONIG_NORMAL) {return onig2posix_error_code(r);}reg->re_nsub = ONIG_C(reg)->num_mem;return 0;}extern intregexec(regex_t* reg, const char* str, size_t nmatch,regmatch_t pmatch[], int posix_options){int r, i, len;UChar* end;regmatch_t* pm;OnigOptionType options;options = ONIG_OPTION_POSIX_REGION;if ((posix_options & REG_NOTBOL) != 0) options |= ONIG_OPTION_NOTBOL;if ((posix_options & REG_NOTEOL) != 0) options |= ONIG_OPTION_NOTEOL;if (nmatch == 0 || (reg->comp_options & REG_NOSUB) != 0) {pm = (regmatch_t* )NULL;nmatch = 0;}else if ((int )nmatch < ONIG_C(reg)->num_mem + 1) {pm = (regmatch_t* )xmalloc(sizeof(regmatch_t)* (ONIG_C(reg)->num_mem + 1));if (pm == NULL)return REG_ESPACE;}else {pm = pmatch;}ENC_STRING_LEN(ONIG_C(reg)->enc, str, len);end = (UChar* )(str + len);r = onig_search(ONIG_C(reg), (UChar* )str, end, (UChar* )str, end,(OnigRegion* )pm, options);if (r >= 0) {r = 0; /* Match */if (pm != pmatch && pm != NULL) {xmemcpy(pmatch, pm, sizeof(regmatch_t) * nmatch);}}else if (r == ONIG_MISMATCH) {r = REG_NOMATCH;for (i = 0; i < (int )nmatch; i++)pmatch[i].rm_so = pmatch[i].rm_eo = ONIG_REGION_NOTPOS;}else {r = onig2posix_error_code(r);}if (pm != pmatch && pm != NULL)xfree(pm);#if 0if (reg->re_nsub > nmatch - 1)reg->re_nsub = (nmatch <= 1 ? 0 : nmatch - 1);#endifreturn r;}extern voidregfree(regex_t* reg){onig_free(ONIG_C(reg));}extern voidreg_set_encoding(int mb_code){OnigEncoding enc;switch (mb_code) {case REG_POSIX_ENCODING_ASCII:enc = ONIG_ENCODING_ASCII;break;case REG_POSIX_ENCODING_EUC_JP:enc = ONIG_ENCODING_EUC_JP;break;case REG_POSIX_ENCODING_SJIS:enc = ONIG_ENCODING_SJIS;break;case REG_POSIX_ENCODING_UTF8:enc = ONIG_ENCODING_UTF8;break;case REG_POSIX_ENCODING_UTF16_BE:enc = ONIG_ENCODING_UTF16_BE;break;case REG_POSIX_ENCODING_UTF16_LE:enc = ONIG_ENCODING_UTF16_LE;break;default:return ;break;}onigenc_set_default_encoding(enc);}extern intreg_name_to_group_numbers(regex_t* reg,const unsigned char* name, const unsigned char* name_end, int** nums){return onig_name_to_group_numbers(ONIG_C(reg), name, name_end, nums);}typedef struct {int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*);regex_t* reg;void* arg;} i_wrap;static inti_wrapper(const UChar* name, const UChar* name_end, int ng, int* gs,onig_regex_t* reg ARG_UNUSED, void* arg){i_wrap* warg = (i_wrap* )arg;return (*warg->func)(name, name_end, ng, gs, warg->reg, warg->arg);}extern intreg_foreach_name(regex_t* reg,int (*func)(const unsigned char*, const unsigned char*,int,int*,regex_t*,void*),void* arg){i_wrap warg;warg.func = func;warg.reg = reg;warg.arg = arg;return onig_foreach_name(ONIG_C(reg), i_wrapper, &warg);}extern intreg_number_of_names(regex_t* reg){return onig_number_of_names(ONIG_C(reg));}
/**********************************************************************regsyntax.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2006 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"OnigSyntaxType OnigSyntaxASIS = {0, ONIG_SYN_OP2_INEFFECTIVE_ESCAPE, 0, ONIG_OPTION_NONE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxPosixBasic = {( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_ESC_LPAREN_SUBEXP |ONIG_SYN_OP_ESC_BRACE_INTERVAL ), 0, 0, ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE ),{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxPosixExtended = {( SYN_POSIX_COMMON_OP | ONIG_SYN_OP_LPAREN_SUBEXP |ONIG_SYN_OP_BRACE_INTERVAL |ONIG_SYN_OP_PLUS_ONE_INF | ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_VBAR_ALT ), 0, ( ONIG_SYN_CONTEXT_INDEP_ANCHORS |ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS | ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS |ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP |ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC ), ( ONIG_OPTION_SINGLELINE | ONIG_OPTION_MULTILINE ),{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxEmacs = {( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC |ONIG_SYN_OP_ESC_BRACE_INTERVAL |ONIG_SYN_OP_ESC_LPAREN_SUBEXP | ONIG_SYN_OP_ESC_VBAR_ALT |ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_PLUS_ONE_INF |ONIG_SYN_OP_QMARK_ZERO_ONE | ONIG_SYN_OP_DECIMAL_BACKREF |ONIG_SYN_OP_LINE_ANCHOR | ONIG_SYN_OP_ESC_CONTROL_CHARS ), ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR, ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC, ONIG_OPTION_NONE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxGrep = {( ONIG_SYN_OP_DOT_ANYCHAR | ONIG_SYN_OP_BRACKET_CC | ONIG_SYN_OP_POSIX_BRACKET |ONIG_SYN_OP_ESC_BRACE_INTERVAL | ONIG_SYN_OP_ESC_LPAREN_SUBEXP |ONIG_SYN_OP_ESC_VBAR_ALT |ONIG_SYN_OP_ASTERISK_ZERO_INF | ONIG_SYN_OP_ESC_PLUS_ONE_INF |ONIG_SYN_OP_ESC_QMARK_ZERO_ONE | ONIG_SYN_OP_LINE_ANCHOR |ONIG_SYN_OP_ESC_W_WORD | ONIG_SYN_OP_ESC_B_WORD_BOUND |ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END | ONIG_SYN_OP_DECIMAL_BACKREF ), 0, ( ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC | ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC ), ONIG_OPTION_NONE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxGnuRegex = {SYN_GNU_REGEX_OP, 0, SYN_GNU_REGEX_BV, ONIG_OPTION_NONE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxJava = {(( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |ONIG_SYN_OP_ESC_CONTROL_CHARS | ONIG_SYN_OP_ESC_C_CONTROL |ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 )& ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ), ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE | ONIG_SYN_OP2_QMARK_GROUP_EFFECT |ONIG_SYN_OP2_OPTION_PERL | ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT |ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL | ONIG_SYN_OP2_CCLASS_SET_OP |ONIG_SYN_OP2_ESC_V_VTAB | ONIG_SYN_OP2_ESC_U_HEX4 |ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY ), ( SYN_GNU_REGEX_BV | ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND ), ONIG_OPTION_SINGLELINE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};OnigSyntaxType OnigSyntaxPerl = {(( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |ONIG_SYN_OP_ESC_C_CONTROL )& ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ), ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE |ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL |ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY |ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT ), SYN_GNU_REGEX_BV, ONIG_OPTION_SINGLELINE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};/* Perl + named group */OnigSyntaxType OnigSyntaxPerl_NG = {(( SYN_GNU_REGEX_OP | ONIG_SYN_OP_QMARK_NON_GREEDY |ONIG_SYN_OP_ESC_OCTAL3 | ONIG_SYN_OP_ESC_X_HEX2 |ONIG_SYN_OP_ESC_X_BRACE_HEX8 | ONIG_SYN_OP_ESC_CONTROL_CHARS |ONIG_SYN_OP_ESC_C_CONTROL )& ~ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END ), ( ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE |ONIG_SYN_OP2_QMARK_GROUP_EFFECT | ONIG_SYN_OP2_OPTION_PERL |ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY |ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT |ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP |ONIG_SYN_OP2_ESC_K_NAMED_BACKREF |ONIG_SYN_OP2_ESC_G_SUBEXP_CALL ), ( SYN_GNU_REGEX_BV |ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP |ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME ), ONIG_OPTION_SINGLELINE,{(OnigCodePoint )'\\' /* esc */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */, (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */}};extern intonig_set_default_syntax(OnigSyntaxType* syntax){if (IS_NULL(syntax))syntax = ONIG_SYNTAX_RUBY;OnigDefaultSyntax = syntax;return 0;}extern voidonig_copy_syntax(OnigSyntaxType* to, OnigSyntaxType* from){*to = *from;}extern voidonig_set_syntax_op(OnigSyntaxType* syntax, unsigned int op){syntax->op = op;}extern voidonig_set_syntax_op2(OnigSyntaxType* syntax, unsigned int op2){syntax->op2 = op2;}extern voidonig_set_syntax_behavior(OnigSyntaxType* syntax, unsigned int behavior){syntax->behavior = behavior;}extern voidonig_set_syntax_options(OnigSyntaxType* syntax, OnigOptionType options){syntax->options = options;}extern unsigned intonig_get_syntax_op(OnigSyntaxType* syntax){return syntax->op;}extern unsigned intonig_get_syntax_op2(OnigSyntaxType* syntax){return syntax->op2;}extern unsigned intonig_get_syntax_behavior(OnigSyntaxType* syntax){return syntax->behavior;}extern OnigOptionTypeonig_get_syntax_options(OnigSyntaxType* syntax){return syntax->options;}#ifdef USE_VARIABLE_META_CHARSextern int onig_set_meta_char(OnigSyntaxType* enc,unsigned int what, OnigCodePoint code){switch (what) {case ONIG_META_CHAR_ESCAPE:enc->meta_char_table.esc = code;break;case ONIG_META_CHAR_ANYCHAR:enc->meta_char_table.anychar = code;break;case ONIG_META_CHAR_ANYTIME:enc->meta_char_table.anytime = code;break;case ONIG_META_CHAR_ZERO_OR_ONE_TIME:enc->meta_char_table.zero_or_one_time = code;break;case ONIG_META_CHAR_ONE_OR_MORE_TIME:enc->meta_char_table.one_or_more_time = code;break;case ONIG_META_CHAR_ANYCHAR_ANYTIME:enc->meta_char_table.anychar_anytime = code;break;default:return ONIGERR_INVALID_ARGUMENT;break;}return 0;}#endif /* USE_VARIABLE_META_CHARS */
/**********************************************************************regtrav.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2004 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "regint.h"#ifdef USE_CAPTURE_HISTORYstatic intcapture_tree_traverse(OnigCaptureTreeNode* node, int at,int(*callback_func)(int,int,int,int,int,void*),int level, void* arg){int r, i;if (node == (OnigCaptureTreeNode* )0)return 0;if ((at & ONIG_TRAVERSE_CALLBACK_AT_FIRST) != 0) {r = (*callback_func)(node->group, node->beg, node->end,level, ONIG_TRAVERSE_CALLBACK_AT_FIRST, arg);if (r != 0) return r;}for (i = 0; i < node->num_childs; i++) {r = capture_tree_traverse(node->childs[i], at,callback_func, level + 1, arg);if (r != 0) return r;}if ((at & ONIG_TRAVERSE_CALLBACK_AT_LAST) != 0) {r = (*callback_func)(node->group, node->beg, node->end,level, ONIG_TRAVERSE_CALLBACK_AT_LAST, arg);if (r != 0) return r;}return 0;}#endif /* USE_CAPTURE_HISTORY */extern intonig_capture_tree_traverse(OnigRegion* region, int at,int(*callback_func)(int,int,int,int,int,void*), void* arg){#ifdef USE_CAPTURE_HISTORYreturn capture_tree_traverse(region->history_root, at,callback_func, 0, arg);#elsereturn ONIG_NO_SUPPORT_CONFIG;#endif}
/**********************************************************************regversion.c - Oniguruma (regular expression library)**********************************************************************//*-* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:* 1. Redistributions of source code must retain the above copyright* notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.*/#include "config.h"#include "oniguruma.h"#include <stdio.h>extern const char*onig_version(void){static char s[12];sprintf(s, "%d.%d.%d",ONIGURUMA_VERSION_MAJOR,ONIGURUMA_VERSION_MINOR,ONIGURUMA_VERSION_TEENY);return s;}extern const char*onig_copyright(void){static char s[58];sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2008 K.Kosako",ONIGURUMA_VERSION_MAJOR,ONIGURUMA_VERSION_MINOR,ONIGURUMA_VERSION_TEENY);return s;}
noinst_PROGRAMS = encode listcap names posix simple sql syntax crnllibname = $(top_builddir)/libonig.laLDADD = $(libname)INCLUDES = -I$(top_srcdir) -I$(includedir)encode_SOURCES = encode.clistcap_SOURCES = listcap.cnames_SOURCES = names.cposix_SOURCES = posix.csimple_SOURCES = simple.csql_SOURCES = sql.csyntax_SOURCES = syntax.csampledir = $(top_builddir)/sampletest: encode listcap names posix simple sql syntax@$(sampledir)/encode@$(sampledir)/listcap@$(sampledir)/names@$(sampledir)/posix@$(sampledir)/simple@$(sampledir)/sql@$(sampledir)/syntax
# Makefile.in generated by automake 1.10 from Makefile.am.# @configure_input@# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.# This Makefile.in is free software; the Free Software Foundation# gives unlimited permission to copy and/or distribute it,# with or without modifications, as long as this notice is preserved.# This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY, to the extent permitted by law; without# even the implied warranty of MERCHANTABILITY or FITNESS FOR A# PARTICULAR PURPOSE.@SET_MAKE@VPATH = @srcdir@pkgdatadir = $(datadir)/@PACKAGE@pkglibdir = $(libdir)/@PACKAGE@pkgincludedir = $(includedir)/@PACKAGE@am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cdinstall_sh_DATA = $(install_sh) -c -m 644install_sh_PROGRAM = $(install_sh) -cinstall_sh_SCRIPT = $(install_sh) -cINSTALL_HEADER = $(INSTALL_DATA)transform = $(program_transform_name)NORMAL_INSTALL = :PRE_INSTALL = :POST_INSTALL = :NORMAL_UNINSTALL = :PRE_UNINSTALL = :POST_UNINSTALL = :build_triplet = @build@host_triplet = @host@noinst_PROGRAMS = encode$(EXEEXT) listcap$(EXEEXT) names$(EXEEXT) \posix$(EXEEXT) simple$(EXEEXT) sql$(EXEEXT) syntax$(EXEEXT) \crnl$(EXEEXT)subdir = sampleDIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.inACLOCAL_M4 = $(top_srcdir)/aclocal.m4am__aclocal_m4_deps = $(top_srcdir)/configure.inam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \$(ACLOCAL_M4)mkinstalldirs = $(install_sh) -dCONFIG_HEADER = $(top_builddir)/config.hCONFIG_CLEAN_FILES =PROGRAMS = $(noinst_PROGRAMS)crnl_SOURCES = crnl.ccrnl_OBJECTS = crnl.$(OBJEXT)crnl_LDADD = $(LDADD)crnl_DEPENDENCIES = $(libname)am_encode_OBJECTS = encode.$(OBJEXT)encode_OBJECTS = $(am_encode_OBJECTS)encode_LDADD = $(LDADD)encode_DEPENDENCIES = $(libname)am_listcap_OBJECTS = listcap.$(OBJEXT)listcap_OBJECTS = $(am_listcap_OBJECTS)listcap_LDADD = $(LDADD)listcap_DEPENDENCIES = $(libname)am_names_OBJECTS = names.$(OBJEXT)names_OBJECTS = $(am_names_OBJECTS)names_LDADD = $(LDADD)names_DEPENDENCIES = $(libname)am_posix_OBJECTS = posix.$(OBJEXT)posix_OBJECTS = $(am_posix_OBJECTS)posix_LDADD = $(LDADD)posix_DEPENDENCIES = $(libname)am_simple_OBJECTS = simple.$(OBJEXT)simple_OBJECTS = $(am_simple_OBJECTS)simple_LDADD = $(LDADD)simple_DEPENDENCIES = $(libname)am_sql_OBJECTS = sql.$(OBJEXT)sql_OBJECTS = $(am_sql_OBJECTS)sql_LDADD = $(LDADD)sql_DEPENDENCIES = $(libname)am_syntax_OBJECTS = syntax.$(OBJEXT)syntax_OBJECTS = $(am_syntax_OBJECTS)syntax_LDADD = $(LDADD)syntax_DEPENDENCIES = $(libname)DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@depcomp = $(SHELL) $(top_srcdir)/depcompam__depfiles_maybe = depfilesCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)CCLD = $(CC)LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \$(LDFLAGS) -o $@SOURCES = crnl.c $(encode_SOURCES) $(listcap_SOURCES) $(names_SOURCES) \$(posix_SOURCES) $(simple_SOURCES) $(sql_SOURCES) \$(syntax_SOURCES)DIST_SOURCES = crnl.c $(encode_SOURCES) $(listcap_SOURCES) \$(names_SOURCES) $(posix_SOURCES) $(simple_SOURCES) \$(sql_SOURCES) $(syntax_SOURCES)ETAGS = etagsCTAGS = ctagsDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)ACLOCAL = @ACLOCAL@ALLOCA = @ALLOCA@AMTAR = @AMTAR@AR = @AR@AUTOCONF = @AUTOCONF@AUTOHEADER = @AUTOHEADER@AUTOMAKE = @AUTOMAKE@AWK = @AWK@CC = @CC@CCDEPMODE = @CCDEPMODE@CFLAGS = @CFLAGS@CPP = @CPP@CPPFLAGS = @CPPFLAGS@CYGPATH_W = @CYGPATH_W@DEFS = @DEFS@DEPDIR = @DEPDIR@DSYMUTIL = @DSYMUTIL@DUMPBIN = @DUMPBIN@ECHO_C = @ECHO_C@ECHO_N = @ECHO_N@ECHO_T = @ECHO_T@EGREP = @EGREP@EXEEXT = @EXEEXT@FGREP = @FGREP@GREP = @GREP@INSTALL = @INSTALL@INSTALL_DATA = @INSTALL_DATA@INSTALL_PROGRAM = @INSTALL_PROGRAM@INSTALL_SCRIPT = @INSTALL_SCRIPT@INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@LD = @LD@LDFLAGS = @LDFLAGS@LIBOBJS = @LIBOBJS@LIBS = @LIBS@LIBTOOL = @LIBTOOL@LIPO = @LIPO@LN_S = @LN_S@LTLIBOBJS = @LTLIBOBJS@LTVERSION = @LTVERSION@MAKEINFO = @MAKEINFO@MKDIR_P = @MKDIR_P@NM = @NM@NMEDIT = @NMEDIT@OBJEXT = @OBJEXT@OTOOL = @OTOOL@OTOOL64 = @OTOOL64@PACKAGE = @PACKAGE@PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@PACKAGE_NAME = @PACKAGE_NAME@PACKAGE_STRING = @PACKAGE_STRING@PACKAGE_TARNAME = @PACKAGE_TARNAME@PACKAGE_VERSION = @PACKAGE_VERSION@PATH_SEPARATOR = @PATH_SEPARATOR@RANLIB = @RANLIB@RUBYDIR = @RUBYDIR@SED = @SED@SET_MAKE = @SET_MAKE@SHELL = @SHELL@STATISTICS = @STATISTICS@STRIP = @STRIP@VERSION = @VERSION@abs_builddir = @abs_builddir@abs_srcdir = @abs_srcdir@abs_top_builddir = @abs_top_builddir@abs_top_srcdir = @abs_top_srcdir@ac_ct_CC = @ac_ct_CC@ac_ct_DUMPBIN = @ac_ct_DUMPBIN@am__include = @am__include@am__leading_dot = @am__leading_dot@am__quote = @am__quote@am__tar = @am__tar@am__untar = @am__untar@bindir = @bindir@build = @build@build_alias = @build_alias@build_cpu = @build_cpu@build_os = @build_os@build_vendor = @build_vendor@builddir = @builddir@datadir = @datadir@datarootdir = @datarootdir@docdir = @docdir@dvidir = @dvidir@exec_prefix = @exec_prefix@host = @host@host_alias = @host_alias@host_cpu = @host_cpu@host_os = @host_os@host_vendor = @host_vendor@htmldir = @htmldir@includedir = @includedir@infodir = @infodir@install_sh = @install_sh@libdir = @libdir@libexecdir = @libexecdir@localedir = @localedir@localstatedir = @localstatedir@lt_ECHO = @lt_ECHO@mandir = @mandir@mkdir_p = @mkdir_p@oldincludedir = @oldincludedir@pdfdir = @pdfdir@prefix = @prefix@program_transform_name = @program_transform_name@psdir = @psdir@sbindir = @sbindir@sharedstatedir = @sharedstatedir@srcdir = @srcdir@sysconfdir = @sysconfdir@target_alias = @target_alias@top_builddir = @top_builddir@top_srcdir = @top_srcdir@libname = $(top_builddir)/libonig.laLDADD = $(libname)INCLUDES = -I$(top_srcdir) -I$(includedir)encode_SOURCES = encode.clistcap_SOURCES = listcap.cnames_SOURCES = names.cposix_SOURCES = posix.csimple_SOURCES = simple.csql_SOURCES = sql.csyntax_SOURCES = syntax.csampledir = $(top_builddir)/sampleall: all-am.SUFFIXES:.SUFFIXES: .c .lo .o .obj$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)@for dep in $?; do \case '$(am__configure_deps)' in \*$$dep*) \cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \&& exit 0; \exit 1;; \esac; \done; \echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sample/Makefile'; \cd $(top_srcdir) && \$(AUTOMAKE) --foreign sample/Makefile.PRECIOUS: MakefileMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status@case '$?' in \*config.status*) \cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \*) \echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \esac;$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh$(top_srcdir)/configure: $(am__configure_deps)cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh$(ACLOCAL_M4): $(am__aclocal_m4_deps)cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refreshclean-noinstPROGRAMS:@list='$(noinst_PROGRAMS)'; for p in $$list; do \f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \echo " rm -f $$p $$f"; \rm -f $$p $$f ; \donecrnl$(EXEEXT): $(crnl_OBJECTS) $(crnl_DEPENDENCIES)@rm -f crnl$(EXEEXT)$(LINK) $(crnl_OBJECTS) $(crnl_LDADD) $(LIBS)encode$(EXEEXT): $(encode_OBJECTS) $(encode_DEPENDENCIES)@rm -f encode$(EXEEXT)$(LINK) $(encode_OBJECTS) $(encode_LDADD) $(LIBS)listcap$(EXEEXT): $(listcap_OBJECTS) $(listcap_DEPENDENCIES)@rm -f listcap$(EXEEXT)$(LINK) $(listcap_OBJECTS) $(listcap_LDADD) $(LIBS)names$(EXEEXT): $(names_OBJECTS) $(names_DEPENDENCIES)@rm -f names$(EXEEXT)$(LINK) $(names_OBJECTS) $(names_LDADD) $(LIBS)posix$(EXEEXT): $(posix_OBJECTS) $(posix_DEPENDENCIES)@rm -f posix$(EXEEXT)$(LINK) $(posix_OBJECTS) $(posix_LDADD) $(LIBS)simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES)@rm -f simple$(EXEEXT)$(LINK) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)sql$(EXEEXT): $(sql_OBJECTS) $(sql_DEPENDENCIES)@rm -f sql$(EXEEXT)$(LINK) $(sql_OBJECTS) $(sql_LDADD) $(LIBS)syntax$(EXEEXT): $(syntax_OBJECTS) $(syntax_DEPENDENCIES)@rm -f syntax$(EXEEXT)$(LINK) $(syntax_OBJECTS) $(syntax_LDADD) $(LIBS)mostlyclean-compile:-rm -f *.$(OBJEXT)distclean-compile:-rm -f *.tab.c@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crnl.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listcap.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/names.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sql.Po@am__quote@@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syntax.Po@am__quote@.c.o:@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(COMPILE) -c $<.c.obj:@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`.c.lo:@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<mostlyclean-libtool:-rm -f *.loclean-libtool:-rm -rf .libs _libsID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \unique=`for i in $$list; do \if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \done | \$(AWK) ' { files[$$0] = 1; } \END { for (i in files) print i; }'`; \mkid -fID $$uniquetags: TAGSTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \$(TAGS_FILES) $(LISP)tags=; \here=`pwd`; \list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \unique=`for i in $$list; do \if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \done | \$(AWK) ' { files[$$0] = 1; } \END { for (i in files) print i; }'`; \if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \test -n "$$unique" || unique=$$empty_fix; \$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \$$tags $$unique; \fictags: CTAGSCTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \$(TAGS_FILES) $(LISP)tags=; \here=`pwd`; \list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \unique=`for i in $$list; do \if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \done | \$(AWK) ' { files[$$0] = 1; } \END { for (i in files) print i; }'`; \test -z "$(CTAGS_ARGS)$$tags$$unique" \|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \$$tags $$uniqueGTAGS:here=`$(am__cd) $(top_builddir) && pwd` \&& cd $(top_srcdir) \&& gtags -i $(GTAGS_ARGS) $$heredistclean-tags:-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tagsdistdir: $(DISTFILES)@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \list='$(DISTFILES)'; \dist_files=`for file in $$list; do echo $$file; done | \sed -e "s|^$$srcdirstrip/||;t" \-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \case $$dist_files in \*/*) $(MKDIR_P) `echo "$$dist_files" | \sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \sort -u` ;; \esac; \for file in $$dist_files; do \if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \if test -d $$d/$$file; then \dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \fi; \cp -pR $$d/$$file $(distdir)$$dir || exit 1; \else \test -f $(distdir)/$$file \|| cp -p $$d/$$file $(distdir)/$$file \|| exit 1; \fi; \donecheck-am: all-amcheck: check-amall-am: Makefile $(PROGRAMS)installdirs:install: install-aminstall-exec: install-exec-aminstall-data: install-data-amuninstall: uninstall-aminstall-am: all-am@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-aminstallcheck: installcheck-aminstall-strip:$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \`test -z '$(STRIP)' || \echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` installmostlyclean-generic:clean-generic:distclean-generic:-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)maintainer-clean-generic:@echo "This command is intended for maintainers to use"@echo "it deletes files that may require special tools to rebuild."clean: clean-amclean-am: clean-generic clean-libtool clean-noinstPROGRAMS \mostlyclean-amdistclean: distclean-am-rm -rf ./$(DEPDIR)-rm -f Makefiledistclean-am: clean-am distclean-compile distclean-generic \distclean-tagsdvi: dvi-amdvi-am:html: html-aminfo: info-aminfo-am:install-data-am:install-dvi: install-dvi-aminstall-exec-am:install-html: install-html-aminstall-info: install-info-aminstall-man:install-pdf: install-pdf-aminstall-ps: install-ps-aminstallcheck-am:maintainer-clean: maintainer-clean-am-rm -rf ./$(DEPDIR)-rm -f Makefilemaintainer-clean-am: distclean-am maintainer-clean-genericmostlyclean: mostlyclean-ammostlyclean-am: mostlyclean-compile mostlyclean-generic \mostlyclean-libtoolpdf: pdf-ampdf-am:ps: ps-amps-am:uninstall-am:.MAKE: install-am install-strip.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \clean-libtool clean-noinstPROGRAMS ctags distclean \distclean-compile distclean-generic distclean-libtool \distclean-tags distdir dvi dvi-am html html-am info info-am \install install-am install-data install-data-am install-dvi \install-dvi-am install-exec install-exec-am install-html \install-html-am install-info install-info-am install-man \install-pdf install-pdf-am install-ps install-ps-am \install-strip installcheck installcheck-am installdirs \maintainer-clean maintainer-clean-generic mostlyclean \mostlyclean-compile mostlyclean-generic mostlyclean-libtool \pdf pdf-am ps ps-am tags uninstall uninstall-amtest: encode listcap names posix simple sql syntax@$(sampledir)/encode@$(sampledir)/listcap@$(sampledir)/names@$(sampledir)/posix@$(sampledir)/simple@$(sampledir)/sql@$(sampledir)/syntax# Tell versions [3.59,3.63) of GNU make to not export all variables.# Otherwise a system limit (for SysV at least) may be exceeded..NOEXPORT:
/** crnl.c 2007/05/30 K.Kosako** !!! You should enable USE_CRNL_AS_LINE_TERMINATOR. !!!** USE_CRNL_AS_LINE_TERMINATOR config test program.*/#include <stdio.h>#include <string.h>#include "oniguruma.h"static int nfail = 0;static void result(int no, int from, int to,int expected_from, int expected_to){fprintf(stderr, "%3d: ", no);if (from == expected_from && to == expected_to) {fprintf(stderr, "Success\n");}else {fprintf(stderr, "Fail: expected: (%d-%d), result: (%d-%d)\n",expected_from, expected_to, from, to);nfail++;}}static intx(int no, char* pattern_arg, char* str_arg,int expected_from, int expected_to){int r;unsigned char *start, *range, *end;regex_t* reg;OnigErrorInfo einfo;OnigRegion *region;UChar *pattern, *str;pattern = (UChar* )pattern_arg;str = (UChar* )str_arg;r = onig_new(®, pattern, pattern + strlen((char* )pattern),ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}region = onig_region_new();end = str + strlen((char* )str);start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0 || r == ONIG_MISMATCH) {result(no, region->beg[0], region->end[0], expected_from, expected_to);}else if (r == ONIG_MISMATCH) {result(no, r, -1, expected_from, expected_to);}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);fprintf(stderr, "ERROR: %s\n", s);return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);onig_free(reg);return 0;}static intf(int no, char* pattern_arg, char* str_arg){return x(no, pattern_arg, str_arg, -1, -1);}extern int main(int argc, char* argv[]){x( 1, "", "\r\n", 0, 0);x( 2, ".", "\r\n", 0, 1);f( 3, "..", "\r\n");x( 4, "^", "\r\n", 0, 0);x( 5, "\\n^", "\r\nf", 1, 2);x( 6, "\\n^a", "\r\na", 1, 3);x( 7, "$", "\r\n", 0, 0);x( 8, "T$", "T\r\n", 0, 1);x( 9, "T$", "T\raT\r\n", 3, 4);x(10, "\\z", "\r\n", 2, 2);f(11, "a\\z", "a\r\n");x(12, "\\Z", "\r\n", 0, 0);x(13, "\\Z", "\r\na", 3, 3);x(14, "\\Z", "\r\n\r\n\n", 4, 4);x(15, "\\Z", "\r\n\r\nX", 5, 5);x(16, "a\\Z", "a\r\n", 0, 1);x(17, "aaaaaaaaaaaaaaa\\Z", "aaaaaaaaaaaaaaa\r\n", 0, 15);x(18, "a|$", "b\r\n", 1, 1);x(19, "$|b", "\rb", 1, 2);x(20, "a$|ab$", "\r\nab\r\n", 2, 4);x(21, "a|\\Z", "b\r\n", 1, 1);x(22, "\\Z|b", "\rb", 1, 2);x(23, "a\\Z|ab\\Z", "\r\nab\r\n", 2, 4);x(24, "(?=a$).", "a\r\n", 0, 1);f(25, "(?=a$).", "a\r");x(26, "(?!a$)..", "a\r", 0, 2);x(27, "(?<=a$).\\n", "a\r\n", 1, 3);f(28, "(?<!a$).\\n", "a\r\n");x(29, "(?=a\\Z).", "a\r\n", 0, 1);f(30, "(?=a\\Z).", "a\r");x(31, "(?!a\\Z)..", "a\r", 0, 2);onig_end();if (nfail > 0) {fprintf(stderr, "\n");fprintf(stderr, "!!! You have to enable USE_CRNL_AS_LINE_TERMINATOR\n");fprintf(stderr, "!!! in regenc.h for this test program.\n");fprintf(stderr, "\n");}return 0;}
/** encode.c*/#include <stdio.h>#include "oniguruma.h"static intsearch(regex_t* reg, unsigned char* str, unsigned char* end){int r;unsigned char *start, *range;OnigRegion *region;region = onig_region_new();start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0) {int i;fprintf(stderr, "match at %d (%s)\n", r,ONIGENC_NAME(onig_get_encoding(reg)));for (i = 0; i < region->num_regs; i++) {fprintf(stderr, "%d: (%d-%d)\n", i, region->beg[i], region->end[i]);}}else if (r == ONIG_MISMATCH) {fprintf(stderr, "search fail (%s)\n",ONIGENC_NAME(onig_get_encoding(reg)));}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);fprintf(stderr, "ERROR: %s\n", s);fprintf(stderr, " (%s)\n", ONIGENC_NAME(onig_get_encoding(reg)));return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);return 0;}static intexec(OnigEncoding enc, OnigOptionType options,char* apattern, char* astr){int r;unsigned char *end;regex_t* reg;OnigErrorInfo einfo;UChar* pattern = (UChar* )apattern;UChar* str = (UChar* )astr;r = onig_new(®, pattern,pattern + onigenc_str_bytelen_null(enc, pattern),options, enc, ONIG_SYNTAX_DEFAULT, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}end = str + onigenc_str_bytelen_null(enc, str);r = search(reg, str, end);onig_free(reg);onig_end();return 0;}static OnigCaseFoldType CF = ONIGENC_CASE_FOLD_MIN;#if 0static voidset_case_fold(OnigCaseFoldType cf){CF = cf;}#endifstatic intexec_deluxe(OnigEncoding pattern_enc, OnigEncoding str_enc,OnigOptionType options, char* apattern, char* astr){int r;unsigned char *end;regex_t* reg;OnigCompileInfo ci;OnigErrorInfo einfo;UChar* pattern = (UChar* )apattern;UChar* str = (UChar* )astr;ci.num_of_elements = 5;ci.pattern_enc = pattern_enc;ci.target_enc = str_enc;ci.syntax = ONIG_SYNTAX_DEFAULT;ci.option = options;ci.case_fold_flag = CF;r = onig_new_deluxe(®, pattern,pattern + onigenc_str_bytelen_null(pattern_enc, pattern),&ci, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}end = str + onigenc_str_bytelen_null(str_enc, str);r = search(reg, str, end);onig_free(reg);onig_end();return 0;}extern int main(int argc, char* argv[]){int r;/* ISO 8859-1 test */static unsigned char str[] = { 0xc7, 0xd6, 0xfe, 0xea, 0xe0, 0xe2, 0x00 };static unsigned char pattern[] = { 0xe7, 0xf6, 0xde, '\\', 'w', '+', 0x00 };r = exec(ONIG_ENCODING_CP1251, ONIG_OPTION_IGNORECASE,"aBc", " AbC");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE," [a-c\337z] ", " SS ");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE," [\330-\341] ", " SS ");r = exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE,"\337 ", " Ss ");r = exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE,"SS ", " \337 ");r = exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE,"\\A\\S\\z", "ss");r = exec(ONIG_ENCODING_ISO_8859_2, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_3, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_4, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_5, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_6, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_7, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_8, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_9, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_10, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_11, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_13, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_14, ONIG_OPTION_IGNORECASE,"[ac]+", "bbbaAaCCC");r = exec(ONIG_ENCODING_ISO_8859_15, ONIG_OPTION_IGNORECASE,(char* )pattern, (char* )str);r = exec(ONIG_ENCODING_ISO_8859_16, ONIG_OPTION_IGNORECASE,(char* )pattern, (char* )str);r = exec(ONIG_ENCODING_KOI8_R, ONIG_OPTION_NONE, "a+", "bbbaaaccc");r = exec(ONIG_ENCODING_EUC_TW, ONIG_OPTION_NONE, "b*a+?c+", "bbbaaaccc");r = exec(ONIG_ENCODING_EUC_KR, ONIG_OPTION_NONE, "a+", "bbbaaaccc");r = exec(ONIG_ENCODING_EUC_CN, ONIG_OPTION_NONE, "c+", "bbbaaaccc");r = exec(ONIG_ENCODING_BIG5, ONIG_OPTION_NONE, "a+", "bbbaaaccc");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE,"\337", "SS");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE,"SS", "\337");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE,"SSb\337ssc", "a\337bSS\337cd");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE,"[a\337]{0,2}", "aSS");r = exec(ONIG_ENCODING_ISO_8859_1, ONIG_OPTION_IGNORECASE,"is", "iss");r = exec_deluxe(ONIG_ENCODING_ASCII, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_NONE, "a+","\000b\000a\000a\000a\000c\000c\000\000");r = exec_deluxe(ONIG_ENCODING_ASCII, ONIG_ENCODING_UTF16_LE,ONIG_OPTION_NONE, "a+","b\000a\000a\000a\000a\000c\000\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_LE,ONIG_OPTION_NONE,"\000b\000a\000a\000a\000c\000c\000\000","x\000b\000a\000a\000a\000c\000c\000\000\000");r = exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\337", "\000S\000S\000\000");r = exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"SS", "\000\337\000\000");r = exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_LE,ONIG_OPTION_IGNORECASE,"\337", "S\000S\000\000\000");r = exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF32_BE,ONIG_OPTION_IGNORECASE,"SS", "\000\000\000\337\000\000\000\000");r = exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF32_LE,ONIG_OPTION_IGNORECASE,"\337", "S\000\000\000S\000\000\000\000\000\000\000");r = exec(ONIG_ENCODING_UTF16_BE, ONIG_OPTION_NONE,"\000[\000[\000:\000a\000l\000n\000u\000m\000:\000]\000]\000+\000\000","\000#\002\120\000a\000Z\012\077\012\076\012\075\000\000");/* 0x0a3d == \012\075 : is not alnum *//* 0x0a3e == \012\076 : is alnum */r = exec(ONIG_ENCODING_UTF16_BE, ONIG_OPTION_NONE,"\000\\\000d\000+\000\000","\0003\0001\377\020\377\031\377\032\000\000");r = exec(ONIG_ENCODING_GB18030, ONIG_OPTION_IGNORECASE,"(Aa\\d)+", "BaA5Aa0234");r = exec_deluxe(ONIG_ENCODING_ISO_8859_1, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_NONE,"^\\P{Hiragana}\\p{^Hiragana}(\\p{Hiragana}+)$","\060\100\060\240\060\101\060\102\060\226\060\237\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\000[\000\337\000]\000\000", "\000S\000S\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\000[\000\337\000]\000\000", "\000s\000S\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\000^\000[\000\001\000-\377\375\000]\000$\000\000","\000s\000S\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\000S\000S\000\000","\000S\000T\000\337\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\000S\000T\000S\000S\000\000","\000S\000t\000s\000S\000\000");{UChar pat[] = { 0x1f, 0xfc, 0x00, 0x00 };UChar str1[] = { 0x21, 0x26, 0x1f, 0xbe, 0x00, 0x00 };UChar str2[] = { 0x1f, 0xf3, 0x00, 0x00 };r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,(char* )pat, (char* )str1);r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,(char* )pat, (char* )str2);}#if 0/* You should define USE_UNICODE_CASE_FOLD_TURKISH_AZERI in regenc.h. */set_case_fold(ONIGENC_CASE_FOLD_TURKISH_AZERI);r = exec_deluxe(ONIG_ENCODING_UTF8, ONIG_ENCODING_UTF8,ONIG_OPTION_IGNORECASE,"Ii", "\304\261\304\260");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\000I\000i\000\000", "\001\061\001\060\000\000");r = exec_deluxe(ONIG_ENCODING_UTF16_BE, ONIG_ENCODING_UTF16_BE,ONIG_OPTION_IGNORECASE,"\001\061\001\060\000\000", "\000I\000i\000\000");set_case_fold(ONIGENC_CASE_FOLD_MIN);#endifreturn 0;}
/** listcap.c** capture history (?@...) sample.*/#include <stdio.h>#include <string.h>#include "oniguruma.h"static intnode_callback(int group, int beg, int end, int level, int at, void* arg){int i;if (at != ONIG_TRAVERSE_CALLBACK_AT_FIRST)return -1; /* error *//* indent */for (i = 0; i < level * 2; i++)fputc(' ', stderr);fprintf(stderr, "%d: (%d-%d)\n", group, beg, end);return 0;}extern int ex(unsigned char* str, unsigned char* pattern,OnigSyntaxType* syntax){int r;unsigned char *start, *range, *end;regex_t* reg;OnigErrorInfo einfo;OnigRegion *region;r = onig_new(®, pattern, pattern + strlen((char* )pattern),ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, syntax, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}fprintf(stderr, "number of captures: %d\n", onig_number_of_captures(reg));fprintf(stderr, "number of capture histories: %d\n",onig_number_of_capture_histories(reg));region = onig_region_new();end = str + strlen((char* )str);start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0) {int i;fprintf(stderr, "match at %d\n", r);for (i = 0; i < region->num_regs; i++) {fprintf(stderr, "%d: (%d-%d)\n", i, region->beg[i], region->end[i]);}fprintf(stderr, "\n");r = onig_capture_tree_traverse(region, ONIG_TRAVERSE_CALLBACK_AT_FIRST,node_callback, (void* )0);}else if (r == ONIG_MISMATCH) {fprintf(stderr, "search fail\n");}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);onig_free(reg);return 0;}extern int main(int argc, char* argv[]){int r;OnigSyntaxType syn;static UChar* str1 = (UChar* )"((())())";static UChar* pattern1= (UChar* )"\\g<p>(?@<p>\\(\\g<s>\\)){0}(?@<s>(?:\\g<p>)*|){0}";static UChar* str2 = (UChar* )"x00x00x00";static UChar* pattern2 = (UChar* )"(?@x(?@\\d+))+";static UChar* str3 = (UChar* )"0123";static UChar* pattern3 = (UChar* )"(?@.)(?@.)(?@.)(?@.)";/* enable capture hostory */onig_copy_syntax(&syn, ONIG_SYNTAX_DEFAULT);onig_set_syntax_op2(&syn,onig_get_syntax_op2(&syn) | ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY);r = ex(str1, pattern1, &syn);r = ex(str2, pattern2, &syn);r = ex(str3, pattern3, &syn);onig_end();return 0;}
/** names.c -- example of group name callback.*/#include <stdio.h>#include <string.h>#include "oniguruma.h"static intname_callback(const UChar* name, const UChar* name_end,int ngroup_num, int* group_nums,regex_t* reg, void* arg){int i, gn, ref;char* s;OnigRegion *region = (OnigRegion* )arg;for (i = 0; i < ngroup_num; i++) {gn = group_nums[i];ref = onig_name_to_backref_number(reg, name, name_end, region);s = (ref == gn ? "*" : "");fprintf(stderr, "%s (%d): ", name, gn);fprintf(stderr, "(%d-%d) %s\n", region->beg[gn], region->end[gn], s);}return 0; /* 0: continue */}extern int main(int argc, char* argv[]){int r;unsigned char *start, *range, *end;regex_t* reg;OnigErrorInfo einfo;OnigRegion *region;static UChar* pattern = (UChar* )"(?<foo>a*)(?<bar>b*)(?<foo>c*)";static UChar* str = (UChar* )"aaabbbbcc";r = onig_new(®, pattern, pattern + strlen((char* )pattern),ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}fprintf(stderr, "number of names: %d\n", onig_number_of_names(reg));region = onig_region_new();end = str + strlen((char* )str);start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0) {fprintf(stderr, "match at %d\n\n", r);r = onig_foreach_name(reg, name_callback, (void* )region);}else if (r == ONIG_MISMATCH) {fprintf(stderr, "search fail\n");}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);onig_free(reg);onig_end();return 0;}
/** posix.c*/#include <stdio.h>#include "onigposix.h"typedef unsigned char UChar;static int x(regex_t* reg, unsigned char* pattern, unsigned char* str){int r, i;char buf[200];regmatch_t pmatch[20];r = regexec(reg, (char* )str, reg->re_nsub + 1, pmatch, 0);if (r != 0 && r != REG_NOMATCH) {regerror(r, reg, buf, sizeof(buf));fprintf(stderr, "ERROR: %s\n", buf);return -1;}if (r == REG_NOMATCH) {fprintf(stderr, "FAIL: /%s/ '%s'\n", pattern, str);}else {fprintf(stderr, "OK: /%s/ '%s'\n", pattern, str);for (i = 0; i <= (int )reg->re_nsub; i++) {fprintf(stderr, "%d: %d-%d\n", i, pmatch[i].rm_so, pmatch[i].rm_eo);}}return 0;}extern int main(int argc, char* argv[]){int r;char buf[200];regex_t reg;UChar* pattern;/* default syntax (ONIG_SYNTAX_RUBY) */pattern = (UChar* )"^a+b{2,7}[c-f]?$|uuu";r = regcomp(®, (char* )pattern, REG_EXTENDED);if (r) {regerror(r, ®, buf, sizeof(buf));fprintf(stderr, "ERROR: %s\n", buf);return -1;}x(®, pattern, (UChar* )"aaabbbbd");/* POSIX Basic RE (REG_EXTENDED is not specified.) */pattern = (UChar* )"^a+b{2,7}[c-f]?|uuu";r = regcomp(®, (char* )pattern, 0);if (r) {regerror(r, ®, buf, sizeof(buf));fprintf(stderr, "ERROR: %s\n", buf);return -1;}x(®, pattern, (UChar* )"a+b{2,7}d?|uuu");/* POSIX Basic RE (REG_EXTENDED is not specified.) */pattern = (UChar* )"^a*b\\{2,7\\}\\([c-f]\\)$";r = regcomp(®, (char* )pattern, 0);if (r) {regerror(r, ®, buf, sizeof(buf));fprintf(stderr, "ERROR: %s\n", buf);return -1;}x(®, pattern, (UChar* )"aaaabbbbbbd");/* POSIX Extended RE */onig_set_default_syntax(ONIG_SYNTAX_POSIX_EXTENDED);pattern = (UChar* )"^a+b{2,7}[c-f]?)$|uuu";r = regcomp(®, (char* )pattern, REG_EXTENDED);if (r) {regerror(r, ®, buf, sizeof(buf));fprintf(stderr, "ERROR: %s\n", buf);return -1;}x(®, pattern, (UChar* )"aaabbbbd)");pattern = (UChar* )"^b.";r = regcomp(®, (char* )pattern, REG_EXTENDED | REG_NEWLINE);if (r) {regerror(r, ®, buf, sizeof(buf));fprintf(stderr, "ERROR: %s\n", buf);return -1;}x(®, pattern, (UChar* )"a\nb\n");regfree(®);return 0;}
/** simple.c*/#include <stdio.h>#include <string.h>#include "oniguruma.h"extern int main(int argc, char* argv[]){int r;unsigned char *start, *range, *end;regex_t* reg;OnigErrorInfo einfo;OnigRegion *region;static UChar* pattern = (UChar* )"a(.*)b|[e-f]+";static UChar* str = (UChar* )"zzzzaffffffffb";r = onig_new(®, pattern, pattern + strlen((char* )pattern),ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}region = onig_region_new();end = str + strlen((char* )str);start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0) {int i;fprintf(stderr, "match at %d\n", r);for (i = 0; i < region->num_regs; i++) {fprintf(stderr, "%d: (%d-%d)\n", i, region->beg[i], region->end[i]);}}else if (r == ONIG_MISMATCH) {fprintf(stderr, "search fail\n");}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);fprintf(stderr, "ERROR: %s\n", s);return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);onig_free(reg);onig_end();return 0;}
/** sql.c*/#include <stdio.h>#include <string.h>#include "oniguruma.h"extern int main(int argc, char* argv[]){static OnigSyntaxType SQLSyntax;int r;unsigned char *start, *range, *end;regex_t* reg;OnigErrorInfo einfo;OnigRegion *region;static UChar* pattern = (UChar* )"\\_%\\\\__zz";static UChar* str = (UChar* )"a_abcabcabc\\ppzz";onig_set_syntax_op (&SQLSyntax, ONIG_SYN_OP_VARIABLE_META_CHARACTERS);onig_set_syntax_op2 (&SQLSyntax, 0);onig_set_syntax_behavior(&SQLSyntax, 0);onig_set_syntax_options (&SQLSyntax, ONIG_OPTION_MULTILINE);onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ESCAPE, (OnigCodePoint )'\\');onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ANYCHAR, (OnigCodePoint )'_');onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ANYTIME,ONIG_INEFFECTIVE_META_CHAR);onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ZERO_OR_ONE_TIME,ONIG_INEFFECTIVE_META_CHAR);onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ONE_OR_MORE_TIME,ONIG_INEFFECTIVE_META_CHAR);onig_set_meta_char(&SQLSyntax, ONIG_META_CHAR_ANYCHAR_ANYTIME,(OnigCodePoint )'%');r = onig_new(®, pattern, pattern + strlen((char* )pattern),ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, &SQLSyntax, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}region = onig_region_new();end = str + strlen((char* )str);start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0) {int i;fprintf(stderr, "match at %d\n", r);for (i = 0; i < region->num_regs; i++) {fprintf(stderr, "%d: (%d-%d)\n", i, region->beg[i], region->end[i]);}}else if (r == ONIG_MISMATCH) {fprintf(stderr, "search fail\n");}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);fprintf(stderr, "ERROR: %s\n", s);return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);onig_free(reg);onig_end();return 0;}
/** syntax.c*/#include <stdio.h>#include <string.h>#include "oniguruma.h"extern int exec(OnigSyntaxType* syntax,char* apattern, char* astr){int r;unsigned char *start, *range, *end;regex_t* reg;OnigErrorInfo einfo;OnigRegion *region;UChar* pattern = (UChar* )apattern;UChar* str = (UChar* )astr;r = onig_new(®, pattern, pattern + strlen((char* )pattern),ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, syntax, &einfo);if (r != ONIG_NORMAL) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(stderr, "ERROR: %s\n", s);return -1;}region = onig_region_new();end = str + strlen((char* )str);start = str;range = end;r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);if (r >= 0) {int i;fprintf(stderr, "match at %d\n", r);for (i = 0; i < region->num_regs; i++) {fprintf(stderr, "%d: (%d-%d)\n", i, region->beg[i], region->end[i]);}}else if (r == ONIG_MISMATCH) {fprintf(stderr, "search fail\n");}else { /* error */char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);fprintf(stderr, "ERROR: %s\n", s);return -1;}onig_region_free(region, 1 /* 1:free self, 0:free contents only */);onig_free(reg);onig_end();return 0;}extern int main(int argc, char* argv[]){int r;r = exec(ONIG_SYNTAX_PERL,"\\p{XDigit}\\P{XDigit}\\p{^XDigit}\\P{^XDigit}\\p{XDigit}","bgh3a");r = exec(ONIG_SYNTAX_JAVA,"\\p{XDigit}\\P{XDigit}[a-c&&b-g]", "bgc");r = exec(ONIG_SYNTAX_ASIS,"abc def* e+ g?ddd[a-rvvv] (vv){3,7}hv\\dvv(?:aczui ss)\\W\\w$","abc def* e+ g?ddd[a-rvvv] (vv){3,7}hv\\dvv(?:aczui ss)\\W\\w$");onig_end();return 0;}
/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. *//* static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; */#include <stdio.h>#include <stdlib.h>#include <string.h>#ifdef _WIN32#include <malloc.h>#endif#include "regint.h"#include "st.h"typedef struct st_table_entry st_table_entry;struct st_table_entry {unsigned int hash;st_data_t key;st_data_t record;st_table_entry *next;};#define ST_DEFAULT_MAX_DENSITY 5#define ST_DEFAULT_INIT_TABLE_SIZE 11/** DEFAULT_MAX_DENSITY is the default for the largest we allow the* average number of items per bin before increasing the number of* bins** DEFAULT_INIT_TABLE_SIZE is the default for the number of bins* allocated initially**/static int numcmp(long, long);static int numhash(long);static struct st_hash_type type_numhash = {numcmp,numhash,};/* extern int strcmp(const char *, const char *); */static int strhash(const char *);static struct st_hash_type type_strhash = {strcmp,strhash,};static void rehash(st_table *);#define alloc(type) (type*)xmalloc((unsigned)sizeof(type))#define Calloc(n,s) (char*)xcalloc((n),(s))#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0)#define do_hash(key,table) (unsigned int)(*(table)->type->hash)((key))#define do_hash_bin(key,table) (do_hash(key, table)%(table)->num_bins)/** MINSIZE is the minimum size of a dictionary.*/#define MINSIZE 8/*Table of prime numbers 2^n+a, 2<=n<=30.*/static const long primes[] = {8 + 3,16 + 3,32 + 5,64 + 3,128 + 3,256 + 27,512 + 9,1024 + 9,2048 + 5,4096 + 3,8192 + 27,16384 + 43,32768 + 3,65536 + 45,131072 + 29,262144 + 3,524288 + 21,1048576 + 7,2097152 + 17,4194304 + 15,8388608 + 9,16777216 + 43,33554432 + 35,67108864 + 15,134217728 + 29,268435456 + 3,536870912 + 11,1073741824 + 85,0};static intnew_size(size)int size;{int i;#if 0for (i=3; i<31; i++) {if ((1<<i) > size) return 1<<i;}return -1;#elseint newsize;for (i = 0, newsize = MINSIZE;i < (int )(sizeof(primes)/sizeof(primes[0]));i++, newsize <<= 1){if (newsize > size) return primes[i];}/* Ran out of polynomials */return -1; /* should raise exception */#endif}#ifdef HASH_LOGstatic int collision = 0;static int init_st = 0;static voidstat_col(){FILE *f = fopen("/tmp/col", "w");fprintf(f, "collision: %d\n", collision);fclose(f);}#endifst_table*st_init_table_with_size(type, size)struct st_hash_type *type;int size;{st_table *tbl;#ifdef HASH_LOGif (init_st == 0) {init_st = 1;atexit(stat_col);}#endifsize = new_size(size); /* round up to prime number */tbl = alloc(st_table);tbl->type = type;tbl->num_entries = 0;tbl->num_bins = size;tbl->bins = (st_table_entry **)Calloc(size, sizeof(st_table_entry*));return tbl;}st_table*st_init_table(type)struct st_hash_type *type;{return st_init_table_with_size(type, 0);}st_table*st_init_numtable(void){return st_init_table(&type_numhash);}st_table*st_init_numtable_with_size(size)int size;{return st_init_table_with_size(&type_numhash, size);}st_table*st_init_strtable(void){return st_init_table(&type_strhash);}st_table*st_init_strtable_with_size(size)int size;{return st_init_table_with_size(&type_strhash, size);}voidst_free_table(table)st_table *table;{register st_table_entry *ptr, *next;int i;for(i = 0; i < table->num_bins; i++) {ptr = table->bins[i];while (ptr != 0) {next = ptr->next;free(ptr);ptr = next;}}free(table->bins);free(table);}#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key)))#ifdef HASH_LOG#define COLLISION collision++#else#define COLLISION#endif#define FIND_ENTRY(table, ptr, hash_val, bin_pos) do {\bin_pos = hash_val%(table)->num_bins;\ptr = (table)->bins[bin_pos];\if (PTR_NOT_EQUAL(table, ptr, hash_val, key)) {\COLLISION;\while (PTR_NOT_EQUAL(table, ptr->next, hash_val, key)) {\ptr = ptr->next;\}\ptr = ptr->next;\}\} while (0)intst_lookup(table, key, value)st_table *table;register st_data_t key;st_data_t *value;{unsigned int hash_val, bin_pos;register st_table_entry *ptr;hash_val = do_hash(key, table);FIND_ENTRY(table, ptr, hash_val, bin_pos);if (ptr == 0) {return 0;}else {if (value != 0) *value = ptr->record;return 1;}}#define ADD_DIRECT(table, key, value, hash_val, bin_pos)\do {\st_table_entry *entry;\if (table->num_entries/(table->num_bins) > ST_DEFAULT_MAX_DENSITY) {\rehash(table);\bin_pos = hash_val % table->num_bins;\}\\entry = alloc(st_table_entry);\\entry->hash = hash_val;\entry->key = key;\entry->record = value;\entry->next = table->bins[bin_pos];\table->bins[bin_pos] = entry;\table->num_entries++;\} while (0)intst_insert(table, key, value)register st_table *table;register st_data_t key;st_data_t value;{unsigned int hash_val, bin_pos;register st_table_entry *ptr;hash_val = do_hash(key, table);FIND_ENTRY(table, ptr, hash_val, bin_pos);if (ptr == 0) {ADD_DIRECT(table, key, value, hash_val, bin_pos);return 0;}else {ptr->record = value;return 1;}}voidst_add_direct(table, key, value)st_table *table;st_data_t key;st_data_t value;{unsigned int hash_val, bin_pos;hash_val = do_hash(key, table);bin_pos = hash_val % table->num_bins;ADD_DIRECT(table, key, value, hash_val, bin_pos);}static voidrehash(table)register st_table *table;{register st_table_entry *ptr, *next, **new_bins;int i, old_num_bins = table->num_bins, new_num_bins;unsigned int hash_val;new_num_bins = new_size(old_num_bins+1);new_bins = (st_table_entry**)Calloc(new_num_bins, sizeof(st_table_entry*));for(i = 0; i < old_num_bins; i++) {ptr = table->bins[i];while (ptr != 0) {next = ptr->next;hash_val = ptr->hash % new_num_bins;ptr->next = new_bins[hash_val];new_bins[hash_val] = ptr;ptr = next;}}free(table->bins);table->num_bins = new_num_bins;table->bins = new_bins;}st_table*st_copy(old_table)st_table *old_table;{st_table *new_table;st_table_entry *ptr, *entry;int i, num_bins = old_table->num_bins;new_table = alloc(st_table);if (new_table == 0) {return 0;}*new_table = *old_table;new_table->bins = (st_table_entry**)Calloc((unsigned)num_bins, sizeof(st_table_entry*));if (new_table->bins == 0) {free(new_table);return 0;}for(i = 0; i < num_bins; i++) {new_table->bins[i] = 0;ptr = old_table->bins[i];while (ptr != 0) {entry = alloc(st_table_entry);if (entry == 0) {free(new_table->bins);free(new_table);return 0;}*entry = *ptr;entry->next = new_table->bins[i];new_table->bins[i] = entry;ptr = ptr->next;}}return new_table;}intst_delete(table, key, value)register st_table *table;register st_data_t *key;st_data_t *value;{unsigned int hash_val;st_table_entry *tmp;register st_table_entry *ptr;hash_val = do_hash_bin(*key, table);ptr = table->bins[hash_val];if (ptr == 0) {if (value != 0) *value = 0;return 0;}if (EQUAL(table, *key, ptr->key)) {table->bins[hash_val] = ptr->next;table->num_entries--;if (value != 0) *value = ptr->record;*key = ptr->key;free(ptr);return 1;}for(; ptr->next != 0; ptr = ptr->next) {if (EQUAL(table, ptr->next->key, *key)) {tmp = ptr->next;ptr->next = ptr->next->next;table->num_entries--;if (value != 0) *value = tmp->record;*key = tmp->key;free(tmp);return 1;}}return 0;}intst_delete_safe(table, key, value, never)register st_table *table;register st_data_t *key;st_data_t *value;st_data_t never;{unsigned int hash_val;register st_table_entry *ptr;hash_val = do_hash_bin(*key, table);ptr = table->bins[hash_val];if (ptr == 0) {if (value != 0) *value = 0;return 0;}for(; ptr != 0; ptr = ptr->next) {if ((ptr->key != never) && EQUAL(table, ptr->key, *key)) {table->num_entries--;*key = ptr->key;if (value != 0) *value = ptr->record;ptr->key = ptr->record = never;return 1;}}return 0;}static int#if defined(__GNUC__)delete_never(st_data_t key __attribute__ ((unused)), st_data_t value,st_data_t never)#elsedelete_never(key, value, never)st_data_t key, value, never;#endif{if (value == never) return ST_DELETE;return ST_CONTINUE;}voidst_cleanup_safe(table, never)st_table *table;st_data_t never;{int num_entries = table->num_entries;st_foreach(table, delete_never, never);table->num_entries = num_entries;}intst_foreach(table, func, arg)st_table *table;int (*func)();st_data_t arg;{st_table_entry *ptr, *last, *tmp;enum st_retval retval;int i;for(i = 0; i < table->num_bins; i++) {last = 0;for(ptr = table->bins[i]; ptr != 0;) {retval = (*func)(ptr->key, ptr->record, arg);switch (retval) {case ST_CHECK: /* check if hash is modified during iteration */tmp = 0;if (i < table->num_bins) {for (tmp = table->bins[i]; tmp; tmp=tmp->next) {if (tmp == ptr) break;}}if (!tmp) {/* call func with error notice */return 1;}/* fall through */case ST_CONTINUE:last = ptr;ptr = ptr->next;break;case ST_STOP:return 0;case ST_DELETE:tmp = ptr;if (last == 0) {table->bins[i] = ptr->next;}else {last->next = ptr->next;}ptr = ptr->next;free(tmp);table->num_entries--;}}}return 0;}static intstrhash(string)register const char *string;{register int c;#ifdef HASH_ELFHASHregister unsigned int h = 0, g;while ((c = *string++) != '\0') {h = ( h << 4 ) + c;if ( g = h & 0xF0000000 )h ^= g >> 24;h &= ~g;}return h;#elif HASH_PERLregister int val = 0;while ((c = *string++) != '\0') {val += c;val += (val << 10);val ^= (val >> 6);}val += (val << 3);val ^= (val >> 11);return val + (val << 15);#elseregister int val = 0;while ((c = *string++) != '\0') {val = val*997 + c;}return val + (val>>5);#endif}static intnumcmp(x, y)long x, y;{return x != y;}static intnumhash(n)long n;{return n;}
/* This is a public domain general purpose hash table package written by Peter Moore @ UCB. *//* @(#) st.h 5.1 89/12/14 */#ifndef ST_INCLUDED#define ST_INCLUDEDtypedef unsigned long st_data_t;#define ST_DATA_T_DEFINEDtypedef struct st_table st_table;struct st_hash_type {int (*compare)();int (*hash)();};struct st_table {struct st_hash_type *type;int num_bins;int num_entries;struct st_table_entry **bins;};#define st_is_member(table,key) st_lookup(table,key,(st_data_t *)0)enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};#ifndef _# define _(args) args#endif#ifndef ANYARGS# ifdef __cplusplus# define ANYARGS ...# else# define ANYARGS# endif#endifst_table *st_init_table _((struct st_hash_type *));st_table *st_init_table_with_size _((struct st_hash_type *, int));st_table *st_init_numtable _((void));st_table *st_init_numtable_with_size _((int));st_table *st_init_strtable _((void));st_table *st_init_strtable_with_size _((int));int st_delete _((st_table *, st_data_t *, st_data_t *));int st_delete_safe _((st_table *, st_data_t *, st_data_t *, st_data_t));int st_insert _((st_table *, st_data_t, st_data_t));int st_lookup _((st_table *, st_data_t, st_data_t *));int st_foreach _((st_table *, int (*)(ANYARGS), st_data_t));void st_add_direct _((st_table *, st_data_t, st_data_t));void st_free_table _((st_table *));void st_cleanup_safe _((st_table *, st_data_t));st_table *st_copy _((st_table *));#define ST_NUMCMP ((int (*)()) 0)#define ST_NUMHASH ((int (*)()) -2)#define st_numcmp ST_NUMCMP#define st_numhash ST_NUMHASH#endif /* ST_INCLUDED */
/** This program was generated by testconv.rb.*/#include<stdio.h>#ifdef POSIX_TEST#include "onigposix.h"#else#include "oniguruma.h"#endifstatic int nsucc = 0;static int nfail = 0;static int nerror = 0;static FILE* err_file;#ifndef POSIX_TESTstatic OnigRegion* region;static OnigEncoding ENC;#endif#define ulen(p) onigenc_str_bytelen_null(ENC, (UChar* )p)static void uconv(char* from, char* to, int len){int i;unsigned char c;char *q;q = to;for (i = 0; i < len; i += 2) {c = (unsigned char )from[i];if (c == 0) {c = (unsigned char )from[i+1];if (c < 0x20 || c >= 0x7f || c == 0x5c || c == 0x22) {sprintf(q, "\\%03o", c);q += 4;}else {sprintf(q, "%c", c);q++;}}else {sprintf(q, "\\%03o", c);q += 4;c = (unsigned char )from[i+1];sprintf(q, "\\%03o", c);q += 4;}}*q = 0;}static void xx(char* pattern, char* str, int from, int to, int mem, int not){int r;char cpat[4000], cstr[4000];#ifdef POSIX_TESTregex_t reg;char buf[200];regmatch_t pmatch[20];uconv(pattern, cpat, ulen(pattern));uconv(str, cstr, ulen(str));r = regcomp(®, pattern, REG_EXTENDED | REG_NEWLINE);if (r) {regerror(r, ®, buf, sizeof(buf));fprintf(err_file, "ERROR: %s\n", buf);nerror++;return ;}r = regexec(®, str, reg.re_nsub + 1, pmatch, 0);if (r != 0 && r != REG_NOMATCH) {regerror(r, ®, buf, sizeof(buf));fprintf(err_file, "ERROR: %s\n", buf);nerror++;return ;}if (r == REG_NOMATCH) {if (not) {fprintf(stdout, "OK(N): /%s/ '%s'\n", cpat, cstr);nsucc++;}else {fprintf(stdout, "FAIL: /%s/ '%s'\n", cpat, cstr);nfail++;}}else {if (not) {fprintf(stdout, "FAIL(N): /%s/ '%s'\n", cpat, cstr);nfail++;}else {if (pmatch[mem].rm_so == from && pmatch[mem].rm_eo == to) {fprintf(stdout, "OK: /%s/ '%s'\n", cpat, cstr);nsucc++;}else {fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", cpat, cstr,from, to, pmatch[mem].rm_so, pmatch[mem].rm_eo);nfail++;}}}regfree(®);#elseregex_t* reg;OnigCompileInfo ci;OnigErrorInfo einfo;uconv(pattern, cpat, ulen(pattern));uconv(str, cstr, ulen(str));#if 0r = onig_new(®, (UChar* )pattern, (UChar* )(pattern + ulen(pattern)),ONIG_OPTION_DEFAULT, ENC, ONIG_SYNTAX_DEFAULT, &einfo);#elseci.num_of_elements = 5;ci.pattern_enc = ENC;ci.target_enc = ENC;ci.syntax = ONIG_SYNTAX_DEFAULT;ci.option = ONIG_OPTION_DEFAULT;ci.case_fold_flag = ONIGENC_CASE_FOLD_DEFAULT;r = onig_new_deluxe(®, (UChar* )pattern,(UChar* )(pattern + ulen(pattern)),&ci, &einfo);#endifif (r) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r, &einfo);fprintf(err_file, "ERROR: %s\n", s);nerror++;return ;}r = onig_search(reg, (UChar* )str, (UChar* )(str + ulen(str)),(UChar* )str, (UChar* )(str + ulen(str)),region, ONIG_OPTION_NONE);if (r < ONIG_MISMATCH) {char s[ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(s, r);fprintf(err_file, "ERROR: %s\n", s);nerror++;return ;}if (r == ONIG_MISMATCH) {if (not) {fprintf(stdout, "OK(N): /%s/ '%s'\n", cpat, cstr);nsucc++;}else {fprintf(stdout, "FAIL: /%s/ '%s'\n", cpat, cstr);nfail++;}}else {if (not) {fprintf(stdout, "FAIL(N): /%s/ '%s'\n", cpat, cstr);nfail++;}else {if (region->beg[mem] == from && region->end[mem] == to) {fprintf(stdout, "OK: /%s/ '%s'\n", cpat, cstr);nsucc++;}else {fprintf(stdout, "FAIL: /%s/ '%s' %d-%d : %d-%d\n", cpat, cstr,from, to, region->beg[mem], region->end[mem]);nfail++;}}}onig_free(reg);#endif}static void x2(char* pattern, char* str, int from, int to){xx(pattern, str, from, to, 0, 0);}static void x3(char* pattern, char* str, int from, int to, int mem){xx(pattern, str, from, to, mem, 0);}static void n(char* pattern, char* str){xx(pattern, str, 0, 0, 0, 1);}extern int main(int argc, char* argv[]){err_file = stdout;#ifndef POSIX_TESTregion = onig_region_new();#endif#ifdef POSIX_TESTreg_set_encoding(REG_POSIX_ENCODING_UTF16_BE);#elseENC = ONIG_ENCODING_UTF16_BE;#endifx2("\000\000", "\000\000", 0, 0);x2("\000^\000\000", "\000\000", 0, 0);x2("\000$\000\000", "\000\000", 0, 0);x2("\000\134\000G\000\000", "\000\000", 0, 0);x2("\000\134\000A\000\000", "\000\000", 0, 0);x2("\000\134\000Z\000\000", "\000\000", 0, 0);x2("\000\134\000z\000\000", "\000\000", 0, 0);x2("\000^\000$\000\000", "\000\000", 0, 0);x2("\000\134\000c\000a\000\000", "\000\001\000\000", 0, 2);x2("\000\134\000C\000-\000b\000\000", "\000\002\000\000", 0, 2);x2("\000\134\000c\000\134\000\134\000\000", "\000\034\000\000", 0, 2);x2("\000q\000[\000\134\000c\000\134\000\134\000]\000\000", "\000q\000\034\000\000", 0, 4);x2("\000\000", "\000a\000\000", 0, 0);x2("\000a\000\000", "\000a\000\000", 0, 2);x2("\000\134\000x\0000\0000\000\134\000x\0006\0001\000\000", "\000a\000\000", 0, 2);x2("\000a\000a\000\000", "\000a\000a\000\000", 0, 4);x2("\000a\000a\000a\000\000", "\000a\000a\000a\000\000", 0, 6);x2("\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000\000", "\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000a\000\000", 0, 70);x2("\000a\000b\000\000", "\000a\000b\000\000", 0, 4);x2("\000b\000\000", "\000a\000b\000\000", 2, 4);x2("\000b\000c\000\000", "\000a\000b\000c\000\000", 2, 6);x2("\000(\000?\000i\000:\000#\000R\000E\000T\000#\000)\000\000", "\000#\000I\000N\000S\000#\000#\000R\000E\000T\000#\000\000", 10, 20);x2("\000\134\0000\0000\0000\000\134\0001\0007\000\000", "\000\017\000\000", 0, 2);x2("\000\134\000x\0000\0000\000\134\000x\0001\000f\000\000", "\000\037\000\000", 0, 2);x2("\000a\000(\000?\000#\000.\000.\000.\000.\000\134\000\134\000J\000J\000J\000J\000)\000b\000\000", "\000a\000b\000\000", 0, 4);x2("\000(\000?\000x\000)\000 \000 \000G\000 \000(\000o\000 \000O\000(\000?\000-\000x\000)\000o\000O\000)\000 \000g\000 \000L\000\000", "\000G\000o\000O\000o\000O\000g\000L\000e\000\000", 0, 14);x2("\000.\000\000", "\000a\000\000", 0, 2);n("\000.\000\000", "\000\000");x2("\000.\000.\000\000", "\000a\000b\000\000", 0, 4);x2("\000\134\000w\000\000", "\000e\000\000", 0, 2);n("\000\134\000W\000\000", "\000e\000\000");x2("\000\134\000s\000\000", "\000 \000\000", 0, 2);x2("\000\134\000S\000\000", "\000b\000\000", 0, 2);x2("\000\134\000d\000\000", "\0004\000\000", 0, 2);n("\000\134\000D\000\000", "\0004\000\000");x2("\000\134\000b\000\000", "\000z\000 \000\000", 0, 0);x2("\000\134\000b\000\000", "\000 \000z\000\000", 2, 2);x2("\000\134\000B\000\000", "\000z\000z\000 \000\000", 2, 2);x2("\000\134\000B\000\000", "\000z\000 \000\000", 4, 4);x2("\000\134\000B\000\000", "\000 \000z\000\000", 0, 0);x2("\000[\000a\000b\000]\000\000", "\000b\000\000", 0, 2);n("\000[\000a\000b\000]\000\000", "\000c\000\000");x2("\000[\000a\000-\000z\000]\000\000", "\000t\000\000", 0, 2);n("\000[\000^\000a\000]\000\000", "\000a\000\000");x2("\000[\000^\000a\000]\000\000", "\000\012\000\000", 0, 2);x2("\000[\000]\000]\000\000", "\000]\000\000", 0, 2);n("\000[\000^\000]\000]\000\000", "\000]\000\000");x2("\000[\000\134\000^\000]\000+\000\000", "\0000\000^\000^\0001\000\000", 2, 6);x2("\000[\000b\000-\000]\000\000", "\000b\000\000", 0, 2);x2("\000[\000b\000-\000]\000\000", "\000-\000\000", 0, 2);x2("\000[\000\134\000w\000]\000\000", "\000z\000\000", 0, 2);n("\000[\000\134\000w\000]\000\000", "\000 \000\000");x2("\000[\000\134\000W\000]\000\000", "\000b\000$\000\000", 2, 4);x2("\000[\000\134\000d\000]\000\000", "\0005\000\000", 0, 2);n("\000[\000\134\000d\000]\000\000", "\000e\000\000");x2("\000[\000\134\000D\000]\000\000", "\000t\000\000", 0, 2);n("\000[\000\134\000D\000]\000\000", "\0003\000\000");x2("\000[\000\134\000s\000]\000\000", "\000 \000\000", 0, 2);n("\000[\000\134\000s\000]\000\000", "\000a\000\000");x2("\000[\000\134\000S\000]\000\000", "\000b\000\000", 0, 2);n("\000[\000\134\000S\000]\000\000", "\000 \000\000");x2("\000[\000\134\000w\000\134\000d\000]\000\000", "\0002\000\000", 0, 2);n("\000[\000\134\000w\000\134\000d\000]\000\000", "\000 \000\000");x2("\000[\000[\000:\000u\000p\000p\000e\000r\000:\000]\000]\000\000", "\000B\000\000", 0, 2);x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]\000\000", "\000+\000\000", 0, 2);x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]\000\000", "\000G\000H\000I\000K\000K\000-\0009\000+\000*\000\000", 12, 14);x2("\000[\000*\000[\000:\000x\000d\000i\000g\000i\000t\000:\000]\000+\000]\000\000", "\000-\000@\000^\000+\000\000", 6, 8);n("\000[\000[\000:\000u\000p\000p\000e\000r\000]\000]\000\000", "\000A\000\000");x2("\000[\000[\000:\000u\000p\000p\000e\000r\000]\000]\000\000", "\000:\000\000", 0, 2);x2("\000[\000\134\0000\0000\0000\000\134\0000\0004\0004\000-\000\134\0000\0000\0000\000\134\0000\0004\0007\000]\000\000", "\000&\000\000", 0, 2);x2("\000[\000\134\000x\0000\0000\000\134\000x\0005\000a\000-\000\134\000x\0000\0000\000\134\000x\0005\000c\000]\000\000", "\000[\000\000", 0, 2);x2("\000[\000\134\000x\0000\0000\000\134\000x\0006\000A\000-\000\134\000x\0000\0000\000\134\000x\0006\000D\000]\000\000", "\000l\000\000", 0, 2);n("\000[\000\134\000x\0000\0000\000\134\000x\0006\000A\000-\000\134\000x\0000\0000\000\134\000x\0006\000D\000]\000\000", "\000n\000\000");n("\000^\000[\0000\000-\0009\000A\000-\000F\000]\000+\000 \0000\000+\000 \000U\000N\000D\000E\000F\000 \000\000", "\0007\0005\000F\000 \0000\0000\0000\0000\0000\0000\0000\0000\000 \000S\000E\000C\000T\0001\0004\000A\000 \000n\000o\000t\000y\000p\000e\000 \000(\000)\000 \000 \000 \000 \000E\000x\000t\000e\000r\000n\000a\000l\000 \000 \000 \000 \000|\000 \000_\000r\000b\000_\000a\000p\000p\000l\000y\000\000");x2("\000[\000\134\000[\000]\000\000", "\000[\000\000", 0, 2);x2("\000[\000\134\000]\000]\000\000", "\000]\000\000", 0, 2);x2("\000[\000&\000]\000\000", "\000&\000\000", 0, 2);x2("\000[\000[\000a\000b\000]\000]\000\000", "\000b\000\000", 0, 2);x2("\000[\000[\000a\000b\000]\000c\000]\000\000", "\000c\000\000", 0, 2);n("\000[\000[\000^\000a\000]\000]\000\000", "\000a\000\000");n("\000[\000^\000[\000a\000]\000]\000\000", "\000a\000\000");x2("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", "\000b\000\000", 0, 2);n("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", "\000a\000\000");n("\000[\000[\000a\000b\000]\000&\000&\000b\000c\000]\000\000", "\000c\000\000");x2("\000[\000a\000-\000z\000&\000&\000b\000-\000y\000&\000&\000c\000-\000x\000]\000\000", "\000w\000\000", 0, 2);n("\000[\000^\000a\000-\000z\000&\000&\000b\000-\000y\000&\000&\000c\000-\000x\000]\000\000", "\000w\000\000");x2("\000[\000[\000^\000a\000&\000&\000a\000]\000&\000&\000a\000-\000z\000]\000\000", "\000b\000\000", 0, 2);n("\000[\000[\000^\000a\000&\000&\000a\000]\000&\000&\000a\000-\000z\000]\000\000", "\000a\000\000");x2("\000[\000[\000^\000a\000-\000z\000&\000&\000b\000c\000d\000e\000f\000]\000&\000&\000[\000^\000c\000-\000g\000]\000]\000\000", "\000h\000\000", 0, 2);n("\000[\000[\000^\000a\000-\000z\000&\000&\000b\000c\000d\000e\000f\000]\000&\000&\000[\000^\000c\000-\000g\000]\000]\000\000", "\000c\000\000");x2("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^\000c\000d\000e\000]\000]\000\000", "\000c\000\000", 0, 2);x2("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^\000c\000d\000e\000]\000]\000\000", "\000e\000\000", 0, 2);n("\000[\000^\000[\000^\000a\000b\000c\000]\000&\000&\000[\000^\000c\000d\000e\000]\000]\000\000", "\000f\000\000");x2("\000[\000a\000-\000&\000&\000-\000a\000]\000\000", "\000-\000\000", 0, 2);n("\000[\000a\000\134\000-\000&\000&\000\134\000-\000a\000]\000\000", "\000&\000\000");n("\000\134\000w\000a\000b\000c\000\000", "\000 \000a\000b\000c\000\000");x2("\000a\000\134\000W\000b\000c\000\000", "\000a\000 \000b\000c\000\000", 0, 8);x2("\000a\000.\000b\000.\000c\000\000", "\000a\000a\000b\000b\000c\000\000", 0, 10);x2("\000.\000\134\000w\000b\000\134\000W\000.\000.\000c\000\000", "\000a\000b\000b\000 \000b\000c\000c\000\000", 0, 14);x2("\000\134\000s\000\134\000w\000z\000z\000z\000\000", "\000 \000z\000z\000z\000z\000\000", 0, 10);x2("\000a\000a\000.\000b\000\000", "\000a\000a\000b\000b\000\000", 0, 8);n("\000.\000a\000\000", "\000a\000b\000\000");x2("\000.\000a\000\000", "\000a\000a\000\000", 0, 4);x2("\000^\000a\000\000", "\000a\000\000", 0, 2);x2("\000^\000a\000$\000\000", "\000a\000\000", 0, 2);x2("\000^\000\134\000w\000$\000\000", "\000a\000\000", 0, 2);n("\000^\000\134\000w\000$\000\000", "\000 \000\000");x2("\000^\000\134\000w\000a\000b\000$\000\000", "\000z\000a\000b\000\000", 0, 6);x2("\000^\000\134\000w\000a\000b\000c\000d\000e\000f\000$\000\000", "\000z\000a\000b\000c\000d\000e\000f\000\000", 0, 14);x2("\000^\000\134\000w\000.\000.\000.\000d\000e\000f\000$\000\000", "\000z\000a\000b\000c\000d\000e\000f\000\000", 0, 14);x2("\000\134\000w\000\134\000w\000\134\000s\000\134\000W\000a\000a\000a\000\134\000d\000\000", "\000a\000a\000 \000 \000a\000a\000a\0004\000\000", 0, 16);x2("\000\134\000A\000\134\000Z\000\000", "\000\000", 0, 0);x2("\000\134\000A\000x\000y\000z\000\000", "\000x\000y\000z\000\000", 0, 6);x2("\000x\000y\000z\000\134\000Z\000\000", "\000x\000y\000z\000\000", 0, 6);x2("\000x\000y\000z\000\134\000z\000\000", "\000x\000y\000z\000\000", 0, 6);x2("\000a\000\134\000Z\000\000", "\000a\000\000", 0, 2);x2("\000\134\000G\000a\000z\000\000", "\000a\000z\000\000", 0, 4);n("\000\134\000G\000z\000\000", "\000b\000z\000a\000\000");n("\000a\000z\000\134\000G\000\000", "\000a\000z\000\000");n("\000a\000z\000\134\000A\000\000", "\000a\000z\000\000");n("\000a\000\134\000A\000z\000\000", "\000a\000z\000\000");x2("\000\134\000^\000\134\000$\000\000", "\000^\000$\000\000", 0, 4);x2("\000^\000x\000?\000y\000\000", "\000x\000y\000\000", 0, 4);x2("\000^\000(\000x\000?\000y\000)\000\000", "\000x\000y\000\000", 0, 4);x2("\000\134\000w\000\000", "\000_\000\000", 0, 2);n("\000\134\000W\000\000", "\000_\000\000");x2("\000(\000?\000=\000z\000)\000z\000\000", "\000z\000\000", 0, 2);n("\000(\000?\000=\000z\000)\000.\000\000", "\000a\000\000");x2("\000(\000?\000!\000z\000)\000a\000\000", "\000a\000\000", 0, 2);n("\000(\000?\000!\000z\000)\000a\000\000", "\000z\000\000");x2("\000(\000?\000i\000:\000a\000)\000\000", "\000a\000\000", 0, 2);x2("\000(\000?\000i\000:\000a\000)\000\000", "\000A\000\000", 0, 2);x2("\000(\000?\000i\000:\000A\000)\000\000", "\000a\000\000", 0, 2);n("\000(\000?\000i\000:\000A\000)\000\000", "\000b\000\000");x2("\000(\000?\000i\000:\000[\000A\000-\000Z\000]\000)\000\000", "\000a\000\000", 0, 2);x2("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", "\000H\000\000", 0, 2);x2("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", "\000h\000\000", 0, 2);n("\000(\000?\000i\000:\000[\000f\000-\000m\000]\000)\000\000", "\000e\000\000");x2("\000(\000?\000i\000:\000[\000A\000-\000c\000]\000)\000\000", "\000D\000\000", 0, 2);n("\000(\000?\000i\000:\000[\000^\000a\000-\000z\000]\000)\000\000", "\000A\000\000");n("\000(\000?\000i\000:\000[\000^\000a\000-\000z\000]\000)\000\000", "\000a\000\000");x2("\000(\000?\000i\000:\000[\000!\000-\000k\000]\000)\000\000", "\000Z\000\000", 0, 2);x2("\000(\000?\000i\000:\000[\000!\000-\000k\000]\000)\000\000", "\0007\000\000", 0, 2);x2("\000(\000?\000i\000:\000[\000T\000-\000}\000]\000)\000\000", "\000b\000\000", 0, 2);x2("\000(\000?\000i\000:\000[\000T\000-\000}\000]\000)\000\000", "\000{\000\000", 0, 2);x2("\000(\000?\000i\000:\000\134\000?\000a\000)\000\000", "\000?\000A\000\000", 0, 4);x2("\000(\000?\000i\000:\000\134\000*\000A\000)\000\000", "\000*\000a\000\000", 0, 4);n("\000.\000\000", "\000\012\000\000");x2("\000(\000?\000m\000:\000.\000)\000\000", "\000\012\000\000", 0, 2);x2("\000(\000?\000m\000:\000a\000.\000)\000\000", "\000a\000\012\000\000", 0, 4);x2("\000(\000?\000m\000:\000.\000b\000)\000\000", "\000a\000\012\000b\000\000", 2, 6);x2("\000.\000*\000a\000b\000c\000\000", "\000d\000d\000d\000a\000b\000d\000d\000\012\000d\000d\000a\000b\000c\000\000", 16, 26);x2("\000(\000?\000m\000:\000.\000*\000a\000b\000c\000)\000\000", "\000d\000d\000d\000a\000b\000d\000d\000a\000b\000c\000\000", 0, 20);n("\000(\000?\000i\000)\000(\000?\000-\000i\000)\000a\000\000", "\000A\000\000");n("\000(\000?\000i\000)\000(\000?\000-\000i\000:\000a\000)\000\000", "\000A\000\000");x2("\000a\000?\000\000", "\000\000", 0, 0);x2("\000a\000?\000\000", "\000b\000\000", 0, 0);x2("\000a\000?\000\000", "\000a\000\000", 0, 2);x2("\000a\000*\000\000", "\000\000", 0, 0);x2("\000a\000*\000\000", "\000a\000\000", 0, 2);x2("\000a\000*\000\000", "\000a\000a\000a\000\000", 0, 6);x2("\000a\000*\000\000", "\000b\000a\000a\000a\000a\000\000", 0, 0);n("\000a\000+\000\000", "\000\000");x2("\000a\000+\000\000", "\000a\000\000", 0, 2);x2("\000a\000+\000\000", "\000a\000a\000a\000a\000\000", 0, 8);x2("\000a\000+\000\000", "\000a\000a\000b\000b\000b\000\000", 0, 4);x2("\000a\000+\000\000", "\000b\000a\000a\000a\000a\000\000", 2, 10);x2("\000.\000?\000\000", "\000\000", 0, 0);x2("\000.\000?\000\000", "\000f\000\000", 0, 2);x2("\000.\000?\000\000", "\000\012\000\000", 0, 0);x2("\000.\000*\000\000", "\000\000", 0, 0);x2("\000.\000*\000\000", "\000a\000b\000c\000d\000e\000\000", 0, 10);x2("\000.\000+\000\000", "\000z\000\000", 0, 2);x2("\000.\000+\000\000", "\000z\000d\000s\000w\000e\000r\000\012\000\000", 0, 12);x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", "\000b\000a\000b\000f\000b\000a\000c\000\000", 0, 8);x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", "\000b\000a\000c\000b\000a\000b\000f\000\000", 6, 14);x2("\000(\000(\000.\000*\000)\000a\000\134\0002\000f\000)\000\000", "\000b\000a\000c\000b\000a\000b\000f\000\000", 6, 14);x2("\000(\000.\000*\000)\000a\000\134\0001\000f\000\000", "\000b\000a\000c\000z\000z\000z\000z\000z\000z\000\012\000b\000a\000z\000z\000\012\000z\000z\000z\000z\000b\000a\000b\000f\000\000", 38, 46);x2("\000a\000|\000b\000\000", "\000a\000\000", 0, 2);x2("\000a\000|\000b\000\000", "\000b\000\000", 0, 2);x2("\000|\000a\000\000", "\000a\000\000", 0, 0);x2("\000(\000|\000a\000)\000\000", "\000a\000\000", 0, 0);x2("\000a\000b\000|\000b\000c\000\000", "\000a\000b\000\000", 0, 4);x2("\000a\000b\000|\000b\000c\000\000", "\000b\000c\000\000", 0, 4);x2("\000z\000(\000?\000:\000a\000b\000|\000b\000c\000)\000\000", "\000z\000b\000c\000\000", 0, 6);x2("\000a\000(\000?\000:\000a\000b\000|\000b\000c\000)\000c\000\000", "\000a\000a\000b\000c\000\000", 0, 8);x2("\000a\000b\000|\000(\000?\000:\000a\000c\000|\000a\000z\000)\000\000", "\000a\000z\000\000", 0, 4);x2("\000a\000|\000b\000|\000c\000\000", "\000d\000c\000\000", 2, 4);x2("\000a\000|\000b\000|\000c\000d\000|\000e\000f\000g\000|\000h\000|\000i\000j\000k\000|\000l\000m\000n\000|\000o\000|\000p\000q\000|\000r\000s\000t\000u\000v\000w\000x\000|\000y\000z\000\000", "\000p\000q\000r\000\000", 0, 4);n("\000a\000|\000b\000|\000c\000d\000|\000e\000f\000g\000|\000h\000|\000i\000j\000k\000|\000l\000m\000n\000|\000o\000|\000p\000q\000|\000r\000s\000t\000u\000v\000w\000x\000|\000y\000z\000\000", "\000m\000n\000\000");x2("\000a\000|\000^\000z\000\000", "\000b\000a\000\000", 2, 4);x2("\000a\000|\000^\000z\000\000", "\000z\000a\000\000", 0, 2);x2("\000a\000|\000\134\000G\000z\000\000", "\000b\000z\000a\000\000", 4, 6);x2("\000a\000|\000\134\000G\000z\000\000", "\000z\000a\000\000", 0, 2);x2("\000a\000|\000\134\000A\000z\000\000", "\000b\000z\000a\000\000", 4, 6);x2("\000a\000|\000\134\000A\000z\000\000", "\000z\000a\000\000", 0, 2);x2("\000a\000|\000b\000\134\000Z\000\000", "\000b\000a\000\000", 2, 4);x2("\000a\000|\000b\000\134\000Z\000\000", "\000b\000\000", 0, 2);x2("\000a\000|\000b\000\134\000z\000\000", "\000b\000a\000\000", 2, 4);x2("\000a\000|\000b\000\134\000z\000\000", "\000b\000\000", 0, 2);x2("\000\134\000w\000|\000\134\000s\000\000", "\000 \000\000", 0, 2);n("\000\134\000w\000|\000\134\000w\000\000", "\000 \000\000");x2("\000\134\000w\000|\000%\000\000", "\000%\000\000", 0, 2);x2("\000\134\000w\000|\000[\000&\000$\000]\000\000", "\000&\000\000", 0, 2);x2("\000[\000b\000-\000d\000]\000|\000[\000^\000e\000-\000z\000]\000\000", "\000a\000\000", 0, 2);x2("\000(\000?\000:\000a\000|\000[\000c\000-\000f\000]\000)\000|\000b\000z\000\000", "\000d\000z\000\000", 0, 2);x2("\000(\000?\000:\000a\000|\000[\000c\000-\000f\000]\000)\000|\000b\000z\000\000", "\000b\000z\000\000", 0, 4);x2("\000a\000b\000c\000|\000(\000?\000=\000z\000z\000)\000.\000.\000f\000\000", "\000z\000z\000f\000\000", 0, 6);x2("\000a\000b\000c\000|\000(\000?\000!\000z\000z\000)\000.\000.\000f\000\000", "\000a\000b\000f\000\000", 0, 6);x2("\000(\000?\000=\000z\000a\000)\000.\000.\000a\000|\000(\000?\000=\000z\000z\000)\000.\000.\000a\000\000", "\000z\000z\000a\000\000", 0, 6);n("\000(\000?\000>\000a\000|\000a\000b\000d\000)\000c\000\000", "\000a\000b\000d\000c\000\000");x2("\000(\000?\000>\000a\000b\000d\000|\000a\000)\000c\000\000", "\000a\000b\000d\000c\000\000", 0, 8);x2("\000a\000?\000|\000b\000\000", "\000a\000\000", 0, 2);x2("\000a\000?\000|\000b\000\000", "\000b\000\000", 0, 0);x2("\000a\000?\000|\000b\000\000", "\000\000", 0, 0);x2("\000a\000*\000|\000b\000\000", "\000a\000a\000\000", 0, 4);x2("\000a\000*\000|\000b\000*\000\000", "\000b\000a\000\000", 0, 0);x2("\000a\000*\000|\000b\000*\000\000", "\000a\000b\000\000", 0, 2);x2("\000a\000+\000|\000b\000*\000\000", "\000\000", 0, 0);x2("\000a\000+\000|\000b\000*\000\000", "\000b\000b\000b\000\000", 0, 6);x2("\000a\000+\000|\000b\000*\000\000", "\000a\000b\000b\000b\000\000", 0, 2);n("\000a\000+\000|\000b\000+\000\000", "\000\000");x2("\000(\000a\000|\000b\000)\000?\000\000", "\000b\000\000", 0, 2);x2("\000(\000a\000|\000b\000)\000*\000\000", "\000b\000a\000\000", 0, 4);x2("\000(\000a\000|\000b\000)\000+\000\000", "\000b\000a\000b\000\000", 0, 6);x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", "\000c\000a\000a\000b\000b\000c\000\000", 0, 8);x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", "\000a\000a\000b\000c\000a\000\000", 2, 10);x2("\000(\000a\000b\000|\000c\000a\000)\000+\000\000", "\000a\000b\000z\000c\000a\000\000", 0, 4);x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000a\000b\000a\000b\000a\000\000", 0, 10);x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000b\000a\000\000", 2, 4);x2("\000(\000a\000|\000b\000a\000b\000)\000+\000\000", "\000b\000a\000a\000a\000b\000a\000\000", 2, 8);x2("\000(\000?\000:\000a\000|\000b\000)\000(\000?\000:\000a\000|\000b\000)\000\000", "\000a\000b\000\000", 0, 4);x2("\000(\000?\000:\000a\000*\000|\000b\000*\000)\000(\000?\000:\000a\000*\000|\000b\000*\000)\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 6);x2("\000(\000?\000:\000a\000*\000|\000b\000*\000)\000(\000?\000:\000a\000+\000|\000b\000+\000)\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 12);x2("\000(\000?\000:\000a\000+\000|\000b\000+\000)\000{\0002\000}\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 12);x2("\000h\000{\0000\000,\000}\000\000", "\000h\000h\000h\000h\000\000", 0, 8);x2("\000(\000?\000:\000a\000+\000|\000b\000+\000)\000{\0001\000,\0002\000}\000\000", "\000a\000a\000a\000b\000b\000b\000\000", 0, 12);n("\000a\000x\000{\0002\000}\000*\000a\000\000", "\0000\000a\000x\000x\000x\000a\0001\000\000");n("\000a\000.\000{\0000\000,\0002\000}\000a\000\000", "\0000\000a\000X\000X\000X\000a\0000\000\000");n("\000a\000.\000{\0000\000,\0002\000}\000?\000a\000\000", "\0000\000a\000X\000X\000X\000a\0000\000\000");n("\000a\000.\000{\0000\000,\0002\000}\000?\000a\000\000", "\0000\000a\000X\000X\000X\000X\000a\0000\000\000");x2("\000^\000a\000{\0002\000,\000}\000?\000a\000$\000\000", "\000a\000a\000a\000\000", 0, 6);x2("\000^\000[\000a\000-\000z\000]\000{\0002\000,\000}\000?\000$\000\000", "\000a\000a\000a\000\000", 0, 6);x2("\000(\000?\000:\000a\000+\000|\000\134\000A\000b\000*\000)\000c\000c\000\000", "\000c\000c\000\000", 0, 4);n("\000(\000?\000:\000a\000+\000|\000\134\000A\000b\000*\000)\000c\000c\000\000", "\000a\000b\000c\000c\000\000");x2("\000(\000?\000:\000^\000a\000+\000|\000b\000+\000)\000*\000c\000\000", "\000a\000a\000b\000b\000b\000a\000b\000c\000\000", 12, 16);x2("\000(\000?\000:\000^\000a\000+\000|\000b\000+\000)\000*\000c\000\000", "\000a\000a\000b\000b\000b\000b\000c\000\000", 0, 14);x2("\000a\000|\000(\000?\000i\000)\000c\000\000", "\000C\000\000", 0, 2);x2("\000(\000?\000i\000)\000c\000|\000a\000\000", "\000C\000\000", 0, 2);x2("\000(\000?\000i\000)\000c\000|\000a\000\000", "\000A\000\000", 0, 2);x2("\000(\000?\000i\000:\000c\000)\000|\000a\000\000", "\000C\000\000", 0, 2);n("\000(\000?\000i\000:\000c\000)\000|\000a\000\000", "\000A\000\000");x2("\000[\000a\000b\000c\000]\000?\000\000", "\000a\000b\000c\000\000", 0, 2);x2("\000[\000a\000b\000c\000]\000*\000\000", "\000a\000b\000c\000\000", 0, 6);x2("\000[\000^\000a\000b\000c\000]\000*\000\000", "\000a\000b\000c\000\000", 0, 0);n("\000[\000^\000a\000b\000c\000]\000+\000\000", "\000a\000b\000c\000\000");x2("\000a\000?\000?\000\000", "\000a\000a\000a\000\000", 0, 0);x2("\000b\000a\000?\000?\000b\000\000", "\000b\000a\000b\000\000", 0, 6);x2("\000a\000*\000?\000\000", "\000a\000a\000a\000\000", 0, 0);x2("\000b\000a\000*\000?\000\000", "\000b\000a\000a\000\000", 0, 2);x2("\000b\000a\000*\000?\000b\000\000", "\000b\000a\000a\000b\000\000", 0, 8);x2("\000a\000+\000?\000\000", "\000a\000a\000a\000\000", 0, 2);x2("\000b\000a\000+\000?\000\000", "\000b\000a\000a\000\000", 0, 4);x2("\000b\000a\000+\000?\000b\000\000", "\000b\000a\000a\000b\000\000", 0, 8);x2("\000(\000?\000:\000a\000?\000)\000?\000?\000\000", "\000a\000\000", 0, 0);x2("\000(\000?\000:\000a\000?\000?\000)\000?\000\000", "\000a\000\000", 0, 0);x2("\000(\000?\000:\000a\000?\000)\000+\000?\000\000", "\000a\000a\000a\000\000", 0, 2);x2("\000(\000?\000:\000a\000+\000)\000?\000?\000\000", "\000a\000a\000a\000\000", 0, 0);x2("\000(\000?\000:\000a\000+\000)\000?\000?\000b\000\000", "\000a\000a\000a\000b\000\000", 0, 8);x2("\000(\000?\000:\000a\000b\000)\000?\000{\0002\000}\000\000", "\000\000", 0, 0);x2("\000(\000?\000:\000a\000b\000)\000?\000{\0002\000}\000\000", "\000a\000b\000a\000b\000a\000\000", 0, 8);x2("\000(\000?\000:\000a\000b\000)\000*\000{\0000\000}\000\000", "\000a\000b\000a\000b\000a\000\000", 0, 0);x2("\000(\000?\000:\000a\000b\000)\000{\0003\000,\000}\000\000", "\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 16);n("\000(\000?\000:\000a\000b\000)\000{\0003\000,\000}\000\000", "\000a\000b\000a\000b\000\000");x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000\000", "\000a\000b\000a\000b\000a\000b\000\000", 0, 12);x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000\000", "\000a\000b\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 16);x2("\000(\000?\000:\000a\000b\000)\000{\0002\000,\0004\000}\000?\000\000", "\000a\000b\000a\000b\000a\000b\000a\000b\000a\000b\000\000", 0, 8);x2("\000(\000?\000:\000a\000b\000)\000{\000,\000}\000\000", "\000a\000b\000{\000,\000}\000\000", 0, 10);x2("\000(\000?\000:\000a\000b\000c\000)\000+\000?\000{\0002\000}\000\000", "\000a\000b\000c\000a\000b\000c\000a\000b\000c\000\000", 0, 12);x2("\000(\000?\000:\000X\000*\000)\000(\000?\000i\000:\000x\000a\000)\000\000", "\000X\000X\000X\000a\000\000", 0, 8);x2("\000(\000d\000+\000)\000(\000[\000^\000a\000b\000c\000]\000z\000)\000\000", "\000d\000d\000d\000z\000\000", 0, 8);x2("\000(\000[\000^\000a\000b\000c\000]\000*\000)\000(\000[\000^\000a\000b\000c\000]\000z\000)\000\000", "\000d\000d\000d\000z\000\000", 0, 8);x2("\000(\000\134\000w\000+\000)\000(\000\134\000w\000z\000)\000\000", "\000d\000d\000d\000z\000\000", 0, 8);x3("\000(\000a\000)\000\000", "\000a\000\000", 0, 2, 1);x3("\000(\000a\000b\000)\000\000", "\000a\000b\000\000", 0, 4, 1);x2("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4);x3("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 1);x3("\000(\000(\000a\000b\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 2);x3("\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000a\000b\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000\000", "\000a\000b\000\000", 0, 4, 20);x3("\000(\000a\000b\000)\000(\000c\000d\000)\000\000", "\000a\000b\000c\000d\000\000", 0, 4, 1);x3("\000(\000a\000b\000)\000(\000c\000d\000)\000\000", "\000a\000b\000c\000d\000\000", 4, 8, 2);x3("\000(\000)\000(\000a\000)\000b\000c\000(\000d\000e\000f\000)\000g\000h\000i\000j\000k\000\000", "\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000\000", 6, 12, 3);x3("\000(\000(\000)\000(\000a\000)\000b\000c\000(\000d\000e\000f\000)\000g\000h\000i\000j\000k\000)\000\000", "\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000\000", 6, 12, 4);x2("\000(\000^\000a\000)\000\000", "\000a\000\000", 0, 2);x3("\000(\000a\000)\000|\000(\000a\000)\000\000", "\000b\000a\000\000", 2, 4, 1);x3("\000(\000^\000a\000)\000|\000(\000a\000)\000\000", "\000b\000a\000\000", 2, 4, 2);x3("\000(\000a\000?\000)\000\000", "\000a\000a\000a\000\000", 0, 2, 1);x3("\000(\000a\000*\000)\000\000", "\000a\000a\000a\000\000", 0, 6, 1);x3("\000(\000a\000*\000)\000\000", "\000\000", 0, 0, 1);x3("\000(\000a\000+\000)\000\000", "\000a\000a\000a\000a\000a\000a\000a\000\000", 0, 14, 1);x3("\000(\000a\000+\000|\000b\000*\000)\000\000", "\000b\000b\000b\000a\000a\000\000", 0, 6, 1);x3("\000(\000a\000+\000|\000b\000?\000)\000\000", "\000b\000b\000b\000a\000a\000\000", 0, 2, 1);x3("\000(\000a\000b\000c\000)\000?\000\000", "\000a\000b\000c\000\000", 0, 6, 1);x3("\000(\000a\000b\000c\000)\000*\000\000", "\000a\000b\000c\000\000", 0, 6, 1);x3("\000(\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, 1);x3("\000(\000x\000y\000z\000|\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, 1);x3("\000(\000[\000x\000y\000z\000]\000[\000a\000b\000c\000]\000|\000a\000b\000c\000)\000+\000\000", "\000a\000b\000c\000\000", 0, 6, 1);x3("\000(\000(\000?\000i\000:\000a\000b\000c\000)\000)\000\000", "\000A\000b\000C\000\000", 0, 6, 1);x2("\000(\000a\000b\000c\000)\000(\000?\000i\000:\000\134\0001\000)\000\000", "\000a\000b\000c\000A\000B\000C\000\000", 0, 12);x3("\000(\000(\000?\000m\000:\000a\000.\000c\000)\000)\000\000", "\000a\000\012\000c\000\000", 0, 6, 1);x3("\000(\000(\000?\000=\000a\000z\000)\000a\000)\000\000", "\000a\000z\000b\000\000", 0, 2, 1);x3("\000a\000b\000c\000|\000(\000.\000a\000b\000d\000)\000\000", "\000z\000a\000b\000d\000\000", 0, 8, 1);x2("\000(\000?\000:\000a\000b\000c\000)\000|\000(\000A\000B\000C\000)\000\000", "\000a\000b\000c\000\000", 0, 6);x3("\000(\000?\000i\000:\000(\000a\000b\000c\000)\000)\000|\000(\000z\000z\000z\000)\000\000", "\000A\000B\000C\000\000", 0, 6, 1);x3("\000a\000*\000(\000.\000)\000\000", "\000a\000a\000a\000a\000z\000\000", 8, 10, 1);x3("\000a\000*\000?\000(\000.\000)\000\000", "\000a\000a\000a\000a\000z\000\000", 0, 2, 1);x3("\000a\000*\000?\000(\000c\000)\000\000", "\000a\000a\000a\000a\000c\000\000", 8, 10, 1);x3("\000[\000b\000c\000d\000]\000a\000*\000(\000.\000)\000\000", "\000c\000a\000a\000a\000a\000z\000\000", 10, 12, 1);x3("\000(\000\134\000A\000b\000b\000)\000c\000c\000\000", "\000b\000b\000c\000c\000\000", 0, 4, 1);n("\000(\000\134\000A\000b\000b\000)\000c\000c\000\000", "\000z\000b\000b\000c\000c\000\000");x3("\000(\000^\000b\000b\000)\000c\000c\000\000", "\000b\000b\000c\000c\000\000", 0, 4, 1);n("\000(\000^\000b\000b\000)\000c\000c\000\000", "\000z\000b\000b\000c\000c\000\000");x3("\000c\000c\000(\000b\000b\000$\000)\000\000", "\000c\000c\000b\000b\000\000", 4, 8, 1);n("\000c\000c\000(\000b\000b\000$\000)\000\000", "\000c\000c\000b\000b\000b\000\000");n("\000(\000\134\0001\000)\000\000", "\000\000");n("\000\134\0001\000(\000a\000)\000\000", "\000a\000a\000\000");n("\000(\000a\000(\000b\000)\000\134\0001\000)\000\134\0002\000+\000\000", "\000a\000b\000a\000b\000b\000\000");n("\000(\000?\000:\000(\000?\000:\000\134\0001\000|\000z\000)\000(\000a\000)\000)\000+\000$\000\000", "\000z\000a\000a\000\000");x2("\000(\000?\000:\000(\000?\000:\000\134\0001\000|\000z\000)\000(\000a\000)\000)\000+\000$\000\000", "\000z\000a\000a\000a\000\000", 0, 8);x2("\000(\000a\000)\000(\000?\000=\000\134\0001\000)\000\000", "\000a\000a\000\000", 0, 2);n("\000(\000a\000)\000$\000|\000\134\0001\000\000", "\000a\000z\000\000");x2("\000(\000a\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4);n("\000(\000a\000)\000\134\0001\000\000", "\000a\000b\000\000");x2("\000(\000a\000?\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4);x2("\000(\000a\000?\000?\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 0);x2("\000(\000a\000*\000)\000\134\0001\000\000", "\000a\000a\000a\000a\000a\000\000", 0, 8);x3("\000(\000a\000*\000)\000\134\0001\000\000", "\000a\000a\000a\000a\000a\000\000", 0, 4, 1);x2("\000a\000(\000b\000*\000)\000\134\0001\000\000", "\000a\000b\000b\000b\000b\000\000", 0, 10);x2("\000a\000(\000b\000*\000)\000\134\0001\000\000", "\000a\000b\000\000", 0, 2);x2("\000(\000a\000*\000)\000(\000b\000*\000)\000\134\0001\000\134\0002\000\000", "\000a\000a\000a\000b\000b\000a\000a\000a\000b\000b\000\000", 0, 20);x2("\000(\000a\000*\000)\000(\000b\000*\000)\000\134\0002\000\000", "\000a\000a\000a\000b\000b\000b\000b\000\000", 0, 14);x2("\000(\000(\000(\000(\000(\000(\000(\000a\000*\000)\000b\000)\000)\000)\000)\000)\000)\000c\000\134\0007\000\000", "\000a\000a\000a\000b\000c\000a\000a\000a\000\000", 0, 16);x3("\000(\000(\000(\000(\000(\000(\000(\000a\000*\000)\000b\000)\000)\000)\000)\000)\000)\000c\000\134\0007\000\000", "\000a\000a\000a\000b\000c\000a\000a\000a\000\000", 0, 6, 7);x2("\000(\000a\000)\000(\000b\000)\000(\000c\000)\000\134\0002\000\134\0001\000\134\0003\000\000", "\000a\000b\000c\000b\000a\000c\000\000", 0, 12);x2("\000(\000[\000a\000-\000d\000]\000)\000\134\0001\000\000", "\000c\000c\000\000", 0, 4);x2("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "\000f\0005\000 \000f\0005\000 \000\000", 0, 12);n("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "\000f\0005\000 \000f\0005\000\000");x2("\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)\000\134\0001\000\000", "\000w\000h\000o\000w\000h\000o\000\000", 0, 12);x2("\000.\000.\000.\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)\000\134\0001\000\000", "\000a\000b\000c\000w\000h\000o\000w\000h\000o\000\000", 0, 18);x2("\000(\000w\000h\000o\000|\000[\000a\000-\000c\000]\000{\0003\000}\000)\000\134\0001\000\000", "\000c\000b\000c\000c\000b\000c\000\000", 0, 12);x2("\000(\000^\000a\000)\000\134\0001\000\000", "\000a\000a\000\000", 0, 4);n("\000(\000^\000a\000)\000\134\0001\000\000", "\000b\000a\000a\000\000");n("\000(\000a\000$\000)\000\134\0001\000\000", "\000a\000a\000\000");n("\000(\000a\000b\000\134\000Z\000)\000\134\0001\000\000", "\000a\000b\000\000");x2("\000(\000a\000*\000\134\000Z\000)\000\134\0001\000\000", "\000a\000\000", 2, 2);x2("\000.\000(\000a\000*\000\134\000Z\000)\000\134\0001\000\000", "\000b\000a\000\000", 2, 4);x3("\000(\000.\000(\000a\000b\000c\000)\000\134\0002\000)\000\000", "\000z\000a\000b\000c\000a\000b\000c\000\000", 0, 14, 1);x3("\000(\000.\000(\000.\000.\000\134\000d\000.\000)\000\134\0002\000)\000\000", "\000z\0001\0002\0003\0004\0001\0002\0003\0004\000\000", 0, 18, 1);x2("\000(\000(\000?\000i\000:\000a\000z\000)\000)\000\134\0001\000\000", "\000A\000z\000A\000z\000\000", 0, 8);n("\000(\000(\000?\000i\000:\000a\000z\000)\000)\000\134\0001\000\000", "\000A\000z\000a\000z\000\000");x2("\000(\000?\000<\000=\000a\000)\000b\000\000", "\000a\000b\000\000", 2, 4);n("\000(\000?\000<\000=\000a\000)\000b\000\000", "\000b\000b\000\000");x2("\000(\000?\000<\000=\000a\000|\000b\000)\000b\000\000", "\000b\000b\000\000", 2, 4);x2("\000(\000?\000<\000=\000a\000|\000b\000c\000)\000b\000\000", "\000b\000c\000b\000\000", 4, 6);x2("\000(\000?\000<\000=\000a\000|\000b\000c\000)\000b\000\000", "\000a\000b\000\000", 2, 4);x2("\000(\000?\000<\000=\000a\000|\000b\000c\000|\000|\000d\000e\000f\000g\000h\000i\000j\000|\000k\000l\000m\000n\000o\000p\000q\000|\000r\000)\000z\000\000", "\000r\000z\000\000", 2, 4);x2("\000(\000a\000)\000\134\000g\000<\0001\000>\000\000", "\000a\000a\000\000", 0, 4);x2("\000(\000?\000<\000!\000a\000)\000b\000\000", "\000c\000b\000\000", 2, 4);n("\000(\000?\000<\000!\000a\000)\000b\000\000", "\000a\000b\000\000");x2("\000(\000?\000<\000!\000a\000|\000b\000c\000)\000b\000\000", "\000b\000b\000b\000\000", 0, 2);n("\000(\000?\000<\000!\000a\000|\000b\000c\000)\000z\000\000", "\000b\000c\000z\000\000");x2("\000(\000?\000<\000n\000a\000m\000e\0001\000>\000a\000)\000\000", "\000a\000\000", 0, 2);x2("\000(\000?\000<\000n\000a\000m\000e\000_\0002\000>\000a\000b\000)\000\134\000g\000<\000n\000a\000m\000e\000_\0002\000>\000\000", "\000a\000b\000a\000b\000\000", 0, 8);x2("\000(\000?\000<\000n\000a\000m\000e\000_\0003\000>\000.\000z\000v\000.\000)\000\134\000k\000<\000n\000a\000m\000e\000_\0003\000>\000\000", "\000a\000z\000v\000b\000a\000z\000v\000b\000\000", 0, 16);x2("\000(\000?\000<\000=\000\134\000g\000<\000a\000b\000>\000)\000|\000-\000\134\000z\000E\000N\000D\000 \000(\000?\000<\000a\000b\000>\000X\000y\000Z\000)\000\000", "\000X\000y\000Z\000\000", 6, 6);x2("\000(\000?\000<\000n\000>\000|\000a\000\134\000g\000<\000n\000>\000)\000+\000\000", "\000\000", 0, 0);x2("\000(\000?\000<\000n\000>\000|\000\134\000(\000\134\000g\000<\000n\000>\000\134\000)\000)\000+\000$\000\000", "\000(\000)\000(\000(\000)\000)\000\000", 0, 12);x3("\000\134\000g\000<\000n\000>\000(\000?\000<\000n\000>\000.\000)\000{\0000\000}\000\000", "\000X\000\000", 0, 2, 1);x2("\000\134\000g\000<\000n\000>\000(\000a\000b\000c\000|\000d\000f\000(\000?\000<\000n\000>\000.\000Y\000Z\000)\000{\0002\000,\0008\000}\000)\000{\0000\000}\000\000", "\000X\000Y\000Z\000\000", 0, 6);x2("\000\134\000A\000(\000?\000<\000n\000>\000(\000a\000\134\000g\000<\000n\000>\000)\000|\000)\000\134\000z\000\000", "\000a\000a\000a\000a\000\000", 0, 8);x2("\000(\000?\000<\000n\000>\000|\000\134\000g\000<\000m\000>\000\134\000g\000<\000n\000>\000)\000\134\000z\000|\000\134\000z\000E\000N\000D\000 \000(\000?\000<\000m\000>\000a\000|\000(\000b\000)\000\134\000g\000<\000m\000>\000)\000\000", "\000b\000b\000b\000b\000a\000b\000b\000a\000\000", 0, 16);x2("\000(\000?\000<\000n\000a\000m\000e\0001\0002\0004\0000\000>\000\134\000w\000+\000\134\000s\000x\000)\000a\000+\000\134\000k\000<\000n\000a\000m\000e\0001\0002\0004\0000\000>\000\000", "\000 \000 \000f\000g\000 \000x\000a\000a\000a\000a\000a\000a\000a\000a\000f\000g\000 \000x\000\000", 4, 36);x3("\000(\000z\000)\000(\000)\000(\000)\000(\000?\000<\000_\0009\000>\000a\000)\000\134\000g\000<\000_\0009\000>\000\000", "\000z\000a\000a\000\000", 4, 6, 1);x2("\000(\000.\000)\000(\000(\000(\000?\000<\000_\000>\000a\000)\000)\000)\000\134\000k\000<\000_\000>\000\000", "\000z\000a\000a\000\000", 0, 6);x2("\000(\000(\000?\000<\000n\000a\000m\000e\0001\000>\000\134\000d\000)\000|\000(\000?\000<\000n\000a\000m\000e\0002\000>\000\134\000w\000)\000)\000(\000\134\000k\000<\000n\000a\000m\000e\0001\000>\000|\000\134\000k\000<\000n\000a\000m\000e\0002\000>\000)\000\000", "\000f\000f\000\000", 0, 4);x2("\000(\000?\000:\000(\000?\000<\000x\000>\000)\000|\000(\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", "\000\000", 0, 0);x2("\000(\000?\000:\000(\000?\000<\000x\000>\000a\000b\000c\000)\000|\000(\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", "\000a\000b\000c\000e\000f\000g\000e\000f\000g\000\000", 6, 18);n("\000(\000?\000:\000(\000?\000<\000x\000>\000a\000b\000c\000)\000|\000(\000?\000<\000x\000>\000e\000f\000g\000)\000)\000\134\000k\000<\000x\000>\000\000", "\000a\000b\000c\000e\000f\000g\000\000");x2("\000(\000?\000:\000(\000?\000<\000n\0001\000>\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000)\000\134\000k\000<\000n\0001\000>\000$\000\000", "\000a\000-\000p\000y\000u\000m\000p\000y\000u\000m\000\000", 4, 20);x3("\000(\000?\000:\000(\000?\000<\000n\0001\000>\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000|\000(\000?\000<\000n\0001\000>\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000.\000)\000)\000\134\000k\000<\000n\0001\000>\000$\000\000", "\000x\000x\000x\000x\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000l\000m\000n\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000l\000m\000n\000\000", 8, 36, 14);x3("\000(\000?\000<\000n\000a\000m\000e\0001\000>\000)\000(\000?\000<\000n\000a\000m\000e\0002\000>\000)\000(\000?\000<\000n\000a\000m\000e\0003\000>\000)\000(\000?\000<\000n\000a\000m\000e\0004\000>\000)\000(\000?\000<\000n\000a\000m\000e\0005\000>\000)\000(\000?\000<\000n\000a\000m\000e\0006\000>\000)\000(\000?\000<\000n\000a\000m\000e\0007\000>\000)\000(\000?\000<\000n\000a\000m\000e\0008\000>\000)\000(\000?\000<\000n\000a\000m\000e\0009\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0000\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0001\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0002\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0003\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0004\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0005\000>\000)\000(\000?\000<\000n\000a\000m\000e\0001\0006\000>\000a\000a\000a\000)\000(\000?\000<\000n\000a\000m\000e\0001\0007\000>\000)\000$\000\000", "\000a\000a\000a\000\000", 0, 6, 16);x2("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", "\000a\000\000", 0, 2);x2("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", "\000(\000(\000(\000(\000(\000(\000a\000)\000)\000)\000)\000)\000)\000\000", 0, 26);x3("\000(\000?\000<\000f\000o\000o\000>\000a\000|\000\134\000(\000\134\000g\000<\000f\000o\000o\000>\000\134\000)\000)\000\000", "\000(\000(\000(\000(\000(\000(\000(\000(\000a\000)\000)\000)\000)\000)\000)\000)\000)\000\000", 0, 34, 1);x2("\000\134\000g\000<\000b\000a\000r\000>\000|\000\134\000z\000E\000N\000D\000(\000?\000<\000b\000a\000r\000>\000.\000*\000a\000b\000c\000$\000)\000\000", "\000a\000b\000c\000x\000x\000x\000a\000b\000c\000\000", 0, 18);x2("\000\134\000g\000<\0001\000>\000|\000\134\000z\000E\000N\000D\000(\000.\000a\000.\000)\000\000", "\000b\000a\000c\000\000", 0, 6);x3("\000\134\000g\000<\000_\000A\000>\000\134\000g\000<\000_\000A\000>\000|\000\134\000z\000E\000N\000D\000(\000.\000a\000.\000)\000(\000?\000<\000_\000A\000>\000.\000b\000.\000)\000\000", "\000x\000b\000x\000y\000b\000y\000\000", 6, 12, 1);x2("\000\134\000A\000(\000?\000:\000\134\000g\000<\000p\000o\000n\000>\000|\000\134\000g\000<\000p\000a\000n\000>\000|\000\134\000z\000E\000N\000D\000 \000 \000(\000?\000<\000p\000a\000n\000>\000a\000|\000c\000\134\000g\000<\000p\000o\000n\000>\000c\000)\000(\000?\000<\000p\000o\000n\000>\000b\000|\000d\000\134\000g\000<\000p\000a\000n\000>\000d\000)\000)\000$\000\000", "\000c\000d\000c\000b\000c\000d\000c\000\000", 0, 14);x2("\000\134\000A\000(\000?\000<\000n\000>\000|\000a\000\134\000g\000<\000m\000>\000)\000\134\000z\000|\000\134\000z\000E\000N\000D\000 \000(\000?\000<\000m\000>\000\134\000g\000<\000n\000>\000)\000\000", "\000a\000a\000a\000a\000\000", 0, 8);x2("\000(\000?\000<\000n\000>\000(\000a\000|\000b\000\134\000g\000<\000n\000>\000c\000)\000{\0003\000,\0005\000}\000)\000\000", "\000b\000a\000a\000a\000a\000c\000a\000\000", 2, 10);x2("\000(\000?\000<\000n\000>\000(\000a\000|\000b\000\134\000g\000<\000n\000>\000c\000)\000{\0003\000,\0005\000}\000)\000\000", "\000b\000a\000a\000a\000a\000c\000a\000a\000a\000a\000a\000\000", 0, 20);x2("\000(\000?\000<\000p\000a\000r\000e\000>\000\134\000(\000(\000[\000^\000\134\000(\000\134\000)\000]\000+\000+\000|\000\134\000g\000<\000p\000a\000r\000e\000>\000)\000*\000+\000\134\000)\000)\000\000", "\000(\000(\000a\000)\000)\000\000", 0, 10);x2("\000(\000)\000*\000\134\0001\000\000", "\000\000", 0, 0);x2("\000(\000?\000:\000(\000)\000|\000(\000)\000)\000*\000\134\0001\000\134\0002\000\000", "\000\000", 0, 0);x3("\000(\000?\000:\000\134\0001\000a\000|\000(\000)\000)\000*\000\000", "\000a\000\000", 0, 0, 1);x2("\000x\000(\000(\000.\000)\000*\000)\000*\000x\000\000", "\0000\000x\0001\000x\0002\000x\0003\000\000", 2, 12);x2("\000x\000(\000(\000.\000)\000*\000)\000*\000x\000(\000?\000i\000:\000\134\0001\000)\000\134\000Z\000\000", "\0000\000x\0001\000x\0002\000x\0001\000X\0002\000\000", 2, 18);x2("\000(\000?\000:\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000)\000)\000*\000\134\0002\000\134\0005\000\000", "\000\000", 0, 0);x2("\000(\000?\000:\000(\000)\000|\000(\000)\000|\000(\000)\000|\000(\000x\000)\000|\000(\000)\000|\000(\000)\000)\000*\000\134\0002\000b\000\134\0005\000\000", "\000b\000\000", 0, 2);x2("\217\372\000\000", "\217\372\000\000", 0, 2);x2("\000\000", "0B\000\000", 0, 0);x2("0B\000\000", "0B\000\000", 0, 2);n("0D\000\000", "0B\000\000");x2("0F0F\000\000", "0F0F\000\000", 0, 4);x2("0B0D0F\000\000", "0B0D0F\000\000", 0, 6);x2("0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S\000\000", "0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S\000\000", 0, 70);x2("0B\000\000", "0D0B\000\000", 2, 4);x2("0D0F\000\000", "0B0D0F\000\000", 2, 6);x2("e\207\000\000", "e\207\000\000", 0, 2);x2("\000.\000\000", "0B\000\000", 0, 2);x2("\000.\000.\000\000", "0K0M\000\000", 0, 4);x2("\000\134\000w\000\000", "0J\000\000", 0, 2);n("\000\134\000W\000\000", "0B\000\000");x2("\000[\000\134\000W\000]\000\000", "0F\000$\000\000", 2, 4);x2("\000\134\000S\000\000", "0]\000\000", 0, 2);x2("\000\134\000S\000\000", "o\042\000\000", 0, 2);x2("\000\134\000b\000\000", "l\027\000 \000\000", 0, 0);x2("\000\134\000b\000\000", "\000 0{\000\000", 2, 2);x2("\000\134\000B\000\000", "0[0]\000 \000\000", 2, 2);x2("\000\134\000B\000\000", "0F\000 \000\000", 4, 4);x2("\000\134\000B\000\000", "\000 0D\000\000", 0, 0);x2("\000[0_0a\000]\000\000", "0a\000\000", 0, 2);n("\000[0j0k\000]\000\000", "0l\000\000");x2("\000[0F\000-0J\000]\000\000", "0H\000\000", 0, 2);n("\000[\000^0Q\000]\000\000", "0Q\000\000");x2("\000[\000\134\000w\000]\000\000", "0m\000\000", 0, 2);n("\000[\000\134\000d\000]\000\000", "0u\000\000");x2("\000[\000\134\000D\000]\000\000", "0o\000\000", 0, 2);n("\000[\000\134\000s\000]\000\000", "0O\000\000");x2("\000[\000\134\000S\000]\000\000", "0x\000\000", 0, 2);x2("\000[\000\134\000w\000\134\000d\000]\000\000", "0\210\000\000", 0, 2);x2("\000[\000\134\000w\000\134\000d\000]\000\000", "\000 \000 \000 0\210\000\000", 6, 8);n("\000\134\000w\233<\216\312\000\000", "\000 \233<\216\312\000\000");x2("\233<\000\134\000W\216\312\000\000", "\233<\000 \216\312\000\000", 0, 6);x2("0B\000.0D\000.0F\000\000", "0B0B0D0D0F\000\000", 0, 10);x2("\000.\000\134\000w0F\000\134\000W\000.\000.0^\000\000", "0H0F0F\000 0F0^0^\000\000", 0, 14);x2("\000\134\000s\000\134\000w0S0S0S\000\000", "\000 0S0S0S0S\000\000", 0, 10);x2("0B0B\000.0Q\000\000", "0B0B0Q0Q\000\000", 0, 8);n("\000.0D\000\000", "0D0H\000\000");x2("\000.0J\000\000", "0J0J\000\000", 0, 4);x2("\000^0B\000\000", "0B\000\000", 0, 2);x2("\000^0\200\000$\000\000", "0\200\000\000", 0, 2);x2("\000^\000\134\000w\000$\000\000", "0k\000\000", 0, 2);x2("\000^\000\134\000w0K0M0O0Q0S\000$\000\000", "\000z0K0M0O0Q0S\000\000", 0, 12);x2("\000^\000\134\000w\000.\000.\000.0F0H0J\000$\000\000", "\000z0B0D0F0F0H0J\000\000", 0, 14);x2("\000\134\000w\000\134\000w\000\134\000s\000\134\000W0J0J0J\000\134\000d\000\000", "\000a0J\000 \000 0J0J0J\0004\000\000", 0, 16);x2("\000\134\000A0_0a0d\000\000", "0_0a0d\000\000", 0, 6);x2("0\2000\2010\202\000\134\000Z\000\000", "0\2000\2010\202\000\000", 0, 6);x2("0K0M0O\000\134\000z\000\000", "0K0M0O\000\000", 0, 6);x2("0K0M0O\000\134\000Z\000\000", "0K0M0O\000\012\000\000", 0, 6);x2("\000\134\000G0}0t\000\000", "0}0t\000\000", 0, 4);n("\000\134\000G0H\000\000", "0F0H0J\000\000");n("0h0f\000\134\000G\000\000", "0h0f\000\000");n("0~0\177\000\134\000A\000\000", "0~0\177\000\000");n("0~\000\134\000A0\177\000\000", "0~0\177\000\000");x2("\000(\000?\000=0[\000)0[\000\000", "0[\000\000", 0, 2);n("\000(\000?\000=0F\000)\000.\000\000", "0D\000\000");x2("\000(\000?\000!0F\000)0K\000\000", "0K\000\000", 0, 2);n("\000(\000?\000!0h\000)0B\000\000", "0h\000\000");x2("\000(\000?\000i\000:0B\000)\000\000", "0B\000\000", 0, 2);x2("\000(\000?\000i\000:0v0y\000)\000\000", "0v0y\000\000", 0, 4);n("\000(\000?\000i\000:0D\000)\000\000", "0F\000\000");x2("\000(\000?\000m\000:0\210\000.\000)\000\000", "0\210\000\012\000\000", 0, 4);x2("\000(\000?\000m\000:\000.0\201\000)\000\000", "0~\000\0120\201\000\000", 2, 6);x2("0B\000?\000\000", "\000\000", 0, 0);x2("Y\011\000?\000\000", "S\026\000\000", 0, 0);x2("Y\011\000?\000\000", "Y\011\000\000", 0, 2);x2("\221\317\000*\000\000", "\000\000", 0, 0);x2("\221\317\000*\000\000", "\221\317\000\000", 0, 2);x2("[P\000*\000\000", "[P[P[P\000\000", 0, 6);x2("\231\254\000*\000\000", "\236\177\231\254\231\254\231\254\231\254\000\000", 0, 0);n("\134q\000+\000\000", "\000\000");x2("l\263\000+\000\000", "l\263\000\000", 0, 2);x2("fB\000+\000\000", "fBfBfBfB\000\000", 0, 8);x2("0H\000+\000\000", "0H0H0F0F0F\000\000", 0, 4);x2("0F\000+\000\000", "0J0F0F0F0F\000\000", 2, 10);x2("\000.\000?\000\000", "0_\000\000", 0, 2);x2("\000.\000*\000\000", "0q0t0w0z\000\000", 0, 8);x2("\000.\000+\000\000", "0\215\000\000", 0, 2);x2("\000.\000+\000\000", "0D0F0H0K\000\012\000\000", 0, 8);x2("0B\000|0D\000\000", "0B\000\000", 0, 2);x2("0B\000|0D\000\000", "0D\000\000", 0, 2);x2("0B0D\000|0D0F\000\000", "0B0D\000\000", 0, 4);x2("0B0D\000|0D0F\000\000", "0D0F\000\000", 0, 4);x2("0\222\000(\000?\000:0K0M\000|0M0O\000)\000\000", "0\2220K0M\000\000", 0, 6);x2("0\222\000(\000?\000:0K0M\000|0M0O\000)0Q\000\000", "0\2220M0O0Q\000\000", 0, 8);x2("0B0D\000|\000(\000?\000:0B0F\000|0B0\222\000)\000\000", "0B0\222\000\000", 0, 4);x2("0B\000|0D\000|0F\000\000", "0H0F\000\000", 2, 4);x2("0B\000|0D\000|0F0H\000|0J0K0M\000|0O\000|0Q0S0U\000|0W0Y0[\000|0]\000|0_0a\000|0d0f0h0j0k\000|0l0m\000\000", "0W0Y0[\000\000", 0, 6);n("0B\000|0D\000|0F0H\000|0J0K0M\000|0O\000|0Q0S0U\000|0W0Y0[\000|0]\000|0_0a\000|0d0f0h0j0k\000|0l0m\000\000", "0Y0[\000\000");x2("0B\000|\000^0\217\000\000", "0v0B\000\000", 2, 4);x2("0B\000|\000^0\222\000\000", "0\2220B\000\000", 0, 2);x2("\233<\000|\000\134\000G\216\312\000\000", "0Q\216\312\233<\000\000", 4, 6);x2("\233<\000|\000\134\000G\216\312\000\000", "\216\312\233<\000\000", 0, 2);x2("\233<\000|\000\134\000A\216\312\000\000", "\000b\216\312\233<\000\000", 4, 6);x2("\233<\000|\000\134\000A\216\312\000\000", "\216\312\000\000", 0, 2);x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\233<\000\000", 2, 4);x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\000\000", 0, 2);x2("\233<\000|\216\312\000\134\000Z\000\000", "\216\312\000\012\000\000", 0, 2);x2("\233<\000|\216\312\000\134\000z\000\000", "\216\312\233<\000\000", 2, 4);x2("\233<\000|\216\312\000\134\000z\000\000", "\216\312\000\000", 0, 2);x2("\000\134\000w\000|\000\134\000s\000\000", "0J\000\000", 0, 2);x2("\000\134\000w\000|\000%\000\000", "\000%0J\000\000", 0, 2);x2("\000\134\000w\000|\000[\000&\000$\000]\000\000", "0F\000&\000\000", 0, 2);x2("\000[0D\000-0Q\000]\000\000", "0F\000\000", 0, 2);x2("\000[0D\000-0Q\000]\000|\000[\000^0K\000-0S\000]\000\000", "0B\000\000", 0, 2);x2("\000[0D\000-0Q\000]\000|\000[\000^0K\000-0S\000]\000\000", "0K\000\000", 0, 2);x2("\000[\000^0B\000]\000\000", "\000\012\000\000", 0, 2);x2("\000(\000?\000:0B\000|\000[0F\000-0M\000]\000)\000|0D0\222\000\000", "0F0\222\000\000", 0, 2);x2("\000(\000?\000:0B\000|\000[0F\000-0M\000]\000)\000|0D0\222\000\000", "0D0\222\000\000", 0, 4);x2("0B0D0F\000|\000(\000?\000=0Q0Q\000)\000.\000.0{\000\000", "0Q0Q0{\000\000", 0, 6);x2("0B0D0F\000|\000(\000?\000!0Q0Q\000)\000.\000.0{\000\000", "0B0D0{\000\000", 0, 6);x2("\000(\000?\000=0\2220B\000)\000.\000.0B\000|\000(\000?\000=0\2220\222\000)\000.\000.0B\000\000", "0\2220\2220B\000\000", 0, 6);x2("\000(\000?\000<\000=0B\000|0D0F\000)0D\000\000", "0D0F0D\000\000", 4, 6);n("\000(\000?\000>0B\000|0B0D0H\000)0F\000\000", "0B0D0H0F\000\000");x2("\000(\000?\000>0B0D0H\000|0B\000)0F\000\000", "0B0D0H0F\000\000", 0, 8);x2("0B\000?\000|0D\000\000", "0B\000\000", 0, 2);x2("0B\000?\000|0D\000\000", "0D\000\000", 0, 0);x2("0B\000?\000|0D\000\000", "\000\000", 0, 0);x2("0B\000*\000|0D\000\000", "0B0B\000\000", 0, 4);x2("0B\000*\000|0D\000*\000\000", "0D0B\000\000", 0, 0);x2("0B\000*\000|0D\000*\000\000", "0B0D\000\000", 0, 2);x2("\000[\000a0B\000]\000*\000|0D\000*\000\000", "\000a0B0D0D0D\000\000", 0, 4);x2("0B\000+\000|0D\000*\000\000", "\000\000", 0, 0);x2("0B\000+\000|0D\000*\000\000", "0D0D0D\000\000", 0, 6);x2("0B\000+\000|0D\000*\000\000", "0B0D0D0D\000\000", 0, 2);x2("0B\000+\000|0D\000*\000\000", "\000a0B0D0D0D\000\000", 0, 0);n("0B\000+\000|0D\000+\000\000", "\000\000");x2("\000(0B\000|0D\000)\000?\000\000", "0D\000\000", 0, 2);x2("\000(0B\000|0D\000)\000*\000\000", "0D0B\000\000", 0, 4);x2("\000(0B\000|0D\000)\000+\000\000", "0D0B0D\000\000", 0, 6);x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0F0B0B0D0F0H\000\000", 0, 8);x2("\000(0B0D\000|0F0H\000)\000+\000\000", "0F0B0B0D0F0H\000\000", 4, 12);x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0B0B0D0F0B\000\000", 2, 10);x2("\000(0B0D\000|0F0B\000)\000+\000\000", "0B0D0\2220F0B\000\000", 0, 4);x2("\000(0B0D\000|0F0B\000)\000+\000\000", "\000$\000$\000z\000z\000z\000z0B0D0\2220F0B\000\000", 12, 16);x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0B0D0B0D0B\000\000", 0, 10);x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0D0B\000\000", 2, 4);x2("\000(0B\000|0D0B0D\000)\000+\000\000", "0D0B0B0B0D0B\000\000", 2, 8);x2("\000(\000?\000:0B\000|0D\000)\000(\000?\000:0B\000|0D\000)\000\000", "0B0D\000\000", 0, 4);x2("\000(\000?\000:0B\000*\000|0D\000*\000)\000(\000?\000:0B\000*\000|0D\000*\000)\000\000", "0B0B0B0D0D0D\000\000", 0, 6);x2("\000(\000?\000:0B\000*\000|0D\000*\000)\000(\000?\000:0B\000+\000|0D\000+\000)\000\000", "0B0B0B0D0D0D\000\000", 0, 12);x2("\000(\000?\000:0B\000+\000|0D\000+\000)\000{\0002\000}\000\000", "0B0B0B0D0D0D\000\000", 0, 12);x2("\000(\000?\000:0B\000+\000|0D\000+\000)\000{\0001\000,\0002\000}\000\000", "0B0B0B0D0D0D\000\000", 0, 12);x2("\000(\000?\000:0B\000+\000|\000\134\000A0D\000*\000)0F0F\000\000", "0F0F\000\000", 0, 4);n("\000(\000?\000:0B\000+\000|\000\134\000A0D\000*\000)0F0F\000\000", "0B0D0F0F\000\000");x2("\000(\000?\000:\000^0B\000+\000|0D\000+\000)\000*0F\000\000", "0B0B0D0D0D0B0D0F\000\000", 12, 16);x2("\000(\000?\000:\000^0B\000+\000|0D\000+\000)\000*0F\000\000", "0B0B0D0D0D0D0F\000\000", 0, 14);x2("0F\000{\0000\000,\000}\000\000", "0F0F0F0F\000\000", 0, 8);x2("0B\000|\000(\000?\000i\000)\000c\000\000", "\000C\000\000", 0, 2);x2("\000(\000?\000i\000)\000c\000|0B\000\000", "\000C\000\000", 0, 2);x2("\000(\000?\000i\000:0B\000)\000|\000a\000\000", "\000a\000\000", 0, 2);n("\000(\000?\000i\000:0B\000)\000|\000a\000\000", "\000A\000\000");x2("\000[0B0D0F\000]\000?\000\000", "0B0D0F\000\000", 0, 2);x2("\000[0B0D0F\000]\000*\000\000", "0B0D0F\000\000", 0, 6);x2("\000[\000^0B0D0F\000]\000*\000\000", "0B0D0F\000\000", 0, 0);n("\000[\000^0B0D0F\000]\000+\000\000", "0B0D0F\000\000");x2("0B\000?\000?\000\000", "0B0B0B\000\000", 0, 0);x2("0D0B\000?\000?0D\000\000", "0D0B0D\000\000", 0, 6);x2("0B\000*\000?\000\000", "0B0B0B\000\000", 0, 0);x2("0D0B\000*\000?\000\000", "0D0B0B\000\000", 0, 2);x2("0D0B\000*\000?0D\000\000", "0D0B0B0D\000\000", 0, 8);x2("0B\000+\000?\000\000", "0B0B0B\000\000", 0, 2);x2("0D0B\000+\000?\000\000", "0D0B0B\000\000", 0, 4);x2("0D0B\000+\000?0D\000\000", "0D0B0B0D\000\000", 0, 8);x2("\000(\000?\000:Y)\000?\000)\000?\000?\000\000", "Y)\000\000", 0, 0);x2("\000(\000?\000:Y)\000?\000?\000)\000?\000\000", "Y)\000\000", 0, 0);x2("\000(\000?\000:Y\042\000?\000)\000+\000?\000\000", "Y\042Y\042Y\042\000\000", 0, 2);x2("\000(\000?\000:\230\250\000+\000)\000?\000?\000\000", "\230\250\230\250\230\250\000\000", 0, 0);x2("\000(\000?\000:\226\352\000+\000)\000?\000?\227\034\000\000", "\226\352\226\352\226\352\227\034\000\000", 0, 8);x2("\000(\000?\000:0B0D\000)\000?\000{\0002\000}\000\000", "\000\000", 0, 0);x2("\000(\000?\000:\233<\216\312\000)\000?\000{\0002\000}\000\000", "\233<\216\312\233<\216\312\233<\000\000", 0, 8);x2("\000(\000?\000:\233<\216\312\000)\000*\000{\0000\000}\000\000", "\233<\216\312\233<\216\312\233<\000\000", 0, 0);x2("\000(\000?\000:\233<\216\312\000)\000{\0003\000,\000}\000\000", "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 16);n("\000(\000?\000:\233<\216\312\000)\000{\0003\000,\000}\000\000", "\233<\216\312\233<\216\312\000\000");x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000\000", "\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 12);x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000\000", "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 16);x2("\000(\000?\000:\233<\216\312\000)\000{\0002\000,\0004\000}\000?\000\000", "\233<\216\312\233<\216\312\233<\216\312\233<\216\312\233<\216\312\000\000", 0, 8);x2("\000(\000?\000:\233<\216\312\000)\000{\000,\000}\000\000", "\233<\216\312\000{\000,\000}\000\000", 0, 10);x2("\000(\000?\000:0K0M0O\000)\000+\000?\000{\0002\000}\000\000", "0K0M0O0K0M0O0K0M0O\000\000", 0, 12);x3("\000(pk\000)\000\000", "pk\000\000", 0, 2, 1);x3("\000(pkl4\000)\000\000", "pkl4\000\000", 0, 4, 1);x2("\000(\000(fB\225\223\000)\000)\000\000", "fB\225\223\000\000", 0, 4);x3("\000(\000(\230\250l4\000)\000)\000\000", "\230\250l4\000\000", 0, 4, 1);x3("\000(\000(f(e\345\000)\000)\000\000", "f(e\345\000\000", 0, 4, 2);x3("\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\000(\221\317[P\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000)\000\000", "\221\317[P\000\000", 0, 4, 20);x3("\000(0B0D\000)\000(0F0H\000)\000\000", "0B0D0F0H\000\000", 0, 4, 1);x3("\000(0B0D\000)\000(0F0H\000)\000\000", "0B0D0F0H\000\000", 4, 8, 2);x3("\000(\000)\000(0B\000)0D0F\000(0H0J0K\000)0M0O0Q0S\000\000", "0B0D0F0H0J0K0M0O0Q0S\000\000", 6, 12, 3);x3("\000(\000(\000)\000(0B\000)0D0F\000(0H0J0K\000)0M0O0Q0S\000)\000\000", "0B0D0F0H0J0K0M0O0Q0S\000\000", 6, 12, 4);x3("\000.\000*\000(0\3250\251\000)0\3630\3730\336\000(0\363\000(\000)0\2670\3450\277\000)0\2440\363\000\000", "0\3250\2510\3630\3730\3360\3630\2670\3450\2770\2440\363\000\000", 10, 18, 2);x2("\000(\000^0B\000)\000\000", "0B\000\000", 0, 2);x3("\000(0B\000)\000|\000(0B\000)\000\000", "0D0B\000\000", 2, 4, 1);x3("\000(\000^0B\000)\000|\000(0B\000)\000\000", "0D0B\000\000", 2, 4, 2);x3("\000(0B\000?\000)\000\000", "0B0B0B\000\000", 0, 2, 1);x3("\000(0~\000*\000)\000\000", "0~0~0~\000\000", 0, 6, 1);x3("\000(0h\000*\000)\000\000", "\000\000", 0, 0, 1);x3("\000(0\213\000+\000)\000\000", "0\2130\2130\2130\2130\2130\2130\213\000\000", 0, 14, 1);x3("\000(0u\000+\000|0x\000*\000)\000\000", "0u0u0u0x0x\000\000", 0, 6, 1);x3("\000(0B\000+\000|0D\000?\000)\000\000", "0D0D0D0B0B\000\000", 0, 2, 1);x3("\000(0B0D0F\000)\000?\000\000", "0B0D0F\000\000", 0, 6, 1);x3("\000(0B0D0F\000)\000*\000\000", "0B0D0F\000\000", 0, 6, 1);x3("\000(0B0D0F\000)\000+\000\000", "0B0D0F\000\000", 0, 6, 1);x3("\000(0U0W0Y\000|0B0D0F\000)\000+\000\000", "0B0D0F\000\000", 0, 6, 1);x3("\000(\000[0j0k0l\000]\000[0K0M0O\000]\000|0K0M0O\000)\000+\000\000", "0K0M0O\000\000", 0, 6, 1);x3("\000(\000(\000?\000i\000:0B0D0F\000)\000)\000\000", "0B0D0F\000\000", 0, 6, 1);x3("\000(\000(\000?\000m\000:0B\000.0F\000)\000)\000\000", "0B\000\0120F\000\000", 0, 6, 1);x3("\000(\000(\000?\000=0B0\223\000)0B\000)\000\000", "0B0\2230D\000\000", 0, 2, 1);x3("0B0D0F\000|\000(\000.0B0D0H\000)\000\000", "0\2230B0D0H\000\000", 0, 8, 1);x3("0B\000*\000(\000.\000)\000\000", "0B0B0B0B0\223\000\000", 8, 10, 1);x3("0B\000*\000?\000(\000.\000)\000\000", "0B0B0B0B0\223\000\000", 0, 2, 1);x3("0B\000*\000?\000(0\223\000)\000\000", "0B0B0B0B0\223\000\000", 8, 10, 1);x3("\000[0D0F0H\000]0B\000*\000(\000.\000)\000\000", "0H0B0B0B0B0\223\000\000", 10, 12, 1);x3("\000(\000\134\000A0D0D\000)0F0F\000\000", "0D0D0F0F\000\000", 0, 4, 1);n("\000(\000\134\000A0D0D\000)0F0F\000\000", "0\2230D0D0F0F\000\000");x3("\000(\000^0D0D\000)0F0F\000\000", "0D0D0F0F\000\000", 0, 4, 1);n("\000(\000^0D0D\000)0F0F\000\000", "0\2230D0D0F0F\000\000");x3("0\2150\215\000(0\2130\213\000$\000)\000\000", "0\2150\2150\2130\213\000\000", 4, 8, 1);n("0\2150\215\000(0\2130\213\000$\000)\000\000", "0\2150\2150\2130\2130\213\000\000");x2("\000(q!\000)\000\134\0001\000\000", "q!q!\000\000", 0, 4);n("\000(q!\000)\000\134\0001\000\000", "q!kf\000\000");x2("\000(zz\000?\000)\000\134\0001\000\000", "zzzz\000\000", 0, 4);x2("\000(zz\000?\000?\000)\000\134\0001\000\000", "zzzz\000\000", 0, 0);x2("\000(zz\000*\000)\000\134\0001\000\000", "zzzzzzzzzz\000\000", 0, 8);x3("\000(zz\000*\000)\000\134\0001\000\000", "zzzzzzzzzz\000\000", 0, 4, 1);x2("0B\000(0D\000*\000)\000\134\0001\000\000", "0B0D0D0D0D\000\000", 0, 10);x2("0B\000(0D\000*\000)\000\134\0001\000\000", "0B0D\000\000", 0, 2);x2("\000(0B\000*\000)\000(0D\000*\000)\000\134\0001\000\134\0002\000\000", "0B0B0B0D0D0B0B0B0D0D\000\000", 0, 20);x2("\000(0B\000*\000)\000(0D\000*\000)\000\134\0002\000\000", "0B0B0B0D0D0D0D\000\000", 0, 14);x3("\000(0B\000*\000)\000(0D\000*\000)\000\134\0002\000\000", "0B0B0B0D0D0D0D\000\000", 6, 10, 2);x2("\000(\000(\000(\000(\000(\000(\000(0}\000*\000)0z\000)\000)\000)\000)\000)\000)0t\000\134\0007\000\000", "0}0}0}0z0t0}0}0}\000\000", 0, 16);x3("\000(\000(\000(\000(\000(\000(\000(0}\000*\000)0z\000)\000)\000)\000)\000)\000)0t\000\134\0007\000\000", "0}0}0}0z0t0}0}0}\000\000", 0, 6, 7);x2("\000(0o\000)\000(0r\000)\000(0u\000)\000\134\0002\000\134\0001\000\134\0003\000\000", "0o0r0u0r0o0u\000\000", 0, 12);x2("\000(\000[0M\000-0Q\000]\000)\000\134\0001\000\000", "0O0O\000\000", 0, 4);x2("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "0B\0005\000 0B\0005\000 \000\000", 0, 12);n("\000(\000\134\000w\000\134\000d\000\134\000s\000)\000\134\0001\000\000", "0B\0005\000 0B\0005\000\000");x2("\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)\000\134\0001\000\000", "\212\260\377\037\212\260\377\037\000\000", 0, 8);x2("\000.\000.\000.\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)\000\134\0001\000\000", "0B\000a0B\212\260\377\037\212\260\377\037\000\000", 0, 14);x2("\000(\212\260\377\037\000|\000[0B\000-0F\000]\000{\0003\000}\000)\000\134\0001\000\000", "0F0D0F0F0D0F\000\000", 0, 12);x2("\000(\000^0S\000)\000\134\0001\000\000", "0S0S\000\000", 0, 4);n("\000(\000^0\200\000)\000\134\0001\000\000", "0\2010\2000\200\000\000");n("\000(0B\000$\000)\000\134\0001\000\000", "0B0B\000\000");n("\000(0B0D\000\134\000Z\000)\000\134\0001\000\000", "0B0D\000\000");x2("\000(0B\000*\000\134\000Z\000)\000\134\0001\000\000", "0B\000\000", 2, 2);x2("\000.\000(0B\000*\000\134\000Z\000)\000\134\0001\000\000", "0D0B\000\000", 2, 4);x3("\000(\000.\000(0\2040D0\206\000)\000\134\0002\000)\000\000", "\000z0\2040D0\2060\2040D0\206\000\000", 0, 14, 1);x3("\000(\000.\000(\000.\000.\000\134\000d\000.\000)\000\134\0002\000)\000\000", "0B\0001\0002\0003\0004\0001\0002\0003\0004\000\000", 0, 18, 1);x2("\000(\000(\000?\000i\000:0B\000v0Z\000)\000)\000\134\0001\000\000", "0B\000v0Z0B\000v0Z\000\000", 0, 12);x2("\000(\000?\000<a\0320K\000>Y\011\000|\000\134\000(\000\134\000g\000<a\0320K\000>\000\134\000)\000)\000\000", "\000(\000(\000(\000(\000(\000(Y\011\000)\000)\000)\000)\000)\000)\000\000", 0, 26);x2("\000\134\000A\000(\000?\000:\000\134\000g\000<\226?\000_\0001\000>\000|\000\134\000g\000<N\221\000_\0002\000>\000|\000\134\000z}BN\206\000 \000 \000(\000?\000<\226?\000_\0001\000>\211\263\000|\201\352\000\134\000g\000<N\221\000_\0002\000>\201\352\000)\000(\000?\000<N\221\000_\0002\000>W(\000|\203\351\205\251\000\134\000g\000<\226?\000_\0001\000>\203\351\205\251\000)\000)\000$\000\000", "\203\351\205\251\201\352\203\351\205\251\201\352W(\201\352\203\351\205\251\201\352\203\351\205\251\000\000", 0, 26);x2("\000[\000[0r0u\000]\000]\000\000", "0u\000\000", 0, 2);x2("\000[\000[0D0J0F\000]0K\000]\000\000", "0K\000\000", 0, 2);n("\000[\000[\000^0B\000]\000]\000\000", "0B\000\000");n("\000[\000^\000[0B\000]\000]\000\000", "0B\000\000");x2("\000[\000^\000[\000^0B\000]\000]\000\000", "0B\000\000", 0, 2);x2("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0O\000\000", 0, 2);n("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0K\000\000");n("\000[\000[0K0M0O\000]\000&\000&0M0O\000]\000\000", "0Q\000\000");x2("\000[0B\000-0\223\000&\000&0D\000-0\222\000&\000&0F\000-0\221\000]\000\000", "0\221\000\000", 0, 2);n("\000[\000^0B\000-0\223\000&\000&0D\000-0\222\000&\000&0F\000-0\221\000]\000\000", "0\221\000\000");x2("\000[\000[\000^0B\000&\000&0B\000]\000&\000&0B\000-0\223\000]\000\000", "0D\000\000", 0, 2);n("\000[\000[\000^0B\000&\000&0B\000]\000&\000&0B\000-0\223\000]\000\000", "0B\000\000");x2("\000[\000[\000^0B\000-0\223\000&\000&0D0F0H0J\000]\000&\000&\000[\000^0F\000-0K\000]\000]\000\000", "0M\000\000", 0, 2);n("\000[\000[\000^0B\000-0\223\000&\000&0D0F0H0J\000]\000&\000&\000[\000^0F\000-0K\000]\000]\000\000", "0D\000\000");x2("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]\000\000", "0F\000\000", 0, 2);x2("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]\000\000", "0H\000\000", 0, 2);n("\000[\000^\000[\000^0B0D0F\000]\000&\000&\000[\000^0F0H0J\000]\000]\000\000", "0K\000\000");x2("\000[0B\000-\000&\000&\000-0B\000]\000\000", "\000-\000\000", 0, 2);x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000q\000-\000w\000]\000\000", "0H\000\000", 0, 2);x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", "\000f\000\000", 0, 2);x2("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", "\000g\000\000", 0, 2);n("\000[\000^\000[\000^\000a\000-\000z0B0D0F\000]\000&\000&\000[\000^\000b\000c\000d\000e\000f\000g0F0H0J\000]\000g\000-\000w\000]\000\000", "\0002\000\000");x2("\000a\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000\134\000/\000b\000>\000\000", "\000a\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000/\000b\000>\000\000", 0, 40);x2("\000.\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000\134\000/\000b\000>\000\000", "\000a\000<\000b\000>0\3200\3740\2700\3470\3630n0\3000\2460\3630\3550\3740\311\000<\000/\000b\000>\000\000", 0, 40);fprintf(stdout,"\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",nsucc, nfail, nerror, onig_version());#ifndef POSIX_TESTonig_region_free(region, 1);onig_end();#endifreturn ((nfail == 0 && nerror == 0) ? 0 : -1);}
# Oniguruma Makefile for Win32product_name = onigurumaCPPFLAGS =CFLAGS = -O2 -nologo /W3LDFLAGS =LOADLIBES =ARLIB = libARLIB_FLAGS = -nologoARDLL = clARDLL_FLAGS = -nologo -LD $(LINKFLAGS) -dllLINKFLAGS = -link -incremental:no -pdb:noneINSTALL = install -cCP = copyCC = clDEFS = -DHAVE_CONFIG_H -DNOT_RUBY -DEXPORTRUBYDIR = ..subdirs =libbase = oniglibname = $(libbase)_s.libdllname = $(libbase).dlldlllib = $(libbase).libonigheaders = oniguruma.h regint.h regparse.h regenc.h st.hposixheaders = onigposix.hheaders = $(posixheaders) $(onigheaders)onigobjs = reggnu.obj regerror.obj regparse.obj regext.obj regcomp.obj \regexec.obj regenc.obj regsyntax.obj regtrav.obj \regversion.obj st.objposixobjs = regposix.obj regposerr.objlibobjs = $(onigobjs) $(posixobjs)jp_objs = $(encdir)\euc_jp.obj $(encdir)\sjis.objiso8859_objs = $(encdir)\iso8859_1.obj $(encdir)\iso8859_2.obj \$(encdir)\iso8859_3.obj $(encdir)\iso8859_4.obj \$(encdir)\iso8859_5.obj $(encdir)\iso8859_6.obj \$(encdir)\iso8859_7.obj $(encdir)\iso8859_8.obj \$(encdir)\iso8859_9.obj $(encdir)\iso8859_10.obj \$(encdir)\iso8859_11.obj $(encdir)\iso8859_13.obj \$(encdir)\iso8859_14.obj $(encdir)\iso8859_15.obj \$(encdir)\iso8859_16.objencobjs = $(encdir)\ascii.obj $(encdir)\utf8.obj \$(encdir)\unicode.obj \$(encdir)\utf16_be.obj $(encdir)\utf16_le.obj \$(encdir)\utf32_be.obj $(encdir)\utf32_le.obj \$(jp_objs) $(iso8859_objs) \$(encdir)\euc_tw.obj $(encdir)\euc_kr.obj $(encdir)\big5.obj \$(encdir)\gb18030.obj \$(encdir)\koi8_r.obj \$(encdir)\cp1251.obj # $(encdir)\koi8.objonigsources = regerror.c regparse.c regext.c regcomp.c regexec.c regenc.c \regsyntax.c regtrav.c regversion.c reggnu.c st.cposixsources = regposix.c regposerr.clibsources = $(posixsources) $(onigsources)rubysources = $(onigsources)encdir = encpatchfiles = re.c.168.patch re.c.181.patchdistfiles = README COPYING HISTORY \Makefile.in configure.in config.h.in configure \$(headers) $(libsources) $(patchfiles) \test.rb testconv.rbtestc = testctestp = testpmakeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)'.SUFFIXES:.SUFFIXES: .obj .c .h .ps .dvi .info .texinfo.c.obj:$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) /I. /I.. /Fo$@ /c $<# targetsdefault: allsetup:$(CP) win32\config.h config.h$(CP) win32\testc.c testc.call: $(libname) $(dllname)$(libname): $(libobjs) $(encobjs)$(ARLIB) $(ARLIB_FLAGS) -out:$@ $(libobjs) $(encobjs)$(dllname): $(libobjs) $(encobjs)$(ARDLL) $(libobjs) $(encobjs) -Fe$@ $(ARDLL_FLAGS)regparse.obj: regparse.c $(onigheaders) config.h st.hregext.obj: regext.c $(onigheaders) config.hregtrav.obj: regtrav.c $(onigheaders) config.hregcomp.obj: regcomp.c $(onigheaders) config.hregexec.obj: regexec.c regint.h regenc.h oniguruma.h config.hreggnu.obj: reggnu.c regint.h regenc.h oniguruma.h config.h oniggnu.hregerror.obj: regerror.c regint.h regenc.h oniguruma.h config.hregenc.obj: regenc.c regenc.h oniguruma.h config.hregsyntax.obj: regsyntax.c regint.h regenc.h oniguruma.h config.hregversion.obj: regversion.c oniguruma.h config.hregposix.obj: regposix.c $(posixheaders) oniguruma.h config.hregposerr.obj: regposerr.c $(posixheaders) config.hst.obj: st.c regint.h oniguruma.h config.h st.h$(encdir)\ascii.obj: $(encdir)\ascii.c regenc.h config.h$(encdir)\unicode.obj: $(encdir)\unicode.c regenc.h config.h$(encdir)\utf8.obj: $(encdir)\utf8.c regenc.h config.h$(encdir)\utf16_be.obj: $(encdir)\utf16_be.c regenc.h config.h$(encdir)\utf16_le.obj: $(encdir)\utf16_le.c regenc.h config.h$(encdir)\utf32_be.obj: $(encdir)\utf32_be.c regenc.h config.h$(encdir)\utf32_le.obj: $(encdir)\utf32_le.c regenc.h config.h$(encdir)\euc_jp.obj: $(encdir)\euc_jp.c regenc.h config.h$(encdir)\euc_tw.obj: $(encdir)\euc_tw.c regenc.h config.h$(encdir)\euc_kr.obj: $(encdir)\euc_kr.c regenc.h config.h$(encdir)\sjis.obj: $(encdir)\sjis.c regenc.h config.h$(encdir)\iso8859_1.obj: $(encdir)\iso8859_1.c regenc.h config.h$(encdir)\iso8859_2.obj: $(encdir)\iso8859_2.c regenc.h config.h$(encdir)\iso8859_3.obj: $(encdir)\iso8859_3.c regenc.h config.h$(encdir)\iso8859_4.obj: $(encdir)\iso8859_4.c regenc.h config.h$(encdir)\iso8859_5.obj: $(encdir)\iso8859_5.c regenc.h config.h$(encdir)\iso8859_6.obj: $(encdir)\iso8859_6.c regenc.h config.h$(encdir)\iso8859_7.obj: $(encdir)\iso8859_7.c regenc.h config.h$(encdir)\iso8859_8.obj: $(encdir)\iso8859_8.c regenc.h config.h$(encdir)\iso8859_9.obj: $(encdir)\iso8859_9.c regenc.h config.h$(encdir)\iso8859_10.obj: $(encdir)\iso8859_10.c regenc.h config.h$(encdir)\iso8859_11.obj: $(encdir)\iso8859_11.c regenc.h config.h$(encdir)\iso8859_13.obj: $(encdir)\iso8859_13.c regenc.h config.h$(encdir)\iso8859_14.obj: $(encdir)\iso8859_14.c regenc.h config.h$(encdir)\iso8859_15.obj: $(encdir)\iso8859_15.c regenc.h config.h$(encdir)\iso8859_16.obj: $(encdir)\iso8859_16.c regenc.h config.h$(encdir)\koi8.obj: $(encdir)\koi8.c regenc.h config.h$(encdir)\koi8_r.obj: $(encdir)\koi8_r.c regenc.h config.h$(encdir)\cp1251.obj: $(encdir)\cp1251.c regenc.h config.h$(encdir)\big5.obj: $(encdir)\big5.c regenc.h config.h$(encdir)\gb18030.obj: $(encdir)\gb18030.c regenc.h config.h# Ruby testrtest:$(RUBYDIR)\win32\ruby -w -Ke test.rb# C library testctest: $(testc).\$(testc)# POSIX C library testptest: $(testp).\$(testp)$(testc): $(testc).c $(libname)$(CC) -nologo -o $(testc) -DONIG_EXTERN=extern $(testc).c $(libname)$(testp): $(testc).c $(dlllib)$(CC) -nologo -DPOSIX_TEST -o $(testp) $(testc).c $(dlllib)#$(testc)u.c: test.rb testconvu.rb# ruby -Ke testconvu.rb test.rb > $@$(testc)u: $(testc)u.c $(libname)$(CC) -nologo -o $(testc)u -DONIG_EXTERN=extern $(testc)u.c $(libname)clean:del *.obj $(encdir)\*.obj *.lib *.exp *.dll $(testp).exe $(testc).exe $(testc).obj# backup file suffixSORIG = ruby_orig# ruby 1.9 source update19:$(CP) regerror.c $(RUBYDIR)$(CP) regparse.c $(RUBYDIR)$(CP) regcomp.c $(RUBYDIR)$(CP) regexec.c $(RUBYDIR)$(CP) regenc.c $(RUBYDIR)$(CP) regint.h $(RUBYDIR)$(CP) regparse.h $(RUBYDIR)$(CP) regenc.h $(RUBYDIR)$(CP) oniguruma.h $(RUBYDIR)$(CP) enc\ascii.c $(RUBYDIR)$(CP) enc\utf8.c $(RUBYDIR)$(CP) enc\euc_jp.c $(RUBYDIR)$(CP) enc\sjis.c $(RUBYDIR)$(CP) enc\unicode.c $(RUBYDIR)samples: all$(CC) $(CFLAGS) -I. -o simple sample\simple.c $(dlllib)$(CC) $(CFLAGS) -I. -o posix sample\posix.c $(dlllib)$(CC) $(CFLAGS) -I. -o names sample\names.c $(dlllib)$(CC) $(CFLAGS) -I. -o listcap sample\listcap.c $(dlllib)$(CC) $(CFLAGS) -I. -o sql sample\sql.c $(dlllib)$(CC) $(CFLAGS) -I. -o encode sample\encode.c $(dlllib)$(CC) $(CFLAGS) -I. -o syntax sample\syntax.c $(dlllib)
#define STDC_HEADERS 1#define HAVE_SYS_TYPES_H 1#define HAVE_SYS_STAT_H 1#define HAVE_STDLIB_H 1#define HAVE_STRING_H 1#define HAVE_MEMORY_H 1#define HAVE_FLOAT_H 1#define HAVE_OFF_T 1#define SIZEOF_INT 4#define SIZEOF_SHORT 2#define SIZEOF_LONG 4#define SIZEOF_LONG_LONG 0#define SIZEOF___INT64 8#define SIZEOF_OFF_T 4#define SIZEOF_VOIDP 4#define SIZEOF_FLOAT 4#define SIZEOF_DOUBLE 8#define HAVE_PROTOTYPES 1#define TOKEN_PASTE(x,y) x##y#define HAVE_STDARG_PROTOTYPES 1#ifndef NORETURN#if _MSC_VER > 1100#define NORETURN(x) __declspec(noreturn) x#else#define NORETURN(x) x#endif#endif#define HAVE_DECL_SYS_NERR 1#define STDC_HEADERS 1#define HAVE_STDLIB_H 1#define HAVE_STRING_H 1#define HAVE_LIMITS_H 1#define HAVE_FCNTL_H 1#define HAVE_SYS_UTIME_H 1#define HAVE_MEMORY_H 1#define uid_t int#define gid_t int#define HAVE_STRUCT_STAT_ST_RDEV 1#define HAVE_ST_RDEV 1#define GETGROUPS_T int#define RETSIGTYPE void#define HAVE_ALLOCA 1#define HAVE_DUP2 1#define HAVE_MEMCMP 1#define HAVE_MEMMOVE 1#define HAVE_MKDIR 1#define HAVE_STRCASECMP 1#define HAVE_STRNCASECMP 1#define HAVE_STRERROR 1#define HAVE_STRFTIME 1#define HAVE_STRCHR 1#define HAVE_STRSTR 1#define HAVE_STRTOD 1#define HAVE_STRTOL 1#define HAVE_STRTOUL 1#define HAVE_FLOCK 1#define HAVE_VSNPRINTF 1#define HAVE_FINITE 1#define HAVE_FMOD 1#define HAVE_FREXP 1#define HAVE_HYPOT 1#define HAVE_MODF 1#define HAVE_WAITPID 1#define HAVE_CHSIZE 1#define HAVE_TIMES 1#define HAVE__SETJMP 1#define HAVE_TELLDIR 1#define HAVE_SEEKDIR 1#define HAVE_MKTIME 1#define HAVE_COSH 1#define HAVE_SINH 1#define HAVE_TANH 1#define HAVE_EXECVE 1#define HAVE_TZNAME 1#define HAVE_DAYLIGHT 1#define SETPGRP_VOID 1#define inline __inline#define NEED_IO_SEEK_BETWEEN_RW 1#define RSHIFT(x,y) ((x)>>(int)y)#define FILE_COUNT _cnt#define FILE_READPTR _ptr#define DEFAULT_KCODE KCODE_NONE#define DLEXT ".so"#define DLEXT2 ".dll"
License of Lrexlib release 2.6------------------------------Copyright (C) Reuben Thomas 2000-2012Copyright (C) Shmuel Zeigerman 2004-2012Permission is hereby granted, free of charge, to any personobtaining a copy of this software and associateddocumentation files (the "Software"), to deal in theSoftware without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute,sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so,subject to the following conditions:The above copyright notice and this permission notice shallbe included in all copies or substantial portions of theSoftware.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANYKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THEWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULARPURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORSOR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OROTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Makefile for lrexlib# See src/*/Makefile and src/defaults.mak for user-definable settingsinclude src/defaults.makREGNAMES = onigurumaPROJECT = lrexlibVERSION = $(V).$(MINORV)PROJECT_VERSIONED = $(PROJECT)-$(VERSION)DISTFILE = $(PROJECT_VERSIONED).zipall:@for i in $(REGNAMES); do \make -C src/$$i; \donecheck: all@for i in $(REGNAMES); do \make -C src/$$i check; \doneclean:@for i in $(REGNAMES); do \make -C src/$$i clean; \done
Lrexlib 2.6===========| by Reuben Thomas (rrt@sc3d.org)| and Shmuel Zeigerman (shmuz@013net.net) [maintainer]**Lrexlib** provides bindings of five regular expression library APIs(POSIX_, PCRE_, GNU_, TRE_ and Oniguruma_) to Lua_ 5.1 and Lua 5.2.The bindings for TRE and Oniguruma are not currently complete.**Lrexlib** is copyright Reuben Thomas 2000-2012 and copyright ShmuelZeigerman 2004-2012, and is released under the same license as Lua,the MIT_ license (otherwise known as the revised BSD license). Thereis no warranty... _POSIX: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html.. _PCRE: http://www.pcre.org/pcre.txt.. _GNU: ftp://ftp.gnu.org/old-gnu/regex/.. _Oniguruma: http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt.. _TRE: http://laurikari.net/tre/documentation/.. _Lua: http://www.lua.org.. _MIT: http://www.opensource.org/licenses/mit-license.phpPlease report bugs and make suggestions to the maintainer, or use theLuaForge trackers and mailing lists.Thanks to Thatcher Ulrich for bug and warning fixes, and to NickGammon for adding support for PCRE named subpatterns.-----------------------------------------------------------Links------ License_- `Reference Manual`_- `LuaForge Project Page`_- Download_.. _License: http://rrthomas.github.com/lrexlib/license.html.. _Reference Manual: http://rrthomas.github.com/lrexlib/manual.html.. _LuaForge Project Page: http://luaforge.net/projects/lrexlib/.. _Download: https://github.com/rrthomas/lrexlib/downloads
/* algo.h *//* See Copyright Notice in the file LICENSE */#include "common.h"/* FIXME: Get version from defaults.mak */#define REX_VERSION "Lrexlib 2.6.0"/* Forward declarations */static void gmatch_pushsubject (lua_State *L, TArgExec *argE);static int findmatch_exec (TUserdata *ud, TArgExec *argE);static int split_exec (TUserdata *ud, TArgExec *argE, int offset);static int compile_regex (lua_State *L, const TArgComp *argC, TUserdata **pud);static int generate_error (lua_State *L, const TUserdata *ud, int errcode);#if LUA_VERSION_NUM == 501# define ALG_ENVIRONINDEX LUA_ENVIRONINDEX#else# define ALG_ENVIRONINDEX lua_upvalueindex(1)#endif#ifndef ALG_CHARSIZE# define ALG_CHARSIZE 1#endif#ifndef BUFFERZ_PUTREPSTRING# define BUFFERZ_PUTREPSTRING bufferZ_putrepstring#endif#ifndef ALG_GETCARGS# define ALG_GETCARGS(a,b,c)#endif#ifndef DO_NAMED_SUBPATTERNS#define DO_NAMED_SUBPATTERNS(a,b,c)#endif/* When doing an iterative search, there can occur a situation of a zero-length* match at the current position, that prevents further advance on the subject* string.* There are two ways to handle that (AFAIK):* a) Advance by one character (continue the search from the next position),* or* b) Search for a non-zero-length match that begins from the current* position ("retry" the search). If the match is not found then advance* by one character.* The "b)" seems more correct, but most regex libraries expose no API for that.* The known exception is PCRE that has flags PCRE_NOTEMPTY and PCRE_ANCHORED.*/#ifdef ALG_USERETRY#define SET_RETRY(a,b) (a=b)static int gsub_exec (TUserdata *ud, TArgExec *argE, int offset, int retry);static int gmatch_exec (TUserdata *ud, TArgExec *argE, int retry);#define GSUB_EXEC gsub_exec#define GMATCH_EXEC gmatch_exec#else#define SET_RETRY(a,b) ((void)a)static int gsub_exec (TUserdata *ud, TArgExec *argE, int offset);static int gmatch_exec (TUserdata *ud, TArgExec *argE);#define GSUB_EXEC(a,b,c,d) gsub_exec(a,b,c)#define GMATCH_EXEC(a,b,c) gmatch_exec(a,b)#endif#define METHOD_FIND 0#define METHOD_MATCH 1#define METHOD_EXEC 2#define METHOD_TFIND 3static int OptLimit (lua_State *L, int pos) {if (lua_isnoneornil (L, pos))return GSUB_UNLIMITED;if (lua_isfunction (L, pos))return GSUB_CONDITIONAL;if (lua_isnumber (L, pos)) {int a = lua_tointeger (L, pos);return a < 0 ? 0 : a;}return luaL_typerror (L, pos, "number or function");}static int get_startoffset(lua_State *L, int stackpos, size_t len) {int startoffset = luaL_optint(L, stackpos, 1);if(startoffset > 0)startoffset--;else if(startoffset < 0) {startoffset += len/ALG_CHARSIZE;if(startoffset < 0)startoffset = 0;}return startoffset*ALG_CHARSIZE;}static TUserdata* test_ud (lua_State *L, int pos){TUserdata *ud;if (lua_getmetatable(L, pos) &&lua_rawequal(L, -1, ALG_ENVIRONINDEX) &&(ud = (TUserdata *)lua_touserdata(L, pos)) != NULL) {lua_pop(L, 1);return ud;}return NULL;}static TUserdata* check_ud (lua_State *L){TUserdata *ud = test_ud(L, 1);if (ud == NULL) luaL_typerror(L, 1, REX_TYPENAME);return ud;}static void check_pattern (lua_State *L, int pos, TArgComp *argC){if (lua_isstring (L, pos)) {argC->pattern = lua_tolstring (L, pos, &argC->patlen);argC->ud = NULL;}else if ((argC->ud = test_ud (L, pos)) == NULL)luaL_typerror(L, pos, "string or "REX_TYPENAME);}static void checkarg_new (lua_State *L, TArgComp *argC) {argC->pattern = luaL_checklstring (L, 1, &argC->patlen);argC->cflags = ALG_GETCFLAGS (L, 2);ALG_GETCARGS (L, 3, argC);}/* function gsub (s, patt, f, [n], [cf], [ef], [larg...]) */static void checkarg_gsub (lua_State *L, TArgComp *argC, TArgExec *argE) {argE->text = luaL_checklstring (L, 1, &argE->textlen);check_pattern (L, 2, argC);lua_tostring (L, 3); /* converts number (if any) to string */argE->reptype = lua_type (L, 3);if (argE->reptype != LUA_TSTRING && argE->reptype != LUA_TTABLE &&argE->reptype != LUA_TFUNCTION) {luaL_typerror (L, 3, "string, table or function");}argE->funcpos = 3;argE->funcpos2 = 4;argE->maxmatch = OptLimit (L, 4);argC->cflags = ALG_GETCFLAGS (L, 5);argE->eflags = luaL_optint (L, 6, ALG_EFLAGS_DFLT);ALG_GETCARGS (L, 7, argC);}/* function find (s, patt, [st], [cf], [ef], [larg...]) *//* function match (s, patt, [st], [cf], [ef], [larg...]) */static void checkarg_find_func (lua_State *L, TArgComp *argC, TArgExec *argE) {argE->text = luaL_checklstring (L, 1, &argE->textlen);check_pattern (L, 2, argC);argE->startoffset = get_startoffset (L, 3, argE->textlen);argC->cflags = ALG_GETCFLAGS (L, 4);argE->eflags = luaL_optint (L, 5, ALG_EFLAGS_DFLT);ALG_GETCARGS (L, 6, argC);}/* function gmatch (s, patt, [cf], [ef], [larg...]) *//* function split (s, patt, [cf], [ef], [larg...]) */static void checkarg_gmatch_split (lua_State *L, TArgComp *argC, TArgExec *argE) {argE->text = luaL_checklstring (L, 1, &argE->textlen);check_pattern (L, 2, argC);argC->cflags = ALG_GETCFLAGS (L, 3);argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT);ALG_GETCARGS (L, 5, argC);}/* method r:tfind (s, [st], [ef]) *//* method r:exec (s, [st], [ef]) *//* method r:find (s, [st], [ef]) *//* method r:match (s, [st], [ef]) */static void checkarg_find_method (lua_State *L, TArgExec *argE, TUserdata **ud) {*ud = check_ud (L);argE->text = luaL_checklstring (L, 2, &argE->textlen);argE->startoffset = get_startoffset (L, 3, argE->textlen);argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT);}static int algf_new (lua_State *L) {TArgComp argC;checkarg_new (L, &argC);return compile_regex (L, &argC, NULL);}static void push_substrings (lua_State *L, TUserdata *ud, const char *text,TFreeList *freelist) {int i;if (lua_checkstack (L, ALG_NSUB(ud)) == 0) {if (freelist)freelist_free (freelist);luaL_error (L, "cannot add %d stack slots", ALG_NSUB(ud));}for (i = 1; i <= ALG_NSUB(ud); i++) {ALG_PUSHSUB_OR_FALSE (L, ud, text, i);}}static int algf_gsub (lua_State *L) {TUserdata *ud;TArgComp argC;TArgExec argE;int n_match = 0, n_subst = 0, st = 0, retry;TBuffer BufOut, BufRep, BufTemp, *pBuf = &BufOut;TFreeList freelist;/*------------------------------------------------------------------*/checkarg_gsub (L, &argC, &argE);if (argC.ud) {ud = (TUserdata*) argC.ud;lua_pushvalue (L, 2);}else compile_regex (L, &argC, &ud);freelist_init (&freelist);/*------------------------------------------------------------------*/if (argE.reptype == LUA_TSTRING) {buffer_init (&BufRep, 256, L, &freelist);BUFFERZ_PUTREPSTRING (&BufRep, argE.funcpos, ALG_NSUB(ud));}/*------------------------------------------------------------------*/if (argE.maxmatch == GSUB_CONDITIONAL) {buffer_init (&BufTemp, 1024, L, &freelist);pBuf = &BufTemp;}/*------------------------------------------------------------------*/buffer_init (&BufOut, 1024, L, &freelist);SET_RETRY (retry, 0);while ((argE.maxmatch < 0 || n_match < argE.maxmatch) && st <= (int)argE.textlen) {int from, to, res;int curr_subst = 0;res = GSUB_EXEC (ud, &argE, st, retry);if (ALG_NOMATCH (res)) {#ifdef ALG_USERETRYif (retry) {if (st < (int)argE.textlen) { /* advance by 1 char (not replaced) */buffer_addlstring (&BufOut, argE.text + st, ALG_CHARSIZE);st += ALG_CHARSIZE;retry = 0;continue;}}#endifbreak;}else if (!ALG_ISMATCH (res)) {freelist_free (&freelist);return generate_error (L, ud, res);}++n_match;from = ALG_BASE(st) + ALG_SUBBEG(ud,0);to = ALG_BASE(st) + ALG_SUBEND(ud,0);if (st < from) {buffer_addlstring (&BufOut, argE.text + st, from - st);#ifdef ALG_PULLst = from;#endif}/*----------------------------------------------------------------*/if (argE.reptype == LUA_TSTRING) {size_t iter = 0, num;const char *str;while (bufferZ_next (&BufRep, &iter, &num, &str)) {if (str)buffer_addlstring (pBuf, str, num);else if (num == 0 || ALG_SUBVALID (ud,num))buffer_addlstring (pBuf, argE.text + ALG_BASE(st) + ALG_SUBBEG(ud,num), ALG_SUBLEN(ud,num));}curr_subst = 1;}/*----------------------------------------------------------------*/else if (argE.reptype == LUA_TTABLE) {if (ALG_NSUB(ud) > 0)ALG_PUSHSUB_OR_FALSE (L, ud, argE.text + ALG_BASE(st), 1);elselua_pushlstring (L, argE.text + from, to - from);lua_gettable (L, argE.funcpos);}/*----------------------------------------------------------------*/else if (argE.reptype == LUA_TFUNCTION) {int narg;lua_pushvalue (L, argE.funcpos);if (ALG_NSUB(ud) > 0) {push_substrings (L, ud, argE.text + ALG_BASE(st), &freelist);narg = ALG_NSUB(ud);}else {lua_pushlstring (L, argE.text + from, to - from);narg = 1;}if (0 != lua_pcall (L, narg, 1, 0)) {freelist_free (&freelist);return lua_error (L); /* re-raise the error */}}/*----------------------------------------------------------------*/if (argE.reptype != LUA_TSTRING) {if (lua_tostring (L, -1)) {buffer_addvalue (pBuf, -1);curr_subst = 1;}else if (!lua_toboolean (L, -1))buffer_addlstring (pBuf, argE.text + from, to - from);else {freelist_free (&freelist);luaL_error (L, "invalid replacement value (a %s)", luaL_typename (L, -1));}if (argE.maxmatch != GSUB_CONDITIONAL)lua_pop (L, 1);}/*----------------------------------------------------------------*/if (argE.maxmatch == GSUB_CONDITIONAL) {/* Call the function */lua_pushvalue (L, argE.funcpos2);lua_pushinteger (L, from/ALG_CHARSIZE + 1);lua_pushinteger (L, to/ALG_CHARSIZE);if (argE.reptype == LUA_TSTRING)buffer_pushresult (&BufTemp);else {lua_pushvalue (L, -4);lua_remove (L, -5);}if (0 != lua_pcall (L, 3, 2, 0)) {freelist_free (&freelist);lua_error (L); /* re-raise the error */}/* Handle the 1-st return value */if (lua_isstring (L, -2)) { /* coercion is allowed here */buffer_addvalue (&BufOut, -2); /* rep2 */curr_subst = 1;}else if (lua_toboolean (L, -2))buffer_addbuffer (&BufOut, &BufTemp); /* rep1 */else {buffer_addlstring (&BufOut, argE.text + from, to - from); /* "no" */curr_subst = 0;}/* Handle the 2-nd return value */if (lua_type (L, -1) == LUA_TNUMBER) { /* no coercion is allowed here */int n = lua_tointeger (L, -1);if (n < 0) /* n */n = 0;argE.maxmatch = n_match + n;}else if (lua_toboolean (L, -1)) /* "yes to all" */argE.maxmatch = GSUB_UNLIMITED;elsebuffer_clear (&BufTemp);lua_pop (L, 2);if (argE.maxmatch != GSUB_CONDITIONAL)pBuf = &BufOut;}/*----------------------------------------------------------------*/n_subst += curr_subst;if (st < to) {st = to;SET_RETRY (retry, 0);}else if (st < (int)argE.textlen) {#ifdef ALG_USERETRYretry = 1;#else/* advance by 1 char (not replaced) */buffer_addlstring (&BufOut, argE.text + st, ALG_CHARSIZE);st += ALG_CHARSIZE;#endif}else break;}/*------------------------------------------------------------------*/buffer_addlstring (&BufOut, argE.text + st, argE.textlen - st);buffer_pushresult (&BufOut);lua_pushinteger (L, n_match);lua_pushinteger (L, n_subst);freelist_free (&freelist);return 3;}static int finish_generic_find (lua_State *L, TUserdata *ud, TArgExec *argE,int method, int res){if (ALG_ISMATCH (res)) {if (method == METHOD_FIND)ALG_PUSHOFFSETS (L, ud, ALG_BASE(argE->startoffset), 0);if (ALG_NSUB(ud)) /* push captures */push_substrings (L, ud, argE->text, NULL);else if (method != METHOD_FIND) {ALG_PUSHSUB (L, ud, argE->text, 0);return 1;}return (method == METHOD_FIND) ? ALG_NSUB(ud) + 2 : ALG_NSUB(ud);}else if (ALG_NOMATCH (res))return lua_pushnil (L), 1;elsereturn generate_error (L, ud, res);}static int generic_find_func (lua_State *L, int method) {TUserdata *ud;TArgComp argC;TArgExec argE;int res;checkarg_find_func (L, &argC, &argE);if (argE.startoffset > (int)argE.textlen)return lua_pushnil (L), 1;if (argC.ud) {ud = (TUserdata*) argC.ud;lua_pushvalue (L, 2);}else compile_regex (L, &argC, &ud);res = findmatch_exec (ud, &argE);return finish_generic_find (L, ud, &argE, method, res);}static int algf_find (lua_State *L) {return generic_find_func (L, METHOD_FIND);}static int algf_match (lua_State *L) {return generic_find_func (L, METHOD_MATCH);}static int gmatch_iter (lua_State *L) {int retry;TArgExec argE;TUserdata *ud = (TUserdata*) lua_touserdata (L, lua_upvalueindex (1));argE.text = lua_tolstring (L, lua_upvalueindex (2), &argE.textlen);argE.eflags = lua_tointeger (L, lua_upvalueindex (3));argE.startoffset = lua_tointeger (L, lua_upvalueindex (4));#ifdef ALG_USERETRYretry = lua_tointeger (L, lua_upvalueindex (5));#endifif (argE.startoffset > (int)argE.textlen)return 0;while (1) {int res = GMATCH_EXEC (ud, &argE, retry);if (ALG_ISMATCH (res)) {int incr = 0;if (ALG_SUBLEN(ud,0)) {SET_RETRY (retry, 0);}else { /* no progress: prevent endless loop */#ifdef ALG_USERETRYSET_RETRY (retry, 1);#elseincr = ALG_CHARSIZE;#endif}lua_pushinteger(L, ALG_BASE(argE.startoffset) + incr + ALG_SUBEND(ud,0)); /* update start offset */lua_replace (L, lua_upvalueindex (4));#ifdef ALG_USERETRYlua_pushinteger (L, retry);lua_replace (L, lua_upvalueindex (5)); /* update retry */#endif/* push either captures or entire match */if (ALG_NSUB(ud)) {push_substrings (L, ud, argE.text, NULL);return ALG_NSUB(ud);}else {ALG_PUSHSUB (L, ud, argE.text, 0);return 1;}}else if (ALG_NOMATCH (res)) {#ifdef ALG_USERETRYif (retry) {if (argE.startoffset < (int)argE.textlen) {++argE.startoffset; /* advance by 1 char */SET_RETRY (retry, 0);continue;}}#endifreturn 0;}elsereturn generate_error (L, ud, res);}}static int split_iter (lua_State *L) {int incr, newoffset, res;TArgExec argE;TUserdata *ud = (TUserdata*) lua_touserdata (L, lua_upvalueindex (1));argE.text = lua_tolstring (L, lua_upvalueindex (2), &argE.textlen);argE.eflags = lua_tointeger (L, lua_upvalueindex (3));argE.startoffset = lua_tointeger (L, lua_upvalueindex (4));incr = lua_tointeger (L, lua_upvalueindex (5));if (argE.startoffset > (int)argE.textlen)return 0;if ((newoffset = argE.startoffset + incr) > (int)argE.textlen)goto nomatch;res = split_exec (ud, &argE, newoffset);if (ALG_ISMATCH (res)) {lua_pushinteger(L, ALG_BASE(newoffset) + ALG_SUBEND(ud,0)); /* update start offset */lua_replace (L, lua_upvalueindex (4));lua_pushinteger (L, ALG_SUBLEN(ud,0) ? 0 : ALG_CHARSIZE); /* update incr */lua_replace (L, lua_upvalueindex (5));/* push text preceding the match */lua_pushlstring (L, argE.text + argE.startoffset,ALG_SUBBEG(ud,0) + ALG_BASE(newoffset) - argE.startoffset);/* push either captures or entire match */if (ALG_NSUB(ud)) {push_substrings (L, ud, argE.text + ALG_BASE(newoffset), NULL);return 1 + ALG_NSUB(ud);}else {ALG_PUSHSUB (L, ud, argE.text + ALG_BASE(newoffset), 0);return 2;}}else if (ALG_NOMATCH (res))goto nomatch;elsereturn generate_error (L, ud, res);nomatch:lua_pushinteger (L, argE.textlen + 1); /* mark as last iteration */lua_replace (L, lua_upvalueindex (4)); /* update start offset */lua_pushlstring (L, argE.text+argE.startoffset, argE.textlen-argE.startoffset);return 1;}static int algf_gmatch (lua_State *L){TArgComp argC;TArgExec argE;TUserdata *ud;checkarg_gmatch_split (L, &argC, &argE);if (argC.ud) {ud = (TUserdata*) argC.ud;lua_pushvalue (L, 2);}else compile_regex (L, &argC, &ud); /* 1-st upvalue: ud */gmatch_pushsubject (L, &argE); /* 2-nd upvalue: s */lua_pushinteger (L, argE.eflags); /* 3-rd upvalue: ef */lua_pushinteger (L, 0); /* 4-th upvalue: startoffset */#ifdef ALG_USERETRYlua_pushinteger (L, 0); /* 5-th upvalue: retry */lua_pushcclosure (L, gmatch_iter, 5);#elselua_pushcclosure (L, gmatch_iter, 4);#endifreturn 1;}static int algf_split (lua_State *L){TArgComp argC;TArgExec argE;TUserdata *ud;checkarg_gmatch_split (L, &argC, &argE);if (argC.ud) {ud = (TUserdata*) argC.ud;lua_pushvalue (L, 2);}else compile_regex (L, &argC, &ud); /* 1-st upvalue: ud */gmatch_pushsubject (L, &argE); /* 2-nd upvalue: s */lua_pushinteger (L, argE.eflags); /* 3-rd upvalue: ef */lua_pushinteger (L, 0); /* 4-th upvalue: startoffset */lua_pushinteger (L, 0); /* 5-th upvalue: incr */lua_pushcclosure (L, split_iter, 5);return 1;}static void push_substring_table (lua_State *L, TUserdata *ud, const char *text) {int i;lua_newtable (L);for (i = 1; i <= ALG_NSUB(ud); i++) {ALG_PUSHSUB_OR_FALSE (L, ud, text, i);lua_rawseti (L, -2, i);}}static void push_offset_table (lua_State *L, TUserdata *ud, int startoffset) {int i, j;lua_newtable (L);for (i=1, j=1; i <= ALG_NSUB(ud); i++) {if (ALG_SUBVALID (ud,i)) {ALG_PUSHSTART (L, ud, startoffset, i);lua_rawseti (L, -2, j++);ALG_PUSHEND (L, ud, startoffset, i);lua_rawseti (L, -2, j++);}else {lua_pushboolean (L, 0);lua_rawseti (L, -2, j++);lua_pushboolean (L, 0);lua_rawseti (L, -2, j++);}}}static int generic_find_method (lua_State *L, int method) {TUserdata *ud;TArgExec argE;int res;checkarg_find_method (L, &argE, &ud);if (argE.startoffset > (int)argE.textlen)return lua_pushnil(L), 1;res = findmatch_exec (ud, &argE);if (ALG_ISMATCH (res)) {switch (method) {case METHOD_EXEC:ALG_PUSHOFFSETS (L, ud, ALG_BASE(argE.startoffset), 0);push_offset_table (L, ud, ALG_BASE(argE.startoffset));DO_NAMED_SUBPATTERNS (L, ud, argE.text);return 3;case METHOD_TFIND:ALG_PUSHOFFSETS (L, ud, ALG_BASE(argE.startoffset), 0);push_substring_table (L, ud, argE.text);DO_NAMED_SUBPATTERNS (L, ud, argE.text);return 3;case METHOD_MATCH:case METHOD_FIND:return finish_generic_find (L, ud, &argE, method, res);}return 0;}else if (ALG_NOMATCH (res))return lua_pushnil (L), 1;elsereturn generate_error(L, ud, res);}static int algm_find (lua_State *L) {return generic_find_method (L, METHOD_FIND);}static int algm_match (lua_State *L) {return generic_find_method (L, METHOD_MATCH);}static int algm_tfind (lua_State *L) {return generic_find_method (L, METHOD_TFIND);}static int algm_exec (lua_State *L) {return generic_find_method (L, METHOD_EXEC);}static void alg_register (lua_State *L, const luaL_Reg *r_methods,const luaL_Reg *r_functions, const char *name) {/* Create a new function environment to serve as a metatable for methods. */#if LUA_VERSION_NUM == 501lua_newtable (L);lua_pushvalue (L, -1);lua_replace (L, LUA_ENVIRONINDEX);luaL_register (L, NULL, r_methods);#elseluaL_newmetatable(L, REX_TYPENAME);lua_pushvalue(L, -1);luaL_setfuncs (L, r_methods, 1);#endiflua_pushvalue(L, -1); /* mt.__index = mt */lua_setfield(L, -2, "__index");/* Register functions. */lua_createtable(L, 0, 8);#if LUA_VERSION_NUM == 501luaL_register (L, NULL, r_functions);#elselua_pushvalue(L, -2);luaL_setfuncs (L, r_functions, 1);#endif#ifdef REX_CREATEGLOBALVARlua_pushvalue(L, -1);lua_setglobal(L, REX_LIBNAME);#endiflua_pushfstring (L, REX_VERSION" (for %s)", name);lua_setfield (L, -2, "_VERSION");}
/* common.c *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <ctype.h>#include <string.h>#include "lua.h"#include "lauxlib.h"#include "common.h"#define N_ALIGN sizeof(int)/* the table must be on Lua stack top */int get_int_field (lua_State *L, const char* field){int val;lua_getfield (L, -1, field);val = lua_tointeger (L, -1);lua_pop (L, 1);return val;}/* the table must be on Lua stack top */void set_int_field (lua_State *L, const char* field, int val){lua_pushinteger (L, val);lua_setfield (L, -2, field);}void *Lmalloc(lua_State *L, size_t size) {void *p = malloc(size);if(p == NULL)luaL_error(L, "malloc failed");return p;}/* This function fills a table with string-number pairs.The table can be passed as the 1-st lua-function parameter,otherwise it is created. The return value is the filled table.*/int get_flags (lua_State *L, const flag_pair **arrs) {const flag_pair *p;const flag_pair **pp;int nparams = lua_gettop(L);if(nparams == 0)lua_newtable(L);else {if(!lua_istable(L, 1))luaL_argerror(L, 1, "not a table");if(nparams > 1)lua_pushvalue(L, 1);}for(pp=arrs; *pp; ++pp) {for(p=*pp; p->key; ++p) {lua_pushstring(L, p->key);lua_pushinteger(L, p->val);lua_rawset(L, -3);}}return 1;}const char *get_flag_key (const flag_pair *fp, int val) {for (; fp->key; ++fp) {if (fp->val == val)return fp->key;}return NULL;}/* Classes *//** class TFreeList* **************** Simple array of pointers to TBuffer's.* The array has fixed capacity (not expanded automatically).*/void freelist_init (TFreeList *fl) {fl->top = 0;}void freelist_add (TFreeList *fl, TBuffer *buf) {fl->list[fl->top++] = buf;}void freelist_free (TFreeList *fl) {while (fl->top > 0)buffer_free (fl->list[--fl->top]);}/** class TBuffer* ************** Auto-extensible array of characters for building long strings incrementally.* * Differs from luaL_Buffer in that:* * it does not use Lua facilities (except luaL_error when malloc fails)* * its operations do not change Lua stack top position* * buffer_addvalue does not extract the value from Lua stack* * buffer_pushresult does not have to be the last operation* * Uses TFreeList class:* * for inserting itself into a TFreeList instance for future clean-up* * calls freelist_free prior to calling luaL_error.* * Has specialized "Z-operations" for maintaining mixed string/integer* array: bufferZ_addlstring, bufferZ_addnum and bufferZ_next.* * if the array is intended to be "mixed", then the methods* buffer_addlstring and buffer_addvalue must not be used* (the application will crash on bufferZ_next).* * conversely, if the array is not intended to be "mixed",* then the method bufferZ_next must not be used.*/enum { ID_NUMBER, ID_STRING };void buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl) {buf->arr = (char*) malloc (sz);if (!buf->arr) {freelist_free (fl);luaL_error (L, "malloc failed");}buf->size = sz;buf->top = 0;buf->L = L;buf->freelist = fl;freelist_add (fl, buf);}void buffer_free (TBuffer *buf) {free (buf->arr);}void buffer_clear (TBuffer *buf) {buf->top = 0;}void buffer_pushresult (TBuffer *buf) {lua_pushlstring (buf->L, buf->arr, buf->top);}void buffer_addbuffer (TBuffer *trg, TBuffer *src) {buffer_addlstring (trg, src->arr, src->top);}void buffer_addlstring (TBuffer *buf, const void *src, size_t sz) {size_t newtop = buf->top + sz;if (newtop > buf->size) {char *p = (char*) realloc (buf->arr, 2 * newtop); /* 2x expansion */if (!p) {freelist_free (buf->freelist);luaL_error (buf->L, "realloc failed");}buf->arr = p;buf->size = 2 * newtop;}if (src)memcpy (buf->arr + buf->top, src, sz);buf->top = newtop;}void buffer_addvalue (TBuffer *buf, int stackpos) {size_t len;const char *p = lua_tolstring (buf->L, stackpos, &len);buffer_addlstring (buf, p, len);}void bufferZ_addlstring (TBuffer *buf, const void *src, size_t len) {int n;size_t header[2] = { ID_STRING };header[1] = len;buffer_addlstring (buf, header, sizeof (header));buffer_addlstring (buf, src, len);n = len % N_ALIGN;if (n) buffer_addlstring (buf, NULL, N_ALIGN - n);}void bufferZ_addnum (TBuffer *buf, size_t num) {size_t header[2] = { ID_NUMBER };header[1] = num;buffer_addlstring (buf, header, sizeof (header));}/* 1. When called repeatedly on the same TBuffer, its existing datais discarded and overwritten by the new data.2. The TBuffer's array is never shrunk by this function.*/void bufferZ_putrepstring (TBuffer *BufRep, int reppos, int nsub) {char dbuf[] = { 0, 0 };size_t replen;const char *p = lua_tolstring (BufRep->L, reppos, &replen);const char *end = p + replen;BufRep->top = 0;while (p < end) {const char *q;for (q = p; q < end && *q != '%'; ++q){}if (q != p)bufferZ_addlstring (BufRep, p, q - p);if (q < end) {if (++q < end) { /* skip % */if (isdigit (*q)) {int num;*dbuf = *q;num = strtol (dbuf, NULL, 10);if (num == 1 && nsub == 0)num = 0;else if (num > nsub) {freelist_free (BufRep->freelist);luaL_error (BufRep->L, "invalid capture index");}bufferZ_addnum (BufRep, num);}else bufferZ_addlstring (BufRep, q, 1);}p = q + 1;}else break;}}/******************************************************************************The intended use of this function is as follows:size_t iter = 0;while (bufferZ_next (buf, &iter, &num, &str)) {if (str) do_something_with_string (str, num);else do_something_with_number (num);}********************************************************************************/int bufferZ_next (TBuffer *buf, size_t *iter, size_t *num, const char **str) {if (*iter < buf->top) {size_t *ptr_header = (size_t*)(buf->arr + *iter);*num = ptr_header[1];*iter += 2 * sizeof (size_t);*str = NULL;if (*ptr_header == ID_STRING) {int n;*str = buf->arr + *iter;*iter += *num;n = *iter % N_ALIGN;if (n) *iter += (N_ALIGN - n);}return 1;}return 0;}#if LUA_VERSION_NUM > 501int luaL_typerror (lua_State *L, int narg, const char *tname) {const char *msg = lua_pushfstring(L, "%s expected, got %s",tname, luaL_typename(L, narg));return luaL_argerror(L, narg, msg);}#endif
/* common.h *//* See Copyright Notice in the file LICENSE */#ifndef COMMON_H#define COMMON_H#include "lua.h"#if LUA_VERSION_NUM > 501int luaL_typerror (lua_State *L, int narg, const char *tname);#endif/* REX_API can be overridden from the command line or Makefile */#ifndef REX_API# define REX_API LUALIB_API#endif/* Special values for maxmatch in gsub. They all must be negative. */#define GSUB_UNLIMITED -1#define GSUB_CONDITIONAL -2/* Common structs and functions */typedef struct {const char* key;int val;} flag_pair;typedef struct { /* compile arguments */const char * pattern;size_t patlen;void * ud;int cflags;const char * locale; /* PCRE, Oniguruma */const unsigned char * tables; /* PCRE */int tablespos; /* PCRE */void * syntax; /* Oniguruma */const unsigned char * translate; /* GNU */int gnusyn; /* GNU */} TArgComp;typedef struct { /* exec arguments */const char * text;size_t textlen;int startoffset;int eflags;int funcpos;int maxmatch;int funcpos2; /* used with gsub */int reptype; /* used with gsub */size_t ovecsize; /* PCRE: dfa_exec */size_t wscount; /* PCRE: dfa_exec */} TArgExec;struct tagFreeList; /* forward declaration */struct tagBuffer {size_t size;size_t top;char * arr;lua_State * L;struct tagFreeList * freelist;};struct tagFreeList {struct tagBuffer * list[16];int top;};typedef struct tagBuffer TBuffer;typedef struct tagFreeList TFreeList;void freelist_init (TFreeList *fl);void freelist_add (TFreeList *fl, TBuffer *buf);void freelist_free (TFreeList *fl);void buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl);void buffer_free (TBuffer *buf);void buffer_clear (TBuffer *buf);void buffer_addbuffer (TBuffer *trg, TBuffer *src);void buffer_addlstring (TBuffer *buf, const void *src, size_t sz);void buffer_addvalue (TBuffer *buf, int stackpos);void buffer_pushresult (TBuffer *buf);void bufferZ_putrepstring (TBuffer *buf, int reppos, int nsub);int bufferZ_next (TBuffer *buf, size_t *iter, size_t *len, const char **str);void bufferZ_addlstring (TBuffer *buf, const void *src, size_t len);void bufferZ_addnum (TBuffer *buf, size_t num);int get_int_field (lua_State *L, const char* field);void set_int_field (lua_State *L, const char* field, int val);int get_flags (lua_State *L, const flag_pair **arr);const char *get_flag_key (const flag_pair *fp, int val);void *Lmalloc (lua_State *L, size_t size);#endif
# Rules for lrexlibTRG = rex_$(REGNAME)DEFS = -DREX_OPENLIB=luaopen_$(TRG) -DREX_LIBNAME=\"$(TRG)\"CFLAGS = $(MYCFLAGS) $(DEFS) $(INC)TRG_AR = lib$(TRG).aTRG_SO = $(TRG).soLD = $(CC)UNAME_S := $(shell uname -s)ifeq ($(UNAME_S),Linux)LDFLAGS= -sharedendififeq ($(UNAME_S),Darwin)LDFLAGS= -bundle -undefined dynamic_lookupendifall: $(TRG_AR) $(TRG_SO)$(TRG_AR): $(OBJ)$(AR) $@ $^$(TRG_SO): $(OBJ)$(LD) -o $@.$V $(LDFLAGS) $^ $(LIB) $(LIB_LUA)ln -fs $@.$V $@clean:rm -f $(OBJ) $(TRG_AR) $(TRG_SO)*check: allLUA_INIT= LUA_PATH=../../test/?.lua $(LUA) ../../test/runtest.lua -d. $(REGNAME)
# default settings for lrexlibV = 2.6MINORV = 0LUA = luaINC_LUA =LIB_LUA =# If the default settings don't work for your system,# try to uncomment and edit the settings below.#INC_LUA = -I/usr/include/lua5.1#LIB_LUA = -lluaMYCFLAGS = -W -Wall -g $(INC_LUA) $(INC_PCRE) -fPICAR = ar rcuCC = gcc
# makefile for rex_gnu libraryinclude ../defaults.mak# === USER SETTINGS ===# ===========================================================================# These are default values.INC =LIB =# If the default settings don't work for your system,# try to uncomment and edit the settings below.# The default settings below work with a libgnu.a in the current directory,# copied from any libgnu.a built with the regex module.INC = -I. -DREX_GNU_INCLUDE='"regex.h"'LIB = -L. -lgnu# Regex library nameREGNAME = gnu# ===========================================================================# === END OF USER SETTINGS ===OBJ = lgnu.o ../common.oinclude ../common.mak# static GNU regexp library bindingar_gnu: $(TRG_AR)# dynamic GNU regexp library bindingso_gnu: $(TRG_SO)# Dependencieslgnu.o: lgnu.c ../common.h ../algo.h../common.o: ../common.c ../common.h# (End of Makefile)
/* lgnu.c - Lua binding of GNU regular expressions library *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <string.h>#include <ctype.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"#define _GNU_SOURCE#ifndef __USE_GNU# define __USE_GNU#endif#ifndef REX_GNU_INCLUDE# include <regex.h>#else# include REX_GNU_INCLUDE#endif/* These 2 settings may be redefined from the command-line or the makefile.* They should be kept in sync between themselves and with the target name.*/#ifndef REX_LIBNAME# define REX_LIBNAME "rex_gnu"#endif#ifndef REX_OPENLIB# define REX_OPENLIB luaopen_rex_gnu#endif#define REX_TYPENAME REX_LIBNAME"_regex"#define ALG_CFLAGS_DFLT RE_SYNTAX_POSIX_EXTENDED#define ALG_EFLAGS_DFLT 0#define ALG_GETCFLAGS(L,pos) luaL_optint(L, pos, ALG_CFLAGS_DFLT)static const unsigned char *gettranslate (lua_State *L, int pos);#define ALG_GETCARGS(L,pos,argC) argC->translate = gettranslate (L, pos)#define ALG_NOMATCH(res) ((res) == -1 || (res) == -2)#define ALG_ISMATCH(res) ((res) >= 0)#define ALG_SUBBEG(ud,n) ud->match.start[n]#define ALG_SUBEND(ud,n) ud->match.end[n]#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n))#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0)#define ALG_NSUB(ud) ((int)ud->r.re_nsub)#define ALG_PUSHSUB(L,ud,text,n) \lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n))#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \(ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0))#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1)#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n))#define ALG_PUSHOFFSETS(L,ud,offs,n) \(ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n))#define ALG_BASE(st) (st)typedef struct {struct re_pattern_buffer r;struct re_registers match;int freed;const char * errmsg;} TGnu;#define TUserdata TGnu#include "../algo.h"/* Functions*******************************************************************************//* Execution flags, which we need to simulate as GNU does not use flags for this. */#define GNU_NOTBOL 1#define GNU_NOTEOL 2#define GNU_BACKWARD 4static int generate_error (lua_State *L, const TUserdata *ud, int errcode) {const char *errmsg;switch (errcode) {case 0:errmsg = ud->errmsg;break;case -1:errmsg = "no match";break;case -2:errmsg = "internal error in GNU regex";break;default:errmsg = "unknown error";}return luaL_error (L, "%s", errmsg);}#define ALG_TRANSLATE_SIZE (UCHAR_MAX + 1)static const unsigned char *gettranslate (lua_State *L, int pos) {unsigned i;const unsigned char *translate;if (lua_isnoneornil (L, pos))return NULL;translate = (const unsigned char *) Lmalloc (L, ALG_TRANSLATE_SIZE);memset ((unsigned char *) translate, 0, ALG_TRANSLATE_SIZE); /* initialize all members to 0 */for (i = 0; i <= UCHAR_MAX; i++) {lua_pushinteger (L, i);lua_gettable (L, pos);if (lua_tostring (L, -1))((unsigned char *) translate)[i] = *lua_tostring (L, -1);lua_pop (L, 1);}return translate;}static void seteflags (TGnu *ud, TArgExec *argE) {ud->r.not_bol = (argE->eflags & GNU_NOTBOL) != 0;ud->r.not_eol = (argE->eflags & GNU_NOTEOL) != 0;}static int compile_regex (lua_State *L, const TArgComp *argC, TGnu **pud) {const char *res;TGnu *ud;int ret;ud = (TGnu *)lua_newuserdata (L, sizeof (TGnu));memset (ud, 0, sizeof (TGnu)); /* initialize all members to 0 */re_set_syntax (argC->cflags);/* translate table is never written to, so this cast is safe */ud->r.translate = (unsigned char *) argC->translate;res = re_compile_pattern (argC->pattern, argC->patlen, &ud->r);if (res != NULL) {ud->errmsg = res;ret = generate_error (L, ud, 0);} else {lua_pushvalue (L, ALG_ENVIRONINDEX);lua_setmetatable (L, -2);if (pud) *pud = ud;ret = 1;}return ret;}static int gmatch_exec (TUserdata *ud, TArgExec *argE) {seteflags (ud, argE);if (argE->startoffset > 0)ud->r.not_bol = 1;argE->text += argE->startoffset;argE->textlen -= argE->startoffset;if (argE->eflags & GNU_BACKWARD)return re_search (&ud->r, argE->text, argE->textlen, argE->textlen, -argE->textlen, &ud->match);elsereturn re_search (&ud->r, argE->text, argE->textlen, 0, argE->textlen, &ud->match);}static void gmatch_pushsubject (lua_State *L, TArgExec *argE) {lua_pushlstring (L, argE->text, argE->textlen);}static int findmatch_exec (TGnu *ud, TArgExec *argE) {argE->text += argE->startoffset;argE->textlen -= argE->startoffset;seteflags (ud, argE);if (argE->eflags & GNU_BACKWARD)return re_search (&ud->r, argE->text, argE->textlen, argE->textlen, -argE->textlen, &ud->match);elsereturn re_search (&ud->r, argE->text, argE->textlen, 0, argE->textlen, &ud->match);}static int gsub_exec (TGnu *ud, TArgExec *argE, int st) {seteflags (ud, argE);if (st > 0)ud->r.not_bol = 1;if (argE->eflags & GNU_BACKWARD)return re_search (&ud->r, argE->text + st, argE->textlen - st, argE->textlen - st, -(argE->textlen - st), &ud->match);elsereturn re_search (&ud->r, argE->text + st, argE->textlen - st, 0, argE->textlen - st, &ud->match);}static int split_exec (TGnu *ud, TArgExec *argE, int offset) {seteflags (ud, argE);if (offset > 0)ud->r.not_bol = 1;if (argE->eflags & GNU_BACKWARD)return re_search (&ud->r, argE->text + offset, argE->textlen - offset, argE->textlen - offset, -(argE->textlen - offset), &ud->match);elsereturn re_search (&ud->r, argE->text + offset, argE->textlen - offset, 0, argE->textlen - offset, &ud->match);}static int Gnu_gc (lua_State *L) {TGnu *ud = check_ud (L);if (ud->freed == 0) { /* precaution against "manual" __gc calling */ud->freed = 1;regfree (&ud->r);free (ud->match.start);free (ud->match.end);}return 0;}static int Gnu_tostring (lua_State *L) {TGnu *ud = check_ud (L);if (ud->freed == 0)lua_pushfstring (L, "%s (%p)", REX_TYPENAME, (void*)ud);elselua_pushfstring (L, "%s (deleted)", REX_TYPENAME);return 1;}static flag_pair gnu_flags[] ={{ "not_bol", GNU_NOTBOL },{ "not_eol", GNU_NOTEOL },{ "backward", GNU_BACKWARD },/*---------------------------------------------------------------------------*/{ NULL, 0 }};static flag_pair gnu_syntax_flags[] = {/* Syntax flag sets. */{ "SYNTAX_EMACS", RE_SYNTAX_EMACS },{ "SYNTAX_AWK", RE_SYNTAX_AWK },{ "SYNTAX_GNU_AWK", RE_SYNTAX_GNU_AWK },{ "SYNTAX_POSIX_AWK", RE_SYNTAX_POSIX_AWK },{ "SYNTAX_POSIX_AWK", RE_SYNTAX_POSIX_AWK },{ "SYNTAX_EGREP", RE_SYNTAX_EGREP },{ "SYNTAX_POSIX_EGREP", RE_SYNTAX_POSIX_EGREP },{ "SYNTAX_ED", RE_SYNTAX_ED },{ "SYNTAX_SED", RE_SYNTAX_SED },{ "SYNTAX_POSIX_AWK", RE_SYNTAX_POSIX_AWK },{ "SYNTAX_GREP", RE_SYNTAX_GREP },{ "SYNTAX_POSIX_BASIC", RE_SYNTAX_POSIX_BASIC },{ "SYNTAX_POSIX_MINIMAL_BASIC", RE_SYNTAX_POSIX_MINIMAL_BASIC },{ "SYNTAX_POSIX_EXTENDED", RE_SYNTAX_POSIX_EXTENDED },{ "SYNTAX_POSIX_MINIMAL_EXTENDED", RE_SYNTAX_POSIX_MINIMAL_EXTENDED },/* Individual syntax flags. */{ "BACKSLASH_ESCAPE_IN_LISTS", RE_BACKSLASH_ESCAPE_IN_LISTS },{ "BK_PLUS_QM", RE_BK_PLUS_QM },{ "CHAR_CLASSES", RE_CHAR_CLASSES },{ "CONTEXT_INDEP_ANCHORS", RE_CONTEXT_INDEP_ANCHORS },{ "CONTEXT_INDEP_OPS", RE_CONTEXT_INDEP_OPS },{ "CONTEXT_INVALID_OPS", RE_CONTEXT_INVALID_OPS },{ "DOT_NEWLINE", RE_DOT_NEWLINE },{ "DOT_NOT_NULL", RE_DOT_NOT_NULL },{ "HAT_LISTS_NOT_NEWLINE", RE_HAT_LISTS_NOT_NEWLINE },{ "INTERVALS", RE_INTERVALS },{ "LIMITED_OPS", RE_LIMITED_OPS },{ "NEWLINE_ALT", RE_NEWLINE_ALT },{ "NO_BK_BRACES", RE_NO_BK_BRACES },{ "NO_BK_PARENS", RE_NO_BK_PARENS },{ "NO_BK_REFS", RE_NO_BK_REFS },{ "NO_BK_VBAR", RE_NO_BK_VBAR },{ "NO_EMPTY_RANGES", RE_NO_EMPTY_RANGES },{ "UNMATCHED_RIGHT_PAREN_ORD", RE_UNMATCHED_RIGHT_PAREN_ORD },{ "NO_POSIX_BACKTRACKING", RE_NO_POSIX_BACKTRACKING },{ "NO_GNU_OPS", RE_NO_GNU_OPS },{ "DEBUG", RE_DEBUG },{ "INVALID_INTERVAL_ORD", RE_INVALID_INTERVAL_ORD },{ "ICASE", RE_ICASE },{ "CARET_ANCHORS_HERE", RE_CARET_ANCHORS_HERE },{ "CONTEXT_INVALID_DUP", RE_CONTEXT_INVALID_DUP },{ "NO_SUB", RE_NO_SUB },#ifdef RE_PLAIN{ "PLAIN", RE_PLAIN },#endif/*---------------------------------------------------------------------------*/{ NULL, 0 }};static int Gnu_get_flags (lua_State *L) {const flag_pair* fps[] = { gnu_flags, gnu_syntax_flags, NULL };return get_flags (L, fps);}static const luaL_Reg r_methods[] = {{ "exec", algm_exec },{ "tfind", algm_tfind }, /* old match */{ "find", algm_find },{ "match", algm_match },{ "__gc", Gnu_gc },{ "__tostring", Gnu_tostring },{ NULL, NULL}};static const luaL_Reg r_functions[] = {{ "match", algf_match },{ "find", algf_find },{ "gmatch", algf_gmatch },{ "gsub", algf_gsub },{ "split", algf_split },{ "new", algf_new },{ "flags", Gnu_get_flags },{ NULL, NULL }};/* Open the library */REX_API int REX_OPENLIB (lua_State *L){alg_register(L, r_methods, r_functions, "GNU regexes");return 1;}
/* Definitions for data structures and routines for the regularexpression library.Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1998,2000, 2001, 2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation,Inc.This file is part of the GNU C Library.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 3, or (at your option)any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public License alongwith this program; if not, write to the Free Software Foundation,Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */#ifndef _REGEX_H#define _REGEX_H 1#include <sys/types.h>/* Allow the use in C++ code. */#ifdef __cplusplusextern "C" {#endif/* Define __USE_GNU_REGEX to declare GNU extensions that violate thePOSIX name space rules. */#undef __USE_GNU_REGEX#if (defined _GNU_SOURCE \|| (!defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE \&& !defined _XOPEN_SOURCE))# define __USE_GNU_REGEX 1#endif#ifdef _REGEX_LARGE_OFFSETS/* Use types and values that are wide enough to represent signed andunsigned byte offsets in memory. This currently works only whenthe regex code is used outside of the GNU C library; it is not yetsupported within glibc itself, and glibc users should not define_REGEX_LARGE_OFFSETS. *//* The type of the offset of a byte within a string.For historical reasons POSIX 1003.1-2004 requires that regoff_t beat least as wide as off_t. However, many common POSIX platforms setregoff_t to the more-sensible ssize_t and the Open Group hassignalled its intention to change the requirement to be thatregoff_t be at least as wide as ptrdiff_t and ssize_t; see XBD ERN60 (2005-08-25). We don't know of any hosts where ssize_t orptrdiff_t is wider than ssize_t, so ssize_t is safe. */typedef ssize_t regoff_t;/* The type of nonnegative object indexes. Traditionally, GNU regexuses 'int' for these. Code that uses __re_idx_t should workregardless of whether the type is signed. */typedef size_t __re_idx_t;/* The type of object sizes. */typedef size_t __re_size_t;/* The type of object sizes, in places where the traditional codeuses unsigned long int. */typedef size_t __re_long_size_t;#else/* Use types that are binary-compatible with the traditional GNU regeximplementation, which mishandles strings longer than INT_MAX. */typedef int regoff_t;typedef int __re_idx_t;typedef unsigned int __re_size_t;typedef unsigned long int __re_long_size_t;#endif/* The following two types have to be signed and unsigned integer typewide enough to hold a value of a pointer. For most ANSI compilersptrdiff_t and size_t should be likely OK. Still size of these twotypes is 2 for Microsoft C. Ugh... */typedef long int s_reg_t;typedef unsigned long int active_reg_t;/* The following bits are used to determine the regexp syntax werecognize. The set/not-set meanings are chosen so that Emacs syntaxremains the value 0. The bits are given in alphabetical order, andthe definitions shifted by one from the previous bit; thus, when weadd or remove a bit, only one other definition need change. */typedef unsigned long int reg_syntax_t;#ifdef __USE_GNU_REGEX/* If this bit is not set, then \ inside a bracket expression is literal.If set, then such a \ quotes the following character. */# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)/* If this bit is not set, then + and ? are operators, and \+ and \? areliterals.If set, then \+ and \? are operators and + and ? are literals. */# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)/* If this bit is set, then character classes are supported. They are:[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],[:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].If not set, then character classes are not supported. */# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)/* If this bit is set, then ^ and $ are always anchors (outside bracketexpressions, of course).If this bit is not set, then it depends:^ is an anchor if it is at the beginning of a regularexpression or after an open-group or an alternation operator;$ is an anchor if it is at the end of a regular expression, orbefore a close-group or an alternation operator.This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, becausePOSIX draft 11.2 says that * etc. in leading positions is undefined.We already implemented a previous draft which made those constructsinvalid, though, so we haven't changed the code back. */# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)/* If this bit is set, then special characters are always specialregardless of where they are in the pattern.If this bit is not set, then special characters are special only insome contexts; otherwise they are ordinary. Specifically,* + ? and intervals are only special when not after the beginning,open-group, or alternation operator. */# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)/* If this bit is set, then *, +, ?, and { cannot be first in an re orimmediately after an alternation or begin-group operator. */# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)/* If this bit is set, then . matches newline.If not set, then it doesn't. */# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)/* If this bit is set, then . doesn't match NUL.If not set, then it does. */# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)/* If this bit is set, nonmatching lists [^...] do not match newline.If not set, they do. */# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)/* If this bit is set, either \{...\} or {...} defines aninterval, depending on RE_NO_BK_BRACES.If not set, \{, \}, {, and } are literals. */# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)/* If this bit is set, +, ? and | aren't recognized as operators.If not set, they are. */# define RE_LIMITED_OPS (RE_INTERVALS << 1)/* If this bit is set, newline is an alternation operator.If not set, newline is literal. */# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)/* If this bit is set, then `{...}' defines an interval, and \{ and \}are literals.If not set, then `\{...\}' defines an interval. */# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)/* If this bit is set, (...) defines a group, and \( and \) are literals.If not set, \(...\) defines a group, and ( and ) are literals. */# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)/* If this bit is set, then \<digit> matches <digit>.If not set, then \<digit> is a back-reference. */# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)/* If this bit is set, then | is an alternation operator, and \| is literal.If not set, then \| is an alternation operator, and | is literal. */# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)/* If this bit is set, then an ending range point collating higherthan the starting range point, as in [z-a], is invalid.If not set, then when ending range point collates higher than thestarting range point, the range is ignored. */# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)/* If this bit is set, then an unmatched ) is ordinary.If not set, then an unmatched ) is invalid. */# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)/* If this bit is set, succeed as soon as we match the whole pattern,without further backtracking. */# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)/* If this bit is set, do not process the GNU regex operators.If not set, then the GNU regex operators are recognized. */# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)/* If this bit is set, turn on internal regex debugging.If not set, and debugging was on, turn it off.This only works if regex.c is compiled -DDEBUG.We define this bit always, so that all that's needed to turn ondebugging is to recompile regex.c; the calling code can always havethis bit set, and it won't affect anything in the normal case. */# define RE_DEBUG (RE_NO_GNU_OPS << 1)/* If this bit is set, a syntactically invalid interval is treated asa string of ordinary characters. For example, the ERE 'a{1' istreated as 'a\{1'. */# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)/* If this bit is set, then ignore case when matching.If not set, then case is significant. */# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but onlyfor ^, because it is difficult to scan the regex backwards to findwhether ^ should be special. */# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)/* If this bit is set, then \{ cannot be first in a regex orimmediately after an alternation, open-group or \} operator. */# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)/* If this bit is set, then no_sub will be set to 1 duringre_compile_pattern. */# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)/* If this bit is set, then all special characters are ignoredby re_compile_pattern. */# define RE_PLAIN (RE_NO_SUB << 1)#endif /* defined __USE_GNU_REGEX *//* This global variable defines the particular regexp syntax to use (forsome interfaces). When a regexp is compiled, the syntax used isstored in the pattern buffer, so changing this does not affectalready-compiled regexps. */extern reg_syntax_t re_syntax_options;#ifdef __USE_GNU_REGEX/* Define combinations of the above bits for the standard possibilities.(The [[[ comments delimit what gets put into the Texinfo file, sodon't delete them!) *//* [[[begin syntaxes]]] */# define RE_SYNTAX_EMACS 0# define RE_SYNTAX_AWK \(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \| RE_NO_BK_PARENS | RE_NO_BK_REFS \| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)# define RE_SYNTAX_GNU_AWK \((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \| RE_CONTEXT_INVALID_OPS ))# define RE_SYNTAX_POSIX_AWK \(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \| RE_INTERVALS | RE_NO_GNU_OPS)# define RE_SYNTAX_GREP \(RE_BK_PLUS_QM | RE_CHAR_CLASSES \| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \| RE_NEWLINE_ALT)# define RE_SYNTAX_EGREP \(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \| RE_NEWLINE_ALT | RE_NO_BK_PARENS \| RE_NO_BK_VBAR)# define RE_SYNTAX_POSIX_EGREP \(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \| RE_INVALID_INTERVAL_ORD)/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC/* Syntax bits common to both basic and extended POSIX regex syntax. */# define _RE_SYNTAX_POSIX_COMMON \(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \| RE_INTERVALS | RE_NO_EMPTY_RANGES)# define RE_SYNTAX_POSIX_BASIC \(_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomesRE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, thisisn't minimal, since other operators, such as \`, aren't disabled. */# define RE_SYNTAX_POSIX_MINIMAL_BASIC \(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)# define RE_SYNTAX_POSIX_EXTENDED \(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \| RE_NO_BK_PARENS | RE_NO_BK_VBAR \| RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS isremoved and RE_NO_BK_REFS is added. */# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \| RE_NO_BK_PARENS | RE_NO_BK_REFS \| RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)/* [[[end syntaxes]]] */#endif /* defined __USE_GNU_REGEX */#ifdef __USE_GNU_REGEX/* Maximum number of duplicates an interval can allow. POSIX-conformingsystems might define this in <limits.h>, but we want ourvalue, so remove any previous define. */# ifdef RE_DUP_MAX# undef RE_DUP_MAX# endif/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation storedthe counter as a 2-byte signed integer. This is no longer true, soRE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined.However, there would be a huge performance problem if someoneactually used a pattern like a\{214748363\}, so RE_DUP_MAX retainsits historical value. */# define RE_DUP_MAX (0x7fff)#endif /* defined __USE_GNU_REGEX *//* POSIX `cflags' bits (i.e., information for `regcomp'). *//* If this bit is set, then use extended regular expression syntax.If not set, then use basic regular expression syntax. */#define REG_EXTENDED 1/* If this bit is set, then ignore case when matching.If not set, then case is significant. */#define REG_ICASE (1 << 1)/* If this bit is set, then anchors do not match at newlinecharacters in the string.If not set, then anchors do match at newlines. */#define REG_NEWLINE (1 << 2)/* If this bit is set, then report only success or fail in regexec.If not set, then returns differ between not matching and errors. */#define REG_NOSUB (1 << 3)/* POSIX `eflags' bits (i.e., information for regexec). *//* If this bit is set, then the beginning-of-line operator doesn't matchthe beginning of the string (presumably because it's not thebeginning of a line).If not set, then the beginning-of-line operator does match thebeginning of the string. */#define REG_NOTBOL 1/* Like REG_NOTBOL, except for the end-of-line. */#define REG_NOTEOL (1 << 1)/* Use PMATCH[0] to delimit the start and end of the search in thebuffer. */#define REG_STARTEND (1 << 2)/* If any error codes are removed, changed, or added, update the`__re_error_msgid' table in regcomp.c. */typedef enum{_REG_ENOSYS = -1, /* This will never happen for this implementation. */_REG_NOERROR = 0, /* Success. */_REG_NOMATCH, /* Didn't find a match (for regexec). *//* POSIX regcomp return error codes. (In the order listed in thestandard.) */_REG_BADPAT, /* Invalid pattern. */_REG_ECOLLATE, /* Invalid collating element. */_REG_ECTYPE, /* Invalid character class name. */_REG_EESCAPE, /* Trailing backslash. */_REG_ESUBREG, /* Invalid back reference. */_REG_EBRACK, /* Unmatched left bracket. */_REG_EPAREN, /* Parenthesis imbalance. */_REG_EBRACE, /* Unmatched \{. */_REG_BADBR, /* Invalid contents of \{\}. */_REG_ERANGE, /* Invalid range end. */_REG_ESPACE, /* Ran out of memory. */_REG_BADRPT, /* No preceding re for repetition op. *//* Error codes we've added. */_REG_EEND, /* Premature end. */_REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */_REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */} reg_errcode_t;#ifdef _XOPEN_SOURCE# define REG_ENOSYS _REG_ENOSYS#endif#define REG_NOERROR _REG_NOERROR#define REG_NOMATCH _REG_NOMATCH#define REG_BADPAT _REG_BADPAT#define REG_ECOLLATE _REG_ECOLLATE#define REG_ECTYPE _REG_ECTYPE#define REG_EESCAPE _REG_EESCAPE#define REG_ESUBREG _REG_ESUBREG#define REG_EBRACK _REG_EBRACK#define REG_EPAREN _REG_EPAREN#define REG_EBRACE _REG_EBRACE#define REG_BADBR _REG_BADBR#define REG_ERANGE _REG_ERANGE#define REG_ESPACE _REG_ESPACE#define REG_BADRPT _REG_BADRPT#define REG_EEND _REG_EEND#define REG_ESIZE _REG_ESIZE#define REG_ERPAREN _REG_ERPAREN/* struct re_pattern_buffer normally uses member names like `buffer'that POSIX does not allow. In POSIX mode these members have nameswith leading `re_' (e.g., `re_buffer'). */#ifdef __USE_GNU_REGEX# define _REG_RE_NAME(id) id# define _REG_RM_NAME(id) id#else# define _REG_RE_NAME(id) re_##id# define _REG_RM_NAME(id) rm_##id#endif/* The user can specify the type of the re_translate member bydefining the macro RE_TRANSLATE_TYPE, which defaults to unsignedchar *. This pollutes the POSIX name space, so in POSIX mode justuse unsigned char *. */#ifdef __USE_GNU_REGEX# ifndef RE_TRANSLATE_TYPE# define RE_TRANSLATE_TYPE unsigned char *# endif# define REG_TRANSLATE_TYPE RE_TRANSLATE_TYPE#else# define REG_TRANSLATE_TYPE unsigned char *#endif/* This data structure represents a compiled pattern. Before callingthe pattern compiler, the fields `buffer', `allocated', `fastmap',`translate', and `no_sub' can be set. After the pattern has beencompiled, the `re_nsub' field is available. All other fields areprivate to the regex routines. */struct re_pattern_buffer{/* Space that holds the compiled pattern. It is declared as`unsigned char *' because its elements are sometimes used asarray indexes. */unsigned char *_REG_RE_NAME (buffer);/* Number of bytes to which `buffer' points. */__re_long_size_t _REG_RE_NAME (allocated);/* Number of bytes actually used in `buffer'. */__re_long_size_t _REG_RE_NAME (used);/* Syntax setting with which the pattern was compiled. */reg_syntax_t _REG_RE_NAME (syntax);/* Pointer to a fastmap, if any, otherwise zero. re_search uses thefastmap, if there is one, to skip over impossible starting pointsfor matches. */char *_REG_RE_NAME (fastmap);/* Either a translate table to apply to all characters beforecomparing them, or zero for no translation. The translation isapplied to a pattern when it is compiled and to a string when itis matched. */REG_TRANSLATE_TYPE _REG_RE_NAME (translate);/* Number of subexpressions found by the compiler. */size_t re_nsub;/* Zero if this pattern cannot match the empty string, one else.Well, in truth it's used only in `re_search_2', to see whether ornot we should use the fastmap, so we don't set this absolutelyperfectly; see `re_compile_fastmap' (the `duplicate' case). */unsigned int _REG_RE_NAME (can_be_null) : 1;/* If REGS_UNALLOCATED, allocate space in the `regs' structurefor `max (RE_NREGS, re_nsub + 1)' groups.If REGS_REALLOCATE, reallocate space if necessary.If REGS_FIXED, use what's there. */#ifdef __USE_GNU_REGEX# define REGS_UNALLOCATED 0# define REGS_REALLOCATE 1# define REGS_FIXED 2#endifunsigned int _REG_RE_NAME (regs_allocated) : 2;/* Set to zero when `re_compile_pattern' compiles a pattern; set toone by `re_compile_fastmap' if it updates the fastmap. */unsigned int _REG_RE_NAME (fastmap_accurate) : 1;/* If set, `re_match_2' does not return information aboutsubexpressions. */unsigned int _REG_RE_NAME (no_sub) : 1;/* If set, a beginning-of-line anchor doesn't match at the beginningof the string. */unsigned int _REG_RE_NAME (not_bol) : 1;/* Similarly for an end-of-line anchor. */unsigned int _REG_RE_NAME (not_eol) : 1;/* If true, an anchor at a newline matches. */unsigned int _REG_RE_NAME (newline_anchor) : 1;/* [[[end pattern_buffer]]] */};typedef struct re_pattern_buffer regex_t;/* This is the structure we store register match data in. Seeregex.texinfo for a full description of what registers match. */struct re_registers{__re_size_t _REG_RM_NAME (num_regs);regoff_t *_REG_RM_NAME (start);regoff_t *_REG_RM_NAME (end);};/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,`re_match_2' returns information about at least this many registersthe first time a `regs' structure is passed. */#if !defined RE_NREGS && defined __USE_GNU_REGEX# define RE_NREGS 30#endif/* POSIX specification for registers. Aside from the different names than`re_registers', POSIX uses an array of structures, instead of astructure of arrays. */typedef struct{regoff_t rm_so; /* Byte offset from string's start to substring's start. */regoff_t rm_eo; /* Byte offset from string's start to substring's end. */} regmatch_t;/* Declarations for routines. *//* Sets the current default syntax to SYNTAX, and return the old syntax.You can also simply assign to the `re_syntax_options' variable. */extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);/* Compile the regular expression PATTERN, with length LENGTHand syntax given by the global `re_syntax_options', into the bufferBUFFER. Return NULL if successful, and an error string if not. */extern const char *re_compile_pattern (const char *__pattern, size_t __length,struct re_pattern_buffer *__buffer);/* Compile a fastmap for the compiled pattern in BUFFER; used toaccelerate searches. Return 0 if successful and -2 if was aninternal error. */extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);/* Search in the string STRING (with length LENGTH) for the patterncompiled into BUFFER. Start searching at position START, for RANGEcharacters. Return the starting position of the match, -1 for nomatch, or -2 for an internal error. Also return registerinformation in REGS (if REGS and BUFFER->no_sub are nonzero). */extern regoff_t re_search (struct re_pattern_buffer *__buffer,const char *__string, __re_idx_t __length,__re_idx_t __start, regoff_t __range,struct re_registers *__regs);/* Like `re_search', but search in the concatenation of STRING1 andSTRING2. Also, stop searching at index START + STOP. */extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,const char *__string1, __re_idx_t __length1,const char *__string2, __re_idx_t __length2,__re_idx_t __start, regoff_t __range,struct re_registers *__regs,__re_idx_t __stop);/* Like `re_search', but return how many characters in STRING the regexpin BUFFER matched, starting at position START. */extern regoff_t re_match (struct re_pattern_buffer *__buffer,const char *__string, __re_idx_t __length,__re_idx_t __start, struct re_registers *__regs);/* Relates to `re_match' as `re_search_2' relates to `re_search'. */extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,const char *__string1, __re_idx_t __length1,const char *__string2, __re_idx_t __length2,__re_idx_t __start, struct re_registers *__regs,__re_idx_t __stop);/* Set REGS to hold NUM_REGS registers, storing them in STARTS andENDS. Subsequent matches using BUFFER and REGS will use this memoryfor recording register information. STARTS and ENDS must beallocated with malloc, and must each be at least `NUM_REGS * sizeof(regoff_t)' bytes long.If NUM_REGS == 0, then subsequent matches should allocate their ownregister data.Unless this function is called, the first search or match usingBUFFER will allocate its own register data, without freeing the olddata. */extern void re_set_registers (struct re_pattern_buffer *__buffer,struct re_registers *__regs,__re_size_t __num_regs,regoff_t *__starts, regoff_t *__ends);#if defined _REGEX_RE_COMP || defined _LIBC# ifndef _CRAY/* 4.2 bsd compatibility. */extern char *re_comp (const char *);extern int re_exec (const char *);# endif#endif/* GCC 2.95 and later have "__restrict"; C99 compilers have"restrict", and "configure" may have defined "restrict".Other compilers use __restrict, __restrict__, and _Restrict, and'configure' might #define 'restrict' to those words, so pick adifferent name. */#ifndef _Restrict_# if 199901L <= __STDC_VERSION__# define _Restrict_ restrict# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)# define _Restrict_ __restrict# else# define _Restrict_# endif#endif/* gcc 3.1 and up support the [restrict] syntax. Don't trustsys/cdefs.h's definition of __restrict_arr, though, as itmishandles gcc -ansi -pedantic. */#ifndef _Restrict_arr_# if ((199901L <= __STDC_VERSION__ \|| ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \&& !__STRICT_ANSI__)) \&& !defined __GNUG__)# define _Restrict_arr_ _Restrict_# else# define _Restrict_arr_# endif#endif/* POSIX compatibility. */extern int regcomp (regex_t *_Restrict_ __preg,const char *_Restrict_ __pattern,int __cflags);extern int regexec (const regex_t *_Restrict_ __preg,const char *_Restrict_ __string, size_t __nmatch,regmatch_t __pmatch[_Restrict_arr_],int __eflags);extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,char *_Restrict_ __errbuf, size_t __errbuf_size);extern void regfree (regex_t *__preg);#ifdef __cplusplus}#endif /* C++ */#endif /* regex.h */
# makefile for rex_onig libraryinclude ../defaults.mak# === USER SETTINGS ===# ===========================================================================# BRATINC = -I../../../../common/onig-5.9.2 -I$(LUA_INC_PATH)LIB = -L$(BRAT_LIB_PATH) -lonig -fPIC# If the default settings don't work for your system,# try to uncomment and edit the settings below.#INC =#LIB = -lonig# Target nameREGNAME = onig# ===========================================================================# === END OF USER SETTINGS ===OBJ = lonig.o lonig_f.o ../common.oinclude ../common.mak# static Oniguruma regexp library bindingar_onig: $(TRG_AR)# dynamic Oniguruma regexp library bindingso_onig: $(TRG_SO)# Dependencieslonig.o: lonig.c ../common.h ../algo.hlonig_f.o: lonig_f.c ../common.h../common.o: ../common.c ../common.h# (End of Makefile)
/* lonig.c - Lua binding of Oniguruma library *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <string.h>#include <locale.h>#include <ctype.h>#include <oniguruma.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"extern int LOnig_get_flags (lua_State *L);/* These 2 settings may be redefined from the command-line or the makefile.* They should be kept in sync between themselves and with the target name.*/#ifndef REX_LIBNAME# define REX_LIBNAME "rex_onig"#endif#ifndef REX_OPENLIB# define REX_OPENLIB luaopen_rex_onig#endif#define REX_TYPENAME REX_LIBNAME"_regex"#define ALG_CFLAGS_DFLT ONIG_OPTION_NONE#define ALG_EFLAGS_DFLT 0static int getcflags (lua_State *L, int pos);#define ALG_GETCFLAGS(L,pos) getcflags(L, pos)static void checkarg_compile (lua_State *L, int pos, TArgComp *argC);#define ALG_GETCARGS(a,b,c) checkarg_compile(a,b,c)#define ALG_NOMATCH(res) ((res) == ONIG_MISMATCH)#define ALG_ISMATCH(res) ((res) >= 0)#define ALG_SUBBEG(ud,n) ud->region->beg[n]#define ALG_SUBEND(ud,n) ud->region->end[n]#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n))#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0)#define ALG_NSUB(ud) onig_number_of_captures(ud->reg)#define ALG_PUSHSUB(L,ud,text,n) \lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n))#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \(ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0))#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1)#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n))#define ALG_PUSHOFFSETS(L,ud,offs,n) \(ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n))#define ALG_BASE(st) 0#define ALG_PULL/* #define ALG_USERETRY */typedef struct {regex_t *reg;OnigRegion *region;OnigErrorInfo einfo;} TOnig;#define TUserdata TOnigstatic void do_named_subpatterns (lua_State *L, TOnig *ud, const char *text);# define DO_NAMED_SUBPATTERNS do_named_subpatterns#include "../algo.h"#define CUC const unsigned char*/* Functions*******************************************************************************/static int getcflags (lua_State *L, int pos) {switch (lua_type (L, pos)) {case LUA_TNONE:case LUA_TNIL:return ALG_CFLAGS_DFLT;case LUA_TNUMBER:return lua_tointeger (L, pos);case LUA_TSTRING: {const char *s = lua_tostring (L, pos);int res = 0, ch;while ((ch = *s++) != '\0') {if (ch == 'i') res |= ONIG_OPTION_IGNORECASE;else if (ch == 'm') res |= ONIG_OPTION_NEGATE_SINGLELINE;else if (ch == 's') res |= ONIG_OPTION_MULTILINE;else if (ch == 'x') res |= ONIG_OPTION_EXTEND;/* else if (ch == 'U') res |= PCRE_UNGREEDY; *//* else if (ch == 'X') res |= PCRE_EXTRA; */}return res;}default:return luaL_typerror (L, pos, "number or string");}}static int generate_error (lua_State *L, const TOnig *ud, int errcode) {char buf [ONIG_MAX_ERROR_MESSAGE_LEN];onig_error_code_to_str(buf, errcode, ud->einfo);return luaL_error(L, buf);}typedef struct {const char * name;void * value;} EncPair;/* ATTENTION:This array must always be kept alphabetically sorted, as it's used in thebinary search, so take care when manually inserting new elements.*/static EncPair Encodings[] = {{ "ASCII", ONIG_ENCODING_ASCII },{ "BIG5", ONIG_ENCODING_BIG5 },{ "CP1251", ONIG_ENCODING_CP1251 },{ "EUC_CN", ONIG_ENCODING_EUC_CN },{ "EUC_JP", ONIG_ENCODING_EUC_JP },{ "EUC_KR", ONIG_ENCODING_EUC_KR },{ "EUC_TW", ONIG_ENCODING_EUC_TW },{ "GB18030", ONIG_ENCODING_GB18030 },{ "ISO_8859_1", ONIG_ENCODING_ISO_8859_1 },{ "ISO_8859_10", ONIG_ENCODING_ISO_8859_10 },{ "ISO_8859_11", ONIG_ENCODING_ISO_8859_11 },{ "ISO_8859_13", ONIG_ENCODING_ISO_8859_13 },{ "ISO_8859_14", ONIG_ENCODING_ISO_8859_14 },{ "ISO_8859_15", ONIG_ENCODING_ISO_8859_15 },{ "ISO_8859_16", ONIG_ENCODING_ISO_8859_16 },{ "ISO_8859_2", ONIG_ENCODING_ISO_8859_2 },{ "ISO_8859_3", ONIG_ENCODING_ISO_8859_3 },{ "ISO_8859_4", ONIG_ENCODING_ISO_8859_4 },{ "ISO_8859_5", ONIG_ENCODING_ISO_8859_5 },{ "ISO_8859_6", ONIG_ENCODING_ISO_8859_6 },{ "ISO_8859_7", ONIG_ENCODING_ISO_8859_7 },{ "ISO_8859_8", ONIG_ENCODING_ISO_8859_8 },{ "ISO_8859_9", ONIG_ENCODING_ISO_8859_9 },/*{ "KOI8", ONIG_ENCODING_KOI8 }, */{ "KOI8_R", ONIG_ENCODING_KOI8_R },{ "SJIS", ONIG_ENCODING_SJIS },{ "UNDEF", ONIG_ENCODING_UNDEF },{ "UTF16_BE", ONIG_ENCODING_UTF16_BE },{ "UTF16_LE", ONIG_ENCODING_UTF16_LE },{ "UTF32_BE", ONIG_ENCODING_UTF32_BE },{ "UTF32_LE", ONIG_ENCODING_UTF32_LE },{ "UTF8", ONIG_ENCODING_UTF8 },};/* ATTENTION:This array must always be kept alphabetically sorted, as it's used in thebinary search, so take care when manually inserting new elements.*/static EncPair Syntaxes[] = {{ "ASIS", ONIG_SYNTAX_ASIS },/*{ "DEFAULT", ONIG_SYNTAX_DEFAULT }, */{ "EMACS", ONIG_SYNTAX_EMACS },{ "GNU_REGEX", ONIG_SYNTAX_GNU_REGEX },{ "GREP", ONIG_SYNTAX_GREP },{ "JAVA", ONIG_SYNTAX_JAVA },{ "PERL", ONIG_SYNTAX_PERL },{ "PERL_NG", ONIG_SYNTAX_PERL_NG },{ "POSIX_BASIC", ONIG_SYNTAX_POSIX_BASIC },{ "POSIX_EXTENDED", ONIG_SYNTAX_POSIX_EXTENDED },{ "RUBY", ONIG_SYNTAX_RUBY },};static int fcmp(const void *p1, const void *p2) {return strcmp(((EncPair*)p1)->name, ((EncPair*)p2)->name);}static const char *getlocale (lua_State *L, int pos) {EncPair key, *found;if ((key.name = luaL_optstring(L, pos, NULL)) == NULL)return (const char*)ONIG_ENCODING_ASCII;found = (EncPair*) bsearch(&key, Encodings, sizeof(Encodings)/sizeof(EncPair),sizeof(EncPair), fcmp);if (found == NULL)luaL_argerror(L, pos, "invalid or unsupported encoding string");return (const char*)found->value;}static void *getsyntax (lua_State *L, int pos) {EncPair key, *found;if ((key.name = luaL_optstring(L, pos, NULL)) == NULL)return ONIG_SYNTAX_DEFAULT;found = (EncPair*) bsearch(&key, Syntaxes, sizeof(Syntaxes)/sizeof(EncPair),sizeof(EncPair), fcmp);if (found == NULL)luaL_argerror(L, pos, "invalid or unsupported syntax string");return found->value;}static void checkarg_compile (lua_State *L, int pos, TArgComp *argC) {argC->locale = getlocale (L, pos);argC->syntax = getsyntax (L, pos + 1);}/*rex.setdefaultsyntax (syntax)@param syntax: one of the predefined strings listed in array 'Syntaxes'@return: nothing*/static int LOnig_setdefaultsyntax (lua_State *L) {(void)luaL_checkstring(L, 1);onig_set_default_syntax(getsyntax(L, 1));return 0;}static int compile_regex (lua_State *L, const TArgComp *argC, TOnig **pud) {TOnig *ud;int r;ud = (TOnig*)lua_newuserdata (L, sizeof (TOnig));memset (ud, 0, sizeof (TOnig)); /* initialize all members to 0 */lua_pushvalue (L, ALG_ENVIRONINDEX);lua_setmetatable (L, -2);r = onig_new(&ud->reg, (CUC)argC->pattern, (CUC)argC->pattern + argC->patlen,argC->cflags, (OnigEncoding)argC->locale, (OnigSyntaxType*)argC->syntax,&ud->einfo);if (r != ONIG_NORMAL)return generate_error(L, ud, r);if ((ud->region = onig_region_new()) == NULL)return luaL_error(L, "`onig_region_new' failed");if (pud) *pud = ud;return 1;}typedef struct {lua_State *L;TOnig *ud;const char *text;} TNameArg;static int name_callback (const UChar *name, const UChar *name_end,int ngroups, int *groupnumlist, regex_t *reg, void *arg){(void) ngroups;(void) groupnumlist;TNameArg *A = (TNameArg*)arg;int num = onig_name_to_backref_number(reg, name, name_end, A->ud->region);lua_pushlstring (A->L, (const char*)name, name_end - name);ALG_PUSHSUB_OR_FALSE (A->L, A->ud, A->text, num);lua_rawset (A->L, -3);return 0;}/* the target table must be on lua stack top */static void do_named_subpatterns (lua_State *L, TOnig *ud, const char *text) {if (onig_number_of_names (ud->reg) > 0) {TNameArg A = { L, ud, text };onig_foreach_name(ud->reg, name_callback, &A);}}static int findmatch_exec (TUserdata *ud, TArgExec *argE) {const char *end = argE->text + argE->textlen;onig_region_clear(ud->region);return onig_search (ud->reg, (CUC)argE->text, (CUC)end,(CUC)argE->text + argE->startoffset, (CUC)end,ud->region, argE->eflags);}static void gmatch_pushsubject (lua_State *L, TArgExec *argE) {lua_pushlstring (L, argE->text, argE->textlen);}static int gmatch_exec (TOnig *ud, TArgExec *argE) {return findmatch_exec(ud, argE);}static int gsub_exec (TOnig *ud, TArgExec *argE, int st) {const char *end = argE->text + argE->textlen;onig_region_clear(ud->region);return onig_search (ud->reg, (CUC)argE->text, (CUC)end, (CUC)argE->text + st,(CUC)end, ud->region, argE->eflags);}static int split_exec (TOnig *ud, TArgExec *argE, int st) {return gsub_exec(ud, argE, st);}static int LOnig_gc (lua_State *L) {TOnig *ud = check_ud (L);if (ud->reg) { /* precaution against "manual" __gc calling */onig_free (ud->reg);ud->reg = NULL;}if (ud->region) {onig_region_free (ud->region, 1);ud->region = NULL;}return 0;}static int LOnig_tostring (lua_State *L) {TOnig *ud = check_ud (L);if (ud->reg)lua_pushfstring (L, "%s (%p)", REX_TYPENAME, (void*)ud);elselua_pushfstring (L, "%s (deleted)", REX_TYPENAME);return 1;}static int LOnig_version (lua_State *L) {lua_pushstring (L, onig_version ());return 1;}static const luaL_Reg r_methods[] = {{ "exec", algm_exec },{ "tfind", algm_tfind }, /* old name: match */{ "find", algm_find },{ "match", algm_match },{ "__gc", LOnig_gc },{ "__tostring", LOnig_tostring },{ NULL, NULL }};static const luaL_Reg r_functions[] = {{ "match", algf_match },{ "find", algf_find },{ "gmatch", algf_gmatch },{ "gsub", algf_gsub },{ "split", algf_split },{ "new", algf_new },{ "flags", LOnig_get_flags },{ "version", LOnig_version },{ "setdefaultsyntax", LOnig_setdefaultsyntax },{ NULL, NULL }};/* Open the library */REX_API int REX_OPENLIB (lua_State *L) {if (ONIGURUMA_VERSION_MAJOR > atoi (onig_version ())) {return luaL_error (L, "%s requires at least version %d of Oniguruma library",REX_LIBNAME, (int)ONIGURUMA_VERSION_MAJOR);}onig_init();onig_set_default_syntax(ONIG_SYNTAX_RUBY);alg_register(L, r_methods, r_functions, "Oniguruma");return 1;}
/* lonig_f.c - Lua binding of Oniguruma library *//* See Copyright Notice in the file LICENSE */#include <oniguruma.h>#include <lua.h>#include <lauxlib.h>#include "../common.h"static flag_pair onig_flags[] = {#ifdef ONIG_INFINITE_DISTANCE{ "ONIG_INFINITE_DISTANCE", ONIG_INFINITE_DISTANCE },#endif#ifdef ONIG_NREGION{ "ONIG_NREGION", ONIG_NREGION },#endif#ifdef ONIG_MAX_BACKREF_NUM{ "ONIG_MAX_BACKREF_NUM", ONIG_MAX_BACKREF_NUM },#endif#ifdef ONIG_MAX_REPEAT_NUM{ "ONIG_MAX_REPEAT_NUM", ONIG_MAX_REPEAT_NUM },#endif#ifdef ONIG_MAX_MULTI_BYTE_RANGES_NUM{ "ONIG_MAX_MULTI_BYTE_RANGES_NUM", ONIG_MAX_MULTI_BYTE_RANGES_NUM },#endif#ifdef ONIG_MAX_ERROR_MESSAGE_LEN{ "ONIG_MAX_ERROR_MESSAGE_LEN", ONIG_MAX_ERROR_MESSAGE_LEN },#endif#ifdef ONIG_OPTION_DEFAULT{ "ONIG_OPTION_DEFAULT", ONIG_OPTION_DEFAULT },{ "DEFAULT", ONIG_OPTION_DEFAULT },#endif#ifdef ONIG_OPTION_NONE{ "ONIG_OPTION_NONE", ONIG_OPTION_NONE },{ "NONE", ONIG_OPTION_NONE },#endif#ifdef ONIG_OPTION_IGNORECASE{ "ONIG_OPTION_IGNORECASE", ONIG_OPTION_IGNORECASE },{ "IGNORECASE", ONIG_OPTION_IGNORECASE },#endif#ifdef ONIG_OPTION_EXTEND{ "ONIG_OPTION_EXTEND", ONIG_OPTION_EXTEND },{ "EXTEND", ONIG_OPTION_EXTEND },#endif#ifdef ONIG_OPTION_MULTILINE{ "ONIG_OPTION_MULTILINE", ONIG_OPTION_MULTILINE },{ "MULTILINE", ONIG_OPTION_MULTILINE },#endif#ifdef ONIG_OPTION_SINGLELINE{ "ONIG_OPTION_SINGLELINE", ONIG_OPTION_SINGLELINE },{ "SINGLELINE", ONIG_OPTION_SINGLELINE },#endif#ifdef ONIG_OPTION_FIND_LONGEST{ "ONIG_OPTION_FIND_LONGEST", ONIG_OPTION_FIND_LONGEST },{ "FIND_LONGEST", ONIG_OPTION_FIND_LONGEST },#endif#ifdef ONIG_OPTION_FIND_NOT_EMPTY{ "ONIG_OPTION_FIND_NOT_EMPTY", ONIG_OPTION_FIND_NOT_EMPTY },{ "FIND_NOT_EMPTY", ONIG_OPTION_FIND_NOT_EMPTY },#endif#ifdef ONIG_OPTION_NEGATE_SINGLELINE{ "ONIG_OPTION_NEGATE_SINGLELINE", ONIG_OPTION_NEGATE_SINGLELINE },{ "NEGATE_SINGLELINE", ONIG_OPTION_NEGATE_SINGLELINE },#endif#ifdef ONIG_OPTION_DONT_CAPTURE_GROUP{ "ONIG_OPTION_DONT_CAPTURE_GROUP", ONIG_OPTION_DONT_CAPTURE_GROUP },{ "DONT_CAPTURE_GROUP", ONIG_OPTION_DONT_CAPTURE_GROUP },#endif#ifdef ONIG_OPTION_CAPTURE_GROUP{ "ONIG_OPTION_CAPTURE_GROUP", ONIG_OPTION_CAPTURE_GROUP },{ "CAPTURE_GROUP", ONIG_OPTION_CAPTURE_GROUP },#endif#ifdef ONIG_OPTION_NOTBOL{ "ONIG_OPTION_NOTBOL", ONIG_OPTION_NOTBOL },{ "NOTBOL", ONIG_OPTION_NOTBOL },#endif#ifdef ONIG_OPTION_NOTEOL{ "ONIG_OPTION_NOTEOL", ONIG_OPTION_NOTEOL },{ "NOTEOL", ONIG_OPTION_NOTEOL },#endif#ifdef ONIG_OPTION_POSIX_REGION{ "ONIG_OPTION_POSIX_REGION", ONIG_OPTION_POSIX_REGION },{ "POSIX_REGION", ONIG_OPTION_POSIX_REGION },#endif#ifdef ONIG_OPTION_MAXBIT{ "ONIG_OPTION_MAXBIT", ONIG_OPTION_MAXBIT },{ "MAXBIT", ONIG_OPTION_MAXBIT },#endif#ifdef ONIG_SYN_OP_VARIABLE_META_CHARACTERS{ "ONIG_SYN_OP_VARIABLE_META_CHARACTERS", ONIG_SYN_OP_VARIABLE_META_CHARACTERS },#endif#ifdef ONIG_SYN_OP_DOT_ANYCHAR{ "ONIG_SYN_OP_DOT_ANYCHAR", ONIG_SYN_OP_DOT_ANYCHAR },#endif#ifdef ONIG_SYN_OP_ASTERISK_ZERO_INF{ "ONIG_SYN_OP_ASTERISK_ZERO_INF", ONIG_SYN_OP_ASTERISK_ZERO_INF },#endif#ifdef ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF{ "ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF", ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF },#endif#ifdef ONIG_SYN_OP_PLUS_ONE_INF{ "ONIG_SYN_OP_PLUS_ONE_INF", ONIG_SYN_OP_PLUS_ONE_INF },#endif#ifdef ONIG_SYN_OP_ESC_PLUS_ONE_INF{ "ONIG_SYN_OP_ESC_PLUS_ONE_INF", ONIG_SYN_OP_ESC_PLUS_ONE_INF },#endif#ifdef ONIG_SYN_OP_QMARK_ZERO_ONE{ "ONIG_SYN_OP_QMARK_ZERO_ONE", ONIG_SYN_OP_QMARK_ZERO_ONE },#endif#ifdef ONIG_SYN_OP_ESC_QMARK_ZERO_ONE{ "ONIG_SYN_OP_ESC_QMARK_ZERO_ONE", ONIG_SYN_OP_ESC_QMARK_ZERO_ONE },#endif#ifdef ONIG_SYN_OP_BRACE_INTERVAL{ "ONIG_SYN_OP_BRACE_INTERVAL", ONIG_SYN_OP_BRACE_INTERVAL },#endif#ifdef ONIG_SYN_OP_ESC_BRACE_INTERVAL{ "ONIG_SYN_OP_ESC_BRACE_INTERVAL", ONIG_SYN_OP_ESC_BRACE_INTERVAL },#endif#ifdef ONIG_SYN_OP_VBAR_ALT{ "ONIG_SYN_OP_VBAR_ALT", ONIG_SYN_OP_VBAR_ALT },#endif#ifdef ONIG_SYN_OP_ESC_VBAR_ALT{ "ONIG_SYN_OP_ESC_VBAR_ALT", ONIG_SYN_OP_ESC_VBAR_ALT },#endif#ifdef ONIG_SYN_OP_LPAREN_SUBEXP{ "ONIG_SYN_OP_LPAREN_SUBEXP", ONIG_SYN_OP_LPAREN_SUBEXP },#endif#ifdef ONIG_SYN_OP_ESC_LPAREN_SUBEXP{ "ONIG_SYN_OP_ESC_LPAREN_SUBEXP", ONIG_SYN_OP_ESC_LPAREN_SUBEXP },#endif#ifdef ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR{ "ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR", ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR },#endif#ifdef ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR{ "ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR", ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR },#endif#ifdef ONIG_SYN_OP_DECIMAL_BACKREF{ "ONIG_SYN_OP_DECIMAL_BACKREF", ONIG_SYN_OP_DECIMAL_BACKREF },#endif#ifdef ONIG_SYN_OP_BRACKET_CC{ "ONIG_SYN_OP_BRACKET_CC", ONIG_SYN_OP_BRACKET_CC },#endif#ifdef ONIG_SYN_OP_ESC_W_WORD{ "ONIG_SYN_OP_ESC_W_WORD", ONIG_SYN_OP_ESC_W_WORD },#endif#ifdef ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END{ "ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END", ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END },#endif#ifdef ONIG_SYN_OP_ESC_B_WORD_BOUND{ "ONIG_SYN_OP_ESC_B_WORD_BOUND", ONIG_SYN_OP_ESC_B_WORD_BOUND },#endif#ifdef ONIG_SYN_OP_ESC_S_WHITE_SPACE{ "ONIG_SYN_OP_ESC_S_WHITE_SPACE", ONIG_SYN_OP_ESC_S_WHITE_SPACE },#endif#ifdef ONIG_SYN_OP_ESC_D_DIGIT{ "ONIG_SYN_OP_ESC_D_DIGIT", ONIG_SYN_OP_ESC_D_DIGIT },#endif#ifdef ONIG_SYN_OP_LINE_ANCHOR{ "ONIG_SYN_OP_LINE_ANCHOR", ONIG_SYN_OP_LINE_ANCHOR },#endif#ifdef ONIG_SYN_OP_POSIX_BRACKET{ "ONIG_SYN_OP_POSIX_BRACKET", ONIG_SYN_OP_POSIX_BRACKET },#endif#ifdef ONIG_SYN_OP_QMARK_NON_GREEDY{ "ONIG_SYN_OP_QMARK_NON_GREEDY", ONIG_SYN_OP_QMARK_NON_GREEDY },#endif#ifdef ONIG_SYN_OP_ESC_CONTROL_CHARS{ "ONIG_SYN_OP_ESC_CONTROL_CHARS", ONIG_SYN_OP_ESC_CONTROL_CHARS },#endif#ifdef ONIG_SYN_OP_ESC_C_CONTROL{ "ONIG_SYN_OP_ESC_C_CONTROL", ONIG_SYN_OP_ESC_C_CONTROL },#endif#ifdef ONIG_SYN_OP_ESC_OCTAL3{ "ONIG_SYN_OP_ESC_OCTAL3", ONIG_SYN_OP_ESC_OCTAL3 },#endif#ifdef ONIG_SYN_OP_ESC_X_HEX2{ "ONIG_SYN_OP_ESC_X_HEX2", ONIG_SYN_OP_ESC_X_HEX2 },#endif#ifdef ONIG_SYN_OP_ESC_X_BRACE_HEX8{ "ONIG_SYN_OP_ESC_X_BRACE_HEX8", ONIG_SYN_OP_ESC_X_BRACE_HEX8 },#endif#ifdef ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE{ "ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE", ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE },#endif#ifdef ONIG_SYN_OP2_QMARK_GROUP_EFFECT{ "ONIG_SYN_OP2_QMARK_GROUP_EFFECT", ONIG_SYN_OP2_QMARK_GROUP_EFFECT },#endif#ifdef ONIG_SYN_OP2_OPTION_PERL{ "ONIG_SYN_OP2_OPTION_PERL", ONIG_SYN_OP2_OPTION_PERL },#endif#ifdef ONIG_SYN_OP2_OPTION_RUBY{ "ONIG_SYN_OP2_OPTION_RUBY", ONIG_SYN_OP2_OPTION_RUBY },#endif#ifdef ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT{ "ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT", ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT },#endif#ifdef ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL{ "ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL", ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL },#endif#ifdef ONIG_SYN_OP2_CCLASS_SET_OP{ "ONIG_SYN_OP2_CCLASS_SET_OP", ONIG_SYN_OP2_CCLASS_SET_OP },#endif#ifdef ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP{ "ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP", ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP },#endif#ifdef ONIG_SYN_OP2_ESC_K_NAMED_BACKREF{ "ONIG_SYN_OP2_ESC_K_NAMED_BACKREF", ONIG_SYN_OP2_ESC_K_NAMED_BACKREF },#endif#ifdef ONIG_SYN_OP2_ESC_G_SUBEXP_CALL{ "ONIG_SYN_OP2_ESC_G_SUBEXP_CALL", ONIG_SYN_OP2_ESC_G_SUBEXP_CALL },#endif#ifdef ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY{ "ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY", ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY },#endif#ifdef ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL{ "ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL", ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL },#endif#ifdef ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META{ "ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META", ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META },#endif#ifdef ONIG_SYN_OP2_ESC_V_VTAB{ "ONIG_SYN_OP2_ESC_V_VTAB", ONIG_SYN_OP2_ESC_V_VTAB },#endif#ifdef ONIG_SYN_OP2_ESC_U_HEX4{ "ONIG_SYN_OP2_ESC_U_HEX4", ONIG_SYN_OP2_ESC_U_HEX4 },#endif#ifdef ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR{ "ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR", ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR },#endif#ifdef ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY{ "ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY", ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY },#endif#ifdef ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT{ "ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT", ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT },#endif#ifdef ONIG_SYN_OP2_ESC_H_XDIGIT{ "ONIG_SYN_OP2_ESC_H_XDIGIT", ONIG_SYN_OP2_ESC_H_XDIGIT },#endif#ifdef ONIG_SYN_OP2_INEFFECTIVE_ESCAPE{ "ONIG_SYN_OP2_INEFFECTIVE_ESCAPE", ONIG_SYN_OP2_INEFFECTIVE_ESCAPE },#endif#ifdef ONIG_SYN_CONTEXT_INDEP_ANCHORS{ "ONIG_SYN_CONTEXT_INDEP_ANCHORS", ONIG_SYN_CONTEXT_INDEP_ANCHORS },#endif#ifdef ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS{ "ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS", ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS },#endif#ifdef ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS{ "ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS", ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS },#endif#ifdef ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP{ "ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP", ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP },#endif#ifdef ONIG_SYN_ALLOW_INVALID_INTERVAL{ "ONIG_SYN_ALLOW_INVALID_INTERVAL", ONIG_SYN_ALLOW_INVALID_INTERVAL },#endif#ifdef ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV{ "ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV", ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV },#endif#ifdef ONIG_SYN_STRICT_CHECK_BACKREF{ "ONIG_SYN_STRICT_CHECK_BACKREF", ONIG_SYN_STRICT_CHECK_BACKREF },#endif#ifdef ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND{ "ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND", ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND },#endif#ifdef ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP{ "ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP", ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP },#endif#ifdef ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME{ "ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME", ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME },#endif#ifdef ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY{ "ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY", ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY },#endif#ifdef ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC{ "ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC", ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC },#endif#ifdef ONIG_SYN_BACKSLASH_ESCAPE_IN_CC{ "ONIG_SYN_BACKSLASH_ESCAPE_IN_CC", ONIG_SYN_BACKSLASH_ESCAPE_IN_CC },#endif#ifdef ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC{ "ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC", ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC },#endif#ifdef ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC{ "ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC", ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC },#endif#ifdef ONIG_SYN_WARN_CC_OP_NOT_ESCAPED{ "ONIG_SYN_WARN_CC_OP_NOT_ESCAPED", ONIG_SYN_WARN_CC_OP_NOT_ESCAPED },#endif#ifdef ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT{ "ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT", ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT },#endif#ifdef ONIG_META_CHAR_ESCAPE{ "ONIG_META_CHAR_ESCAPE", ONIG_META_CHAR_ESCAPE },#endif#ifdef ONIG_META_CHAR_ANYCHAR{ "ONIG_META_CHAR_ANYCHAR", ONIG_META_CHAR_ANYCHAR },#endif#ifdef ONIG_META_CHAR_ANYTIME{ "ONIG_META_CHAR_ANYTIME", ONIG_META_CHAR_ANYTIME },#endif#ifdef ONIG_META_CHAR_ZERO_OR_ONE_TIME{ "ONIG_META_CHAR_ZERO_OR_ONE_TIME", ONIG_META_CHAR_ZERO_OR_ONE_TIME },#endif#ifdef ONIG_META_CHAR_ONE_OR_MORE_TIME{ "ONIG_META_CHAR_ONE_OR_MORE_TIME", ONIG_META_CHAR_ONE_OR_MORE_TIME },#endif#ifdef ONIG_META_CHAR_ANYCHAR_ANYTIME{ "ONIG_META_CHAR_ANYCHAR_ANYTIME", ONIG_META_CHAR_ANYCHAR_ANYTIME },#endif#ifdef ONIG_INEFFECTIVE_META_CHAR{ "ONIG_INEFFECTIVE_META_CHAR", ONIG_INEFFECTIVE_META_CHAR },#endif#ifdef ONIG_NORMAL{ "ONIG_NORMAL", ONIG_NORMAL },#endif#ifdef ONIG_MISMATCH{ "ONIG_MISMATCH", ONIG_MISMATCH },#endif#ifdef ONIG_NO_SUPPORT_CONFIG{ "ONIG_NO_SUPPORT_CONFIG", ONIG_NO_SUPPORT_CONFIG },#endif#ifdef ONIG_MAX_CAPTURE_HISTORY_GROUP{ "ONIG_MAX_CAPTURE_HISTORY_GROUP", ONIG_MAX_CAPTURE_HISTORY_GROUP },#endif#ifdef ONIG_TRAVERSE_CALLBACK_AT_FIRST{ "ONIG_TRAVERSE_CALLBACK_AT_FIRST", ONIG_TRAVERSE_CALLBACK_AT_FIRST },#endif#ifdef ONIG_TRAVERSE_CALLBACK_AT_LAST{ "ONIG_TRAVERSE_CALLBACK_AT_LAST", ONIG_TRAVERSE_CALLBACK_AT_LAST },#endif#ifdef ONIG_TRAVERSE_CALLBACK_AT_BOTH{ "ONIG_TRAVERSE_CALLBACK_AT_BOTH", ONIG_TRAVERSE_CALLBACK_AT_BOTH },#endif#ifdef ONIG_REGION_NOTPOS{ "ONIG_REGION_NOTPOS", ONIG_REGION_NOTPOS },#endif#ifdef ONIG_CHAR_TABLE_SIZE{ "ONIG_CHAR_TABLE_SIZE", ONIG_CHAR_TABLE_SIZE },#endif#ifdef ONIG_STATE_NORMAL{ "ONIG_STATE_NORMAL", ONIG_STATE_NORMAL },#endif#ifdef ONIG_STATE_SEARCHING{ "ONIG_STATE_SEARCHING", ONIG_STATE_SEARCHING },#endif#ifdef ONIG_STATE_COMPILING{ "ONIG_STATE_COMPILING", ONIG_STATE_COMPILING },#endif#ifdef ONIG_STATE_MODIFY{ "ONIG_STATE_MODIFY", ONIG_STATE_MODIFY },#endif{ NULL, 0 }};static flag_pair onig_error_flags[] = {#ifdef ONIGERR_MEMORY{ "ONIGERR_MEMORY", ONIGERR_MEMORY },#endif#ifdef ONIGERR_TYPE_BUG{ "ONIGERR_TYPE_BUG", ONIGERR_TYPE_BUG },#endif#ifdef ONIGERR_PARSER_BUG{ "ONIGERR_PARSER_BUG", ONIGERR_PARSER_BUG },#endif#ifdef ONIGERR_STACK_BUG{ "ONIGERR_STACK_BUG", ONIGERR_STACK_BUG },#endif#ifdef ONIGERR_UNDEFINED_BYTECODE{ "ONIGERR_UNDEFINED_BYTECODE", ONIGERR_UNDEFINED_BYTECODE },#endif#ifdef ONIGERR_UNEXPECTED_BYTECODE{ "ONIGERR_UNEXPECTED_BYTECODE", ONIGERR_UNEXPECTED_BYTECODE },#endif#ifdef ONIGERR_MATCH_STACK_LIMIT_OVER{ "ONIGERR_MATCH_STACK_LIMIT_OVER", ONIGERR_MATCH_STACK_LIMIT_OVER },#endif#ifdef ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED{ "ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED", ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED },#endif#ifdef ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR{ "ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR", ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR },#endif#ifdef ONIGERR_INVALID_ARGUMENT{ "ONIGERR_INVALID_ARGUMENT", ONIGERR_INVALID_ARGUMENT },#endif#ifdef ONIGERR_END_PATTERN_AT_LEFT_BRACE{ "ONIGERR_END_PATTERN_AT_LEFT_BRACE", ONIGERR_END_PATTERN_AT_LEFT_BRACE },#endif#ifdef ONIGERR_END_PATTERN_AT_LEFT_BRACKET{ "ONIGERR_END_PATTERN_AT_LEFT_BRACKET", ONIGERR_END_PATTERN_AT_LEFT_BRACKET },#endif#ifdef ONIGERR_EMPTY_CHAR_CLASS{ "ONIGERR_EMPTY_CHAR_CLASS", ONIGERR_EMPTY_CHAR_CLASS },#endif#ifdef ONIGERR_PREMATURE_END_OF_CHAR_CLASS{ "ONIGERR_PREMATURE_END_OF_CHAR_CLASS", ONIGERR_PREMATURE_END_OF_CHAR_CLASS },#endif#ifdef ONIGERR_END_PATTERN_AT_ESCAPE{ "ONIGERR_END_PATTERN_AT_ESCAPE", ONIGERR_END_PATTERN_AT_ESCAPE },#endif#ifdef ONIGERR_END_PATTERN_AT_META{ "ONIGERR_END_PATTERN_AT_META", ONIGERR_END_PATTERN_AT_META },#endif#ifdef ONIGERR_END_PATTERN_AT_CONTROL{ "ONIGERR_END_PATTERN_AT_CONTROL", ONIGERR_END_PATTERN_AT_CONTROL },#endif#ifdef ONIGERR_META_CODE_SYNTAX{ "ONIGERR_META_CODE_SYNTAX", ONIGERR_META_CODE_SYNTAX },#endif#ifdef ONIGERR_CONTROL_CODE_SYNTAX{ "ONIGERR_CONTROL_CODE_SYNTAX", ONIGERR_CONTROL_CODE_SYNTAX },#endif#ifdef ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE{ "ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE", ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE },#endif#ifdef ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE{ "ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE", ONIGERR_CHAR_CLASS_VALUE_AT_START_OF_RANGE },#endif#ifdef ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS{ "ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS", ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS },#endif#ifdef ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED{ "ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED", ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED },#endif#ifdef ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID{ "ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID", ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID },#endif#ifdef ONIGERR_NESTED_REPEAT_OPERATOR{ "ONIGERR_NESTED_REPEAT_OPERATOR", ONIGERR_NESTED_REPEAT_OPERATOR },#endif#ifdef ONIGERR_UNMATCHED_CLOSE_PARENTHESIS{ "ONIGERR_UNMATCHED_CLOSE_PARENTHESIS", ONIGERR_UNMATCHED_CLOSE_PARENTHESIS },#endif#ifdef ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS{ "ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS", ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS },#endif#ifdef ONIGERR_END_PATTERN_IN_GROUP{ "ONIGERR_END_PATTERN_IN_GROUP", ONIGERR_END_PATTERN_IN_GROUP },#endif#ifdef ONIGERR_UNDEFINED_GROUP_OPTION{ "ONIGERR_UNDEFINED_GROUP_OPTION", ONIGERR_UNDEFINED_GROUP_OPTION },#endif#ifdef ONIGERR_INVALID_POSIX_BRACKET_TYPE{ "ONIGERR_INVALID_POSIX_BRACKET_TYPE", ONIGERR_INVALID_POSIX_BRACKET_TYPE },#endif#ifdef ONIGERR_INVALID_LOOK_BEHIND_PATTERN{ "ONIGERR_INVALID_LOOK_BEHIND_PATTERN", ONIGERR_INVALID_LOOK_BEHIND_PATTERN },#endif#ifdef ONIGERR_INVALID_REPEAT_RANGE_PATTERN{ "ONIGERR_INVALID_REPEAT_RANGE_PATTERN", ONIGERR_INVALID_REPEAT_RANGE_PATTERN },#endif#ifdef ONIGERR_TOO_BIG_NUMBER{ "ONIGERR_TOO_BIG_NUMBER", ONIGERR_TOO_BIG_NUMBER },#endif#ifdef ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE{ "ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE", ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE },#endif#ifdef ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE{ "ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE", ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE },#endif#ifdef ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS{ "ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS", ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS },#endif#ifdef ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE{ "ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE", ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE },#endif#ifdef ONIGERR_TOO_MANY_MULTI_BYTE_RANGES{ "ONIGERR_TOO_MANY_MULTI_BYTE_RANGES", ONIGERR_TOO_MANY_MULTI_BYTE_RANGES },#endif#ifdef ONIGERR_TOO_SHORT_MULTI_BYTE_STRING{ "ONIGERR_TOO_SHORT_MULTI_BYTE_STRING", ONIGERR_TOO_SHORT_MULTI_BYTE_STRING },#endif#ifdef ONIGERR_TOO_BIG_BACKREF_NUMBER{ "ONIGERR_TOO_BIG_BACKREF_NUMBER", ONIGERR_TOO_BIG_BACKREF_NUMBER },#endif#ifdef ONIGERR_INVALID_BACKREF{ "ONIGERR_INVALID_BACKREF", ONIGERR_INVALID_BACKREF },#endif#ifdef ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED{ "ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED", ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED },#endif#ifdef ONIGERR_TOO_LONG_WIDE_CHAR_VALUE{ "ONIGERR_TOO_LONG_WIDE_CHAR_VALUE", ONIGERR_TOO_LONG_WIDE_CHAR_VALUE },#endif#ifdef ONIGERR_EMPTY_GROUP_NAME{ "ONIGERR_EMPTY_GROUP_NAME", ONIGERR_EMPTY_GROUP_NAME },#endif#ifdef ONIGERR_INVALID_GROUP_NAME{ "ONIGERR_INVALID_GROUP_NAME", ONIGERR_INVALID_GROUP_NAME },#endif#ifdef ONIGERR_INVALID_CHAR_IN_GROUP_NAME{ "ONIGERR_INVALID_CHAR_IN_GROUP_NAME", ONIGERR_INVALID_CHAR_IN_GROUP_NAME },#endif#ifdef ONIGERR_UNDEFINED_NAME_REFERENCE{ "ONIGERR_UNDEFINED_NAME_REFERENCE", ONIGERR_UNDEFINED_NAME_REFERENCE },#endif#ifdef ONIGERR_UNDEFINED_GROUP_REFERENCE{ "ONIGERR_UNDEFINED_GROUP_REFERENCE", ONIGERR_UNDEFINED_GROUP_REFERENCE },#endif#ifdef ONIGERR_MULTIPLEX_DEFINED_NAME{ "ONIGERR_MULTIPLEX_DEFINED_NAME", ONIGERR_MULTIPLEX_DEFINED_NAME },#endif#ifdef ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL{ "ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL", ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL },#endif#ifdef ONIGERR_NEVER_ENDING_RECURSION{ "ONIGERR_NEVER_ENDING_RECURSION", ONIGERR_NEVER_ENDING_RECURSION },#endif#ifdef ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY{ "ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY", ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY },#endif#ifdef ONIGERR_INVALID_CHAR_PROPERTY_NAME{ "ONIGERR_INVALID_CHAR_PROPERTY_NAME", ONIGERR_INVALID_CHAR_PROPERTY_NAME },#endif#ifdef ONIGERR_INVALID_CODE_POINT_VALUE{ "ONIGERR_INVALID_CODE_POINT_VALUE", ONIGERR_INVALID_CODE_POINT_VALUE },#endif#ifdef ONIGERR_INVALID_WIDE_CHAR_VALUE{ "ONIGERR_INVALID_WIDE_CHAR_VALUE", ONIGERR_INVALID_WIDE_CHAR_VALUE },#endif#ifdef ONIGERR_TOO_BIG_WIDE_CHAR_VALUE{ "ONIGERR_TOO_BIG_WIDE_CHAR_VALUE", ONIGERR_TOO_BIG_WIDE_CHAR_VALUE },#endif#ifdef ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION{ "ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION", ONIGERR_NOT_SUPPORTED_ENCODING_COMBINATION },#endif#ifdef ONIGERR_INVALID_COMBINATION_OF_OPTIONS{ "ONIGERR_INVALID_COMBINATION_OF_OPTIONS", ONIGERR_INVALID_COMBINATION_OF_OPTIONS },#endif#ifdef ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT{ "ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT", ONIGERR_OVER_THREAD_PASS_LIMIT_COUNT },#endif{ NULL, 0 }};int LOnig_get_flags (lua_State *L) {const flag_pair* fps[] = { onig_flags, onig_error_flags, NULL };return get_flags (L, fps);}
# makefile for rex_pcre libraryinclude ../defaults.mak# === USER SETTINGS ===# ===========================================================================# These are default values.INC =LIB = -lpcre# If the default settings don't work for your system,# try to uncomment and edit the settings below.#INC =#LIB = -lpcre# Target nameREGNAME = pcre# ===========================================================================# === END OF USER SETTINGS ===OBJ = lpcre.o lpcre_f.o ../common.oinclude ../common.mak# static PCRE regexp library bindingar_pcre: $(TRG_AR)# dynamic PCRE regexp library bindingso_pcre: $(TRG_SO)# Dependencieslpcre.o: lpcre.c ../common.h ../algo.hlpcre_f.o: lpcre_f.c ../common.h../common.o: ../common.c ../common.h# (End of Makefile)
/* lpcre.c - Lua binding of PCRE library *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <string.h>#include <locale.h>#include <ctype.h>#include <pcre.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"extern int Lpcre_get_flags (lua_State *L);extern int Lpcre_config (lua_State *L);extern flag_pair pcre_error_flags[];/* These 2 settings may be redefined from the command-line or the makefile.* They should be kept in sync between themselves and with the target name.*/#ifndef REX_LIBNAME# define REX_LIBNAME "rex_pcre"#endif#ifndef REX_OPENLIB# define REX_OPENLIB luaopen_rex_pcre#endif#define REX_TYPENAME REX_LIBNAME"_regex"#define ALG_CFLAGS_DFLT 0#define ALG_EFLAGS_DFLT 0static int getcflags (lua_State *L, int pos);#define ALG_GETCFLAGS(L,pos) getcflags(L, pos)static void checkarg_compile (lua_State *L, int pos, TArgComp *argC);#define ALG_GETCARGS(a,b,c) checkarg_compile(a,b,c)#define ALG_NOMATCH(res) ((res) == PCRE_ERROR_NOMATCH)#define ALG_ISMATCH(res) ((res) >= 0)#define ALG_SUBBEG(ud,n) ud->match[n+n]#define ALG_SUBEND(ud,n) ud->match[n+n+1]#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n))#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0)#define ALG_NSUB(ud) ((int)ud->ncapt)#define ALG_PUSHSUB(L,ud,text,n) \lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n))#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \(ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0))#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1)#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n))#define ALG_PUSHOFFSETS(L,ud,offs,n) \(ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n))#define ALG_BASE(st) 0#define ALG_PULL#define ALG_USERETRYtypedef struct {pcre * pr;pcre_extra * extra;int * match;int ncapt;const unsigned char * tables;int freed;} TPcre;#define TUserdata TPcre#if PCRE_MAJOR >= 4static void do_named_subpatterns (lua_State *L, TPcre *ud, const char *text);# define DO_NAMED_SUBPATTERNS do_named_subpatterns#endif#include "../algo.h"/* Locations of the 2 permanent tables in the function environment */#define INDEX_CHARTABLES_META 1 /* chartables type's metatable */#define INDEX_CHARTABLES_LINK 2 /* link chartables to compiled regex */const char chartables_typename[] = "chartables";/* Functions*******************************************************************************/static void push_chartables_meta (lua_State *L) {lua_pushinteger (L, INDEX_CHARTABLES_META);lua_rawget (L, ALG_ENVIRONINDEX);}static int getcflags (lua_State *L, int pos) {switch (lua_type (L, pos)) {case LUA_TNONE:case LUA_TNIL:return ALG_CFLAGS_DFLT;case LUA_TNUMBER:return lua_tointeger (L, pos);case LUA_TSTRING: {const char *s = lua_tostring (L, pos);int res = 0, ch;while ((ch = *s++) != '\0') {if (ch == 'i') res |= PCRE_CASELESS;else if (ch == 'm') res |= PCRE_MULTILINE;else if (ch == 's') res |= PCRE_DOTALL;else if (ch == 'x') res |= PCRE_EXTENDED;else if (ch == 'U') res |= PCRE_UNGREEDY;else if (ch == 'X') res |= PCRE_EXTRA;}return res;}default:return luaL_typerror (L, pos, "number or string");}}static int generate_error (lua_State *L, const TPcre *ud, int errcode) {const char *key = get_flag_key (pcre_error_flags, errcode);(void) ud;if (key)return luaL_error (L, "error PCRE_%s", key);elsereturn luaL_error (L, "PCRE error code %d", errcode);}#if PCRE_MAJOR >= 6/* method r:dfa_exec (s, [st], [ef], [ovecsize], [wscount]) */static void checkarg_dfa_exec (lua_State *L, TArgExec *argE, TPcre **ud) {*ud = check_ud (L);argE->text = luaL_checklstring (L, 2, &argE->textlen);argE->startoffset = get_startoffset (L, 3, argE->textlen);argE->eflags = luaL_optint (L, 4, ALG_EFLAGS_DFLT);argE->ovecsize = luaL_optint (L, 5, 100);argE->wscount = luaL_optint (L, 6, 50);}#endifstatic int Lpcre_maketables (lua_State *L) {*(const void**)lua_newuserdata (L, sizeof(void*)) = pcre_maketables();push_chartables_meta (L);lua_setmetatable (L, -2);return 1;}static void **check_chartables (lua_State *L, int pos) {void **q;/* Compare the metatable against the C function environment. */if (lua_getmetatable(L, pos)) {push_chartables_meta (L);if (lua_rawequal(L, -1, -2) &&(q = (void **)lua_touserdata(L, pos)) != NULL) {lua_pop(L, 2);return q;}}luaL_argerror(L, pos, lua_pushfstring (L, "not a %s", chartables_typename));return NULL;}static int chartables_gc (lua_State *L) {void **ud = check_chartables (L, 1);if (*ud) {pcre_free (*ud);*ud = NULL;}return 0;}static void checkarg_compile (lua_State *L, int pos, TArgComp *argC) {argC->locale = NULL;argC->tables = NULL;if (!lua_isnoneornil (L, pos)) {if (lua_isstring (L, pos))argC->locale = lua_tostring (L, pos);else {argC->tablespos = pos;argC->tables = *check_chartables (L, pos);}}}static int compile_regex (lua_State *L, const TArgComp *argC, TPcre **pud) {const char *error;int erroffset;TPcre *ud;const unsigned char *tables = NULL;ud = (TPcre*)lua_newuserdata (L, sizeof (TPcre));memset (ud, 0, sizeof (TPcre)); /* initialize all members to 0 */lua_pushvalue (L, ALG_ENVIRONINDEX);lua_setmetatable (L, -2);if (argC->locale) {char old_locale[256];strcpy (old_locale, setlocale (LC_CTYPE, NULL)); /* store the locale */if (NULL == setlocale (LC_CTYPE, argC->locale)) /* set new locale */return luaL_error (L, "cannot set locale");ud->tables = tables = pcre_maketables (); /* make tables with new locale */setlocale (LC_CTYPE, old_locale); /* restore the old locale */}else if (argC->tables) {tables = argC->tables;lua_pushinteger (L, INDEX_CHARTABLES_LINK);lua_rawget (L, ALG_ENVIRONINDEX);lua_pushvalue (L, -2);lua_pushvalue (L, argC->tablespos);lua_rawset (L, -3);lua_pop (L, 1);}ud->pr = pcre_compile (argC->pattern, argC->cflags, &error, &erroffset, tables);if (!ud->pr)return luaL_error (L, "%s (pattern offset: %d)", error, erroffset + 1);ud->extra = pcre_study (ud->pr, 0, &error);if (error) return luaL_error (L, "%s", error);pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_CAPTURECOUNT, &ud->ncapt);/* need (2 ints per capture, plus one for substring match) * 3/2 */ud->match = (int *) Lmalloc (L, (ALG_NSUB(ud) + 1) * 3 * sizeof (int));if (pud) *pud = ud;return 1;}#if PCRE_MAJOR >= 4/* the target table must be on lua stack top */static void do_named_subpatterns (lua_State *L, TPcre *ud, const char *text) {int i, namecount, name_entry_size;unsigned char *name_table, *tabptr;/* do named subpatterns - NJG */pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_NAMECOUNT, &namecount);if (namecount <= 0)return;pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_NAMETABLE, &name_table);pcre_fullinfo (ud->pr, ud->extra, PCRE_INFO_NAMEENTRYSIZE, &name_entry_size);tabptr = name_table;for (i = 0; i < namecount; i++) {int n = (tabptr[0] << 8) | tabptr[1]; /* number of the capturing parenthesis */if (n > 0 && n <= ALG_NSUB(ud)) { /* check range */lua_pushstring (L, (char *)tabptr + 2); /* name of the capture, zero terminated */ALG_PUSHSUB_OR_FALSE (L, ud, text, n);lua_rawset (L, -3);}tabptr += name_entry_size;}}#endif /* #if PCRE_MAJOR >= 4 */#if PCRE_MAJOR >= 6static int Lpcre_dfa_exec (lua_State *L){TArgExec argE;TPcre *ud;int res;int *buf, *ovector, *wspace;checkarg_dfa_exec (L, &argE, &ud);buf = (int*) Lmalloc (L, (argE.ovecsize + argE.wscount) * sizeof(int));ovector = buf;wspace = buf + argE.ovecsize;res = pcre_dfa_exec (ud->pr, ud->extra, argE.text, (int)argE.textlen,argE.startoffset, argE.eflags, ovector, argE.ovecsize, wspace, argE.wscount);if (ALG_ISMATCH (res) || res == PCRE_ERROR_PARTIAL) {int i;int max = (res>0) ? res : (res==0) ? (int)argE.ovecsize/2 : 1;lua_pushinteger (L, ovector[0] + 1); /* 1-st return value */lua_newtable (L); /* 2-nd return value */for (i=0; i<max; i++) {lua_pushinteger (L, ovector[i+i+1]);lua_rawseti (L, -2, i+1);}lua_pushinteger (L, res); /* 3-rd return value */free (buf);return 3;}else {free (buf);if (ALG_NOMATCH (res))return lua_pushnil (L), 1;elsereturn generate_error (L, ud, res);}}#endif /* #if PCRE_MAJOR >= 6 */#ifdef ALG_USERETRYstatic int gmatch_exec (TUserdata *ud, TArgExec *argE, int retry) {int eflags = retry ? (argE->eflags|PCRE_NOTEMPTY|PCRE_ANCHORED) : argE->eflags;return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen,argE->startoffset, eflags, ud->match, (ALG_NSUB(ud) + 1) * 3);}#elsestatic int gmatch_exec (TUserdata *ud, TArgExec *argE) {return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen,argE->startoffset, argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3);}#endifstatic void gmatch_pushsubject (lua_State *L, TArgExec *argE) {lua_pushlstring (L, argE->text, argE->textlen);}static int findmatch_exec (TPcre *ud, TArgExec *argE) {return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen,argE->startoffset, argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3);}#ifdef ALG_USERETRYstatic int gsub_exec (TPcre *ud, TArgExec *argE, int st, int retry) {int eflags = retry ? (argE->eflags|PCRE_NOTEMPTY|PCRE_ANCHORED) : argE->eflags;return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen,st, eflags, ud->match, (ALG_NSUB(ud) + 1) * 3);}#elsestatic int gsub_exec (TPcre *ud, TArgExec *argE, int st) {return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen,st, argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3);}#endifstatic int split_exec (TPcre *ud, TArgExec *argE, int offset) {return pcre_exec (ud->pr, ud->extra, argE->text, argE->textlen, offset,argE->eflags, ud->match, (ALG_NSUB(ud) + 1) * 3);}static int Lpcre_gc (lua_State *L) {TPcre *ud = check_ud (L);if (ud->freed == 0) { /* precaution against "manual" __gc calling */ud->freed = 1;if (ud->pr) pcre_free (ud->pr);if (ud->extra) pcre_free (ud->extra);if (ud->tables) pcre_free ((void *)ud->tables);free (ud->match);}return 0;}static int Lpcre_tostring (lua_State *L) {TPcre *ud = check_ud (L);if (ud->freed == 0)lua_pushfstring (L, "%s (%p)", REX_TYPENAME, (void*)ud);elselua_pushfstring (L, "%s (deleted)", REX_TYPENAME);return 1;}static int chartables_tostring (lua_State *L) {void **ud = check_chartables (L, 1);lua_pushfstring (L, "%s (%p)", chartables_typename, ud);return 1;}static int Lpcre_version (lua_State *L) {lua_pushstring (L, pcre_version ());return 1;}static const luaL_Reg chartables_meta[] = {{ "__gc", chartables_gc },{ "__tostring", chartables_tostring },{ NULL, NULL }};static const luaL_Reg r_methods[] = {{ "exec", algm_exec },{ "tfind", algm_tfind }, /* old name: match */{ "find", algm_find },{ "match", algm_match },#if PCRE_MAJOR >= 6{ "dfa_exec", Lpcre_dfa_exec },#endif{ "__gc", Lpcre_gc },{ "__tostring", Lpcre_tostring },{ NULL, NULL }};static const luaL_Reg r_functions[] = {{ "match", algf_match },{ "find", algf_find },{ "gmatch", algf_gmatch },{ "gsub", algf_gsub },{ "split", algf_split },{ "new", algf_new },{ "flags", Lpcre_get_flags },{ "version", Lpcre_version },{ "maketables", Lpcre_maketables },#if PCRE_MAJOR >= 4{ "config", Lpcre_config },#endif{ NULL, NULL }};/* Open the library */REX_API int REX_OPENLIB (lua_State *L) {if (PCRE_MAJOR > atoi (pcre_version ())) {return luaL_error (L, "%s requires at least version %d of PCRE library",REX_LIBNAME, (int)PCRE_MAJOR);}alg_register(L, r_methods, r_functions, "PCRE");/* create a table and register it as a metatable for "chartables" userdata */lua_newtable (L);lua_pushliteral (L, "access denied");lua_setfield (L, -2, "__metatable");#if LUA_VERSION_NUM == 501luaL_register (L, NULL, chartables_meta);lua_rawseti (L, LUA_ENVIRONINDEX, INDEX_CHARTABLES_META);#elselua_pushvalue(L, -3);luaL_setfuncs (L, chartables_meta, 1);lua_rawseti (L, -3, INDEX_CHARTABLES_META);#endif/* create a table for connecting "chartables" userdata to "regex" userdata */lua_newtable (L);lua_pushliteral (L, "k"); /* weak keys */lua_setfield (L, -2, "__mode");lua_pushvalue (L, -1); /* setmetatable (tb, tb) */lua_setmetatable (L, -2);#if LUA_VERSION_NUM == 501lua_rawseti (L, LUA_ENVIRONINDEX, INDEX_CHARTABLES_LINK);#elselua_rawseti (L, -3, INDEX_CHARTABLES_LINK);#endifreturn 1;}
/* lpcre.c - PCRE regular expression library *//* See Copyright Notice in the file LICENSE */#include <pcre.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"#define VERSION_PCRE (PCRE_MAJOR*100 + PCRE_MINOR)static flag_pair pcre_flags[] = {{ "MAJOR", PCRE_MAJOR },{ "MINOR", PCRE_MINOR },/*---------------------------------------------------------------------------*/{ "CASELESS", PCRE_CASELESS },{ "MULTILINE", PCRE_MULTILINE },{ "DOTALL", PCRE_DOTALL },{ "EXTENDED", PCRE_EXTENDED },{ "ANCHORED", PCRE_ANCHORED },{ "DOLLAR_ENDONLY", PCRE_DOLLAR_ENDONLY },{ "EXTRA", PCRE_EXTRA },{ "NOTBOL", PCRE_NOTBOL },{ "NOTEOL", PCRE_NOTEOL },{ "UNGREEDY", PCRE_UNGREEDY },{ "NOTEMPTY", PCRE_NOTEMPTY },{ "UTF8", PCRE_UTF8 },#if VERSION_PCRE >= 400{ "NO_AUTO_CAPTURE", PCRE_NO_AUTO_CAPTURE },{ "NO_UTF8_CHECK", PCRE_NO_UTF8_CHECK },#endif#if VERSION_PCRE >= 500{ "AUTO_CALLOUT", PCRE_AUTO_CALLOUT },{ "PARTIAL", PCRE_PARTIAL },#endif#ifdef PCRE_PARTIAL_SOFT{ "PARTIAL_SOFT", PCRE_PARTIAL_SOFT },#endif#if VERSION_PCRE >= 600{ "DFA_SHORTEST", PCRE_DFA_SHORTEST },{ "DFA_RESTART", PCRE_DFA_RESTART },{ "FIRSTLINE", PCRE_FIRSTLINE },#endif#if VERSION_PCRE >= 607{ "DUPNAMES", PCRE_DUPNAMES },{ "NEWLINE_CR", PCRE_NEWLINE_CR },{ "NEWLINE_LF", PCRE_NEWLINE_LF },{ "NEWLINE_CRLF", PCRE_NEWLINE_CRLF },#endif#if VERSION_PCRE >= 700{ "NEWLINE_ANY", PCRE_NEWLINE_ANY },#endif#if VERSION_PCRE >= 701{ "NEWLINE_ANYCRLF", PCRE_NEWLINE_ANYCRLF },#endif#if VERSION_PCRE >= 704{ "BSR_ANYCRLF", PCRE_BSR_ANYCRLF },{ "BSR_UNICODE", PCRE_BSR_UNICODE },#endif#if VERSION_PCRE >= 707{ "JAVASCRIPT_COMPAT", PCRE_JAVASCRIPT_COMPAT },#endif#ifdef PCRE_NO_START_OPTIMIZE{ "NO_START_OPTIMIZE", PCRE_NO_START_OPTIMIZE },#endif#ifdef PCRE_NO_START_OPTIMISE{ "NO_START_OPTIMISE", PCRE_NO_START_OPTIMISE },#endif#ifdef PCRE_PARTIAL_HARD{ "PARTIAL_HARD", PCRE_PARTIAL_HARD },#endif#ifdef PCRE_NOTEMPTY_ATSTART{ "NOTEMPTY_ATSTART", PCRE_NOTEMPTY_ATSTART },#endif#ifdef PCRE_UCP{ "UCP", PCRE_UCP },#endif/*---------------------------------------------------------------------------*/{ "INFO_OPTIONS", PCRE_INFO_OPTIONS },{ "INFO_SIZE", PCRE_INFO_SIZE },{ "INFO_CAPTURECOUNT", PCRE_INFO_CAPTURECOUNT },{ "INFO_BACKREFMAX", PCRE_INFO_BACKREFMAX },#if VERSION_PCRE >= 400{ "INFO_FIRSTBYTE", PCRE_INFO_FIRSTBYTE },#endif{ "INFO_FIRSTCHAR", PCRE_INFO_FIRSTCHAR },{ "INFO_FIRSTTABLE", PCRE_INFO_FIRSTTABLE },{ "INFO_LASTLITERAL", PCRE_INFO_LASTLITERAL },#if VERSION_PCRE >= 400{ "INFO_NAMEENTRYSIZE", PCRE_INFO_NAMEENTRYSIZE },{ "INFO_NAMECOUNT", PCRE_INFO_NAMECOUNT },{ "INFO_NAMETABLE", PCRE_INFO_NAMETABLE },{ "INFO_STUDYSIZE", PCRE_INFO_STUDYSIZE },#endif#if VERSION_PCRE >= 500{ "INFO_DEFAULT_TABLES", PCRE_INFO_DEFAULT_TABLES },#endif#ifdef PCRE_INFO_OKPARTIAL{ "INFO_OKPARTIAL", PCRE_INFO_OKPARTIAL },#endif#ifdef PCRE_INFO_JCHANGED{ "INFO_JCHANGED", PCRE_INFO_JCHANGED },#endif#ifdef PCRE_INFO_HASCRORLF{ "INFO_HASCRORLF", PCRE_INFO_HASCRORLF },#endif#ifdef PCRE_INFO_MINLENGTH{ "INFO_MINLENGTH", PCRE_INFO_MINLENGTH },#endif#ifdef PCRE_INFO_JIT{ "INFO_JIT", PCRE_INFO_JIT },#endif#ifdef PCRE_INFO_JITSIZE{ "INFO_JITSIZE", PCRE_INFO_JITSIZE },#endif/*---------------------------------------------------------------------------*/#if VERSION_PCRE >= 400{ "EXTRA_STUDY_DATA", PCRE_EXTRA_STUDY_DATA },{ "EXTRA_MATCH_LIMIT", PCRE_EXTRA_MATCH_LIMIT },{ "EXTRA_CALLOUT_DATA", PCRE_EXTRA_CALLOUT_DATA },#endif#if VERSION_PCRE >= 500{ "EXTRA_TABLES", PCRE_EXTRA_TABLES },#endif#ifdef PCRE_EXTRA_MATCH_LIMIT_RECURSION{ "EXTRA_MATCH_LIMIT_RECURSION", PCRE_EXTRA_MATCH_LIMIT_RECURSION },#endif#ifdef PCRE_EXTRA_MARK{ "EXTRA_MARK", PCRE_EXTRA_MARK },#endif/*---------------------------------------------------------------------------*/{ NULL, 0 }};flag_pair pcre_error_flags[] = {{ "ERROR_NOMATCH", PCRE_ERROR_NOMATCH },{ "ERROR_NULL", PCRE_ERROR_NULL },{ "ERROR_BADOPTION", PCRE_ERROR_BADOPTION },{ "ERROR_BADMAGIC", PCRE_ERROR_BADMAGIC },#if VERSION_PCRE >= 700{ "ERROR_UNKNOWN_OPCODE", PCRE_ERROR_UNKNOWN_OPCODE },#endif{ "ERROR_UNKNOWN_NODE", PCRE_ERROR_UNKNOWN_NODE },{ "ERROR_NOMEMORY", PCRE_ERROR_NOMEMORY },{ "ERROR_NOSUBSTRING", PCRE_ERROR_NOSUBSTRING },#if VERSION_PCRE >= 400{ "ERROR_MATCHLIMIT", PCRE_ERROR_MATCHLIMIT },{ "ERROR_CALLOUT", PCRE_ERROR_CALLOUT },{ "ERROR_BADUTF8", PCRE_ERROR_BADUTF8 },{ "ERROR_BADUTF8_OFFSET", PCRE_ERROR_BADUTF8_OFFSET },#endif#if VERSION_PCRE >= 500{ "ERROR_PARTIAL", PCRE_ERROR_PARTIAL },{ "ERROR_BADPARTIAL", PCRE_ERROR_BADPARTIAL },{ "ERROR_INTERNAL", PCRE_ERROR_INTERNAL },{ "ERROR_BADCOUNT", PCRE_ERROR_BADCOUNT },#endif#if VERSION_PCRE >= 600{ "ERROR_DFA_UITEM", PCRE_ERROR_DFA_UITEM },{ "ERROR_DFA_UCOND", PCRE_ERROR_DFA_UCOND },{ "ERROR_DFA_UMLIMIT", PCRE_ERROR_DFA_UMLIMIT },{ "ERROR_DFA_WSSIZE", PCRE_ERROR_DFA_WSSIZE },{ "ERROR_DFA_RECURSE", PCRE_ERROR_DFA_RECURSE },#endif#if VERSION_PCRE >= 607{ "ERROR_RECURSIONLIMIT", PCRE_ERROR_RECURSIONLIMIT },#endif#if VERSION_PCRE >= 700{ "ERROR_BADNEWLINE", PCRE_ERROR_BADNEWLINE },#endif#ifdef PCRE_ERROR_NULLWSLIMIT{ "ERROR_NULLWSLIMIT", PCRE_ERROR_NULLWSLIMIT },#endif#ifdef PCRE_ERROR_BADOFFSET{ "ERROR_BADOFFSET", PCRE_ERROR_BADOFFSET },#endif#ifdef PCRE_ERROR_SHORTUTF8{ "ERROR_SHORTUTF8", PCRE_ERROR_SHORTUTF8 },#endif#ifdef PCRE_ERROR_RECURSELOOP{ "ERROR_RECURSELOOP", PCRE_ERROR_RECURSELOOP },#endif/*---------------------------------------------------------------------------*/{ NULL, 0 }};#if VERSION_PCRE >= 400static flag_pair pcre_config_flags[] = {{ "CONFIG_UTF8", PCRE_CONFIG_UTF8 },{ "CONFIG_NEWLINE", PCRE_CONFIG_NEWLINE },{ "CONFIG_LINK_SIZE", PCRE_CONFIG_LINK_SIZE },{ "CONFIG_POSIX_MALLOC_THRESHOLD", PCRE_CONFIG_POSIX_MALLOC_THRESHOLD },{ "CONFIG_MATCH_LIMIT", PCRE_CONFIG_MATCH_LIMIT },{ "CONFIG_STACKRECURSE", PCRE_CONFIG_STACKRECURSE },#if VERSION_PCRE >= 500{ "CONFIG_UNICODE_PROPERTIES", PCRE_CONFIG_UNICODE_PROPERTIES },#endif#if VERSION_PCRE >= 650{ "CONFIG_MATCH_LIMIT_RECURSION", PCRE_CONFIG_MATCH_LIMIT_RECURSION },#endif#if VERSION_PCRE >= 704{ "CONFIG_BSR", PCRE_CONFIG_BSR },#endif/*---------------------------------------------------------------------------*/{ NULL, 0 }};int Lpcre_config (lua_State *L) {int val;flag_pair *fp;if (lua_istable (L, 1))lua_settop (L, 1);elselua_newtable (L);for (fp = pcre_config_flags; fp->key; ++fp) {if (0 == pcre_config (fp->val, &val)) {lua_pushinteger (L, val);lua_setfield (L, -2, fp->key);}}return 1;}#endif /* #if VERSION_PCRE >= 400 */int Lpcre_get_flags (lua_State *L) {const flag_pair* fps[] = { pcre_flags, pcre_error_flags, NULL };return get_flags (L, fps);}
# makefile for rex_posix libraryinclude ../defaults.mak# === USER SETTINGS ===# ===========================================================================# These are default values.INC =LIB =# If the default settings don't work for your system,# try to uncomment and edit the settings below.#INC =#LIB = -lc# WARNING:# If you want to use a POSIX regex library that is not the system# default, make sure you set both the INC and LIB variables correctly,# as if a header file and library are used which do not match, you may# well get segmentation faults (or worse).# The following lines work for the rxspencer library, when installed# under /usr (note the above warning!)#INC = -I/usr/include/rxspencer#LIB = -lrxspencer# Target nameREGNAME = posix# ===========================================================================# === END OF USER SETTINGS ===OBJ = lposix.o ../common.oinclude ../common.mak# static POSIX regexp library bindingar_posix: $(TRG_AR)# dynamic POSIX regexp library bindingso_posix: $(TRG_SO)# Dependencieslposix.o: lposix.c ../common.h ../algo.h../common.o: ../common.c ../common.h# (End of Makefile)
/* lposix.c - Lua binding of POSIX regular expressions library *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <string.h>#include <ctype.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"#ifndef REX_POSIX_INCLUDE# include <regex.h>#else# include REX_POSIX_INCLUDE#endif/* These 2 settings may be redefined from the command-line or the makefile.* They should be kept in sync between themselves and with the target name.*/#ifndef REX_LIBNAME# define REX_LIBNAME "rex_posix"#endif#ifndef REX_OPENLIB# define REX_OPENLIB luaopen_rex_posix#endif#define REX_TYPENAME REX_LIBNAME"_regex"/* Test if regex.h corresponds to the extended POSIX library, i.e. H.Spencer's.This test may not work as intended if regex.h introduced REG_BASIC, etc.via enum rather than #define.If that's the case, add -DREX_POSIX_EXT in the makefile/command line.*/#ifndef REX_POSIX_EXT# if defined(REG_BASIC) && defined(REG_STARTEND)# define REX_POSIX_EXT# endif#endif#define ALG_CFLAGS_DFLT REG_EXTENDED#ifdef REX_POSIX_EXT# define ALG_EFLAGS_DFLT REG_STARTEND#else# define ALG_EFLAGS_DFLT 0#endif#define ALG_NOMATCH(res) ((res) == REG_NOMATCH)#define ALG_ISMATCH(res) ((res) == 0)#define ALG_SUBBEG(ud,n) ud->match[n].rm_so#define ALG_SUBEND(ud,n) ud->match[n].rm_eo#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n))#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0)#ifdef REX_NSUB_BASE1# define ALG_NSUB(ud) ((int)ud->r.re_nsub - 1)#else# define ALG_NSUB(ud) ((int)ud->r.re_nsub)#endif#define ALG_PUSHSUB(L,ud,text,n) \lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n))#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \(ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0))#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1)#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n))#define ALG_PUSHOFFSETS(L,ud,offs,n) \(ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n))#define ALG_BASE(st) (st)#define ALG_GETCFLAGS(L,pos) luaL_optint(L, pos, ALG_CFLAGS_DFLT)typedef struct {regex_t r;regmatch_t * match;int freed;} TPosix;#define TUserdata TPosix#include "../algo.h"/* Functions*******************************************************************************/static int generate_error (lua_State *L, const TPosix *ud, int errcode) {char errbuf[80];regerror (errcode, &ud->r, errbuf, sizeof (errbuf));return luaL_error (L, "%s", errbuf);}static int compile_regex (lua_State *L, const TArgComp *argC, TPosix **pud) {int res;TPosix *ud;ud = (TPosix *)lua_newuserdata (L, sizeof (TPosix));memset (ud, 0, sizeof (TPosix)); /* initialize all members to 0 */#ifdef REX_POSIX_EXTif (argC->cflags & REG_PEND)ud->r.re_endp = argC->pattern + argC->patlen;#endifres = regcomp (&ud->r, argC->pattern, argC->cflags);if (res != 0)return generate_error (L, ud, res);if (argC->cflags & REG_NOSUB)ud->r.re_nsub = 0;ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t));lua_pushvalue (L, ALG_ENVIRONINDEX);lua_setmetatable (L, -2);if (pud) *pud = ud;return 1;}#ifdef REX_POSIX_EXTstatic void CheckStartEnd (TArgExec *argE, TPosix *ud) {if (argE->eflags & REG_STARTEND) {ud->match[0].rm_so = argE->startoffset;ud->match[0].rm_eo = argE->textlen;argE->startoffset = 0;}elseargE->text += argE->startoffset;}#endifstatic int gmatch_exec (TUserdata *ud, TArgExec *argE) {if (argE->startoffset > 0)argE->eflags |= REG_NOTBOL;#ifdef REX_POSIX_EXTif (argE->eflags & REG_STARTEND) {ALG_SUBBEG(ud,0) = 0;ALG_SUBEND(ud,0) = argE->textlen - argE->startoffset;}#endifargE->text += argE->startoffset;return regexec (&ud->r, argE->text, ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static void gmatch_pushsubject (lua_State *L, TArgExec *argE) {#ifdef REX_POSIX_EXTif (argE->eflags & REG_STARTEND)lua_pushlstring (L, argE->text, argE->textlen);elselua_pushlstring (L, argE->text, strlen (argE->text));#elselua_pushlstring (L, argE->text, strlen (argE->text));#endif}static int findmatch_exec (TPosix *ud, TArgExec *argE) {#ifdef REX_POSIX_EXTCheckStartEnd (argE, ud);#elseargE->text += argE->startoffset;#endifreturn regexec (&ud->r, argE->text, ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static int gsub_exec (TPosix *ud, TArgExec *argE, int st) {#ifdef REX_POSIX_EXTif(argE->eflags & REG_STARTEND) {ALG_SUBBEG(ud,0) = 0;ALG_SUBEND(ud,0) = argE->textlen - st;}#endifif (st > 0)argE->eflags |= REG_NOTBOL;return regexec (&ud->r, argE->text+st, ALG_NSUB(ud)+1, ud->match, argE->eflags);}static int split_exec (TPosix *ud, TArgExec *argE, int offset) {#ifdef REX_POSIX_EXTif (argE->eflags & REG_STARTEND) {ALG_SUBBEG(ud,0) = 0;ALG_SUBEND(ud,0) = argE->textlen - offset;}#endifif (offset > 0)argE->eflags |= REG_NOTBOL;return regexec (&ud->r, argE->text + offset, ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static int Posix_gc (lua_State *L) {TPosix *ud = check_ud (L);if (ud->freed == 0) { /* precaution against "manual" __gc calling */ud->freed = 1;regfree (&ud->r);free (ud->match);}return 0;}static int Posix_tostring (lua_State *L) {TPosix *ud = check_ud (L);if (ud->freed == 0)lua_pushfstring (L, "%s (%p)", REX_TYPENAME, (void*)ud);elselua_pushfstring (L, "%s (deleted)", REX_TYPENAME);return 1;}static flag_pair posix_flags[] ={#ifdef REX_POSIX_EXT{ "BASIC", REG_BASIC },{ "NOSPEC", REG_NOSPEC },{ "PEND", REG_PEND },{ "STARTEND", REG_STARTEND },#endif{ "EXTENDED", REG_EXTENDED },{ "ICASE", REG_ICASE },{ "NOSUB", REG_NOSUB },{ "NEWLINE", REG_NEWLINE },{ "NOTBOL", REG_NOTBOL },{ "NOTEOL", REG_NOTEOL },/*---------------------------------------------------------------------------*/{ NULL, 0 }};static flag_pair posix_error_flags[] = {{ "NOMATCH", REG_NOMATCH },{ "BADPAT", REG_BADPAT },{ "ECOLLATE", REG_ECOLLATE },{ "ECTYPE", REG_ECTYPE },{ "EESCAPE", REG_EESCAPE },{ "ESUBREG", REG_ESUBREG },{ "EBRACK", REG_EBRACK },{ "EPAREN", REG_EPAREN },{ "EBRACE", REG_EBRACE },{ "BADBR", REG_BADBR },{ "ERANGE", REG_ERANGE },{ "ESPACE", REG_ESPACE },{ "BADRPT", REG_BADRPT },#ifdef REX_POSIX_EXT{ "EMPTY", REG_EMPTY },{ "ASSERT", REG_ASSERT },{ "INVARG", REG_INVARG },#endif/*---------------------------------------------------------------------------*/{ NULL, 0 }};static int Posix_get_flags (lua_State *L) {const flag_pair* fps[] = { posix_flags, posix_error_flags, NULL };return get_flags (L, fps);}static const luaL_Reg r_methods[] = {{ "exec", algm_exec },{ "tfind", algm_tfind }, /* old match */{ "find", algm_find },{ "match", algm_match },{ "__gc", Posix_gc },{ "__tostring", Posix_tostring },{ NULL, NULL}};static const luaL_Reg r_functions[] = {{ "match", algf_match },{ "find", algf_find },{ "gmatch", algf_gmatch },{ "gsub", algf_gsub },{ "split", algf_split },{ "new", algf_new },{ "flags", Posix_get_flags },{ NULL, NULL }};/* Open the library */REX_API int REX_OPENLIB (lua_State *L){alg_register(L, r_methods, r_functions, "POSIX regexes");return 1;}
# makefile for rex_tre libraryinclude ../defaults.mak# === USER SETTINGS ===# ===========================================================================# These are default values.INC =LIB = -ltre# If the default settings don't work for your system,# try to uncomment and edit the settings below.#INC = -I/usr/include#LIB = -lc# WARNING:# Make sure you set both the INC and LIB variables correctly, as# otherwise you risk using a header file and library that do not# match, and you may well get segmentation faults (or worse).# Target nameREGNAME = tre# ===========================================================================# === END OF USER SETTINGS ===OBJ = ltre.o ../common.o # ltre_w.oinclude ../common.mak# static TRE regexp library bindingar_tre: $(TRG_AR)# dynamic TRE regexp library bindingso_tre: $(TRG_SO)# Dependenciesltre.o: ltre.c ../common.h ../algo.hltre_w.o: ltre_w.c ../common.h ../algo.h../common.o: ../common.c ../common.h# (End of Makefile)
/* ltre.c - Lua binding of TRE regular expressions library *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <string.h>#include <ctype.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"extern void add_wide_lib (lua_State *L);#include <tre/tre.h>/* These 2 settings may be redefined from the command-line or the makefile.* They should be kept in sync between themselves and with the target name.*/#ifndef REX_LIBNAME# define REX_LIBNAME "rex_tre"#endif#ifndef REX_OPENLIB# define REX_OPENLIB luaopen_rex_tre#endif#define REX_TYPENAME REX_LIBNAME"_regex"#define ALG_CFLAGS_DFLT REG_EXTENDED#define ALG_EFLAGS_DFLT 0#define ALG_NOMATCH(res) ((res) == REG_NOMATCH)#define ALG_ISMATCH(res) ((res) == 0)#define ALG_SUBBEG(ud,n) ud->match[n].rm_so#define ALG_SUBEND(ud,n) ud->match[n].rm_eo#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n))#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0)#define ALG_NSUB(ud) ((int)ud->r.re_nsub)#define ALG_PUSHSUB(L,ud,text,n) \lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n))#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \(ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0))#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBBEG(ud,n) + 1)#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, (offs) + ALG_SUBEND(ud,n))#define ALG_PUSHOFFSETS(L,ud,offs,n) \(ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n))#define ALG_BASE(st) (st)#define ALG_GETCFLAGS(L,pos) luaL_optint(L, pos, ALG_CFLAGS_DFLT)typedef struct {regex_t r;regmatch_t * match;int freed;} TPosix;#define TUserdata TPosix#include "../algo.h"/* Functions*******************************************************************************/static void checkarg_regaparams (lua_State *L, int stackpos, regaparams_t *argP) {if (lua_type (L, stackpos) != LUA_TTABLE) /* allow for userdata? */luaL_argerror (L, stackpos, "table expected");lua_pushvalue (L, stackpos);argP->cost_ins = get_int_field (L, "cost_ins");argP->cost_del = get_int_field (L, "cost_del");argP->cost_subst = get_int_field (L, "cost_subst");argP->max_cost = get_int_field (L, "max_cost");argP->max_ins = get_int_field (L, "max_ins");argP->max_del = get_int_field (L, "max_del");argP->max_subst = get_int_field (L, "max_subst");argP->max_err = get_int_field (L, "max_err");lua_pop (L, 1);}/* method r:atfind (s, params, [st], [ef]) *//* method r:aexec (s, params, [st], [ef]) */static void checkarg_atfind (lua_State *L, TArgExec *argE, TPosix **ud,regaparams_t *argP) {*ud = check_ud (L);argE->text = luaL_checklstring (L, 2, &argE->textlen);checkarg_regaparams (L, 3, argP);argE->startoffset = get_startoffset (L, 4, argE->textlen);argE->eflags = luaL_optint (L, 5, ALG_EFLAGS_DFLT);}static int generate_error (lua_State *L, const TPosix *ud, int errcode) {char errbuf[80];tre_regerror (errcode, &ud->r, errbuf, sizeof (errbuf));return luaL_error (L, "%s", errbuf);}static int compile_regex (lua_State *L, const TArgComp *argC, TPosix **pud) {int res;TPosix *ud;ud = (TPosix *)lua_newuserdata (L, sizeof (TPosix));memset (ud, 0, sizeof (TPosix)); /* initialize all members to 0 */res = tre_regncomp (&ud->r, argC->pattern, argC->patlen, argC->cflags);if (res != 0)return generate_error (L, ud, res);if (argC->cflags & REG_NOSUB)ud->r.re_nsub = 0;ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t));lua_pushvalue (L, ALG_ENVIRONINDEX);lua_setmetatable (L, -2);if (pud) *pud = ud;return 1;}static int generic_atfind (lua_State *L, int tfind) {int res;TArgExec argE;TPosix *ud;regaparams_t argP;regamatch_t res_match;checkarg_atfind (L, &argE, &ud, &argP);if (argE.startoffset > (int)argE.textlen)return lua_pushnil(L), 1;argE.text += argE.startoffset;res_match.nmatch = ALG_NSUB(ud) + 1;res_match.pmatch = ud->match;/* execute the search */res = tre_reganexec (&ud->r, argE.text, argE.textlen - argE.startoffset,&res_match, argP, argE.eflags);if (ALG_ISMATCH (res)) {ALG_PUSHOFFSETS (L, ud, argE.startoffset, 0);if (tfind)push_substring_table (L, ud, argE.text);elsepush_offset_table (L, ud, argE.startoffset);/* set values in the dictionary part of the table */set_int_field (L, "cost", res_match.cost);set_int_field (L, "num_ins", res_match.num_ins);set_int_field (L, "num_del", res_match.num_del);set_int_field (L, "num_subst", res_match.num_subst);return 3;}else if (ALG_NOMATCH (res))return lua_pushnil (L), 1;elsereturn generate_error (L, ud, res);}static int Ltre_atfind (lua_State *L) {return generic_atfind (L, 1);}static int Ltre_aexec (lua_State *L) {return generic_atfind (L, 0);}static int gmatch_exec (TUserdata *ud, TArgExec *argE) {if (argE->startoffset > 0)argE->eflags |= REG_NOTBOL;argE->text += argE->startoffset;return tre_regnexec (&ud->r, argE->text, argE->textlen - argE->startoffset,ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static void gmatch_pushsubject (lua_State *L, TArgExec *argE) {lua_pushlstring (L, argE->text, argE->textlen);}static int findmatch_exec (TPosix *ud, TArgExec *argE) {argE->text += argE->startoffset;return tre_regnexec (&ud->r, argE->text, argE->textlen - argE->startoffset,ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static int gsub_exec (TPosix *ud, TArgExec *argE, int st) {if (st > 0)argE->eflags |= REG_NOTBOL;return tre_regnexec (&ud->r, argE->text+st, argE->textlen-st, ALG_NSUB(ud)+1,ud->match, argE->eflags);}static int split_exec (TPosix *ud, TArgExec *argE, int offset) {if (offset > 0)argE->eflags |= REG_NOTBOL;return tre_regnexec (&ud->r, argE->text + offset, argE->textlen - offset,ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static int Ltre_have_backrefs (lua_State *L) {TPosix *ud = check_ud (L);lua_pushboolean (L, tre_have_backrefs (&ud->r));return 1;}static int Ltre_have_approx (lua_State *L) {TPosix *ud = check_ud (L);lua_pushboolean (L, tre_have_approx (&ud->r));return 1;}static int Ltre_gc (lua_State *L) {TPosix *ud = check_ud (L);if (ud->freed == 0) { /* precaution against "manual" __gc calling */ud->freed = 1;tre_regfree (&ud->r);free (ud->match);}return 0;}static int Ltre_tostring (lua_State *L) {TPosix *ud = check_ud (L);if (ud->freed == 0)lua_pushfstring (L, "%s (%p)", REX_TYPENAME, (void*)ud);elselua_pushfstring (L, "%s (deleted)", REX_TYPENAME);return 1;}static flag_pair tre_flags[] ={{ "BASIC", REG_BASIC },{ "NOSPEC", REG_NOSPEC },{ "EXTENDED", REG_EXTENDED },{ "ICASE", REG_ICASE },{ "NOSUB", REG_NOSUB },{ "NEWLINE", REG_NEWLINE },{ "NOTBOL", REG_NOTBOL },{ "NOTEOL", REG_NOTEOL },/* TRE-specific flags */{ "LITERAL", REG_LITERAL },{ "RIGHT_ASSOC", REG_RIGHT_ASSOC },{ "UNGREEDY", REG_UNGREEDY },{ "APPROX_MATCHER", REG_APPROX_MATCHER },{ "BACKTRACKING_MATCHER", REG_BACKTRACKING_MATCHER },/*---------------------------------------------------------------------------*/{ NULL, 0 }};static flag_pair tre_error_flags[] = {{ "OK", REG_OK }, /* TRE-specific */{ "NOMATCH", REG_NOMATCH },{ "BADPAT", REG_BADPAT },{ "ECOLLATE", REG_ECOLLATE },{ "ECTYPE", REG_ECTYPE },{ "EESCAPE", REG_EESCAPE },{ "ESUBREG", REG_ESUBREG },{ "EBRACK", REG_EBRACK },{ "EPAREN", REG_EPAREN },{ "EBRACE", REG_EBRACE },{ "BADBR", REG_BADBR },{ "ERANGE", REG_ERANGE },{ "ESPACE", REG_ESPACE },{ "BADRPT", REG_BADRPT },/*---------------------------------------------------------------------------*/{ NULL, 0 }};/* config. flags with integer value */static flag_pair tre_config_flags_int[] = {{ "CONFIG_APPROX", TRE_CONFIG_APPROX },{ "CONFIG_WCHAR", TRE_CONFIG_WCHAR },{ "CONFIG_MULTIBYTE", TRE_CONFIG_MULTIBYTE },{ "CONFIG_SYSTEM_ABI", TRE_CONFIG_SYSTEM_ABI },{ NULL, 0 }};/* config. flags with string value */static flag_pair tre_config_flags_str[] = {{ "CONFIG_VERSION", TRE_CONFIG_VERSION },{ NULL, 0 }};static int Ltre_get_flags (lua_State *L) {const flag_pair* fps[] = { tre_flags, tre_error_flags, NULL };return get_flags (L, fps);}static int Ltre_config (lua_State *L) {int intval;const char *strval;flag_pair *fp;if (lua_istable (L, 1))lua_settop (L, 1);elselua_newtable (L);for (fp = tre_config_flags_int; fp->key; ++fp) {if (0 == tre_config (fp->val, &intval)) {lua_pushinteger (L, intval);lua_setfield (L, -2, fp->key);}}for (fp = tre_config_flags_str; fp->key; ++fp) {if (0 == tre_config (fp->val, &strval)) {lua_pushstring (L, strval);lua_setfield (L, -2, fp->key);}}return 1;}static int Ltre_version (lua_State *L) {lua_pushstring (L, tre_version ());return 1;}static const luaL_Reg r_methods[] = {{ "exec", algm_exec },{ "find", algm_find },{ "match", algm_match },{ "tfind", algm_tfind },{ "aexec", Ltre_aexec },{ "atfind", Ltre_atfind },{ "have_approx", Ltre_have_approx },{ "have_backrefs", Ltre_have_backrefs },{ "__gc", Ltre_gc },{ "__tostring", Ltre_tostring },{ NULL, NULL}};static const luaL_Reg r_functions[] = {{ "new", algf_new },{ "find", algf_find },{ "gmatch", algf_gmatch },{ "gsub", algf_gsub },{ "match", algf_match },{ "split", algf_split },{ "config", Ltre_config },{ "flags", Ltre_get_flags },{ "version", Ltre_version },{ NULL, NULL }};/* Open the library */REX_API int REX_OPENLIB (lua_State *L){alg_register(L, r_methods, r_functions, "TRE regexes");#ifdef REX_ADDWIDECHARFUNCSadd_wide_lib (L);#endifreturn 1;}
/* ltre.c - Lua binding of TRE regular expressions library *//* See Copyright Notice in the file LICENSE */#include <stdlib.h>#include <string.h>#include <ctype.h>#include "lua.h"#include "lauxlib.h"#include "../common.h"#include <tre/tre.h>void bufferZ_putrepstringW (TBuffer *BufRep, int reppos, int nsub);/* These 2 settings may be redefined from the command-line or the makefile.* They should be kept in sync between themselves and with the target name.*/#ifndef REX_LIBNAME# define REX_LIBNAME "rex_tre"#endif#ifndef REX_OPENLIB# define REX_OPENLIB luaopen_rex_tre#endif#define REX_TYPENAME REX_LIBNAME"_regex"#define ALG_CFLAGS_DFLT REG_EXTENDED#define ALG_EFLAGS_DFLT 0#define ALG_CHARSIZE 2#define BUFFERZ_PUTREPSTRING bufferZ_putrepstringW#define ALG_NOMATCH(res) ((res) == REG_NOMATCH)#define ALG_ISMATCH(res) ((res) == 0)#define ALG_SUBBEG(ud,n) (ALG_CHARSIZE * ud->match[n].rm_so)#define ALG_SUBEND(ud,n) (ALG_CHARSIZE * ud->match[n].rm_eo)#define ALG_SUBLEN(ud,n) (ALG_SUBEND(ud,n) - ALG_SUBBEG(ud,n))#define ALG_SUBVALID(ud,n) (ALG_SUBBEG(ud,n) >= 0)#define ALG_NSUB(ud) ((int)ud->r.re_nsub)#define ALG_PUSHSUB(L,ud,text,n) \lua_pushlstring (L, (text) + ALG_SUBBEG(ud,n), ALG_SUBLEN(ud,n))#define ALG_PUSHSUB_OR_FALSE(L,ud,text,n) \(ALG_SUBVALID(ud,n) ? ALG_PUSHSUB (L,ud,text,n) : lua_pushboolean (L,0))#define ALG_PUSHSTART(L,ud,offs,n) lua_pushinteger(L, ((offs) + ALG_SUBBEG(ud,n))/ALG_CHARSIZE + 1)#define ALG_PUSHEND(L,ud,offs,n) lua_pushinteger(L, ((offs) + ALG_SUBEND(ud,n))/ALG_CHARSIZE)#define ALG_PUSHOFFSETS(L,ud,offs,n) \(ALG_PUSHSTART(L,ud,offs,n), ALG_PUSHEND(L,ud,offs,n))#define ALG_BASE(st) (st)#define ALG_GETCFLAGS(L,pos) luaL_optint(L, pos, ALG_CFLAGS_DFLT)typedef struct {regex_t r;regmatch_t * match;int freed;} TPosix;#define TUserdata TPosix#include "../algo.h"/* Functions*******************************************************************************/static void checkarg_regaparams (lua_State *L, int stackpos, regaparams_t *argP) {if (lua_type (L, stackpos) != LUA_TTABLE) /* allow for userdata? */luaL_argerror (L, stackpos, "table expected");lua_pushvalue (L, stackpos);argP->cost_ins = get_int_field (L, "cost_ins");argP->cost_del = get_int_field (L, "cost_del");argP->cost_subst = get_int_field (L, "cost_subst");argP->max_cost = get_int_field (L, "max_cost");argP->max_ins = get_int_field (L, "max_ins");argP->max_del = get_int_field (L, "max_del");argP->max_subst = get_int_field (L, "max_subst");argP->max_err = get_int_field (L, "max_err");lua_pop (L, 1);}/* method r:atfind (s, params, [st], [ef]) *//* method r:aexec (s, params, [st], [ef]) */static void checkarg_atfind (lua_State *L, TArgExec *argE, TPosix **ud,regaparams_t *argP) {*ud = check_ud (L);argE->text = luaL_checklstring (L, 2, &argE->textlen);checkarg_regaparams (L, 3, argP);argE->startoffset = get_startoffset (L, 4, argE->textlen);argE->eflags = luaL_optint (L, 5, ALG_EFLAGS_DFLT);}static int generate_error (lua_State *L, const TPosix *ud, int errcode) {char errbuf[80];tre_regerror (errcode, &ud->r, errbuf, sizeof (errbuf));return luaL_error (L, "%s", errbuf);}static int compile_regex (lua_State *L, const TArgComp *argC, TPosix **pud) {int res;TPosix *ud;ud = (TPosix *)lua_newuserdata (L, sizeof (TPosix));memset (ud, 0, sizeof (TPosix)); /* initialize all members to 0 */res = tre_regwncomp (&ud->r, (const wchar_t*)argC->pattern, argC->patlen/ALG_CHARSIZE, argC->cflags);if (res != 0)return generate_error (L, ud, res);if (argC->cflags & REG_NOSUB)ud->r.re_nsub = 0;ud->match = (regmatch_t *) Lmalloc (L, (ALG_NSUB(ud) + 1) * sizeof (regmatch_t));lua_pushvalue (L, ALG_ENVIRONINDEX);lua_setmetatable (L, -2);if (pud) *pud = ud;return 1;}static int generic_atfind (lua_State *L, int tfind) {int res;TArgExec argE;TPosix *ud;regaparams_t argP;regamatch_t res_match;checkarg_atfind (L, &argE, &ud, &argP);if (argE.startoffset > (int)argE.textlen)return lua_pushnil(L), 1;argE.text += argE.startoffset;res_match.nmatch = ALG_NSUB(ud) + 1;res_match.pmatch = ud->match;/* execute the search */res = tre_regawnexec (&ud->r, (const wchar_t*)argE.text,(argE.textlen - argE.startoffset)/ALG_CHARSIZE, &res_match, argP, argE.eflags);if (ALG_ISMATCH (res)) {ALG_PUSHOFFSETS (L, ud, argE.startoffset, 0);if (tfind)push_substring_table (L, ud, argE.text);elsepush_offset_table (L, ud, argE.startoffset);/* set values in the dictionary part of the table */set_int_field (L, "cost", res_match.cost);set_int_field (L, "num_ins", res_match.num_ins);set_int_field (L, "num_del", res_match.num_del);set_int_field (L, "num_subst", res_match.num_subst);return 3;}else if (ALG_NOMATCH (res))return lua_pushnil (L), 1;elsereturn generate_error (L, ud, res);}static int Ltre_atfind (lua_State *L) {return generic_atfind (L, 1);}static int Ltre_aexec (lua_State *L) {return generic_atfind (L, 0);}static int gmatch_exec (TUserdata *ud, TArgExec *argE) {if (argE->startoffset > 0)argE->eflags |= REG_NOTBOL;argE->text += argE->startoffset;return tre_regwnexec (&ud->r, (const wchar_t*)argE->text, (argE->textlen - argE->startoffset)/ALG_CHARSIZE,ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static void gmatch_pushsubject (lua_State *L, TArgExec *argE) {lua_pushlstring (L, argE->text, argE->textlen);}static int findmatch_exec (TPosix *ud, TArgExec *argE) {argE->text += argE->startoffset;return tre_regwnexec (&ud->r, (const wchar_t*)argE->text, (argE->textlen - argE->startoffset)/ALG_CHARSIZE,ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static int gsub_exec (TPosix *ud, TArgExec *argE, int st) {if (st > 0)argE->eflags |= REG_NOTBOL;return tre_regwnexec (&ud->r, (const wchar_t*)(argE->text+st), (argE->textlen-st)/ALG_CHARSIZE, ALG_NSUB(ud)+1,ud->match, argE->eflags);}static int split_exec (TPosix *ud, TArgExec *argE, int offset) {if (offset > 0)argE->eflags |= REG_NOTBOL;return tre_regwnexec (&ud->r, (const wchar_t*)(argE->text + offset), (argE->textlen - offset)/ALG_CHARSIZE,ALG_NSUB(ud) + 1, ud->match, argE->eflags);}static const luaL_Reg r_methods[] = {{ "wexec", algm_exec },{ "wfind", algm_find },{ "wmatch", algm_match },{ "wtfind", algm_tfind },{ "waexec", Ltre_aexec },{ "watfind", Ltre_atfind },{ NULL, NULL}};static const luaL_Reg r_functions[] = {{ "wnew", algf_new },{ "wfind", algf_find },{ "wgmatch", algf_gmatch },{ "wgsub", algf_gsub },{ "wmatch", algf_match },{ "wsplit", algf_split },{ NULL, NULL }};/* Add the library */void add_wide_lib (lua_State *L){(void)alg_register;lua_pushvalue(L, -2);#if LUA_VERSION_NUM == 501luaL_register(L, NULL, r_methods);lua_pop(L, 1);luaL_register(L, NULL, r_functions);#elselua_pushvalue(L, -1);luaL_setfuncs(L, r_methods, 1);luaL_setfuncs(L, r_functions, 1);#endif}/* 1. When called repeatedly on the same TBuffer, its existing datais discarded and overwritten by the new data.2. The TBuffer's array is never shrunk by this function.*/void bufferZ_putrepstringW (TBuffer *BufRep, int reppos, int nsub) {wchar_t dbuf[] = { 0, 0 };size_t replen;const wchar_t *p = (const wchar_t*) lua_tolstring (BufRep->L, reppos, &replen);replen /= sizeof(wchar_t);const wchar_t *end = p + replen;BufRep->top = 0;while (p < end) {const wchar_t *q;for (q = p; q < end && *q != L'%'; ++q){}if (q != p)bufferZ_addlstring (BufRep, p, (q - p) * sizeof(wchar_t));if (q < end) {if (++q < end) { /* skip % */if (iswdigit (*q)) {int num;*dbuf = *q;num = wcstol (dbuf, NULL, 10);if (num == 1 && nsub == 0)num = 0;else if (num > nsub) {freelist_free (BufRep->freelist);luaL_error (BufRep->L, "invalid capture index");}bufferZ_addnum (BufRep, num);}else bufferZ_addlstring (BufRep, q, 1 * sizeof(wchar_t));}p = q + 1;}else break;}}
/* linenoise.c -- guerrilla line editing library against the idea that a* line editing lib needs to be 20,000 lines of C code.** You can find the latest source code at:** http://github.com/antirez/linenoise** Does a number of crazy assumptions that happen to be true in 99.9999% of* the 2010 UNIX computers around.** Copyright (c) 2010, Salvatore Sanfilippo <antirez at gmail dot com>* Copyright (c) 2010, Pieter Noordhuis <pcnoordhuis at gmail dot com>** All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions are met:** * Redistributions of source code must retain the above copyright notice,* this list of conditions and the following disclaimer.* * Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.* * Neither the name of Redis nor the names of its contributors may be used* to endorse or promote products derived from this software without* specific prior written permission.** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE* POSSIBILITY OF SUCH DAMAGE.** References:* - http://invisible-island.net/xterm/ctlseqs/ctlseqs.html* - http://www.3waylabs.com/nw/WWW/products/wizcon/vt220.html** Todo list:* - Switch to gets() if $TERM is something we can't support.* - Filter bogus Ctrl+<char> combinations.* - Win32 support** Bloat:* - Completion?* - History search like Ctrl+r in readline?** List of escape sequences used by this program, we do everything just* with three sequences. In order to be so cheap we may have some* flickering effect with some slow terminal, but the lesser sequences* the more compatible.** CHA (Cursor Horizontal Absolute)* Sequence: ESC [ n G* Effect: moves cursor to column n** EL (Erase Line)* Sequence: ESC [ n K* Effect: if n is 0 or missing, clear from cursor to end of line* Effect: if n is 1, clear from beginning of line to cursor* Effect: if n is 2, clear entire line** CUF (CUrsor Forward)* Sequence: ESC [ n C* Effect: moves cursor forward of n chars** The following are used to clear the screen: ESC [ H ESC [ 2 J* This is actually composed of two sequences:** cursorhome* Sequence: ESC [ H* Effect: moves the cursor to upper left corner** ED2 (Clear entire screen)* Sequence: ESC [ 2 J* Effect: clear the whole screen**/#include <termios.h>#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <string.h>#include <stdlib.h>#include <sys/types.h>#include <sys/ioctl.h>#include <unistd.h>#include "linenoise.h"#define LINENOISE_DEFAULT_HISTORY_MAX_LEN 100#define LINENOISE_MAX_LINE 4096static char *unsupported_term[] = {"dumb","cons25",NULL};static linenoiseCompletionCallback *completionCallback = NULL;static struct termios orig_termios; /* in order to restore at exit */static int rawmode = 0; /* for atexit() function to check if restore is needed*/static int atexit_registered = 0; /* register atexit just 1 time */static int history_max_len = LINENOISE_DEFAULT_HISTORY_MAX_LEN;static int history_len = 0;char **history = NULL;static void linenoiseAtExit(void);int linenoiseHistoryAdd(const char *line);static int isUnsupportedTerm(void) {char *term = getenv("TERM");int j;if (term == NULL) return 0;for (j = 0; unsupported_term[j]; j++)if (!strcasecmp(term,unsupported_term[j])) return 1;return 0;}static void freeHistory(void) {if (history) {int j;for (j = 0; j < history_len; j++)free(history[j]);free(history);}}static int enableRawMode(int fd) {struct termios raw;if (!isatty(STDIN_FILENO)) goto fatal;if (!atexit_registered) {atexit(linenoiseAtExit);atexit_registered = 1;}if (tcgetattr(fd,&orig_termios) == -1) goto fatal;raw = orig_termios; /* modify the original mode *//* input modes: no break, no CR to NL, no parity check, no strip char,* no start/stop output control. */raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);/* output modes - disable post processing */raw.c_oflag &= ~(OPOST);/* control modes - set 8 bit chars */raw.c_cflag |= (CS8);/* local modes - choing off, canonical off, no extended functions,* no signal chars (^Z,^C) */raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);/* control chars - set return condition: min number of bytes and timer.* We want read to return every single byte, without timeout. */raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer *//* put terminal in raw mode after flushing */if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal;rawmode = 1;return 0;fatal:errno = ENOTTY;return -1;}static void disableRawMode(int fd) {/* Don't even check the return value as it's too late. */if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1)rawmode = 0;}/* At exit we'll try to fix the terminal to the initial conditions. */static void linenoiseAtExit(void) {disableRawMode(STDIN_FILENO);freeHistory();}static int getColumns(void) {struct winsize ws;if (ioctl(1, TIOCGWINSZ, &ws) == -1) return 80;return ws.ws_col;}static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_t pos, size_t cols) {char seq[64];size_t plen = strlen(prompt);while((plen+pos) >= cols) {buf++;len--;pos--;}while (plen+len > cols) {len--;}/* Cursor to left edge */snprintf(seq,64,"\x1b[0G");if (write(fd,seq,strlen(seq)) == -1) return;/* Write the prompt and the current buffer content */if (write(fd,prompt,strlen(prompt)) == -1) return;if (write(fd,buf,len) == -1) return;/* Erase to right */snprintf(seq,64,"\x1b[0K");if (write(fd,seq,strlen(seq)) == -1) return;/* Move cursor to original position. */snprintf(seq,64,"\x1b[0G\x1b[%dC", (int)(pos+plen));if (write(fd,seq,strlen(seq)) == -1) return;}static void beep() {fprintf(stderr, "\x7");fflush(stderr);}static void freeCompletions(linenoiseCompletions *lc) {size_t i;for (i = 0; i < lc->len; i++)free(lc->cvec[i]);if (lc->cvec != NULL)free(lc->cvec);}static int completeLine(int fd, const char *prompt, char *buf, size_t buflen, size_t *len, size_t *pos, size_t cols) {linenoiseCompletions lc = { 0, NULL };int nread, nwritten;char c = 0;completionCallback(buf,&lc);if (lc.len == 0) {beep();} else {size_t stop = 0, i = 0;size_t clen;while(!stop) {/* Show completion or original buffer */if (i < lc.len) {clen = strlen(lc.cvec[i]);refreshLine(fd,prompt,lc.cvec[i],clen,clen,cols);} else {refreshLine(fd,prompt,buf,*len,*pos,cols);}nread = read(fd,&c,1);if (nread <= 0) {freeCompletions(&lc);return -1;}switch(c) {case 9: /* tab */i = (i+1) % (lc.len+1);if (i == lc.len) beep();break;case 27: /* escape *//* Re-show original buffer */if (i < lc.len) {refreshLine(fd,prompt,buf,*len,*pos,cols);}stop = 1;break;default:/* Update buffer and return */if (i < lc.len) {nwritten = snprintf(buf,buflen,"%s",lc.cvec[i]);*len = *pos = nwritten;}stop = 1;break;}}}freeCompletions(&lc);return c; /* Return last read character */}void linenoiseClearScreen(void) {if (write(STDIN_FILENO,"\x1b[H\x1b[2J",7) <= 0) {/* nothing to do, just to avoid warning. */}}static int linenoisePrompt(int fd, char *buf, size_t buflen, const char *prompt) {size_t plen = strlen(prompt);size_t pos = 0;size_t len = 0;size_t cols = getColumns();int history_index = 0;buf[0] = '\0';buflen--; /* Make sure there is always space for the nulterm *//* The latest history entry is always our current buffer, that* initially is just an empty string. */linenoiseHistoryAdd("");if (write(fd,prompt,plen) == -1) return -1;while(1) {char c;int nread;char seq[2], seq2[2];nread = read(fd,&c,1);if (nread <= 0) return len;/* Only autocomplete when the callback is set. It returns < 0 when* there was an error reading from fd. Otherwise it will return the* character that should be handled next. */if (c == 9 && completionCallback != NULL) {c = completeLine(fd,prompt,buf,buflen,&len,&pos,cols);/* Return on errors */if (c < 0) return len;/* Read next character when 0 */if (c == 0) continue;}switch(c) {case 13: /* enter */case 4: /* ctrl-d */history_len--;free(history[history_len]);return (len == 0 && c == 4) ? -1 : (int)len;case 3: /* ctrl-c */errno = EAGAIN;return -1;case 127: /* backspace */case 8: /* ctrl-h */if (pos > 0 && len > 0) {memmove(buf+pos-1,buf+pos,len-pos);pos--;len--;buf[len] = '\0';refreshLine(fd,prompt,buf,len,pos,cols);}break;case 20: /* ctrl-t */if (pos > 0 && pos < len) {int aux = buf[pos-1];buf[pos-1] = buf[pos];buf[pos] = aux;if (pos != len-1) pos++;refreshLine(fd,prompt,buf,len,pos,cols);}break;case 2: /* ctrl-b */goto left_arrow;case 6: /* ctrl-f */goto right_arrow;case 16: /* ctrl-p */seq[1] = 65;goto up_down_arrow;case 14: /* ctrl-n */seq[1] = 66;goto up_down_arrow;break;case 27: /* escape sequence */if (read(fd,seq,2) == -1) break;if (seq[0] == 91 && seq[1] == 68) {left_arrow:/* left arrow */if (pos > 0) {pos--;refreshLine(fd,prompt,buf,len,pos,cols);}} else if (seq[0] == 91 && seq[1] == 67) {right_arrow:/* right arrow */if (pos != len) {pos++;refreshLine(fd,prompt,buf,len,pos,cols);}} else if (seq[0] == 91 && (seq[1] == 65 || seq[1] == 66)) {up_down_arrow:/* up and down arrow: history */if (history_len > 1) {/* Update the current history entry before to* overwrite it with tne next one. */free(history[history_len-1-history_index]);history[history_len-1-history_index] = strdup(buf);/* Show the new entry */history_index += (seq[1] == 65) ? 1 : -1;if (history_index < 0) {history_index = 0;break;} else if (history_index >= history_len) {history_index = history_len-1;break;}strncpy(buf,history[history_len-1-history_index],buflen);buf[buflen] = '\0';len = pos = strlen(buf);refreshLine(fd,prompt,buf,len,pos,cols);}} else if (seq[0] == 91 && seq[1] > 48 && seq[1] < 55) {/* extended escape */if (read(fd,seq2,2) == -1) break;if (seq[1] == 51 && seq2[0] == 126) {/* delete */if (len > 0 && pos < len) {memmove(buf+pos,buf+pos+1,len-pos-1);len--;buf[len] = '\0';refreshLine(fd,prompt,buf,len,pos,cols);}}}break;default:if (len < buflen) {if (len == pos) {buf[pos] = c;pos++;len++;buf[len] = '\0';if (plen+len < cols) {/* Avoid a full update of the line in the* trivial case. */if (write(fd,&c,1) == -1) return -1;} else {refreshLine(fd,prompt,buf,len,pos,cols);}} else {memmove(buf+pos+1,buf+pos,len-pos);buf[pos] = c;len++;pos++;buf[len] = '\0';refreshLine(fd,prompt,buf,len,pos,cols);}}break;case 21: /* Ctrl+u, delete the whole line. */buf[0] = '\0';pos = len = 0;refreshLine(fd,prompt,buf,len,pos,cols);break;case 11: /* Ctrl+k, delete from current to end of line. */buf[pos] = '\0';len = pos;refreshLine(fd,prompt,buf,len,pos,cols);break;case 1: /* Ctrl+a, go to the start of the line */pos = 0;refreshLine(fd,prompt,buf,len,pos,cols);break;case 5: /* ctrl+e, go to the end of the line */pos = len;refreshLine(fd,prompt,buf,len,pos,cols);break;case 12: /* ctrl+l, clear screen */linenoiseClearScreen();refreshLine(fd,prompt,buf,len,pos,cols);}}return len;}static int linenoiseRaw(char *buf, size_t buflen, const char *prompt) {int fd = STDIN_FILENO;int count;if (buflen == 0) {errno = EINVAL;return -1;}if (!isatty(STDIN_FILENO)) {if (fgets(buf, buflen, stdin) == NULL) return -1;count = strlen(buf);if (count && buf[count-1] == '\n') {count--;buf[count] = '\0';}} else {if (enableRawMode(fd) == -1) return -1;count = linenoisePrompt(fd, buf, buflen, prompt);disableRawMode(fd);printf("\n");}return count;}char *linenoise(const char *prompt) {char buf[LINENOISE_MAX_LINE];int count;if (isUnsupportedTerm()) {size_t len;printf("%s",prompt);fflush(stdout);if (fgets(buf,LINENOISE_MAX_LINE,stdin) == NULL) return NULL;len = strlen(buf);while(len && (buf[len-1] == '\n' || buf[len-1] == '\r')) {len--;buf[len] = '\0';}return strdup(buf);} else {count = linenoiseRaw(buf,LINENOISE_MAX_LINE,prompt);if (count == -1) return NULL;return strdup(buf);}}/* Register a callback function to be called for tab-completion. */void linenoiseSetCompletionCallback(linenoiseCompletionCallback *fn) {completionCallback = fn;}void linenoiseAddCompletion(linenoiseCompletions *lc, char *str) {size_t len = strlen(str);char *copy = malloc(len+1);memcpy(copy,str,len+1);lc->cvec = realloc(lc->cvec,sizeof(char*)*(lc->len+1));lc->cvec[lc->len++] = copy;}/* Using a circular buffer is smarter, but a bit more complex to handle. */int linenoiseHistoryAdd(const char *line) {char *linecopy;if (history_max_len == 0) return 0;if (history == NULL) {history = malloc(sizeof(char*)*history_max_len);if (history == NULL) return 0;memset(history,0,(sizeof(char*)*history_max_len));}linecopy = strdup(line);if (!linecopy) return 0;if (history_len == history_max_len) {free(history[0]);memmove(history,history+1,sizeof(char*)*(history_max_len-1));history_len--;}history[history_len] = linecopy;history_len++;return 1;}int linenoiseHistorySetMaxLen(int len) {char **new;if (len < 1) return 0;if (history) {int tocopy = history_len;new = malloc(sizeof(char*)*len);if (new == NULL) return 0;if (len < tocopy) tocopy = len;memcpy(new,history+(history_max_len-tocopy), sizeof(char*)*tocopy);free(history);history = new;}history_max_len = len;if (history_len > history_max_len)history_len = history_max_len;return 1;}/* Save the history in the specified file. On success 0 is returned* otherwise -1 is returned. */int linenoiseHistorySave(char *filename) {FILE *fp = fopen(filename,"w");int j;if (fp == NULL) return -1;for (j = 0; j < history_len; j++)fprintf(fp,"%s\n",history[j]);fclose(fp);return 0;}/* Load the history from the specified file. If the file does not exist* zero is returned and no operation is performed.** If the file exists and the operation succeeded 0 is returned, otherwise* on error -1 is returned. */int linenoiseHistoryLoad(char *filename) {FILE *fp = fopen(filename,"r");char buf[LINENOISE_MAX_LINE];if (fp == NULL) return -1;while (fgets(buf,LINENOISE_MAX_LINE,fp) != NULL) {char *p;p = strchr(buf,'\r');if (!p) p = strchr(buf,'\n');if (p) *p = '\0';linenoiseHistoryAdd(buf);}fclose(fp);return 0;}
/* linenoise.h -- guerrilla line editing library against the idea that a* line editing lib needs to be 20,000 lines of C code.** See linenoise.c for more information.** Copyright (c) 2010, Salvatore Sanfilippo <antirez at gmail dot com>* Copyright (c) 2010, Pieter Noordhuis <pcnoordhuis at gmail dot com>** All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions are met:** * Redistributions of source code must retain the above copyright notice,* this list of conditions and the following disclaimer.* * Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the* documentation and/or other materials provided with the distribution.* * Neither the name of Redis nor the names of its contributors may be used* to endorse or promote products derived from this software without* specific prior written permission.** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE* POSSIBILITY OF SUCH DAMAGE.*/#ifndef __LINENOISE_H#define __LINENOISE_Htypedef struct linenoiseCompletions {size_t len;char **cvec;} linenoiseCompletions;typedef void(linenoiseCompletionCallback)(const char *, linenoiseCompletions *);void linenoiseSetCompletionCallback(linenoiseCompletionCallback *);void linenoiseAddCompletion(linenoiseCompletions *, char *);char *linenoise(const char *prompt);int linenoiseHistoryAdd(const char *line);int linenoiseHistorySetMaxLen(int len);int linenoiseHistorySave(char *filename);int linenoiseHistoryLoad(char *filename);void linenoiseClearScreen(void);#endif /* __LINENOISE_H */
echo Building Onigurumacd $COMMON/$ONIG./configure && makeif [ "$SYSTEM" = "osx" ]then#Copy to lib/cp -f .libs/libonig.2.0.0.dylib $LIB/#Do symbolic linkscd $LIBln -s -f libonig.2.0.0.dylib libonig.2.dylibln -s -f libonig.2.0.0.dylib libonig.dylibelif [ "$SYSTEM" = "linux" ]then#Copy to lib/cp -f .libs/libonig.so.2.0.0 $LIB#Do symbolic linkscd $LIBln -s -f libonig.so.2.0.0 libonig.so.2ln -s -f libonig.so.2.0.0 libonig.sofiecho Building lrexlibcd $COMMON/$LREXmake#Copy lrexlib to lib/cp -f src/oniguruma/rex_onig.so.2.6 $LIB#cp -f src/onigurum/librex_onig.a $LIBcd $LIBln -s -f rex_onig.so.2.6 rex_onig.so