Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/win32 text eol=crlf
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else
agrep_dirs =
endif

SUBDIRS = local_includes lib $(agrep_dirs) tests utils po m4
SUBDIRS = include lib $(agrep_dirs) tests utils po m4

EXTRA_DIST = \
LICENSE \
Expand Down
14 changes: 6 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([TRE], [0.9.0])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([lib/regcomp.c])
AC_CONFIG_AUX_DIR([utils])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign])
AC_PREREQ([2.63])
AM_GNU_GETTEXT_VERSION(0.17)
AC_PREREQ([2.69])
AM_GNU_GETTEXT_VERSION(0.19)

dnl Checks for programs.
AC_PROG_CC
Expand Down Expand Up @@ -100,10 +101,6 @@ else
AM_CONDITIONAL(TRE_AGREP, false)
fi


dnl Make sure locally configured headers are used (this adds the #define to config.h).
AC_DEFINE(USE_LOCAL_TRE_H, 1, [ Define to ensure locally configured headers are used ])

AC_ARG_WITH(alloca,
AS_HELP_STRING(
[--without-alloca],
Expand Down Expand Up @@ -520,12 +517,13 @@ AM_GNU_GETTEXT([external])
LT_INIT([win32-dll, disable-static])

dnl Output files
AC_CONFIG_HEADERS([config.h local_includes/tre-config.h])
AC_CONFIG_HEADERS([config.h include/tre/tre-config.h])
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/agrep.1
local_includes/Makefile
include/Makefile
include/tre/Makefile
lib/Makefile
m4/Makefile
po/Makefile.in
Expand Down
1 change: 1 addition & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBDIRS = tre
File renamed without changes.
37 changes: 37 additions & 0 deletions include/tre/regex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* regex.h - TRE legacy API
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*
* This header is for source level compatibility with old code using
* the <tre/regex.h> header which defined the TRE API functions without
* a prefix. New code should include <tre/tre.h> instead.
*/

#ifndef TRE_REGEX_H
#define TRE_REGEX_H

#include <tre/tre.h>

#ifndef TRE_USE_SYSTEM_REGEX_H
#define regcomp tre_regcomp
#define regerror tre_regerror
#define regexec tre_regexec
#define regfree tre_regfree
#endif /* TRE_USE_SYSTEM_REGEX_H */

#define regacomp tre_regacomp
#define regaexec tre_regaexec
#define regancomp tre_regancomp
#define reganexec tre_reganexec
#define regawncomp tre_regawncomp
#define regawnexec tre_regawnexec
#define regncomp tre_regncomp
#define regnexec tre_regnexec
#define regwcomp tre_regwcomp
#define regwexec tre_regwexec
#define regwncomp tre_regwncomp
#define regwnexec tre_regwnexec

#endif /* TRE_REGEX_H */
File renamed without changes.
23 changes: 8 additions & 15 deletions local_includes/tre.h → include/tre/tre.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
/*
tre.h - TRE public API definitions

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/
* tre.h - TRE public API definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

#ifndef TRE_H
#define TRE_H 1
#define TRE_H

#ifdef USE_LOCAL_TRE_H
/* Make certain to use the header(s) from the TRE package that this
file is part of by giving the full path to the header from this directory. */
#include "../local_includes/tre-config.h"
#else
/* Use the header in the same directory as this file if there is one. */
#include "tre-config.h"
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
Expand Down Expand Up @@ -339,6 +331,7 @@ tre_have_approx(const regex_t *preg);
#ifdef __cplusplus
}
#endif
#endif /* TRE_H */

#endif /* TRE_H */

/* EOF */
2 changes: 1 addition & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib_LTLIBRARIES = libtre.la
libtre_la_LDFLAGS = -no-undefined -version-info 5:0:0 $(LDFLAGS)
libtre_la_LIBADD = $(LTLIBINTL)
AM_CPPFLAGS = -I$(top_srcdir)/include/tre
AM_CPPFLAGS = -I$(top_srcdir)/include

noinst_HEADERS = \
tre-ast.h \
Expand Down
14 changes: 6 additions & 8 deletions lib/tre-ast.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/*
tre-ast.h - Abstract syntax tree (AST) definitions

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/

* tre-ast.h - Abstract syntax tree (AST) definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

#ifndef TRE_AST_H
#define TRE_AST_H 1
#define TRE_AST_H

#include "tre-mem.h"
#include "tre-internal.h"
Expand Down
15 changes: 12 additions & 3 deletions lib/tre-filter.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/*
* tre-filter.h - Histogram filter definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/



#ifndef TRE_FILTER_H
#define TRE_FILTER_H

typedef struct {
unsigned char ch;
Expand All @@ -14,6 +20,9 @@ typedef struct {
tre_filter_profile_t *profile;
} tre_filter_t;


int
tre_filter_find(const unsigned char *str, size_t len, tre_filter_t *filter);

#endif /* TRE_FILTER_H */

/* EOF */
29 changes: 12 additions & 17 deletions lib/tre-internal.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/*
tre-internal.h - TRE internal definitions

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/
* tre-internal.h - TRE internal definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

#ifndef TRE_INTERNAL_H
#define TRE_INTERNAL_H 1
#define TRE_INTERNAL_H

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */

#ifdef HAVE_WCHAR_H
#include <wchar.h>
Expand All @@ -17,13 +20,10 @@
#include <wctype.h>
#endif /* HAVE_WCTYPE_H */

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */

#include <limits.h>
#include <ctype.h>
#include "../local_includes/tre.h"

#include "tre/tre.h"

#define TRE_MAX_RE 65536
#define TRE_MAX_STRING INT_MAX
Expand Down Expand Up @@ -277,11 +277,6 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, ssize_t len,
tre_str_type_t type, int *match_tags, int eflags,
int *match_end_ofs);

reg_errcode_t
tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, ssize_t len,
tre_str_type_t type, int *match_tags, int eflags,
int *match_end_ofs);

reg_errcode_t
tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string, ssize_t len,
tre_str_type_t type, int *match_tags, int eflags,
Expand Down
16 changes: 11 additions & 5 deletions lib/tre-match-utils.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/*
tre-match-utils.h - TRE matcher helper definitions
* tre-match-utils.h - TRE matcher helper definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/
#ifndef TRE_MATCH_UTILS_H
#define TRE_MATCH_UTILS_H

#define str_source ((const tre_str_source*)string)

Expand Down Expand Up @@ -213,3 +215,7 @@ tre_neg_char_classes_match(tre_ctype_t *classes, tre_cint_t wc, int icase)
classes++;
return 0; /* No match. */
}

#endif /* TRE_MATCH_UTILS_H */

/* EOF */
15 changes: 6 additions & 9 deletions lib/tre-mem.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
tre-mem.h - TRE memory allocator interface

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/
* tre-mem.h - TRE memory allocator interface
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

#ifndef TRE_MEM_H
#define TRE_MEM_H 1
#define TRE_MEM_H

#include <stdlib.h>

Expand All @@ -27,7 +26,6 @@ typedef struct tre_mem_struct {
void **provided;
} *tre_mem_t;


tre_mem_t tre_mem_new_impl(int provided, void *provided_block);
void *tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block,
int zero, size_t size);
Expand Down Expand Up @@ -57,7 +55,6 @@ void *tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block,
: tre_mem_alloc_impl((mem), 1, alloca(TRE_MEM_BLOCK_SIZE), 0, (size)))
#endif /* TRE_USE_ALLOCA */


/* Frees the memory allocator and all memory allocated with it. */
void tre_mem_destroy(tre_mem_t mem);

Expand Down
13 changes: 6 additions & 7 deletions lib/tre-parse.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
tre-parse.c - Regexp parser definitions

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/
* tre-parse.c - Regexp parser definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

#ifndef TRE_PARSE_H
#define TRE_PARSE_H 1
#define TRE_PARSE_H

/* Parse context. */
typedef struct {
Expand Down
17 changes: 7 additions & 10 deletions lib/tre-stack.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/*
tre-stack.h: Stack definitions

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/

* tre-stack.h: Stack definitions
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*
*/

#ifndef TRE_STACK_H
#define TRE_STACK_H 1

#include "../local_includes/tre.h"
#define TRE_STACK_H

typedef struct tre_stack_rec tre_stack_t;

Expand Down
17 changes: 8 additions & 9 deletions lib/xmalloc.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/*
xmalloc.h - Simple malloc debugging library API
* xmalloc.h - Simple malloc debugging library API
*
* This software is released under a BSD-style license.
* See the file LICENSE for details and copyright.
*/

This software is released under a BSD-style license.
See the file LICENSE for details and copyright.

*/

#ifndef _XMALLOC_H
#define _XMALLOC_H 1
#ifndef TRE_XMALLOC_H
#define TRE_XMALLOC_H

void *xmalloc_impl(size_t size, const char *file, int line, const char *func);
void *xcalloc_impl(size_t nmemb, size_t size, const char *file, int line,
Expand Down Expand Up @@ -72,6 +71,6 @@ void xmalloc_configure(int fail_after);
#endif /* !MALLOC_DEBUGGING */
#endif /* !XMALLOC_INTERNAL */

#endif /* _XMALLOC_H */
#endif /* TRE_XMALLOC_H */

/* EOF */
Loading
Loading