Browse Source

*: massive decruftification & cleanup

- Removed all backends apart from twitter, template, and libpurple.
  (why would you want to use any of them?)
- Deleted dodgy vendored includes (from swiften, boost)
- Replaced all usage of the dodgy SWIFTEN_* macros and HAVE_SWIFTEN_3
  define.
- Removed spectrum2_manager (it's stupid, just use systemd)
- Removed spectrum2 server mode (it's stupid, just use a component)
- Removed Jingle File Transfer (only worked on swiften 3, was suuuper
  hacky)
- Moved spectrum/src to src/ (this always pissed me off)
- Removed WIN32 and non-Linux platform support (was ugly)
- Removed packaging, munin, travis, etc (this is a fork)
- Added .clang-format, ran clang-format everywhere (hooray!)
- Removed half the flags and crap in CMakeLists.txt (it didn't really help)
master
eta 3 years ago
parent
commit
51b16becd1
  1. 5
      .clang-format
  2. 42
      .travis.yml
  3. 196
      CMakeLists.txt
  4. 110
      Dockerfile
  5. 23
      appveyor.yml
  6. 17
      backends/CMakeLists.txt
  7. 11
      backends/frotz/CMakeLists.txt
  8. 9
      backends/frotz/dfrotz/CMakeLists.txt
  9. 2
      backends/frotz/dfrotz/README
  10. 154
      backends/frotz/dfrotz/common/buffer.c
  11. 154
      backends/frotz/dfrotz/common/err.c
  12. 1115
      backends/frotz/dfrotz/common/fastmem.c
  13. 566
      backends/frotz/dfrotz/common/files.c
  14. 617
      backends/frotz/dfrotz/common/frotz.h
  15. 72
      backends/frotz/dfrotz/common/getopt.c
  16. 258
      backends/frotz/dfrotz/common/hotkey.c
  17. 324
      backends/frotz/dfrotz/common/input.c
  18. 200
      backends/frotz/dfrotz/common/main.c
  19. 261
      backends/frotz/dfrotz/common/math.c
  20. 1003
      backends/frotz/dfrotz/common/object.c
  21. 798
      backends/frotz/dfrotz/common/process.c
  22. 562
      backends/frotz/dfrotz/common/quetzal.c
  23. 82
      backends/frotz/dfrotz/common/random.c
  24. 172
      backends/frotz/dfrotz/common/redirect.c
  25. 1743
      backends/frotz/dfrotz/common/screen.c
  26. 67
      backends/frotz/dfrotz/common/setup.h
  27. 204
      backends/frotz/dfrotz/common/sound.c
  28. 365
      backends/frotz/dfrotz/common/stream.c
  29. 193
      backends/frotz/dfrotz/common/table.c
  30. 1109
      backends/frotz/dfrotz/common/text.c
  31. 304
      backends/frotz/dfrotz/common/variable.c
  32. 42
      backends/frotz/dfrotz/dumb/dumb_frotz.h
  33. 233
      backends/frotz/dfrotz/dumb/dumb_init.c
  34. 432
      backends/frotz/dfrotz/dumb/dumb_input.c
  35. 540
      backends/frotz/dfrotz/dumb/dumb_output.c
  36. 153
      backends/frotz/dfrotz/dumb/dumb_pic.c
  37. 358
      backends/frotz/main.cpp
  38. 30
      backends/libcommuni/CMakeLists.txt
  39. 70
      backends/libcommuni/backports.h
  40. 310
      backends/libcommuni/ircnetworkplugin.cpp
  41. 77
      backends/libcommuni/ircnetworkplugin.h
  42. 53
      backends/libcommuni/main.cpp
  43. 587
      backends/libcommuni/session.cpp
  44. 119
      backends/libcommuni/session.h
  45. 161
      backends/libpurple/geventloop.cpp
  46. 9
      backends/libpurple/geventloop.h
  47. 2307
      backends/libpurple/main.cpp
  48. 376
      backends/libpurple/purple_defs.cpp
  49. 344
      backends/libpurple/purple_defs.h
  50. 83
      backends/libpurple/utils.cpp
  51. 11
      backends/libpurple/utils.h
  52. 9
      backends/smstools3/CMakeLists.txt
  53. 292
      backends/smstools3/main.cpp
  54. 13
      backends/swiften/CMakeLists.txt
  55. 464
      backends/swiften/main.cpp
  56. 20
      backends/template/main.cpp
  57. 19
      backends/template/plugin.cpp
  58. 40
      backends/template/plugin.h
  59. 19
      backends/twitter/HTTPRequest.cpp
  60. 21
      backends/twitter/HTTPRequest.h
  61. 29
      backends/twitter/Requests/CreateFriendRequest.cpp
  62. 24
      backends/twitter/Requests/CreateFriendRequest.h
  63. 19
      backends/twitter/Requests/DestroyFriendRequest.cpp
  64. 24
      backends/twitter/Requests/DestroyFriendRequest.h
  65. 25
      backends/twitter/Requests/DirectMessageRequest.cpp
  66. 21
      backends/twitter/Requests/DirectMessageRequest.h
  67. 39
      backends/twitter/Requests/FetchFriends.cpp
  68. 24
      backends/twitter/Requests/FetchFriends.h
  69. 48
      backends/twitter/Requests/HelpMessageRequest.cpp
  70. 21
      backends/twitter/Requests/HelpMessageRequest.h
  71. 19
      backends/twitter/Requests/OAuthFlow.cpp
  72. 21
      backends/twitter/Requests/OAuthFlow.h
  73. 60
      backends/twitter/Requests/PINExchangeProcess.cpp
  74. 21
      backends/twitter/Requests/PINExchangeProcess.h
  75. 14
      backends/twitter/Requests/ProfileImageRequest.cpp
  76. 38
      backends/twitter/Requests/ProfileImageRequest.h
  77. 12
      backends/twitter/Requests/RetweetRequest.cpp
  78. 18
      backends/twitter/Requests/RetweetRequest.h
  79. 17
      backends/twitter/Requests/StatusUpdateRequest.cpp
  80. 20
      backends/twitter/Requests/StatusUpdateRequest.h
  81. 27
      backends/twitter/Requests/TimelineRequest.cpp
  82. 23
      backends/twitter/Requests/TimelineRequest.h
  83. 648
      backends/twitter/TwitterPlugin.cpp
  84. 316
      backends/twitter/TwitterPlugin.h
  85. 193
      backends/twitter/TwitterResponseParser.cpp
  86. 488
      backends/twitter/TwitterResponseParser.h
  87. 19
      backends/twitter/libtwitcurl/HMAC_SHA1.cpp
  88. 72
      backends/twitter/libtwitcurl/HMAC_SHA1.h
  89. 290
      backends/twitter/libtwitcurl/SHA1.cpp
  90. 80
      backends/twitter/libtwitcurl/SHA1.h
  91. 172
      backends/twitter/libtwitcurl/base64.cpp
  92. 4
      backends/twitter/libtwitcurl/base64.h
  93. 1164
      backends/twitter/libtwitcurl/oauthlib.cpp
  94. 121
      backends/twitter/libtwitcurl/oauthlib.h
  95. 4380
      backends/twitter/libtwitcurl/twitcurl.cpp
  96. 140
      backends/twitter/libtwitcurl/twitcurl.dsp
  97. 344
      backends/twitter/libtwitcurl/twitcurl.h
  98. 37
      backends/twitter/libtwitcurl/twitcurl.plg
  99. 347
      backends/twitter/libtwitcurl/twitcurl.vcproj
  100. 286
      backends/twitter/libtwitcurl/twitcurlurls.h
  101. Some files were not shown because too many files have changed in this diff Show More

5
.clang-format

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
BasedOnStyle: Microsoft
AlignAfterOpenBracket: Align
BreakBeforeBraces: Attach
NamespaceIndentation: None
UseTab: ForIndentation

42
.travis.yml

@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
language: cpp
matrix:
include:
- os: linux
dist: xenial
- os: osx
osx_image: xcode10.1
addons:
homebrew:
packages:
- cppunit
- log4cxx
- popt
- jsoncpp
- libswiften
- protobuf
update: true
apt:
sources:
- sourceline: 'deb https://packages.spectrum.im/spectrum2/ xenial main'
key_url: 'https://packages.spectrum.im/packages.key'
- sourceline: 'deb https://swift.im/packages/ubuntu/xenial release main'
key_url: 'https://swift.im/keys/packages.key'
- sourceline: 'deb https://packages.prosody.im/debian xenial main'
key_url: 'https://prosody.im/files/prosody-debian-packages.key'
packages:
- git cmake prosody ngircd python-dateutil python-sleekxmpp libswiften-dev libprotobuf-dev protobuf-compiler libpurple-dev libglib2.0-dev libdbus-glib-1-dev liblog4cxx10-dev libpopt-dev libboost-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-locale-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-date-time-dev libcppunit-dev libcommuni-dev libminiupnpc-dev libnatpmp-dev libssl-dev libcurl4-openssl-dev libidn11-dev libxml2-dev libsqlite3-dev libqt4-dev libjsoncpp-dev libsasl2-modules-gssapi-mit libpurple-xmpp-carbons1
update: true
before_script:
sudo systemctl disable prosody;
sudo service prosody stop;
sudo rm /usr/include/mysql/plugin.h;
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON .;
make;
script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
make test;
else
make extended_test;
fi
notifications:
slack: spectrum2:CIlYHtxGMAaxs3qVHfwBzCuy

196
CMakeLists.txt

@ -2,51 +2,31 @@ cmake_minimum_required(VERSION 2.6) @@ -2,51 +2,31 @@ cmake_minimum_required(VERSION 2.6)
project(libtransport)
if(${CMAKE_MAJOR_VERSION} GREATER 2)
cmake_policy(SET CMP0037 OLD)
endif()
include(CPack)
message(STATUS "Variables to override default places where to find libraries:")
message(STATUS "|- cppunit : -DCPPUNIT_INCLUDE_DIR, -DCPPUNIT_LIBRARY")
message(STATUS "|- swiften : -DSWIFTEN_INCLUDE_DIR, -DSWIFTEN_LIBRARY")
message(STATUS " |- zlib : -DZLIB_LIBRARY")
message(STATUS " |- expat : -DEXPAT_LIBRARY")
message(STATUS " |-libidn : -DLIBIDN_LIBRARY")
message(STATUS " |-libxml : -DLIBXML_LIBRARY")
message(STATUS "|- boost : -DBOOST_INCLUDEDIR, -DBOOST_LIBRARYDIR")
message(STATUS "|- protobuf: -DPROTOBUF_INCLUDE_DIR, -DPROTOBUF_LIBRARY")
message(STATUS " : -DPROTOBUF_PROTOC_EXECUTABLE")
message(STATUS "|- log4cxx : -DLOG4CXX_INCLUDE_DIR, -DLOG4CXX_LIBRARY")
message(STATUS "|- purple : -DPURPLE_INCLUDE_DIR, -DPURPLE_LIBRARY")
message(STATUS " : -DPURPLE_NOT_RUNTIME - enables compilation with libpurple.lib")
option(ENABLE_QT4 "Build with Qt4 instead of Qt5" ON)
message(STATUS "cppunit : -DCPPUNIT_INCLUDE_DIR, -DCPPUNIT_LIBRARY")
message(STATUS "swiften : -DSWIFTEN_INCLUDE_DIR, -DSWIFTEN_LIBRARY")
message(STATUS "zlib : -DZLIB_LIBRARY")
message(STATUS "expat : -DEXPAT_LIBRARY")
message(STATUS "libidn : -DLIBIDN_LIBRARY")
message(STATUS "libxml : -DLIBXML_LIBRARY")
message(STATUS "boost : -DBOOST_INCLUDEDIR, -DBOOST_LIBRARYDIR")
message(STATUS "protobuf: -DPROTOBUF_INCLUDE_DIR, -DPROTOBUF_LIBRARY")
message(STATUS " | -DPROTOBUF_PROTOC_EXECUTABLE")
message(STATUS "log4cxx : -DLOG4CXX_INCLUDE_DIR, -DLOG4CXX_LIBRARY")
message(STATUS "purple : -DPURPLE_INCLUDE_DIR, -DPURPLE_LIBRARY")
message(STATUS " | -DPURPLE_NOT_RUNTIME - enables compilation with libpurple.lib")
option(ENABLE_SQLITE3 "Build with SQLite3 support" ON)
option(ENABLE_MYSQL "Build with MySQL support" ON)
option(ENABLE_PQXX "Build with Postgres supoort" ON)
option(ENABLE_FROTZ "Build Frotz plugin" ON)
option(ENABLE_IRC "Build IRC plugin" ON)
option(ENABLE_PURPLE "Build Libpurple plugin" ON)
option(ENABLE_SMSTOOLS3 "Build SMSTools3 plugin" ON)
option(ENABLE_XMPP "Build XMPP plugin" ON)
option(ENABLE_TWITTER "Build Twitter plugin" ON)
option(ENABLE_DOCS "Build Docs" ON)
# option(ENABLE_LOG "Build with logging using Log4cxx" ON)
option(ENABLE_TESTS "Build Tests using CppUnit" OFF)
macro(LIST_CONTAINS var value)
set(${var})
foreach(value2 ${ARGN})
if(${value} STREQUAL ${value2})
set(${var} TRUE)
endif(${value} STREQUAL ${value2})
endforeach(value2)
endmacro(LIST_CONTAINS)
if(NOT LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR "lib")
endif()
@ -59,37 +39,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules") @@ -59,37 +39,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules")
find_package(Swiften)
if(NOT SWIFTEN_FOUND)
if(ZLIB_LIBRARY)
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} ${ZLIB_LIBRARY})
endif()
if(EXPAT_LIBRARY)
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} ${EXPAT_LIBRARY})
endif()
if(LIBIDN_LIBRARY)
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} ${LIBIDN_LIBRARY})
endif()
if(LIBXML_LIBRARY)
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} ${LIBXML_LIBRARY})
endif()
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} "Dnsapi")
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} "Crypt32")
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} "Secur32")
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} "Iphlpapi")
set(SWIFTEN_LIBRARY ${SWIFTEN_LIBRARY} "Winscard")
message(STATUS "Using swiften: ${SWIFTEN_INCLUDE_DIR} ${SWIFTEN_LIBRARY}
Version: ${SWIFTEN_VERSION}")
endif()
# FIND BOOST
if(WIN32)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_ALL_NO_LIB)
endif(WIN32)
set(Boost_FIND_QUIETLY ON)
if("${SWIFTEN_VERSION}" STRGREATER "4")
@ -106,9 +56,7 @@ if(${Boost_VERSION} GREATER 104999) @@ -106,9 +56,7 @@ if(${Boost_VERSION} GREATER 104999)
endif()
# FIND POPT
if(NOT WIN32)
find_package(popt REQUIRED)
endif()
find_package(popt REQUIRED)
###### Database ######
@ -133,15 +81,7 @@ endif() @@ -133,15 +81,7 @@ endif()
if(ENABLE_PURPLE)
find_package(purple)
if(WIN32)
if(PURPLE_NOT_RUNTIME)
add_definitions(-DPURPLE_RUNTIME=0)
else(PURPLE_NOT_RUNTIME)
add_definitions(-DPURPLE_RUNTIME=1)
endif(PURPLE_NOT_RUNTIME)
else()
add_definitions(-DPURPLE_RUNTIME=0)
endif()
add_definitions(-DPURPLE_RUNTIME=0)
# FIND LIBEVENT
find_package(event)
@ -149,16 +89,9 @@ endif() @@ -149,16 +89,9 @@ endif()
# FIND GLIB
if(ENABLE_PURPLE)
# if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
# set(GLIB2_FOUND TRUE)
# else()
find_package(glib)
# endif()
find_package(glib)
endif()
# FIND LIBXML2
# find_package(libxml2)
# FIND PROTOBUF
find_package(Protobuf REQUIRED)
@ -178,52 +111,27 @@ if(JSONCPP_FOUND) @@ -178,52 +111,27 @@ if(JSONCPP_FOUND)
message(STATUS "Found jsoncpp: ${JSONCPP_INCLUDE_DIRS} ${JSONCPP_LIBRARY}, shared: ${JSONCPP_LIBRARY_IS_SHARED}")
endif()
if(WIN32)
add_definitions(-DSWIFTEN_STATIC=1)
add_definitions(-D_WIN32_WINNT=0x0600)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DBOOST_USE_WINDOWS_H)
add_definitions(-D_UNICODE)
add_definitions(-DUNICODE)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
find_package(openssl)
endif()
if(ENABLE_IRC)
find_package(Communi)
if(ENABLE_QT4)
include(FindQt4)
find_package(Qt4 COMPONENTS QtCore QtNetwork)
else()
find_package(Qt5 COMPONENTS Core Network)
endif()
# add_definitions(${SWIFTEN_CFLAGS})
add_definitions(-DSUPPORT_LEGACY_CAPS)
# add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
endif()
find_package(event)
####### Miscallanous ######
####### Miscellaneous ######
if(ENABLE_DOCS)
find_package(Doxygen)
endif()
# if(ENABLE_LOG)
if(LOG4CXX_INCLUDE_DIR AND LOG4CXX_LIBRARY)
set(LOG4CXX_LIBRARIES ${LOG4CXX_LIBRARY})
set(LOG4CXX_FOUND 1)
message(STATUS "Using log4cxx: ${CPPUNIT_INCLUDE_DIR} ${LOG4CXX_INCLUDE_DIR}")
else()
set(log4cxx_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
find_package(log4cxx)
endif()
# endif()
if(LOG4CXX_INCLUDE_DIR AND LOG4CXX_LIBRARY)
set(LOG4CXX_LIBRARIES ${LOG4CXX_LIBRARY})
set(LOG4CXX_FOUND 1)
message(STATUS "Using log4cxx: ${CPPUNIT_INCLUDE_DIR} ${LOG4CXX_INCLUDE_DIR}")
else()
set(log4cxx_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
find_package(log4cxx)
endif()
# FIND CPPUNIT
if(ENABLE_TESTS)
@ -262,13 +170,8 @@ message("Version : " ${SPECTRUM_VERSION}) @@ -262,13 +170,8 @@ message("Version : " ${SPECTRUM_VERSION})
if(SQLITE3_FOUND)
add_definitions(-DWITH_SQLITE)
if(WIN32)
include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/sqlite3")
message("SQLite3 : bundled")
else(WIN32)
include_directories(${SQLITE3_INCLUDE_DIR})
message("SQLite3 : yes")
endif(WIN32)
else(SQLITE3_FOUND)
set(SQLITE3_LIBRARIES "")
if(ENABLE_SQLITE3)
@ -332,43 +235,11 @@ if(PROTOBUF_FOUND) @@ -332,43 +235,11 @@ if(PROTOBUF_FOUND)
endif()
endif()
if(IRC_FOUND)
add_definitions(-DIRC_SHARED)
message("IRC plugin : yes")
include_directories(${QT_QTNETWORK_INCLUDE_DIR})
include_directories(${IRC_INCLUDE_DIR})
if(ENABLE_QT4)
include(${QT_USE_FILE})
endif()
else()
if(ENABLE_IRC)
message("IRC plugin : no (install libCommuni and libprotobuf-dev)")
else(ENABLE_IRC)
message("IRC plugin : no (user disabled)")
endif()
endif()
if(ENABLE_TWITTER)
message("Twitter plugin : yes")
else(ENABLE_TWITTER)
message("Twitter plugin : no (user disabled)")
endif()
if(NOT WIN32)
if(ENABLE_FROTZ)
message("Frotz plugin : yes")
else()
message("Frotz plugin : no (user disabled)")
endif()
if(ENABLE_SMSTOOLS3)
message("SMSTools3 plugin : yes")
else()
message("SMSTools3 plugin : no (user disabled)")
endif()
else()
message("Frotz plugin : no (does not run on Win32)")
message("SMSTools3 plugin : no (does not run on Win32)")
message("Skype plugin : no (does not run on Win32)")
endif()
if(ENABLE_XMPP)
message("Swiften plugin : yes")
@ -378,10 +249,6 @@ if(PROTOBUF_FOUND) @@ -378,10 +249,6 @@ if(PROTOBUF_FOUND)
else()
message("Network plugins : no (install libprotobuf-dev)")
message("Libpurple plugin : no (install libpurple and libprotobuf-dev)")
message("IRC plugin : no (install libircclient-qt and libprotobuf-dev)")
message("Frotz plugin : no (install libprotobuf-dev)")
message("SMSTools3 plugin : no (install libprotobuf-dev)")
message("Swiften plugin : no (install libprotobuf-dev)")
message("Twitter plugin : no (install libprotobuf-dev)")
endif()
@ -391,16 +258,9 @@ if(LOG4CXX_FOUND) @@ -391,16 +258,9 @@ if(LOG4CXX_FOUND)
add_definitions(-DWITH_LOG4CXX)
else()
set(LOG4CXX_LIBRARIES "")
if(WIN32)
message("Log4cxx : no (install log4cxx-devel)")
else()
message(FATAL_ERROR "Log4cxx : no (install log4cxx-devel)")
endif()
message(FATAL_ERROR "Log4cxx : no (install log4cxx-devel)")
endif()
if(WIN32)
add_definitions(-DLOG4CXX_STATIC)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
if(CMAKE_COMPILER_IS_GNUCXX)
@ -428,13 +288,9 @@ endif() @@ -428,13 +288,9 @@ endif()
add_subdirectory(libtransport)
add_subdirectory(plugin)
add_subdirectory(include)
add_subdirectory(spectrum)
add_subdirectory(src)
add_subdirectory(backends)
add_subdirectory(tests)
if(NOT WIN32)
add_subdirectory(spectrum_manager)
# add_subdirectory(spectrum2_send_message)
endif()
if(CPPUNIT_FOUND)
message("Tests : yes")

110
Dockerfile

@ -1,110 +0,0 @@ @@ -1,110 +0,0 @@
FROM fedora:27
EXPOSE 5222
VOLUME ["/etc/spectrum2/transports", "/var/lib/spectrum2"]
ARG commit=unknown
RUN echo $commit
# Spectrum 2
RUN dnf install ImageMagick protobuf swiften gcc gcc-c++ make libpqxx-devel libpurple-devel protobuf-devel swiften-devel rpm-build avahi-devel boost-devel cmake cppunit-devel expat-devel libcommuni-devel libidn-devel libsqlite3x-devel log4cxx-devel gettext libgcrypt-devel libwebp-devel libpurple-devel zlib-devel json-glib-devel python-pip zlib-devel libjpeg-devel python-devel mysql-devel popt-devel git libev-libevent-devel qt-devel dbus-glib-devel libcurl-devel wget mercurial libtool libgnome-keyring-devel nss-devel jsoncpp-devel purple-hangouts -y && \
echo "---> Installing Spectrum 2" && \
git clone git://github.com/hanzz/spectrum2.git && \
cd spectrum2 && \
./packaging/fedora/build_rpm.sh && \
rpm -U /root/rpmbuild/RPMS/x86_64/*.rpm && \
cp ./packaging/docker/run.sh /run.sh && \
cd .. && \
rm -rf spectrum2 && \
rm -rf ~/rpmbuild && \
dnf mark install json-glib
RUN echo "---> Installing purple-instagram" && \
git clone https://github.com/EionRobb/purple-instagram.git && \
cd purple-instagram && \
make && \
make install && \
cd .. && \
rm -rf purple-instagram
RUN echo "---> Installing icyque" && \
git clone git://github.com/EionRobb/icyque.git && \
cd icyque && \
make && \
make install && \
cd .. && \
rm -rf icyque
RUN echo "---> Installing purple-facebook" && \
wget https://github.com/dequis/purple-facebook/releases/download/v0.9.6/purple-facebook-0.9.6.tar.gz && \
tar -xf purple-facebook-0.9.6.tar.gz && \
cd purple-facebook-0.9.6 && \
./autogen.sh && \
./configure && \
make && \
make install && \
cd .. && \
rm -rf purple-facebook*
RUN echo "---> Installing skype4pidgin" && \
git clone git://github.com/EionRobb/skype4pidgin.git && \
cd skype4pidgin/skypeweb && \
make CFLAGS=-DFEDORA=1 && \
make install && \
cd ../.. && \
rm -rf skype4pidgin
RUN echo "---> Installing transwhat" && \
pip install --pre e4u six==1.10 protobuf python-dateutil yowsup Pillow==2.9.0 &&\
git clone git://github.com/stv0g/transwhat.git &&\
cd transwhat &&\
git checkout yowsup-3 &&\
python setup.py install &&\
cd .. &&\
rm -r transwhat
RUN echo "---> Installing Telegram" && \
git clone --recursive https://github.com/majn/telegram-purple && \
cd telegram-purple && \
./configure && \
make && \
make install && \
cd .. && \
rm -rf telegram-purple
RUN echo "---> Install Discord" && \
git clone https://github.com/EionRobb/purple-discord.git && \
cd purple-discord && \
make && \
make install && \
cd .. && \
rm -rf purple-discord
RUN echo "---> Install Steam" && \
git clone https://github.com/EionRobb/pidgin-opensteamworks.git && \
cd pidgin-opensteamworks/steam-mobile && \
make && \
make install && \
cd ../.. && \
rm -rf pidgin-opensteamworks
RUN echo "---> purple-gowhatsapp" && \
dnf -y install golang && \
git clone https://github.com/hoehermann/purple-gowhatsapp && \
cd purple-gowhatsapp && \
make && \
make install && \
cd .. && \
rm -rf purple-gowhatsapp && \
dnf -y remove golang
RUN echo "---> cleanup" && \
rm -rf /usr/share/locale/* && \
rm -rf /usr/share/doc/* && \
rm -rf /usr/share/icons/* && \
rm -rf /usr/share/cracklib* && \
rm -rf /usr/share/hwdata* && \
rm -rf /usr/lib64/libQtGui* && \
rm -rf /usr/lib64/libQtSvg* && \
rm -rf /usr/lib64/libQtDeclarative* && \
rm -rf /usr/lib64/libQtOpenGL* && \
rm -rf /usr/lib64/libQtScriptTools* && \
rm -rf /usr/lib64/libQtMultimedia* && \
rm -rf /usr/lib64/libQtHelp* && \
rm -rf /usr/lib64/libQtDesigner* && \
rm -rf /usr/lib64/libQt3* && \
dnf remove protobuf-devel swiften-devel gcc gcc-c++ libpqxx-devel libev-libevent-devel qt-devel dbus-glib-devel libpurple-devel rpm-build avahi-devel boost-devel cmake cppunit-devel expat-devel libcommuni-devel libidn-devel libsqlite3x-devel libgcrypt-devel libwebp-devel libpurple-devel zlib-devel json-glib-devel zlib-devel libjpeg-devel python-devel log4cxx-devel mysql-devel popt-devel libcurl-devel spectrum2-debuginfo wget -y && \
dnf clean all -y && \
rm -rf /var/lib/rpm/*
CMD "/run.sh"

23
appveyor.yml

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
version: 1.0.{build}
image: Visual Studio 2017
build_script:
- cmd: >-
curl -L -O https://packages.spectrum.im/deps32.zip
7z x deps32.zip
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
set PATH=%PATH%;C:\projects\spectrum2\deps32\bin
set CMAKE_PREFIX_PATH=C:\projects\spectrum2\deps32
cmake . -G "NMake Makefiles" -DENABLE_PURPLE=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX=dist
nmake
nmake install
nmake test
artifacts:
- path: dist

17
backends/CMakeLists.txt

@ -5,24 +5,7 @@ if(PROTOBUF_FOUND) @@ -5,24 +5,7 @@ if(PROTOBUF_FOUND)
add_subdirectory(libpurple)
endif()
if(IRC_FOUND)
add_subdirectory(libcommuni)
endif()
if(ENABLE_XMPP)
add_subdirectory(swiften)
endif()
if(ENABLE_TWITTER)
add_subdirectory(twitter)
endif()
if(NOT WIN32)
if(ENABLE_SMSTOOLS3)
add_subdirectory(smstools3)
endif()
if(ENABLE_FROTZ)
add_subdirectory(frotz)
endif()
endif()
endif()

11
backends/frotz/CMakeLists.txt

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
cmake_minimum_required(VERSION 2.6)
add_subdirectory(dfrotz)
file(GLOB SRC *.c *.cpp)
add_executable(spectrum2_frotz_backend ${SRC})
target_link_libraries(spectrum2_frotz_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES})
install(TARGETS spectrum2_frotz_backend RUNTIME DESTINATION bin)

9
backends/frotz/dfrotz/CMakeLists.txt

@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
cmake_minimum_required(VERSION 2.6)
file(GLOB SRC common/*.c dumb/*.c)
add_executable(dfrotz ${SRC})
# target_link_libraries(dfrotz)
install(TARGETS dfrotz RUNTIME DESTINATION bin)

2
backends/frotz/dfrotz/README

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
This is patched version of dfrotz. frotz_backend won't work with dfrotz from
your distribution.

154
backends/frotz/dfrotz/common/buffer.c

@ -1,154 +0,0 @@ @@ -1,154 +0,0 @@
/* buffer.c - Text buffering and word wrapping
* Copyright (c) 1995-1997 Stefan Jokisch
*
* This file is part of Frotz.
*
* Frotz 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.
*
* Frotz 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <string.h>
#include "frotz.h"
extern void stream_char (zchar);
extern void stream_word (const zchar *);
extern void stream_new_line (void);
static zchar buffer[TEXT_BUFFER_SIZE];
static int bufpos = 0;
static zchar prev_c = 0;
/*
* flush_buffer
*
* Copy the contents of the text buffer to the output streams.
*
*/
void flush_buffer (void)
{
static bool locked = FALSE;
/* Make sure we stop when flush_buffer is called from flush_buffer.
Note that this is difficult to avoid as we might print a newline
during flush_buffer, which might cause a newline interrupt, that
might execute any arbitrary opcode, which might flush the buffer. */
if (locked || bufpos == 0)
return;
/* Send the buffer to the output streams */
buffer[bufpos] = 0;
locked = TRUE;
stream_word (buffer);
#ifdef SPEECH_OUTPUT
os_speech_output(buffer);
#endif
locked = FALSE;
/* Reset the buffer */
bufpos = 0;
prev_c = 0;
}/* flush_buffer */
/*
* print_char
*
* High level output function.
*
*/
void print_char (zchar c)
{
static bool flag = FALSE;
if (message || ostream_memory || enable_buffering) {
if (!flag) {
/* Characters 0 and ZC_RETURN are special cases */
if (c == ZC_RETURN)
{ new_line (); return; }
if (c == 0)
return;
/* Flush the buffer before a whitespace or after a hyphen */
if (c == ' ' || c == ZC_INDENT || c == ZC_GAP || (prev_c == '-' && c != '-'))
flush_buffer ();
/* Set the flag if this is part one of a style or font change */
if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE)
flag = TRUE;
/* Remember the current character code */
prev_c = c;
} else flag = FALSE;
/* Insert the character into the buffer */
buffer[bufpos++] = c;
if (bufpos == TEXT_BUFFER_SIZE)
runtime_error (ERR_TEXT_BUF_OVF);
} else stream_char (c);
}/* print_char */
/*
* new_line
*
* High level newline function.
*
*/
void new_line (void)
{
flush_buffer (); stream_new_line ();
}/* new_line */
/*
* init_buffer
*
* Initialize buffer variables.
*
*/
void init_buffer(void)
{
memset(buffer, 0, sizeof (zchar) * TEXT_BUFFER_SIZE);
bufpos = 0;
prev_c = 0;
}

154
backends/frotz/dfrotz/common/err.c

@ -1,154 +0,0 @@ @@ -1,154 +0,0 @@
/* err.c - Runtime error reporting functions
* Written by Jim Dunleavy <jim.dunleavy@erha.ie>
*
* This file is part of Frotz.
*
* Frotz 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.
*
* Frotz 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "frotz.h"
/* Define stuff for stricter Z-code error checking, for the generic
Unix/DOS/etc terminal-window interface. Feel free to change the way
player prefs are specified, or replace report_zstrict_error()
completely if you want to change the way errors are reported. */
/* int err_report_mode = ERR_DEFAULT_REPORT_MODE; */
static int error_count[ERR_NUM_ERRORS];
static char *err_messages[] = {
"Text buffer overflow",
"Store out of dynamic memory",
"Division by zero",
"Illegal object",
"Illegal attribute",
"No such property",
"Stack overflow",
"Call to illegal address",
"Call to non-routine",
"Stack underflow",
"Illegal opcode",
"Bad stack frame",
"Jump to illegal address",
"Can't save while in interrupt",
"Nesting stream #3 too deep",
"Illegal window",
"Illegal window property",
"Print at illegal address",
"@jin called with object 0",
"@get_child called with object 0",
"@get_parent called with object 0",
"@get_sibling called with object 0",
"@get_prop_addr called with object 0",
"@get_prop called with object 0",
"@put_prop called with object 0",
"@clear_attr called with object 0",
"@set_attr called with object 0",
"@test_attr called with object 0",
"@move_object called moving object 0",
"@move_object called moving into object 0",
"@remove_object called with object 0",
"@get_next_prop called with object 0"
};
static void print_long (unsigned long value, int base);
/*
* init_err
*
* Initialise error reporting.
*
*/
void init_err (void)
{
int i;
/* Initialize the counters. */
for (i = 0; i < ERR_NUM_ERRORS; i++)
error_count[i] = 0;
}
/*
* runtime_error
*
* An error has occurred. Ignore it, pass it to os_fatal or report
* it according to err_report_mode.
*
* errnum : Numeric code for error (1 to ERR_NUM_ERRORS)
*
*/
void runtime_error (int errnum)
{
int wasfirst;
if (errnum <= 0 || errnum > ERR_NUM_ERRORS)
return;
if (f_setup.err_report_mode == ERR_REPORT_FATAL
|| (!f_setup.ignore_errors && errnum <= ERR_MAX_FATAL)) {
flush_buffer ();
os_fatal (err_messages[errnum - 1]);
return;
}
wasfirst = (error_count[errnum - 1] == 0);
error_count[errnum - 1]++;
if ((f_setup.err_report_mode == ERR_REPORT_ALWAYS)
|| (f_setup.err_report_mode == ERR_REPORT_ONCE && wasfirst)) {
long pc;
GET_PC (pc);
print_string ("Warning: ");
print_string (err_messages[errnum - 1]);
print_string (" (PC = ");
print_long (pc, 16);
print_char (')');
if (f_setup.err_report_mode == ERR_REPORT_ONCE) {
print_string (" (will ignore further occurrences)");
} else {
print_string (" (occurence ");
print_long (error_count[errnum - 1], 10);
print_char (')');
}
new_line ();
}
} /* report_error */
/*
* print_long
*
* Print an unsigned 32bit number in decimal or hex.
*
*/
static void print_long (unsigned long value, int base)
{
unsigned long i;
char c;
for (i = (base == 10 ? 1000000000 : 0x10000000); i != 0; i /= base)
if (value >= i || i == 1) {
c = (value / i) % base;
print_char (c + (c <= 9 ? '0' : 'a' - 10));
}
}/* print_long */

1115
backends/frotz/dfrotz/common/fastmem.c

File diff suppressed because it is too large Load Diff

566
backends/frotz/dfrotz/common/files.c

@ -1,566 +0,0 @@ @@ -1,566 +0,0 @@
/* files.c - Transscription, recording and playback
* Copyright (c) 1995-1997 Stefan Jokisch
*
* This file is part of Frotz.
*
* Frotz 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.
*
* Frotz 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include <stdio.h>
#include <string.h>
#include "frotz.h"
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
extern void set_more_prompts (bool);
extern bool is_terminator (zchar);
extern bool read_yes_or_no (const char *);
char script_name[MAX_FILE_NAME + 1] = DEFAULT_SCRIPT_NAME;
char command_name[MAX_FILE_NAME + 1] = DEFAULT_COMMAND_NAME;
#ifdef __MSDOS__
extern char latin1_to_ibm[];
#endif
static int script_width = 0;
static FILE *sfp = NULL;
static FILE *rfp = NULL;
static FILE *pfp = NULL;
/*
* script_open
*
* Open the transscript file. 'AMFV' makes this more complicated as it
* turns transscription on/off several times to exclude some text from
* the transscription file. This wasn't a problem for the original V4
* interpreters which always sent transscription to the printer, but it
* means a problem to modern interpreters that offer to open a new file
* every time transscription is turned on. Our solution is to append to
* the old transscription file in V1 to V4, and to ask for a new file
* name in V5+.
*
*/
void script_open (void)
{
static bool script_valid = FALSE;
char new_name[MAX_FILE_NAME + 1];
h_flags &= ~SCRIPTING_FLAG;
if (h_version >= V5 || !script_valid) {
if (!os_read_file_name (new_name, script_name, FILE_SCRIPT))
goto done;
strcpy (script_name, new_name);
}
/* Opening in "at" mode doesn't work for script_erase_input... */
if ((sfp = fopen (script_name, "r+t")) != NULL || (sfp = fopen (script_name, "w+t")) != NULL) {
fseek (sfp, 0, SEEK_END);
h_flags |= SCRIPTING_FLAG;
script_valid = TRUE;
ostream_script = TRUE;
script_width = 0;
} else print_string ("Cannot open file\n");
done:
SET_WORD (H_FLAGS, h_flags)
}/* script_open */
/*
* script_close
*
* Stop transscription.
*
*/
void script_close (void)
{
h_flags &= ~SCRIPTING_FLAG;
SET_WORD (H_FLAGS, h_flags)
fclose (sfp); ostream_script = FALSE;
}/* script_close */
/*
* script_new_line
*
* Write a newline to the transscript file.
*
*/
void script_new_line (void)
{
if (fputc ('\n', sfp) == EOF)
script_close ();
script_width = 0;
}/* script_new_line */
/*
* script_char
*
* Write a single character to the transscript file.
*
*/
void script_char (zchar c)
{
if (c == ZC_INDENT && script_width != 0)
c = ' ';
if (c == ZC_INDENT)
{ script_char (' '); script_char (' '); script_char (' '); return; }
if (c == ZC_GAP)
{ script_char (' '); script_char (' '); return; }
#ifdef __MSDOS__
if (c >= ZC_LATIN1_MIN)
c = latin1_to_ibm[c - ZC_LATIN1_MIN];
#endif
fputc (c, sfp); script_width++;
}/* script_char */
/*
* script_word
*
* Write a string to the transscript file.
*
*/
void script_word (const zchar *s)
{
int width;
int i;
if (*s == ZC_INDENT && script_width != 0)
script_char (*s++);
for (i = 0, width = 0; s[i] != 0; i++)
if (s[i] == ZC_NEW_STYLE || s[i] == ZC_NEW_FONT)
i++;
else if (s[i] == ZC_GAP)
width += 3;
else if (s[i] == ZC_INDENT)
width += 2;
else
width += 1;
if (f_setup.script_cols != 0 && script_width + width > f_setup.script_cols) {
if (*s == ' ' || *s == ZC_INDENT || *s == ZC_GAP)
s++;
script_new_line ();
}
for (i = 0; s[i] != 0; i++)
if (s[i] == ZC_NEW_FONT || s[i] == ZC_NEW_STYLE)
i++;
else
script_char (s[i]);
}/* script_word */
/*
* script_write_input
*
* Send an input line to the transscript file.
*
*/
void script_write_input (const zchar *buf, zchar key)
{
int width;
int i;
for (i = 0, width = 0; buf[i] != 0; i++)
width++;
if (f_setup.script_cols != 0 && script_width + width > f_setup.script_cols)
script_new_line ();
for (i = 0; buf[i] != 0; i++)
script_char (buf[i]);
if (key == ZC_RETURN)
script_new_line ();
}/* script_write_input */
/*
* script_erase_input
*
* Remove an input line from the transscript file.
*
*/
void script_erase_input (const zchar *buf)
{
int width;
int i;
for (i = 0, width = 0; buf[i] != 0; i++)
width++;
fseek (sfp, -width, SEEK_CUR); script_width -= width;
}/* script_erase_input */
/*
* script_mssg_on
*
* Start sending a "debugging" message to the transscript file.
*
*/
void script_mssg_on (void)
{
if (script_width != 0)
script_new_line ();
script_char (ZC_INDENT);
}/* script_mssg_on */
/*
* script_mssg_off
*
* Stop writing a "debugging" message.
*
*/
void script_mssg_off (void)
{
script_new_line ();
}/* script_mssg_off */
/*
* record_open
*
* Open a file to record the player's input.
*
*/
void record_open (void)
{
char new_name[MAX_FILE_NAME + 1];
if (os_read_file_name (new_name, command_name, FILE_RECORD)) {
strcpy (command_name, new_name);
if ((rfp = fopen (new_name, "wt")) != NULL)
ostream_record = TRUE;
else
print_string ("Cannot open file\n");
}
}/* record_open */
/*
* record_close
*
* Stop recording the player's input.
*
*/
void record_close (void)
{
fclose (rfp); ostream_record = FALSE;
}/* record_close */
/*
* record_code
*
* Helper function for record_char.
*
*/
static void record_code (int c, bool force_encoding)
{
if (force_encoding || c == '[' || c < 0x20 || c > 0x7e) {
int i;
fputc ('[', rfp);
for (i = 10000; i != 0; i /= 10)
if (c >= i || i == 1)
fputc ('0' + (c / i) % 10, rfp);
fputc (']', rfp);
} else fputc (c, rfp);
}/* record_code */
/*
* record_char
*
* Write a character to the command file.
*
*/
static void record_char (zchar c)
{
if (c != ZC_RETURN) {
if (c < ZC_HKEY_MIN || c > ZC_HKEY_MAX) {
record_code (translate_to_zscii (c), FALSE);
if (c == ZC_SINGLE_CLICK || c == ZC_DOUBLE_CLICK) {
record_code (mouse_x, TRUE);
record_code (mouse_y, TRUE);
}
} else record_code (1000 + c - ZC_HKEY_MIN, TRUE);
}
}/* record_char */
/*
* record_write_key
*
* Copy a keystroke to the command file.
*
*/
void record_write_key (zchar key)
{
record_char (key);
if (fputc ('\n', rfp) == EOF)
record_close ();
}/* record_write_key */
/*
* record_write_input
*
* Copy a line of input to a command file.
*
*/
void record_write_input (const zchar *buf, zchar key)
{
zchar c;
while ((c = *buf++) != 0)
record_char (c);
record_char (key);
if (fputc ('\n', rfp) == EOF)
record_close ();
}/* record_write_input */
/*
* replay_open
*
* Open a file of commands for playback.
*
*/
void replay_open (void)
{
char new_name[MAX_FILE_NAME + 1];
if (os_read_file_name (new_name, command_name, FILE_PLAYBACK)) {
strcpy (command_name, new_name);
if ((pfp = fopen (new_name, "rt")) != NULL) {
set_more_prompts (read_yes_or_no ("Do you want MORE prompts"));
istream_replay = TRUE;
} else print_string ("Cannot open file\n");
}
}/* replay_open */
/*
* replay_close
*
* Stop playback of commands.
*
*/
void replay_close (void)
{
set_more_prompts (TRUE);
fclose (pfp); istream_replay = FALSE;
}/* replay_close */
/*
* replay_code
*
* Helper function for replay_key and replay_line.
*
*/
static int replay_code (void)
{
int c;
if ((c = fgetc (pfp)) == '[') {
int c2;
c = 0;
while ((c2 = fgetc (pfp)) != EOF && c2 >= '0' && c2 <= '9')
c = 10 * c + c2 - '0';
return (c2 == ']') ? c : EOF;
} else return c;
}/* replay_code */
/*
* replay_char
*
* Read a character from the command file.
*
*/
static zchar replay_char (void)
{
int c;
if ((c = replay_code ()) != EOF) {
if (c != '\n') {
if (c < 1000) {
c = translate_from_zscii (c);
if (c == ZC_SINGLE_CLICK || c == ZC_DOUBLE_CLICK) {
mouse_x = replay_code ();
mouse_y = replay_code ();
}
return c;
} else return ZC_HKEY_MIN + c - 1000;
}
ungetc ('\n', pfp);
return ZC_RETURN;
} else return ZC_BAD;
}/* replay_char */
/*
* replay_read_key
*
* Read a keystroke from a command file.
*
*/
zchar replay_read_key (void)
{
zchar key;
key = replay_char ();
if (fgetc (pfp) != '\n') {
replay_close ();
return ZC_BAD;
} else return key;
}/* replay_read_key */
/*
* replay_read_input
*
* Read a line of input from a command file.
*
*/
zchar replay_read_input (zchar *buf)
{
zchar c;
for (;;) {
c = replay_char ();
if (c == ZC_BAD || is_terminator (c))
break;
*buf++ = c;
}
*buf = 0;
if (fgetc (pfp) != '\n') {
replay_close ();
return ZC_BAD;
} else return c;
}/* replay_read_input */

617
backends/frotz/dfrotz/common/frotz.h

@ -1,617 +0,0 @@ @@ -1,617 +0,0 @@
/*
* frotz.h
*
* Global declarations and definitions
*
*/
/* Unfortunately, frotz's bool definition conflicts with that of curses.
But since no os_* function uses it, it's safe to let the frotz core see
this definition, but have the unix port see the curses version. */
/* #include "../config.h" */
#ifndef __UNIX_PORT_FILE
#include <signal.h>
typedef int bool;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif /* __UNIX_PORT_FILE */
#include <stdio.h>