From 1a328c5f6c1d914703181fa5a4d14c196ecf7ef4 Mon Sep 17 00:00:00 2001 From: Paul Boersma Date: Sat, 11 Aug 2018 15:44:53 +0200 Subject: [PATCH] move melder --- Makefile | 8 +- dwsys/Makefile | 2 +- dwsys/NUM2.cpp | 1 - dwsys/NUM2.h | 3 +- dwtools/DataModeler.cpp | 1 - dwtools/praat_David_init.cpp | 2 +- external/mp3/mp3.h | 2 +- fon/Sound.cpp | 1 - fon/SpellingChecker.cpp | 2 +- fon/TextGrid.cpp | 2 +- fon/TimeSoundEditor.cpp | 2 +- fon/WordList.cpp | 2 +- fon/manual_Picture.cpp | 2 +- fon/manual_sound.cpp | 2 +- kar/longchar.h | 2 +- melder/Makefile | 8 +- melder/MelderGui.cpp | 6 +- melder/NUMinterpol.cpp | 2 +- melder/NUMmath.cpp | 2 +- melder/NUMspecfunc.cpp | 10 +-- melder/abcio.cpp | 1 - melder/abcio.h | 5 -- melder/melder.cpp | 9 +-- melder/melder.h | 143 +++++---------------------------- melder/melder_audio.cpp | 7 +- melder/melder_audio.h | 47 +++++++++++ melder/melder_audiofiles.cpp | 12 ++- melder/melder_debug.cpp | 6 +- melder/melder_files.cpp | 3 +- melder/melder_quantity.h | 33 ++++++++ melder/melder_readText.h | 80 ++++++++++++++++++ melder/melder_readtext.cpp | 3 +- melder/melder_strings.cpp | 2 +- melder/melder_sysenv.h | 26 ++++++ melder/melder_textencoding.cpp | 6 +- melder/melder_textencoding.h | 1 - melder/melder_vector.h | 98 ++++++++++++++++++++-- melder/melder_writeText.h | 24 ++++++ melder/melder_writetext.cpp | 5 +- melder/tensor.cpp | 23 +++++- melder/tensor.h | 4 +- stat/LogisticRegression.cpp | 2 +- stat/praat_Stat.cpp | 2 +- sys/DemoEditor.cpp | 2 +- sys/Formula.cpp | 4 +- sys/Graphics.h | 2 +- sys/Graphics_text.cpp | 4 +- sys/GuiShell.cpp | 2 +- sys/GuiWindow.cpp | 2 +- sys/Interpreter.cpp | 2 +- sys/Makefile | 9 ++- sys/ManPages.cpp | 2 +- sys/ScriptEditor.cpp | 2 +- sys/Strings.cpp | 2 +- sys/TextEditor.cpp | 4 +- sys/Thing.h | 5 +- sys/Ui.cpp | 2 +- sys/praat.cpp | 2 +- sys/praat_actions.cpp | 2 +- 59 files changed, 422 insertions(+), 230 deletions(-) create mode 100644 melder/melder_quantity.h create mode 100644 melder/melder_readText.h create mode 100644 melder/melder_sysenv.h create mode 100644 melder/melder_writeText.h diff --git a/Makefile b/Makefile index 9e3de056c..500f7d140 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # File: Makefile # Makefile for Praat. -# Paul Boersma, 22 October 2016 +# Paul Boersma, 11 August 2018 # System-dependent definitions of CC, LIBS, ICON and MAIN_ICON should be in # makefile.defs, which has to be copied and renamed @@ -20,7 +20,7 @@ all: $(MAKE) -C external/portaudio $(MAKE) -C external/espeak $(MAKE) -C kar - $(MAKE) -C num + $(MAKE) -C melder $(MAKE) -C sys $(MAKE) -C dwsys $(MAKE) -C stat @@ -38,7 +38,7 @@ all: FFNet/libFFNet.a gram/libgram.a EEG/libEEG.a \ LPC/libLPC.a dwtools/libdwtools.a \ fon/libfon.a stat/libstat.a dwsys/libdwsys.a \ - sys/libsys.a num/libnum.a kar/libkar.a \ + sys/libsys.a melder/libmelder.a sys/libsys.a kar/libkar.a \ external/espeak/libespeak.a \ external/portaudio/libportaudio.a \ external/flac/libflac.a external/mp3/libmp3.a \ @@ -53,7 +53,7 @@ clean: $(MAKE) -C external/portaudio clean $(MAKE) -C external/espeak clean $(MAKE) -C kar clean - $(MAKE) -C num clean + $(MAKE) -C melder clean $(MAKE) -C sys clean $(MAKE) -C dwsys clean $(MAKE) -C stat clean diff --git a/dwsys/Makefile b/dwsys/Makefile index 3e343681e..2eef5dbc9 100644 --- a/dwsys/Makefile +++ b/dwsys/Makefile @@ -16,7 +16,7 @@ OBJECTS = Collection_extensions.o Command.o \ NUMf2c.o NUMcblas.o NUMclapack.o NUMcomplex.o NUMfft_d.o NUMsort2.o \ NUMmathlib.o NUMstring.o \ Permutation.o Permutation_and_Index.o \ - regularExp.o SimpleVector.o \ + SimpleVector.o \ SVD.o .PHONY: all clean diff --git a/dwsys/NUM2.cpp b/dwsys/NUM2.cpp index dfc4bcab4..1bd013cc7 100644 --- a/dwsys/NUM2.cpp +++ b/dwsys/NUM2.cpp @@ -76,7 +76,6 @@ #include "gsl_sf_trig.h" #include "gsl_poly.h" #include "gsl_cdf.h" -#include "tensor.h" #undef MAX #undef MIN diff --git a/dwsys/NUM2.h b/dwsys/NUM2.h index 428ea1fe1..fe9b4f19a 100644 --- a/dwsys/NUM2.h +++ b/dwsys/NUM2.h @@ -24,8 +24,7 @@ */ #include -#include "melder.h" -#include "regularExp.h" +#include "../melder/melder.h" /* machine precision */ #define NUMeps 2.2e-16 diff --git a/dwtools/DataModeler.cpp b/dwtools/DataModeler.cpp index de13593ee..b6fe3b119 100644 --- a/dwtools/DataModeler.cpp +++ b/dwtools/DataModeler.cpp @@ -27,7 +27,6 @@ #include "Strings_extensions.h" #include "Sound_and_LPC_robust.h" #include "Table_extensions.h" -#include "tensor.h" #include "oo_DESTROY.h" #include "DataModeler_def.h" diff --git a/dwtools/praat_David_init.cpp b/dwtools/praat_David_init.cpp index 4d2efded4..489d2c8e2 100644 --- a/dwtools/praat_David_init.cpp +++ b/dwtools/praat_David_init.cpp @@ -3838,7 +3838,7 @@ DO /**************** Ltas *******************************************/ -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" FORM (INFO_Ltas_reportSpectralTilt, U"Ltas: Report spectral tilt", nullptr) { POSITIVE (fromFrequency, U"left Frequency range (Hz)", U"100.0") POSITIVE (toFrequency, U"right Frequency range (Hz)", U"5000.0") diff --git a/external/mp3/mp3.h b/external/mp3/mp3.h index a54853322..f2fef397c 100644 --- a/external/mp3/mp3.h +++ b/external/mp3/mp3.h @@ -19,7 +19,7 @@ * along with this work. If not, see . */ -#include "melder.h" // for integer +#include "../../melder/melder.h" // for integer /* The following function is used to identify MP3 files */ int mp3_recognize (int nread, const char *data); diff --git a/fon/Sound.cpp b/fon/Sound.cpp index 4b47970d5..b392e23b6 100644 --- a/fon/Sound.cpp +++ b/fon/Sound.cpp @@ -25,7 +25,6 @@ #include "Sound.h" #include "Sound_extensions.h" #include "NUM2.h" -#include "tensor.h" #include "enums_getText.h" #include "Sound_enums.h" diff --git a/fon/SpellingChecker.cpp b/fon/SpellingChecker.cpp index ab5bf6b00..cb95f0db5 100644 --- a/fon/SpellingChecker.cpp +++ b/fon/SpellingChecker.cpp @@ -38,7 +38,7 @@ #include "oo_DESCRIPTION.h" #include "SpellingChecker_def.h" -#include "longchar.h" +#include "../kar/longchar.h" Thing_implement (SpellingChecker, Daata, 0); diff --git a/fon/TextGrid.cpp b/fon/TextGrid.cpp index d891ac7c7..1a9e95c15 100644 --- a/fon/TextGrid.cpp +++ b/fon/TextGrid.cpp @@ -17,7 +17,7 @@ */ #include "TextGrid.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "oo_DESTROY.h" #include "TextGrid_def.h" diff --git a/fon/TimeSoundEditor.cpp b/fon/TimeSoundEditor.cpp index 0e129279f..889bf0335 100644 --- a/fon/TimeSoundEditor.cpp +++ b/fon/TimeSoundEditor.cpp @@ -19,7 +19,7 @@ #include "NUM2.h" #include "TimeSoundEditor.h" #include "EditorM.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #include "enums_getText.h" #include "TimeSoundEditor_enums.h" diff --git a/fon/WordList.cpp b/fon/WordList.cpp index 128a036ad..ba7938c05 100644 --- a/fon/WordList.cpp +++ b/fon/WordList.cpp @@ -17,7 +17,7 @@ */ #include "WordList.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "oo_DESTROY.h" #include "WordList_def.h" diff --git a/fon/manual_Picture.cpp b/fon/manual_Picture.cpp index d903c3e03..7613bc0c4 100644 --- a/fon/manual_Picture.cpp +++ b/fon/manual_Picture.cpp @@ -17,7 +17,7 @@ */ #include "ManPagesM.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" static void drawOneIpaSymbol (Graphics g, double x, double y, conststring32 symbol) { char32 buffer [30], *p = & buffer [0]; diff --git a/fon/manual_sound.cpp b/fon/manual_sound.cpp index ff156ea28..8026eb1a3 100644 --- a/fon/manual_sound.cpp +++ b/fon/manual_sound.cpp @@ -19,7 +19,7 @@ #include "ManPagesM.h" #include "Sound.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" static void draw_SoundDeepen_filter (Graphics g) { try { diff --git a/kar/longchar.h b/kar/longchar.h index 9423b6d4a..eac41574a 100644 --- a/kar/longchar.h +++ b/kar/longchar.h @@ -18,7 +18,7 @@ * along with this work. If not, see . */ -#include "melder.h" +#include "../melder/melder.h" /********** NON-ASCII CHARACTERS **********/ diff --git a/melder/Makefile b/melder/Makefile index c938711aa..c06d4e5f3 100644 --- a/melder/Makefile +++ b/melder/Makefile @@ -1,16 +1,16 @@ # Makefile of the library "melder" -# Paul Boersma, 10 August 2018 +# Paul Boersma, 11 August 2018 include ../makefile.defs -CPPFLAGS = -I ../external/gsl -I ../external/glpk -I ../kar -I ../sys -I ../dwsys +CPPFLAGS = -I ../melder OBJECTS = melder.o complex.o melder_alloc.o \ melder_ftoa.o melder_console.o melder_textencoding.o melder_atof.o melder_files.o \ melder_vector.o melder_sort.o melder_debug.o melder_strings.o melder_token.o \ melder_info.o melder_error.o melder_time.o \ melder_audio.o melder_audiofiles.o melder_quantity.o melder_readtext.o melder_writetext.o \ - abcio.o MelderGui.o melder_sysenv.o \ + abcio.o MelderGui.o melder_sysenv.o regularExp.o \ tensor.o \ NUMmath.o \ NUMspecfunc.o NUMear.o NUMinterpol.o NUMmetrics.o NUMrandom.o NUMfilter.o NUMlinprog.o \ @@ -30,4 +30,4 @@ libmelder.a: $(OBJECTS) $(AR) cq libmelder.a $(OBJECTS) $(RANLIB) libmelder.a -$(OBJECTS): ../external/gsl/*.h ../external/glpk/*.h ../kar/*.h ../sys/*.h ../dwsys/*.h +$(OBJECTS): ../kar/*.h ../sys/*.h ../dwsys/*.h diff --git a/melder/MelderGui.cpp b/melder/MelderGui.cpp index 28826d3c4..9a97d9696 100644 --- a/melder/MelderGui.cpp +++ b/melder/MelderGui.cpp @@ -21,13 +21,13 @@ //#include #include -#include "melder.h" #ifdef _WIN32 #include #endif -#include "Graphics.h" -#include "Gui.h" +#include "melder.h" +#include "../sys/Graphics.h" +#include "../sys/Gui.h" /********** Exported variable. **********/ diff --git a/melder/NUMinterpol.cpp b/melder/NUMinterpol.cpp index f7031a17e..ae4a40a26 100644 --- a/melder/NUMinterpol.cpp +++ b/melder/NUMinterpol.cpp @@ -26,7 +26,7 @@ */ #include "melder.h" -#include "NUM2.h" +#include "../dwsys/NUM2.h" #define SIGN(x,s) ((s) < 0 ? -fabs (x) : fabs(x)) #define NUM_interpolate_simple_cases \ diff --git a/melder/NUMmath.cpp b/melder/NUMmath.cpp index 76b4b76fa..bac4684c8 100644 --- a/melder/NUMmath.cpp +++ b/melder/NUMmath.cpp @@ -30,7 +30,7 @@ double NUMpow (double base, double exponent) { return base <= 0.0 ? 0.0 : pow (base, exponent); } -#include "gsl_errno.h" +#include "../external/gsl/gsl_errno.h" void NUMshift (double *x, double xfrom, double xto) { if (*x == xfrom) *x = xto; else *x += xto - xfrom; diff --git a/melder/NUMspecfunc.cpp b/melder/NUMspecfunc.cpp index 7c5512e97..0440a4ec1 100644 --- a/melder/NUMspecfunc.cpp +++ b/melder/NUMspecfunc.cpp @@ -30,12 +30,12 @@ */ #include "melder.h" -#include "NUM2.h" // NUMridders +#include "../dwsys/NUM2.h" // NUMridders -#include "gsl_errno.h" -#include "gsl_sf_bessel.h" -#include "gsl_sf_gamma.h" -#include "gsl_sf_erf.h" +#include "../external/gsl/gsl_errno.h" +#include "../external/gsl/gsl_sf_bessel.h" +#include "../external/gsl/gsl_sf_gamma.h" +#include "../external/gsl/gsl_sf_erf.h" double NUMlnGamma (double x) { gsl_sf_result result; diff --git a/melder/abcio.cpp b/melder/abcio.cpp index e10342a77..6821ba796 100644 --- a/melder/abcio.cpp +++ b/melder/abcio.cpp @@ -37,7 +37,6 @@ #ifdef macintosh #include #endif -#include "abcio.h" /********** text I/O **********/ diff --git a/melder/abcio.h b/melder/abcio.h index 365742228..bd1bbaca0 100644 --- a/melder/abcio.h +++ b/melder/abcio.h @@ -18,11 +18,6 @@ * along with this work. If not, see . */ -#include "complex.h" -#include "melder.h" - -#include "abcio_enums.h" - /* Numeric text input and output. */ int texgeti8 (MelderReadText text); diff --git a/melder/melder.cpp b/melder/melder.cpp index 11b6542cb..150c28a64 100644 --- a/melder/melder.cpp +++ b/melder/melder.cpp @@ -27,7 +27,7 @@ #include "macport_off.h" #endif -#include "MelderThread.h" +#include "../sys/MelderThread.h" #include "enums_getText.h" #include "melder_enums.h" @@ -36,10 +36,9 @@ /********** Exported variables. **********/ -//bool Melder_batch; // don't we have a GUI?- Set once at application start-up -//bool Melder_backgrounding; // are we running a script?- Set and unset dynamically -//bool Melder_asynchronous; -//int32 Melder_systemVersion; +bool Melder_batch; // don't we have a GUI?- Set once at application start-up +bool Melder_backgrounding; // are we running a script?- Set and unset dynamically +int32 Melder_systemVersion; static void defaultHelp (conststring32 query) { Melder_flushError (U"Don't know how to find help on \"", query, U"\"."); diff --git a/melder/melder.h b/melder/melder.h index fb21836b5..a09b597da 100644 --- a/melder/melder.h +++ b/melder/melder.h @@ -100,10 +100,11 @@ typedef struct { double red, green, blue, transparency; } double_rgbt; /********** SYSTEM VERSION **********/ -inline int32 Melder_systemVersion; /* For Macintosh, this is set in praat_init. + TODO: change to inline variable once C++17 is implemented completely on all platforms. */ +extern int32 Melder_systemVersion; /********** ENFORCE INTERACTIVE BEHAVIOUR **********/ @@ -114,9 +115,18 @@ void MelderGui_create (/* GuiWindow */ void *parent); 'parent' is the top-level widget returned by GuiAppInitialize. */ -inline bool Melder_batch; // true if run from the batch or from an interactive command-line interface -inline bool Melder_backgrounding; // true if running a script -inline bool Melder_asynchronous; // true if specified by the "asynchronous" directive in a script +/* + Set in praat_init. + True if run from the batch or from an interactive command-line interface. + TODO: change to inline variable once C++17 is implemented completely on all platforms. +*/ +extern bool Melder_batch; + +/* + True if running a script. + TODO: change to inline variable once C++17 is implemented completely on all platforms. +*/ +extern bool Melder_backgrounding; /********** OVERRIDE DEFAULT BEHAVIOUR **********/ @@ -136,79 +146,12 @@ void Melder_setMonitorProc (void * (*monitor) (double, conststring32)); void Melder_setErrorProc (void (*errorProc) (conststring32 message)); void Melder_setFatalProc (void (*fatalProc) (conststring32 message)); -#pragma mark - QUANTITY - -#define MelderQuantity_NONE 0 -#define MelderQuantity_TIME_SECONDS 1 -#define MelderQuantity_FREQUENCY_HERTZ 2 -#define MelderQuantity_FREQUENCY_BARK 3 -#define MelderQuantity_DISTANCE_FROM_GLOTTIS_METRES 4 -#define MelderQuantity_NUMBER_OF_QUANTITIES 4 -conststring32 MelderQuantity_getText (int quantity); // e.g. "Time" -conststring32 MelderQuantity_getWithUnitText (int quantity); // e.g. "Time (s)" -conststring32 MelderQuantity_getLongUnitText (int quantity); // e.g. "seconds" -conststring32 MelderQuantity_getShortUnitText (int quantity); // e.g. "s" - -#pragma mark - READING TEXT - -struct structMelderReadText { - autostring32 string32; - char32 *readPointer32; - autostring8 string8; - char *readPointer8; - kMelder_textInputEncoding input8Encoding; - structMelderReadText () : readPointer32 (nullptr), readPointer8 (nullptr) { - /* - Check that C++ default initialization has worked. - */ - Melder_assert (! our string32); - Melder_assert (! our string8); - } -}; -typedef struct structMelderReadText *MelderReadText; - -#if 1 - using autoMelderReadText = std::unique_ptr; -#else -struct autoMelderReadText { - MelderReadText text; - autoMelderReadText () { - our text = new structMelderReadText; - } - ~ autoMelderReadText () { - delete (our text); - } - MelderReadText operator-> () const { // as r-value - return our text; - } - MelderReadText get () const { - return our text; - } - autoMelderReadText (const autoMelderReadText&) = delete; // disable copy constructor - autoMelderReadText (autoMelderReadText&& other) noexcept { // enable move constructor - our text = other.text; - other.text = nullptr; - } - autoMelderReadText& operator= (const autoMelderReadText&) = delete; // disable copy assignment - autoMelderReadText& operator= (autoMelderReadText&& other) noexcept { // enable move assignment - if (& other != this) { - delete (our text); - our text = other.text; - other.text = nullptr; - } - return *this; - } - autoMelderReadText&& move () noexcept { return static_cast (*this); } - explicit operator bool () const { return !! our text; } -}; -#endif - -autoMelderReadText MelderReadText_createFromFile (MelderFile file); -char32 MelderReadText_getChar (MelderReadText text); -mutablestring32 MelderReadText_readLine (MelderReadText text); -int64 MelderReadText_getNumberOfLines (MelderReadText me); -conststring32 MelderReadText_getLineNumber (MelderReadText text); +#include "melder_quantity.h" +#include "melder_readText.h" +#include "melder_writeText.h" +#include "melder_sysenv.h" +#include "abcio_enums.h" #include "abcio.h" /* The following ANSI-C power trick generates the declarations of 88 functions. */ @@ -269,54 +212,6 @@ double ** NUMmatrix_readBinary_r64 (integer r1, integer r2, integer c1, integer Throw an error message if anything went wrong. */ -#pragma mark - MISCELLANEOUS - -conststring32 Melder_getenv (conststring32 variableName); -void Melder_system (conststring32 command); // spawn a system command -void Melder_execv (conststring32 executableFileName, integer narg, char32 **args); // spawn a subprocess - - - -class autoMelderAsynchronous { - bool _disowned; - bool _savedAsynchronicity; -public: - autoMelderAsynchronous () { - our _savedAsynchronicity = Melder_asynchronous; - Melder_asynchronous = true; - our _disowned = false; - } - ~autoMelderAsynchronous () { - if (! _disowned) { - Melder_asynchronous = _savedAsynchronicity; - } - } - /* - Disable copying. - */ - autoMelderAsynchronous (const autoMelderAsynchronous&) = delete; // disable copy constructor - autoMelderAsynchronous& operator= (const autoMelderAsynchronous&) = delete; // disable copy assignment - /* - Enable moving. - */ - autoMelderAsynchronous (autoMelderAsynchronous&& other) noexcept { // enable move constructor - our _disowned = other._disowned; - our _savedAsynchronicity = other._savedAsynchronicity; - other._disowned = true; - } - autoMelderAsynchronous& operator= (autoMelderAsynchronous&& other) noexcept { // enable move assignment - if (& other != this) { - our _disowned = other._disowned; - our _savedAsynchronicity = other._savedAsynchronicity; - other._disowned = true; // needed only if you insist on keeping the source in a valid state - } - return *this; - } - autoMelderAsynchronous&& move () noexcept { return static_cast (*this); } - void releaseToAmbiguousOwner () { - our _disowned = true; - } -}; //#define Melder_ENABLE_IF_ISA(A,B) , class = typename std::enable_if::value>::type #define Melder_ENABLE_IF_ISA(A,B) , class = typename std::enable_if_t::value> diff --git a/melder/melder_audio.cpp b/melder/melder_audio.cpp index 14d008e4e..8b4d84c56 100644 --- a/melder/melder_audio.cpp +++ b/melder/melder_audio.cpp @@ -41,11 +41,10 @@ #include #endif -#include "Gui.h" -#include "Preferences.h" #include "melder.h" #include - +#include "../sys/Gui.h" +#include "../sys/Preferences.h" #include "../external/portaudio/portaudio.h" #ifdef HAVE_PULSEAUDIO @@ -62,6 +61,8 @@ void pulseAudio_server_info_cb (pa_context *context, const pa_server_info *info, void *userdata); #endif +bool Melder_asynchronous; + static struct { enum kMelder_asynchronicityLevel maximumAsynchronicity; enum kMelder_inputSoundSystem inputSoundSystem; diff --git a/melder/melder_audio.h b/melder/melder_audio.h index 27a668000..fb10acc25 100644 --- a/melder/melder_audio.h +++ b/melder/melder_audio.h @@ -124,5 +124,52 @@ class autoMelderAudioSaveMaximumAsynchronicity { } }; +/* + True if specified by the "asynchronous" directive in a script. + TODO: change to inline variable once C++17 is implemented completely on all platforms. +*/ +extern bool Melder_asynchronous; + +class autoMelderAsynchronous { + bool _disowned; + bool _savedAsynchronicity; +public: + autoMelderAsynchronous () { + our _savedAsynchronicity = Melder_asynchronous; + Melder_asynchronous = true; + our _disowned = false; + } + ~autoMelderAsynchronous () { + if (! _disowned) { + Melder_asynchronous = _savedAsynchronicity; + } + } + /* + Disable copying. + */ + autoMelderAsynchronous (const autoMelderAsynchronous&) = delete; // disable copy constructor + autoMelderAsynchronous& operator= (const autoMelderAsynchronous&) = delete; // disable copy assignment + /* + Enable moving. + */ + autoMelderAsynchronous (autoMelderAsynchronous&& other) noexcept { // enable move constructor + our _disowned = other._disowned; + our _savedAsynchronicity = other._savedAsynchronicity; + other._disowned = true; + } + autoMelderAsynchronous& operator= (autoMelderAsynchronous&& other) noexcept { // enable move assignment + if (& other != this) { + our _disowned = other._disowned; + our _savedAsynchronicity = other._savedAsynchronicity; + other._disowned = true; // needed only if you insist on keeping the source in a valid state + } + return *this; + } + autoMelderAsynchronous&& move () noexcept { return static_cast (*this); } + void releaseToAmbiguousOwner () { + our _disowned = true; + } +}; + /* End of file melder_audio.h */ #endif diff --git a/melder/melder_audiofiles.cpp b/melder/melder_audiofiles.cpp index 838cb8eef..69bc88441 100644 --- a/melder/melder_audiofiles.cpp +++ b/melder/melder_audiofiles.cpp @@ -1,6 +1,6 @@ /* melder_audiofiles.cpp * - * Copyright (C) 1992-2008,2010-2017 Paul Boersma & David Weenink, 2007 Erez Volk (for FLAC) + * Copyright (C) 1992-2008,2010-2018 Paul Boersma & David Weenink, 2007 Erez Volk (for FLAC) * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,12 +17,10 @@ */ #include "melder.h" -#include "abcio.h" -#include "math.h" -#include "flac_FLAC_metadata.h" -#include "flac_FLAC_stream_decoder.h" -#include "flac_FLAC_stream_encoder.h" -#include "mp3.h" +#include "../external/flac/flac_FLAC_metadata.h" +#include "../external/flac/flac_FLAC_stream_decoder.h" +#include "../external/flac/flac_FLAC_stream_encoder.h" +#include "../external/mp3/mp3.h" /***** WRITING *****/ diff --git a/melder/melder_debug.cpp b/melder/melder_debug.cpp index da48c7cc1..2b240a5d7 100644 --- a/melder/melder_debug.cpp +++ b/melder/melder_debug.cpp @@ -18,12 +18,12 @@ #include "melder.h" #ifdef linux - #include "GuiP.h" + #include "../sys/GuiP.h" #endif #include -#include "praat_version.h" +#include "../sys/praat_version.h" #ifdef _WIN32 - #include "UnicodeData.h" + #include "../kar/UnicodeData.h" #include #endif diff --git a/melder/melder_files.cpp b/melder/melder_files.cpp index f5836a684..8ad76b2f4 100644 --- a/melder/melder_files.cpp +++ b/melder/melder_files.cpp @@ -57,7 +57,6 @@ #include "macport_off.h" #endif #include -#include "abcio.h" #include "melder.h" //#include "flac_FLAC_stream_encoder.h" @@ -68,7 +67,7 @@ extern "C" void FLAC__stream_encoder_delete (FLAC__StreamEncoder *); #include #define UNIX #include - #include "UnicodeData.h" + #include "../kar/UnicodeData.h" #endif static char32 theShellDirectory [kMelder_MAXPATH+1]; diff --git a/melder/melder_quantity.h b/melder/melder_quantity.h new file mode 100644 index 000000000..ad6f3ff0a --- /dev/null +++ b/melder/melder_quantity.h @@ -0,0 +1,33 @@ +#ifndef _melder_quantity_h_ +#define _melder_quantity_h_ +/* melder_quantity.h + * + * Copyright (C) 1992-2018 Paul Boersma + * + * This code 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 code 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 work. If not, see . + */ + +#define MelderQuantity_NONE 0 +#define MelderQuantity_TIME_SECONDS 1 +#define MelderQuantity_FREQUENCY_HERTZ 2 +#define MelderQuantity_FREQUENCY_BARK 3 +#define MelderQuantity_DISTANCE_FROM_GLOTTIS_METRES 4 +#define MelderQuantity_NUMBER_OF_QUANTITIES 4 +conststring32 MelderQuantity_getText (int quantity); // e.g. "Time" +conststring32 MelderQuantity_getWithUnitText (int quantity); // e.g. "Time (s)" +conststring32 MelderQuantity_getLongUnitText (int quantity); // e.g. "seconds" +conststring32 MelderQuantity_getShortUnitText (int quantity); // e.g. "s" + +/* End of file melder_quantity.h */ +#endif diff --git a/melder/melder_readText.h b/melder/melder_readText.h new file mode 100644 index 000000000..535cff25b --- /dev/null +++ b/melder/melder_readText.h @@ -0,0 +1,80 @@ +#ifndef _melder_readText_h_ +#define _melder_readText_h_ +/* melder_readText.h + * + * Copyright (C) 1992-2018 Paul Boersma + * + * This code 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 code 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 work. If not, see . + */ + +struct structMelderReadText { + autostring32 string32; + char32 *readPointer32; + autostring8 string8; + char *readPointer8; + kMelder_textInputEncoding input8Encoding; + structMelderReadText () : readPointer32 (nullptr), readPointer8 (nullptr) { + /* + Check that C++ default initialization has worked. + */ + Melder_assert (! our string32); + Melder_assert (! our string8); + } +}; +typedef struct structMelderReadText *MelderReadText; + +#if 1 + using autoMelderReadText = std::unique_ptr; +#else +struct autoMelderReadText { + MelderReadText text; + autoMelderReadText () { + our text = new structMelderReadText; + } + ~ autoMelderReadText () { + delete (our text); + } + MelderReadText operator-> () const { // as r-value + return our text; + } + MelderReadText get () const { + return our text; + } + autoMelderReadText (const autoMelderReadText&) = delete; // disable copy constructor + autoMelderReadText (autoMelderReadText&& other) noexcept { // enable move constructor + our text = other.text; + other.text = nullptr; + } + autoMelderReadText& operator= (const autoMelderReadText&) = delete; // disable copy assignment + autoMelderReadText& operator= (autoMelderReadText&& other) noexcept { // enable move assignment + if (& other != this) { + delete (our text); + our text = other.text; + other.text = nullptr; + } + return *this; + } + autoMelderReadText&& move () noexcept { return static_cast (*this); } + explicit operator bool () const { return !! our text; } +}; +#endif + +autoMelderReadText MelderReadText_createFromFile (MelderFile file); +char32 MelderReadText_getChar (MelderReadText text); +mutablestring32 MelderReadText_readLine (MelderReadText text); +int64 MelderReadText_getNumberOfLines (MelderReadText me); +conststring32 MelderReadText_getLineNumber (MelderReadText text); + +/* End of file melder_readText.h */ +#endif diff --git a/melder/melder_readtext.cpp b/melder/melder_readtext.cpp index 8c88483d9..56cb41cfb 100644 --- a/melder/melder_readtext.cpp +++ b/melder/melder_readtext.cpp @@ -17,8 +17,7 @@ */ #include "melder.h" -#include "UnicodeData.h" -#include "abcio.h" +#include "../kar/UnicodeData.h" char32 MelderReadText_getChar (MelderReadText me) { if (my string32) { diff --git a/melder/melder_strings.cpp b/melder/melder_strings.cpp index 077eedbbe..bafcc5e8a 100644 --- a/melder/melder_strings.cpp +++ b/melder/melder_strings.cpp @@ -17,7 +17,7 @@ */ #include "melder.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #define FREE_THRESHOLD_BYTES 10000LL static int64 totalNumberOfAllocations = 0, totalNumberOfDeallocations = 0, totalAllocationSize = 0, totalDeallocationSize = 0; diff --git a/melder/melder_sysenv.h b/melder/melder_sysenv.h new file mode 100644 index 000000000..b30f2ea97 --- /dev/null +++ b/melder/melder_sysenv.h @@ -0,0 +1,26 @@ +#ifndef _melder_sysenv_h_ +#define _melder_sysenv_h_ +/* melder_sysenv.h + * + * Copyright (C) 1992-2018 Paul Boersma + * + * This code 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 code 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 work. If not, see . + */ + +conststring32 Melder_getenv (conststring32 variableName); +void Melder_system (conststring32 command); // spawn a system command +void Melder_execv (conststring32 executableFileName, integer narg, char32 **args); // spawn a subprocess + +/* End of file melder_sysenv.h */ +#endif diff --git a/melder/melder_textencoding.cpp b/melder/melder_textencoding.cpp index 9e72c0349..7ee854f6d 100644 --- a/melder/melder_textencoding.cpp +++ b/melder/melder_textencoding.cpp @@ -17,10 +17,8 @@ */ #include "melder.h" -#include "Preferences.h" -#include "UnicodeData.h" -#include "abcio.h" -#include +#include "../sys/Preferences.h" +#include "../kar/UnicodeData.h" #if defined (macintosh) #include "macport_on.h" diff --git a/melder/melder_textencoding.h b/melder/melder_textencoding.h index b5021ccf3..7e15cbfd8 100644 --- a/melder/melder_textencoding.h +++ b/melder/melder_textencoding.h @@ -83,7 +83,6 @@ extern "C" conststring16 Melder_peek32to16 (conststring32 string); void Melder_str32To8bitFileRepresentation_inplace (conststring32 string, mutablestring8 utf8); void Melder_8bitFileRepresentationToStr32_inplace (conststring8 utf8, mutablestring32 string); const void * Melder_peek32toCfstring (conststring32 string); -void Melder_fwrite32to8 (conststring32 string, FILE *f); /* End of file melder_textencoding.h */ #endif diff --git a/melder/melder_vector.h b/melder/melder_vector.h index 6307882e3..e7fc98d32 100644 --- a/melder/melder_vector.h +++ b/melder/melder_vector.h @@ -320,10 +320,97 @@ class autoNUMmatrix { } */ -class autonumvec; // forward declaration, needed in the declaration of numvec - enum class kTensorInitializationType { RAW = 0, ZERO = 1 }; +template +class autovector; // forward declaration, needed in the declaration of vector<> + +template +class vector { +public: + T *at; + integer size; +public: + vector () = default; // for use in a union + vector (T *givenAt, integer givenSize): at (givenAt), size (givenSize) { } + vector (const vector& other) = default; + vector (const autovector& other) = delete; + vector& operator= (const vector&) = default; + vector& operator= (const autovector&) = delete; + T& operator[] (integer i) { + return our at [i]; + } + void reset () noexcept { // on behalf of ambiguous owners (otherwise this could be in autovector<>) + if (our at) { + our _freeAt (); + our at = nullptr; + } + our size = 0; + } +protected: + void _initAt (integer givenSize, kTensorInitializationType initializationType); + void _freeAt () noexcept; +}; +/* + An autovector is the sole owner of its payload, which is a vector. + When the autovector ends its life (goes out of scope), + it should destroy its payload (if it has not sold it), + because keeping a payload alive when the owner is dead + would continue to use some of the computer's resources (namely, memory). +*/ +template +class autovector : public vector { +public: + autovector (): vector (nullptr, 0) { } // come into existence without a payload + autovector (integer givenSize, kTensorInitializationType initializationType) { // come into existence and manufacture a payload + our _initAt (givenSize, initializationType); + our size = givenSize; + } + ~autovector () { // destroy the payload (if any) + if (our at) our vector::_freeAt (); + } + vector get () const { return { our at, our size }; } // let the public use the payload (they may change the values of the elements but not the at-pointer or the size) + void adoptFromAmbiguousOwner (vector given) { // buy the payload from a non-autovector + our reset(); + our at = given.at; + our size = given.size; + } + vector releaseToAmbiguousOwner () { // sell the payload to a non-autovector + T *oldAt = our at; + our at = nullptr; // disown ourselves, preventing automatic destruction of the payload + return { oldAt, our size }; + } + /* + Disable copying via construction or assignment (which would violate unique ownership of the payload). + */ + autovector (const autovector&) = delete; // disable copy constructor + autovector& operator= (const autovector&) = delete; // disable copy assignment + /* + Enable moving of temporaries or (for variables) via an explicit move(). + This implements buying a payload from another autovector (which involves destroying our current payload). + */ + autovector (autovector&& other) noexcept : vector { other.get() } { // enable move constructor for r-values (temporaries) + other.at = nullptr; // disown source + } + autovector& operator= (autovector&& other) noexcept { // enable move assignment for r-values (temporaries) + if (other.at != our at) { + if (our at) our _freeAt (); + our at = other.at; + our size = other.size; + other.at = nullptr; // disown source + other.size = 0; // needed only if you insist on keeping the source in a valid state + } + return *this; + } + autovector&& move () noexcept { return static_cast (*this); } // enable constriction and assignment for l-values (variables) via explicit move() +}; + +#if 1 + using numvec = vector ; + using autonumvec = autovector ; +#else +class autonumvec; // forward declaration, needed in the declaration of numvec + class numvec { public: double *at; @@ -349,9 +436,6 @@ class numvec { void _initAt (integer givenSize, kTensorInitializationType initializationType); void _freeAt () noexcept; }; - -#define empty_numvec numvec { nullptr, 0 } - /* An autonumvec is the sole owner of its payload, which is a numvec. When the autonumvec ends its life (goes out of scope), @@ -404,6 +488,10 @@ class autonumvec : public numvec { } autonumvec&& move () noexcept { return static_cast (*this); } // enable constriction and assignment for l-values (variables) via explicit move() }; +#endif + +#define empty_numvec numvec { nullptr, 0 } + class autonummat; // forward declaration, needed in the declaration of nummat diff --git a/melder/melder_writeText.h b/melder/melder_writeText.h new file mode 100644 index 000000000..96091a9fc --- /dev/null +++ b/melder/melder_writeText.h @@ -0,0 +1,24 @@ +#ifndef _melder_writeText_h_ +#define _melder_writeText_h_ +/* melder_writeText.h + * + * Copyright (C) 1992-2018 Paul Boersma + * + * This code 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 code 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 work. If not, see . + */ + +void Melder_fwrite32to8 (conststring32 string, FILE *f); + +/* End of file melder_writeText.h */ +#endif diff --git a/melder/melder_writetext.cpp b/melder/melder_writetext.cpp index a7e246ee5..865076062 100644 --- a/melder/melder_writetext.cpp +++ b/melder/melder_writetext.cpp @@ -17,9 +17,8 @@ */ #include "melder.h" -#include "Preferences.h" -#include "UnicodeData.h" -#include "abcio.h" +#include "../sys/Preferences.h" +#include "../kar/UnicodeData.h" void Melder_fwrite32to8 (conststring32 string, FILE *f) { /* diff --git a/melder/tensor.cpp b/melder/tensor.cpp index 08e90b88d..0242cd8a2 100644 --- a/melder/tensor.cpp +++ b/melder/tensor.cpp @@ -16,10 +16,30 @@ * along with this work. If not, see . */ -#include "tensor.h" +#include "melder.h" #include "../dwsys/NUM2.h" /* for NUMsort2 */ #include "PAIRWISE_SUM.h" +#if 1 +template +void vector :: _initAt (integer givenSize, kTensorInitializationType initializationType) { + Melder_assert (givenSize >= 0); + try { + our at = ( givenSize == 0 ? nullptr : NUMvector (1, givenSize, initializationType == kTensorInitializationType::ZERO) ); + } catch (MelderError) { + Melder_throw (U"Vector not created."); + } +} + +template +void vector :: _freeAt () noexcept { + if (our at) NUMvector_free (our at, 1); +} +template <> +void vector :: _freeAt () noexcept { + if (our at) NUMvector_free (our at, 1); +} +#else void numvec :: _initAt (integer givenSize, kTensorInitializationType initializationType) { Melder_assert (givenSize >= 0); try { @@ -32,6 +52,7 @@ void numvec :: _initAt (integer givenSize, kTensorInitializationType initializat void numvec :: _freeAt () noexcept { if (our at) NUMvector_free (our at, 1); } +#endif void nummat :: _initAt (integer givenNrow, integer givenNcol, kTensorInitializationType initializationType) { Melder_assert (givenNrow >= 0); diff --git a/melder/tensor.h b/melder/tensor.h index 0e2875bff..e7b09eccd 100644 --- a/melder/tensor.h +++ b/melder/tensor.h @@ -2,7 +2,7 @@ #define _tensor_h_ /* tensor.h * - * Copyright (C) 2017 Paul Boersma + * Copyright (C) 2017,2018 Paul Boersma * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +18,6 @@ * along with this work. If not, see . */ -#include "melder.h" - inline static double sqrt_scalar (double x) { #if defined (_WIN32) if (x < 0.0) return undefined; diff --git a/stat/LogisticRegression.cpp b/stat/LogisticRegression.cpp index 59294cc26..d8df95228 100644 --- a/stat/LogisticRegression.cpp +++ b/stat/LogisticRegression.cpp @@ -17,7 +17,7 @@ */ #include "LogisticRegression.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #include "oo_DESTROY.h" #include "LogisticRegression_def.h" diff --git a/stat/praat_Stat.cpp b/stat/praat_Stat.cpp index 89b42b946..5137552ff 100644 --- a/stat/praat_Stat.cpp +++ b/stat/praat_Stat.cpp @@ -22,7 +22,7 @@ #include "PairDistribution.h" #include "Table.h" #include "TableEditor.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #include "praat_TableOfReal.h" diff --git a/sys/DemoEditor.cpp b/sys/DemoEditor.cpp index 796de4dd7..e6f880d55 100644 --- a/sys/DemoEditor.cpp +++ b/sys/DemoEditor.cpp @@ -19,7 +19,7 @@ #include "DemoEditor.h" #include "machine.h" #include "praatP.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" Thing_implement (DemoEditor, Editor, 0); diff --git a/sys/Formula.cpp b/sys/Formula.cpp index 2e1c4641d..504a2d385 100644 --- a/sys/Formula.cpp +++ b/sys/Formula.cpp @@ -27,8 +27,8 @@ #include "Ui.h" #include "praatP.h" #include "praat_script.h" -#include "UnicodeData.h" -#include "longchar.h" +#include "../kar/UnicodeData.h" +#include "../kar/longchar.h" #include "UiPause.h" #include "DemoEditor.h" diff --git a/sys/Graphics.h b/sys/Graphics.h index 21c7d5ce6..a98377808 100644 --- a/sys/Graphics.h +++ b/sys/Graphics.h @@ -19,7 +19,7 @@ */ #include "Thing.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "Graphics_enums.h" diff --git a/sys/Graphics_text.cpp b/sys/Graphics_text.cpp index 1b3a59afc..a0a5cbe3e 100644 --- a/sys/Graphics_text.cpp +++ b/sys/Graphics_text.cpp @@ -17,9 +17,9 @@ */ #include -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #include "GraphicsP.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "Printer.h" extern const char * ipaSerifRegularPS []; diff --git a/sys/GuiShell.cpp b/sys/GuiShell.cpp index 10c68d267..1892db3c5 100644 --- a/sys/GuiShell.cpp +++ b/sys/GuiShell.cpp @@ -17,7 +17,7 @@ */ #include "GuiP.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" Thing_implement (GuiShell, GuiForm, 0); diff --git a/sys/GuiWindow.cpp b/sys/GuiWindow.cpp index 58e972372..79069a655 100644 --- a/sys/GuiWindow.cpp +++ b/sys/GuiWindow.cpp @@ -17,7 +17,7 @@ */ #include "GuiP.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #include "machine.h" #include diff --git a/sys/Interpreter.cpp b/sys/Interpreter.cpp index 69f1e13c1..9900f8547 100644 --- a/sys/Interpreter.cpp +++ b/sys/Interpreter.cpp @@ -23,7 +23,7 @@ extern structMelderDir praatDir; #include "praat_script.h" #include "Formula.h" #include "praat_version.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #include "../fon/Vector.h" diff --git a/sys/Makefile b/sys/Makefile index 4e8a75bb1..35ad84a55 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -1,9 +1,10 @@ # Makefile of the library "sys" -# Paul Boersma, 10 August 2018 +# Paul Boersma, 11 August 2018 include ../makefile.defs - -CPPFLAGS = -I ../kar -I ../melder -I ../sys -I ../external/portaudio -I ../external/flac -I ../external/mp3 + +# -I ../sys is there because e.g. Graphics.cpp include fon/Function.h, which again includes something from sys +CPPFLAGS = -I ../melder -I ../sys OBJECTS = Thing.o Data.o Simple.o Collection.o Strings.o \ Graphics.o Graphics_linesAndAreas.o Graphics_text.o Graphics_colour.o \ @@ -37,4 +38,4 @@ libsys.a: $(OBJECTS) $(AR) cq libsys.a $(OBJECTS) $(RANLIB) libsys.a -$(OBJECTS): *.h ../kar/*.h ../melder/*.h ../dwsys/*.h ../external/portaudio/*.h ../external/flac/*.h ../external/mp3/mp3.h +$(OBJECTS): *.h ../kar/*.h ../melder/*.h ../dwsys/*.h diff --git a/sys/ManPages.cpp b/sys/ManPages.cpp index c58f61852..bc33e79c1 100644 --- a/sys/ManPages.cpp +++ b/sys/ManPages.cpp @@ -18,7 +18,7 @@ #include #include "ManPages.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "Interpreter.h" #include "praat.h" diff --git a/sys/ScriptEditor.cpp b/sys/ScriptEditor.cpp index b7b02e682..a46e702e8 100644 --- a/sys/ScriptEditor.cpp +++ b/sys/ScriptEditor.cpp @@ -17,7 +17,7 @@ */ #include "ScriptEditor.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "praatP.h" #include "EditorM.h" diff --git a/sys/Strings.cpp b/sys/Strings.cpp index b92b7b87a..7f27260e7 100644 --- a/sys/Strings.cpp +++ b/sys/Strings.cpp @@ -38,7 +38,7 @@ #endif #include "Strings_.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "oo_DESTROY.h" #include "Strings_def.h" diff --git a/sys/TextEditor.cpp b/sys/TextEditor.cpp index 8d0c54e28..0725be9d9 100644 --- a/sys/TextEditor.cpp +++ b/sys/TextEditor.cpp @@ -18,9 +18,9 @@ #include "TextEditor.h" #include "machine.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "EditorM.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" Thing_implement (TextEditor, Editor, 0); diff --git a/sys/Thing.h b/sys/Thing.h index a6c972065..25ea01f9d 100644 --- a/sys/Thing.h +++ b/sys/Thing.h @@ -21,12 +21,9 @@ /* The root class of all objects. */ /* Anyone who uses Thing can also use: */ - /* The messaging mechanism, arrays with any bounds and 1 or 2 indices, math, and numerics: */ - #include "melder.h" /* Including stdio.h string.h math.h etc. */ + #include "melder.h" /* The macros for struct and class definitions: */ #include "oo.h" - /* The input/output mechanism: */ - #include "abcio.h" #define _Thing_auto_DEBUG 0 diff --git a/sys/Ui.cpp b/sys/Ui.cpp index ea6e3f3a0..671dd49bc 100644 --- a/sys/Ui.cpp +++ b/sys/Ui.cpp @@ -18,7 +18,7 @@ #include #include -#include "longchar.h" +#include "../kar/longchar.h" #include "machine.h" #include "GuiP.h" #include "Collection.h" diff --git a/sys/praat.cpp b/sys/praat.cpp index cf7c4146b..708a9b020 100644 --- a/sys/praat.cpp +++ b/sys/praat.cpp @@ -43,7 +43,7 @@ #include "Printer.h" #include "ScriptEditor.h" #include "Strings_.h" -#include "UnicodeData.h" +#include "../kar/UnicodeData.h" #if gtk #include diff --git a/sys/praat_actions.cpp b/sys/praat_actions.cpp index 3f7837c7a..7a8a57927 100644 --- a/sys/praat_actions.cpp +++ b/sys/praat_actions.cpp @@ -19,7 +19,7 @@ #include "praatP.h" #include "praat_script.h" #include "praat_version.h" -#include "longchar.h" +#include "../kar/longchar.h" #include "machine.h" #include "GuiP.h"