Enable -fvisibility=hidden for src/misc/.

* configure.ac: Check for -fvisibility support.
* m4/ax_check_compile_flag.m4: New file.
* src/misc/common.hh: New file.
* src/misc/Makefile.am: Add common.hh, and adjust to use -fvisibility.
* src/misc/bareword.hh, src/misc/escape.hh, src/misc/formater.hh,
src/misc/intvcmp2.hh, src/misc/intvcomp.hh, src/misc/memusage.hh,
src/misc/minato.hh, src/misc/optionmap.hh, src/misc/random.hh,
src/misc/timer.hh, src/misc/version.hh, src/misc/bddop.hh: Include
common.hh and add SPOT_API tags.
* src/misc/acccompl.hh, src/misc/accconv.hh: Prepare for upcoming
move.
* src/sanity/style.test: Ignore SPOT_API tags.
* wrap/python/Makefile.am: Ignore SPOT_API.
* wrap/python/spot.i: Do not emit binding for bddalloc.hh.
* wrap/python/tests/minato.py: Do not use bdd_allocator.
This commit is contained in:
Alexandre Duret-Lutz 2013-06-24 21:39:22 +02:00
parent b5710663f4
commit 2ef8917ba5
22 changed files with 258 additions and 78 deletions

View file

@ -60,6 +60,14 @@ gl_INIT
AC_LANG(C++) AC_LANG(C++)
# Use -Werror since using -fvisibility under MinGW is only a warning.
# (The option is ignored anyway since this does not make sense under windows).
AC_SUBST([VISIBILITY_CXXFLAGS])
AX_CHECK_COMPILE_FLAG([-Werror -fvisibility=hidden],
[VISIBILITY_CXXFLAGS="$VISIBILITY_CXXFLAGS -fvisibility=hidden -DSPOT_BUILD"
AX_CHECK_COMPILE_FLAG([-fvisibility-inlines-hidden],
[VISIBILITY_CXXFLAGS="$VISIBILITY_CXXFLAGS -fvisibility-inlines-hidden"])])
AC_HEADER_UNORDERED_MAP AC_HEADER_UNORDERED_MAP
AC_HEADER_TR1_UNORDERED_MAP AC_HEADER_TR1_UNORDERED_MAP
AC_HEADER_EXT_HASH_MAP AC_HEADER_EXT_HASH_MAP

View file

@ -0,0 +1,72 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# 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.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 2
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS

View file

@ -1,8 +1,9 @@
## Copyright (C) 2011, 2012 Laboratoire de Recherche et Développement ## -*- coding: utf-8 -*-
## de l'Epita (LRDE). ## Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et
## Développement de l'Epita (LRDE).
## Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de ## Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie. ## Université Pierre et Marie Curie.
## ##
## This file is part of Spot, a model checking library. ## This file is part of Spot, a model checking library.
## ##
@ -20,7 +21,7 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
AM_CPPFLAGS = -I$(srcdir)/.. -I.. $(BUDDY_CPPFLAGS) AM_CPPFLAGS = -I$(srcdir)/.. -I.. $(BUDDY_CPPFLAGS)
AM_CXXFLAGS = $(WARNING_CXXFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(VISIBILITY_CXXFLAGS)
miscdir = $(pkgincludedir)/misc miscdir = $(pkgincludedir)/misc
@ -35,6 +36,7 @@ misc_HEADERS = \
bddlt.hh \ bddlt.hh \
bddop.hh \ bddop.hh \
casts.hh \ casts.hh \
common.hh \
escape.hh \ escape.hh \
fixpool.hh \ fixpool.hh \
formater.hh \ formater.hh \
@ -45,8 +47,8 @@ misc_HEADERS = \
intvcmp2.hh \ intvcmp2.hh \
ltstr.hh \ ltstr.hh \
minato.hh \ minato.hh \
memusage.hh \
modgray.hh \ modgray.hh \
memusage.hh \
mspool.hh \ mspool.hh \
optionmap.hh \ optionmap.hh \
random.hh \ random.hh \
@ -62,13 +64,13 @@ libmisc_la_SOURCES = \
bddalloc.cc \ bddalloc.cc \
bddop.cc \ bddop.cc \
escape.cc \ escape.cc \
freelist.cc \
formater.cc \ formater.cc \
freelist.cc \
intvcomp.cc \ intvcomp.cc \
intvcmp2.cc \ intvcmp2.cc \
modgray.cc \
memusage.cc \ memusage.cc \
minato.cc \ minato.cc \
modgray.cc \
optionmap.cc \ optionmap.cc \
random.cc \ random.cc \
timer.cc \ timer.cc \

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Developpement de // Copyright (C) 2012, 2013 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE) // l'Epita (LRDE)
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -18,8 +18,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef SPOT_MISC_ACCCOMPL_HH #ifndef SPOT_PRIV_ACCCOMPL_HH
# define SPOT_MISC_ACCCOMPL_HH # define SPOT_PRIV_ACCCOMPL_HH
#include <map> #include <map>
#include <bdd.h> #include <bdd.h>
@ -53,4 +53,4 @@ namespace spot
}; };
} // End namespace Spot } // End namespace Spot
#endif // !SPOT_MISC_ACCCOMPL_HH #endif // SPOT_PRIV_ACCCOMPL_HH

View file

@ -1,4 +1,4 @@
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de // Copyright (C) 2011, 2013 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE) // l'Epita (LRDE)
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef SPOT_MISC_ACCCONV_HH #ifndef SPOT_PRIV_ACCCONV_HH
# define SPOT_MISC_ACCCONV_HH # define SPOT_PRIV_ACCCONV_HH
#include <bdd.h> #include <bdd.h>
#include "misc/hash.hh" #include "misc/hash.hh"
@ -48,4 +48,4 @@ namespace spot
} }
#endif // SPOT_MISC_ACCCONV_HH #endif // SPOT_PRIV_ACCCONV_HH

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -20,7 +23,8 @@
#ifndef SPOT_MISC_BAREWORD_HH #ifndef SPOT_MISC_BAREWORD_HH
# define SPOT_MISC_BAREWORD_HH # define SPOT_MISC_BAREWORD_HH
#include <string> # include "common.hh"
# include <string>
namespace spot namespace spot
{ {
@ -28,13 +32,14 @@ namespace spot
/// @{ /// @{
/// \brief Whether a word is bare. /// \brief Whether a word is bare.
/// ///
/// Bare words should start with a letter or an underscore, and /// Bare words should start with a letter, an underscore, or a dot,
/// consist solely of alphanumeric characters and underscores. /// and consist solely of alphanumeric characters, underscores, and
bool is_bare_word(const char* str); /// dots.
SPOT_API bool is_bare_word(const char* str);
/// \brief Double-quote words that are not bare. /// \brief Double-quote words that are not bare.
/// \see is_bare_word /// \see is_bare_word
std::string quote_unless_bare_word(const std::string& str); SPOT_API std::string quote_unless_bare_word(const std::string& str);
/// @} /// @}
} }

View file

@ -1,4 +1,5 @@
// Copyright (C) 2009 Laboratoire de Recherche et Développement // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -19,17 +20,20 @@
#ifndef SPOT_MISC_BDDOP_HH #ifndef SPOT_MISC_BDDOP_HH
# define SPOT_MISC_BDDOP_HH # define SPOT_MISC_BDDOP_HH
#include "common.hh"
#include "bdd.h" #include "bdd.h"
namespace spot namespace spot
{ {
/// \brief Compute all acceptance conditions from all neg acceptance /// \brief Compute all acceptance conditions from all neg acceptance
/// conditions. /// conditions.
bdd compute_all_acceptance_conditions(bdd neg_acceptance_conditions); SPOT_API bdd
compute_all_acceptance_conditions(bdd neg_acceptance_conditions);
/// \brief Compute neg acceptance conditions from all acceptance /// \brief Compute neg acceptance conditions from all acceptance
/// conditions. /// conditions.
bdd compute_neg_acceptance_conditions(bdd all_acceptance_conditions); SPOT_API bdd
compute_neg_acceptance_conditions(bdd all_acceptance_conditions);
} }
#endif // SPOT_MISC_BDDOP_HH #endif // SPOT_MISC_BDDOP_HH

59
src/misc/common.hh Normal file
View file

@ -0,0 +1,59 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
// Spot 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.
//
// Spot 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, see <http://www.gnu.org/licenses/>.
#ifndef SPOT_MISC_COMMON_HH
# define SPOT_MISC_COMMON_HH
#if defined _WIN32 || defined __CYGWIN__
#define SPOT_HELPER_DLL_IMPORT __declspec(dllimport)
#define SPOT_HELPER_DLL_EXPORT __declspec(dllexport)
#define SPOT_HELPER_DLL_LOCAL
#else
#if __GNUC__ >= 4
#define SPOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
#define SPOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
#define SPOT_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define SPOT_HELPER_DLL_IMPORT
#define SPOT_HELPER_DLL_EXPORT
#define SPOT_HELPER_DLL_LOCAL
#endif
#endif
#ifdef SPOT_BUILD
#define SPOT_DLL
#endif
// SPOT_API is used for the public API symbols. It either DLL imports
// or DLL exports (or does nothing for static build) SPOT_LOCAL is
// used for non-api symbols that may occur in header files.
#ifdef SPOT_DLL
#ifdef SPOT_BUILD
#define SPOT_API SPOT_HELPER_DLL_EXPORT
#else
#define SPOT_API SPOT_HELPER_DLL_IMPORT
#endif
#define SPOT_LOCAL SPOT_HELPER_DLL_LOCAL
#else
#define SPOT_API
#define SPOT_LOCAL
#endif
#define SPOT_API_VAR extern SPOT_API
#endif // SPOT_MISC_COMMON_HH

View file

@ -1,7 +1,8 @@
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Developpement de // -*- coding: utf-8 -*-
// l'Epita (LRDE). // Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et
// Developpement de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -22,6 +23,7 @@
#ifndef SPOT_MISC_ESCAPE_HH #ifndef SPOT_MISC_ESCAPE_HH
# define SPOT_MISC_ESCAPE_HH # define SPOT_MISC_ESCAPE_HH
# include "common.hh"
# include <iosfwd> # include <iosfwd>
# include <string> # include <string>
@ -32,14 +34,14 @@ namespace spot
/// \brief Escape characters <code>"</code>, <code>\\</code>, and /// \brief Escape characters <code>"</code>, <code>\\</code>, and
/// <code>\\n</code> in \a str. /// <code>\\n</code> in \a str.
std::ostream& escape_str(std::ostream& os, const std::string& str); SPOT_API std::ostream& escape_str(std::ostream& os, const std::string& str);
/// \brief Escape characters <code>"</code>, <code>\\</code>, and /// \brief Escape characters <code>"</code>, <code>\\</code>, and
/// <code>\\n</code> in \a str. /// <code>\\n</code> in \a str.
std::string escape_str(const std::string& str); SPOT_API std::string escape_str(const std::string& str);
/// \brief Remove spaces at the front and back of \a str. /// \brief Remove spaces at the front and back of \a str.
void trim(std::string& str); SPOT_API void trim(std::string& str);
/// @} /// @}
} }

View file

@ -20,6 +20,7 @@
#ifndef SPOT_MISC_FORMATER_HH #ifndef SPOT_MISC_FORMATER_HH
#define SPOT_MISC_FORMATER_HH #define SPOT_MISC_FORMATER_HH
#include "common.hh"
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -101,7 +102,7 @@ namespace spot
}; };
class formater class SPOT_API formater
{ {
printable_id id; printable_id id;
printable_percent percent; printable_percent percent;

View file

@ -1,4 +1,5 @@
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE). // l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -19,8 +20,9 @@
#ifndef SPOT_MISC_INTVCMP2_HH #ifndef SPOT_MISC_INTVCMP2_HH
# define SPOT_MISC_INTVCMP2_HH # define SPOT_MISC_INTVCMP2_HH
#include <vector> # include "common.hh"
#include <stddef.h> # include <vector>
# include <stddef.h>
namespace spot namespace spot
{ {
@ -33,7 +35,7 @@ namespace spot
/// assert will be triggered if \a dest_size is too small. On /// assert will be triggered if \a dest_size is too small. On
/// return, \a dest_size will be set to the actually number of int /// return, \a dest_size will be set to the actually number of int
/// filled in \a dest /// filled in \a dest
void SPOT_API void
int_array_array_compress2(const int* array, size_t n, int_array_array_compress2(const int* array, size_t n,
int* dest, size_t& dest_size); int* dest, size_t& dest_size);
@ -41,7 +43,7 @@ namespace spot
/// array of size \a size. /// array of size \a size.
/// ///
/// \a size must be the exact expected size of uncompressed array. /// \a size must be the exact expected size of uncompressed array.
void SPOT_API void
int_array_array_decompress2(const int* array, size_t array_size, int_array_array_decompress2(const int* array, size_t array_size,
int* res, size_t size); int* res, size_t size);

View file

@ -1,5 +1,6 @@
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de // -*- coding: utf-8 -*-
// l'Epita (LRDE). // Copyright (C) 2011, 2013 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -19,8 +20,9 @@
#ifndef SPOT_MISC_INTVCOMP_HH #ifndef SPOT_MISC_INTVCOMP_HH
# define SPOT_MISC_INTVCOMP_HH # define SPOT_MISC_INTVCOMP_HH
#include <vector> # include "common.hh"
#include <stddef.h> # include <vector>
# include <stddef.h>
namespace spot namespace spot
{ {
@ -28,7 +30,7 @@ namespace spot
/// @{ /// @{
/// Compress an int vector into a vector of unsigned int. /// Compress an int vector into a vector of unsigned int.
void SPOT_API void
int_vector_vector_compress(const std::vector<int>& input, int_vector_vector_compress(const std::vector<int>& input,
std::vector<unsigned int>& output); std::vector<unsigned int>& output);
@ -36,19 +38,19 @@ namespace spot
/// size \a size. /// size \a size.
/// ///
/// \a size must be the exact expected size of uncompressed array. /// \a size must be the exact expected size of uncompressed array.
void SPOT_API void
int_vector_vector_decompress(const std::vector<unsigned int>& array, int_vector_vector_decompress(const std::vector<unsigned int>& array,
std::vector<int>& output, size_t size); std::vector<int>& output, size_t size);
/// Compress an int array if size \a n into a vector of unsigned int. /// Compress an int array if size \a n into a vector of unsigned int.
const std::vector<unsigned int>* SPOT_API const std::vector<unsigned int>*
int_array_vector_compress(const int* array, size_t n); int_array_vector_compress(const int* array, size_t n);
/// \brief Uncompress a vector of unsigned int into an int array of /// \brief Uncompress a vector of unsigned int into an int array of
/// size \a size. /// size \a size.
/// ///
/// \a size must be the exact expected size of uncompressed array. /// \a size must be the exact expected size of uncompressed array.
void SPOT_API void
int_vector_array_decompress(const std::vector<unsigned int>* array, int_vector_array_decompress(const std::vector<unsigned int>* array,
int* res, size_t size); int* res, size_t size);
@ -58,7 +60,7 @@ namespace spot
/// assert will be triggered if \a dest_size is too small. On /// assert will be triggered if \a dest_size is too small. On
/// return, \a dest_size will be set to the actually number of int /// return, \a dest_size will be set to the actually number of int
/// filled in \a dest /// filled in \a dest
void SPOT_API void
int_array_array_compress(const int* array, size_t n, int_array_array_compress(const int* array, size_t n,
int* dest, size_t& dest_size); int* dest, size_t& dest_size);
@ -66,7 +68,7 @@ namespace spot
/// array of size \a size. /// array of size \a size.
/// ///
/// \a size must be the exact expected size of uncompressed array. /// \a size must be the exact expected size of uncompressed array.
void SPOT_API void
int_array_array_decompress(const int* array, size_t array_size, int_array_array_decompress(const int* array, size_t array_size,
int* res, size_t size); int* res, size_t size);

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE).
// Copyright (C) 2006 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -20,6 +23,7 @@
#ifndef SPOT_MISC_MEMUSAGE_HH #ifndef SPOT_MISC_MEMUSAGE_HH
# define SPOT_MISC_MEMUSAGE_HH # define SPOT_MISC_MEMUSAGE_HH
#include "common.hh"
namespace spot namespace spot
{ {
@ -27,7 +31,7 @@ namespace spot
/// ///
/// \return The total number of pages in use by the program if known. /// \return The total number of pages in use by the program if known.
/// -1 otherwise. /// -1 otherwise.
int memusage(); SPOT_API int memusage();
} }
#endif // SPOT_MISC_MEMUSAGE_HH #endif // SPOT_MISC_MEMUSAGE_HH

View file

@ -1,7 +1,8 @@
// Copyright (C) 2009 Laboratoire de Recherche et Développement // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -22,6 +23,7 @@
#ifndef SPOT_MISC_MINATO_HH #ifndef SPOT_MISC_MINATO_HH
# define SPOT_MISC_MINATO_HH # define SPOT_MISC_MINATO_HH
# include "common.hh"
# include <bdd.h> # include <bdd.h>
# include <stack> # include <stack>
@ -47,7 +49,7 @@ namespace spot
month = {April} month = {April}
} }
\endverbatim */ \endverbatim */
class minato_isop class SPOT_API minato_isop
{ {
public: public:
/// \brief Conctructor. /// \brief Conctructor.

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE)
// Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -20,6 +23,7 @@
#ifndef SPOT_MISC_OPTIONMAP_HH #ifndef SPOT_MISC_OPTIONMAP_HH
# define SPOT_MISC_OPTIONMAP_HH # define SPOT_MISC_OPTIONMAP_HH
#include "common.hh"
#include <string> #include <string>
#include <map> #include <map>
#include <iosfwd> #include <iosfwd>
@ -30,7 +34,7 @@ namespace spot
/// \brief Manage a map of options. /// \brief Manage a map of options.
/// ///
/// Each option is defined by a string and is associated to an integer value. /// Each option is defined by a string and is associated to an integer value.
class option_map class SPOT_API option_map
{ {
public: public:
/// \brief Add the parsed options to the map. /// \brief Add the parsed options to the map.
@ -76,7 +80,8 @@ namespace spot
int& operator[](const char* option); int& operator[](const char* option);
/// \brief Print the option_map \a m. /// \brief Print the option_map \a m.
friend std::ostream& operator<<(std::ostream& os, const option_map& m); friend SPOT_API std::ostream&
operator<<(std::ostream& os, const option_map& m);
private: private:
std::map<std::string, int> options_; std::map<std::string, int> options_;

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -20,6 +23,7 @@
#ifndef SPOT_MISC_RANDOM_HH #ifndef SPOT_MISC_RANDOM_HH
# define SPOT_MISC_RANDOM_HH # define SPOT_MISC_RANDOM_HH
# include "common.hh"
# include <cmath> # include <cmath>
namespace spot namespace spot
@ -31,25 +35,25 @@ namespace spot
/// \brief Reset the seed of the pseudo-random number generator. /// \brief Reset the seed of the pseudo-random number generator.
/// ///
/// \see drand, mrand, rrand /// \see drand, mrand, rrand
void srand(unsigned int seed); SPOT_API void srand(unsigned int seed);
/// \brief Compute a pseudo-random integer value between \a min and /// \brief Compute a pseudo-random integer value between \a min and
/// \a max included. /// \a max included.
/// ///
/// \see drand, mrand, srand /// \see drand, mrand, srand
int rrand(int min, int max); SPOT_API int rrand(int min, int max);
/// \brief Compute a pseudo-random integer value between 0 and /// \brief Compute a pseudo-random integer value between 0 and
/// \a max-1 included. /// \a max-1 included.
/// ///
/// \see drand, rrand, srand /// \see drand, rrand, srand
int mrand(int max); SPOT_API int mrand(int max);
/// \brief Compute a pseudo-random double value /// \brief Compute a pseudo-random double value
/// between 0.0 and 1.0 (1.0 excluded). /// between 0.0 and 1.0 (1.0 excluded).
/// ///
/// \see mrand, rrand, srand /// \see mrand, rrand, srand
double drand(); SPOT_API double drand();
/// \brief Compute a pseudo-random double value /// \brief Compute a pseudo-random double value
/// following a standard normal distribution. (Odeh & Evans) /// following a standard normal distribution. (Odeh & Evans)
@ -57,14 +61,14 @@ namespace spot
/// This uses a polynomial approximation of the inverse cumulated /// This uses a polynomial approximation of the inverse cumulated
/// density function from Odeh & Evans, Journal of Applied /// density function from Odeh & Evans, Journal of Applied
/// Statistics, 1974, vol 23, pp 96-97. /// Statistics, 1974, vol 23, pp 96-97.
double nrand(); SPOT_API double nrand();
/// \brief Compute a pseudo-random double value /// \brief Compute a pseudo-random double value
/// following a standard normal distribution. (Box-Muller) /// following a standard normal distribution. (Box-Muller)
/// ///
/// This uses the polar form of the Box-Muller transform /// This uses the polar form of the Box-Muller transform
/// to generate random values. /// to generate random values.
double bmrand(); SPOT_API double bmrand();
/// \brief Compute pseudo-random integer value between 0 /// \brief Compute pseudo-random integer value between 0
/// and \a n included, following a binomial distribution /// and \a n included, following a binomial distribution
@ -112,7 +116,7 @@ namespace spot
/// following a Poisson distribution with parameter \a p. /// following a Poisson distribution with parameter \a p.
/// ///
/// \pre <code>p > 0</code> /// \pre <code>p > 0</code>
int prand(double p); SPOT_API int prand(double p);
/// @} /// @}
} }

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2011, 2012 Laboratoire de Recherche et // Copyright (C) 2009, 2011, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -23,6 +23,7 @@
#ifndef SPOT_MISC_TIMER_HH #ifndef SPOT_MISC_TIMER_HH
# define SPOT_MISC_TIMER_HH # define SPOT_MISC_TIMER_HH
# include "common.hh"
# include "misc/_config.h" # include "misc/_config.h"
# include <cassert> # include <cassert>
# include <iosfwd> # include <iosfwd>
@ -200,7 +201,7 @@ namespace spot
} }
/// Format information about all timers in a table. /// Format information about all timers in a table.
std::ostream& SPOT_API std::ostream&
print(std::ostream& os) const; print(std::ostream& os) const;
/// \brief Remove information about all timers. /// \brief Remove information about all timers.

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -20,11 +23,13 @@
#ifndef SPOT_MISC_VERSION_HH #ifndef SPOT_MISC_VERSION_HH
# define SPOT_MISC_VERSION_HH # define SPOT_MISC_VERSION_HH
# include "common.hh"
namespace spot namespace spot
{ {
/// \ingroup misc_tools /// \ingroup misc_tools
/// \brief Return Spot's version. /// \brief Return Spot's version.
const char* version(); SPOT_API const char* version();
} }
#endif // SPOT_MISC_VERSION_HH #endif // SPOT_MISC_VERSION_HH

View file

@ -86,10 +86,13 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
# // # //
# // # //
# to keep the line numbers correct in the diagnostics. # to keep the line numbers correct in the diagnostics.
#
# Also get read of the SPOT_API tags.
perl -pe 'sub f {my $a = shift; $a =~ s:[^\n]*://:g; return "$a"} perl -pe 'sub f {my $a = shift; $a =~ s:[^\n]*://:g; return "$a"}
s,/\*(.*?)\*/,f($1),sge; s,/\*(.*?)\*/,f($1),sge;
s,//.*?\n,//\n,g; s,//.*?\n,//\n,g;
s,"[^"\n]*","",g' -0777 <$file >$tmp s,"[^"\n]*","",g;
s,SPOT_API ,,g' -0777 <$file >$tmp
grep '[ ]$' $tmp && grep '[ ]$' $tmp &&
diag 'Trailing whitespace.' diag 'Trailing whitespace.'

View file

@ -1,7 +1,8 @@
## Copyright (C) 2010, 2011 Laboratoire de Recherche et Development de ## -*- coding: utf-8 -*-
## Copyright (C) 2010, 2011, 2013 Laboratoire de Recherche et Development de
## l'Epita (LRDE). ## l'Epita (LRDE).
## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), ## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre ## département Systèmes Répartis Coopératifs (SRC), Université Pierre
## et Marie Curie. ## et Marie Curie.
## ##
## This file is part of Spot, a model checking library. ## This file is part of Spot, a model checking library.
@ -39,7 +40,8 @@ _spot_la_LDFLAGS = -avoid-version -module
_spot_la_LIBADD = $(top_builddir)/src/libspot.la _spot_la_LIBADD = $(top_builddir)/src/libspot.la
$(srcdir)/spot_wrap.cxx: $(srcdir)/spot.i $(srcdir)/spot_wrap.cxx: $(srcdir)/spot.i
$(SWIG) -c++ -python -I$(srcdir) -I$(top_srcdir)/src $(srcdir)/spot.i $(SWIG) -c++ -python -DSPOT_API= -I$(srcdir) \
-I$(top_srcdir)/src $(srcdir)/spot.i
$(srcdir)/spot.py: $(srcdir)/spot.i $(srcdir)/spot.py: $(srcdir)/spot.i
$(MAKE) $(AM_MAKEFLAGS) spot_wrap.cxx $(MAKE) $(AM_MAKEFLAGS) spot_wrap.cxx
@ -51,7 +53,7 @@ _buddy_la_SOURCES = $(srcdir)/buddy_wrap.cxx
_buddy_la_LDFLAGS = -avoid-version -module $(BUDDY_LDFLAGS) _buddy_la_LDFLAGS = -avoid-version -module $(BUDDY_LDFLAGS)
$(srcdir)/buddy_wrap.cxx: $(srcdir)/buddy.i $(srcdir)/buddy_wrap.cxx: $(srcdir)/buddy.i
$(SWIG) -c++ -python $(BUDDY_CPPFLAGS) $(srcdir)/buddy.i $(SWIG) -c++ -python -DBUDDY_API= $(BUDDY_CPPFLAGS) $(srcdir)/buddy.i
$(srcdir)/buddy.py: $(srcdir)/buddy.i $(srcdir)/buddy.py: $(srcdir)/buddy.i
$(MAKE) $(AM_MAKEFLAGS) buddy_wrap.cxx $(MAKE) $(AM_MAKEFLAGS) buddy_wrap.cxx

View file

@ -44,7 +44,6 @@ namespace std {
#include <signal.h> #include <signal.h>
#include "misc/version.hh" #include "misc/version.hh"
#include "misc/bddalloc.hh"
#include "misc/minato.hh" #include "misc/minato.hh"
#include "misc/modgray.hh" #include "misc/modgray.hh"
#include "misc/optionmap.hh" #include "misc/optionmap.hh"
@ -158,7 +157,6 @@ using namespace spot;
%rename(TrueVal) True; %rename(TrueVal) True;
%include "misc/version.hh" %include "misc/version.hh"
%include "misc/bddalloc.hh"
%include "misc/minato.hh" %include "misc/minato.hh"
%include "misc/optionmap.hh" %include "misc/optionmap.hh"
%include "misc/random.hh" %include "misc/random.hh"

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*- # -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2010, 2012 Laboratoire de Recherche et Développement # Copyright (C) 2010, 2012, 2013 Laboratoire de Recherche et Développement
# de l'Epita # de l'Epita
# Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), # Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre # département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -24,9 +24,8 @@ import spot
import buddy import buddy
import sys import sys
alloc = spot.bdd_allocator() buddy.bdd_init(10000, 10000)
buddy.bdd_setvarnum(3)
alloc.allocate_variables(3)
a = buddy.bdd_ithvar(0) a = buddy.bdd_ithvar(0)
b = buddy.bdd_ithvar(1) b = buddy.bdd_ithvar(1)