# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-FILE_PATTERNS = aop.h *.c
+FILE_PATTERNS = aop.h tracecut.h *.c
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
lib_LTLIBRARIES = libinteraspect.la
libinteraspect_la_SOURCES = aop-pc-assign.c aop-main.c aop-type.c aop-weave.c \
aop-pc-entry.c aop-pc-exit.c aop-pc-fun-call.c aop-header.c \
- aop-pointcut.c aop-duplicate.c
+ aop-pointcut.c aop-duplicate.c tracecut.c
libinteraspect_la_CFLAGS = -Wall -Werror -fvisibility=hidden -prefer-pic
libinteraspect_la_LDFLAGS = -static -prefer-pic -version-info 1:0:0
libinteraspect_la_CPPFLAGS = -DHAVE_CONFIG_H -DIN_GCC -I$(gcc_includes)
* objects for you when the compiler exits.
*/
+/**
+ * \struct tc_tracecut
+ * \brief A tracecut object.
+ *
+ * A tracecut event represents a set of program events parameterized
+ * on program objects. The tracecut runtime can monitor program
+ * objects to see when an object performs a sequence of events
+ * (specified with a regular expression).
+ *
+ * Each tracecut must be freed manually with tc_free_tracecut().
+ */
+
/**
* \example hello.c
* A "hello world" example that shows the minimum setup necessary to
--- /dev/null
+/* Copyright (c) 2011 Justin Seyster
+ Copyright (c) 2011 Erez Zadok
+ Copyright (c) 2011 Stony Brook University
+ Copyright (c) 2011 The Research Foundation of SUNY
+
+ 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 3 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.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License
+ and a copy of the GCC Runtime Library Exception along with this
+ program; see the files COPYING and COPYING.RUNTIME respectively.
+ If not, see <http://www.gnu.org/licenses/>. */
+
+/* Whether we want them or not (we don't), Autoconf _insists_ on
+ defining these. Since GCC's config.h (which we must include) also
+ defines them, we have to undef them here. */
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+
+#include <locale.h>
+#include <stdlib.h>
+
+#include "aop.h"
+#include "tracecut.h"
+
+/**
+ * \cond HIDDEN_SYMBOLS
+ */
+struct tc_call_symbol {
+ const char *name;
+ const char *func_name;
+
+ struct tc_call_symbol *next;
+};
+
+struct tc_tracecut {
+ struct tracecut_symbol *tc_symbol_list;
+};
+/**
+ * \endcond
+ */
+
+/**
+ * \defgroup tracecut Tracecut Functions
+ * \{
+ */
+
+/**
+ * Create an empty tc_tracecut object. The caller is responsible for
+ * freeing the object using tc_free_tracecut().
+ * \return A new tc_tracecut that must be freed with
+ * tc_free_tracecut().
+ */
+struct tc_tracecut *
+tc_create_tracecut (void)
+{
+ struct tc_tracecut *tc;
+
+ tc = (struct tc_tracecut *)malloc (sizeof (struct tc_tracecut));
+ aop_assert (tc != NULL);
+
+ tc->tc_symbol_list = NULL;
+
+ return tc;
+}
+
+/**
+ * Free all the memory used by a tc_object. Every call to
+ * tc_create_tracecut() should have a matching call to
+ * tc_free_tracecut().
+ * \param tc The tracecut object to free.
+ */
+void
+tc_free_tracecut (struct tc_tracecut *tc)
+{
+ free(tc);
+}
+
+/* Close Doxygen defgroup block. */
+/**
+ * \}
+ */
--- /dev/null
+#ifndef __AOP_TRACECUT_H__
+#define __AOP_TRACECUT_H__
+
+/* Copyright (c) 2011 Justin Seyster
+ Copyright (c) 2011 Erez Zadok
+ Copyright (c) 2011 Stony Brook University
+ Copyright (c) 2011 The Research Foundation of SUNY
+
+ 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 3 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.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License
+ and a copy of the GCC Runtime Library Exception along with this
+ program; see the files COPYING and COPYING.RUNTIME respectively.
+ If not, see <http://www.gnu.org/licenses/>. */
+
+/**
+ * \file tracecut.h
+ * \brief The public interface for InterAspect tracecuts, an extension
+ * to the InterAspect framework.
+ *
+ * A tracecut can track sequences of events on a program object (or a
+ * set of program objects) using regular expressions.
+ *
+ * Though included in the InterAspect distribution, the tracecut
+ * extension only uses InterAspect's external API, making it a good
+ * example of how to use the API.
+ *
+ * All tracecut functions have a <code>tc_</code> prefix.
+ */
+
+struct tc_tracecut;
+
+extern struct tc_tracecut *tc_create_tracecut (void);
+extern void tc_free_tracecut (struct tc_tracecut *tc);
+
+#endif